/*! For license information please see HOUSEPLAY.js.LICENSE.txt */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.HOUSEPLAY=e():t.HOUSEPLAY=e()}(window,(function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=77)}([function(t,e,i){"use strict";function n(){}i.r(e),i.d(e,"WebGLRenderTargetCube",(function(){return hi})),i.d(e,"WebGLRenderTarget",(function(){return ui})),i.d(e,"WebGLRenderer",(function(){return wo})),i.d(e,"ShaderLib",(function(){return Pi})),i.d(e,"UniformsLib",(function(){return Ai})),i.d(e,"UniformsUtils",(function(){return Mi})),i.d(e,"ShaderChunk",(function(){return gi})),i.d(e,"FogExp2",(function(){return xo})),i.d(e,"Fog",(function(){return Mo})),i.d(e,"Scene",(function(){return To})),i.d(e,"Sprite",(function(){return Po})),i.d(e,"LOD",(function(){return Co})),i.d(e,"SkinnedMesh",(function(){return Eo})),i.d(e,"Skeleton",(function(){return Do})),i.d(e,"Bone",(function(){return Lo})),i.d(e,"Mesh",(function(){return An})),i.d(e,"LineSegments",(function(){return Ro})),i.d(e,"LineLoop",(function(){return No})),i.d(e,"Line",(function(){return Io})),i.d(e,"Points",(function(){return Fo})),i.d(e,"Group",(function(){return ro})),i.d(e,"VideoTexture",(function(){return Bo})),i.d(e,"DataTexture",(function(){return ci})),i.d(e,"DataTexture3D",(function(){return zn})),i.d(e,"CompressedTexture",(function(){return zo})),i.d(e,"CubeTexture",(function(){return Bn})),i.d(e,"CanvasTexture",(function(){return Uo})),i.d(e,"DepthTexture",(function(){return Vo})),i.d(e,"Texture",(function(){return si})),i.d(e,"AnimationLoader",(function(){return Os})),i.d(e,"CompressedTextureLoader",(function(){return Is})),i.d(e,"DataTextureLoader",(function(){return Rs})),i.d(e,"CubeTextureLoader",(function(){return ks})),i.d(e,"TextureLoader",(function(){return Fs})),i.d(e,"ObjectLoader",(function(){return Ml})),i.d(e,"MaterialLoader",(function(){return yl})),i.d(e,"BufferGeometryLoader",(function(){return wl})),i.d(e,"DefaultLoadingManager",(function(){return Es})),i.d(e,"LoadingManager",(function(){return Cs})),i.d(e,"ImageLoader",(function(){return Ns})),i.d(e,"ImageBitmapLoader",(function(){return Ll})),i.d(e,"FontLoader",(function(){return Nl})),i.d(e,"FileLoader",(function(){return Ls})),i.d(e,"Loader",(function(){return kl})),i.d(e,"LoaderUtils",(function(){return bl})),i.d(e,"Cache",(function(){return Ps})),i.d(e,"AudioLoader",(function(){return Xl})),i.d(e,"SpotLightShadow",(function(){return hl})),i.d(e,"SpotLight",(function(){return cl})),i.d(e,"PointLight",(function(){return dl})),i.d(e,"RectAreaLight",(function(){return vl})),i.d(e,"HemisphereLight",(function(){return ll})),i.d(e,"DirectionalLightShadow",(function(){return fl})),i.d(e,"DirectionalLight",(function(){return ml})),i.d(e,"AmbientLight",(function(){return gl})),i.d(e,"LightShadow",(function(){return ul})),i.d(e,"Light",(function(){return sl})),i.d(e,"StereoCamera",(function(){return Zl})),i.d(e,"PerspectiveCamera",(function(){return ao})),i.d(e,"OrthographicCamera",(function(){return pl})),i.d(e,"CubeCamera",(function(){return Kl})),i.d(e,"ArrayCamera",(function(){return so})),i.d(e,"Camera",(function(){return oo})),i.d(e,"AudioListener",(function(){return Jl})),i.d(e,"PositionalAudio",(function(){return tu})),i.d(e,"AudioContext",(function(){return Yl})),i.d(e,"AudioAnalyser",(function(){return eu})),i.d(e,"Audio",(function(){return $l})),i.d(e,"VectorKeyframeTrack",(function(){return Ss})),i.d(e,"StringKeyframeTrack",(function(){return Ts})),i.d(e,"QuaternionKeyframeTrack",(function(){return Ms})),i.d(e,"NumberKeyframeTrack",(function(){return ws})),i.d(e,"ColorKeyframeTrack",(function(){return bs})),i.d(e,"BooleanKeyframeTrack",(function(){return ys})),i.d(e,"PropertyMixer",(function(){return iu})),i.d(e,"PropertyBinding",(function(){return yu})),i.d(e,"KeyframeTrack",(function(){return vs})),i.d(e,"AnimationUtils",(function(){return ds})),i.d(e,"AnimationObjectGroup",(function(){return bu})),i.d(e,"AnimationMixer",(function(){return xu})),i.d(e,"AnimationClip",(function(){return _s})),i.d(e,"Uniform",(function(){return Mu})),i.d(e,"InstancedBufferGeometry",(function(){return Tu})),i.d(e,"BufferGeometry",(function(){return nn})),i.d(e,"Geometry",(function(){return ji})),i.d(e,"InterleavedBufferAttribute",(function(){return _o})),i.d(e,"InstancedInterleavedBuffer",(function(){return Su})),i.d(e,"InterleavedBuffer",(function(){return So})),i.d(e,"InstancedBufferAttribute",(function(){return _u})),i.d(e,"Face3",(function(){return Di})),i.d(e,"Object3D",(function(){return Bi})),i.d(e,"Raycaster",(function(){return Au})),i.d(e,"Layers",(function(){return Oi})),i.d(e,"EventDispatcher",(function(){return n})),i.d(e,"Clock",(function(){return Ql})),i.d(e,"QuaternionLinearInterpolant",(function(){return xs})),i.d(e,"LinearInterpolant",(function(){return ms})),i.d(e,"DiscreteInterpolant",(function(){return gs})),i.d(e,"CubicInterpolant",(function(){return fs})),i.d(e,"Interpolant",(function(){return ps})),i.d(e,"Triangle",(function(){return Sn})),i.d(e,"Math",(function(){return Xe})),i.d(e,"Spherical",(function(){return Eu})),i.d(e,"Cylindrical",(function(){return Du})),i.d(e,"Plane",(function(){return fi})),i.d(e,"Frustum",(function(){return mi})),i.d(e,"Sphere",(function(){return pi})),i.d(e,"Ray",(function(){return Tn})),i.d(e,"Matrix4",(function(){return Ke})),i.d(e,"Matrix3",(function(){return $e})),i.d(e,"Box3",(function(){return di})),i.d(e,"Box2",(function(){return Lu})),i.d(e,"Line3",(function(){return Ou})),i.d(e,"Euler",(function(){return Li})),i.d(e,"Vector4",(function(){return li})),i.d(e,"Vector3",(function(){return Je})),i.d(e,"Vector2",(function(){return Ze})),i.d(e,"Quaternion",(function(){return Qe})),i.d(e,"Color",(function(){return Si})),i.d(e,"ImmediateRenderObject",(function(){return Iu})),i.d(e,"VertexNormalsHelper",(function(){return Ru})),i.d(e,"SpotLightHelper",(function(){return Nu})),i.d(e,"SkeletonHelper",(function(){return ku})),i.d(e,"PointLightHelper",(function(){return Fu})),i.d(e,"RectAreaLightHelper",(function(){return Bu})),i.d(e,"HemisphereLightHelper",(function(){return zu})),i.d(e,"GridHelper",(function(){return Uu})),i.d(e,"PolarGridHelper",(function(){return Vu})),i.d(e,"FaceNormalsHelper",(function(){return ju})),i.d(e,"DirectionalLightHelper",(function(){return Hu})),i.d(e,"CameraHelper",(function(){return Gu})),i.d(e,"BoxHelper",(function(){return Wu})),i.d(e,"Box3Helper",(function(){return qu})),i.d(e,"PlaneHelper",(function(){return Yu})),i.d(e,"ArrowHelper",(function(){return Xu})),i.d(e,"AxesHelper",(function(){return Zu})),i.d(e,"Shape",(function(){return al})),i.d(e,"Path",(function(){return ol})),i.d(e,"ShapePath",(function(){return Ol})),i.d(e,"Font",(function(){return Il})),i.d(e,"CurvePath",(function(){return rl})),i.d(e,"Curve",(function(){return Bs})),i.d(e,"ImageUtils",(function(){return oi})),i.d(e,"ShapeUtils",(function(){return Ea})),i.d(e,"WebGLUtils",(function(){return no})),i.d(e,"WireframeGeometry",(function(){return jo})),i.d(e,"ParametricGeometry",(function(){return Ho})),i.d(e,"ParametricBufferGeometry",(function(){return Go})),i.d(e,"TetrahedronGeometry",(function(){return Yo})),i.d(e,"TetrahedronBufferGeometry",(function(){return Xo})),i.d(e,"OctahedronGeometry",(function(){return Zo})),i.d(e,"OctahedronBufferGeometry",(function(){return Ko})),i.d(e,"IcosahedronGeometry",(function(){return Qo})),i.d(e,"IcosahedronBufferGeometry",(function(){return Jo})),i.d(e,"DodecahedronGeometry",(function(){return $o})),i.d(e,"DodecahedronBufferGeometry",(function(){return ta})),i.d(e,"PolyhedronGeometry",(function(){return Wo})),i.d(e,"PolyhedronBufferGeometry",(function(){return qo})),i.d(e,"TubeGeometry",(function(){return ea})),i.d(e,"TubeBufferGeometry",(function(){return ia})),i.d(e,"TorusKnotGeometry",(function(){return na})),i.d(e,"TorusKnotBufferGeometry",(function(){return ra})),i.d(e,"TorusGeometry",(function(){return oa})),i.d(e,"TorusBufferGeometry",(function(){return aa})),i.d(e,"TextGeometry",(function(){return ka})),i.d(e,"TextBufferGeometry",(function(){return Fa})),i.d(e,"SphereGeometry",(function(){return Ba})),i.d(e,"SphereBufferGeometry",(function(){return za})),i.d(e,"RingGeometry",(function(){return Ua})),i.d(e,"RingBufferGeometry",(function(){return Va})),i.d(e,"PlaneGeometry",(function(){return an})),i.d(e,"PlaneBufferGeometry",(function(){return sn})),i.d(e,"LatheGeometry",(function(){return ja})),i.d(e,"LatheBufferGeometry",(function(){return Ha})),i.d(e,"ShapeGeometry",(function(){return Ga})),i.d(e,"ShapeBufferGeometry",(function(){return Wa})),i.d(e,"ExtrudeGeometry",(function(){return Oa})),i.d(e,"ExtrudeBufferGeometry",(function(){return Ia})),i.d(e,"EdgesGeometry",(function(){return Ya})),i.d(e,"ConeGeometry",(function(){return Ka})),i.d(e,"ConeBufferGeometry",(function(){return Qa})),i.d(e,"CylinderGeometry",(function(){return Xa})),i.d(e,"CylinderBufferGeometry",(function(){return Za})),i.d(e,"CircleGeometry",(function(){return Ja})),i.d(e,"CircleBufferGeometry",(function(){return $a})),i.d(e,"BoxGeometry",(function(){return rn})),i.d(e,"BoxBufferGeometry",(function(){return on})),i.d(e,"ShadowMaterial",(function(){return es})),i.d(e,"SpriteMaterial",(function(){return Ao})),i.d(e,"RawShaderMaterial",(function(){return is})),i.d(e,"ShaderMaterial",(function(){return Mn})),i.d(e,"PointsMaterial",(function(){return ko})),i.d(e,"MeshPhysicalMaterial",(function(){return rs})),i.d(e,"MeshStandardMaterial",(function(){return ns})),i.d(e,"MeshPhongMaterial",(function(){return os})),i.d(e,"MeshToonMaterial",(function(){return as})),i.d(e,"MeshNormalMaterial",(function(){return ss})),i.d(e,"MeshLambertMaterial",(function(){return ls})),i.d(e,"MeshDepthMaterial",(function(){return Jr})),i.d(e,"MeshDistanceMaterial",(function(){return $r})),i.d(e,"MeshBasicMaterial",(function(){return _n})),i.d(e,"MeshMatcapMaterial",(function(){return us})),i.d(e,"LineDashedMaterial",(function(){return hs})),i.d(e,"LineBasicMaterial",(function(){return Oo})),i.d(e,"Material",(function(){return xn})),i.d(e,"Float64BufferAttribute",(function(){return Ji})),i.d(e,"Float32BufferAttribute",(function(){return Qi})),i.d(e,"Uint32BufferAttribute",(function(){return Ki})),i.d(e,"Int32BufferAttribute",(function(){return Zi})),i.d(e,"Uint16BufferAttribute",(function(){return Xi})),i.d(e,"Int16BufferAttribute",(function(){return Yi})),i.d(e,"Uint8ClampedBufferAttribute",(function(){return qi})),i.d(e,"Uint8BufferAttribute",(function(){return Wi})),i.d(e,"Int8BufferAttribute",(function(){return Gi})),i.d(e,"BufferAttribute",(function(){return Hi})),i.d(e,"ArcCurve",(function(){return Us})),i.d(e,"CatmullRomCurve3",(function(){return qs})),i.d(e,"CubicBezierCurve",(function(){return Ks})),i.d(e,"CubicBezierCurve3",(function(){return Qs})),i.d(e,"EllipseCurve",(function(){return zs})),i.d(e,"LineCurve",(function(){return Js})),i.d(e,"LineCurve3",(function(){return $s})),i.d(e,"QuadraticBezierCurve",(function(){return tl})),i.d(e,"QuadraticBezierCurve3",(function(){return el})),i.d(e,"SplineCurve",(function(){return il})),i.d(e,"REVISION",(function(){return p})),i.d(e,"MOUSE",(function(){return f})),i.d(e,"CullFaceNone",(function(){return m})),i.d(e,"CullFaceBack",(function(){return g})),i.d(e,"CullFaceFront",(function(){return v})),i.d(e,"CullFaceFrontBack",(function(){return y})),i.d(e,"FrontFaceDirectionCW",(function(){return b})),i.d(e,"FrontFaceDirectionCCW",(function(){return w})),i.d(e,"BasicShadowMap",(function(){return x})),i.d(e,"PCFShadowMap",(function(){return M})),i.d(e,"PCFSoftShadowMap",(function(){return T})),i.d(e,"FrontSide",(function(){return S})),i.d(e,"BackSide",(function(){return _})),i.d(e,"DoubleSide",(function(){return A})),i.d(e,"FlatShading",(function(){return P})),i.d(e,"SmoothShading",(function(){return C})),i.d(e,"NoColors",(function(){return E})),i.d(e,"FaceColors",(function(){return D})),i.d(e,"VertexColors",(function(){return L})),i.d(e,"NoBlending",(function(){return O})),i.d(e,"NormalBlending",(function(){return I})),i.d(e,"AdditiveBlending",(function(){return R})),i.d(e,"SubtractiveBlending",(function(){return N})),i.d(e,"MultiplyBlending",(function(){return k})),i.d(e,"CustomBlending",(function(){return F})),i.d(e,"AddEquation",(function(){return B})),i.d(e,"SubtractEquation",(function(){return z})),i.d(e,"ReverseSubtractEquation",(function(){return U})),i.d(e,"MinEquation",(function(){return V})),i.d(e,"MaxEquation",(function(){return j})),i.d(e,"ZeroFactor",(function(){return H})),i.d(e,"OneFactor",(function(){return G})),i.d(e,"SrcColorFactor",(function(){return W})),i.d(e,"OneMinusSrcColorFactor",(function(){return q})),i.d(e,"SrcAlphaFactor",(function(){return Y})),i.d(e,"OneMinusSrcAlphaFactor",(function(){return X})),i.d(e,"DstAlphaFactor",(function(){return Z})),i.d(e,"OneMinusDstAlphaFactor",(function(){return K})),i.d(e,"DstColorFactor",(function(){return Q})),i.d(e,"OneMinusDstColorFactor",(function(){return J})),i.d(e,"SrcAlphaSaturateFactor",(function(){return $})),i.d(e,"NeverDepth",(function(){return tt})),i.d(e,"AlwaysDepth",(function(){return et})),i.d(e,"LessDepth",(function(){return it})),i.d(e,"LessEqualDepth",(function(){return nt})),i.d(e,"EqualDepth",(function(){return rt})),i.d(e,"GreaterEqualDepth",(function(){return ot})),i.d(e,"GreaterDepth",(function(){return at})),i.d(e,"NotEqualDepth",(function(){return st})),i.d(e,"MultiplyOperation",(function(){return lt})),i.d(e,"MixOperation",(function(){return ut})),i.d(e,"AddOperation",(function(){return ht})),i.d(e,"NoToneMapping",(function(){return ct})),i.d(e,"LinearToneMapping",(function(){return dt})),i.d(e,"ReinhardToneMapping",(function(){return pt})),i.d(e,"Uncharted2ToneMapping",(function(){return ft})),i.d(e,"CineonToneMapping",(function(){return mt})),i.d(e,"ACESFilmicToneMapping",(function(){return gt})),i.d(e,"UVMapping",(function(){return vt})),i.d(e,"CubeReflectionMapping",(function(){return yt})),i.d(e,"CubeRefractionMapping",(function(){return bt})),i.d(e,"EquirectangularReflectionMapping",(function(){return wt})),i.d(e,"EquirectangularRefractionMapping",(function(){return xt})),i.d(e,"SphericalReflectionMapping",(function(){return Mt})),i.d(e,"CubeUVReflectionMapping",(function(){return Tt})),i.d(e,"CubeUVRefractionMapping",(function(){return St})),i.d(e,"RepeatWrapping",(function(){return _t})),i.d(e,"ClampToEdgeWrapping",(function(){return At})),i.d(e,"MirroredRepeatWrapping",(function(){return Pt})),i.d(e,"NearestFilter",(function(){return Ct})),i.d(e,"NearestMipMapNearestFilter",(function(){return Et})),i.d(e,"NearestMipMapLinearFilter",(function(){return Dt})),i.d(e,"LinearFilter",(function(){return Lt})),i.d(e,"LinearMipMapNearestFilter",(function(){return Ot})),i.d(e,"LinearMipMapLinearFilter",(function(){return It})),i.d(e,"UnsignedByteType",(function(){return Rt})),i.d(e,"ByteType",(function(){return Nt})),i.d(e,"ShortType",(function(){return kt})),i.d(e,"UnsignedShortType",(function(){return Ft})),i.d(e,"IntType",(function(){return Bt})),i.d(e,"UnsignedIntType",(function(){return zt})),i.d(e,"FloatType",(function(){return Ut})),i.d(e,"HalfFloatType",(function(){return Vt})),i.d(e,"UnsignedShort4444Type",(function(){return jt})),i.d(e,"UnsignedShort5551Type",(function(){return Ht})),i.d(e,"UnsignedShort565Type",(function(){return Gt})),i.d(e,"UnsignedInt248Type",(function(){return Wt})),i.d(e,"AlphaFormat",(function(){return qt})),i.d(e,"RGBFormat",(function(){return Yt})),i.d(e,"RGBAFormat",(function(){return Xt})),i.d(e,"LuminanceFormat",(function(){return Zt})),i.d(e,"LuminanceAlphaFormat",(function(){return Kt})),i.d(e,"RGBEFormat",(function(){return Qt})),i.d(e,"DepthFormat",(function(){return Jt})),i.d(e,"DepthStencilFormat",(function(){return $t})),i.d(e,"RedFormat",(function(){return te})),i.d(e,"RGB_S3TC_DXT1_Format",(function(){return ee})),i.d(e,"RGBA_S3TC_DXT1_Format",(function(){return ie})),i.d(e,"RGBA_S3TC_DXT3_Format",(function(){return ne})),i.d(e,"RGBA_S3TC_DXT5_Format",(function(){return re})),i.d(e,"RGB_PVRTC_4BPPV1_Format",(function(){return oe})),i.d(e,"RGB_PVRTC_2BPPV1_Format",(function(){return ae})),i.d(e,"RGBA_PVRTC_4BPPV1_Format",(function(){return se})),i.d(e,"RGBA_PVRTC_2BPPV1_Format",(function(){return le})),i.d(e,"RGB_ETC1_Format",(function(){return ue})),i.d(e,"RGBA_ASTC_4x4_Format",(function(){return he})),i.d(e,"RGBA_ASTC_5x4_Format",(function(){return ce})),i.d(e,"RGBA_ASTC_5x5_Format",(function(){return de})),i.d(e,"RGBA_ASTC_6x5_Format",(function(){return pe})),i.d(e,"RGBA_ASTC_6x6_Format",(function(){return fe})),i.d(e,"RGBA_ASTC_8x5_Format",(function(){return me})),i.d(e,"RGBA_ASTC_8x6_Format",(function(){return ge})),i.d(e,"RGBA_ASTC_8x8_Format",(function(){return ve})),i.d(e,"RGBA_ASTC_10x5_Format",(function(){return ye})),i.d(e,"RGBA_ASTC_10x6_Format",(function(){return be})),i.d(e,"RGBA_ASTC_10x8_Format",(function(){return we})),i.d(e,"RGBA_ASTC_10x10_Format",(function(){return xe})),i.d(e,"RGBA_ASTC_12x10_Format",(function(){return Me})),i.d(e,"RGBA_ASTC_12x12_Format",(function(){return Te})),i.d(e,"LoopOnce",(function(){return Se})),i.d(e,"LoopRepeat",(function(){return _e})),i.d(e,"LoopPingPong",(function(){return Ae})),i.d(e,"InterpolateDiscrete",(function(){return Pe})),i.d(e,"InterpolateLinear",(function(){return Ce})),i.d(e,"InterpolateSmooth",(function(){return Ee})),i.d(e,"ZeroCurvatureEnding",(function(){return De})),i.d(e,"ZeroSlopeEnding",(function(){return Le})),i.d(e,"WrapAroundEnding",(function(){return Oe})),i.d(e,"TrianglesDrawMode",(function(){return Ie})),i.d(e,"TriangleStripDrawMode",(function(){return Re})),i.d(e,"TriangleFanDrawMode",(function(){return Ne})),i.d(e,"LinearEncoding",(function(){return ke})),i.d(e,"sRGBEncoding",(function(){return Fe})),i.d(e,"GammaEncoding",(function(){return Be})),i.d(e,"RGBEEncoding",(function(){return ze})),i.d(e,"LogLuvEncoding",(function(){return Ue})),i.d(e,"RGBM7Encoding",(function(){return Ve})),i.d(e,"RGBM16Encoding",(function(){return je})),i.d(e,"RGBDEncoding",(function(){return He})),i.d(e,"BasicDepthPacking",(function(){return Ge})),i.d(e,"RGBADepthPacking",(function(){return We})),i.d(e,"TangentSpaceNormalMap",(function(){return qe})),i.d(e,"ObjectSpaceNormalMap",(function(){return Ye})),i.d(e,"CubeGeometry",(function(){return rn})),i.d(e,"Face4",(function(){return Ku})),i.d(e,"LineStrip",(function(){return Qu})),i.d(e,"LinePieces",(function(){return Ju})),i.d(e,"MeshFaceMaterial",(function(){return $u})),i.d(e,"MultiMaterial",(function(){return th})),i.d(e,"PointCloud",(function(){return eh})),i.d(e,"Particle",(function(){return ih})),i.d(e,"ParticleSystem",(function(){return nh})),i.d(e,"PointCloudMaterial",(function(){return rh})),i.d(e,"ParticleBasicMaterial",(function(){return oh})),i.d(e,"ParticleSystemMaterial",(function(){return ah})),i.d(e,"Vertex",(function(){return sh})),i.d(e,"DynamicBufferAttribute",(function(){return lh})),i.d(e,"Int8Attribute",(function(){return uh})),i.d(e,"Uint8Attribute",(function(){return hh})),i.d(e,"Uint8ClampedAttribute",(function(){return ch})),i.d(e,"Int16Attribute",(function(){return dh})),i.d(e,"Uint16Attribute",(function(){return ph})),i.d(e,"Int32Attribute",(function(){return fh})),i.d(e,"Uint32Attribute",(function(){return mh})),i.d(e,"Float32Attribute",(function(){return gh})),i.d(e,"Float64Attribute",(function(){return vh})),i.d(e,"ClosedSplineCurve3",(function(){return yh})),i.d(e,"SplineCurve3",(function(){return bh})),i.d(e,"Spline",(function(){return wh})),i.d(e,"AxisHelper",(function(){return xh})),i.d(e,"BoundingBoxHelper",(function(){return Mh})),i.d(e,"EdgesHelper",(function(){return Th})),i.d(e,"WireframeHelper",(function(){return Sh})),i.d(e,"XHRLoader",(function(){return _h})),i.d(e,"BinaryTextureLoader",(function(){return Ah})),i.d(e,"GeometryUtils",(function(){return Ph})),i.d(e,"Projector",(function(){return Ch})),i.d(e,"CanvasRenderer",(function(){return Eh})),i.d(e,"JSONLoader",(function(){return Dh})),i.d(e,"SceneUtils",(function(){return Lh})),i.d(e,"LensFlare",(function(){return Oh})),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:t>0?1:+t}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i>8&255]+t[e>>16&255]+t[e>>24&255]+"-"+t[255&i]+t[i>>8&255]+"-"+t[i>>16&15|64]+t[i>>24&255]+"-"+t[63&n|128]+t[n>>8&255]+"-"+t[n>>16&255]+t[n>>24&255]+t[255&r]+t[r>>8&255]+t[r>>16&255]+t[r>>24&255]).toUpperCase()}}(),clamp:function(t,e,i){return Math.max(e,Math.min(i,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,i,n,r){return n+(t-e)*(r-n)/(i-e)},lerp:function(t,e,i){return(1-i)*t+i*e},smoothstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)},smootherstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-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*Xe.DEG2RAD},radToDeg:function(t){return t*Xe.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 Ze(t,e){this.x=t||0,this.y=e||0}function Ke(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Qe(t,e,i,n){this._x=t||0,this._y=e||0,this._z=i||0,this._w=void 0!==n?n:1}function Je(t,e,i){this.x=t||0,this.y=e||0,this.z=i||0}function $e(){this.elements=[1,0,0,0,1,0,0,0,1]}Object.defineProperties(Ze.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(Ze.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?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?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,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[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:(r=new Ze,o=new Ze,function(t,e){return r.set(t,t),o.set(e,e),this.clamp(r,o)}),clampLength:function(t,e){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))},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,i=this.y-t.y;return e*e+i*i},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,i){return this.subVectors(e,t).multiplyScalar(i).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,i){return this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var i=Math.cos(e),n=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*i-o*n+t.x,this.y=r*n+o*i+t.y,this}}),Object.assign(Ke.prototype,{isMatrix4:!0,set:function(t,e,i,n,r,o,a,s,l,u,h,c,d,p,f,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=n,g[1]=r,g[5]=o,g[9]=a,g[13]=s,g[2]=l,g[6]=u,g[10]=h,g[14]=c,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 Ke).fromArray(this.elements)},copy:function(t){var e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this},copyPosition:function(t){var e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this},extractBasis:function(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this},extractRotation:(h=new Je,function(t){var e=this.elements,i=t.elements,n=1/h.setFromMatrixColumn(t,0).length(),r=1/h.setFromMatrixColumn(t,1).length(),o=1/h.setFromMatrixColumn(t,2).length();return e[0]=i[0]*n,e[1]=i[1]*n,e[2]=i[2]*n,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*o,e[9]=i[9]*o,e[10]=i[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}),makeRotationFromEuler:function(t){!t||t.isEuler;var e=this.elements,i=t.x,n=t.y,r=t.z,o=Math.cos(i),a=Math.sin(i),s=Math.cos(n),l=Math.sin(n),u=Math.cos(r),h=Math.sin(r);if("XYZ"===t.order){var c=o*u,d=o*h,p=a*u,f=a*h;e[0]=s*u,e[4]=-s*h,e[8]=l,e[1]=d+p*l,e[5]=c-f*l,e[9]=-a*s,e[2]=f-c*l,e[6]=p+d*l,e[10]=o*s}else if("YXZ"===t.order){var m=s*u,g=s*h,v=l*u,y=l*h;e[0]=m+y*a,e[4]=v*a-g,e[8]=o*l,e[1]=o*h,e[5]=o*u,e[9]=-a,e[2]=g*a-v,e[6]=y+m*a,e[10]=o*s}else if("ZXY"===t.order){m=s*u,g=s*h,v=l*u,y=l*h;e[0]=m-y*a,e[4]=-o*h,e[8]=v+g*a,e[1]=g+v*a,e[5]=o*u,e[9]=y-m*a,e[2]=-o*l,e[6]=a,e[10]=o*s}else if("ZYX"===t.order){c=o*u,d=o*h,p=a*u,f=a*h;e[0]=s*u,e[4]=p*l-d,e[8]=c*l+f,e[1]=s*h,e[5]=f*l+c,e[9]=d*l-p,e[2]=-l,e[6]=a*s,e[10]=o*s}else if("YZX"===t.order){var b=o*s,w=o*l,x=a*s,M=a*l;e[0]=s*u,e[4]=M-b*h,e[8]=x*h+w,e[1]=h,e[5]=o*u,e[9]=-a*u,e[2]=-l*u,e[6]=w*h+x,e[10]=b-M*h}else if("XZY"===t.order){b=o*s,w=o*l,x=a*s,M=a*l;e[0]=s*u,e[4]=-h,e[8]=l*u,e[1]=b*h+M,e[5]=o*u,e[9]=w*h-x,e[2]=x*h-w,e[6]=a*u,e[10]=M*h+b}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:(l=new Je(0,0,0),u=new Je(1,1,1),function(t){return this.compose(l,t,u)}),lookAt:function(){var t=new Je,e=new Je,i=new Je;return function(n,r,o){var a=this.elements;return i.subVectors(n,r),0===i.lengthSq()&&(i.z=1),i.normalize(),t.crossVectors(o,i),0===t.lengthSq()&&(1===Math.abs(o.z)?i.x+=1e-4:i.z+=1e-4,i.normalize(),t.crossVectors(o,i)),t.normalize(),e.crossVectors(i,t),a[0]=t.x,a[4]=e.x,a[8]=i.x,a[1]=t.y,a[5]=e.y,a[9]=i.y,a[2]=t.z,a[6]=e.z,a[10]=i.z,this}}(),multiply:function(t,e){return void 0!==e?this.multiplyMatrices(t,e):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.elements,n=e.elements,r=this.elements,o=i[0],a=i[4],s=i[8],l=i[12],u=i[1],h=i[5],c=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],v=i[3],y=i[7],b=i[11],w=i[15],x=n[0],M=n[4],T=n[8],S=n[12],_=n[1],A=n[5],P=n[9],C=n[13],E=n[2],D=n[6],L=n[10],O=n[14],I=n[3],R=n[7],N=n[11],k=n[15];return r[0]=o*x+a*_+s*E+l*I,r[4]=o*M+a*A+s*D+l*R,r[8]=o*T+a*P+s*L+l*N,r[12]=o*S+a*C+s*O+l*k,r[1]=u*x+h*_+c*E+d*I,r[5]=u*M+h*A+c*D+d*R,r[9]=u*T+h*P+c*L+d*N,r[13]=u*S+h*C+c*O+d*k,r[2]=p*x+f*_+m*E+g*I,r[6]=p*M+f*A+m*D+g*R,r[10]=p*T+f*P+m*L+g*N,r[14]=p*S+f*C+m*O+g*k,r[3]=v*x+y*_+b*E+w*I,r[7]=v*M+y*A+b*D+w*R,r[11]=v*T+y*P+b*L+w*N,r[15]=v*S+y*C+b*O+w*k,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:function(){var t=new Je;return function(e){for(var i=0,n=e.count;i=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var b=Math.sqrt(y),w=Math.atan2(b,g*v);m=Math.sin(m*w)/b,a=Math.sin(a*w)/b}var x=a*v;if(s=s*m+c*x,l=l*m+d*x,u=u*m+p*x,h=h*m+f*x,m===1-a){var M=1/Math.sqrt(s*s+l*l+u*u+h*h);s*=M,l*=M,u*=M,h*=M}}t[e]=s,t[e+1]=l,t[e+2]=u,t[e+3]=h}}),Object.defineProperties(Qe.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(Qe.prototype,{isQuaternion:!0,set:function(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._w=n,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 i=t._x,n=t._y,r=t._z,o=t.order,a=Math.cos,s=Math.sin,l=a(i/2),u=a(n/2),h=a(r/2),c=s(i/2),d=s(n/2),p=s(r/2);return"XYZ"===o?(this._x=c*u*h+l*d*p,this._y=l*d*h-c*u*p,this._z=l*u*p+c*d*h,this._w=l*u*h-c*d*p):"YXZ"===o?(this._x=c*u*h+l*d*p,this._y=l*d*h-c*u*p,this._z=l*u*p-c*d*h,this._w=l*u*h+c*d*p):"ZXY"===o?(this._x=c*u*h-l*d*p,this._y=l*d*h+c*u*p,this._z=l*u*p+c*d*h,this._w=l*u*h-c*d*p):"ZYX"===o?(this._x=c*u*h-l*d*p,this._y=l*d*h+c*u*p,this._z=l*u*p-c*d*h,this._w=l*u*h+c*d*p):"YZX"===o?(this._x=c*u*h+l*d*p,this._y=l*d*h+c*u*p,this._z=l*u*p-c*d*h,this._w=l*u*h-c*d*p):"XZY"===o&&(this._x=c*u*h-l*d*p,this._y=l*d*h-c*u*p,this._z=l*u*p+c*d*h,this._w=l*u*h+c*d*p),!1!==e&&this.onChangeCallback(),this},setFromAxisAngle:function(t,e){var i=e/2,n=Math.sin(i);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(i),this.onChangeCallback(),this},setFromRotationMatrix:function(t){var e,i=t.elements,n=i[0],r=i[4],o=i[8],a=i[1],s=i[5],l=i[9],u=i[2],h=i[6],c=i[10],d=n+s+c;return d>0?(e=.5/Math.sqrt(d+1),this._w=.25/e,this._x=(h-l)*e,this._y=(o-u)*e,this._z=(a-r)*e):n>s&&n>c?(e=2*Math.sqrt(1+n-s-c),this._w=(h-l)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(o+u)/e):s>c?(e=2*Math.sqrt(1+s-n-c),this._w=(o-u)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(l+h)/e):(e=2*Math.sqrt(1+c-n-s),this._w=(a-r)/e,this._x=(o+u)/e,this._y=(l+h)/e,this._z=.25*e),this.onChangeCallback(),this},setFromUnitVectors:function(){var t,e=new Je;return function(i,n){return void 0===e&&(e=new Je),(t=i.dot(n)+1)<1e-6?(t=0,Math.abs(i.x)>Math.abs(i.z)?e.set(-i.y,i.x,0):e.set(0,-i.z,i.y)):e.crossVectors(i,n),this._x=e.x,this._y=e.y,this._z=e.z,this._w=t,this.normalize()}}(),angleTo:function(t){return 2*Math.acos(Math.abs(Xe.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){var i=this.angleTo(t);if(0===i)return this;var n=Math.min(1,e/i);return this.slerp(t,n),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?this.multiplyQuaternions(t,e):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var i=t._x,n=t._y,r=t._z,o=t._w,a=e._x,s=e._y,l=e._z,u=e._w;return this._x=i*u+o*a+n*l-r*s,this._y=n*u+o*s+r*a-i*l,this._z=r*u+o*l+i*s-n*a,this._w=o*u-i*a-n*s-r*l,this.onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var i=this._x,n=this._y,r=this._z,o=this._w,a=o*t._w+i*t._x+n*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=i,this._y=n,this._z=r,this;var s=1-a*a;if(s<=Number.EPSILON){var l=1-e;return this._w=l*o+e*this._w,this._x=l*i+e*this._x,this._y=l*n+e*this._y,this._z=l*r+e*this._z,this.normalize()}var u=Math.sqrt(s),h=Math.atan2(u,a),c=Math.sin((1-e)*h)/u,d=Math.sin(e*h)/u;return this._w=o*c+this._w*d,this._x=i*c+this._x*d,this._y=n*c+this._y*d,this._z=r*c+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(Je.prototype,{isVector3:!0,set:function(t,e,i){return this.x=t,this.y=e,this.z=i,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?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?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?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:(c=new Qe,function(t){return!t||t.isEuler,this.applyQuaternion(c.setFromEuler(t))}),applyAxisAngle:function(){var t=new Qe;return function(e,i){return this.applyQuaternion(t.setFromAxisAngle(e,i))}}(),applyMatrix3:function(t){var e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,r=t.elements,o=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*o,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*o,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*o,this},applyQuaternion:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,o=t.y,a=t.z,s=t.w,l=s*e+o*n-a*i,u=s*i+a*e-r*n,h=s*n+r*i-o*e,c=-r*e-o*i-a*n;return this.x=l*s+c*-r+u*-a-h*-o,this.y=u*s+c*-o+h*-r-l*-a,this.z=h*s+c*-a+l*-o-u*-r,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(){var t=new Ke;return function(e){return this.applyMatrix4(t.getInverse(e.projectionMatrix)).applyMatrix4(e.matrixWorld)}}(),transformDirection:function(t){var e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*n,this.y=r[1]*e+r[5]*i+r[9]*n,this.z=r[2]*e+r[6]*i+r[10]*n,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:function(){var t=new Je,e=new Je;return function(i,n){return t.set(i,i,i),e.set(n,n,n),this.clamp(t,e)}}(),clampLength:function(t,e){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))},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,i){return this.subVectors(e,t).multiplyScalar(i).add(t)},cross:function(t,e){return void 0!==e?this.crossVectors(t,e):this.crossVectors(this,t)},crossVectors:function(t,e){var i=t.x,n=t.y,r=t.z,o=e.x,a=e.y,s=e.z;return this.x=n*s-r*a,this.y=r*o-i*s,this.z=i*a-n*o,this},projectOnVector:function(t){var e=t.dot(this)/t.lengthSq();return this.copy(t).multiplyScalar(e)},projectOnPlane:function(){var t=new Je;return function(e){return t.copy(this).projectOnVector(e),this.sub(t)}}(),reflect:function(){var t=new Je;return function(e){return this.sub(t.copy(e).multiplyScalar(2*this.dot(e)))}}(),angleTo:function(t){var e=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq());return Math.acos(Xe.clamp(e,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n},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,i){var n=Math.sin(e)*t;return this.x=n*Math.sin(i),this.y=Math.cos(e)*t,this.z=n*Math.cos(i),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,i){return this.x=t*Math.sin(e),this.y=i,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(),i=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=n,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,i){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}}),Object.assign($e.prototype,{isMatrix3:!0,set:function(t,e,i,n,r,o,a,s,l){var u=this.elements;return u[0]=t,u[1]=n,u[2]=a,u[3]=e,u[4]=r,u[5]=s,u[6]=i,u[7]=o,u[8]=l,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,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[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:function(){var t=new Je;return function(e){for(var i=0,n=e.count;i2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},ai=0;function si(t,e,i,n,r,o,a,s,l,u){Object.defineProperty(this,"id",{value:ai++}),this.uuid=Xe.generateUUID(),this.name="",this.image=void 0!==t?t:si.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:si.DEFAULT_MAPPING,this.wrapS=void 0!==i?i:At,this.wrapT=void 0!==n?n:At,this.magFilter=void 0!==r?r:Lt,this.minFilter=void 0!==o?o:It,this.anisotropy=void 0!==l?l:1,this.format=void 0!==a?a:Xt,this.type=void 0!==s?s:Rt,this.offset=new Ze(0,0),this.repeat=new Ze(1,1),this.center=new Ze(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new $e,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==u?u:ke,this.version=0,this.onUpdate=null}function li(t,e,i,n){this.x=t||0,this.y=e||0,this.z=i||0,this.w=void 0!==n?n:1}function ui(t,e,i){this.width=t,this.height=e,this.scissor=new li(0,0,t,e),this.scissorTest=!1,this.viewport=new li(0,0,t,e),i=i||{},this.texture=new si(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:Lt,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0===i.stencilBuffer||i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}function hi(t,e,i){ui.call(this,t,e,i),this.activeCubeFace=0,this.activeMipMapLevel=0}function ci(t,e,i,n,r,o,a,s,l,u,h,c){si.call(this,null,o,a,s,l,u,n,r,h,c),this.image={data:t,width:e,height:i},this.magFilter=void 0!==l?l:Ct,this.minFilter=void 0!==u?u:Ct,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function di(t,e){this.min=void 0!==t?t:new Je(1/0,1/0,1/0),this.max=void 0!==e?e:new Je(-1/0,-1/0,-1/0)}function pi(t,e){this.center=void 0!==t?t:new Je,this.radius=void 0!==e?e:0}function fi(t,e){this.normal=void 0!==t?t:new Je(1,0,0),this.constant=void 0!==e?e:0}function mi(t,e,i,n,r,o){this.planes=[void 0!==t?t:new fi,void 0!==e?e:new fi,void 0!==i?i:new fi,void 0!==n?n:new fi,void 0!==r?r:new fi,void 0!==o?o:new fi]}si.DEFAULT_IMAGE=void 0,si.DEFAULT_MAPPING=vt,si.prototype=Object.assign(Object.create(n.prototype),{constructor:si,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 i={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 n=this.image;if(void 0===n.uuid&&(n.uuid=Xe.generateUUID()),!e&&void 0===t.images[n.uuid]){var r;if(Array.isArray(n)){r=[];for(var o=0,a=n.length;o1)switch(this.wrapS){case _t:t.x=t.x-Math.floor(t.x);break;case At:t.x=t.x<0?0:1;break;case Pt:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case _t:t.y=t.y-Math.floor(t.y);break;case At:t.y=t.y<0?0:1;break;case Pt: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(si.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(li.prototype,{isVector4:!0,set:function(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,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?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?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,i=this.y,n=this.z,r=this.w,o=t.elements;return this.x=o[0]*e+o[4]*i+o[8]*n+o[12]*r,this.y=o[1]*e+o[5]*i+o[9]*n+o[13]*r,this.z=o[2]*e+o[6]*i+o[10]*n+o[14]*r,this.w=o[3]*e+o[7]*i+o[11]*n+o[15]*r,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,i,n,r,o=t.elements,a=o[0],s=o[4],l=o[8],u=o[1],h=o[5],c=o[9],d=o[2],p=o[6],f=o[10];if(Math.abs(s-u)<.01&&Math.abs(l-d)<.01&&Math.abs(c-p)<.01){if(Math.abs(s+u)<.1&&Math.abs(l+d)<.1&&Math.abs(c+p)<.1&&Math.abs(a+h+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var m=(a+1)/2,g=(h+1)/2,v=(f+1)/2,y=(s+u)/4,b=(l+d)/4,w=(c+p)/4;return m>g&&m>v?m<.01?(i=0,n=.707106781,r=.707106781):(n=y/(i=Math.sqrt(m)),r=b/i):g>v?g<.01?(i=.707106781,n=0,r=.707106781):(i=y/(n=Math.sqrt(g)),r=w/n):v<.01?(i=.707106781,n=.707106781,r=0):(i=b/(r=Math.sqrt(v)),n=w/r),this.set(i,n,r,e),this}var x=Math.sqrt((p-c)*(p-c)+(l-d)*(l-d)+(u-s)*(u-s));return Math.abs(x)<.001&&(x=1),this.x=(p-c)/x,this.y=(l-d)/x,this.z=(u-s)/x,this.w=Math.acos((a+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(){var t,e;return function(i,n){return void 0===t&&(t=new li,e=new li),t.set(i,i,i,i),e.set(n,n,n,n),this.clamp(t,e)}}(),clampLength:function(t,e){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))},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,i){return this.subVectors(e,t).multiplyScalar(i).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,i){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}}),ui.prototype=Object.assign(Object.create(n.prototype),{constructor:ui,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"})}}),hi.prototype=Object.create(ui.prototype),hi.prototype.constructor=hi,hi.prototype.isWebGLRenderTargetCube=!0,ci.prototype=Object.create(si.prototype),ci.prototype.constructor=ci,ci.prototype.isDataTexture=!0,Object.assign(di.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,i=1/0,n=1/0,r=-1/0,o=-1/0,a=-1/0,s=0,l=t.length;sr&&(r=u),h>o&&(o=h),c>a&&(a=c)}return this.min.set(e,i,n),this.max.set(r,o,a),this},setFromBufferAttribute:function(t){for(var e=1/0,i=1/0,n=1/0,r=-1/0,o=-1/0,a=-1/0,s=0,l=t.count;sr&&(r=u),h>o&&(o=h),c>a&&(a=c)}return this.min.set(e,i,n),this.max.set(r,o,a),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,i=t.length;ethis.max.x||t.ythis.max.y||t.zthis.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&&(e=new Je),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.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)},intersectsSphere:(ei=new Je,function(t){return this.clampPoint(t.center,ei),ei.distanceToSquared(t.center)<=t.radius*t.radius}),intersectsPlane:function(t){var e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant},intersectsTriangle:function(){var t=new Je,e=new Je,i=new Je,n=new Je,r=new Je,o=new Je,a=new Je,s=new Je,l=new Je,u=new Je;function h(n){var r,o;for(r=0,o=n.length-3;r<=o;r+=3){a.fromArray(n,r);var s=l.x*Math.abs(a.x)+l.y*Math.abs(a.y)+l.z*Math.abs(a.z),u=t.dot(a),h=e.dot(a),c=i.dot(a);if(Math.max(-Math.max(u,h,c),Math.min(u,h,c))>s)return!1}return!0}return function(a){if(this.isEmpty())return!1;this.getCenter(s),l.subVectors(this.max,s),t.subVectors(a.a,s),e.subVectors(a.b,s),i.subVectors(a.c,s),n.subVectors(e,t),r.subVectors(i,e),o.subVectors(t,i);var c=[0,-n.z,n.y,0,-r.z,r.y,0,-o.z,o.y,n.z,0,-n.x,r.z,0,-r.x,o.z,0,-o.x,-n.y,n.x,0,-r.y,r.x,0,-o.y,o.x,0];return!!h(c)&&(!!h(c=[1,0,0,0,1,0,0,0,1])&&(u.crossVectors(n,r),h(c=[u.x,u.y,u.z])))}}(),clampPoint:function(t,e){return void 0===e&&(e=new Je),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new Je;return function(e){return t.copy(e).clamp(this.min,this.max).sub(e).length()}}(),getBoundingSphere:function(){var t=new Je;return function(e){return void 0===e&&(e=new pi),this.getCenter(e.center),e.radius=.5*this.getSize(t).length(),e}}(),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:(ti=[new Je,new Je,new Je,new Je,new Je,new Je,new Je,new Je],function(t){return this.isEmpty()||(ti[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),ti[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),ti[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),ti[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),ti[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),ti[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),ti[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),ti[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(ti)),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(pi.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:(ii=new di,function(t,e){var i=this.center;void 0!==e?i.copy(e):ii.setFromPoints(t).getCenter(i);for(var n=0,r=0,o=t.length;rthis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(t=new di),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(fi.prototype,{set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(){var t=new Je,e=new Je;return function(i,n,r){var o=t.subVectors(r,n).cross(e.subVectors(i,n)).normalize();return this.setFromNormalAndCoplanarPoint(o,i),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&&(e=new Je),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(){var t=new Je;return function(e,i){void 0===i&&(i=new Je);var n=e.delta(t),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?i.copy(e.start):void 0;var o=-(e.start.dot(this.normal)+this.constant)/r;return o<0||o>1?void 0:i.copy(n).multiplyScalar(o).add(e.start)}}(),intersectsLine:function(t){var e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(t=new Je),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var t=new Je,e=new $e;return function(i,n){var r=n||e.getNormalMatrix(i),o=this.coplanarPoint(t).applyMatrix4(i),a=this.normal.applyMatrix3(r).normalize();return this.constant=-o.dot(a),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(mi.prototype,{set:function(t,e,i,n,r,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(i),a[3].copy(n),a[4].copy(r),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,i=0;i<6;i++)e[i].copy(t.planes[i]);return this},setFromMatrix:function(t){var e=this.planes,i=t.elements,n=i[0],r=i[1],o=i[2],a=i[3],s=i[4],l=i[5],u=i[6],h=i[7],c=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],v=i[14],y=i[15];return e[0].setComponents(a-n,h-s,f-c,y-m).normalize(),e[1].setComponents(a+n,h+s,f+c,y+m).normalize(),e[2].setComponents(a+r,h+l,f+d,y+g).normalize(),e[3].setComponents(a-r,h-l,f-d,y-g).normalize(),e[4].setComponents(a-o,h-u,f-p,y-v).normalize(),e[5].setComponents(a+o,h+u,f+p,y+v).normalize(),this},intersectsObject:(ri=new pi,function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),ri.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(ri)}),intersectsSprite:function(){var t=new pi;return function(e){return t.center.set(0,0,0),t.radius=.7071067811865476,t.applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSphere:function(t){for(var e=this.planes,i=t.center,n=-t.radius,r=0;r<6;r++){if(e[r].distanceToPoint(i)0?t.max.x:t.min.x,ni.y=n.normal.y>0?t.max.y:t.min.y,ni.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(ni)<0)return!1}return!0}),containsPoint:function(t){for(var e=this.planes,i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}});var gi={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 \n\t#include \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 \n\t#include \n}",cube_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include \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 \n\t#include \n}",equirect_vert:"varying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include \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 \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \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 \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \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 \n\t#include \n\t#include \n\t#include \n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n}",shadow_vert:"#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \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 \n\t#include \n\t#include \n}"};function vi(t){var e={};for(var i in t)for(var n in e[i]={},t[i]){var r=t[i][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?e[i][n]=r.clone():Array.isArray(r)?e[i][n]=r.slice():e[i][n]=r}return e}function yi(t){for(var e={},i=0;i>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,i){return this.r=t,this.g=e,this.b=i,this},setHSL:function(){function t(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}return function(e,i,n){if(e=Xe.euclideanModulo(e,1),i=Xe.clamp(i,0,1),n=Xe.clamp(n,0,1),0===i)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+i):n+i-n*i,o=2*n-r;this.r=t(o,r,e+1/3),this.g=t(o,r,e),this.b=t(o,r,e-1/3)}return this}}(),setStyle:function(t){function e(t){void 0!==t&&parseFloat(t)}var i;if(i=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var n,r=i[1],o=i[2];switch(r){case"rgb":case"rgba":if(n=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,e(n[5]),this;if(n=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,e(n[5]),this;break;case"hsl":case"hsla":if(n=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var a=parseFloat(n[1])/360,s=parseInt(n[2],10)/100,l=parseInt(n[3],10)/100;return e(n[5]),this.setHSL(a,s,l)}}}else if(i=/^\#([A-Fa-f0-9]+)$/.exec(t)){var u,h=(u=i[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}t&&t.length>0&&(void 0!==(u=Ti[t])&&this.setHex(u));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 i=e>0?1/e:1;return this.r=Math.pow(t.r,i),this.g=Math.pow(t.g,i),this.b=Math.pow(t.b,i),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(){function t(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}return function(e){return this.r=t(e.r),this.g=t(e.g),this.b=t(e.b),this}}(),copyLinearToSRGB:function(){function t(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}return function(e){return this.r=t(e.r),this.g=t(e.g),this.b=t(e.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&&(t={h:0,s:0,l:0});var e,i,n=this.r,r=this.g,o=this.b,a=Math.max(n,r,o),s=Math.min(n,r,o),l=(s+a)/2;if(s===a)e=0,i=0;else{var u=a-s;switch(i=l<=.5?u/(a+s):u/(2-a-s),a){case n:e=(r-o)/u+(r1){for(var e=0;e1){for(var e=0;e0){n.children=[];for(s=0;s0&&(i.geometries=c),d.length>0&&(i.materials=d),p.length>0&&(i.textures=p),f.length>0&&(i.images=f),a.length>0&&(i.shapes=a)}return i.object=n,i;function m(t){var e=[];for(var i in t){var n=t[i];delete n.metadata,e.push(n)}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 i=0;ie&&(e=t[i]);return e}ji.prototype=Object.assign(Object.create(n.prototype),{constructor:ji,isGeometry:!0,applyMatrix:function(t){for(var e=(new $e).getNormalMatrix(t),i=0,n=this.vertices.length;i0)for(u=0;u0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,i;for(this.computeFaceNormals(),t=0,e=this.faces.length;t0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,i,n,r;for(i=0,n=this.faces.length;i=0;i--){var f=d[i];for(this.faces.splice(f,1),a=0,s=this.faceVertexUvs.length;a0,g=p.vertexNormals.length>0,v=1!==p.color.r||1!==p.color.g||1!==p.color.b,y=p.vertexColors.length>0,b=0;if(b=T(b,0,0),b=T(b,1,!0),b=T(b,2,!1),b=T(b,3,f),b=T(b,4,m),b=T(b,5,g),b=T(b,6,v),b=T(b,7,y),a.push(b),a.push(p.a,p.b,p.c),a.push(p.materialIndex),f){var w=this.faceVertexUvs[0][r];a.push(A(w[0]),A(w[1]),A(w[2]))}if(m&&a.push(S(p.normal)),g){var x=p.vertexNormals;a.push(S(x[0]),S(x[1]),S(x[2]))}if(v&&a.push(_(p.color)),y){var M=p.vertexColors;a.push(_(M[0]),_(M[1]),_(M[2]))}}function T(t,e,i){return i?t|1<0&&(t.data.colors=u),c.length>0&&(t.data.uvs=[c]),t.data.faces=a,t},clone:function(){return(new ji).copy(this)},copy:function(t){var e,i,n,r,o,a;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,i=s.length;e0,a=r[1]&&r[1].length>0,s=t.morphTargets,l=s.length;if(l>0){e=[];for(var u=0;u0){h=[];for(u=0;u0&&i.length;for(u=0;u0?1:-1,u.push(E.x,E.y,E.z),h.push(y/m),h.push(1-b/g),P+=1}}for(b=0;b65535?Ki:Xi)(t,1):this.index=t},addAttribute:function(t,e){return e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(this.setIndex(e),this):(this.attributes[t]=e,this):this.addAttribute(t,new Hi(arguments[1],arguments[2]))},getAttribute:function(t){return this.attributes[t]},removeAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,i){this.groups.push({start:t,count:e,materialIndex:void 0!==i?i: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 i=this.attributes.normal;void 0!==i&&((new $e).getNormalMatrix(t).applyToBufferAttribute(i),i.needsUpdate=!0);return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var t=new Ke;return function(e){return t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t=new Ke;return function(e){return t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t=new Ke;return function(e){return t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t=new Ke;return function(e,i,n){return t.makeTranslation(e,i,n),this.applyMatrix(t),this}}(),scale:function(){var t=new Ke;return function(e,i,n){return t.makeScale(e,i,n),this.applyMatrix(t),this}}(),lookAt:function(){var t=new Bi;return function(e){t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),center:function(){var t=new Je;return function(){return this.computeBoundingBox(),this.boundingBox.getCenter(t).negate(),this.translate(t.x,t.y,t.z),this}}(),setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var i=new Qi(3*e.vertices.length,3),n=new Qi(3*e.colors.length,3);if(this.addAttribute("position",i.copyVector3sArray(e.vertices)),this.addAttribute("color",n.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var r=new Qi(e.lineDistances.length,1);this.addAttribute("lineDistance",r.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=[],i=0,n=t.length;i0){var i=new Float32Array(3*t.normals.length);this.addAttribute("normal",new Hi(i,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var n=new Float32Array(3*t.colors.length);this.addAttribute("color",new Hi(n,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var r=new Float32Array(2*t.uvs.length);this.addAttribute("uv",new Hi(r,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var o=new Float32Array(2*t.uvs2.length);this.addAttribute("uv2",new Hi(o,2).copyVector2sArray(t.uvs2))}for(var a in this.groups=t.groups,t.morphTargets){for(var s=[],l=t.morphTargets[a],u=0,h=l.length;u0){var p=new Qi(4*t.skinIndices.length,4);this.addAttribute("skinIndex",p.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var f=new Qi(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 di);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)},computeBoundingSphere:function(){var t=new di,e=new Je;return function(){null===this.boundingSphere&&(this.boundingSphere=new pi);var i=this.attributes.position;if(i){var n=this.boundingSphere.center;t.setFromBufferAttribute(i),t.getCenter(n);for(var r=0,o=0,a=i.count;o0&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};var n=this.index;if(null!==n){var r=Array.prototype.slice.call(n.array);t.data.index={type:n.array.constructor.name,array:r}}var o=this.attributes;for(var i in o){var a=o[i];r=Array.prototype.slice.call(a.array);t.data.attributes[i]={itemSize:a.itemSize,type:a.array.constructor.name,array:r,normalized:a.normalized}}var s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));var l=this.boundingSphere;return null!==l&&(t.data.boundingSphere={center:l.center.toArray(),radius:l.radius}),t},clone:function(){return(new nn).copy(this)},copy:function(t){var e,i,n;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var r=t.index;null!==r&&this.setIndex(r.clone());var o=t.attributes;for(e in o){var a=o[e];this.addAttribute(e,a.clone())}var s=t.morphAttributes;for(e in s){var l=[],u=s[e];for(i=0,n=u.length;i0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext,a=void 0!==i.precision?i.precision:"highp",s=r(a);s!==a&&(a=s);var l=!0===i.logarithmicDepthBuffer,u=t.getParameter(34930),h=t.getParameter(35660),c=t.getParameter(3379),d=t.getParameter(34076),p=t.getParameter(34921),f=t.getParameter(36347),m=t.getParameter(36348),g=t.getParameter(36349),v=h>0,y=o||!!e.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==n)return n;var i=e.get("EXT_texture_filter_anisotropic");return n=null!==i?t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:r,precision:a,logarithmicDepthBuffer:l,maxTextures:u,maxVertexTextures:h,maxTextureSize:c,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y}}function Dn(){var t=this,e=null,i=0,n=!1,r=!1,o=new fi,a=new $e,s={value:null,needsUpdate:!1};function l(){s.value!==e&&(s.value=e,s.needsUpdate=i>0),t.numPlanes=i,t.numIntersection=0}function u(e,i,n,r){var l=null!==e?e.length:0,u=null;if(0!==l){if(u=s.value,!0!==r||null===u){var h=n+4*l,c=i.matrixWorldInverse;a.getNormalMatrix(c),(null===u||u.length65535?Ki:Xi)(o,1),e.update(i,34963),r[t.id]=i,i}}}function In(t,e,i,n){var r,o,a;this.setMode=function(t){r=t},this.setIndex=function(t){o=t.type,a=t.bytesPerElement},this.render=function(e,n){t.drawElements(r,n,o,e*a),i.update(n,r)},this.renderInstances=function(s,l,u){var h;if(n.isWebGL2)h=t;else if(null===(h=e.get("ANGLE_instanced_arrays")))return;h[n.isWebGL2?"drawElementsInstanced":"drawElementsInstancedANGLE"](r,u,o,l*a,s.maxInstancedCount),i.update(u,r,s.maxInstancedCount)}}function Rn(t){var e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(t,i,n){switch(n=n||1,e.calls++,i){case 4:e.triangles+=n*(t/3);break;case 5:case 6:e.triangles+=n*(t-2);break;case 1:e.lines+=n*(t/2);break;case 3:e.lines+=n*(t-1);break;case 2:e.lines+=n*t;break;case 0:e.points+=n*t}}}}function Nn(t,e){return Math.abs(e[1])-Math.abs(t[1])}function kn(t){var e={},i=new Float32Array(8);return{update:function(n,r,o,a){var s=n.morphTargetInfluences,l=s.length,u=e[r.id];if(void 0===u){u=[];for(var h=0;h0&&(i.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(i.morphTargets=!0),!0===this.skinning&&(i.skinning=!0),!1===this.visible&&(i.visible=!1),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),e){var r=n(t.textures),o=n(t.images);r.length>0&&(i.textures=r),o.length>0&&(i.images=o)}return i},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,i=null;if(null!==e){var n=e.length;i=new Array(n);for(var r=0;r!==n;++r)i[r]=e[r].clone()}return this.clippingPlanes=i,this.shadowSide=t.shadowSide,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Mn.prototype=Object.create(xn.prototype),Mn.prototype.constructor=Mn,Mn.prototype.isShaderMaterial=!0,Mn.prototype.copy=function(t){return xn.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=vi(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},Mn.prototype.toJSON=function(t){var e=xn.prototype.toJSON.call(this,t);for(var i in e.uniforms={},this.uniforms){var n=this.uniforms[i].value;n&&n.isTexture?e.uniforms[i]={type:"t",value:n.toJSON(t).uuid}:n&&n.isColor?e.uniforms[i]={type:"c",value:n.getHex()}:n&&n.isVector2?e.uniforms[i]={type:"v2",value:n.toArray()}:n&&n.isVector3?e.uniforms[i]={type:"v3",value:n.toArray()}:n&&n.isVector4?e.uniforms[i]={type:"v4",value:n.toArray()}:n&&n.isMatrix4?e.uniforms[i]={type:"m4",value:n.toArray()}:e.uniforms[i]={value:n}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;var r={};for(var o in this.extensions)!0===this.extensions[o]&&(r[o]=!0);return Object.keys(r).length>0&&(e.extensions=r),e},Object.assign(Tn.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&&(e=new Je),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(){var t=new Je;return function(e){return this.origin.copy(this.at(e,t)),this}}(),closestPointToPoint:function(t,e){void 0===e&&(e=new Je),e.subVectors(t,this.origin);var i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(i).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(){var t=new Je;return function(e){var i=t.subVectors(e,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(e):(t.copy(this.direction).multiplyScalar(i).add(this.origin),t.distanceToSquared(e))}}(),distanceSqToSegment:(un=new Je,hn=new Je,cn=new Je,function(t,e,i,n){un.copy(t).add(e).multiplyScalar(.5),hn.copy(e).sub(t).normalize(),cn.copy(this.origin).sub(un);var r,o,a,s,l=.5*t.distanceTo(e),u=-this.direction.dot(hn),h=cn.dot(this.direction),c=-cn.dot(hn),d=cn.lengthSq(),p=Math.abs(1-u*u);if(p>0)if(o=u*h-c,s=l*p,(r=u*c-h)>=0)if(o>=-s)if(o<=s){var f=1/p;a=(r*=f)*(r+u*(o*=f)+2*h)+o*(u*r+o+2*c)+d}else o=l,a=-(r=Math.max(0,-(u*o+h)))*r+o*(o+2*c)+d;else o=-l,a=-(r=Math.max(0,-(u*o+h)))*r+o*(o+2*c)+d;else o<=-s?a=-(r=Math.max(0,-(-u*l+h)))*r+(o=r>0?-l:Math.min(Math.max(-l,-c),l))*(o+2*c)+d:o<=s?(r=0,a=(o=Math.min(Math.max(-l,-c),l))*(o+2*c)+d):a=-(r=Math.max(0,-(u*l+h)))*r+(o=r>0?l:Math.min(Math.max(-l,-c),l))*(o+2*c)+d;else o=u>0?-l:l,a=-(r=Math.max(0,-(u*o+h)))*r+o*(o+2*c)+d;return i&&i.copy(this.direction).multiplyScalar(r).add(this.origin),n&&n.copy(hn).multiplyScalar(o).add(un),a}),intersectSphere:function(){var t=new Je;return function(e,i){t.subVectors(e.center,this.origin);var n=t.dot(this.direction),r=t.dot(t)-n*n,o=e.radius*e.radius;if(r>o)return null;var a=Math.sqrt(o-r),s=n-a,l=n+a;return s<0&&l<0?null:s<0?this.at(l,i):this.at(s,i)}}(),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 i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null},intersectPlane:function(t,e){var i=this.distanceToPlane(t);return null===i?null:this.at(i,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 i,n,r,o,a,s,l=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,c=this.origin;return l>=0?(i=(t.min.x-c.x)*l,n=(t.max.x-c.x)*l):(i=(t.max.x-c.x)*l,n=(t.min.x-c.x)*l),u>=0?(r=(t.min.y-c.y)*u,o=(t.max.y-c.y)*u):(r=(t.max.y-c.y)*u,o=(t.min.y-c.y)*u),i>o||r>n?null:((r>i||i!=i)&&(i=r),(o=0?(a=(t.min.z-c.z)*h,s=(t.max.z-c.z)*h):(a=(t.max.z-c.z)*h,s=(t.min.z-c.z)*h),i>s||a>n?null:((a>i||i!=i)&&(i=a),(s=0?i:n,e)))},intersectsBox:(ln=new Je,function(t){return null!==this.intersectBox(t,ln)}),intersectTriangle:function(){var t=new Je,e=new Je,i=new Je,n=new Je;return function(r,o,a,s,l){e.subVectors(o,r),i.subVectors(a,r),n.crossVectors(e,i);var u,h=this.direction.dot(n);if(h>0){if(s)return null;u=1}else{if(!(h<0))return null;u=-1,h=-h}t.subVectors(this.origin,r);var c=u*this.direction.dot(i.crossVectors(t,i));if(c<0)return null;var d=u*this.direction.dot(e.cross(t));if(d<0)return null;if(c+d>h)return null;var p=-u*t.dot(n);return p<0?null:this.at(p/h,l)}}(),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(Sn,{getNormal:(pn=new Je,function(t,e,i,n){void 0===n&&(n=new Je),n.subVectors(i,e),pn.subVectors(t,e),n.cross(pn);var r=n.lengthSq();return r>0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)}),getBarycoord:function(){var t=new Je,e=new Je,i=new Je;return function(n,r,o,a,s){t.subVectors(a,r),e.subVectors(o,r),i.subVectors(n,r);var l=t.dot(t),u=t.dot(e),h=t.dot(i),c=e.dot(e),d=e.dot(i),p=l*c-u*u;if(void 0===s&&(s=new Je),0===p)return s.set(-2,-1,-1);var f=1/p,m=(c*h-u*d)*f,g=(l*d-u*h)*f;return s.set(1-m-g,g,m)}}(),containsPoint:function(){var t=new Je;return function(e,i,n,r){return Sn.getBarycoord(e,i,n,r,t),t.x>=0&&t.y>=0&&t.x+t.y<=1}}(),getUV:(dn=new Je,function(t,e,i,n,r,o,a,s){return this.getBarycoord(t,e,i,n,dn),s.set(0,0),s.addScaledVector(r,dn.x),s.addScaledVector(o,dn.y),s.addScaledVector(a,dn.z),s})}),Object.assign(Sn.prototype,{set:function(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this},setFromPointsAndIndices:function(t,e,i,n){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[n]),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:function(){var t=new Je,e=new Je;return function(){return t.subVectors(this.c,this.b),e.subVectors(this.a,this.b),.5*t.cross(e).length()}}(),getMidpoint:function(t){return void 0===t&&(t=new Je),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return Sn.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(t=new Je),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return Sn.getBarycoord(t,this.a,this.b,this.c,e)},containsPoint:function(t){return Sn.containsPoint(t,this.a,this.b,this.c)},getUV:function(t,e,i,n,r){return Sn.getUV(t,this.a,this.b,this.c,e,i,n,r)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:(fn=new Je,mn=new Je,gn=new Je,vn=new Je,yn=new Je,bn=new Je,function(t,e){void 0===e&&(e=new Je);var i,n,r=this.a,o=this.b,a=this.c;fn.subVectors(o,r),mn.subVectors(a,r),vn.subVectors(t,r);var s=fn.dot(vn),l=mn.dot(vn);if(s<=0&&l<=0)return e.copy(r);yn.subVectors(t,o);var u=fn.dot(yn),h=mn.dot(yn);if(u>=0&&h<=u)return e.copy(o);var c=s*h-u*l;if(c<=0&&s>=0&&u<=0)return i=s/(s-u),e.copy(r).addScaledVector(fn,i);bn.subVectors(t,a);var d=fn.dot(bn),p=mn.dot(bn);if(p>=0&&d<=p)return e.copy(a);var f=d*l-s*p;if(f<=0&&l>=0&&p<=0)return n=l/(l-p),e.copy(r).addScaledVector(mn,n);var m=u*p-d*h;if(m<=0&&h-u>=0&&d-p>=0)return gn.subVectors(a,o),n=(h-u)/(h-u+(d-p)),e.copy(o).addScaledVector(gn,n);var g=1/(m+f+c);return i=f*g,n=c*g,e.copy(r).addScaledVector(fn,i).addScaledVector(mn,n)}),equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}),_n.prototype=Object.create(xn.prototype),_n.prototype.constructor=_n,_n.prototype.isMeshBasicMaterial=!0,_n.prototype.copy=function(t){return xn.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},An.prototype=Object.assign(Object.create(Bi.prototype),{constructor:An,isMesh:!0,setDrawMode:function(t){this.drawMode=t},copy:function(t){return Bi.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,i,n=this.geometry;if(n.isBufferGeometry){var r=n.morphAttributes,o=Object.keys(r);if(o.length>0){var a=r[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;ti.far?null:{distance:l,point:p.clone(),object:t}}function m(t,e,i,a,s,l,p,m,g){n.fromBufferAttribute(s,p),r.fromBufferAttribute(s,m),o.fromBufferAttribute(s,g);var v=f(t,e,i,a,n,r,o,d);if(v){l&&(u.fromBufferAttribute(l,p),h.fromBufferAttribute(l,m),c.fromBufferAttribute(l,g),v.uv=Sn.getUV(d,n,r,o,u,h,c,new Ze));var y=new Di(p,m,g);Sn.getNormal(n,r,o,y.normal),v.face=y}return v}return function(p,g){var v,y=this.geometry,b=this.material,w=this.matrixWorld;if(void 0!==b&&(null===y.boundingSphere&&y.computeBoundingSphere(),i.copy(y.boundingSphere),i.applyMatrix4(w),!1!==p.ray.intersectsSphere(i)&&(t.getInverse(w),e.copy(p.ray).applyMatrix4(t),null===y.boundingBox||!1!==e.intersectsBox(y.boundingBox))))if(y.isBufferGeometry){var x,M,T,S,_,A,P,C,E,D=y.index,L=y.attributes.position,O=y.attributes.uv,I=y.groups,R=y.drawRange;if(null!==D)if(Array.isArray(b))for(S=0,A=I.length;S0&&(B=j);for(var H=0,G=V.length;H0)return t;var r=e*i,o=Gn[r];if(void 0===o&&(o=new Float32Array(r),Gn[r]=o),0!==e){n.toArray(o,0);for(var a=1,s=0;a!==e;++a)s+=i,t[a].toArray(o,s)}return o}function Kn(t,e){if(t.length!==e.length)return!1;for(var i=0,n=t.length;i/gm,(function(t,e){var i=gi[e];if(void 0===i)throw new Error("Can not resolve #include <"+e+">");return Br(i)}))}function zr(t){return t.replace(/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,(function(t,e,i,n){for(var r="",o=parseInt(e);o0?t.gammaFactor:1,x=a.isWebGL2?"":function(t,e,i){return[(t=t||{}).derivatives||e.envMapCubeUV||e.bumpMap||e.normalMap&&!e.objectSpaceNormalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(t.fragDepth||e.logarithmicDepthBuffer)&&i.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",t.drawBuffers&&i.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(t.shaderTextureLOD||e.envMap)&&i.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Nr).join("\n")}(n.extensions,o,e),S=function(t){var e=[];for(var i in t){var n=t[i];!1!==n&&e.push("#define "+i+" "+n)}return e.join("\n")}(l),_=s.createProgram();if(n.isRawShaderMaterial?((m=[S].filter(Nr).join("\n")).length>0&&(m+="\n"),(g=[x,S].filter(Nr).join("\n")).length>0&&(g+="\n")):(m=["precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+r.name,S,o.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+w,"#define MAX_BONES "+o.maxBones,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+p:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.normalMap&&o.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",o.displacementMap&&o.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexColors?"#define USE_COLOR":"",o.flatShading?"#define FLAT_SHADED":"",o.skinning?"#define USE_SKINNING":"",o.useVertexTexture?"#define BONE_TEXTURE":"",o.morphTargets?"#define USE_MORPHTARGETS":"",o.morphNormals&&!1===o.flatShading?"#define USE_MORPHNORMALS":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+c:"",o.sizeAttenuation?"#define USE_SIZEATTENUATION":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&(a.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(Nr).join("\n"),g=[x,"precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+r.name,S,o.alphaTest?"#define ALPHATEST "+o.alphaTest+(o.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+w,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.matcap?"#define USE_MATCAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+d:"",o.envMap?"#define "+p:"",o.envMap?"#define "+f:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.normalMap&&o.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexColors?"#define USE_COLOR":"",o.gradientMap?"#define USE_GRADIENTMAP":"",o.flatShading?"#define FLAT_SHADED":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+c:"",o.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",o.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&(a.isWebGL2||e.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",o.envMap&&(a.isWebGL2||e.get("EXT_shader_texture_lod"))?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",o.toneMapping!==ct?"#define TONE_MAPPING":"",o.toneMapping!==ct?gi.tonemapping_pars_fragment:"",o.toneMapping!==ct?Rr("toneMapping",o.toneMapping):"",o.dithering?"#define DITHERING":"",o.outputEncoding||o.mapEncoding||o.matcapEncoding||o.envMapEncoding||o.emissiveMapEncoding?gi.encodings_pars_fragment:"",o.mapEncoding?Ir("mapTexelToLinear",o.mapEncoding):"",o.matcapEncoding?Ir("matcapTexelToLinear",o.matcapEncoding):"",o.envMapEncoding?Ir("envMapTexelToLinear",o.envMapEncoding):"",o.emissiveMapEncoding?Ir("emissiveMapTexelToLinear",o.emissiveMapEncoding):"",o.outputEncoding?(v="linearToOutputTexel",y=o.outputEncoding,b=Or(y),"vec4 "+v+"( vec4 value ) { return LinearTo"+b[0]+b[1]+"; }"):"",o.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Nr).join("\n")),u=Fr(u=kr(u=Br(u),o),o),h=Fr(h=kr(h=Br(h),o),o),u=zr(u),h=zr(h),a.isWebGL2&&!n.isRawShaderMaterial){var A=!1,P=/^\s*#version\s+300\s+es\s*\n/;n.isShaderMaterial&&null!==u.match(P)&&null!==h.match(P)&&(A=!0,u=u.replace(P,""),h=h.replace(P,"")),m=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+m,g=["#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"+g}var C=g+h,E=Dr(s,35633,m+u),D=Dr(s,35632,C);s.attachShader(_,E),s.attachShader(_,D),void 0!==n.index0AttributeName?s.bindAttribLocation(_,0,n.index0AttributeName):!0===o.morphTargets&&s.bindAttribLocation(_,0,"position"),s.linkProgram(_);var L,O,I=s.getProgramInfoLog(_).trim(),R=s.getShaderInfoLog(E).trim(),N=s.getShaderInfoLog(D).trim(),k=!0,F=!0;return!1===s.getProgramParameter(_,35714)?k=!1:""!==I||""!==R&&""!==N||(F=!1),F&&(this.diagnostics={runnable:k,material:n,programLog:I,vertexShader:{log:R,prefix:m},fragmentShader:{log:N,prefix:g}}),s.deleteShader(E),s.deleteShader(D),this.getUniforms=function(){return void 0===L&&(L=new Er(s,_,t)),L},this.getAttributes=function(){return void 0===O&&(O=function(t,e){for(var i={},n=t.getProgramParameter(e,35721),r=0;r0,maxBones:d,useVertexTexture:i.floatVertexTextures,morphTargets:e.morphTargets,morphNormals:e.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:n.directional.length,numPointLights:n.point.length,numSpotLights:n.spot.length,numRectAreaLights:n.rectArea.length,numHemiLights:n.hemi.length,numClippingPlanes:l,numClipIntersection:u,dithering:e.dithering,shadowMapEnabled:t.shadowMap.enabled&&h.receiveShadow&&o.length>0,shadowMapType:t.shadowMap.type,toneMapping:t.toneMapping,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:e.premultipliedAlpha,alphaTest:e.alphaTest,doubleSided:e.side===A,flipSided:e.side===_,depthPacking:void 0!==e.depthPacking&&e.depthPacking}},this.getProgramCode=function(e,i){var n=[];if(i.shaderID?n.push(i.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(var r in e.defines)n.push(r),n.push(e.defines[r]);for(var a=0;a1&&i.sort(Hr),n.length>1&&n.sort(Gr)}}}function qr(){var t={};return{get:function(e,i){var n,r=t[e.id];return void 0===r?(n=new Wr,t[e.id]={},t[e.id][i.id]=n):void 0===(n=r[i.id])&&(n=new Wr,r[i.id]=n),n},dispose:function(){t={}}}}function Yr(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var i;switch(e.type){case"DirectionalLight":i={direction:new Je,color:new Si,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Ze};break;case"SpotLight":i={position:new Je,direction:new Je,color:new Si,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Ze};break;case"PointLight":i={position:new Je,color:new Si,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Ze,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":i={direction:new Je,skyColor:new Si,groundColor:new Si};break;case"RectAreaLight":i={color:new Si,position:new Je,halfWidth:new Je,halfHeight:new Je}}return t[e.id]=i,i}}}var Xr=0;function Zr(){var t=new Yr,e={id:Xr++,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:[]},i=new Je,n=new Ke,r=new Ke;return{setup:function(o,a,s){for(var l=0,u=0,h=0,c=0,d=0,p=0,f=0,m=0,g=s.matrixWorldInverse,v=0,y=o.length;v0:s&&s.isGeometry&&(m=s.morphTargets&&s.morphTargets.length>0)),e.isSkinnedMesh&&i.skinning;var g=0;m&&(g|=1),e.isSkinnedMesh&&i.skinning&&(g|=2),l=p[g]}if(t.localClippingEnabled&&!0===i.clipShadows&&0!==i.clippingPlanes.length){var v=l.uuid,y=i.uuid,b=c[v];void 0===b&&(b={},c[v]=b);var w=b[y];void 0===w&&(w=l.clone(),b[y]=w),l=w}return l.visible=i.visible,l.wireframe=i.wireframe,l.side=null!=i.shadowSide?i.shadowSide:d[i.side],l.clipShadows=i.clipShadows,l.clippingPlanes=i.clippingPlanes,l.clipIntersection=i.clipIntersection,l.wireframeLinewidth=i.wireframeLinewidth,l.linewidth=i.linewidth,n&&l.isMeshDistanceMaterial&&(l.referencePosition.copy(r),l.nearDistance=o,l.farDistance=a),l}function P(i,r,o,a){if(!1!==i.visible){if(i.layers.test(r.layers)&&(i.isMesh||i.isLine||i.isPoints)&&i.castShadow&&(!i.frustumCulled||n.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,i.matrixWorld);var s=e.update(i),u=i.material;if(Array.isArray(u))for(var h=s.groups,c=0,d=h.length;c=1):-1!==H.indexOf("OpenGL ES")&&(j=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(H)[1]),V=j>=2);var G=null,W={},q=new li,Y=new li;function X(e,i,n){var r=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(var a=0;ae||t.height>e){if("data"in t)return;var i=e/Math.max(t.width,t.height),n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return n.width=Math.floor(t.width*i),n.height=Math.floor(t.height*i),n.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,n.width,n.height),n}return t}function h(t){return Xe.isPowerOfTwo(t.width)&&Xe.isPowerOfTwo(t.height)}function c(t,e){return t.generateMipmaps&&e&&t.minFilter!==Ct&&t.minFilter!==Lt}function d(e,i,r,o){t.generateMipmap(e),n.get(i).__maxMipLevel=Math.log(Math.max(r,o))*Math.LOG2E}function p(t,e){if(!r.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 f(t){return t===Ct||t===Et||t===Dt?9728:9729}function m(e){var i=e.target;i.removeEventListener("dispose",m),function(e){var i=n.get(e);if(e.image&&i.__image__webglTextureCube)t.deleteTexture(i.__image__webglTextureCube);else{if(void 0===i.__webglInit)return;t.deleteTexture(i.__webglTexture)}n.remove(e)}(i),i.isVideoTexture&&delete l[i.id],a.memory.textures--}function g(e){var i=e.target;i.removeEventListener("dispose",g),function(e){var i=n.get(e),r=n.get(e.texture);if(!e)return;void 0!==r.__webglTexture&&t.deleteTexture(r.__webglTexture);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLRenderTargetCube)for(var o=0;o<6;o++)t.deleteFramebuffer(i.__webglFramebuffer[o]),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer[o]);else t.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer);n.remove(e.texture),n.remove(e)}(i),a.memory.textures--}function v(t,e){var r=n.get(t);if(t.isVideoTexture&&function(t){var e=t.id,i=a.render.frame;l[e]!==i&&(l[e]=i,t.update())}(t),t.version>0&&r.__version!==t.version){var o=t.image;if(void 0===o);else if(!1!==o.complete)return void b(r,t,e)}i.activeTexture(33984+e),i.bindTexture(3553,r.__webglTexture)}function y(i,a,s){var l;if(s?(t.texParameteri(i,10242,o.convert(a.wrapS)),t.texParameteri(i,10243,o.convert(a.wrapT)),t.texParameteri(i,10240,o.convert(a.magFilter)),t.texParameteri(i,10241,o.convert(a.minFilter))):(t.texParameteri(i,10242,33071),t.texParameteri(i,10243,33071),a.wrapS!==At||a.wrapT,t.texParameteri(i,10240,f(a.magFilter)),t.texParameteri(i,10241,f(a.minFilter)),a.minFilter!==Ct&&a.minFilter),l=e.get("EXT_texture_filter_anisotropic")){if(a.type===Ut&&null===e.get("OES_texture_float_linear"))return;if(a.type===Vt&&null===(r.isWebGL2||e.get("OES_texture_half_float_linear")))return;(a.anisotropy>1||n.get(a).__currentAnisotropy)&&(t.texParameterf(i,l.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),n.get(a).__currentAnisotropy=a.anisotropy)}}function b(e,n,l){var f;f=n.isDataTexture3D?32879:3553,void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",m),e.__webglTexture=t.createTexture(),a.memory.textures++),i.activeTexture(33984+l),i.bindTexture(f,e.__webglTexture),t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment);var g=u(n.image,r.maxTextureSize);(function(t){return!r.isWebGL2&&(t.wrapS!==At||t.wrapT!==At||t.minFilter!==Ct&&t.minFilter!==Lt)})(n)&&!1===h(g)&&(g=function(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof ImageBitmap?(void 0===s&&(s=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),s.width=Xe.floorPowerOfTwo(t.width),s.height=Xe.floorPowerOfTwo(t.height),s.getContext("2d").drawImage(t,0,0,s.width,s.height),s):t}(g));var v=h(g),b=o.convert(n.format),w=o.convert(n.type),x=p(b,w);y(f,n,v);var M,T=n.mipmaps;if(n.isDepthTexture){if(x=6402,n.type===Ut){if(!r.isWebGL2)throw new Error("Float Depth Texture only supported in WebGL2.0");x=36012}else r.isWebGL2&&(x=33189);n.format===Jt&&6402===x&&n.type!==Ft&&n.type!==zt&&(n.type=Ft,w=o.convert(n.type)),n.format===$t&&(x=34041,n.type!==Wt&&(n.type=Wt,w=o.convert(n.type))),i.texImage2D(3553,0,x,g.width,g.height,0,b,w,null)}else if(n.isDataTexture)if(T.length>0&&v){for(var S=0,_=T.length;S<_;S++)M=T[S],i.texImage2D(3553,S,x,M.width,M.height,0,b,w,M.data);n.generateMipmaps=!1,e.__maxMipLevel=T.length-1}else i.texImage2D(3553,0,x,g.width,g.height,0,b,w,g.data),e.__maxMipLevel=0;else if(n.isCompressedTexture){for(S=0,_=T.length;S<_;S++)M=T[S],n.format!==Xt&&n.format!==Yt?i.getCompressedTextureFormats().indexOf(b)>-1&&i.compressedTexImage2D(3553,S,x,M.width,M.height,0,M.data):i.texImage2D(3553,S,x,M.width,M.height,0,b,w,M.data);e.__maxMipLevel=T.length-1}else if(n.isDataTexture3D)i.texImage3D(32879,0,x,g.width,g.height,g.depth,0,b,w,g.data),e.__maxMipLevel=0;else if(T.length>0&&v){for(S=0,_=T.length;S<_;S++)M=T[S],i.texImage2D(3553,S,x,b,w,M);n.generateMipmaps=!1,e.__maxMipLevel=T.length-1}else i.texImage2D(3553,0,x,b,w,g),e.__maxMipLevel=0;c(n,v)&&d(3553,n,g.width,g.height),e.__version=n.version,n.onUpdate&&n.onUpdate(n)}function w(e,r,a,s){var l=o.convert(r.texture.format),u=o.convert(r.texture.type),h=p(l,u);i.texImage2D(s,0,h,r.width,r.height,0,l,u,null),t.bindFramebuffer(36160,e),t.framebufferTexture2D(36160,a,s,n.get(r.texture).__webglTexture,0),t.bindFramebuffer(36160,null)}function x(e,i){t.bindRenderbuffer(36161,e),i.depthBuffer&&!i.stencilBuffer?(t.renderbufferStorage(36161,33189,i.width,i.height),t.framebufferRenderbuffer(36160,36096,36161,e)):i.depthBuffer&&i.stencilBuffer?(t.renderbufferStorage(36161,34041,i.width,i.height),t.framebufferRenderbuffer(36160,33306,36161,e)):t.renderbufferStorage(36161,32854,i.width,i.height),t.bindRenderbuffer(36161,null)}function M(e){var i=n.get(e),r=!0===e.isWebGLRenderTargetCube;if(e.depthTexture){if(r)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,i){if(i&&i.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,e),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),v(i.depthTexture,0);var r=n.get(i.depthTexture).__webglTexture;if(i.depthTexture.format===Jt)t.framebufferTexture2D(36160,36096,3553,r,0);else{if(i.depthTexture.format!==$t)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(36160,33306,3553,r,0)}}(i.__webglFramebuffer,e)}else if(r){i.__webglDepthbuffer=[];for(var o=0;o<6;o++)t.bindFramebuffer(36160,i.__webglFramebuffer[o]),i.__webglDepthbuffer[o]=t.createRenderbuffer(),x(i.__webglDepthbuffer[o],e)}else t.bindFramebuffer(36160,i.__webglFramebuffer),i.__webglDepthbuffer=t.createRenderbuffer(),x(i.__webglDepthbuffer,e);t.bindFramebuffer(36160,null)}this.setTexture2D=v,this.setTexture3D=function(t,e){var r=n.get(t);t.version>0&&r.__version!==t.version?b(r,t,e):(i.activeTexture(33984+e),i.bindTexture(32879,r.__webglTexture))},this.setTextureCube=function(e,s){var l=n.get(e);if(6===e.image.length)if(e.version>0&&l.__version!==e.version){l.__image__webglTextureCube||(e.addEventListener("dispose",m),l.__image__webglTextureCube=t.createTexture(),a.memory.textures++),i.activeTexture(33984+s),i.bindTexture(34067,l.__image__webglTextureCube),t.pixelStorei(37440,e.flipY);for(var f=e&&e.isCompressedTexture,g=e.image[0]&&e.image[0].isDataTexture,v=[],b=0;b<6;b++)v[b]=f||g?g?e.image[b].image:e.image[b]:u(e.image[b],r.maxCubemapSize);var w=v[0],x=h(w),M=o.convert(e.format),T=o.convert(e.type),S=p(M,T);y(34067,e,x);for(b=0;b<6;b++)if(f)for(var _,A=v[b].mipmaps,P=0,C=A.length;P-1&&i.compressedTexImage2D(34069+b,P,S,_.width,_.height,0,_.data):i.texImage2D(34069+b,P,S,_.width,_.height,0,M,T,_.data);else g?i.texImage2D(34069+b,0,S,v[b].width,v[b].height,0,M,T,v[b].data):i.texImage2D(34069+b,0,S,M,T,v[b]);l.__maxMipLevel=f?A.length-1:0,c(e,x)&&d(34067,e,w.width,w.height),l.__version=e.version,e.onUpdate&&e.onUpdate(e)}else i.activeTexture(33984+s),i.bindTexture(34067,l.__image__webglTextureCube)},this.setTextureCubeDynamic=function(t,e){i.activeTexture(33984+e),i.bindTexture(34067,n.get(t).__webglTexture)},this.setupRenderTarget=function(e){var r=n.get(e),o=n.get(e.texture);e.addEventListener("dispose",g),o.__webglTexture=t.createTexture(),a.memory.textures++;var s=!0===e.isWebGLRenderTargetCube,l=h(e);if(s){r.__webglFramebuffer=[];for(var u=0;u<6;u++)r.__webglFramebuffer[u]=t.createFramebuffer()}else r.__webglFramebuffer=t.createFramebuffer();if(s){i.bindTexture(34067,o.__webglTexture),y(34067,e.texture,l);for(u=0;u<6;u++)w(r.__webglFramebuffer[u],e,36064,34069+u);c(e.texture,l)&&d(34067,e.texture,e.width,e.height),i.bindTexture(34067,null)}else i.bindTexture(3553,o.__webglTexture),y(3553,e.texture,l),w(r.__webglFramebuffer,e,36064,3553),c(e.texture,l)&&d(3553,e.texture,e.width,e.height),i.bindTexture(3553,null);e.depthBuffer&&M(e)},this.updateRenderTargetMipmap=function(t){var e=t.texture;if(c(e,h(t))){var r=t.isWebGLRenderTargetCube?34067:3553,o=n.get(e).__webglTexture;i.bindTexture(r,o),d(r,e,t.width,t.height),i.bindTexture(r,null)}}}function no(t,e,i){return{convert:function(t){var n;if(t===_t)return 10497;if(t===At)return 33071;if(t===Pt)return 33648;if(t===Ct)return 9728;if(t===Et)return 9984;if(t===Dt)return 9986;if(t===Lt)return 9729;if(t===Ot)return 9985;if(t===It)return 9987;if(t===Rt)return 5121;if(t===jt)return 32819;if(t===Ht)return 32820;if(t===Gt)return 33635;if(t===Nt)return 5120;if(t===kt)return 5122;if(t===Ft)return 5123;if(t===Bt)return 5124;if(t===zt)return 5125;if(t===Ut)return 5126;if(t===Vt){if(i.isWebGL2)return 5131;if(null!==(n=e.get("OES_texture_half_float")))return n.HALF_FLOAT_OES}if(t===qt)return 6406;if(t===Yt)return 6407;if(t===Xt)return 6408;if(t===Zt)return 6409;if(t===Kt)return 6410;if(t===Jt)return 6402;if(t===$t)return 34041;if(t===te)return 6403;if(t===B)return 32774;if(t===z)return 32778;if(t===U)return 32779;if(t===H)return 0;if(t===G)return 1;if(t===W)return 768;if(t===q)return 769;if(t===Y)return 770;if(t===X)return 771;if(t===Z)return 772;if(t===K)return 773;if(t===Q)return 774;if(t===J)return 775;if(t===$)return 776;if((t===ee||t===ie||t===ne||t===re)&&null!==(n=e.get("WEBGL_compressed_texture_s3tc"))){if(t===ee)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===ie)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===ne)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===re)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((t===oe||t===ae||t===se||t===le)&&null!==(n=e.get("WEBGL_compressed_texture_pvrtc"))){if(t===oe)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===ae)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===se)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===le)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===ue&&null!==(n=e.get("WEBGL_compressed_texture_etc1")))return n.COMPRESSED_RGB_ETC1_WEBGL;if((t===he||t===ce||t===de||t===pe||t===fe||t===me||t===ge||t===ve||t===ye||t===be||t===we||t===xe||t===Me||t===Te)&&null!==(n=e.get("WEBGL_compressed_texture_astc")))return t;if(t===V||t===j){if(i.isWebGL2){if(t===V)return 32775;if(t===j)return 32776}if(null!==(n=e.get("EXT_blend_minmax"))){if(t===V)return n.MIN_EXT;if(t===j)return n.MAX_EXT}}if(t===Wt){if(i.isWebGL2)return 34042;if(null!==(n=e.get("WEBGL_depth_texture")))return n.UNSIGNED_INT_24_8_WEBGL}return 0}}}function ro(){Bi.call(this),this.type="Group"}function oo(){Bi.call(this),this.type="Camera",this.matrixWorldInverse=new Ke,this.projectionMatrix=new Ke,this.projectionMatrixInverse=new Ke}function ao(t,e,i,n){oo.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==i?i:.1,this.far=void 0!==n?n:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function so(t){ao.call(this),this.cameras=t||[]}Jr.prototype=Object.create(xn.prototype),Jr.prototype.constructor=Jr,Jr.prototype.isMeshDepthMaterial=!0,Jr.prototype.copy=function(t){return xn.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},$r.prototype=Object.create(xn.prototype),$r.prototype.constructor=$r,$r.prototype.isMeshDistanceMaterial=!0,$r.prototype.copy=function(t){return xn.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},ro.prototype=Object.assign(Object.create(Bi.prototype),{constructor:ro,isGroup:!0}),oo.prototype=Object.assign(Object.create(Bi.prototype),{constructor:oo,isCamera:!0,copy:function(t,e){return Bi.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&&(t=new Je),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){Bi.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),ao.prototype=Object.assign(Object.create(oo.prototype),{constructor:ao,isPerspectiveCamera:!0,copy:function(t,e){return oo.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*Xe.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*Xe.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*Xe.RAD2DEG*Math.atan(Math.tan(.5*Xe.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,i,n,r,o){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=i,this.view.offsetY=n,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*Xe.DEG2RAD*this.fov)/this.zoom,i=2*e,n=this.aspect*i,r=-.5*n,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;r+=o.offsetX*n/a,e-=o.offsetY*i/s,n*=o.width/a,i*=o.height/s}var l=this.filmOffset;0!==l&&(r+=t*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,e,e-i,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=Bi.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}}),so.prototype=Object.assign(Object.create(ao.prototype),{constructor:so,isArrayCamera:!0});var lo,uo,ho,co,po,fo,mo=new Je,go=new Je;function vo(t,e,i){mo.setFromMatrixPosition(e.matrixWorld),go.setFromMatrixPosition(i.matrixWorld);var n=mo.distanceTo(go),r=e.projectionMatrix.elements,o=i.projectionMatrix.elements,a=r[14]/(r[10]-1),s=r[14]/(r[10]+1),l=(r[9]+1)/r[5],u=(r[9]-1)/r[5],h=(r[8]-1)/r[0],c=(o[8]+1)/o[0],d=a*h,p=a*c,f=n/(-h+c),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=a+f,v=s+f,y=d-m,b=p+(n-m),w=l*s/v*g,x=u*s/v*g;t.projectionMatrix.makePerspective(y,b,w,x,g,v)}function yo(t){var e=this,i=null,n=null,r=null,o=[],a=new Ke,s=new Ke,l=1,u="stage";"undefined"!=typeof window&&"VRFrameData"in window&&(n=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",b,!1));var h=new Ke,c=new Qe,d=new Je,p=new ao;p.bounds=new li(0,0,.5,1),p.layers.enable(1);var f=new ao;f.bounds=new li(.5,0,.5,1),f.layers.enable(2);var m,g,v=new so([p,f]);function y(){return null!==i&&!0===i.isPresenting}function b(){if(y()){var n=i.getEyeParameters("left"),r=n.renderWidth*l,o=n.renderHeight*l;g=t.getPixelRatio(),m=t.getSize(),t.setDrawingBufferSize(2*r,o,1),M.start()}else e.enabled&&t.setDrawingBufferSize(m.width,m.height,g),M.stop()}v.layers.enable(1),v.layers.enable(2);var w=[];function x(t){for(var e=navigator.getGamepads&&navigator.getGamepads(),i=0,n=0,r=e.length;i=0){var l=n[a];if(void 0!==l){var u=l.normalized,h=l.itemSize,c=b.get(l);if(void 0===c)continue;var g=c.buffer,v=c.type,y=c.bytesPerElement;if(l.isInterleavedBufferAttribute){var w=l.data,x=w.stride,M=l.offset;w&&w.isInstancedInterleavedBuffer?(m.enableAttributeAndDivisor(s,w.meshPerAttribute),void 0===i.maxInstancedCount&&(i.maxInstancedCount=w.meshPerAttribute*w.count)):m.enableAttribute(s),d.bindBuffer(34962,g),d.vertexAttribPointer(s,h,v,u,x*y,M*y)}else l.isInstancedBufferAttribute?(m.enableAttributeAndDivisor(s,l.meshPerAttribute),void 0===i.maxInstancedCount&&(i.maxInstancedCount=l.meshPerAttribute*l.count)):m.enableAttribute(s),d.bindBuffer(34962,g),d.vertexAttribPointer(s,h,v,u,0,0)}else if(void 0!==o){var T=o[a];if(void 0!==T)switch(T.length){case 2:d.vertexAttrib2fv(s,T);break;case 3:d.vertexAttrib3fv(s,T);break;case 4:d.vertexAttrib4fv(s,T);break;default:d.vertexAttrib1fv(s,T)}}}}m.disableUnusedAttributes()}(n,s,i),null!==h&&d.bindBuffer(34963,u.buffer));var y=1/0;null!==h?y=h.count:void 0!==c&&(y=c.count);var x=i.drawRange.start*g,M=i.drawRange.count*g,T=null!==o?o.start*g:0,S=null!==o?o.count*g:1/0,_=Math.max(x,T),A=Math.min(y,x+M,T+S)-1,D=Math.max(0,A-_+1);if(0!==D){if(r.isMesh)if(!0===n.wireframe)m.setLineWidth(n.wireframeLinewidth*it()),v.setMode(1);else switch(r.drawMode){case Ie:v.setMode(4);break;case Re:v.setMode(5);break;case Ne:v.setMode(6)}else if(r.isLine){var L=n.linewidth;void 0===L&&(L=1),m.setLineWidth(L*it()),r.isLineSegments?v.setMode(1):r.isLineLoop?v.setMode(2):v.setMode(3)}else r.isPoints?v.setMode(0):r.isSprite&&v.setMode(4);i&&i.isInstancedBufferGeometry?i.maxInstancedCount>0&&v.renderInstances(i,_,D):v.render(_,D)}},this.compile=function(t,e){(c=S.get(t,e)).init(),t.traverse((function(t){t.isLight&&(c.pushLight(t),t.castShadow&&c.pushShadow(t))})),c.setupLights(e),t.traverse((function(e){if(e.material)if(Array.isArray(e.material))for(var i=0;i=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(m=0;m=0&&t.numSupportedMorphNormals++}var g=n.shader.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(n.numClippingPlanes=Q.numPlanes,n.numIntersection=Q.numIntersection,g.clippingPlanes=Q.uniform),n.fog=e,void 0===a&&(n.lightsHash=a={}),a.stateID=s.stateID,a.directionalLength=s.directionalLength,a.pointLength=s.pointLength,a.spotLength=s.spotLength,a.rectAreaLength=s.rectAreaLength,a.hemiLength=s.hemiLength,a.shadowsLength=s.shadowsLength,t.lights&&(g.ambientLightColor.value=r.state.ambient,g.directionalLights.value=r.state.directional,g.spotLights.value=r.state.spot,g.rectAreaLights.value=r.state.rectArea,g.pointLights.value=r.state.point,g.hemisphereLights.value=r.state.hemi,g.directionalShadowMap.value=r.state.directionalShadowMap,g.directionalShadowMatrix.value=r.state.directionalShadowMatrix,g.spotShadowMap.value=r.state.spotShadowMap,g.spotShadowMatrix.value=r.state.spotShadowMatrix,g.pointShadowMap.value=r.state.pointShadowMap,g.pointShadowMatrix.value=r.state.pointShadowMatrix);var y=n.program.getUniforms(),b=Er.seqWithValue(y.seq,g);n.uniformsList=b}function yt(t,e,i,n){H=0;var r=v.get(i),o=c.state.lights,a=r.lightsHash,s=o.state.hash;if(J&&($||t!==B)){var l=t===B&&i.id===k;Q.setState(i.clippingPlanes,i.clipIntersection,i.clipShadows,t,r,l)}!1===i.needsUpdate&&(void 0===r.program||i.fog&&r.fog!==e?i.needsUpdate=!0:(!i.lights||a.stateID===s.stateID&&a.directionalLength===s.directionalLength&&a.pointLength===s.pointLength&&a.spotLength===s.spotLength&&a.rectAreaLength===s.rectAreaLength&&a.hemiLength===s.hemiLength&&a.shadowsLength===s.shadowsLength)&&(void 0===r.numClippingPlanes||r.numClippingPlanes===Q.numPlanes&&r.numIntersection===Q.numIntersection)||(i.needsUpdate=!0)),i.needsUpdate&&(vt(i,e,n),i.needsUpdate=!1);var u,h,p=!1,g=!1,y=!1,b=r.program,w=b.getUniforms(),x=r.shader.uniforms;if(m.useProgram(b.program)&&(p=!0,g=!0,y=!0),i.id!==k&&(k=i.id,g=!0),p||B!==t){if(w.setValue(d,"projectionMatrix",t.projectionMatrix),f.logarithmicDepthBuffer&&w.setValue(d,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),B!==t&&(B=t,g=!0,y=!0),i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.envMap){var M=w.map.cameraPosition;void 0!==M&&M.setValue(d,et.setFromMatrixPosition(t.matrixWorld))}(i.isMeshPhongMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.skinning)&&w.setValue(d,"viewMatrix",t.matrixWorldInverse)}if(i.skinning){w.setOptional(d,n,"bindMatrix"),w.setOptional(d,n,"bindMatrixInverse");var T=n.skeleton;if(T){var S=T.bones;if(f.floatVertexTextures){if(void 0===T.boneTexture){var A=Math.sqrt(4*S.length);A=Xe.ceilPowerOfTwo(A),A=Math.max(A,4);var P=new Float32Array(A*A*4);P.set(T.boneMatrices);var C=new ci(P,A,A,Xt,Ut);C.needsUpdate=!0,T.boneMatrices=P,T.boneTexture=C,T.boneTextureSize=A}w.setValue(d,"boneTexture",T.boneTexture),w.setValue(d,"boneTextureSize",T.boneTextureSize)}else w.setOptional(d,T,"boneMatrices")}}return g&&(w.setValue(d,"toneMappingExposure",L.toneMappingExposure),w.setValue(d,"toneMappingWhitePoint",L.toneMappingWhitePoint),i.lights&&(h=y,(u=x).ambientLightColor.needsUpdate=h,u.directionalLights.needsUpdate=h,u.pointLights.needsUpdate=h,u.spotLights.needsUpdate=h,u.rectAreaLights.needsUpdate=h,u.hemisphereLights.needsUpdate=h),e&&i.fog&&function(t,e){t.fogColor.value=e.color,e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)}(x,e),i.isMeshBasicMaterial?bt(x,i):i.isMeshLambertMaterial?(bt(x,i),function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(x,i)):i.isMeshPhongMaterial?(bt(x,i),i.isMeshToonMaterial?function(t,e){wt(t,e),e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(x,i):wt(x,i)):i.isMeshStandardMaterial?(bt(x,i),i.isMeshPhysicalMaterial?function(t,e){xt(t,e),t.reflectivity.value=e.reflectivity,t.clearCoat.value=e.clearCoat,t.clearCoatRoughness.value=e.clearCoatRoughness}(x,i):xt(x,i)):i.isMeshMatcapMaterial?(bt(x,i),function(t,e){e.matcap&&(t.matcap.value=e.matcap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===_&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===_&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(x,i)):i.isMeshDepthMaterial?(bt(x,i),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(x,i)):i.isMeshDistanceMaterial?(bt(x,i),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}(x,i)):i.isMeshNormalMaterial?(bt(x,i),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===_&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===_&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(x,i)):i.isLineBasicMaterial?(function(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity}(x,i),i.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(x,i)):i.isPointsMaterial?function(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity,t.size.value=e.size*q,t.scale.value=.5*W,t.map.value=e.map,null!==e.map&&(!0===e.map.matrixAutoUpdate&&e.map.updateMatrix(),t.uvTransform.value.copy(e.map.matrix))}(x,i):i.isSpriteMaterial?function(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity,t.rotation.value=e.rotation,t.map.value=e.map,null!==e.map&&(!0===e.map.matrixAutoUpdate&&e.map.updateMatrix(),t.uvTransform.value.copy(e.map.matrix))}(x,i):i.isShadowMaterial&&(x.color.value=i.color,x.opacity.value=i.opacity),void 0!==x.ltc_1&&(x.ltc_1.value=Ai.LTC_1),void 0!==x.ltc_2&&(x.ltc_2.value=Ai.LTC_2),Er.upload(d,r.uniformsList,x,L)),i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(Er.upload(d,r.uniformsList,x,L),i.uniformsNeedUpdate=!1),i.isSpriteMaterial&&w.setValue(d,"center",n.center),w.setValue(d,"modelViewMatrix",n.modelViewMatrix),w.setValue(d,"normalMatrix",n.normalMatrix),w.setValue(d,"modelMatrix",n.matrixWorld),b}function bt(t,e){var i;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=v.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?i=e.map:e.specularMap?i=e.specularMap:e.displacementMap?i=e.displacementMap:e.normalMap?i=e.normalMap:e.bumpMap?i=e.bumpMap:e.roughnessMap?i=e.roughnessMap:e.metalnessMap?i=e.metalnessMap:e.alphaMap?i=e.alphaMap:e.emissiveMap&&(i=e.emissiveMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix))}function wt(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===_&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===_&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function xt(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===_&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===_&&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){ot.isPresenting()||ct&&ct(t)})),"undefined"!=typeof window&&ft.setContext(window),this.setAnimationLoop=function(t){ct=t,ot.setAnimationLoop(t),ft.start()},this.render=function(t,e,i,n){if(e&&e.isCamera&&!O){F.geometry=null,F.program=null,F.wireframe=!1,k=-1,B=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),ot.enabled&&(e=ot.getCamera(e)),(c=S.get(t,e)).init(),t.onBeforeRender(L,t,e,i),tt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),K.setFromMatrix(tt),$=this.localClippingEnabled,J=Q.init(this.clippingPlanes,$,e),(h=T.get(t,e)).init(),function t(e,i,n){if(!1===e.visible)return;if(e.layers.test(i.layers))if(e.isLight)c.pushLight(e),e.castShadow&&c.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||K.intersectsSprite(e)){n&&et.setFromMatrixPosition(e.matrixWorld).applyMatrix4(tt);var r=x.update(e),o=e.material;h.push(e,r,o,et.z,null)}}else if(e.isImmediateRenderObject)n&&et.setFromMatrixPosition(e.matrixWorld).applyMatrix4(tt),h.push(e,null,e.material,et.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.update(),!e.frustumCulled||K.intersectsObject(e))){n&&et.setFromMatrixPosition(e.matrixWorld).applyMatrix4(tt);r=x.update(e),o=e.material;if(Array.isArray(o))for(var a=r.groups,s=0,l=a.length;s=0&&e<=t.width-n&&i>=0&&i<=t.height-r&&d.readPixels(e,i,n,r,D.convert(u),D.convert(h),o)}finally{s&&d.bindFramebuffer(36160,N)}}}},this.copyFramebufferToTexture=function(t,e,i){var n=e.image.width,r=e.image.height,o=D.convert(e.format);this.setTexture2D(e,0),d.copyTexImage2D(3553,i||0,o,t.x,t.y,n,r,0)},this.copyTextureToTexture=function(t,e,i,n){var r=e.image.width,o=e.image.height,a=D.convert(i.format),s=D.convert(i.type);this.setTexture2D(i,0),e.isDataTexture?d.texSubImage2D(3553,n||0,t.x,t.y,r,o,a,s,e.image.data):d.texSubImage2D(3553,n||0,t.x,t.y,a,s,e.image)}}function xo(t,e){this.name="",this.color=new Si(t),this.density=void 0!==e?e:25e-5}function Mo(t,e,i){this.name="",this.color=new Si(t),this.near=void 0!==e?e:1,this.far=void 0!==i?i:1e3}function To(){Bi.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function So(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 _o(t,e,i,n){this.data=t,this.itemSize=e,this.offset=i,this.normalized=!0===n}function Ao(t){xn.call(this),this.type="SpriteMaterial",this.color=new Si(16777215),this.map=null,this.rotation=0,this.sizeAttenuation=!0,this.lights=!1,this.transparent=!0,this.setValues(t)}function Po(t){if(Bi.call(this),this.type="Sprite",void 0===lo){lo=new nn;var e=new So(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);lo.setIndex([0,1,2,0,2,3]),lo.addAttribute("position",new _o(e,3,0,!1)),lo.addAttribute("uv",new _o(e,2,3,!1))}this.geometry=lo,this.material=void 0!==t?t:new Ao,this.center=new Ze(.5,.5)}function Co(){Bi.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function Eo(t,e){t&&t.isGeometry,An.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Ke,this.bindMatrixInverse=new Ke}function Do(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{this.boneInverses=[];for(var i=0,n=this.bones.length;i=0?(t(v-u,g,d),p.subVectors(c,d)):(t(v+u,g,d),p.subVectors(d,c)),g-u>=0?(t(v,g-u,d),f.subVectors(c,d)):(t(v,g+u,d),f.subVectors(d,c)),h.crossVectors(p,f).normalize(),s.push(h.x,h.y,h.z),l.push(v,g)}}for(n=0;n.9&&a<.1&&(e<.2&&(o[t+0]+=1),i<.2&&(o[t+2]+=1),n<.2&&(o[t+4]+=1))}}()}(),this.addAttribute("position",new Qi(r,3)),this.addAttribute("normal",new Qi(r.slice(),3)),this.addAttribute("uv",new Qi(o,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}function Yo(t,e){ji.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Xo(t,e)),this.mergeVertices()}function Xo(t,e){qo.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 Zo(t,e){ji.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Ko(t,e)),this.mergeVertices()}function Ko(t,e){qo.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 Qo(t,e){ji.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Jo(t,e)),this.mergeVertices()}function Jo(t,e){var i=(1+Math.sqrt(5))/2,n=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1];qo.call(this,n,[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 $o(t,e){ji.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new ta(t,e)),this.mergeVertices()}function ta(t,e){var i=(1+Math.sqrt(5))/2,n=1/i,r=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-i,0,-n,i,0,n,-i,0,n,i,-n,-i,0,-n,i,0,n,-i,0,n,i,0,-i,0,-n,i,0,-n,-i,0,n,i,0,n];qo.call(this,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 ea(t,e,i,n,r,o){ji.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:i,radialSegments:n,closed:r};var a=new ia(t,e,i,n,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,this.fromBufferGeometry(a),this.mergeVertices()}function ia(t,e,i,n,r){nn.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:i,radialSegments:n,closed:r},e=e||64,i=i||1,n=n||8,r=r||!1;var o=t.computeFrenetFrames(e,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;var a,s,l=new Je,u=new Je,h=new Ze,c=new Je,d=[],p=[],f=[],m=[];function g(r){c=t.getPointAt(r/e,c);var a=o.normals[r],h=o.binormals[r];for(s=0;s<=n;s++){var f=s/n*Math.PI*2,m=Math.sin(f),g=-Math.cos(f);u.x=g*a.x+m*h.x,u.y=g*a.y+m*h.y,u.z=g*a.z+m*h.z,u.normalize(),p.push(u.x,u.y,u.z),l.x=c.x+i*u.x,l.y=c.y+i*u.y,l.z=c.z+i*u.z,d.push(l.x,l.y,l.z)}}!function(){for(a=0;an.far||r.push({distance:y,point:t.clone(),uv:Sn.getUV(t,a,s,l,u,h,c,new Ze),face:null,object:this})}}}(),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return Bi.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}}),Co.prototype=Object.assign(Object.create(Bi.prototype),{constructor:Co,copy:function(t){Bi.prototype.copy.call(this,t,!1);for(var e=t.levels,i=0,n=e.length;i1){t.setFromMatrixPosition(i.matrixWorld),e.setFromMatrixPosition(this.matrixWorld);var r=t.distanceTo(e);n[0].object.visible=!0;for(var o=1,a=n.length;o=n[o].distance;o++)n[o-1].object.visible=!1,n[o].object.visible=!0;for(;ou))p.applyMatrix4(this.matrixWorld),(S=n.ray.origin.distanceTo(p))n.far||r.push({distance:S,point:d.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}else for(y=0,b=g.length/3-1;yu))p.applyMatrix4(this.matrixWorld),(S=n.ray.origin.distanceTo(p))n.far||r.push({distance:S,point:d.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else if(a.isGeometry){var M=a.vertices,T=M.length;for(y=0;yu))p.applyMatrix4(this.matrixWorld),(S=n.ray.origin.distanceTo(p))n.far||r.push({distance:S,point:d.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}}}(),copy:function(t){return Bi.prototype.copy.call(this,t),this.geometry.copy(t.geometry),this.material.copy(t.material),this},clone:function(){return(new this.constructor).copy(this)}}),Ro.prototype=Object.assign(Object.create(Io.prototype),{constructor:Ro,isLineSegments:!0,computeLineDistances:function(){var t=new Je,e=new Je;return function(){var i=this.geometry;if(i.isBufferGeometry){if(null===i.index){for(var n=i.attributes.position,r=[],o=0,a=n.count;on.far)return;r.push({distance:l,distanceToRay:Math.sqrt(a),point:d.clone(),index:i,face:null,object:o})}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Bo.prototype=Object.assign(Object.create(si.prototype),{constructor:Bo,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),zo.prototype=Object.create(si.prototype),zo.prototype.constructor=zo,zo.prototype.isCompressedTexture=!0,Uo.prototype=Object.create(si.prototype),Uo.prototype.constructor=Uo,Uo.prototype.isCanvasTexture=!0,Vo.prototype=Object.create(si.prototype),Vo.prototype.constructor=Vo,Vo.prototype.isDepthTexture=!0,jo.prototype=Object.create(nn.prototype),jo.prototype.constructor=jo,Ho.prototype=Object.create(ji.prototype),Ho.prototype.constructor=Ho,Go.prototype=Object.create(nn.prototype),Go.prototype.constructor=Go,Wo.prototype=Object.create(ji.prototype),Wo.prototype.constructor=Wo,qo.prototype=Object.create(nn.prototype),qo.prototype.constructor=qo,Yo.prototype=Object.create(ji.prototype),Yo.prototype.constructor=Yo,Xo.prototype=Object.create(qo.prototype),Xo.prototype.constructor=Xo,Zo.prototype=Object.create(ji.prototype),Zo.prototype.constructor=Zo,Ko.prototype=Object.create(qo.prototype),Ko.prototype.constructor=Ko,Qo.prototype=Object.create(ji.prototype),Qo.prototype.constructor=Qo,Jo.prototype=Object.create(qo.prototype),Jo.prototype.constructor=Jo,$o.prototype=Object.create(ji.prototype),$o.prototype.constructor=$o,ta.prototype=Object.create(qo.prototype),ta.prototype.constructor=ta,ea.prototype=Object.create(ji.prototype),ea.prototype.constructor=ea,ia.prototype=Object.create(nn.prototype),ia.prototype.constructor=ia,na.prototype=Object.create(ji.prototype),na.prototype.constructor=na,ra.prototype=Object.create(nn.prototype),ra.prototype.constructor=ra,oa.prototype=Object.create(ji.prototype),oa.prototype.constructor=oa,aa.prototype=Object.create(nn.prototype),aa.prototype.constructor=aa;var sa=function(t,e,i){i=i||2;var n,r,o,a,s,l,u,h=e&&e.length,c=h?e[0]*i:t.length,d=la(t,0,c,i,!0),p=[];if(!d)return p;if(h&&(d=function(t,e,i,n){var r,o,a,s,l,u=[];for(r=0,o=e.length;r80*i){n=o=t[0],r=a=t[1];for(var f=i;fo&&(o=s),l>a&&(a=l);u=0!==(u=Math.max(o-n,a-r))?1/u:0}return ha(d,p,i,n,r,u),p};function la(t,e,i,n,r){var o,a;if(r===function(t,e,i,n){for(var r=0,o=e,a=i-n;o0)for(o=e;o=e;o-=n)a=Aa(o,t[o],t[o+1],a);return a&&Ma(a,a.next)&&(Pa(a),a=a.next),a}function ua(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!Ma(n,n.next)&&0!==xa(n.prev,n,n.next))n=n.next;else{if(Pa(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function ha(t,e,i,n,r,o,a){if(t){!a&&o&&function(t,e,i,n){var r=t;do{null===r.z&&(r.z=va(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,n,r,o,a,s,l,u=1;do{for(i=t,t=null,o=null,a=0;i;){for(a++,n=i,s=0,e=0;e0||l>0&&n;)0!==s&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,s--):(r=n,n=n.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;i=n}o.nextZ=null,u*=2}while(a>1)}(r)}(t,n,r,o);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,o?da(t,n,r,o):ca(t))e.push(s.i/i),e.push(t.i/i),e.push(l.i/i),Pa(t),t=l.next,u=l.next;else if((t=l)===u){a?1===a?ha(t=pa(t,e,i),e,i,n,r,o,2):2===a&&fa(t,e,i,n,r,o):ha(ua(t),e,i,n,r,o,1);break}}}function ca(t){var e=t.prev,i=t,n=t.next;if(xa(e,i,n)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(ba(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&xa(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function da(t,e,i,n){var r=t.prev,o=t,a=t.next;if(xa(r,o,a)>=0)return!1;for(var s=r.xo.x?r.x>a.x?r.x:a.x:o.x>a.x?o.x:a.x,h=r.y>o.y?r.y>a.y?r.y:a.y:o.y>a.y?o.y:a.y,c=va(s,l,e,i,n),d=va(u,h,e,i,n),p=t.nextZ;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&ba(r.x,r.y,o.x,o.y,a.x,a.y,p.x,p.y)&&xa(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&ba(r.x,r.y,o.x,o.y,a.x,a.y,p.x,p.y)&&xa(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function pa(t,e,i){var n=t;do{var r=n.prev,o=n.next.next;!Ma(r,o)&&Ta(r,n,n.next,o)&&Sa(r,o)&&Sa(o,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(o.i/i),Pa(n),Pa(n.next),n=t=o),n=n.next}while(n!==t);return n}function fa(t,e,i,n,r,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&wa(a,s)){var l=_a(a,s);return a=ua(a,a.next),l=ua(l,l.next),ha(a,e,i,n,r,o),void ha(l,e,i,n,r,o)}s=s.next}a=a.next}while(a!==t)}function ma(t,e){return t.x-e.x}function ga(t,e){if(e=function(t,e){var i,n=e,r=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>a){if(a=s,s===r){if(o===n.y)return n;if(o===n.next.y)return n.next}i=n.x=n.x&&n.x>=h&&r!==n.x&&ba(oi.x)&&Sa(n,t)&&(i=n,d=l),n=n.next;return i}(t,e)){var i=_a(e,t);ua(i,i.next)}}function va(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ya(t){var e=t,i=t;do{e.x=0&&(t-a)*(n-s)-(i-a)*(e-s)>=0&&(i-a)*(o-s)-(r-a)*(n-s)>=0}function wa(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&Ta(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&Sa(t,e)&&Sa(e,t)&&function(t,e){var i=t,n=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&r<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)}function xa(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Ma(t,e){return t.x===e.x&&t.y===e.y}function Ta(t,e,i,n){return!!(Ma(t,e)&&Ma(i,n)||Ma(t,n)&&Ma(i,e))||xa(t,e,i)>0!=xa(t,e,n)>0&&xa(i,n,t)>0!=xa(i,n,e)>0}function Sa(t,e){return xa(t.prev,t,t.next)<0?xa(t,e,t.next)>=0&&xa(t,t.prev,e)>=0:xa(t,e,t.prev)<0||xa(t,t.next,e)<0}function _a(t,e){var i=new Ca(t.i,t.x,t.y),n=new Ca(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,o.next=n,n.prev=o,n}function Aa(t,e,i,n){var r=new Ca(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function Pa(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 Ca(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var Ea={area:function(t){for(var e=t.length,i=0,n=e-1,r=0;r2&&t[e-1].equals(t[0])&&t.pop()}function La(t,e){for(var i=0;iNumber.EPSILON){var d=Math.sqrt(h),p=Math.sqrt(l*l+u*u),f=e.x-s/d,m=e.y+a/d,g=((i.x-u/p-f)*u-(i.y+l/p-m)*l)/(a*u-s*l),v=(n=f+a*g-t.x)*n+(r=m+s*g-t.y)*r;if(v<=2)return new Ze(n,r);o=Math.sqrt(v/2)}else{var y=!1;a>Number.EPSILON?l>Number.EPSILON&&(y=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(u)&&(y=!0),y?(n=-s,r=a,o=Math.sqrt(h)):(n=a,r=s,o=Math.sqrt(h/2))}return new Ze(n/o,r/o)}for(var z=[],U=0,V=C.length,j=V-1,H=U+1;U=0;D--){for(O=D/d,I=h*Math.cos(O*Math.PI/2),L=c*Math.sin(O*Math.PI/2),U=0,V=C.length;U=0;){i=U,(n=U-1)<0&&(n=t.length-1);var r=0,o=s+2*d;for(r=0;r0)&&f.push(x,M,S),(l!==i-1||u0&&v(!0),e>0&&v(!1)),this.setIndex(u),this.addAttribute("position",new Qi(h,3)),this.addAttribute("normal",new Qi(c,3)),this.addAttribute("uv",new Qi(d,2))}function Ka(t,e,i,n,r,o,a){Xa.call(this,0,t,e,i,n,r,o,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:o,thetaLength:a}}function Qa(t,e,i,n,r,o,a){Za.call(this,0,t,e,i,n,r,o,a),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:o,thetaLength:a}}function Ja(t,e,i,n){ji.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:n},this.fromBufferGeometry(new $a(t,e,i,n)),this.mergeVertices()}function $a(t,e,i,n){nn.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:n},t=t||1,e=void 0!==e?Math.max(3,e):8,i=void 0!==i?i:0,n=void 0!==n?n:2*Math.PI;var r,o,a=[],s=[],l=[],u=[],h=new Je,c=new Ze;for(s.push(0,0,0),l.push(0,0,1),u.push(.5,.5),o=0,r=3;o<=e;o++,r+=3){var d=i+o/e*n;h.x=t*Math.cos(d),h.y=t*Math.sin(d),s.push(h.x,h.y,h.z),l.push(0,0,1),c.x=(s[r]/t+1)/2,c.y=(s[r+1]/t+1)/2,u.push(c.x,c.y)}for(r=1;r<=e;r++)a.push(r,r+1,0);this.setIndex(a),this.addAttribute("position",new Qi(s,3)),this.addAttribute("normal",new Qi(l,3)),this.addAttribute("uv",new Qi(u,2))}ka.prototype=Object.create(ji.prototype),ka.prototype.constructor=ka,Fa.prototype=Object.create(Ia.prototype),Fa.prototype.constructor=Fa,Ba.prototype=Object.create(ji.prototype),Ba.prototype.constructor=Ba,za.prototype=Object.create(nn.prototype),za.prototype.constructor=za,Ua.prototype=Object.create(ji.prototype),Ua.prototype.constructor=Ua,Va.prototype=Object.create(nn.prototype),Va.prototype.constructor=Va,ja.prototype=Object.create(ji.prototype),ja.prototype.constructor=ja,Ha.prototype=Object.create(nn.prototype),Ha.prototype.constructor=Ha,Ga.prototype=Object.create(ji.prototype),Ga.prototype.constructor=Ga,Ga.prototype.toJSON=function(){var t=ji.prototype.toJSON.call(this);return qa(this.parameters.shapes,t)},Wa.prototype=Object.create(nn.prototype),Wa.prototype.constructor=Wa,Wa.prototype.toJSON=function(){var t=nn.prototype.toJSON.call(this);return qa(this.parameters.shapes,t)},Ya.prototype=Object.create(nn.prototype),Ya.prototype.constructor=Ya,Xa.prototype=Object.create(ji.prototype),Xa.prototype.constructor=Xa,Za.prototype=Object.create(nn.prototype),Za.prototype.constructor=Za,Ka.prototype=Object.create(Xa.prototype),Ka.prototype.constructor=Ka,Qa.prototype=Object.create(Za.prototype),Qa.prototype.constructor=Qa,Ja.prototype=Object.create(ji.prototype),Ja.prototype.constructor=Ja,$a.prototype=Object.create(nn.prototype),$a.prototype.constructor=$a;var ts=Object.freeze({WireframeGeometry:jo,ParametricGeometry:Ho,ParametricBufferGeometry:Go,TetrahedronGeometry:Yo,TetrahedronBufferGeometry:Xo,OctahedronGeometry:Zo,OctahedronBufferGeometry:Ko,IcosahedronGeometry:Qo,IcosahedronBufferGeometry:Jo,DodecahedronGeometry:$o,DodecahedronBufferGeometry:ta,PolyhedronGeometry:Wo,PolyhedronBufferGeometry:qo,TubeGeometry:ea,TubeBufferGeometry:ia,TorusKnotGeometry:na,TorusKnotBufferGeometry:ra,TorusGeometry:oa,TorusBufferGeometry:aa,TextGeometry:ka,TextBufferGeometry:Fa,SphereGeometry:Ba,SphereBufferGeometry:za,RingGeometry:Ua,RingBufferGeometry:Va,PlaneGeometry:an,PlaneBufferGeometry:sn,LatheGeometry:ja,LatheBufferGeometry:Ha,ShapeGeometry:Ga,ShapeBufferGeometry:Wa,ExtrudeGeometry:Oa,ExtrudeBufferGeometry:Ia,EdgesGeometry:Ya,ConeGeometry:Ka,ConeBufferGeometry:Qa,CylinderGeometry:Xa,CylinderBufferGeometry:Za,CircleGeometry:Ja,CircleBufferGeometry:$a,BoxGeometry:rn,BoxBufferGeometry:on});function es(t){xn.call(this),this.type="ShadowMaterial",this.color=new Si(0),this.transparent=!0,this.setValues(t)}function is(t){Mn.call(this,t),this.type="RawShaderMaterial"}function ns(t){xn.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Si(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 Si(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qe,this.normalScale=new Ze(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 rs(t){ns.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(t)}function os(t){xn.call(this),this.type="MeshPhongMaterial",this.color=new Si(16777215),this.specular=new Si(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Si(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qe,this.normalScale=new Ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=lt,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 as(t){os.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(t)}function ss(t){xn.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qe,this.normalScale=new Ze(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 ls(t){xn.call(this),this.type="MeshLambertMaterial",this.color=new Si(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Si(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=lt,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 us(t){xn.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Si(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qe,this.normalScale=new Ze(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 hs(t){Oo.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}es.prototype=Object.create(xn.prototype),es.prototype.constructor=es,es.prototype.isShadowMaterial=!0,es.prototype.copy=function(t){return xn.prototype.copy.call(this,t),this.color.copy(t.color),this},is.prototype=Object.create(Mn.prototype),is.prototype.constructor=is,is.prototype.isRawShaderMaterial=!0,ns.prototype=Object.create(xn.prototype),ns.prototype.constructor=ns,ns.prototype.isMeshStandardMaterial=!0,ns.prototype.copy=function(t){return xn.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},rs.prototype=Object.create(ns.prototype),rs.prototype.constructor=rs,rs.prototype.isMeshPhysicalMaterial=!0,rs.prototype.copy=function(t){return ns.prototype.copy.call(this,t),this.defines={PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearCoat=t.clearCoat,this.clearCoatRoughness=t.clearCoatRoughness,this},os.prototype=Object.create(xn.prototype),os.prototype.constructor=os,os.prototype.isMeshPhongMaterial=!0,os.prototype.copy=function(t){return xn.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},as.prototype=Object.create(os.prototype),as.prototype.constructor=as,as.prototype.isMeshToonMaterial=!0,as.prototype.copy=function(t){return os.prototype.copy.call(this,t),this.gradientMap=t.gradientMap,this},ss.prototype=Object.create(xn.prototype),ss.prototype.constructor=ss,ss.prototype.isMeshNormalMaterial=!0,ss.prototype.copy=function(t){return xn.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},ls.prototype=Object.create(xn.prototype),ls.prototype.constructor=ls,ls.prototype.isMeshLambertMaterial=!0,ls.prototype.copy=function(t){return xn.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},us.prototype=Object.create(xn.prototype),us.prototype.constructor=us,us.prototype.isMeshMatcapMaterial=!0,us.prototype.copy=function(t){return xn.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},hs.prototype=Object.create(Oo.prototype),hs.prototype.constructor=hs,hs.prototype.isLineDashedMaterial=!0,hs.prototype.copy=function(t){return Oo.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var cs=Object.freeze({ShadowMaterial:es,SpriteMaterial:Ao,RawShaderMaterial:is,ShaderMaterial:Mn,PointsMaterial:ko,MeshPhysicalMaterial:rs,MeshStandardMaterial:ns,MeshPhongMaterial:os,MeshToonMaterial:as,MeshNormalMaterial:ss,MeshLambertMaterial:ls,MeshDepthMaterial:Jr,MeshDistanceMaterial:$r,MeshBasicMaterial:_n,MeshMatcapMaterial:us,LineDashedMaterial:hs,LineBasicMaterial:Oo,Material:xn}),ds={arraySlice:function(t,e,i){return ds.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==i?i:t.length)):t.slice(e,i)},convertArray:function(t,e,i){return!t||!i&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){for(var e=t.length,i=new Array(e),n=0;n!==e;++n)i[n]=n;return i.sort((function(e,i){return t[e]-t[i]})),i},sortedArray:function(t,e,i){for(var n=t.length,r=new t.constructor(n),o=0,a=0;a!==n;++o)for(var s=i[o]*e,l=0;l!==e;++l)r[a++]=t[s+l];return r},flattenJSON:function(t,e,i,n){for(var r=1,o=t[0];void 0!==o&&void 0===o[n];)o=t[r++];if(void 0!==o){var a=o[n];if(void 0!==a)if(Array.isArray(a))do{void 0!==(a=o[n])&&(e.push(o.time),i.push.apply(i,a)),o=t[r++]}while(void 0!==o);else if(void 0!==a.toArray)do{void 0!==(a=o[n])&&(e.push(o.time),a.toArray(i,i.length)),o=t[r++]}while(void 0!==o);else do{void 0!==(a=o[n])&&(e.push(o.time),i.push(a)),o=t[r++]}while(void 0!==o)}}};function ps(t,e,i,n){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new e.constructor(i),this.sampleValues=e,this.valueSize=i}function fs(t,e,i,n){ps.call(this,t,e,i,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function ms(t,e,i,n){ps.call(this,t,e,i,n)}function gs(t,e,i,n){ps.call(this,t,e,i,n)}function vs(t,e,i,n){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=ds.convertArray(e,this.TimeBufferType),this.values=ds.convertArray(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}function ys(t,e,i){vs.call(this,t,e,i)}function bs(t,e,i,n){vs.call(this,t,e,i,n)}function ws(t,e,i,n){vs.call(this,t,e,i,n)}function xs(t,e,i,n){ps.call(this,t,e,i,n)}function Ms(t,e,i,n){vs.call(this,t,e,i,n)}function Ts(t,e,i,n){vs.call(this,t,e,i,n)}function Ss(t,e,i,n){vs.call(this,t,e,i,n)}function _s(t,e,i){this.name=t,this.tracks=i,this.duration=void 0!==e?e:-1,this.uuid=Xe.generateUUID(),this.duration<0&&this.resetDuration()}function As(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 ws;case"vector":case"vector2":case"vector3":case"vector4":return Ss;case"color":return bs;case"quaternion":return Ms;case"bool":case"boolean":return ys;case"string":return Ts}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){var i=[],n=[];ds.flattenJSON(t.keys,i,n,"value"),t.times=i,t.values=n}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}Object.assign(ps.prototype,{evaluate:function(t){var e=this.parameterPositions,i=this._cachedIndex,n=e[i],r=e[i-1];t:{e:{var o;i:{n:if(!(t=r)break t;var s=e[1];t=(r=e[--i-1]))break e}o=i,i=0}for(;i>>1;te;)--o;if(++o,0!==r||o!==n){r>=o&&(r=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=ds.arraySlice(i,r,o),this.values=ds.arraySlice(this.values,r*a,o*a)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(t=!1);var i=this.times,n=this.values,r=i.length;0===r&&(t=!1);for(var o=null,a=0;a!==r;a++){var s=i[a];if("number"==typeof s&&isNaN(s)){t=!1;break}if(null!==o&&o>s){t=!1;break}o=s}if(void 0!==n&&ds.isTypedArray(n)){a=0;for(var l=n.length;a!==l;++a){var u=n[a];if(isNaN(u)){t=!1;break}}}return t},optimize:function(){for(var t=this.times,e=this.values,i=this.getValueSize(),n=this.getInterpolation()===Ee,r=1,o=t.length-1,a=1;a0){t[r]=t[o];for(f=o*i,m=r*i,d=0;d!==i;++d)e[m+d]=e[f+d];++r}return r!==t.length&&(this.times=ds.arraySlice(t,0,r),this.values=ds.arraySlice(e,0,r*i)),this}}),ys.prototype=Object.assign(Object.create(vs.prototype),{constructor:ys,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Pe,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),bs.prototype=Object.assign(Object.create(vs.prototype),{constructor:bs,ValueTypeName:"color"}),ws.prototype=Object.assign(Object.create(vs.prototype),{constructor:ws,ValueTypeName:"number"}),xs.prototype=Object.assign(Object.create(ps.prototype),{constructor:xs,interpolate_:function(t,e,i,n){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,l=(i-e)/(n-e),u=s+a;s!==u;s+=4)Qe.slerpFlat(r,0,o,s-a,o,s,l);return r}}),Ms.prototype=Object.assign(Object.create(vs.prototype),{constructor:Ms,ValueTypeName:"quaternion",DefaultInterpolation:Ce,InterpolantFactoryMethodLinear:function(t){return new xs(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),Ts.prototype=Object.assign(Object.create(vs.prototype),{constructor:Ts,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Pe,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Ss.prototype=Object.assign(Object.create(vs.prototype),{constructor:Ss,ValueTypeName:"vector"}),Object.assign(_s,{parse:function(t){for(var e=[],i=t.tracks,n=1/(t.fps||1),r=0,o=i.length;r!==o;++r)e.push(As(i[r]).scale(n));return new _s(t.name,t.duration,e)},toJSON:function(t){for(var e=[],i=t.tracks,n={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid},r=0,o=i.length;r!==o;++r)e.push(vs.toJSON(i[r]));return n},CreateFromMorphTargetSequence:function(t,e,i,n){for(var r=e.length,o=[],a=0;a1){var u=n[c=l[1]];u||(n[c]=u=[]),u.push(s)}}var h=[];for(var c in n)h.push(_s.CreateFromMorphTargetSequence(c,n[c],e,i));return h},parseAnimation:function(t,e){if(!t)return null;for(var i=function(t,e,i,n,r){if(0!==i.length){var o=[],a=[];ds.flattenJSON(i,o,a,n),0!==o.length&&r.push(new t(e,o,a))}},n=[],r=t.name||"default",o=t.length||-1,a=t.fps||30,s=t.hierarchy||[],l=0;l0||0===t.search(/^data\:image\/jpeg/);r.format=n?Yt:Xt,r.needsUpdate=!0,void 0!==e&&e(r)}),i,n),r},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Bs.prototype,{getPoint:function(){return null},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],i=0;i<=t;i++)e.push(this.getPointAt(i/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,i,n=[],r=this.getPoint(0),o=0;for(n.push(0),i=1;i<=t;i++)o+=(e=this.getPoint(i/t)).distanceTo(r),n.push(o),r=e;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var i,n=this.getLengths(),r=0,o=n.length;i=e||t*n[o-1];for(var a,s=0,l=o-1;s<=l;)if((a=n[r=Math.floor(s+(l-s)/2)]-i)<0)s=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(n[r=l]===i)return r/(o-1);var u=n[r];return(r+(i-u)/(n[r+1]-u))/(o-1)},getTangent:function(t){var e=t-1e-4,i=t+1e-4;e<0&&(e=0),i>1&&(i=1);var n=this.getPoint(e);return this.getPoint(i).clone().sub(n).normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)},computeFrenetFrames:function(t,e){var i,n,r,o=new Je,a=[],s=[],l=[],u=new Je,h=new Ke;for(i=0;i<=t;i++)n=i/t,a[i]=this.getTangentAt(n),a[i].normalize();s[0]=new Je,l[0]=new Je;var c=Number.MAX_VALUE,d=Math.abs(a[0].x),p=Math.abs(a[0].y),f=Math.abs(a[0].z);for(d<=c&&(c=d,o.set(1,0,0)),p<=c&&(c=p,o.set(0,1,0)),f<=c&&o.set(0,0,1),u.crossVectors(a[0],o).normalize(),s[0].crossVectors(a[0],u),l[0].crossVectors(a[0],s[0]),i=1;i<=t;i++)s[i]=s[i-1].clone(),l[i]=l[i-1].clone(),u.crossVectors(a[i-1],a[i]),u.length()>Number.EPSILON&&(u.normalize(),r=Math.acos(Xe.clamp(a[i-1].dot(a[i]),-1,1)),s[i].applyMatrix4(h.makeRotationAxis(u,r))),l[i].crossVectors(a[i],s[i]);if(!0===e)for(r=Math.acos(Xe.clamp(s[0].dot(s[t]),-1,1)),r/=t,a[0].dot(u.crossVectors(s[0],s[t]))>0&&(r=-r),i=1;i<=t;i++)s[i].applyMatrix4(h.makeRotationAxis(a[i],r*i)),l[i].crossVectors(a[i],s[i]);return{tangents:a,normals:s,binormals:l}},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}}),zs.prototype=Object.create(Bs.prototype),zs.prototype.constructor=zs,zs.prototype.isEllipseCurve=!0,zs.prototype.getPoint=function(t,e){for(var i=e||new Ze,n=2*Math.PI,r=this.aEndAngle-this.aStartAngle,o=Math.abs(r)n;)r-=n;r0?0:(Math.floor(Math.abs(h)/l)+1)*l:0===c&&h===l-1&&(h=l-2,c=1),this.closed||h>0?i=s[(h-1)%l]:(js.subVectors(s[0],s[1]).add(s[0]),i=js),n=s[h%l],r=s[(h+1)%l],this.closed||h+2n.length-2?n.length-1:o+1],h=n[o>n.length-3?n.length-1:o+2];return i.set(Ys(a,s.x,l.x,u.x,h.x),Ys(a,s.y,l.y,u.y,h.y)),i},il.prototype.copy=function(t){Bs.prototype.copy.call(this,t),this.points=[];for(var e=0,i=t.points.length;e=e){var r=i[n]-e,o=this.curves[n],a=o.getLength(),s=0===a?0:1-r/a;return o.getPointAt(s)}n++}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,i=0,n=this.curves.length;i1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},copy:function(t){Bs.prototype.copy.call(this,t),this.curves=[];for(var e=0,i=t.curves.length;e0){var u=l.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(l);var h=l.getPoint(1);this.currentPoint.copy(h)},copy:function(t){return rl.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=rl.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return rl.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),al.prototype=Object.assign(Object.create(ol.prototype),{constructor:al,getPointsHoles:function(t){for(var e=[],i=0,n=this.holes.length;i0){var o=new Ns(new Cs(e));o.setCrossOrigin(this.crossOrigin);for(var a=0,s=t.length;a0?new Eo(a,s):new An(a,s);break;case"LOD":n=new Co;break;case"Line":n=new Io(r(t.geometry),o(t.material),t.mode);break;case"LineLoop":n=new No(r(t.geometry),o(t.material));break;case"LineSegments":n=new Ro(r(t.geometry),o(t.material));break;case"PointCloud":case"Points":n=new Fo(r(t.geometry),o(t.material));break;case"Sprite":n=new Po(o(t.material));break;case"Group":n=new ro;break;default:n=new Bi}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 l=t.children,u=0;uNumber.EPSILON){if(u<0&&(a=e[o],l=-l,s=e[r],u=-u),t.ys.y)continue;if(t.y===a.y){if(t.x===a.x)return!0}else{var h=u*(t.x-a.x)-l*(t.y-a.y);if(0===h)return!0;if(h<0)continue;n=!n}}else{if(t.y!==a.y)continue;if(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x)return!0}}return n}var r=Ea.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===e)return i(o);var a,s,l,u=[];if(1===o.length)return s=o[0],(l=new al).curves=s.curves,u.push(l),u;var h=!r(o[0].getPoints());h=t?!h:h;var c,d,p=[],f=[],m=[],g=0;f[g]=void 0,m[g]=[];for(var v=0,y=o.length;v1){for(var b=!1,w=[],x=0,M=f.length;x0&&(b||(m=p))}v=0;for(var C=f.length;v0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t=.5)for(var o=0;o!==r;++o)t[e+o]=t[i+o]},_slerp:function(t,e,i,n){Qe.slerpFlat(t,e,t,e,t,i,n)},_lerp:function(t,e,i,n,r){for(var o=1-n,a=0;a!==r;++a){var s=e+a;t[s]=t[s]*o+t[i+a]*n}}});var nu,ru,ou,au,su,lu,uu,hu,cu,du,pu,fu,mu,gu;function vu(t,e,i){var n=i||yu.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,n)}function yu(t,e,i){this.path=e,this.parsedPath=i||yu.parseTrackName(e),this.node=yu.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function bu(){this.uuid=Xe.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,i=arguments.length;e!==i;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}}function wu(t,e,i){this._mixer=t,this._clip=e,this._localRoot=i||null;for(var n=e.tracks,r=n.length,o=new Array(r),a={endingStart:De,endingEnd:De},s=0;s!==r;++s){var l=n[s].createInterpolant(null);o[s]=l,l.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=_e,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 xu(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Mu(t){"string"==typeof t&&(t=arguments[1]),this.value=t}function Tu(){nn.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function Su(t,e,i){So.call(this,t,e),this.meshPerAttribute=i||1}function _u(t,e,i,n){"number"==typeof i&&(n=i,i=!1),Hi.call(this,t,e,i),this.meshPerAttribute=n||1}function Au(t,e,i,n){this.ray=new Tn(t,e),this.near=i||0,this.far=n||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return this.Points}}})}function Pu(t,e){return t.distance-e.distance}function Cu(t,e,i,n){if(!1!==t.visible&&(t.raycast(e,i),!0===n))for(var r=t.children,o=0,a=r.length;o=e){var h=e++,c=t[h];i[c.uuid]=u,t[u]=c,i[l]=h,t[h]=s;for(var d=0,p=r;d!==p;++d){var f=n[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,i=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,o=r.length,a=0,s=arguments.length;a!==s;++a){var l=arguments[a],u=l.uuid,h=n[u];if(void 0!==h)if(delete n[u],h0)for(var l=this._interpolants,u=this._propertyBindings,h=0,c=l.length;h!==c;++h)l[h].evaluate(a),u[h].accumulate(n,s)}else this._updateWeight(t)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var i=this._weightInterpolant;if(null!==i){var n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var i=this._timeScaleInterpolant;if(null!==i)e*=i.evaluate(t)[0],t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}return this._effectiveTimeScale=e,e},_updateTime:function(t){var e=this.time+t,i=this._clip.duration,n=this.loop,r=this._loopCount,o=n===Ae;if(0===t)return-1===r?e:o&&1==(1&r)?i-e:e;if(n===Se){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(e>=i)e=i;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===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),e>=i||e<0){var a=Math.floor(e/i);e-=i*a,r+=Math.abs(a);var s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=t>0?i:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){var l=t<0;this._setEndings(l,!l,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}if(o&&1==(1&r))return this.time=e,i-e}return this.time=e,e},_setEndings:function(t,e,i){var n=this._interpolantSettings;i?(n.endingStart=Le,n.endingEnd=Le):(n.endingStart=t?this.zeroSlopeAtStart?Le:De:Oe,n.endingEnd=e?this.zeroSlopeAtEnd?Le:De:Oe)},_scheduleFading:function(t,e,i){var n=this._mixer,r=n.time,o=this._weightInterpolant;null===o&&(o=n._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=r,s[0]=e,a[1]=r+t,s[1]=i,this}}),xu.prototype=Object.assign(Object.create(n.prototype),{constructor:xu,_bindAction:function(t,e){var i=t._localRoot||this._root,n=t._clip.tracks,r=n.length,o=t._propertyBindings,a=t._interpolants,s=i.uuid,l=this._bindingsByRootAndName,u=l[s];void 0===u&&(u={},l[s]=u);for(var h=0;h!==r;++h){var c=n[h],d=c.name,p=u[d];if(void 0!==p)o[h]=p;else{if(void 0!==(p=o[h])){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,s,d));continue}var f=e&&e._propertyBindings[h].binding.parsedPath;++(p=new iu(yu.create(i,d,f),c.ValueTypeName,c.getValueSize())).referenceCount,this._addInactiveBinding(p,s,d),o[h]=p}a[h].resultBuffer=p.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,i=t._clip.uuid,n=this._actionsByClip[i];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,i,e)}for(var r=t._propertyBindings,o=0,a=r.length;o!==a;++o){var s=r[o];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,i=0,n=e.length;i!==n;++i){var r=e[i];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}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&&ethis.max.x||t.ythis.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&&(e=new Ze),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.xthis.max.x||t.max.ythis.max.y)},clampPoint:function(t,e){return void 0===e&&(e=new Ze),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new Ze;return function(e){return t.copy(e).clamp(this.min,this.max).sub(e).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(Ou.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&&(t=new Je),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(t=new Je),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&&(e=new Je),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:(cu=new Je,du=new Je,function(t,e){cu.subVectors(t,this.start),du.subVectors(this.end,this.start);var i=du.dot(du),n=du.dot(cu)/i;return e&&(n=Xe.clamp(n,0,1)),n}),closestPointToPoint:function(t,e,i){var n=this.closestPointToPointParameter(t,e);return void 0===i&&(i=new Je),this.delta(i).multiplyScalar(n).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)}}),Iu.prototype=Object.create(Bi.prototype),Iu.prototype.constructor=Iu,Iu.prototype.isImmediateRenderObject=!0,Ru.prototype=Object.create(Ro.prototype),Ru.prototype.constructor=Ru,Ru.prototype.update=function(){var t=new Je,e=new Je,i=new $e;return function(){var n=["a","b","c"];this.object.updateMatrixWorld(!0),i.getNormalMatrix(this.object.matrixWorld);var r=this.object.matrixWorld,o=this.geometry.attributes.position,a=this.object.geometry;if(a&&a.isGeometry)for(var s=a.vertices,l=a.faces,u=0,h=0,c=l.length;h1&&t.multiplyScalar(1/e),this.children[0].material.color.copy(this.material.color)}},Bu.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()},zu.prototype=Object.create(Bi.prototype),zu.prototype.constructor=zu,zu.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},zu.prototype.update=function(){var t=new Je,e=new Si,i=new Si;return function(){var n=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var r=n.geometry.getAttribute("color");e.copy(this.light.color),i.copy(this.light.groundColor);for(var o=0,a=r.count;o.99999?this.quaternion.set(0,0,0,1):t.y<-.99999?this.quaternion.set(1,0,0,0):(gu.set(t.z,0,-t.x).normalize(),mu=Math.acos(t.y),this.quaternion.setFromAxisAngle(gu,mu))}),Xu.prototype.setLength=function(t,e,i){void 0===e&&(e=.2*t),void 0===i&&(i=.2*e),this.line.scale.set(1,Math.max(0,t-e),1),this.line.updateMatrix(),this.cone.scale.set(i,e,i),this.cone.position.y=t,this.cone.updateMatrix()},Xu.prototype.setColor=function(t){this.line.material.color.copy(t),this.cone.material.color.copy(t)},Xu.prototype.copy=function(t){return Bi.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},Xu.prototype.clone=function(){return(new this.constructor).copy(this)},Zu.prototype=Object.create(Ro.prototype),Zu.prototype.constructor=Zu;var Qu=0,Ju=1;function $u(t){return t}function th(t){return void 0===t&&(t=[]),t.isMultiMaterial=!0,t.materials=t,t.clone=function(){return t.slice()},t}function eh(t,e){return new Fo(t,e)}function ih(t){return new Po(t)}function nh(t,e){return new Fo(t,e)}function rh(t){return new ko(t)}function oh(t){return new ko(t)}function ah(t){return new ko(t)}function sh(t,e,i){return new Je(t,e,i)}function lh(t,e){return new Hi(t,e).setDynamic(!0)}function uh(t,e){return new Gi(t,e)}function hh(t,e){return new Wi(t,e)}function ch(t,e){return new qi(t,e)}function dh(t,e){return new Yi(t,e)}function ph(t,e){return new Xi(t,e)}function fh(t,e){return new Zi(t,e)}function mh(t,e){return new Ki(t,e)}function gh(t,e){return new Qi(t,e)}function vh(t,e){return new Ji(t,e)}function yh(t){qs.call(this,t),this.type="catmullrom",this.closed=!0}function bh(t){qs.call(this,t),this.type="catmullrom"}function wh(t){qs.call(this,t),this.type="catmullrom"}function xh(t){return new Zu(t)}function Mh(t,e){return new Wu(t,e)}function Th(t,e){return new Ro(new Ya(t.geometry),new Oo({color:void 0!==e?e:16777215}))}function Sh(t,e){return new Ro(new jo(t.geometry),new Oo({color:void 0!==e?e:16777215}))}function _h(t){return new Ls(t)}function Ah(t){return new Rs(t)}Bs.create=function(t,e){return t.prototype=Object.create(Bs.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(rl.prototype,{createPointsGeometry:function(t){var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){for(var e=new ji,i=0,n=t.length;i"+t+"

"),e("#debug-console")[0].scrollTop=e("#debug-console")[0].scrollHeight};r=function(t){c(Array.prototype.slice.call(arguments).join(" "))},o=function(t){c(Array.prototype.slice.call(arguments).join(" "))},a=function(t){c("WARN: "+Array.prototype.slice.call(arguments).join(" "))},s=function(t){c("ERROR: "+Array.prototype.slice.call(arguments).join(" "))}}else console.debug?(r=console.debug,o=console.info?console.info:console.debug,a=console.warn?console.warn:console.debug,s=console.error?console.error:console.debug):r=o=a=s=function(){};var d=function(t){return[u,n.timestamp()].concat(Array.prototype.slice.call(t))},p=function(e,r){if(i){var o=Array.prototype.slice.call(e).join(" ");i.captureMessage(o,{level:r,path:t,timestamp:n.timestamp()})}},f=function(e,r){if(i){var o=Array.prototype.slice.call(e).join(" ");i.captureException(new Error(o),{level:r,path:t,timestamp:n.timestamp()})}};return{debug:function(){n.level>=n.levels.debug&&r.appply(console,d(arguments))},info:function(){n.level>=n.levels.info&&o.apply(console,d(arguments))},warn:function(){p(arguments,"warn"),n.level>=n.levels.warn&&a.apply(console,d(arguments))},error:function(){f(arguments,"error"),n.level>=n.levels.error&&s.apply(console,d(arguments))},v3str:function(t,e){var i=void 0===e?2:e;return"("+t.x.toPrecision(i)+", "+t.y.toPrecision(i)+", "+t.z.toPrecision(i)+")"},eulstr:function(t,e){var i=void 0===e?2:e;return"("+THREE.Math.radToDeg(t.x).toPrecision(i)+", "+THREE.Math.radToDeg(t.y).toPrecision(i)+", "+THREE.Math.radToDeg(t.z).toPrecision(i)+' "'+t.order+'")'},time:function(t){n.level>=n.levels.debug&&(h[t]=Date.now())},timeEnd:function(t){if(n.level>=n.levels.debug){var e=h[t];if(!e)return;var i=(Date.now()-e)/1e3;this.debug(t,i+"s")}}}}n.timestamp=function(){return(Date.now()-window.navigationStart)/1e3+"s"},n.levels={debug:3,info:2,warn:1,error:0},n.level=n.levels.info,t.exports=n}).call(this,i(6))},function(t,e,i){(function(e){function n(t,e){var i=window.navigator.userAgent.match(t);return i=i?i[1].split(e):[],{major:parseInt(i[0])||0,minor:parseInt(i[1])||0,patch:parseInt(i[2])||0}}var r=i(99);t.exports={isFullscreen:function(){return document.fullscreenElement||document.mozFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement},supportsFullscreen:function(){return document.fullscreenEnabled||document.mozFullscreenEnabled||document.mozFullScreenEnabled||document.webkitFullscreenEnabled||document.msFullscreenEnabled},isPointerLocked:function(){return document.pointerLockElement||document.mozPointerLockElement||document.webkitPointerLockElement},requestFullscreen:function(t,i){t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):t.msRequestFullscreen&&t.msRequestFullscreen(),i&&e(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange",browser.requestPointerLock)},requestPointerLock:function(){var t;if(document.fullscreenElement)t=document.fullscreenElement();else if(document.mozFullscreenElement)t=document.mozFullscreenElement();else if(document.mozFullScreenElement)t=document.mozFullScreenElement();else{if(!document.webkitFullscreenElement)return;t=document.webkitFullscreenElement()}t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock(),e(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange",this)},exitPointerLock:function(){document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock()},exitFullscreen:function(){document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()},details:function(){var t=navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");return t?{name:t[1],version:parseInt(t[2]),platform:navigator.platform}:{}},is:function(t){return this.details()&&this.details().name===t},inIframe:function(){return window.parent!==window},aspectRatio:function(){var t=(window.renderWidth || window.innerWidth)/(window.renderHeight || window.innerHeight);return isFinite(t)?t:0},userAgent:function(){return window.navigator.userAgent},isMobile:function(){var t=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))},isWeixin:function(){return"micromessenger"==navigator.userAgent.toLowerCase().match(/MicroMessenger/i)},isSmallScreen:function(){return screen.width/window.devicePixelRatio<240},detectIE:function(){return-1!==window.navigator.userAgent.indexOf("MSIE ")||!!navigator.userAgent.match(/Trident.*rv\:11\./)},detectSafari:function(){return-1!==window.navigator.userAgent.indexOf("Safari")&&!this.detectChrome()},detectFirefox:function(){return-1!==window.navigator.userAgent.indexOf("Firefox")},detectChrome:function(){return-1!==window.navigator.userAgent.indexOf("Chrome")&&!this.detectOpera()},detectOpera:function(){return-1!==window.navigator.userAgent.indexOf("OPR")},detectIOS:function(){var t=window.navigator.userAgent;return/iPad|iPhone|iPod/.test(t)},detectAndroid:function(){return-1!==window.navigator.userAgent.indexOf("Android")},detectAndroidMobile:function(){var t=window.navigator.userAgent;return this.detectAndroid()&&-1!==t.indexOf("Mobile")},detectSamsungNative:function(){var t=window.navigator.userAgent;return-1!==t.indexOf("SM-G900H")||-1!==t.indexOf("GT-I9500")||-1!==t.indexOf("SM-N900")},detectSamsungS6:function(){return-1!==window.navigator.userAgent.indexOf("SM-G92")},detectHUAWEI5X:function(){return-1!==window.navigator.userAgent.indexOf("KIW-TL00H")},iosVersion:function(){if(!this.detectIOS())throw new r("Did not detect an iDevice");return n(/((?:\d+\_?){1,3}) like Mac OS/,"_")},androidVersion:function(){if(!this.detectAndroid())throw new r("Did not detect an Android based device");return n(/Android ((?:\d+\.?){1,3})/,".")},valueFromCookie:function(t,e){var i=new RegExp(t+"=([0-9a-f]+)(; ?|$)").exec(document.cookie);if(!i)return e;var n=i[1];return"boolean"==typeof e?"true"===n||"1"===n:"number"==typeof e?parseFloat(n):n},valueFromHash:function(t,e){var i=new RegExp("[#&?]"+t+"=([^#&?]*)").exec(window.location.href);if(!i)return e;var n=i[1];return"boolean"==typeof e?"true"===n||"1"===n:"number"==typeof e?parseFloat(n):window.decodeURIComponent(n)},getAllValueFromSearch:function(){var t=window.location.search,e={};if(-1!==t.indexOf("?"))for(var i=t.substr(1).split("&"),n="",r=0;r0&&a.length>r&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=a.length,console&&console.warn}return t}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,i){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},r=d.bind(n);return r.listener=i,n.wrapFn=r,r}function f(t,e,i){var n=t._events;if(void 0===n)return[];var r=n[e];return void 0===r?[]:"function"==typeof r?i?[r.listener||r]:[r]:i?function(t){for(var e=new Array(t.length),i=0;i0&&(a=e[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=r[t];if(void 0===l)return!1;if("function"==typeof l)o(l,this,e);else{var u=l.length,h=g(l,u);for(i=0;i=0;o--)if(i[o]===e||i[o].listener===e){a=i[o].listener,r=o;break}if(r<0)return this;0===r?i.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return f(this,t,!0)},s.prototype.rawListeners=function(t){return f(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,i){var n=i(100);t.exports={PANORAMA:"panorama",DOLLHOUSE:"dollhouse",FLOORPLAN:"floorplan",MESH:"mesh",OUTDOOR:"outdoor",TRANSITIONING:"transitioning",toInt:function(t){switch(t){case this.PANORAMA:return 1;case this.DOLLHOUSE:return 2;case this.FLOORPLAN:return 3;case this.OUTDOOR:return 4;case this.TRANSITIONING:return-1}throw new n("No known conversion for Viewmode to int for mode: "+t)},fromInt:function(t){switch(t){case"1":case 1:return this.PANORAMA;case"2":case 2:return this.DOLLHOUSE;case"3":case 3:return this.FLOORPLAN;case"4":case 4:return this.OUTDOOR}throw new n("No known conversion for int to viewmode for int: "+t)},convertWorkshopModeInt:function(t){switch(t){case"0":case 0:return this.PANORAMA;case"1":case 1:return this.FLOORPLAN;case"2":case 2:return this.DOLLHOUSE;case"3":case 3:return this.MESH}throw new n("No known conversion for Workshop int to viewmode for int: "+t)}}},function(t,e,i){var n;!function(e,i){"use strict";"object"==typeof t.exports?t.exports=e.document?i(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return i(t)}:i(e)}("undefined"!=typeof window?window:this,(function(i,r){"use strict";var o=[],a=Object.getPrototypeOf,s=o.slice,l=o.flat?function(t){return o.flat.call(t)}:function(t){return o.concat.apply([],t)},u=o.push,h=o.indexOf,c={},d=c.toString,p=c.hasOwnProperty,f=p.toString,m=f.call(Object),g={},v=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},y=function(t){return null!=t&&t===t.window},b=i.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function x(t,e,i){var n,r,o=(i=i||b).createElement("script");if(o.text=t,e)for(n in w)(r=e[n]||e.getAttribute&&e.getAttribute(n))&&o.setAttribute(n,r);i.head.appendChild(o).parentNode.removeChild(o)}function M(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?c[d.call(t)]||"object":typeof t}var T=/HTML$/i,S=function(t,e){return new S.fn.init(t,e)};function _(t){var e=!!t&&"length"in t&&t.length,i=M(t);return!v(t)&&!y(t)&&("array"===i||0===e||"number"==typeof e&&e>0&&e-1 in t)}function A(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}S.fn=S.prototype={jquery:"3.7.0",constructor:S,length:0,toArray:function(){return s.call(this)},get:function(t){return null==t?s.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=S.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return S.each(this,t)},map:function(t){return this.pushStack(S.map(this,(function(e,i){return t.call(e,i,e)})))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(S.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,i=+t+(t<0?e:0);return this.pushStack(i>=0&&i+~]|"+D+")"+D+"*"),V=new RegExp(D+"|>"),j=new RegExp(F),H=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+k),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+D+"*(even|odd|(([+-]|)(\\d*)n|)"+D+"*(?:([+-]|)"+D+"*(\\d+)|))"+D+"*\\)|)","i"),bool:new RegExp("^(?:"+O+")$","i"),needsContext:new RegExp("^"+D+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+D+"*((?:-\\d)?\\d*)"+D+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,Y=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,X=/[+~]/,Z=new RegExp("\\\\[\\da-fA-F]{1,6}"+D+"?|\\\\([^\\r\\n\\f])","g"),K=function(t,e){var i="0x"+t.slice(1)-65536;return e||(i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320))},Q=function(){lt()},J=dt((function(t){return!0===t.disabled&&A(t,"fieldset")}),{dir:"parentNode",next:"legend"});try{m.apply(o=s.call(R.childNodes),R.childNodes),o[R.childNodes.length].nodeType}catch(t){m={apply:function(t,e){N.apply(t,s.call(e))},call:function(t){N.apply(t,s.call(arguments,1))}}}function $(t,e,i,n){var r,o,a,s,u,h,p,f=e&&e.ownerDocument,y=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==y&&9!==y&&11!==y)return i;if(!n&&(lt(e),e=e||l,c)){if(11!==y&&(u=Y.exec(t)))if(r=u[1]){if(9===y){if(!(a=e.getElementById(r)))return i;if(a.id===r)return m.call(i,a),i}else if(f&&(a=f.getElementById(r))&&$.contains(e,a)&&a.id===r)return m.call(i,a),i}else{if(u[2])return m.apply(i,e.getElementsByTagName(t)),i;if((r=u[3])&&e.getElementsByClassName)return m.apply(i,e.getElementsByClassName(r)),i}if(!(T[t+" "]||d&&d.test(t))){if(p=t,f=e,1===y&&(V.test(t)||U.test(t))){for((f=X.test(t)&&st(e.parentNode)||e)==e&&g.scope||((s=e.getAttribute("id"))?s=S.escapeSelector(s):e.setAttribute("id",s=v)),o=(h=ht(t)).length;o--;)h[o]=(s?"#"+s:":scope")+" "+ct(h[o]);p=h.join(",")}try{return m.apply(i,f.querySelectorAll(p)),i}catch(e){T(t,!0)}finally{s===v&&e.removeAttribute("id")}}}return yt(t.replace(L,"$1"),e,i,n)}function tt(){var t=[];return function i(n,r){return t.push(n+" ")>e.cacheLength&&delete i[t.shift()],i[n+" "]=r}}function et(t){return t[v]=!0,t}function it(t){var e=l.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function nt(t){return function(e){return A(e,"input")&&e.type===t}}function rt(t){return function(e){return(A(e,"input")||A(e,"button"))&&e.type===t}}function ot(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&J(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function at(t){return et((function(e){return e=+e,et((function(i,n){for(var r,o=t([],i.length,e),a=o.length;a--;)i[r=o[a]]&&(i[r]=!(n[r]=i[r]))}))}))}function st(t){return t&&void 0!==t.getElementsByTagName&&t}function lt(t){var i,n=t?t.ownerDocument||t:R;return n!=l&&9===n.nodeType&&n.documentElement?(u=(l=n).documentElement,c=!S.isXMLDoc(l),f=u.matches||u.webkitMatchesSelector||u.msMatchesSelector,R!=l&&(i=l.defaultView)&&i.top!==i&&i.addEventListener("unload",Q),g.getById=it((function(t){return u.appendChild(t).id=S.expando,!l.getElementsByName||!l.getElementsByName(S.expando).length})),g.disconnectedMatch=it((function(t){return f.call(t,"*")})),g.scope=it((function(){return l.querySelectorAll(":scope")})),g.cssHas=it((function(){try{return l.querySelector(":has(*,:jqfake)"),!1}catch(t){return!0}})),g.getById?(e.filter.ID=function(t){var e=t.replace(Z,K);return function(t){return t.getAttribute("id")===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&c){var i=e.getElementById(t);return i?[i]:[]}}):(e.filter.ID=function(t){var e=t.replace(Z,K);return function(t){var i=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return i&&i.value===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&c){var i,n,r,o=e.getElementById(t);if(o){if((i=o.getAttributeNode("id"))&&i.value===t)return[o];for(r=e.getElementsByName(t),n=0;o=r[n++];)if((i=o.getAttributeNode("id"))&&i.value===t)return[o]}return[]}}),e.find.TAG=function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):e.querySelectorAll(t)},e.find.CLASS=function(t,e){if(void 0!==e.getElementsByClassName&&c)return e.getElementsByClassName(t)},d=[],it((function(t){var e;u.appendChild(t).innerHTML="",t.querySelectorAll("[selected]").length||d.push("\\["+D+"*(?:value|"+O+")"),t.querySelectorAll("[id~="+v+"-]").length||d.push("~="),t.querySelectorAll("a#"+v+"+*").length||d.push(".#.+[+~]"),t.querySelectorAll(":checked").length||d.push(":checked"),(e=l.createElement("input")).setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),u.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(e=l.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||d.push("\\["+D+"*name"+D+"*="+D+"*(?:''|\"\")")})),g.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),_=function(t,e){if(t===e)return a=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!g.sortDetached&&e.compareDocumentPosition(t)===i?t===l||t.ownerDocument==R&&$.contains(R,t)?-1:e===l||e.ownerDocument==R&&$.contains(R,e)?1:r?h.call(r,t)-h.call(r,e):0:4&i?-1:1)},l):l}for(t in $.matches=function(t,e){return $(t,null,null,e)},$.matchesSelector=function(t,e){if(lt(t),c&&!T[e+" "]&&(!d||!d.test(e)))try{var i=f.call(t,e);if(i||g.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){T(e,!0)}return $(e,l,null,[t]).length>0},$.contains=function(t,e){return(t.ownerDocument||t)!=l&<(t),S.contains(t,e)},$.attr=function(t,i){(t.ownerDocument||t)!=l&<(t);var n=e.attrHandle[i.toLowerCase()],r=n&&p.call(e.attrHandle,i.toLowerCase())?n(t,i,!c):void 0;return void 0!==r?r:t.getAttribute(i)},$.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},S.uniqueSort=function(t){var e,i=[],n=0,o=0;if(a=!g.sortStable,r=!g.sortStable&&s.call(t,0),C.call(t,_),a){for(;e=t[o++];)e===t[o]&&(n=i.push(o));for(;n--;)E.call(t,i[n],1)}return r=null,t},S.fn.uniqueSort=function(){return this.pushStack(S.uniqueSort(s.apply(this)))},(e=S.expr={cacheLength:50,createPseudo:et,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(Z,K),t[3]=(t[3]||t[4]||t[5]||"").replace(Z,K),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||$.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&$.error(t[0]),t},PSEUDO:function(t){var e,i=!t[6]&&t[2];return G.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":i&&j.test(i)&&(e=ht(i,!0))&&(e=i.indexOf(")",i.length-e)-i.length)&&(t[0]=t[0].slice(0,e),t[2]=i.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(Z,K).toLowerCase();return"*"===t?function(){return!0}:function(t){return A(t,e)}},CLASS:function(t){var e=w[t+" "];return e||(e=new RegExp("(^|"+D+")"+t+"("+D+"|$)"))&&w(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,i){return function(n){var r=$.attr(n,t);return null==r?"!="===e:!e||(r+="","="===e?r===i:"!="===e?r!==i:"^="===e?i&&0===r.indexOf(i):"*="===e?i&&r.indexOf(i)>-1:"$="===e?i&&r.slice(-i.length)===i:"~="===e?(" "+r.replace(B," ")+" ").indexOf(i)>-1:"|="===e&&(r===i||r.slice(0,i.length+1)===i+"-"))}},CHILD:function(t,e,i,n,r){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===n&&0===r?function(t){return!!t.parentNode}:function(e,i,l){var u,h,c,d,p,f=o!==a?"nextSibling":"previousSibling",m=e.parentNode,g=s&&e.nodeName.toLowerCase(),b=!l&&!s,w=!1;if(m){if(o){for(;f;){for(c=e;c=c[f];)if(s?A(c,g):1===c.nodeType)return!1;p=f="only"===t&&!p&&"nextSibling"}return!0}if(p=[a?m.firstChild:m.lastChild],a&&b){for(w=(d=(u=(h=m[v]||(m[v]={}))[t]||[])[0]===y&&u[1])&&u[2],c=d&&m.childNodes[d];c=++d&&c&&c[f]||(w=d=0)||p.pop();)if(1===c.nodeType&&++w&&c===e){h[t]=[y,d,w];break}}else if(b&&(w=d=(u=(h=e[v]||(e[v]={}))[t]||[])[0]===y&&u[1]),!1===w)for(;(c=++d&&c&&c[f]||(w=d=0)||p.pop())&&(!(s?A(c,g):1===c.nodeType)||!++w||(b&&((h=c[v]||(c[v]={}))[t]=[y,w]),c!==e)););return(w-=r)===n||w%n==0&&w/n>=0}}},PSEUDO:function(t,i){var n,r=e.pseudos[t]||e.setFilters[t.toLowerCase()]||$.error("unsupported pseudo: "+t);return r[v]?r(i):r.length>1?(n=[t,t,"",i],e.setFilters.hasOwnProperty(t.toLowerCase())?et((function(t,e){for(var n,o=r(t,i),a=o.length;a--;)t[n=h.call(t,o[a])]=!(e[n]=o[a])})):function(t){return r(t,0,n)}):r}},pseudos:{not:et((function(t){var e=[],i=[],n=vt(t.replace(L,"$1"));return n[v]?et((function(t,e,i,r){for(var o,a=n(t,null,r,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))})):function(t,r,o){return e[0]=t,n(e,null,o,i),e[0]=null,!i.pop()}})),has:et((function(t){return function(e){return $(t,e).length>0}})),contains:et((function(t){return t=t.replace(Z,K),function(e){return(e.textContent||S.text(e)).indexOf(t)>-1}})),lang:et((function(t){return H.test(t||"")||$.error("unsupported lang: "+t),t=t.replace(Z,K).toLowerCase(),function(e){var i;do{if(i=c?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(i=i.toLowerCase())===t||0===i.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=i.location&&i.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===u},focus:function(t){return t===function(){try{return l.activeElement}catch(t){}}()&&l.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:ot(!1),disabled:ot(!0),checked:function(t){return A(t,"input")&&!!t.checked||A(t,"option")&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!e.pseudos.empty(t)},header:function(t){return q.test(t.nodeName)},input:function(t){return W.test(t.nodeName)},button:function(t){return A(t,"input")&&"button"===t.type||A(t,"button")},text:function(t){var e;return A(t,"input")&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:at((function(){return[0]})),last:at((function(t,e){return[e-1]})),eq:at((function(t,e,i){return[i<0?i+e:i]})),even:at((function(t,e){for(var i=0;ie?e:i;--n>=0;)t.push(n);return t})),gt:at((function(t,e,i){for(var n=i<0?i+e:i;++n1?function(e,i,n){for(var r=t.length;r--;)if(!t[r](e,i,n))return!1;return!0}:t[0]}function ft(t,e,i,n,r){for(var o,a=[],s=0,l=t.length,u=null!=e;s-1&&(o[u]=!(a[u]=d))}}else p=ft(p===a?p.splice(v,p.length):p),r?r(null,a,p,l):m.apply(a,p)}))}function gt(t){for(var i,r,o,a=t.length,s=e.relative[t[0].type],l=s||e.relative[" "],u=s?1:0,c=dt((function(t){return t===i}),l,!0),d=dt((function(t){return h.call(i,t)>-1}),l,!0),p=[function(t,e,r){var o=!s&&(r||e!=n)||((i=e).nodeType?c(t,e,r):d(t,e,r));return i=null,o}];u1&&pt(p),u>1&&ct(t.slice(0,u-1).concat({value:" "===t[u-2].type?"*":""})).replace(L,"$1"),r,u0,o=t.length>0,a=function(a,s,u,h,d){var p,f,g,v=0,b="0",w=a&&[],x=[],M=n,T=a||o&&e.find.TAG("*",d),_=y+=null==M?1:Math.random()||.1,A=T.length;for(d&&(n=s==l||s||d);b!==A&&null!=(p=T[b]);b++){if(o&&p){for(f=0,s||p.ownerDocument==l||(lt(p),u=!c);g=t[f++];)if(g(p,s||l,u)){m.call(h,p);break}d&&(y=_)}r&&((p=!g&&p)&&v--,a&&w.push(p))}if(v+=b,r&&b!==v){for(f=0;g=i[f++];)g(w,x,s,u);if(a){if(v>0)for(;b--;)w[b]||x[b]||(x[b]=P.call(h));x=ft(x)}m.apply(h,x),d&&!a&&x.length>0&&v+i.length>1&&S.uniqueSort(h)}return d&&(y=_,n=M),w};return r?et(a):a}(a,o))).selector=t}return s}function yt(t,i,n,r){var o,a,s,l,u,h="function"==typeof t&&t,d=!r&&ht(t=h.selector||t);if(n=n||[],1===d.length){if((a=d[0]=d[0].slice(0)).length>2&&"ID"===(s=a[0]).type&&9===i.nodeType&&c&&e.relative[a[1].type]){if(!(i=(e.find.ID(s.matches[0].replace(Z,K),i)||[])[0]))return n;h&&(i=i.parentNode),t=t.slice(a.shift().value.length)}for(o=G.needsContext.test(t)?0:a.length;o--&&(s=a[o],!e.relative[l=s.type]);)if((u=e.find[l])&&(r=u(s.matches[0].replace(Z,K),X.test(a[0].type)&&st(i.parentNode)||i))){if(a.splice(o,1),!(t=r.length&&ct(a)))return m.apply(n,r),n;break}}return(h||vt(t,d))(r,i,!c,n,!i||X.test(t)&&st(i.parentNode)||i),n}ut.prototype=e.filters=e.pseudos,e.setFilters=new ut,g.sortStable=v.split("").sort(_).join("")===v,lt(),g.sortDetached=it((function(t){return 1&t.compareDocumentPosition(l.createElement("fieldset"))})),S.find=$,S.expr[":"]=S.expr.pseudos,S.unique=S.uniqueSort,$.compile=vt,$.select=yt,$.setDocument=lt,$.escape=S.escapeSelector,$.getText=S.text,$.isXML=S.isXMLDoc,$.selectors=S.expr,$.support=S.support,$.uniqueSort=S.uniqueSort}();var k=function(t,e,i){for(var n=[],r=void 0!==i;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&S(t).is(i))break;n.push(t)}return n},F=function(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i},B=S.expr.match.needsContext,z=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function U(t,e,i){return v(e)?S.grep(t,(function(t,n){return!!e.call(t,n,t)!==i})):e.nodeType?S.grep(t,(function(t){return t===e!==i})):"string"!=typeof e?S.grep(t,(function(t){return h.call(e,t)>-1!==i})):S.filter(e,t,i)}S.filter=function(t,e,i){var n=e[0];return i&&(t=":not("+t+")"),1===e.length&&1===n.nodeType?S.find.matchesSelector(n,t)?[n]:[]:S.find.matches(t,S.grep(e,(function(t){return 1===t.nodeType})))},S.fn.extend({find:function(t){var e,i,n=this.length,r=this;if("string"!=typeof t)return this.pushStack(S(t).filter((function(){for(e=0;e1?S.uniqueSort(i):i},filter:function(t){return this.pushStack(U(this,t||[],!1))},not:function(t){return this.pushStack(U(this,t||[],!0))},is:function(t){return!!U(this,"string"==typeof t&&B.test(t)?S(t):t||[],!1).length}});var V,j=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(t,e,i){var n,r;if(!t)return this;if(i=i||V,"string"==typeof t){if(!(n="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:j.exec(t))||!n[1]&&e)return!e||e.jquery?(e||i).find(t):this.constructor(e).find(t);if(n[1]){if(e=e instanceof S?e[0]:e,S.merge(this,S.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:b,!0)),z.test(n[1])&&S.isPlainObject(e))for(n in e)v(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}return(r=b.getElementById(n[2]))&&(this[0]=r,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):v(t)?void 0!==i.ready?i.ready(t):t(S):S.makeArray(t,this)}).prototype=S.fn,V=S(b);var H=/^(?:parents|prev(?:Until|All))/,G={children:!0,contents:!0,next:!0,prev:!0};function W(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}S.fn.extend({has:function(t){var e=S(t,this),i=e.length;return this.filter((function(){for(var t=0;t-1:1===i.nodeType&&S.find.matchesSelector(i,t))){o.push(i);break}return this.pushStack(o.length>1?S.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?h.call(S(t),this[0]):h.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),S.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return k(t,"parentNode")},parentsUntil:function(t,e,i){return k(t,"parentNode",i)},next:function(t){return W(t,"nextSibling")},prev:function(t){return W(t,"previousSibling")},nextAll:function(t){return k(t,"nextSibling")},prevAll:function(t){return k(t,"previousSibling")},nextUntil:function(t,e,i){return k(t,"nextSibling",i)},prevUntil:function(t,e,i){return k(t,"previousSibling",i)},siblings:function(t){return F((t.parentNode||{}).firstChild,t)},children:function(t){return F(t.firstChild)},contents:function(t){return null!=t.contentDocument&&a(t.contentDocument)?t.contentDocument:(A(t,"template")&&(t=t.content||t),S.merge([],t.childNodes))}},(function(t,e){S.fn[t]=function(i,n){var r=S.map(this,e,i);return"Until"!==t.slice(-5)&&(n=i),n&&"string"==typeof n&&(r=S.filter(n,r)),this.length>1&&(G[t]||S.uniqueSort(r),H.test(t)&&r.reverse()),this.pushStack(r)}}));var q=/[^\x20\t\r\n\f]+/g;function Y(t){return t}function X(t){throw t}function Z(t,e,i,n){var r;try{t&&v(r=t.promise)?r.call(t).done(e).fail(i):t&&v(r=t.then)?r.call(t,e,i):e.apply(void 0,[t].slice(n))}catch(t){i.apply(void 0,[t])}}S.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return S.each(t.match(q)||[],(function(t,i){e[i]=!0})),e}(t):S.extend({},t);var e,i,n,r,o=[],a=[],s=-1,l=function(){for(r=r||t.once,n=e=!0;a.length;s=-1)for(i=a.shift();++s-1;)o.splice(i,1),i<=s&&s--})),this},has:function(t){return t?S.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return r=a=[],o=i="",this},disabled:function(){return!o},lock:function(){return r=a=[],i||e||(o=i=""),this},locked:function(){return!!r},fireWith:function(t,i){return r||(i=[t,(i=i||[]).slice?i.slice():i],a.push(i),e||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!n}};return u},S.extend({Deferred:function(t){var e=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],n="pending",r={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return r.then(null,t)},pipe:function(){var t=arguments;return S.Deferred((function(i){S.each(e,(function(e,n){var r=v(t[n[4]])&&t[n[4]];o[n[1]]((function(){var t=r&&r.apply(this,arguments);t&&v(t.promise)?t.promise().progress(i.notify).done(i.resolve).fail(i.reject):i[n[0]+"With"](this,r?[t]:arguments)}))})),t=null})).promise()},then:function(t,n,r){var o=0;function a(t,e,n,r){return function(){var s=this,l=arguments,u=function(){var i,u;if(!(t=o&&(n!==X&&(s=void 0,l=[i]),e.rejectWith(s,l))}};t?h():(S.Deferred.getErrorHook?h.error=S.Deferred.getErrorHook():S.Deferred.getStackHook&&(h.error=S.Deferred.getStackHook()),i.setTimeout(h))}}return S.Deferred((function(i){e[0][3].add(a(0,i,v(r)?r:Y,i.notifyWith)),e[1][3].add(a(0,i,v(t)?t:Y)),e[2][3].add(a(0,i,v(n)?n:X))})).promise()},promise:function(t){return null!=t?S.extend(t,r):r}},o={};return S.each(e,(function(t,i){var a=i[2],s=i[5];r[i[1]]=a.add,s&&a.add((function(){n=s}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),a.add(i[3].fire),o[i[0]]=function(){return o[i[0]+"With"](this===o?void 0:this,arguments),this},o[i[0]+"With"]=a.fireWith})),r.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,i=e,n=Array(i),r=s.call(arguments),o=S.Deferred(),a=function(t){return function(i){n[t]=this,r[t]=arguments.length>1?s.call(arguments):i,--e||o.resolveWith(n,r)}};if(e<=1&&(Z(t,o.done(a(i)).resolve,o.reject,!e),"pending"===o.state()||v(r[i]&&r[i].then)))return o.then();for(;i--;)Z(r[i],a(i),o.reject);return o.promise()}});var K=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(t,e){i.console&&i.console.warn&&t&&K.test(t.name)&&i.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},S.readyException=function(t){i.setTimeout((function(){throw t}))};var Q=S.Deferred();function J(){b.removeEventListener("DOMContentLoaded",J),i.removeEventListener("load",J),S.ready()}S.fn.ready=function(t){return Q.then(t).catch((function(t){S.readyException(t)})),this},S.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==t&&--S.readyWait>0||Q.resolveWith(b,[S]))}}),S.ready.then=Q.then,"complete"===b.readyState||"loading"!==b.readyState&&!b.documentElement.doScroll?i.setTimeout(S.ready):(b.addEventListener("DOMContentLoaded",J),i.addEventListener("load",J));var $=function(t,e,i,n,r,o,a){var s=0,l=t.length,u=null==i;if("object"===M(i))for(s in r=!0,i)$(t,e,s,i[s],!0,o,a);else if(void 0!==n&&(r=!0,v(n)||(a=!0),u&&(a?(e.call(t,n),e=null):(u=e,e=function(t,e,i){return u.call(S(t),i)})),e))for(;s1,null,!0)},removeData:function(t){return this.each((function(){st.remove(this,t)}))}}),S.extend({queue:function(t,e,i){var n;if(t)return e=(e||"fx")+"queue",n=at.get(t,e),i&&(!n||Array.isArray(i)?n=at.access(t,e,S.makeArray(i)):n.push(i)),n||[]},dequeue:function(t,e){e=e||"fx";var i=S.queue(t,e),n=i.length,r=i.shift(),o=S._queueHooks(t,e);"inprogress"===r&&(r=i.shift(),n--),r&&("fx"===e&&i.unshift("inprogress"),delete o.stop,r.call(t,(function(){S.dequeue(t,e)}),o)),!n&&o&&o.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return at.get(t,i)||at.access(t,i,{empty:S.Callbacks("once memory").add((function(){at.remove(t,[e+"queue",i])}))})}}),S.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.length\x20\t\r\n\f]*)/i,At=/^$|^module$|\/(?:java|ecma)script/i;Mt=b.createDocumentFragment().appendChild(b.createElement("div")),(Tt=b.createElement("input")).setAttribute("type","radio"),Tt.setAttribute("checked","checked"),Tt.setAttribute("name","t"),Mt.appendChild(Tt),g.checkClone=Mt.cloneNode(!0).cloneNode(!0).lastChild.checked,Mt.innerHTML="",g.noCloneChecked=!!Mt.cloneNode(!0).lastChild.defaultValue,Mt.innerHTML="",g.option=!!Mt.lastChild;var Pt={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Ct(t,e){var i;return i=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&A(t,e)?S.merge([t],i):i}function Et(t,e){for(var i=0,n=t.length;i",""]);var Dt=/<|&#?\w+;/;function Lt(t,e,i,n,r){for(var o,a,s,l,u,h,c=e.createDocumentFragment(),d=[],p=0,f=t.length;p-1)r&&r.push(o);else if(u=mt(o),a=Ct(c.appendChild(o),"script"),u&&Et(a),i)for(h=0;o=a[h++];)At.test(o.type||"")&&i.push(o);return c}var Ot=/^([^.]*)(?:\.(.+)|)/;function It(){return!0}function Rt(){return!1}function Nt(t,e,i,n,r,o){var a,s;if("object"==typeof e){for(s in"string"!=typeof i&&(n=n||i,i=void 0),e)Nt(t,s,i,n,e[s],o);return t}if(null==n&&null==r?(r=i,n=i=void 0):null==r&&("string"==typeof i?(r=n,n=void 0):(r=n,n=i,i=void 0)),!1===r)r=Rt;else if(!r)return t;return 1===o&&(a=r,(r=function(t){return S().off(t),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),t.each((function(){S.event.add(this,e,r,n,i)}))}function kt(t,e,i){i?(at.set(t,e,!1),S.event.add(t,e,{namespace:!1,handler:function(t){var i,n=at.get(this,e);if(1&t.isTrigger&&this[e]){if(n)(S.event.special[e]||{}).delegateType&&t.stopPropagation();else if(n=s.call(arguments),at.set(this,e,n),this[e](),i=at.get(this,e),at.set(this,e,!1),n!==i)return t.stopImmediatePropagation(),t.preventDefault(),i}else n&&(at.set(this,e,S.event.trigger(n[0],n.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=It)}})):void 0===at.get(t,e)&&S.event.add(t,e,It)}S.event={global:{},add:function(t,e,i,n,r){var o,a,s,l,u,h,c,d,p,f,m,g=at.get(t);if(rt(t))for(i.handler&&(i=(o=i).handler,r=o.selector),r&&S.find.matchesSelector(ft,r),i.guid||(i.guid=S.guid++),(l=g.events)||(l=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(e){return void 0!==S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(q)||[""]).length;u--;)p=m=(s=Ot.exec(e[u])||[])[1],f=(s[2]||"").split(".").sort(),p&&(c=S.event.special[p]||{},p=(r?c.delegateType:c.bindType)||p,c=S.event.special[p]||{},h=S.extend({type:p,origType:m,data:n,handler:i,guid:i.guid,selector:r,needsContext:r&&S.expr.match.needsContext.test(r),namespace:f.join(".")},o),(d=l[p])||((d=l[p]=[]).delegateCount=0,c.setup&&!1!==c.setup.call(t,n,f,a)||t.addEventListener&&t.addEventListener(p,a)),c.add&&(c.add.call(t,h),h.handler.guid||(h.handler.guid=i.guid)),r?d.splice(d.delegateCount++,0,h):d.push(h),S.event.global[p]=!0)},remove:function(t,e,i,n,r){var o,a,s,l,u,h,c,d,p,f,m,g=at.hasData(t)&&at.get(t);if(g&&(l=g.events)){for(u=(e=(e||"").match(q)||[""]).length;u--;)if(p=m=(s=Ot.exec(e[u])||[])[1],f=(s[2]||"").split(".").sort(),p){for(c=S.event.special[p]||{},d=l[p=(n?c.delegateType:c.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)h=d[o],!r&&m!==h.origType||i&&i.guid!==h.guid||s&&!s.test(h.namespace)||n&&n!==h.selector&&("**"!==n||!h.selector)||(d.splice(o,1),h.selector&&d.delegateCount--,c.remove&&c.remove.call(t,h));a&&!d.length&&(c.teardown&&!1!==c.teardown.call(t,f,g.handle)||S.removeEvent(t,p,g.handle),delete l[p])}else for(p in l)S.event.remove(t,p+e[u],i,n,!0);S.isEmptyObject(l)&&at.remove(t,"handle events")}},dispatch:function(t){var e,i,n,r,o,a,s=new Array(arguments.length),l=S.event.fix(t),u=(at.get(this,"events")||Object.create(null))[l.type]||[],h=S.event.special[l.type]||{};for(s[0]=l,e=1;e=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==t.type||!0!==u.disabled)){for(o=[],a={},i=0;i-1:S.find(r,this,null,[u]).length),a[r]&&o.push(n);o.length&&s.push({elem:u,handlers:o})}return u=this,l\s*$/g;function Ut(t,e){return A(t,"table")&&A(11!==e.nodeType?e:e.firstChild,"tr")&&S(t).children("tbody")[0]||t}function Vt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function jt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Ht(t,e){var i,n,r,o,a,s;if(1===e.nodeType){if(at.hasData(t)&&(s=at.get(t).events))for(r in at.remove(e,"handle events"),s)for(i=0,n=s[r].length;i1&&"string"==typeof f&&!g.checkClone&&Bt.test(f))return t.each((function(r){var o=t.eq(r);m&&(e[0]=f.call(this,r,o.html())),Wt(o,e,i,n)}));if(d&&(o=(r=Lt(e,t[0].ownerDocument,!1,t,n)).firstChild,1===r.childNodes.length&&(r=o),o||n)){for(s=(a=S.map(Ct(r,"script"),Vt)).length;c0&&Et(a,!l&&Ct(t,"script")),s},cleanData:function(t){for(var e,i,n,r=S.event.special,o=0;void 0!==(i=t[o]);o++)if(rt(i)){if(e=i[at.expando]){if(e.events)for(n in e.events)r[n]?S.event.remove(i,n):S.removeEvent(i,n,e.handle);i[at.expando]=void 0}i[st.expando]&&(i[st.expando]=void 0)}}}),S.fn.extend({detach:function(t){return qt(this,t,!0)},remove:function(t){return qt(this,t)},text:function(t){return $(this,(function(t){return void 0===t?S.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Wt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ut(this,t).appendChild(t)}))},prepend:function(){return Wt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Ut(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Wt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Wt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(S.cleanData(Ct(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return S.clone(this,t,e)}))},html:function(t){return $(this,(function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Ft.test(t)&&!Pt[(_t.exec(t)||["",""])[1].toLowerCase()]){t=S.htmlPrefilter(t);try{for(;i=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-l-s-.5))||0),l+u}function ue(t,e,i){var n=Zt(t),r=(!g.boxSizingReliable()||i)&&"border-box"===S.css(t,"boxSizing",!1,n),o=r,a=Jt(t,e,n),s="offset"+e[0].toUpperCase()+e.slice(1);if(Yt.test(a)){if(!i)return a;a="auto"}return(!g.boxSizingReliable()&&r||!g.reliableTrDimensions()&&A(t,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(t,"display",!1,n))&&t.getClientRects().length&&(r="border-box"===S.css(t,"boxSizing",!1,n),(o=s in t)&&(a=t[s])),(a=parseFloat(a)||0)+le(t,e,i||(r?"border":"content"),o,n,a)+"px"}function he(t,e,i,n,r){return new he.prototype.init(t,e,i,n,r)}S.extend({cssHooks:{opacity:{get:function(t,e){if(e){var i=Jt(t,"opacity");return""===i?"1":i}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(t,e,i,n){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,o,a,s=nt(e),l=Xt.test(e),u=t.style;if(l||(e=ne(s)),a=S.cssHooks[e]||S.cssHooks[s],void 0===i)return a&&"get"in a&&void 0!==(r=a.get(t,!1,n))?r:u[e];"string"===(o=typeof i)&&(r=dt.exec(i))&&r[1]&&(i=yt(t,e,r),o="number"),null!=i&&i==i&&("number"!==o||l||(i+=r&&r[3]||(S.cssNumber[s]?"":"px")),g.clearCloneStyle||""!==i||0!==e.indexOf("background")||(u[e]="inherit"),a&&"set"in a&&void 0===(i=a.set(t,i,n))||(l?u.setProperty(e,i):u[e]=i))}},css:function(t,e,i,n){var r,o,a,s=nt(e);return Xt.test(e)||(e=ne(s)),(a=S.cssHooks[e]||S.cssHooks[s])&&"get"in a&&(r=a.get(t,!0,i)),void 0===r&&(r=Jt(t,e,n)),"normal"===r&&e in ae&&(r=ae[e]),""===i||i?(o=parseFloat(r),!0===i||isFinite(o)?o||0:r):r}}),S.each(["height","width"],(function(t,e){S.cssHooks[e]={get:function(t,i,n){if(i)return!re.test(S.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?ue(t,e,n):Kt(t,oe,(function(){return ue(t,e,n)}))},set:function(t,i,n){var r,o=Zt(t),a=!g.scrollboxSize()&&"absolute"===o.position,s=(a||n)&&"border-box"===S.css(t,"boxSizing",!1,o),l=n?le(t,e,n,s,o):0;return s&&a&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-le(t,e,"border",!1,o)-.5)),l&&(r=dt.exec(i))&&"px"!==(r[3]||"px")&&(t.style[e]=i,i=S.css(t,e)),se(0,i,l)}}})),S.cssHooks.marginLeft=$t(g.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Jt(t,"marginLeft"))||t.getBoundingClientRect().left-Kt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),S.each({margin:"",padding:"",border:"Width"},(function(t,e){S.cssHooks[t+e]={expand:function(i){for(var n=0,r={},o="string"==typeof i?i.split(" "):[i];n<4;n++)r[t+pt[n]+e]=o[n]||o[n-2]||o[0];return r}},"margin"!==t&&(S.cssHooks[t+e].set=se)})),S.fn.extend({css:function(t,e){return $(this,(function(t,e,i){var n,r,o={},a=0;if(Array.isArray(e)){for(n=Zt(t),r=e.length;a1)}}),S.Tween=he,he.prototype={constructor:he,init:function(t,e,i,n,r,o){this.elem=t,this.prop=i,this.easing=r||S.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=n,this.unit=o||(S.cssNumber[i]?"":"px")},cur:function(){var t=he.propHooks[this.prop];return t&&t.get?t.get(this):he.propHooks._default.get(this)},run:function(t){var e,i=he.propHooks[this.prop];return this.options.duration?this.pos=e=S.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):he.propHooks._default.set(this),this}},he.prototype.init.prototype=he.prototype,he.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=S.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){S.fx.step[t.prop]?S.fx.step[t.prop](t):1!==t.elem.nodeType||!S.cssHooks[t.prop]&&null==t.elem.style[ne(t.prop)]?t.elem[t.prop]=t.now:S.style(t.elem,t.prop,t.now+t.unit)}}},he.propHooks.scrollTop=he.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},S.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},S.fx=he.prototype.init,S.fx.step={};var ce,de,pe=/^(?:toggle|show|hide)$/,fe=/queueHooks$/;function me(){de&&(!1===b.hidden&&i.requestAnimationFrame?i.requestAnimationFrame(me):i.setTimeout(me,S.fx.interval),S.fx.tick())}function ge(){return i.setTimeout((function(){ce=void 0})),ce=Date.now()}function ve(t,e){var i,n=0,r={height:t};for(e=e?1:0;n<4;n+=2-e)r["margin"+(i=pt[n])]=r["padding"+i]=t;return e&&(r.opacity=r.width=t),r}function ye(t,e,i){for(var n,r=(be.tweeners[e]||[]).concat(be.tweeners["*"]),o=0,a=r.length;o1)},removeAttr:function(t){return this.each((function(){S.removeAttr(this,t)}))}}),S.extend({attr:function(t,e,i){var n,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?S.prop(t,e,i):(1===o&&S.isXMLDoc(t)||(r=S.attrHooks[e.toLowerCase()]||(S.expr.match.bool.test(e)?we:void 0)),void 0!==i?null===i?void S.removeAttr(t,e):r&&"set"in r&&void 0!==(n=r.set(t,i,e))?n:(t.setAttribute(e,i+""),i):r&&"get"in r&&null!==(n=r.get(t,e))?n:null==(n=S.find.attr(t,e))?void 0:n)},attrHooks:{type:{set:function(t,e){if(!g.radioValue&&"radio"===e&&A(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}}},removeAttr:function(t,e){var i,n=0,r=e&&e.match(q);if(r&&1===t.nodeType)for(;i=r[n++];)t.removeAttribute(i)}}),we={set:function(t,e,i){return!1===e?S.removeAttr(t,i):t.setAttribute(i,i),i}},S.each(S.expr.match.bool.source.match(/\w+/g),(function(t,e){var i=xe[e]||S.find.attr;xe[e]=function(t,e,n){var r,o,a=e.toLowerCase();return n||(o=xe[a],xe[a]=r,r=null!=i(t,e,n)?a:null,xe[a]=o),r}}));var Me=/^(?:input|select|textarea|button)$/i,Te=/^(?:a|area)$/i;function Se(t){return(t.match(q)||[]).join(" ")}function _e(t){return t.getAttribute&&t.getAttribute("class")||""}function Ae(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(q)||[]}S.fn.extend({prop:function(t,e){return $(this,S.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[S.propFix[t]||t]}))}}),S.extend({prop:function(t,e,i){var n,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(t)||(e=S.propFix[e]||e,r=S.propHooks[e]),void 0!==i?r&&"set"in r&&void 0!==(n=r.set(t,i,e))?n:t[e]=i:r&&"get"in r&&null!==(n=r.get(t,e))?n:t[e]},propHooks:{tabIndex:{get:function(t){var e=S.find.attr(t,"tabindex");return e?parseInt(e,10):Me.test(t.nodeName)||Te.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(S.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){S.propFix[this.toLowerCase()]=this})),S.fn.extend({addClass:function(t){var e,i,n,r,o,a;return v(t)?this.each((function(e){S(this).addClass(t.call(this,e,_e(this)))})):(e=Ae(t)).length?this.each((function(){if(n=_e(this),i=1===this.nodeType&&" "+Se(n)+" "){for(o=0;o-1;)i=i.replace(" "+r+" "," ");a=Se(i),n!==a&&this.setAttribute("class",a)}})):this:this.attr("class","")},toggleClass:function(t,e){var i,n,r,o,a=typeof t,s="string"===a||Array.isArray(t);return v(t)?this.each((function(i){S(this).toggleClass(t.call(this,i,_e(this),e),e)})):"boolean"==typeof e&&s?e?this.addClass(t):this.removeClass(t):(i=Ae(t),this.each((function(){if(s)for(o=S(this),r=0;r-1)return!0;return!1}});var Pe=/\r/g;S.fn.extend({val:function(t){var e,i,n,r=this[0];return arguments.length?(n=v(t),this.each((function(i){var r;1===this.nodeType&&(null==(r=n?t.call(this,i,S(this).val()):t)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=S.map(r,(function(t){return null==t?"":t+""}))),(e=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))}))):r?(e=S.valHooks[r.type]||S.valHooks[r.nodeName.toLowerCase()])&&"get"in e&&void 0!==(i=e.get(r,"value"))?i:"string"==typeof(i=r.value)?i.replace(Pe,""):null==i?"":i:void 0}}),S.extend({valHooks:{option:{get:function(t){var e=S.find.attr(t,"value");return null!=e?e:Se(S.text(t))}},select:{get:function(t){var e,i,n,r=t.options,o=t.selectedIndex,a="select-one"===t.type,s=a?null:[],l=a?o+1:r.length;for(n=o<0?l:a?o:0;n-1)&&(i=!0);return i||(t.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],(function(){S.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=S.inArray(S(t).val(),e)>-1}},g.checkOn||(S.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}));var Ce=i.location,Ee={guid:Date.now()},De=/\?/;S.parseXML=function(t){var e,n;if(!t||"string"!=typeof t)return null;try{e=(new i.DOMParser).parseFromString(t,"text/xml")}catch(t){}return n=e&&e.getElementsByTagName("parsererror")[0],e&&!n||S.error("Invalid XML: "+(n?S.map(n.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var Le=/^(?:focusinfocus|focusoutblur)$/,Oe=function(t){t.stopPropagation()};S.extend(S.event,{trigger:function(t,e,n,r){var o,a,s,l,u,h,c,d,f=[n||b],m=p.call(t,"type")?t.type:t,g=p.call(t,"namespace")?t.namespace.split("."):[];if(a=d=s=n=n||b,3!==n.nodeType&&8!==n.nodeType&&!Le.test(m+S.event.triggered)&&(m.indexOf(".")>-1&&(g=m.split("."),m=g.shift(),g.sort()),u=m.indexOf(":")<0&&"on"+m,(t=t[S.expando]?t:new S.Event(m,"object"==typeof t&&t)).isTrigger=r?2:3,t.namespace=g.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),e=null==e?[t]:S.makeArray(e,[t]),c=S.event.special[m]||{},r||!c.trigger||!1!==c.trigger.apply(n,e))){if(!r&&!c.noBubble&&!y(n)){for(l=c.delegateType||m,Le.test(l+m)||(a=a.parentNode);a;a=a.parentNode)f.push(a),s=a;s===(n.ownerDocument||b)&&f.push(s.defaultView||s.parentWindow||i)}for(o=0;(a=f[o++])&&!t.isPropagationStopped();)d=a,t.type=o>1?l:c.bindType||m,(h=(at.get(a,"events")||Object.create(null))[t.type]&&at.get(a,"handle"))&&h.apply(a,e),(h=u&&a[u])&&h.apply&&rt(a)&&(t.result=h.apply(a,e),!1===t.result&&t.preventDefault());return t.type=m,r||t.isDefaultPrevented()||c._default&&!1!==c._default.apply(f.pop(),e)||!rt(n)||u&&v(n[m])&&!y(n)&&((s=n[u])&&(n[u]=null),S.event.triggered=m,t.isPropagationStopped()&&d.addEventListener(m,Oe),n[m](),t.isPropagationStopped()&&d.removeEventListener(m,Oe),S.event.triggered=void 0,s&&(n[u]=s)),t.result}},simulate:function(t,e,i){var n=S.extend(new S.Event,i,{type:t,isSimulated:!0});S.event.trigger(n,null,e)}}),S.fn.extend({trigger:function(t,e){return this.each((function(){S.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var i=this[0];if(i)return S.event.trigger(t,e,i,!0)}});var Ie=/\[\]$/,Re=/\r?\n/g,Ne=/^(?:submit|button|image|reset|file)$/i,ke=/^(?:input|select|textarea|keygen)/i;function Fe(t,e,i,n){var r;if(Array.isArray(e))S.each(e,(function(e,r){i||Ie.test(t)?n(t,r):Fe(t+"["+("object"==typeof r&&null!=r?e:"")+"]",r,i,n)}));else if(i||"object"!==M(e))n(t,e);else for(r in e)Fe(t+"["+r+"]",e[r],i,n)}S.param=function(t,e){var i,n=[],r=function(t,e){var i=v(e)?e():e;n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==i?"":i)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!S.isPlainObject(t))S.each(t,(function(){r(this.name,this.value)}));else for(i in t)Fe(i,t[i],e,r);return n.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=S.prop(this,"elements");return t?S.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!S(this).is(":disabled")&&ke.test(this.nodeName)&&!Ne.test(t)&&(this.checked||!St.test(t))})).map((function(t,e){var i=S(this).val();return null==i?null:Array.isArray(i)?S.map(i,(function(t){return{name:e.name,value:t.replace(Re,"\r\n")}})):{name:e.name,value:i.replace(Re,"\r\n")}})).get()}});var Be=/%20/g,ze=/#.*$/,Ue=/([?&])_=[^&]*/,Ve=/^(.*?):[ \t]*([^\r\n]*)$/gm,je=/^(?:GET|HEAD)$/,He=/^\/\//,Ge={},We={},qe="*/".concat("*"),Ye=b.createElement("a");function Xe(t){return function(e,i){"string"!=typeof e&&(i=e,e="*");var n,r=0,o=e.toLowerCase().match(q)||[];if(v(i))for(;n=o[r++];)"+"===n[0]?(n=n.slice(1)||"*",(t[n]=t[n]||[]).unshift(i)):(t[n]=t[n]||[]).push(i)}}function Ze(t,e,i,n){var r={},o=t===We;function a(s){var l;return r[s]=!0,S.each(t[s]||[],(function(t,s){var u=s(e,i,n);return"string"!=typeof u||o||r[u]?o?!(l=u):void 0:(e.dataTypes.unshift(u),a(u),!1)})),l}return a(e.dataTypes[0])||!r["*"]&&a("*")}function Ke(t,e){var i,n,r=S.ajaxSettings.flatOptions||{};for(i in e)void 0!==e[i]&&((r[i]?t:n||(n={}))[i]=e[i]);return n&&S.extend(!0,t,n),t}Ye.href=Ce.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ce.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Ce.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":qe,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Ke(Ke(t,S.ajaxSettings),e):Ke(S.ajaxSettings,t)},ajaxPrefilter:Xe(Ge),ajaxTransport:Xe(We),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var n,r,o,a,s,l,u,h,c,d,p=S.ajaxSetup({},e),f=p.context||p,m=p.context&&(f.nodeType||f.jquery)?S(f):S.event,g=S.Deferred(),v=S.Callbacks("once memory"),y=p.statusCode||{},w={},x={},M="canceled",T={readyState:0,getResponseHeader:function(t){var e;if(u){if(!a)for(a={};e=Ve.exec(o);)a[e[1].toLowerCase()+" "]=(a[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=a[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return u?o:null},setRequestHeader:function(t,e){return null==u&&(t=x[t.toLowerCase()]=x[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==u&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(u)T.always(t[T.status]);else for(e in t)y[e]=[y[e],t[e]];return this},abort:function(t){var e=t||M;return n&&n.abort(e),_(0,e),this}};if(g.promise(T),p.url=((t||p.url||Ce.href)+"").replace(He,Ce.protocol+"//"),p.type=e.method||e.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(q)||[""],null==p.crossDomain){l=b.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=Ye.protocol+"//"+Ye.host!=l.protocol+"//"+l.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=S.param(p.data,p.traditional)),Ze(Ge,p,e,T),u)return T;for(c in(h=S.event&&p.global)&&0==S.active++&&S.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!je.test(p.type),r=p.url.replace(ze,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Be,"+")):(d=p.url.slice(r.length),p.data&&(p.processData||"string"==typeof p.data)&&(r+=(De.test(r)?"&":"?")+p.data,delete p.data),!1===p.cache&&(r=r.replace(Ue,"$1"),d=(De.test(r)?"&":"?")+"_="+Ee.guid+++d),p.url=r+d),p.ifModified&&(S.lastModified[r]&&T.setRequestHeader("If-Modified-Since",S.lastModified[r]),S.etag[r]&&T.setRequestHeader("If-None-Match",S.etag[r])),(p.data&&p.hasContent&&!1!==p.contentType||e.contentType)&&T.setRequestHeader("Content-Type",p.contentType),T.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+qe+"; q=0.01":""):p.accepts["*"]),p.headers)T.setRequestHeader(c,p.headers[c]);if(p.beforeSend&&(!1===p.beforeSend.call(f,T,p)||u))return T.abort();if(M="abort",v.add(p.complete),T.done(p.success),T.fail(p.error),n=Ze(We,p,e,T)){if(T.readyState=1,h&&m.trigger("ajaxSend",[T,p]),u)return T;p.async&&p.timeout>0&&(s=i.setTimeout((function(){T.abort("timeout")}),p.timeout));try{u=!1,n.send(w,_)}catch(t){if(u)throw t;_(-1,t)}}else _(-1,"No Transport");function _(t,e,a,l){var c,d,b,w,x,M=e;u||(u=!0,s&&i.clearTimeout(s),n=void 0,o=l||"",T.readyState=t>0?4:0,c=t>=200&&t<300||304===t,a&&(w=function(t,e,i){for(var n,r,o,a,s=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=t.mimeType||e.getResponseHeader("Content-Type"));if(n)for(r in s)if(s[r]&&s[r].test(n)){l.unshift(r);break}if(l[0]in i)o=l[0];else{for(r in i){if(!l[0]||t.converters[r+" "+l[0]]){o=r;break}a||(a=r)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),i[o]}(p,T,a)),!c&&S.inArray("script",p.dataTypes)>-1&&S.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),w=function(t,e,i,n){var r,o,a,s,l,u={},h=t.dataTypes.slice();if(h[1])for(a in t.converters)u[a.toLowerCase()]=t.converters[a];for(o=h.shift();o;)if(t.responseFields[o]&&(i[t.responseFields[o]]=e),!l&&n&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=o,o=h.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(r in u)if((s=r.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[r]:!0!==u[r]&&(o=s[0],h.unshift(s[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+l+" to "+o}}}return{state:"success",data:e}}(p,w,T,c),c?(p.ifModified&&((x=T.getResponseHeader("Last-Modified"))&&(S.lastModified[r]=x),(x=T.getResponseHeader("etag"))&&(S.etag[r]=x)),204===t||"HEAD"===p.type?M="nocontent":304===t?M="notmodified":(M=w.state,d=w.data,c=!(b=w.error))):(b=M,!t&&M||(M="error",t<0&&(t=0))),T.status=t,T.statusText=(e||M)+"",c?g.resolveWith(f,[d,M,T]):g.rejectWith(f,[T,M,b]),T.statusCode(y),y=void 0,h&&m.trigger(c?"ajaxSuccess":"ajaxError",[T,p,c?d:b]),v.fireWith(f,[T,M]),h&&(m.trigger("ajaxComplete",[T,p]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(t,e,i){return S.get(t,e,i,"json")},getScript:function(t,e){return S.get(t,void 0,e,"script")}}),S.each(["get","post"],(function(t,e){S[e]=function(t,i,n,r){return v(i)&&(r=r||n,n=i,i=void 0),S.ajax(S.extend({url:t,type:e,dataType:r,data:i,success:n},S.isPlainObject(t)&&t))}})),S.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),S._evalUrl=function(t,e,i){return S.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){S.globalEval(t,e,i)}})},S.fn.extend({wrapAll:function(t){var e;return this[0]&&(v(t)&&(t=t.call(this[0])),e=S(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return v(t)?this.each((function(e){S(this).wrapInner(t.call(this,e))})):this.each((function(){var e=S(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)}))},wrap:function(t){var e=v(t);return this.each((function(i){S(this).wrapAll(e?t.call(this,i):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){S(this).replaceWith(this.childNodes)})),this}}),S.expr.pseudos.hidden=function(t){return!S.expr.pseudos.visible(t)},S.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new i.XMLHttpRequest}catch(t){}};var Qe={0:200,1223:204},Je=S.ajaxSettings.xhr();g.cors=!!Je&&"withCredentials"in Je,g.ajax=Je=!!Je,S.ajaxTransport((function(t){var e,n;if(g.cors||Je&&!t.crossDomain)return{send:function(r,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];for(a in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)s.setRequestHeader(a,r[a]);e=function(t){return function(){e&&(e=n=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===t?s.abort():"error"===t?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Qe[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=e(),n=s.onerror=s.ontimeout=e("error"),void 0!==s.onabort?s.onabort=n:s.onreadystatechange=function(){4===s.readyState&&i.setTimeout((function(){e&&n()}))},e=e("abort");try{s.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),S.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return S.globalEval(t),t}}}),S.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),S.ajaxTransport("script",(function(t){var e,i;if(t.crossDomain||t.scriptAttrs)return{send:function(n,r){e=S("