(window.webpackJsonp=window.webpackJsonp||[]).push([[1],[function(t,e,i){"use strict";i.r(e),i.d(e,"ACESFilmicToneMapping",(function(){return it})),i.d(e,"AddEquation",(function(){return S})),i.d(e,"AddOperation",(function(){return J})),i.d(e,"AdditiveAnimationBlendMode",(function(){return je})),i.d(e,"AdditiveBlending",(function(){return w})),i.d(e,"AlphaFormat",(function(){return Bt})),i.d(e,"AlwaysDepth",(function(){return V})),i.d(e,"AlwaysStencilFunc",(function(){return _i})),i.d(e,"AmbientLight",(function(){return ou})),i.d(e,"AmbientLightProbe",(function(){return Cu})),i.d(e,"AnimationClip",(function(){return pc})),i.d(e,"AnimationLoader",(function(){return wc})),i.d(e,"AnimationMixer",(function(){return sd})),i.d(e,"AnimationObjectGroup",(function(){return nd})),i.d(e,"AnimationUtils",(function(){return tc})),i.d(e,"ArcCurve",(function(){return Pc})),i.d(e,"ArrayCamera",(function(){return Ca})),i.d(e,"ArrowHelper",(function(){return qd})),i.d(e,"Audio",(function(){return Uu})),i.d(e,"AudioAnalyser",(function(){return Xu})),i.d(e,"AudioContext",(function(){return Su})),i.d(e,"AudioListener",(function(){return Nu})),i.d(e,"AudioLoader",(function(){return Mu})),i.d(e,"AxesHelper",(function(){return Zd})),i.d(e,"AxisHelper",(function(){return Qp})),i.d(e,"BackSide",(function(){return m})),i.d(e,"BasicDepthPacking",(function(){return ri})),i.d(e,"BasicShadowMap",(function(){return c})),i.d(e,"BinaryTextureLoader",(function(){return rf})),i.d(e,"Bone",(function(){return dh})),i.d(e,"BooleanKeyframeTrack",(function(){return oc})),i.d(e,"BoundingBoxHelper",(function(){return $p})),i.d(e,"Box2",(function(){return md})),i.d(e,"Box3",(function(){return $i})),i.d(e,"Box3Helper",(function(){return Hd})),i.d(e,"BoxBufferGeometry",(function(){return ds})),i.d(e,"BoxGeometry",(function(){return ds})),i.d(e,"BoxHelper",(function(){return Vd})),i.d(e,"BufferAttribute",(function(){return Sr})),i.d(e,"BufferGeometry",(function(){return jr})),i.d(e,"BufferGeometryLoader",(function(){return fu})),i.d(e,"ByteType",(function(){return St})),i.d(e,"Cache",(function(){return mc})),i.d(e,"Camera",(function(){return vs})),i.d(e,"CameraHelper",(function(){return Ud})),i.d(e,"CanvasRenderer",(function(){return af})),i.d(e,"CanvasTexture",(function(){return Gh})),i.d(e,"CatmullRomCurve3",(function(){return Fc})),i.d(e,"CineonToneMapping",(function(){return et})),i.d(e,"CircleBufferGeometry",(function(){return Hh})),i.d(e,"CircleGeometry",(function(){return Hh})),i.d(e,"ClampToEdgeWrapping",(function(){return dt})),i.d(e,"Clock",(function(){return Ou})),i.d(e,"ClosedSplineCurve3",(function(){return Zp})),i.d(e,"Color",(function(){return yr})),i.d(e,"ColorKeyframeTrack",(function(){return ac})),i.d(e,"CompressedTexture",(function(){return zh})),i.d(e,"CompressedTextureLoader",(function(){return Tc})),i.d(e,"ConeBufferGeometry",(function(){return Xh})),i.d(e,"ConeGeometry",(function(){return Xh})),i.d(e,"CubeCamera",(function(){return xs})),i.d(e,"CubeReflectionMapping",(function(){return st})),i.d(e,"CubeRefractionMapping",(function(){return ot})),i.d(e,"CubeTexture",(function(){return bs})),i.d(e,"CubeTextureLoader",(function(){return Ec})),i.d(e,"CubeUVReflectionMapping",(function(){return lt})),i.d(e,"CubeUVRefractionMapping",(function(){return ct})),i.d(e,"CubicBezierCurve",(function(){return Uc})),i.d(e,"CubicBezierCurve3",(function(){return zc})),i.d(e,"CubicInterpolant",(function(){return ic})),i.d(e,"CullFaceBack",(function(){return a})),i.d(e,"CullFaceFront",(function(){return h})),i.d(e,"CullFaceFrontBack",(function(){return l})),i.d(e,"CullFaceNone",(function(){return o})),i.d(e,"Curve",(function(){return Ac})),i.d(e,"CurvePath",(function(){return Yc})),i.d(e,"CustomBlending",(function(){return E})),i.d(e,"CustomToneMapping",(function(){return nt})),i.d(e,"CylinderBufferGeometry",(function(){return Wh})),i.d(e,"CylinderGeometry",(function(){return Wh})),i.d(e,"Cylindrical",(function(){return pd})),i.d(e,"DataTexture",(function(){return Ts})),i.d(e,"DataTexture2DArray",(function(){return js})),i.d(e,"DataTexture3D",(function(){return Ys})),i.d(e,"DataTextureLoader",(function(){return Sc})),i.d(e,"DataUtils",(function(){return Qd})),i.d(e,"DecrementStencilOp",(function(){return di})),i.d(e,"DecrementWrapStencilOp",(function(){return fi})),i.d(e,"DefaultLoadingManager",(function(){return vc})),i.d(e,"DepthFormat",(function(){return Vt})),i.d(e,"DepthStencilFormat",(function(){return Ht})),i.d(e,"DepthTexture",(function(){return Vh})),i.d(e,"DirectionalLight",(function(){return su})),i.d(e,"DirectionalLightHelper",(function(){return Bd})),i.d(e,"DiscreteInterpolant",(function(){return rc})),i.d(e,"DodecahedronBufferGeometry",(function(){return Yh})),i.d(e,"DodecahedronGeometry",(function(){return Yh})),i.d(e,"DoubleSide",(function(){return g})),i.d(e,"DstAlphaFactor",(function(){return B})),i.d(e,"DstColorFactor",(function(){return N})),i.d(e,"DynamicBufferAttribute",(function(){return Up})),i.d(e,"DynamicCopyUsage",(function(){return Li})),i.d(e,"DynamicDrawUsage",(function(){return Si})),i.d(e,"DynamicReadUsage",(function(){return Ci})),i.d(e,"EdgesGeometry",(function(){return Qh})),i.d(e,"EdgesHelper",(function(){return tf})),i.d(e,"EllipseCurve",(function(){return Cc})),i.d(e,"EqualDepth",(function(){return X})),i.d(e,"EqualStencilFunc",(function(){return yi})),i.d(e,"EquirectangularReflectionMapping",(function(){return at})),i.d(e,"EquirectangularRefractionMapping",(function(){return ht})),i.d(e,"Euler",(function(){return Dn})),i.d(e,"EventDispatcher",(function(){return Fi})),i.d(e,"ExtrudeBufferGeometry",(function(){return Al})),i.d(e,"ExtrudeGeometry",(function(){return Al})),i.d(e,"Face3",(function(){return xr})),i.d(e,"Face4",(function(){return Ep})),i.d(e,"FaceColors",(function(){return Cp})),i.d(e,"FileLoader",(function(){return bc})),i.d(e,"FlatShading",(function(){return v})),i.d(e,"Float16BufferAttribute",(function(){return Dr})),i.d(e,"Float32Attribute",(function(){return Yp})),i.d(e,"Float32BufferAttribute",(function(){return Ir})),i.d(e,"Float64Attribute",(function(){return qp})),i.d(e,"Float64BufferAttribute",(function(){return Fr})),i.d(e,"FloatType",(function(){return Rt})),i.d(e,"Fog",(function(){return Ba})),i.d(e,"FogExp2",(function(){return Fa})),i.d(e,"Font",(function(){return wu})),i.d(e,"FontLoader",(function(){return _u})),i.d(e,"FrontSide",(function(){return f})),i.d(e,"Frustum",(function(){return Ss})),i.d(e,"GLBufferAttribute",(function(){return hd})),i.d(e,"GLSL1",(function(){return Di})),i.d(e,"GLSL3",(function(){return Ii})),i.d(e,"GammaEncoding",(function(){return Qe})),i.d(e,"GeometryUtils",(function(){return of})),i.d(e,"GreaterDepth",(function(){return Y})),i.d(e,"GreaterEqualDepth",(function(){return j})),i.d(e,"GreaterEqualStencilFunc",(function(){return Ti})),i.d(e,"GreaterStencilFunc",(function(){return bi})),i.d(e,"GridHelper",(function(){return Ld})),i.d(e,"Group",(function(){return Pa})),i.d(e,"HalfFloatType",(function(){return Lt})),i.d(e,"HemisphereLight",(function(){return Jc})),i.d(e,"HemisphereLightHelper",(function(){return Rd})),i.d(e,"HemisphereLightProbe",(function(){return Au})),i.d(e,"IcosahedronBufferGeometry",(function(){return Pl})),i.d(e,"IcosahedronGeometry",(function(){return Pl})),i.d(e,"ImageBitmapLoader",(function(){return xu})),i.d(e,"ImageLoader",(function(){return _c})),i.d(e,"ImageUtils",(function(){return Vi})),i.d(e,"ImmediateRenderObject",(function(){return xd})),i.d(e,"IncrementStencilOp",(function(){return ui})),i.d(e,"IncrementWrapStencilOp",(function(){return pi})),i.d(e,"InstancedBufferAttribute",(function(){return pu})),i.d(e,"InstancedBufferGeometry",(function(){return du})),i.d(e,"InstancedInterleavedBuffer",(function(){return ad})),i.d(e,"InstancedMesh",(function(){return bh})),i.d(e,"Int16Attribute",(function(){return Hp})),i.d(e,"Int16BufferAttribute",(function(){return Pr})),i.d(e,"Int32Attribute",(function(){return Xp})),i.d(e,"Int32BufferAttribute",(function(){return Lr})),i.d(e,"Int8Attribute",(function(){return zp})),i.d(e,"Int8BufferAttribute",(function(){return Mr})),i.d(e,"IntType",(function(){return Ct})),i.d(e,"InterleavedBuffer",(function(){return Na})),i.d(e,"InterleavedBufferAttribute",(function(){return za})),i.d(e,"Interpolant",(function(){return ec})),i.d(e,"InterpolateDiscrete",(function(){return Ue})),i.d(e,"InterpolateLinear",(function(){return ze})),i.d(e,"InterpolateSmooth",(function(){return Ge})),i.d(e,"InvertStencilOp",(function(){return mi})),i.d(e,"JSONLoader",(function(){return hf})),i.d(e,"KeepStencilOp",(function(){return li})),i.d(e,"KeyframeTrack",(function(){return sc})),i.d(e,"LOD",(function(){return sh})),i.d(e,"LatheBufferGeometry",(function(){return Rl})),i.d(e,"LatheGeometry",(function(){return Rl})),i.d(e,"Layers",(function(){return Bn})),i.d(e,"LensFlare",(function(){return cf})),i.d(e,"LessDepth",(function(){return H})),i.d(e,"LessEqualDepth",(function(){return W})),i.d(e,"LessEqualStencilFunc",(function(){return xi})),i.d(e,"LessStencilFunc",(function(){return vi})),i.d(e,"Light",(function(){return Kc})),i.d(e,"LightProbe",(function(){return lu})),i.d(e,"Line",(function(){return Ah})),i.d(e,"Line3",(function(){return yd})),i.d(e,"LineBasicMaterial",(function(){return wh})),i.d(e,"LineCurve",(function(){return Gc})),i.d(e,"LineCurve3",(function(){return Vc})),i.d(e,"LineDashedMaterial",(function(){return Ql})),i.d(e,"LineLoop",(function(){return Lh})),i.d(e,"LinePieces",(function(){return Mp})),i.d(e,"LineSegments",(function(){return Rh})),i.d(e,"LineStrip",(function(){return Sp})),i.d(e,"LinearEncoding",(function(){return Ke})),i.d(e,"LinearFilter",(function(){return xt})),i.d(e,"LinearInterpolant",(function(){return nc})),i.d(e,"LinearMipMapLinearFilter",(function(){return _t})),i.d(e,"LinearMipMapNearestFilter",(function(){return wt})),i.d(e,"LinearMipmapLinearFilter",(function(){return Tt})),i.d(e,"LinearMipmapNearestFilter",(function(){return bt})),i.d(e,"LinearToneMapping",(function(){return $})),i.d(e,"Loader",(function(){return yc})),i.d(e,"LoaderUtils",(function(){return uu})),i.d(e,"LoadingManager",(function(){return gc})),i.d(e,"LogLuvEncoding",(function(){return ti})),i.d(e,"LoopOnce",(function(){return Be})),i.d(e,"LoopPingPong",(function(){return Ne})),i.d(e,"LoopRepeat",(function(){return ke})),i.d(e,"LuminanceAlphaFormat",(function(){return zt})),i.d(e,"LuminanceFormat",(function(){return Ut})),i.d(e,"MOUSE",(function(){return r})),i.d(e,"Material",(function(){return wr})),i.d(e,"MaterialLoader",(function(){return cu})),i.d(e,"Math",(function(){return Ni})),i.d(e,"MathUtils",(function(){return Ni})),i.d(e,"Matrix3",(function(){return zi})),i.d(e,"Matrix4",(function(){return Sn})),i.d(e,"MaxEquation",(function(){return P})),i.d(e,"Mesh",(function(){return cs})),i.d(e,"MeshBasicMaterial",(function(){return Tr})),i.d(e,"MeshDepthMaterial",(function(){return Ta})),i.d(e,"MeshDistanceMaterial",(function(){return _a})),i.d(e,"MeshFaceMaterial",(function(){return Rp})),i.d(e,"MeshLambertMaterial",(function(){return Kl})),i.d(e,"MeshMatcapMaterial",(function(){return Jl})),i.d(e,"MeshNormalMaterial",(function(){return Zl})),i.d(e,"MeshPhongMaterial",(function(){return Yl})),i.d(e,"MeshPhysicalMaterial",(function(){return jl})),i.d(e,"MeshStandardMaterial",(function(){return Xl})),i.d(e,"MeshToonMaterial",(function(){return ql})),i.d(e,"MinEquation",(function(){return C})),i.d(e,"MirroredRepeatWrapping",(function(){return pt})),i.d(e,"MixOperation",(function(){return K})),i.d(e,"MultiMaterial",(function(){return Lp})),i.d(e,"MultiplyBlending",(function(){return _})),i.d(e,"MultiplyOperation",(function(){return Z})),i.d(e,"NearestFilter",(function(){return ft})),i.d(e,"NearestMipMapLinearFilter",(function(){return yt})),i.d(e,"NearestMipMapNearestFilter",(function(){return gt})),i.d(e,"NearestMipmapLinearFilter",(function(){return vt})),i.d(e,"NearestMipmapNearestFilter",(function(){return mt})),i.d(e,"NeverDepth",(function(){return G})),i.d(e,"NeverStencilFunc",(function(){return gi})),i.d(e,"NoBlending",(function(){return x})),i.d(e,"NoColors",(function(){return Ap})),i.d(e,"NoToneMapping",(function(){return Q})),i.d(e,"NormalAnimationBlendMode",(function(){return Xe})),i.d(e,"NormalBlending",(function(){return b})),i.d(e,"NotEqualDepth",(function(){return q})),i.d(e,"NotEqualStencilFunc",(function(){return wi})),i.d(e,"NumberKeyframeTrack",(function(){return hc})),i.d(e,"Object3D",(function(){return Kn})),i.d(e,"ObjectLoader",(function(){return mu})),i.d(e,"ObjectSpaceNormalMap",(function(){return ai})),i.d(e,"OctahedronBufferGeometry",(function(){return Ll})),i.d(e,"OctahedronGeometry",(function(){return Ll})),i.d(e,"OneFactor",(function(){return L})),i.d(e,"OneMinusDstAlphaFactor",(function(){return k})),i.d(e,"OneMinusDstColorFactor",(function(){return U})),i.d(e,"OneMinusSrcAlphaFactor",(function(){return F})),i.d(e,"OneMinusSrcColorFactor",(function(){return D})),i.d(e,"OrthographicCamera",(function(){return nu})),i.d(e,"PCFShadowMap",(function(){return u})),i.d(e,"PCFSoftShadowMap",(function(){return d})),i.d(e,"PMREMGenerator",(function(){return mp})),i.d(e,"ParametricBufferGeometry",(function(){return Ol})),i.d(e,"ParametricGeometry",(function(){return Ol})),i.d(e,"Particle",(function(){return Dp})),i.d(e,"ParticleBasicMaterial",(function(){return Bp})),i.d(e,"ParticleSystem",(function(){return Ip})),i.d(e,"ParticleSystemMaterial",(function(){return kp})),i.d(e,"Path",(function(){return qc})),i.d(e,"PerspectiveCamera",(function(){return ys})),i.d(e,"Plane",(function(){return tr})),i.d(e,"PlaneBufferGeometry",(function(){return Cs})),i.d(e,"PlaneGeometry",(function(){return Cs})),i.d(e,"PlaneHelper",(function(){return Wd})),i.d(e,"PointCloud",(function(){return Op})),i.d(e,"PointCloudMaterial",(function(){return Fp})),i.d(e,"PointLight",(function(){return iu})),i.d(e,"PointLightHelper",(function(){return Md})),i.d(e,"Points",(function(){return kh})),i.d(e,"PointsMaterial",(function(){return Oh})),i.d(e,"PolarGridHelper",(function(){return Od})),i.d(e,"PolyhedronBufferGeometry",(function(){return jh})),i.d(e,"PolyhedronGeometry",(function(){return jh})),i.d(e,"PositionalAudio",(function(){return Wu})),i.d(e,"PropertyBinding",(function(){return id})),i.d(e,"PropertyMixer",(function(){return ju})),i.d(e,"QuadraticBezierCurve",(function(){return Hc})),i.d(e,"QuadraticBezierCurve3",(function(){return Wc})),i.d(e,"Quaternion",(function(){return Zi})),i.d(e,"QuaternionKeyframeTrack",(function(){return cc})),i.d(e,"QuaternionLinearInterpolant",(function(){return lc})),i.d(e,"REVISION",(function(){return n})),i.d(e,"RGBADepthPacking",(function(){return si})),i.d(e,"RGBAFormat",(function(){return Nt})),i.d(e,"RGBAIntegerFormat",(function(){return Zt})),i.d(e,"RGBA_ASTC_10x10_Format",(function(){return ye})),i.d(e,"RGBA_ASTC_10x5_Format",(function(){return me})),i.d(e,"RGBA_ASTC_10x6_Format",(function(){return ge})),i.d(e,"RGBA_ASTC_10x8_Format",(function(){return ve})),i.d(e,"RGBA_ASTC_12x10_Format",(function(){return xe})),i.d(e,"RGBA_ASTC_12x12_Format",(function(){return be})),i.d(e,"RGBA_ASTC_4x4_Format",(function(){return ae})),i.d(e,"RGBA_ASTC_5x4_Format",(function(){return he})),i.d(e,"RGBA_ASTC_5x5_Format",(function(){return le})),i.d(e,"RGBA_ASTC_6x5_Format",(function(){return ce})),i.d(e,"RGBA_ASTC_6x6_Format",(function(){return ue})),i.d(e,"RGBA_ASTC_8x5_Format",(function(){return de})),i.d(e,"RGBA_ASTC_8x6_Format",(function(){return pe})),i.d(e,"RGBA_ASTC_8x8_Format",(function(){return fe})),i.d(e,"RGBA_BPTC_Format",(function(){return we})),i.d(e,"RGBA_ETC2_EAC_Format",(function(){return oe})),i.d(e,"RGBA_PVRTC_2BPPV1_Format",(function(){return ne})),i.d(e,"RGBA_PVRTC_4BPPV1_Format",(function(){return ie})),i.d(e,"RGBA_S3TC_DXT1_Format",(function(){return Jt})),i.d(e,"RGBA_S3TC_DXT3_Format",(function(){return Qt})),i.d(e,"RGBA_S3TC_DXT5_Format",(function(){return $t})),i.d(e,"RGBDEncoding",(function(){return ni})),i.d(e,"RGBEEncoding",(function(){return $e})),i.d(e,"RGBEFormat",(function(){return Gt})),i.d(e,"RGBFormat",(function(){return kt})),i.d(e,"RGBIntegerFormat",(function(){return qt})),i.d(e,"RGBM16Encoding",(function(){return ii})),i.d(e,"RGBM7Encoding",(function(){return ei})),i.d(e,"RGB_ETC1_Format",(function(){return re})),i.d(e,"RGB_ETC2_Format",(function(){return se})),i.d(e,"RGB_PVRTC_2BPPV1_Format",(function(){return ee})),i.d(e,"RGB_PVRTC_4BPPV1_Format",(function(){return te})),i.d(e,"RGB_S3TC_DXT1_Format",(function(){return Kt})),i.d(e,"RGFormat",(function(){return jt})),i.d(e,"RGIntegerFormat",(function(){return Yt})),i.d(e,"RawShaderMaterial",(function(){return Wl})),i.d(e,"Ray",(function(){return En})),i.d(e,"Raycaster",(function(){return ld})),i.d(e,"RectAreaLight",(function(){return au})),i.d(e,"RedFormat",(function(){return Wt})),i.d(e,"RedIntegerFormat",(function(){return Xt})),i.d(e,"ReinhardToneMapping",(function(){return tt})),i.d(e,"RepeatWrapping",(function(){return ut})),i.d(e,"ReplaceStencilOp",(function(){return ci})),i.d(e,"ReverseSubtractEquation",(function(){return A})),i.d(e,"RingBufferGeometry",(function(){return Dl})),i.d(e,"RingGeometry",(function(){return Dl})),i.d(e,"SRGB8_ALPHA8_ASTC_10x10_Format",(function(){return De})),i.d(e,"SRGB8_ALPHA8_ASTC_10x5_Format",(function(){return Re})),i.d(e,"SRGB8_ALPHA8_ASTC_10x6_Format",(function(){return Le})),i.d(e,"SRGB8_ALPHA8_ASTC_10x8_Format",(function(){return Oe})),i.d(e,"SRGB8_ALPHA8_ASTC_12x10_Format",(function(){return Ie})),i.d(e,"SRGB8_ALPHA8_ASTC_12x12_Format",(function(){return Fe})),i.d(e,"SRGB8_ALPHA8_ASTC_4x4_Format",(function(){return Te})),i.d(e,"SRGB8_ALPHA8_ASTC_5x4_Format",(function(){return _e})),i.d(e,"SRGB8_ALPHA8_ASTC_5x5_Format",(function(){return Ee})),i.d(e,"SRGB8_ALPHA8_ASTC_6x5_Format",(function(){return Se})),i.d(e,"SRGB8_ALPHA8_ASTC_6x6_Format",(function(){return Me})),i.d(e,"SRGB8_ALPHA8_ASTC_8x5_Format",(function(){return Ae})),i.d(e,"SRGB8_ALPHA8_ASTC_8x6_Format",(function(){return Ce})),i.d(e,"SRGB8_ALPHA8_ASTC_8x8_Format",(function(){return Pe})),i.d(e,"Scene",(function(){return ka})),i.d(e,"SceneUtils",(function(){return lf})),i.d(e,"ShaderChunk",(function(){return Ps})),i.d(e,"ShaderLib",(function(){return Ls})),i.d(e,"ShaderMaterial",(function(){return gs})),i.d(e,"ShadowMaterial",(function(){return Hl})),i.d(e,"Shape",(function(){return Zc})),i.d(e,"ShapeBufferGeometry",(function(){return Il})),i.d(e,"ShapeGeometry",(function(){return Il})),i.d(e,"ShapePath",(function(){return bu})),i.d(e,"ShapeUtils",(function(){return El})),i.d(e,"ShortType",(function(){return Mt})),i.d(e,"Skeleton",(function(){return mh})),i.d(e,"SkeletonHelper",(function(){return Sd})),i.d(e,"SkinnedMesh",(function(){return uh})),i.d(e,"SmoothShading",(function(){return y})),i.d(e,"Sphere",(function(){return gn})),i.d(e,"SphereBufferGeometry",(function(){return Fl})),i.d(e,"SphereGeometry",(function(){return Fl})),i.d(e,"Spherical",(function(){return dd})),i.d(e,"SphericalHarmonics3",(function(){return hu})),i.d(e,"Spline",(function(){return Jp})),i.d(e,"SplineCurve",(function(){return Xc})),i.d(e,"SplineCurve3",(function(){return Kp})),i.d(e,"SpotLight",(function(){return tu})),i.d(e,"SpotLightHelper",(function(){return wd})),i.d(e,"Sprite",(function(){return eh})),i.d(e,"SpriteMaterial",(function(){return Ga})),i.d(e,"SrcAlphaFactor",(function(){return I})),i.d(e,"SrcAlphaSaturateFactor",(function(){return z})),i.d(e,"SrcColorFactor",(function(){return O})),i.d(e,"StaticCopyUsage",(function(){return Ri})),i.d(e,"StaticDrawUsage",(function(){return Ei})),i.d(e,"StaticReadUsage",(function(){return Ai})),i.d(e,"StereoCamera",(function(){return Lu})),i.d(e,"StreamCopyUsage",(function(){return Oi})),i.d(e,"StreamDrawUsage",(function(){return Mi})),i.d(e,"StreamReadUsage",(function(){return Pi})),i.d(e,"StringKeyframeTrack",(function(){return uc})),i.d(e,"SubtractEquation",(function(){return M})),i.d(e,"SubtractiveBlending",(function(){return T})),i.d(e,"TOUCH",(function(){return s})),i.d(e,"TangentSpaceNormalMap",(function(){return oi})),i.d(e,"TetrahedronBufferGeometry",(function(){return Bl})),i.d(e,"TetrahedronGeometry",(function(){return Bl})),i.d(e,"TextBufferGeometry",(function(){return kl})),i.d(e,"TextGeometry",(function(){return kl})),i.d(e,"Texture",(function(){return Wi})),i.d(e,"TextureLoader",(function(){return Mc})),i.d(e,"TorusBufferGeometry",(function(){return Nl})),i.d(e,"TorusGeometry",(function(){return Nl})),i.d(e,"TorusKnotBufferGeometry",(function(){return Ul})),i.d(e,"TorusKnotGeometry",(function(){return Ul})),i.d(e,"Triangle",(function(){return ur})),i.d(e,"TriangleFanDrawMode",(function(){return Ze})),i.d(e,"TriangleStripDrawMode",(function(){return qe})),i.d(e,"TrianglesDrawMode",(function(){return Ye})),i.d(e,"TubeBufferGeometry",(function(){return zl})),i.d(e,"TubeGeometry",(function(){return zl})),i.d(e,"UVMapping",(function(){return rt})),i.d(e,"Uint16Attribute",(function(){return Wp})),i.d(e,"Uint16BufferAttribute",(function(){return Rr})),i.d(e,"Uint32Attribute",(function(){return jp})),i.d(e,"Uint32BufferAttribute",(function(){return Or})),i.d(e,"Uint8Attribute",(function(){return Gp})),i.d(e,"Uint8BufferAttribute",(function(){return Ar})),i.d(e,"Uint8ClampedAttribute",(function(){return Vp})),i.d(e,"Uint8ClampedBufferAttribute",(function(){return Cr})),i.d(e,"Uniform",(function(){return od})),i.d(e,"UniformsLib",(function(){return Rs})),i.d(e,"UniformsUtils",(function(){return ms})),i.d(e,"UnsignedByteType",(function(){return Et})),i.d(e,"UnsignedInt248Type",(function(){return Ft})),i.d(e,"UnsignedIntType",(function(){return Pt})),i.d(e,"UnsignedShort4444Type",(function(){return Ot})),i.d(e,"UnsignedShort5551Type",(function(){return Dt})),i.d(e,"UnsignedShort565Type",(function(){return It})),i.d(e,"UnsignedShortType",(function(){return At})),i.d(e,"VSMShadowMap",(function(){return p})),i.d(e,"Vector2",(function(){return Ui})),i.d(e,"Vector3",(function(){return Ki})),i.d(e,"Vector4",(function(){return ji})),i.d(e,"VectorKeyframeTrack",(function(){return dc})),i.d(e,"Vertex",(function(){return Np})),i.d(e,"VertexColors",(function(){return Pp})),i.d(e,"VideoTexture",(function(){return Uh})),i.d(e,"WebGL1Renderer",(function(){return Ia})),i.d(e,"WebGLCubeRenderTarget",(function(){return ws})),i.d(e,"WebGLMultisampleRenderTarget",(function(){return qi})),i.d(e,"WebGLRenderTarget",(function(){return Yi})),i.d(e,"WebGLRenderTargetCube",(function(){return sf})),i.d(e,"WebGLRenderer",(function(){return Da})),i.d(e,"WebGLUtils",(function(){return Aa})),i.d(e,"WireframeGeometry",(function(){return Gl})),i.d(e,"WireframeHelper",(function(){return ef})),i.d(e,"WrapAroundEnding",(function(){return We})),i.d(e,"XHRLoader",(function(){return nf})),i.d(e,"ZeroCurvatureEnding",(function(){return Ve})),i.d(e,"ZeroFactor",(function(){return R})),i.d(e,"ZeroSlopeEnding",(function(){return He})),i.d(e,"ZeroStencilOp",(function(){return hi})),i.d(e,"sRGBEncoding",(function(){return Je}));const n="125",r={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},s={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},o=0,a=1,h=2,l=3,c=0,u=1,d=2,p=3,f=0,m=1,g=2,v=1,y=2,x=0,b=1,w=2,T=3,_=4,E=5,S=100,M=101,A=102,C=103,P=104,R=200,L=201,O=202,D=203,I=204,F=205,B=206,k=207,N=208,U=209,z=210,G=0,V=1,H=2,W=3,X=4,j=5,Y=6,q=7,Z=0,K=1,J=2,Q=0,$=1,tt=2,et=3,it=4,nt=5,rt=300,st=301,ot=302,at=303,ht=304,lt=306,ct=307,ut=1e3,dt=1001,pt=1002,ft=1003,mt=1004,gt=1004,vt=1005,yt=1005,xt=1006,bt=1007,wt=1007,Tt=1008,_t=1008,Et=1009,St=1010,Mt=1011,At=1012,Ct=1013,Pt=1014,Rt=1015,Lt=1016,Ot=1017,Dt=1018,It=1019,Ft=1020,Bt=1021,kt=1022,Nt=1023,Ut=1024,zt=1025,Gt=Nt,Vt=1026,Ht=1027,Wt=1028,Xt=1029,jt=1030,Yt=1031,qt=1032,Zt=1033,Kt=33776,Jt=33777,Qt=33778,$t=33779,te=35840,ee=35841,ie=35842,ne=35843,re=36196,se=37492,oe=37496,ae=37808,he=37809,le=37810,ce=37811,ue=37812,de=37813,pe=37814,fe=37815,me=37816,ge=37817,ve=37818,ye=37819,xe=37820,be=37821,we=36492,Te=37840,_e=37841,Ee=37842,Se=37843,Me=37844,Ae=37845,Ce=37846,Pe=37847,Re=37848,Le=37849,Oe=37850,De=37851,Ie=37852,Fe=37853,Be=2200,ke=2201,Ne=2202,Ue=2300,ze=2301,Ge=2302,Ve=2400,He=2401,We=2402,Xe=2500,je=2501,Ye=0,qe=1,Ze=2,Ke=3e3,Je=3001,Qe=3007,$e=3002,ti=3003,ei=3004,ii=3005,ni=3006,ri=3200,si=3201,oi=0,ai=1,hi=0,li=7680,ci=7681,ui=7682,di=7683,pi=34055,fi=34056,mi=5386,gi=512,vi=513,yi=514,xi=515,bi=516,wi=517,Ti=518,_i=519,Ei=35044,Si=35048,Mi=35040,Ai=35045,Ci=35049,Pi=35041,Ri=35046,Li=35050,Oi=35042,Di="100",Ii="300 es";function Fi(){}Object.assign(Fi.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});const i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;const i=this._listeners;return void 0!==i[t]&&-1!==i[t].indexOf(e)},removeEventListener:function(t,e){if(void 0===this._listeners)return;const i=this._listeners[t];if(void 0!==i){const t=i.indexOf(e);-1!==t&&i.splice(t,1)}},dispatchEvent:function(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const i=e.slice(0);for(let e=0,n=i.length;e>8&255]+Bi[t>>16&255]+Bi[t>>24&255]+"-"+Bi[255&e]+Bi[e>>8&255]+"-"+Bi[e>>16&15|64]+Bi[e>>24&255]+"-"+Bi[63&i|128]+Bi[i>>8&255]+"-"+Bi[i>>16&255]+Bi[i>>24&255]+Bi[255&n]+Bi[n>>8&255]+Bi[n>>16&255]+Bi[n>>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},damp:function(t,e,i,n){return Ni.lerp(t,e,1-Math.exp(-i*n))},pingpong:function(t,e=1){return e-Math.abs(Ni.euclideanModulo(t,2*e)-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())},seededRandom:function(t){return void 0!==t&&(ki=t%2147483647),ki=16807*ki%2147483647,(ki-1)/2147483646},degToRad:function(t){return t*Ni.DEG2RAD},radToDeg:function(t){return t*Ni.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,i,n,r){const s=Math.cos,o=Math.sin,a=s(i/2),h=o(i/2),l=s((e+n)/2),c=o((e+n)/2),u=s((e-n)/2),d=o((e-n)/2),p=s((n-e)/2),f=o((n-e)/2);switch(r){case"XYX":t.set(a*c,h*u,h*d,a*l);break;case"YZY":t.set(h*d,a*c,h*u,a*l);break;case"ZXZ":t.set(h*u,h*d,a*c,a*l);break;case"XZX":t.set(a*c,h*f,h*p,a*l);break;case"YXY":t.set(h*p,a*c,h*f,a*l);break;case"ZYZ":t.set(h*f,h*p,a*c,a*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}};class Ui{constructor(t=0,e=0){Object.defineProperty(this,"isVector2",{value:!0}),this.x=t,this.y=e}get width(){return this.x}set width(t){this.x=t}get height(){return this.y}set height(t){this.y=t}set(t,e){return this.x=t,this.y=e,this}setScalar(t){return this.x=t,this.y=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setComponent(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(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}}clone(){return new this.constructor(this.x,this.y)}copy(t){return this.x=t.x,this.y=t.y,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)}addScalar(t){return this.x+=t,this.y+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)}subScalar(t){return this.x-=t,this.y-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this}multiply(t){return this.x*=t.x,this.y*=t.y,this}multiplyScalar(t){return this.x*=t,this.y*=t,this}divide(t){return this.x/=t.x,this.y/=t.y,this}divideScalar(t){return this.multiplyScalar(1/t)}applyMatrix3(t){const 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(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this}max(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this}clamp(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(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){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(){return this.x=-this.x,this.y=-this.y,this}dot(t){return this.x*t.x+this.y*t.y}cross(t){return this.x*t.y-this.y*t.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y;return e*e+i*i}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this}lerpVectors(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this}equals(t){return t.x===this.x&&t.y===this.y}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t}fromBufferAttribute(t,e,i){return void 0!==i&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this}rotateAround(t,e){const i=Math.cos(e),n=Math.sin(e),r=this.x-t.x,s=this.y-t.y;return this.x=r*i-s*n+t.x,this.y=r*n+s*i+t.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}}class zi{constructor(){Object.defineProperty(this,"isMatrix3",{value:!0}),this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}set(t,e,i,n,r,s,o,a,h){const l=this.elements;return l[0]=t,l[1]=n,l[2]=o,l[3]=e,l[4]=r,l[5]=a,l[6]=i,l[7]=s,l[8]=h,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}clone(){return(new this.constructor).fromArray(this.elements)}copy(t){const 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}extractBasis(t,e,i){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(t){const 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}multiply(t){return this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,r=this.elements,s=i[0],o=i[3],a=i[6],h=i[1],l=i[4],c=i[7],u=i[2],d=i[5],p=i[8],f=n[0],m=n[3],g=n[6],v=n[1],y=n[4],x=n[7],b=n[2],w=n[5],T=n[8];return r[0]=s*f+o*v+a*b,r[3]=s*m+o*y+a*w,r[6]=s*g+o*x+a*T,r[1]=h*f+l*v+c*b,r[4]=h*m+l*y+c*w,r[7]=h*g+l*x+c*T,r[2]=u*f+d*v+p*b,r[5]=u*m+d*y+p*w,r[8]=u*g+d*x+p*T,this}multiplyScalar(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this}determinant(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*s*l-e*o*h-i*r*l+i*o*a+n*r*h-n*s*a}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],c=l*s-o*h,u=o*a-l*r,d=h*r-s*a,p=e*c+i*u+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return t[0]=c*f,t[1]=(n*h-l*i)*f,t[2]=(o*i-n*s)*f,t[3]=u*f,t[4]=(l*e-n*a)*f,t[5]=(n*r-o*e)*f,t[6]=d*f,t[7]=(i*a-h*e)*f,t[8]=(s*e-i*r)*f,this}transpose(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this}getNormalMatrix(t){return this.setFromMatrix4(t).copy(this).invert().transpose()}transposeIntoArray(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this}setUvTransform(t,e,i,n,r,s,o){const a=Math.cos(r),h=Math.sin(r);return this.set(i*a,i*h,-i*(a*s+h*o)+s+t,-n*h,n*a,-n*(-h*s+a*o)+o+e,0,0,1),this}scale(t,e){const i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=e,i[4]*=e,i[7]*=e,this}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.elements,r=n[0],s=n[3],o=n[6],a=n[1],h=n[4],l=n[7];return n[0]=e*r+i*a,n[3]=e*s+i*h,n[6]=e*o+i*l,n[1]=-i*r+e*a,n[4]=-i*s+e*h,n[7]=-i*o+e*l,this}translate(t,e){const i=this.elements;return i[0]+=t*i[2],i[3]+=t*i[5],i[6]+=t*i[8],i[1]+=e*i[2],i[4]+=e*i[5],i[7]+=e*i[8],this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<9;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<9;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}}let Gi;const Vi={getDataURL:function(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===Gi&&(Gi=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Gi.width=t.width,Gi.height=t.height;const i=Gi.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=Gi}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}};let Hi=0;function Wi(t=Wi.DEFAULT_IMAGE,e=Wi.DEFAULT_MAPPING,i=dt,n=dt,r=xt,s=Tt,o=Nt,a=Et,h=1,l=Ke){Object.defineProperty(this,"id",{value:Hi++}),this.uuid=Ni.generateUUID(),this.name="",this.image=t,this.mipmaps=[],this.mapping=e,this.wrapS=i,this.wrapT=n,this.magFilter=r,this.minFilter=s,this.anisotropy=h,this.format=o,this.internalFormat=null,this.type=a,this.offset=new Ui(0,0),this.repeat=new Ui(1,1),this.center=new Ui(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new zi,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=l,this.version=0,this.onUpdate=null}function Xi(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?Vi.getDataURL(t):t.data?{data:Array.prototype.slice.call(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}Wi.DEFAULT_IMAGE=void 0,Wi.DEFAULT_MAPPING=rt,Wi.prototype=Object.assign(Object.create(Fi.prototype),{constructor:Wi,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const 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){const n=this.image;if(void 0===n.uuid&&(n.uuid=Ni.generateUUID()),!e&&void 0===t.images[n.uuid]){let e;if(Array.isArray(n)){e=[];for(let t=0,i=n.length;t1)switch(this.wrapS){case ut:t.x=t.x-Math.floor(t.x);break;case dt: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 ut:t.y=t.y-Math.floor(t.y);break;case dt: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(Wi.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}});class ji{constructor(t=0,e=0,i=0,n=1){Object.defineProperty(this,"isVector4",{value:!0}),this.x=t,this.y=e,this.z=i,this.w=n}get width(){return this.z}set width(t){this.z=t}get height(){return this.w}set height(t){this.w=t}set(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this.w=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setW(t){return this.w=t,this}setComponent(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(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(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(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(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this}addVectors(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(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(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this}subVectors(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}multiply(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this}applyMatrix4(t){const e=this.x,i=this.y,n=this.z,r=this.w,s=t.elements;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12]*r,this.y=s[1]*e+s[5]*i+s[9]*n+s[13]*r,this.z=s[2]*e+s[6]*i+s[10]*n+s[14]*r,this.w=s[3]*e+s[7]*i+s[11]*n+s[15]*r,this}divideScalar(t){return this.multiplyScalar(1/t)}setAxisAngleFromQuaternion(t){this.w=2*Math.acos(t.w);const 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(t){let e,i,n,r;const s=t.elements,o=s[0],a=s[4],h=s[8],l=s[1],c=s[5],u=s[9],d=s[2],p=s[6],f=s[10];if(Math.abs(a-l)<.01&&Math.abs(h-d)<.01&&Math.abs(u-p)<.01){if(Math.abs(a+l)<.1&&Math.abs(h+d)<.1&&Math.abs(u+p)<.1&&Math.abs(o+c+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const t=(o+1)/2,s=(c+1)/2,m=(f+1)/2,g=(a+l)/4,v=(h+d)/4,y=(u+p)/4;return t>s&&t>m?t<.01?(i=0,n=.707106781,r=.707106781):(i=Math.sqrt(t),n=g/i,r=v/i):s>m?s<.01?(i=.707106781,n=0,r=.707106781):(n=Math.sqrt(s),i=g/n,r=y/n):m<.01?(i=.707106781,n=.707106781,r=0):(r=Math.sqrt(m),i=v/r,n=y/r),this.set(i,n,r,e),this}let m=Math.sqrt((p-u)*(p-u)+(h-d)*(h-d)+(l-a)*(l-a));return Math.abs(m)<.001&&(m=1),this.x=(p-u)/m,this.y=(h-d)/m,this.z=(l-a)/m,this.w=Math.acos((o+c+f-1)/2),this}min(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(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(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(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){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(){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(){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(){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(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(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(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this.w=t.w+(e.w-t.w)*i,this}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t}fromBufferAttribute(t,e,i){return void 0!==i&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}class Yi extends Fi{constructor(t,e,i){super(),Object.defineProperty(this,"isWebGLRenderTarget",{value:!0}),this.width=t,this.height=e,this.scissor=new ji(0,0,t,e),this.scissorTest=!1,this.viewport=new ji(0,0,t,e),i=i||{},this.texture=new Wi(void 0,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:xt,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}setSize(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)}clone(){return(new this.constructor).copy(this)}copy(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(){this.dispatchEvent({type:"dispose"})}}class qi extends Yi{constructor(t,e,i){super(t,e,i),Object.defineProperty(this,"isWebGLMultisampleRenderTarget",{value:!0}),this.samples=4}copy(t){return super.copy.call(this,t),this.samples=t.samples,this}}class Zi{constructor(t=0,e=0,i=0,n=1){Object.defineProperty(this,"isQuaternion",{value:!0}),this._x=t,this._y=e,this._z=i,this._w=n}static slerp(t,e,i,n){return i.copy(t).slerp(e,n)}static slerpFlat(t,e,i,n,r,s,o){let a=i[n+0],h=i[n+1],l=i[n+2],c=i[n+3];const u=r[s+0],d=r[s+1],p=r[s+2],f=r[s+3];if(c!==f||a!==u||h!==d||l!==p){let t=1-o;const e=a*u+h*d+l*p+c*f,i=e>=0?1:-1,n=1-e*e;if(n>Number.EPSILON){const r=Math.sqrt(n),s=Math.atan2(r,e*i);t=Math.sin(t*s)/r,o=Math.sin(o*s)/r}const r=o*i;if(a=a*t+u*r,h=h*t+d*r,l=l*t+p*r,c=c*t+f*r,t===1-o){const t=1/Math.sqrt(a*a+h*h+l*l+c*c);a*=t,h*=t,l*=t,c*=t}}t[e]=a,t[e+1]=h,t[e+2]=l,t[e+3]=c}static multiplyQuaternionsFlat(t,e,i,n,r,s){const o=i[n],a=i[n+1],h=i[n+2],l=i[n+3],c=r[s],u=r[s+1],d=r[s+2],p=r[s+3];return t[e]=o*p+l*c+a*d-h*u,t[e+1]=a*p+l*u+h*c-o*d,t[e+2]=h*p+l*d+o*u-a*c,t[e+3]=l*p-o*c-a*u-h*d,t}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get w(){return this._w}set w(t){this._w=t,this._onChangeCallback()}set(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this}setFromEuler(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const i=t._x,n=t._y,r=t._z,s=t._order,o=Math.cos,a=Math.sin,h=o(i/2),l=o(n/2),c=o(r/2),u=a(i/2),d=a(n/2),p=a(r/2);switch(s){case"XYZ":this._x=u*l*c+h*d*p,this._y=h*d*c-u*l*p,this._z=h*l*p+u*d*c,this._w=h*l*c-u*d*p;break;case"YXZ":this._x=u*l*c+h*d*p,this._y=h*d*c-u*l*p,this._z=h*l*p-u*d*c,this._w=h*l*c+u*d*p;break;case"ZXY":this._x=u*l*c-h*d*p,this._y=h*d*c+u*l*p,this._z=h*l*p+u*d*c,this._w=h*l*c-u*d*p;break;case"ZYX":this._x=u*l*c-h*d*p,this._y=h*d*c+u*l*p,this._z=h*l*p-u*d*c,this._w=h*l*c+u*d*p;break;case"YZX":this._x=u*l*c+h*d*p,this._y=h*d*c+u*l*p,this._z=h*l*p-u*d*c,this._w=h*l*c-u*d*p;break;case"XZY":this._x=u*l*c-h*d*p,this._y=h*d*c-u*l*p,this._z=h*l*p+u*d*c,this._w=h*l*c+u*d*p;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+s)}return!1!==e&&this._onChangeCallback(),this}setFromAxisAngle(t,e){const 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(t){const e=t.elements,i=e[0],n=e[4],r=e[8],s=e[1],o=e[5],a=e[9],h=e[2],l=e[6],c=e[10],u=i+o+c;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(l-a)*t,this._y=(r-h)*t,this._z=(s-n)*t}else if(i>o&&i>c){const t=2*Math.sqrt(1+i-o-c);this._w=(l-a)/t,this._x=.25*t,this._y=(n+s)/t,this._z=(r+h)/t}else if(o>c){const t=2*Math.sqrt(1+o-i-c);this._w=(r-h)/t,this._x=(n+s)/t,this._y=.25*t,this._z=(a+l)/t}else{const t=2*Math.sqrt(1+c-i-o);this._w=(s-n)/t,this._x=(r+h)/t,this._y=(a+l)/t,this._z=.25*t}return this._onChangeCallback(),this}setFromUnitVectors(t,e){let i=t.dot(e)+1;return i<1e-6?(i=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=i):(this._x=0,this._y=-t.z,this._z=t.y,this._w=i)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=i),this.normalize()}angleTo(t){return 2*Math.acos(Math.abs(Ni.clamp(this.dot(t),-1,1)))}rotateTowards(t,e){const i=this.angleTo(t);if(0===i)return this;const n=Math.min(1,e/i);return this.slerp(t,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let 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(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)}premultiply(t){return this.multiplyQuaternions(t,this)}multiplyQuaternions(t,e){const i=t._x,n=t._y,r=t._z,s=t._w,o=e._x,a=e._y,h=e._z,l=e._w;return this._x=i*l+s*o+n*h-r*a,this._y=n*l+s*a+r*o-i*h,this._z=r*l+s*h+i*a-n*o,this._w=s*l-i*o-n*a-r*h,this._onChangeCallback(),this}slerp(t,e){if(0===e)return this;if(1===e)return this.copy(t);const i=this._x,n=this._y,r=this._z,s=this._w;let o=s*t._w+i*t._x+n*t._y+r*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),o>=1)return this._w=s,this._x=i,this._y=n,this._z=r,this;const a=1-o*o;if(a<=Number.EPSILON){const t=1-e;return this._w=t*s+e*this._w,this._x=t*i+e*this._x,this._y=t*n+e*this._y,this._z=t*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const h=Math.sqrt(a),l=Math.atan2(h,o),c=Math.sin((1-e)*l)/h,u=Math.sin(e*l)/h;return this._w=s*c+this._w*u,this._x=i*c+this._x*u,this._y=n*c+this._y*u,this._z=r*c+this._z*u,this._onChangeCallback(),this}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w}fromArray(t,e=0){return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t}fromBufferAttribute(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}class Ki{constructor(t=0,e=0,i=0){Object.defineProperty(this,"isVector3",{value:!0}),this.x=t,this.y=e,this.z=i}set(t,e,i){return void 0===i&&(i=this.z),this.x=t,this.y=e,this.z=i,this}setScalar(t){return this.x=t,this.y=t,this.z=t,this}setX(t){return this.x=t,this}setY(t){return this.y=t,this}setZ(t){return this.z=t,this}setComponent(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(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(){return new this.constructor(this.x,this.y,this.z)}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}add(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)}addScalar(t){return this.x+=t,this.y+=t,this.z+=t,this}addVectors(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this}addScaledVector(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this}sub(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)}subScalar(t){return this.x-=t,this.y-=t,this.z-=t,this}subVectors(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this}multiply(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)}multiplyScalar(t){return this.x*=t,this.y*=t,this.z*=t,this}multiplyVectors(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this}applyEuler(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(Qi.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(Qi.setFromAxisAngle(t,e))}applyMatrix3(t){const 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}applyNormalMatrix(t){return this.applyMatrix3(t).normalize()}applyMatrix4(t){const e=this.x,i=this.y,n=this.z,r=t.elements,s=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])*s,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*s,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*s,this}applyQuaternion(t){const e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,o=t.z,a=t.w,h=a*e+s*n-o*i,l=a*i+o*e-r*n,c=a*n+r*i-s*e,u=-r*e-s*i-o*n;return this.x=h*a+u*-r+l*-o-c*-s,this.y=l*a+u*-s+c*-r-h*-o,this.z=c*a+u*-o+h*-s-l*-r,this}project(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)}unproject(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)}transformDirection(t){const 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(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this}divideScalar(t){return this.multiplyScalar(1/t)}min(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(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(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(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this}clampLength(t,e){const i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){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(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(t){return this.normalize().multiplyScalar(t)}lerp(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(t,e,i){return this.x=t.x+(e.x-t.x)*i,this.y=t.y+(e.y-t.y)*i,this.z=t.z+(e.z-t.z)*i,this}cross(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)}crossVectors(t,e){const i=t.x,n=t.y,r=t.z,s=e.x,o=e.y,a=e.z;return this.x=n*a-r*o,this.y=r*s-i*a,this.z=i*o-n*s,this}projectOnVector(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const i=t.dot(this)/e;return this.copy(t).multiplyScalar(i)}projectOnPlane(t){return Ji.copy(this).projectOnVector(t),this.sub(Ji)}reflect(t){return this.sub(Ji.copy(t).multiplyScalar(2*this.dot(t)))}angleTo(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const i=this.dot(t)/e;return Math.acos(Ni.clamp(i,-1,1))}distanceTo(t){return Math.sqrt(this.distanceToSquared(t))}distanceToSquared(t){const e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n}manhattanDistanceTo(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)}setFromSpherical(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)}setFromSphericalCoords(t,e,i){const 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(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)}setFromCylindricalCoords(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this}setFromMatrixPosition(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this}setFromMatrixScale(t){const 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(t,e){return this.fromArray(t.elements,4*e)}setFromMatrix3Column(t,e){return this.fromArray(t.elements,3*e)}equals(t){return t.x===this.x&&t.y===this.y&&t.z===this.z}fromArray(t,e=0){return this.x=t[e],this.y=t[e+1],this.z=t[e+2],this}toArray(t=[],e=0){return t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t}fromBufferAttribute(t,e,i){return void 0!==i&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}}const Ji=new Ki,Qi=new Zi;class $i{constructor(t,e){Object.defineProperty(this,"isBox3",{value:!0}),this.min=void 0!==t?t:new Ki(1/0,1/0,1/0),this.max=void 0!==e?e:new Ki(-1/0,-1/0,-1/0)}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromArray(t){let e=1/0,i=1/0,n=1/0,r=-1/0,s=-1/0,o=-1/0;for(let a=0,h=t.length;ar&&(r=h),l>s&&(s=l),c>o&&(o=c)}return this.min.set(e,i,n),this.max.set(r,s,o),this}setFromBufferAttribute(t){let e=1/0,i=1/0,n=1/0,r=-1/0,s=-1/0,o=-1/0;for(let a=0,h=t.count;ar&&(r=h),l>s&&(s=l),c>o&&(o=c)}return this.min.set(e,i,n),this.max.set(r,s,o),this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;ethis.max.x||t.ythis.max.y||t.zthis.max.z)}containsBox(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(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new Ki),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(t){return!(t.max.xthis.max.x||t.max.ythis.max.y||t.max.zthis.max.z)}intersectsSphere(t){return this.clampPoint(t.center,nn),nn.distanceToSquared(t.center)<=t.radius*t.radius}intersectsPlane(t){let 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(t){if(this.isEmpty())return!1;this.getCenter(un),dn.subVectors(this.max,un),sn.subVectors(t.a,un),on.subVectors(t.b,un),an.subVectors(t.c,un),hn.subVectors(on,sn),ln.subVectors(an,on),cn.subVectors(sn,an);let e=[0,-hn.z,hn.y,0,-ln.z,ln.y,0,-cn.z,cn.y,hn.z,0,-hn.x,ln.z,0,-ln.x,cn.z,0,-cn.x,-hn.y,hn.x,0,-ln.y,ln.x,0,-cn.y,cn.x,0];return!!tn(e,sn,on,an,dn)&&(e=[1,0,0,0,1,0,0,0,1],!!tn(e,sn,on,an,dn)&&(pn.crossVectors(hn,ln),e=[pn.x,pn.y,pn.z],tn(e,sn,on,an,dn)))}clampPoint(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new Ki),e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return nn.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(nn).length(),t}intersect(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}applyMatrix4(t){return this.isEmpty()||(en[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),en[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),en[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),en[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),en[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),en[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),en[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),en[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(en)),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}function tn(t,e,i,n,r){for(let s=0,o=t.length-3;s<=o;s+=3){fn.fromArray(t,s);const o=r.x*Math.abs(fn.x)+r.y*Math.abs(fn.y)+r.z*Math.abs(fn.z),a=e.dot(fn),h=i.dot(fn),l=n.dot(fn);if(Math.max(-Math.max(a,h,l),Math.min(a,h,l))>o)return!1}return!0}const en=[new Ki,new Ki,new Ki,new Ki,new Ki,new Ki,new Ki,new Ki],nn=new Ki,rn=new $i,sn=new Ki,on=new Ki,an=new Ki,hn=new Ki,ln=new Ki,cn=new Ki,un=new Ki,dn=new Ki,pn=new Ki,fn=new Ki,mn=new $i;class gn{constructor(t,e){this.center=void 0!==t?t:new Ki,this.radius=void 0!==e?e:-1}set(t,e){return this.center.copy(t),this.radius=e,this}setFromPoints(t,e){const i=this.center;void 0!==e?i.copy(e):mn.setFromPoints(t).getCenter(i);let n=0;for(let e=0,r=t.length;ethis.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new $i),this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)}applyMatrix4(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this}translate(t){return this.center.add(t),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}}const vn=new Ki,yn=new Ki,xn=new Ki,bn=new Ki,wn=new Ki,Tn=new Ki,_n=new Ki;class En{constructor(t,e){this.origin=void 0!==t?t:new Ki,this.direction=void 0!==e?e:new Ki(0,0,-1)}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new Ki),e.copy(this.direction).multiplyScalar(t).add(this.origin)}lookAt(t){return this.direction.copy(t).sub(this.origin).normalize(),this}recast(t){return this.origin.copy(this.at(t,vn)),this}closestPointToPoint(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new Ki),e.subVectors(t,this.origin);const i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(i).add(this.origin)}distanceToPoint(t){return Math.sqrt(this.distanceSqToPoint(t))}distanceSqToPoint(t){const e=vn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(vn.copy(this.direction).multiplyScalar(e).add(this.origin),vn.distanceToSquared(t))}distanceSqToSegment(t,e,i,n){yn.copy(t).add(e).multiplyScalar(.5),xn.copy(e).sub(t).normalize(),bn.copy(this.origin).sub(yn);const r=.5*t.distanceTo(e),s=-this.direction.dot(xn),o=bn.dot(this.direction),a=-bn.dot(xn),h=bn.lengthSq(),l=Math.abs(1-s*s);let c,u,d,p;if(l>0)if(c=s*a-o,u=s*o-a,p=r*l,c>=0)if(u>=-p)if(u<=p){const t=1/l;c*=t,u*=t,d=c*(c+s*u+2*o)+u*(s*c+u+2*a)+h}else u=r,c=Math.max(0,-(s*u+o)),d=-c*c+u*(u+2*a)+h;else u=-r,c=Math.max(0,-(s*u+o)),d=-c*c+u*(u+2*a)+h;else u<=-p?(c=Math.max(0,-(-s*r+o)),u=c>0?-r:Math.min(Math.max(-r,-a),r),d=-c*c+u*(u+2*a)+h):u<=p?(c=0,u=Math.min(Math.max(-r,-a),r),d=u*(u+2*a)+h):(c=Math.max(0,-(s*r+o)),u=c>0?r:Math.min(Math.max(-r,-a),r),d=-c*c+u*(u+2*a)+h);else u=s>0?-r:r,c=Math.max(0,-(s*u+o)),d=-c*c+u*(u+2*a)+h;return i&&i.copy(this.direction).multiplyScalar(c).add(this.origin),n&&n.copy(xn).multiplyScalar(u).add(yn),d}intersectSphere(t,e){vn.subVectors(t.center,this.origin);const i=vn.dot(this.direction),n=vn.dot(vn)-i*i,r=t.radius*t.radius;if(n>r)return null;const s=Math.sqrt(r-n),o=i-s,a=i+s;return o<0&&a<0?null:o<0?this.at(a,e):this.at(o,e)}intersectsSphere(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius}distanceToPlane(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null}intersectPlane(t,e){const i=this.distanceToPlane(t);return null===i?null:this.at(i,e)}intersectsPlane(t){const e=t.distanceToPoint(this.origin);if(0===e)return!0;return t.normal.dot(this.direction)*e<0}intersectBox(t,e){let i,n,r,s,o,a;const h=1/this.direction.x,l=1/this.direction.y,c=1/this.direction.z,u=this.origin;return h>=0?(i=(t.min.x-u.x)*h,n=(t.max.x-u.x)*h):(i=(t.max.x-u.x)*h,n=(t.min.x-u.x)*h),l>=0?(r=(t.min.y-u.y)*l,s=(t.max.y-u.y)*l):(r=(t.max.y-u.y)*l,s=(t.min.y-u.y)*l),i>s||r>n?null:((r>i||i!=i)&&(i=r),(s=0?(o=(t.min.z-u.z)*c,a=(t.max.z-u.z)*c):(o=(t.max.z-u.z)*c,a=(t.min.z-u.z)*c),i>a||o>n?null:((o>i||i!=i)&&(i=o),(a=0?i:n,e)))}intersectsBox(t){return null!==this.intersectBox(t,vn)}intersectTriangle(t,e,i,n,r){wn.subVectors(e,t),Tn.subVectors(i,t),_n.crossVectors(wn,Tn);let s,o=this.direction.dot(_n);if(o>0){if(n)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}bn.subVectors(this.origin,t);const a=s*this.direction.dot(Tn.crossVectors(bn,Tn));if(a<0)return null;const h=s*this.direction.dot(wn.cross(bn));if(h<0)return null;if(a+h>o)return null;const l=-s*bn.dot(_n);return l<0?null:this.at(l/o,r)}applyMatrix4(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this}equals(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}}class Sn{constructor(){Object.defineProperty(this,"isMatrix4",{value:!0}),this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}set(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=n,g[1]=r,g[5]=s,g[9]=o,g[13]=a,g[2]=h,g[6]=l,g[10]=c,g[14]=u,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return(new Sn).fromArray(this.elements)}copy(t){const 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(t){const e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this}setFromMatrix3(t){const e=t.elements;return this.set(e[0],e[3],e[6],0,e[1],e[4],e[7],0,e[2],e[5],e[8],0,0,0,0,1),this}extractBasis(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(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(t){const e=this.elements,i=t.elements,n=1/Mn.setFromMatrixColumn(t,0).length(),r=1/Mn.setFromMatrixColumn(t,1).length(),s=1/Mn.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]*s,e[9]=i[9]*s,e[10]=i[10]*s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromEuler(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const e=this.elements,i=t.x,n=t.y,r=t.z,s=Math.cos(i),o=Math.sin(i),a=Math.cos(n),h=Math.sin(n),l=Math.cos(r),c=Math.sin(r);if("XYZ"===t.order){const t=s*l,i=s*c,n=o*l,r=o*c;e[0]=a*l,e[4]=-a*c,e[8]=h,e[1]=i+n*h,e[5]=t-r*h,e[9]=-o*a,e[2]=r-t*h,e[6]=n+i*h,e[10]=s*a}else if("YXZ"===t.order){const t=a*l,i=a*c,n=h*l,r=h*c;e[0]=t+r*o,e[4]=n*o-i,e[8]=s*h,e[1]=s*c,e[5]=s*l,e[9]=-o,e[2]=i*o-n,e[6]=r+t*o,e[10]=s*a}else if("ZXY"===t.order){const t=a*l,i=a*c,n=h*l,r=h*c;e[0]=t-r*o,e[4]=-s*c,e[8]=n+i*o,e[1]=i+n*o,e[5]=s*l,e[9]=r-t*o,e[2]=-s*h,e[6]=o,e[10]=s*a}else if("ZYX"===t.order){const t=s*l,i=s*c,n=o*l,r=o*c;e[0]=a*l,e[4]=n*h-i,e[8]=t*h+r,e[1]=a*c,e[5]=r*h+t,e[9]=i*h-n,e[2]=-h,e[6]=o*a,e[10]=s*a}else if("YZX"===t.order){const t=s*a,i=s*h,n=o*a,r=o*h;e[0]=a*l,e[4]=r-t*c,e[8]=n*c+i,e[1]=c,e[5]=s*l,e[9]=-o*l,e[2]=-h*l,e[6]=i*c+n,e[10]=t-r*c}else if("XZY"===t.order){const t=s*a,i=s*h,n=o*a,r=o*h;e[0]=a*l,e[4]=-c,e[8]=h*l,e[1]=t*c+r,e[5]=s*l,e[9]=i*c-n,e[2]=n*c-i,e[6]=o*l,e[10]=r*c+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}makeRotationFromQuaternion(t){return this.compose(Cn,t,Pn)}lookAt(t,e,i){const n=this.elements;return On.subVectors(t,e),0===On.lengthSq()&&(On.z=1),On.normalize(),Rn.crossVectors(i,On),0===Rn.lengthSq()&&(1===Math.abs(i.z)?On.x+=1e-4:On.z+=1e-4,On.normalize(),Rn.crossVectors(i,On)),Rn.normalize(),Ln.crossVectors(On,Rn),n[0]=Rn.x,n[4]=Ln.x,n[8]=On.x,n[1]=Rn.y,n[5]=Ln.y,n[9]=On.y,n[2]=Rn.z,n[6]=Ln.z,n[10]=On.z,this}multiply(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)}premultiply(t){return this.multiplyMatrices(t,this)}multiplyMatrices(t,e){const i=t.elements,n=e.elements,r=this.elements,s=i[0],o=i[4],a=i[8],h=i[12],l=i[1],c=i[5],u=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],v=i[3],y=i[7],x=i[11],b=i[15],w=n[0],T=n[4],_=n[8],E=n[12],S=n[1],M=n[5],A=n[9],C=n[13],P=n[2],R=n[6],L=n[10],O=n[14],D=n[3],I=n[7],F=n[11],B=n[15];return r[0]=s*w+o*S+a*P+h*D,r[4]=s*T+o*M+a*R+h*I,r[8]=s*_+o*A+a*L+h*F,r[12]=s*E+o*C+a*O+h*B,r[1]=l*w+c*S+u*P+d*D,r[5]=l*T+c*M+u*R+d*I,r[9]=l*_+c*A+u*L+d*F,r[13]=l*E+c*C+u*O+d*B,r[2]=p*w+f*S+m*P+g*D,r[6]=p*T+f*M+m*R+g*I,r[10]=p*_+f*A+m*L+g*F,r[14]=p*E+f*C+m*O+g*B,r[3]=v*w+y*S+x*P+b*D,r[7]=v*T+y*M+x*R+b*I,r[11]=v*_+y*A+x*L+b*F,r[15]=v*E+y*C+x*O+b*B,this}multiplyScalar(t){const 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}determinant(){const t=this.elements,e=t[0],i=t[4],n=t[8],r=t[12],s=t[1],o=t[5],a=t[9],h=t[13],l=t[2],c=t[6],u=t[10],d=t[14];return t[3]*(+r*a*c-n*h*c-r*o*u+i*h*u+n*o*d-i*a*d)+t[7]*(+e*a*d-e*h*u+r*s*u-n*s*d+n*h*l-r*a*l)+t[11]*(+e*h*c-e*o*d-r*s*c+i*s*d+r*o*l-i*h*l)+t[15]*(-n*o*l-e*a*c+e*o*u+n*s*c-i*s*u+i*a*l)}transpose(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this}setPosition(t,e,i){const n=this.elements;return t.isVector3?(n[12]=t.x,n[13]=t.y,n[14]=t.z):(n[12]=t,n[13]=e,n[14]=i),this}invert(){const t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15],v=c*m*h-f*u*h+f*a*d-o*m*d-c*a*g+o*u*g,y=p*u*h-l*m*h-p*a*d+s*m*d+l*a*g-s*u*g,x=l*f*h-p*c*h+p*o*d-s*f*d-l*o*g+s*c*g,b=p*c*a-l*f*a-p*o*u+s*f*u+l*o*m-s*c*m,w=e*v+i*y+n*x+r*b;if(0===w)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/w;return t[0]=v*T,t[1]=(f*u*r-c*m*r-f*n*d+i*m*d+c*n*g-i*u*g)*T,t[2]=(o*m*r-f*a*r+f*n*h-i*m*h-o*n*g+i*a*g)*T,t[3]=(c*a*r-o*u*r-c*n*h+i*u*h+o*n*d-i*a*d)*T,t[4]=y*T,t[5]=(l*m*r-p*u*r+p*n*d-e*m*d-l*n*g+e*u*g)*T,t[6]=(p*a*r-s*m*r-p*n*h+e*m*h+s*n*g-e*a*g)*T,t[7]=(s*u*r-l*a*r+l*n*h-e*u*h-s*n*d+e*a*d)*T,t[8]=x*T,t[9]=(p*c*r-l*f*r-p*i*d+e*f*d+l*i*g-e*c*g)*T,t[10]=(s*f*r-p*o*r+p*i*h-e*f*h-s*i*g+e*o*g)*T,t[11]=(l*o*r-s*c*r-l*i*h+e*c*h+s*i*d-e*o*d)*T,t[12]=b*T,t[13]=(l*f*n-p*c*n+p*i*u-e*f*u-l*i*m+e*c*m)*T,t[14]=(p*o*n-s*f*n-p*i*a+e*f*a+s*i*m-e*o*m)*T,t[15]=(s*c*n-l*o*n+l*i*a-e*c*a-s*i*u+e*o*u)*T,this}scale(t){const e=this.elements,i=t.x,n=t.y,r=t.z;return e[0]*=i,e[4]*=n,e[8]*=r,e[1]*=i,e[5]*=n,e[9]*=r,e[2]*=i,e[6]*=n,e[10]*=r,e[3]*=i,e[7]*=n,e[11]*=r,this}getMaxScaleOnAxis(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))}makeTranslation(t,e,i){return this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this}makeRotationX(t){const e=Math.cos(t),i=Math.sin(t);return this.set(1,0,0,0,0,e,-i,0,0,i,e,0,0,0,0,1),this}makeRotationY(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,0,i,0,0,1,0,0,-i,0,e,0,0,0,0,1),this}makeRotationZ(t){const e=Math.cos(t),i=Math.sin(t);return this.set(e,-i,0,0,i,e,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(t,e){const i=Math.cos(e),n=Math.sin(e),r=1-i,s=t.x,o=t.y,a=t.z,h=r*s,l=r*o;return this.set(h*s+i,h*o-n*a,h*a+n*o,0,h*o+n*a,l*o+i,l*a-n*s,0,h*a-n*o,l*a+n*s,r*a*a+i,0,0,0,0,1),this}makeScale(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this}makeShear(t,e,i){return this.set(1,e,i,0,t,1,i,0,t,e,1,0,0,0,0,1),this}compose(t,e,i){const n=this.elements,r=e._x,s=e._y,o=e._z,a=e._w,h=r+r,l=s+s,c=o+o,u=r*h,d=r*l,p=r*c,f=s*l,m=s*c,g=o*c,v=a*h,y=a*l,x=a*c,b=i.x,w=i.y,T=i.z;return n[0]=(1-(f+g))*b,n[1]=(d+x)*b,n[2]=(p-y)*b,n[3]=0,n[4]=(d-x)*w,n[5]=(1-(u+g))*w,n[6]=(m+v)*w,n[7]=0,n[8]=(p+y)*T,n[9]=(m-v)*T,n[10]=(1-(u+f))*T,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this}decompose(t,e,i){const n=this.elements;let r=Mn.set(n[0],n[1],n[2]).length();const s=Mn.set(n[4],n[5],n[6]).length(),o=Mn.set(n[8],n[9],n[10]).length();this.determinant()<0&&(r=-r),t.x=n[12],t.y=n[13],t.z=n[14],An.copy(this);const a=1/r,h=1/s,l=1/o;return An.elements[0]*=a,An.elements[1]*=a,An.elements[2]*=a,An.elements[4]*=h,An.elements[5]*=h,An.elements[6]*=h,An.elements[8]*=l,An.elements[9]*=l,An.elements[10]*=l,e.setFromRotationMatrix(An),i.x=r,i.y=s,i.z=o,this}makePerspective(t,e,i,n,r,s){void 0===s&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const o=this.elements,a=2*r/(e-t),h=2*r/(i-n),l=(e+t)/(e-t),c=(i+n)/(i-n),u=-(s+r)/(s-r),d=-2*s*r/(s-r);return o[0]=a,o[4]=0,o[8]=l,o[12]=0,o[1]=0,o[5]=h,o[9]=c,o[13]=0,o[2]=0,o[6]=0,o[10]=u,o[14]=d,o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this}makeOrthographic(t,e,i,n,r,s){const o=this.elements,a=1/(e-t),h=1/(i-n),l=1/(s-r),c=(e+t)*a,u=(i+n)*h,d=(s+r)*l;return o[0]=2*a,o[4]=0,o[8]=0,o[12]=-c,o[1]=0,o[5]=2*h,o[9]=0,o[13]=-u,o[2]=0,o[6]=0,o[10]=-2*l,o[14]=-d,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this}equals(t){const e=this.elements,i=t.elements;for(let t=0;t<16;t++)if(e[t]!==i[t])return!1;return!0}fromArray(t,e=0){for(let i=0;i<16;i++)this.elements[i]=t[i+e];return this}toArray(t=[],e=0){const i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t}}const Mn=new Ki,An=new Sn,Cn=new Ki(0,0,0),Pn=new Ki(1,1,1),Rn=new Ki,Ln=new Ki,On=new Ki;class Dn{constructor(t=0,e=0,i=0,n=Dn.DefaultOrder){Object.defineProperty(this,"isEuler",{value:!0}),this._x=t,this._y=e,this._z=i,this._order=n}get x(){return this._x}set x(t){this._x=t,this._onChangeCallback()}get y(){return this._y}set y(t){this._y=t,this._onChangeCallback()}get z(){return this._z}set z(t){this._z=t,this._onChangeCallback()}get order(){return this._order}set order(t){this._order=t,this._onChangeCallback()}set(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._order=n||this._order,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this}setFromRotationMatrix(t,e,i){const n=Ni.clamp,r=t.elements,s=r[0],o=r[4],a=r[8],h=r[1],l=r[5],c=r[9],u=r[2],d=r[6],p=r[10];switch(e=e||this._order){case"XYZ":this._y=Math.asin(n(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-c,p),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(d,l),this._z=0);break;case"YXZ":this._x=Math.asin(-n(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(a,p),this._z=Math.atan2(h,l)):(this._y=Math.atan2(-u,s),this._z=0);break;case"ZXY":this._x=Math.asin(n(d,-1,1)),Math.abs(d)<.9999999?(this._y=Math.atan2(-u,p),this._z=Math.atan2(-o,l)):(this._y=0,this._z=Math.atan2(h,s));break;case"ZYX":this._y=Math.asin(-n(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(d,p),this._z=Math.atan2(h,s)):(this._x=0,this._z=Math.atan2(-o,l));break;case"YZX":this._z=Math.asin(n(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-c,l),this._y=Math.atan2(-u,s)):(this._x=0,this._y=Math.atan2(a,p));break;case"XZY":this._z=Math.asin(-n(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(d,l),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-c,p),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!1!==i&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return In.makeRotationFromQuaternion(t),this.setFromRotationMatrix(In,e,i)}setFromVector3(t,e){return this.set(t.x,t.y,t.z,e||this._order)}reorder(t){return Fn.setFromEuler(this),this.setFromQuaternion(Fn,t)}equals(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order}fromArray(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this}toArray(t=[],e=0){return t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t}toVector3(t){return t?t.set(this._x,this._y,this._z):new Ki(this._x,this._y,this._z)}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}}Dn.DefaultOrder="XYZ",Dn.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];const In=new Sn,Fn=new Zi;class Bn{constructor(){this.mask=1}set(t){this.mask=1<1){for(let t=0;t1){for(let t=0;t0){n.children=[];for(let e=0;e0){n.animations=[];for(let e=0;e0&&(i.geometries=e),n.length>0&&(i.materials=n),r.length>0&&(i.textures=r),o.length>0&&(i.images=o),a.length>0&&(i.shapes=a),h.length>0&&(i.skeletons=h),l.length>0&&(i.animations=l)}return i.object=n,i;function s(t){const e=[];for(const i in t){const 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=!0){if(this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let e=0;e1?void 0:e.copy(i).multiplyScalar(r).add(t.start)}intersectsLine(t){const e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0}intersectsBox(t){return t.intersectsPlane(this)}intersectsSphere(t){return t.intersectsPlane(this)}coplanarPoint(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new Ki),t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const i=e||$n.getNormalMatrix(t),n=this.coplanarPoint(Jn).applyMatrix4(t),r=this.normal.applyMatrix3(i).normalize();return this.constant=-n.dot(r),this}translate(t){return this.constant-=t.dot(this.normal),this}equals(t){return t.normal.equals(this.normal)&&t.constant===this.constant}}const er=new Ki,ir=new Ki,nr=new Ki,rr=new Ki,sr=new Ki,or=new Ki,ar=new Ki,hr=new Ki,lr=new Ki,cr=new Ki;class ur{constructor(t,e,i){this.a=void 0!==t?t:new Ki,this.b=void 0!==e?e:new Ki,this.c=void 0!==i?i:new Ki}static getNormal(t,e,i,n){void 0===n&&(console.warn("THREE.Triangle: .getNormal() target is now required"),n=new Ki),n.subVectors(i,e),er.subVectors(t,e),n.cross(er);const r=n.lengthSq();return r>0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)}static getBarycoord(t,e,i,n,r){er.subVectors(n,e),ir.subVectors(i,e),nr.subVectors(t,e);const s=er.dot(er),o=er.dot(ir),a=er.dot(nr),h=ir.dot(ir),l=ir.dot(nr),c=s*h-o*o;if(void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new Ki),0===c)return r.set(-2,-1,-1);const u=1/c,d=(h*a-o*l)*u,p=(s*l-o*a)*u;return r.set(1-d-p,p,d)}static containsPoint(t,e,i,n){return this.getBarycoord(t,e,i,n,rr),rr.x>=0&&rr.y>=0&&rr.x+rr.y<=1}static getUV(t,e,i,n,r,s,o,a){return this.getBarycoord(t,e,i,n,rr),a.set(0,0),a.addScaledVector(r,rr.x),a.addScaledVector(s,rr.y),a.addScaledVector(o,rr.z),a}static isFrontFacing(t,e,i,n){return er.subVectors(i,e),ir.subVectors(t,e),er.cross(ir).dot(n)<0}set(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this}setFromPointsAndIndices(t,e,i,n){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[n]),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this}getArea(){return er.subVectors(this.c,this.b),ir.subVectors(this.a,this.b),.5*er.cross(ir).length()}getMidpoint(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new Ki),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return ur.getNormal(this.a,this.b,this.c,t)}getPlane(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new tr),t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return ur.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,i,n,r){return ur.getUV(t,this.a,this.b,this.c,e,i,n,r)}containsPoint(t){return ur.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return ur.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new Ki);const i=this.a,n=this.b,r=this.c;let s,o;sr.subVectors(n,i),or.subVectors(r,i),hr.subVectors(t,i);const a=sr.dot(hr),h=or.dot(hr);if(a<=0&&h<=0)return e.copy(i);lr.subVectors(t,n);const l=sr.dot(lr),c=or.dot(lr);if(l>=0&&c<=l)return e.copy(n);const u=a*c-l*h;if(u<=0&&a>=0&&l<=0)return s=a/(a-l),e.copy(i).addScaledVector(sr,s);cr.subVectors(t,r);const d=sr.dot(cr),p=or.dot(cr);if(p>=0&&d<=p)return e.copy(r);const f=d*h-a*p;if(f<=0&&h>=0&&p<=0)return o=h/(h-p),e.copy(i).addScaledVector(or,o);const m=l*p-d*c;if(m<=0&&c-l>=0&&d-p>=0)return ar.subVectors(r,n),o=(c-l)/(c-l+(d-p)),e.copy(n).addScaledVector(ar,o);const g=1/(m+f+u);return s=f*g,o=u*g,e.copy(i).addScaledVector(sr,s).addScaledVector(or,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}const dr={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},pr={h:0,s:0,l:0},fr={h:0,s:0,l:0};function mr(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}function gr(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function vr(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}class yr{constructor(t,e,i){return Object.defineProperty(this,"isColor",{value:!0}),void 0===e&&void 0===i?this.set(t):this.setRGB(t,e,i)}set(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this}setScalar(t){return this.r=t,this.g=t,this.b=t,this}setHex(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this}setRGB(t,e,i){return this.r=t,this.g=e,this.b=i,this}setHSL(t,e,i){if(t=Ni.euclideanModulo(t,1),e=Ni.clamp(e,0,1),i=Ni.clamp(i,0,1),0===e)this.r=this.g=this.b=i;else{const n=i<=.5?i*(1+e):i+e-i*e,r=2*i-n;this.r=mr(r,n,t+1/3),this.g=mr(r,n,t),this.b=mr(r,n,t-1/3)}return this}setStyle(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let i;if(i=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let t;const n=i[1],r=i[2];switch(n){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,e(t[4]),this;if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,e(t[4]),this;break;case"hsl":case"hsla":if(t=/^\s*(\d*\.?\d+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(r)){const i=parseFloat(t[1])/360,n=parseInt(t[2],10)/100,r=parseInt(t[3],10)/100;return e(t[4]),this.setHSL(i,n,r)}}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=i[1],e=t.length;if(3===e)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this;if(6===e)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this}setColorName(t){const e=dr[t];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(t){return this.r=t.r,this.g=t.g,this.b=t.b,this}copyGammaToLinear(t,e=2){return this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this}copyLinearToGamma(t,e=2){const 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(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.r=gr(t.r),this.g=gr(t.g),this.b=gr(t.b),this}copyLinearToSRGB(t){return this.r=vr(t.r),this.g=vr(t.g),this.b=vr(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0}getHexString(){return("000000"+this.getHex().toString(16)).slice(-6)}getHSL(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});const e=this.r,i=this.g,n=this.b,r=Math.max(e,i,n),s=Math.min(e,i,n);let o,a;const h=(s+r)/2;if(s===r)o=0,a=0;else{const t=r-s;switch(a=h<=.5?t/(r+s):t/(2-r-s),r){case e:o=(i-n)/t+(i0&&(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.morphNormals&&(i.morphNormals=!0),!0===this.skinning&&(i.skinning=!0),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),e){const e=n(t.textures),r=n(t.images);e.length>0&&(i.textures=e),r.length>0&&(i.images=r)}return i},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let i=null;if(null!==e){const t=e.length;i=new Array(t);for(let n=0;n!==t;++n)i[n]=e[n].clone()}return this.clippingPlanes=i,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(wr.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Tr.prototype=Object.create(wr.prototype),Tr.prototype.constructor=Tr,Tr.prototype.isMeshBasicMaterial=!0,Tr.prototype.copy=function(t){return wr.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};const _r=new Ki,Er=new Ui;function Sr(t,e,i){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===i,this.usage=Ei,this.updateRange={offset:0,count:-1},this.version=0}function Mr(t,e,i){Sr.call(this,new Int8Array(t),e,i)}function Ar(t,e,i){Sr.call(this,new Uint8Array(t),e,i)}function Cr(t,e,i){Sr.call(this,new Uint8ClampedArray(t),e,i)}function Pr(t,e,i){Sr.call(this,new Int16Array(t),e,i)}function Rr(t,e,i){Sr.call(this,new Uint16Array(t),e,i)}function Lr(t,e,i){Sr.call(this,new Int32Array(t),e,i)}function Or(t,e,i){Sr.call(this,new Uint32Array(t),e,i)}function Dr(t,e,i){Sr.call(this,new Uint16Array(t),e,i)}function Ir(t,e,i){Sr.call(this,new Float32Array(t),e,i)}function Fr(t,e,i){Sr.call(this,new Float64Array(t),e,i)}function Br(t){if(0===t.length)return-1/0;let e=t[0];for(let i=1,n=t.length;ie&&(e=t[i]);return e}Object.defineProperty(Sr.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Sr.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let n=0,r=this.itemSize;n65535?Or:Rr)(t,1):this.index=t,this},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},hasAttribute:function(t){return void 0!==this.attributes[t]},addGroup:function(t,e,i=0){this.groups.push({start:t,count:e,materialIndex:i})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const i=this.attributes.normal;if(void 0!==i){const e=(new zi).getNormalMatrix(t);i.applyNormalMatrix(e),i.needsUpdate=!0}const n=this.attributes.tangent;return void 0!==n&&(n.transformDirection(t),n.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return zr.makeRotationX(t),this.applyMatrix4(zr),this},rotateY:function(t){return zr.makeRotationY(t),this.applyMatrix4(zr),this},rotateZ:function(t){return zr.makeRotationZ(t),this.applyMatrix4(zr),this},translate:function(t,e,i){return zr.makeTranslation(t,e,i),this.applyMatrix4(zr),this},scale:function(t,e,i){return zr.makeScale(t,e,i),this.applyMatrix4(zr),this},lookAt:function(t){return Gr.lookAt(t),Gr.updateMatrix(),this.applyMatrix4(Gr.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Vr).negate(),this.translate(Vr.x,Vr.y,Vr.z),this},setFromPoints:function(t){const e=[];for(let i=0,n=t.length;i0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const i=this.attributes;for(const e in i){const n=i[e],r=n.toJSON(t.data);""!==n.name&&(r.name=n.name),t.data.attributes[e]=r}const n={};let r=!1;for(const e in this.morphAttributes){const i=this.morphAttributes[e],s=[];for(let e=0,n=i.length;e0&&(n[e]=s,r=!0)}r&&(t.data.morphAttributes=n,t.data.morphTargetsRelative=this.morphTargetsRelative);const s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));const o=this.boundingSphere;return null!==o&&(t.data.boundingSphere={center:o.center.toArray(),radius:o.radius}),t},clone:function(){return(new jr).copy(this)},copy:function(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const i=t.index;null!==i&&this.setIndex(i.clone(e));const n=t.attributes;for(const t in n){const i=n[t];this.setAttribute(t,i.clone(e))}const r=t.morphAttributes;for(const t in r){const i=[],n=r[t];for(let t=0,r=n.length;ti.far?null:{distance:l,point:ls.clone(),object:t}}(t,e,i,n,Kr,Jr,Qr,hs);if(p){a&&(ss.fromBufferAttribute(a,l),os.fromBufferAttribute(a,c),as.fromBufferAttribute(a,u),p.uv=ur.getUV(hs,Kr,Jr,Qr,ss,os,as,new Ui)),h&&(ss.fromBufferAttribute(h,l),os.fromBufferAttribute(h,c),as.fromBufferAttribute(h,u),p.uv2=ur.getUV(hs,Kr,Jr,Qr,ss,os,as,new Ui));const t=new xr(l,c,u);ur.getNormal(Kr,Jr,Qr,t.normal),p.face=t}return p}cs.prototype=Object.assign(Object.create(Kn.prototype),{constructor:cs,isMesh:!0,copy:function(t){return Kn.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this},updateMorphTargets:function(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,i=Object.keys(e);if(i.length>0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){const i=this.geometry,n=this.material,r=this.matrixWorld;if(void 0===n)return;if(null===i.boundingSphere&&i.computeBoundingSphere(),Zr.copy(i.boundingSphere),Zr.applyMatrix4(r),!1===t.ray.intersectsSphere(Zr))return;if(Yr.copy(r).invert(),qr.copy(t.ray).applyMatrix4(Yr),null!==i.boundingBox&&!1===qr.intersectsBox(i.boundingBox))return;let s;if(i.isBufferGeometry){const r=i.index,o=i.attributes.position,a=i.morphAttributes.position,h=i.morphTargetsRelative,l=i.attributes.uv,c=i.attributes.uv2,u=i.groups,d=i.drawRange;if(null!==r)if(Array.isArray(n))for(let i=0,p=u.length;i0?1:-1,l.push(A.x,A.y,A.z),c.push(a/m),c.push(1-s/g),S+=1}}for(let t=0;t0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;const i={};for(const t in this.extensions)!0===this.extensions[t]&&(i[t]=!0);return Object.keys(i).length>0&&(e.extensions=i),e},vs.prototype=Object.assign(Object.create(Kn.prototype),{constructor:vs,isCamera:!0,copy:function(t,e){return Kn.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new Ki),this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){Kn.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()},updateWorldMatrix:function(t,e){Kn.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()},clone:function(){return(new this.constructor).copy(this)}}),ys.prototype=Object.assign(Object.create(vs.prototype),{constructor:ys,isPerspectiveCamera:!0,copy:function(t,e){return vs.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){const e=.5*this.getFilmHeight()/t;this.fov=2*Ni.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){const t=Math.tan(.5*Ni.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*Ni.RAD2DEG*Math.atan(Math.tan(.5*Ni.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,s){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=s,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){const t=this.near;let e=t*Math.tan(.5*Ni.DEG2RAD*this.fov)/this.zoom,i=2*e,n=this.aspect*i,r=-.5*n;const s=this.view;if(null!==this.view&&this.view.enabled){const t=s.fullWidth,o=s.fullHeight;r+=s.offsetX*n/t,e-=s.offsetY*i/o,n*=s.width/t,i*=s.height/o}const o=this.filmOffset;0!==o&&(r+=t*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,e,e-i,t,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()},toJSON:function(t){const e=Kn.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}});function xs(t,e,i){if(Kn.call(this),this.type="CubeCamera",!0!==i.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=i;const n=new ys(90,1,t,e);n.layers=this.layers,n.up.set(0,-1,0),n.lookAt(new Ki(1,0,0)),this.add(n);const r=new ys(90,1,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new Ki(-1,0,0)),this.add(r);const s=new ys(90,1,t,e);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(new Ki(0,1,0)),this.add(s);const o=new ys(90,1,t,e);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new Ki(0,-1,0)),this.add(o);const a=new ys(90,1,t,e);a.layers=this.layers,a.up.set(0,-1,0),a.lookAt(new Ki(0,0,1)),this.add(a);const h=new ys(90,1,t,e);h.layers=this.layers,h.up.set(0,-1,0),h.lookAt(new Ki(0,0,-1)),this.add(h),this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();const l=t.xr.enabled,c=t.getRenderTarget();t.xr.enabled=!1;const u=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,t.setRenderTarget(i,0),t.render(e,n),t.setRenderTarget(i,1),t.render(e,r),t.setRenderTarget(i,2),t.render(e,s),t.setRenderTarget(i,3),t.render(e,o),t.setRenderTarget(i,4),t.render(e,a),i.texture.generateMipmaps=u,t.setRenderTarget(i,5),t.render(e,h),t.setRenderTarget(c),t.xr.enabled=l}}function bs(t,e,i,n,r,s,o,a,h,l){t=void 0!==t?t:[],e=void 0!==e?e:st,o=void 0!==o?o:kt,Wi.call(this,t,e,i,n,r,s,o,a,h,l),this.flipY=!1,this._needsFlipEnvMap=!0}xs.prototype=Object.create(Kn.prototype),xs.prototype.constructor=xs,bs.prototype=Object.create(Wi.prototype),bs.prototype.constructor=bs,bs.prototype.isCubeTexture=!0,Object.defineProperty(bs.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}});class ws extends Yi{constructor(t,e,i){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=i),super(t,t,e),Object.defineProperty(this,"isWebGLCubeRenderTarget",{value:!0}),e=e||{},this.texture=new bs(void 0,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture._needsFlipEnvMap=!1}fromEquirectangularTexture(t,e){this.texture.type=e.type,this.texture.format=Nt,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include \n\t\t\t\t\t#include \n\n\t\t\t\t}\n\t\t\t",fragmentShader:"\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include \n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t"},n=new ds(5,5,5),r=new gs({name:"CubemapFromEquirect",uniforms:ps(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:m,blending:x});r.uniforms.tEquirect.value=e;const s=new cs(n,r),o=e.minFilter;e.minFilter===Tt&&(e.minFilter=xt);return new xs(1,10,this).update(t,s),e.minFilter=o,s.geometry.dispose(),s.material.dispose(),this}clear(t,e,i,n){const r=t.getRenderTarget();for(let r=0;r<6;r++)t.setRenderTarget(this,r),t.clear(e,i,n);t.setRenderTarget(r)}}function Ts(t,e,i,n,r,s,o,a,h,l,c,u){Wi.call(this,null,s,o,a,h,l,n,r,c,u),this.image={data:t||null,width:e||1,height:i||1},this.magFilter=void 0!==h?h:ft,this.minFilter=void 0!==l?l:ft,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}Ts.prototype=Object.create(Wi.prototype),Ts.prototype.constructor=Ts,Ts.prototype.isDataTexture=!0;const _s=new gn,Es=new Ki;class Ss{constructor(t,e,i,n,r,s){this.planes=[void 0!==t?t:new tr,void 0!==e?e:new tr,void 0!==i?i:new tr,void 0!==n?n:new tr,void 0!==r?r:new tr,void 0!==s?s:new tr]}set(t,e,i,n,r,s){const o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(i),o[3].copy(n),o[4].copy(r),o[5].copy(s),this}clone(){return(new this.constructor).copy(this)}copy(t){const e=this.planes;for(let i=0;i<6;i++)e[i].copy(t.planes[i]);return this}setFromProjectionMatrix(t){const e=this.planes,i=t.elements,n=i[0],r=i[1],s=i[2],o=i[3],a=i[4],h=i[5],l=i[6],c=i[7],u=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(o-n,c-a,f-u,y-m).normalize(),e[1].setComponents(o+n,c+a,f+u,y+m).normalize(),e[2].setComponents(o+r,c+h,f+d,y+g).normalize(),e[3].setComponents(o-r,c-h,f-d,y-g).normalize(),e[4].setComponents(o-s,c-l,f-p,y-v).normalize(),e[5].setComponents(o+s,c+l,f+p,y+v).normalize(),this}intersectsObject(t){const e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),_s.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(_s)}intersectsSprite(t){return _s.center.set(0,0,0),_s.radius=.7071067811865476,_s.applyMatrix4(t.matrixWorld),this.intersectsSphere(_s)}intersectsSphere(t){const e=this.planes,i=t.center,n=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(i)0?t.max.x:t.min.x,Es.y=n.normal.y>0?t.max.y:t.min.y,Es.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(Es)<0)return!1}return!0}containsPoint(t){const e=this.planes;for(let i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}}function Ms(){let t=null,e=!1,i=null,n=null;function r(e,s){i(e,s),n=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==i&&(n=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(t){i=t},setContext:function(e){t=e}}}function As(t,e){const i=e.isWebGL2,n=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),n.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const i=n.get(e);i&&(t.deleteBuffer(i.buffer),n.delete(e))},update:function(e,r){if(e.isGLBufferAttribute){const t=n.get(e);return void((!t||t.version 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor.xyz *= color.xyz;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif",common:"#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_maxMipLevel 8.0\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_maxTileSize 256.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\n\t\tvec2 f = fract( uv );\n\t\tuv += 0.5 - f;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tif ( mipInt < cubeUV_maxMipLevel ) {\n\t\t\tuv.y += 2.0 * cubeUV_maxTileSize;\n\t\t}\n\t\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\n\t\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\n\t\tuv *= texelSize;\n\t\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x += texelSize;\n\t\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.y += texelSize;\n\t\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tuv.x -= texelSize;\n\t\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\n\t\tvec3 tm = mix( tl, tr, f.x );\n\t\tvec3 bm = mix( bl, br, f.x );\n\t\treturn mix( tm, bm, f.y );\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_common_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",envmap_pars_fragment:"#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",lights_pars_begin:"uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",map_particle_pars_fragment:"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",normal_fragment_maps:"#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",clearcoat_normal_fragment_maps:"#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",clearcoat_pars_fragment:"#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",transmissionmap_fragment:"#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif",transmissionmap_pars_fragment:"#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",uv_pars_fragment:"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include \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:"#include \nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include \nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include \n\tgl_FragColor = envColor;\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 \nvarying vec2 vHighPrecisionZW;\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\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvarying vec2 vHighPrecisionZW;\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\tvHighPrecisionZW = gl_Position.zw;\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 = equirectUv( direction );\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 \n#include \nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include \n\t#include \n\t#include \n\t#include \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 \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\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \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\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;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\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 \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#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include \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;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\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 \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\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\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 \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#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}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\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 \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\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshtoon_vert:"#define TOON\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}",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 \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 STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \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 \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#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\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\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#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= mix( saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) ), 1.0, metalness );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \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\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \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( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \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_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include \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#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include \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( TANGENTSPACE_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 = isPerspectiveMatrix( projectionMatrix );\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\t#include \n\t#include \n}",shadow_vert:"#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}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \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}",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 = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}"},Rs={common:{diffuse:{value:new yr(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new zi},uv2Transform:{value:new zi},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Ui(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new yr(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new yr(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new zi}},sprite:{diffuse:{value:new yr(15658734)},opacity:{value:1},center:{value:new Ui(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new zi}}},Ls={basic:{uniforms:fs([Rs.common,Rs.specularmap,Rs.envmap,Rs.aomap,Rs.lightmap,Rs.fog]),vertexShader:Ps.meshbasic_vert,fragmentShader:Ps.meshbasic_frag},lambert:{uniforms:fs([Rs.common,Rs.specularmap,Rs.envmap,Rs.aomap,Rs.lightmap,Rs.emissivemap,Rs.fog,Rs.lights,{emissive:{value:new yr(0)}}]),vertexShader:Ps.meshlambert_vert,fragmentShader:Ps.meshlambert_frag},phong:{uniforms:fs([Rs.common,Rs.specularmap,Rs.envmap,Rs.aomap,Rs.lightmap,Rs.emissivemap,Rs.bumpmap,Rs.normalmap,Rs.displacementmap,Rs.fog,Rs.lights,{emissive:{value:new yr(0)},specular:{value:new yr(1118481)},shininess:{value:30}}]),vertexShader:Ps.meshphong_vert,fragmentShader:Ps.meshphong_frag},standard:{uniforms:fs([Rs.common,Rs.envmap,Rs.aomap,Rs.lightmap,Rs.emissivemap,Rs.bumpmap,Rs.normalmap,Rs.displacementmap,Rs.roughnessmap,Rs.metalnessmap,Rs.fog,Rs.lights,{emissive:{value:new yr(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ps.meshphysical_vert,fragmentShader:Ps.meshphysical_frag},toon:{uniforms:fs([Rs.common,Rs.aomap,Rs.lightmap,Rs.emissivemap,Rs.bumpmap,Rs.normalmap,Rs.displacementmap,Rs.gradientmap,Rs.fog,Rs.lights,{emissive:{value:new yr(0)}}]),vertexShader:Ps.meshtoon_vert,fragmentShader:Ps.meshtoon_frag},matcap:{uniforms:fs([Rs.common,Rs.bumpmap,Rs.normalmap,Rs.displacementmap,Rs.fog,{matcap:{value:null}}]),vertexShader:Ps.meshmatcap_vert,fragmentShader:Ps.meshmatcap_frag},points:{uniforms:fs([Rs.points,Rs.fog]),vertexShader:Ps.points_vert,fragmentShader:Ps.points_frag},dashed:{uniforms:fs([Rs.common,Rs.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ps.linedashed_vert,fragmentShader:Ps.linedashed_frag},depth:{uniforms:fs([Rs.common,Rs.displacementmap]),vertexShader:Ps.depth_vert,fragmentShader:Ps.depth_frag},normal:{uniforms:fs([Rs.common,Rs.bumpmap,Rs.normalmap,Rs.displacementmap,{opacity:{value:1}}]),vertexShader:Ps.normal_vert,fragmentShader:Ps.normal_frag},sprite:{uniforms:fs([Rs.sprite,Rs.fog]),vertexShader:Ps.sprite_vert,fragmentShader:Ps.sprite_frag},background:{uniforms:{uvTransform:{value:new zi},t2D:{value:null}},vertexShader:Ps.background_vert,fragmentShader:Ps.background_frag},cube:{uniforms:fs([Rs.envmap,{opacity:{value:1}}]),vertexShader:Ps.cube_vert,fragmentShader:Ps.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Ps.equirect_vert,fragmentShader:Ps.equirect_frag},distanceRGBA:{uniforms:fs([Rs.common,Rs.displacementmap,{referencePosition:{value:new Ki},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ps.distanceRGBA_vert,fragmentShader:Ps.distanceRGBA_frag},shadow:{uniforms:fs([Rs.lights,Rs.fog,{color:{value:new yr(0)},opacity:{value:1}}]),vertexShader:Ps.shadow_vert,fragmentShader:Ps.shadow_frag}};function Os(t,e,i,n,r){const s=new yr(0);let o,a,h=0,l=null,c=0,u=null;function d(t,e){i.buffers.color.setClear(t.r,t.g,t.b,e,r)}return{getClearColor:function(){return s},setClearColor:function(t,e=1){s.set(t),h=e,d(s,h)},getClearAlpha:function(){return h},setClearAlpha:function(t){h=t,d(s,h)},render:function(i,r,p,g){let v=!0===r.isScene?r.background:null;v&&v.isTexture&&(v=e.get(v));const y=t.xr,x=y.getSession&&y.getSession();x&&"additive"===x.environmentBlendMode&&(v=null),null===v?d(s,h):v&&v.isColor&&(d(v,1),g=!0),(t.autoClear||g)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),v&&(v.isCubeTexture||v.isWebGLCubeRenderTarget||v.mapping===lt)?(void 0===a&&(a=new cs(new ds(1,1,1),new gs({name:"BackgroundCubeMaterial",uniforms:ps(Ls.cube.uniforms),vertexShader:Ls.cube.vertexShader,fragmentShader:Ls.cube.fragmentShader,side:m,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),a.geometry.deleteAttribute("uv"),a.onBeforeRender=function(t,e,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(a.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(a)),v.isWebGLCubeRenderTarget&&(v=v.texture),a.material.uniforms.envMap.value=v,a.material.uniforms.flipEnvMap.value=v.isCubeTexture&&v._needsFlipEnvMap?-1:1,l===v&&c===v.version&&u===t.toneMapping||(a.material.needsUpdate=!0,l=v,c=v.version,u=t.toneMapping),i.unshift(a,a.geometry,a.material,0,0,null)):v&&v.isTexture&&(void 0===o&&(o=new cs(new Cs(2,2),new gs({name:"BackgroundMaterial",uniforms:ps(Ls.background.uniforms),vertexShader:Ls.background.vertexShader,fragmentShader:Ls.background.fragmentShader,side:f,depthTest:!1,depthWrite:!1,fog:!1})),o.geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(o)),o.material.uniforms.t2D.value=v,!0===v.matrixAutoUpdate&&v.updateMatrix(),o.material.uniforms.uvTransform.value.copy(v.matrix),l===v&&c===v.version&&u===t.toneMapping||(o.material.needsUpdate=!0,l=v,c=v.version,u=t.toneMapping),i.unshift(o,o.geometry,o.material,0,0,null))}}}function Ds(t,e,i,n){const r=t.getParameter(34921),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||null!==s,a={},h=d(null);let l=h;function c(e){return n.isWebGL2?t.bindVertexArray(e):s.bindVertexArrayOES(e)}function u(e){return n.isWebGL2?t.deleteVertexArray(e):s.deleteVertexArrayOES(e)}function d(t){const e=[],i=[],n=[];for(let t=0;t=0){const s=h[e];if(void 0!==s){const e=s.normalized,r=s.itemSize,o=i.get(s);if(void 0===o)continue;const h=o.buffer,l=o.type,c=o.bytesPerElement;if(s.isInterleavedBufferAttribute){const i=s.data,o=i.stride,u=s.offset;i&&i.isInstancedInterleavedBuffer?(m(n,i.meshPerAttribute),void 0===a._maxInstanceCount&&(a._maxInstanceCount=i.meshPerAttribute*i.count)):f(n),t.bindBuffer(34962,h),v(n,r,l,e,o*c,u*c)}else s.isInstancedBufferAttribute?(m(n,s.meshPerAttribute),void 0===a._maxInstanceCount&&(a._maxInstanceCount=s.meshPerAttribute*s.count)):f(n),t.bindBuffer(34962,h),v(n,r,l,e,0,0)}else if("instanceMatrix"===e){const e=i.get(r.instanceMatrix);if(void 0===e)continue;const s=e.buffer,o=e.type;m(n+0,1),m(n+1,1),m(n+2,1),m(n+3,1),t.bindBuffer(34962,s),t.vertexAttribPointer(n+0,4,o,!1,64,0),t.vertexAttribPointer(n+1,4,o,!1,64,16),t.vertexAttribPointer(n+2,4,o,!1,64,32),t.vertexAttribPointer(n+3,4,o,!1,64,48)}else if("instanceColor"===e){const e=i.get(r.instanceColor);if(void 0===e)continue;const s=e.buffer,o=e.type;m(n,1),t.bindBuffer(34962,s),t.vertexAttribPointer(n,3,o,!1,12,0)}else if(void 0!==c){const i=c[e];if(void 0!==i)switch(i.length){case 2:t.vertexAttrib2fv(n,i);break;case 3:t.vertexAttrib3fv(n,i);break;case 4:t.vertexAttrib4fv(n,i);break;default:t.vertexAttrib1fv(n,i)}}}}g()}(r,h,u,y),null!==x&&t.bindBuffer(34963,i.get(x).buffer))},reset:y,resetDefaultState:x,dispose:function(){y();for(const t in a){const e=a[t];for(const t in e){const i=e[t];for(const t in i)u(i[t].object),delete i[t];delete e[t]}delete a[t]}},releaseStatesOfGeometry:function(t){if(void 0===a[t.id])return;const e=a[t.id];for(const t in e){const i=e[t];for(const t in i)u(i[t].object),delete i[t];delete e[t]}delete a[t.id]},releaseStatesOfProgram:function(t){for(const e in a){const i=a[e];if(void 0===i[t.id])continue;const n=i[t.id];for(const t in n)u(n[t].object),delete n[t];delete i[t.id]}},initAttributes:p,enableAttribute:f,disableUnusedAttributes:g}}function Is(t,e,i,n){const r=n.isWebGL2;let s;this.setMode=function(t){s=t},this.render=function(e,n){t.drawArrays(s,e,n),i.update(n,s,1)},this.renderInstances=function(n,o,a){if(0===a)return;let h,l;if(r)h=t,l="drawArraysInstanced";else if(h=e.get("ANGLE_instanced_arrays"),l="drawArraysInstancedANGLE",null===h)return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[l](s,n,o,a),i.update(o,s,a)}}function Fs(t,e,i){let n;function r(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const s="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext;let o=void 0!==i.precision?i.precision:"highp";const a=r(o);a!==o&&(console.warn("THREE.WebGLRenderer:",o,"not supported, using",a,"instead."),o=a);const h=!0===i.logarithmicDepthBuffer,l=t.getParameter(34930),c=t.getParameter(35660),u=t.getParameter(3379),d=t.getParameter(34076),p=t.getParameter(34921),f=t.getParameter(36347),m=t.getParameter(36348),g=t.getParameter(36349),v=c>0,y=s||!!e.get("OES_texture_float");return{isWebGL2:s,getMaxAnisotropy:function(){if(void 0!==n)return n;const i=e.get("EXT_texture_filter_anisotropic");return n=null!==i?t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,n},getMaxPrecision:r,precision:o,logarithmicDepthBuffer:h,maxTextures:l,maxVertexTextures:c,maxTextureSize:u,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:s?t.getParameter(36183):0}}function Bs(t){const e=this;let i=null,n=0,r=!1,s=!1;const o=new tr,a=new zi,h={value:null,needsUpdate:!1};function l(){h.value!==i&&(h.value=i,h.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function c(t,i,n,r){const s=null!==t?t.length:0;let l=null;if(0!==s){if(l=h.value,!0!==r||null===l){const e=n+4*s,r=i.matrixWorldInverse;a.getNormalMatrix(r),(null===l||l.length0){const o=t.getRenderList(),a=t.getRenderTarget(),h=new ws(s.height/2);return h.fromEquirectangularTexture(t,r),e.set(r,h),t.setRenderTarget(a),t.setRenderList(o),r.addEventListener("dispose",n),i(h.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}function Ns(t){const e={};function i(i){if(void 0!==e[i])return e[i];let n;switch(i){case"WEBGL_depth_texture":n=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":n=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":n=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":n=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:n=t.getExtension(i)}return e[i]=n,n}return{has:function(t){return null!==i(t)},init:function(t){t.isWebGL2?i("EXT_color_buffer_float"):(i("WEBGL_depth_texture"),i("OES_texture_float"),i("OES_texture_half_float"),i("OES_texture_half_float_linear"),i("OES_standard_derivatives"),i("OES_element_index_uint"),i("OES_vertex_array_object"),i("ANGLE_instanced_arrays")),i("OES_texture_float_linear"),i("EXT_color_buffer_half_float")},get:function(t){const e=i(t);return null===e&&console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e}}}function Us(t,e,i,n){const r={},s=new WeakMap;function o(t){const a=t.target;null!==a.index&&e.remove(a.index);for(const t in a.attributes)e.remove(a.attributes[t]);a.removeEventListener("dispose",o),delete r[a.id];const h=s.get(a);h&&(e.remove(h),s.delete(a)),n.releaseStatesOfGeometry(a),!0===a.isInstancedBufferGeometry&&delete a._maxInstanceCount,i.memory.geometries--}function a(t){const i=[],n=t.index,r=t.attributes.position;let o=0;if(null!==n){const t=n.array;o=n.version;for(let e=0,n=t.length;e65535?Or:Rr)(i,1);a.version=o;const h=s.get(t);h&&e.remove(h),s.set(t,a)}return{get:function(t,e){return!0===r[e.id]||(e.addEventListener("dispose",o),r[e.id]=!0,i.memory.geometries++),e},update:function(t){const i=t.attributes;for(const t in i)e.update(i[t],34962);const n=t.morphAttributes;for(const t in n){const i=n[t];for(let t=0,n=i.length;t0)return t;const r=e*i;let s=Qs[r];if(void 0===s&&(s=new Float32Array(r),Qs[r]=s),0!==e){n.toArray(s,0);for(let n=1,r=0;n!==e;++n)r+=i,t[n].toArray(s,r)}return s}function ro(t,e){if(t.length!==e.length)return!1;for(let i=0,n=t.length;i/gm;function ea(t){return t.replace(ta,ia)}function ia(t,e){const i=Ps[e];if(void 0===i)throw new Error("Can not resolve #include <"+e+">");return ea(i)}const na=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,ra=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function sa(t){return t.replace(ra,aa).replace(na,oa)}function oa(t,e,i,n){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),aa(t,e,i,n)}function aa(t,e,i,n){let r="";for(let t=parseInt(e);t0?t.gammaFactor:1,g=i.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Jo).join("\n")}(i),v=function(t){const e=[];for(const i in t){const n=t[i];!1!==n&&e.push("#define "+i+" "+n)}return e.join("\n")}(s),y=r.createProgram();let x,b,w=i.glslVersion?"#version "+i.glslVersion+"\n":"";i.isRawShaderMaterial?(x=[v].filter(Jo).join("\n"),x.length>0&&(x+="\n"),b=[g,v].filter(Jo).join("\n"),b.length>0&&(b+="\n")):(x=[ha(i),"#define SHADER_NAME "+i.shaderName,v,i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+m,"#define MAX_BONES "+i.maxBones,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+c:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.displacementMap&&i.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.useVertexTexture?"#define BONE_TEXTURE":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&!1===i.flatShading?"#define USE_MORPHNORMALS":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+h:"",i.sizeAttenuation?"#define USE_SIZEATTENUATION":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","\tattribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","\tattribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Jo).join("\n"),b=[g,ha(i),"#define SHADER_NAME "+i.shaderName,v,i.alphaTest?"#define ALPHATEST "+i.alphaTest+(i.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+m,i.useFog&&i.fog?"#define USE_FOG":"",i.useFog&&i.fogExp2?"#define FOG_EXP2":"",i.map?"#define USE_MAP":"",i.matcap?"#define USE_MATCAP":"",i.envMap?"#define USE_ENVMAP":"",i.envMap?"#define "+l:"",i.envMap?"#define "+c:"",i.envMap?"#define "+f:"",i.lightMap?"#define USE_LIGHTMAP":"",i.aoMap?"#define USE_AOMAP":"",i.emissiveMap?"#define USE_EMISSIVEMAP":"",i.bumpMap?"#define USE_BUMPMAP":"",i.normalMap?"#define USE_NORMALMAP":"",i.normalMap&&i.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",i.normalMap&&i.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.sheen?"#define USE_SHEEN":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.gradientMap?"#define USE_GRADIENTMAP":"",i.flatShading?"#define FLAT_SHADED":"",i.doubleSided?"#define DOUBLE_SIDED":"",i.flipSided?"#define FLIP_SIDED":"",i.shadowMapEnabled?"#define USE_SHADOWMAP":"",i.shadowMapEnabled?"#define "+h:"",i.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",i.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",i.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",i.logarithmicDepthBuffer&&i.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(i.extensionShaderTextureLOD||i.envMap)&&i.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",i.toneMapping!==Q?"#define TONE_MAPPING":"",i.toneMapping!==Q?Ps.tonemapping_pars_fragment:"",i.toneMapping!==Q?Ko("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",Ps.encodings_pars_fragment,i.map?qo("mapTexelToLinear",i.mapEncoding):"",i.matcap?qo("matcapTexelToLinear",i.matcapEncoding):"",i.envMap?qo("envMapTexelToLinear",i.envMapEncoding):"",i.emissiveMap?qo("emissiveMapTexelToLinear",i.emissiveMapEncoding):"",i.lightMap?qo("lightMapTexelToLinear",i.lightMapEncoding):"",Zo("linearToOutputTexel",i.outputEncoding),i.depthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(Jo).join("\n")),o=ea(o),o=Qo(o,i),o=$o(o,i),a=ea(a),a=Qo(a,i),a=$o(a,i),o=sa(o),a=sa(a),i.isWebGL2&&!0!==i.isRawShaderMaterial&&(w="#version 300 es\n",x=["#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+x,b=["#define varying in",i.glslVersion===Ii?"":"out highp vec4 pc_fragColor;",i.glslVersion===Ii?"":"#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"+b);const T=w+b+a,_=Wo(r,35633,w+x+o),E=Wo(r,35632,T);if(r.attachShader(y,_),r.attachShader(y,E),void 0!==i.index0AttributeName?r.bindAttribLocation(y,0,i.index0AttributeName):!0===i.morphTargets&&r.bindAttribLocation(y,0,"position"),r.linkProgram(y),t.debug.checkShaderErrors){const t=r.getProgramInfoLog(y).trim(),e=r.getShaderInfoLog(_).trim(),i=r.getShaderInfoLog(E).trim();let n=!0,s=!0;if(!1===r.getProgramParameter(y,35714)){n=!1;const e=Yo(r,_,"vertex"),i=Yo(r,E,"fragment");console.error("THREE.WebGLProgram: shader error: ",r.getError(),"35715",r.getProgramParameter(y,35715),"gl.getProgramInfoLog",t,e,i)}else""!==t?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",t):""!==e&&""!==i||(s=!1);s&&(this.diagnostics={runnable:n,programLog:t,vertexShader:{log:e,prefix:x},fragmentShader:{log:i,prefix:b}})}let S,M;return r.deleteShader(_),r.deleteShader(E),this.getUniforms=function(){return void 0===S&&(S=new Ho(r,y)),S},this.getAttributes=function(){return void 0===M&&(M=function(t,e){const i={},n=t.getProgramParameter(e,35721);for(let r=0;r0,maxBones:E,useVertexTexture:l,morphTargets:r.morphTargets,morphNormals:r.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:o.directional.length,numPointLights:o.point.length,numSpotLights:o.spot.length,numRectAreaLights:o.rectArea.length,numHemiLights:o.hemi.length,numDirLightShadows:o.directionalShadowMap.length,numPointLightShadows:o.pointShadowMap.length,numSpotLightShadows:o.spotShadowMap.length,numClippingPlanes:s.numPlanes,numClipIntersection:s.numIntersection,dithering:r.dithering,shadowMapEnabled:t.shadowMap.enabled&&f.length>0,shadowMapType:t.shadowMap.type,toneMapping:r.toneMapped?t.toneMapping:Q,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:r.premultipliedAlpha,alphaTest:r.alphaTest,doubleSided:r.side===g,flipSided:r.side===m,depthPacking:void 0!==r.depthPacking&&r.depthPacking,index0AttributeName:r.index0AttributeName,extensionDerivatives:r.extensions&&r.extensions.derivatives,extensionFragDepth:r.extensions&&r.extensions.fragDepth,extensionDrawBuffers:r.extensions&&r.extensions.drawBuffers,extensionShaderTextureLOD:r.extensions&&r.extensions.shaderTextureLOD,rendererExtensionFragDepth:a||i.has("EXT_frag_depth"),rendererExtensionDrawBuffers:a||i.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:a||i.has("EXT_shader_texture_lod"),customProgramCacheKey:r.customProgramCacheKey()}},getProgramCacheKey:function(e){const i=[];if(e.shaderID?i.push(e.shaderID):(i.push(e.fragmentShader),i.push(e.vertexShader)),void 0!==e.defines)for(const t in e.defines)i.push(t),i.push(e.defines[t]);if(!1===e.isRawShaderMaterial){for(let t=0;t1&&n.sort(t||da),r.length>1&&r.sort(e||pa)}}}function ma(t){let e=new WeakMap;return{get:function(i,n){const r=e.get(i);let s;return void 0===r?(s=new fa(t),e.set(i,new WeakMap),e.get(i).set(n,s)):(s=r.get(n),void 0===s&&(s=new fa(t),r.set(n,s))),s},dispose:function(){e=new WeakMap}}}function ga(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let i;switch(e.type){case"DirectionalLight":i={direction:new Ki,color:new yr};break;case"SpotLight":i={position:new Ki,direction:new Ki,color:new yr,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new Ki,color:new yr,distance:0,decay:0};break;case"HemisphereLight":i={direction:new Ki,skyColor:new yr,groundColor:new yr};break;case"RectAreaLight":i={color:new yr,position:new Ki,halfWidth:new Ki,halfHeight:new Ki}}return t[e.id]=i,i}}}let va=0;function ya(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function xa(t,e){const i=new ga,n=function(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let i;switch(e.type){case"DirectionalLight":case"SpotLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ui};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ui,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=i,i}}}(),r={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let t=0;t<9;t++)r.probe.push(new Ki);const s=new Ki,o=new Sn,a=new Sn;return{setup:function(s){let o=0,a=0,h=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let l=0,c=0,u=0,d=0,p=0,f=0,m=0,g=0;s.sort(ya);for(let t=0,e=s.length;t0&&(e.isWebGL2||!0===t.has("OES_texture_float_linear")?(r.rectAreaLTC1=Rs.LTC_FLOAT_1,r.rectAreaLTC2=Rs.LTC_FLOAT_2):!0===t.has("OES_texture_half_float_linear")?(r.rectAreaLTC1=Rs.LTC_HALF_1,r.rectAreaLTC2=Rs.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),r.ambient[0]=o,r.ambient[1]=a,r.ambient[2]=h;const v=r.hash;v.directionalLength===l&&v.pointLength===c&&v.spotLength===u&&v.rectAreaLength===d&&v.hemiLength===p&&v.numDirectionalShadows===f&&v.numPointShadows===m&&v.numSpotShadows===g||(r.directional.length=l,r.spot.length=u,r.rectArea.length=d,r.point.length=c,r.hemi.length=p,r.directionalShadow.length=f,r.directionalShadowMap.length=f,r.pointShadow.length=m,r.pointShadowMap.length=m,r.spotShadow.length=g,r.spotShadowMap.length=g,r.directionalShadowMatrix.length=f,r.pointShadowMatrix.length=m,r.spotShadowMatrix.length=g,v.directionalLength=l,v.pointLength=c,v.spotLength=u,v.rectAreaLength=d,v.hemiLength=p,v.numDirectionalShadows=f,v.numPointShadows=m,v.numSpotShadows=g,r.version=va++)},setupView:function(t,e){let i=0,n=0,h=0,l=0,c=0;const u=e.matrixWorldInverse;for(let e=0,d=t.length;e=i.get(n).length?(s=new ba(t,e),i.get(n).push(s)):s=i.get(n)[r],s},dispose:function(){i=new WeakMap}}}function Ta(t){wr.call(this),this.type="MeshDepthMaterial",this.depthPacking=ri,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(t)}function _a(t){wr.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Ki,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}Ta.prototype=Object.create(wr.prototype),Ta.prototype.constructor=Ta,Ta.prototype.isMeshDepthMaterial=!0,Ta.prototype.copy=function(t){return wr.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},_a.prototype=Object.create(wr.prototype),_a.prototype.constructor=_a,_a.prototype.isMeshDistanceMaterial=!0,_a.prototype.copy=function(t){return wr.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};function Ea(t,e,i){let n=new Ss;const r=new Ui,s=new Ui,o=new ji,a=[],h=[],l={},c={0:m,1:f,2:g},d=new gs({defines:{SAMPLE_RATE:2/8,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ui},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include \nvoid main() {\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n\tfor ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean * HALF_SAMPLE_RATE;\n\tsquared_mean = squared_mean * HALF_SAMPLE_RATE;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),v=d.clone();v.defines.HORIZONTAL_PASS=1;const y=new jr;y.setAttribute("position",new Sr(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new cs(y,d),w=this;function T(i,n){const r=e.update(b);d.uniforms.shadow_pass.value=i.map.texture,d.uniforms.resolution.value=i.mapSize,d.uniforms.radius.value=i.radius,t.setRenderTarget(i.mapPass),t.clear(),t.renderBufferDirect(n,null,r,d,b,null),v.uniforms.shadow_pass.value=i.mapPass.texture,v.uniforms.resolution.value=i.mapSize,v.uniforms.radius.value=i.radius,t.setRenderTarget(i.map),t.clear(),t.renderBufferDirect(n,null,r,v,b,null)}function _(t,e,i){const n=t<<0|e<<1|i<<2;let r=a[n];return void 0===r&&(r=new Ta({depthPacking:si,morphTargets:t,skinning:e}),a[n]=r),r}function E(t,e,i){const n=t<<0|e<<1|i<<2;let r=h[n];return void 0===r&&(r=new _a({morphTargets:t,skinning:e}),h[n]=r),r}function S(e,i,n,r,s,o,a){let h=null,u=_,d=e.customDepthMaterial;if(!0===r.isPointLight&&(u=E,d=e.customDistanceMaterial),void 0===d){let t=!1;!0===n.morphTargets&&(t=i.morphAttributes&&i.morphAttributes.position&&i.morphAttributes.position.length>0);let r=!1;!0===e.isSkinnedMesh&&(!0===n.skinning?r=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e));h=u(t,r,!0===e.isInstancedMesh)}else h=d;if(t.localClippingEnabled&&!0===n.clipShadows&&0!==n.clippingPlanes.length){const t=h.uuid,e=n.uuid;let i=l[t];void 0===i&&(i={},l[t]=i);let r=i[e];void 0===r&&(r=h.clone(),i[e]=r),h=r}return h.visible=n.visible,h.wireframe=n.wireframe,h.side=a===p?null!==n.shadowSide?n.shadowSide:n.side:null!==n.shadowSide?n.shadowSide:c[n.side],h.clipShadows=n.clipShadows,h.clippingPlanes=n.clippingPlanes,h.clipIntersection=n.clipIntersection,h.wireframeLinewidth=n.wireframeLinewidth,h.linewidth=n.linewidth,!0===r.isPointLight&&!0===h.isMeshDistanceMaterial&&(h.referencePosition.setFromMatrixPosition(r.matrixWorld),h.nearDistance=s,h.farDistance=o),h}function M(i,r,s,o,a){if(!1===i.visible)return;if(i.layers.test(r.layers)&&(i.isMesh||i.isLine||i.isPoints)&&(i.castShadow||i.receiveShadow&&a===p)&&(!i.frustumCulled||n.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(s.matrixWorldInverse,i.matrixWorld);const n=e.update(i),r=i.material;if(Array.isArray(r)){const e=n.groups;for(let h=0,l=e.length;hi||r.y>i)&&(r.x>i&&(s.x=Math.floor(i/f.x),r.x=s.x*f.x,u.mapSize.x=s.x),r.y>i&&(s.y=Math.floor(i/f.y),r.y=s.y*f.y,u.mapSize.y=s.y)),null===u.map&&!u.isPointLightShadow&&this.type===p){const t={minFilter:xt,magFilter:xt,format:Nt};u.map=new Yi(r.x,r.y,t),u.map.texture.name=c.name+".shadowMap",u.mapPass=new Yi(r.x,r.y,t),u.camera.updateProjectionMatrix()}if(null===u.map){const t={minFilter:ft,magFilter:ft,format:Nt};u.map=new Yi(r.x,r.y,t),u.map.texture.name=c.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const m=u.getViewportCount();for(let t=0;t=1):-1!==at.indexOf("OpenGL ES")&&(ot=parseFloat(/^OpenGL ES (\d)/.exec(at)[1]),st=ot>=2);let ht=null,lt={};const ct=new ji,ut=new ji;function dt(e,i,n){const r=new Uint8Array(4),s=t.createTexture();t.bindTexture(e,s),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(let e=0;en||t.height>n)&&(r=n/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const n=e?Ni.floorPowerOfTwo:Math.floor,s=n(r*t.width),o=n(r*t.height);void 0===p&&(p=m(s,o));const a=i?m(s,o):p;a.width=s,a.height=o;return a.getContext("2d").drawImage(t,0,0,s,o),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+s+"x"+o+")."),a}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function v(t){return Ni.isPowerOfTwo(t.width)&&Ni.isPowerOfTwo(t.height)}function y(t,e){return t.generateMipmaps&&e&&t.minFilter!==ft&&t.minFilter!==xt}function x(e,i,r,s){t.generateMipmap(e);n.get(i).__maxMipLevel=Math.log(Math.max(r,s))*Math.LOG2E}function b(i,n,r){if(!1===a)return n;if(null!==i){if(void 0!==t[i])return t[i];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+i+"'")}let s=n;return 6403===n&&(5126===r&&(s=33326),5131===r&&(s=33325),5121===r&&(s=33321)),6407===n&&(5126===r&&(s=34837),5131===r&&(s=34843),5121===r&&(s=32849)),6408===n&&(5126===r&&(s=34836),5131===r&&(s=34842),5121===r&&(s=32856)),33325!==s&&33326!==s&&34842!==s&&34836!==s||e.get("EXT_color_buffer_float"),s}function w(t){return t===ft||t===mt||t===vt?9728:9729}function T(e){const i=e.target;i.removeEventListener("dispose",T),function(e){const i=n.get(e);if(void 0===i.__webglInit)return;t.deleteTexture(i.__webglTexture),n.remove(e)}(i),i.isVideoTexture&&d.delete(i),o.memory.textures--}function _(e){const i=e.target;i.removeEventListener("dispose",_),function(e){const 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.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)t.deleteFramebuffer(i.__webglFramebuffer[e]),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer[e]);else t.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer),i.__webglMultisampledFramebuffer&&t.deleteFramebuffer(i.__webglMultisampledFramebuffer),i.__webglColorRenderbuffer&&t.deleteRenderbuffer(i.__webglColorRenderbuffer),i.__webglDepthRenderbuffer&&t.deleteRenderbuffer(i.__webglDepthRenderbuffer);n.remove(e.texture),n.remove(e)}(i),o.memory.textures--}let E=0;function S(t,e){const r=n.get(t);if(t.isVideoTexture&&function(t){const e=o.render.frame;d.get(t)!==e&&(d.set(t,e),t.update())}(t),t.version>0&&r.__version!==t.version){const i=t.image;if(void 0===i)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==i.complete)return void L(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}i.activeTexture(33984+e),i.bindTexture(3553,r.__webglTexture)}function M(e,r){const o=n.get(e);e.version>0&&o.__version!==e.version?function(e,n,r){if(6!==n.image.length)return;R(e,n),i.activeTexture(33984+r),i.bindTexture(34067,e.__webglTexture),t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment);const o=n&&(n.isCompressedTexture||n.image[0].isCompressedTexture),h=n.image[0]&&n.image[0].isDataTexture,c=[];for(let t=0;t<6;t++)c[t]=o||h?h?n.image[t].image:n.image[t]:g(n.image[t],!1,!0,l);const u=c[0],d=v(u)||a,p=s.convert(n.format),f=s.convert(n.type),m=b(n.internalFormat,p,f);let w;if(P(34067,n,d),o){for(let t=0;t<6;t++){w=c[t].mipmaps;for(let e=0;e1||n.get(s).__currentAnisotropy)&&(t.texParameterf(i,h.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),n.get(s).__currentAnisotropy=s.anisotropy)}}function R(e,i){void 0===e.__webglInit&&(e.__webglInit=!0,i.addEventListener("dispose",T),e.__webglTexture=t.createTexture(),o.memory.textures++)}function L(e,n,r){let o=3553;n.isDataTexture2DArray&&(o=35866),n.isDataTexture3D&&(o=32879),R(e,n),i.activeTexture(33984+r),i.bindTexture(o,e.__webglTexture),t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment);const h=function(t){return!a&&(t.wrapS!==dt||t.wrapT!==dt||t.minFilter!==ft&&t.minFilter!==xt)}(n)&&!1===v(n.image),l=g(n.image,h,!1,c),u=v(l)||a,d=s.convert(n.format);let p,f=s.convert(n.type),m=b(n.internalFormat,d,f);P(o,n,u);const w=n.mipmaps;if(n.isDepthTexture)m=6402,a?m=n.type===Rt?36012:n.type===Pt?33190:n.type===Ft?35056:33189:n.type===Rt&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),n.format===Vt&&6402===m&&n.type!==At&&n.type!==Pt&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=At,f=s.convert(n.type)),n.format===Ht&&6402===m&&(m=34041,n.type!==Ft&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=Ft,f=s.convert(n.type))),i.texImage2D(3553,0,m,l.width,l.height,0,d,f,null);else if(n.isDataTexture)if(w.length>0&&u){for(let t=0,e=w.length;t0&&u){for(let t=0,e=w.length;t=h&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+h),E+=1,t},this.resetTextureUnits=function(){E=0},this.setTexture2D=S,this.setTexture2DArray=function(t,e){const r=n.get(t);t.version>0&&r.__version!==t.version?L(r,t,e):(i.activeTexture(33984+e),i.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(t,e){const r=n.get(t);t.version>0&&r.__version!==t.version?L(r,t,e):(i.activeTexture(33984+e),i.bindTexture(32879,r.__webglTexture))},this.setTextureCube=M,this.setupRenderTarget=function(e){const r=n.get(e),h=n.get(e.texture);e.addEventListener("dispose",_),h.__webglTexture=t.createTexture(),o.memory.textures++;const l=!0===e.isWebGLCubeRenderTarget,c=!0===e.isWebGLMultisampleRenderTarget,u=v(e)||a;if(!a||e.texture.format!==kt||e.texture.type!==Rt&&e.texture.type!==Lt||(e.texture.format=Nt,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),l){r.__webglFramebuffer=[];for(let e=0;e<6;e++)r.__webglFramebuffer[e]=t.createFramebuffer()}else if(r.__webglFramebuffer=t.createFramebuffer(),c)if(a){r.__webglMultisampledFramebuffer=t.createFramebuffer(),r.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,r.__webglColorRenderbuffer);const i=s.convert(e.texture.format),n=s.convert(e.texture.type),o=b(e.texture.internalFormat,i,n),a=F(e);t.renderbufferStorageMultisample(36161,a,o,e.width,e.height),t.bindFramebuffer(36160,r.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,r.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(r.__webglDepthRenderbuffer=t.createRenderbuffer(),D(r.__webglDepthRenderbuffer,e,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(l){i.bindTexture(34067,h.__webglTexture),P(34067,e.texture,u);for(let t=0;t<6;t++)O(r.__webglFramebuffer[t],e,36064,34069+t);y(e.texture,u)&&x(34067,e.texture,e.width,e.height),i.bindTexture(34067,null)}else i.bindTexture(3553,h.__webglTexture),P(3553,e.texture,u),O(r.__webglFramebuffer,e,36064,3553),y(e.texture,u)&&x(3553,e.texture,e.width,e.height),i.bindTexture(3553,null);e.depthBuffer&&I(e)},this.updateRenderTargetMipmap=function(t){const e=t.texture;if(y(e,v(t)||a)){const r=t.isWebGLCubeRenderTarget?34067:3553,s=n.get(e).__webglTexture;i.bindTexture(r,s),x(r,e,t.width,t.height),i.bindTexture(r,null)}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget)if(a){const i=n.get(e);t.bindFramebuffer(36008,i.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,i.__webglFramebuffer);const r=e.width,s=e.height;let o=16384;e.depthBuffer&&(o|=256),e.stencilBuffer&&(o|=1024),t.blitFramebuffer(0,0,r,s,0,0,r,s,o,9728),t.bindFramebuffer(36160,i.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===B&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),B=!0),t=t.texture),S(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===k&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),k=!0),t=t.texture),M(t,e)}}function Aa(t,e,i){const n=i.isWebGL2;return{convert:function(t){let i;if(t===Et)return 5121;if(t===Ot)return 32819;if(t===Dt)return 32820;if(t===It)return 33635;if(t===St)return 5120;if(t===Mt)return 5122;if(t===At)return 5123;if(t===Ct)return 5124;if(t===Pt)return 5125;if(t===Rt)return 5126;if(t===Lt)return n?5131:(i=e.get("OES_texture_half_float"),null!==i?i.HALF_FLOAT_OES:null);if(t===Bt)return 6406;if(t===kt)return 6407;if(t===Nt)return 6408;if(t===Ut)return 6409;if(t===zt)return 6410;if(t===Vt)return 6402;if(t===Ht)return 34041;if(t===Wt)return 6403;if(t===Xt)return 36244;if(t===jt)return 33319;if(t===Yt)return 33320;if(t===qt)return 36248;if(t===Zt)return 36249;if(t===Kt||t===Jt||t===Qt||t===$t){if(i=e.get("WEBGL_compressed_texture_s3tc"),null===i)return null;if(t===Kt)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===Jt)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===Qt)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===$t)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t===te||t===ee||t===ie||t===ne){if(i=e.get("WEBGL_compressed_texture_pvrtc"),null===i)return null;if(t===te)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===ee)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===ie)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===ne)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===re)return i=e.get("WEBGL_compressed_texture_etc1"),null!==i?i.COMPRESSED_RGB_ETC1_WEBGL:null;if((t===se||t===oe)&&(i=e.get("WEBGL_compressed_texture_etc"),null!==i)){if(t===se)return i.COMPRESSED_RGB8_ETC2;if(t===oe)return i.COMPRESSED_RGBA8_ETC2_EAC}return t===ae||t===he||t===le||t===ce||t===ue||t===de||t===pe||t===fe||t===me||t===ge||t===ve||t===ye||t===xe||t===be||t===Te||t===_e||t===Ee||t===Se||t===Me||t===Ae||t===Ce||t===Pe||t===Re||t===Le||t===Oe||t===De||t===Ie||t===Fe?(i=e.get("WEBGL_compressed_texture_astc"),null!==i?t:null):t===we?(i=e.get("EXT_texture_compression_bptc"),null!==i?t:null):t===Ft?n?34042:(i=e.get("WEBGL_depth_texture"),null!==i?i.UNSIGNED_INT_24_8_WEBGL:null):void 0}}}function Ca(t=[]){ys.call(this),this.cameras=t}function Pa(){Kn.call(this),this.type="Group"}function Ra(){this._targetRay=null,this._grip=null,this._hand=null}function La(t,e){const i=this;let n=null,r=1,s=null,o="local-floor",a=null;const h=[],l=new Map,c=new ys;c.layers.enable(1),c.viewport=new ji;const u=new ys;u.layers.enable(2),u.viewport=new ji;const d=[c,u],p=new Ca;p.layers.enable(1),p.layers.enable(2);let f=null,m=null;function g(t){const e=l.get(t.inputSource);e&&e.dispatchEvent({type:t.type,data:t.inputSource})}function v(){l.forEach((function(t,e){t.disconnect(e)})),l.clear(),f=null,m=null,t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),_.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}function y(t){const e=n.inputSources;for(let t=0;t0&&wt(s,t,e),o.length>0&&wt(o,t,e),!0===t.isScene&&t.onAfterRender(f,t,e),null!==x&&(j.updateRenderTargetMipmap(x),j.updateMultisampleRenderTarget(x)),H.buffers.depth.setTest(!0),H.buffers.depth.setMask(!0),H.buffers.color.setMask(!0),H.setPolygonOffset(!1),p.pop(),d=p.length>0?p[p.length-1]:null,u=null},this.setFramebuffer=function(t){g!==t&&null===x&<.bindFramebuffer(36160,t),g=t},this.getActiveCubeFace=function(){return v},this.getActiveMipmapLevel=function(){return y},this.getRenderList=function(){return u},this.setRenderList=function(t){u=t},this.getRenderTarget=function(){return x},this.setRenderTarget=function(t,e=0,i=0){x=t,v=e,y=i,t&&void 0===X.get(t).__webglFramebuffer&&j.setupRenderTarget(t);let n=g,r=!1;if(t){const i=X.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(n=i[e],r=!0):n=t.isWebGLMultisampleRenderTarget?X.get(t).__webglMultisampledFramebuffer:i,_.copy(t.viewport),E.copy(t.scissor),S=t.scissorTest}else _.copy(L).multiplyScalar(C).floor(),E.copy(O).multiplyScalar(C).floor(),S=D;if(b!==n&&(lt.bindFramebuffer(36160,n),b=n),H.viewport(_),H.scissor(E),H.setScissorTest(S),r){const n=X.get(t.texture);lt.framebufferTexture2D(36160,36064,34069+e,n.__webglTexture,i)}},this.readRenderTargetPixels=function(t,e,i,n,r,s,o){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=X.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==o&&(a=a[o]),a){let o=!1;a!==b&&(lt.bindFramebuffer(36160,a),o=!0);try{const a=t.texture,h=a.format,l=a.type;if(h!==Nt&&at.convert(h)!==lt.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");const c=l===Lt&&(G.has("EXT_color_buffer_half_float")||V.isWebGL2&&G.has("EXT_color_buffer_float"));if(!(l===Et||at.convert(l)===lt.getParameter(35738)||l===Rt&&(V.isWebGL2||G.has("OES_texture_float")||G.has("WEBGL_color_buffer_float"))||c))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===lt.checkFramebufferStatus(36160)?e>=0&&e<=t.width-n&&i>=0&&i<=t.height-r&<.readPixels(e,i,n,r,at.convert(h),at.convert(l),s):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{o&<.bindFramebuffer(36160,b)}}},this.copyFramebufferToTexture=function(t,e,i=0){const n=Math.pow(2,-i),r=Math.floor(e.image.width*n),s=Math.floor(e.image.height*n),o=at.convert(e.format);j.setTexture2D(e,0),lt.copyTexImage2D(3553,i,o,t.x,t.y,r,s,0),H.unbindTexture()},this.copyTextureToTexture=function(t,e,i,n=0){const r=e.image.width,s=e.image.height,o=at.convert(i.format),a=at.convert(i.type);j.setTexture2D(i,0),lt.pixelStorei(37440,i.flipY),lt.pixelStorei(37441,i.premultiplyAlpha),lt.pixelStorei(3317,i.unpackAlignment),e.isDataTexture?lt.texSubImage2D(3553,n,t.x,t.y,r,s,o,a,e.image.data):e.isCompressedTexture?lt.compressedTexSubImage2D(3553,n,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,o,e.mipmaps[0].data):lt.texSubImage2D(3553,n,t.x,t.y,o,a,e.image),0===n&&i.generateMipmaps&<.generateMipmap(3553),H.unbindTexture()},this.initTexture=function(t){j.setTexture2D(t,0),H.unbindTexture()},this.resetState=function(){H.reset(),ht.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function Ia(t){Da.call(this,t)}Ca.prototype=Object.assign(Object.create(ys.prototype),{constructor:Ca,isArrayCamera:!0}),Pa.prototype=Object.assign(Object.create(Kn.prototype),{constructor:Pa,isGroup:!0}),Object.assign(Ra.prototype,{constructor:Ra,getHandSpace:function(){return null===this._hand&&(this._hand=new Pa,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new Pa,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new Pa,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this},disconnect:function(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},update:function(t,e,i){let n=null,r=null,s=null;const o=this._targetRay,a=this._grip,h=this._hand;if(t&&"visible-blurred"!==e.session.visibilityState)if(h&&t.hand){s=!0;for(const n of t.hand.values()){const t=e.getJointPose(n,i);if(void 0===h.joints[n.jointName]){const t=new Pa;t.matrixAutoUpdate=!1,t.visible=!1,h.joints[n.jointName]=t,h.add(t)}const r=h.joints[n.jointName];null!==t&&(r.matrix.fromArray(t.transform.matrix),r.matrix.decompose(r.position,r.rotation,r.scale),r.jointRadius=t.radius),r.visible=null!==t}const n=h.joints["index-finger-tip"],r=h.joints["thumb-tip"],o=n.position.distanceTo(r.position),a=.02,l=.005;h.inputState.pinching&&o>a+l?(h.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!h.inputState.pinching&&o<=a-l&&(h.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}else null!==o&&(n=e.getPose(t.targetRaySpace,i),null!==n&&(o.matrix.fromArray(n.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale))),null!==a&&t.gripSpace&&(r=e.getPose(t.gripSpace,i),null!==r&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale)));return null!==o&&(o.visible=null!==n),null!==a&&(a.visible=null!==r),null!==h&&(h.visible=null!==s),this}}),Object.assign(La.prototype,Fi.prototype),Ia.prototype=Object.assign(Object.create(Da.prototype),{constructor:Ia,isWebGL1Renderer:!0});class Fa{constructor(t,e){Object.defineProperty(this,"isFogExp2",{value:!0}),this.name="",this.color=new yr(t),this.density=void 0!==e?e:25e-5}clone(){return new Fa(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class Ba{constructor(t,e,i){Object.defineProperty(this,"isFog",{value:!0}),this.name="",this.color=new yr(t),this.near=void 0!==e?e:1,this.far=void 0!==i?i:1e3}clone(){return new Ba(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class ka extends Kn{constructor(){super(),Object.defineProperty(this,"isScene",{value:!0}),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(t,e){return super.copy(t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this}toJSON(t){const e=super.toJSON(t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.environment&&(e.object.environment=this.environment.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}function Na(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=Ei,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=Ni.generateUUID()}Object.defineProperty(Na.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Na.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},copyAt:function(t,e,i){t*=this.stride,i*=e.stride;for(let n=0,r=this.stride;nt.far||e.push({distance:a,point:Ha.clone(),uv:ur.getUV(Ha,Za,Ka,Ja,Qa,$a,th,new Ui),face:null,object:this})},copy:function(t){return Kn.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}});const nh=new Ki,rh=new Ki;function sh(){Kn.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}sh.prototype=Object.assign(Object.create(Kn.prototype),{constructor:sh,isLOD:!0,copy:function(t){Kn.prototype.copy.call(this,t,!1);const e=t.levels;for(let t=0,i=e.length;t0){let i,n;for(i=1,n=e.length;i0){nh.setFromMatrixPosition(this.matrixWorld);const i=t.ray.origin.distanceTo(nh);this.getObjectForDistance(i).raycast(t,e)}},update:function(t){const e=this.levels;if(e.length>1){nh.setFromMatrixPosition(t.matrixWorld),rh.setFromMatrixPosition(this.matrixWorld);const i=nh.distanceTo(rh)/t.zoom;let n,r;for(e[0].object.visible=!0,n=1,r=e.length;n=e[n].distance;n++)e[n-1].object.visible=!1,e[n].object.visible=!0;for(this._currentLevel=n-1;no)continue;c.applyMatrix4(this.matrixWorld);const d=t.ray.origin.distanceTo(c);dt.far||e.push({distance:d,point:l.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else for(let i=0,n=r.count-1;io)continue;c.applyMatrix4(this.matrixWorld);const n=t.ray.origin.distanceTo(c);nt.far||e.push({distance:n,point:l.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else i.isGeometry&&console.error("THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")},updateMorphTargets:function(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,i=Object.keys(e);if(i.length>0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});const Ch=new Ki,Ph=new Ki;function Rh(t,e){Ah.call(this,t,e),this.type="LineSegments"}function Lh(t,e){Ah.call(this,t,e),this.type="LineLoop"}function Oh(t){wr.call(this),this.type="PointsMaterial",this.color=new yr(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}Rh.prototype=Object.assign(Object.create(Ah.prototype),{constructor:Rh,isLineSegments:!0,computeLineDistances:function(){const t=this.geometry;if(t.isBufferGeometry)if(null===t.index){const e=t.attributes.position,i=[];for(let t=0,n=e.count;tr.far)return;s.push({distance:h,distanceToRay:Math.sqrt(a),point:i,index:e,face:null,object:o})}}function Uh(t,e,i,n,r,s,o,a,h){Wi.call(this,t,e,i,n,r,s,o,a,h),this.format=void 0!==o?o:kt,this.minFilter=void 0!==s?s:xt,this.magFilter=void 0!==r?r:xt,this.generateMipmaps=!1;const l=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback((function e(){l.needsUpdate=!0,t.requestVideoFrameCallback(e)}))}function zh(t,e,i,n,r,s,o,a,h,l,c,u){Wi.call(this,null,s,o,a,h,l,n,r,c,u),this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function Gh(t,e,i,n,r,s,o,a,h){Wi.call(this,t,e,i,n,r,s,o,a,h),this.needsUpdate=!0}function Vh(t,e,i,n,r,s,o,a,h,l){if((l=void 0!==l?l:Vt)!==Vt&&l!==Ht)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&l===Vt&&(i=At),void 0===i&&l===Ht&&(i=Ft),Wi.call(this,null,n,r,s,o,a,l,i,h),this.image={width:t,height:e},this.magFilter=void 0!==o?o:ft,this.minFilter=void 0!==a?a:ft,this.flipY=!1,this.generateMipmaps=!1}kh.prototype=Object.assign(Object.create(Kn.prototype),{constructor:kh,isPoints:!0,copy:function(t){return Kn.prototype.copy.call(this,t),this.material=t.material,this.geometry=t.geometry,this},raycast:function(t,e){const i=this.geometry,n=this.matrixWorld,r=t.params.Points.threshold;if(null===i.boundingSphere&&i.computeBoundingSphere(),Fh.copy(i.boundingSphere),Fh.applyMatrix4(n),Fh.radius+=r,!1===t.ray.intersectsSphere(Fh))return;Dh.copy(n).invert(),Ih.copy(t.ray).applyMatrix4(Dh);const s=r/((this.scale.x+this.scale.y+this.scale.z)/3),o=s*s;if(i.isBufferGeometry){const r=i.index,s=i.attributes.position;if(null!==r){const i=r.array;for(let r=0,a=i.length;r0){const t=e[i[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,i=t.length;e0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),Uh.prototype=Object.assign(Object.create(Wi.prototype),{constructor:Uh,clone:function(){return new this.constructor(this.image).copy(this)},isVideoTexture:!0,update:function(){const t=this.image;!1==="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),zh.prototype=Object.create(Wi.prototype),zh.prototype.constructor=zh,zh.prototype.isCompressedTexture=!0,Gh.prototype=Object.create(Wi.prototype),Gh.prototype.constructor=Gh,Gh.prototype.isCanvasTexture=!0,Vh.prototype=Object.create(Wi.prototype),Vh.prototype.constructor=Vh,Vh.prototype.isDepthTexture=!0;class Hh extends jr{constructor(t=1,e=8,i=0,n=2*Math.PI){super(),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:n},e=Math.max(3,e);const r=[],s=[],o=[],a=[],h=new Ki,l=new Ui;s.push(0,0,0),o.push(0,0,1),a.push(.5,.5);for(let r=0,c=3;r<=e;r++,c+=3){const u=i+r/e*n;h.x=t*Math.cos(u),h.y=t*Math.sin(u),s.push(h.x,h.y,h.z),o.push(0,0,1),l.x=(s[c]/t+1)/2,l.y=(s[c+1]/t+1)/2,a.push(l.x,l.y)}for(let t=1;t<=e;t++)r.push(t,t+1,0);this.setIndex(r),this.setAttribute("position",new Ir(s,3)),this.setAttribute("normal",new Ir(o,3)),this.setAttribute("uv",new Ir(a,2))}}class Wh extends jr{constructor(t=1,e=1,i=1,n=8,r=1,s=!1,o=0,a=2*Math.PI){super(),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:n,heightSegments:r,openEnded:s,thetaStart:o,thetaLength:a};const h=this;n=Math.floor(n),r=Math.floor(r);const l=[],c=[],u=[],d=[];let p=0;const f=[],m=i/2;let g=0;function v(i){const r=p,s=new Ui,f=new Ki;let v=0;const y=!0===i?t:e,x=!0===i?1:-1;for(let t=1;t<=n;t++)c.push(0,m*x,0),u.push(0,x,0),d.push(.5,.5),p++;const b=p;for(let t=0;t<=n;t++){const e=t/n*a+o,i=Math.cos(e),r=Math.sin(e);f.x=y*r,f.y=m*x,f.z=y*i,c.push(f.x,f.y,f.z),u.push(0,x,0),s.x=.5*i+.5,s.y=.5*r*x+.5,d.push(s.x,s.y),p++}for(let t=0;t0&&v(!0),e>0&&v(!1)),this.setIndex(l),this.setAttribute("position",new Ir(c,3)),this.setAttribute("normal",new Ir(u,3)),this.setAttribute("uv",new Ir(d,2))}}class Xh extends Wh{constructor(t=1,e=1,i=8,n=1,r=!1,s=0,o=2*Math.PI){super(0,t,e,i,n,r,s,o),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:s,thetaLength:o}}}class jh extends jr{constructor(t,e,i=1,n=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:i,detail:n};const r=[],s=[];function o(t,e,i,n){const r=n+1,s=[];for(let n=0;n<=r;n++){s[n]=[];const o=t.clone().lerp(i,n/r),a=e.clone().lerp(i,n/r),h=r-n;for(let t=0;t<=h;t++)s[n][t]=0===t&&n===r?o:o.clone().lerp(a,t/h)}for(let t=0;t.9&&o<.1&&(e<.2&&(s[t+0]+=1),i<.2&&(s[t+2]+=1),n<.2&&(s[t+4]+=1))}}()}(),this.setAttribute("position",new Ir(r,3)),this.setAttribute("normal",new Ir(r.slice(),3)),this.setAttribute("uv",new Ir(s,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}}class Yh extends jh{constructor(t=1,e=0){const i=(1+Math.sqrt(5))/2,n=1/i;super([-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],[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="DodecahedronGeometry",this.parameters={radius:t,detail:e}}}const qh=new Ki,Zh=new Ki,Kh=new Ki,Jh=new ur;class Qh extends jr{constructor(t,e){if(super(),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1,!0===t.isGeometry)return void console.error("THREE.EdgesGeometry no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.");const i=Math.pow(10,4),n=Math.cos(Ni.DEG2RAD*e),r=t.getIndex(),s=t.getAttribute("position"),o=r?r.count:s.count,a=[0,0,0],h=["a","b","c"],l=new Array(3),c={},u=[];for(let t=0;t80*i){a=l=t[0],h=c=t[1];for(let e=i;el&&(l=u),d>c&&(c=d);p=Math.max(l-a,c-h),p=0!==p?1/p:0}return il(s,o,i,a,h,p),o};function tl(t,e,i,n,r){let s,o;if(r===function(t,e,i,n){let r=0;for(let s=e,o=i-n;s0)for(s=e;s=e;s-=n)o=wl(s,t[s],t[s+1],o);return o&&ml(o,o.next)&&(Tl(o),o=o.next),o}function el(t,e){if(!t)return t;e||(e=t);let i,n=t;do{if(i=!1,n.steiner||!ml(n,n.next)&&0!==fl(n.prev,n,n.next))n=n.next;else{if(Tl(n),n=e=n.prev,n===n.next)break;i=!0}}while(i||n!==e);return e}function il(t,e,i,n,r,s,o){if(!t)return;!o&&s&&function(t,e,i,n){let r=t;do{null===r.z&&(r.z=cl(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){let e,i,n,r,s,o,a,h,l=1;do{for(i=t,t=null,s=null,o=0;i;){for(o++,n=i,a=0,e=0;e0||h>0&&n;)0!==a&&(0===h||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,h--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=n}s.nextZ=null,l*=2}while(o>1)}(r)}(t,n,r,s);let a,h,l=t;for(;t.prev!==t.next;)if(a=t.prev,h=t.next,s?rl(t,n,r,s):nl(t))e.push(a.i/i),e.push(t.i/i),e.push(h.i/i),Tl(t),t=h.next,l=h.next;else if((t=h)===l){o?1===o?il(t=sl(el(t),e,i),e,i,n,r,s,2):2===o&&ol(t,e,i,n,r,s):il(el(t),e,i,n,r,s,1);break}}function nl(t){const e=t.prev,i=t,n=t.next;if(fl(e,i,n)>=0)return!1;let r=t.next.next;for(;r!==t.prev;){if(dl(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&fl(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function rl(t,e,i,n){const r=t.prev,s=t,o=t.next;if(fl(r,s,o)>=0)return!1;const a=r.xs.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,c=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,u=cl(a,h,e,i,n),d=cl(l,c,e,i,n);let p=t.prevZ,f=t.nextZ;for(;p&&p.z>=u&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&dl(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&fl(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&dl(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&fl(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=u;){if(p!==t.prev&&p!==t.next&&dl(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&fl(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&dl(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&fl(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function sl(t,e,i){let n=t;do{const r=n.prev,s=n.next.next;!ml(r,s)&&gl(r,n,n.next,s)&&xl(r,s)&&xl(s,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(s.i/i),Tl(n),Tl(n.next),n=t=s),n=n.next}while(n!==t);return el(n)}function ol(t,e,i,n,r,s){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&pl(o,t)){let a=bl(o,t);return o=el(o,o.next),a=el(a,a.next),il(o,e,i,n,r,s),void il(a,e,i,n,r,s)}t=t.next}o=o.next}while(o!==t)}function al(t,e){return t.x-e.x}function hl(t,e){if(e=function(t,e){let i=e;const n=t.x,r=t.y;let s,o=-1/0;do{if(r<=i.y&&r>=i.next.y&&i.next.y!==i.y){const t=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=n&&t>o){if(o=t,t===n){if(r===i.y)return i;if(r===i.next.y)return i.next}s=i.x=i.x&&i.x>=h&&n!==i.x&&dl(rs.x||i.x===s.x&&ll(s,i)))&&(s=i,u=c)),i=i.next}while(i!==a);return s}(t,e)){const i=bl(e,t);el(e,e.next),el(i,i.next)}}function ll(t,e){return fl(t.prev,t,e.prev)<0&&fl(e.next,t,t.next)<0}function cl(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 ul(t){let e=t,i=t;do{(e.x=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(s-a)-(r-o)*(n-a)>=0}function pl(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&gl(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(xl(t,e)&&xl(e,t)&&function(t,e){let i=t,n=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(fl(t.prev,t,e.prev)||fl(t,e.prev,e))||ml(t,e)&&fl(t.prev,t,t.next)>0&&fl(e.prev,e,e.next)>0)}function fl(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function ml(t,e){return t.x===e.x&&t.y===e.y}function gl(t,e,i,n){const r=yl(fl(t,e,i)),s=yl(fl(t,e,n)),o=yl(fl(i,n,t)),a=yl(fl(i,n,e));return r!==s&&o!==a||(!(0!==r||!vl(t,i,e))||(!(0!==s||!vl(t,n,e))||(!(0!==o||!vl(i,t,n))||!(0!==a||!vl(i,e,n)))))}function vl(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function yl(t){return t>0?1:t<0?-1:0}function xl(t,e){return fl(t.prev,t,t.next)<0?fl(t,e,t.next)>=0&&fl(t,t.prev,e)>=0:fl(t,e,t.prev)<0||fl(t,t.next,e)<0}function bl(t,e){const i=new _l(t.i,t.x,t.y),n=new _l(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function wl(t,e,i,n){const r=new _l(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 Tl(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 _l(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}const El={area:function(t){const e=t.length;let i=0;for(let n=e-1,r=0;r2&&t[e-1].equals(t[0])&&t.pop()}function Ml(t,e){for(let i=0;iNumber.EPSILON){const u=Math.sqrt(c),d=Math.sqrt(h*h+l*l),p=e.x-a/u,f=e.y+o/u,m=((i.x-l/d-p)*l-(i.y+h/d-f)*h)/(o*l-a*h);n=p+o*m-t.x,r=f+a*m-t.y;const g=n*n+r*r;if(g<=2)return new Ui(n,r);s=Math.sqrt(g/2)}else{let t=!1;o>Number.EPSILON?h>Number.EPSILON&&(t=!0):o<-Number.EPSILON?h<-Number.EPSILON&&(t=!0):Math.sign(a)===Math.sign(l)&&(t=!0),t?(n=-a,r=o,s=Math.sqrt(c)):(n=o,r=a,s=Math.sqrt(c/2))}return new Ui(n/s,r/s)}const L=[];for(let t=0,e=M.length,i=e-1,n=t+1;t=0;t--){const e=t/p,i=c*Math.cos(e*Math.PI/2),n=u*Math.sin(e*Math.PI/2)+d;for(let t=0,e=M.length;t=0;){const n=i;let r=i-1;r<0&&(r=t.length-1);for(let t=0,i=a+2*p;t=0?(t(n-a,p,c),u.subVectors(l,c)):(t(n+a,p,c),u.subVectors(c,l)),p-a>=0?(t(n,p-a,c),d.subVectors(l,c)):(t(n,p+a,c),d.subVectors(c,l)),h.crossVectors(u,d).normalize(),s.push(h.x,h.y,h.z),o.push(n,p)}}for(let t=0;t0)&&d.push(e,r,h),(t!==i-1||a=n)){h.push(e.times[t]);for(let i=0;is.tracks[t].times[0]&&(a=s.tracks[t].times[0]);for(let t=0;t=n.times[u]){const t=u*h+a,e=t+h-a;d=tc.arraySlice(n.values,t,e)}else{const t=n.createInterpolant(),e=a,i=h-a;t.evaluate(s),d=tc.arraySlice(t.resultBuffer,e,i)}if("quaternion"===r){(new Zi).fromArray(d).normalize().conjugate().toArray(d)}const p=o.times.length;for(let t=0;t=r)break t;{const o=e[1];t=r)break e}s=i,i=0}}for(;i>>1;te;)--s;if(++s,0!==r||s!==n){r>=s&&(s=Math.max(s,1),r=s-1);const t=this.getValueSize();this.times=tc.arraySlice(i,r,s),this.values=tc.arraySlice(this.values,r*t,s*t)}return this},validate:function(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const i=this.times,n=this.values,r=i.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let s=null;for(let e=0;e!==r;e++){const n=i[e];if("number"==typeof n&&isNaN(n)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,e,n),t=!1;break}if(null!==s&&s>n){console.error("THREE.KeyframeTrack: Out of order keys.",this,e,n,s),t=!1;break}s=n}if(void 0!==n&&tc.isTypedArray(n))for(let e=0,i=n.length;e!==i;++e){const i=n[e];if(isNaN(i)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,e,i),t=!1;break}}return t},optimize:function(){const t=tc.arraySlice(this.times),e=tc.arraySlice(this.values),i=this.getValueSize(),n=this.getInterpolation()===Ge,r=t.length-1;let s=1;for(let o=1;o0){t[s]=t[r];for(let t=r*i,n=s*i,o=0;o!==i;++o)e[n+o]=e[t+o];++s}return s!==t.length?(this.times=tc.arraySlice(t,0,s),this.values=tc.arraySlice(e,0,s*i)):(this.times=t,this.values=e),this},clone:function(){const t=tc.arraySlice(this.times,0),e=tc.arraySlice(this.values,0),i=new(0,this.constructor)(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}),oc.prototype=Object.assign(Object.create(sc.prototype),{constructor:oc,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Ue,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),ac.prototype=Object.assign(Object.create(sc.prototype),{constructor:ac,ValueTypeName:"color"}),hc.prototype=Object.assign(Object.create(sc.prototype),{constructor:hc,ValueTypeName:"number"}),lc.prototype=Object.assign(Object.create(ec.prototype),{constructor:lc,interpolate_:function(t,e,i,n){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=(i-e)/(n-e);let h=t*o;for(let t=h+o;h!==t;h+=4)Zi.slerpFlat(r,0,s,h-o,s,h,a);return r}}),cc.prototype=Object.assign(Object.create(sc.prototype),{constructor:cc,ValueTypeName:"quaternion",DefaultInterpolation:ze,InterpolantFactoryMethodLinear:function(t){return new lc(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),uc.prototype=Object.assign(Object.create(sc.prototype),{constructor:uc,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Ue,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),dc.prototype=Object.assign(Object.create(sc.prototype),{constructor:dc,ValueTypeName:"vector"}),Object.assign(pc,{parse:function(t){const e=[],i=t.tracks,n=1/(t.fps||1);for(let t=0,r=i.length;t!==r;++t)e.push(fc(i[t]).scale(n));const r=new pc(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r},toJSON:function(t){const e=[],i=t.tracks,n={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let t=0,n=i.length;t!==n;++t)e.push(sc.toJSON(i[t]));return n},CreateFromMorphTargetSequence:function(t,e,i,n){const r=e.length,s=[];for(let t=0;t1){const t=s[1];let e=n[t];e||(n[t]=e=[]),e.push(i)}}const s=[];for(const t in n)s.push(pc.CreateFromMorphTargetSequence(t,n[t],e,i));return s},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(t,e,i,n,r){if(0!==i.length){const s=[],o=[];tc.flattenJSON(i,s,o,n),0!==s.length&&r.push(new t(e,s,o))}},n=[],r=t.name||"default",s=t.fps||30,o=t.blendMode;let a=t.length||-1;const h=t.hierarchy||[];for(let t=0;t0||0===t.search(/^data\:image\/jpeg/);r.format=n?kt:Nt,r.needsUpdate=!0,void 0!==e&&e(r)}),i,n),r}}),Object.assign(Ac.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){const i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getSpacedPoints:function(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e},getLength:function(){const 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;const e=[];let i,n=this.getPoint(0),r=0;e.push(0);for(let s=1;s<=t;s++)i=this.getPoint(s/t),r+=i.distanceTo(n),e.push(r),n=i;return this.cacheArcLengths=e,e},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){const i=this.getLengths();let n=0;const r=i.length;let s;s=e||t*i[r-1];let o,a=0,h=r-1;for(;a<=h;)if(n=Math.floor(a+(h-a)/2),o=i[n]-s,o<0)a=n+1;else{if(!(o>0)){h=n;break}h=n-1}if(n=h,i[n]===s)return n/(r-1);const l=i[n];return(n+(s-l)/(i[n+1]-l))/(r-1)},getTangent:function(t,e){let i=t-1e-4,n=t+1e-4;i<0&&(i=0),n>1&&(n=1);const r=this.getPoint(i),s=this.getPoint(n),o=e||(r.isVector2?new Ui:new Ki);return o.copy(s).sub(r).normalize(),o},getTangentAt:function(t,e){const i=this.getUtoTmapping(t);return this.getTangent(i,e)},computeFrenetFrames:function(t,e){const i=new Ki,n=[],r=[],s=[],o=new Ki,a=new Sn;for(let e=0;e<=t;e++){const i=e/t;n[e]=this.getTangentAt(i,new Ki),n[e].normalize()}r[0]=new Ki,s[0]=new Ki;let h=Number.MAX_VALUE;const l=Math.abs(n[0].x),c=Math.abs(n[0].y),u=Math.abs(n[0].z);l<=h&&(h=l,i.set(1,0,0)),c<=h&&(h=c,i.set(0,1,0)),u<=h&&i.set(0,0,1),o.crossVectors(n[0],i).normalize(),r[0].crossVectors(n[0],o),s[0].crossVectors(n[0],r[0]);for(let e=1;e<=t;e++){if(r[e]=r[e-1].clone(),s[e]=s[e-1].clone(),o.crossVectors(n[e-1],n[e]),o.length()>Number.EPSILON){o.normalize();const t=Math.acos(Ni.clamp(n[e-1].dot(n[e]),-1,1));r[e].applyMatrix4(a.makeRotationAxis(o,t))}s[e].crossVectors(n[e],r[e])}if(!0===e){let e=Math.acos(Ni.clamp(r[0].dot(r[t]),-1,1));e/=t,n[0].dot(o.crossVectors(r[0],r[t]))>0&&(e=-e);for(let i=1;i<=t;i++)r[i].applyMatrix4(a.makeRotationAxis(n[i],e*i)),s[i].crossVectors(n[i],r[i])}return{tangents:n,normals:r,binormals:s}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){const 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}}),Cc.prototype=Object.create(Ac.prototype),Cc.prototype.constructor=Cc,Cc.prototype.isEllipseCurve=!0,Cc.prototype.getPoint=function(t,e){const i=e||new Ui,n=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)n;)r-=n;r0?0:(Math.floor(Math.abs(h)/r)+1)*r:0===l&&h===r-1&&(h=r-2,l=1),this.closed||h>0?o=n[(h-1)%r]:(Lc.subVectors(n[0],n[1]).add(n[0]),o=Lc);const c=n[h%r],u=n[(h+1)%r];if(this.closed||h+2n.length-2?n.length-1:s+1],c=n[s>n.length-3?n.length-1:s+2];return i.set(Bc(o,a.x,h.x,l.x,c.x),Bc(o,a.y,h.y,l.y,c.y)),i},Xc.prototype.copy=function(t){Ac.prototype.copy.call(this,t),this.points=[];for(let e=0,i=t.points.length;e=e){const t=i[n]-e,r=this.curves[n],s=r.getLength(),o=0===s?0:1-t/s;return r.getPointAt(o)}n++}return null},getLength:function(){const 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;const t=[];let e=0;for(let i=0,n=this.curves.length;i1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e},copy:function(t){Ac.prototype.copy.call(this,t),this.curves=[];for(let e=0,i=t.curves.length;e0){const t=h.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(h);const l=h.getPoint(1);return this.currentPoint.copy(l),this},copy:function(t){return Yc.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){const t=Yc.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return Yc.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),Zc.prototype=Object.assign(Object.create(qc.prototype),{constructor:Zc,getPointsHoles:function(t){const e=[];for(let i=0,n=this.holes.length;i0:n.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const e in t.uniforms){const r=t.uniforms[e];switch(n.uniforms[e]={},r.type){case"t":n.uniforms[e].value=i(r.value);break;case"c":n.uniforms[e].value=(new yr).setHex(r.value);break;case"v2":n.uniforms[e].value=(new Ui).fromArray(r.value);break;case"v3":n.uniforms[e].value=(new Ki).fromArray(r.value);break;case"v4":n.uniforms[e].value=(new ji).fromArray(r.value);break;case"m3":n.uniforms[e].value=(new zi).fromArray(r.value);break;case"m4":n.uniforms[e].value=(new Sn).fromArray(r.value);break;default:n.uniforms[e].value=r.value}}if(void 0!==t.defines&&(n.defines=t.defines),void 0!==t.vertexShader&&(n.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(n.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(const e in t.extensions)n.extensions[e]=t.extensions[e];if(void 0!==t.shading&&(n.flatShading=1===t.shading),void 0!==t.size&&(n.size=t.size),void 0!==t.sizeAttenuation&&(n.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(n.map=i(t.map)),void 0!==t.matcap&&(n.matcap=i(t.matcap)),void 0!==t.alphaMap&&(n.alphaMap=i(t.alphaMap)),void 0!==t.bumpMap&&(n.bumpMap=i(t.bumpMap)),void 0!==t.bumpScale&&(n.bumpScale=t.bumpScale),void 0!==t.normalMap&&(n.normalMap=i(t.normalMap)),void 0!==t.normalMapType&&(n.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),n.normalScale=(new Ui).fromArray(e)}return void 0!==t.displacementMap&&(n.displacementMap=i(t.displacementMap)),void 0!==t.displacementScale&&(n.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(n.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(n.roughnessMap=i(t.roughnessMap)),void 0!==t.metalnessMap&&(n.metalnessMap=i(t.metalnessMap)),void 0!==t.emissiveMap&&(n.emissiveMap=i(t.emissiveMap)),void 0!==t.emissiveIntensity&&(n.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(n.specularMap=i(t.specularMap)),void 0!==t.envMap&&(n.envMap=i(t.envMap)),void 0!==t.envMapIntensity&&(n.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(n.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(n.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(n.lightMap=i(t.lightMap)),void 0!==t.lightMapIntensity&&(n.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(n.aoMap=i(t.aoMap)),void 0!==t.aoMapIntensity&&(n.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(n.gradientMap=i(t.gradientMap)),void 0!==t.clearcoatMap&&(n.clearcoatMap=i(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(n.clearcoatRoughnessMap=i(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(n.clearcoatNormalMap=i(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(n.clearcoatNormalScale=(new Ui).fromArray(t.clearcoatNormalScale)),void 0!==t.transmission&&(n.transmission=t.transmission),void 0!==t.transmissionMap&&(n.transmissionMap=i(t.transmissionMap)),n},setTextures:function(t){return this.textures=t,this}});const uu={decodeText:function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let i=0,n=t.length;i0){const i=new gc(e);r=new _c(i),r.setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;eNumber.EPSILON){if(h<0&&(i=e[s],a=-a,o=e[r],h=-h),t.yo.y)continue;if(t.y===i.y){if(t.x===i.x)return!0}else{const e=h*(t.x-i.x)-a*(t.y-i.y);if(0===e)return!0;if(e<0)continue;n=!n}}else{if(t.y!==i.y)continue;if(o.x<=t.x&&t.x<=i.x||i.x<=t.x&&t.x<=o.x)return!0}}return n}const r=El.isClockWise,s=this.subPaths;if(0===s.length)return[];if(!0===e)return i(s);let o,a,h;const l=[];if(1===s.length)return a=s[0],h=new Zc,h.curves=a.curves,l.push(h),l;let c=!r(s[0].getPoints());c=t?!c:c;const u=[],d=[];let p,f,m=[],g=0;d[g]=void 0,m[g]=[];for(let e=0,i=s.length;e1){let t=!1;const e=[];for(let t=0,e=d.length;t0&&(t||(m=u))}for(let t=0,e=d.length;t0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t0&&this._mixBufferRegionAdditive(i,n,this._addIndex*e,1,e);for(let t=e,r=e+e;t!==r;++t)if(i[t]!==i[t+e]){o.setValue(i,n);break}},saveOriginalState:function(){const t=this.binding,e=this.buffer,i=this.valueSize,n=i*this._origIndex;t.getValue(e,n);for(let t=i,r=n;t!==r;++t)e[t]=e[n+t%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_setAdditiveIdentityNumeric:function(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let i=t;i=.5)for(let n=0;n!==r;++n)t[e+n]=t[i+n]},_slerp:function(t,e,i,n){Zi.slerpFlat(t,e,t,e,t,i,n)},_slerpAdditive:function(t,e,i,n,r){const s=this._workIndex*r;Zi.multiplyQuaternionsFlat(t,s,t,e,t,i),Zi.slerpFlat(t,e,t,e,t,s,n)},_lerp:function(t,e,i,n,r){const s=1-n;for(let o=0;o!==r;++o){const r=e+o;t[r]=t[r]*s+t[i+o]*n}},_lerpAdditive:function(t,e,i,n,r){for(let s=0;s!==r;++s){const r=e+s;t[r]=t[r]+t[i+s]*n}}});const Yu=new RegExp("[\\[\\]\\.:\\/]","g"),qu="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Zu=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Ku=/(WCOD+)?/.source.replace("WCOD",qu),Ju=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Qu=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),$u=new RegExp("^"+Zu+Ku+Ju+Qu+"$"),td=["material","materials","bones"];function ed(t,e,i){const n=i||id.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,n)}function id(t,e,i){this.path=e,this.parsedPath=i||id.parseTrackName(e),this.node=id.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function nd(){this.uuid=Ni.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const t={};this._indicesByUUID=t;for(let e=0,i=arguments.length;e!==i;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const e=this;this.stats={objects:{get total(){return e._objects.length},get inUse(){return this.total-e.nCachedObjects_}},get bindingsPerObject(){return e._bindings.length}}}Object.assign(ed.prototype,{getValue:function(t,e){this.bind();const i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(t,e)},setValue:function(t,e){const i=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=i.length;n!==r;++n)i[n].setValue(t,e)},bind:function(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()},unbind:function(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}}),Object.assign(id,{Composite:ed,create:function(t,e,i){return t&&t.isAnimationObjectGroup?new id.Composite(t,e,i):new id(t,e,i)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(Yu,"")},parseTrackName:function(t){const e=$u.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const i={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},n=i.nodeName&&i.nodeName.lastIndexOf(".");if(void 0!==n&&-1!==n){const t=i.nodeName.substring(n+1);-1!==td.indexOf(t)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=t)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i},findNode:function(t,e){if(!e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const i=t.skeleton.getBoneByName(e);if(void 0!==i)return i}if(t.children){const i=function(t){for(let n=0;n=r){const s=r++,l=t[s];e[l.uuid]=h,t[h]=l,e[a]=s,t[s]=o;for(let t=0,e=n;t!==e;++t){const e=i[t],n=e[s],r=e[h];e[h]=n,e[s]=r}}}this.nCachedObjects_=r},uncache:function(){const t=this._objects,e=this._indicesByUUID,i=this._bindings,n=i.length;let r=this.nCachedObjects_,s=t.length;for(let o=0,a=arguments.length;o!==a;++o){const a=arguments[o].uuid,h=e[a];if(void 0!==h)if(delete e[a],h0&&(e[o.uuid]=h),t[h]=o,t.pop();for(let t=0,e=n;t!==e;++t){const e=i[t];e[h]=e[r],e.pop()}}}this.nCachedObjects_=r},subscribe_:function(t,e){const i=this._bindingsIndicesByPath;let n=i[t];const r=this._bindings;if(void 0!==n)return r[n];const s=this._paths,o=this._parsedPaths,a=this._objects,h=a.length,l=this.nCachedObjects_,c=new Array(h);n=r.length,i[t]=n,s.push(t),o.push(e),r.push(c);for(let i=l,n=a.length;i!==n;++i){const n=a[i];c[i]=new id(n,t,e)}return c},unsubscribe_:function(t){const e=this._bindingsIndicesByPath,i=e[t];if(void 0!==i){const n=this._paths,r=this._parsedPaths,s=this._bindings,o=s.length-1,a=s[o];e[t[o]]=i,s[i]=a,s.pop(),r[i]=r[o],r.pop(),n[i]=n[o],n.pop()}}});class rd{constructor(t,e,i=null,n=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=n;const r=e.tracks,s=r.length,o=new Array(s),a={endingStart:Ve,endingEnd:Ve};for(let t=0;t!==s;++t){const e=r[t].createInterpolant(null);o[t]=e,e.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=ke,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}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,i){if(t.fadeOut(e),this.fadeIn(e),i){const i=this._clip.duration,n=t._clip.duration,r=n/i,s=i/n;t.warp(1,r,e),this.warp(s,1,e)}return this}crossFadeTo(t,e,i){return t.crossFadeFrom(this,e,i)}stopFading(){const t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,i){const n=this._mixer,r=n.time,s=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=n._lendControlInterpolant(),this._timeScaleInterpolant=o);const a=o.parameterPositions,h=o.sampleValues;return a[0]=r,a[1]=r+i,h[0]=t/s,h[1]=e/s,this}stopWarping(){const t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,i,n){if(!this.enabled)return void this._updateWeight(t);const r=this._startTime;if(null!==r){const n=(t-r)*i;if(n<0||0===i)return;this._startTime=null,e=i*n}e*=this._updateTimeScale(t);const s=this._updateTime(e),o=this._updateWeight(t);if(o>0){const t=this._interpolants,e=this._propertyBindings;switch(this.blendMode){case je:for(let i=0,n=t.length;i!==n;++i)t[i].evaluate(s),e[i].accumulateAdditive(o);break;case Xe:default:for(let i=0,r=t.length;i!==r;++i)t[i].evaluate(s),e[i].accumulate(n,o)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const i=this._weightInterpolant;if(null!==i){const n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const 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(t){const e=this._clip.duration,i=this.loop;let n=this.time+t,r=this._loopCount;const s=i===Ne;if(0===t)return-1===r?n:s&&1==(1&r)?e-n:n;if(i===Be){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n>=e)n=e;else{if(!(n<0)){this.time=n;break t}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,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,s)):this._setEndings(0===this.repetitions,!0,s)),n>=e||n<0){const i=Math.floor(n/e);n-=e*i,r+=Math.abs(i);const o=this.repetitions-r;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=t>0?e:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===o){const e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=n;if(s&&1==(1&r))return e-n}return n}_setEndings(t,e,i){const n=this._interpolantSettings;i?(n.endingStart=He,n.endingEnd=He):(n.endingStart=t?this.zeroSlopeAtStart?He:Ve:We,n.endingEnd=e?this.zeroSlopeAtEnd?He:Ve:We)}_scheduleFading(t,e,i){const n=this._mixer,r=n.time;let s=this._weightInterpolant;null===s&&(s=n._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,a=s.sampleValues;return o[0]=r,a[0]=e,o[1]=r+t,a[1]=i,this}}function sd(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}sd.prototype=Object.assign(Object.create(Fi.prototype),{constructor:sd,_bindAction:function(t,e){const i=t._localRoot||this._root,n=t._clip.tracks,r=n.length,s=t._propertyBindings,o=t._interpolants,a=i.uuid,h=this._bindingsByRootAndName;let l=h[a];void 0===l&&(l={},h[a]=l);for(let t=0;t!==r;++t){const r=n[t],h=r.name;let c=l[h];if(void 0!==c)s[t]=c;else{if(c=s[t],void 0!==c){null===c._cacheIndex&&(++c.referenceCount,this._addInactiveBinding(c,a,h));continue}const n=e&&e._propertyBindings[t].binding.parsedPath;c=new ju(id.create(i,h,n),r.ValueTypeName,r.getValueSize()),++c.referenceCount,this._addInactiveBinding(c,a,h),s[t]=c}o[t].resultBuffer=c.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const 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)}const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==i.useCount++&&(this._lendBinding(i),i.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const 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){const e=t._cacheIndex;return null!==e&&e=0;--e)t[e].stop();return this},update:function(t){t*=this.timeScale;const e=this._actions,i=this._nActiveActions,n=this.time+=t,r=Math.sign(t),s=this._accuIndex^=1;for(let o=0;o!==i;++o){e[o]._update(n,t,r,s)}const o=this._bindings,a=this._nActiveBindings;for(let t=0;t!==a;++t)o[t].apply(s);return this},setTime:function(t){this.time=0;for(let t=0;tthis.max.x||t.ythis.max.y)}containsBox(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(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new Ui),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(t){return!(t.max.xthis.max.x||t.max.ythis.max.y)}clampPoint(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new Ui),e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return fd.copy(t).clamp(this.min,this.max).sub(t).length()}intersect(t){return this.min.max(t.min),this.max.min(t.max),this}union(t){return this.min.min(t.min),this.max.max(t.max),this}translate(t){return this.min.add(t),this.max.add(t),this}equals(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}const gd=new Ki,vd=new Ki;class yd{constructor(t,e){this.start=void 0!==t?t:new Ki,this.end=void 0!==e?e:new Ki}set(t,e){return this.start.copy(t),this.end.copy(e),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new Ki),t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new Ki),t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new Ki),this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){gd.subVectors(t,this.start),vd.subVectors(this.end,this.start);const i=vd.dot(vd);let n=vd.dot(gd)/i;return e&&(n=Ni.clamp(n,0,1)),n}closestPointToPoint(t,e,i){const n=this.closestPointToPointParameter(t,e);return void 0===i&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),i=new Ki),this.delta(i).multiplyScalar(n).add(this.start)}applyMatrix4(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this}equals(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}function xd(t){Kn.call(this),this.material=t,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}xd.prototype=Object.create(Kn.prototype),xd.prototype.constructor=xd,xd.prototype.isImmediateRenderObject=!0;const bd=new Ki;class wd extends Kn{constructor(t,e){super(),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;const i=new jr,n=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let t=0,e=1,i=32;t.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{Xd.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(Xd,e)}}setLength(t,e,i){void 0===e&&(e=.2*t),void 0===i&&(i=.2*e),this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(i,e,i),this.cone.position.y=t,this.cone.updateMatrix()}setColor(t){this.line.material.color.set(t),this.cone.material.color.set(t)}copy(t){return super.copy(t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this}}class Zd extends Rh{constructor(t=1){const e=[0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t],i=new jr;i.setAttribute("position",new Ir(e,3)),i.setAttribute("color",new Ir([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));super(i,new wh({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}}const Kd=new Float32Array(1),Jd=new Int32Array(Kd.buffer),Qd={toHalfFloat:function(t){Kd[0]=t;const e=Jd[0];let i=e>>16&32768,n=e>>12&2047;const r=e>>23&255;return r<103?i:r>142?(i|=31744,i|=(255==r?0:1)&&8388607&e,i):r<113?(n|=2048,i|=(n>>114-r)+(n>>113-r&1),i):(i|=r-112<<10|n>>1,i+=1&n,i)}},$d=Math.pow(2,8),tp=[.125,.215,.35,.446,.526,.582],ep=5+tp.length,ip={[Ke]:0,[Je]:1,[$e]:2,[ei]:3,[ii]:4,[ni]:5,[Qe]:6},np=new Tr({side:m,depthWrite:!1,depthTest:!1}),rp=new cs(new ds,np),sp=new nu,{_lodPlanes:op,_sizeLods:ap,_sigmas:hp}=vp(),lp=new yr;let cp=null;const up=(1+Math.sqrt(5))/2,dp=1/up,pp=[new Ki(1,1,1),new Ki(-1,1,1),new Ki(1,1,-1),new Ki(-1,1,-1),new Ki(0,up,dp),new Ki(0,up,-dp),new Ki(dp,0,up),new Ki(-dp,0,up),new Ki(up,dp,0),new Ki(-up,dp,0)];function fp(t){const e=Math.max(t.r,t.g,t.b),i=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);t.multiplyScalar(Math.pow(2,-i));return(i+128)/255}class mp{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._blurMaterial=function(t){const e=new Float32Array(t),i=new Ki(0,1,0);return new Wl({name:"SphericalGaussianBlur",defines:{n:t},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:e},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i},inputEncoding:{value:ip[Ke]},outputEncoding:{value:ip[Ke]}},vertexShader:Tp(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t${_p()}\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include \n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t`,blending:x,depthTest:!1,depthWrite:!1})}(20),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,i=.1,n=100){cp=this._renderer.getRenderTarget();const r=this._allocateTargets();return this._sceneToCubeUV(t,i,n,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t){return this._fromTexture(t)}fromCubemap(t){return this._fromTexture(t)}compileCubemapShader(){null===this._cubemapShader&&(this._cubemapShader=wp(),this._compileMaterial(this._cubemapShader))}compileEquirectangularShader(){null===this._equirectShader&&(this._equirectShader=bp(),this._compileMaterial(this._equirectShader))}dispose(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(let t=0;t2?$d:0,$d,$d),a.setRenderTarget(n),u&&a.render(rp,r),a.render(t,r)}a.toneMapping=c,a.outputEncoding=l,a.autoClear=h}_textureToCubeUV(t,e){const i=this._renderer;t.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=wp()):null==this._equirectShader&&(this._equirectShader=bp());const n=t.isCubeTexture?this._cubemapShader:this._equirectShader,r=new cs(op[0],n),s=n.uniforms;s.envMap.value=t,t.isCubeTexture||s.texelSize.value.set(1/t.image.width,1/t.image.height),s.inputEncoding.value=ip[t.encoding],s.outputEncoding.value=ip[e.texture.encoding],xp(e,0,0,3*$d,2*$d),i.setRenderTarget(e),i.render(r,sp)}_applyPMREM(t){const e=this._renderer,i=e.autoClear;e.autoClear=!1;for(let e=1;e20&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${f} samples when the maximum is set to 20`);const m=[];let g=0;for(let t=0;t<20;++t){const e=t/p,i=Math.exp(-e*e/2);m.push(i),0==t?g+=i:t4?n-8+4:0),3*v,2*v),a.setRenderTarget(e),a.render(l,sp)}}function gp(t){return void 0!==t&&t.type===Et&&(t.encoding===Ke||t.encoding===Je||t.encoding===Qe)}function vp(){const t=[],e=[],i=[];let n=8;for(let r=0;r4?o=tp[r-8+4-1]:0==r&&(o=0),i.push(o);const a=1/(s-1),h=-a/2,l=1+a/2,c=[h,h,l,h,l,l,h,h,l,l,h,l],u=6,d=6,p=3,f=2,m=1,g=new Float32Array(p*d*u),v=new Float32Array(f*d*u),y=new Float32Array(m*d*u);for(let t=0;t2?0:-1,n=[e,i,0,e+2/3,i,0,e+2/3,i+1,0,e,i,0,e+2/3,i+1,0,e,i+1,0];g.set(n,p*d*t),v.set(c,f*d*t);const r=[t,t,t,t,t,t];y.set(r,m*d*t)}const x=new jr;x.setAttribute("position",new Sr(g,p)),x.setAttribute("uv",new Sr(v,f)),x.setAttribute("faceIndex",new Sr(y,m)),t.push(x),n>4&&n--}return{_lodPlanes:t,_sizeLods:e,_sigmas:i}}function yp(t){const e=new Yi(3*$d,3*$d,t);return e.texture.mapping=lt,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function xp(t,e,i,n,r){t.viewport.set(e,i,n,r),t.scissor.set(e,i,n,r)}function bp(){return new Wl({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:new Ui(1,1)},inputEncoding:{value:ip[Ke]},outputEncoding:{value:ip[Ke]}},vertexShader:Tp(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t${_p()}\n\n\t\t\t#include \n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t`,blending:x,depthTest:!1,depthWrite:!1})}function wp(){return new Wl({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:ip[Ke]},outputEncoding:{value:ip[Ke]}},vertexShader:Tp(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t${_p()}\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t`,blending:x,depthTest:!1,depthWrite:!1})}function Tp(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function _p(){return"\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include \n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t"}function Ep(t,e,i,n,r,s,o){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new xr(t,e,i,r,s,o)}const Sp=0,Mp=1,Ap=0,Cp=1,Pp=2;function Rp(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t}function Lp(t=[]){return console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),t.isMultiMaterial=!0,t.materials=t,t.clone=function(){return t.slice()},t}function Op(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new kh(t,e)}function Dp(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new eh(t)}function Ip(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new kh(t,e)}function Fp(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new Oh(t)}function Bp(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new Oh(t)}function kp(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new Oh(t)}function Np(t,e,i){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new Ki(t,e,i)}function Up(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new Sr(t,e).setUsage(Si)}function zp(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new Mr(t,e)}function Gp(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new Ar(t,e)}function Vp(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new Cr(t,e)}function Hp(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new Pr(t,e)}function Wp(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Rr(t,e)}function Xp(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Lr(t,e)}function jp(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Or(t,e)}function Yp(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Ir(t,e)}function qp(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Fr(t,e)}function Zp(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Fc.call(this,t),this.type="catmullrom",this.closed=!0}function Kp(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Fc.call(this,t),this.type="catmullrom"}function Jp(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Fc.call(this,t),this.type="catmullrom"}function Qp(t){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new Zd(t)}function $p(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new Vd(t,e)}function tf(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new Rh(new Qh(t.geometry),new wh({color:void 0!==e?e:16777215}))}function ef(t,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new Rh(new Gl(t.geometry),new wh({color:void 0!==e?e:16777215}))}function nf(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new bc(t)}function rf(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new Sc(t)}function sf(t,e,i){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new ws(t,i)}Ac.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Ac.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(qc.prototype,{fromPoints:function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),Zp.prototype=Object.create(Fc.prototype),Kp.prototype=Object.create(Fc.prototype),Jp.prototype=Object.create(Fc.prototype),Object.assign(Jp.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),Ld.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Sd.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(yc.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),uu.extractUrlBase(t)}}),yc.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(md.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign($i.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(gn.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),Ss.prototype.setFromMatrix=function(t){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(t)},yd.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(Ni,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),Ni.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),Ni.ceilPowerOfTwo(t)}}),Object.assign(zi.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")},getInverse:function(t){return console.warn("THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(t).invert()}}),Object.assign(Sn.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new Ki).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,i,n,r,s){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,n,i,r,s)},getInverse:function(t){return console.warn("THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead."),this.copy(t).invert()}}),tr.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},Object.assign(Zi.prototype,{multiplyVector3:function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},inverse:function(){return console.warn("THREE.Quaternion: .inverse() has been renamed to invert()."),this.invert()}}),Object.assign(En.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(ur.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(ur,{barycoordFromPoint:function(t,e,i,n,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),ur.getBarycoord(t,e,i,n,r)},normal:function(t,e,i,n){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),ur.getNormal(t,e,i,n)}}),Object.assign(Zc.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new Al(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Il(this,t)}}),Object.assign(Ui.prototype,{fromAttribute:function(t,e,i){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Ki.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,i){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(ji.prototype,{fromAttribute:function(t,e,i){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,i)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Kn.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(t){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(Kn.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(cs.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(cs.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),Ye},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(sh.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(mh.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),uh.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Ac.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),ys.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(Kc.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(Sr.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===Si},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Si)}}}),Object.assign(Sr.prototype,{setDynamic:function(t){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?Si:Ei),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(jr.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addAttribute:function(t,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(t,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(t,new Sr(arguments[1],arguments[2])))},addDrawCall:function(t,e,i){void 0!==i&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(t){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(t)},applyMatrix:function(t){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(jr.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(du.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(t){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=t}}}),Object.defineProperties(ld.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(t){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=t}}}),Object.defineProperties(Na.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===Si},set:function(t){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(t)}}}),Object.assign(Na.prototype,{setDynamic:function(t){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?Si:Ei),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(Al.prototype,{getArrays:function(){console.error("THREE.ExtrudeGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeGeometry: .addShape() has been removed.")}}),Object.assign(ka.prototype,{dispose:function(){console.error("THREE.Scene: .dispose() has been removed.")}}),Object.defineProperties(od.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(wr.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new yr}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=t===v}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(t){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=t}}}),Object.defineProperties(Yl.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(jl.prototype,{transparency:{get:function(){return console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission},set:function(t){console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission=t}}}),Object.defineProperties(gs.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(Da.prototype,{clearTarget:function(t,e,i,n){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,i,n)},animate:function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(Da.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(t){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===t?Je:Ke}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(Ea.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(Yi.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(Uu.prototype,{load:{value:function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const e=this;return(new Mu).load(t,(function(t){e.setBuffer(t)})),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),Xu.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},xs.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)},xs.prototype.clear=function(t,e,i,n){return console.warn("THREE.CubeCamera: .clear() is now .renderTarget.clear()."),this.renderTarget.clear(t,e,i,n)};const of={merge:function(t,e,i){let n;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),e.isMesh&&(e.matrixAutoUpdate&&e.updateMatrix(),n=e.matrix,e=e.geometry),t.merge(e,n,i)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}};function af(){console.error("THREE.CanvasRenderer has been removed")}function hf(){console.error("THREE.JSONLoader has been removed.")}Vi.crossOrigin=void 0,Vi.loadTexture=function(t,e,i,n){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const r=new Mc;r.setCrossOrigin(this.crossOrigin);const s=r.load(t,i,void 0,n);return e&&(s.mapping=e),s},Vi.loadTextureCube=function(t,e,i,n){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const r=new Ec;r.setCrossOrigin(this.crossOrigin);const s=r.load(t,i,void 0,n);return e&&(s.mapping=e),s},Vi.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Vi.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};const lf={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};function cf(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:n}})),"undefined"!=typeof window&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=n)},function(t,e,i){"use strict"; /** * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */Object.defineProperty(e,"__esModule",{value:!0}),e.DotScreenShader=e.GlitchPass=e.ShaderPass=e.RenderPass=e.EffectComposer=e.PointerDrag=e.PointerLock=e.FirstPersonControls=e.ThirdPersonControls=e.JoyStick=e.Types=e.THREE=e.ExtendedGroup=e.ExtendedObject3D=e.ExtendedMesh=e.Canvas=e.PhysicsLoader=e.enable3d=e.Scene3D=void 0;var n=i(23);Object.defineProperty(e,"Scene3D",{enumerable:!0,get:function(){return n.Scene3D}});var r=i(67);Object.defineProperty(e,"enable3d",{enumerable:!0,get:function(){return r.enable3d}});var s=i(11);Object.defineProperty(e,"PhysicsLoader",{enumerable:!0,get:function(){return s.PhysicsLoader}});const o=i(68);e.Canvas=o.default;var a=i(6);Object.defineProperty(e,"ExtendedMesh",{enumerable:!0,get:function(){return a.ExtendedMesh}});var h=i(10);Object.defineProperty(e,"ExtendedObject3D",{enumerable:!0,get:function(){return h.ExtendedObject3D}});var l=i(15);Object.defineProperty(e,"ExtendedGroup",{enumerable:!0,get:function(){return l.ExtendedGroup}});const c=i(2);e.THREE=c;const u=i(4);e.Types=u;var d=i(69);Object.defineProperty(e,"JoyStick",{enumerable:!0,get:function(){return d.JoyStick}});var p=i(70);Object.defineProperty(e,"ThirdPersonControls",{enumerable:!0,get:function(){return p.ThirdPersonControls}});var f=i(71);Object.defineProperty(e,"FirstPersonControls",{enumerable:!0,get:function(){return f.FirstPersonControls}});var m=i(72);Object.defineProperty(e,"PointerLock",{enumerable:!0,get:function(){return m.PointerLock}});var g=i(73);Object.defineProperty(e,"PointerDrag",{enumerable:!0,get:function(){return g.PointerDrag}});var v=i(2);Object.defineProperty(e,"EffectComposer",{enumerable:!0,get:function(){return v.EffectComposer}}),Object.defineProperty(e,"RenderPass",{enumerable:!0,get:function(){return v.RenderPass}}),Object.defineProperty(e,"ShaderPass",{enumerable:!0,get:function(){return v.ShaderPass}}),Object.defineProperty(e,"GlitchPass",{enumerable:!0,get:function(){return v.GlitchPass}}),Object.defineProperty(e,"DotScreenShader",{enumerable:!0,get:function(){return v.DotScreenShader}})},function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),r=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),e.DotScreenShader=e.GlitchPass=e.ShaderPass=e.RenderPass=e.EffectComposer=e.WEBGL=e.OrbitControls=e.Water=e.Sky=e.AnimationAction=e.VRButton=e.SVGLoader=e.XRControllerModelFactory=e.GLTFLoader=e.FBXLoader=e.ConvexGeometry=e.Face3=e.Geometry=void 0,r(i(0),e);var s=i(27);Object.defineProperty(e,"Geometry",{enumerable:!0,get:function(){return s.Geometry}});var o=i(28);Object.defineProperty(e,"Face3",{enumerable:!0,get:function(){return o.Face3}});var a=i(95);Object.defineProperty(e,"ConvexGeometry",{enumerable:!0,get:function(){return a.ConvexGeometry}});var h=i(90);Object.defineProperty(e,"FBXLoader",{enumerable:!0,get:function(){return h.FBXLoader}});var l=i(12);Object.defineProperty(e,"GLTFLoader",{enumerable:!0,get:function(){return l.GLTFLoader}});var c=i(93);Object.defineProperty(e,"XRControllerModelFactory",{enumerable:!0,get:function(){return c.XRControllerModelFactory}});var u=i(29);Object.defineProperty(e,"SVGLoader",{enumerable:!0,get:function(){return u.SVGLoader}});var d=i(30);Object.defineProperty(e,"VRButton",{enumerable:!0,get:function(){return d.VRButton}});var p=i(94);Object.defineProperty(e,"AnimationAction",{enumerable:!0,get:function(){return p.AnimationAction}});var f=i(31);Object.defineProperty(e,"Sky",{enumerable:!0,get:function(){return f.Sky}});var m=i(91);Object.defineProperty(e,"Water",{enumerable:!0,get:function(){return m.Water}});var g=i(32);Object.defineProperty(e,"OrbitControls",{enumerable:!0,get:function(){return g.OrbitControls}});var v=i(33);Object.defineProperty(e,"WEBGL",{enumerable:!0,get:function(){return v.WEBGL}});var y=i(92);Object.defineProperty(e,"EffectComposer",{enumerable:!0,get:function(){return y.EffectComposer}});var x=i(34);Object.defineProperty(e,"RenderPass",{enumerable:!0,get:function(){return x.RenderPass}});var b=i(8);Object.defineProperty(e,"ShaderPass",{enumerable:!0,get:function(){return b.ShaderPass}});var w=i(96);Object.defineProperty(e,"GlitchPass",{enumerable:!0,get:function(){return w.GlitchPass}});var T=i(35);Object.defineProperty(e,"DotScreenShader",{enumerable:!0,get:function(){return T.DotScreenShader}});const _="Three.js r"+i(0).REVISION;console.log(`%c %c %c %c %c ${_} %c https://threejs.org/`,"background: #ff0000","background: #ffff00","background: #00ff00","background: #00ffff","color: #fff; background: #000000;","background: none")},function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));var n,r,s,o=i(0);function a(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}Object.assign(a.prototype,{setSize:function(){},render:function(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}}),a.FullScreenQuad=(n=new o.OrthographicCamera(-1,1,1,-1,0,1),r=new o.PlaneGeometry(2,2),s=function(t){this._mesh=new o.Mesh(r,t)},Object.defineProperty(s.prototype,"material",{get:function(){return this._mesh.material},set:function(t){this._mesh.material=t}}),Object.assign(s.prototype,{dispose:function(){this._mesh.geometry.dispose()},render:function(t){t.render(this._mesh,n)}}),s)},function(t,e,i){"use strict"; /** * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */Object.defineProperty(e,"__esModule",{value:!0}),e.Group=e.Points=e.Line=e.Material=e.Mesh=e.Object3D=e.AnimationAction=e.AnimationClip=e.AnimationMixer=e.ExtendedMesh=e.ExtendedObject3D=void 0;const n=i(10);Object.defineProperty(e,"ExtendedObject3D",{enumerable:!0,get:function(){return n.ExtendedObject3D}});const r=i(6);Object.defineProperty(e,"ExtendedMesh",{enumerable:!0,get:function(){return r.ExtendedMesh}});var s=i(2);Object.defineProperty(e,"AnimationMixer",{enumerable:!0,get:function(){return s.AnimationMixer}}),Object.defineProperty(e,"AnimationClip",{enumerable:!0,get:function(){return s.AnimationClip}}),Object.defineProperty(e,"AnimationAction",{enumerable:!0,get:function(){return s.AnimationAction}}),Object.defineProperty(e,"Object3D",{enumerable:!0,get:function(){return s.Object3D}}),Object.defineProperty(e,"Mesh",{enumerable:!0,get:function(){return s.Mesh}}),Object.defineProperty(e,"Material",{enumerable:!0,get:function(){return s.Material}}),Object.defineProperty(e,"Line",{enumerable:!0,get:function(){return s.Line}}),Object.defineProperty(e,"Points",{enumerable:!0,get:function(){return s.Points}}),Object.defineProperty(e,"Group",{enumerable:!0,get:function(){return s.Group}})},function(t,e,i){"use strict";var n=Object.prototype.hasOwnProperty,r="~";function s(){}function o(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function a(t,e,i,n,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new o(i,n||t,s),h=r?r+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function h(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function l(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(r=!1)),l.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)n.call(t,e)&&i.push(r?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},l.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,s=i.length,o=new Array(s);n{console.error(`%c [enable3d] ${t} `,"background: #222; color: #bada55")}},function(t,e,i){"use strict"; /** * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */Object.defineProperty(e,"__esModule",{value:!0}),e.ExtendedObject3D=void 0;const n=i(2);class r extends n.Object3D{constructor(){super(),this.vector3=new n.Vector3,this.isGroup=!1,this.hasBody=!1,this.anims={},this._currentAnimation="",this._animationActions=new Map,this.name="object-"+this.id}setAction(t){console.warn("[enable3d] setAction(name) is deprecated. Use animation.play(name) instead!"),this.animationPlay(t)}get world(){return{theta:this.worldTheta,phi:this.worldPhi}}get worldTheta(){return this.getWorldDirection(this.vector3),Math.atan2(this.vector3.x,this.vector3.z)}get worldPhi(){return this.getWorldDirection(this.vector3),Math.acos(this.vector3.y)}get animation(){return{current:this._currentAnimation,add:(t,e)=>this.animationAdd(t,e),play:(t,e=500,i=!0)=>this.animationPlay(t,e,i),mixer:this.animationMixer}}set animationMixer(t){this._animationMixer=t}get animationMixer(){return this._animationMixer||(this._animationMixer=new n.AnimationMixer(this)),this._animationMixer}animationAdd(t,e){this._animationActions.set(t,this.animationMixer.clipAction(e))}animationPlay(t,e=500,i=!0){const r=this._animationActions.get(t),s=this._animationActions.get(this._currentAnimation);r&&(r.reset(),s&&(r.crossFadeFrom(s,e/1e3,!0),r.clampWhenFinished=!0),i||r.setLoop(n.LoopOnce,0),r.play()),this._currentAnimation=t}}e.ExtendedObject3D=r,e.default=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PhysicsLoader=void 0;const n=i(18);e.PhysicsLoader=(t,e)=>{"undefined"!=typeof window&&(window.__loadPhysics=!0),n.default(t,()=>{Ammo().then(()=>{e()})})}},function(t,e,i){"use strict";i.r(e),i.d(e,"GLTFLoader",(function(){return r}));var n=i(0),r=function(){function t(t){n.Loader.call(this,t),this.dracoLoader=null,this.ddsLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(t){return new a(t)})),this.register((function(t){return new l(t)})),this.register((function(t){return new c(t)})),this.register((function(t){return new h(t)})),this.register((function(t){return new s(t)})),this.register((function(t){return new u(t)}))}function e(){var t={};return{get:function(e){return t[e]},add:function(e,i){t[e]=i},remove:function(e){delete t[e]},removeAll:function(){t={}}}}t.prototype=Object.assign(Object.create(n.Loader.prototype),{constructor:t,load:function(t,e,i,r){var s,o=this;s=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:n.LoaderUtils.extractUrlBase(t),this.manager.itemStart(t);var a=function(e){r?r(e):console.error(e),o.manager.itemError(t),o.manager.itemEnd(t)},h=new n.FileLoader(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.setRequestHeader(this.requestHeader),h.setWithCredentials(this.withCredentials),h.load(t,(function(i){try{o.parse(i,s,(function(i){e(i),o.manager.itemEnd(t)}),a)}catch(t){a(t)}}),i,a)},setDRACOLoader:function(t){return this.dracoLoader=t,this},setDDSLoader:function(t){return this.ddsLoader=t,this},setKTX2Loader:function(t){return this.ktx2Loader=t,this},setMeshoptDecoder:function(t){return this.meshoptDecoder=t,this},register:function(t){return-1===this.pluginCallbacks.indexOf(t)&&this.pluginCallbacks.push(t),this},unregister:function(t){return-1!==this.pluginCallbacks.indexOf(t)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1),this},parse:function(t,e,s,a){var h,l={},c={};if("string"==typeof t)h=t;else if(n.LoaderUtils.decodeText(new Uint8Array(t,0,4))===d){try{l[i.KHR_BINARY_GLTF]=new m(t)}catch(t){return void(a&&a(t))}h=l[i.KHR_BINARY_GLTF].content}else h=n.LoaderUtils.decodeText(new Uint8Array(t));var u=JSON.parse(h);if(void 0===u.asset||u.asset.version[0]<2)a&&a(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{var p=new W(u,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});p.fileLoader.setRequestHeader(this.requestHeader);for(var f=0;f=0&&void 0===c[w]&&console.warn('THREE.GLTFLoader: Unknown extension "'+w+'".')}}p.setExtensions(l),p.setPlugins(c),p.parse(s,a)}}});var i={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function r(t){if(!t)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=i.MSFT_TEXTURE_DDS,this.ddsLoader=t}function s(t){this.parser=t,this.name=i.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}function o(){this.name=i.KHR_MATERIALS_UNLIT}function a(t){this.parser=t,this.name=i.KHR_MATERIALS_CLEARCOAT}function h(t){this.parser=t,this.name=i.KHR_MATERIALS_TRANSMISSION}function l(t){this.parser=t,this.name=i.KHR_TEXTURE_BASISU}function c(t){this.parser=t,this.name=i.EXT_TEXTURE_WEBP,this.isSupported=null}function u(t){this.name=i.EXT_MESHOPT_COMPRESSION,this.parser=t}s.prototype._markDefs=function(){for(var t=this.parser,e=this.parser.json.nodes||[],i=0,n=e.length;i=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,s,o)},c.prototype.loadTexture=function(t){var e=this.name,i=this.parser,n=i.json,r=n.textures[t];if(!r.extensions||!r.extensions[e])return null;var s=r.extensions[e],o=n.images[s.source],a=o.uri?i.options.manager.getHandler(o.uri):i.textureLoader;return this.detectSupport().then((function(r){if(r)return i.loadTextureImage(t,o,a);if(n.extensionsRequired&&n.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(t)}))},c.prototype.detectSupport=function(){return this.isSupported||(this.isSupported=new Promise((function(t){var e=new Image;e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.onload=e.onerror=function(){t(1===e.height)}}))),this.isSupported},u.prototype.loadBufferView=function(t){var e=this.parser.json,i=e.bufferViews[t];if(i.extensions&&i.extensions[this.name]){var n=i.extensions[this.name],r=this.parser.getDependency("buffer",n.buffer),s=this.parser.options.meshoptDecoder;if(!s||!s.supported){if(e.extensionsRequired&&e.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return Promise.all([r,s.ready]).then((function(t){var e=n.byteOffset||0,i=n.byteLength||0,r=n.count,o=n.byteStride,a=new ArrayBuffer(r*o),h=new Uint8Array(t[0],e,i);return s.decodeGltfBuffer(new Uint8Array(a),r,o,h,n.mode,n.filter),a}))}return null};var d="glTF",p=1313821514,f=5130562;function m(t){this.name=i.KHR_BINARY_GLTF,this.content=null,this.body=null;var e=new DataView(t,0,12);if(this.header={magic:n.LoaderUtils.decodeText(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==d)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var r=this.header.length-12,s=new DataView(t,12),o=0;o",e).replace("#include ",i).replace("#include ",r).replace("#include ",s).replace("#include ",o)},Object.defineProperties(this,{specular:{get:function(){return a.specular.value},set:function(t){a.specular.value=t}},specularMap:{get:function(){return a.specularMap.value},set:function(t){a.specularMap.value=t,t?this.defines.USE_SPECULARMAP="":delete this.defines.USE_SPECULARMAP}},glossiness:{get:function(){return a.glossiness.value},set:function(t){a.glossiness.value=t}},glossinessMap:{get:function(){return a.glossinessMap.value},set:function(t){a.glossinessMap.value=t,t?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_UV=""):(delete this.defines.USE_GLOSSINESSMAP,delete this.defines.USE_UV)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(t)}function x(){return{name:i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return y},extendParams:function(t,e,i){var r=e.extensions[this.name];t.color=new n.Color(1,1,1),t.opacity=1;var s=[];if(Array.isArray(r.diffuseFactor)){var o=r.diffuseFactor;t.color.fromArray(o),t.opacity=o[3]}if(void 0!==r.diffuseTexture&&s.push(i.assignTexture(t,"map",r.diffuseTexture)),t.emissive=new n.Color(0,0,0),t.glossiness=void 0!==r.glossinessFactor?r.glossinessFactor:1,t.specular=new n.Color(1,1,1),Array.isArray(r.specularFactor)&&t.specular.fromArray(r.specularFactor),void 0!==r.specularGlossinessTexture){var a=r.specularGlossinessTexture;s.push(i.assignTexture(t,"glossinessMap",a)),s.push(i.assignTexture(t,"specularMap",a))}return Promise.all(s)},createMaterial:function(t){var e=new y(t);return e.fog=!0,e.color=t.color,e.map=void 0===t.map?null:t.map,e.lightMap=null,e.lightMapIntensity=1,e.aoMap=void 0===t.aoMap?null:t.aoMap,e.aoMapIntensity=1,e.emissive=t.emissive,e.emissiveIntensity=1,e.emissiveMap=void 0===t.emissiveMap?null:t.emissiveMap,e.bumpMap=void 0===t.bumpMap?null:t.bumpMap,e.bumpScale=1,e.normalMap=void 0===t.normalMap?null:t.normalMap,e.normalMapType=n.TangentSpaceNormalMap,t.normalScale&&(e.normalScale=t.normalScale),e.displacementMap=null,e.displacementScale=1,e.displacementBias=0,e.specularMap=void 0===t.specularMap?null:t.specularMap,e.specular=t.specular,e.glossinessMap=void 0===t.glossinessMap?null:t.glossinessMap,e.glossiness=t.glossiness,e.alphaMap=null,e.envMap=void 0===t.envMap?null:t.envMap,e.envMapIntensity=1,e.refractionRatio=.98,e}}}function b(){this.name=i.KHR_MESH_QUANTIZATION}function w(t,e,i,r){n.Interpolant.call(this,t,e,i,r)}g.prototype.decodePrimitive=function(t,e){var i=this.json,n=this.dracoLoader,r=t.extensions[this.name].bufferView,s=t.extensions[this.name].attributes,o={},a={},h={};for(var l in s){var c=D[l]||l.toLowerCase();o[c]=s[l]}for(l in t.attributes){c=D[l]||l.toLowerCase();if(void 0!==s[l]){var u=i.accessors[t.attributes[l]],d=P[u.componentType];h[c]=d,a[c]=!0===u.normalized}}return e.getDependency("bufferView",r).then((function(t){return new Promise((function(e){n.decodeDracoFile(t,(function(t){for(var i in t.attributes){var n=t.attributes[i],r=a[i];void 0!==r&&(n.normalized=r)}e(t)}),o,h)}))}))},v.prototype.extendTexture=function(t,e){return t=t.clone(),void 0!==e.offset&&t.offset.fromArray(e.offset),void 0!==e.rotation&&(t.rotation=e.rotation),void 0!==e.scale&&t.repeat.fromArray(e.scale),void 0!==e.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),t.needsUpdate=!0,t},y.prototype=Object.create(n.MeshStandardMaterial.prototype),y.prototype.constructor=y,y.prototype.copy=function(t){return n.MeshStandardMaterial.prototype.copy.call(this,t),this.specularMap=t.specularMap,this.specular.copy(t.specular),this.glossinessMap=t.glossinessMap,this.glossiness=t.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},w.prototype=Object.create(n.Interpolant.prototype),w.prototype.constructor=w,w.prototype.copySampleValue_=function(t){for(var e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=t*n*3+n,s=0;s!==n;s++)e[s]=i[r+s];return e},w.prototype.beforeStart_=w.prototype.copySampleValue_,w.prototype.afterEnd_=w.prototype.copySampleValue_,w.prototype.interpolate_=function(t,e,i,n){for(var r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=2*o,h=3*o,l=n-e,c=(i-e)/l,u=c*c,d=u*c,p=t*h,f=p-h,m=-2*d+3*u,g=d-u,v=1-m,y=g-u+c,x=0;x!==o;x++){var b=s[f+x+o],w=s[f+x+a]*l,T=s[p+x+o],_=s[p+x]*l;r[x]=v*b+y*w+m*T+g*_}return r};var T=0,_=1,E=2,S=3,M=4,A=5,C=6,P={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},R={9728:n.NearestFilter,9729:n.LinearFilter,9984:n.NearestMipmapNearestFilter,9985:n.LinearMipmapNearestFilter,9986:n.NearestMipmapLinearFilter,9987:n.LinearMipmapLinearFilter},L={33071:n.ClampToEdgeWrapping,33648:n.MirroredRepeatWrapping,10497:n.RepeatWrapping},O={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},D={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},I={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},F={CUBICSPLINE:void 0,LINEAR:n.InterpolateLinear,STEP:n.InterpolateDiscrete},B="OPAQUE",k="MASK",N="BLEND";function U(t,e){return"string"!=typeof t||""===t?"":(/^https?:\/\//i.test(e)&&/^\//.test(t)&&(e=e.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t)?t:e+t)}function z(t,e,i){for(var n in i.extensions)void 0===t[n]&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=i.extensions[n])}function G(t,e){void 0!==e.extras&&("object"==typeof e.extras?Object.assign(t.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function V(t,e){if(t.updateMorphTargets(),void 0!==e.weights)for(var i=0,n=e.weights.length;i=2&&o.setY(M,_[E*h+1]),h>=3&&o.setZ(M,_[E*h+2]),h>=4&&o.setW(M,_[E*h+3]),h>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return o}))},W.prototype.loadTexture=function(t){var e,n,r=this.json,s=this.options,o=r.textures[t],a=o.extensions||{};return(e=a[i.MSFT_TEXTURE_DDS]?r.images[a[i.MSFT_TEXTURE_DDS].source]:r.images[o.source]).uri&&(n=s.manager.getHandler(e.uri)),n||(n=a[i.MSFT_TEXTURE_DDS]?this.extensions[i.MSFT_TEXTURE_DDS].ddsLoader:this.textureLoader),this.loadTextureImage(t,e,n)},W.prototype.loadTextureImage=function(t,e,i){var r=this,s=this.json,o=this.options,a=s.textures[t],h=self.URL||self.webkitURL,l=e.uri,c=!1,u=!0;return"image/jpeg"===e.mimeType&&(u=!1),void 0!==e.bufferView&&(l=r.getDependency("bufferView",e.bufferView).then((function(t){if("image/png"===e.mimeType){var i=new DataView(t,25,1).getUint8(0,!1);u=6===i||4===i||3===i}c=!0;var n=new Blob([t],{type:e.mimeType});return l=h.createObjectURL(n)}))),Promise.resolve(l).then((function(t){return new Promise((function(e,r){var s=e;!0===i.isImageBitmapLoader&&(s=function(t){e(new n.CanvasTexture(t))}),i.load(U(t,o.path),s,void 0,r)}))})).then((function(e){!0===c&&h.revokeObjectURL(l),e.flipY=!1,a.name&&(e.name=a.name),u||(e.format=n.RGBFormat);var i=(s.samplers||{})[a.sampler]||{};return e.magFilter=R[i.magFilter]||n.LinearFilter,e.minFilter=R[i.minFilter]||n.LinearMipmapLinearFilter,e.wrapS=L[i.wrapS]||n.RepeatWrapping,e.wrapT=L[i.wrapT]||n.RepeatWrapping,r.associations.set(e,{type:"textures",index:t}),e}))},W.prototype.assignTexture=function(t,e,n){var r=this;return this.getDependency("texture",n.index).then((function(s){if(void 0===n.texCoord||0==n.texCoord||"aoMap"===e&&1==n.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+n.texCoord+" for texture "+e+" not yet supported."),r.extensions[i.KHR_TEXTURE_TRANSFORM]){var o=void 0!==n.extensions?n.extensions[i.KHR_TEXTURE_TRANSFORM]:void 0;if(o){var a=r.associations.get(s);s=r.extensions[i.KHR_TEXTURE_TRANSFORM].extendTexture(s,o),r.associations.set(s,a)}}t[e]=s}))},W.prototype.assignFinalMaterial=function(t){var e=t.geometry,i=t.material,r=void 0!==e.attributes.tangent,s=void 0!==e.attributes.color,o=void 0===e.attributes.normal,a=!0===t.isSkinnedMesh,h=Object.keys(e.morphAttributes).length>0,l=h&&void 0!==e.morphAttributes.normal;if(t.isPoints){var c="PointsMaterial:"+i.uuid,u=this.cache.get(c);u||(u=new n.PointsMaterial,n.Material.prototype.copy.call(u,i),u.color.copy(i.color),u.map=i.map,u.sizeAttenuation=!1,this.cache.add(c,u)),i=u}else if(t.isLine){c="LineBasicMaterial:"+i.uuid;var d=this.cache.get(c);d||(d=new n.LineBasicMaterial,n.Material.prototype.copy.call(d,i),d.color.copy(i.color),this.cache.add(c,d)),i=d}if(r||s||o||a||h){c="ClonedMaterial:"+i.uuid+":";i.isGLTFSpecularGlossinessMaterial&&(c+="specular-glossiness:"),a&&(c+="skinning:"),r&&(c+="vertex-tangents:"),s&&(c+="vertex-colors:"),o&&(c+="flat-shading:"),h&&(c+="morph-targets:"),l&&(c+="morph-normals:");var p=this.cache.get(c);p||(p=i.clone(),a&&(p.skinning=!0),s&&(p.vertexColors=!0),o&&(p.flatShading=!0),h&&(p.morphTargets=!0),l&&(p.morphNormals=!0),r&&(p.vertexTangents=!0,p.normalScale&&(p.normalScale.y*=-1),p.clearcoatNormalScale&&(p.clearcoatNormalScale.y*=-1)),this.cache.add(c,p),this.associations.set(p,this.associations.get(i))),i=p}i.aoMap&&void 0===e.attributes.uv2&&void 0!==e.attributes.uv&&e.setAttribute("uv2",e.attributes.uv),t.material=i},W.prototype.getMaterialType=function(){return n.MeshStandardMaterial},W.prototype.loadMaterial=function(t){var e,r=this,s=this.json,o=this.extensions,a=s.materials[t],h={},l=a.extensions||{},c=[];if(l[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var u=o[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];e=u.getMaterialType(),c.push(u.extendParams(h,a,r))}else if(l[i.KHR_MATERIALS_UNLIT]){var d=o[i.KHR_MATERIALS_UNLIT];e=d.getMaterialType(),c.push(d.extendParams(h,a,r))}else{var p=a.pbrMetallicRoughness||{};if(h.color=new n.Color(1,1,1),h.opacity=1,Array.isArray(p.baseColorFactor)){var f=p.baseColorFactor;h.color.fromArray(f),h.opacity=f[3]}void 0!==p.baseColorTexture&&c.push(r.assignTexture(h,"map",p.baseColorTexture)),h.metalness=void 0!==p.metallicFactor?p.metallicFactor:1,h.roughness=void 0!==p.roughnessFactor?p.roughnessFactor:1,void 0!==p.metallicRoughnessTexture&&(c.push(r.assignTexture(h,"metalnessMap",p.metallicRoughnessTexture)),c.push(r.assignTexture(h,"roughnessMap",p.metallicRoughnessTexture))),e=this._invokeOne((function(e){return e.getMaterialType&&e.getMaterialType(t)})),c.push(Promise.all(this._invokeAll((function(e){return e.extendMaterialParams&&e.extendMaterialParams(t,h)}))))}!0===a.doubleSided&&(h.side=n.DoubleSide);var m=a.alphaMode||B;return m===N?(h.transparent=!0,h.depthWrite=!1):(h.transparent=!1,m===k&&(h.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&e!==n.MeshBasicMaterial&&(c.push(r.assignTexture(h,"normalMap",a.normalTexture)),h.normalScale=new n.Vector2(1,-1),void 0!==a.normalTexture.scale&&h.normalScale.set(a.normalTexture.scale,-a.normalTexture.scale)),void 0!==a.occlusionTexture&&e!==n.MeshBasicMaterial&&(c.push(r.assignTexture(h,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(h.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&e!==n.MeshBasicMaterial&&(h.emissive=(new n.Color).fromArray(a.emissiveFactor)),void 0!==a.emissiveTexture&&e!==n.MeshBasicMaterial&&c.push(r.assignTexture(h,"emissiveMap",a.emissiveTexture)),Promise.all(c).then((function(){var s;return s=e===y?o[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(h):new e(h),a.name&&(s.name=a.name),s.map&&(s.map.encoding=n.sRGBEncoding),s.emissiveMap&&(s.emissiveMap.encoding=n.sRGBEncoding),G(s,a),r.associations.set(s,{type:"materials",index:t}),a.extensions&&z(o,s,a),s}))},W.prototype.createUniqueName=function(t){for(var e=n.PropertyBinding.sanitizeNodeName(t||""),i=e,r=1;this.nodeNamesUsed[i];++r)i=e+"_"+r;return this.nodeNamesUsed[i]=!0,i},W.prototype.loadGeometries=function(t){var e=this,r=this.extensions,s=this.primitiveCache;function o(t){return r[i.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(t,e).then((function(i){return X(i,t,e)}))}for(var a,h,l=[],c=0,u=t.length;c0&&V(d,o),d.name=i.createUniqueName(o.name||"mesh_"+t),G(d,o),f.extensions&&z(s,d,f),i.assignFinalMaterial(d),l.push(d)}if(1===l.length)return l[0];var g=new n.Group;for(c=0,u=l.length;c1?new n.Group:1===e.length?e[0]:new n.Object3D)!==e[0])for(var h=0,l=e.length;h * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ function(t){return!!t.get&&"function"==typeof t.get||!!t.set&&"function"==typeof t.set}(n))&&(void 0===n.enumerable&&(n.enumerable=!0),void 0===n.configurable&&(n.configurable=!0),n)}function n(t,e){var i=Object.getOwnPropertyDescriptor(t,e);return!!i&&(i.value&&"object"==typeof i.value&&(i=i.value),!1===i.configurable)}function r(t,e,r,s){for(var a in e)if(e.hasOwnProperty(a)){var h=i(e,a,r);if(!1!==h){if(n((s||t).prototype,a)){if(o.ignoreFinals)continue;throw new Error("cannot override final property '"+a+"', set Class.ignoreFinals = true to skip")}Object.defineProperty(t.prototype,a,h)}else t.prototype[a]=e[a]}}function s(t,e){if(e){Array.isArray(e)||(e=[e]);for(var i=0;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(123),s=new n({initialize:function(t,e){this.x=0,this.y=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0):(void 0===e&&(e=t),this.x=t||0,this.y=e||0)},clone:function(){return new s(this.x,this.y)},copy:function(t){return this.x=t.x||0,this.y=t.y||0,this},setFromObject:function(t){return this.x=t.x||0,this.y=t.y||0,this},set:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setTo:function(t,e){return this.set(t,e)},setToPolar:function(t,e){return null==e&&(e=1),this.x=Math.cos(t)*e,this.y=Math.sin(t)*e,this},equals:function(t){return this.x===t.x&&this.y===t.y},fuzzyEquals:function(t,e){return r(this.x,t.x,e)&&r(this.y,t.y,e)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},setAngle:function(t){return this.setToPolar(t,this.length())},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t):(this.x=0,this.y=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},negate:function(){return this.x=-this.x,this.y=-this.y,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},length:function(){var t=this.x,e=this.y;return Math.sqrt(t*t+e*e)},setLength:function(t){return this.normalize().scale(t)},lengthSq:function(){var t=this.x,e=this.y;return t*t+e*e},normalize:function(){var t=this.x,e=this.y,i=t*t+e*e;return i>0&&(i=1/Math.sqrt(i),this.x=t*i,this.y=e*i),this},normalizeRightHand:function(){var t=this.x;return this.x=-1*this.y,this.y=t,this},normalizeLeftHand:function(){var t=this.x;return this.x=this.y,this.y=-1*t,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},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this},transformMat3:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},transformMat4:function(t){var e=this.x,i=this.y,n=t.val;return this.x=n[0]*e+n[4]*i+n[12],this.y=n[1]*e+n[5]*i+n[13],this},reset:function(){return this.x=0,this.y=0,this},limit:function(t){var e=this.length();return e&&e>t&&this.scale(t/e),this},reflect:function(t){return t=t.clone().normalize(),this.subtract(t.scale(2*this.dot(t)))},mirror:function(t){return this.reflect(t).negate()},rotate:function(t){var e=Math.cos(t),i=Math.sin(t);return this.set(e*this.x-i*this.y,i*this.x+e*this.y)}});s.ZERO=new s,s.RIGHT=new s(1,0),s.LEFT=new s(-1,0),s.UP=new s(0,-1),s.DOWN=new s(0,1),s.ONE=new s(1,1),t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(55),s=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=t),this.type=r.POINT,this.x=t,this.y=e},setTo:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.x=t,this.y=e,this}});t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(24),s=i(21),o=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(s.BOOT,this.boot,this),this.events.on(s.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(s.DESTROY,this.destroy,this)},start:function(){this.events.once(s.SHUTDOWN,this.shutdown,this)},existing:function(t){return(t.renderCanvas||t.renderWebGL)&&this.displayList.add(t),t.preUpdate&&this.updateList.add(t),t},shutdown:function(){this.events.off(s.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(s.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});o.register=function(t,e){o.prototype.hasOwnProperty(t)||(o.prototype[t]=e)},o.remove=function(t){o.prototype.hasOwnProperty(t)&&delete o.prototype[t]},r.register("GameObjectFactory",o,"add"),t.exports=o},function(t,e){t.exports=function(t,e,i){if(t&&"number"!=typeof t){if(t.hasOwnProperty(e))return t[e];if(-1!==e.indexOf(".")){for(var n=e.split("."),r=t,s=i,o=0;o * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i={},n={install:function(t){for(var e in i)t[e]=i[e]},register:function(t,e){i[t]=e},destroy:function(){i={}}};t.exports=n},function(t,e,i){"use strict";var n=Object.prototype.hasOwnProperty,r="~";function s(){}function o(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function a(t,e,i,n,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new o(i,n||t,s),h=r?r+e:e;return t._events[h]?t._events[h].fn?t._events[h]=[t._events[h],a]:t._events[h].push(a):(t._events[h]=a,t._eventsCount++),t}function h(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function l(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(r=!1)),l.prototype.eventNames=function(){var t,e,i=[];if(0===this._eventsCount)return i;for(e in t=this._events)n.call(t,e)&&i.push(r?e.slice(1):e);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},l.prototype.listeners=function(t){var e=r?r+t:t,i=this._events[e];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,s=i.length,o=new Array(s);n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(56),s=i(167),o=i(300),a=i(55),h=i(45),l=i(170),c=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=a.RECTANGLE,this.x=t,this.y=e,this.width=i,this.height=n},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return s(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setEmpty:function(){return this.setTo(0,0,0,0)},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.y,this.right,this.y),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.y,this.right,this.bottom),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.right,this.bottom,this.x,this.bottom),t},getLineD:function(t){return void 0===t&&(t=new h),t.setTo(this.x,this.bottom,this.x,this.y),t},left:{get:function(){return this.x},set:function(t){t>=this.right?this.width=0:this.width=this.right-t,this.x=t}},right:{get:function(){return this.x+this.width},set:function(t){t<=this.x?this.width=0:this.width=t-this.x}},top:{get:function(){return this.y},set:function(t){t>=this.bottom?this.height=0:this.height=this.bottom-t,this.y=t}},bottom:{get:function(){return this.y+this.height},set:function(t){t<=this.y?this.height=0:this.height=t-this.y}},centerX:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=c},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Alpha:i(605),AlphaSingle:i(297),BlendMode:i(298),ComputedSize:i(606),Crop:i(607),Depth:i(299),Flip:i(608),GetBounds:i(609),Mask:i(303),Origin:i(630),PathFollower:i(631),Pipeline:i(171),ScrollFactor:i(306),Size:i(632),Texture:i(633),TextureCrop:i(634),Tint:i(635),ToJSON:i(173),Transform:i(307),TransformMatrix:i(25),Visible:i(308)}},function(t,e){ /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> * @author Matthew Groves <@doormat> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ function i(t){for(var e="",i=0;i0&&(e+="\nelse "),i>>0},getTintAppendFloatAlpha:function(t,e){return((255&(255*e|0))<<24|t)>>>0},getTintAppendFloatAlphaAndSwap:function(t,e){return((255&(255*e|0))<<24|(255&(0|t))<<16|(255&(t>>8|0))<<8|255&(t>>16|0))>>>0},getFloatsFromUintRGB:function(t){return[(255&(t>>16|0))/255,(255&(t>>8|0))/255,(255&(0|t))/255]},checkShaderMax:function(t,e){e&&-1!==e||(e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS));for(var n=t.createShader(t.FRAGMENT_SHADER),r=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join("\n");;){var s=r.replace(/%forloop%/gi,i(e));if(t.shaderSource(n,s),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS))break;e=e/2|0}return e},parseFragmentShaderMaxTextures:function(t,e){if(!t)return"";for(var i="",n=0;n0&&(i+="\n\telse "),n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(190),r=i(6);t.exports=function(t,e,i){var s=r(t,e,null);if(null===s)return i;if(Array.isArray(s))return n.RND.pick(s);if("object"==typeof s){if(s.hasOwnProperty("randInt"))return n.RND.integerInRange(s.randInt[0],s.randInt[1]);if(s.hasOwnProperty("randFloat"))return n.RND.realInRange(s.randFloat[0],s.randFloat[1])}else if("function"==typeof s)return s(e);return s}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i={PI2:2*Math.PI,TAU:.5*Math.PI,EPSILON:1e-6,DEG_TO_RAD:Math.PI/180,RAD_TO_DEG:180/Math.PI,RND:null,MIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER||-9007199254740991,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991};t.exports=i},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(173),s=i(98),o=i(9),a=i(75),h=new n({Extends:o,initialize:function(t,e){o.call(this),this.scene=t,this.displayList=null,this.type=e,this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.on(a.ADDED_TO_SCENE,this.addedToScene,this),this.on(a.REMOVED_FROM_SCENE,this.removedFromScene,this),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new s(this)),this},setData:function(t,e){return this.data||(this.data=new s(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new s(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new s(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new s(this)),this.data.get(t)},setInteractive:function(t,e,i){return this.scene.sys.input.enable(this,t,e,i),this},disableInteractive:function(){return this.input&&(this.input.enabled=!1),this},removeInteractive:function(){return this.scene.sys.input.clear(this),this.input=void 0,this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return r(this)},willRender:function(t){return!(h.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return this.displayList?i.unshift(this.displayList.getIndex(t)):i.unshift(this.scene.sys.displayList.getIndex(t)),i},destroy:function(){this.scene&&!this.ignoreDestroy&&(this.preDestroy&&this.preDestroy.call(this),this.emit(a.DESTROY,this),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.displayList&&(this.displayList.queueDepthSort(),this.displayList.remove(this)),this.input&&(this.scene.sys.input.clear(this),this.input=void 0),this.data&&(this.data.destroy(),this.data=void 0),this.body&&(this.body.destroy(),this.body=void 0),this.active=!1,this.visible=!1,this.scene=void 0,this.displayList=void 0,this.parentContainer=void 0)}});h.RENDER_MASK=15,t.exports=h},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(24),s=i(21),o=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.displayList,this.updateList,this.events.once(s.BOOT,this.boot,this),this.events.on(s.START,this.start,this)},boot:function(){this.displayList=this.systems.displayList,this.updateList=this.systems.updateList,this.events.once(s.DESTROY,this.destroy,this)},start:function(){this.events.once(s.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.events.off(s.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(s.START,this.start,this),this.scene=null,this.systems=null,this.events=null,this.displayList=null,this.updateList=null}});o.register=function(t,e){o.prototype.hasOwnProperty(t)||(o.prototype[t]=e)},o.remove=function(t){o.prototype.hasOwnProperty(t)&&delete o.prototype[t]},r.register("GameObjectCreator",o,"make"),t.exports=o},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(7),r=function(){var t,e,i,s,o,a,h=arguments[0]||{},l=1,c=arguments.length,u=!1;for("boolean"==typeof h&&(u=h,h=arguments[1]||{},l=2),c===l&&(h=this,--l);l * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(25),r=new n,s=new n,o=new n,a={camera:r,sprite:s,calc:o};t.exports=function(t,e,i){var n=r,h=s,l=o;return h.applyITRS(t.x,t.y,t.rotation,t.scaleX,t.scaleY),n.copyFrom(e.matrix),i?(n.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),h.e=t.x,h.f=t.y):(h.e-=e.scrollX*t.scrollFactorX,h.f-=e.scrollY*t.scrollFactorY),n.multiply(h,l),a}},function(t,e){t.exports={LOADER_IDLE:0,LOADER_LOADING:1,LOADER_PROCESSING:2,LOADER_COMPLETE:3,LOADER_SHUTDOWN:4,LOADER_DESTROYED:5,FILE_PENDING:10,FILE_LOADING:11,FILE_LOADED:12,FILE_FAILED:13,FILE_PROCESSING:14,FILE_ERRORED:16,FILE_COMPLETE:17,FILE_DESTROYED:18,FILE_POPULATED:19}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={ADDED_TO_SCENE:i(782),BOOT:i(783),CREATE:i(784),DESTROY:i(785),PAUSE:i(786),POST_UPDATE:i(787),PRE_UPDATE:i(788),READY:i(789),REMOVED_FROM_SCENE:i(790),RENDER:i(791),RESUME:i(792),SHUTDOWN:i(793),SLEEP:i(794),START:i(795),TRANSITION_COMPLETE:i(796),TRANSITION_INIT:i(797),TRANSITION_OUT:i(798),TRANSITION_START:i(799),TRANSITION_WAKE:i(800),UPDATE:i(801),WAKE:i(802)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={BLUR:i(610),BOOT:i(611),CONTEXT_LOST:i(612),CONTEXT_RESTORED:i(613),DESTROY:i(614),FOCUS:i(615),HIDDEN:i(616),PAUSE:i(617),POST_RENDER:i(618),POST_STEP:i(619),PRE_RENDER:i(620),PRE_STEP:i(621),READY:i(622),RESUME:i(623),STEP:i(624),VISIBLE:i(625)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(20),s=i(91),o=i(2),a=i(153),h=i(237),l=i(511),c=i(154),u=new n({initialize:function(t,e){this.loader=t,this.cache=o(e,"cache",!1),this.type=o(e,"type",!1),this.key=o(e,"key",!1);var i=this.key;if(t.prefix&&""!==t.prefix&&(this.key=t.prefix+i),!this.type||!this.key)throw new Error("Invalid Loader."+this.type+" key");var n=o(e,"url");void 0===n?n=t.path+i+"."+o(e,"extension",""):"string"!=typeof n||n.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)||(n=t.path+n),this.url=n,this.src="",this.xhrSettings=c(o(e,"responseType",void 0)),o(e,"xhrSettings",!1)&&(this.xhrSettings=h(this.xhrSettings,o(e,"xhrSettings",{}))),this.xhrLoader=null,this.state="function"==typeof this.url?r.FILE_POPULATED:r.FILE_PENDING,this.bytesTotal=0,this.bytesLoaded=-1,this.percentComplete=-1,this.crossOrigin=void 0,this.data=void 0,this.config=o(e,"config",{}),this.multiFile,this.linkFile},setLink:function(t){this.linkFile=t,t.linkFile=this},resetXHR:function(){this.xhrLoader&&(this.xhrLoader.onload=void 0,this.xhrLoader.onerror=void 0,this.xhrLoader.onprogress=void 0)},load:function(){this.state===r.FILE_POPULATED?this.loader.nextFile(this,!0):(this.state=r.FILE_LOADING,this.src=a(this,this.loader.baseURL),0===this.src.indexOf("data:")?console.warn("Local data URIs are not supported: "+this.key):this.xhrLoader=l(this,this.loader.xhr))},onLoad:function(t,e){var i=t.responseURL&&0===t.responseURL.indexOf("file://")&&0===e.target.status,n=!(e.target&&200!==e.target.status)||i;4===t.readyState&&t.status>=400&&t.status<=599&&(n=!1),this.state=r.FILE_LOADED,this.resetXHR(),this.loader.nextFile(this,n)},onError:function(){this.resetXHR(),this.loader.nextFile(this,!1)},onProgress:function(t){t.lengthComputable&&(this.bytesLoaded=t.loaded,this.bytesTotal=t.total,this.percentComplete=Math.min(this.bytesLoaded/this.bytesTotal,1),this.loader.emit(s.FILE_PROGRESS,this,this.percentComplete))},onProcess:function(){this.state=r.FILE_PROCESSING,this.onProcessComplete()},onProcessComplete:function(){this.state=r.FILE_COMPLETE,this.multiFile&&this.multiFile.onFileComplete(this),this.loader.fileProcessComplete(this)},onProcessError:function(){this.state=r.FILE_ERRORED,this.multiFile&&this.multiFile.onFileFailed(this),this.loader.fileProcessComplete(this)},hasCacheConflict:function(){return this.cache&&this.cache.exists(this.key)},addToCache:function(){this.cache&&this.cache.add(this.key,this.data),this.pendingDestroy()},pendingDestroy:function(t){void 0===t&&(t=this.data);var e=this.key,i=this.type;this.loader.emit(s.FILE_COMPLETE,e,i,t),this.loader.emit(s.FILE_KEY_COMPLETE+i+"-"+e,e,i,t),this.loader.flagForRemoval(this)},destroy:function(){this.loader=null,this.cache=null,this.xhrSettings=null,this.multiFile=null,this.linkFile=null,this.data=null}});u.createObjectURL=function(t,e,i){if("function"==typeof URL)t.src=URL.createObjectURL(e);else{var n=new FileReader;n.onload=function(){t.removeAttribute("crossOrigin"),t.src="data:"+(e.type||i)+";base64,"+n.result.split(",")[1]},n.onerror=t.onerror,n.readAsDataURL(e)}},u.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=u},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i={},n={},r={register:function(t,e,n,r){void 0===r&&(r=!1),i[t]={plugin:e,mapping:n,custom:r}},registerCustom:function(t,e,i,r){n[t]={plugin:e,mapping:i,data:r}},hasCore:function(t){return i.hasOwnProperty(t)},hasCustom:function(t){return n.hasOwnProperty(t)},getCore:function(t){return i[t]},getCustom:function(t){return n[t]},getCustomClass:function(t){return n.hasOwnProperty(t)?n[t].plugin:null},remove:function(t){i.hasOwnProperty(t)&&delete i[t]},removeCustom:function(t){n.hasOwnProperty(t)&&delete n[t]},destroyCorePlugins:function(){for(var t in i)i.hasOwnProperty(t)&&delete i[t]},destroyCustomPlugins:function(){for(var t in n)n.hasOwnProperty(t)&&delete n[t]}};t.exports=r},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(14),s=i(3),o=new n({initialize:function(t,e,i,n,r,s){void 0===t&&(t=1),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),void 0===r&&(r=0),void 0===s&&(s=0),this.matrix=new Float32Array([t,e,i,n,r,s,0,0,1]),this.decomposedMatrix={translateX:0,translateY:0,scaleX:1,scaleY:1,rotation:0}},a:{get:function(){return this.matrix[0]},set:function(t){this.matrix[0]=t}},b:{get:function(){return this.matrix[1]},set:function(t){this.matrix[1]=t}},c:{get:function(){return this.matrix[2]},set:function(t){this.matrix[2]=t}},d:{get:function(){return this.matrix[3]},set:function(t){this.matrix[3]=t}},e:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},f:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},tx:{get:function(){return this.matrix[4]},set:function(t){this.matrix[4]=t}},ty:{get:function(){return this.matrix[5]},set:function(t){this.matrix[5]=t}},rotation:{get:function(){return Math.acos(this.a/this.scaleX)*(Math.atan(-this.c/this.a)<0?-1:1)}},rotationNormalized:{get:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],s=t[3];return e||i?i>0?Math.acos(e/this.scaleX):-Math.acos(e/this.scaleX):n||s?r.TAU-(s>0?Math.acos(-n/this.scaleY):-Math.acos(n/this.scaleY)):0}},scaleX:{get:function(){return Math.sqrt(this.a*this.a+this.b*this.b)}},scaleY:{get:function(){return Math.sqrt(this.c*this.c+this.d*this.d)}},loadIdentity:function(){var t=this.matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,this},translate:function(t,e){var i=this.matrix;return i[4]=i[0]*t+i[2]*e+i[4],i[5]=i[1]*t+i[3]*e+i[5],this},scale:function(t,e){var i=this.matrix;return i[0]*=t,i[1]*=t,i[2]*=e,i[3]*=e,this},rotate:function(t){var e=Math.sin(t),i=Math.cos(t),n=this.matrix,r=n[0],s=n[1],o=n[2],a=n[3];return n[0]=r*i+o*e,n[1]=s*i+a*e,n[2]=r*-e+o*i,n[3]=s*-e+a*i,this},multiply:function(t,e){var i=this.matrix,n=t.matrix,r=i[0],s=i[1],o=i[2],a=i[3],h=i[4],l=i[5],c=n[0],u=n[1],d=n[2],p=n[3],f=n[4],m=n[5],g=void 0===e?this:e;return g.a=c*r+u*o,g.b=c*s+u*a,g.c=d*r+p*o,g.d=d*s+p*a,g.e=f*r+m*o+h,g.f=f*s+m*a+l,g},multiplyWithOffset:function(t,e,i){var n=this.matrix,r=t.matrix,s=n[0],o=n[1],a=n[2],h=n[3],l=e*s+i*a+n[4],c=e*o+i*h+n[5],u=r[0],d=r[1],p=r[2],f=r[3],m=r[4],g=r[5];return n[0]=u*s+d*a,n[1]=u*o+d*h,n[2]=p*s+f*a,n[3]=p*o+f*h,n[4]=m*s+g*a+l,n[5]=m*o+g*h+c,this},transform:function(t,e,i,n,r,s){var o=this.matrix,a=o[0],h=o[1],l=o[2],c=o[3],u=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*c,o[2]=i*a+n*l,o[3]=i*h+n*c,o[4]=r*a+s*l+u,o[5]=r*h+s*c+d,this},transformPoint:function(t,e,i){void 0===i&&(i={x:0,y:0});var n=this.matrix,r=n[0],s=n[1],o=n[2],a=n[3],h=n[4],l=n[5];return i.x=t*r+e*o+h,i.y=t*s+e*a+l,i},invert:function(){var t=this.matrix,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=e*r-i*n;return t[0]=r/a,t[1]=-i/a,t[2]=-n/a,t[3]=e/a,t[4]=(n*o-r*s)/a,t[5]=-(e*o-i*s)/a,this},copyFrom:function(t){var e=this.matrix;return e[0]=t.a,e[1]=t.b,e[2]=t.c,e[3]=t.d,e[4]=t.e,e[5]=t.f,this},copyFromArray:function(t){var e=this.matrix;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],this},copyToContext:function(t){var e=this.matrix;return t.transform(e[0],e[1],e[2],e[3],e[4],e[5]),t},setToContext:function(t){var e=this.matrix;return t.setTransform(e[0],e[1],e[2],e[3],e[4],e[5]),t},copyToArray:function(t){var e=this.matrix;return void 0===t?t=[e[0],e[1],e[2],e[3],e[4],e[5]]:(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5]),t},setTransform:function(t,e,i,n,r,s){var o=this.matrix;return o[0]=t,o[1]=e,o[2]=i,o[3]=n,o[4]=r,o[5]=s,this},decomposeMatrix:function(){var t=this.decomposedMatrix,e=this.matrix,i=e[0],n=e[1],r=e[2],s=e[3],o=i*s-n*r;if(t.translateX=e[4],t.translateY=e[5],i||n){var a=Math.sqrt(i*i+n*n);t.rotation=n>0?Math.acos(i/a):-Math.acos(i/a),t.scaleX=a,t.scaleY=o/a}else if(r||s){var h=Math.sqrt(r*r+s*s);t.rotation=.5*Math.PI-(s>0?Math.acos(-r/h):-Math.acos(r/h)),t.scaleX=o/h,t.scaleY=h}else t.rotation=0,t.scaleX=0,t.scaleY=0;return t},applyITRS:function(t,e,i,n,r){var s=this.matrix,o=Math.sin(i),a=Math.cos(i);return s[4]=t,s[5]=e,s[0]=a*n,s[1]=o*n,s[2]=-o*r,s[3]=a*r,this},applyInverse:function(t,e,i){void 0===i&&(i=new s);var n=this.matrix,r=n[0],o=n[1],a=n[2],h=n[3],l=n[4],c=n[5],u=1/(r*h+a*-o);return i.x=h*u*t+-a*u*e+(c*a-l*h)*u,i.y=r*u*e+-o*u*t+(-c*r+l*o)*u,i},getX:function(t,e){return t*this.a+e*this.c+this.e},getY:function(t,e){return t*this.b+e*this.d+this.f},getXRound:function(t,e,i){var n=this.getX(t,e);return i&&(n=Math.round(n)),n},getYRound:function(t,e,i){var n=this.getY(t,e);return i&&(n=Math.round(n)),n},getCSSMatrix:function(){var t=this.matrix;return"matrix("+t[0]+","+t[1]+","+t[2]+","+t[3]+","+t[4]+","+t[5]+")"},destroy:function(){this.matrix=null,this.decomposedMatrix=null}});t.exports=o},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(2);t.exports=function(t,e,i,r,s,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=o.width),void 0===r&&(r=o.height),s||(s={});var a=n(s,"isNotEmpty",!1),h=n(s,"isColliding",!1),l=n(s,"hasInterestingFace",!1);t<0&&(i+=t,t=0),e<0&&(r+=e,e=0),t+i>o.width&&(i=Math.max(o.width-t,0)),e+r>o.height&&(r=Math.max(o.height-e,0));for(var c=[],u=e;u=0;o--)t[o][e]=i+a*n,a++;return t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(34),r=i(13);t.exports=function(t,e,i){e.x=r(i,"x",0),e.y=r(i,"y",0),e.depth=r(i,"depth",0),e.flipX=r(i,"flipX",!1),e.flipY=r(i,"flipY",!1);var s=r(i,"scale",null);"number"==typeof s?e.setScale(s):null!==s&&(e.scaleX=r(s,"x",1),e.scaleY=r(s,"y",1));var o=r(i,"scrollFactor",null);"number"==typeof o?e.setScrollFactor(o):null!==o&&(e.scrollFactorX=r(o,"x",1),e.scrollFactorY=r(o,"y",1)),e.rotation=r(i,"rotation",0);var a=r(i,"angle",null);null!==a&&(e.angle=a),e.alpha=r(i,"alpha",1);var h=r(i,"origin",null);if("number"==typeof h)e.setOrigin(h);else if(null!==h){var l=r(h,"x",.5),c=r(h,"y",.5);e.setOrigin(l,c)}return e.blendMode=r(i,"blendMode",n.NORMAL),e.visible=r(i,"visible",!0),r(i,"add",!0)&&t.sys.displayList.add(e),e.preUpdate&&t.sys.updateList.add(e),e}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(19);t.exports=function(t,e,i,r,s){var o=r.alpha*i.alpha;if(o<=0)return!1;var a=n(i,r,s).calc;return e.globalCompositeOperation=t.blendModes[i.blendMode],e.globalAlpha=o,e.save(),a.setToContext(e),e.imageSmoothingEnabled=!(!t.antialias||i.frame&&i.frame.source.scaleMode),!0}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n,r,s,o=i(32),a=i(189),h=[],l=!1;t.exports=(s=function(){var t=0;return h.forEach((function(e){e.parent&&t++})),t},{create2D:function(t,e,i){return n(t,e,i,o.CANVAS)},create:n=function(t,e,i,n,s){var c;void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=o.CANVAS),void 0===s&&(s=!1);var u=r(n);return null===u?(u={parent:t,canvas:document.createElement("canvas"),type:n},n===o.CANVAS&&h.push(u),c=u.canvas):(u.parent=t,c=u.canvas),s&&(u.parent=c),c.width=e,c.height=i,l&&n===o.CANVAS&&a.disable(c.getContext("2d")),c},createWebGL:function(t,e,i){return n(t,e,i,o.WEBGL)},disableSmoothing:function(){l=!0},enableSmoothing:function(){l=!1},first:r=function(t){if(void 0===t&&(t=o.CANVAS),t===o.WEBGL)return null;for(var e=0;e * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n={VERSION:"3.52.0",BlendModes:i(34),ScaleModes:i(164),AUTO:0,CANVAS:1,WEBGL:2,HEADLESS:3,FOREVER:-1,NONE:4,UP:5,DOWN:6,LEFT:7,RIGHT:8};t.exports=n},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(11),s=i(15),o=i(45),a=i(65),h=new n({Extends:s,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Transform,r.Visible],initialize:function(t,e,i){void 0===e&&(e="Shape"),s.call(this,t,e),this.geom=i,this.pathData=[],this.pathIndexes=[],this.fillColor=16777215,this.fillAlpha=1,this.strokeColor=16777215,this.strokeAlpha=1,this.lineWidth=1,this.isFilled=!1,this.isStroked=!1,this.closePath=!0,this._tempLine=new o,this.width=0,this.height=0,this.initPipeline(a.GRAPHICS_PIPELINE)},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.isFilled=!1:(this.fillColor=t,this.fillAlpha=e,this.isFilled=!0),this},setStrokeStyle:function(t,e,i){return void 0===i&&(i=1),void 0===t?this.isStroked=!1:(this.lineWidth=t,this.strokeColor=e,this.strokeAlpha=i,this.isStroked=!0),this},setClosePath:function(t){return this.closePath=t,this},setSize:function(t,e){return this.width=t,this.height=e,this},preDestroy:function(){this.geom=null,this._tempLine=null,this.pathData=[],this.pathIndexes=[]},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}}});t.exports=h},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={SKIP_CHECK:-1,NORMAL:0,ADD:1,MULTIPLY:2,SCREEN:3,OVERLAY:4,DARKEN:5,LIGHTEN:6,COLOR_DODGE:7,COLOR_BURN:8,HARD_LIGHT:9,SOFT_LIGHT:10,DIFFERENCE:11,EXCLUSION:12,HUE:13,SATURATION:14,COLOR:15,LUMINOSITY:16,ERASE:17,SOURCE_IN:18,SOURCE_OUT:19,SOURCE_ATOP:20,DESTINATION_OVER:21,DESTINATION_IN:22,DESTINATION_OUT:23,DESTINATION_ATOP:24,LIGHTER:25,COPY:26,XOR:27}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(14);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={DESTROY:i(719),FADE_IN_COMPLETE:i(720),FADE_IN_START:i(721),FADE_OUT_COMPLETE:i(722),FADE_OUT_START:i(723),FLASH_COMPLETE:i(724),FLASH_START:i(725),FOLLOW_UPDATE:i(726),PAN_COMPLETE:i(727),PAN_START:i(728),POST_RENDER:i(729),PRE_RENDER:i(730),ROTATE_COMPLETE:i(731),ROTATE_START:i(732),SHAKE_COMPLETE:i(733),SHAKE_START:i(734),ZOOM_COMPLETE:i(735),ZOOM_START:i(736)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(100),s=i(322),o=i(185),a=i(323),h=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=255),this.r=0,this.g=0,this.b=0,this.a=255,this._h=0,this._s=0,this._v=0,this._locked=!1,this.gl=[0,0,0,1],this._color=0,this._color32=0,this._rgba="",this.setTo(t,e,i,n)},transparent:function(){return this._locked=!0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this._locked=!1,this.update(!0)},setTo:function(t,e,i,n,r){return void 0===n&&(n=255),void 0===r&&(r=!0),this._locked=!0,this.red=t,this.green=e,this.blue=i,this.alpha=n,this._locked=!1,this.update(r)},setGLTo:function(t,e,i,n){return void 0===n&&(n=1),this._locked=!0,this.redGL=t,this.greenGL=e,this.blueGL=i,this.alphaGL=n,this._locked=!1,this.update(!0)},setFromRGB:function(t){return this._locked=!0,this.red=t.r,this.green=t.g,this.blue=t.b,t.hasOwnProperty("a")&&(this.alpha=t.a),this._locked=!1,this.update(!0)},setFromHSV:function(t,e,i){return o(t,e,i,this)},update:function(t){if(void 0===t&&(t=!1),this._locked)return this;var e=this.r,i=this.g,n=this.b,o=this.a;return this._color=r(e,i,n),this._color32=s(e,i,n,o),this._rgba="rgba("+e+","+i+","+n+","+o/255+")",t&&a(e,i,n,this),this},updateHSV:function(){var t=this.r,e=this.g,i=this.b;return a(t,e,i,this),this},clone:function(){return new h(this.r,this.g,this.b,this.a)},gray:function(t){return this.setTo(t,t,t)},random:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t)),n=Math.floor(t+Math.random()*(e-t)),r=Math.floor(t+Math.random()*(e-t));return this.setTo(i,n,r)},randomGray:function(t,e){void 0===t&&(t=0),void 0===e&&(e=255);var i=Math.floor(t+Math.random()*(e-t));return this.setTo(i,i,i)},saturate:function(t){return this.s+=t/100,this},desaturate:function(t){return this.s-=t/100,this},lighten:function(t){return this.v+=t/100,this},darken:function(t){return this.v-=t/100,this},brighten:function(t){var e=this.r,i=this.g,n=this.b;return e=Math.max(0,Math.min(255,e-Math.round(-t/100*255))),i=Math.max(0,Math.min(255,i-Math.round(-t/100*255))),n=Math.max(0,Math.min(255,n-Math.round(-t/100*255))),this.setTo(e,i,n)},color:{get:function(){return this._color}},color32:{get:function(){return this._color32}},rgba:{get:function(){return this._rgba}},redGL:{get:function(){return this.gl[0]},set:function(t){this.gl[0]=Math.min(Math.abs(t),1),this.r=Math.floor(255*this.gl[0]),this.update(!0)}},greenGL:{get:function(){return this.gl[1]},set:function(t){this.gl[1]=Math.min(Math.abs(t),1),this.g=Math.floor(255*this.gl[1]),this.update(!0)}},blueGL:{get:function(){return this.gl[2]},set:function(t){this.gl[2]=Math.min(Math.abs(t),1),this.b=Math.floor(255*this.gl[2]),this.update(!0)}},alphaGL:{get:function(){return this.gl[3]},set:function(t){this.gl[3]=Math.min(Math.abs(t),1),this.a=Math.floor(255*this.gl[3]),this.update()}},red:{get:function(){return this.r},set:function(t){t=Math.floor(Math.abs(t)),this.r=Math.min(t,255),this.gl[0]=t/255,this.update(!0)}},green:{get:function(){return this.g},set:function(t){t=Math.floor(Math.abs(t)),this.g=Math.min(t,255),this.gl[1]=t/255,this.update(!0)}},blue:{get:function(){return this.b},set:function(t){t=Math.floor(Math.abs(t)),this.b=Math.min(t,255),this.gl[2]=t/255,this.update(!0)}},alpha:{get:function(){return this.a},set:function(t){t=Math.floor(Math.abs(t)),this.a=Math.min(t,255),this.gl[3]=t/255,this.update()}},h:{get:function(){return this._h},set:function(t){this._h=t,o(t,this._s,this._v,this)}},s:{get:function(){return this._s},set:function(t){this._s=t,o(this._h,t,this._v,this)}},v:{get:function(){return this._v},set:function(t){this._v=t,o(this._h,this._s,t,this)}}});t.exports=h},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=new(i(0))({initialize:function(t,e,i){this.x=0,this.y=0,this.z=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0)},up:function(){return this.x=0,this.y=1,this.z=0,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},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},clone:function(){return new n(this.x,this.y,this.z)},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},crossVectors:function(t,e){var i=t.x,n=t.y,r=t.z,s=e.x,o=e.y,a=e.z;return this.x=n*a-r*o,this.y=r*s-i*a,this.z=i*o-n*s,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this},set:function(t,e,i){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0):(this.x=t||0,this.y=e||0,this.z=i||0),this},setFromMatrixPosition:function(t){return this.fromArray(t.val,12)},setFromMatrixColumn:function(t,e){return this.fromArray(t.val,4*e)},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},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addScale:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this},scale:function(t){return isFinite(t)?(this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return Math.sqrt(e*e+i*i+n*n)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0;return e*e+i*i+n*n},length:function(){var t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)},lengthSq:function(){var t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},normalize:function(){var t=this.x,e=this.y,i=this.z,n=t*t+e*e+i*i;return n>0&&(n=1/Math.sqrt(n),this.x=t*n,this.y=e*n,this.z=i*n),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},cross:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,o=t.z;return this.x=i*o-n*s,this.y=n*r-e*o,this.z=e*s-i*r,this},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=r+e*(t.z-r),this},applyMatrix3:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;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.val,s=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])*s,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*s,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*s,this},transformMat3:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=e*r[0]+i*r[3]+n*r[6],this.y=e*r[1]+i*r[4]+n*r[7],this.z=e*r[2]+i*r[5]+n*r[8],this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,r=t.val;return this.x=r[0]*e+r[4]*i+r[8]*n+r[12],this.y=r[1]*e+r[5]*i+r[9]*n+r[13],this.z=r[2]*e+r[6]*i+r[10]*n+r[14],this},transformCoordinates:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=e*r[0]+i*r[4]+n*r[8]+r[12],o=e*r[1]+i*r[5]+n*r[9]+r[13],a=e*r[2]+i*r[6]+n*r[10]+r[14],h=e*r[3]+i*r[7]+n*r[11]+r[15];return this.x=s/h,this.y=o/h,this.z=a/h,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,o=t.z,a=t.w,h=a*e+s*n-o*i,l=a*i+o*e-r*n,c=a*n+r*i-s*e,u=-r*e-s*i-o*n;return this.x=h*a+u*-r+l*-o-c*-s,this.y=l*a+u*-s+c*-r-h*-o,this.z=c*a+u*-o+h*-s-l*-r,this},project:function(t){var e=this.x,i=this.y,n=this.z,r=t.val,s=r[0],o=r[1],a=r[2],h=r[3],l=r[4],c=r[5],u=r[6],d=r[7],p=r[8],f=r[9],m=r[10],g=r[11],v=r[12],y=r[13],x=r[14],b=1/(e*h+i*d+n*g+r[15]);return this.x=(e*s+i*l+n*p+v)*b,this.y=(e*o+i*c+n*f+y)*b,this.z=(e*a+i*u+n*m+x)*b,this},projectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unprojectViewMatrix:function(t,e){return this.applyMatrix4(t).applyMatrix4(e)},unproject:function(t,e){var i=t.x,n=t.y,r=t.z,s=t.w,o=this.x-i,a=s-this.y-1-n,h=this.z;return this.x=2*o/r-1,this.y=2*a/s-1,this.z=2*h-1,this.project(e)},reset:function(){return this.x=0,this.y=0,this.z=0,this}});n.ZERO=new n,n.RIGHT=new n(1,0,0),n.LEFT=new n(-1,0,0),n.UP=new n(0,-1,0),n.DOWN=new n(0,1,0),n.FORWARD=new n(0,0,1),n.BACK=new n(0,0,-1),n.ONE=new n(1,1,1),t.exports=n},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},function(t,e){t.exports=function(t){return t.y+t.height-t.height*t.originY}},function(t,e){t.exports=function(t){return t.x-t.width*t.originX}},function(t,e){t.exports=function(t){return t.x+t.width-t.width*t.originX}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY}},function(t,e){t.exports=function(t,e,i,n,r,s){var o;void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=1);var a=0,h=t.length;if(1===s)for(o=r;o=0;o--)t[o][e]+=i+a*n,a++;return t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(301),s=i(168),o=i(55),a=i(169),h=i(3),l=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=o.LINE,this.x1=t,this.y1=e,this.x2=i,this.y2=n},getPoint:function(t,e){return r(this,t,e)},getPoints:function(t,e,i){return s(this,t,e,i)},getRandomPoint:function(t){return a(this,t)},setTo:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this},getPointA:function(t){return void 0===t&&(t=new h),t.set(this.x1,this.y1),t},getPointB:function(t){return void 0===t&&(t=new h),t.set(this.x2,this.y2),t},left:{get:function(){return Math.min(this.x1,this.x2)},set:function(t){this.x1<=this.x2?this.x1=t:this.x2=t}},right:{get:function(){return Math.max(this.x1,this.x2)},set:function(t){this.x1>this.x2?this.x1=t:this.x2=t}},top:{get:function(){return Math.min(this.y1,this.y2)},set:function(t){this.y1<=this.y2?this.y1=t:this.y2=t}},bottom:{get:function(){return Math.max(this.y1,this.y2)},set:function(t){this.y1>this.y2?this.y1=t:this.y2=t}}});t.exports=l},function(t,e){t.exports=function(t,e,i,n){var r=i||e.fillColor,s=n||e.fillAlpha,o=(16711680&r)>>>16,a=(65280&r)>>>8,h=255&r;t.fillStyle="rgba("+o+","+a+","+h+","+s+")"}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=new(i(0))({initialize:function(t,e,i,n){var r=[];n.forEach((function(t){t&&r.push(t)})),this.loader=t,this.type=e,this.key=i,this.multiKeyIndex=t.multiKeyIndex++,this.files=r,this.complete=!1,this.pending=r.length,this.failed=0,this.config={},this.baseURL=t.baseURL,this.path=t.path,this.prefix=t.prefix;for(var s=0;s * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={BOOT:i(918),DESTROY:i(919),DRAG_END:i(920),DRAG_ENTER:i(921),DRAG:i(922),DRAG_LEAVE:i(923),DRAG_OVER:i(924),DRAG_START:i(925),DROP:i(926),GAME_OUT:i(927),GAME_OVER:i(928),GAMEOBJECT_DOWN:i(929),GAMEOBJECT_DRAG_END:i(930),GAMEOBJECT_DRAG_ENTER:i(931),GAMEOBJECT_DRAG:i(932),GAMEOBJECT_DRAG_LEAVE:i(933),GAMEOBJECT_DRAG_OVER:i(934),GAMEOBJECT_DRAG_START:i(935),GAMEOBJECT_DROP:i(936),GAMEOBJECT_MOVE:i(937),GAMEOBJECT_OUT:i(938),GAMEOBJECT_OVER:i(939),GAMEOBJECT_POINTER_DOWN:i(940),GAMEOBJECT_POINTER_MOVE:i(941),GAMEOBJECT_POINTER_OUT:i(942),GAMEOBJECT_POINTER_OVER:i(943),GAMEOBJECT_POINTER_UP:i(944),GAMEOBJECT_POINTER_WHEEL:i(945),GAMEOBJECT_UP:i(946),GAMEOBJECT_WHEEL:i(947),MANAGER_BOOT:i(948),MANAGER_PROCESS:i(949),MANAGER_UPDATE:i(950),POINTER_DOWN:i(951),POINTER_DOWN_OUTSIDE:i(952),POINTER_MOVE:i(953),POINTER_OUT:i(954),POINTER_OVER:i(955),POINTER_UP:i(956),POINTER_UP_OUTSIDE:i(957),POINTER_WHEEL:i(958),POINTERLOCK_CHANGE:i(959),PRE_UPDATE:i(960),SHUTDOWN:i(961),START:i(962),UPDATE:i(963)}},function(t,e){var i={};t.exports=i,function(){i._nextId=0,i._seed=0,i._nowStartTime=+new Date,i.extend=function(t,e){var n,r;"boolean"==typeof e?(n=2,r=e):(n=1,r=!0);for(var s=n;s0;e--){var n=Math.floor(i.random()*(e+1)),r=t[e];t[e]=t[n],t[n]=r}return t},i.choose=function(t){return t[Math.floor(i.random()*t.length)]},i.isElement=function(t){return"undefined"!=typeof HTMLElement?t instanceof HTMLElement:!!(t&&t.nodeType&&t.nodeName)},i.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},i.isFunction=function(t){return"function"==typeof t},i.isPlainObject=function(t){return"object"==typeof t&&t.constructor===Object},i.isString=function(t){return"[object String]"===Object.prototype.toString.call(t)},i.clamp=function(t,e,i){return ti?i:t},i.sign=function(t){return t<0?-1:1},i.now=function(){if("undefined"!=typeof window&&window.performance){if(window.performance.now)return window.performance.now();if(window.performance.webkitNow)return window.performance.webkitNow()}return new Date-i._nowStartTime},i.random=function(e,i){return i=void 0!==i?i:1,(e=void 0!==e?e:0)+t()*(i-e)};var t=function(){return i._seed=(9301*i._seed+49297)%233280,i._seed/233280};i.colorToNumber=function(t){return 3==(t=t.replace("#","")).length&&(t=t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2)),parseInt(t,16)},i.logLevel=1,i.log=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.log.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.info=function(){console&&i.logLevel>0&&i.logLevel<=2&&console.info.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.warn=function(){console&&i.logLevel>0&&i.logLevel<=3&&console.warn.apply(console,["matter-js:"].concat(Array.prototype.slice.call(arguments)))},i.nextId=function(){return i._nextId++},i.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i=e&&t.y<=i&&t.y+t.height>=i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(172),s=i(9),o=i(368),a=i(2),h=i(67),l=i(88),c=i(139),u=i(12),d=i(369),p=new n({Extends:s,initialize:function(t){s.call(this);var e=t.game,i=e.renderer,n=i.gl;this.name=a(t,"name","WebGLPipeline"),this.game=e,this.renderer=i,this.manager,this.gl=n,this.view=e.canvas,this.width=0,this.height=0,this.vertexCount=0,this.vertexCapacity=0,this.vertexData,this.vertexBuffer,this.topology=a(t,"topology",n.TRIANGLES),this.bytes,this.vertexViewF32,this.vertexViewU32,this.active=!0,this.currentUnit=0,this.forceZero=a(t,"forceZero",!1),this.hasBooted=!1,this.isPostFX=!1,this.renderTargets=[],this.currentRenderTarget,this.shaders=[],this.currentShader,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.config=t},boot:function(){var t,e=this.gl,i=this.config,n=this.renderer;this.isPostFX||(this.projectionMatrix=(new h).identity());var r=this.renderTargets,s=a(i,"renderTarget",!1);"boolean"==typeof s&&s&&(s=1);var u=n.width,d=n.height;if("number"==typeof s)for(t=0;tv&&(v=g[t].vertexSize);var y=a(i,"batchSize",n.config.batchSize);this.vertexCapacity=6*y;var x=new ArrayBuffer(this.vertexCapacity*v);this.vertexData=x,this.bytes=new Uint8Array(x),this.vertexViewF32=new Float32Array(x),this.vertexViewU32=new Uint32Array(x);var b=a(i,"vertices",null);for(b?(this.vertexViewF32.set(b),this.vertexBuffer=n.createVertexBuffer(x,e.STATIC_DRAW)):this.vertexBuffer=n.createVertexBuffer(x.byteLength,e.DYNAMIC_DRAW),this.setVertexBuffer(),t=g.length-1;t>=0;t--)g[t].rebind();this.hasBooted=!0,n.on(l.RESIZE,this.resize,this),n.on(l.PRE_RENDER,this.onPreRender,this),n.on(l.RENDER,this.onRender,this),n.on(l.POST_RENDER,this.onPostRender,this),this.emit(o.BOOT,this),this.onBoot()},onBoot:function(){},onResize:function(){},setShader:function(t,e){var i=this.renderer;return t===this.currentShader&&i.currentProgram===this.currentShader.program||(this.flush(),i.resetTextures(),this.setVertexBuffer()&&!e&&(e=!0),t.bind(e,!1),this.currentShader=t),this},getShaderByName:function(t){for(var e=this.shaders,i=0;ithis.vertexCapacity},resize:function(t,e){t===this.width&&e===this.height||this.flush(),this.width=t,this.height=e;for(var i=this.renderTargets,n=0;n=0;e--)this.currentShader=t[e].rebind();return this.emit(o.REBIND,this.currentShader),this.onActive(this.currentShader),this.onRebind(),this},setVertexBuffer:function(){var t=this.gl,e=this.vertexBuffer;return t.getParameter(t.ARRAY_BUFFER_BINDING)!==e&&(t.bindBuffer(t.ARRAY_BUFFER,e),!0)},preBatch:function(t){return this.currentRenderTarget&&this.currentRenderTarget.bind(),this.onPreBatch(t),this},postBatch:function(t){return this.onDraw(this.currentRenderTarget),this.onPostBatch(t),this},onDraw:function(){},unbind:function(){this.currentRenderTarget&&this.currentRenderTarget.unbind()},flush:function(t){if(void 0===t&&(t=!1),this.vertexCount>0){this.emit(o.BEFORE_FLUSH,this,t),this.onBeforeFlush(t);var e=this.gl,i=this.vertexCount,n=this.currentShader.vertexSize;this.active&&(this.setVertexBuffer(),i===this.vertexCapacity?e.bufferData(e.ARRAY_BUFFER,this.vertexData,e.DYNAMIC_DRAW):e.bufferSubData(e.ARRAY_BUFFER,0,this.bytes.subarray(0,i*n)),e.drawArrays(this.topology,0,i)),this.vertexCount=0,this.emit(o.AFTER_FLUSH,this,t),this.onAfterFlush(t)}return this},onActive:function(){},onBind:function(){},onRebind:function(){},onBatch:function(){},onPreBatch:function(){},onPostBatch:function(){},onPreRender:function(){},onRender:function(){},onPostRender:function(){},onBeforeFlush:function(){},onAfterFlush:function(){},batchVert:function(t,e,i,n,r,s,o){var a=this.vertexViewF32,h=this.vertexViewU32,l=this.vertexCount*this.currentShader.vertexComponentCount-1;a[++l]=t,a[++l]=e,a[++l]=i,a[++l]=n,a[++l]=r,a[++l]=s,h[++l]=o,this.vertexCount++},batchQuad:function(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f,m,g,v,y,x){void 0===x&&(x=this.currentUnit);var b=!1;return this.shouldFlush(6)&&(this.flush(),b=!0,x=this.setTexture2D(y)),this.batchVert(e,i,l,c,x,v,p),this.batchVert(n,r,l,d,x,v,m),this.batchVert(s,o,u,d,x,v,g),this.batchVert(e,i,l,c,x,v,p),this.batchVert(s,o,u,d,x,v,g),this.batchVert(a,h,u,c,x,v,f),this.onBatch(t),b},batchTri:function(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f,m,g){void 0===g&&(g=this.currentUnit);var v=!1;return this.shouldFlush(3)&&(this.flush(),v=!0,g=this.setTexture2D(m)),this.batchVert(e,i,a,h,g,f,u),this.batchVert(n,r,a,c,g,f,d),this.batchVert(s,o,l,c,g,f,p),this.onBatch(t),v},drawFillRect:function(t,e,i,n,r,s,o,a){void 0===o&&(o=this.renderer.whiteTexture.glTexture),void 0===a&&(a=!0),t=Math.floor(t),e=Math.floor(e);var h=Math.floor(t+i),l=Math.floor(e+n),c=this.setTexture2D(o),d=u.getTintAppendFloatAlphaAndSwap(r,s),p=0,f=1;a&&(p=1,f=0),this.batchQuad(null,t,e,t,l,h,l,h,e,0,p,1,f,d,d,d,d,0,o,c)},setTexture2D:function(t){return void 0===t&&(t=this.renderer.whiteTexture.glTexture),this.currentUnit=this.renderer.setTexture2D(t),this.currentUnit},bindTexture:function(t,e){void 0===e&&(e=0);var i=this.gl;return i.activeTexture(i.TEXTURE0+e),i.bindTexture(i.TEXTURE_2D,t),this},bindRenderTarget:function(t,e){return this.bindTexture(t.texture,e)},setTime:function(t){return this.set1f(t,this.game.loop.getDuration()),this},set1f:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1f(t,e),this},set2f:function(t,e,i,n){return void 0===n&&(n=this.currentShader),n.set2f(t,e,i),this},set3f:function(t,e,i,n,r){return void 0===r&&(r=this.currentShader),r.set3f(t,e,i,n),this},set4f:function(t,e,i,n,r,s){return void 0===s&&(s=this.currentShader),s.set4f(t,e,i,n,r),this},set1fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1fv(t,e),this},set2fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set2fv(t,e),this},set3fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set3fv(t,e),this},set4fv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set4fv(t,e),this},set1iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1iv(t,e),this},set2iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set2iv(t,e),this},set3iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set3iv(t,e),this},set4iv:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set4iv(t,e),this},set1i:function(t,e,i){return void 0===i&&(i=this.currentShader),i.set1i(t,e),this},set2i:function(t,e,i,n){return void 0===n&&(n=this.currentShader),n.set2i(t,e,i),this},set3i:function(t,e,i,n,r){return void 0===r&&(r=this.currentShader),r.set3i(t,e,i,n),this},set4i:function(t,e,i,n,r,s){return void 0===s&&(s=this.currentShader),s.set4i(t,e,i,n,r),this},setMatrix2fv:function(t,e,i,n){return void 0===n&&(n=this.currentShader),n.setMatrix2fv(t,e,i),this},setMatrix3fv:function(t,e,i,n){return void 0===n&&(n=this.currentShader),n.setMatrix3fv(t,e,i),this},setMatrix4fv:function(t,e,i,n){return void 0===n&&(n=this.currentShader),n.setMatrix4fv(t,e,i),this},destroy:function(){var t;this.emit(o.DESTROY,this);var e=this.shaders;for(t=0;t>>16,a=(65280&r)>>>8,h=255&r;t.strokeStyle="rgba("+o+","+a+","+h+","+s+")",t.lineWidth=e.lineWidth}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(6),l=i(7),c=new n({Extends:s,initialize:function(t,e,i,n,o){var c="json";if(l(e)){var u=e;e=a(u,"key"),i=a(u,"url"),n=a(u,"xhrSettings"),c=a(u,"extension",c),o=a(u,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:c,responseType:"text",key:e,url:i,xhrSettings:n,config:o};s.call(this,t,d),l(i)&&(this.data=o?h(i,o):i,this.state=r.FILE_POPULATED)},onProcess:function(){if(this.state!==r.FILE_POPULATED){this.state=r.FILE_PROCESSING;var t=JSON.parse(this.xhrLoader.responseText),e=this.config;this.data="string"==typeof e?h(t,e,t):t}this.onProcessComplete()}});o.register("json",(function(t,e,i,n){if(Array.isArray(t))for(var r=0;r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(156),r=i(26);t.exports=function(t,e,i,s,o){for(var a=null,h=null,l=null,c=null,u=r(t,e,i,s,null,o),d=0;d * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(63),s=i(294),o=i(295),a=i(55),h=i(166),l=new n({initialize:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.type=a.CIRCLE,this.x=t,this.y=e,this._radius=i,this._diameter=2*i},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return s(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i){return this.x=t,this.y=e,this._radius=i,this._diameter=2*i,this},setEmpty:function(){return this._radius=0,this._diameter=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},isEmpty:function(){return this._radius<=0},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this._diameter=2*t}},diameter:{get:function(){return this._diameter},set:function(t){this._diameter=t,this._radius=.5*t}},left:{get:function(){return this.x-this._radius},set:function(t){this.x=t+this._radius}},right:{get:function(){return this.x+this._radius},set:function(t){this.x=t-this._radius}},top:{get:function(){return this.y-this._radius},set:function(t){this.y=t+this._radius}},bottom:{get:function(){return this.y+this._radius},set:function(t){this.y=t-this._radius}}});t.exports=l},function(t,e){t.exports=function(t,e,i){return t.radius>0&&e>=t.left&&e<=t.right&&i>=t.top&&i<=t.bottom&&(t.x-e)*(t.x-e)+(t.y-i)*(t.y-i)<=t.radius*t.radius}},function(t,e){t.exports=function(t){return Math.sqrt((t.x2-t.x1)*(t.x2-t.x1)+(t.y2-t.y1)*(t.y2-t.y1))}},function(t,e){t.exports={BITMAPMASK_PIPELINE:"BitmapMaskPipeline",LIGHT_PIPELINE:"Light2D",POINTLIGHT_PIPELINE:"PointLightPipeline",SINGLE_PIPELINE:"SinglePipeline",MULTI_PIPELINE:"MultiPipeline",ROPE_PIPELINE:"RopePipeline",GRAPHICS_PIPELINE:"GraphicsPipeline",POSTFX_PIPELINE:"PostFXPipeline",UTILITY_PIPELINE:"UtilityPipeline"}},function(t,e){t.exports=function(t,e,i){var n=i-e;return e+((t-e)%n+n)%n}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(38),s=new n({initialize:function(t){this.val=new Float32Array(16),t?this.copy(t):this.identity()},clone:function(){return new s(this)},set:function(t){return this.copy(t)},setValues:function(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f,m){var g=this.val;return g[0]=t,g[1]=e,g[2]=i,g[3]=n,g[4]=r,g[5]=s,g[6]=o,g[7]=a,g[8]=h,g[9]=l,g[10]=c,g[11]=u,g[12]=d,g[13]=p,g[14]=f,g[15]=m,this},copy:function(t){var e=t.val;return this.setValues(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])},fromArray:function(t){return this.setValues(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},zero:function(){return this.setValues(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)},transform:function(t,e,i){var n=o.fromQuat(i).val,r=e.x,s=e.y,a=e.z;return this.setValues(n[0]*r,n[1]*r,n[2]*r,0,n[4]*s,n[5]*s,n[6]*s,0,n[8]*a,n[9]*a,n[10]*a,0,t.x,t.y,t.z,1)},xyz:function(t,e,i){this.identity();var n=this.val;return n[12]=t,n[13]=e,n[14]=i,this},scaling:function(t,e,i){this.zero();var n=this.val;return n[0]=t,n[5]=e,n[10]=i,n[15]=1,this},identity:function(){return this.setValues(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[3],r=t[6],s=t[7],o=t[11];return t[1]=t[4],t[2]=t[8],t[3]=t[12],t[4]=e,t[6]=t[9],t[7]=t[13],t[8]=i,t[9]=r,t[11]=t[14],t[12]=n,t[13]=s,t[14]=o,this},getInverse:function(t){return this.copy(t),this.invert()},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15],v=e*o-i*s,y=e*a-n*s,x=e*h-r*s,b=i*a-n*o,w=i*h-r*o,T=n*h-r*a,_=l*f-c*p,E=l*m-u*p,S=l*g-d*p,M=c*m-u*f,A=c*g-d*f,C=u*g-d*m,P=v*C-y*A+x*M+b*S-w*E+T*_;return P?(P=1/P,this.setValues((o*C-a*A+h*M)*P,(n*A-i*C-r*M)*P,(f*T-m*w+g*b)*P,(u*w-c*T-d*b)*P,(a*S-s*C-h*E)*P,(e*C-n*S+r*E)*P,(m*x-p*T-g*y)*P,(l*T-u*x+d*y)*P,(s*A-o*S+h*_)*P,(i*S-e*A-r*_)*P,(p*w-f*x+g*v)*P,(c*x-l*w-d*v)*P,(o*E-s*M-a*_)*P,(e*M-i*E+n*_)*P,(f*y-p*b-m*v)*P,(l*b-c*y+u*v)*P)):this},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15];return this.setValues(o*(u*g-d*m)-c*(a*g-h*m)+f*(a*d-h*u),-(i*(u*g-d*m)-c*(n*g-r*m)+f*(n*d-r*u)),i*(a*g-h*m)-o*(n*g-r*m)+f*(n*h-r*a),-(i*(a*d-h*u)-o*(n*d-r*u)+c*(n*h-r*a)),-(s*(u*g-d*m)-l*(a*g-h*m)+p*(a*d-h*u)),e*(u*g-d*m)-l*(n*g-r*m)+p*(n*d-r*u),-(e*(a*g-h*m)-s*(n*g-r*m)+p*(n*h-r*a)),e*(a*d-h*u)-s*(n*d-r*u)+l*(n*h-r*a),s*(c*g-d*f)-l*(o*g-h*f)+p*(o*d-h*c),-(e*(c*g-d*f)-l*(i*g-r*f)+p*(i*d-r*c)),e*(o*g-h*f)-s*(i*g-r*f)+p*(i*h-r*o),-(e*(o*d-h*c)-s*(i*d-r*c)+l*(i*h-r*o)),-(s*(c*m-u*f)-l*(o*m-a*f)+p*(o*u-a*c)),e*(c*m-u*f)-l*(i*m-n*f)+p*(i*u-n*c),-(e*(o*m-a*f)-s*(i*m-n*f)+p*(i*a-n*o)),e*(o*u-a*c)-s*(i*u-n*c)+l*(i*a-n*o))},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],c=t[9],u=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15];return(e*o-i*s)*(u*g-d*m)-(e*a-n*s)*(c*g-d*f)+(e*h-r*s)*(c*m-u*f)+(i*a-n*o)*(l*g-d*p)-(i*h-r*o)*(l*m-u*p)+(n*h-r*a)*(l*f-c*p)},multiply:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],h=e[6],l=e[7],c=e[8],u=e[9],d=e[10],p=e[11],f=e[12],m=e[13],g=e[14],v=e[15],y=t.val,x=y[0],b=y[1],w=y[2],T=y[3];return e[0]=x*i+b*o+w*c+T*f,e[1]=x*n+b*a+w*u+T*m,e[2]=x*r+b*h+w*d+T*g,e[3]=x*s+b*l+w*p+T*v,x=y[4],b=y[5],w=y[6],T=y[7],e[4]=x*i+b*o+w*c+T*f,e[5]=x*n+b*a+w*u+T*m,e[6]=x*r+b*h+w*d+T*g,e[7]=x*s+b*l+w*p+T*v,x=y[8],b=y[9],w=y[10],T=y[11],e[8]=x*i+b*o+w*c+T*f,e[9]=x*n+b*a+w*u+T*m,e[10]=x*r+b*h+w*d+T*g,e[11]=x*s+b*l+w*p+T*v,x=y[12],b=y[13],w=y[14],T=y[15],e[12]=x*i+b*o+w*c+T*f,e[13]=x*n+b*a+w*u+T*m,e[14]=x*r+b*h+w*d+T*g,e[15]=x*s+b*l+w*p+T*v,this},multiplyLocal:function(t){var e=this.val,i=t.val;return this.setValues(e[0]*i[0]+e[1]*i[4]+e[2]*i[8]+e[3]*i[12],e[0]*i[1]+e[1]*i[5]+e[2]*i[9]+e[3]*i[13],e[0]*i[2]+e[1]*i[6]+e[2]*i[10]+e[3]*i[14],e[0]*i[3]+e[1]*i[7]+e[2]*i[11]+e[3]*i[15],e[4]*i[0]+e[5]*i[4]+e[6]*i[8]+e[7]*i[12],e[4]*i[1]+e[5]*i[5]+e[6]*i[9]+e[7]*i[13],e[4]*i[2]+e[5]*i[6]+e[6]*i[10]+e[7]*i[14],e[4]*i[3]+e[5]*i[7]+e[6]*i[11]+e[7]*i[15],e[8]*i[0]+e[9]*i[4]+e[10]*i[8]+e[11]*i[12],e[8]*i[1]+e[9]*i[5]+e[10]*i[9]+e[11]*i[13],e[8]*i[2]+e[9]*i[6]+e[10]*i[10]+e[11]*i[14],e[8]*i[3]+e[9]*i[7]+e[10]*i[11]+e[11]*i[15],e[12]*i[0]+e[13]*i[4]+e[14]*i[8]+e[15]*i[12],e[12]*i[1]+e[13]*i[5]+e[14]*i[9]+e[15]*i[13],e[12]*i[2]+e[13]*i[6]+e[14]*i[10]+e[15]*i[14],e[12]*i[3]+e[13]*i[7]+e[14]*i[11]+e[15]*i[15])},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.val,n=e.val,r=i[0],s=i[4],o=i[8],a=i[12],h=i[1],l=i[5],c=i[9],u=i[13],d=i[2],p=i[6],f=i[10],m=i[14],g=i[3],v=i[7],y=i[11],x=i[15],b=n[0],w=n[4],T=n[8],_=n[12],E=n[1],S=n[5],M=n[9],A=n[13],C=n[2],P=n[6],R=n[10],L=n[14],O=n[3],D=n[7],I=n[11],F=n[15];return this.setValues(r*b+s*E+o*C+a*O,h*b+l*E+c*C+u*O,d*b+p*E+f*C+m*O,g*b+v*E+y*C+x*O,r*w+s*S+o*P+a*D,h*w+l*S+c*P+u*D,d*w+p*S+f*P+m*D,g*w+v*S+y*P+x*D,r*T+s*M+o*R+a*I,h*T+l*M+c*R+u*I,d*T+p*M+f*R+m*I,g*T+v*M+y*R+x*I,r*_+s*A+o*L+a*F,h*_+l*A+c*L+u*F,d*_+p*A+f*L+m*F,g*_+v*A+y*L+x*F)},translate:function(t){return this.translateXYZ(t.x,t.y,t.z)},translateXYZ:function(t,e,i){var n=this.val;return n[12]=n[0]*t+n[4]*e+n[8]*i+n[12],n[13]=n[1]*t+n[5]*e+n[9]*i+n[13],n[14]=n[2]*t+n[6]*e+n[10]*i+n[14],n[15]=n[3]*t+n[7]*e+n[11]*i+n[15],this},scale:function(t){return this.scaleXYZ(t.x,t.y,t.z)},scaleXYZ:function(t,e,i){var n=this.val;return n[0]=n[0]*t,n[1]=n[1]*t,n[2]=n[2]*t,n[3]=n[3]*t,n[4]=n[4]*e,n[5]=n[5]*e,n[6]=n[6]*e,n[7]=n[7]*e,n[8]=n[8]*i,n[9]=n[9]*i,n[10]=n[10]*i,n[11]=n[11]*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),r=1-i,s=t.x,o=t.y,a=t.z,h=r*s,l=r*o;return this.setValues(h*s+i,h*o-n*a,h*a+n*o,0,h*o+n*a,l*o+i,l*a-n*s,0,h*a-n*o,l*a+n*s,r*a*a+i,0,0,0,0,1)},rotate:function(t,e){var i=this.val,n=e.x,r=e.y,s=e.z,o=Math.sqrt(n*n+r*r+s*s);if(Math.abs(o)<1e-6)return this;n*=o=1/o,r*=o,s*=o;var a=Math.sin(t),h=Math.cos(t),l=1-h,c=i[0],u=i[1],d=i[2],p=i[3],f=i[4],m=i[5],g=i[6],v=i[7],y=i[8],x=i[9],b=i[10],w=i[11],T=i[12],_=i[13],E=i[14],S=i[15],M=n*n*l+h,A=r*n*l+s*a,C=s*n*l-r*a,P=n*r*l-s*a,R=r*r*l+h,L=s*r*l+n*a,O=n*s*l+r*a,D=r*s*l-n*a,I=s*s*l+h;return this.setValues(c*M+f*A+y*C,u*M+m*A+x*C,d*M+g*A+b*C,p*M+v*A+w*C,c*P+f*R+y*L,u*P+m*R+x*L,d*P+g*R+b*L,p*P+v*R+w*L,c*O+f*D+y*I,u*O+m*D+x*I,d*O+g*D+b*I,p*O+v*D+w*I,T,_,E,S)},rotateX:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),r=e[4],s=e[5],o=e[6],a=e[7],h=e[8],l=e[9],c=e[10],u=e[11];return e[4]=r*n+h*i,e[5]=s*n+l*i,e[6]=o*n+c*i,e[7]=a*n+u*i,e[8]=h*n-r*i,e[9]=l*n-s*i,e[10]=c*n-o*i,e[11]=u*n-a*i,this},rotateY:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),r=e[0],s=e[1],o=e[2],a=e[3],h=e[8],l=e[9],c=e[10],u=e[11];return e[0]=r*n-h*i,e[1]=s*n-l*i,e[2]=o*n-c*i,e[3]=a*n-u*i,e[8]=r*i+h*n,e[9]=s*i+l*n,e[10]=o*i+c*n,e[11]=a*i+u*n,this},rotateZ:function(t){var e=this.val,i=Math.sin(t),n=Math.cos(t),r=e[0],s=e[1],o=e[2],a=e[3],h=e[4],l=e[5],c=e[6],u=e[7];return e[0]=r*n+h*i,e[1]=s*n+l*i,e[2]=o*n+c*i,e[3]=a*n+u*i,e[4]=h*n-r*i,e[5]=l*n-s*i,e[6]=c*n-o*i,e[7]=u*n-a*i,this},fromRotationTranslation:function(t,e){var i=t.x,n=t.y,r=t.z,s=t.w,o=i+i,a=n+n,h=r+r,l=i*o,c=i*a,u=i*h,d=n*a,p=n*h,f=r*h,m=s*o,g=s*a,v=s*h;return this.setValues(1-(d+f),c+v,u-g,0,c-v,1-(l+f),p+m,0,u+g,p-m,1-(l+d),0,e.x,e.y,e.z,1)},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,r=t.w,s=e+e,o=i+i,a=n+n,h=e*s,l=e*o,c=e*a,u=i*o,d=i*a,p=n*a,f=r*s,m=r*o,g=r*a;return this.setValues(1-(u+p),l+g,c-m,0,l-g,1-(h+p),d+f,0,c+m,d-f,1-(h+u),0,0,0,0,1)},frustum:function(t,e,i,n,r,s){var o=1/(e-t),a=1/(n-i),h=1/(r-s);return this.setValues(2*r*o,0,0,0,0,2*r*a,0,0,(e+t)*o,(n+i)*a,(s+r)*h,-1,0,0,s*r*2*h,0)},perspective:function(t,e,i,n){var r=1/Math.tan(t/2),s=1/(i-n);return this.setValues(r/e,0,0,0,0,r,0,0,0,0,(n+i)*s,-1,0,0,2*n*i*s,0)},perspectiveLH:function(t,e,i,n){return this.setValues(2*i/t,0,0,0,0,2*i/e,0,0,0,0,-n/(i-n),1,0,0,i*n/(i-n),0)},ortho:function(t,e,i,n,r,s){var o=t-e,a=i-n,h=r-s;return o=0===o?o:1/o,a=0===a?a:1/a,h=0===h?h:1/h,this.setValues(-2*o,0,0,0,0,-2*a,0,0,0,0,2*h,0,(t+e)*o,(n+i)*a,(s+r)*h,1)},lookAtRH:function(t,e,i){var n=this.val;return c.subVectors(t,e),0===c.getLengthSquared()&&(c.z=1),c.normalize(),h.crossVectors(i,c),0===h.getLengthSquared()&&(1===Math.abs(i.z)?c.x+=1e-4:c.z+=1e-4,c.normalize(),h.crossVectors(i,c)),h.normalize(),l.crossVectors(c,h),n[0]=h.x,n[1]=h.y,n[2]=h.z,n[4]=l.x,n[5]=l.y,n[6]=l.z,n[8]=c.x,n[9]=c.y,n[10]=c.z,this},lookAt:function(t,e,i){var n=t.x,r=t.y,s=t.z,o=i.x,a=i.y,h=i.z,l=e.x,c=e.y,u=e.z;if(Math.abs(n-l)<1e-6&&Math.abs(r-c)<1e-6&&Math.abs(s-u)<1e-6)return this.identity();var d=n-l,p=r-c,f=s-u,m=1/Math.sqrt(d*d+p*p+f*f),g=a*(f*=m)-h*(p*=m),v=h*(d*=m)-o*f,y=o*p-a*d;(m=Math.sqrt(g*g+v*v+y*y))?(g*=m=1/m,v*=m,y*=m):(g=0,v=0,y=0);var x=p*y-f*v,b=f*g-d*y,w=d*v-p*g;return(m=Math.sqrt(x*x+b*b+w*w))?(x*=m=1/m,b*=m,w*=m):(x=0,b=0,w=0),this.setValues(g,x,d,0,v,b,p,0,y,w,f,0,-(g*n+v*r+y*s),-(x*n+b*r+w*s),-(d*n+p*r+f*s),1)},yawPitchRoll:function(t,e,i){this.zero(),o.zero(),a.zero();var n=this.val,r=o.val,s=a.val,h=Math.sin(i),l=Math.cos(i);return n[10]=1,n[15]=1,n[0]=l,n[1]=h,n[4]=-h,n[5]=l,h=Math.sin(e),l=Math.cos(e),r[0]=1,r[15]=1,r[5]=l,r[10]=l,r[9]=-h,r[6]=h,h=Math.sin(t),l=Math.cos(t),s[5]=1,s[15]=1,s[0]=l,s[2]=-h,s[8]=h,s[10]=l,this.multiplyLocal(o),this.multiplyLocal(a),this},setWorldMatrix:function(t,e,i,n,r){return this.yawPitchRoll(t.y,t.x,t.z),o.scaling(i.x,i.y,i.z),a.xyz(e.x,e.y,e.z),this.multiplyLocal(o),this.multiplyLocal(a),n&&this.multiplyLocal(n),r&&this.multiplyLocal(r),this},multiplyToMat4:function(t,e){var i=this.val,n=t.val,r=i[0],s=i[1],o=i[2],a=i[3],h=i[4],l=i[5],c=i[6],u=i[7],d=i[8],p=i[9],f=i[10],m=i[11],g=i[12],v=i[13],y=i[14],x=i[15],b=n[0],w=n[1],T=n[2],_=n[3],E=n[4],S=n[5],M=n[6],A=n[7],C=n[8],P=n[9],R=n[10],L=n[11],O=n[12],D=n[13],I=n[14],F=n[15];return e.setValues(b*r+w*h+T*d+_*g,w*s+w*l+T*p+_*v,T*o+w*c+T*f+_*y,_*a+w*u+T*m+_*x,E*r+S*h+M*d+A*g,E*s+S*l+M*p+A*v,E*o+S*c+M*f+A*y,E*a+S*u+M*m+A*x,C*r+P*h+R*d+L*g,C*s+P*l+R*p+L*v,C*o+P*c+R*f+L*y,C*a+P*u+R*m+L*x,O*r+D*h+I*d+F*g,O*s+D*l+I*p+F*v,O*o+D*c+I*f+F*y,O*a+D*u+I*m+F*x)},fromRotationXYTranslation:function(t,e,i){var n=e.x,r=e.y,s=e.z,o=Math.sin(t.x),a=Math.cos(t.x),h=Math.sin(t.y),l=Math.cos(t.y),c=n,u=r,d=s,p=-o,f=0-p*h,m=0-a*h,g=p*l,v=a*l;return i||(c=l*n+h*s,u=f*n+a*r+g*s,d=m*n+o*r+v*s),this.setValues(l,f,m,0,0,a,o,0,h,g,v,0,c,u,d,1)},getMaxScaleOnAxis:function(){var t=this.val,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],i=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],n=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,i,n))}}),o=new s,a=new s,h=new r,l=new r,c=new r;t.exports=s},function(t,e,i){"use strict"; /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */function n(t,e,i){i=i||2;var n,a,h,l,c,p,f,g=e&&e.length,v=g?e[0]*i:t.length,y=r(t,0,v,i,!0),x=[];if(!y||y.next===y.prev)return x;if(g&&(y=function(t,e,i,n){var o,a,h,l,c,p=[];for(o=0,a=e.length;o80*i){n=h=t[0],a=l=t[1];for(var b=i;bh&&(h=c),p>l&&(l=p);f=0!==(f=Math.max(h-n,l-a))?1/f:0}return o(y,x,i,n,a,f),x}function r(t,e,i,n,r){var s,o;if(r===C(t,e,i,n)>0)for(s=e;s=e;s-=n)o=S(s,t[s],t[s+1],o);return o&&x(o,o.next)&&(M(o),o=o.next),o}function s(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!x(n,n.next)&&0!==y(n.prev,n,n.next))n=n.next;else{if(M(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function o(t,e,i,n,r,u,d){if(t){!d&&u&&function(t,e,i,n){var r=t;do{null===r.z&&(r.z=f(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,s,o,a,h,l=1;do{for(i=t,t=null,s=null,o=0;i;){for(o++,n=i,a=0,e=0;e0||h>0&&n;)0!==a&&(0===h||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,h--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=n}s.nextZ=null,l*=2}while(o>1)}(r)}(t,n,r,u);for(var p,m,g=t;t.prev!==t.next;)if(p=t.prev,m=t.next,u?h(t,n,r,u):a(t))e.push(p.i/i),e.push(t.i/i),e.push(m.i/i),M(t),t=m.next,g=m.next;else if((t=m)===g){d?1===d?o(t=l(s(t),e,i),e,i,n,r,u,2):2===d&&c(t,e,i,n,r,u):o(s(t),e,i,n,r,u,1);break}}}function a(t){var e=t.prev,i=t,n=t.next;if(y(e,i,n)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(g(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&y(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function h(t,e,i,n){var r=t.prev,s=t,o=t.next;if(y(r,s,o)>=0)return!1;for(var a=r.xs.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,c=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,u=f(a,h,e,i,n),d=f(l,c,e,i,n),p=t.prevZ,m=t.nextZ;p&&p.z>=u&&m&&m.z<=d;){if(p!==t.prev&&p!==t.next&&g(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,m!==t.prev&&m!==t.next&&g(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&y(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;p&&p.z>=u;){if(p!==t.prev&&p!==t.next&&g(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&y(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;m&&m.z<=d;){if(m!==t.prev&&m!==t.next&&g(r.x,r.y,s.x,s.y,o.x,o.y,m.x,m.y)&&y(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function l(t,e,i){var n=t;do{var r=n.prev,o=n.next.next;!x(r,o)&&b(r,n,n.next,o)&&_(r,o)&&_(o,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(o.i/i),M(n),M(n.next),n=t=o),n=n.next}while(n!==t);return s(n)}function c(t,e,i,n,r,a){var h=t;do{for(var l=h.next.next;l!==h.prev;){if(h.i!==l.i&&v(h,l)){var c=E(h,l);return h=s(h,h.next),c=s(c,c.next),o(h,e,i,n,r,a),void o(c,e,i,n,r,a)}l=l.next}h=h.next}while(h!==t)}function u(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var i,n=e,r=t.x,s=t.y,o=-1/0;do{if(s<=n.y&&s>=n.next.y&&n.next.y!==n.y){var a=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=r&&a>o){if(o=a,a===r){if(s===n.y)return n;if(s===n.next.y)return n.next}i=n.x=n.x&&n.x>=c&&r!==n.x&&g(si.x||n.x===i.x&&p(i,n)))&&(i=n,d=h)),n=n.next}while(n!==l);return i}(t,e)){var i=E(e,t);s(e,e.next),s(i,i.next)}}function p(t,e){return y(t.prev,t,e.prev)<0&&y(e.next,t,t.next)<0}function f(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 m(t){var e=t,i=t;do{(e.x=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(s-a)-(r-o)*(n-a)>=0}function v(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&&b(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(_(t,e)&&_(e,t)&&function(t,e){var i=t,n=!1,r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(y(t.prev,t,e.prev)||y(t,e.prev,e))||x(t,e)&&y(t.prev,t,t.next)>0&&y(e.prev,e,e.next)>0)}function y(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function x(t,e){return t.x===e.x&&t.y===e.y}function b(t,e,i,n){var r=T(y(t,e,i)),s=T(y(t,e,n)),o=T(y(i,n,t)),a=T(y(i,n,e));return r!==s&&o!==a||!(0!==r||!w(t,i,e))||!(0!==s||!w(t,n,e))||!(0!==o||!w(i,t,n))||!(0!==a||!w(i,e,n))}function w(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function T(t){return t>0?1:t<0?-1:0}function _(t,e){return y(t.prev,t,t.next)<0?y(t,e,t.next)>=0&&y(t,t.prev,e)>=0:y(t,e,t.prev)<0||y(t,t.next,e)<0}function E(t,e){var i=new A(t.i,t.x,t.y),n=new A(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function S(t,e,i,n){var r=new A(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 M(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 A(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}function C(t,e,i,n){for(var r=0,s=e,o=i-n;s0&&(n+=t[r-1].length,i.holes.push(n))}return i},t.exports=n},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={COMPLETE:i(983),DECODED:i(984),DECODED_ALL:i(985),DESTROY:i(986),DETUNE:i(987),GLOBAL_DETUNE:i(988),GLOBAL_MUTE:i(989),GLOBAL_RATE:i(990),GLOBAL_VOLUME:i(991),LOOP:i(992),LOOPED:i(993),MUTE:i(994),PAN:i(995),PAUSE_ALL:i(996),PAUSE:i(997),PLAY:i(998),RATE:i(999),RESUME_ALL:i(1e3),RESUME:i(1001),SEEK:i(1002),STOP_ALL:i(1003),STOP:i(1004),UNLOCKED:i(1005),VOLUME:i(1006)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=new n({Extends:s,initialize:function t(e,i,n,r,o){var l,c="png";if(h(i)){var u=i;i=a(u,"key"),n=a(u,"url"),l=a(u,"normalMap"),r=a(u,"xhrSettings"),c=a(u,"extension",c),o=a(u,"frameConfig")}Array.isArray(n)&&(l=n[1],n=n[0]);var d={type:"image",cache:e.textureManager,extension:c,responseType:"blob",key:i,url:n,xhrSettings:r,config:o};if(s.call(this,e,d),l){var p=new t(e,this.key,l,r,o);p.type="normalMap",this.setLink(p),e.addFile(p)}},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=new Image,this.data.crossOrigin=this.crossOrigin;var t=this;this.data.onload=function(){s.revokeObjectURL(t.data),t.onProcessComplete()},this.data.onerror=function(){s.revokeObjectURL(t.data),t.onProcessError()},s.createObjectURL(this.data,this.xhrLoader.response,"image/png")},addToCache:function(){var t,e=this.linkFile;e&&e.state===r.FILE_COMPLETE?(t="image"===this.type?this.cache.addImage(this.key,this.data,e.data):this.cache.addImage(e.key,e.data,this.data),this.pendingDestroy(t),e.pendingDestroy(t)):e||(t=this.cache.addImage(this.key,this.data),this.pendingDestroy(t))}});o.register("image",(function(t,e,i){if(Array.isArray(t))for(var n=0;n0&&s.rotateAbout(o.position,i,t.position,o.position)}},n.setVelocity=function(t,e){t.positionPrev.x=t.position.x-e.x,t.positionPrev.y=t.position.y-e.y,t.velocity.x=e.x,t.velocity.y=e.y,t.speed=s.magnitude(t.velocity)},n.setAngularVelocity=function(t,e){t.anglePrev=t.angle-e,t.angularVelocity=e,t.angularSpeed=Math.abs(t.angularVelocity)},n.translate=function(t,e){n.setPosition(t,s.add(t.position,e))},n.rotate=function(t,e,i){if(i){var r=Math.cos(e),s=Math.sin(e),o=t.position.x-i.x,a=t.position.y-i.y;n.setPosition(t,{x:i.x+(o*r-a*s),y:i.y+(o*s+a*r)}),n.setAngle(t,t.angle+e)}else n.setAngle(t,t.angle+e)},n.scale=function(t,e,i,s){var o=0,a=0;s=s||t.position;for(var c=0;c0&&(o+=u.area,a+=u.inertia),u.position.x=s.x+(u.position.x-s.x)*e,u.position.y=s.y+(u.position.y-s.y)*i,h.update(u.bounds,u.vertices,t.velocity)}t.parts.length>1&&(t.area=o,t.isStatic||(n.setMass(t,t.density*o),n.setInertia(t,a))),t.circleRadius&&(e===i?t.circleRadius*=e:t.circleRadius=null)},n.update=function(t,e,i,n){var o=Math.pow(e*i*t.timeScale,2),a=1-t.frictionAir*i*t.timeScale,c=t.position.x-t.positionPrev.x,u=t.position.y-t.positionPrev.y;t.velocity.x=c*a*n+t.force.x/t.mass*o,t.velocity.y=u*a*n+t.force.y/t.mass*o,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.position.x+=t.velocity.x,t.position.y+=t.velocity.y,t.angularVelocity=(t.angle-t.anglePrev)*a*n+t.torque/t.inertia*o,t.anglePrev=t.angle,t.angle+=t.angularVelocity,t.speed=s.magnitude(t.velocity),t.angularSpeed=Math.abs(t.angularVelocity);for(var d=0;d0&&(p.position.x+=t.velocity.x,p.position.y+=t.velocity.y),0!==t.angularVelocity&&(r.rotate(p.vertices,t.angularVelocity,t.position),l.rotate(p.axes,t.angularVelocity),d>0&&s.rotateAbout(p.position,t.angularVelocity,t.position,p.position)),h.update(p.bounds,p.vertices,t.velocity)}},n.applyForce=function(t,e,i){t.force.x+=i.x,t.force.y+=i.y;var n=e.x-t.position.x,r=e.y-t.position.y;t.torque+=n*i.y-r*i.x},n._totalProperties=function(t){for(var e={mass:0,area:0,inertia:0,centre:{x:0,y:0}},i=1===t.parts.length?0:1;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(162),r=i(0),s=i(11),o=i(15),a=i(1059),h=new r({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,a],initialize:function(t,e,i,r,s){o.call(this,t,"Sprite"),this._crop=this.resetCropObject(),this.anims=new n(this),this.setTexture(r,s),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){this.anims.update(t,e)},play:function(t,e){return this.anims.play(t,e)},playReverse:function(t,e){return this.anims.playReverse(t,e)},playAfterDelay:function(t,e){return this.anims.playAfterDelay(t,e)},playAfterRepeat:function(t,e){return this.anims.playAfterRepeat(t,e)},chain:function(t){return this.anims.chain(t)},stop:function(){return this.anims.stop()},stopAfterDelay:function(t){return this.anims.stopAfterDelay(t)},stopAfterRepeat:function(t){return this.anims.stopAfterRepeat(t)},stopOnFrame:function(t){return this.anims.stopOnFrame(t)},toJSON:function(){return s.ToJSON(this)},preDestroy:function(){this.anims.destroy(),this.anims=void 0}});t.exports=h},function(t,e){t.exports=function(t,e){if(!(e>=t.length)){for(var i=t.length-1,n=t[e],r=e;r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={ADDED_TO_SCENE:i(641),DESTROY:i(642),REMOVED_FROM_SCENE:i(643),VIDEO_COMPLETE:i(644),VIDEO_CREATED:i(645),VIDEO_ERROR:i(646),VIDEO_LOOP:i(647),VIDEO_PLAY:i(648),VIDEO_SEEKED:i(649),VIDEO_SEEKING:i(650),VIDEO_STOP:i(651),VIDEO_TIMEOUT:i(652),VIDEO_UNLOCKED:i(653)}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.floor(t/e),n?(i+t)/e:i+t)}},function(t,e){t.exports=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i]=t[i].slice(0):e[i]=t[i];return e}},function(t,e){t.exports=function(t,e,i,n){var r=t.length;if(e<0||e>r||e>=i||i>r||e+i>r){if(n)throw new Error("Range Error: Values outside acceptable range");return!1}return!0}},function(t,e){ /** * @author Richard Davey * @author Angry Bytes (and contributors) * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ function i(t,e){return String(t).localeCompare(e)}function n(t,e,i,n){var r,s,o,a,h,l=t.length,c=0,u=2*i;for(r=0;rl&&(s=l),o>l&&(o=l),a=r,h=s;;)if(a * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(132),r=i(202);t.exports=function(t,e){var i=n.Power0;if("string"==typeof t)if(n.hasOwnProperty(t))i=n[t];else{var s="";t.indexOf(".")&&("in"===(s=t.substr(t.indexOf(".")+1)).toLowerCase()?s="easeIn":"out"===s.toLowerCase()?s="easeOut":"inout"===s.toLowerCase()&&(s="easeInOut")),t=r(t.substr(0,t.indexOf(".")+1)+s),n.hasOwnProperty(t)&&(i=n[t])}else"function"==typeof t?i=t:Array.isArray(t)&&t.length;if(!e)return i;var o=e.slice(0);return o.unshift(0),function(t){return o[0]=t,i.apply(this,o)}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(12);t.exports=function(t,e,i,r,s){var o=t.strokeTint,a=n.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*i);o.TL=a,o.TR=a,o.BL=a,o.BR=a;var h=e.pathData,l=h.length-1,c=e.lineWidth,u=c/2,d=h[0]-r,p=h[1]-s;e.closePath||(l-=2);for(var f=2;f * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(112),s=i(470),o=i(471),a=i(55),h=i(45),l=i(178),c=new n({initialize:function(t,e,i,n,r,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=0),this.type=a.TRIANGLE,this.x1=t,this.y1=e,this.x2=i,this.y2=n,this.x3=r,this.y3=s},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return s(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return l(this,t)},setTo:function(t,e,i,n,r,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=0),this.x1=t,this.y1=e,this.x2=i,this.y2=n,this.x3=r,this.y3=s,this},getLineA:function(t){return void 0===t&&(t=new h),t.setTo(this.x1,this.y1,this.x2,this.y2),t},getLineB:function(t){return void 0===t&&(t=new h),t.setTo(this.x2,this.y2,this.x3,this.y3),t},getLineC:function(t){return void 0===t&&(t=new h),t.setTo(this.x3,this.y3,this.x1,this.y1),t},left:{get:function(){return Math.min(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1<=this.x2&&this.x1<=this.x3?this.x1-t:this.x2<=this.x1&&this.x2<=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},right:{get:function(){return Math.max(this.x1,this.x2,this.x3)},set:function(t){var e=0;e=this.x1>=this.x2&&this.x1>=this.x3?this.x1-t:this.x2>=this.x1&&this.x2>=this.x3?this.x2-t:this.x3-t,this.x1-=e,this.x2-=e,this.x3-=e}},top:{get:function(){return Math.min(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1<=this.y2&&this.y1<=this.y3?this.y1-t:this.y2<=this.y1&&this.y2<=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}},bottom:{get:function(){return Math.max(this.y1,this.y2,this.y3)},set:function(t){var e=0;e=this.y1>=this.y2&&this.y1>=this.y3?this.y1-t:this.y2>=this.y1&&this.y2>=this.y3?this.y2-t:this.y3-t,this.y1-=e,this.y2-=e,this.y3-=e}}});t.exports=c},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(29),r=i(0),s=i(11),o=i(496),a=new r({Mixins:[s.Alpha,s.Flip,s.Visible],initialize:function(t,e,i,n,r,s,o,a){this.layer=t,this.index=e,this.x=i,this.y=n,this.width=r,this.height=s,this.right,this.bottom,this.baseWidth=void 0!==o?o:r,this.baseHeight=void 0!==a?a:s,this.pixelX=0,this.pixelY=0,this.updatePixelXY(),this.properties={},this.rotation=0,this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceLeft=!1,this.faceRight=!1,this.faceTop=!1,this.faceBottom=!1,this.collisionCallback=void 0,this.collisionCallbackContext=this,this.tint=16777215,this.physics={}},containsPoint:function(t,e){return!(tthis.right||e>this.bottom)},copy:function(t){return this.index=t.index,this.alpha=t.alpha,this.properties=t.properties,this.visible=t.visible,this.setFlip(t.flipX,t.flipY),this.tint=t.tint,this.rotation=t.rotation,this.collideUp=t.collideUp,this.collideDown=t.collideDown,this.collideLeft=t.collideLeft,this.collideRight=t.collideRight,this.collisionCallback=t.collisionCallback,this.collisionCallbackContext=t.collisionCallbackContext,this},getCollisionGroup:function(){return this.tileset?this.tileset.getTileCollisionGroup(this.index):null},getTileData:function(){return this.tileset?this.tileset.getTileData(this.index):null},getLeft:function(t){var e=this.tilemapLayer;return e?e.tileToWorldX(this.x,t):this.x*this.baseWidth},getRight:function(t){var e=this.tilemapLayer;return e?this.getLeft(t)+this.width*e.scaleX:this.getLeft(t)+this.width},getTop:function(t){var e=this.tilemapLayer;return e?e.tileToWorldY(this.y,t)-(this.height-this.baseHeight)*e.scaleY:this.y*this.baseHeight-(this.height-this.baseHeight)},getBottom:function(t){var e=this.tilemapLayer;return e?this.getTop(t)+this.height*e.scaleY:this.getTop(t)+this.height},getBounds:function(t,e){return void 0===e&&(e=new o),e.x=this.getLeft(),e.y=this.getTop(),e.width=this.getRight()-e.x,e.height=this.getBottom()-e.y,e},getCenterX:function(t){return(this.getLeft(t)+this.getRight(t))/2},getCenterY:function(t){return(this.getTop(t)+this.getBottom(t))/2},intersects:function(t,e,i,n){return!(i<=this.pixelX||n<=this.pixelY||t>=this.right||e>=this.bottom)},isInteresting:function(t,e){return t&&e?this.canCollide||this.hasInterestingFace:t?this.collides:!!e&&this.hasInterestingFace},resetCollision:function(t){return void 0===t&&(t=!0),this.collideLeft=!1,this.collideRight=!1,this.collideUp=!1,this.collideDown=!1,this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,t&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},resetFaces:function(){return this.faceTop=!1,this.faceBottom=!1,this.faceLeft=!1,this.faceRight=!1,this},setCollision:function(t,e,i,n,r){return void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=t),void 0===r&&(r=!0),this.collideLeft=t,this.collideRight=e,this.collideUp=i,this.collideDown=n,this.faceLeft=t,this.faceRight=e,this.faceTop=i,this.faceBottom=n,r&&this.tilemapLayer&&this.tilemapLayer.calculateFacesAt(this.x,this.y),this},setCollisionCallback:function(t,e){return null===t?(this.collisionCallback=void 0,this.collisionCallbackContext=void 0):(this.collisionCallback=t,this.collisionCallbackContext=e),this},setSize:function(t,e,i,n){return void 0!==t&&(this.width=t),void 0!==e&&(this.height=e),void 0!==i&&(this.baseWidth=i),void 0!==n&&(this.baseHeight=n),this.updatePixelXY(),this},updatePixelXY:function(){var t=this.layer.orientation;if(t===n.ORTHOGONAL)this.pixelX=this.x*this.baseWidth,this.pixelY=this.y*this.baseHeight;else if(t===n.ISOMETRIC)this.pixelX=(this.x-this.y)*this.baseWidth*.5,this.pixelY=(this.x+this.y)*this.baseHeight*.5;else if(t===n.STAGGERED)this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*(this.baseHeight/2);else if(t===n.HEXAGONAL){var e=this.layer.hexSideLength,i=(this.baseHeight-e)/2+e;this.pixelX=this.x*this.baseWidth+this.y%2*(this.baseWidth/2),this.pixelY=this.y*i}return this.right=this.pixelX+this.baseWidth,this.bottom=this.pixelY+this.baseHeight,this},destroy:function(){this.collisionCallback=void 0,this.collisionCallbackContext=void 0,this.properties=void 0},canCollide:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown||void 0!==this.collisionCallback}},collides:{get:function(){return this.collideLeft||this.collideRight||this.collideUp||this.collideDown}},hasInterestingFace:{get:function(){return this.faceTop||this.faceBottom||this.faceLeft||this.faceRight}},tileset:{get:function(){var t=this.layer.tilemapLayer;if(t){var e=t.gidMap[this.index];if(e)return e}return null}},tilemapLayer:{get:function(){return this.layer.tilemapLayer}},tilemap:{get:function(){var t=this.tilemapLayer;return t?t.tilemap:null}}});t.exports=a},function(t,e){t.exports=function(t){return t.x-t.width*t.originX+.5*t.width}},function(t,e){t.exports=function(t,e){var i=t.width*t.originX;return t.x=e+i-.5*t.width,t}},function(t,e){t.exports=function(t){return t.y-t.height*t.originY+.5*t.height}},function(t,e){t.exports=function(t,e){var i=t.height*t.originY;return t.y=e+i-.5*t.height,t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={POST_RENDER:i(626),PRE_RENDER:i(627),RENDER:i(628),RESIZE:i(629)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(74);t.exports=function(t,e,i,r){var s;if(void 0===r&&(r=t),!Array.isArray(e))return-1!==(s=t.indexOf(e))?(n(t,s),i&&i.call(r,e),e):null;for(var o=e.length-1,a=[];o>=0;){var h=e[o];-1!==(s=t.indexOf(h))&&(n(t,s),a.push(h),i&&i.call(r,h)),o--}return a}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(196),s=i(10),o=i(3),a=new n({initialize:function(t){this.type=t,this.defaultDivisions=5,this.arcLengthDivisions=100,this.cacheArcLengths=[],this.needsUpdate=!0,this.active=!0,this._tmpVec2A=new o,this._tmpVec2B=new o},draw:function(t,e){return void 0===e&&(e=32),t.strokePoints(this.getPoints(e))},getBounds:function(t,e){t||(t=new s),void 0===e&&(e=16);var i=this.getLength();e>i&&(e=i/2);var n=Math.max(1,Math.round(i/e));return r(this.getSpacedPoints(n),t)},getDistancePoints:function(t){var e=this.getLength(),i=Math.max(1,e/t);return this.getSpacedPoints(i)},getEndPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(1,t)},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i=[],n=this.getPoint(0,this._tmpVec2A),r=0;i.push(0);for(var s=1;s<=t;s++)r+=(e=this.getPoint(s/t,this._tmpVec2B)).distance(n),i.push(r),n.copy(e);return this.cacheArcLengths=i,i},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var n=0;n<=t;n++)i.push(this.getPoint(n/t));return i},getRandomPoint:function(t){return void 0===t&&(t=new o),this.getPoint(Math.random(),t)},getSpacedPoints:function(t,e,i){void 0===i&&(i=[]),t||(t=e?this.getLength()/e:this.defaultDivisions);for(var n=0;n<=t;n++){var r=this.getUtoTmapping(n/t,null,t);i.push(this.getPoint(r))}return i},getStartPoint:function(t){return void 0===t&&(t=new o),this.getPointAt(0,t)},getTangent:function(t,e){void 0===e&&(e=new o);var i=t-1e-4,n=t+1e-4;return i<0&&(i=0),n>1&&(n=1),this.getPoint(i,this._tmpVec2A),this.getPoint(n,e),e.subtract(this._tmpVec2A).normalize()},getTangentAt:function(t,e){var i=this.getUtoTmapping(t);return this.getTangent(i,e)},getTFromDistance:function(t,e){return t<=0?0:this.getUtoTmapping(0,t,e)},getUtoTmapping:function(t,e,i){var n,r=this.getLengths(i),s=0,o=r.length;n=e?Math.min(e,r[o-1]):t*r[o-1];for(var a,h=0,l=o-1;h<=l;)if((a=r[s=Math.floor(h+(l-h)/2)]-n)<0)h=s+1;else{if(!(a>0)){l=s;break}l=s-1}if(r[s=l]===n)return s/(o-1);var c=r[s];return(s+(n-c)/(r[s+1]-c))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={ADD:i(964),COMPLETE:i(965),FILE_COMPLETE:i(966),FILE_KEY_COMPLETE:i(967),FILE_LOAD_ERROR:i(968),FILE_LOAD:i(969),FILE_PROGRESS:i(970),POST_PROCESS:i(971),PROGRESS:i(972),START:i(973)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=t.x1,s=t.y1,o=t.x2,a=t.y2,h=e.x1,l=e.y1,c=e.x2,u=e.y2,d=(u-l)*(o-r)-(c-h)*(a-s);if(0===d)return!1;var p=((c-h)*(s-l)-(u-l)*(r-h))/d,f=((o-r)*(s-l)-(a-s)*(r-h))/d;return p>=0&&p<=1&&f>=0&&f<=1&&(i.x=r+p*(o-r),i.y=s+p*(a-s),!0)}},function(t,e){t.exports=function(t){return Math.atan2(t.y2-t.y1,t.x2-t.x1)}},function(t,e,i){var n={};t.exports=n;var r=i(116),s=i(50);n.create=function(t,e){for(var i=[],n=0;n0)return!1}return!0},n.scale=function(t,e,i,s){if(1===e&&1===i)return t;var o,a;s=s||n.centre(t);for(var h=0;h=0?h-1:t.length-1],c=t[h],u=t[(h+1)%t.length],d=e[h0&&(s|=2),3===s)return!1;return 0!==s||null},n.hull=function(t){var e,i,n=[],s=[];for((t=t.slice(0)).sort((function(t,e){var i=t.x-e.x;return 0!==i?i:t.y-e.y})),i=0;i=2&&r.cross3(s[s.length-2],s[s.length-1],e)<=0;)s.pop();s.push(e)}for(i=t.length-1;i>=0;i-=1){for(e=t[i];n.length>=2&&r.cross3(n[n.length-2],n[n.length-1],e)<=0;)n.pop();n.push(e)}return n.pop(),s.pop(),n.concat(s)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(18);t.exports=function(t,e,i){return(i-e)*(t=n(t,0,1))}},function(t,e){t.exports=function(t,e,i){return t&&t.hasOwnProperty(e)?t[e]:i}},function(t,e){t.exports={CREATED:0,INIT:1,DELAY:2,OFFSET_DELAY:3,PENDING_RENDER:4,PLAYING_FORWARD:5,PLAYING_BACKWARD:6,HOLD_DELAY:7,REPEAT_DELAY:8,COMPLETE:9,PENDING_ADD:20,PAUSED:21,LOOP_DELAY:22,ACTIVE:23,COMPLETE_DELAY:24,PENDING_REMOVE:25,REMOVED:26}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(309),s=new n({initialize:function(t,e){this.parent=t,this.events=e,e||(this.events=t.events?t.events:t),this.list={},this.values={},this._frozen=!1,!t.hasOwnProperty("sys")&&this.events&&this.events.once(r.DESTROY,this.destroy,this)},get:function(t){var e=this.list;if(Array.isArray(t)){for(var i=[],n=0;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=new(i(0))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={ENTER_FULLSCREEN:i(776),FULLSCREEN_FAILED:i(777),FULLSCREEN_UNSUPPORTED:i(778),LEAVE_FULLSCREEN:i(779),ORIENTATION_CHANGE:i(780),RESIZE:i(781)}},function(t,e,i){(function(e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i={android:!1,chromeOS:!1,cordova:!1,crosswalk:!1,desktop:!1,ejecta:!1,electron:!1,iOS:!1,iOSVersion:0,iPad:!1,iPhone:!1,kindle:!1,linux:!1,macOS:!1,node:!1,nodeWebkit:!1,pixelRatio:1,webApp:!1,windows:!1,windowsPhone:!1};t.exports=function(){var t=navigator.userAgent;/Windows/.test(t)?i.windows=!0:/Mac OS/.test(t)&&!/like Mac OS/.test(t)?navigator.maxTouchPoints&&navigator.maxTouchPoints>2?(i.iOS=!0,i.iPad=!0,navigator.appVersion.match(/Version\/(\d+)/),i.iOSVersion=parseInt(RegExp.$1,10)):i.macOS=!0:/Android/.test(t)?i.android=!0:/Linux/.test(t)?i.linux=!0:/iP[ao]d|iPhone/i.test(t)?(i.iOS=!0,navigator.appVersion.match(/OS (\d+)/),i.iOSVersion=parseInt(RegExp.$1,10),i.iPhone=-1!==t.toLowerCase().indexOf("iphone"),i.iPad=-1!==t.toLowerCase().indexOf("ipad")):/Kindle/.test(t)||/\bKF[A-Z][A-Z]+/.test(t)||/Silk.*Mobile Safari/.test(t)?i.kindle=!0:/CrOS/.test(t)&&(i.chromeOS=!0),(/Windows Phone/i.test(t)||/IEMobile/i.test(t))&&(i.android=!1,i.iOS=!1,i.macOS=!1,i.windows=!0,i.windowsPhone=!0);var n=/Silk/.test(t);return(i.windows||i.macOS||i.linux&&!n||i.chromeOS)&&(i.desktop=!0),(i.windowsPhone||/Windows NT/i.test(t)&&/Touch/i.test(t))&&(i.desktop=!1),navigator.standalone&&(i.webApp=!0),void 0!==window.cordova&&(i.cordova=!0),void 0!==e&&e.versions&&e.versions.node&&(i.node=!0),i.node&&"object"==typeof e.versions&&(i.nodeWebkit=!!e.versions["node-webkit"],i.electron=!!e.versions.electron),void 0!==window.ejecta&&(i.ejecta=!0),/Crosswalk/.test(t)&&(i.crosswalk=!0),i.pixelRatio=window.devicePixelRatio||1,i}()}).call(this,i(804))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={ADD:i(857),ERROR:i(858),LOAD:i(859),READY:i(860),REMOVE:i(861)}},function(t,e){t.exports={BYTE:{enum:5120,size:1},UNSIGNED_BYTE:{enum:5121,size:1},SHORT:{enum:5122,size:2},UNSIGNED_SHORT:{enum:5123,size:2},INT:{enum:5124,size:4},UNSIGNED_INT:{enum:5125,size:4},FLOAT:{enum:5126,size:4}}},function(t,e,i){ /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(2),s=i(874),o=i(875),a=i(25),h=i(12),l=i(104),c=i(57),u=new n({Extends:c,initialize:function(t){var e=t.game.renderer,i=r(t,"fragShader",s);t.fragShader=h.parseFragmentShaderMaxTextures(i,e.maxTextures),t.vertShader=r(t,"vertShader",o),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:l.UNSIGNED_BYTE,normalized:!0}]),c.call(this,t),this._tempMatrix1=new a,this._tempMatrix2=new a,this._tempMatrix3=new a},boot:function(){c.prototype.boot.call(this),this.currentShader.set1iv("uMainSampler",this.renderer.textureIndexes)},batchSprite:function(t,e,i){this.manager.set(this,t);var n=this._tempMatrix1,r=this._tempMatrix2,s=this._tempMatrix3,o=t.frame,a=o.glTexture,l=o.u0,c=o.v0,u=o.u1,d=o.v1,p=o.x,f=o.y,m=o.cutWidth,g=o.cutHeight,v=o.customPivot,y=t.displayOriginX,x=t.displayOriginY,b=-y+p,w=-x+f;if(t.isCropped){var T=t._crop;T.flipX===t.flipX&&T.flipY===t.flipY||o.updateCropUVs(T,t.flipX,t.flipY),l=T.u0,c=T.v0,u=T.u1,d=T.v1,m=T.width,g=T.height,b=-y+(p=T.x),w=-x+(f=T.y)}var _=1,E=1;t.flipX&&(v||(b+=-o.realWidth+2*y),_=-1),(t.flipY||o.source.isGLTexture&&!a.flipY)&&(v||(w+=-o.realHeight+2*x),E=-1),r.applyITRS(t.x,t.y,t.rotation,t.scaleX*_,t.scaleY*E),n.copyFrom(e.matrix),i?(n.multiplyWithOffset(i,-e.scrollX*t.scrollFactorX,-e.scrollY*t.scrollFactorY),r.e=t.x,r.f=t.y):(r.e-=e.scrollX*t.scrollFactorX,r.f-=e.scrollY*t.scrollFactorY),n.multiply(r,s);var S=b+m,M=w+g,A=e.roundPixels,C=s.getXRound(b,w,A),P=s.getYRound(b,w,A),R=s.getXRound(b,M,A),L=s.getYRound(b,M,A),O=s.getXRound(S,M,A),D=s.getYRound(S,M,A),I=s.getXRound(S,w,A),F=s.getYRound(S,w,A),B=h.getTintAppendFloatAlpha,k=e.alpha,N=B(t.tintTopLeft,k*t._alphaTL),U=B(t.tintTopRight,k*t._alphaTR),z=B(t.tintBottomLeft,k*t._alphaBL),G=B(t.tintBottomRight,k*t._alphaBR);this.shouldFlush(6)&&this.flush();var V=this.setGameObject(t,o);this.manager.preBatch(t),this.batchQuad(t,C,P,R,L,O,D,I,F,l,c,u,d,N,U,z,G,t.tintFill,a,V),this.manager.postBatch(t)},batchTexture:function(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f,m,g,v,y,x,b,w,T,_,E,S,M,A,C,P,R,L){this.manager.set(this,t);var O=this._tempMatrix1,D=this._tempMatrix2,I=this._tempMatrix3,F=v/i+M,B=y/n+A,k=(v+x)/i+M,N=(y+b)/n+A,U=o,z=a,G=-m,V=-g;if(t.isCropped){var H=t._crop,W=H.width,X=H.height;U=W,z=X,o=W,a=X;var j=v=H.x,Y=y=H.y;u&&(j=x-H.x-W),d&&(Y=b-H.y-X),F=j/i+M,B=Y/n+A,k=(j+W)/i+M,N=(Y+X)/n+A,G=-m+v,V=-g+y}u&&(U*=-1,G+=o),(d^=!R&&e.isRenderTexture?1:0)&&(z*=-1,V+=a);var q=G+U,Z=V+z;D.applyITRS(r,s,c,h,l),O.copyFrom(C.matrix),P?(O.multiplyWithOffset(P,-C.scrollX*p,-C.scrollY*f),D.e=r,D.f=s):(D.e-=C.scrollX*p,D.f-=C.scrollY*f),O.multiply(D,I);var K=C.roundPixels,J=I.getXRound(G,V,K),Q=I.getYRound(G,V,K),$=I.getXRound(G,Z,K),tt=I.getYRound(G,Z,K),et=I.getXRound(q,Z,K),it=I.getYRound(q,Z,K),nt=I.getXRound(q,V,K),rt=I.getYRound(q,V,K);void 0===L&&(L=this.renderer.setTexture2D(e)),t&&this.manager.preBatch(t),this.batchQuad(t,J,Q,$,tt,et,it,nt,rt,F,B,k,N,w,T,_,E,S,e,L),t&&this.manager.postBatch(t)},batchTextureFrame:function(t,e,i,n,r,s,o){this.manager.set(this);var a=this._tempMatrix1.copyFrom(s),l=this._tempMatrix2,c=e+t.width,u=i+t.height;o?a.multiply(o,l):l=a;var d=l.getX(e,i),p=l.getY(e,i),f=l.getX(e,u),m=l.getY(e,u),g=l.getX(c,u),v=l.getY(c,u),y=l.getX(c,i),x=l.getY(c,i),b=this.renderer.setTextureSource(t.source);n=h.getTintAppendFloatAlpha(n,r),this.batchQuad(null,d,p,f,m,g,v,y,x,t.u0,t.v0,t.u1,t.v1,n,n,n,n,0,t.glTexture,b)}});t.exports=u},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(18),s=i(17),o=new n({initialize:function(t,e,i,n,r,s,o){this.texture=t,this.name=e,this.source=t.source[i],this.sourceIndex=i,this.glTexture=this.source.glTexture,this.cutX,this.cutY,this.cutWidth,this.cutHeight,this.x=0,this.y=0,this.width,this.height,this.halfWidth,this.halfHeight,this.centerX,this.centerY,this.pivotX=0,this.pivotY=0,this.customPivot=!1,this.rotated=!1,this.autoRound=-1,this.customData={},this.u0=0,this.v0=0,this.u1=0,this.v1=0,this.data={cut:{x:0,y:0,w:0,h:0,r:0,b:0},trim:!1,sourceSize:{w:0,h:0},spriteSourceSize:{x:0,y:0,w:0,h:0,r:0,b:0},radius:0,drawImage:{x:0,y:0,width:0,height:0}},this.setSize(s,o,n,r)},setSize:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0),this.cutX=i,this.cutY=n,this.cutWidth=t,this.cutHeight=e,this.width=t,this.height=e,this.halfWidth=Math.floor(.5*t),this.halfHeight=Math.floor(.5*e),this.centerX=Math.floor(t/2),this.centerY=Math.floor(e/2);var r=this.data,s=r.cut;s.x=i,s.y=n,s.w=t,s.h=e,s.r=i+t,s.b=n+e,r.sourceSize.w=t,r.sourceSize.h=e,r.spriteSourceSize.w=t,r.spriteSourceSize.h=e,r.radius=.5*Math.sqrt(t*t+e*e);var o=r.drawImage;return o.x=i,o.y=n,o.width=t,o.height=e,this.updateUVs()},setTrim:function(t,e,i,n,r,s){var o=this.data,a=o.spriteSourceSize;return o.trim=!0,o.sourceSize.w=t,o.sourceSize.h=e,a.x=i,a.y=n,a.w=r,a.h=s,a.r=i+r,a.b=n+s,this.x=i,this.y=n,this.width=r,this.height=s,this.halfWidth=.5*r,this.halfHeight=.5*s,this.centerX=Math.floor(r/2),this.centerY=Math.floor(s/2),this.updateUVs()},setCropUVs:function(t,e,i,n,s,o,a){var h=this.cutX,l=this.cutY,c=this.cutWidth,u=this.cutHeight,d=this.realWidth,p=this.realHeight,f=h+(e=r(e,0,d)),m=l+(i=r(i,0,p)),g=n=r(n,0,d-e),v=s=r(s,0,p-i),y=this.data;if(y.trim){var x=y.spriteSourceSize,b=e+(n=r(n,0,c-e)),w=i+(s=r(s,0,u-i));if(x.rb||x.y>w)f=0,m=0,g=0,v=0;else{var T=Math.max(x.x,e),_=Math.max(x.y,i),E=Math.min(x.r,b)-T,S=Math.min(x.b,w)-_;g=E,v=S,f=o?h+(c-(T-x.x)-E):h+(T-x.x),m=a?l+(u-(_-x.y)-S):l+(_-x.y),e=T,i=_,n=E,s=S}}else o&&(f=h+(c-e-n)),a&&(m=l+(u-i-s));var M=this.source.width,A=this.source.height;return t.u0=Math.max(0,f/M),t.v0=Math.max(0,m/A),t.u1=Math.min(1,(f+g)/M),t.v1=Math.min(1,(m+v)/A),t.x=e,t.y=i,t.cx=f,t.cy=m,t.cw=g,t.ch=v,t.width=n,t.height=s,t.flipX=o,t.flipY=a,t},updateCropUVs:function(t,e,i){return this.setCropUVs(t,t.x,t.y,t.width,t.height,e,i)},setUVs:function(t,e,i,n,r,s){var o=this.data.drawImage;return o.width=t,o.height=e,this.u0=i,this.v0=n,this.u1=r,this.v1=s,this},updateUVs:function(){var t=this.cutX,e=this.cutY,i=this.cutWidth,n=this.cutHeight,r=this.data.drawImage;r.width=i,r.height=n;var s=this.source.width,o=this.source.height;return this.u0=t/s,this.v0=e/o,this.u1=(t+i)/s,this.v1=(e+n)/o,this},updateUVsInverted:function(){var t=this.source.width,e=this.source.height;return this.u0=(this.cutX+this.cutHeight)/t,this.v0=this.cutY/e,this.u1=this.cutX/t,this.v1=(this.cutY+this.cutWidth)/e,this},clone:function(){var t=new o(this.texture,this.name,this.sourceIndex);return t.cutX=this.cutX,t.cutY=this.cutY,t.cutWidth=this.cutWidth,t.cutHeight=this.cutHeight,t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t.halfWidth=this.halfWidth,t.halfHeight=this.halfHeight,t.centerX=this.centerX,t.centerY=this.centerY,t.rotated=this.rotated,t.data=s(!0,t.data,this.data),t.updateUVs(),t},destroy:function(){this.source=null,this.texture=null,this.glTexture=null,this.customData=null,this.data=null},realWidth:{get:function(){return this.data.sourceSize.w}},realHeight:{get:function(){return this.data.sourceSize.h}},radius:{get:function(){return this.data.radius}},trimmed:{get:function(){return this.data.trim}},canvasData:{get:function(){return this.data.drawImage}}});t.exports=o},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(205),r=i(0),s=i(1),o=i(79),a=new r({initialize:function(t){this.parent=t,this.list=[],this.position=0,this.addCallback=s,this.removeCallback=s,this._sortKey=""},add:function(t,e){return e?n.Add(this.list,t):n.Add(this.list,t,0,this.addCallback,this)},addAt:function(t,e,i){return i?n.AddAt(this.list,t,e):n.AddAt(this.list,t,e,0,this.addCallback,this)},getAt:function(t){return this.list[t]},getIndex:function(t){return this.list.indexOf(t)},sort:function(t,e){return t?(void 0===e&&(e=function(e,i){return e[t]-i[t]}),o(this.list,e),this):this},getByName:function(t){return n.GetFirst(this.list,"name",t)},getRandom:function(t,e){return n.GetRandom(this.list,t,e)},getFirst:function(t,e,i,r){return n.GetFirst(this.list,t,e,i,r)},getAll:function(t,e,i,r){return n.GetAll(this.list,t,e,i,r)},count:function(t,e){return n.CountAllMatching(this.list,t,e)},swap:function(t,e){n.Swap(this.list,t,e)},moveTo:function(t,e){return n.MoveTo(this.list,t,e)},remove:function(t,e){return e?n.Remove(this.list,t):n.Remove(this.list,t,this.removeCallback,this)},removeAt:function(t,e){return e?n.RemoveAt(this.list,t):n.RemoveAt(this.list,t,this.removeCallback,this)},removeBetween:function(t,e,i){return i?n.RemoveBetween(this.list,t,e):n.RemoveBetween(this.list,t,e,this.removeCallback,this)},removeAll:function(t){for(var e=this.list.length;e--;)this.remove(this.list[e],t);return this},bringToTop:function(t){return n.BringToTop(this.list,t)},sendToBack:function(t){return n.SendToBack(this.list,t)},moveUp:function(t){return n.MoveUp(this.list,t),t},moveDown:function(t){return n.MoveDown(this.list,t),t},reverse:function(){return this.list.reverse(),this},shuffle:function(){return n.Shuffle(this.list),this},replace:function(t,e){return n.Replace(this.list,t,e)},exists:function(t){return this.list.indexOf(t)>-1},setAll:function(t,e,i,r){return n.SetAll(this.list,t,e,i,r),this},each:function(t,e){for(var i=[null],n=2;n0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}}});t.exports=a},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(109),s=i(439),o=i(440),a=i(55),h=i(177),l=new n({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),this.type=a.ELLIPSE,this.x=t,this.y=e,this.width=i,this.height=n},contains:function(t,e){return r(this,t,e)},getPoint:function(t,e){return s(this,t,e)},getPoints:function(t,e,i){return o(this,t,e,i)},getRandomPoint:function(t){return h(this,t)},setTo:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setEmpty:function(){return this.width=0,this.height=0,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},isEmpty:function(){return this.width<=0||this.height<=0},getMinorRadius:function(){return Math.min(this.width,this.height)/2},getMajorRadius:function(){return Math.max(this.width,this.height)/2},left:{get:function(){return this.x-this.width/2},set:function(t){this.x=t+this.width/2}},right:{get:function(){return this.x+this.width/2},set:function(t){this.x=t-this.width/2}},top:{get:function(){return this.y-this.height/2},set:function(t){this.y=t+this.height/2}},bottom:{get:function(){return this.y+this.height/2},set:function(t){this.y=t-this.height/2}}});t.exports=l},function(t,e){t.exports=function(t,e,i){if(t.width<=0||t.height<=0)return!1;var n=(e-t.x)/t.width,r=(i-t.y)/t.height;return(n*=n)+(r*=r)<.25}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(269),r=i(0),s=i(75),o=i(9),a=i(204),h=i(2),l=i(6),c=i(7),u=i(431),d=i(148),p=i(73),f=new r({Extends:o,initialize:function(t,e,i){o.call(this),i?e&&!Array.isArray(e)&&(e=[e]):Array.isArray(e)?c(e[0])&&(i=e,e=null):c(e)&&(i=e,e=null),this.scene=t,this.children=new d,this.isParent=!0,this.type="Group",this.classType=h(i,"classType",p),this.name=h(i,"name",""),this.active=h(i,"active",!0),this.maxSize=h(i,"maxSize",-1),this.defaultKey=h(i,"defaultKey",null),this.defaultFrame=h(i,"defaultFrame",null),this.runChildUpdate=h(i,"runChildUpdate",!1),this.createCallback=h(i,"createCallback",null),this.removeCallback=h(i,"removeCallback",null),this.createMultipleCallback=h(i,"createMultipleCallback",null),this.internalCreateCallback=h(i,"internalCreateCallback",null),this.internalRemoveCallback=h(i,"internalRemoveCallback",null),e&&this.addMultiple(e),i&&this.createMultiple(i)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},create:function(t,e,i,n,r,s){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.defaultKey),void 0===n&&(n=this.defaultFrame),void 0===r&&(r=!0),void 0===s&&(s=!0),this.isFull())return null;var o=new this.classType(this.scene,t,e,i,n);return this.scene.sys.displayList.add(o),o.preUpdate&&this.scene.sys.updateList.add(o),o.visible=r,o.setActive(s),this.add(o),o},createMultiple:function(t){if(this.isFull())return[];Array.isArray(t)||(t=[t]);var e=[];if(t[0].key)for(var i=0;i=0;c--)if((l=d[c]).active===i){if(++u===e)break}else l=null;return l?("number"==typeof r&&(l.x=r),"number"==typeof s&&(l.y=s),l):n?this.create(r,s,o,a,h):null},get:function(t,e,i,n,r){return this.getFirst(!1,!0,t,e,i,n,r)},getFirstAlive:function(t,e,i,n,r,s){return this.getFirst(!0,t,e,i,n,r,s)},getFirstDead:function(t,e,i,n,r,s){return this.getFirst(!1,t,e,i,n,r,s)},playAnimation:function(t,e){return n.PlayAnimation(this.children.entries,t,e),this},isFull:function(){return-1!==this.maxSize&&this.children.size>=this.maxSize},countActive:function(t){void 0===t&&(t=!0);for(var e=0,i=0;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(12);t.exports=function(t,e,i,r,s,o){for(var a=n.getTintAppendFloatAlpha(i.fillColor,i.fillAlpha*r),h=i.pathData,l=i.pathIndexes,c=0;c=0&&v>=0&&g+v<1}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(10),s=i(114),o=i(3);function a(t,e,i,n){var r=t-i,s=e-n,o=r*r+s*s;return Math.sqrt(o)}var h=new n({initialize:function(t,e,i){this.vertex1=t,this.vertex2=e,this.vertex3=i,this.bounds=new r,this._inCenter=new o},getInCenter:function(t){void 0===t&&(t=!0);var e,i,n,r,s,o,h=this.vertex1,l=this.vertex2,c=this.vertex3;t?(e=h.x,i=h.y,n=l.x,r=l.y,s=c.x,o=c.y):(e=h.vx,i=h.vy,n=l.vx,r=l.vy,s=c.vx,o=c.vy);var u=a(s,o,n,r),d=a(e,i,s,o),p=a(n,r,e,i),f=u+d+p;return this._inCenter.set((e*u+n*d+s*p)/f,(i*u+r*d+o*p)/f)},contains:function(t,e,i){var n=this.vertex1,r=this.vertex2,s=this.vertex3,o=n.vx,a=n.vy,h=r.vx,l=r.vy,c=s.vx,u=s.vy;if(i){var d=i.a,p=i.b,f=i.c,m=i.d,g=i.e,v=i.f;o=n.vx*d+n.vy*f+g,a=n.vx*p+n.vy*m+v,h=r.vx*d+r.vy*f+g,l=r.vx*p+r.vy*m+v,c=s.vx*d+s.vy*f+g,u=s.vx*p+s.vy*m+v}var y=c-o,x=u-a,b=h-o,w=l-a,T=t-o,_=e-a,E=y*y+x*x,S=y*b+x*w,M=y*T+x*_,A=b*b+w*w,C=b*T+w*_,P=E*A-S*S,R=0===P?0:1/P,L=(A*M-S*C)*R,O=(E*C-S*M)*R;return L>=0&&O>=0&&L+O<1},isCounterClockwise:function(t){var e=this.vertex1,i=this.vertex2,n=this.vertex3,r=(i.vx-e.vx)*(n.vy-e.vy)-(i.vy-e.vy)*(n.vx-e.vx);return t<=0?r>=0:r<0},load:function(t,e,i,n,r){return i=this.vertex1.load(t,e,i,n,r),i=this.vertex2.load(t,e,i,n,r),i=this.vertex3.load(t,e,i,n,r)},transformCoordinatesLocal:function(t,e,i,n){return this.vertex1.transformCoordinatesLocal(t,e,i,n),this.vertex2.transformCoordinatesLocal(t,e,i,n),this.vertex3.transformCoordinatesLocal(t,e,i,n),this},updateBounds:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3,n=this.bounds;return n.x=Math.min(t.vx,e.vx,i.vx),n.y=Math.min(t.vy,e.vy,i.vy),n.width=Math.max(t.vx,e.vx,i.vx)-n.x,n.height=Math.max(t.vy,e.vy,i.vy)-n.y,this},isInView:function(t,e,i,n,r,o,a,h,l,c,u){var d=this.vertex1.update(r,o,a,h,l,c,u,n),p=this.vertex2.update(r,o,a,h,l,c,u,n),f=this.vertex3.update(r,o,a,h,l,c,u,n);if(d.ta<=0&&p.ta<=0&&f.ta<=0)return!1;if(e&&!this.isCounterClockwise(i))return!1;var m=this.bounds;return m.x=Math.min(d.tx,p.tx,f.tx),m.y=Math.min(d.ty,p.ty,f.ty),m.width=Math.max(d.tx,p.tx,f.tx)-m.x,m.height=Math.max(d.ty,p.ty,f.ty)-m.y,s(m,t.worldView)},translate:function(t,e){void 0===e&&(e=0);var i=this.vertex1,n=this.vertex2,r=this.vertex3;return i.x+=t,i.y+=e,n.x+=t,n.y+=e,r.x+=t,r.y+=e,this},x:{get:function(){return this.getInCenter().x},set:function(t){var e=this.getInCenter();this.translate(t-e.x,0)}},y:{get:function(){return this.getInCenter().y},set:function(t){var e=this.getInCenter();this.translate(0,t-e.y)}},alpha:{get:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3;return(t.alpha+e.alpha+i.alpha)/3},set:function(t){this.vertex1.alpha=t,this.vertex2.alpha=t,this.vertex3.alpha=t}},depth:{get:function(){var t=this.vertex1,e=this.vertex2,i=this.vertex3;return(t.vz+e.vz+i.vz)/3}},destroy:function(){this.vertex1=null,this.vertex2=null,this.vertex3=null}});t.exports=h},function(t,e){t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0||t.righte.right||t.y>e.bottom)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(12),s=i(38),o=new n({Extends:s,initialize:function(t,e,i,n,r,o,a,h,l,c){void 0===o&&(o=16777215),void 0===a&&(a=1),void 0===h&&(h=0),void 0===l&&(l=0),void 0===c&&(c=0),s.call(this,t,e,i),this.vx=0,this.vy=0,this.vz=0,this.nx=h,this.ny=l,this.nz=c,this.u=n,this.v=r,this.color=o,this.alpha=a,this.tx=0,this.ty=0,this.ta=0},setUVs:function(t,e){return this.u=t,this.v=e,this},transformCoordinatesLocal:function(t,e,i,n){var r=this.x,s=this.y,o=this.z,a=t.val,h=r*a[0]+s*a[4]+o*a[8]+a[12],l=r*a[1]+s*a[5]+o*a[9]+a[13],c=r*a[2]+s*a[6]+o*a[10]+a[14],u=r*a[3]+s*a[7]+o*a[11]+a[15];this.vx=h/u*e,this.vy=-l/u*i,this.vz=n<=0?c/u:-c/u},update:function(t,e,i,n,r,s,o,a){var h=this.vx*t+this.vy*i+r,l=this.vx*e+this.vy*n+s;return o&&(h=Math.round(h),l=Math.round(l)),this.tx=h,this.ty=l,this.ta=this.alpha*a,this},load:function(t,e,i,n,s){return t[++i]=this.tx,t[++i]=this.ty,t[++i]=this.u,t[++i]=this.v,t[++i]=n,t[++i]=s,e[++i]=r.getTintAppendFloatAlpha(this.color,this.ta),i}});t.exports=o},function(t,e){var i={};t.exports=i,i.create=function(t,e){return{x:t||0,y:e||0}},i.clone=function(t){return{x:t.x,y:t.y}},i.magnitude=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)},i.magnitudeSquared=function(t){return t.x*t.x+t.y*t.y},i.rotate=function(t,e,i){var n=Math.cos(e),r=Math.sin(e);i||(i={});var s=t.x*n-t.y*r;return i.y=t.x*r+t.y*n,i.x=s,i},i.rotateAbout=function(t,e,i,n){var r=Math.cos(e),s=Math.sin(e);n||(n={});var o=i.x+((t.x-i.x)*r-(t.y-i.y)*s);return n.y=i.y+((t.x-i.x)*s+(t.y-i.y)*r),n.x=o,n},i.normalise=function(t){var e=i.magnitude(t);return 0===e?{x:0,y:0}:{x:t.x/e,y:t.y/e}},i.dot=function(t,e){return t.x*e.x+t.y*e.y},i.cross=function(t,e){return t.x*e.y-t.y*e.x},i.cross3=function(t,e,i){return(e.x-t.x)*(i.y-t.y)-(e.y-t.y)*(i.x-t.x)},i.add=function(t,e,i){return i||(i={}),i.x=t.x+e.x,i.y=t.y+e.y,i},i.sub=function(t,e,i){return i||(i={}),i.x=t.x-e.x,i.y=t.y-e.y,i},i.mult=function(t,e){return{x:t.x*e,y:t.y*e}},i.div=function(t,e){return{x:t.x/e,y:t.y/e}},i.perp=function(t,e){return{x:(e=!0===e?-1:1)*-t.y,y:e*t.x}},i.neg=function(t){return{x:-t.x,y:-t.y}},i.angle=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)},i._temp=[i.create(),i.create(),i.create(),i.create(),i.create(),i.create()]},function(t,e){var i={};t.exports=i,i.create=function(t){var e={min:{x:0,y:0},max:{x:0,y:0}};return t&&i.update(e,t),e},i.update=function(t,e,i){t.min.x=1/0,t.max.x=-1/0,t.min.y=1/0,t.max.y=-1/0;for(var n=0;nt.max.x&&(t.max.x=r.x),r.xt.max.y&&(t.max.y=r.y),r.y0?t.max.x+=i.x:t.min.x+=i.x,i.y>0?t.max.y+=i.y:t.min.y+=i.y)},i.contains=function(t,e){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},i.overlaps=function(t,e){return t.min.x<=e.max.x&&t.max.x>=e.min.x&&t.max.y>=e.min.y&&t.min.y<=e.max.y},i.translate=function(t,e){t.min.x+=e.x,t.max.x+=e.x,t.min.y+=e.y,t.max.y+=e.y},i.shift=function(t,e){var i=t.max.x-t.min.x,n=t.max.y-t.min.y;t.min.x=e.x,t.max.x=e.x+i,t.min.y=e.y,t.max.y=e.y+n}},function(t,e){t.exports=function(t,e,i){return t>=0&&t=0&&e * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(29),s=i(2),o=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","layer"),this.x=s(t,"x",0),this.y=s(t,"y",0),this.width=s(t,"width",0),this.height=s(t,"height",0),this.tileWidth=s(t,"tileWidth",0),this.tileHeight=s(t,"tileHeight",0),this.baseTileWidth=s(t,"baseTileWidth",this.tileWidth),this.baseTileHeight=s(t,"baseTileHeight",this.tileHeight),this.orientation=s(t,"orientation",r.ORTHOGONAL),this.widthInPixels=s(t,"widthInPixels",this.width*this.baseTileWidth),this.heightInPixels=s(t,"heightInPixels",this.height*this.baseTileHeight),this.alpha=s(t,"alpha",1),this.visible=s(t,"visible",!0),this.properties=s(t,"properties",[]),this.indexes=s(t,"indexes",[]),this.collideIndexes=s(t,"collideIndexes",[]),this.callbacks=s(t,"callbacks",[]),this.bodies=s(t,"bodies",[]),this.data=s(t,"data",[]),this.tilemapLayer=s(t,"tilemapLayer",null),this.hexSideLength=s(t,"hexSideLength",0)}});t.exports=o},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(29),s=i(2),o=new n({initialize:function(t){void 0===t&&(t={}),this.name=s(t,"name","map"),this.width=s(t,"width",0),this.height=s(t,"height",0),this.infinite=s(t,"infinite",!1),this.tileWidth=s(t,"tileWidth",0),this.tileHeight=s(t,"tileHeight",0),this.widthInPixels=s(t,"widthInPixels",this.width*this.tileWidth),this.heightInPixels=s(t,"heightInPixels",this.height*this.tileHeight),this.format=s(t,"format",null),this.orientation=s(t,"orientation",r.ORTHOGONAL),this.renderOrder=s(t,"renderOrder","right-down"),this.version=s(t,"version","1"),this.properties=s(t,"properties",{}),this.layers=s(t,"layers",[]),this.images=s(t,"images",[]),this.objects=s(t,"objects",{}),this.collision=s(t,"collision",{}),this.tilesets=s(t,"tilesets",[]),this.imageCollections=s(t,"imageCollections",[]),this.tiles=s(t,"tiles",[]),this.hexSideLength=s(t,"hexSideLength",0)}});t.exports=o},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=new(i(0))({initialize:function(t,e,i,n,r,s,o,a){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===r&&(r=0),void 0===s&&(s=0),void 0===o&&(o={}),void 0===a&&(a={}),this.name=t,this.firstgid=e,this.tileWidth=i,this.tileHeight=n,this.tileMargin=r,this.tileSpacing=s,this.tileProperties=o,this.tileData=a,this.image=null,this.glTexture=null,this.rows=0,this.columns=0,this.total=0,this.texCoordinates=[]},getTileProperties:function(t){return this.containsTileIndex(t)?this.tileProperties[t-this.firstgid]:null},getTileData:function(t){return this.containsTileIndex(t)?this.tileData[t-this.firstgid]:null},getTileCollisionGroup:function(t){var e=this.getTileData(t);return e&&e.objectgroup?e.objectgroup:null},containsTileIndex:function(t){return t>=this.firstgid&&t * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(11),s=i(15),o=i(1062),a=new n({Extends:s,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.GetBounds,r.Mask,r.Origin,r.Pipeline,r.ScrollFactor,r.Size,r.TextureCrop,r.Tint,r.Transform,r.Visible,o],initialize:function(t,e,i,n,r){s.call(this,t,"Image"),this._crop=this.resetCropObject(),this.setTexture(n,r),this.setPosition(e,i),this.setSizeToFrame(),this.setOriginFromFrame(),this.initPipeline()}});t.exports=a},function(t,e){t.exports=function(t,e){return t.hasOwnProperty(e)}},function(t,e,i){var n={};t.exports=n;var r=i(94),s=i(50),o=i(71),a=i(117),h=i(116),l=i(1487);n.rectangle=function(t,e,i,n,a){a=a||{};var h={label:"Rectangle Body",position:{x:t,y:e},vertices:r.fromPath("L 0 0 L "+i+" 0 L "+i+" "+n+" L 0 "+n)};if(a.chamfer){var l=a.chamfer;h.vertices=r.chamfer(h.vertices,l.radius,l.quality,l.qualityMin,l.qualityMax),delete a.chamfer}return o.create(s.extend({},h,a))},n.trapezoid=function(t,e,i,n,a,h){h=h||{};var l,c=i*(a*=.5),u=c+(1-2*a)*i,d=u+c;l=a<.5?"L 0 0 L "+c+" "+-n+" L "+u+" "+-n+" L "+d+" 0":"L 0 0 L "+u+" "+-n+" L "+d+" 0";var p={label:"Trapezoid Body",position:{x:t,y:e},vertices:r.fromPath(l)};if(h.chamfer){var f=h.chamfer;p.vertices=r.chamfer(p.vertices,f.radius,f.quality,f.qualityMin,f.qualityMax),delete h.chamfer}return o.create(s.extend({},p,h))},n.circle=function(t,e,i,r,o){r=r||{};var a={label:"Circle Body",circleRadius:i};o=o||25;var h=Math.ceil(Math.max(10,Math.min(o,i)));return h%2==1&&(h+=1),n.polygon(t,e,h,i,s.extend({},a,r))},n.polygon=function(t,e,i,a,h){if(h=h||{},i<3)return n.circle(t,e,a,h);for(var l=2*Math.PI/i,c="",u=.5*l,d=0;d0&&r.area(b)1?(d=o.create(s.extend({parts:p.slice(0)},a)),o.setPosition(d,{x:t,y:e}),d):p[0]},n.flagCoincidentParts=function(t,e){void 0===e&&(e=5);for(var i=0;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(34),r=i(62),s=i(63),o=i(0),a=i(11),h=i(15),l=i(10),c=i(56),u=new o({Extends:h,Mixins:[a.Depth,a.GetBounds,a.Origin,a.Transform,a.ScrollFactor,a.Visible],initialize:function(t,e,i,r,s){void 0===r&&(r=1),void 0===s&&(s=r),h.call(this,t,"Zone"),this.setPosition(e,i),this.width=r,this.height=s,this.blendMode=n.NORMAL,this.updateDisplayOrigin()},displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e,i){void 0===i&&(i=!0),this.width=t,this.height=e,this.updateDisplayOrigin();var n=this.input;return i&&n&&!n.customHitArea&&(n.hitArea.width=t,n.hitArea.height=e),this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this},setCircleDropZone:function(t){return this.setDropZone(new r(0,0,t),s)},setRectangleDropZone:function(t,e){return this.setDropZone(new l(0,0,t,e),c)},setDropZone:function(t,e){return void 0===t?this.setRectangleDropZone(this.width,this.height):this.input||this.setInteractive(t,e,!0),this},setAlpha:function(){},setBlendMode:function(){},renderCanvas:function(){},renderWebGL:function(){}});t.exports=u},function(t,e){t.exports=function(t){return 2*(t.width+t.height)}},function(t,e){t.exports=function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),n=t[e];t[e]=t[i],t[i]=n}return t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={ADD_ANIMATION:i(700),ANIMATION_COMPLETE:i(701),ANIMATION_COMPLETE_KEY:i(702),ANIMATION_REPEAT:i(703),ANIMATION_RESTART:i(704),ANIMATION_START:i(705),ANIMATION_STOP:i(706),ANIMATION_UPDATE:i(707),PAUSE_ALL:i(708),REMOVE_ANIMATION:i(709),RESUME_ALL:i(710)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(11),s=i(35),o=i(9),a=i(36),h=i(10),l=i(25),c=i(184),u=i(3),d=new n({Extends:o,Mixins:[r.Alpha,r.Visible],initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),o.call(this),this.scene,this.sceneManager,this.scaleManager,this.cameraManager,this.id=0,this.name="",this.roundPixels=!1,this.useBounds=!1,this.worldView=new h,this.dirty=!0,this._x=t,this._y=e,this._width=i,this._height=n,this._bounds=new h,this._scrollX=0,this._scrollY=0,this._zoomX=1,this._zoomY=1,this._rotation=0,this.matrix=new l,this.transparent=!0,this.backgroundColor=c("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new u(i/2,n/2),this.originX=.5,this.originY=.5,this._customViewport=!1,this.mask=null,this._maskCamera=null,this.renderList=[]},addToRenderList:function(t){this.renderList.push(t)},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this},getScroll:function(t,e,i){void 0===i&&(i=new u);var n=.5*this.width,r=.5*this.height;return i.x=t-n,i.y=e-r,this.useBounds&&(i.x=this.clampX(i.x),i.y=this.clampY(i.y)),i},centerOnX:function(t){var e=.5*this.width;return this.midPoint.x=t,this.scrollX=t-e,this.useBounds&&(this.scrollX=this.clampX(this.scrollX)),this},centerOnY:function(t){var e=.5*this.height;return this.midPoint.y=t,this.scrollY=t-e,this.useBounds&&(this.scrollY=this.clampY(this.scrollY)),this},centerOn:function(t,e){return this.centerOnX(t),this.centerOnY(e),this},centerToBounds:function(){if(this.useBounds){var t=this._bounds,e=.5*this.width,i=.5*this.height;this.midPoint.set(t.centerX,t.centerY),this.scrollX=t.centerX-e,this.scrollY=t.centerY-i}return this},centerToSize:function(){return this.scrollX=.5*this.width,this.scrollY=.5*this.height,this},cull:function(t){if(this.disableCull)return t;var e=this.matrix.matrix,i=e[0],n=e[1],r=e[2],s=e[3],o=i*s-n*r;if(!o)return t;var a=e[4],h=e[5],l=this.scrollX,c=this.scrollY,u=this.width,d=this.height,p=this.y,f=p+d,m=this.x,g=m+u,v=this.culledObjects,y=t.length;o=1/o,v.length=0;for(var x=0;xm&&_*i+E*r+ap&&_*n+E*s+hr&&(t=r),t},clampY:function(t){var e=this._bounds,i=this.displayHeight,n=e.y+(i-this.height)/2,r=Math.max(n,n+e.height-i);return tr&&(t=r),t},removeBounds:function(){return this.useBounds=!1,this.dirty=!0,this._bounds.setEmpty(),this},setAngle:function(t){return void 0===t&&(t=0),this.rotation=s(t),this},setBackgroundColor:function(t){return void 0===t&&(t="rgba(0,0,0,0)"),this.backgroundColor=c(t),this.transparent=0===this.backgroundColor.alpha,this},setBounds:function(t,e,i,n,r){return void 0===r&&(r=!1),this._bounds.setTo(t,e,i,n),this.dirty=!0,this.useBounds=!0,r?this.centerToBounds():(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},getBounds:function(t){void 0===t&&(t=new h);var e=this._bounds;return t.setTo(e.x,e.y,e.width,e.height),t},setName:function(t){return void 0===t&&(t=""),this.name=t,this},setPosition:function(t,e){return void 0===e&&(e=t),this.x=t,this.y=e,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setRoundPixels:function(t){return this.roundPixels=t,this},setScene:function(t){this.scene&&this._customViewport&&this.sceneManager.customViewports--,this.scene=t;var e=t.sys;return this.sceneManager=e.game.scene,this.scaleManager=e.scale,this.cameraManager=e.cameras,this.updateSystem(),this},setScroll:function(t,e){return void 0===e&&(e=t),this.scrollX=t,this.scrollY=e,this},setSize:function(t,e){return void 0===e&&(e=t),this.width=t,this.height=e,this},setViewport:function(t,e,i,n){return this.x=t,this.y=e,this.width=i,this.height=n,this},setZoom:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),0===t&&(t=.001),0===e&&(e=.001),this.zoomX=t,this.zoomY=e,this},setMask:function(t,e){return void 0===e&&(e=!0),this.mask=t,this._maskCamera=e?this.cameraManager.default:this,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},toJSON:function(){var t={name:this.name,x:this.x,y:this.y,width:this.width,height:this.height,zoom:this.zoom,rotation:this.rotation,roundPixels:this.roundPixels,scrollX:this.scrollX,scrollY:this.scrollY,backgroundColor:this.backgroundColor.rgba};return this.useBounds&&(t.bounds={x:this._bounds.x,y:this._bounds.y,width:this._bounds.width,height:this._bounds.height}),t},update:function(){},updateSystem:function(){if(this.scaleManager){var t=0!==this._x||0!==this._y||this.scaleManager.width!==this._width||this.scaleManager.height!==this._height,e=this.sceneManager;t&&!this._customViewport?e.customViewports++:!t&&this._customViewport&&e.customViewports--,this.dirty=!0,this._customViewport=t}},destroy:function(){this.emit(a.DESTROY,this),this.removeAllListeners(),this.matrix.destroy(),this.culledObjects=[],this._customViewport&&this.sceneManager.customViewports--,this.renderList=[],this._bounds=null,this.scene=null,this.scaleManager=null,this.sceneManager=null,this.cameraManager=null},x:{get:function(){return this._x},set:function(t){this._x=t,this.updateSystem()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.updateSystem()}},width:{get:function(){return this._width},set:function(t){this._width=t,this.updateSystem()}},height:{get:function(){return this._height},set:function(t){this._height=t,this.updateSystem()}},scrollX:{get:function(){return this._scrollX},set:function(t){this._scrollX=t,this.dirty=!0}},scrollY:{get:function(){return this._scrollY},set:function(t){this._scrollY=t,this.dirty=!0}},zoom:{get:function(){return(this._zoomX+this._zoomY)/2},set:function(t){this._zoomX=t,this._zoomY=t,this.dirty=!0}},zoomX:{get:function(){return this._zoomX},set:function(t){this._zoomX=t,this.dirty=!0}},zoomY:{get:function(){return this._zoomY},set:function(t){this._zoomY=t,this.dirty=!0}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t,this.dirty=!0}},centerX:{get:function(){return this.x+.5*this.width}},centerY:{get:function(){return this.y+.5*this.height}},displayWidth:{get:function(){return this.width/this.zoomX}},displayHeight:{get:function(){return this.height/this.zoomY}}});t.exports=d},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(328),r=i(329),s=i(330),o=i(331),a=i(332),h=i(333),l=i(334),c=i(335),u=i(336),d=i(337),p=i(338),f=i(339);t.exports={Power0:l,Power1:c.Out,Power2:o.Out,Power3:u.Out,Power4:d.Out,Linear:l,Quad:c.Out,Cubic:o.Out,Quart:u.Out,Quint:d.Out,Sine:p.Out,Expo:h.Out,Circ:s.Out,Elastic:a.Out,Back:n.Out,Bounce:r.Out,Stepped:f,"Quad.easeIn":c.In,"Cubic.easeIn":o.In,"Quart.easeIn":u.In,"Quint.easeIn":d.In,"Sine.easeIn":p.In,"Expo.easeIn":h.In,"Circ.easeIn":s.In,"Elastic.easeIn":a.In,"Back.easeIn":n.In,"Bounce.easeIn":r.In,"Quad.easeOut":c.Out,"Cubic.easeOut":o.Out,"Quart.easeOut":u.Out,"Quint.easeOut":d.Out,"Sine.easeOut":p.Out,"Expo.easeOut":h.Out,"Circ.easeOut":s.Out,"Elastic.easeOut":a.Out,"Back.easeOut":n.Out,"Bounce.easeOut":r.Out,"Quad.easeInOut":c.InOut,"Cubic.easeInOut":o.InOut,"Quart.easeInOut":u.InOut,"Quint.easeInOut":d.InOut,"Sine.easeInOut":p.InOut,"Expo.easeInOut":h.InOut,"Circ.easeInOut":s.InOut,"Elastic.easeInOut":a.InOut,"Back.easeInOut":n.InOut,"Bounce.easeInOut":r.InOut}},function(t,e){t.exports=function(t,e,i){return(e-t)*i+t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n,r=i(102),s={chrome:!1,chromeVersion:0,edge:!1,firefox:!1,firefoxVersion:0,ie:!1,ieVersion:0,mobileSafari:!1,opera:!1,safari:!1,safariVersion:0,silk:!1,trident:!1,tridentVersion:0};t.exports=(n=navigator.userAgent,/Edge\/\d+/.test(n)?s.edge=!0:/Chrome\/(\d+)/.test(n)&&!r.windowsPhone?(s.chrome=!0,s.chromeVersion=parseInt(RegExp.$1,10)):/Firefox\D+(\d+)/.test(n)?(s.firefox=!0,s.firefoxVersion=parseInt(RegExp.$1,10)):/AppleWebKit/.test(n)&&r.iOS?s.mobileSafari=!0:/MSIE (\d+\.\d+);/.test(n)?(s.ie=!0,s.ieVersion=parseInt(RegExp.$1,10)):/Opera/.test(n)?s.opera=!0:/Safari/.test(n)&&!r.windowsPhone?s.safari=!0:/Trident\/(\d+\.\d+)(.*)rv:(\d+\.\d+)/.test(n)&&(s.ie=!0,s.trident=!0,s.tridentVersion=parseInt(RegExp.$1,10),s.ieVersion=parseInt(RegExp.$3,10)),/Silk/.test(n)&&(s.silk=!0),s)},function(t,e){t.exports=function(t,e){return Math.random()*(e-t)+t}},function(t,e){t.exports=function(t,e){return t>0&&0==(t&t-1)&&e>0&&0==(e&e-1)}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.ceil(t/e),n?(i+t)/e:i+t)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=new(i(0))({initialize:function(t,e,i,n){this.x=0,this.y=0,this.z=0,this.w=0,"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0)},clone:function(){return new n(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z||0,this.w=t.w||0,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},set:function(t,e,i,n){return"object"==typeof t?(this.x=t.x||0,this.y=t.y||0,this.z=t.z||0,this.w=t.w||0):(this.x=t||0,this.y=e||0,this.z=i||0,this.w=n||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z||0,this.w+=t.w||0,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z||0,this.w-=t.w||0,this},scale:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n;return r>0&&(r=1/Math.sqrt(r),this.x=t*r,this.y=e*r,this.z=i*r,this.w=n*r),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z,s=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=r+e*(t.z-r),this.w=s+e*(t.w-s),this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z||1,this.w*=t.w||1,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z||1,this.w/=t.w||1,this},distance:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,r=t.w-this.w||0;return Math.sqrt(e*e+i*i+n*n+r*r)},distanceSq:function(t){var e=t.x-this.x,i=t.y-this.y,n=t.z-this.z||0,r=t.w-this.w||0;return e*e+i*i+n*n+r*r},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},transformMat4:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,s=t.val;return this.x=s[0]*e+s[4]*i+s[8]*n+s[12]*r,this.y=s[1]*e+s[5]*i+s[9]*n+s[13]*r,this.z=s[2]*e+s[6]*i+s[10]*n+s[14]*r,this.w=s[3]*e+s[7]*i+s[11]*n+s[15]*r,this},transformQuat:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,o=t.z,a=t.w,h=a*e+s*n-o*i,l=a*i+o*e-r*n,c=a*n+r*i-s*e,u=-r*e-s*i-o*n;return this.x=h*a+u*-r+l*-o-c*-s,this.y=l*a+u*-s+c*-r-h*-o,this.z=c*a+u*-o+h*-s-l*-r,this},reset:function(){return this.x=0,this.y=0,this.z=0,this.w=0,this}});n.prototype.sub=n.prototype.subtract,n.prototype.mul=n.prototype.multiply,n.prototype.div=n.prototype.divide,n.prototype.dist=n.prototype.distance,n.prototype.distSq=n.prototype.distanceSq,n.prototype.len=n.prototype.length,n.prototype.lenSq=n.prototype.lengthSq,t.exports=n},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(88),s=new n({initialize:function(t,e,i,n,r,s,o){void 0===n&&(n=1),void 0===r&&(r=0),void 0===s&&(s=!0),void 0===o&&(o=!1),this.renderer=t,this.framebuffer=null,this.texture=null,this.width=0,this.height=0,this.scale=n,this.minFilter=r,this.autoClear=s,this.autoResize=!1,this.resize(e,i),o&&this.setAutoResize(!0)},setAutoResize:function(t){return t&&!this.autoResize?(this.renderer.on(r.RESIZE,this.resize,this),this.autoResize=!0):!t&&this.autoResize&&(this.renderer.off(r.RESIZE,this.resize,this),this.autoResize=!1),this},resize:function(t,e){var i=t*this.scale,n=e*this.scale;if(i!==this.width||n!==this.height){var r=this.renderer;r.deleteFramebuffer(this.framebuffer),r.deleteTexture(this.texture),t*=this.scale,e*=this.scale,this.texture=r.createTextureFromSource(null,t,e,this.minFilter),this.framebuffer=r.createFramebuffer(t,e,this.texture,!1),this.width=t,this.height=e}return this},bind:function(t,e,i){if(void 0===t&&(t=!1),t&&this.renderer.flush(),e&&i&&this.resize(e,i),this.renderer.pushFramebuffer(this.framebuffer,!1,!1,!1),t&&this.adjustViewport(),this.autoClear){var n=this.renderer.gl;n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT)}},adjustViewport:function(){var t=this.renderer.gl;t.viewport(0,0,this.width,this.height),t.disable(t.SCISSOR_TEST)},clear:function(){var t=this.renderer,e=t.gl;t.pushFramebuffer(this.framebuffer),e.disable(e.SCISSOR_TEST),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),t.popFramebuffer(),t.resetScissor()},unbind:function(t){void 0===t&&(t=!1);var e=this.renderer;return t&&e.flush(),e.popFramebuffer()},destroy:function(){var t=this.renderer;t.deleteFramebuffer(this.framebuffer),t.deleteTexture(this.texture),t.off(r.RESIZE,this.resize,this),this.renderer=null,this.framebuffer=null,this.texture=null}});t.exports=s},function(t,e){t.exports=function(t,e){var i;if(e)"string"==typeof e?i=document.getElementById(e):"object"==typeof e&&1===e.nodeType&&(i=e);else if(t.parentElement||null===e)return t;return i||(i=document.body),i.appendChild(t),t}},function(t,e){t.exports={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:42,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,NUMPAD_ZERO:96,NUMPAD_ONE:97,NUMPAD_TWO:98,NUMPAD_THREE:99,NUMPAD_FOUR:100,NUMPAD_FIVE:101,NUMPAD_SIX:102,NUMPAD_SEVEN:103,NUMPAD_EIGHT:104,NUMPAD_NINE:105,NUMPAD_ADD:107,NUMPAD_SUBTRACT:109,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,SEMICOLON:186,PLUS:187,COMMA:188,MINUS:189,PERIOD:190,FORWARD_SLASH:191,BACK_SLASH:220,QUOTES:222,BACKTICK:192,OPEN_BRACKET:219,CLOSED_BRACKET:221,SEMICOLON_FIREFOX:59,COLON:58,COMMA_FIREFOX_WINDOWS:60,COMMA_FIREFOX:62,BRACKET_RIGHT_FIREFOX:174,BRACKET_LEFT_FIREFOX:175}},function(t,e){t.exports={PENDING:0,INIT:1,START:2,LOADING:3,CREATING:4,RUNNING:5,PAUSED:6,SLEEPING:7,SHUTDOWN:8,DESTROYED:9}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(77);t.exports=function(t,e){var i=n(t);for(var r in e)i.hasOwnProperty(r)||(i[r]=e[r]);return i}},function(t,e,i){ /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(77),s=i(9),o=i(69),a=i(22),h=i(1),l=i(204),c=i(422),u=new n({Extends:s,initialize:function(t){s.call(this),this.game=t,this.jsonCache=t.cache.json,this.sounds=[],this.mute=!1,this.volume=1,this.pauseOnBlur=!0,this._rate=1,this._detune=0,this.locked=this.locked||!1,this.unlocked=!1,t.events.on(a.BLUR,this.onGameBlur,this),t.events.on(a.FOCUS,this.onGameFocus,this),t.events.on(a.PRE_STEP,this.update,this),t.events.once(a.DESTROY,this.destroy,this)},add:h,addAudioSprite:function(t,e){void 0===e&&(e={});var i=this.add(t,e);for(var n in i.spritemap=this.jsonCache.get(t).spritemap,i.spritemap)if(i.spritemap.hasOwnProperty(n)){var s=r(e),o=i.spritemap[n];s.loop=!!o.hasOwnProperty("loop")&&o.loop,i.addMarker({name:n,start:o.start,duration:o.end-o.start,config:s})}return i},get:function(t){return c(this.sounds,"key",t)},getAll:function(t){return l(this.sounds,"key",t)},play:function(t,e){var i=this.add(t);return i.once(o.COMPLETE,i.destroy,i),e?e.name?(i.addMarker(e),i.play(e.name)):i.play(e):i.play()},playAudioSprite:function(t,e,i){var n=this.addAudioSprite(t);return n.once(o.COMPLETE,n.destroy,n),n.play(e,i)},remove:function(t){var e=this.sounds.indexOf(t);return-1!==e&&(t.destroy(),this.sounds.splice(e,1),!0)},removeAll:function(){this.sounds.forEach((function(t){t.destroy()})),this.sounds.length=0},removeByKey:function(t){for(var e=0,i=this.sounds.length-1;i>=0;i--){var n=this.sounds[i];n.key===t&&(n.destroy(),this.sounds.splice(i,1),e++)}return e},pauseAll:function(){this.forEachActiveSound((function(t){t.pause()})),this.emit(o.PAUSE_ALL,this)},resumeAll:function(){this.forEachActiveSound((function(t){t.resume()})),this.emit(o.RESUME_ALL,this)},stopAll:function(){this.forEachActiveSound((function(t){t.stop()})),this.emit(o.STOP_ALL,this)},stopByKey:function(t){var e=0;return this.getAll(t).forEach((function(t){t.stop()&&e++})),e},unlock:h,onBlur:h,onFocus:h,onGameBlur:function(){this.pauseOnBlur&&this.onBlur()},onGameFocus:function(){this.pauseOnBlur&&this.onFocus()},update:function(t,e){this.unlocked&&(this.unlocked=!1,this.locked=!1,this.emit(o.UNLOCKED,this));for(var i=this.sounds.length-1;i>=0;i--)this.sounds[i].pendingRemove&&this.sounds.splice(i,1);this.sounds.forEach((function(i){i.update(t,e)}))},destroy:function(){this.game.events.off(a.BLUR,this.onGameBlur,this),this.game.events.off(a.FOCUS,this.onGameFocus,this),this.game.events.off(a.PRE_STEP,this.update,this),this.removeAllListeners(),this.removeAll(),this.sounds.length=0,this.sounds=null,this.game=null},forEachActiveSound:function(t,e){var i=this;this.sounds.forEach((function(n,r){n&&!n.pendingRemove&&t.call(e||i,n,r,i.sounds)}))},setRate:function(t){return this.rate=t,this},rate:{get:function(){return this._rate},set:function(t){this._rate=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(o.GLOBAL_RATE,this,t)}},setDetune:function(t){return this.detune=t,this},detune:{get:function(){return this._detune},set:function(t){this._detune=t,this.forEachActiveSound((function(t){t.calculateRate()})),this.emit(o.GLOBAL_DETUNE,this,t)}}});t.exports=u},function(t,e,i){ /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(9),s=i(69),o=i(17),a=i(1),h=new n({Extends:r,initialize:function(t,e,i){r.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=this.duration||0,this.totalDuration=this.totalDuration||0,this.config={mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},this.currentConfig=this.config,this.config=o(this.config,i),this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name||(this.markers[t.name]?(console.error("addMarker "+t.name+" already exists in Sound"),1):(t=o(!0,{name:"",start:0,duration:this.totalDuration-(t.start||0),config:{mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0}},t),this.markers[t.name]=t,0)))},updateMarker:function(t){return!(!t||!t.name||"string"!=typeof t.name||(this.markers[t.name]?(this.markers[t.name]=o(!0,this.markers[t.name],t),0):(console.warn("Audio Marker: "+t.name+" missing in Sound: "+this.key),1)))},removeMarker:function(t){var e=this.markers[t];return e?(this.markers[t]=null,e):null},play:function(t,e){if(void 0===t&&(t=""),"object"==typeof t&&(e=t,t=""),"string"!=typeof t)return!1;if(t){if(!this.markers[t])return console.warn("Marker: "+t+" missing in Sound: "+this.key),!1;this.currentMarker=this.markers[t],this.currentConfig=this.currentMarker.config,this.duration=this.currentMarker.duration}else this.currentMarker=null,this.currentConfig=this.config,this.duration=this.totalDuration;return this.resetConfig(),this.currentConfig=o(this.currentConfig,e),this.isPlaying=!0,this.isPaused=!1,!0},pause:function(){return!(this.isPaused||!this.isPlaying||(this.isPlaying=!1,this.isPaused=!0,0))},resume:function(){return!(!this.isPaused||this.isPlaying||(this.isPlaying=!0,this.isPaused=!1,0))},stop:function(){return!(!this.isPaused&&!this.isPlaying||(this.isPlaying=!1,this.isPaused=!1,this.resetConfig(),0))},applyConfig:function(){this.mute=this.currentConfig.mute,this.volume=this.currentConfig.volume,this.rate=this.currentConfig.rate,this.detune=this.currentConfig.detune,this.loop=this.currentConfig.loop,this.pan=this.currentConfig.pan},resetConfig:function(){this.currentConfig.seek=0,this.currentConfig.delay=0},update:a,calculateRate:function(){var t=this.currentConfig.detune+this.manager.detune,e=Math.pow(1.0005777895065548,t);this.totalRate=this.currentConfig.rate*this.manager.rate*e},destroy:function(){this.pendingRemove||(this.emit(s.DESTROY,this),this.pendingRemove=!0,this.manager=null,this.key="",this.removeAllListeners(),this.isPlaying=!1,this.isPaused=!1,this.config=null,this.currentConfig=null,this.markers=null,this.currentMarker=null)}});t.exports=h},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(206),r=i(429);t.exports=function(t,e){if(void 0===e&&(e=90),!n(t))return null;if("string"!=typeof e&&(e=(e%360+360)%360),90===e||-270===e||"rotateLeft"===e)(t=r(t)).reverse();else if(-90===e||270===e||"rotateRight"===e)t.reverse(),t=r(t);else if(180===Math.abs(e)||"rotate180"===e){for(var i=0;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(18),s=i(11),o=i(15),a=i(1037),h=i(1038),l=i(209),c=i(10),u=i(1039),d=new n({Extends:o,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Texture,s.Tint,s.Transform,s.Visible,u],initialize:function(t,e,i,n,r,s,h){void 0===r&&(r=""),void 0===h&&(h=0),o.call(this,t,"BitmapText"),this.font=n;var l=this.scene.sys.cache.bitmapFont.get(n);l||console.warn("Invalid BitmapText key: "+n),this.fontData=l.data,this._text="",this._fontSize=s||this.fontData.size,this._letterSpacing=0,this._align=h,this._bounds=a(),this._dirty=!0,this._maxWidth=0,this.wordWrapCharCode=32,this.charColors=[],this.dropShadowX=0,this.dropShadowY=0,this.dropShadowColor=0,this.dropShadowAlpha=.5,this.setTexture(l.texture,l.frame),this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.setText(r)},setLeftAlign:function(){return this._align=d.ALIGN_LEFT,this._dirty=!0,this},setCenterAlign:function(){return this._align=d.ALIGN_CENTER,this._dirty=!0,this},setRightAlign:function(){return this._align=d.ALIGN_RIGHT,this._dirty=!0,this},setFontSize:function(t){return this._fontSize=t,this._dirty=!0,this},setLetterSpacing:function(t){return void 0===t&&(t=0),this._letterSpacing=t,this._dirty=!0,this},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this.text&&(this._text=t.toString(),this._dirty=!0,this.updateDisplayOrigin()),this},setDropShadow:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=.5),this.dropShadowX=t,this.dropShadowY=e,this.dropShadowColor=i,this.dropShadowAlpha=n,this},setCharacterTint:function(t,e,i,n,s,o,a){void 0===t&&(t=0),void 0===e&&(e=1),void 0===i&&(i=!1),void 0===n&&(n=-1),void 0===s&&(s=n,o=n,a=n);var h=this.text.length;-1===e&&(e=h),t<0&&(t=h+t),t=r(t,0,h-1);for(var l=r(t+e,t,h),c=this.charColors,u=t;u * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=new(i(0))({initialize:function(t){if(this.entries=[],Array.isArray(t))for(var e=0;e-1&&this.entries.splice(e,1),this},dump:function(){console.group("Set");for(var t=0;t-1},union:function(t){var e=new n;return t.entries.forEach((function(t){e.set(t)})),this.entries.forEach((function(t){e.set(t)})),e},intersect:function(t){var e=new n;return this.entries.forEach((function(i){t.contains(i)&&e.set(i)})),e},difference:function(t){var e=new n;return this.entries.forEach((function(i){t.contains(i)||e.set(i)})),e},size:{get:function(){return this.entries.length},set:function(t){return t * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(11),s=i(15),o=i(186),a=i(65),h=i(1176),l=new n({Extends:s,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.GetBounds,r.Mask,r.Pipeline,r.ScrollFactor,r.Transform,r.Visible,h],initialize:function(t,e,i,n,r,h,l){void 0===n&&(n=16777215),void 0===r&&(r=128),void 0===h&&(h=1),void 0===l&&(l=.1),s.call(this,t,"PointLight"),this.initPipeline(a.POINTLIGHT_PIPELINE),this.setPosition(e,i),this.color=o(n),this.intensity=h,this.attenuation=l,this.width=2*r,this.height=2*r,this._radius=r},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this.width=2*t,this.height=2*t}},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return this._radius}},displayOriginY:{get:function(){return this._radius}}});t.exports=l},function(t,e){t.exports=function(t,e){var i=e.width/2,n=e.height/2,r=Math.abs(t.x-e.x-i),s=Math.abs(t.y-e.y-n),o=i+t.radius,a=n+t.radius;if(r>o||s>a)return!1;if(r<=i||s<=n)return!0;var h=r-i,l=s-n;return h*h+l*l<=t.radius*t.radius}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(6),r={},s={register:function(t,e,i,n,s){r[t]={plugin:e,mapping:i,settingsKey:n,configKey:s}},getPlugin:function(t){return r[t]},install:function(t){var e=t.scene.sys,i=e.settings.input,s=e.game.config;for(var o in r){var a=r[o].plugin,h=r[o].mapping,l=r[o].settingsKey,c=r[o].configKey;n(i,l,s[c])&&(t[h]=new a(t))}},remove:function(t){r.hasOwnProperty(t)&&delete r[t]}};t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={ANY_KEY_DOWN:i(1317),ANY_KEY_UP:i(1318),COMBO_MATCH:i(1319),DOWN:i(1320),KEY_DOWN:i(1321),KEY_UP:i(1322),UP:i(1323)}},function(t,e){t.exports=function(t,e){return!!t.url&&(t.url.match(/^(?:blob:|data:|http:\/\/|https:\/\/|\/\/)/)?t.url:e+t.url)}},function(t,e){t.exports=function(t,e,i,n,r,s){return void 0===t&&(t=""),void 0===e&&(e=!0),void 0===i&&(i=""),void 0===n&&(n=""),void 0===r&&(r=0),void 0===s&&(s=!1),{responseType:t,async:e,user:i,password:n,timeout:r,headers:void 0,header:void 0,headerValue:void 0,requestedWith:!1,overrideMimeType:void 0,withCredentials:s}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(240),s=i(73),o=new n({Extends:s,Mixins:[r.Acceleration,r.Angular,r.Bounce,r.Debug,r.Drag,r.Enable,r.Friction,r.Gravity,r.Immovable,r.Mass,r.Pushable,r.Size,r.Velocity],initialize:function(t,e,i,n,r){s.call(this,t,e,i,n,r),this.body=null}});t.exports=o},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(118);t.exports=function(t,e,i,r){if(void 0===i&&(i=!1),n(t,e,r)){var s=r.data[e][t]||null;return s?-1===s.index?i?s:null:s:null}return null}},function(t,e){t.exports=function(t,e,i,n){var r,s,o,a=t.data,h=t.width,l=t.height,c=t.tilemapLayer,u=Math.max(0,e.left),d=Math.min(h,e.right),p=Math.max(0,e.top),f=Math.min(l,e.bottom);if(0===i)for(s=p;s=u;r--)(o=a[s][r])&&-1!==o.index&&o.visible&&0!==o.alpha&&n.push(o);else if(2===i)for(s=f;s>=p;s--)for(r=u;a[s]&&r=p;s--)for(r=d;a[s]&&r>=u;r--)(o=a[s][r])&&-1!==o.index&&o.visible&&0!==o.alpha&&n.push(o);return c.tilesDrawn=n.length,c.tilesTotal=h*l,n}},function(t,e){t.exports=function(t,e,i){var n=i.collideIndexes.indexOf(t);e&&-1===n?i.collideIndexes.push(t):e||-1===n||i.collideIndexes.splice(n,1)}},function(t,e,i){ /** * @author Seth Berrier * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(2);t.exports=function(t,e,i){if(!e)return{i:0,layers:t.layers,name:"",opacity:1,visible:!0,x:0,y:0};var r=e.x+n(e,"startx",0)*t.tilewidth+n(e,"offsetx",0),s=e.y+n(e,"starty",0)*t.tileheight+n(e,"offsety",0);return{i:0,layers:e.layers,name:i.name+e.name+"/",opacity:i.opacity*e.opacity,visible:i.visible&&e.visible,x:i.x+r,y:i.y+s}}},function(t,e){t.exports=function(t,e,i){return t.hasOwnProperty(e)?"function"==typeof t[e]?function(i,n,r,s,o,a){return t[e](i,n,r,s,o,a)}:function(){return t[e]}:"function"==typeof i?i:function(){return i}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(261),r=i(13),s=i(96),o=i(80),a=i(160),h=i(579),l=i(259),c=i(6),u=i(260),d=i(262),p=i(264);t.exports=function(t,e,i){void 0===i&&(i=n);for(var f=i.targets?i.targets:l(e),m=h(e),g=a(e,"delay",i.delay),v=a(e,"duration",i.duration),y=c(e,"easeParams",i.easeParams),x=o(c(e,"ease",i.ease),y),b=a(e,"hold",i.hold),w=a(e,"repeat",i.repeat),T=a(e,"repeatDelay",i.repeatDelay),_=s(e,"yoyo",i.yoyo),E=s(e,"flipX",i.flipX),S=s(e,"flipY",i.flipY),M=[],A=0;A * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(99),s=i(2),o=i(130),a=i(182),h=new n({initialize:function(t){this.parent=t,this.animationManager=t.scene.sys.anims,this.animationManager.on(o.REMOVE_ANIMATION,this.globalRemove,this),this.textureManager=this.animationManager.textureManager,this.anims=null,this.isPlaying=!1,this.hasStarted=!1,this.currentAnim=null,this.currentFrame=null,this.nextAnim=null,this.nextAnimsQueue=[],this.timeScale=1,this.frameRate=0,this.duration=0,this.msPerFrame=0,this.skipMissedFrames=!0,this.delay=0,this.repeat=0,this.repeatDelay=0,this.yoyo=!1,this.showOnStart=!1,this.hideOnComplete=!1,this.forward=!0,this.inReverse=!1,this.accumulator=0,this.nextTick=0,this.delayCounter=0,this.repeatCounter=0,this.pendingRepeat=!1,this._paused=!1,this._wasPlaying=!1,this._pendingStop=0,this._pendingStopValue},chain:function(t){var e=this.parent;if(void 0===t)return this.nextAnimsQueue.length=0,this.nextAnim=null,e;Array.isArray(t)||(t=[t]);for(var i=0;in.getTotalFrames()&&(h=0);var l=n.frames[h];0!==h||this.forward||(l=n.getLastFrame()),this.currentFrame=l}else console.warn("Missing animation: "+i);return this.parent},pause:function(t){return this._paused||(this._paused=!0,this._wasPlaying=this.isPlaying,this.isPlaying=!1),void 0!==t&&this.setCurrentFrame(t),this.parent},resume:function(t){return this._paused&&(this._paused=!1,this.isPlaying=this._wasPlaying),void 0!==t&&this.setCurrentFrame(t),this.parent},playAfterDelay:function(t,e){if(this.isPlaying){var i=this.nextAnim,n=this.nextAnimsQueue;i&&n.unshift(i),this.nextAnim=t,this._pendingStop=1,this._pendingStopValue=e}else this.delayCounter=e,this.play(t,!0);return this.parent},playAfterRepeat:function(t,e){if(void 0===e&&(e=1),this.isPlaying){var i=this.nextAnim,n=this.nextAnimsQueue;i&&n.unshift(i),-1!==this.repeatCounter&&e>this.repeatCounter&&(e=this.repeatCounter),this.nextAnim=t,this._pendingStop=2,this._pendingStopValue=e}else this.play(t);return this.parent},play:function(t,e){void 0===e&&(e=!1);var i=this.currentAnim,n=this.parent,r="string"==typeof t?t:t.key;if(e&&this.isPlaying&&i.key===r)return n;if(i&&this.isPlaying){var s=this.animationManager.getMix(i.key,t);if(s>0)return this.playAfterDelay(t,s)}return this.forward=!0,this.inReverse=!1,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t)},playReverse:function(t,e){void 0===e&&(e=!1);var i="string"==typeof t?t:t.key;return e&&this.isPlaying&&this.currentAnim.key===i?this.parent:(this.forward=!1,this.inReverse=!0,this._paused=!1,this._wasPlaying=!0,this.startAnimation(t))},startAnimation:function(t){this.load(t);var e=this.currentAnim,i=this.parent;return e?(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat,e.getFirstTick(this),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!1,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.delayCounter+=this.delay,0===this.delayCounter&&this.handleStart(),i):i},handleStart:function(){this.showOnStart&&this.parent.setVisible(!0),this.setCurrentFrame(this.currentFrame),this.hasStarted=!0,this.emitEvents(o.ANIMATION_START)},handleRepeat:function(){this.pendingRepeat=!1,this.emitEvents(o.ANIMATION_REPEAT)},handleStop:function(){this._pendingStop=0,this.isPlaying=!1,this.emitEvents(o.ANIMATION_STOP)},handleComplete:function(){this._pendingStop=0,this.isPlaying=!1,this.hideOnComplete&&this.parent.setVisible(!1),this.emitEvents(o.ANIMATION_COMPLETE,o.ANIMATION_COMPLETE_KEY)},emitEvents:function(t,e){var i=this.currentAnim,n=this.currentFrame,r=this.parent,s=n.textureFrame;r.emit(t,i,n,r,s),e&&r.emit(e+i.key,i,n,r,s)},reverse:function(){return this.isPlaying&&(this.inReverse=!this.inReverse,this.forward=!this.forward),this.parent},getProgress:function(){var t=this.currentFrame;if(!t)return 0;var e=t.progress;return this.inReverse&&(e*=-1),e},setProgress:function(t){return this.forward||(t=1-t),this.setCurrentFrame(this.currentAnim.getFrameByProgress(t)),this.parent},setRepeat:function(t){return this.repeatCounter=-1===t?Number.MAX_VALUE:t,this.parent},globalRemove:function(t,e){void 0===e&&(e=this.currentAnim),this.isPlaying&&e.key===this.currentAnim.key&&(this.stop(),this.setCurrentFrame(this.currentAnim.frames[0]))},restart:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);var i=this.currentAnim,n=this.parent;return i?(e&&(this.repeatCounter=-1===this.repeat?Number.MAX_VALUE:this.repeat),i.getFirstTick(this),this.emitEvents(o.ANIMATION_RESTART),this.isPlaying=!0,this.pendingRepeat=!1,this.hasStarted=!t,this._pendingStop=0,this._pendingStopValue=0,this._paused=!1,this.setCurrentFrame(i.frames[0]),this.parent):n},complete:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleComplete(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.length>0?this.nextAnimsQueue.shift():null,this.play(t)}return this.parent},stop:function(){if(this._pendingStop=0,this.isPlaying=!1,this.currentAnim&&this.handleStop(),this.nextAnim){var t=this.nextAnim;this.nextAnim=this.nextAnimsQueue.shift(),this.play(t)}return this.parent},stopAfterDelay:function(t){return this._pendingStop=1,this._pendingStopValue=t,this.parent},stopAfterRepeat:function(t){return void 0===t&&(t=1),-1!==this.repeatCounter&&t>this.repeatCounter&&(t=this.repeatCounter),this._pendingStop=2,this._pendingStopValue=t,this.parent},stopOnFrame:function(t){return this._pendingStop=3,this._pendingStopValue=t,this.parent},getTotalFrames:function(){return this.currentAnim?this.currentAnim.getTotalFrames():0},update:function(t,e){var i=this.currentAnim;if(this.isPlaying&&i&&!i.paused){if(this.accumulator+=e*this.timeScale,1===this._pendingStop&&(this._pendingStopValue-=e,this._pendingStopValue<=0))return this.stop();if(this.hasStarted){if(this.accumulator>=this.nextTick&&(this.forward?i.nextFrame(this):i.previousFrame(this),this.isPlaying&&0===this._pendingStop&&this.skipMissedFrames&&this.accumulator>this.nextTick)){var n=0;do{this.forward?i.nextFrame(this):i.previousFrame(this),n++}while(this.accumulator>this.nextTick&&n<60)}}else this.accumulator>=this.delayCounter&&(this.accumulator-=this.delayCounter,this.handleStart())}},setCurrentFrame:function(t){var e=this.parent;return this.currentFrame=t,e.texture=t.frame.texture,e.frame=t.frame,e.isCropped&&e.frame.updateCropUVs(e._crop,e.flipX,e.flipY),t.setAlpha&&(e.alpha=t.alpha),e.setSizeToFrame(),e._originComponent&&(t.frame.customPivot?e.setOrigin(t.frame.pivotX,t.frame.pivotY):e.updateDisplayOrigin()),this.isPlaying&&this.hasStarted&&(this.emitEvents(o.ANIMATION_UPDATE),3===this._pendingStop&&this._pendingStopValue===t&&this.stop()),e},nextFrame:function(){return this.currentAnim&&this.currentAnim.nextFrame(this),this.parent},previousFrame:function(){return this.currentAnim&&this.currentAnim.previousFrame(this),this.parent},get:function(t){return this.anims?this.anims.get(t):null},exists:function(t){return!!this.anims&&this.anims.has(t)},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))||(i=new a(this,e,t),this.anims||(this.anims=new r),this.anims.set(e,i))),i},generateFrameNames:function(t,e){return this.animationManager.generateFrameNames(t,e)},generateFrameNumbers:function(t,e){return this.animationManager.generateFrameNumbers(t,e)},remove:function(t){var e=this.get(t);return e&&(this.currentAnim===e&&this.stop(),this.anims.delete(t)),e},destroy:function(){this.animationManager.off(o.REMOVE_ANIMATION,this.globalRemove,this),this.anims&&this.anims.clear(),this.animationManager=null,this.parent=null,this.nextAnim=null,this.nextAnimsQueue.length=0,this.currentAnim=null,this.currentFrame=null},isPaused:{get:function(){return this._paused}}});t.exports=h},function(t,e,i){var n={};t.exports=n;var r=i(268),s=i(50),o=i(117),a=i(71);n.create=function(t){return s.extend({id:s.nextId(),type:"composite",parent:null,isModified:!1,bodies:[],constraints:[],composites:[],label:"Composite",plugin:{}},t)},n.setModified=function(t,e,i,s){if(r.trigger(t,"compositeModified",t),t.isModified=e,i&&t.parent&&n.setModified(t.parent,e,i,s),s)for(var o=0;o * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x+t.radius*Math.cos(e),i.y=t.y+t.radius*Math.sin(e),i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4);t.exports=function(t,e){void 0===e&&(e=new n);var i=2*Math.PI*Math.random(),r=Math.random()+Math.random(),s=r>1?2-r:r,o=s*Math.cos(i),a=s*Math.sin(i);return e.x=t.x+o*t.radius,e.y=t.y+a*t.radius,e}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(128),r=i(4);t.exports=function(t,e,i){if(void 0===i&&(i=new r),e<=0||e>=1)return i.x=t.x,i.y=t.y,i;var s=n(t)*e;return e>.5?(s-=t.width+t.height)<=t.width?(i.x=t.right-s,i.y=t.bottom):(i.x=t.x,i.y=t.bottom-(s-t.width)):s<=t.width?(i.x=t.x+s,i.y=t.y):(i.x=t.right,i.y=t.y+(s-t.width)),i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(64),r=i(4);t.exports=function(t,e,i,s){void 0===s&&(s=[]),!e&&i>0&&(e=n(t)/i);for(var o=t.x1,a=t.y1,h=t.x2,l=t.y2,c=0;c * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random();return e.x=t.x1+i*(t.x2-t.x1),e.y=t.y1+i*(t.y2-t.y1),e}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.x+Math.random()*t.width,e.y=t.y+Math.random()*t.height,e}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(172),r=i(65),s=i(74),o={defaultPipeline:null,pipeline:null,hasPostPipeline:!1,postPipelines:null,pipelineData:null,initPipeline:function(t){void 0===t&&(t=r.MULTI_PIPELINE);var e=this.scene.sys.renderer;if(!e)return!1;var i=e.pipelines;if(this.postPipelines=[],this.pipelineData={},i){var n=i.get(t);if(n)return this.defaultPipeline=n,this.pipeline=n,!0}return!1},setPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var s=r.pipelines;if(s){var o=s.get(t);o&&(this.pipeline=o),e&&(this.pipelineData=i?n(e):e)}return this},setPostPipeline:function(t,e,i){var r=this.scene.sys.renderer;if(!r)return this;var s=r.pipelines;if(s){Array.isArray(t)||(t=[t]);for(var o=0;o0,this},setPipelineData:function(t,e){var i=this.pipelineData;return void 0===e?delete i[t]:i[t]=e,this},getPostPipeline:function(t){for(var e=this.postPipelines,i=[],n=0;n=0;i--){var n=e[i];("string"==typeof t&&n.name===t||"string"!=typeof t&&n instanceof t)&&(n.destroy(),s(e,i))}return this.hasPostPipeline=this.postPipelines.length>0,this},getPipelineName:function(){return this.pipeline.name}};t.exports=o},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i=function(t){var e,n,r;if("object"!=typeof t||null===t)return t;for(r in e=Array.isArray(t)?[]:{},t)n=t[r],e[r]=i(n);return e};t.exports=i},function(t,e){t.exports=function(t){var e={name:t.name,type:t.type,x:t.x,y:t.y,depth:t.depth,scale:{x:t.scaleX,y:t.scaleY},origin:{x:t.originX,y:t.originY},flipX:t.flipX,flipY:t.flipY,rotation:t.rotation,alpha:t.alpha,visible:t.visible,blendMode:t.blendMode,textureKey:"",frameKey:"",data:{}};return t.texture&&(e.textureKey=t.texture.key,e.frameKey=t.frame.name),e}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(3);t.exports=function(t,e,i,r,s,o,a,h){void 0===h&&(h=new n);var l=Math.sin(s),c=Math.cos(s),u=c*o,d=l*o,p=-l*a,f=c*a,m=1/(u*f+p*-d);return h.x=f*m*t+-p*m*e+(r*p-i*f)*m,h.y=u*m*e+-d*m*t+(-r*u+i*d)*m,h}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4);t.exports=function(t,e){void 0===e&&(e=new n);var i=Math.random()*Math.PI*2,r=Math.sqrt(Math.random());return e.x=t.x+r*Math.cos(i)*t.width/2,e.y=t.y+r*Math.sin(i)*t.height/2,e}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4);t.exports=function(t,e){void 0===e&&(e=new n);var i=t.x2-t.x1,r=t.y2-t.y1,s=t.x3-t.x1,o=t.y3-t.y1,a=Math.random(),h=Math.random();return a+h>=1&&(a=1-a,h=1-h),e.x=t.x1+(i*a+s*h),e.y=t.y1+(r*a+o*h),e}},function(t,e){t.exports=function(t,e,i,n,r){var s=n+Math.atan2(t.y-i,t.x-e);return t.x=e+r*Math.cos(s),t.y=i+r*Math.sin(s),t}},function(t,e){t.exports=function(t,e,i){return(t=Math.max(0,Math.min(1,(t-e)/(i-e))))*t*t*(t*(6*t-15)+10)}},function(t,e){t.exports=function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(18),r=i(0),s=i(130),o=i(312),a=i(313),h=i(6),l=i(314),c=new r({initialize:function(t,e,i){this.manager=t,this.key=e,this.type="frame",this.frames=this.getFrames(t.textureManager,h(i,"frames",[]),h(i,"defaultTextureKey",null),h(i,"sortFrames",!0)),this.frameRate=h(i,"frameRate",null),this.duration=h(i,"duration",null),this.msPerFrame,this.skipMissedFrames=h(i,"skipMissedFrames",!0),this.delay=h(i,"delay",0),this.repeat=h(i,"repeat",0),this.repeatDelay=h(i,"repeatDelay",0),this.yoyo=h(i,"yoyo",!1),this.showOnStart=h(i,"showOnStart",!1),this.hideOnComplete=h(i,"hideOnComplete",!1),this.paused=!1,this.calculateDuration(this,this.getTotalFrames(),this.duration,this.frameRate),this.manager.on&&(this.manager.on(s.PAUSE_ALL,this.pause,this),this.manager.on(s.RESUME_ALL,this.resume,this))},getTotalFrames:function(){return this.frames.length},calculateDuration:function(t,e,i,n){null===i&&null===n?(t.frameRate=24,t.duration=24/e*1e3):i&&null===n?(t.duration=i,t.frameRate=e/(i/1e3)):(t.frameRate=n,t.duration=e/n*1e3),t.msPerFrame=1e3/t.frameRate},addFrame:function(t){return this.addFrameAt(this.frames.length,t)},addFrameAt:function(t,e){var i=this.getFrames(this.manager.textureManager,e);if(i.length>0){if(0===t)this.frames=i.concat(this.frames);else if(t===this.frames.length)this.frames=this.frames.concat(i);else{var n=this.frames.slice(0,t),r=this.frames.slice(t);this.frames=n.concat(i,r)}this.updateFrameSequence()}return this},checkFrame:function(t){return t>=0&&t0){s.isLast=!0,s.nextFrame=u[0],u[0].prevFrame=s;var y=1/(u.length-1);for(o=0;o0?t.inReverse&&t.forward?t.forward=!1:this.repeatAnimation(t):t.complete():this.updateAndGetNextTick(t,e.nextFrame)},handleYoyoFrame:function(t,e){if(e||(e=!1),t.inReverse===!e&&t.repeatCounter>0)return(0===t.repeatDelay||t.pendingRepeat)&&(t.forward=e),void this.repeatAnimation(t);if(t.inReverse===e||0!==t.repeatCounter){t.forward=e;var i=e?t.currentFrame.nextFrame:t.currentFrame.prevFrame;this.updateAndGetNextTick(t,i)}else t.complete()},getLastFrame:function(){return this.frames[this.frames.length-1]},previousFrame:function(t){var e=t.currentFrame;e.isFirst?t.yoyo?this.handleYoyoFrame(t,!0):t.repeatCounter>0?(t.inReverse&&!t.forward||(t.forward=!0),this.repeatAnimation(t)):t.complete():this.updateAndGetNextTick(t,e.prevFrame)},updateAndGetNextTick:function(t,e){t.setCurrentFrame(e),this.getNextTick(t)},removeFrame:function(t){var e=this.frames.indexOf(t);return-1!==e&&this.removeFrameAt(e),this},removeFrameAt:function(t){return this.frames.splice(t,1),this.updateFrameSequence(),this},repeatAnimation:function(t){if(2===t._pendingStop){if(0===t._pendingStopValue)return t.stop();t._pendingStopValue--}t.repeatDelay>0&&!t.pendingRepeat?(t.pendingRepeat=!0,t.accumulator-=t.nextTick,t.nextTick+=t.repeatDelay):(t.repeatCounter--,t.forward?t.setCurrentFrame(t.currentFrame.nextFrame):t.setCurrentFrame(t.currentFrame.prevFrame),t.isPlaying&&(this.getNextTick(t),t.handleRepeat()))},toJSON:function(){var t={key:this.key,type:this.type,frames:[],frameRate:this.frameRate,duration:this.duration,skipMissedFrames:this.skipMissedFrames,delay:this.delay,repeat:this.repeat,repeatDelay:this.repeatDelay,yoyo:this.yoyo,showOnStart:this.showOnStart,hideOnComplete:this.hideOnComplete};return this.frames.forEach((function(e){t.frames.push(e.toJSON())})),t},updateFrameSequence:function(){for(var t,e=this.frames.length,i=1/(e-1),n=0;n1?(t.isLast=!0,t.prevFrame=this.frames[e-2],t.nextFrame=this.frames[0]):e>1&&(t.prevFrame=this.frames[n-1],t.nextFrame=this.frames[n+1]);return this},pause:function(){return this.paused=!0,this},resume:function(){return this.paused=!1,this},destroy:function(){this.manager.off&&(this.manager.off(s.PAUSE_ALL,this.pause,this),this.manager.off(s.RESUME_ALL,this.resume,this)),this.manager.remove(this.key);for(var t=0;t=(t=t.toString()).length)switch(n){case 1:t=new Array(e+1-t.length).join(i)+t;break;case 3:var s=Math.ceil((r=e-t.length)/2);t=new Array(r-s+1).join(i)+t+new Array(s+1).join(i);break;default:t+=new Array(e+1-t.length).join(i)}return t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(321),r=i(186),s=i(325),o=i(326);t.exports=function(t){switch(typeof t){case"string":return"rgb"===t.substr(0,3).toLowerCase()?o(t):n(t);case"number":return r(t);case"object":return s(t)}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(100);function r(t,e,i,n){var r=(t+6*e)%6,s=Math.min(r,4-r,1);return Math.round(255*(n-n*i*Math.max(0,s)))}t.exports=function(t,e,i,s){void 0===e&&(e=1),void 0===i&&(i=1);var o=r(5,t,e,i),a=r(3,t,e,i),h=r(1,t,e,i);return s?s.setTo?s.setTo(o,a,h,s.alpha,!1):(s.r=o,s.g=a,s.b=h,s.color=n(o,a,h),s):{r:o,g:a,b:h,color:n(o,a,h)}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(37),r=i(324);t.exports=function(t){var e=r(t);return new n(e.r,e.g,e.b,e.a)}},function(t,e){t.exports=function(t,e,i){return t.x=e-t.width/2,t.y=i-t.height/2,t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(102),r=i(134),s=i(31),o={canvas:!1,canvasBitBltShift:null,file:!1,fileSystem:!1,getUserMedia:!0,littleEndian:!1,localStorage:!1,pointerLock:!1,support32bit:!1,vibration:!1,webGL:!1,worker:!1};t.exports=function(){o.canvas=!!window.CanvasRenderingContext2D;try{o.localStorage=!!localStorage.getItem}catch(t){o.localStorage=!1}o.file=!!(window.File&&window.FileReader&&window.FileList&&window.Blob),o.fileSystem=!!window.requestFileSystem;var t,e,i,a=!1;return o.webGL=function(){if(window.WebGLRenderingContext)try{var t=s.createWebGL(this),e=t.getContext("webgl")||t.getContext("experimental-webgl"),i=s.create2D(this),n=i.getContext("2d").createImageData(1,1);return a=n.data instanceof Uint8ClampedArray,s.remove(t),s.remove(i),!!e}catch(t){return!1}return!1}(),o.worker=!!window.Worker,o.pointerLock="pointerLockElement"in document||"mozPointerLockElement"in document||"webkitPointerLockElement"in document,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||navigator.oGetUserMedia,window.URL=window.URL||window.webkitURL||window.mozURL||window.msURL,o.getUserMedia=o.getUserMedia&&!!navigator.getUserMedia&&!!window.URL,r.firefox&&r.firefoxVersion<21&&(o.getUserMedia=!1),!n.iOS&&(r.ie||r.firefox||r.chrome)&&(o.canvasBitBltShift=!0),(r.safari||r.mobileSafari)&&(o.canvasBitBltShift=!1),navigator.vibrate=navigator.vibrate||navigator.webkitVibrate||navigator.mozVibrate||navigator.msVibrate,navigator.vibrate&&(o.vibration=!0),"undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint32Array&&(o.littleEndian=(t=new ArrayBuffer(4),e=new Uint8Array(t),i=new Uint32Array(t),e[0]=161,e[1]=178,e[2]=195,e[3]=212,3569595041===i[0]||2712847316!==i[0]&&null)),o.support32bit="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof Int32Array&&null!==o.littleEndian&&a,o}()},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i,n="";t.exports={disable:function(t){return""===n&&(n=i(t)),n&&(t[n]=!1),t},enable:function(t){return""===n&&(n=i(t)),n&&(t[n]=!0),t},getPrefix:i=function(t){for(var e=["i","webkitI","msI","mozI","oI"],i=0;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(14),r=i(17),s={Angle:i(809),Distance:i(818),Easing:i(823),Fuzzy:i(824),Interpolation:i(827),Pow2:i(832),Snap:i(834),RandomDataGenerator:i(836),Average:i(837),Bernstein:i(350),Between:i(192),CatmullRom:i(191),CeilTo:i(838),Clamp:i(18),DegToRad:i(35),Difference:i(839),Euler:i(840),Factorial:i(351),FloatBetween:i(135),FloorTo:i(841),FromPercent:i(95),GetSpeed:i(842),IsEven:i(843),IsEvenStrict:i(844),Linear:i(133),MaxAdd:i(845),MinSub:i(846),Percent:i(847),RadToDeg:i(193),RandomXY:i(848),RandomXYZ:i(849),RandomXYZW:i(850),Rotate:i(356),RotateAround:i(302),RotateAroundDistance:i(179),RotateTo:i(851),RoundAwayFromZero:i(357),RoundTo:i(852),SinCosTableGenerator:i(853),SmootherStep:i(180),SmoothStep:i(181),ToXY:i(854),TransformXY:i(174),Within:i(855),Wrap:i(66),Vector2:i(3),Vector3:i(38),Vector4:i(138),Matrix3:i(358),Matrix4:i(67),Quaternion:i(359),RotateVec3:i(856)};s=r(!1,s,n),t.exports=s},function(t,e){t.exports=function(t,e,i,n,r){var s=.5*(n-e),o=.5*(r-i),a=t*t;return(2*i-2*n+s+o)*(t*a)+(-3*i+3*n-2*s-o)*a+s*t+i}},function(t,e){t.exports=function(t,e){return Math.floor(Math.random()*(e-t+1)+t)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(14);t.exports=function(t){return t*n.RAD_TO_DEG}},function(t,e,i){t.exports={Global:["game","anims","cache","plugins","registry","scale","sound","textures","renderer"],CoreScene:["EventEmitter","CameraManager","GameObjectCreator","GameObjectFactory","ScenePlugin","DisplayList","UpdateList"],DefaultScene:["Clock","DataManagerPlugin","InputPlugin","Loader","TweenManager","LightsPlugin"]}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=new(i(0))({initialize:function(){this._matrix=[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0],this.alpha=1,this._dirty=!0,this._data},set:function(t){return this._matrix=t,this._dirty=!0,this},reset:function(){var t=this._matrix;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=1,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=1,t[13]=0,t[14]=0,t[15]=0,t[16]=0,t[17]=0,t[18]=1,t[19]=0,this._dirty=!0,this},getData:function(){if(this._dirty){var t=new Float32Array(this._matrix);t[4]/=255,t[9]/=255,t[14]/=255,t[19]/=255,this._data=t,this._dirty=!1}return this._data},brightness:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t;return this.multiply([i,0,0,0,0,0,i,0,0,0,0,0,i,0,0,0,0,0,1,0],e)},saturate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=2*t/3+1,n=-.5*(i-1);return this.multiply([i,n,n,0,0,n,i,n,0,0,n,n,i,0,0,0,0,0,1,0],e)},desaturate:function(t){return void 0===t&&(t=!1),this.saturate(-1,t)},hue:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1),t=t/180*Math.PI;var i=Math.cos(t),n=Math.sin(t);return this.multiply([.213+.787*i+-.213*n,.715+-.715*i+-.715*n,.072+-.072*i+.928*n,0,0,.213+-.213*i+.143*n,.715+i*(1-.715)+.14*n,.072+-.072*i+-.283*n,0,0,.213+-.213*i+-.787*n,.715+-.715*i+.715*n,.072+.928*i+.072*n,0,0,0,0,0,1,0],e)},grayscale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=!1),this.saturate(-t,e)},blackWhite:function(t){return void 0===t&&(t=!1),this.multiply([.3,.6,.1,0,0,.3,.6,.1,0,0,.3,.6,.1,0,0,0,0,0,1,0],t)},contrast:function(t,e){void 0===t&&(t=0),void 0===e&&(e=!1);var i=t+1,n=-.5*(i-1);return this.multiply([i,0,0,0,n,0,i,0,0,n,0,0,i,0,n,0,0,0,1,0],e)},negative:function(t){return void 0===t&&(t=!1),this.multiply([-1,0,0,1,0,0,-1,0,1,0,0,0,-1,1,0,0,0,0,1,0],t)},desaturateLuminance:function(t){return void 0===t&&(t=!1),this.multiply([.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,.2764723,.929708,.0938197,0,-37.1,0,0,0,1,0],t)},sepia:function(t){return void 0===t&&(t=!1),this.multiply([.393,.7689999,.18899999,0,0,.349,.6859999,.16799999,0,0,.272,.5339999,.13099999,0,0,0,0,0,1,0],t)},night:function(t,e){return void 0===t&&(t=.1),void 0===e&&(e=!1),this.multiply([-2*t,-t,0,0,0,-t,0,t,0,0,0,t,2*t,0,0,0,0,0,1,0],e)},lsd:function(t){return void 0===t&&(t=!1),this.multiply([2,-.4,.5,0,0,-.5,2,-.4,0,0,-.4,-.5,3,0,0,0,0,0,1,0],t)},brown:function(t){return void 0===t&&(t=!1),this.multiply([.5997023498159715,.34553243048391263,-.2708298674538042,0,47.43192855600873,-.037703249837783157,.8609577587992641,.15059552388459913,0,-36.96841498319127,.24113635128153335,-.07441037908422492,.44972182064877153,0,-7.562075277591283,0,0,0,1,0],t)},vintagePinhole:function(t){return void 0===t&&(t=!1),this.multiply([.6279345635605994,.3202183420819367,-.03965408211312453,0,9.651285835294123,.02578397704808868,.6441188644374771,.03259127616149294,0,7.462829176470591,.0466055556782719,-.0851232987247891,.5241648018700465,0,5.159190588235296,0,0,0,1,0],t)},kodachrome:function(t){return void 0===t&&(t=!1),this.multiply([1.1285582396593525,-.3967382283601348,-.03992559172921793,0,63.72958762196502,-.16404339962244616,1.0835251566291304,-.05498805115633132,0,24.732407896706203,-.16786010706155763,-.5603416277695248,1.6014850761964943,0,35.62982807460946,0,0,0,1,0],t)},technicolor:function(t){return void 0===t&&(t=!1),this.multiply([1.9125277891456083,-.8545344976951645,-.09155508482755585,0,11.793603434377337,-.3087833385928097,1.7658908555458428,-.10601743074722245,0,-70.35205161461398,-.231103377548616,-.7501899197440212,1.847597816108189,0,30.950940869491138,0,0,0,1,0],t)},polaroid:function(t){return void 0===t&&(t=!1),this.multiply([1.438,-.062,-.062,0,0,-.122,1.378,-.122,0,0,-.016,-.016,1.483,0,0,0,0,0,1,0],t)},shiftToBGR:function(t){return void 0===t&&(t=!1),this.multiply([0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0],t)},multiply:function(t,e){e||this.reset();for(var i=this._matrix,n=[],r=0;r<20;r++)n[r]=i[r];return i[0]=n[0]*t[0]+n[1]*t[5]+n[2]*t[10]+n[3]*t[15],i[1]=n[0]*t[1]+n[1]*t[6]+n[2]*t[11]+n[3]*t[16],i[2]=n[0]*t[2]+n[1]*t[7]+n[2]*t[12]+n[3]*t[17],i[3]=n[0]*t[3]+n[1]*t[8]+n[2]*t[13]+n[3]*t[18],i[4]=n[0]*t[4]+n[1]*t[9]+n[2]*t[14]+n[3]*t[19]+n[4],i[5]=n[5]*t[0]+n[6]*t[5]+n[7]*t[10]+n[8]*t[15],i[6]=n[5]*t[1]+n[6]*t[6]+n[7]*t[11]+n[8]*t[16],i[7]=n[5]*t[2]+n[6]*t[7]+n[7]*t[12]+n[8]*t[17],i[8]=n[5]*t[3]+n[6]*t[8]+n[7]*t[13]+n[8]*t[18],i[9]=n[5]*t[4]+n[6]*t[9]+n[7]*t[14]+n[8]*t[19]+n[9],i[10]=n[10]*t[0]+n[11]*t[5]+n[12]*t[10]+n[13]*t[15],i[11]=n[10]*t[1]+n[11]*t[6]+n[12]*t[11]+n[13]*t[16],i[12]=n[10]*t[2]+n[11]*t[7]+n[12]*t[12]+n[13]*t[17],i[13]=n[10]*t[3]+n[11]*t[8]+n[12]*t[13]+n[13]*t[18],i[14]=n[10]*t[4]+n[11]*t[9]+n[12]*t[14]+n[13]*t[19]+n[14],i[15]=n[15]*t[0]+n[16]*t[5]+n[17]*t[10]+n[18]*t[15],i[16]=n[15]*t[1]+n[16]*t[6]+n[17]*t[11]+n[18]*t[16],i[17]=n[15]*t[2]+n[16]*t[7]+n[17]*t[12]+n[18]*t[17],i[18]=n[15]*t[3]+n[16]*t[8]+n[17]*t[13]+n[18]*t[18],i[19]=n[15]*t[4]+n[16]*t[9]+n[17]*t[14]+n[18]*t[19]+n[19],this._dirty=!0,this}});t.exports=n},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(10),r=i(14);t.exports=function(t,e){if(void 0===e&&(e=new n),0===t.length)return e;for(var i,s,o,a=Number.MAX_VALUE,h=Number.MAX_VALUE,l=r.MIN_SAFE_INTEGER,c=r.MIN_SAFE_INTEGER,u=0;u * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(1),s=new n({initialize:function(t,e,i){this._rgb=[0,0,0],this.onChangeCallback=r,this.dirty=!1,this.set(t,e,i)},set:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this._rgb=[t,e,i],this.onChange(),this},equals:function(t,e,i){var n=this._rgb;return n.r===t&&n.g===e&&n.b===i},onChange:function(){this.dirty=!0;var t=this._rgb;this.onChangeCallback.call(this,t[0],t[1],t[2])},r:{get:function(){return this._rgb[0]},set:function(t){this._rgb[0]=t,this.onChange()}},g:{get:function(){return this._rgb[1]},set:function(t){this._rgb[1]=t,this.onChange()}},b:{get:function(){return this._rgb[2]},set:function(t){this._rgb[2]=t,this.onChange()}},destroy:function(){this.onChangeCallback=null}});t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n={CENTER:i(397),ORIENTATION:i(398),SCALE_MODE:i(399),ZOOM:i(400)};t.exports=n},function(t,e){t.exports=function(t){t.parentNode&&t.parentNode.removeChild(t)}},function(t,e){t.exports={MOUSE_DOWN:0,MOUSE_MOVE:1,MOUSE_UP:2,TOUCH_START:3,TOUCH_MOVE:4,TOUCH_END:5,POINTER_LOCK_CHANGE:6,TOUCH_CANCEL:7,MOUSE_WHEEL:8}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(142),s=i(194),o=i(21),a=i(413),h=i(414),l=i(32),c=i(1),u=i(415),d=new n({initialize:function(t,e){this.scene=t,this.game,this.renderer,this.config=e,this.settings=u.create(e),this.canvas,this.context,this.anims,this.cache,this.plugins,this.registry,this.scale,this.sound,this.textures,this.add,this.cameras,this.displayList,this.events,this.make,this.scenePlugin,this.updateList,this.sceneUpdate=c},init:function(t){this.settings.status=r.INIT,this.sceneUpdate=c,this.game=t,this.renderer=t.renderer,this.canvas=t.canvas,this.context=t.context;var e=t.plugins;this.plugins=e,e.addToScene(this,s.Global,[s.CoreScene,h(this),a(this)]),this.events.emit(o.BOOT,this),this.settings.isBooted=!0},install:function(t){Array.isArray(t)||(t=[t]),this.plugins.installLocal(this,t)},step:function(t,e){var i=this.events;i.emit(o.PRE_UPDATE,t,e),i.emit(o.UPDATE,t,e),this.sceneUpdate.call(this.scene,t,e),i.emit(o.POST_UPDATE,t,e)},render:function(t){var e=this.displayList;e.depthSort(),this.cameras.render(t,e),this.events.emit(o.RENDER,t)},queueDepthSort:function(){this.displayList.queueDepthSort()},depthSort:function(){this.displayList.depthSort()},pause:function(t){var e=this.events,i=this.settings;return this.settings.active&&(i.status=r.PAUSED,i.active=!1,e.emit(o.PAUSE,this,t)),this},resume:function(t){var e=this.events,i=this.settings;return this.settings.active||(i.status=r.RUNNING,i.active=!0,e.emit(o.RESUME,this,t)),this},sleep:function(t){var e=this.events,i=this.settings;return i.status=r.SLEEPING,i.active=!1,i.visible=!1,e.emit(o.SLEEP,this,t),this},wake:function(t){var e=this.events,i=this.settings;return i.status=r.RUNNING,i.active=!0,i.visible=!0,e.emit(o.WAKE,this,t),i.isTransition&&e.emit(o.TRANSITION_WAKE,i.transitionFrom,i.transitionDuration),this},getData:function(){return this.settings.data},isSleeping:function(){return this.settings.status===r.SLEEPING},isActive:function(){return this.settings.status===r.RUNNING},isPaused:function(){return this.settings.status===r.PAUSED},isTransitioning:function(){return this.settings.isTransition||null!==this.scenePlugin._target},isTransitionOut:function(){return null!==this.scenePlugin._target&&this.scenePlugin._duration>0},isTransitionIn:function(){return this.settings.isTransition},isVisible:function(){return this.settings.visible},setVisible:function(t){return this.settings.visible=t,this},setActive:function(t,e){return t?this.resume(e):this.pause(e)},start:function(t){var e=this.events,i=this.settings;t&&(i.data=t),i.status=r.START,i.active=!0,i.visible=!0,e.emit(o.START,this),e.emit(o.READY,this,t)},shutdown:function(t){var e=this.events,i=this.settings;e.off(o.TRANSITION_INIT),e.off(o.TRANSITION_START),e.off(o.TRANSITION_COMPLETE),e.off(o.TRANSITION_OUT),i.status=r.SHUTDOWN,i.active=!1,i.visible=!1,this.renderer===l.WEBGL&&this.renderer.resetTextures(!0),e.emit(o.SHUTDOWN,this,t)},destroy:function(){var t=this.events,e=this.settings;e.status=r.DESTROYED,e.active=!1,e.visible=!1,t.emit(o.DESTROY,this),t.removeAllListeners();for(var i=["scene","game","anims","cache","plugins","registry","sound","textures","add","camera","displayList","events","make","scenePlugin","updateList"],n=0;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(32),r=i(0),s=i(106),o=i(418),a=new r({initialize:function(t,e,i,n,r){Array.isArray(i)||(i=[i]),this.manager=t,this.key=e,this.source=[],this.dataSource=[],this.frames={},this.customData={},this.firstFrame="__BASE",this.frameTotal=0;for(var s=0;s * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(78);t.exports=function(t,e,i,r,s){void 0===r&&(r=0),void 0===s&&(s=t.length);var o=[];if(n(t,r,s))for(var a=r;a * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Matrix:i(1009),Add:i(1017),AddAt:i(1018),BringToTop:i(1019),CountAllMatching:i(1020),Each:i(1021),EachInRange:i(1022),FindClosestInSorted:i(312),GetAll:i(204),GetFirst:i(422),GetRandom:i(207),MoveDown:i(1023),MoveTo:i(1024),MoveUp:i(1025),NumberArray:i(316),NumberArrayStep:i(1026),QuickSelect:i(430),Range:i(431),Remove:i(89),RemoveAt:i(1027),RemoveBetween:i(1028),RemoveRandomElement:i(1029),Replace:i(1030),RotateLeft:i(175),RotateRight:i(176),SafeRange:i(78),SendToBack:i(1031),SetAll:i(1032),Shuffle:i(129),SortByDigits:i(314),SpliceOne:i(74),StableSort:i(79),Swap:i(1033)}},function(t,e){t.exports=function(t){if(!Array.isArray(t)||t.length<2||!Array.isArray(t[0]))return!1;for(var e=t[0].length,i=1;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(9),s=i(432),o=new n({Extends:r,initialize:function(){r.call(this),this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,this.checkQueue=!1},add:function(t){return this._pending.push(t),this._toProcess++,t},remove:function(t){return this._destroy.push(t),this._toProcess++,t},removeAll:function(){for(var t=this._active,e=this._destroy,i=t.length;i--;)e.push(t[i]),this._toProcess++;return this},update:function(){if(0===this._toProcess)return this._active;var t,e,i=this._destroy,n=this._active;for(t=0;t * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ function i(t,e){return parseInt(t.getAttribute(e),10)}t.exports=function(t,e,n,r,s){void 0===n&&(n=0),void 0===r&&(r=0);var o=e.cutX,a=e.cutY,h=e.source.width,l=e.source.height,c=e.sourceIndex,u={},d=t.getElementsByTagName("info")[0],p=t.getElementsByTagName("common")[0];u.font=d.getAttribute("face"),u.size=i(d,"size"),u.lineHeight=i(p,"lineHeight")+r,u.chars={};var f=t.getElementsByTagName("char"),m=void 0!==e&&e.trimmed;if(m)var g=e.height,v=e.width;for(var y=0;y * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1043),r=i(434),s=i(0),o=i(11),a=i(106),h=i(15),l=i(107),c=new s({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.Depth,o.Mask,o.Pipeline,o.ScrollFactor,o.Size,o.Texture,o.Transform,o.Visible,n],initialize:function(t,e,i,n,r){h.call(this,t,"Blitter"),this.setTexture(n,r),this.setPosition(e,i),this.initPipeline(),this.children=new l,this.renderList=[],this.dirty=!1},create:function(t,e,i,n,s){void 0===n&&(n=!0),void 0===s&&(s=this.children.length),void 0===i?i=this.frame:i instanceof a||(i=this.texture.get(i));var o=new r(this,t,e,i,n);return this.children.addAt(o,s,!1),this.dirty=!0,o},createFromCallback:function(t,e,i,n){for(var r=this.createMultiple(e,i,n),s=0;s0},getRenderList:function(){return this.dirty&&(this.renderList=this.children.list.filter(this.childCanRender,this),this.dirty=!1),this.renderList},clear:function(){this.children.removeAll(),this.dirty=!0},preDestroy:function(){this.children.destroy(),this.renderList=[]}});t.exports=c},function(t,e,i){ /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(205),r=i(34),s=i(0),o=i(11),a=i(75),h=i(15),l=i(10),c=i(1046),u=i(435),d=i(3),p=new s({Extends:h,Mixins:[o.AlphaSingle,o.BlendMode,o.ComputedSize,o.Depth,o.Mask,o.Pipeline,o.Transform,o.Visible,c],initialize:function(t,e,i,n){h.call(this,t,"Container"),this.list=[],this.exclusive=!0,this.maxSize=-1,this.position=0,this.localTransform=new o.TransformMatrix,this.tempTransformMatrix=new o.TransformMatrix,this._sortKey="",this._sysEvents=t.sys.events,this.scrollFactorX=1,this.scrollFactorY=1,this.initPipeline(),this.setPosition(e,i),this.clearAlpha(),this.setBlendMode(r.SKIP_CHECK),n&&this.add(n)},originX:{get:function(){return.5}},originY:{get:function(){return.5}},displayOriginX:{get:function(){return.5*this.width}},displayOriginY:{get:function(){return.5*this.height}},setExclusive:function(t){return void 0===t&&(t=!0),this.exclusive=t,this},getBounds:function(t){if(void 0===t&&(t=new l),t.setTo(this.x,this.y,0,0),this.parentContainer){var e=this.parentContainer.getBoundsTransformMatrix().transformPoint(this.x,this.y);t.setTo(e.x,e.y,0,0)}if(this.list.length>0){var i=this.list,n=new l,r=!1;t.setEmpty();for(var s=0;s-1},setAll:function(t,e,i,r){return n.SetAll(this.list,t,e,i,r),this},each:function(t,e){var i,n=[null],r=this.list.slice(),s=r.length;for(i=2;i0?this.list[0]:null}},last:{get:function(){return this.list.length>0?(this.position=this.list.length-1,this.list[this.position]):null}},next:{get:function(){return this.position0?(this.position--,this.list[this.position]):null}},preDestroy:function(){this.removeAll(!!this.exclusive),this.localTransform.destroy(),this.tempTransformMatrix.destroy(),this.list=[]}});t.exports=p},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(147),r=i(0),s=i(1051),o=new r({Extends:n,Mixins:[s],initialize:function(t,e,i,r,s,o,a){n.call(this,t,e,i,r,s,o,a),this.type="DynamicBitmapText",this.scrollX=0,this.scrollY=0,this.cropWidth=0,this.cropHeight=0,this.displayCallback,this.callbackData={parent:this,color:0,tint:{topLeft:0,topRight:0,bottomLeft:0,bottomRight:0},index:0,charCode:0,x:0,y:0,scale:0,rotation:0,data:0}},setSize:function(t,e){return this.cropWidth=t,this.cropHeight=e,this},setDisplayCallback:function(t){return this.displayCallback=t,this},setScrollX:function(t){return this.scrollX=t,this},setScrollY:function(t){return this.scrollY=t,this}});t.exports=o},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(131),r=i(0),s=i(214),o=i(297),a=i(298),h=i(299),l=i(303),c=i(171),u=i(306),d=i(307),p=i(308),f=i(108),m=i(15),g=i(2),v=i(6),y=i(14),x=i(65),b=i(1057),w=new r({Extends:m,Mixins:[o,a,h,l,c,d,p,u,b],initialize:function(t,e){var i=v(e,"x",0),n=v(e,"y",0);m.call(this,t,"Graphics"),this.setPosition(i,n),this.initPipeline(x.GRAPHICS_PIPELINE),this.displayOriginX=0,this.displayOriginY=0,this.commandBuffer=[],this.defaultFillColor=-1,this.defaultFillAlpha=1,this.defaultStrokeWidth=1,this.defaultStrokeColor=-1,this.defaultStrokeAlpha=1,this._lineWidth=1,this.setDefaultStyles(e)},setDefaultStyles:function(t){return v(t,"lineStyle",null)&&(this.defaultStrokeWidth=v(t,"lineStyle.width",1),this.defaultStrokeColor=v(t,"lineStyle.color",16777215),this.defaultStrokeAlpha=v(t,"lineStyle.alpha",1),this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha)),v(t,"fillStyle",null)&&(this.defaultFillColor=v(t,"fillStyle.color",16777215),this.defaultFillAlpha=v(t,"fillStyle.alpha",1),this.fillStyle(this.defaultFillColor,this.defaultFillAlpha)),this},lineStyle:function(t,e,i){return void 0===i&&(i=1),this.commandBuffer.push(s.LINE_STYLE,t,e,i),this._lineWidth=t,this},fillStyle:function(t,e){return void 0===e&&(e=1),this.commandBuffer.push(s.FILL_STYLE,t,e),this},fillGradientStyle:function(t,e,i,n,r,o,a,h){return void 0===r&&(r=1),void 0===o&&(o=r),void 0===a&&(a=r),void 0===h&&(h=r),this.commandBuffer.push(s.GRADIENT_FILL_STYLE,r,o,a,h,t,e,i,n),this},lineGradientStyle:function(t,e,i,n,r,o){return void 0===o&&(o=1),this.commandBuffer.push(s.GRADIENT_LINE_STYLE,t,o,e,i,n,r),this},beginPath:function(){return this.commandBuffer.push(s.BEGIN_PATH),this},closePath:function(){return this.commandBuffer.push(s.CLOSE_PATH),this},fillPath:function(){return this.commandBuffer.push(s.FILL_PATH),this},fill:function(){return this.commandBuffer.push(s.FILL_PATH),this},strokePath:function(){return this.commandBuffer.push(s.STROKE_PATH),this},stroke:function(){return this.commandBuffer.push(s.STROKE_PATH),this},fillCircleShape:function(t){return this.fillCircle(t.x,t.y,t.radius)},strokeCircleShape:function(t){return this.strokeCircle(t.x,t.y,t.radius)},fillCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,y.PI2),this.fillPath(),this},strokeCircle:function(t,e,i){return this.beginPath(),this.arc(t,e,i,0,y.PI2),this.strokePath(),this},fillRectShape:function(t){return this.fillRect(t.x,t.y,t.width,t.height)},strokeRectShape:function(t){return this.strokeRect(t.x,t.y,t.width,t.height)},fillRect:function(t,e,i,n){return this.commandBuffer.push(s.FILL_RECT,t,e,i,n),this},strokeRect:function(t,e,i,n){var r=this._lineWidth/2,s=t-r,o=t+r;return this.beginPath(),this.moveTo(t,e),this.lineTo(t,e+n),this.strokePath(),this.beginPath(),this.moveTo(t+i,e),this.lineTo(t+i,e+n),this.strokePath(),this.beginPath(),this.moveTo(s,e),this.lineTo(o+i,e),this.strokePath(),this.beginPath(),this.moveTo(s,e+n),this.lineTo(o+i,e+n),this.strokePath(),this},fillRoundedRect:function(t,e,i,n,r){void 0===r&&(r=20);var s=r,o=r,a=r,h=r;return"number"!=typeof r&&(s=g(r,"tl",20),o=g(r,"tr",20),a=g(r,"bl",20),h=g(r,"br",20)),this.beginPath(),this.moveTo(t+s,e),this.lineTo(t+i-o,e),this.arc(t+i-o,e+o,o,-y.TAU,0),this.lineTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,y.TAU),this.lineTo(t+a,e+n),this.arc(t+a,e+n-a,a,y.TAU,Math.PI),this.lineTo(t,e+s),this.arc(t+s,e+s,s,-Math.PI,-y.TAU),this.fillPath(),this},strokeRoundedRect:function(t,e,i,n,r){void 0===r&&(r=20);var s=r,o=r,a=r,h=r;return"number"!=typeof r&&(s=g(r,"tl",20),o=g(r,"tr",20),a=g(r,"bl",20),h=g(r,"br",20)),this.beginPath(),this.moveTo(t+s,e),this.lineTo(t+i-o,e),this.moveTo(t+i-o,e),this.arc(t+i-o,e+o,o,-y.TAU,0),this.lineTo(t+i,e+n-h),this.moveTo(t+i,e+n-h),this.arc(t+i-h,e+n-h,h,0,y.TAU),this.lineTo(t+a,e+n),this.moveTo(t+a,e+n),this.arc(t+a,e+n-a,a,y.TAU,Math.PI),this.lineTo(t,e+s),this.moveTo(t,e+s),this.arc(t+s,e+s,s,-Math.PI,-y.TAU),this.strokePath(),this},fillPointShape:function(t,e){return this.fillPoint(t.x,t.y,e)},fillPoint:function(t,e,i){return!i||i<1?i=1:(t-=i/2,e-=i/2),this.commandBuffer.push(s.FILL_RECT,t,e,i,i),this},fillTriangleShape:function(t){return this.fillTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},strokeTriangleShape:function(t){return this.strokeTriangle(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)},fillTriangle:function(t,e,i,n,r,o){return this.commandBuffer.push(s.FILL_TRIANGLE,t,e,i,n,r,o),this},strokeTriangle:function(t,e,i,n,r,o){return this.commandBuffer.push(s.STROKE_TRIANGLE,t,e,i,n,r,o),this},strokeLineShape:function(t){return this.lineBetween(t.x1,t.y1,t.x2,t.y2)},lineBetween:function(t,e,i,n){return this.beginPath(),this.moveTo(t,e),this.lineTo(i,n),this.strokePath(),this},lineTo:function(t,e){return this.commandBuffer.push(s.LINE_TO,t,e),this},moveTo:function(t,e){return this.commandBuffer.push(s.MOVE_TO,t,e),this},strokePoints:function(t,e,i,n){void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===n&&(n=t.length),this.beginPath(),this.moveTo(t[0].x,t[0].y);for(var r=1;r-1&&this.fillStyle(this.defaultFillColor,this.defaultFillAlpha),this.defaultStrokeColor>-1&&this.lineStyle(this.defaultStrokeWidth,this.defaultStrokeColor,this.defaultStrokeAlpha),this},generateTexture:function(t,e,i){var n,r,s=this.scene.sys,o=s.game.renderer;if(void 0===e&&(e=s.scale.width),void 0===i&&(i=s.scale.height),w.TargetCamera.setScene(this.scene),w.TargetCamera.setViewport(0,0,e,i),w.TargetCamera.scrollX=this.x,w.TargetCamera.scrollY=this.y,"string"==typeof t)if(s.textures.exists(t)){var a=(n=s.textures.get(t)).getSourceImage();a instanceof HTMLCanvasElement&&(r=a.getContext("2d"))}else r=(n=s.textures.createCanvas(t,e,i)).getSourceImage().getContext("2d");else t instanceof HTMLCanvasElement&&(r=t.getContext("2d"));return r&&(this.renderCanvas(o,this,w.TargetCamera,null,r,!1),n&&n.refresh()),this},preDestroy:function(){this.commandBuffer=[]}});w.TargetCamera=new n,t.exports=w},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={ARC:0,BEGIN_PATH:1,CLOSE_PATH:2,FILL_RECT:3,LINE_TO:4,MOVE_TO:5,LINE_STYLE:6,FILL_STYLE:7,FILL_PATH:8,STROKE_PATH:9,FILL_TRIANGLE:10,STROKE_TRIANGLE:11,SAVE:14,RESTORE:15,TRANSLATE:16,SCALE:17,ROTATE:18,GRADIENT_FILL_STYLE:21,GRADIENT_LINE_STYLE:22}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=t.width/2,s=t.height/2;return i.x=t.x+r*Math.cos(e),i.y=t.y+s*Math.sin(e),i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(34),r=i(0),s=i(11),o=i(173),a=i(98),h=i(9),l=i(75),c=i(107),u=i(1065),d=i(21),p=i(79),f=new r({Extends:c,Mixins:[s.AlphaSingle,s.BlendMode,s.Depth,s.Mask,s.Pipeline,s.Visible,h,u],initialize:function(t,e){c.call(this,t),h.call(this),this.scene=t,this.displayList=null,this.type="Layer",this.state=0,this.parentContainer=null,this.name="",this.active=!0,this.tabIndex=-1,this.data=null,this.renderFlags=15,this.cameraFilter=0,this.input=null,this.body=null,this.ignoreDestroy=!1,this.systems=t.sys,this.events=t.sys.events,this.sortChildrenFlag=!1,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.initPipeline(),this.clearAlpha(),this.setBlendMode(n.SKIP_CHECK),e&&this.add(e),t.sys.queueDepthSort()},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},setState:function(t){return this.state=t,this},setDataEnabled:function(){return this.data||(this.data=new a(this)),this},setData:function(t,e){return this.data||(this.data=new a(this)),this.data.set(t,e),this},incData:function(t,e){return this.data||(this.data=new a(this)),this.data.inc(t,e),this},toggleData:function(t){return this.data||(this.data=new a(this)),this.data.toggle(t),this},getData:function(t){return this.data||(this.data=new a(this)),this.data.get(t)},setInteractive:function(){return this},disableInteractive:function(){return this},removeInteractive:function(){return this},addedToScene:function(){},removedFromScene:function(){},update:function(){},toJSON:function(){return o(this)},willRender:function(t){return!(15!==this.renderFlags||0===this.list.length||0!==this.cameraFilter&&this.cameraFilter&t.id)},getIndexList:function(){for(var t=this,e=this.parentContainer,i=[];e&&(i.unshift(e.getIndex(t)),t=e,e.parentContainer);)e=e.parentContainer;return i.unshift(this.displayList.getIndex(t)),i},addChildCallback:function(t){t.emit(l.ADDED_TO_SCENE,t,this.scene),t.displayList&&t.displayList.remove(t),t.displayList=this,this.queueDepthSort(),this.events.emit(d.ADDED_TO_SCENE,t,this.scene)},removeChildCallback:function(t){t.emit(l.REMOVED_FROM_SCENE,t,this.scene),t.displayList=null,this.queueDepthSort(),this.events.emit(d.REMOVED_FROM_SCENE,t,this.scene)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(p(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},destroy:function(){if(this.scene&&!this.ignoreDestroy){this.emit(l.DESTROY,this);for(var t=this.list.length;t--;)this.list[t].destroy();this.removeAllListeners(),this.resetPostPipeline(!0),this.displayList&&(this.displayList.queueDepthSort(),this.displayList.remove(this)),this.data&&(this.data.destroy(),this.data=void 0),this.active=!1,this.visible=!1,this.list=void 0,this.scene=void 0,this.displayList=void 0,this.systems=void 0,this.events=void 0}}});t.exports=f},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(11),s=i(15),o=i(444),a=i(107),h=i(446),l=i(1069),c=new n({Extends:s,Mixins:[r.Depth,r.Mask,r.Pipeline,r.Transform,r.Visible,l],initialize:function(t,e,i,n){if(s.call(this,t,"ParticleEmitterManager"),this.blendMode=-1,this.timeScale=1,this.texture=null,this.frame=null,this.frameNames=[],null===i||"object"!=typeof i&&!Array.isArray(i)||(n=i,i=null),this.setTexture(e,i),this.initPipeline(),this.emitters=new a(this),this.wells=new a(this),n){Array.isArray(n)||(n=[n]);for(var r=0;r0?e.defaultFrame=i[0]:e.defaultFrame=this.defaultFrame,this},addEmitter:function(t){return this.emitters.add(t)},createEmitter:function(t){return this.addEmitter(new h(this,t))},removeEmitter:function(t){return this.emitters.remove(t,!0)},addGravityWell:function(t){return this.wells.add(t)},createGravityWell:function(t){return this.addGravityWell(new o(t))},emitParticle:function(t,e,i){for(var n=this.emitters.list,r=0;r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(34),r=i(131),s=i(31),o=i(0),a=i(11),h=i(32),l=i(106),c=i(15),u=i(1),d=i(65),p=i(1073),f=i(139),m=i(12),g=i(219),v=new o({Extends:c,Mixins:[a.Alpha,a.BlendMode,a.ComputedSize,a.Crop,a.Depth,a.Flip,a.GetBounds,a.Mask,a.Origin,a.Pipeline,a.ScrollFactor,a.Tint,a.Transform,a.Visible,p],initialize:function(t,e,i,n,o,a,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=32),void 0===o&&(o=32),c.call(this,t,"RenderTexture"),this.renderer=t.sys.renderer,this.textureManager=t.sys.textures,this.globalTint=16777215,this.globalAlpha=1,this.canvas=null,this.dirty=!1,this._crop=this.resetCropObject(),this.texture=null,this.frame=null,this._saved=!1,void 0===a?(this.canvas=s.create2D(this,n,o),this.texture=t.sys.textures.addCanvas(g(),this.canvas),this.frame=this.texture.get()):(this.texture=t.sys.textures.get(a),this.frame=this.texture.get(l),this.canvas=this.frame.source.image,this._saved=!0,this.dirty=!0,this.width=this.frame.cutWidth,this.height=this.frame.cutHeight),this.context=this.canvas.getContext("2d"),this._eraseMode=!1,this.camera=new r(0,0,n,o),this.renderTarget=null;var p=this.renderer;p?p.type===h.WEBGL?(this.drawGameObject=this.batchGameObjectWebGL,this.renderTarget=new f(p,n,o,1,0,!1)):p.type===h.CANVAS&&(this.drawGameObject=this.batchGameObjectCanvas):this.drawGameObject=u,this.camera.setScene(t),this.setPosition(e,i),void 0===a&&this.setSize(n,o),this.setOrigin(0,0),this.initPipeline(d.SINGLE_PIPELINE)},setSize:function(t,e){return this.resize(t,e)},resize:function(t,e){void 0===e&&(e=t);var i=this.frame;if(t!==this.width||e!==this.height){if("__BASE"===i.name){this.canvas.width=t,this.canvas.height=e,this.texture.width=t,this.texture.height=e;var n=this.renderTarget;n&&(n.resize(t,e),i.glTexture=n.texture,i.source.isRenderTexture=!0,i.source.isGLTexture=!0,i.source.glTexture=n.texture),this.camera.setSize(t,e),i.source.width=t,i.source.height=e,i.setSize(t,e),this.width=t,this.height=e}}else{var r=this.texture.getSourceImage();i.cutX+t>r.width&&(t=r.width-i.cutX),i.cutY+e>r.height&&(e=r.height-i.cutY),i.setSize(t,e,i.cutX,i.cutY)}this.updateDisplayOrigin();var s=this.input;return s&&!s.customHitArea&&(s.hitArea.width=t,s.hitArea.height=e),this},setGlobalTint:function(t){return this.globalTint=t,this},setGlobalAlpha:function(t){return this.globalAlpha=t,this},saveTexture:function(t){return this.textureManager.renameTexture(this.texture.key,t),this._saved=!0,this.texture},fill:function(t,e,i,n,r,s){var o=this.frame,a=this.camera,h=this.renderer;void 0===e&&(e=1),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=o.cutWidth),void 0===s&&(s=o.cutHeight);var l=(t>>16&255)/255,c=(t>>8&255)/255,u=(255&t)/255,d=this.renderTarget;if(a.preRender(),d){d.bind(!0);var p=this.pipeline;p.manager.set(p);var f=d.width,g=d.height,v=h.width/f,y=h.height/g;p.drawFillRect(i*v,n*y,r*v,s*y,m.getTintFromFloats(u,c,l,1),e),d.unbind(!0)}else{var x=this.context;h.setContext(x),x.fillStyle="rgba("+l+","+c+","+u+","+e+")",x.fillRect(i+o.cutX,n+o.cutY,r,s),h.setContext()}return this.dirty=!0,this},clear:function(){if(this.dirty){var t=this.renderTarget;if(t)t.clear();else{var e=this.context;e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(this.frame.cutX,this.frame.cutY,this.frame.cutWidth,this.frame.cutHeight),e.restore()}this.dirty=!1}return this},erase:function(t,e,i){return this._eraseMode=!0,this.draw(t,e,i,1,16777215),this._eraseMode=!1,this},draw:function(t,e,i,n,r){return this.beginDraw(),this.batchDraw(t,e,i,n,r),this.endDraw(),this},drawFrame:function(t,e,i,n,r,s){return this.beginDraw(),this.batchDrawFrame(t,e,i,n,r,s),this.endDraw(),this},beginDraw:function(){var t=this.camera,e=this.renderer,i=this.renderTarget;return t.preRender(),i?e.beginCapture(i.width,i.height):e.setContext(this.context),this},batchDraw:function(t,e,i,n,r){return void 0===n&&(n=this.globalAlpha),r=void 0===r?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(r>>16)+(65280&r)+((255&r)<<16),Array.isArray(t)||(t=[t]),this.batchList(t,e,i,n,r),this},batchDrawFrame:function(t,e,i,n,r,s){void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=this.globalAlpha),s=void 0===s?(this.globalTint>>16)+(65280&this.globalTint)+((255&this.globalTint)<<16):(s>>16)+(65280&s)+((255&s)<<16);var o=this.textureManager.getFrame(t,e);return o&&(this.renderTarget?this.pipeline.batchTextureFrame(o,i,n,s,r,this.camera.matrix,null):this.batchTextureFrame(o,i+this.frame.cutX,n+this.frame.cutY,r,s)),this},endDraw:function(){var t=this.renderer,e=this.renderTarget;if(e){var i=t.endCapture();t.pipelines.setUtility().blitFrame(i,e,1,!1,!1,this._eraseMode),t.resetScissor(),t.resetViewport()}else t.setContext();return this.dirty=!0,this},batchList:function(t,e,i,n,r){for(var s=0;s * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(162),r=i(0),s=i(11),o=i(15),a=i(65),h=i(1079),l=i(3),c=new r({Extends:o,Mixins:[s.AlphaSingle,s.BlendMode,s.Depth,s.Flip,s.Mask,s.Pipeline,s.Size,s.Texture,s.Transform,s.Visible,s.ScrollFactor,h],initialize:function(t,e,i,r,s,h,c,u,d){void 0===r&&(r="__DEFAULT"),void 0===h&&(h=2),void 0===c&&(c=!0),o.call(this,t,"Rope"),this.anims=new n(this),this.points=h,this.vertices,this.uv,this.colors,this.alphas,this.tintFill="__DEFAULT"===r,this.dirty=!1,this.horizontal=c,this._flipX=!1,this._flipY=!1,this._perp=new l,this.debugCallback=null,this.debugGraphic=null,this.setTexture(r,s),this.setPosition(e,i),this.setSizeToFrame(),this.initPipeline(a.ROPE_PIPELINE),Array.isArray(h)&&this.resizeArrays(h.length),this.setPoints(h,u,d),this.updateVertices()},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(t,e){var i=this.anims.currentFrame;this.anims.update(t,e),this.anims.currentFrame!==i&&(this.updateUVs(),this.updateVertices())},play:function(t,e,i){return this.anims.play(t,e,i),this},setDirty:function(){return this.dirty=!0,this},setHorizontal:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?this:(this.horizontal=!0,this.setPoints(t,e,i))},setVertical:function(t,e,i){return void 0===t&&(t=this.points.length),this.horizontal?(this.horizontal=!1,this.setPoints(t,e,i)):this},setTintFill:function(t){return void 0===t&&(t=!1),this.tintFill=t,this},setAlphas:function(t,e){var i=this.points.length;if(i<1)return this;var n,r=this.alphas;void 0===t?t=[1]:Array.isArray(t)||void 0!==e||(t=[t]);var s=0;if(void 0!==e)for(n=0;ns&&(o=t[s]),r[s]=o,t.length>s+1&&(o=t[s+1]),r[s+1]=o}return this},setColors:function(t){var e=this.points.length;if(e<1)return this;var i,n=this.colors;void 0===t?t=[16777215]:Array.isArray(t)||(t=[t]);var r=0;if(t.length===e)for(i=0;ir&&(s=t[r]),n[r]=s,t.length>r+1&&(s=t[r+1]),n[r+1]=s}return this},setPoints:function(t,e,i){if(void 0===t&&(t=2),"number"==typeof t){var n,r,s,o=t;if(o<2&&(o=2),t=[],this.horizontal)for(s=-this.frame.halfWidth,r=this.frame.width/(o-1),n=0;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(140),r=i(31),s=i(0),o=i(11),a=i(22),h=i(15),l=i(452),c=i(6),u=i(199),d=i(1082),p=i(453),f=new s({Extends:h,Mixins:[o.Alpha,o.BlendMode,o.ComputedSize,o.Crop,o.Depth,o.Flip,o.GetBounds,o.Mask,o.Origin,o.Pipeline,o.ScrollFactor,o.Tint,o.Transform,o.Visible,d],initialize:function(t,e,i,n,s){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Text"),this.renderer=t.sys.renderer,this.setPosition(e,i),this.setOrigin(0,0),this.initPipeline(),this.canvas=r.create(this),this.context=this.canvas.getContext("2d"),this.style=new p(this,s),this.autoRound=!0,this.splitRegExp=/(?:\r\n|\r|\n)/,this._text=void 0,this.padding={left:0,right:0,top:0,bottom:0},this.width=1,this.height=1,this.lineSpacing=0,this.dirty=!1,0===this.style.resolution&&(this.style.resolution=1),this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.frame.source.resolution=this.style.resolution,this.renderer&&this.renderer.gl&&(this.renderer.deleteTexture(this.frame.source.glTexture),this.frame.source.glTexture=null),this.initRTL(),this.setText(n),s&&s.padding&&this.setPadding(s.padding),s&&s.lineSpacing&&this.setLineSpacing(s.lineSpacing),t.sys.game.events.on(a.CONTEXT_RESTORED,(function(){this.dirty=!0}),this)},initRTL:function(){this.style.rtl&&(this.canvas.dir="rtl",this.context.direction="rtl",this.canvas.style.display="none",n(this.canvas,this.scene.sys.canvas),this.originX=1)},runWordWrap:function(t){var e=this.style;if(e.wordWrapCallback){var i=e.wordWrapCallback.call(e.wordWrapCallbackScope,t,this);return Array.isArray(i)&&(i=i.join("\n")),i}return e.wordWrapWidth?e.wordWrapUseAdvanced?this.advancedWordWrap(t,this.context,this.style.wordWrapWidth):this.basicWordWrap(t,this.context,this.style.wordWrapWidth):t},advancedWordWrap:function(t,e,i){for(var n="",r=t.replace(/ +/gi," ").split(this.splitRegExp),s=r.length,o=0;ol){if(0===u){for(var m=p;m.length&&(m=m.slice(0,-1),!((f=e.measureText(m).width)<=l)););if(!m.length)throw new Error("This text's wordWrapWidth setting is less than a single character!");var g=d.substr(m.length);c[u]=g,h+=m}var v=c[u].length?u:u+1,y=c.slice(v).join(" ").replace(/[ \n]*$/gi,"");r[o+1]=y+" "+(r[o+1]||""),s=r.length;break}h+=p,l-=f}n+=h.replace(/[ \n]*$/gi,"")+"\n"}}return n=n.replace(/[\s|\n]*$/gi,"")},basicWordWrap:function(t,e,i){for(var n="",r=t.split(this.splitRegExp),s=r.length-1,o=e.measureText(" ").width,a=0;a<=s;a++){for(var h=i,l=r[a].split(" "),c=l.length-1,u=0;u<=c;u++){var d=l[u],p=e.measureText(d).width,f=p;uh&&u>0&&(n+="\n",h=i),n+=d,u0&&(d+=h.lineSpacing*m),i.rtl)u=p-u;else if("right"===i.align)u+=o-h.lineWidths[m];else if("center"===i.align)u+=(o-h.lineWidths[m])/2;else if("justify"===i.align&&h.lineWidths[m]/h.width>=.85){var g=h.width-h.lineWidths[m],v=e.measureText(" ").width,y=a[m].trim(),x=y.split(" ");g+=(a[m].length-y.length)*v;for(var b=Math.floor(g/v),w=0;b>0;)x[w]+=" ",w=(w+1)%(x.length-1||1),--b;a[m]=x.join(" ")}this.autoRound&&(u=Math.round(u),d=Math.round(d)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(a[m],u,d)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(a[m],u,d))}e.restore(),this.renderer&&this.renderer.gl&&(this.frame.source.glTexture=this.renderer.canvasToTexture(t,this.frame.source.glTexture,!0),this.frame.glTexture=this.frame.source.glTexture),this.dirty=!0;var T=this.input;return T&&!T.customHitArea&&(T.hitArea.width=this.width,T.hitArea.height=this.height),this},getTextMetrics:function(){return this.style.getTextMetrics()},text:{get:function(){return this._text},set:function(t){this.setText(t)}},toJSON:function(){var t=o.ToJSON(this),e={autoRound:this.autoRound,text:this._text,style:this.style.toJSON(),padding:{left:this.padding.left,right:this.padding.right,top:this.padding.top,bottom:this.padding.bottom}};return t.data=e,t},preDestroy:function(){this.style.rtl&&u(this.canvas),r.remove(this.canvas),this.texture.destroy()}});t.exports=f},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(31),r=i(0),s=i(11),o=i(22),a=i(15),h=i(355),l=i(189),c=i(1085),u=i(3),d=new r({Extends:a,Mixins:[s.Alpha,s.BlendMode,s.ComputedSize,s.Crop,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Tint,s.Transform,s.Visible,c],initialize:function(t,e,i,r,s,l,c){var d=t.sys.renderer;a.call(this,t,"TileSprite");var p=t.sys.textures.get(l),f=p.get(c);r&&s?(r=Math.floor(r),s=Math.floor(s)):(r=f.width,s=f.height),this._tilePosition=new u,this._tileScale=new u(1,1),this.dirty=!1,this.renderer=d,this.canvas=n.create(this,r,s),this.context=this.canvas.getContext("2d"),this.displayTexture=p,this.displayFrame=f,this._crop=this.resetCropObject(),this.texture=t.sys.textures.addCanvas(null,this.canvas,!0),this.frame=this.texture.get(),this.potWidth=h(f.width),this.potHeight=h(f.height),this.fillCanvas=n.create2D(this,this.potWidth,this.potHeight),this.fillContext=this.fillCanvas.getContext("2d"),this.fillPattern=null,this.setPosition(e,i),this.setSize(r,s),this.setFrame(c),this.setOriginFromFrame(),this.initPipeline(),t.sys.game.events.on(o.CONTEXT_RESTORED,(function(t){var e=t.gl;this.dirty=!0,this.fillPattern=null,this.fillPattern=t.createTexture2D(0,e.LINEAR,e.LINEAR,e.REPEAT,e.REPEAT,e.RGBA,this.fillCanvas,this.potWidth,this.potHeight)}),this)},setTexture:function(t,e){return this.displayTexture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){var e=this.displayTexture.get(t);return this.potWidth=h(e.width),this.potHeight=h(e.height),this.canvas.width=0,e.cutWidth&&e.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this.displayFrame=e,this.dirty=!0,this.updateTileTexture(),this},setTilePosition:function(t,e){return void 0!==t&&(this.tilePositionX=t),void 0!==e&&(this.tilePositionY=e),this},setTileScale:function(t,e){return void 0===t&&(t=this.tileScaleX),void 0===e&&(e=t),this.tileScaleX=t,this.tileScaleY=e,this},updateTileTexture:function(){if(this.dirty&&this.renderer){var t=this.displayFrame;if(t.source.isRenderTexture||t.source.isGLTexture)return console.warn("TileSprites can only use Image or Canvas based textures"),void(this.dirty=!1);var e=this.fillContext,i=this.fillCanvas,n=this.potWidth,r=this.potHeight;this.renderer.gl||(n=t.cutWidth,r=t.cutHeight),e.clearRect(0,0,n,r),i.width=n,i.height=r,e.drawImage(t.source.image,t.cutX,t.cutY,t.cutWidth,t.cutHeight,0,0,n,r),this.renderer.gl?this.fillPattern=this.renderer.canvasToTexture(i,this.fillPattern):this.fillPattern=e.createPattern(i,"repeat"),this.updateCanvas(),this.dirty=!1}},updateCanvas:function(){var t=this.canvas;if(t.width===this.width&&t.height===this.height||(t.width=this.width,t.height=this.height,this.frame.setSize(this.width,this.height),this.updateDisplayOrigin(),this.dirty=!0),!this.dirty||this.renderer&&this.renderer.gl)this.dirty=!1;else{var e=this.context;this.scene.sys.game.config.antialias||l.disable(e);var i=this._tileScale.x,n=this._tileScale.y,r=this._tilePosition.x,s=this._tilePosition.y;e.clearRect(0,0,this.width,this.height),e.save(),e.scale(i,n),e.translate(-r,-s),e.fillStyle=this.fillPattern,e.fillRect(r,s,this.width/i,this.height/n),e.restore(),this.dirty=!1}},preDestroy:function(){this.renderer&&this.renderer.gl&&this.renderer.deleteTexture(this.fillPattern),n.remove(this.canvas),n.remove(this.fillCanvas),this.fillPattern=null,this.fillContext=null,this.fillCanvas=null,this.displayTexture=null,this.displayFrame=null,this.texture.destroy(),this.renderer=null},tilePositionX:{get:function(){return this._tilePosition.x},set:function(t){this._tilePosition.x=t,this.dirty=!0}},tilePositionY:{get:function(){return this._tilePosition.y},set:function(t){this._tilePosition.y=t,this.dirty=!0}},tileScaleX:{get:function(){return this._tileScale.x},set:function(t){this._tileScale.x=t,this.dirty=!0}},tileScaleY:{get:function(){return this._tileScale.y},set:function(t){this._tileScale.y=t,this.dirty=!0}}});t.exports=d},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(18),s=i(11),o=i(75),a=i(22),h=i(49),l=i(15),c=i(69),u=i(219),d=i(1088),p=i(14),f=new n({Extends:l,Mixins:[s.Alpha,s.BlendMode,s.Depth,s.Flip,s.GetBounds,s.Mask,s.Origin,s.Pipeline,s.ScrollFactor,s.Size,s.TextureCrop,s.Tint,s.Transform,s.Visible,d],initialize:function(t,e,i,n){l.call(this,t,"Video"),this.video=null,this.videoTexture=null,this.videoTextureSource=null,this.snapshotTexture=null,this.flipY=!1,this._key=u(),this.touchLocked=!0,this.playWhenUnlocked=!1,this.retryLimit=20,this.retry=0,this.retryInterval=500,this._retryID=null,this._systemMuted=!1,this._codeMuted=!1,this._systemPaused=!1,this._codePaused=!1,this._callbacks={play:this.playHandler.bind(this),error:this.loadErrorHandler.bind(this),end:this.completeHandler.bind(this),time:this.timeUpdateHandler.bind(this),seeking:this.seekingHandler.bind(this),seeked:this.seekedHandler.bind(this)},this._crop=this.resetCropObject(),this.markers={},this._markerIn=-1,this._markerOut=p.MAX_SAFE_INTEGER,this._lastUpdate=0,this._cacheKey="",this._isSeeking=!1,this.removeVideoElementOnDestroy=!1,this.setPosition(e,i),this.initPipeline(),n&&this.changeSource(n,!1);var r=t.sys.game.events;r.on(a.PAUSE,this.globalPause,this),r.on(a.RESUME,this.globalResume,this);var s=t.sys.sound;s&&s.on(c.GLOBAL_MUTE,this.globalMute,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},play:function(t,e,i){if(this.touchLocked&&this.playWhenUnlocked||this.isPlaying())return this;var n=this.video;if(!n)return console.warn("Video not loaded"),this;void 0===t&&(t=n.loop);var r=this.scene.sys.sound;r&&r.mute&&this.setMute(!0),isNaN(e)||(this._markerIn=e),!isNaN(i)&&i>e&&(this._markerOut=i),n.loop=t;var s=this._callbacks,o=n.play();return void 0!==o?o.then(this.playPromiseSuccessHandler.bind(this)).catch(this.playPromiseErrorHandler.bind(this)):(n.addEventListener("playing",s.play,!0),n.readyState<2&&(this.retry=this.retryLimit,this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval))),n.addEventListener("ended",s.end,!0),n.addEventListener("timeupdate",s.time,!0),n.addEventListener("seeking",s.seeking,!0),n.addEventListener("seeked",s.seeked,!0),this},changeSource:function(t,e,i,n,r){void 0===e&&(e=!0),this.video&&this.stop();var s=this.scene.sys.cache.video.get(t);return s?(this.video=s,this._cacheKey=t,this._codePaused=s.paused,this._codeMuted=s.muted,this.videoTexture?(this.scene.sys.textures.remove(this._key),this.videoTexture=this.scene.sys.textures.create(this._key,s,s.videoWidth,s.videoHeight),this.videoTextureSource=this.videoTexture.source[0],this.videoTexture.add("__BASE",0,0,0,s.videoWidth,s.videoHeight),this.setTexture(this.videoTexture),this.setSizeToFrame(),this.updateDisplayOrigin(),this.emit(o.VIDEO_CREATED,this,s.videoWidth,s.videoHeight)):this.updateTexture(),s.currentTime=0,this._lastUpdate=0,e&&this.play(i,n,r)):this.video=null,this},addMarker:function(t,e,i){return!isNaN(e)&&e>=0&&!isNaN(i)&&(this.markers[t]=[e,i]),this},playMarker:function(t,e){var i=this.markers[t];return i&&this.play(e,i[0],i[1]),this},removeMarker:function(t){return delete this.markers[t],this},snapshot:function(t,e){return void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.snapshotArea(0,0,this.width,this.height,t,e)},snapshotArea:function(t,e,i,n,r,s){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===n&&(n=this.height),void 0===r&&(r=i),void 0===s&&(s=n);var o=this.video,a=this.snapshotTexture;return a?(a.setSize(r,s),o&&a.context.drawImage(o,t,e,i,n,0,0,r,s)):(a=this.scene.sys.textures.createCanvas(u(),r,s),this.snapshotTexture=a,o&&a.context.drawImage(o,t,e,i,n,0,0,r,s)),a.update()},saveSnapshotTexture:function(t){return this.snapshotTexture?this.scene.sys.textures.renameTexture(this.snapshotTexture.key,t):this.snapshotTexture=this.scene.sys.textures.createCanvas(t,this.width,this.height),this.snapshotTexture},loadURL:function(t,e,i){void 0===e&&(e="loadeddata"),void 0===i&&(i=!1),this.video&&this.stop(),this.videoTexture&&this.scene.sys.textures.remove(this._key);var n=document.createElement("video");return n.controls=!1,i&&(n.muted=!0,n.defaultMuted=!0,n.setAttribute("autoplay","autoplay")),n.setAttribute("playsinline","playsinline"),n.setAttribute("preload","auto"),n.addEventListener("error",this._callbacks.error,!0),n.src=t,n.load(),this.video=n,this},loadMediaStream:function(t,e,i){void 0===e&&(e="loadeddata"),void 0===i&&(i=!1),this.video&&this.stop(),this.videoTexture&&this.scene.sys.textures.remove(this._key);var n=document.createElement("video");n.controls=!1,i&&(n.muted=!0,n.defaultMuted=!0,n.setAttribute("autoplay","autoplay")),n.setAttribute("playsinline","playsinline"),n.setAttribute("preload","auto"),n.addEventListener("error",this._callbacks.error,!0);try{n.srcObject=t}catch(e){n.src=window.URL.createObjectURL(t)}return n.load(),this.video=n,this},playPromiseSuccessHandler:function(){this.touchLocked=!1,this.emit(o.VIDEO_PLAY,this),this._markerIn>-1&&(this.video.currentTime=this._markerIn)},playPromiseErrorHandler:function(t){this.scene.sys.input.once(h.POINTER_DOWN,this.unlockHandler,this),this.touchLocked=!0,this.playWhenUnlocked=!0,this.emit(o.VIDEO_ERROR,this,t)},playHandler:function(){this.touchLocked=!1,this.emit(o.VIDEO_PLAY,this),this.video.removeEventListener("playing",this._callbacks.play,!0)},loadErrorHandler:function(t){this.stop(),this.emit(o.VIDEO_ERROR,this,t)},unlockHandler:function(){this.touchLocked=!1,this.playWhenUnlocked=!1,this.emit(o.VIDEO_UNLOCKED,this),this._markerIn>-1&&(this.video.currentTime=this._markerIn),this.video.play(),this.emit(o.VIDEO_PLAY,this)},completeHandler:function(){this.emit(o.VIDEO_COMPLETE,this)},timeUpdateHandler:function(){this.video&&this.video.currentTime=this._markerOut&&(t.loop?(t.currentTime=this._markerIn,this.updateTexture(),this._lastUpdate=e,this.emit(o.VIDEO_LOOP,this)):(this.emit(o.VIDEO_COMPLETE,this),this.stop())))}},checkVideoProgress:function(){this.video.readyState>=2?this.updateTexture():(this.retry--,this.retry>0?this._retryID=window.setTimeout(this.checkVideoProgress.bind(this),this.retryInterval):this.emit(o.VIDEO_TIMEOUT,this))},updateTexture:function(){var t=this.video,e=t.videoWidth,i=t.videoHeight;if(this.videoTexture){var n=this.videoTextureSource;n.source!==t&&(n.source=t,n.width=e,n.height=i),n.update()}else this.videoTexture=this.scene.sys.textures.create(this._key,t,e,i),this.videoTextureSource=this.videoTexture.source[0],this.videoTexture.add("__BASE",0,0,0,e,i),this.setTexture(this.videoTexture),this.setSizeToFrame(),this.updateDisplayOrigin(),this.emit(o.VIDEO_CREATED,this,e,i)},getVideoKey:function(){return this._cacheKey},seekTo:function(t){var e=this.video;if(e){var i=e.duration;if(i!==1/0&&!isNaN(i)){var n=i*t;this.setCurrentTime(n)}}return this},getCurrentTime:function(){return this.video?this.video.currentTime:0},setCurrentTime:function(t){var e=this.video;if(e){if("string"==typeof t){var i=t[0],n=parseFloat(t.substr(1));"+"===i?t=e.currentTime+n:"-"===i&&(t=e.currentTime-n)}e.currentTime=t,this._lastUpdate=t}return this},isSeeking:function(){return this._isSeeking},seekingHandler:function(){this._isSeeking=!0,this.emit(o.VIDEO_SEEKING,this)},seekedHandler:function(){this._isSeeking=!1,this.emit(o.VIDEO_SEEKED,this),this.video&&this.updateTexture()},getProgress:function(){var t=this.video;if(t){var e=t.currentTime,i=t.duration;if(i!==1/0&&!isNaN(i))return e/i}return 0},getDuration:function(){return this.video?this.video.duration:0},setMute:function(t){void 0===t&&(t=!0),this._codeMuted=t;var e=this.video;return e&&(e.muted=!!this._systemMuted||t),this},isMuted:function(){return this._codeMuted},globalMute:function(t,e){this._systemMuted=e;var i=this.video;i&&(i.muted=!!this._codeMuted||e)},globalPause:function(){this._systemPaused=!0,this.video&&this.video.pause()},globalResume:function(){this._systemPaused=!1,this.video&&!this._codePaused&&this.video.play()},setPaused:function(t){void 0===t&&(t=!0);var e=this.video;return this._codePaused=t,e&&(t?e.paused||e.pause():t||e.paused&&!this._systemPaused&&e.play()),this},getVolume:function(){return this.video?this.video.volume:1},setVolume:function(t){return void 0===t&&(t=1),this.video&&(this.video.volume=r(t,0,1)),this},getPlaybackRate:function(){return this.video?this.video.playbackRate:1},setPlaybackRate:function(t){return this.video&&(this.video.playbackRate=t),this},getLoop:function(){return!!this.video&&this.video.loop},setLoop:function(t){return void 0===t&&(t=!0),this.video&&(this.video.loop=t),this},isPlaying:function(){return!!this.video&&!(this.video.paused||this.video.ended)},isPaused:function(){return this.video&&this.video.paused||this._codePaused||this._systemPaused},saveTexture:function(t,e){return void 0===e&&(e=!1),this.videoTexture&&this.scene.sys.textures.renameTexture(this._key,t),this._key=t,this.flipY=e,this.videoTextureSource&&this.videoTextureSource.setFlipY(e),this.videoTexture},stop:function(){var t=this.video;if(t){var e=this._callbacks;for(var i in e)t.removeEventListener(i,e[i],!0);t.pause()}return this._retryID&&window.clearTimeout(this._retryID),this.emit(o.VIDEO_STOP,this),this},removeVideoElement:function(){var t=this.video;if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("autoplay"),t.removeAttribute("src"),this.video=null}},preDestroy:function(){this.stop(),this.removeVideoElementOnDestroy&&this.removeVideoElement();var t=this.scene.sys.game.events;t.off(a.PAUSE,this.globalPause,this),t.off(a.RESUME,this.globalResume,this);var e=this.scene.sys.sound;e&&e.off(c.GLOBAL_MUTE,this.globalMute,this),this._retryID&&window.clearTimeout(this._retryID)}});t.exports=f},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(225),s=i(464),o=i(55),a=new n({initialize:function(t){this.type=o.POLYGON,this.area=0,this.points=[],t&&this.setTo(t)},contains:function(t,e){return r(this,t,e)},setTo:function(t){if(this.area=0,this.points=[],"string"==typeof t&&(t=t.split(" ")),!Array.isArray(t))return this;for(var e,i=Number.MAX_VALUE,n=0;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(11),s=i(15),o=i(2),a=i(17),h=i(472),l=i(1170),c=i(25),u=new n({Extends:s,Mixins:[r.ComputedSize,r.Depth,r.GetBounds,r.Mask,r.Origin,r.ScrollFactor,r.Transform,r.Visible,l],initialize:function(t,e,i,n,r,o,a,h){void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=128),void 0===o&&(o=128),s.call(this,t,"Shader"),this.blendMode=-1,this.shader;var l=t.sys.renderer;this.renderer=l,this.gl=l.gl,this.vertexData=new ArrayBuffer(2*Float32Array.BYTES_PER_ELEMENT*6),this.vertexBuffer=l.createVertexBuffer(this.vertexData.byteLength,this.gl.STREAM_DRAW),this.program=null,this.bytes=new Uint8Array(this.vertexData),this.vertexViewF32=new Float32Array(this.vertexData),this._tempMatrix1=new c,this._tempMatrix2=new c,this._tempMatrix3=new c,this.viewMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.projectionMatrix=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),this.uniforms={},this.pointer=null,this._rendererWidth=l.width,this._rendererHeight=l.height,this._textureCount=0,this.framebuffer=null,this.glTexture=null,this.renderToTexture=!1,this.texture=null,this.setPosition(i,n),this.setSize(r,o),this.setOrigin(.5,.5),this.setShader(e,a,h)},willRender:function(t){return!!this.renderToTexture||!(s.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setRenderToTexture:function(t,e){if(void 0===e&&(e=!1),!this.renderToTexture){var i=this.width,n=this.height,r=this.renderer;this.glTexture=r.createTextureFromSource(null,i,n,0),this.glTexture.flipY=e,this.framebuffer=r.createFramebuffer(i,n,this.glTexture,!1),this._rendererWidth=i,this._rendererHeight=n,this.renderToTexture=!0,this.projOrtho(0,this.width,this.height,0),t&&(this.texture=this.scene.sys.textures.addGLTexture(t,this.glTexture,i,n))}return this.shader&&(r.pipelines.clear(),this.load(),this.flush(),r.pipelines.rebind()),this},setShader:function(t,e,i){if(void 0===e&&(e=[]),"string"==typeof t){var n=this.scene.sys.cache.shader;if(!n.has(t))return console.warn("Shader missing: "+t),this;this.shader=n.get(t)}else this.shader=t;var r=this.gl,s=this.renderer;this.program&&r.deleteProgram(this.program);var o=s.createProgram(this.shader.vertexSrc,this.shader.fragmentSrc);r.uniformMatrix4fv(r.getUniformLocation(o,"uViewMatrix"),!1,this.viewMatrix),r.uniformMatrix4fv(r.getUniformLocation(o,"uProjectionMatrix"),!1,this.projectionMatrix),r.uniform2f(r.getUniformLocation(o,"uResolution"),this.width,this.height),this.program=o;var h=new Date,l={resolution:{type:"2f",value:{x:this.width,y:this.height}},time:{type:"1f",value:0},mouse:{type:"2f",value:{x:this.width/2,y:this.height/2}},date:{type:"4fv",value:[h.getFullYear(),h.getMonth(),h.getDate(),60*h.getHours()*60+60*h.getMinutes()+h.getSeconds()]},sampleRate:{type:"1f",value:44100},iChannel0:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel1:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel2:{type:"sampler2D",value:null,textureData:{repeat:!0}},iChannel3:{type:"sampler2D",value:null,textureData:{repeat:!0}}};this.shader.uniforms?this.uniforms=a(!0,{},this.shader.uniforms,l):this.uniforms=l;for(var c=0;c<4;c++)e[c]&&this.setSampler2D("iChannel"+c,e[c],c,i);return this.initUniforms(),this.projOrtho(0,this._rendererWidth,this._rendererHeight,0),this},setPointer:function(t){return this.pointer=t,this},projOrtho:function(t,e,i,n){var r=1/(t-e),s=1/(i-n),o=this.projectionMatrix;o[0]=-2*r,o[5]=-2*s,o[10]=-.001,o[12]=(t+e)*r,o[13]=(n+i)*s,o[14]=-0;var a=this.program,h=this.gl;this.renderer.setProgram(a),h.uniformMatrix4fv(h.getUniformLocation(a,"uProjectionMatrix"),!1,this.projectionMatrix),this._rendererWidth=e,this._rendererHeight=i},initUniforms:function(){var t=this.gl,e=this.renderer.glFuncMap,i=this.program;for(var n in this._textureCount=0,this.uniforms){var r=this.uniforms[n],s=r.type,o=e[s];r.uniformLocation=t.getUniformLocation(i,n),"sampler2D"!==s&&(r.glMatrix=o.matrix,r.glValueLength=o.length,r.glFunc=o.func)}},setSampler2DBuffer:function(t,e,i,n,r,s){void 0===r&&(r=0),void 0===s&&(s={});var o=this.uniforms[t];return o.value=e,s.width=i,s.height=n,o.textureData=s,this._textureCount=r,this.initSampler2D(o),this},setSampler2D:function(t,e,i,n){void 0===i&&(i=0);var r=this.scene.sys.textures;if(r.exists(e)){var s=r.getFrame(e);if(s.glTexture&&s.glTexture.isRenderTexture)return this.setSampler2DBuffer(t,s.glTexture,s.width,s.height,i,n);var o=this.uniforms[t],a=s.source;o.textureKey=e,o.source=a.image,o.value=s.glTexture,a.isGLTexture&&(n||(n={}),n.width=a.width,n.height=a.height),n&&(o.textureData=n),this._textureCount=i,this.initSampler2D(o)}return this},setUniform:function(t,e){return h(this.uniforms,t,e),this},getUniform:function(t){return o(this.uniforms,t,null)},setChannel0:function(t,e){return this.setSampler2D("iChannel0",t,0,e)},setChannel1:function(t,e){return this.setSampler2D("iChannel1",t,1,e)},setChannel2:function(t,e){return this.setSampler2D("iChannel2",t,2,e)},setChannel3:function(t,e){return this.setSampler2D("iChannel3",t,3,e)},initSampler2D:function(t){if(t.value){var e=this.gl;e.activeTexture(e.TEXTURE0+this._textureCount),e.bindTexture(e.TEXTURE_2D,t.value);var i=t.textureData;if(i&&!t.value.isRenderTexture){var n=e[o(i,"magFilter","linear").toUpperCase()],r=e[o(i,"minFilter","linear").toUpperCase()],s=e[o(i,"wrapS","repeat").toUpperCase()],a=e[o(i,"wrapT","repeat").toUpperCase()],h=e[o(i,"format","rgba").toUpperCase()];if(i.repeat&&(s=e.REPEAT,a=e.REPEAT),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!!i.flipY),i.width){var l=o(i,"width",512),c=o(i,"height",2),u=o(i,"border",0);e.texImage2D(e.TEXTURE_2D,0,h,l,c,u,h,e.UNSIGNED_BYTE,null)}else e.texImage2D(e.TEXTURE_2D,0,h,e.RGBA,e.UNSIGNED_BYTE,t.source);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,n),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,s),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,a)}this.renderer.setProgram(this.program),e.uniform1i(t.uniformLocation,this._textureCount),this._textureCount++}},syncUniforms:function(){var t,e,i,n,r,s=this.gl,o=this.uniforms,a=0;for(var h in o)i=(t=o[h]).glFunc,e=t.glValueLength,n=t.uniformLocation,null!==(r=t.value)&&(1===e?t.glMatrix?i.call(s,n,t.transpose,r):i.call(s,n,r):2===e?i.call(s,n,r.x,r.y):3===e?i.call(s,n,r.x,r.y,r.z):4===e?i.call(s,n,r.x,r.y,r.z,r.w):"sampler2D"===t.type&&(s.activeTexture(s.TEXTURE0+a),s.bindTexture(s.TEXTURE_2D,r),s.uniform1i(n,a),a++))},load:function(t){var e=this.gl,i=this.width,n=this.height,r=this.renderer,s=this.program,o=this.viewMatrix;if(!this.renderToTexture){var a=-this._displayOriginX,h=-this._displayOriginY;o[0]=t[0],o[1]=t[1],o[4]=t[2],o[5]=t[3],o[8]=t[4],o[9]=t[5],o[12]=o[0]*a+o[4]*h,o[13]=o[1]*a+o[5]*h}e.useProgram(s),e.uniformMatrix4fv(e.getUniformLocation(s,"uViewMatrix"),!1,o),e.uniform2f(e.getUniformLocation(s,"uResolution"),this.width,this.height);var l=this.uniforms,c=l.resolution;c.value.x=i,c.value.y=n,l.time.value=r.game.loop.getDuration();var u=this.pointer;if(u){var d=l.mouse,p=u.x/i,f=1-u.y/n;d.value.x=p.toFixed(2),d.value.y=f.toFixed(2)}this.syncUniforms()},flush:function(){var t=this.width,e=this.height,i=this.program,n=this.gl,r=this.vertexBuffer,s=this.renderer,o=2*Float32Array.BYTES_PER_ELEMENT;this.renderToTexture&&(s.setFramebuffer(this.framebuffer),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT)),n.bindBuffer(n.ARRAY_BUFFER,r);var a=n.getAttribLocation(i,"inPosition");-1!==a&&(n.enableVertexAttribArray(a),n.vertexAttribPointer(a,2,n.FLOAT,!1,o,0));var h=this.vertexViewF32;h[3]=e,h[4]=t,h[5]=e,h[8]=t,h[9]=e,h[10]=t,n.bufferSubData(n.ARRAY_BUFFER,0,this.bytes.subarray(0,6*o)),n.drawArrays(n.TRIANGLES,0,6),this.renderToTexture&&s.setFramebuffer(null,!1)},setAlpha:function(){},setBlendMode:function(){},preDestroy:function(){var t=this.gl;t.deleteProgram(this.program),t.deleteBuffer(this.vertexBuffer),this.renderToTexture&&(this.renderer.deleteFramebuffer(this.framebuffer),this.texture.destroy(),this.framebuffer=null,this.glTexture=null,this.texture=null)}});t.exports=u},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(11),s=i(35),o=i(113),a=i(15),h=i(473),l=i(474),c=i(19),u=i(67),d=i(1173),p=i(79),f=i(38),m=i(115),g=new n({Extends:a,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Mask,r.Pipeline,r.Size,r.Texture,r.Transform,r.Visible,r.ScrollFactor,d],initialize:function(t,e,i,n,r,s,o,h,l,c,d,p){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n="__WHITE"),a.call(this,t,"Mesh"),this.faces=[],this.vertices=[],this.tintFill=!1,this.debugCallback=null,this.debugGraphic=null,this.hideCCW=!0,this.modelPosition=new f,this.modelScale=new f(1,1,1),this.modelRotation=new f,this.dirtyCache=[0,0,0,0,0,0,0,0,0,0,0,0],this.transformMatrix=new u,this.viewPosition=new f,this.viewMatrix=new u,this.projectionMatrix=new u,this.totalRendered=0,this.totalFrame=0,this.ignoreDirtyCache=!1;var m=t.sys.renderer;this.setPosition(e,i),this.setTexture(n,r),this.setSize(m.width,m.height),this.initPipeline(),this.setPerspective(m.width,m.height),s&&this.addVertices(s,o,h,l,c,d,p)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},panX:function(t){return this.viewPosition.addScale(f.LEFT,t),this.dirtyCache[10]=1,this},panY:function(t){return this.viewPosition.y+=f.DOWN.y*t,this.dirtyCache[10]=1,this},panZ:function(t){return this.viewPosition.z+=t,this.dirtyCache[10]=1,this},setPerspective:function(t,e,i,n,r){return void 0===i&&(i=45),void 0===n&&(n=.01),void 0===r&&(r=1e3),this.projectionMatrix.perspective(s(i),t/e,n,r),this.dirtyCache[10]=1,this.dirtyCache[11]=0,this},setOrtho:function(t,e,i,n){return void 0===t&&(t=this.scene.sys.renderer.getAspectRatio()),void 0===e&&(e=1),void 0===i&&(i=-1e3),void 0===n&&(n=1e3),this.projectionMatrix.ortho(-t,t,-e,e,i,n),this.dirtyCache[10]=1,this.dirtyCache[11]=1,this},clear:function(){return this.faces.forEach((function(t){t.destroy()})),this.faces=[],this.vertices=[],this},addVerticesFromObj:function(t,e,i,n,r,s,o,a,h){var c=this.scene.sys.cache.obj.get(t);return c&&l(c,this,e,i,n,r,s,o,a,h),this},sortByDepth:function(t,e){return t.depth-e.depth},depthSort:function(){return p(this.faces,this.sortByDepth),this},addVertex:function(t,e,i,n,r,s,o){var a=new m(t,e,i,n,r,s,o);return this.vertices.push(a),a},addFace:function(t,e,i){var n=new o(t,e,i);return this.faces.push(n),this.dirtyCache[9]=-1,n},addVertices:function(t,e,i,n,r,s,o){var a=h(t,e,i,n,r,s,o);return a&&(this.faces=this.faces.concat(a.faces),this.vertices=this.vertices.concat(a.vertices)),this.dirtyCache[9]=-1,this},getFaceCount:function(){return this.faces.length},getVertexCount:function(){return this.vertices.length},getFace:function(t){return this.faces[t]},getFaceAt:function(t,e,i){void 0===i&&(i=this.scene.sys.cameras.main);for(var n=c(this,i).calc,r=this.faces,s=[],o=0;o * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(48);t.exports=function(t,e){return n(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},function(t,e,i){ /** * @author Florian Vazelle * @author Geoffrey Glaive * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4),r=i(230);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var s,o,a=t.x1,h=t.y1,l=t.x2,c=t.y2,u=e.x,d=e.y,p=e.radius,f=l-a,m=c-h,g=a-u,v=h-d,y=f*f+m*m,x=2*(f*g+m*v),b=x*x-4*y*(g*g+v*v-p*p);if(0===b){var w=-x/(2*y);s=a+w*f,o=h+w*m,w>=0&&w<=1&&i.push(new n(s,o))}else if(b>0){var T=(-x-Math.sqrt(b))/(2*y);s=a+T*f,o=h+T*m,T>=0&&T<=1&&i.push(new n(s,o));var _=(-x+Math.sqrt(b))/(2*y);s=a+_*f,o=h+_*m,_>=0&&_<=1&&i.push(new n(s,o))}}return i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(63),r=new(i(4));t.exports=function(t,e,i){if(void 0===i&&(i=r),n(e,t.x1,t.y1))return i.x=t.x1,i.y=t.y1,!0;if(n(e,t.x2,t.y2))return i.x=t.x2,i.y=t.y2,!0;var s=t.x2-t.x1,o=t.y2-t.y1,a=e.x-t.x1,h=e.y-t.y1,l=s*s+o*o,c=s,u=o;if(l>0){var d=(a*s+h*o)/l;c*=d,u*=d}return i.x=t.x1+c,i.y=t.y1+u,c*c+u*u<=l&&c*s+u*o>=0&&n(e,i.x,i.y)}},function(t,e,i){ /** * @author Florian Vazelle * @author Geoffrey Glaive * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4),r=i(92),s=i(482);t.exports=function(t,e,i){if(void 0===i&&(i=[]),s(t,e))for(var o=e.getLineA(),a=e.getLineB(),h=e.getLineC(),l=e.getLineD(),c=[new n,new n,new n,new n],u=[r(o,t,c[0]),r(a,t,c[1]),r(h,t,c[2]),r(l,t,c[3])],d=0;d<4;d++)u[d]&&i.push(c[d]);return i}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=!1),void 0===n&&(n=[]);for(var r,s,o,a,h,l,c=t.x3-t.x1,u=t.y3-t.y1,d=t.x2-t.x1,p=t.y2-t.y1,f=c*c+u*u,m=c*d+u*p,g=d*d+p*p,v=f*g-m*m,y=0===v?0:1/v,x=t.x1,b=t.y1,w=0;w=0&&s>=0&&r+s<1&&(n.push({x:e[w].x,y:e[w].y}),i)));w++);return n}},function(t,e){t.exports=function(t,e,i,n){var r=Math.cos(n),s=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*r-a*s+e,t.y1=o*s+a*r+i,o=t.x2-e,a=t.y2-i,t.x2=o*r-a*s+e,t.y2=o*s+a*r+i,t}},function(t,e){t.exports=function(t){return 0===t.height?NaN:t.width/t.height}},function(t,e){t.exports=function(t,e,i,n){var r=Math.cos(n),s=Math.sin(n),o=t.x1-e,a=t.y1-i;return t.x1=o*r-a*s+e,t.y1=o*s+a*r+i,o=t.x2-e,a=t.y2-i,t.x2=o*r-a*s+e,t.y2=o*s+a*r+i,o=t.x3-e,a=t.y3-i,t.x3=o*r-a*s+e,t.y3=o*s+a*r+i,t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={BUTTON_DOWN:i(1304),BUTTON_UP:i(1305),CONNECTED:i(1306),DISCONNECTED:i(1307),GAMEPAD_BUTTON_DOWN:i(1308),GAMEPAD_BUTTON_UP:i(1309)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(17),r=i(154);t.exports=function(t,e){var i=void 0===t?r():n({},t);if(e)for(var s in e)void 0!==e[s]&&(i[s]=e[s]);return i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=i(402),c=new n({Extends:s,initialize:function(t,e,i,n){var r="xml";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),r=a(o,"extension",r)}var l={type:"xml",cache:t.cacheManager.xml,extension:r,responseType:"text",key:e,url:i,xhrSettings:n};s.call(this,t,l)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=l(this.xhrLoader.responseText),this.data?this.onProcessComplete():(console.warn("Invalid XMLFile: "+this.key),this.onProcessError())}});o.register("xml",(function(t,e,i){if(Array.isArray(t))for(var n=0;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=new n({Extends:s,initialize:function(t,e,i,n){var r="text",o="txt",l=t.cacheManager.text;if(h(e)){var c=e;e=a(c,"key"),i=a(c,"url"),n=a(c,"xhrSettings"),o=a(c,"extension",o),r=a(c,"type",r),l=a(c,"cache",l)}var u={type:r,cache:l,extension:o,responseType:"text",key:e,url:i,xhrSettings:n};s.call(this,t,u)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("text",(function(t,e,i){if(Array.isArray(t))for(var n=0;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Acceleration:i(1362),Angular:i(1363),Bounce:i(1364),Debug:i(1365),Drag:i(1366),Enable:i(1367),Friction:i(1368),Gravity:i(1369),Immovable:i(1370),Mass:i(1371),OverlapCirc:i(517),OverlapRect:i(241),Pushable:i(1372),Size:i(1373),Velocity:i(1374)}},function(t,e){t.exports=function(t,e,i,n,r,s,o){void 0===s&&(s=!0),void 0===o&&(o=!1);var a=[],h=[],l=t.treeMinMax;if(l.minX=e,l.minY=i,l.maxX=e+n,l.maxY=i+r,o&&(h=t.staticTree.search(l)),s&&t.useTree)a=t.tree.search(l);else if(s){var c=t.bodies,u={position:{x:e,y:i},left:e,top:i,right:e+n,bottom:i+r,isCircle:!1},d=t.intersects;c.iterate((function(t){d(t,u)&&a.push(t)}))}return h.concat(a)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={COLLIDE:i(1375),OVERLAP:i(1376),PAUSE:i(1377),RESUME:i(1378),TILE_COLLIDE:i(1379),TILE_OVERLAP:i(1380),WORLD_BOUNDS:i(1381),WORLD_STEP:i(1382)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(60);t.exports=function(t,e,i,r){var s=0,o=t.deltaAbsX()+e.deltaAbsX()+r;return 0===t._dx&&0===e._dx?(t.embedded=!0,e.embedded=!0):t._dx>e._dx?(s=t.right-e.x)>o&&!i||!1===t.checkCollision.right||!1===e.checkCollision.left?s=0:(t.touching.none=!1,t.touching.right=!0,e.touching.none=!1,e.touching.left=!0,e.physicsType!==n.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.right=!0),t.physicsType!==n.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.left=!0)):t._dxo&&!i||!1===t.checkCollision.left||!1===e.checkCollision.right?s=0:(t.touching.none=!1,t.touching.left=!0,e.touching.none=!1,e.touching.right=!0,e.physicsType!==n.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.left=!0),t.physicsType!==n.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.right=!0))),t.overlapX=s,e.overlapX=s,s}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(60);t.exports=function(t,e,i,r){var s=0,o=t.deltaAbsY()+e.deltaAbsY()+r;return 0===t._dy&&0===e._dy?(t.embedded=!0,e.embedded=!0):t._dy>e._dy?(s=t.bottom-e.y)>o&&!i||!1===t.checkCollision.down||!1===e.checkCollision.up?s=0:(t.touching.none=!1,t.touching.down=!0,e.touching.none=!1,e.touching.up=!0,e.physicsType!==n.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.down=!0),t.physicsType!==n.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.up=!0)):t._dyo&&!i||!1===t.checkCollision.up||!1===e.checkCollision.down?s=0:(t.touching.none=!1,t.touching.up=!0,e.touching.none=!1,e.touching.down=!0,e.physicsType!==n.STATIC_BODY||i||(t.blocked.none=!1,t.blocked.up=!0),t.physicsType!==n.STATIC_BODY||i||(e.blocked.none=!1,e.blocked.down=!0))),t.overlapY=s,e.overlapY=s,s}},function(t,e){t.exports=function(t,e){return!(e.right<=t.left||e.bottom<=t.top||e.position.x>=t.right||e.position.y>=t.bottom)}},function(t,e,i){var n={};t.exports=n;var r=i(94),s=i(116),o=i(267),a=i(117),h=i(585),l=i(50);n._warming=.4,n._torqueDampen=1,n._minLength=1e-6,n.create=function(t){var e=t;e.bodyA&&!e.pointA&&(e.pointA={x:0,y:0}),e.bodyB&&!e.pointB&&(e.pointB={x:0,y:0});var i=e.bodyA?s.add(e.bodyA.position,e.pointA):e.pointA,n=e.bodyB?s.add(e.bodyB.position,e.pointB):e.pointB,r=s.magnitude(s.sub(i,n));e.length=void 0!==e.length?e.length:r,e.id=e.id||l.nextId(),e.label=e.label||"Constraint",e.type="constraint",e.stiffness=e.stiffness||(e.length>0?1:.7),e.damping=e.damping||0,e.angularStiffness=e.angularStiffness||0,e.angleA=e.bodyA?e.bodyA.angle:e.angleA,e.angleB=e.bodyB?e.bodyB.angle:e.angleB,e.plugin={};var o={visible:!0,type:"line",anchors:!0,lineColor:null,lineOpacity:null,lineThickness:null,pinSize:null,anchorColor:null,anchorSize:null};return 0===e.length&&e.stiffness>.1?(o.type="pin",o.anchors=!1):e.stiffness<.9&&(o.type="spring"),e.render=l.extend(o,e.render),e},n.preSolveAll=function(t){for(var e=0;e0&&(u.position.x+=l.x,u.position.y+=l.y),0!==l.angle&&(r.rotate(u.vertices,l.angle,i.position),h.rotate(u.axes,l.angle),c>0&&s.rotateAbout(u.position,l.angle,i.position,u.position)),a.update(u.bounds,u.vertices,i.velocity)}l.angle*=n._warming,l.x*=n._warming,l.y*=n._warming}}},n.pointAWorld=function(t){return{x:(t.bodyA?t.bodyA.position.x:0)+t.pointA.x,y:(t.bodyA?t.bodyA.position.y:0)+t.pointA.y}},n.pointBWorld=function(t){return{x:(t.bodyB?t.bodyB.position.x:0)+t.pointB.x,y:(t.bodyB?t.bodyB.position.y:0)+t.pointB.y}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={CalculateFacesAt:i(248),CalculateFacesWithin:i(61),CheckIsoBounds:i(537),Copy:i(1414),CreateFromTiles:i(1415),CullBounds:i(539),CullTiles:i(540),Fill:i(1416),FilterTiles:i(1417),FindByIndex:i(1418),FindTile:i(1419),ForEachTile:i(1420),GetCullTilesFunction:i(1421),GetTileAt:i(156),GetTileAtWorldXY:i(1422),GetTilesWithin:i(26),GetTilesWithinShape:i(1423),GetTilesWithinWorldXY:i(523),GetTileToWorldXFunction:i(1424),GetTileToWorldXYFunction:i(1425),GetTileToWorldYFunction:i(1426),GetWorldToTileXFunction:i(1427),GetWorldToTileXYFunction:i(1428),GetWorldToTileYFunction:i(1429),HasTileAt:i(558),HasTileAtWorldXY:i(1430),HexagonalCullBounds:i(542),HexagonalCullTiles:i(541),HexagonalTileToWorldXY:i(546),HexagonalTileToWorldY:i(550),HexagonalWorldToTileXY:i(552),HexagonalWorldToTileY:i(556),IsInLayerBounds:i(118),IsometricCullTiles:i(543),IsometricTileToWorldXY:i(547),IsometricWorldToTileXY:i(553),PutTileAt:i(253),PutTileAtWorldXY:i(1431),PutTilesAt:i(1432),Randomize:i(1433),RemoveTileAt:i(559),RemoveTileAtWorldXY:i(1434),RenderDebug:i(1435),ReplaceByIndex:i(538),RunCull:i(157),SetCollision:i(1436),SetCollisionBetween:i(1437),SetCollisionByExclusion:i(1438),SetCollisionByProperty:i(1439),SetCollisionFromCollisionGroup:i(1440),SetLayerCollisionIndex:i(158),SetTileCollision:i(72),SetTileIndexCallback:i(1441),SetTileLocationCallback:i(1442),Shuffle:i(1443),StaggeredCullBounds:i(545),StaggeredCullTiles:i(544),StaggeredTileToWorldXY:i(548),StaggeredTileToWorldY:i(551),StaggeredWorldToTileXY:i(554),StaggeredWorldToTileY:i(557),SwapByIndex:i(1444),TileToWorldX:i(249),TileToWorldXY:i(549),TileToWorldY:i(250),WeightedRandomize:i(1445),WorldToTileX:i(251),WorldToTileXY:i(555),WorldToTileY:i(252)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(156);t.exports=function(t,e,i){var r=n(t,e,!0,i),s=n(t,e-1,!0,i),o=n(t,e+1,!0,i),a=n(t-1,e,!0,i),h=n(t+1,e,!0,i),l=r&&r.collides;return l&&(r.faceTop=!0,r.faceBottom=!0,r.faceLeft=!0,r.faceRight=!0),s&&s.collides&&(l&&(r.faceTop=!1),s.faceBottom=!l),o&&o.collides&&(l&&(r.faceBottom=!1),o.faceTop=!l),a&&a.collides&&(l&&(r.faceLeft=!1),a.faceRight=!l),h&&h.collides&&(l&&(r.faceRight=!1),h.faceLeft=!l),r&&!r.collides&&r.resetFaces(),r}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileWidth,r=i.tilemapLayer,s=0;return r&&(e||(e=r.scene.cameras.main),s=r.x+e.scrollX*(1-r.scrollFactorX),n*=r.scaleX),s+t*n}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileHeight,r=i.tilemapLayer,s=0;return r&&(e||(e=r.scene.cameras.main),s=r.y+e.scrollY*(1-r.scrollFactorY),n*=r.scaleY),s+t*n}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var r=n.baseTileWidth,s=n.tilemapLayer;return s&&(i||(i=s.scene.cameras.main),t-=s.x+i.scrollX*(1-s.scrollFactorX),r*=s.scaleX),e?Math.floor(t/r):t/r}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=!0);var r=n.baseTileHeight,s=n.tilemapLayer;return s&&(i||(i=s.scene.cameras.main),t-=s.y+i.scrollY*(1-s.scrollFactorY),r*=s.scaleY),e?Math.floor(t/r):t/r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(83),r=i(118),s=i(248),o=i(72);t.exports=function(t,e,i,a,h){if(void 0===a&&(a=!0),!r(e,i,h))return null;var l=h.data[i][e],c=l&&l.collides;if(t instanceof n)null===h.data[i][e]&&(h.data[i][e]=new n(h,t.index,e,i,h.tileWidth,h.tileHeight)),h.data[i][e].copy(t);else{var u=t;null===h.data[i][e]?h.data[i][e]=new n(h,u,e,i,h.tileWidth,h.tileHeight):h.data[i][e].index=u}var d=h.data[i][e],p=-1!==h.collideIndexes.indexOf(d.index);return o(d,p),a&&c!==d.collides&&s(e,i,h),d}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(29);t.exports=function(t){return"isometric"===(t=t.toLowerCase())?n.ISOMETRIC:"staggered"===t?n.STAGGERED:"hexagonal"===t?n.HEXAGONAL:n.ORTHOGONAL}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(39),r=i(119),s=i(120),o=i(83);t.exports=function(t,e,i,a,h){for(var l=new r({tileWidth:i,tileHeight:a}),c=new s({name:t,tileWidth:i,tileHeight:a,format:n.ARRAY_2D,layers:[l]}),u=[],d=e.length,p=0,f=0;f * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(567),r=i(257),s=function(t){return{x:t.x,y:t.y}},o=["id","name","type","rotation","properties","visible","x","y","width","height"];t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0);var a=n(t,o);if(a.x+=e,a.y+=i,t.gid){var h=r(t.gid);a.gid=h.gid,a.flippedHorizontal=h.flippedHorizontal,a.flippedVertical=h.flippedVertical,a.flippedAntiDiagonal=h.flippedAntiDiagonal}else t.polyline?a.polyline=t.polyline.map(s):t.polygon?a.polygon=t.polygon.map(s):t.ellipse?a.ellipse=t.ellipse:t.text?a.text=t.text:t.point?a.point=!0:a.rectangle=!0;return a}},function(t,e){t.exports=function(t){var e=Boolean(2147483648&t),i=Boolean(1073741824&t),n=Boolean(536870912&t);t&=536870911;var r=0,s=!1;return e&&i&&n?(r=Math.PI/2,s=!0):e&&i&&!n?(r=Math.PI,s=!1):e&&!i&&n?(r=Math.PI/2,s=!1):!e||i||n?!e&&i&&n?(r=3*Math.PI/2,s=!1):e||!i||n?e||i||!n?e||i||n||(r=0,s=!1):(r=3*Math.PI/2,s=!0):(r=Math.PI,s=!0):(r=0,s=!0),{gid:t,flippedHorizontal:e,flippedVertical:i,flippedAntiDiagonal:n,rotation:r,flipped:s}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(39),r=i(120),s=i(560),o=i(576);t.exports=function(t,e,i,a,h,l,c,u){void 0===i&&(i=32),void 0===a&&(a=32),void 0===h&&(h=10),void 0===l&&(l=10),void 0===u&&(u=!1);var d=null;if(Array.isArray(c))d=s(void 0!==e?e:"map",n.ARRAY_2D,c,i,a,u);else if(void 0!==e){var p=t.cache.tilemap.get(e);p?d=s(e,p.format,p.data,i,a,u):console.warn("No map data found for key "+e)}return null===d&&(d=new r({tileWidth:i,tileHeight:a,width:h,height:l})),new o(t,d)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(6);t.exports=function(t){var e=n(t,"targets",null);return null===e||("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e])),e}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ function i(t){return!!t.getActive&&"function"==typeof t.getActive}function n(t){return!!t.getStart&&"function"==typeof t.getStart}function r(t){return!!t.getEnd&&"function"==typeof t.getEnd}var s=function(t,e){var o,a,h=function(t,e,i){return i},l=function(t,e,i){return i},c=null,u=typeof e;if("number"===u)h=function(){return e};else if("string"===u){var d=e[0],p=parseFloat(e.substr(2));switch(d){case"+":h=function(t,e,i){return i+p};break;case"-":h=function(t,e,i){return i-p};break;case"*":h=function(t,e,i){return i*p};break;case"/":h=function(t,e,i){return i/p};break;default:h=function(){return parseFloat(e)}}}else if("function"===u)h=e;else if("object"===u)if(n(a=e)||r(a)||i(a))i(e)&&(c=e.getActive),r(e)&&(h=e.getEnd),n(e)&&(l=e.getStart);else if(e.hasOwnProperty("value"))o=s(t,e.value);else{var f=e.hasOwnProperty("to"),m=e.hasOwnProperty("from"),g=e.hasOwnProperty("start");if(f&&(m||g)){if(o=s(t,e.to),g){var v=s(t,e.start);o.getActive=v.getEnd}if(m){var y=s(t,e.from);o.getStart=y.getEnd}}}return o||(o={getActive:c,getEnd:h,getStart:l}),o};t.exports=s},function(t,e){t.exports={targets:null,delay:0,duration:1e3,ease:"Power0",easeParams:null,hold:0,repeat:0,repeatDelay:0,yoyo:!1,flipX:!1,flipY:!1}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(9),s=i(263),o=i(16),a=i(5),h=i(97),l=i(14),c=new n({Extends:r,initialize:function(t,e,i){r.call(this),this.parent=t,this.parentIsTimeline=t.hasOwnProperty("isTimeline"),this.data=e,this.totalData=e.length,this.targets=i,this.totalTargets=i.length,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.startDelay=0,this.hasStarted=!1,this.isSeeking=!1,this.completeDelay=0,this.countdown=0,this.offset=0,this.calculatedOffset=0,this.state=h.PENDING_ADD,this._pausedState=h.INIT,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onActive:null,onComplete:null,onLoop:null,onRepeat:null,onStart:null,onStop:null,onUpdate:null,onYoyo:null},this.callbackScope},getValue:function(t){return void 0===t&&(t=0),this.data[t].current},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===h.ACTIVE},isPaused:function(){return this.state===h.PAUSED},hasTarget:function(t){return-1!==this.targets.indexOf(t)},updateTo:function(t,e,i){void 0===i&&(i=!1);for(var n=0;n0&&(r.totalDuration+=r.t2*r.repeat),r.totalDuration>t&&(t=r.totalDuration),r.delay0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay,this.startDelay=e},init:function(){if(this.paused&&!this.parentIsTimeline)return this.state=h.PENDING_ADD,this._pausedState=h.INIT,!1;for(var t=this.data,e=this.totalTargets,i=0;i0?(this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweenData(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=h.LOOP_DELAY):(this.state=h.ACTIVE,this.dispatchTweenEvent(s.TWEEN_LOOP,this.callbacks.onLoop))):this.completeDelay>0?(this.state=h.COMPLETE_DELAY,this.countdown=this.completeDelay):(this.state=h.PENDING_REMOVE,this.dispatchTweenEvent(s.TWEEN_COMPLETE,this.callbacks.onComplete))},pause:function(){return this.state===h.PAUSED||(this.paused=!0,this._pausedState=this.state,this.state=h.PAUSED),this},play:function(t){void 0===t&&(t=!1);var e=this.state;return e!==h.INIT||this.parentIsTimeline?e===h.ACTIVE||e===h.PENDING_ADD&&this._pausedState===h.PENDING_ADD?this:this.parentIsTimeline||e!==h.PENDING_REMOVE&&e!==h.REMOVED?(this.parentIsTimeline?(this.resetTweenData(t),0===this.calculatedOffset?this.state=h.ACTIVE:(this.countdown=this.calculatedOffset,this.state=h.OFFSET_DELAY)):this.paused?(this.paused=!1,this.makeActive()):(this.resetTweenData(t),this.state=h.ACTIVE,this.makeActive()),this):(this.seek(0),this.parent.makeActive(this),this):(this.resetTweenData(!1),this.state=h.ACTIVE,this)},resetTweenData:function(t){for(var e=this.data,i=this.totalData,n=this.totalTargets,r=0;r0&&(s.elapsed=s.delay,s.state=h.DELAY),s.getActiveValue&&(o[a]=s.getActiveValue(s.target,s.key,s.start))}},resume:function(){return this.state===h.PAUSED?(this.paused=!1,this.state=this._pausedState):this.play(),this},seek:function(t,e){void 0===e&&(e=16.6),this.state===h.REMOVED&&this.makeActive(),this.elapsed=0,this.progress=0,this.totalElapsed=0,this.totalProgress=0;for(var i=this.data,n=this.totalTargets,r=0;r0&&(s.elapsed=s.delay,s.state=h.DELAY)}this.calcDuration();var u=!1;this.state===h.PAUSED&&(u=!0,this.state=h.ACTIVE),this.isSeeking=!0;do{this.update(0,e)}while(this.totalProgress0?(e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),e.start=e.getStartValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.end=e.getEndValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,h.REPEAT_DELAY):(this.dispatchTweenDataEvent(s.TWEEN_REPEAT,t.callbacks.onRepeat,e),h.PLAYING_FORWARD)):h.COMPLETE},setStateFromStart:function(t,e,i){return e.repeatCounter>0?(e.repeatCounter--,e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),e.end=e.getEndValue(e.target,e.key,e.start,e.index,t.totalTargets,t),e.repeatDelay>0?(e.elapsed=e.repeatDelay-i,e.current=e.start,e.target[e.key]=e.current,h.REPEAT_DELAY):(this.dispatchTweenDataEvent(s.TWEEN_REPEAT,t.callbacks.onRepeat,e),h.PLAYING_FORWARD)):h.COMPLETE},updateTweenData:function(t,e,i){var n=e.target;switch(e.state){case h.PLAYING_FORWARD:case h.PLAYING_BACKWARD:if(!n){e.state=h.COMPLETE;break}var r=e.elapsed,o=e.duration,a=0;(r+=i)>o&&(a=r-o,r=o);var l=e.state===h.PLAYING_FORWARD,c=r/o;if(e.elapsed=r,e.progress=c,e.previous=e.current,1===c)l?(e.current=e.end,n[e.key]=e.end,e.hold>0?(e.elapsed=e.hold-a,e.state=h.HOLD_DELAY):e.state=this.setStateFromEnd(t,e,a)):(e.current=e.start,n[e.key]=e.start,e.state=this.setStateFromStart(t,e,a));else{var u=l?e.ease(c):e.ease(1-c);e.current=e.start+(e.end-e.start)*u,n[e.key]=e.current}this.dispatchTweenDataEvent(s.TWEEN_UPDATE,t.callbacks.onUpdate,e);break;case h.DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=h.PENDING_RENDER);break;case h.REPEAT_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.elapsed=Math.abs(e.elapsed),e.state=h.PLAYING_FORWARD,this.dispatchTweenDataEvent(s.TWEEN_REPEAT,t.callbacks.onRepeat,e));break;case h.HOLD_DELAY:e.elapsed-=i,e.elapsed<=0&&(e.state=this.setStateFromEnd(t,e,Math.abs(e.elapsed)));break;case h.PENDING_RENDER:n?(e.start=e.getStartValue(n,e.key,n[e.key],e.index,t.totalTargets,t),e.end=e.getEndValue(n,e.key,e.start,e.index,t.totalTargets,t),e.current=e.start,n[e.key]=e.start,e.state=h.PLAYING_FORWARD):e.state=h.COMPLETE}return e.state!==h.COMPLETE}});c.TYPES=["onActive","onComplete","onLoop","onRepeat","onStart","onStop","onUpdate","onYoyo"],a.register("tween",(function(t){return this.scene.sys.tweens.add(t)})),o.register("tween",(function(t){return this.scene.sys.tweens.create(t)})),t.exports=c},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={TIMELINE_COMPLETE:i(1459),TIMELINE_LOOP:i(1460),TIMELINE_PAUSE:i(1461),TIMELINE_RESUME:i(1462),TIMELINE_START:i(1463),TIMELINE_UPDATE:i(1464),TWEEN_ACTIVE:i(1465),TWEEN_COMPLETE:i(1466),TWEEN_LOOP:i(1467),TWEEN_REPEAT:i(1468),TWEEN_START:i(1469),TWEEN_STOP:i(1470),TWEEN_UPDATE:i(1471),TWEEN_YOYO:i(1472)}},function(t,e){t.exports=function(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f){return{target:t,index:e,key:i,getActiveValue:s,getEndValue:n,getStartValue:r,ease:o,duration:0,totalDuration:0,delay:0,yoyo:l,hold:0,repeat:0,repeatDelay:0,flipX:p,flipY:f,progress:0,elapsed:0,repeatCounter:0,start:0,previous:0,current:0,end:0,t1:0,t2:0,gen:{delay:a,duration:h,hold:c,repeat:u,repeatDelay:d},state:0}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(66);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(66);t.exports=function(t){return n(t,-180,180)}},function(t,e,i){var n={};t.exports=n;var r=i(268);n._motionWakeThreshold=.18,n._motionSleepThreshold=.08,n._minBias=.9,n.update=function(t,e){for(var i=e*e*e,r=0;r0&&s.motion=s.sleepThreshold&&n.set(s,!0)):s.sleepCounter>0&&(s.sleepCounter-=1)}else n.set(s,!1)}},n.afterCollisions=function(t,e){for(var i=e*e*e,r=0;rn._motionWakeThreshold*i&&n.set(l,!1)}}}},n.set=function(t,e){var i=t.isSleeping;e?(t.isSleeping=!0,t.sleepCounter=t.sleepThreshold,t.positionImpulse.x=0,t.positionImpulse.y=0,t.positionPrev.x=t.position.x,t.positionPrev.y=t.position.y,t.anglePrev=t.angle,t.speed=0,t.angularSpeed=0,t.motion=0,i||r.trigger(t,"sleepStart")):(t.isSleeping=!1,t.sleepCounter=0,i&&r.trigger(t,"sleepEnd"))}},function(t,e,i){var n={};t.exports=n;var r=i(50);n.on=function(t,e,i){for(var n,r=e.split(" "),s=0;s0){i||(i={}),n=e.split(" ");for(var l=0;l * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={AlignTo:i(599),Angle:i(600),Call:i(601),GetFirst:i(602),GetLast:i(603),GridAlign:i(604),IncAlpha:i(654),IncX:i(655),IncXY:i(656),IncY:i(657),PlaceOnCircle:i(658),PlaceOnEllipse:i(659),PlaceOnLine:i(660),PlaceOnRectangle:i(661),PlaceOnTriangle:i(662),PlayAnimation:i(663),PropertyValueInc:i(44),PropertyValueSet:i(27),RandomCircle:i(664),RandomEllipse:i(665),RandomLine:i(666),RandomRectangle:i(667),RandomTriangle:i(668),Rotate:i(669),RotateAround:i(670),RotateAroundDistance:i(671),ScaleX:i(672),ScaleXY:i(673),ScaleY:i(674),SetAlpha:i(675),SetBlendMode:i(676),SetDepth:i(677),SetHitArea:i(678),SetOrigin:i(679),SetRotation:i(680),SetScale:i(681),SetScaleX:i(682),SetScaleY:i(683),SetScrollFactor:i(684),SetScrollFactorX:i(685),SetScrollFactorY:i(686),SetTint:i(687),SetVisible:i(688),SetX:i(689),SetXY:i(690),SetY:i(691),ShiftPosition:i(692),Shuffle:i(693),SmootherStep:i(694),SmoothStep:i(695),Spread:i(696),ToggleVisible:i(697),WrapInRectangle:i(698)}},function(t,e,i){ /** * @author samme * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(122),r=[];r[n.BOTTOM_CENTER]=i(271),r[n.BOTTOM_LEFT]=i(272),r[n.BOTTOM_RIGHT]=i(273),r[n.LEFT_BOTTOM]=i(274),r[n.LEFT_CENTER]=i(275),r[n.LEFT_TOP]=i(276),r[n.RIGHT_BOTTOM]=i(277),r[n.RIGHT_CENTER]=i(278),r[n.RIGHT_TOP]=i(279),r[n.TOP_CENTER]=i(280),r[n.TOP_LEFT]=i(281),r[n.TOP_RIGHT]=i(282),t.exports=function(t,e,i,n,s){return r[i](t,e,n,s)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(40),r=i(84),s=i(85),o=i(51);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),s(t,r(e)+i),o(t,n(e)+a),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(40),r=i(41),s=i(52),o=i(51);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),s(t,r(e)-i),o(t,n(e)+a),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(40),r=i(42),s=i(53),o=i(51);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),s(t,r(e)+i),o(t,n(e)+a),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(40),r=i(41),s=i(54),o=i(53);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,r(e)-i),s(t,n(e)+a),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(86),r=i(41),s=i(87),o=i(53);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,r(e)-i),s(t,n(e)+a),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(41),r=i(43),s=i(53),o=i(51);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),s(t,n(e)-i),o(t,r(e)-a),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(40),r=i(42),s=i(54),o=i(52);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,r(e)+i),s(t,n(e)+a),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(86),r=i(42),s=i(87),o=i(52);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,r(e)+i),s(t,n(e)+a),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(42),r=i(43),s=i(52),o=i(51);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),s(t,n(e)+i),o(t,r(e)-a),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(84),r=i(43),s=i(54),o=i(85);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),s(t,r(e)-a),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(41),r=i(43),s=i(54),o=i(52);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)-i),s(t,r(e)-a),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(42),r=i(43),s=i(54),o=i(53);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,n(e)+i),s(t,r(e)-a),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(122),r=[];r[n.BOTTOM_CENTER]=i(284),r[n.BOTTOM_LEFT]=i(285),r[n.BOTTOM_RIGHT]=i(286),r[n.CENTER]=i(287),r[n.LEFT_CENTER]=i(289),r[n.RIGHT_CENTER]=i(290),r[n.TOP_CENTER]=i(291),r[n.TOP_LEFT]=i(292),r[n.TOP_RIGHT]=i(293),r[n.LEFT_BOTTOM]=r[n.BOTTOM_LEFT],r[n.LEFT_TOP]=r[n.TOP_LEFT],r[n.RIGHT_BOTTOM]=r[n.BOTTOM_RIGHT],r[n.RIGHT_TOP]=r[n.TOP_RIGHT],t.exports=function(t,e,i,n,s){return r[i](t,e,n,s)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(40),r=i(84),s=i(54),o=i(85);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,r(e)+i),s(t,n(e)+a),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(40),r=i(41),s=i(54),o=i(52);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,r(e)-i),s(t,n(e)+a),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(40),r=i(42),s=i(54),o=i(53);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,r(e)+i),s(t,n(e)+a),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(288),r=i(84),s=i(86);t.exports=function(t,e,i,o){return void 0===i&&(i=0),void 0===o&&(o=0),n(t,r(e)+i,s(e)+o),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(85),r=i(87);t.exports=function(t,e,i){return n(t,e),r(t,i)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(86),r=i(41),s=i(87),o=i(52);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,r(e)-i),s(t,n(e)+a),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(86),r=i(42),s=i(87),o=i(53);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),o(t,r(e)+i),s(t,n(e)+a),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(84),r=i(43),s=i(85),o=i(51);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),s(t,n(e)+i),o(t,r(e)-a),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(41),r=i(43),s=i(52),o=i(51);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),s(t,n(e)-i),o(t,r(e)-a),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(42),r=i(43),s=i(53),o=i(51);t.exports=function(t,e,i,a){return void 0===i&&(i=0),void 0===a&&(a=0),s(t,n(e)+i),o(t,r(e)-a),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(165),r=i(95),s=i(14),o=i(4);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=r(e,0,s.PI2);return n(t,a,i)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(296),r=i(165),s=i(95),o=i(14);t.exports=function(t,e,i,a){void 0===a&&(a=[]),!e&&i>0&&(e=n(t)/i);for(var h=0;h * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(18),r={_alpha:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t){return void 0===t&&(t=1),this.alpha=t,this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}}};t.exports=r},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(34),r={_blendMode:n.NORMAL,blendMode:{get:function(){return this._blendMode},set:function(t){"string"==typeof t&&(t=n[t]),(t|=0)>=-1&&(this._blendMode=t)}},setBlendMode:function(t){return this.blendMode=t,this}};t.exports=r},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i={_depth:0,depth:{get:function(){return this._depth},set:function(t){this.displayList&&this.displayList.queueDepthSort(),this._depth=t}},setDepth:function(t){return void 0===t&&(t=0),this.depth=t,this}};t.exports=i},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(167),r=i(128);t.exports=function(t,e,i,s){void 0===s&&(s=[]),!e&&i>0&&(e=r(t)/i);for(var o=0;o * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4);t.exports=function(t,e,i){return void 0===i&&(i=new n),i.x=t.x1+(t.x2-t.x1)*e,i.y=t.y1+(t.y2-t.y1)*e,i}},function(t,e){t.exports=function(t,e,i,n){var r=Math.cos(n),s=Math.sin(n),o=t.x-e,a=t.y-i;return t.x=o*r-a*s+e,t.y=o*s+a*r+i,t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(304),r=i(305),s={mask:null,setMask:function(t){return this.mask=t,this},clearMask:function(t){return void 0===t&&(t=!1),t&&this.mask&&this.mask.destroy(),this.mask=null,this},createBitmapMask:function(t){return void 0===t&&(this.texture||this.shader)&&(t=this),new n(this.scene,t)},createGeometryMask:function(t){return void 0===t&&"Graphics"===this.type&&(t=this),new r(this.scene,t)}};t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(22),s=i(88),o=new n({initialize:function(t,e){var i=t.sys.renderer;this.renderer=i,this.bitmapMask=e,this.maskTexture=null,this.mainTexture=null,this.dirty=!0,this.mainFramebuffer=null,this.maskFramebuffer=null,this.invertAlpha=!1,this.isStencil=!1,this.createMask(),t.sys.game.events.on(r.CONTEXT_RESTORED,this.createMask,this),i.on(s.RESIZE,this.createMask,this)},createMask:function(){var t=this.renderer;if(t.gl){this.mainTexture&&this.clearMask();var e=t.width,i=t.height,n=0==(e&e-1)&&0==(i&i-1),r=t.gl,s=n?r.REPEAT:r.CLAMP_TO_EDGE,o=r.LINEAR;this.mainTexture=t.createTexture2D(0,o,o,s,s,r.RGBA,null,e,i),this.maskTexture=t.createTexture2D(0,o,o,s,s,r.RGBA,null,e,i),this.mainFramebuffer=t.createFramebuffer(e,i,this.mainTexture,!0),this.maskFramebuffer=t.createFramebuffer(e,i,this.maskTexture,!0)}},clearMask:function(){var t=this.renderer;t.gl&&this.mainTexture&&(t.deleteTexture(this.mainTexture),t.deleteTexture(this.maskTexture),t.deleteFramebuffer(this.mainFramebuffer),t.deleteFramebuffer(this.maskFramebuffer),this.mainTexture=null,this.maskTexture=null,this.mainFramebuffer=null,this.maskFramebuffer=null)},setBitmap:function(t){this.bitmapMask=t},preRenderWebGL:function(t,e,i){t.pipelines.BITMAPMASK_PIPELINE.beginMask(this,e,i)},postRenderWebGL:function(t,e){t.pipelines.BITMAPMASK_PIPELINE.endMask(this,e)},preRenderCanvas:function(){},postRenderCanvas:function(){},destroy:function(){this.clearMask(),this.renderer.off(s.RESIZE,this.createMask,this),this.bitmapMask=null,this.prevFramebuffer=null,this.renderer=null}});t.exports=o},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=new(i(0))({initialize:function(t,e){this.geometryMask=e,this.invertAlpha=!1,this.isStencil=!0,this.level=0},setShape:function(t){return this.geometryMask=t,this},setInvertAlpha:function(t){return void 0===t&&(t=!0),this.invertAlpha=t,this},preRenderWebGL:function(t,e,i){var n=t.gl;t.flush(),0===t.maskStack.length&&(n.enable(n.STENCIL_TEST),n.clear(n.STENCIL_BUFFER_BIT),t.maskCount=0),t.currentCameraMask.mask!==this&&(t.currentMask.mask=this),t.maskStack.push({mask:this,camera:i}),this.applyStencil(t,i,!0),t.maskCount++},applyStencil:function(t,e,i){var n=t.gl,r=this.geometryMask,s=t.maskCount;n.colorMask(!1,!1,!1,!1),i?(n.stencilFunc(n.EQUAL,s,255),n.stencilOp(n.KEEP,n.KEEP,n.INCR)):(n.stencilFunc(n.EQUAL,s+1,255),n.stencilOp(n.KEEP,n.KEEP,n.DECR)),r.renderWebGL(t,r,e),t.flush(),n.colorMask(!0,!0,!0,!0),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),i?this.invertAlpha?n.stencilFunc(n.NOTEQUAL,s+1,255):n.stencilFunc(n.EQUAL,s+1,255):this.invertAlpha?n.stencilFunc(n.NOTEQUAL,s,255):n.stencilFunc(n.EQUAL,s,255)},postRenderWebGL:function(t){var e=t.gl;t.maskStack.pop(),t.maskCount--,t.flush();var i=t.currentMask;if(0===t.maskStack.length)i.mask=null,e.disable(e.STENCIL_TEST);else{var n=t.maskStack[t.maskStack.length-1];n.mask.applyStencil(t,n.camera,!1),t.currentCameraMask.mask!==n.mask?(i.mask=n.mask,i.camera=n.camera):i.mask=null}},preRenderCanvas:function(t,e,i){var n=this.geometryMask;t.currentContext.save(),n.renderCanvas(t,n,i,null,null,!0),t.currentContext.clip()},postRenderCanvas:function(t){t.currentContext.restore()},destroy:function(){this.geometryMask=null}});t.exports=n},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i={scrollFactorX:1,scrollFactorY:1,setScrollFactor:function(t,e){return void 0===e&&(e=t),this.scrollFactorX=t,this.scrollFactorY=e,this}};t.exports=i},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(14),r=i(25),s=i(174),o=i(265),a=i(266),h=i(3),l={_scaleX:1,_scaleY:1,_rotation:0,x:0,y:0,z:0,w:0,scale:{get:function(){return(this._scaleX+this._scaleY)/2},set:function(t){this._scaleX=t,this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleX:{get:function(){return this._scaleX},set:function(t){this._scaleX=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},scaleY:{get:function(){return this._scaleY},set:function(t){this._scaleY=t,0===t?this.renderFlags&=-5:this.renderFlags|=4}},angle:{get:function(){return a(this._rotation*n.RAD_TO_DEG)},set:function(t){this.rotation=a(t)*n.DEG_TO_RAD}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=o(t)}},setPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=0),this.x=t,this.y=e,this.z=i,this.w=n,this},copyPosition:function(t){return void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.z&&(this.z=t.z),void 0!==t.w&&(this.w=t.w),this},setRandomPosition:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),this.x=t+Math.random()*i,this.y=e+Math.random()*n,this},setRotation:function(t){return void 0===t&&(t=0),this.rotation=t,this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,this},setScale:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.scaleX=t,this.scaleY=e,this},setX:function(t){return void 0===t&&(t=0),this.x=t,this},setY:function(t){return void 0===t&&(t=0),this.y=t,this},setZ:function(t){return void 0===t&&(t=0),this.z=t,this},setW:function(t){return void 0===t&&(t=0),this.w=t,this},getLocalTransformMatrix:function(t){return void 0===t&&(t=new r),t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY)},getWorldTransformMatrix:function(t,e){void 0===t&&(t=new r),void 0===e&&(e=new r);var i=this.parentContainer;if(!i)return this.getLocalTransformMatrix(t);for(t.applyITRS(this.x,this.y,this._rotation,this._scaleX,this._scaleY);i;)e.applyITRS(i.x,i.y,i._rotation,i._scaleX,i._scaleY),e.multiply(t,t),i=i.parentContainer;return t},getLocalPoint:function(t,e,i,n){i||(i=new h),n||(n=this.scene.sys.cameras.main);var r=n.scrollX,o=n.scrollY,a=t+r*this.scrollFactorX-r,l=e+o*this.scrollFactorY-o;return this.parentContainer?this.getWorldTransformMatrix().applyInverse(a,l,i):s(a,l,this.x,this.y,this.rotation,this.scaleX,this.scaleY,i),this._originComponent&&(i.x+=this._displayOriginX,i.y+=this._displayOriginY),i},getParentRotation:function(){for(var t=0,e=this.parentContainer;e;)t+=e.rotation,e=e.parentContainer;return t}};t.exports=l},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i={_visible:!0,visible:{get:function(){return this._visible},set:function(t){t?(this._visible=!0,this.renderFlags|=1):(this._visible=!1,this.renderFlags&=-2)}},setVisible:function(t){return this.visible=t,this}};t.exports=i},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={CHANGE_DATA:i(636),CHANGE_DATA_KEY:i(637),DESTROY:i(638),REMOVE_DATA:i(639),SET_DATA:i(640)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(128),r=i(4);t.exports=function(t,e,i,s){if(void 0===s&&(s=[]),!e&&!i)return s;e?i=Math.round(n(t)/e):e=n(t)/i;for(var o=t.x,a=t.y,h=0,l=0;l=t.right&&(h=1,a+=o-t.right,o=t.right);break;case 1:(a+=e)>=t.bottom&&(h=2,o-=a-t.bottom,a=t.bottom);break;case 2:(o-=e)<=t.left&&(h=3,a-=t.left-o,o=t.left);break;case 3:(a-=e)<=t.top&&(h=0,a=t.top)}return s}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=[]);var n=Math.round(t.x1),r=Math.round(t.y1),s=Math.round(t.x2),o=Math.round(t.y2),a=Math.abs(s-n),h=Math.abs(o-r),l=n-h&&(u-=h,n+=l),pe.length&&(s=e.length),i?(n=e[s-1][i],(r=e[s][i])-t<=t-n?e[s]:e[s-1]):(n=e[s-1],(r=e[s])-t<=t-n?r:n)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=new(i(0))({initialize:function(t,e,i,n,r){void 0===r&&(r=!1),this.textureKey=t,this.textureFrame=e,this.index=i,this.frame=n,this.isFirst=!1,this.isLast=!1,this.prevFrame=null,this.nextFrame=null,this.duration=0,this.progress=0,this.isKeyFrame=r},toJSON:function(){return{key:this.textureKey,frame:this.textureFrame,duration:this.duration,keyframe:this.isKeyFrame}},destroy:function(){this.frame=void 0}});t.exports=n},function(t,e){t.exports=function(t){var e=/\D/g;return t.sort((function(t,i){return parseInt(t.replace(e,""),10)-parseInt(i.replace(e,""),10)})),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(182),r=i(0),s=i(99),o=i(9),a=i(130),h=i(22),l=i(2),c=i(6),u=i(183),d=i(316),p=new r({Extends:o,initialize:function(t){o.call(this),this.game=t,this.textureManager=null,this.globalTimeScale=1,this.anims=new s,this.mixes=new s,this.paused=!1,this.name="AnimationManager",t.events.once(h.BOOT,this.boot,this)},boot:function(){this.textureManager=this.game.textures,this.game.events.once(h.DESTROY,this.destroy,this)},addMix:function(t,e,i){var n=this.anims,r=this.mixes,s="string"==typeof t?t:t.key,o="string"==typeof e?e:e.key;if(n.has(s)&&n.has(o)){var a=r.get(s);a||(a={}),a[o]=i,r.set(s,a)}return this},removeMix:function(t,e){var i=this.mixes,n="string"==typeof t?t:t.key,r=i.get(n);if(r)if(e){var s="string"==typeof e?e:e.key;r.hasOwnProperty(s)&&delete r[s]}else e||i.delete(n);return this},getMix:function(t,e){var i=this.mixes,n="string"==typeof t?t:t.key,r="string"==typeof e?e:e.key,s=i.get(n);return s&&s.hasOwnProperty(r)?s[r]:0},add:function(t,e){return this.anims.has(t)?(console.warn("Animation key exists: "+t),this):(e.key=t,this.anims.set(t,e),this.emit(a.ADD_ANIMATION,t,e),this)},exists:function(t){return this.anims.has(t)},createFromAseprite:function(t,e){var i=[],n=this.game.cache.json.get(t);if(!n)return i;var r=this,s=c(n,"meta",null),o=c(n,"frames",null);return s&&o&&c(s,"frameTags",[]).forEach((function(n){var s=[],a=l(n,"name",null),h=l(n,"from",0),c=l(n,"to",0),u=l(n,"direction","forward");if(a&&(!e||e&&e.indexOf(a)>-1)){for(var d=[],p=Number.MAX_SAFE_INTEGER,f=h;f<=c;f++){var m=f.toString(),g=o[m];if(g){var v=l(g,"duration",Number.MAX_SAFE_INTEGER);v=e;r--)o?s.push(i+r.toString()+n):s.push(r);else for(r=t;r<=e;r++)o?s.push(i+r.toString()+n):s.push(r);return s}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(99),s=i(9),o=i(318),a=new n({initialize:function(){this.entries=new r,this.events=new s},add:function(t,e){return this.entries.set(t,e),this.events.emit(o.ADD,this,t,e),this},has:function(t){return this.entries.has(t)},exists:function(t){return this.entries.has(t)},get:function(t){return this.entries.get(t)},remove:function(t){var e=this.get(t);return e&&(this.entries.delete(t),this.events.emit(o.REMOVE,this,t,e.data)),this},getKeys:function(){return this.entries.keys()},destroy:function(){this.entries.clear(),this.events.removeAllListeners(),this.entries=null,this.events=null}});t.exports=a},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={ADD:i(712),REMOVE:i(713)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(317),r=i(0),s=i(22),o=new r({initialize:function(t){this.game=t,this.binary=new n,this.bitmapFont=new n,this.json=new n,this.physics=new n,this.shader=new n,this.audio=new n,this.video=new n,this.text=new n,this.html=new n,this.obj=new n,this.tilemap=new n,this.xml=new n,this.custom={},this.game.events.once(s.DESTROY,this.destroy,this)},addCustom:function(t){return this.custom.hasOwnProperty(t)||(this.custom[t]=new n),this.custom[t]},destroy:function(){for(var t=["binary","bitmapFont","json","physics","shader","audio","video","text","html","obj","tilemap","xml"],e=0;e * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(131),r=i(187),s=i(18),o=i(0),a=i(11),h=i(327),l=i(36),c=i(133),u=i(10),d=i(3),p=new o({Extends:n,Mixins:[a.Flip,a.Tint,a.Pipeline],initialize:function(t,e,i,r){n.call(this,t,e,i,r),this.postPipelines=[],this.pipelineData={},this.inputEnabled=!0,this.fadeEffect=new h.Fade(this),this.flashEffect=new h.Flash(this),this.shakeEffect=new h.Shake(this),this.panEffect=new h.Pan(this),this.rotateToEffect=new h.RotateTo(this),this.zoomEffect=new h.Zoom(this),this.lerp=new d(1,1),this.followOffset=new d,this.deadzone=null,this._follow=null},setDeadzone:function(t,e){if(void 0===t)this.deadzone=null;else{if(this.deadzone?(this.deadzone.width=t,this.deadzone.height=e):this.deadzone=new u(0,0,t,e),this._follow){var i=this.width/2,n=this.height/2,s=this._follow.x-this.followOffset.x,o=this._follow.y-this.followOffset.y;this.midPoint.set(s,o),this.scrollX=s-i,this.scrollY=o-n}r(this.deadzone,this.midPoint.x,this.midPoint.y)}return this},fadeIn:function(t,e,i,n,r,s){return this.fadeEffect.start(!1,t,e,i,n,!0,r,s)},fadeOut:function(t,e,i,n,r,s){return this.fadeEffect.start(!0,t,e,i,n,!0,r,s)},fadeFrom:function(t,e,i,n,r,s,o){return this.fadeEffect.start(!1,t,e,i,n,r,s,o)},fade:function(t,e,i,n,r,s,o){return this.fadeEffect.start(!0,t,e,i,n,r,s,o)},flash:function(t,e,i,n,r,s,o){return this.flashEffect.start(t,e,i,n,r,s,o)},shake:function(t,e,i,n,r){return this.shakeEffect.start(t,e,i,n,r)},pan:function(t,e,i,n,r,s,o){return this.panEffect.start(t,e,i,n,r,s,o)},rotateTo:function(t,e,i,n,r,s,o){return this.rotateToEffect.start(t,e,i,n,r,s,o)},zoomTo:function(t,e,i,n,r,s){return this.zoomEffect.start(t,e,i,n,r,s)},preRender:function(){this.renderList.length=0;var t=this.width,e=this.height,i=.5*t,n=.5*e,s=this.zoom,o=this.matrix,a=t*this.originX,h=e*this.originY,u=this._follow,d=this.deadzone,p=this.scrollX,f=this.scrollY;d&&r(d,this.midPoint.x,this.midPoint.y);var m=!1;if(u&&!this.panEffect.isRunning){var g=u.x-this.followOffset.x,v=u.y-this.followOffset.y;d?(gd.right&&(p=c(p,p+(g-d.right),this.lerp.x)),vd.bottom&&(f=c(f,f+(v-d.bottom),this.lerp.y))):(p=c(p,g-a,this.lerp.x),f=c(f,v-h,this.lerp.y)),m=!0}this.useBounds&&(p=this.clampX(p),f=this.clampY(f)),this.roundPixels&&(a=Math.round(a),h=Math.round(h),p=Math.round(p),f=Math.round(f)),this.scrollX=p,this.scrollY=f;var y=p+i,x=f+n;this.midPoint.set(y,x);var b=t/s,w=e/s,T=y-b/2,_=x-w/2;this.roundPixels&&(T=Math.round(T),_=Math.round(_)),this.worldView.setTo(T,_,b,w),o.applyITRS(this.x+a,this.y+h,this.rotation,s,s),o.translate(-a,-h),this.shakeEffect.preRender(),m&&this.emit(l.FOLLOW_UPDATE,this,u)},setLerp:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=t),this.lerp.set(t,e),this},setFollowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=0),this.followOffset.set(t,e),this},startFollow:function(t,e,i,n,r,o){void 0===e&&(e=!1),void 0===i&&(i=1),void 0===n&&(n=i),void 0===r&&(r=0),void 0===o&&(o=r),this._follow=t,this.roundPixels=e,i=s(i,0,1),n=s(n,0,1),this.lerp.set(i,n),this.followOffset.set(r,o);var a=this.width/2,h=this.height/2,l=t.x-r,c=t.y-o;return this.midPoint.set(l,c),this.scrollX=l-a,this.scrollY=c-h,this.useBounds&&(this.scrollX=this.clampX(this.scrollX),this.scrollY=this.clampY(this.scrollY)),this},stopFollow:function(){return this._follow=null,this},resetFX:function(){return this.rotateToEffect.reset(),this.panEffect.reset(),this.shakeEffect.reset(),this.flashEffect.reset(),this.fadeEffect.reset(),this},update:function(t,e){this.visible&&(this.rotateToEffect.update(t,e),this.panEffect.update(t,e),this.zoomEffect.update(t,e),this.shakeEffect.update(t,e),this.flashEffect.update(t,e),this.fadeEffect.update(t,e))},destroy:function(){this.resetFX(),n.prototype.destroy.call(this),this._follow=null,this.deadzone=null}});t.exports=p},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(37);t.exports=function(t){var e=new n;t=t.replace(/^(?:#|0x)?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,i,n){return e+e+i+i+n+n}));var i=/^(?:#|0x)?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);if(i){var r=parseInt(i[1],16),s=parseInt(i[2],16),o=parseInt(i[3],16);e.setTo(r,s,o)}return e}},function(t,e){t.exports=function(t,e,i,n){return n<<24|t<<16|e<<8|i}},function(t,e){t.exports=function(t,e,i,n){void 0===n&&(n={h:0,s:0,v:0}),t/=255,e/=255,i/=255;var r=Math.min(t,e,i),s=Math.max(t,e,i),o=s-r,a=0,h=0===s?0:o/s,l=s;return s!==r&&(s===t?a=(e-i)/o+(e16777215?{a:t>>>24,r:t>>16&255,g:t>>8&255,b:255&t}:{a:255,r:t>>16&255,g:t>>8&255,b:255&t}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(37);t.exports=function(t){return new n(t.r,t.g,t.b,t.a)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(37);t.exports=function(t){var e=new n,i=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?))?\s*\)$/.exec(t.toLowerCase());if(i){var r=parseInt(i[1],10),s=parseInt(i[2],10),o=parseInt(i[3],10),a=void 0!==i[4]?parseFloat(i[4]):1;e.setTo(r,s,o,255*a)}return e}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Fade:i(737),Flash:i(738),Pan:i(739),Shake:i(772),RotateTo:i(773),Zoom:i(774)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={In:i(740),Out:i(741),InOut:i(742)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={In:i(743),Out:i(744),InOut:i(745)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={In:i(746),Out:i(747),InOut:i(748)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={In:i(749),Out:i(750),InOut:i(751)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={In:i(752),Out:i(753),InOut:i(754)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={In:i(755),Out:i(756),InOut:i(757)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports=i(758)},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={In:i(759),Out:i(760),InOut:i(761)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={In:i(762),Out:i(763),InOut:i(764)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={In:i(765),Out:i(766),InOut:i(767)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={In:i(768),Out:i(769),InOut:i(770)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports=i(771)},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(32),s=i(341),o=i(2),a=i(6),h=i(7),l=i(190),c=i(1),u=i(194),d=i(184),p=new n({initialize:function(t){void 0===t&&(t={}),this.width=a(t,"width",1024),this.height=a(t,"height",768),this.zoom=a(t,"zoom",1),this.parent=a(t,"parent",void 0),this.scaleMode=a(t,"scaleMode",0),this.expandParent=a(t,"expandParent",!0),this.autoRound=a(t,"autoRound",!1),this.autoCenter=a(t,"autoCenter",0),this.resizeInterval=a(t,"resizeInterval",500),this.fullscreenTarget=a(t,"fullscreenTarget",null),this.minWidth=a(t,"minWidth",0),this.maxWidth=a(t,"maxWidth",0),this.minHeight=a(t,"minHeight",0),this.maxHeight=a(t,"maxHeight",0);var e=a(t,"scale",null);e&&(this.width=a(e,"width",this.width),this.height=a(e,"height",this.height),this.zoom=a(e,"zoom",this.zoom),this.parent=a(e,"parent",this.parent),this.scaleMode=a(e,"mode",this.scaleMode),this.expandParent=a(e,"expandParent",this.expandParent),this.autoRound=a(e,"autoRound",this.autoRound),this.autoCenter=a(e,"autoCenter",this.autoCenter),this.resizeInterval=a(e,"resizeInterval",this.resizeInterval),this.fullscreenTarget=a(e,"fullscreenTarget",this.fullscreenTarget),this.minWidth=a(e,"min.width",this.minWidth),this.maxWidth=a(e,"max.width",this.maxWidth),this.minHeight=a(e,"min.height",this.minHeight),this.maxHeight=a(e,"max.height",this.maxHeight)),this.renderType=a(t,"type",r.AUTO),this.canvas=a(t,"canvas",null),this.context=a(t,"context",null),this.canvasStyle=a(t,"canvasStyle",null),this.customEnvironment=a(t,"customEnvironment",!1),this.sceneConfig=a(t,"scene",null),this.seed=a(t,"seed",[(Date.now()*Math.random()).toString()]),l.RND=new l.RandomDataGenerator(this.seed),this.gameTitle=a(t,"title",""),this.gameURL=a(t,"url","https://phaser.io"),this.gameVersion=a(t,"version",""),this.autoFocus=a(t,"autoFocus",!0),this.domCreateContainer=a(t,"dom.createContainer",!1),this.domBehindCanvas=a(t,"dom.behindCanvas",!1),this.inputKeyboard=a(t,"input.keyboard",!0),this.inputKeyboardEventTarget=a(t,"input.keyboard.target",window),this.inputKeyboardCapture=a(t,"input.keyboard.capture",[]),this.inputMouse=a(t,"input.mouse",!0),this.inputMouseEventTarget=a(t,"input.mouse.target",null),this.inputMousePreventDefaultDown=a(t,"input.mouse.preventDefaultDown",!0),this.inputMousePreventDefaultUp=a(t,"input.mouse.preventDefaultUp",!0),this.inputMousePreventDefaultMove=a(t,"input.mouse.preventDefaultMove",!0),this.inputMousePreventDefaultWheel=a(t,"input.mouse.preventDefaultWheel",!0),this.inputTouch=a(t,"input.touch",s.input.touch),this.inputTouchEventTarget=a(t,"input.touch.target",null),this.inputTouchCapture=a(t,"input.touch.capture",!0),this.inputActivePointers=a(t,"input.activePointers",1),this.inputSmoothFactor=a(t,"input.smoothFactor",0),this.inputWindowEvents=a(t,"input.windowEvents",!0),this.inputGamepad=a(t,"input.gamepad",!1),this.inputGamepadEventTarget=a(t,"input.gamepad.target",window),this.disableContextMenu=a(t,"disableContextMenu",!1),this.audio=a(t,"audio",{}),this.hideBanner=!1===a(t,"banner",null),this.hidePhaser=a(t,"banner.hidePhaser",!1),this.bannerTextColor=a(t,"banner.text","#ffffff"),this.bannerBackgroundColor=a(t,"banner.background",["#ff0000","#ffff00","#00ff00","#00ffff","#000000"]),""===this.gameTitle&&this.hidePhaser&&(this.hideBanner=!0),this.fps=a(t,"fps",null);var i=a(t,"render",t);this.pipeline=a(i,"pipeline",null),this.antialias=a(i,"antialias",!0),this.antialiasGL=a(i,"antialiasGL",!0),this.mipmapFilter=a(i,"mipmapFilter","LINEAR"),this.desynchronized=a(i,"desynchronized",!1),this.roundPixels=a(i,"roundPixels",!1),this.pixelArt=a(i,"pixelArt",1!==this.zoom),this.pixelArt&&(this.antialias=!1,this.antialiasGL=!1,this.roundPixels=!0),this.transparent=a(i,"transparent",!1),this.clearBeforeRender=a(i,"clearBeforeRender",!0),this.premultipliedAlpha=a(i,"premultipliedAlpha",!0),this.failIfMajorPerformanceCaveat=a(i,"failIfMajorPerformanceCaveat",!1),this.powerPreference=a(i,"powerPreference","default"),this.batchSize=a(i,"batchSize",4096),this.maxTextures=a(i,"maxTextures",-1),this.maxLights=a(i,"maxLights",10);var n=a(t,"backgroundColor",0);this.backgroundColor=d(n),this.transparent&&(this.backgroundColor=d(0),this.backgroundColor.alpha=0),this.preBoot=a(t,"callbacks.preBoot",c),this.postBoot=a(t,"callbacks.postBoot",c),this.physics=a(t,"physics",{}),this.defaultPhysicsSystem=a(this.physics,"default",!1),this.loaderBaseURL=a(t,"loader.baseURL",""),this.loaderPath=a(t,"loader.path","");var p=s.os.android?6:32;this.loaderMaxParallelDownloads=a(t,"loader.maxParallelDownloads",p),this.loaderCrossOrigin=a(t,"loader.crossOrigin",void 0),this.loaderResponseType=a(t,"loader.responseType",""),this.loaderAsync=a(t,"loader.async",!0),this.loaderUser=a(t,"loader.user",""),this.loaderPassword=a(t,"loader.password",""),this.loaderTimeout=a(t,"loader.timeout",0),this.loaderWithCredentials=a(t,"loader.withCredentials",!1),this.installGlobalPlugins=[],this.installScenePlugins=[];var f=a(t,"plugins",null),m=u.DefaultScene;f&&(Array.isArray(f)?this.defaultPlugins=f:h(f)&&(this.installGlobalPlugins=o(f,"global",[]),this.installScenePlugins=o(f,"scene",[]),Array.isArray(f.default)?m=f.default:Array.isArray(f.defaultMerge)&&(m=m.concat(f.defaultMerge)))),this.defaultPlugins=m;var g="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAg";this.defaultImage=a(t,"images.default",g+"AQMAAABJtOi3AAAAA1BMVEX///+nxBvIAAAAAXRSTlMAQObYZgAAABVJREFUeF7NwIEAAAAAgKD9qdeocAMAoAABm3DkcAAAAABJRU5ErkJggg=="),this.missingImage=a(t,"images.missing",g+"CAIAAAD8GO2jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAJ9JREFUeNq01ssOwyAMRFG46v//Mt1ESmgh+DFmE2GPOBARKb2NVjo+17PXLD8a1+pl5+A+wSgFygymWYHBb0FtsKhJDdZlncG2IzJ4ayoMDv20wTmSMzClEgbWYNTAkQ0Z+OJ+A/eWnAaR9+oxCF4Os0H8htsMUp+pwcgBBiMNnAwF8GqIgL2hAzaGFFgZauDPKABmowZ4GL369/0rwACp2yA/ttmvsQAAAABJRU5ErkJggg=="),this.whiteImage=a(t,"images.white","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAIAAAAmkwkpAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABdJREFUeNpi/P//PwMMMDEgAdwcgAADAJZuAwXJYZOzAAAAAElFTkSuQmCC"),window&&(window.FORCE_WEBGL?this.renderType=r.WEBGL:window.FORCE_CANVAS&&(this.renderType=r.CANVAS))}});t.exports=p},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={os:i(102),browser:i(134),features:i(188),input:i(805),audio:i(806),video:i(807),fullscreen:i(808),canvasFeatures:i(342)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n,r,s,o=i(31),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=(void 0!==document&&(a.supportNewBlendModes=(n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAABAQMAAADD8p2OAAAAA1BMVEX/",r="AAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==",(s=new Image).onload=function(){var t=new Image;t.onload=function(){var e=o.create(t,6,1).getContext("2d");if(e.globalCompositeOperation="multiply",e.drawImage(s,0,0),e.drawImage(t,2,0),!e.getImageData(2,0,1,1))return!1;var i=e.getImageData(2,0,1,1).data;o.remove(t),a.supportNewBlendModes=255===i[0]&&0===i[1]&&0===i[2]},t.src=n+"/wCKxvRF"+r},s.src=n+"AP804Oa6"+r,!1),a.supportInverseAlpha=function(){var t=o.create(this,2,1).getContext("2d");t.fillStyle="rgba(10, 20, 30, 0.5)",t.fillRect(0,0,1,1);var e=t.getImageData(0,0,1,1);if(null===e)return!1;t.putImageData(e,1,0);var i=t.getImageData(1,0,1,1);return i.data[0]===e.data[0]&&i.data[1]===e.data[1]&&i.data[2]===e.data[2]&&i.data[3]===e.data[3]}()),a)},function(t,e){t.exports=function(t,e,i,n){return Math.atan2(n-e,i-t)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}},function(t,e){t.exports=function(t){return(t%=2*Math.PI)>=0?t:t+2*Math.PI}},function(t,e){t.exports=function(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)}},function(t,e){t.exports=function(t,e,i,n){var r=t-i,s=e-n;return r*r+s*s}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t>e-i}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),t * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(351);t.exports=function(t,e){return n(t)/n(e)/n(t-e)}},function(t,e){t.exports=function(t){if(0===t)return 1;for(var e=t;--t;)e*=t;return e}},function(t,e){t.exports=function(t,e,i,n,r){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ return function(t,e){var i=1-t;return i*i*i*e}(t,e)+function(t,e){var i=1-t;return 3*i*i*t*e}(t,i)+function(t,e){return 3*(1-t)*t*t*e}(t,n)+function(t,e){return t*t*t*e}(t,r)}},function(t,e){t.exports=function(t,e,i,n){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ return function(t,e){var i=1-t;return i*i*e}(t,e)+function(t,e){return 2*(1-t)*t*e}(t,i)+function(t,e){return t*t*e}(t,n)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(181);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e){t.exports=function(t){var e=Math.log(t)/.6931471805599453;return 1<0?Math.ceil(t):Math.floor(t)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=new(i(0))({initialize:function(t){this.val=new Float32Array(9),t?this.copy(t):this.identity()},clone:function(){return new n(this)},set:function(t){return this.copy(t)},copy:function(t){var e=this.val,i=t.val;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},fromMat4:function(t){var e=t.val,i=this.val;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[4],i[4]=e[5],i[5]=e[6],i[6]=e[8],i[7]=e[9],i[8]=e[10],this},fromArray:function(t){var e=this.val;return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],this},identity:function(){var t=this.val;return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=1,t[5]=0,t[6]=0,t[7]=0,t[8]=1,this},transpose:function(){var t=this.val,e=t[1],i=t[2],n=t[5];return t[1]=t[3],t[2]=t[6],t[3]=e,t[5]=t[7],t[6]=i,t[7]=n,this},invert:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8],c=l*s-o*h,u=-l*r+o*a,d=h*r-s*a,p=e*c+i*u+n*d;return p?(p=1/p,t[0]=c*p,t[1]=(-l*i+n*h)*p,t[2]=(o*i-n*s)*p,t[3]=u*p,t[4]=(l*e-n*a)*p,t[5]=(-o*e+n*r)*p,t[6]=d*p,t[7]=(-h*e+i*a)*p,t[8]=(s*e-i*r)*p,this):null},adjoint:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return t[0]=s*l-o*h,t[1]=n*h-i*l,t[2]=i*o-n*s,t[3]=o*a-r*l,t[4]=e*l-n*a,t[5]=n*r-e*o,t[6]=r*h-s*a,t[7]=i*a-e*h,t[8]=e*s-i*r,this},determinant:function(){var t=this.val,e=t[0],i=t[1],n=t[2],r=t[3],s=t[4],o=t[5],a=t[6],h=t[7],l=t[8];return e*(l*s-o*h)+i*(-l*r+o*a)+n*(h*r-s*a)},multiply:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],h=e[6],l=e[7],c=e[8],u=t.val,d=u[0],p=u[1],f=u[2],m=u[3],g=u[4],v=u[5],y=u[6],x=u[7],b=u[8];return e[0]=d*i+p*s+f*h,e[1]=d*n+p*o+f*l,e[2]=d*r+p*a+f*c,e[3]=m*i+g*s+v*h,e[4]=m*n+g*o+v*l,e[5]=m*r+g*a+v*c,e[6]=y*i+x*s+b*h,e[7]=y*n+x*o+b*l,e[8]=y*r+x*a+b*c,this},translate:function(t){var e=this.val,i=t.x,n=t.y;return e[6]=i*e[0]+n*e[3]+e[6],e[7]=i*e[1]+n*e[4]+e[7],e[8]=i*e[2]+n*e[5]+e[8],this},rotate:function(t){var e=this.val,i=e[0],n=e[1],r=e[2],s=e[3],o=e[4],a=e[5],h=Math.sin(t),l=Math.cos(t);return e[0]=l*i+h*s,e[1]=l*n+h*o,e[2]=l*r+h*a,e[3]=l*s-h*i,e[4]=l*o-h*n,e[5]=l*a-h*r,this},scale:function(t){var e=this.val,i=t.x,n=t.y;return e[0]=i*e[0],e[1]=i*e[1],e[2]=i*e[2],e[3]=n*e[3],e[4]=n*e[4],e[5]=n*e[5],this},fromQuat:function(t){var e=t.x,i=t.y,n=t.z,r=t.w,s=e+e,o=i+i,a=n+n,h=e*s,l=e*o,c=e*a,u=i*o,d=i*a,p=n*a,f=r*s,m=r*o,g=r*a,v=this.val;return v[0]=1-(u+p),v[3]=l+g,v[6]=c-m,v[1]=l-g,v[4]=1-(h+p),v[7]=d+f,v[2]=c+m,v[5]=d-f,v[8]=1-(h+u),this},normalFromMat4:function(t){var e=t.val,i=this.val,n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],h=e[5],l=e[6],c=e[7],u=e[8],d=e[9],p=e[10],f=e[11],m=e[12],g=e[13],v=e[14],y=e[15],x=n*h-r*a,b=n*l-s*a,w=n*c-o*a,T=r*l-s*h,_=r*c-o*h,E=s*c-o*l,S=u*g-d*m,M=u*v-p*m,A=u*y-f*m,C=d*v-p*g,P=d*y-f*g,R=p*y-f*v,L=x*R-b*P+w*C+T*A-_*M+E*S;return L?(L=1/L,i[0]=(h*R-l*P+c*C)*L,i[1]=(l*A-a*R-c*M)*L,i[2]=(a*P-h*A+c*S)*L,i[3]=(s*P-r*R-o*C)*L,i[4]=(n*R-s*A+o*M)*L,i[5]=(r*A-n*P-o*S)*L,i[6]=(g*E-v*_+y*T)*L,i[7]=(v*w-m*E-y*b)*L,i[8]=(m*_-g*w+y*x)*L,this):null}});t.exports=n},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(358),s=i(1),o=i(38),a=new Int8Array([1,2,0]),h=new Float32Array([0,0,0]),l=new o(1,0,0),c=new o(0,1,0),u=new o,d=new r,p=new n({initialize:function(t,e,i,n){this.onChangeCallback=s,this.set(t,e,i,n)},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback(this)}},copy:function(t){return this.set(t)},set:function(t,e,i,n,r){return void 0===r&&(r=!0),"object"==typeof t?(this._x=t.x||0,this._y=t.y||0,this._z=t.z||0,this._w=t.w||0):(this._x=t||0,this._y=e||0,this._z=i||0,this._w=n||0),r&&this.onChangeCallback(this),this},add:function(t){return this._x+=t.x,this._y+=t.y,this._z+=t.z,this._w+=t.w,this.onChangeCallback(this),this},subtract:function(t){return this._x-=t.x,this._y-=t.y,this._z-=t.z,this._w-=t.w,this.onChangeCallback(this),this},scale:function(t){return this._x*=t,this._y*=t,this._z*=t,this._w*=t,this.onChangeCallback(this),this},length:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return Math.sqrt(t*t+e*e+i*i+n*n)},lengthSq:function(){var t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},normalize:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n;return r>0&&(r=1/Math.sqrt(r),this._x=t*r,this._y=e*r,this._z=i*r,this._w=n*r),this.onChangeCallback(this),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lerp:function(t,e){void 0===e&&(e=0);var i=this.x,n=this.y,r=this.z,s=this.w;return this.set(i+e*(t.x-i),n+e*(t.y-n),r+e*(t.z-r),s+e*(t.w-s))},rotationTo:function(t,e){var i=t.x*e.x+t.y*e.y+t.z*e.z;return i<-.999999?(u.copy(l).cross(t).length()<1e-6&&u.copy(c).cross(t),u.normalize(),this.setAxisAngle(u,Math.PI)):i>.999999?this.set(0,0,0,1):(u.copy(t).cross(e),this._x=u.x,this._y=u.y,this._z=u.z,this._w=1+i,this.normalize())},setAxes:function(t,e,i){var n=d.val;return n[0]=e.x,n[3]=e.y,n[6]=e.z,n[1]=i.x,n[4]=i.y,n[7]=i.z,n[2]=-t.x,n[5]=-t.y,n[8]=-t.z,this.fromMat3(d).normalize()},identity:function(){return this.set(0,0,0,1)},setAxisAngle:function(t,e){e*=.5;var i=Math.sin(e);return this.set(i*t.x,i*t.y,i*t.z,Math.cos(e))},multiply:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,s=t.x,o=t.y,a=t.z,h=t.w;return this.set(e*h+r*s+i*a-n*o,i*h+r*o+n*s-e*a,n*h+r*a+e*o-i*s,r*h-e*s-i*o-n*a)},slerp:function(t,e){var i=this.x,n=this.y,r=this.z,s=this.w,o=t.x,a=t.y,h=t.z,l=t.w,c=i*o+n*a+r*h+s*l;c<0&&(c=-c,o=-o,a=-a,h=-h,l=-l);var u=1-e,d=e;if(1-c>1e-6){var p=Math.acos(c),f=Math.sin(p);u=Math.sin((1-e)*p)/f,d=Math.sin(e*p)/f}return this.set(u*i+d*o,u*n+d*a,u*r+d*h,u*s+d*l)},invert:function(){var t=this.x,e=this.y,i=this.z,n=this.w,r=t*t+e*e+i*i+n*n,s=r?1/r:0;return this.set(-t*s,-e*s,-i*s,n*s)},conjugate:function(){return this._x=-this.x,this._y=-this.y,this._z=-this.z,this.onChangeCallback(this),this},rotateX:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),o=Math.cos(t);return this.set(e*o+r*s,i*o+n*s,n*o-i*s,r*o-e*s)},rotateY:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),o=Math.cos(t);return this.set(e*o-n*s,i*o+r*s,n*o+e*s,r*o-i*s)},rotateZ:function(t){t*=.5;var e=this.x,i=this.y,n=this.z,r=this.w,s=Math.sin(t),o=Math.cos(t);return this.set(e*o+i*s,i*o-e*s,n*o+r*s,r*o-n*s)},calculateW:function(){var t=this.x,e=this.y,i=this.z;return this.w=-Math.sqrt(1-t*t-e*e-i*i),this},setFromEuler:function(t,e){var i=t.x/2,n=t.y/2,r=t.z/2,s=Math.cos(i),o=Math.cos(n),a=Math.cos(r),h=Math.sin(i),l=Math.sin(n),c=Math.sin(r);switch(t.order){case"XYZ":this.set(h*o*a+s*l*c,s*l*a-h*o*c,s*o*c+h*l*a,s*o*a-h*l*c,e);break;case"YXZ":this.set(h*o*a+s*l*c,s*l*a-h*o*c,s*o*c-h*l*a,s*o*a+h*l*c,e);break;case"ZXY":this.set(h*o*a-s*l*c,s*l*a+h*o*c,s*o*c+h*l*a,s*o*a-h*l*c,e);break;case"ZYX":this.set(h*o*a-s*l*c,s*l*a+h*o*c,s*o*c-h*l*a,s*o*a+h*l*c,e);break;case"YZX":this.set(h*o*a+s*l*c,s*l*a+h*o*c,s*o*c-h*l*a,s*o*a-h*l*c,e);break;case"XZY":this.set(h*o*a-s*l*c,s*l*a-h*o*c,s*o*c+h*l*a,s*o*a+h*l*c,e)}return this},setFromRotationMatrix:function(t){var e,i=t.val,n=i[0],r=i[4],s=i[8],o=i[1],a=i[5],h=i[9],l=i[2],c=i[6],u=i[10],d=n+a+u;return d>0?(e=.5/Math.sqrt(d+1),this.set((c-h)*e,(s-l)*e,(o-r)*e,.25/e)):n>a&&n>u?(e=2*Math.sqrt(1+n-a-u),this.set(.25*e,(r+o)/e,(s+l)/e,(c-h)/e)):a>u?(e=2*Math.sqrt(1+a-n-u),this.set((r+o)/e,.25*e,(h+c)/e,(s-l)/e)):(e=2*Math.sqrt(1+u-n-a),this.set((s+l)/e,(h+c)/e,.25*e,(o-r)/e)),this},fromMat3:function(t){var e,i=t.val,n=i[0]+i[4]+i[8];if(n>0)e=Math.sqrt(n+1),this.w=.5*e,e=.5/e,this._x=(i[7]-i[5])*e,this._y=(i[2]-i[6])*e,this._z=(i[3]-i[1])*e;else{var r=0;i[4]>i[0]&&(r=1),i[8]>i[3*r+r]&&(r=2);var s=a[r],o=a[s];e=Math.sqrt(i[3*r+r]-i[3*s+s]-i[3*o+o]+1),h[r]=.5*e,e=.5/e,h[s]=(i[3*s+r]+i[3*r+s])*e,h[o]=(i[3*o+r]+i[3*r+o])*e,this._x=h[0],this._y=h[1],this._z=h[2],this._w=(i[3*o+s]-i[3*s+o])*e}return this.onChangeCallback(this),this}});t.exports=p},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(361),r=i(31),s=i(32),o=i(188);t.exports=function(t){var e=t.config;if((e.customEnvironment||e.canvas)&&e.renderType===s.AUTO)throw new Error("Must set explicit renderType in custom environment");if(!e.customEnvironment&&!e.canvas&&e.renderType!==s.HEADLESS)if(e.renderType===s.CANVAS||e.renderType!==s.CANVAS&&!o.webGL){if(!o.canvas)throw new Error("Cannot create Canvas or WebGL context, aborting.");e.renderType=s.CANVAS}else e.renderType=s.WEBGL;e.antialias||r.disableSmoothing();var a,h,l=t.scale.baseSize,c=l.width,u=l.height;e.canvas?(t.canvas=e.canvas,t.canvas.width=c,t.canvas.height=u):t.canvas=r.create(t,c,u,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||n.setCrisp(t.canvas),e.renderType!==s.HEADLESS&&(a=i(362),h=i(365),e.renderType===s.WEBGL?t.renderer=new h(t):(t.renderer=new a(t),t.context=t.renderer.gameContext))}},function(t,e){t.exports={setCrisp:function(t){return["optimizeSpeed","-moz-crisp-edges","-o-crisp-edges","-webkit-optimize-contrast","optimize-contrast","crisp-edges","pixelated"].forEach((function(e){t.style["image-rendering"]=e})),t.style.msInterpolationMode="nearest-neighbor",t},setBicubic:function(t){return t.style["image-rendering"]="auto",t.style.msInterpolationMode="bicubic",t}}},function(t,e,i){ /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(36),r=i(363),s=i(0),o=i(32),a=i(9),h=i(88),l=i(364),c=i(101),u=i(103),d=i(25),p=new s({Extends:a,initialize:function(t){a.call(this);var e=t.config;this.config={clearBeforeRender:e.clearBeforeRender,backgroundColor:e.backgroundColor,antialias:e.antialias,roundPixels:e.roundPixels},this.game=t,this.type=o.CANVAS,this.drawCount=0,this.width=0,this.height=0,this.gameCanvas=t.canvas;var i={alpha:t.config.transparent,desynchronized:t.config.desynchronized};this.gameContext=e.context?e.context:this.gameCanvas.getContext("2d",i),this.currentContext=this.gameContext,this.antialias=t.config.antialias,this.blendModes=l(),this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92},this._tempMatrix1=new d,this._tempMatrix2=new d,this._tempMatrix3=new d,this.isBooted=!1,this.init()},init:function(){this.game.textures.once(u.READY,this.boot,this)},boot:function(){var t=this.game,e=t.scale.baseSize;this.width=e.width,this.height=e.height,this.isBooted=!0,t.scale.on(c.RESIZE,this.onResize,this),this.resize(e.width,e.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},resize:function(t,e){this.width=t,this.height=e,this.emit(h.RESIZE,t,e)},resetTransform:function(){this.currentContext.setTransform(1,0,0,1,0,0)},setBlendMode:function(t){return this.currentContext.globalCompositeOperation=t,this},setContext:function(t){return this.currentContext=t||this.gameContext,this},setAlpha:function(t){return this.currentContext.globalAlpha=t,this},preRender:function(){var t=this.gameContext,e=this.config,i=this.width,n=this.height;t.globalAlpha=1,t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0),e.clearBeforeRender&&t.clearRect(0,0,i,n),e.transparent||(t.fillStyle=e.backgroundColor.rgba,t.fillRect(0,0,i,n)),t.save(),this.drawCount=0,this.emit(h.PRE_RENDER)},render:function(t,e,i){var r=e.length;this.emit(h.RENDER,t,i);var s=i.x,o=i.y,a=i.width,l=i.height,c=i.renderToTexture?i.context:t.sys.context;c.save(),this.game.scene.customViewports&&(c.beginPath(),c.rect(s,o,a,l),c.clip()),this.currentContext=c;var u=i.mask;u&&u.preRenderCanvas(this,null,i._maskCamera),i.transparent||(c.fillStyle=i.backgroundColor.rgba,c.fillRect(s,o,a,l)),c.globalAlpha=i.alpha,c.globalCompositeOperation="source-over",this.drawCount+=r,i.renderToTexture&&i.emit(n.PRE_RENDER,i),i.matrix.copyToContext(c);for(var d=0;d=0?v=-(v+u):v<0&&(v=Math.abs(v)-u)),t.flipY&&(y>=0?y=-(y+d):y<0&&(y=Math.abs(y)-d))}var b=1,w=1;t.flipX&&(p||(v+=-e.realWidth+2*m),b=-1),t.flipY&&(p||(y+=-e.realHeight+2*g),w=-1),a.applyITRS(t.x,t.y,t.rotation,t.scaleX*b,t.scaleY*w),o.copyFrom(i.matrix),n?(o.multiplyWithOffset(n,-i.scrollX*t.scrollFactorX,-i.scrollY*t.scrollFactorY),a.e=t.x,a.f=t.y):(a.e-=i.scrollX*t.scrollFactorX,a.f-=i.scrollY*t.scrollFactorY),o.multiply(a),s.save(),o.setToContext(s),s.globalCompositeOperation=this.blendModes[t.blendMode],s.globalAlpha=r,s.imageSmoothingEnabled=!(!this.antialias||e.source.scaleMode),t.mask&&t.mask.preRenderCanvas(this,t,i),s.drawImage(e.source.image,l,c,u,d,v,y,u/f,d/f),t.mask&&t.mask.postRenderCanvas(this,t,i),s.restore()}},destroy:function(){this.removeAllListeners(),this.game=null,this.gameCanvas=null,this.gameContext=null}});t.exports=p},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(31),r=i(37),s=i(2);t.exports=function(t,e){var i=s(e,"callback"),o=s(e,"type","image/png"),a=s(e,"encoder",.92),h=Math.abs(Math.round(s(e,"x",0))),l=Math.abs(Math.round(s(e,"y",0))),c=s(e,"width",t.width),u=s(e,"height",t.height);if(s(e,"getPixel",!1)){var d=t.getContext("2d").getImageData(h,l,1,1).data;i.call(null,new r(d[0],d[1],d[2],d[3]/255))}else if(0!==h||0!==l||c!==t.width||u!==t.height){var p=n.createWebGL(this,c,u);p.getContext("2d").drawImage(t,h,l,c,u,0,0,c,u);var f=new Image;f.onerror=function(){i.call(null),n.remove(p)},f.onload=function(){i.call(null,f),n.remove(p)},f.src=p.toDataURL(o,a)}else{var m=new Image;m.onerror=function(){i.call(null)},m.onload=function(){i.call(null,m)},m.src=t.toDataURL(o,a)}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(34),r=i(342);t.exports=function(){var t=[],e=r.supportNewBlendModes,i="source-over";return t[n.NORMAL]=i,t[n.ADD]="lighter",t[n.MULTIPLY]=e?"multiply":i,t[n.SCREEN]=e?"screen":i,t[n.OVERLAY]=e?"overlay":i,t[n.DARKEN]=e?"darken":i,t[n.LIGHTEN]=e?"lighten":i,t[n.COLOR_DODGE]=e?"color-dodge":i,t[n.COLOR_BURN]=e?"color-burn":i,t[n.HARD_LIGHT]=e?"hard-light":i,t[n.SOFT_LIGHT]=e?"soft-light":i,t[n.DIFFERENCE]=e?"difference":i,t[n.EXCLUSION]=e?"exclusion":i,t[n.HUE]=e?"hue":i,t[n.SATURATION]=e?"saturation":i,t[n.COLOR]=e?"color":i,t[n.LUMINOSITY]=e?"luminosity":i,t[n.ERASE]="destination-out",t[n.SOURCE_IN]="source-in",t[n.SOURCE_OUT]="source-out",t[n.SOURCE_ATOP]="source-atop",t[n.DESTINATION_OVER]="destination-over",t[n.DESTINATION_IN]="destination-in",t[n.DESTINATION_OUT]="destination-out",t[n.DESTINATION_ATOP]="destination-atop",t[n.LIGHTER]="lighter",t[n.COPY]="copy",t[n.XOR]="xor",t}},function(t,e,i){ /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(89),r=i(36),s=i(0),o=i(32),a=i(9),h=i(88),l=i(22),c=i(136),u=i(67),d=i(1),p=i(366),f=i(139),m=i(101),g=i(103),v=i(12),y=i(377),x=new s({Extends:a,initialize:function(t){a.call(this);var e=t.config,i={alpha:e.transparent,desynchronized:e.desynchronized,depth:!1,antialias:e.antialiasGL,premultipliedAlpha:e.premultipliedAlpha,stencil:!0,failIfMajorPerformanceCaveat:e.failIfMajorPerformanceCaveat,powerPreference:e.powerPreference};this.config={clearBeforeRender:e.clearBeforeRender,antialias:e.antialias,backgroundColor:e.backgroundColor,contextCreation:i,roundPixels:e.roundPixels,maxTextures:e.maxTextures,maxTextureSize:e.maxTextureSize,batchSize:e.batchSize,maxLights:e.maxLights,mipmapFilter:e.mipmapFilter},this.game=t,this.type=o.WEBGL,this.pipelines=null,this.width=0,this.height=0,this.canvas=t.canvas,this.blendModes=[],this.contextLost=!1,this.snapshotState={x:0,y:0,width:1,height:1,getPixel:!1,callback:null,type:"image/png",encoder:.92,isFramebuffer:!1,bufferWidth:0,bufferHeight:0},this.currentActiveTexture=0,this.startActiveTexture=0,this.maxTextures=0,this.textureIndexes,this.tempTextures,this.textureZero,this.normalTexture,this.currentFramebuffer=null,this.fboStack=[],this.currentProgram=null,this.currentBlendMode=1/0,this.currentScissorEnabled=!1,this.currentScissor=null,this.scissorStack=[],this.contextLostHandler=d,this.contextRestoredHandler=d,this.gl=null,this.supportedExtensions=null,this.instancedArraysExtension=null,this.vaoExtension=null,this.extensions={},this.glFormats=[],this.compression={ETC1:!1,PVRTC:!1,S3TC:!1},this.drawingBufferHeight=0,this.blankTexture=null,this.whiteTexture=null,this.maskCount=0,this.maskStack=[],this.currentMask={mask:null,camera:null},this.currentCameraMask={mask:null,camera:null},this.glFuncMap=null,this.currentType="",this.newType=!1,this.nextTypeMatch=!1,this.finalType=!1,this.mipmapFilter=null,this.textureFlush=0,this.isTextureClean=!1,this.defaultScissor=[0,0,0,0],this.isBooted=!1,this.renderTarget=null,this.projectionMatrix,this.projectionWidth=0,this.projectionHeight=0,this.init(this.config)},init:function(t){var e,i=this.game,n=this.canvas,r=t.backgroundColor;if(!(e=i.config.context?i.config.context:n.getContext("webgl",t.contextCreation)||n.getContext("experimental-webgl",t.contextCreation))||e.isContextLost())throw this.contextLost=!0,new Error("WebGL unsupported");this.gl=e;var s=this;this.contextLostHandler=function(t){s.contextLost=!0,s.game.events.emit(l.CONTEXT_LOST,s),t.preventDefault()},this.contextRestoredHandler=function(){s.contextLost=!1,s.init(s.config),s.game.events.emit(l.CONTEXT_RESTORED,s)},n.addEventListener("webglcontextlost",this.contextLostHandler,!1),n.addEventListener("webglcontextrestored",this.contextRestoredHandler,!1),i.context=e;for(var a=0;a<=27;a++)this.blendModes.push({func:[e.ONE,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_ADD});this.blendModes[1].func=[e.ONE,e.DST_ALPHA],this.blendModes[2].func=[e.DST_COLOR,e.ONE_MINUS_SRC_ALPHA],this.blendModes[3].func=[e.ONE,e.ONE_MINUS_SRC_COLOR],this.blendModes[17]={func:[e.ZERO,e.ONE_MINUS_SRC_ALPHA],equation:e.FUNC_REVERSE_SUBTRACT},this.glFormats[0]=e.BYTE,this.glFormats[1]=e.SHORT,this.glFormats[2]=e.UNSIGNED_BYTE,this.glFormats[3]=e.UNSIGNED_SHORT,this.glFormats[4]=e.FLOAT,this.glFuncMap={mat2:{func:e.uniformMatrix2fv,length:1,matrix:!0},mat3:{func:e.uniformMatrix3fv,length:1,matrix:!0},mat4:{func:e.uniformMatrix4fv,length:1,matrix:!0},"1f":{func:e.uniform1f,length:1},"1fv":{func:e.uniform1fv,length:1},"1i":{func:e.uniform1i,length:1},"1iv":{func:e.uniform1iv,length:1},"2f":{func:e.uniform2f,length:2},"2fv":{func:e.uniform2fv,length:1},"2i":{func:e.uniform2i,length:2},"2iv":{func:e.uniform2iv,length:1},"3f":{func:e.uniform3f,length:3},"3fv":{func:e.uniform3fv,length:1},"3i":{func:e.uniform3i,length:3},"3iv":{func:e.uniform3iv,length:1},"4f":{func:e.uniform4f,length:4},"4fv":{func:e.uniform4fv,length:1},"4i":{func:e.uniform4i,length:4},"4iv":{func:e.uniform4iv,length:1}};var h=e.getSupportedExtensions();t.maxTextures&&-1!==t.maxTextures||(t.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),t.maxTextureSize||(t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE));var c="WEBGL_compressed_texture_",d="WEBKIT_"+c;this.compression.ETC1=e.getExtension(c+"etc1")||e.getExtension(d+"etc1"),this.compression.PVRTC=e.getExtension(c+"pvrtc")||e.getExtension(d+"pvrtc"),this.compression.S3TC=e.getExtension(c+"s3tc")||e.getExtension(d+"s3tc"),this.supportedExtensions=h,this.instancedArraysExtension=h.indexOf("ANGLE_instanced_arrays")>-1?e.getExtension("ANGLE_instanced_arrays"):null,this.vaoExtension=h.indexOf("OES_vertex_array_object")>-1?e.getExtension("OES_vertex_array_object"):null,e.disable(e.DEPTH_TEST),e.disable(e.CULL_FACE),e.enable(e.BLEND),e.clearColor(r.redGL,r.greenGL,r.blueGL,r.alphaGL),this.mipmapFilter=e[t.mipmapFilter],this.maxTextures=v.checkShaderMax(e,t.maxTextures),this.textureIndexes=[];var f=this.tempTextures;if(Array.isArray(f))for(var m=0;a0&&n>0;if(o&&a){var h=o[0],l=o[1],c=o[2],u=o[3];a=h!==t||l!==e||c!==i||u!==n}a&&(this.flush(),s.scissor(t,r-e-n,i,n))},resetScissor:function(){var t=this.gl;t.enable(t.SCISSOR_TEST);var e=this.currentScissor;if(e){var i=e[0],n=e[1],r=e[2],s=e[3];r>0&&s>0&&t.scissor(i,this.drawingBufferHeight-n-s,r,s)}},popScissor:function(){var t=this.scissorStack;t.pop();var e=t[t.length-1];e&&this.setScissor(e[0],e[1],e[2],e[3]),this.currentScissor=e},hasActiveStencilMask:function(){var t=this.currentMask.mask,e=this.currentCameraMask.mask;return t&&t.isStencil||e&&e.isStencil},resetViewport:function(){var t=this.gl;t.viewport(0,0,this.width,this.height),this.drawingBufferHeight=t.drawingBufferHeight},setBlendMode:function(t,e){void 0===e&&(e=!1);var i=this.gl,n=this.blendModes[t];return!!(e||t!==o.BlendModes.SKIP_CHECK&&this.currentBlendMode!==t)&&(this.flush(),i.enable(i.BLEND),i.blendEquation(n.equation),n.func.length>2?i.blendFuncSeparate(n.func[0],n.func[1],n.func[2],n.func[3]):i.blendFunc(n.func[0],n.func[1]),this.currentBlendMode=t,!0)},addBlendMode:function(t,e){return this.blendModes.push({func:t,equation:e})-1},updateBlendMode:function(t,e,i){return this.blendModes[t]&&(this.blendModes[t].func=e,i&&(this.blendModes[t].equation=i)),this},removeBlendMode:function(t){return t>17&&this.blendModes[t]&&this.blendModes.splice(t,1),this},setBlankTexture:function(){this.setTexture2D(this.blankTexture.glTexture)},setTextureSource:function(t){if(this.pipelines.forceZero())return this.setTextureZero(t.glTexture,!0),0;var e=this.gl,i=this.currentActiveTexture;return t.glIndexCounter0&&this.pipelines.setMulti().drawFillRect(e,i,n,s,v.getTintFromFloats(o.blueGL,o.greenGL,o.redGL,1),o.alphaGL)},getCurrentStencilMask:function(){var t=null,e=this.maskStack,i=this.currentCameraMask;return e.length>0?t=e[e.length-1]:i.mask&&i.mask.isStencil&&(t=i),t},postRenderCamera:function(t){var e=t.flashEffect,i=t.fadeEffect;if(e.isRunning||i.isRunning||i.isComplete){var n=this.pipelines.setMulti();e.postRenderWebGL(n,v.getTintFromFloats),i.postRenderWebGL(n,v.getTintFromFloats)}t.dirty=!1,this.popScissor(),t.mask&&(this.currentCameraMask.mask=null,t.mask.postRenderWebGL(this,t._maskCamera)),this.pipelines.postBatchCamera(t),t.emit(r.POST_RENDER,t)},preRender:function(){if(!this.contextLost){var t=this.gl;if(t.bindFramebuffer(t.FRAMEBUFFER,null),this.config.clearBeforeRender){var e=this.config.backgroundColor;t.clearColor(e.redGL,e.greenGL,e.blueGL,e.alphaGL),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT|t.STENCIL_BUFFER_BIT)}t.enable(t.SCISSOR_TEST),this.currentScissor=this.defaultScissor,this.scissorStack.length=0,this.scissorStack.push(this.currentScissor),this.game.scene.customViewports&&t.scissor(0,this.drawingBufferHeight-this.height,this.width,this.height),this.currentMask.mask=null,this.currentCameraMask.mask=null,this.maskStack.length=0,this.textureFlush=0,this.emit(h.PRE_RENDER)}},render:function(t,e,i){if(!this.contextLost){var n=e.length;if(this.emit(h.RENDER,t,i),this.preRenderCamera(i),0===n)return this.setBlendMode(o.BlendModes.NORMAL),void this.postRenderCamera(i);this.currentType="";for(var r=this.currentMask,s=0;s0&&(this.startActiveTexture++,this.currentActiveTexture=1)}},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight,t,e,i)},snapshotArea:function(t,e,i,n,r,s,o){var a=this.snapshotState;return a.callback=r,a.type=s,a.encoder=o,a.getPixel=!1,a.x=t,a.y=e,a.width=Math.min(i,this.gl.drawingBufferWidth),a.height=Math.min(n,this.gl.drawingBufferHeight),this},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i),this.snapshotState.getPixel=!0,this},snapshotFramebuffer:function(t,e,i,n,r,s,o,a,h,l,c){void 0===r&&(r=!1),void 0===s&&(s=0),void 0===o&&(o=0),void 0===a&&(a=e),void 0===h&&(h=i);var u=this.currentFramebuffer;this.snapshotArea(s,o,a,h,n,l,c);var d=this.snapshotState;return d.getPixel=r,d.isFramebuffer=!0,d.bufferWidth=e,d.bufferHeight=i,this.setFramebuffer(t),y(this.canvas,d),this.setFramebuffer(u),d.callback=null,d.isFramebuffer=!1,this},canvasToTexture:function(t,e,i,n){return void 0===i&&(i=!1),void 0===n&&(n=!1),e?this.updateCanvasTexture(t,e,n):this.createCanvasTexture(t,i,n)},createCanvasTexture:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=this.gl,r=n.NEAREST,s=n.NEAREST,o=t.width,a=t.height,h=n.CLAMP_TO_EDGE,l=c(o,a);return!e&&l&&(h=n.REPEAT),this.config.antialias&&(r=l?this.mipmapFilter:n.LINEAR,s=n.LINEAR),this.createTexture2D(0,r,s,h,h,n.RGBA,t,o,a,!0,!1,i)},updateCanvasTexture:function(t,e,i){void 0===i&&(i=!1);var n=this.gl,r=t.width,s=t.height;if(r>0&&s>0){n.activeTexture(n.TEXTURE0);var o=n.getParameter(n.TEXTURE_BINDING_2D);n.bindTexture(n.TEXTURE_2D,e),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,i),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),e.width=r,e.height=s,o&&n.bindTexture(n.TEXTURE_2D,o)}return e},createVideoTexture:function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1);var n=this.gl,r=n.NEAREST,s=n.NEAREST,o=t.videoWidth,a=t.videoHeight,h=n.CLAMP_TO_EDGE,l=c(o,a);return!e&&l&&(h=n.REPEAT),this.config.antialias&&(r=l?this.mipmapFilter:n.LINEAR,s=n.LINEAR),this.createTexture2D(0,r,s,h,h,n.RGBA,t,o,a,!0,!0,i)},updateVideoTexture:function(t,e,i){void 0===i&&(i=!1);var n=this.gl,r=t.videoWidth,s=t.videoHeight;if(r>0&&s>0){n.activeTexture(n.TEXTURE0);var o=n.getParameter(n.TEXTURE_BINDING_2D);n.bindTexture(n.TEXTURE_2D,e),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,i),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),e.width=r,e.height=s,o&&n.bindTexture(n.TEXTURE_2D,o)}return e},setTextureFilter:function(t,e){var i=this.gl,n=[i.LINEAR,i.NEAREST][e];i.activeTexture(i.TEXTURE0);var r=i.getParameter(i.TEXTURE_BINDING_2D);return i.bindTexture(i.TEXTURE_2D,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,n),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,n),r&&i.bindTexture(i.TEXTURE_2D,r),this},getMaxTextureSize:function(){return this.config.maxTextureSize},destroy:function(){this.canvas.removeEventListener("webglcontextlost",this.contextLostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.contextRestoredHandler,!1);for(var t=this.gl,e=this.tempTextures,i=0;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(65),s=i(99),o=i(367),a=i(370),h=i(371),l=i(105),c=i(372),u=i(373),d=i(374),p=i(375),f=new n({initialize:function(t){this.game=t.game,this.renderer=t,this.classes=new s([[r.UTILITY_PIPELINE,p],[r.MULTI_PIPELINE,l],[r.BITMAPMASK_PIPELINE,o],[r.SINGLE_PIPELINE,d],[r.ROPE_PIPELINE,u],[r.LIGHT_PIPELINE,h],[r.POINTLIGHT_PIPELINE,c],[r.GRAPHICS_PIPELINE,a]]),this.postPipelineClasses=new s,this.pipelines=new s,this.current=null,this.previous=null,this.MULTI_PIPELINE=null,this.BITMAPMASK_PIPELINE=null,this.UTILITY_PIPELINE=null,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2},boot:function(t){var e,i,n=this,s=this.game;if(this.classes.each((function(t,i){e=n.add(t,new i({game:s})),t===r.UTILITY_PIPELINE&&(n.UTILITY_PIPELINE=e,n.fullFrame1=e.fullFrame1,n.fullFrame2=e.fullFrame2,n.halfFrame1=e.halfFrame1,n.halfFrame2=e.halfFrame2)})),this.MULTI_PIPELINE=this.get(r.MULTI_PIPELINE),this.BITMAPMASK_PIPELINE=this.get(r.BITMAPMASK_PIPELINE),t)for(i in t){var o=t[i];(e=new o(s)).isPostFX?this.postPipelineClasses.set(i,o):this.has(i)||(this.classes.set(i,o),this.add(i,e))}},add:function(t,e){if(!e.isPostFX){var i=this.pipelines,n=this.renderer;return i.has(t)?console.warn("Pipeline exists: "+t):(e.name=t,e.manager=this,i.set(t,e)),e.hasBooted||e.boot(),0!==n.width&&0!==n.height&&e.resize(n.width,n.height),e}console.warn(t+" is a Post Pipeline. Use `addPostPipeline` instead")},addPostPipeline:function(t,e){this.postPipelineClasses.has(t)||this.postPipelineClasses.set(t,e)},flush:function(){this.current&&this.current.flush()},has:function(t){var e=this.pipelines;return"string"==typeof t?e.has(t):!!e.contains(t)},get:function(t){var e=this.pipelines;return"string"==typeof t?e.get(t):e.contains(t)?t:void 0},getPostPipeline:function(t,e){var i,n=this.postPipelineClasses;if("string"==typeof t?i=n.get(t):"function"==typeof t?n.contains(t)&&(i=t):"object"==typeof t&&(i=n.get(t.name)),i){var r=new i(this.game);return e&&(r.gameObject=e),r}},remove:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!0),this.pipelines.delete(t),e&&this.classes.delete(t),i&&this.postPipelineClasses.delete(t)},set:function(t,e,i){if(!t.isPostFX)return this.isCurrent(t,i)||(this.flush(),this.current&&this.current.unbind(),this.current=t,t.bind(i)),t.updateProjectionMatrix(),t.onBind(e),t},preBatch:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=e.length-1;i>=0;i--){var n=e[i];n.active&&n.preBatch(t)}}},postBatch:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;i=0;i--){var n=e[i];n.active&&n.preBatch(t)}}},postBatchCamera:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;i * @author Felipe Alfonso <@bitnenfer> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(2),s=i(862),o=i(863),a=i(104),h=i(57),l=new n({Extends:h,initialize:function(t){t.fragShader=r(t,"fragShader",s),t.vertShader=r(t,"vertShader",o),t.batchSize=r(t,"batchSize",1),t.vertices=r(t,"vertices",[-1,1,-1,-7,7,1]),t.attributes=r(t,"attributes",[{name:"inPosition",size:2,type:a.FLOAT}]),h.call(this,t)},boot:function(){h.prototype.boot.call(this),this.set1i("uMainSampler",0),this.set1i("uMaskSampler",1)},resize:function(t,e){h.prototype.resize.call(this,t,e),this.set2f("uResolution",t,e)},beginMask:function(t,e,i){var n=this.gl;if(t.bitmapMask&&n){var r=this.renderer;r.flush(),r.pushFramebuffer(t.mainFramebuffer),n.disable(n.STENCIL_TEST),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),r.currentCameraMask.mask!==t&&(r.currentMask.mask=t,r.currentMask.camera=i)}},endMask:function(t,e){var i=this.gl,n=this.renderer,r=t.bitmapMask;if(r&&i){n.flush(),n.pushFramebuffer(t.maskFramebuffer),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),n.setBlendMode(0,!0),r.renderWebGL(n,r,e),n.flush(),n.popFramebuffer(),n.popFramebuffer();var s=n.getCurrentStencilMask();s?(i.enable(i.STENCIL_TEST),s.mask.applyStencil(n,s.camera,!0)):n.currentMask.mask=null,n.pipelines.set(this),i.activeTexture(i.TEXTURE1),i.bindTexture(i.TEXTURE_2D,t.maskTexture),i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t.mainTexture),this.set1i("uInvertMaskAlpha",t.invertAlpha),i.drawArrays(this.topology,0,3),n.resetTextures()}}});t.exports=l},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={AFTER_FLUSH:i(864),BEFORE_FLUSH:i(865),BIND:i(866),BOOT:i(867),DESTROY:i(868),REBIND:i(869),RESIZE:i(870)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(2),s=i(104),o=new n({initialize:function(t,e,i,n,r){this.pipeline=t,this.name=e,this.renderer=t.renderer,this.gl=this.renderer.gl,this.program=this.renderer.createProgram(i,n),this.attributes,this.vertexComponentCount=0,this.vertexSize=0,this.uniforms={},this.createAttributes(r),this.createUniforms()},createAttributes:function(t){var e=0,i=0,n=[];this.vertexComponentCount=0;for(var o=0;o=0?(e.enableVertexAttribArray(p),e.vertexAttribPointer(p,a,h,d,i,l),o.enabled=!0,o.location=p):-1!==p&&e.disableVertexAttribArray(p)}else c?e.vertexAttribPointer(u,a,h,d,i,l):!c&&u>-1&&(e.disableVertexAttribArray(u),o.location=-1)}return this},createUniforms:function(){var t,e,i,n=this.gl,r=this.program,s=this.uniforms,o=n.getProgramParameter(r,n.ACTIVE_UNIFORMS);for(t=0;t0&&(e=e.substr(0,h),s.hasOwnProperty(e)||null!==(i=n.getUniformLocation(r,e))&&(s[e]={name:e,location:i,value1:null,value2:null,value3:null,value4:null}))}}return this},hasUniform:function(t){return this.uniforms.hasOwnProperty(t)},resetUniform:function(t){var e=this.uniforms[t];return e&&(e.value1=null,e.value2=null,e.value3=null,e.value4=null),this},setUniform1:function(t,e,i){var n=this.uniforms[e];return n?(n.value1!==i&&(n.value1=i,this.renderer.setProgram(this.program),t.call(this.gl,n.location,i),this.pipeline.currentShader=this),this):this},setUniform2:function(t,e,i,n){var r=this.uniforms[e];return r?(r.value1===i&&r.value2===n||(r.value1=i,r.value2=n,this.renderer.setProgram(this.program),t.call(this.gl,r.location,i,n),this.pipeline.currentShader=this),this):this},setUniform3:function(t,e,i,n,r){var s=this.uniforms[e];return s?(s.value1===i&&s.value2===n&&s.value3===r||(s.value1=i,s.value2=n,s.value3=r,this.renderer.setProgram(this.program),t.call(this.gl,s.location,i,n,r),this.pipeline.currentShader=this),this):this},setUniform4:function(t,e,i,n,r,s){var o=this.uniforms[e];return o?(o.value1===i&&o.value2===n&&o.value3===r&&o.value4===s||(o.value1=i,o.value2=n,o.value3=r,o.value4=s,this.renderer.setProgram(this.program),t.call(this.gl,o.location,i,n,r,s),this.pipeline.currentShader=this),this):this},set1f:function(t,e){return this.setUniform1(this.gl.uniform1f,t,e)},set2f:function(t,e,i){return this.setUniform2(this.gl.uniform2f,t,e,i)},set3f:function(t,e,i,n){return this.setUniform3(this.gl.uniform3f,t,e,i,n)},set4f:function(t,e,i,n,r){return this.setUniform4(this.gl.uniform4f,t,e,i,n,r)},set1fv:function(t,e){return this.setUniform1(this.gl.uniform1fv,t,e)},set2fv:function(t,e){return this.setUniform1(this.gl.uniform2fv,t,e)},set3fv:function(t,e){return this.setUniform1(this.gl.uniform3fv,t,e)},set4fv:function(t,e){return this.setUniform1(this.gl.uniform4fv,t,e)},set1iv:function(t,e){return this.setUniform1(this.gl.uniform1iv,t,e)},set2iv:function(t,e){return this.setUniform1(this.gl.uniform2iv,t,e)},set3iv:function(t,e){return this.setUniform1(this.gl.uniform3iv,t,e)},set4iv:function(t,e){return this.setUniform1(this.gl.uniform4iv,t,e)},set1i:function(t,e){return this.setUniform1(this.gl.uniform1i,t,e)},set2i:function(t,e,i){return this.setUniform2(this.gl.uniform2i,t,e,i)},set3i:function(t,e,i,n){return this.setUniform3(this.gl.uniform3i,t,e,i,n)},set4i:function(t,e,i,n,r){return this.setUniform4(this.gl.uniform4i,t,e,i,n,r)},setMatrix2fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix2fv,t,e,i)},setMatrix3fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix3fv,t,e,i)},setMatrix4fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix4fv,t,e,i)},destroy:function(){this.gl.deleteProgram(this.program),this.pipeline=null,this.renderer=null,this.gl=null,this.program=null,this.attributes=null,this.uniforms=null}});t.exports=o},function(t,e,i){ /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(68),s=i(2),o=i(871),a=i(872),h=i(25),l=i(104),c=i(57),u=new n({Extends:c,initialize:function(t){t.fragShader=s(t,"fragShader",o),t.vertShader=s(t,"vertShader",a),t.attributes=s(t,"attributes",[{name:"inPosition",size:2},{name:"inColor",size:4,type:l.UNSIGNED_BYTE,normalized:!0}]),c.call(this,t),this.calcMatrix=new h,this.tempTriangle=[{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0},{x:0,y:0,width:0}],this.strokeTint={TL:0,TR:0,BL:0,BR:0},this.fillTint={TL:0,TR:0,BL:0,BR:0},this.currentFrame={u0:0,v0:0,u1:1,v1:1},this.firstQuad=[0,0,0,0,0],this.prevQuad=[0,0,0,0,0],this.polygonCache=[]},batchFillRect:function(t,e,i,n,r,s){this.renderer.pipelines.set(this);var o=this.calcMatrix;s&&s.multiply(r,o);var a=t+i,h=e+n,l=o.getX(t,e),c=o.getY(t,e),u=o.getX(t,h),d=o.getY(t,h),p=o.getX(a,h),f=o.getY(a,h),m=o.getX(a,e),g=o.getY(a,e),v=this.fillTint;this.batchQuad(l,c,u,d,p,f,m,g,v.TL,v.TR,v.BL,v.BR)},batchFillTriangle:function(t,e,i,n,r,s,o,a){this.renderer.pipelines.set(this);var h=this.calcMatrix;a&&a.multiply(o,h);var l=h.getX(t,e),c=h.getY(t,e),u=h.getX(i,n),d=h.getY(i,n),p=h.getX(r,s),f=h.getY(r,s),m=this.fillTint;this.batchTri(l,c,u,d,p,f,m.TL,m.TR,m.BL)},batchStrokeTriangle:function(t,e,i,n,r,s,o,a,h){var l=this.tempTriangle;l[0].x=t,l[0].y=e,l[0].width=o,l[1].x=i,l[1].y=n,l[1].width=o,l[2].x=r,l[2].y=s,l[2].width=o,l[3].x=t,l[3].y=e,l[3].width=o,this.batchStrokePath(l,o,!1,a,h)},batchFillPath:function(t,e,i){this.renderer.pipelines.set(this);var n=this.calcMatrix;i&&i.multiply(e,n);for(var s,o,a=t.length,h=this.polygonCache,l=this.fillTint.TL,c=this.fillTint.TR,u=this.fillTint.BL,d=0;d0&&z[4]?this.batchQuad(D,I,P,R,z[0],z[1],z[2],z[3],B,k,N,U):(G[0]=D,G[1]=I,G[2]=P,G[3]=R,G[4]=1),h&&G[4]?this.batchQuad(A,C,L,O,G[0],G[1],G[2],G[3],B,k,N,U):(z[0]=A,z[1]=C,z[2]=L,z[3]=O,z[4]=1)}},batchVert:function(t,e,i){var n=this.vertexViewF32,r=this.vertexViewU32,s=this.vertexCount*this.currentShader.vertexComponentCount-1;n[++s]=t,n[++s]=e,r[++s]=i,this.vertexCount++},batchQuad:function(t,e,i,n,r,s,o,a,h,l,c,u){var d=!1;return this.shouldFlush(6)&&(this.flush(),d=!0),this.batchVert(t,e,h),this.batchVert(i,n,c),this.batchVert(r,s,u),this.batchVert(t,e,h),this.batchVert(r,s,u),this.batchVert(o,a,l),d},batchTri:function(t,e,i,n,r,s,o,a,h){var l=!1;return this.shouldFlush(3)&&(this.flush(),l=!0),this.batchVert(t,e,o),this.batchVert(i,n,a),this.batchVert(r,s,h),l},destroy:function(){return c.prototype.destroy.call(this),this.polygonCache=null,this}});t.exports=u},function(t,e,i){ /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(2),s=i(873),o=i(105),a=i(3),h=i(57),l=10,c=new a,u=new n({Extends:o,initialize:function(t){l=t.game.renderer.config.maxLights;for(var e=r(t,"fragShader",s),i=[],n=1;n<=l;n++)i.push({name:"lights"+n,fragShader:e.replace("%LIGHT_COUNT%",n.toString())});t.shaders=i,o.call(this,t),this.inverseRotationMatrix=new Float32Array([1,0,0,0,1,0,0,0,1]),this.defaultNormalMap},boot:function(){h.prototype.boot.call(this);var t=this.gl,e=t.createTexture();t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,new Uint8Array([127,127,255,255])),this.defaultNormalMap={glTexture:e};for(var i=0;i0&&this.flush();var e=this.inverseRotationMatrix;if(t){var i=-t,n=Math.cos(i),r=Math.sin(i);e[1]=r,e[3]=-r,e[0]=e[4]=n}else e[0]=e[4]=1,e[1]=e[3]=0;this.setMatrix3fv("uInverseRotationMatrix",!1,e),this.currentNormalMapRotation=t}},setTexture2D:function(t,e){var i=this.renderer;void 0===t&&(t=i.tempTextures[0]);var n=this.getNormalMap(e);i.isNewNormalMap(t,n)&&(this.flush(),i.setTextureZero(t),i.setNormalMap(n));var r=e?e.rotation:0;return this.setNormalMapRotation(r),this.currentUnit=0,0},setGameObject:function(t,e){void 0===e&&(e=t.frame);var i=this.renderer,n=e.glTexture,r=this.getNormalMap(t);return i.isNewNormalMap()&&(this.flush(),i.setTextureZero(n),i.setNormalMap(r)),this.setNormalMapRotation(t.rotation),this.currentUnit=0,0},getNormalMap:function(t){var e;return t?t.displayTexture?e=t.displayTexture.dataSource[t.displayFrame.sourceIndex]:t.texture?e=t.texture.dataSource[t.frame.sourceIndex]:t.tileset&&(e=Array.isArray(t.tileset)?t.tileset[0].image.dataSource[0]:t.tileset.image.dataSource[0]):e=this.defaultNormalMap,e||(e=this.defaultNormalMap),e.glTexture}});u.LIGHT_COUNT=l,t.exports=u},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(2),s=i(876),o=i(877),a=i(57),h=new n({Extends:a,initialize:function(t){t.vertShader=r(t,"vertShader",o),t.fragShader=r(t,"fragShader",s),t.attributes=r(t,"attributes",[{name:"inPosition",size:2},{name:"inLightPosition",size:2},{name:"inLightRadius"},{name:"inLightAttenuation"},{name:"inLightColor",size:4}]),a.call(this,t)},onRender:function(t,e){this.set2f("uResolution",this.width,this.height),this.set1f("uCameraZoom",e.zoom)},batchPointLight:function(t,e,i,n,r,s,o,a,h,l,c,u){var d=t.color,p=t.intensity,f=t.radius,m=t.attenuation,g=d.r*p,v=d.g*p,y=d.b*p,x=e.alpha*t.alpha;this.shouldFlush(6)&&this.flush(),this.batchLightVert(i,n,c,u,f,m,g,v,y,x),this.batchLightVert(r,s,c,u,f,m,g,v,y,x),this.batchLightVert(o,a,c,u,f,m,g,v,y,x),this.batchLightVert(i,n,c,u,f,m,g,v,y,x),this.batchLightVert(o,a,c,u,f,m,g,v,y,x),this.batchLightVert(h,l,c,u,f,m,g,v,y,x)},batchLightVert:function(t,e,i,n,r,s,o,a,h,l){var c=this.vertexViewF32,u=this.vertexCount*this.currentShader.vertexComponentCount-1;c[++u]=t,c[++u]=e,c[++u]=i,c[++u]=n,c[++u]=r,c[++u]=s,c[++u]=o,c[++u]=a,c[++u]=h,c[++u]=l,this.vertexCount++}});t.exports=h},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(2),s=i(105),o=new n({Extends:s,initialize:function(t){t.topology=5,t.batchSize=r(t,"batchSize",256),s.call(this,t)}});t.exports=o},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(2),s=i(105),o=i(878),a=i(879),h=i(57),l=new n({Extends:s,initialize:function(t){t.fragShader=r(t,"fragShader",o),t.vertShader=r(t,"vertShader",a),t.forceZero=!0,s.call(this,t)},boot:function(){h.prototype.boot.call(this),this.set1i("uMainSampler",0)}});t.exports=l},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(880),r=i(34),s=i(0),o=i(195),a=i(881),h=i(882),l=i(2),c=i(883),u=i(376),d=i(57),p=new s({Extends:d,initialize:function(t){t.renderTarget=l(t,"renderTarget",[{scale:1},{scale:1},{scale:.5},{scale:.5}]),t.vertShader=l(t,"vertShader",u),t.shaders=l(t,"shaders",[{name:"Copy",fragShader:h},{name:"AddBlend",fragShader:n},{name:"LinearBlend",fragShader:c},{name:"ColorMatrix",fragShader:a}]),t.attributes=l(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),t.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],t.batchSize=1,d.call(this,t),this.colorMatrix=new o,this.copyShader,this.addShader,this.linearShader,this.colorMatrixShader,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2},boot:function(){d.prototype.boot.call(this);var t=this.shaders,e=this.renderTargets;this.copyShader=t[0],this.addShader=t[1],this.linearShader=t[2],this.colorMatrixShader=t[3],this.fullFrame1=e[0],this.fullFrame2=e[1],this.halfFrame1=e[2],this.halfFrame2=e[3]},copyFrame:function(t,e,i,n,r){void 0===i&&(i=1),void 0===n&&(n=!0),void 0===r&&(r=!0);var s=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",i),s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,t.texture),e?(s.viewport(0,0,e.width,e.height),s.bindFramebuffer(s.FRAMEBUFFER,e.framebuffer),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,e.texture,0)):s.viewport(0,0,t.width,t.height),n&&(r?s.clearColor(0,0,0,0):s.clearColor(0,0,0,1),s.clear(s.COLOR_BUFFER_BIT)),s.bufferData(s.ARRAY_BUFFER,this.vertexData,s.STATIC_DRAW),s.drawArrays(s.TRIANGLES,0,6),s.bindFramebuffer(s.FRAMEBUFFER,null),s.bindTexture(s.TEXTURE_2D,null)},blitFrame:function(t,e,i,n,s,o){void 0===i&&(i=1),void 0===n&&(n=!0),void 0===s&&(s=!0),void 0===o&&(o=!1);var a=this.gl;if(this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",i),a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,t.texture),t.height>e.height)a.viewport(0,0,t.width,t.height),this.setTargetUVs(t,e);else{var h=e.height-t.height;a.viewport(0,h,t.width,t.height)}if(a.bindFramebuffer(a.FRAMEBUFFER,e.framebuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,e.texture,0),n&&(s?a.clearColor(0,0,0,0):a.clearColor(0,0,0,1),a.clear(a.COLOR_BUFFER_BIT)),o){var l=this.renderer.currentBlendMode;this.renderer.setBlendMode(r.ERASE)}a.bufferData(a.ARRAY_BUFFER,this.vertexData,a.STATIC_DRAW),a.drawArrays(a.TRIANGLES,0,6),o&&this.renderer.setBlendMode(l),a.bindFramebuffer(a.FRAMEBUFFER,null),a.bindTexture(a.TEXTURE_2D,null),this.resetUVs()},copyFrameRect:function(t,e,i,n,r,s,o,a){void 0===o&&(o=!0),void 0===a&&(a=!0);var h=this.gl;h.bindFramebuffer(h.FRAMEBUFFER,t.framebuffer),h.framebufferTexture2D(h.FRAMEBUFFER,h.COLOR_ATTACHMENT0,h.TEXTURE_2D,t.texture,0),o&&(a?h.clearColor(0,0,0,0):h.clearColor(0,0,0,1),h.clear(h.COLOR_BUFFER_BIT)),h.activeTexture(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,e.texture),h.copyTexSubImage2D(h.TEXTURE_2D,0,0,0,i,n,r,s),h.bindFramebuffer(h.FRAMEBUFFER,null),h.bindTexture(h.TEXTURE_2D,null)},copyToGame:function(t){var e=this.gl;this.setShader(this.copyShader),this.set1i("uMainSampler",0),this.set1f("uBrightness",1),this.renderer.popFramebuffer(),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,t.texture),e.bufferData(e.ARRAY_BUFFER,this.vertexData,e.STATIC_DRAW),e.drawArrays(e.TRIANGLES,0,6),this.renderer.resetTextures()},drawFrame:function(t,e,i,n){void 0===i&&(i=!0),void 0===n&&(n=this.colorMatrix);var r=this.gl;this.setShader(this.colorMatrixShader),this.set1i("uMainSampler",0),this.set1fv("uColorMatrix",n.getData()),this.set1f("uAlpha",n.alpha),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,t.texture),e?(r.viewport(0,0,e.width,e.height),r.bindFramebuffer(r.FRAMEBUFFER,e.framebuffer),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e.texture,0)):r.viewport(0,0,t.width,t.height),i?r.clearColor(0,0,0,0):r.clearColor(0,0,0,1),r.clear(r.COLOR_BUFFER_BIT),r.bufferData(r.ARRAY_BUFFER,this.vertexData,r.STATIC_DRAW),r.drawArrays(r.TRIANGLES,0,6),r.bindFramebuffer(r.FRAMEBUFFER,null),r.bindTexture(r.TEXTURE_2D,null)},blendFrames:function(t,e,i,n,r,s){void 0===n&&(n=1),void 0===r&&(r=!0),void 0===s&&(s=this.linearShader);var o=this.gl;this.setShader(s),this.set1i("uMainSampler1",0),this.set1i("uMainSampler2",1),this.set1f("uStrength",n),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,t.texture),o.activeTexture(o.TEXTURE1),o.bindTexture(o.TEXTURE_2D,e.texture),i?(o.bindFramebuffer(o.FRAMEBUFFER,i.framebuffer),o.framebufferTexture2D(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.TEXTURE_2D,i.texture,0),o.viewport(0,0,i.width,i.height)):o.viewport(0,0,t.width,t.height),r?o.clearColor(0,0,0,0):o.clearColor(0,0,0,1),o.clear(o.COLOR_BUFFER_BIT),o.bufferData(o.ARRAY_BUFFER,this.vertexData,o.STATIC_DRAW),o.drawArrays(o.TRIANGLES,0,6),o.bindFramebuffer(o.FRAMEBUFFER,null),o.bindTexture(o.TEXTURE_2D,null)},blendFramesAdditive:function(t,e,i,n,r){this.blendFrames(t,e,i,n,r,this.addShader)},clearFrame:function(t,e){void 0===e&&(e=!0);var i=this.gl;i.viewport(0,0,t.width,t.height),i.bindFramebuffer(i.FRAMEBUFFER,t.framebuffer),e?i.clearColor(0,0,0,0):i.clearColor(0,0,0,1),i.clear(i.COLOR_BUFFER_BIT);var n=this.renderer.currentFramebuffer;i.bindFramebuffer(i.FRAMEBUFFER,n)},setUVs:function(t,e,i,n,r,s,o,a){var h=this.vertexViewF32;h[2]=t,h[3]=e,h[6]=i,h[7]=n,h[10]=r,h[11]=s,h[14]=t,h[15]=e,h[18]=r,h[19]=s,h[22]=o,h[23]=a},setTargetUVs:function(t,e){var i=e.height/t.height;i=i>.5?.5-(i-.5):.5-i+.5,this.setUVs(0,i,0,1+i,1,1+i,1,i)},flipX:function(){this.setUVs(1,0,1,1,0,1,0,0)},flipY:function(){this.setUVs(0,1,0,0,1,0,1,1)},resetUVs:function(){this.setUVs(0,0,0,1,1,1,1,0)}});t.exports=p},function(t,e){t.exports=["#define SHADER_NAME PHASER_QUAD_VS","","precision mediump float;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","","varying vec2 outFragCoord;","varying vec2 outTexCoord;","","void main ()","{"," outFragCoord = inPosition.xy * 0.5 + 0.5;"," outTexCoord = inTexCoord;",""," gl_Position = vec4(inPosition, 0, 1);","}",""].join("\n")},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(31),r=i(37),s=i(2);t.exports=function(t,e){var i=t.getContext("experimental-webgl"),o=s(e,"callback"),a=s(e,"type","image/png"),h=s(e,"encoder",.92),l=s(e,"x",0),c=s(e,"y",0),u=s(e,"getPixel",!1),d=s(e,"isFramebuffer",!1),p=d?s(e,"bufferWidth",1):i.drawingBufferWidth,f=d?s(e,"bufferHeight",1):i.drawingBufferHeight;if(u){var m=new Uint8Array(4),g=d?c:f-c;i.readPixels(l,g,1,1,i.RGBA,i.UNSIGNED_BYTE,m),o.call(null,new r(m[0],m[1],m[2],m[3]/255))}else{var v=s(e,"width",p),y=s(e,"height",f),x=new Uint8Array(v*y*4);i.readPixels(l,f-c-y,v,y,i.RGBA,i.UNSIGNED_BYTE,x);for(var b=n.createWebGL(this,v,y),w=b.getContext("2d"),T=w.getImageData(0,0,v,y),_=T.data,E=0;E * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(32);t.exports=function(t){var e=t.config;if(!e.hideBanner){var i="WebGL";e.renderType===n.CANVAS?i="Canvas":e.renderType===n.HEADLESS&&(i="Headless");var r,s=e.audio,o=t.device.audio;if(r=o.webAudio&&!s.disableWebAudio?"Web Audio":s.noAudio||!o.webAudio&&!o.audioData?"No Audio":"HTML5 Audio",t.device.browser.ie)window.console&&console.log("Phaser v"+n.VERSION+" / https://phaser.io");else{var a,h="",l=[h];Array.isArray(e.bannerBackgroundColor)?(e.bannerBackgroundColor.forEach((function(t){h=h.concat("%c "),l.push("background: "+t),a=t})),l[l.length-1]="color: "+e.bannerTextColor+"; background: "+a):(h=h.concat("%c "),l.push("color: "+e.bannerTextColor+"; background: "+e.bannerBackgroundColor)),l.push("background: transparent"),e.gameTitle&&(h=h.concat(e.gameTitle),e.gameVersion&&(h=h.concat(" v"+e.gameVersion)),e.hidePhaser||(h=h.concat(" / "))),e.hidePhaser||(h=h.concat("Phaser v"+n.VERSION+" ("+i+" | "+r+")")),h=h.concat(" %c "+e.gameURL),l[0]=h,console.log.apply(console,l)}}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(6),s=i(1),o=i(380),a=new n({initialize:function(t,e){this.game=t,this.raf=new o,this.started=!1,this.running=!1,this.minFps=r(e,"min",5),this.targetFps=r(e,"target",60),this._min=1e3/this.minFps,this._target=1e3/this.targetFps,this.actualFps=this.targetFps,this.nextFpsUpdate=0,this.framesThisSecond=0,this.callback=s,this.forceSetTimeOut=r(e,"forceSetTimeOut",!1),this.time=0,this.startTime=0,this.lastTime=0,this.frame=0,this.inFocus=!0,this._pauseTime=0,this._coolDown=0,this.delta=0,this.deltaIndex=0,this.deltaHistory=[],this.deltaSmoothingMax=r(e,"deltaHistory",10),this.panicMax=r(e,"panicMax",120),this.rawDelta=0,this.now=0,this.smoothStep=r(e,"smoothStep",!0)},blur:function(){this.inFocus=!1},focus:function(){this.inFocus=!0,this.resetDelta()},pause:function(){this._pauseTime=window.performance.now()},resume:function(){this.resetDelta(),this.startTime+=this.time-this._pauseTime},resetDelta:function(){var t=window.performance.now();this.time=t,this.lastTime=t,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0;for(var e=0;e0||!this.inFocus)&&(this._coolDown--,s=Math.min(s,this._target)),s>this._min&&(s=n[i],s=Math.min(s,this._min)),n[i]=s,this.deltaIndex++,this.deltaIndex>r&&(this.deltaIndex=0),o=0;for(var a=0;athis.nextFpsUpdate&&(this.actualFps=.25*this.framesThisSecond+.75*this.actualFps,this.nextFpsUpdate=t+1e3,this.framesThisSecond=0),this.framesThisSecond++;var h=o/this._target;this.callback(t,o,h),this.lastTime=t,this.frame++},tick:function(){this.step()},sleep:function(){this.running&&(this.raf.stop(),this.running=!1)},wake:function(t){this.running||(t&&(this.startTime+=-this.lastTime+(this.lastTime+window.performance.now())),this.raf.start(this.step.bind(this),this.useRAF),this.running=!0,this.step())},getDuration:function(){return Math.round(this.lastTime-this.startTime)/1e3},getDurationMS:function(){return Math.round(this.lastTime-this.startTime)},stop:function(){return this.running=!1,this.started=!1,this.raf.stop(),this},destroy:function(){this.stop(),this.callback=s,this.raf=null,this.game=null}});t.exports=a},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(1),s=new n({initialize:function(){this.isRunning=!1,this.callback=r,this.tick=0,this.isSetTimeOut=!1,this.timeOutID=null,this.lastTime=0,this.target=0;var t=this;this.step=function e(){var i=window.performance.now();t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.requestAnimationFrame(e)},this.stepTimeout=function e(){var i=Date.now(),n=Math.min(Math.max(2*t.target+t.tick-i,0),t.target);t.lastTime=t.tick,t.tick=i,t.callback(i),t.timeOutID=window.setTimeout(e,n)}},start:function(t,e,i){this.isRunning||(this.callback=t,this.isSetTimeOut=e,this.target=i,this.isRunning=!0,this.timeOutID=e?window.setTimeout(this.stepTimeout,0):window.requestAnimationFrame(this.step))},stop:function(){this.isRunning=!1,this.isSetTimeOut?clearTimeout(this.timeOutID):window.cancelAnimationFrame(this.timeOutID)},destroy:function(){this.stop(),this.callback=r}});t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(22);t.exports=function(t){var e,i=t.events;void 0!==document.hidden?e="visibilitychange":["webkit","moz","ms"].forEach((function(t){void 0!==document[t+"Hidden"]&&(document.hidden=function(){return document[t+"Hidden"]},e=t+"visibilitychange")})),e&&document.addEventListener(e,(function(t){document.hidden||"pause"===t.type?i.emit(n.HIDDEN):i.emit(n.VISIBLE)}),!1),window.onblur=function(){i.emit(n.BLUR)},window.onfocus=function(){i.emit(n.FOCUS)},window.focus&&t.config.autoFocus&&window.focus()}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(383),r=i(31),s=i(6);t.exports=function(t){var e=s(t,"data",[]),i=s(t,"canvas",null),o=s(t,"palette",n),a=s(t,"pixelWidth",1),h=s(t,"pixelHeight",a),l=s(t,"resizeCanvas",!0),c=s(t,"clearCanvas",!0),u=s(t,"preRender",null),d=s(t,"postRender",null),p=Math.floor(Math.abs(e[0].length*a)),f=Math.floor(Math.abs(e.length*h));i||(i=r.create2D(this,p,f),l=!1,c=!1),l&&(i.width=p,i.height=f);var m=i.getContext("2d");c&&m.clearRect(0,0,p,f),u&&u(i,m);for(var g=0;g * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={0:"#000",1:"#9D9D9D",2:"#FFF",3:"#BE2633",4:"#E06F8B",5:"#493C2B",6:"#A46422",7:"#EB8931",8:"#F7E26B",9:"#2F484E",A:"#44891A",B:"#A3CE27",C:"#1B2632",D:"#005784",E:"#31A2F2",F:"#B2DCEF"}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(352),s=i(90),o=i(3),a=new n({Extends:s,initialize:function(t,e,i,n){s.call(this,"CubicBezierCurve"),Array.isArray(t)&&(n=new o(t[6],t[7]),i=new o(t[4],t[5]),e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i,this.p3=n},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.p0,n=this.p1,s=this.p2,a=this.p3;return e.set(r(t,i.x,n.x,s.x,a.x),r(t,i.y,n.y,s.y,a.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var n=1;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(90),s=i(35),o=i(6),a=i(193),h=i(3),l=new n({Extends:r,initialize:function(t,e,i,n,a,l,c,u){if("object"==typeof t){var d=t;t=o(d,"x",0),e=o(d,"y",0),i=o(d,"xRadius",0),n=o(d,"yRadius",i),a=o(d,"startAngle",0),l=o(d,"endAngle",360),c=o(d,"clockwise",!1),u=o(d,"rotation",0)}else void 0===n&&(n=i),void 0===a&&(a=0),void 0===l&&(l=360),void 0===c&&(c=!1),void 0===u&&(u=0);r.call(this,"EllipseCurve"),this.p0=new h(t,e),this._xRadius=i,this._yRadius=n,this._startAngle=s(a),this._endAngle=s(l),this._clockwise=c,this._rotation=s(u)},getStartPoint:function(t){return void 0===t&&(t=new h),this.getPoint(0,t)},getResolution:function(t){return 2*t},getPoint:function(t,e){void 0===e&&(e=new h);for(var i=2*Math.PI,n=this._endAngle-this._startAngle,r=Math.abs(n)i;)n-=i;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(90),s=i(196),o=i(10),a=i(3),h=new a,l=new n({Extends:r,initialize:function(t,e){r.call(this,"LineCurve"),Array.isArray(t)&&(e=new a(t[2],t[3]),t=new a(t[0],t[1])),this.p0=t,this.p1=e,this.arcLengthDivisions=1},getBounds:function(t){return void 0===t&&(t=new o),s([this.p0,this.p1],t)},getStartPoint:function(t){return void 0===t&&(t=new a),t.copy(this.p0)},getResolution:function(t){return void 0===t&&(t=1),t},getPoint:function(t,e){return void 0===e&&(e=new a),1===t?e.copy(this.p1):(e.copy(this.p1).subtract(this.p0).scale(t).add(this.p0),e)},getPointAt:function(t,e){return this.getPoint(t,e)},getTangent:function(){return h.copy(this.p1).subtract(this.p0).normalize()},getUtoTmapping:function(t,e,i){var n;if(e){var r=this.getLengths(i),s=r[r.length-1];n=Math.min(e,s)/s}else n=t;return n},draw:function(t){return t.lineBetween(this.p0.x,this.p0.y,this.p1.x,this.p1.y),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y]}}});l.fromJSON=function(t){var e=t.points,i=new a(e[0],e[1]),n=new a(e[2],e[3]);return new l(i,n)},t.exports=l},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(3),s=new n({initialize:function(t,e){this.active=!1,this.p0=new r(t,e)},getPoint:function(t,e){return void 0===e&&(e=new r),e.copy(this.p0)},getPointAt:function(t,e){return this.getPoint(t,e)},getResolution:function(){return 1},getLength:function(){return 0},toJSON:function(){return{type:"MoveTo",points:[this.p0.x,this.p0.y]}}});t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(90),s=i(353),o=i(3),a=new n({Extends:r,initialize:function(t,e,i){r.call(this,"QuadraticBezier"),Array.isArray(t)&&(i=new o(t[4],t[5]),e=new o(t[2],t[3]),t=new o(t[0],t[1])),this.p0=t,this.p1=e,this.p2=i},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.p0)},getResolution:function(t){return t},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.p0,n=this.p1,r=this.p2;return e.set(s(t,i.x,n.x,r.x),s(t,i.y,n.y,r.y))},draw:function(t,e){void 0===e&&(e=32);var i=this.getPoints(e);t.beginPath(),t.moveTo(this.p0.x,this.p0.y);for(var n=1;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(191),r=i(0),s=i(90),o=i(3),a=new r({Extends:s,initialize:function(t){void 0===t&&(t=[]),s.call(this,"SplineCurve"),this.points=[],this.addPoints(t)},addPoints:function(t){for(var e=0;ei.length-2?i.length-1:s+1],u=i[s>i.length-3?i.length-1:s+2];return e.set(n(a,h.x,l.x,c.x,u.x),n(a,h.y,l.y,c.y,u.y))},toJSON:function(){for(var t=[],e=0;e * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=new(i(0))({initialize:function(t,e,i,n){e&&""!==e||(e=["precision mediump float;","uniform vec2 resolution;","varying vec2 fragCoord;","void main () {"," vec2 uv = fragCoord / resolution.xy;"," gl_FragColor = vec4(uv.xyx, 1.0);","}"].join("\n")),i&&""!==i||(i=["precision mediump float;","uniform mat4 uProjectionMatrix;","uniform mat4 uViewMatrix;","uniform vec2 uResolution;","attribute vec2 inPosition;","varying vec2 fragCoord;","varying vec2 outTexCoord;","void main () {"," gl_Position = uProjectionMatrix * uViewMatrix * vec4(inPosition, 1.0, 1.0);"," fragCoord = vec2(inPosition.x, uResolution.y - inPosition.y);"," outTexCoord = vec2(inPosition.x / uResolution.x, fragCoord.y / uResolution.y);","}"].join("\n")),void 0===n&&(n=null),this.key=t,this.fragmentSrc=e,this.vertexSrc=i,this.uniforms=n}});t.exports=n},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(37);n.ColorSpectrum=i(905),n.ColorToRGBA=i(906),n.ComponentToHex=i(392),n.GetColor=i(100),n.GetColor32=i(322),n.HexStringToColor=i(321),n.HSLToColor=i(907),n.HSVColorWheel=i(908),n.HSVToRGB=i(185),n.HueToComponent=i(393),n.IntegerToColor=i(186),n.IntegerToRGB=i(324),n.Interpolate=i(909),n.ObjectToColor=i(325),n.RandomRGB=i(910),n.RGBStringToColor=i(326),n.RGBToHSV=i(323),n.RGBToString=i(911),n.ValueToColor=i(184),t.exports=n},function(t,e){t.exports=function(t){var e=t.toString(16);return 1===e.length?"0"+e:e}},function(t,e){t.exports=function(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+(e-t)*(2/3-i)*6:t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(102);t.exports=function(t){if("complete"!==document.readyState&&"interactive"!==document.readyState){var e=function(){document.removeEventListener("deviceready",e,!0),document.removeEventListener("DOMContentLoaded",e,!0),window.removeEventListener("load",e,!0),t()};document.body?n.cordova?document.addEventListener("deviceready",e,!1):(document.addEventListener("DOMContentLoaded",e,!0),window.addEventListener("load",e,!0)):window.setTimeout(e,20)}else t()}},function(t,e){t.exports=function(t){if(!t)return window.innerHeight;var e=Math.abs(window.orientation),i={w:0,h:0},n=document.createElement("div");return n.setAttribute("style","position: fixed; height: 100vh; width: 0; top: 0"),document.documentElement.appendChild(n),i.w=90===e?n.offsetHeight:window.innerWidth,i.h=90===e?window.innerWidth:n.offsetHeight,document.documentElement.removeChild(n),n=null,90!==Math.abs(window.orientation)?i.h:i.w}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(198);t.exports=function(t,e){var i=window.screen,r=!!i&&(i.orientation||i.mozOrientation||i.msOrientation);return r&&"string"==typeof r.type?r.type:"string"==typeof r?r:"number"==typeof window.orientation?0===window.orientation||180===window.orientation?n.ORIENTATION.PORTRAIT:n.ORIENTATION.LANDSCAPE:window.matchMedia?window.matchMedia("(orientation: portrait)").matches?n.ORIENTATION.PORTRAIT:window.matchMedia("(orientation: landscape)").matches?n.ORIENTATION.LANDSCAPE:void 0:e>t?n.ORIENTATION.PORTRAIT:n.ORIENTATION.LANDSCAPE}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={NO_ZOOM:1,ZOOM_2X:2,ZOOM_4X:4,MAX_ZOOM:-1}},function(t,e){t.exports=function(t){var e;return""!==t&&("string"==typeof t?e=document.getElementById(t):t&&1===t.nodeType&&(e=t)),e||(e=document.body),e}},function(t,e){t.exports=function(t){var e="";try{window.DOMParser?e=(new DOMParser).parseFromString(t,"text/xml"):(e=new ActiveXObject("Microsoft.XMLDOM")).loadXML(t)}catch(t){e=null}return e&&e.documentElement&&!e.getElementsByTagName("parsererror").length?e:null}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(200),s=i(9),o=i(49),a=i(22),h=i(404),l=i(405),c=i(406),u=i(407),d=i(25),p=i(174),f=new n({initialize:function(t,e){this.game=t,this.scaleManager,this.canvas,this.config=e,this.enabled=!0,this.events=new s,this.isOver=!0,this.defaultCursor="",this.keyboard=e.inputKeyboard?new h(this):null,this.mouse=e.inputMouse?new l(this):null,this.touch=e.inputTouch?new u(this):null,this.pointers=[],this.pointersTotal=e.inputActivePointers,e.inputTouch&&1===this.pointersTotal&&(this.pointersTotal=2);for(var i=0;i<=this.pointersTotal;i++){var n=new c(this,i);n.smoothFactor=e.inputSmoothFactor,this.pointers.push(n)}this.mousePointer=e.inputMouse?this.pointers[0]:null,this.activePointer=this.pointers[0],this.globalTopOnly=!0,this.time=0,this._tempPoint={x:0,y:0},this._tempHitTest=[],this._tempMatrix=new d,this._tempMatrix2=new d,this._tempSkip=!1,this.mousePointerContainer=[this.mousePointer],t.events.once(a.BOOT,this.boot,this)},boot:function(){this.canvas=this.game.canvas,this.scaleManager=this.game.scale,this.events.emit(o.MANAGER_BOOT),this.game.events.on(a.PRE_RENDER,this.preRender,this),this.game.events.once(a.DESTROY,this.destroy,this)},setCanvasOver:function(t){this.isOver=!0,this.events.emit(o.GAME_OVER,t)},setCanvasOut:function(t){this.isOver=!1,this.events.emit(o.GAME_OUT,t)},preRender:function(){var t=this.game.loop.now,e=this.game.loop.delta,i=this.game.scene.getScenes(!0,!0);this.time=t,this.events.emit(o.MANAGER_UPDATE);for(var n=0;n10&&(t=10-this.pointersTotal);for(var i=0;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(89),r=i(0),s=i(22),o=i(49),a=i(141),h=i(1),l=new r({initialize:function(t){this.manager=t,this.queue=[],this.preventDefault=!0,this.captures=[],this.enabled=!1,this.target,this.onKeyDown=h,this.onKeyUp=h,t.events.once(o.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputKeyboard,this.target=t.inputKeyboardEventTarget,this.addCapture(t.inputKeyboardCapture),!this.target&&window&&(this.target=window),this.enabled&&this.target&&this.startListeners(),this.manager.game.events.on(s.POST_STEP,this.postUpdate,this)},startListeners:function(){var t=this;this.onKeyDown=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}},this.onKeyUp=function(e){if(!e.defaultPrevented&&t.enabled&&t.manager){t.queue.push(e),t.manager.events.emit(o.MANAGER_PROCESS);var i=e.altKey||e.ctrlKey||e.shiftKey||e.metaKey;t.preventDefault&&!i&&t.captures.indexOf(e.keyCode)>-1&&e.preventDefault()}};var e=this.target;e&&(e.addEventListener("keydown",this.onKeyDown,!1),e.addEventListener("keyup",this.onKeyUp,!1),this.enabled=!0)},stopListeners:function(){var t=this.target;t.removeEventListener("keydown",this.onKeyDown,!1),t.removeEventListener("keyup",this.onKeyUp,!1),this.enabled=!1},postUpdate:function(){this.queue=[]},addCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i0},clearCaptures:function(){this.captures=[],this.preventDefault=!1},destroy:function(){this.stopListeners(),this.clearCaptures(),this.queue=[],this.manager.game.events.off(s.POST_RENDER,this.postUpdate,this),this.target=null,this.enabled=!1,this.manager=null}});t.exports=l},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(188),s=i(49),o=i(1),a=new n({initialize:function(t){this.manager=t,this.preventDefaultDown=!0,this.preventDefaultUp=!0,this.preventDefaultMove=!0,this.preventDefaultWheel=!1,this.enabled=!1,this.target,this.locked=!1,this.onMouseMove=o,this.onMouseDown=o,this.onMouseUp=o,this.onMouseDownWindow=o,this.onMouseUpWindow=o,this.onMouseOver=o,this.onMouseOut=o,this.onMouseWheel=o,this.pointerLockChange=o,this.isTop=!0,t.events.once(s.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputMouse,this.target=t.inputMouseEventTarget,this.passive=t.inputMousePassive,this.preventDefaultDown=t.inputMousePreventDefaultDown,this.preventDefaultUp=t.inputMousePreventDefaultUp,this.preventDefaultMove=t.inputMousePreventDefaultMove,this.preventDefaultWheel=t.inputMousePreventDefaultWheel,this.target?"string"==typeof this.target&&(this.target=document.getElementById(this.target)):this.target=this.manager.game.canvas,t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},requestPointerLock:function(){if(r.pointerLock){var t=this.target;t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock()}},releasePointerLock:function(){r.pointerLock&&(document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock())},startListeners:function(){var t=this.target;if(t){var e=this,i=this.manager,n=i.canvas,s=window&&window.focus&&i.game.config.autoFocus;this.onMouseMove=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseMove(t),e.preventDefaultMove&&t.preventDefault())},this.onMouseDown=function(t){s&&window.focus(),!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseDown(t),e.preventDefaultDown&&t.target===n&&t.preventDefault())},this.onMouseDownWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==n&&i.onMouseDown(t)},this.onMouseUp=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&(i.onMouseUp(t),e.preventDefaultUp&&t.target===n&&t.preventDefault())},this.onMouseUpWindow=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&t.target!==n&&i.onMouseUp(t)},this.onMouseOver=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOver(t)},this.onMouseOut=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.setCanvasOut(t)},this.onMouseWheel=function(t){!t.defaultPrevented&&e.enabled&&i&&i.enabled&&i.onMouseWheel(t),e.preventDefaultWheel&&t.target===n&&t.preventDefault()};var o={passive:!0};if(t.addEventListener("mousemove",this.onMouseMove),t.addEventListener("mousedown",this.onMouseDown),t.addEventListener("mouseup",this.onMouseUp),t.addEventListener("mouseover",this.onMouseOver,o),t.addEventListener("mouseout",this.onMouseOut,o),this.preventDefaultWheel?t.addEventListener("wheel",this.onMouseWheel,{passive:!1}):t.addEventListener("wheel",this.onMouseWheel,o),window&&i.game.config.inputWindowEvents)try{window.top.addEventListener("mousedown",this.onMouseDownWindow,o),window.top.addEventListener("mouseup",this.onMouseUpWindow,o)}catch(t){window.addEventListener("mousedown",this.onMouseDownWindow,o),window.addEventListener("mouseup",this.onMouseUpWindow,o),this.isTop=!1}r.pointerLock&&(this.pointerLockChange=function(t){var n=e.target;e.locked=document.pointerLockElement===n||document.mozPointerLockElement===n||document.webkitPointerLockElement===n,i.onPointerLockChange(t)},document.addEventListener("pointerlockchange",this.pointerLockChange,!0),document.addEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.addEventListener("webkitpointerlockchange",this.pointerLockChange,!0)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("mousemove",this.onMouseMove),t.removeEventListener("mousedown",this.onMouseDown),t.removeEventListener("mouseup",this.onMouseUp),t.removeEventListener("mouseover",this.onMouseOver),t.removeEventListener("mouseout",this.onMouseOut),window&&((t=this.isTop?window.top:window).removeEventListener("mousedown",this.onMouseDownWindow),t.removeEventListener("mouseup",this.onMouseUpWindow)),r.pointerLock&&(document.removeEventListener("pointerlockchange",this.pointerLockChange,!0),document.removeEventListener("mozpointerlockchange",this.pointerLockChange,!0),document.removeEventListener("webkitpointerlockchange",this.pointerLockChange,!0))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=a},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(343),r=i(0),s=i(48),o=i(123),a=i(354),h=i(3),l=i(102),c=new r({initialize:function(t,e){this.manager=t,this.id=e,this.event,this.downElement,this.upElement,this.camera=null,this.button=0,this.buttons=0,this.position=new h,this.prevPosition=new h,this.midPoint=new h(-1,-1),this.velocity=new h,this.angle=0,this.distance=0,this.smoothFactor=0,this.motionFactor=.2,this.worldX=0,this.worldY=0,this.moveTime=0,this.downX=0,this.downY=0,this.downTime=0,this.upX=0,this.upY=0,this.upTime=0,this.primaryDown=!1,this.isDown=!1,this.wasTouch=!1,this.wasCanceled=!1,this.movementX=0,this.movementY=0,this.identifier=0,this.pointerId=null,this.active=0===e,this.locked=!1,this.deltaX=0,this.deltaY=0,this.deltaZ=0},updateWorldPoint:function(t){var e=t.getWorldPoint(this.x,this.y);return this.worldX=e.x,this.worldY=e.y,this},positionToCamera:function(t,e){return t.getWorldPoint(this.x,this.y,e)},updateMotion:function(){var t=this.position.x,e=this.position.y,i=this.midPoint.x,r=this.midPoint.y;if(t!==i||e!==r){var s=a(this.motionFactor,i,t),h=a(this.motionFactor,r,e);o(s,t,.1)&&(s=t),o(h,e,.1)&&(h=e),this.midPoint.set(s,h);var l=t-s,c=e-h;this.velocity.set(l,c),this.angle=n(s,h,t,e),this.distance=Math.sqrt(l*l+c*c)}},up:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!1,this.upX=this.x,this.upY=this.y),0===this.buttons&&(this.isDown=!1,this.upTime=t.timeStamp,this.wasTouch=!1)},down:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.button=t.button,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),0===t.button&&(this.primaryDown=!0,this.downX=this.x,this.downY=this.y),l.macOS&&t.ctrlKey&&(this.buttons=2,this.primaryDown=!1),this.isDown||(this.isDown=!0,this.downTime=t.timeStamp),this.wasTouch=!1},move:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.locked&&(this.movementX=t.movementX||t.mozMovementX||t.webkitMovementX||0,this.movementY=t.movementY||t.mozMovementY||t.webkitMovementY||0),this.moveTime=t.timeStamp,this.wasTouch=!1},wheel:function(t){"buttons"in t&&(this.buttons=t.buttons),this.event=t,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.deltaX=t.deltaX,this.deltaY=t.deltaY,this.deltaZ=t.deltaZ,this.wasTouch=!1},touchstart:function(t,e){t.pointerId&&(this.pointerId=t.pointerId),this.identifier=t.identifier,this.target=t.target,this.active=!0,this.buttons=1,this.event=e,this.downElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!0,this.downX=this.x,this.downY=this.y,this.downTime=e.timeStamp,this.isDown=!0,this.wasTouch=!0,this.wasCanceled=!1,this.updateMotion()},touchmove:function(t,e){this.event=e,this.manager.transformPointer(this,t.pageX,t.pageY,!0),this.moveTime=e.timeStamp,this.wasTouch=!0,this.updateMotion()},touchend:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!1,this.active=!1,this.updateMotion()},touchcancel:function(t,e){this.buttons=0,this.event=e,this.upElement=t.target,this.manager.transformPointer(this,t.pageX,t.pageY,!1),this.primaryDown=!1,this.upX=this.x,this.upY=this.y,this.upTime=e.timeStamp,this.isDown=!1,this.wasTouch=!0,this.wasCanceled=!0,this.active=!1},noButtonDown:function(){return 0===this.buttons},leftButtonDown:function(){return!!(1&this.buttons)},rightButtonDown:function(){return!!(2&this.buttons)},middleButtonDown:function(){return!!(4&this.buttons)},backButtonDown:function(){return!!(8&this.buttons)},forwardButtonDown:function(){return!!(16&this.buttons)},leftButtonReleased:function(){return 0===this.button&&!this.isDown},rightButtonReleased:function(){return 2===this.button&&!this.isDown},middleButtonReleased:function(){return 1===this.button&&!this.isDown},backButtonReleased:function(){return 3===this.button&&!this.isDown},forwardButtonReleased:function(){return 4===this.button&&!this.isDown},getDistance:function(){return this.isDown?s(this.downX,this.downY,this.x,this.y):s(this.downX,this.downY,this.upX,this.upY)},getDistanceX:function(){return this.isDown?Math.abs(this.downX-this.x):Math.abs(this.downX-this.upX)},getDistanceY:function(){return this.isDown?Math.abs(this.downY-this.y):Math.abs(this.downY-this.upY)},getDuration:function(){return this.isDown?this.manager.time-this.downTime:this.upTime-this.downTime},getAngle:function(){return this.isDown?n(this.downX,this.downY,this.x,this.y):n(this.downX,this.downY,this.upX,this.upY)},getInterpolatedPosition:function(t,e){void 0===t&&(t=10),void 0===e&&(e=[]);for(var i=this.prevPosition.x,n=this.prevPosition.y,r=this.position.x,s=this.position.y,o=0;o * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(49),s=i(1),o=new n({initialize:function(t){this.manager=t,this.capture=!0,this.enabled=!1,this.target,this.onTouchStart=s,this.onTouchStartWindow=s,this.onTouchMove=s,this.onTouchEnd=s,this.onTouchEndWindow=s,this.onTouchCancel=s,this.onTouchCancelWindow=s,this.onTouchOver=s,this.onTouchOut=s,t.events.once(r.MANAGER_BOOT,this.boot,this)},boot:function(){var t=this.manager.config;this.enabled=t.inputTouch,this.target=t.inputTouchEventTarget,this.capture=t.inputTouchCapture,this.target||(this.target=this.manager.game.canvas),t.disableContextMenu&&this.disableContextMenu(),this.enabled&&this.target&&this.startListeners()},disableContextMenu:function(){return document.body.addEventListener("contextmenu",(function(t){return t.preventDefault(),!1})),this},startListeners:function(){var t=this,e=this.manager.canvas,i=window&&window.focus&&this.manager.game.config.autoFocus;this.onTouchStart=function(n){i&&window.focus(),!n.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchStart(n),t.capture&&n.cancelable&&n.target===e&&n.preventDefault())},this.onTouchStartWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onTouchStart(i)},this.onTouchMove=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchMove(e),t.capture&&e.cancelable&&e.preventDefault())},this.onTouchEnd=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchEnd(i),t.capture&&i.cancelable&&i.target===e&&i.preventDefault())},this.onTouchEndWindow=function(i){!i.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&i.target!==e&&t.manager.onTouchEnd(i)},this.onTouchCancel=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&(t.manager.onTouchCancel(e),t.capture&&e.preventDefault())},this.onTouchCancelWindow=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.onTouchCancel(e)},this.onTouchOver=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOver(e)},this.onTouchOut=function(e){!e.defaultPrevented&&t.enabled&&t.manager&&t.manager.enabled&&t.manager.setCanvasOut(e)};var n=this.target;if(n){var r={passive:!0},s={passive:!1};n.addEventListener("touchstart",this.onTouchStart,this.capture?s:r),n.addEventListener("touchmove",this.onTouchMove,this.capture?s:r),n.addEventListener("touchend",this.onTouchEnd,this.capture?s:r),n.addEventListener("touchcancel",this.onTouchCancel,this.capture?s:r),n.addEventListener("touchover",this.onTouchOver,this.capture?s:r),n.addEventListener("touchout",this.onTouchOut,this.capture?s:r),window&&this.manager.game.config.inputWindowEvents&&(window.addEventListener("touchstart",this.onTouchStartWindow,s),window.addEventListener("touchend",this.onTouchEndWindow,s),window.addEventListener("touchcancel",this.onTouchCancelWindow,s)),this.enabled=!0}},stopListeners:function(){var t=this.target;t.removeEventListener("touchstart",this.onTouchStart),t.removeEventListener("touchmove",this.onTouchMove),t.removeEventListener("touchend",this.onTouchEnd),t.removeEventListener("touchcancel",this.onTouchCancel),t.removeEventListener("touchover",this.onTouchOver),t.removeEventListener("touchout",this.onTouchOut),window&&(window.removeEventListener("touchstart",this.onTouchStartWindow),window.removeEventListener("touchend",this.onTouchEndWindow))},destroy:function(){this.stopListeners(),this.target=null,this.enabled=!1,this.manager=null}});t.exports=o},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(22),s=i(9),o=i(8),a=i(16),h=i(5),l=i(2),c=i(24),u=i(89),d=new n({Extends:s,initialize:function(t){s.call(this),this.game=t,this.plugins=[],this.scenePlugins=[],this._pendingGlobal=[],this._pendingScene=[],t.isBooted?this.boot():t.events.once(r.BOOT,this.boot,this)},boot:function(){var t,e,i,n,s,o,a,h=this.game.config,c=h.installGlobalPlugins;for(c=c.concat(this._pendingGlobal),t=0;t * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(198),r=i(0),s=i(9),o=i(101),a=i(22),h=i(395),l=i(401),c=i(396),u=i(1),d=i(10),p=i(410),f=i(76),m=i(3),g=new r({Extends:s,initialize:function(t){s.call(this),this.game=t,this.canvas,this.canvasBounds=new d,this.parent=null,this.parentIsWindow=!1,this.parentSize=new p,this.gameSize=new p,this.baseSize=new p,this.displaySize=new p,this.scaleMode=n.SCALE_MODE.NONE,this.zoom=1,this._resetZoom=!1,this.displayScale=new m(1,1),this.autoRound=!1,this.autoCenter=n.CENTER.NO_CENTER,this.orientation=n.ORIENTATION.LANDSCAPE,this.fullscreen,this.fullscreenTarget=null,this._createdFullscreenTarget=!1,this.dirty=!1,this.resizeInterval=500,this._lastCheck=0,this._checkOrientation=!1,this.listeners={orientationChange:u,windowResize:u,fullScreenChange:u,fullScreenError:u}},preBoot:function(){this.parseConfig(this.game.config),this.game.events.once(a.BOOT,this.boot,this)},boot:function(){var t=this.game;this.canvas=t.canvas,this.fullscreen=t.device.fullscreen,this.scaleMode!==n.SCALE_MODE.RESIZE&&this.displaySize.setAspectMode(this.scaleMode),this.scaleMode===n.SCALE_MODE.NONE?this.resize(this.width,this.height):(this.getParentBounds(),this.parentSize.width>0&&this.parentSize.height>0&&this.displaySize.setParent(this.parentSize),this.refresh()),t.events.on(a.PRE_STEP,this.step,this),t.events.once(a.READY,this.refresh,this),t.events.once(a.DESTROY,this.destroy,this),this.startListeners()},parseConfig:function(t){this.getParent(t),this.getParentBounds();var e=t.width,i=t.height,r=t.scaleMode,s=t.zoom,o=t.autoRound;if("string"==typeof e){var a=this.parentSize.width;0===a&&(a=window.innerWidth);var h=parseInt(e,10)/100;e=Math.floor(a*h)}if("string"==typeof i){var l=this.parentSize.height;0===l&&(l=window.innerHeight);var u=parseInt(i,10)/100;i=Math.floor(l*u)}this.scaleMode=r,this.autoRound=o,this.autoCenter=t.autoCenter,this.resizeInterval=t.resizeInterval,o&&(e=Math.floor(e),i=Math.floor(i)),this.gameSize.setSize(e,i),s===n.ZOOM.MAX_ZOOM&&(s=this.getMaxZoom()),this.zoom=s,1!==s&&(this._resetZoom=!0),this.baseSize.setSize(e,i),o&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),t.minWidth>0&&this.displaySize.setMin(t.minWidth*s,t.minHeight*s),t.maxWidth>0&&this.displaySize.setMax(t.maxWidth*s,t.maxHeight*s),this.displaySize.setSize(e,i),this.orientation=c(e,i)},getParent:function(t){var e=t.parent;if(null!==e){if(this.parent=l(e),this.parentIsWindow=this.parent===document.body,t.expandParent&&t.scaleMode!==n.SCALE_MODE.NONE){var i=this.parent.getBoundingClientRect();(this.parentIsWindow||0===i.height)&&(document.documentElement.style.height="100%",document.body.style.height="100%",i=this.parent.getBoundingClientRect(),this.parentIsWindow||0!==i.height||(this.parent.style.overflow="hidden",this.parent.style.width="100%",this.parent.style.height="100%"))}t.fullscreenTarget&&!this.fullscreenTarget&&(this.fullscreenTarget=l(t.fullscreenTarget))}},getParentBounds:function(){if(!this.parent)return!1;var t=this.parentSize,e=this.parent.getBoundingClientRect();this.parentIsWindow&&this.game.device.os.iOS&&(e.height=h(!0));var i=e.width,n=e.height;return(t.width!==i||t.height!==n)&&(t.setSize(i,n),!0)},lockOrientation:function(t){var e=screen.lockOrientation||screen.mozLockOrientation||screen.msLockOrientation;return!!e&&e.call(screen,t)},setParentSize:function(t,e){return this.parentSize.setSize(t,e),this.refresh()},setGameSize:function(t,e){var i=this.autoRound;i&&(t=Math.floor(t),e=Math.floor(e));var n=this.width,r=this.height;return this.gameSize.resize(t,e),this.baseSize.resize(t,e),i&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setAspectRatio(t/e),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height,this.refresh(n,r)},resize:function(t,e){var i=this.zoom,n=this.autoRound;n&&(t=Math.floor(t),e=Math.floor(e));var r=this.width,s=this.height;this.gameSize.resize(t,e),this.baseSize.resize(t,e),n&&(this.baseSize.width=Math.floor(this.baseSize.width),this.baseSize.height=Math.floor(this.baseSize.height)),this.displaySize.setSize(t*i,e*i),this.canvas.width=this.baseSize.width,this.canvas.height=this.baseSize.height;var o=this.canvas.style,a=t*i,h=e*i;return n&&(a=Math.floor(a),h=Math.floor(h)),a===t&&h===e||(o.width=a+"px",o.height=h+"px"),this.refresh(r,s)},setZoom:function(t){return this.zoom=t,this._resetZoom=!0,this.refresh()},setMaxZoom:function(){return this.zoom=this.getMaxZoom(),this._resetZoom=!0,this.refresh()},refresh:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.updateScale(),this.updateBounds(),this.updateOrientation(),this.displayScale.set(this.baseSize.width/this.canvasBounds.width,this.baseSize.height/this.canvasBounds.height);var i=this.game.domContainer;if(i){this.baseSize.setCSS(i);var n=this.canvas.style,r=i.style;r.transform="scale("+this.displaySize.width/this.baseSize.width+","+this.displaySize.height/this.baseSize.height+")",r.marginLeft=n.marginLeft,r.marginTop=n.marginTop}return this.emit(o.RESIZE,this.gameSize,this.baseSize,this.displaySize,t,e),this},updateOrientation:function(){if(this._checkOrientation){this._checkOrientation=!1;var t=c(this.width,this.height);t!==this.orientation&&(this.orientation=t,this.emit(o.ORIENTATION_CHANGE,t))}},updateScale:function(){var t,e,i=this.canvas.style,r=this.gameSize.width,s=this.gameSize.height,o=this.zoom,a=this.autoRound;this.scaleMode===n.SCALE_MODE.NONE?(this.displaySize.setSize(r*o,s*o),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),this._resetZoom&&(i.width=t+"px",i.height=e+"px",this._resetZoom=!1)):this.scaleMode===n.SCALE_MODE.RESIZE?(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),this.gameSize.setSize(this.displaySize.width,this.displaySize.height),this.baseSize.setSize(this.displaySize.width,this.displaySize.height),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),this.canvas.width=t,this.canvas.height=e):(this.displaySize.setSize(this.parentSize.width,this.parentSize.height),t=this.displaySize.width,e=this.displaySize.height,a&&(t=Math.floor(t),e=Math.floor(e)),i.width=t+"px",i.height=e+"px"),this.getParentBounds(),this.updateCenter()},getMaxZoom:function(){var t=f(this.parentSize.width,this.gameSize.width,0,!0),e=f(this.parentSize.height,this.gameSize.height,0,!0);return Math.max(Math.min(t,e),1)},updateCenter:function(){var t=this.autoCenter;if(t!==n.CENTER.NO_CENTER){var e=this.canvas,i=e.style,r=e.getBoundingClientRect(),s=r.width,o=r.height,a=Math.floor((this.parentSize.width-s)/2),h=Math.floor((this.parentSize.height-o)/2);t===n.CENTER.CENTER_HORIZONTALLY?h=0:t===n.CENTER.CENTER_VERTICALLY&&(a=0),i.marginLeft=a+"px",i.marginTop=h+"px"}},updateBounds:function(){var t=this.canvasBounds,e=this.canvas.getBoundingClientRect();t.x=e.left+(window.pageXOffset||0)-(document.documentElement.clientLeft||0),t.y=e.top+(window.pageYOffset||0)-(document.documentElement.clientTop||0),t.width=e.width,t.height=e.height},transformX:function(t){return(t-this.canvasBounds.left)*this.displayScale.x},transformY:function(t){return(t-this.canvasBounds.top)*this.displayScale.y},startFullscreen:function(t){void 0===t&&(t={navigationUI:"hide"});var e=this.fullscreen;if(e.available){if(!e.active){var i=this.getFullscreenTarget();e.keyboard?i[e.request](Element.ALLOW_KEYBOARD_INPUT):i[e.request](t)}}else this.emit(o.FULLSCREEN_UNSUPPORTED)},fullscreenSuccessHandler:function(){this.getParentBounds(),this.refresh(),this.emit(o.ENTER_FULLSCREEN)},fullscreenErrorHandler:function(t){this.removeFullscreenTarget(),this.emit(o.FULLSCREEN_FAILED,t)},getFullscreenTarget:function(){if(!this.fullscreenTarget){var t=document.createElement("div");t.style.margin="0",t.style.padding="0",t.style.width="100%",t.style.height="100%",this.fullscreenTarget=t,this._createdFullscreenTarget=!0}return this._createdFullscreenTarget&&(this.canvas.parentNode.insertBefore(this.fullscreenTarget,this.canvas),this.fullscreenTarget.appendChild(this.canvas)),this.fullscreenTarget},removeFullscreenTarget:function(){if(this._createdFullscreenTarget){var t=this.fullscreenTarget;if(t&&t.parentNode){var e=t.parentNode;e.insertBefore(this.canvas,t),e.removeChild(t)}}},stopFullscreen:function(){var t=this.fullscreen;if(!t.available)return this.emit(o.FULLSCREEN_UNSUPPORTED),!1;t.active&&document[t.cancel](),this.removeFullscreenTarget(),this.getParentBounds(),this.emit(o.LEAVE_FULLSCREEN),this.refresh()},toggleFullscreen:function(t){this.fullscreen.active?this.stopFullscreen():this.startFullscreen(t)},startListeners:function(){var t=this,e=this.listeners;e.orientationChange=function(){t.updateBounds(),t._checkOrientation=!0,t.dirty=!0},e.windowResize=function(){t.updateBounds(),t.dirty=!0},window.addEventListener("orientationchange",e.orientationChange,!1),window.addEventListener("resize",e.windowResize,!1),this.fullscreen.available&&(e.fullScreenChange=function(e){return t.onFullScreenChange(e)},e.fullScreenError=function(e){return t.onFullScreenError(e)},["webkit","moz",""].forEach((function(t){document.addEventListener(t+"fullscreenchange",e.fullScreenChange,!1),document.addEventListener(t+"fullscreenerror",e.fullScreenError,!1)})),document.addEventListener("MSFullscreenChange",e.fullScreenChange,!1),document.addEventListener("MSFullscreenError",e.fullScreenError,!1))},onFullScreenChange:function(){document.fullscreenElement||document.webkitFullscreenElement||document.msFullscreenElement||document.mozFullScreenElement?this.fullscreenSuccessHandler():this.stopFullscreen()},onFullScreenError:function(){this.removeFullscreenTarget()},step:function(t,e){this.parent&&(this._lastCheck+=e,(this.dirty||this._lastCheck>this.resizeInterval)&&(this.getParentBounds()&&this.refresh(),this.dirty=!1,this._lastCheck=0))},stopListeners:function(){var t=this.listeners;window.removeEventListener("orientationchange",t.orientationChange,!1),window.removeEventListener("resize",t.windowResize,!1),["webkit","moz",""].forEach((function(e){document.removeEventListener(e+"fullscreenchange",t.fullScreenChange,!1),document.removeEventListener(e+"fullscreenerror",t.fullScreenError,!1)})),document.removeEventListener("MSFullscreenChange",t.fullScreenChange,!1),document.removeEventListener("MSFullscreenError",t.fullScreenError,!1)},destroy:function(){this.removeAllListeners(),this.stopListeners(),this.game=null,this.canvas=null,this.canvasBounds=null,this.parent=null,this.fullscreenTarget=null,this.parentSize.destroy(),this.gameSize.destroy(),this.baseSize.destroy(),this.displaySize.destroy()},isFullscreen:{get:function(){return this.fullscreen.active}},width:{get:function(){return this.gameSize.width}},height:{get:function(){return this.gameSize.height}},isPortrait:{get:function(){return this.orientation===n.ORIENTATION.PORTRAIT}},isLandscape:{get:function(){return this.orientation===n.ORIENTATION.LANDSCAPE}},isGamePortrait:{get:function(){return this.height>this.width}},isGameLandscape:{get:function(){return this.width>this.height}}});t.exports=g},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(18),r=i(0),s=i(76),o=i(3),a=new r({initialize:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=0),void 0===n&&(n=null),this._width=t,this._height=e,this._parent=n,this.aspectMode=i,this.aspectRatio=0===e?1:t/e,this.minWidth=0,this.minHeight=0,this.maxWidth=Number.MAX_VALUE,this.maxHeight=Number.MAX_VALUE,this.snapTo=new o},setAspectMode:function(t){return void 0===t&&(t=0),this.aspectMode=t,this.setSize(this._width,this._height)},setSnap:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.snapTo.set(t,e),this.setSize(this._width,this._height)},setParent:function(t){return this._parent=t,this.setSize(this._width,this._height)},setMin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.minWidth=n(t,0,this.maxWidth),this.minHeight=n(e,0,this.maxHeight),this.setSize(this._width,this._height)},setMax:function(t,e){return void 0===t&&(t=Number.MAX_VALUE),void 0===e&&(e=t),this.maxWidth=n(t,this.minWidth,Number.MAX_VALUE),this.maxHeight=n(e,this.minHeight,Number.MAX_VALUE),this.setSize(this._width,this._height)},setSize:function(t,e){switch(void 0===t&&(t=0),void 0===e&&(e=t),this.aspectMode){case a.NONE:this._width=this.getNewWidth(s(t,this.snapTo.x)),this._height=this.getNewHeight(s(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height;break;case a.WIDTH_CONTROLS_HEIGHT:this._width=this.getNewWidth(s(t,this.snapTo.x)),this._height=this.getNewHeight(this._width*(1/this.aspectRatio),!1);break;case a.HEIGHT_CONTROLS_WIDTH:this._height=this.getNewHeight(s(e,this.snapTo.y)),this._width=this.getNewWidth(this._height*this.aspectRatio,!1);break;case a.FIT:this.constrain(t,e,!0);break;case a.ENVELOP:this.constrain(t,e,!1)}return this},setAspectRatio:function(t){return this.aspectRatio=t,this.setSize(this._width,this._height)},resize:function(t,e){return this._width=this.getNewWidth(s(t,this.snapTo.x)),this._height=this.getNewHeight(s(e,this.snapTo.y)),this.aspectRatio=0===this._height?1:this._width/this._height,this},getNewWidth:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minWidth,this.maxWidth),e&&this._parent&&t>this._parent.width&&(t=Math.max(this.minWidth,this._parent.width)),t},getNewHeight:function(t,e){return void 0===e&&(e=!0),t=n(t,this.minHeight,this.maxHeight),e&&this._parent&&t>this._parent.height&&(t=Math.max(this.minHeight,this._parent.height)),t},constrain:function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=!0),t=this.getNewWidth(t),e=this.getNewHeight(e);var n=this.snapTo,r=0===e?1:t/e;return i&&this.aspectRatio>r||!i&&this.aspectRatio0&&(t=(e=s(e,n.y))*this.aspectRatio)):(i&&this.aspectRatior)&&(t=(e=s(e,n.y))*this.aspectRatio,n.x>0&&(e=(t=s(t,n.x))*(1/this.aspectRatio))),this._width=t,this._height=e,this},fitTo:function(t,e){return this.constrain(t,e,!0)},envelop:function(t,e){return this.constrain(t,e,!1)},setWidth:function(t){return this.setSize(t,this._height)},setHeight:function(t){return this.setSize(this._width,t)},toString:function(){return"[{ Size (width="+this._width+" height="+this._height+" aspectRatio="+this.aspectRatio+" aspectMode="+this.aspectMode+") }]"},setCSS:function(t){t&&t.style&&(t.style.width=this._width+"px",t.style.height=this._height+"px")},copy:function(t){return t.setAspectMode(this.aspectMode),t.aspectRatio=this.aspectRatio,t.setSize(this.width,this.height)},destroy:function(){this._parent=null,this.snapTo=null},width:{get:function(){return this._width},set:function(t){this.setSize(t,this._height)}},height:{get:function(){return this._height},set:function(t){this.setSize(this._width,t)}}});a.NONE=0,a.WIDTH_CONTROLS_HEIGHT=1,a.HEIGHT_CONTROLS_WIDTH=2,a.FIT=3,a.ENVELOP=4,t.exports=a},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(142),s=i(21),o=i(22),a=i(6),h=i(91),l=i(1),c=i(412),u=i(201),d=new n({initialize:function(t,e){if(this.game=t,this.keys={},this.scenes=[],this._pending=[],this._start=[],this._queue=[],this._data={},this.isProcessing=!1,this.isBooted=!1,this.customViewports=0,e){Array.isArray(e)||(e=[e]);for(var i=0;i-1&&(delete this.keys[n],this.scenes.splice(i,1),this._start.indexOf(n)>-1&&(i=this._start.indexOf(n),this._start.splice(i,1)),e.sys.destroy())}return this},bootScene:function(t){var e,i=t.sys,n=i.settings;i.sceneUpdate=l,t.init&&(t.init.call(t,n.data),n.status=r.INIT,n.isTransition&&i.events.emit(s.TRANSITION_INIT,n.transitionFrom,n.transitionDuration)),i.load&&(e=i.load).reset(),e&&t.preload?(t.preload.call(t),0===e.list.size?this.create(t):(n.status=r.LOADING,e.once(h.COMPLETE,this.loadComplete,this),e.start())):this.create(t)},loadComplete:function(t){var e=t.scene;this.game.sound&&this.game.sound.onBlurPausedSounds&&this.game.sound.unlock(),this.create(e)},payloadComplete:function(t){this.bootScene(t.scene)},update:function(t,e){this.processQueue(),this.isProcessing=!0;for(var i=this.scenes.length-1;i>=0;i--){var n=this.scenes[i].sys;n.settings.status>r.START&&n.settings.status<=r.RUNNING&&n.step(t,e)}},render:function(t){for(var e=0;e=r.LOADING&&i.settings.status0){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.unshift(i)}}return this},moveDown:function(t){if(this.isProcessing)this._queue.push({op:"moveDown",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e>0){var i=e-1,n=this.getScene(t),r=this.getAt(i);this.scenes[e]=r,this.scenes[i]=n}}return this},moveUp:function(t){if(this.isProcessing)this._queue.push({op:"moveUp",keyA:t,keyB:null});else{var e=this.getIndex(t);if(e * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(201),s=new n({initialize:function(t){this.sys=new r(this,t),this.game,this.anims,this.cache,this.registry,this.sound,this.textures,this.events,this.cameras,this.add,this.make,this.scene,this.children,this.lights,this.data,this.input,this.load,this.time,this.tweens,this.physics,this.matter,this.scale,this.plugins,this.renderer},update:function(){}});t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(2),r=i(202);t.exports=function(t){var e=t.game.config.defaultPhysicsSystem,i=n(t.settings,"physics",!1);if(e||i){var s=[];if(e&&s.push(r(e+"Physics")),i)for(var o in i)o=r(o.concat("Physics")),-1===s.indexOf(o)&&s.push(o);return s}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(2);t.exports=function(t){var e=t.plugins.getDefaultScenePlugins(),i=n(t.settings,"plugins",!1);return Array.isArray(i)?i:e||[]}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(142),r=i(6),s=i(143),o=i(974),a={create:function(t){return"string"==typeof t?t={key:t}:void 0===t&&(t={}),{status:n.PENDING,key:r(t,"key",""),active:r(t,"active",!1),visible:r(t,"visible",!0),isBooted:!1,isTransition:!1,transitionFrom:null,transitionDuration:0,transitionAllowInput:!0,data:{},pack:r(t,"pack",!1),cameras:r(t,"cameras",null),map:r(t,"map",s(o,r(t,"mapAdd",{}))),physics:r(t,"physics",{}),loader:r(t,"loader",{}),plugins:r(t,"plugins",!1),input:r(t,"input",{})}}};t.exports=a},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(31),r=i(417),s=i(0),o=i(37),a=i(32),h=i(9),l=i(103),c=i(22),u=i(382),d=i(6),p=i(419),f=i(203),m=new s({Extends:h,initialize:function(t){h.call(this),this.game=t,this.name="TextureManager",this.list={},this._tempCanvas=n.create2D(this,1,1),this._tempContext=this._tempCanvas.getContext("2d"),this._pending=0,t.events.once(c.BOOT,this.boot,this)},boot:function(){this.on(l.LOAD,this.updatePending,this),this.on(l.ERROR,this.updatePending,this);var t=this.game.config;this.addBase64("__DEFAULT",t.defaultImage),this.addBase64("__MISSING",t.missingImage),this.addBase64("__WHITE",t.whiteImage),this._pending=3,this.game.events.once(c.DESTROY,this.destroy,this)},updatePending:function(){this._pending--,0===this._pending&&(this.off(l.LOAD),this.off(l.ERROR),this.emit(l.READY))},checkKey:function(t){return!this.exists(t)||(console.error("Texture key already in use: "+t),!1)},remove:function(t){if("string"==typeof t){if(!this.exists(t))return console.warn("No texture found matching key: "+t),this;t=this.get(t)}return this.list.hasOwnProperty(t.key)&&(t.destroy(),this.emit(l.REMOVE,t.key)),this},removeKey:function(t){return this.list.hasOwnProperty(t)&&delete this.list[t],this},addBase64:function(t,e){if(this.checkKey(t)){var i=this,n=new Image;n.onerror=function(){i.emit(l.ERROR,t)},n.onload=function(){var e=i.create(t,n);p.Image(e,0),i.emit(l.ADD,t,e),i.emit(l.LOAD,t,e)},n.src=e}return this},getBase64:function(t,e,i,r){void 0===i&&(i="image/png"),void 0===r&&(r=.92);var s="",o=this.getFrame(t,e);if(o&&(o.source.isRenderTexture||o.source.isGLTexture))console.warn("Cannot getBase64 from WebGL Texture");else if(o){var a=o.canvasData,h=n.create2D(this,a.width,a.height);h.getContext("2d").drawImage(o.source.image,a.x,a.y,a.width,a.height,0,0,a.width,a.height),s=h.toDataURL(i,r),n.remove(h)}return s},addImage:function(t,e,i){var n=null;return this.checkKey(t)&&(n=this.create(t,e),p.Image(n,0),i&&n.setDataSource(i),this.emit(l.ADD,t,n)),n},addGLTexture:function(t,e,i,n){var r=null;return this.checkKey(t)&&(void 0===i&&(i=e.width),void 0===n&&(n=e.height),(r=this.create(t,e,i,n)).add("__BASE",0,0,0,i,n),this.emit(l.ADD,t,r)),r},addRenderTexture:function(t,e){var i=null;return this.checkKey(t)&&((i=this.create(t,e)).add("__BASE",0,0,0,e.width,e.height),this.emit(l.ADD,t,i)),i},generate:function(t,e){if(this.checkKey(t)){var i=n.create(this,1,1);return e.canvas=i,u(e),this.addCanvas(t,i)}return null},createCanvas:function(t,e,i){if(void 0===e&&(e=256),void 0===i&&(i=256),this.checkKey(t)){var r=n.create(this,e,i,a.CANVAS,!0);return this.addCanvas(t,r)}return null},addCanvas:function(t,e,i){void 0===i&&(i=!1);var n=null;return i?n=new r(this,t,e,e.width,e.height):this.checkKey(t)&&(n=new r(this,t,e,e.width,e.height),this.list[t]=n,this.emit(l.ADD,t,n)),n},addAtlas:function(t,e,i,n){return Array.isArray(i.textures)||Array.isArray(i.frames)?this.addAtlasJSONArray(t,e,i,n):this.addAtlasJSONHash(t,e,i,n)},addAtlasJSONArray:function(t,e,i,n){var r=null;if(this.checkKey(t)){if(r=this.create(t,e),Array.isArray(i))for(var s=1===i.length,o=0;o=s.x&&t=s.y&&e=s.x&&t=s.y&&e * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(18),s=i(37),o=i(32),a=i(136),h=i(203),l=new n({Extends:h,initialize:function(t,e,i,n,r){h.call(this,t,e,i,n,r),this.add("__BASE",0,0,0,n,r),this._source=this.frames.__BASE.source,this.canvas=this._source.image,this.context=this.canvas.getContext("2d"),this.width=n,this.height=r,this.imageData=this.context.getImageData(0,0,n,r),this.data=null,this.imageData&&(this.data=this.imageData.data),this.pixels=null,this.buffer,this.data&&(this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data)},update:function(){return this.imageData=this.context.getImageData(0,0,this.width,this.height),this.data=this.imageData.data,this.imageData.data.buffer?(this.buffer=this.imageData.data.buffer,this.pixels=new Uint32Array(this.buffer)):window.ArrayBuffer?(this.buffer=new ArrayBuffer(this.imageData.data.length),this.pixels=new Uint32Array(this.buffer)):this.pixels=this.imageData.data,this.manager.game.config.renderType===o.WEBGL&&this.refresh(),this},draw:function(t,e,i){return this.context.drawImage(i,t,e),this.update()},drawFrame:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=0);var r=this.manager.getFrame(t,e);if(r){var s=r.canvasData,o=r.cutWidth,a=r.cutHeight,h=r.source.resolution;return this.context.drawImage(r.source.image,s.x,s.y,o,a,i,n,o/h,a/h),this.update()}return this},setPixel:function(t,e,i,n,r,s){if(void 0===s&&(s=255),t=Math.abs(Math.floor(t)),e=Math.abs(Math.floor(e)),this.getIndex(t,e)>-1){var o=this.context.getImageData(t,e,1,1);o.data[0]=i,o.data[1]=n,o.data[2]=r,o.data[3]=s,this.context.putImageData(o,t,e)}return this},putData:function(t,e,i,n,r,s,o){return void 0===n&&(n=0),void 0===r&&(r=0),void 0===s&&(s=t.width),void 0===o&&(o=t.height),this.context.putImageData(t,e,i,n,r,s,o),this},getData:function(t,e,i,n){return t=r(Math.floor(t),0,this.width-1),e=r(Math.floor(e),0,this.height-1),i=r(i,1,this.width-t),n=r(n,1,this.height-e),this.context.getImageData(t,e,i,n)},getPixel:function(t,e,i){i||(i=new s);var n=this.getIndex(t,e);if(n>-1){var r=this.data,o=r[n+0],a=r[n+1],h=r[n+2],l=r[n+3];i.setTo(o,a,h,l)}return i},getPixels:function(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===n&&(n=i),t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e));for(var o=r(t,0,this.width),a=r(t+i,0,this.width),h=r(e,0,this.height),l=r(e+n,0,this.height),c=new s,u=[],d=h;d * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(31),r=i(0),s=i(136),o=i(164),a=new r({initialize:function(t,e,i,n,r){void 0===r&&(r=!1);var a=t.manager.game;this.renderer=a.renderer,this.texture=t,this.source=e,this.image=e,this.compressionAlgorithm=null,this.resolution=1,this.width=i||e.naturalWidth||e.videoWidth||e.width||0,this.height=n||e.naturalHeight||e.videoHeight||e.height||0,this.scaleMode=o.DEFAULT,this.isCanvas=e instanceof HTMLCanvasElement,this.isVideo=window.hasOwnProperty("HTMLVideoElement")&&e instanceof HTMLVideoElement,this.isRenderTexture="RenderTexture"===e.type,this.isGLTexture=window.hasOwnProperty("WebGLTexture")&&e instanceof WebGLTexture,this.isPowerOf2=s(this.width,this.height),this.glTexture=null,this.glIndex=0,this.glIndexCounter=-1,this.flipY=r,this.init(a)},init:function(t){var e=this.renderer;e&&(e.gl?this.isCanvas?this.glTexture=e.createCanvasTexture(this.image,!1,this.flipY):this.isVideo?this.glTexture=e.createVideoTexture(this.image,!1,this.flipY):this.isRenderTexture?(this.image=this.source.canvas,this.glTexture=e.createTextureFromSource(null,this.width,this.height,this.scaleMode)):this.isGLTexture?this.glTexture=this.source:this.glTexture=e.createTextureFromSource(this.image,this.width,this.height,this.scaleMode):this.isRenderTexture&&(this.image=this.source.canvas)),t.config.antialias||this.setFilter(1)},setFilter:function(t){this.renderer.gl&&this.renderer.setTextureFilter(this.glTexture,t),this.scaleMode=t},setFlipY:function(t){return void 0===t&&(t=!0),this.flipY=t,this},update:function(){var t=this.renderer.gl;t&&this.isCanvas?this.glTexture=this.renderer.updateCanvasTexture(this.image,this.glTexture,this.flipY):t&&this.isVideo&&(this.glTexture=this.renderer.updateVideoTexture(this.image,this.glTexture,this.flipY))},destroy:function(){this.glTexture&&this.renderer.deleteTexture(this.glTexture,!1),this.isCanvas&&n.remove(this.image),this.renderer=null,this.texture=null,this.source=null,this.image=null,this.glTexture=null}});t.exports=a},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={AtlasXML:i(975),Canvas:i(976),Image:i(977),JSONArray:i(978),JSONHash:i(979),SpriteSheet:i(980),SpriteSheetFromAtlas:i(981),UnityYAML:i(982)}},function(t,e,i){ /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(421),r=i(424),s=i(426),o={create:function(t){var e=t.config.audio,i=t.device.audio;return e.noAudio||!i.webAudio&&!i.audioData?new r(t):i.webAudio&&!e.disableWebAudio?new s(t):new n(t)}};t.exports=o},function(t,e,i){ /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(144),r=i(0),s=i(69),o=i(423),a=new r({Extends:n,initialize:function(t){this.override=!0,this.audioPlayDelay=.1,this.loopEndOffset=.05,this.onBlurPausedSounds=[],this.locked="ontouchstart"in window,this.lockedActionsQueue=this.locked?[]:null,this._mute=!1,this._volume=1,n.call(this,t)},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},unlock:function(){this.locked=!1;var t=this;if(this.game.cache.audio.entries.each((function(e,i){for(var n=0;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(78);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s))for(var o=r;o * @author Pavle Goloskokovic (http://prunegames.com) * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(145),r=i(0),s=i(69),o=i(18),a=new r({Extends:n,initialize:function(t,e,i){if(void 0===i&&(i={}),this.tags=t.game.cache.audio.get(e),!this.tags)throw new Error('There is no audio asset with key "'+e+'" in the audio cache');this.audio=null,this.startTime=0,this.previousTime=0,this.duration=this.tags[0].duration,this.totalDuration=this.tags[0].duration,n.call(this,t,e,i)},play:function(t,e){return!(this.manager.isLocked(this,"play",[t,e])||!n.prototype.play.call(this,t,e)||!this.pickAndPlayAudioTag()||(this.emit(s.PLAY,this),0))},pause:function(){return!(this.manager.isLocked(this,"pause")||this.startTime>0||!n.prototype.pause.call(this)||(this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.stopAndReleaseAudioTag(),this.emit(s.PAUSE,this),0))},resume:function(){return!(this.manager.isLocked(this,"resume")||this.startTime>0||!n.prototype.resume.call(this)||!this.pickAndPlayAudioTag()||(this.emit(s.RESUME,this),0))},stop:function(){return!this.manager.isLocked(this,"stop")&&!!n.prototype.stop.call(this)&&(this.stopAndReleaseAudioTag(),this.emit(s.STOP,this),!0)},pickAndPlayAudioTag:function(){if(!this.pickAudioTag())return this.reset(),!1;var t=this.currentConfig.seek,e=this.currentConfig.delay,i=(this.currentMarker?this.currentMarker.start:0)+t;return this.previousTime=i,this.audio.currentTime=i,this.applyConfig(),0===e?(this.startTime=0,this.audio.paused&&this.playCatchPromise()):(this.startTime=window.performance.now()+1e3*e,this.audio.paused||this.audio.pause()),this.resetConfig(),!0},pickAudioTag:function(){if(this.audio)return!0;for(var t=0;t0)this.startTime=i-this.manager.loopEndOffset?(this.audio.currentTime=e+Math.max(0,n-i),n=this.audio.currentTime):n=i)return this.reset(),this.stopAndReleaseAudioTag(),void this.emit(s.COMPLETE,this);this.previousTime=n}},destroy:function(){n.prototype.destroy.call(this),this.tags=null,this.audio&&this.stopAndReleaseAudioTag()},updateMute:function(){this.audio&&(this.audio.muted=this.currentConfig.mute||this.manager.mute)},updateVolume:function(){this.audio&&(this.audio.volume=o(this.currentConfig.volume*this.manager.volume,0,1))},calculateRate:function(){n.prototype.calculateRate.call(this),this.audio&&(this.audio.playbackRate=this.totalRate)},mute:{get:function(){return this.currentConfig.mute},set:function(t){this.currentConfig.mute=t,this.manager.isLocked(this,"mute",t)||(this.updateMute(),this.emit(s.MUTE,this,t))}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.currentConfig.volume},set:function(t){this.currentConfig.volume=t,this.manager.isLocked(this,"volume",t)||(this.updateVolume(),this.emit(s.VOLUME,this,t))}},setVolume:function(t){return this.volume=t,this},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.rate=t,this.manager.isLocked(this,s.RATE,t)||(this.calculateRate(),this.emit(s.RATE,this,t))}},setRate:function(t){return this.rate=t,this},detune:{get:function(){return this.currentConfig.detune},set:function(t){this.currentConfig.detune=t,this.manager.isLocked(this,s.DETUNE,t)||(this.calculateRate(),this.emit(s.DETUNE,this,t))}},setDetune:function(t){return this.detune=t,this},seek:{get:function(){return this.isPlaying?this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0):this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.isLocked(this,"seek",t)||this.startTime>0||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.isPlaying?(this.previousTime=t,this.audio.currentTime=t):this.isPaused&&(this.currentConfig.seek=t),this.emit(s.SEEK,this,t))}},setSeek:function(t){return this.seek=t,this},loop:{get:function(){return this.currentConfig.loop},set:function(t){this.currentConfig.loop=t,this.manager.isLocked(this,"loop",t)||(this.audio&&(this.audio.loop=t),this.emit(s.LOOP,this,t))}},setLoop:function(t){return this.loop=t,this},pan:{get:function(){return this.currentConfig.pan},set:function(t){this.currentConfig.pan=t,this.emit(s.PAN,this,t)}},setPan:function(t){return this.pan=t,this}});t.exports=a},function(t,e,i){ /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(144),r=i(0),s=i(9),o=i(425),a=i(1),h=new r({Extends:s,initialize:function(t){s.call(this),this.game=t,this.sounds=[],this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.pauseOnBlur=!0,this.locked=!1},add:function(t,e){var i=new o(this,t,e);return this.sounds.push(i),i},addAudioSprite:function(t,e){var i=this.add(t,e);return i.spritemap={},i},play:function(t,e){return!1},playAudioSprite:function(t,e,i){return!1},remove:function(t){return n.prototype.remove.call(this,t)},removeByKey:function(t){return n.prototype.removeByKey.call(this,t)},pauseAll:a,resumeAll:a,stopAll:a,update:a,setRate:a,setDetune:a,setMute:a,setVolume:a,forEachActiveSound:function(t,e){n.prototype.forEachActiveSound.call(this,t,e)},destroy:function(){n.prototype.destroy.call(this)}});t.exports=h},function(t,e,i){ /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(145),r=i(0),s=i(9),o=i(17),a=function(){return!1},h=function(){return this},l=new r({Extends:s,initialize:function(t,e,i){void 0===i&&(i={}),s.call(this),this.manager=t,this.key=e,this.isPlaying=!1,this.isPaused=!1,this.totalRate=1,this.duration=0,this.totalDuration=0,this.config=o({mute:!1,volume:1,rate:1,detune:0,seek:0,loop:!1,delay:0,pan:0},i),this.currentConfig=this.config,this.mute=!1,this.volume=1,this.rate=1,this.detune=0,this.seek=0,this.loop=!1,this.pan=0,this.markers={},this.currentMarker=null,this.pendingRemove=!1},addMarker:a,updateMarker:a,removeMarker:function(){return null},play:a,pause:a,resume:a,stop:a,destroy:function(){n.prototype.destroy.call(this)},setMute:h,setVolume:h,setRate:h,setDetune:h,setSeek:h,setLoop:h,setPan:h});t.exports=l},function(t,e,i){ /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(427),r=i(144),s=i(0),o=i(69),a=i(22),h=i(428),l=new s({Extends:r,initialize:function(t){this.context=this.createAudioContext(t),this.masterMuteNode=this.context.createGain(),this.masterVolumeNode=this.context.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(this.context.destination),this.destination=this.masterMuteNode,this.locked="suspended"===this.context.state&&("ontouchstart"in window||"onclick"in window),r.call(this,t),this.locked&&t.isBooted?this.unlock():t.events.once(a.BOOT,this.unlock,this)},createAudioContext:function(t){var e=t.config.audio;return e.context?(e.context.resume(),e.context):new AudioContext},setAudioContext:function(t){return this.context&&this.context.close(),this.masterMuteNode&&this.masterMuteNode.disconnect(),this.masterVolumeNode&&this.masterVolumeNode.disconnect(),this.context=t,this.masterMuteNode=t.createGain(),this.masterVolumeNode=t.createGain(),this.masterMuteNode.connect(this.masterVolumeNode),this.masterVolumeNode.connect(t.destination),this.destination=this.masterMuteNode,this},add:function(t,e){var i=new h(this,t,e);return this.sounds.push(i),i},decodeAudio:function(t,e){var i;i=Array.isArray(t)?t:[{key:t,data:e}];for(var r=this.game.cache.audio,s=i.length,a=0;a * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(256),r=0;r>4,c[h++]=(15&i)<<4|r>>2,c[h++]=(3&r)<<6|63&s;return l}},function(t,e,i){ /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(145),r=i(0),s=i(69),o=new r({Extends:n,initialize:function(t,e,i){if(void 0===i&&(i={}),this.audioBuffer=t.game.cache.audio.get(e),!this.audioBuffer)throw new Error('Audio key "'+e+'" missing from cache');this.source=null,this.loopSource=null,this.muteNode=t.context.createGain(),this.volumeNode=t.context.createGain(),this.pannerNode=null,this.playTime=0,this.startTime=0,this.loopTime=0,this.rateUpdates=[],this.hasEnded=!1,this.hasLooped=!1,this.muteNode.connect(this.volumeNode),t.context.createStereoPanner?(this.pannerNode=t.context.createStereoPanner(),this.volumeNode.connect(this.pannerNode),this.pannerNode.connect(t.destination)):this.volumeNode.connect(t.destination),this.duration=this.audioBuffer.duration,this.totalDuration=this.audioBuffer.duration,n.call(this,t,e,i)},play:function(t,e){return!!n.prototype.play.call(this,t,e)&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource(),this.emit(s.PLAY,this),!0)},pause:function(){return!(this.manager.context.currentTime-1;s--)n[r][s]=t[s][r]}return n}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ function i(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function n(t,e){return te?1:0}var r=function(t,e,s,o,a){for(void 0===s&&(s=0),void 0===o&&(o=t.length-1),void 0===a&&(a=n);o>s;){if(o-s>600){var h=o-s+1,l=e-s+1,c=Math.log(h),u=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*u*(h-u)/h)*(l-h/2<0?-1:1),p=Math.max(s,Math.floor(e-l*u/h+d)),f=Math.min(o,Math.floor(e+(h-l)*u/h+d));r(t,e,p,f,a)}var m=t[e],g=s,v=o;for(i(t,s,e),a(t[o],m)>0&&i(t,s,o);g0;)v--}0===a(t[s],m)?i(t,s,v):i(t,++v,o),v<=e&&(s=v+1),e<=v&&(o=v-1)}};t.exports=r},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(6),r=i(129),s=function(t,e,i){for(var n=[],r=0;r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={PROCESS_QUEUE_ADD:i(1035),PROCESS_QUEUE_REMOVE:i(1036)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(13);t.exports=function(t,e){var i=n(e,"anims",null);if(null===i)return t;if("string"==typeof i)t.anims.play(i);else if("object"==typeof i){var r=t.anims,s=n(i,"key",void 0);if(s){var o=n(i,"startFrame",void 0),a=n(i,"delay",0),h=n(i,"repeat",0),l=n(i,"repeatDelay",0),c=n(i,"yoyo",!1),u=n(i,"play",!1),d=n(i,"delayedPlay",0),p={key:s,delay:a,repeat:h,repeatDelay:l,yoyo:c,startFrame:o};u?r.play(p):d>0?r.playAfterDelay(p,d):r.load(p)}}return t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(106),s=new n({initialize:function(t,e,i,n,r){this.parent=t,this.x=e,this.y=i,this.frame=n,this.data={},this.tint=16777215,this._visible=r,this._alpha=1,this.flipX=!1,this.flipY=!1},setFrame:function(t){return void 0===t?this.frame=this.parent.frame:t instanceof r&&t.texture===this.parent.texture?this.frame=t:this.frame=this.parent.texture.get(t),this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this},reset:function(t,e,i){return this.x=t,this.y=e,this.flipX=!1,this.flipY=!1,this._alpha=1,this._visible=!0,this.parent.dirty=!0,i&&this.setFrame(i),this},setPosition:function(t,e){return this.x=t,this.y=e,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},setVisible:function(t){return this.visible=t,this},setAlpha:function(t){return this.alpha=t,this},setTint:function(t){return this.tint=t,this},destroy:function(){this.parent.dirty=!0,this.parent.children.remove(this),this.parent=void 0,this.frame=void 0,this.data=void 0},visible:{get:function(){return this._visible},set:function(t){this.parent.dirty|=this._visible!==t,this._visible=t}},alpha:{get:function(){return this._alpha},set:function(t){this.parent.dirty|=this._alpha>0!=t>0,this._alpha=t}}});t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(10);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=Math.min(t.x,e.x),s=Math.min(t.y,e.y),o=Math.max(t.right,e.right)-r,a=Math.max(t.bottom,e.bottom)-s;return i.setTo(r,s,o,a)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(11),s=i(1049),o=i(15),a=i(7),h=i(199),l=i(21),c=i(138),u=new n({Extends:o,Mixins:[r.AlphaSingle,r.BlendMode,r.Depth,r.Origin,r.ScrollFactor,r.Transform,r.Visible,s],initialize:function(t,e,i,n,r,s){o.call(this,t,"DOMElement"),this.parent=t.sys.game.domContainer,this.cache=t.sys.cache.html,this.node,this.transformOnly=!1,this.skewX=0,this.skewY=0,this.rotate3d=new c,this.rotate3dAngle="deg",this.width=0,this.height=0,this.displayWidth=0,this.displayHeight=0,this.handler=this.dispatchNativeEvent.bind(this),this.setPosition(e,i),"string"==typeof n?"#"===n[0]?this.setElement(n.substr(1),r,s):this.createElement(n,r,s):n&&this.setElement(n,r,s),t.sys.events.on(l.SLEEP,this.handleSceneEvent,this),t.sys.events.on(l.WAKE,this.handleSceneEvent,this)},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},handleSceneEvent:function(t){var e=this.node,i=e.style;e&&(i.display=t.settings.visible?"block":"none")},setSkew:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.skewX=t,this.skewY=e,this},setPerspective:function(t){return this.parent.style.perspective=t+"px",this},perspective:{get:function(){return parseFloat(this.parent.style.perspective)},set:function(t){this.parent.style.perspective=t+"px"}},addListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1050),r=i(15),s=i(25),o=new s,a=new s,h=new s;t.exports=function(t,e,i,s){var l=e.node,c=l.style,u=e.scene.sys.settings;if(!(l&&c&&u.visible&&r.RENDER_MASK===e.renderFlags)||0!==e.cameraFilter&&e.cameraFilter&i.id||e.parentContainer&&!e.parentContainer.willRender())l&&(c.display="none");else{var d=e.parentContainer,p=i.alpha*e.alpha;d&&(p*=d.alpha);var f=o,m=a,g=h,v=0,y=0,x="0%",b="0%";s?(v=e.width*e.scaleX*e.originX,y=e.height*e.scaleY*e.originY,m.applyITRS(e.x-v,e.y-y,e.rotation,e.scaleX,e.scaleY),f.copyFrom(i.matrix),f.multiplyWithOffset(s,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),m.e=e.x-v,m.f=e.y-y,f.multiply(m,g)):(v=e.width*e.originX,y=e.height*e.originY,m.applyITRS(e.x-v,e.y-y,e.rotation,e.scaleX,e.scaleY),f.copyFrom(i.matrix),x=100*e.originX+"%",b=100*e.originY+"%",m.e-=i.scrollX*e.scrollFactorX,m.f-=i.scrollY*e.scrollFactorY,f.multiply(m,g)),e.transformOnly||(c.display="block",c.opacity=p,c.zIndex=e._depth,c.pointerEvents="auto",c.mixBlendMode=n[e._blendMode]),c.transform=g.getCSSMatrix()+" skew("+e.skewX+"rad, "+e.skewY+"rad) rotate3d("+e.rotate3d.x+","+e.rotate3d.y+","+e.rotate3d.z+","+e.rotate3d.w+e.rotate3dAngle+")",c.transformOrigin=x+" "+b}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(11),s=i(15),o=i(1054),a=new n({Extends:s,Mixins:[r.Alpha,r.BlendMode,r.Depth,r.Flip,r.Origin,r.ScrollFactor,r.Size,r.Texture,r.Tint,r.Transform,r.Visible,o],initialize:function(t){s.call(this,t,"Extern")},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},preUpdate:function(){},render:function(){}});t.exports=a},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(215),r=i(95),s=i(14),o=i(4);t.exports=function(t,e,i){void 0===i&&(i=new o);var a=r(e,0,s.PI2);return n(t,a,i)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(441),r=i(215),s=i(95),o=i(14);t.exports=function(t,e,i,a){void 0===a&&(a=[]),!e&&i>0&&(e=n(t)/i);for(var h=0;h * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(214),r=i(30);t.exports=function(t,e,i,s,o,a){var h=e.commandBuffer,l=h.length,c=o||t.currentContext;if(0!==l&&r(t,c,e,i,s)){i.addToRenderList(e);var u=1,d=1,p=0,f=0,m=1,g=0,v=0,y=0;c.beginPath();for(var x=0;x>>16,v=(65280&p)>>>8,y=255&p,c.strokeStyle="rgba("+g+","+v+","+y+","+u+")",c.lineWidth=m,x+=3;break;case n.FILL_STYLE:f=h[x+1],d=h[x+2],g=(16711680&f)>>>16,v=(65280&f)>>>8,y=255&f,c.fillStyle="rgba("+g+","+v+","+y+","+d+")",x+=2;break;case n.BEGIN_PATH:c.beginPath();break;case n.CLOSE_PATH:c.closePath();break;case n.FILL_PATH:a||c.fill();break;case n.STROKE_PATH:a||c.stroke();break;case n.FILL_RECT:a?c.rect(h[x+1],h[x+2],h[x+3],h[x+4]):c.fillRect(h[x+1],h[x+2],h[x+3],h[x+4]),x+=4;break;case n.FILL_TRIANGLE:c.beginPath(),c.moveTo(h[x+1],h[x+2]),c.lineTo(h[x+3],h[x+4]),c.lineTo(h[x+5],h[x+6]),c.closePath(),a||c.fill(),x+=6;break;case n.STROKE_TRIANGLE:c.beginPath(),c.moveTo(h[x+1],h[x+2]),c.lineTo(h[x+3],h[x+4]),c.lineTo(h[x+5],h[x+6]),c.closePath(),a||c.stroke(),x+=6;break;case n.LINE_TO:c.lineTo(h[x+1],h[x+2]),x+=2;break;case n.MOVE_TO:c.moveTo(h[x+1],h[x+2]),x+=2;break;case n.LINE_FX_TO:c.lineTo(h[x+1],h[x+2]),x+=5;break;case n.MOVE_FX_TO:c.moveTo(h[x+1],h[x+2]),x+=5;break;case n.SAVE:c.save();break;case n.RESTORE:c.restore();break;case n.TRANSLATE:c.translate(h[x+1],h[x+2]),x+=2;break;case n.SCALE:c.scale(h[x+1],h[x+2]),x+=2;break;case n.ROTATE:c.rotate(h[x+1]),x+=1;break;case n.GRADIENT_FILL_STYLE:x+=5;break;case n.GRADIENT_LINE_STYLE:x+=6}c.restore()}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(135),s=i(80),o=i(2),a=i(66),h=new n({initialize:function(t,e,i,n){void 0===n&&(n=!1),this.propertyKey=e,this.propertyValue=i,this.defaultValue=i,this.steps=0,this.counter=0,this.start=0,this.end=0,this.ease,this.emitOnly=n,this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,this.loadConfig(t)},loadConfig:function(t,e){void 0===t&&(t={}),e&&(this.propertyKey=e),this.propertyValue=o(t,this.propertyKey,this.defaultValue),this.setMethods(),this.emitOnly&&(this.onUpdate=this.defaultUpdate)},toJSON:function(){return this.propertyValue},onChange:function(t){return this.propertyValue=t,this.setMethods()},setMethods:function(){var t=this.propertyValue,e=typeof t;if(this.onEmit=this.defaultEmit,this.onUpdate=this.defaultUpdate,"number"===e)this.onEmit=this.staticValueEmit,this.onUpdate=this.staticValueUpdate;else if(Array.isArray(t))this.onEmit=this.randomStaticValueEmit;else if("function"===e)this.emitOnly?this.onEmit=t:this.onUpdate=t;else if("object"===e&&this.hasBoth(t,"start","end")){this.start=t.start,this.end=t.end;var i=this.has(t,"random");if(i&&(this.onEmit=this.randomRangedValueEmit),this.has(t,"steps"))this.steps=t.steps,this.counter=this.start,this.onEmit=this.steppedEmit;else{var n=this.has(t,"ease")?t.ease:"Linear";this.ease=s(n,t.easeParams),i||(this.onEmit=this.easedValueEmit),this.onUpdate=this.easeValueUpdate}}else if("object"===e&&this.hasBoth(t,"min","max"))this.start=t.min,this.end=t.max,this.onEmit=this.randomRangedValueEmit;else if("object"===e&&this.has(t,"random")){var r=t.random;Array.isArray(r)&&(this.start=r[0],this.end=r[1]),this.onEmit=this.randomRangedValueEmit}else"object"===e&&this.hasEither(t,"onEmit","onUpdate")&&(this.has(t,"onEmit")&&(this.onEmit=t.onEmit),this.has(t,"onUpdate")&&(this.onUpdate=t.onUpdate));return this},has:function(t,e){return t.hasOwnProperty(e)},hasBoth:function(t,e,i){return t.hasOwnProperty(e)&&t.hasOwnProperty(i)},hasEither:function(t,e,i){return t.hasOwnProperty(e)||t.hasOwnProperty(i)},defaultEmit:function(t,e,i){return i},defaultUpdate:function(t,e,i,n){return n},staticValueEmit:function(){return this.propertyValue},staticValueUpdate:function(){return this.propertyValue},randomStaticValueEmit:function(){var t=Math.floor(Math.random()*this.propertyValue.length);return this.propertyValue[t]},randomRangedValueEmit:function(t,e){var i=r(this.start,this.end);return t&&t.data[e]&&(t.data[e].min=i),i},steppedEmit:function(){var t=this.counter,e=this.counter+(this.end-this.start)/this.steps;return this.counter=a(e,this.start,this.end),t},easedValueEmit:function(t,e){if(t&&t.data[e]){var i=t.data[e];i.min=this.start,i.max=this.end}return this.start},easeValueUpdate:function(t,e,i){var n=t.data[e];return(n.max-n.min)*this.ease(i)+n.min}});t.exports=h},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(2),s=new n({initialize:function(t,e,i,n,s){if("object"==typeof t){var o=t;t=r(o,"x",0),e=r(o,"y",0),i=r(o,"power",0),n=r(o,"epsilon",100),s=r(o,"gravity",50)}else void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=100),void 0===s&&(s=50);this.x=t,this.y=e,this.active=!0,this._gravity=s,this._power=0,this._epsilon=0,this.power=i,this.epsilon=n},update:function(t,e){var i=this.x-t.x,n=this.y-t.y,r=i*i+n*n;if(0!==r){var s=Math.sqrt(r);r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(35),s=i(48),o=new n({initialize:function(t){this.emitter=t,this.frame=null,this.x=0,this.y=0,this.velocityX=0,this.velocityY=0,this.accelerationX=0,this.accelerationY=0,this.maxVelocityX=1e4,this.maxVelocityY=1e4,this.bounce=0,this.scaleX=1,this.scaleY=1,this.alpha=1,this.angle=0,this.rotation=0,this.tint=16777215,this.life=1e3,this.lifeCurrent=1e3,this.delayCurrent=0,this.lifeT=0,this.data={tint:{min:16777215,max:16777215,current:16777215},alpha:{min:1,max:1},rotate:{min:0,max:0},scaleX:{min:1,max:1},scaleY:{min:1,max:1}}},isAlive:function(){return this.lifeCurrent>0},resetPosition:function(){this.x=0,this.y=0},fire:function(t,e){var i=this.emitter;this.frame=i.getFrame(),i.emitZone&&i.emitZone.getPoint(this),this.x+=void 0===t?i.x.onEmit(this,"x"):t,this.y+=void 0===e?i.y.onEmit(this,"y"):e,this.life=i.lifespan.onEmit(this,"lifespan"),this.lifeCurrent=this.life,this.lifeT=0;var n=i.speedX.onEmit(this,"speedX"),o=i.speedY?i.speedY.onEmit(this,"speedY"):n;if(i.radial){var a=r(i.angle.onEmit(this,"angle"));this.velocityX=Math.cos(a)*Math.abs(n),this.velocityY=Math.sin(a)*Math.abs(o)}else if(i.moveTo){var h=i.moveToX.onEmit(this,"moveToX"),l=i.moveToY?i.moveToY.onEmit(this,"moveToY"):h,c=Math.atan2(l-this.y,h-this.x),u=s(this.x,this.y,h,l)/(this.life/1e3);this.velocityX=Math.cos(c)*u,this.velocityY=Math.sin(c)*u}else this.velocityX=n,this.velocityY=o;i.acceleration&&(this.accelerationX=i.accelerationX.onEmit(this,"accelerationX"),this.accelerationY=i.accelerationY.onEmit(this,"accelerationY")),this.maxVelocityX=i.maxVelocityX.onEmit(this,"maxVelocityX"),this.maxVelocityY=i.maxVelocityY.onEmit(this,"maxVelocityY"),this.delayCurrent=i.delay.onEmit(this,"delay"),this.scaleX=i.scaleX.onEmit(this,"scaleX"),this.scaleY=i.scaleY?i.scaleY.onEmit(this,"scaleY"):this.scaleX,this.angle=i.rotate.onEmit(this,"rotate"),this.rotation=r(this.angle),this.bounce=i.bounce.onEmit(this,"bounce"),this.alpha=i.alpha.onEmit(this,"alpha"),this.tint=i.tint.onEmit(this,"tint")},computeVelocity:function(t,e,i,n){var r=this.velocityX,s=this.velocityY,o=this.accelerationX,a=this.accelerationY,h=this.maxVelocityX,l=this.maxVelocityY;r+=t.gravityX*i,s+=t.gravityY*i,o&&(r+=o*i),a&&(s+=a*i),r>h?r=h:r<-h&&(r=-h),s>l?s=l:s<-l&&(s=-l),this.velocityX=r,this.velocityY=s;for(var c=0;ce.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.ye.bottom&&t.collideBottom&&(this.y=e.bottom,this.velocityY*=i)},update:function(t,e,i){if(this.delayCurrent>0)return this.delayCurrent-=t,!1;var n=this.emitter,s=1-this.lifeCurrent/this.life;return this.lifeT=s,this.computeVelocity(n,t,e,i),this.x+=this.velocityX*e,this.y+=this.velocityY*e,n.bounds&&this.checkBounds(n),n.deathZone&&n.deathZone.willKill(this)?(this.lifeCurrent=0,!0):(this.scaleX=n.scaleX.onUpdate(this,"scaleX",s,this.scaleX),n.scaleY?this.scaleY=n.scaleY.onUpdate(this,"scaleY",s,this.scaleY):this.scaleY=this.scaleX,this.angle=n.rotate.onUpdate(this,"rotate",s,this.angle),this.rotation=r(this.angle),this.alpha=n.alpha.onUpdate(this,"alpha",s,this.alpha),this.tint=n.tint.onUpdate(this,"tint",s,this.tint),this.lifeCurrent-=t,this.lifeCurrent<=0)}});t.exports=o},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(34),r=i(0),s=i(11),o=i(447),a=i(448),h=i(443),l=i(2),c=i(207),u=i(449),d=i(125),p=i(445),f=i(450),m=i(10),g=i(79),v=i(3),y=i(66),x=new r({Mixins:[s.BlendMode,s.Mask,s.ScrollFactor,s.Visible],initialize:function(t,e){this.manager=t,this.texture=t.texture,this.frames=[t.defaultFrame],this.defaultFrame=t.defaultFrame,this.configFastMap=["active","blendMode","collideBottom","collideLeft","collideRight","collideTop","deathCallback","deathCallbackScope","emitCallback","emitCallbackScope","follow","frequency","gravityX","gravityY","maxParticles","name","on","particleBringToTop","particleClass","radial","timeScale","trackVisible","visible"],this.configOpMap=["accelerationX","accelerationY","angle","alpha","bounce","delay","lifespan","maxVelocityX","maxVelocityY","moveToX","moveToY","quantity","rotate","scaleX","scaleY","speedX","speedY","tint","x","y"],this.name="",this.particleClass=p,this.x=new h(e,"x",0,!0),this.y=new h(e,"y",0,!0),this.radial=!0,this.gravityX=0,this.gravityY=0,this.acceleration=!1,this.accelerationX=new h(e,"accelerationX",0,!0),this.accelerationY=new h(e,"accelerationY",0,!0),this.maxVelocityX=new h(e,"maxVelocityX",1e4,!0),this.maxVelocityY=new h(e,"maxVelocityY",1e4,!0),this.speedX=new h(e,"speedX",0,!0),this.speedY=new h(e,"speedY",0,!0),this.moveTo=!1,this.moveToX=new h(e,"moveToX",0,!0),this.moveToY=new h(e,"moveToY",0,!0),this.bounce=new h(e,"bounce",0,!0),this.scaleX=new h(e,"scaleX",1),this.scaleY=new h(e,"scaleY",1),this.tint=new h(e,"tint",16777215),this.alpha=new h(e,"alpha",1),this.lifespan=new h(e,"lifespan",1e3,!0),this.angle=new h(e,"angle",{min:0,max:360},!0),this.rotate=new h(e,"rotate",0),this.emitCallback=null,this.emitCallbackScope=null,this.deathCallback=null,this.deathCallbackScope=null,this.maxParticles=0,this.quantity=new h(e,"quantity",1,!0),this.delay=new h(e,"delay",0,!0),this.frequency=0,this.on=!0,this.particleBringToTop=!0,this.timeScale=1,this.emitZone=null,this.deathZone=null,this.bounds=null,this.collideLeft=!0,this.collideRight=!0,this.collideTop=!0,this.collideBottom=!0,this.active=!0,this.visible=!0,this.blendMode=n.NORMAL,this.follow=null,this.followOffset=new v,this.trackVisible=!1,this.currentFrame=0,this.randomFrame=!0,this.frameQuantity=1,this.dead=[],this.alive=[],this._counter=0,this._frameCounter=0,e&&this.fromJSON(e)},fromJSON:function(t){if(!t)return this;var e=0,i="";for(e=0;e0&&this.getParticleCount()===this.maxParticles},onParticleEmit:function(t,e){return void 0===t?(this.emitCallback=null,this.emitCallbackScope=null):"function"==typeof t&&(this.emitCallback=t,e&&(this.emitCallbackScope=e)),this},onParticleDeath:function(t,e){return void 0===t?(this.deathCallback=null,this.deathCallbackScope=null):"function"==typeof t&&(this.deathCallback=t,e&&(this.deathCallbackScope=e)),this},killAll:function(){for(var t=this.dead,e=this.alive;e.length>0;)t.push(e.pop());return this},forEachAlive:function(t,e){for(var i=this.alive,n=i.length,r=0;r0){var c=this.deathCallback,u=this.deathCallbackScope;for(o=h-1;o>=0;o--){var d=a[o];r.splice(d.index,1),s.push(d.particle),c&&c.call(u,d.particle),d.particle.resetPosition()}}this.on&&(0===this.frequency?this.emitParticle():this.frequency>0&&(this._counter-=e,this._counter<=0&&(this.emitParticle(),this._counter=this.frequency-Math.abs(this._counter))))},depthSortCallback:function(t,e){return t.y-e.y}});t.exports=x},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=new(i(0))({initialize:function(t,e){this.source=t,this.killOnEnter=e},willKill:function(t){var e=this.source.contains(t.x,t.y);return e&&this.killOnEnter||!e&&!this.killOnEnter}});t.exports=n},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=new(i(0))({initialize:function(t,e,i,n,r){void 0===n&&(n=!1),void 0===r&&(r=!0),this.source=t,this.points=[],this.quantity=e,this.stepRate=i,this.yoyo=n,this.counter=-1,this.seamless=r,this._length=0,this._direction=0,this.updateSource()},updateSource:function(){if(this.points=this.source.getPoints(this.quantity,this.stepRate),this.seamless){var t=this.points[0],e=this.points[this.points.length-1];t.x===e.x&&t.y===e.y&&this.points.pop()}var i=this._length;return this._length=this.points.length,this._lengththis._length&&(this.counter=this._length-1),this},changeSource:function(t){return this.source=t,this.updateSource()},getPoint:function(t){0===this._direction?(this.counter++,this.counter>=this._length&&(this.yoyo?(this._direction=1,this.counter=this._length-1):this.counter=0)):(this.counter--,-1===this.counter&&(this.yoyo?(this._direction=0,this.counter=0):this.counter=this._length-1));var e=this.points[this.counter];e&&(t.x=e.x,t.y=e.y)}});t.exports=n},function(t,e){t.exports=function(t,e){for(var i=0;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(3),s=new n({initialize:function(t){this.source=t,this._tempVec=new r},getPoint:function(t){var e=this._tempVec;this.source.getRandomPoint(e),t.x=e.x,t.y=e.y}});t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(11),s=i(73),o=new n({Extends:s,Mixins:[r.PathFollower],initialize:function(t,e,i,n,r,o){s.call(this,t,i,n,r,o),this.path=e},preUpdate:function(t,e){this.anims.update(t,e),this.pathUpdate(t)}});t.exports=o},function(t,e){t.exports=function(t,e,i){var n=t.canvas,r=t.context,s=t.style,o=[],a=0,h=i.length;s.maxLines>0&&s.maxLines1&&(d+=p*(h-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:p,lineHeight:u}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(13),s=i(6),o=i(454),a={fontFamily:["fontFamily","Courier"],fontSize:["fontSize","16px"],fontStyle:["fontStyle",""],backgroundColor:["backgroundColor",null],color:["color","#fff"],stroke:["stroke","#fff"],strokeThickness:["strokeThickness",0],shadowOffsetX:["shadow.offsetX",0],shadowOffsetY:["shadow.offsetY",0],shadowColor:["shadow.color","#000"],shadowBlur:["shadow.blur",0],shadowStroke:["shadow.stroke",!1],shadowFill:["shadow.fill",!1],align:["align","left"],maxLines:["maxLines",0],fixedWidth:["fixedWidth",0],fixedHeight:["fixedHeight",0],resolution:["resolution",0],rtl:["rtl",!1],testString:["testString","|MÉqgy"],baselineX:["baselineX",1.2],baselineY:["baselineY",1.4],wordWrapWidth:["wordWrap.width",null],wordWrapCallback:["wordWrap.callback",null],wordWrapCallbackScope:["wordWrap.callbackScope",null],wordWrapUseAdvanced:["wordWrap.useAdvancedWrap",!1]},h=new n({initialize:function(t,e){this.parent=t,this.fontFamily,this.fontSize,this.fontStyle,this.backgroundColor,this.color,this.stroke,this.strokeThickness,this.shadowOffsetX,this.shadowOffsetY,this.shadowColor,this.shadowBlur,this.shadowStroke,this.shadowFill,this.align,this.maxLines,this.fixedWidth,this.fixedHeight,this.resolution,this.rtl,this.testString,this.baselineX,this.baselineY,this.wordWrapWidth,this.wordWrapCallback,this.wordWrapCallbackScope,this.wordWrapUseAdvanced,this._font,this.setStyle(e,!1,!0);var i=s(e,"metrics",!1);this.metrics=i?{ascent:s(i,"ascent",0),descent:s(i,"descent",0),fontSize:s(i,"fontSize",0)}:o(this)},setStyle:function(t,e,i){for(var n in void 0===e&&(e=!0),void 0===i&&(i=!1),t&&t.hasOwnProperty("fontSize")&&"number"==typeof t.fontSize&&(t.fontSize=t.fontSize.toString()+"px"),a){var o=i?a[n][1]:this[n];this[n]="wordWrapCallback"===n||"wordWrapCallbackScope"===n?s(t,a[n][0],o):r(t,a[n][0],o)}var h=s(t,"font",null);null!==h&&this.setFont(h,!1),this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim();var l=s(t,"fill",null);return null!==l&&(this.color=l),e?this.update(!0):this.parent},syncFont:function(t,e){e.font=this._font},syncStyle:function(t,e){e.textBaseline="alphabetic",e.fillStyle=this.color,e.strokeStyle=this.stroke,e.lineWidth=this.strokeThickness,e.lineCap="round",e.lineJoin="round"},syncShadow:function(t,e){e?(t.shadowOffsetX=this.shadowOffsetX,t.shadowOffsetY=this.shadowOffsetY,t.shadowColor=this.shadowColor,t.shadowBlur=this.shadowBlur):(t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowColor=0,t.shadowBlur=0)},update:function(t){return t&&(this._font=[this.fontStyle,this.fontSize,this.fontFamily].join(" ").trim(),this.metrics=o(this)),this.parent.updateText()},setFont:function(t,e){void 0===e&&(e=!0);var i=t,n="",r="";if("string"!=typeof t)i=s(t,"fontFamily","Courier"),n=s(t,"fontSize","16px"),r=s(t,"fontStyle","");else{var o=t.split(" "),a=0;r=o.length>2?o[a++]:"",n=o[a++]||"16px",i=o[a++]||"Courier"}return i===this.fontFamily&&n===this.fontSize&&r===this.fontStyle||(this.fontFamily=i,this.fontSize=n,this.fontStyle=r,e&&this.update(!0)),this.parent},setFontFamily:function(t){return this.fontFamily!==t&&(this.fontFamily=t,this.update(!0)),this.parent},setFontStyle:function(t){return this.fontStyle!==t&&(this.fontStyle=t,this.update(!0)),this.parent},setFontSize:function(t){return"number"==typeof t&&(t=t.toString()+"px"),this.fontSize!==t&&(this.fontSize=t,this.update(!0)),this.parent},setTestString:function(t){return this.testString=t,this.update(!0)},setFixedSize:function(t,e){return this.fixedWidth=t,this.fixedHeight=e,t&&(this.parent.width=t),e&&(this.parent.height=e),this.update(!1)},setBackgroundColor:function(t){return this.backgroundColor=t,this.update(!1)},setFill:function(t){return this.color=t,this.update(!1)},setColor:function(t){return this.color=t,this.update(!1)},setResolution:function(t){return this.resolution=t,this.update(!1)},setStroke:function(t,e){return void 0===e&&(e=this.strokeThickness),void 0===t&&0!==this.strokeThickness?(this.strokeThickness=0,this.update(!0)):this.stroke===t&&this.strokeThickness===e||(this.stroke=t,this.strokeThickness=e,this.update(!0)),this.parent},setShadow:function(t,e,i,n,r,s){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i="#000"),void 0===n&&(n=0),void 0===r&&(r=!1),void 0===s&&(s=!0),this.shadowOffsetX=t,this.shadowOffsetY=e,this.shadowColor=i,this.shadowBlur=n,this.shadowStroke=r,this.shadowFill=s,this.update(!1)},setShadowOffset:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.shadowOffsetX=t,this.shadowOffsetY=e,this.update(!1)},setShadowColor:function(t){return void 0===t&&(t="#000"),this.shadowColor=t,this.update(!1)},setShadowBlur:function(t){return void 0===t&&(t=0),this.shadowBlur=t,this.update(!1)},setShadowStroke:function(t){return this.shadowStroke=t,this.update(!1)},setShadowFill:function(t){return this.shadowFill=t,this.update(!1)},setWordWrapWidth:function(t,e){return void 0===e&&(e=!1),this.wordWrapWidth=t,this.wordWrapUseAdvanced=e,this.update(!1)},setWordWrapCallback:function(t,e){return void 0===e&&(e=null),this.wordWrapCallback=t,this.wordWrapCallbackScope=e,this.update(!1)},setAlign:function(t){return void 0===t&&(t="left"),this.align=t,this.update(!1)},setMaxLines:function(t){return void 0===t&&(t=0),this.maxLines=t,this.update(!1)},getTextMetrics:function(){var t=this.metrics;return{ascent:t.ascent,descent:t.descent,fontSize:t.fontSize}},toJSON:function(){var t={};for(var e in a)t[e]=this[e];return t.metrics=this.getTextMetrics(),t},destroy:function(){this.parent=void 0}});t.exports=h},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(31);t.exports=function(t){var e=n.create(this),i=e.getContext("2d");t.syncFont(e,i);var r=i.measureText(t.testString);if(r.hasOwnProperty("actualBoundingBoxAscent")){var s=r.actualBoundingBoxAscent,o=r.actualBoundingBoxDescent;return n.remove(e),{ascent:s,descent:o,fontSize:s+o}}var a=Math.ceil(r.width*t.baselineX),h=a,l=2*h;h=h*t.baselineY|0,e.width=a,e.height=l,i.fillStyle="#f00",i.fillRect(0,0,a,l),i.font=t._font,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(t.testString,0,h);var c={ascent:0,descent:0,fontSize:0};if(!i.getImageData(0,0,a,l))return c.ascent=h,c.descent=h+6,c.fontSize=c.ascent+c.descent,n.remove(e),c;var u,d,p=i.getImageData(0,0,a,l).data,f=p.length,m=4*a,g=0,v=!1;for(u=0;uh;u--){for(d=0;d * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1091),r=i(0),s=i(35),o=i(68),a=i(62),h=i(14),l=i(33),c=new r({Extends:l,Mixins:[n],initialize:function(t,e,i,n,r,s,o,h,c){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===r&&(r=0),void 0===s&&(s=360),void 0===o&&(o=!1),l.call(this,t,"Arc",new a(0,0,n)),this._startAngle=r,this._endAngle=s,this._anticlockwise=o,this._iterations=.01,this.setPosition(e,i);var u=2*this.geom.radius;this.setSize(u,u),void 0!==h&&this.setFillStyle(h,c),this.updateDisplayOrigin(),this.updateData()},iterations:{get:function(){return this._iterations},set:function(t){this._iterations=t,this.updateData()}},radius:{get:function(){return this.geom.radius},set:function(t){this.geom.radius=t;var e=2*t;this.setSize(e,e),this.updateDisplayOrigin(),this.updateData()}},startAngle:{get:function(){return this._startAngle},set:function(t){this._startAngle=t,this.updateData()}},endAngle:{get:function(){return this._endAngle},set:function(t){this._endAngle=t,this.updateData()}},anticlockwise:{get:function(){return this._anticlockwise},set:function(t){this._anticlockwise=t,this.updateData()}},setRadius:function(t){return this.radius=t,this},setIterations:function(t){return void 0===t&&(t=.01),this.iterations=t,this},setStartAngle:function(t,e){return this._startAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},setEndAngle:function(t,e){return this._endAngle=t,void 0!==e&&(this._anticlockwise=e),this.updateData()},updateData:function(){var t=this._iterations,e=t,i=this.geom.radius,n=s(this._startAngle),r=s(this._endAngle),a=i,l=i;r-=n,this._anticlockwise?r<-h.PI2?r=-h.PI2:r>0&&(r=-h.PI2+r%h.PI2):r>h.PI2?r=h.PI2:r<0&&(r=h.PI2+r%h.PI2);for(var c,u=[a+Math.cos(n)*i,l+Math.sin(n)*i];e<1;)c=r*e+n,u.push(a+Math.cos(c)*i,l+Math.sin(c)*i),e+=t;return c=r+n,u.push(a+Math.cos(c)*i,l+Math.sin(c)*i),u.push(a+Math.cos(n)*i,l+Math.sin(n)*i),this.pathIndexes=o(u),this.pathData=u,this}});t.exports=c},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(1094),s=i(68),o=i(10),a=i(33),h=new n({Extends:a,Mixins:[r],initialize:function(t,e,i,n,r,s){void 0===e&&(e=0),void 0===i&&(i=0),a.call(this,t,"Curve",n),this._smoothness=32,this._curveBounds=new o,this.closePath=!1,this.setPosition(e,i),void 0!==r&&this.setFillStyle(r,s),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){var t=this._curveBounds,e=this._smoothness;this.geom.getBounds(t,e),this.setSize(t.width,t.height),this.updateDisplayOrigin();for(var i=[],n=this.geom.getPoints(e),r=0;r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(68),s=i(1097),o=i(108),a=i(33),h=new n({Extends:a,Mixins:[s],initialize:function(t,e,i,n,r,s,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===r&&(r=128),a.call(this,t,"Ellipse",new o(n/2,r/2,n,r)),this._smoothness=64,this.setPosition(e,i),this.width=n,this.height=r,void 0!==s&&this.setFillStyle(s,h),this.updateDisplayOrigin(),this.updateData()},smoothness:{get:function(){return this._smoothness},set:function(t){this._smoothness=t,this.updateData()}},setSize:function(t,e){return this.width=t,this.height=e,this.geom.setPosition(t/2,e/2),this.geom.setSize(t,e),this.updateData()},setSmoothness:function(t){return this._smoothness=t,this.updateData()},updateData:function(){for(var t=[],e=this.geom.getPoints(this._smoothness),i=0;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(33),s=i(1100),o=new n({Extends:r,Mixins:[s],initialize:function(t,e,i,n,s,o,a,h,l,c,u){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===s&&(s=128),void 0===o&&(o=32),void 0===a&&(a=32),r.call(this,t,"Grid",null),this.cellWidth=o,this.cellHeight=a,this.showCells=!0,this.outlineFillColor=0,this.outlineFillAlpha=0,this.showOutline=!0,this.showAltCells=!1,this.altFillColor,this.altFillAlpha,this.setPosition(e,i),this.setSize(n,s),this.setFillStyle(h,l),void 0!==c&&this.setOutlineStyle(c,u),this.updateDisplayOrigin()},setFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showCells=!1:(this.fillColor=t,this.fillAlpha=e,this.showCells=!0),this},setAltFillStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showAltCells=!1:(this.altFillColor=t,this.altFillAlpha=e,this.showAltCells=!0),this},setOutlineStyle:function(t,e){return void 0===e&&(e=1),void 0===t?this.showOutline=!1:(this.outlineFillColor=t,this.outlineFillAlpha=e,this.showOutline=!0),this}});t.exports=o},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1103),r=i(0),s=i(33),o=new r({Extends:s,Mixins:[n],initialize:function(t,e,i,n,r,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=48),void 0===r&&(r=32),void 0===o&&(o=15658734),void 0===a&&(a=10066329),void 0===h&&(h=13421772),s.call(this,t,"IsoBox",null),this.projection=4,this.fillTop=o,this.fillLeft=a,this.fillRight=h,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isFilled=!0,this.setPosition(e,i),this.setSize(n,r),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=o},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(1106),s=i(33),o=new n({Extends:s,Mixins:[r],initialize:function(t,e,i,n,r,o,a,h,l){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=48),void 0===r&&(r=32),void 0===o&&(o=!1),void 0===a&&(a=15658734),void 0===h&&(h=10066329),void 0===l&&(l=13421772),s.call(this,t,"IsoTriangle",null),this.projection=4,this.fillTop=a,this.fillLeft=h,this.fillRight=l,this.showTop=!0,this.showLeft=!0,this.showRight=!0,this.isReversed=o,this.isFilled=!0,this.setPosition(e,i),this.setSize(n,r),this.updateDisplayOrigin()},setProjection:function(t){return this.projection=t,this},setReversed:function(t){return this.isReversed=t,this},setFaces:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!0),this.showTop=t,this.showLeft=e,this.showRight=i,this},setFillStyle:function(t,e,i){return this.fillTop=t,this.fillLeft=e,this.fillRight=i,this.isFilled=!0,this}});t.exports=o},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(33),s=i(45),o=i(1109),a=new n({Extends:r,Mixins:[o],initialize:function(t,e,i,n,o,a,h,l,c){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===o&&(o=0),void 0===a&&(a=128),void 0===h&&(h=0),r.call(this,t,"Line",new s(n,o,a,h));var u=Math.max(1,this.geom.right-this.geom.left),d=Math.max(1,this.geom.bottom-this.geom.top);this.lineWidth=1,this._startWidth=1,this._endWidth=1,this.setPosition(e,i),this.setSize(u,d),void 0!==l&&this.setStrokeStyle(1,l,c),this.updateDisplayOrigin()},setLineWidth:function(t,e){return void 0===e&&(e=t),this._startWidth=t,this._endWidth=e,this.lineWidth=t,this},setTo:function(t,e,i,n){return this.geom.setTo(t,e,i,n),this}});t.exports=a},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1112),r=i(0),s=i(68),o=i(463),a=i(224),h=i(33),l=i(466),c=new r({Extends:h,Mixins:[n],initialize:function(t,e,i,n,r,s){void 0===e&&(e=0),void 0===i&&(i=0),h.call(this,t,"Polygon",new a(n));var l=o(this.geom);this.setPosition(e,i),this.setSize(l.width,l.height),void 0!==r&&this.setFillStyle(r,s),this.updateDisplayOrigin(),this.updateData()},smooth:function(t){void 0===t&&(t=1);for(var e=0;e * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(10);t.exports=function(t,e){void 0===e&&(e=new n);for(var i,r=1/0,s=1/0,o=-r,a=-s,h=0;h * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(64),r=i(45),s=i(465);t.exports=function(t,e,i,o){void 0===o&&(o=[]);var a=t.points,h=s(t);!e&&i>0&&(e=h/i);for(var l=0;lu+g)){var v=m.getPoint((c-u)/g);o.push(v);break}u+=g}return o}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(64),r=i(45);t.exports=function(t){for(var e=t.points,i=0,s=0;s * @author Igor Ognichenko * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i=function(t,e){return t[0]=e[0],t[1]=e[1],t};t.exports=function(t){var e,n=[],r=t.points;for(e=0;e0&&s.push(i([0,0],n[0])),e=0;e1&&s.push(i([0,0],n[n.length-1])),t.setTo(s)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(10),s=i(33),o=i(1115),a=new n({Extends:s,Mixins:[o],initialize:function(t,e,i,n,o,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=128),void 0===o&&(o=128),s.call(this,t,"Rectangle",new r(0,0,n,o)),this.setPosition(e,i),this.setSize(n,o),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setSize:function(t,e){return this.width=t,this.height=e,this.geom.setSize(t,e),this.updateData(),this},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),e.getLineD(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1118),r=i(0),s=i(68),o=i(33),a=new r({Extends:o,Mixins:[n],initialize:function(t,e,i,n,r,s,a,h){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=5),void 0===r&&(r=32),void 0===s&&(s=64),o.call(this,t,"Star",null),this._points=n,this._innerRadius=r,this._outerRadius=s,this.setPosition(e,i),this.setSize(2*s,2*s),void 0!==a&&this.setFillStyle(a,h),this.updateDisplayOrigin(),this.updateData()},setPoints:function(t){return this._points=t,this.updateData()},setInnerRadius:function(t){return this._innerRadius=t,this.updateData()},setOuterRadius:function(t){return this._outerRadius=t,this.updateData()},points:{get:function(){return this._points},set:function(t){this._points=t,this.updateData()}},innerRadius:{get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this.updateData()}},outerRadius:{get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this.updateData()}},updateData:function(){var t=[],e=this._points,i=this._innerRadius,n=this._outerRadius,r=Math.PI/2*3,o=Math.PI/e,a=n,h=n;t.push(a,h+-n);for(var l=0;l * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(33),s=i(82),o=i(1121),a=new n({Extends:r,Mixins:[o],initialize:function(t,e,i,n,o,a,h,l,c,u,d){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===o&&(o=128),void 0===a&&(a=64),void 0===h&&(h=0),void 0===l&&(l=128),void 0===c&&(c=128),r.call(this,t,"Triangle",new s(n,o,a,h,l,c));var p=this.geom.right-this.geom.left,f=this.geom.bottom-this.geom.top;this.setPosition(e,i),this.setSize(p,f),void 0!==u&&this.setFillStyle(u,d),this.updateDisplayOrigin(),this.updateData()},setTo:function(t,e,i,n,r,s){return this.geom.setTo(t,e,i,n,r,s),this.updateData()},updateData:function(){var t=[],e=this.geom,i=this._tempLine;return e.getLineA(i),t.push(i.x1,i.y1,i.x2,i.y2),e.getLineB(i),t.push(i.x2,i.y2),e.getLineC(i),t.push(i.x2,i.y2),this.pathData=t,this}});t.exports=a},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4),r=i(64);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=t.getLineA(),o=t.getLineB(),a=t.getLineC();if(e<=0||e>=1)return i.x=s.x1,i.y=s.y1,i;var h=r(s),l=r(o),c=r(a),u=(h+l+c)*e,d=0;return uh+l?(d=(u-=h+l)/c,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(u-=h)/l,i.x=o.x1+(o.x2-o.x1)*d,i.y=o.y1+(o.y2-o.y1)*d),i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(64),r=i(4);t.exports=function(t,e,i,s){void 0===s&&(s=[]);var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=n(o),c=n(a),u=n(h),d=l+c+u;!e&&i>0&&(e=d/i);for(var p=0;pl+c?(m=(f-=l+c)/u,g.x=h.x1+(h.x2-h.x1)*m,g.y=h.y1+(h.y2-h.y1)*m):(m=(f-=l)/c,g.x=a.x1+(a.x2-a.x1)*m,g.y=a.y1+(a.y2-a.y1)*m),s.push(g)}return s}},function(t,e){t.exports=function(t,e,i){if(!t||"number"==typeof t)return!1;if(t.hasOwnProperty(e))return t[e]=i,!0;if(-1!==e.indexOf(".")){for(var n=e.split("."),r=t,s=t,o=0;o * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(113),r=i(115);t.exports=function(t,e,i,s,o,a,h){if(void 0===s&&(s=!1),void 0===a&&(a=16777215),void 0===h&&(h=1),t.length===e.length){var l,c,u,d,p,f,m,g,v,y,x,b={faces:[],vertices:[]},w=s?3:2,T=Array.isArray(a),_=Array.isArray(h);if(Array.isArray(i)&&i.length>0)for(l=0;l * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(113),r=i(67),s=i(38),o=i(115),a=new s,h=new s,l=new r;t.exports=function(t,e,i,r,s,c,u,d,p,f){void 0===i&&(i=1),void 0===r&&(r=0),void 0===s&&(s=0),void 0===c&&(c=0),void 0===u&&(u=0),void 0===d&&(d=0),void 0===p&&(p=0),void 0===f&&(f=!0);var m={faces:[],verts:[]},g=t.materials;a.set(r,s,c),h.set(u,d,p),l.fromRotationXYTranslation(h,a,f);for(var v=0;v * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(62),r=i(0),s=i(11),o=i(197),a=i(12),h=new r({Extends:n,Mixins:[s.ScrollFactor,s.Visible],initialize:function(t,e,i,r,s,a,h){n.call(this,t,e,i),this.color=new o(r,s,a),this.intensity=h,this.renderFlags=15,this.cameraFilter=0,this.setScrollFactor(1,1)},willRender:function(t){return!(h.RENDER_MASK!==this.renderFlags||0!==this.cameraFilter&&this.cameraFilter&t.id)},setColor:function(t){var e=a.getFloatsFromUintRGB(t);return this.color.set(e[0],e[1],e[2]),this},setIntensity:function(t){return this.intensity=t,this},setRadius:function(t){return this.radius=t,this}});h.RENDER_MASK=15,t.exports=h},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(150),r=i(0),s=i(48),o=i(475),a=i(149),h=i(197),l=i(74),c=i(79),u=i(12),d=new r({initialize:function(){this.lights=[],this.ambientColor=new h(.1,.1,.1),this.active=!1,this.maxLights=-1,this.visibleLights=0},addPointLight:function(t,e,i,n,r){return this.systems.displayList.add(new a(this.scene,t,e,i,n,r))},enable:function(){return-1===this.maxLights&&(this.maxLights=this.scene.sys.renderer.config.maxLights),this.active=!0,this},disable:function(){return this.active=!1,this},getLights:function(t){for(var e=this.lights,i=t.worldView,r=[],o=0;othis.maxLights&&(c(r,this.sortByDistance),r=r.slice(0,this.maxLights)),this.visibleLights=r.length,r},sortByDistance:function(t,e){return t.distance>=e.distance},setAmbientColor:function(t){var e=u.getFloatsFromUintRGB(t);return this.ambientColor.set(e[0],e[1],e[2]),this},getMaxVisibleLights:function(){return this.maxLights},getLightCount:function(){return this.lights.length},addLight:function(t,e,i,n,r){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=128),void 0===n&&(n=16777215),void 0===r&&(r=1);var s=u.getFloatsFromUintRGB(n),a=new o(t,e,i,s[0],s[1],s[2],r);return this.lights.push(a),a},removeLight:function(t){var e=this.lights.indexOf(t);return e>=0&&l(this.lights,e),this},shutdown:function(){this.lights.length=0},destroy:function(){this.shutdown()}});t.exports=d},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(55),r=i(17),s={Circle:i(1185),Ellipse:i(1195),Intersects:i(478),Line:i(1215),Mesh:i(1237),Point:i(1240),Polygon:i(1254),Rectangle:i(496),Triangle:i(1287)};s=r(!1,s,n),t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={CircleToCircle:i(228),CircleToRectangle:i(150),GetCircleToCircle:i(1205),GetCircleToRectangle:i(1206),GetLineToCircle:i(229),GetLineToLine:i(479),GetLineToPoints:i(480),GetLineToPolygon:i(481),GetLineToRectangle:i(231),GetRaysFromPointToPolygon:i(1207),GetRectangleIntersection:i(1208),GetRectangleToRectangle:i(1209),GetRectangleToTriangle:i(1210),GetTriangleToCircle:i(1211),GetTriangleToLine:i(486),GetTriangleToTriangle:i(1212),LineToCircle:i(230),LineToLine:i(92),LineToRectangle:i(482),PointToLine:i(490),PointToLineSegment:i(1213),RectangleToRectangle:i(114),RectangleToTriangle:i(483),RectangleToValues:i(1214),TriangleToCircle:i(485),TriangleToLine:i(487),TriangleToTriangle:i(488)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(38);t.exports=function(t,e,i){var r=t.x1,s=t.y1,o=t.x2,a=t.y2,h=e.x1,l=e.y1,c=o-r,u=a-s,d=e.x2-h,p=e.y2-l;if(0===c||0==p*c-d*u)return!1;var f=(c*(l-s)+u*(r-h))/(d*u-p*c),m=(h+d*f-r)/c;return m<0||f<0||f>1?null:(void 0===i&&(i=new n),i.set(r+c*m,s+u*m,m))}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(38),r=i(479),s=new(i(45)),o=new n;t.exports=function(t,e,i){void 0===i&&(i=new n);var a=!1;i.set(),o.set();for(var h=e[0],l=1;l=o&&i<=h&&n>=a&&n<=l||r>=o&&r<=h&&s>=a&&s<=l)return!0;if(i=o){if((c=n+(s-n)*(o-i)/(r-i))>a&&c<=l)return!0}else if(i>h&&r<=h&&(c=n+(s-n)*(h-i)/(r-i))>=a&&c<=l)return!0;if(n=a){if((c=i+(r-i)*(a-n)/(s-n))>=o&&c<=h)return!0}else if(n>l&&s<=l&&(c=i+(r-i)*(l-n)/(s-n))>=o&&c<=h)return!0;return!1}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(92),r=i(56),s=i(232),o=i(484);t.exports=function(t,e){if(e.left>t.right||e.rightt.bottom||e.bottom0}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x,y:t.y}),e.push({x:t.right,y:t.y}),e.push({x:t.right,y:t.bottom}),e.push({x:t.x,y:t.bottom}),e}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(230),r=i(112);t.exports=function(t,e){return!(t.left>e.right||t.righte.bottom||t.bottom * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(92);t.exports=function(t,e){return!!(t.contains(e.x1,e.y1)||t.contains(e.x2,e.y2)||n(t.getLineA(),e)||n(t.getLineB(),e)||n(t.getLineC(),e))}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(232),r=i(489),s=i(92);t.exports=function(t,e){if(t.left>e.right||t.righte.bottom||t.bottom0||(u=r(e),(d=n(t,u,!0)).length>0)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=[]),e.push({x:t.x1,y:t.y1}),e.push({x:t.x2,y:t.y2}),e.push({x:t.x3,y:t.y3}),e}},function(t,e){t.exports=function(t,e,i){void 0===i&&(i=1);var n=e.x1,r=e.y1,s=e.x2,o=e.y2,a=t.x,h=t.y,l=(s-n)*(s-n)+(o-r)*(o-r);if(0===l)return!1;var c=((a-n)*(s-n)+(h-r)*(o-r))/l;if(c<0)return Math.sqrt((n-a)*(n-a)+(r-h)*(r-h))<=i;if(c>=0&&c<=1){var u=((r-h)*(s-n)-(n-a)*(o-r))/l;return Math.abs(u)*Math.sqrt(l)<=i}return Math.sqrt((s-a)*(s-a)+(o-h)*(o-h))<=i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(14),r=i(66),s=i(93);t.exports=function(t){var e=s(t)-n.TAU;return r(e,-Math.PI,Math.PI)}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i=!0,n="",r="";function s(t){var e=t.indexOf("#");return e>-1?t.substring(0,e):t}function o(t){return 0===t.models.length&&t.models.push({faces:[],name:"untitled",textureCoords:[],vertexNormals:[],vertices:[]}),n="",t.models[t.models.length-1]}function a(t,e){var i=t.length>=2?t[1]:"untitled";e.models.push({faces:[],name:i,textureCoords:[],vertexNormals:[],vertices:[]}),n=""}function h(t){2===t.length&&(n=t[1])}function l(t,e){var i=t.length,n=i>=2?parseFloat(t[1]):0,r=i>=3?parseFloat(t[2]):0,s=i>=4?parseFloat(t[3]):0;o(e).vertices.push({x:n,y:r,z:s})}function c(t,e){var n=t.length,r=n>=2?parseFloat(t[1]):0,s=n>=3?parseFloat(t[2]):0,a=n>=4?parseFloat(t[3]):0;isNaN(r)&&(r=0),isNaN(s)&&(s=0),isNaN(a)&&(a=0),i&&(s=1-s),o(e).textureCoords.push({u:r,v:s,w:a})}function u(t,e){var i=t.length,n=i>=2?parseFloat(t[1]):0,r=i>=3?parseFloat(t[2]):0,s=i>=4?parseFloat(t[3]):0;o(e).vertexNormals.push({x:n,y:r,z:s})}function d(t,e){var i=t.length-1;if(!(i<3)){for(var s={group:n,material:r,vertices:[]},a=0;a3)){var c=0,u=0,d=0;c=parseInt(h[0],10),l>1&&""!==h[1]&&(u=parseInt(h[1],10)),l>2&&(d=parseInt(h[2],10)),0!==c&&(c<0&&(c=o(e).vertices.length+1+c),u-=1,c-=1,d-=1,s.vertices.push({textureCoordsIndex:u,vertexIndex:c,vertexNormalIndex:d}))}}o(e).faces.push(s)}}function p(t,e){t.length>=2&&e.materialLibraries.push(t[1])}function f(t){t.length>=2&&(r=t[1])}t.exports=function(t,e){void 0===e&&(e=!0),i=e;var o={materials:{},materialLibraries:[],models:[]};n="",r="";for(var m=t.split("\n"),g=0;g * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(100);t.exports=function(t){for(var e={},i=t.split("\n"),r="",s=0;s=2?Math.floor(255*a[2]):h,c=a.length>=3?Math.floor(255*a[3]):h;e[r]=n(h,l,c)}}}return e}},function(t,e){t.exports=function(t){return Math.sqrt(t.x*t.x+t.y*t.y)}},function(t,e){t.exports=function(t){return t.x*t.x+t.y*t.y}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(10);n.Area=i(1261),n.Ceil=i(1262),n.CeilAll=i(1263),n.CenterOn=i(187),n.Clone=i(1264),n.Contains=i(56),n.ContainsPoint=i(1265),n.ContainsRect=i(497),n.CopyFrom=i(1266),n.Decompose=i(484),n.Equals=i(1267),n.FitInside=i(1268),n.FitOutside=i(1269),n.Floor=i(1270),n.FloorAll=i(1271),n.FromPoints=i(196),n.FromXY=i(1272),n.GetAspectRatio=i(234),n.GetCenter=i(1273),n.GetPoint=i(167),n.GetPoints=i(300),n.GetSize=i(1274),n.Inflate=i(1275),n.Intersection=i(1276),n.MarchingAnts=i(310),n.MergePoints=i(1277),n.MergeRect=i(1278),n.MergeXY=i(1279),n.Offset=i(1280),n.OffsetPoint=i(1281),n.Overlaps=i(1282),n.Perimeter=i(128),n.PerimeterPoint=i(1283),n.Random=i(170),n.RandomOutside=i(1284),n.SameDimensions=i(1285),n.Scale=i(1286),n.Union=i(435),t.exports=n},function(t,e){t.exports=function(t,e){return!(e.width*e.height>t.width*t.height)&&e.x>t.x&&e.xt.x&&e.rightt.y&&e.yt.y&&e.bottom * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=(t.x1+t.x2+t.x3)/3,e.y=(t.y1+t.y2+t.y3)/3,e}},function(t,e){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t.x3+=e,t.y3+=i,t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4);function r(t,e,i,n){var r=t-i,s=e-n,o=r*r+s*s;return Math.sqrt(o)}t.exports=function(t,e){void 0===e&&(e=new n);var i=t.x1,s=t.y1,o=t.x2,a=t.y2,h=t.x3,l=t.y3,c=r(h,l,o,a),u=r(i,s,h,l),d=r(o,a,i,s),p=c+u+d;return e.x=(i*c+o*u+h*d)/p,e.y=(s*c+a*u+l*d)/p,e}},function(t,e){t.exports=function(t,e){return function(i,n,r,s){var o=t.getPixelAlpha(n,r,s.texture.key,s.frame.name);return o&&o>=e}}},function(t,e){t.exports=function(t,e,i){return{gameObject:t,enabled:!0,alwaysEnabled:!1,draggable:!1,dropZone:!1,cursor:!1,target:null,camera:null,hitArea:e,hitAreaCallback:i,hitAreaDebug:null,customHitArea:!1,localX:0,localY:0,dragState:0,dragStartX:0,dragStartY:0,dragStartXGlobal:0,dragStartYGlobal:0,dragX:0,dragY:0}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=new(i(0))({initialize:function(t,e){this.pad=t,this.events=t.events,this.index=e,this.value=0,this.threshold=.1},update:function(t){this.value=t},getValue:function(){return Math.abs(this.value) * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(236),s=new n({initialize:function(t,e){this.pad=t,this.events=t.manager,this.index=e,this.value=0,this.threshold=1,this.pressed=!1},update:function(t){this.value=t;var e=this.pad,i=this.index;t>=this.threshold?this.pressed||(this.pressed=!0,this.events.emit(r.BUTTON_DOWN,e,this,t),this.pad.emit(r.GAMEPAD_BUTTON_DOWN,i,t,this)):this.pressed&&(this.pressed=!1,this.events.emit(r.BUTTON_UP,e,this,t),this.pad.emit(r.GAMEPAD_BUTTON_UP,i,t,this))},destroy:function(){this.pad=null,this.events=null}});t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(503),r=i(504),s=i(0),o=i(9),a=i(3),h=new s({Extends:o,initialize:function(t,e){o.call(this),this.manager=t,this.pad=e,this.id=e.id,this.index=e.index;for(var i=[],s=0;s=2&&(this.leftStick.set(s[0].getValue(),s[1].getValue()),r>=4&&this.rightStick.set(s[2].getValue(),s[3].getValue()))}},destroy:function(){var t;for(this.removeAllListeners(),this.manager=null,this.pad=null,t=0;t * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(9),s=i(152),o=new n({Extends:r,initialize:function(t,e){r.call(this),this.plugin=t,this.keyCode=e,this.originalEvent=void 0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.location=0,this.timeDown=0,this.duration=0,this.timeUp=0,this.emitOnRepeat=!1,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1},setEmitOnRepeat:function(t){return this.emitOnRepeat=t,this},onDown:function(t){this.originalEvent=t,this.enabled&&(this.altKey=t.altKey,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.metaKey=t.metaKey,this.location=t.location,this.repeats++,this.isDown?this.emitOnRepeat&&this.emit(s.DOWN,this,t):(this.isDown=!0,this.isUp=!1,this.timeDown=t.timeStamp,this.duration=0,this._justDown=!0,this._justUp=!1,this.emit(s.DOWN,this,t)))},onUp:function(t){this.originalEvent=t,this.enabled&&(this.isDown=!1,this.isUp=!0,this.timeUp=t.timeStamp,this.duration=this.timeUp-this.timeDown,this.repeats=0,this._justDown=!1,this._justUp=!0,this._tick=-1,this.emit(s.UP,this,t))},reset:function(){return this.preventDefault=!0,this.enabled=!0,this.isDown=!1,this.isUp=!0,this.altKey=!1,this.ctrlKey=!1,this.shiftKey=!1,this.metaKey=!1,this.timeDown=0,this.duration=0,this.timeUp=0,this.repeats=0,this._justDown=!1,this._justUp=!1,this._tick=-1,this},getDuration:function(){return this.isDown?this.plugin.game.loop.time-this.timeDown:0},destroy:function(){this.removeAllListeners(),this.originalEvent=null,this.plugin=null}});t.exports=o},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(152),s=i(2),o=i(508),a=i(510),h=new n({initialize:function(t,e,i){if(void 0===i&&(i={}),e.length<2)return!1;this.manager=t,this.enabled=!0,this.keyCodes=[];for(var n=0;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(509);t.exports=function(t,e){if(e.matched)return!0;var i=!1,r=!1;if(t.keyCode===e.current)if(e.index>0&&e.maxKeyDelay>0){var s=e.timeLastMatched+e.maxKeyDelay;t.timeStamp<=s&&(r=!0,i=n(t,e))}else r=!0,i=n(t,e);return!r&&e.resetOnWrongKey&&(e.index=0,e.current=e.keyCodes[0]),i&&(e.timeLastMatched=t.timeStamp,e.matched=!0,e.timeMatched=t.timeStamp),i}},function(t,e){t.exports=function(t,e){return e.timeLastMatched=t.timeStamp,e.index++,e.index===e.size||(e.current=e.keyCodes[e.index],!1)}},function(t,e){t.exports=function(t){return t.current=t.keyCodes[0],t.index=0,t.timeLastMatched=0,t.matched=!1,t.timeMatched=0,t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(237);t.exports=function(t,e){var i=n(e,t.xhrSettings),r=new XMLHttpRequest;if(r.open("GET",t.src,i.async,i.user,i.password),r.responseType=t.xhrSettings.responseType,r.timeout=i.timeout,i.headers)for(var s in i.headers)r.setRequestHeader(s,i.headers[s]);return i.header&&i.headerValue&&r.setRequestHeader(i.header,i.headerValue),i.requestedWith&&r.setRequestHeader("X-Requested-With",i.requestedWith),i.overrideMimeType&&r.overrideMimeType(i.overrideMimeType),i.withCredentials&&(r.withCredentials=!0),r.onload=t.onLoad.bind(t,r),r.onerror=t.onError.bind(t,r),r.onprogress=t.onProgress.bind(t),r.send(),r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(513),l=i(7),c=new n({Extends:s,initialize:function(t,e,i,n,r){if(l(e)){var o=e;e=a(o,"key"),n=a(o,"xhrSettings"),r=a(o,"context",r)}var h={type:"audio",cache:t.cacheManager.audio,extension:i.type,responseType:"arraybuffer",key:e,url:i.url,xhrSettings:n,config:{context:r}};s.call(this,t,h)},onProcess:function(){this.state=r.FILE_PROCESSING;var t=this;this.config.context.decodeAudioData(this.xhrLoader.response,(function(e){t.data=e,t.onProcessComplete()}),(function(e){console.error("Error decoding audio: "+t.key+" - ",e?e.message:null),t.onProcessError()})),this.config.context=null}});c.create=function(t,e,i,n,r){var s=t.systems.game,o=s.config.audio,u=s.device.audio;l(e)&&(i=a(e,"url",[]),n=a(e,"config",{}));var d=c.getAudioURL(s,i);return d?u.webAudio&&!o.disableWebAudio?new c(t,e,d,r,s.sound.context):new h(t,e,d,n):null},c.getAudioURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(91),s=i(23),o=i(2),a=i(153),h=i(7),l=new n({Extends:s,initialize:function(t,e,i,n){if(h(e)){var r=e;e=o(r,"key"),n=o(r,"config",n)}var a={type:"audio",cache:t.cacheManager.audio,extension:i.type,key:e,url:i.url,config:n};s.call(this,t,a),this.locked="ontouchstart"in window,this.loaded=!1,this.filesLoaded=0,this.filesTotal=0},onLoad:function(){this.loaded||(this.loaded=!0,this.loader.nextFile(this,!0))},onError:function(){for(var t=0;t * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=new n({Extends:s,initialize:function(t,e,i,n){var r="js";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),r=a(o,"extension",r)}var l={type:"script",cache:!1,extension:r,responseType:"text",key:e,url:i,xhrSettings:n};s.call(this,t,l)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});o.register("script",(function(t,e,i){if(Array.isArray(t))for(var n=0;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(516),r=i(155),s=i(0),o=i(60),a=i(518),h=i(519),l=new s({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},collider:function(t,e,i,n,r){return this.world.addCollider(t,e,i,n,r)},overlap:function(t,e,i,n,r){return this.world.addOverlap(t,e,i,n,r)},existing:function(t,e){var i=e?o.STATIC_BODY:o.DYNAMIC_BODY;return this.world.enableBody(t,i),t},staticImage:function(t,e,i,r){var s=new n(this.scene,t,e,i,r);return this.sys.displayList.add(s),this.world.enableBody(s,o.STATIC_BODY),s},image:function(t,e,i,r){var s=new n(this.scene,t,e,i,r);return this.sys.displayList.add(s),this.world.enableBody(s,o.DYNAMIC_BODY),s},staticSprite:function(t,e,i,n){var s=new r(this.scene,t,e,i,n);return this.sys.displayList.add(s),this.sys.updateList.add(s),this.world.enableBody(s,o.STATIC_BODY),s},sprite:function(t,e,i,n){var s=new r(this.scene,t,e,i,n);return this.sys.displayList.add(s),this.sys.updateList.add(s),this.world.enableBody(s,o.DYNAMIC_BODY),s},staticGroup:function(t,e){return this.sys.updateList.add(new h(this.world,this.world.scene,t,e))},group:function(t,e){return this.sys.updateList.add(new a(this.world,this.world.scene,t,e))},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=l},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(240),s=i(124),o=new n({Extends:s,Mixins:[r.Acceleration,r.Angular,r.Bounce,r.Debug,r.Drag,r.Enable,r.Friction,r.Gravity,r.Immovable,r.Mass,r.Pushable,r.Size,r.Velocity],initialize:function(t,e,i,n,r){s.call(this,t,e,i,n,r),this.body=null}});t.exports=o},function(t,e,i){var n=i(241),r=i(62),s=i(228),o=i(150);t.exports=function(t,e,i,a,h,l){var c=n(t,e-a,i-a,2*a,2*a,h,l);if(0===c.length)return c;for(var u=new r(e,i,a),d=new r,p=[],f=0;f * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(155),r=i(0),s=i(60),o=i(2),a=i(110),h=i(7),l=new r({Extends:a,initialize:function(t,e,i,r){if(i||r)if(h(i))r=i,i=null,r.internalCreateCallback=this.createCallbackHandler,r.internalRemoveCallback=this.removeCallbackHandler;else if(Array.isArray(i)&&h(i[0])){r=i[0];var l=this;i.forEach((function(t){t.internalCreateCallback=l.createCallbackHandler,t.internalRemoveCallback=l.removeCallbackHandler})),i=null}else r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};else r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler};this.world=t,r.classType=o(r,"classType",n),this.physicsType=s.DYNAMIC_BODY,this.defaults={setCollideWorldBounds:o(r,"collideWorldBounds",!1),setBoundsRectangle:o(r,"customBoundsRectangle",null),setAccelerationX:o(r,"accelerationX",0),setAccelerationY:o(r,"accelerationY",0),setAllowDrag:o(r,"allowDrag",!0),setAllowGravity:o(r,"allowGravity",!0),setAllowRotation:o(r,"allowRotation",!0),setBounceX:o(r,"bounceX",0),setBounceY:o(r,"bounceY",0),setDragX:o(r,"dragX",0),setDragY:o(r,"dragY",0),setEnable:o(r,"enable",!0),setGravityX:o(r,"gravityX",0),setGravityY:o(r,"gravityY",0),setFrictionX:o(r,"frictionX",0),setFrictionY:o(r,"frictionY",0),setMaxVelocityX:o(r,"maxVelocityX",1e4),setMaxVelocityY:o(r,"maxVelocityY",1e4),setVelocityX:o(r,"velocityX",0),setVelocityY:o(r,"velocityY",0),setAngularVelocity:o(r,"angularVelocity",0),setAngularAcceleration:o(r,"angularAcceleration",0),setAngularDrag:o(r,"angularDrag",0),setMass:o(r,"mass",1),setImmovable:o(r,"immovable",!1)},a.call(this,e,i,r),this.type="PhysicsGroup"},createCallbackHandler:function(t){t.body||this.world.enableBody(t,s.DYNAMIC_BODY);var e=t.body;for(var i in this.defaults)e[i](this.defaults[i])},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},setVelocity:function(t,e,i){void 0===i&&(i=0);for(var n=this.getChildren(),r=0;r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(155),r=i(0),s=i(60),o=i(2),a=i(110),h=i(7),l=new r({Extends:a,initialize:function(t,e,i,r){i||r?h(i)?(r=i,i=null,r.internalCreateCallback=this.createCallbackHandler,r.internalRemoveCallback=this.removeCallbackHandler,r.createMultipleCallback=this.createMultipleCallbackHandler,r.classType=o(r,"classType",n)):Array.isArray(i)&&h(i[0])?(r=i,i=null,r.forEach((function(t){t.internalCreateCallback=this.createCallbackHandler,t.internalRemoveCallback=this.removeCallbackHandler,t.createMultipleCallback=this.createMultipleCallbackHandler,t.classType=o(t,"classType",n)}))):r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler}:r={internalCreateCallback:this.createCallbackHandler,internalRemoveCallback:this.removeCallbackHandler,createMultipleCallback:this.createMultipleCallbackHandler,classType:n},this.world=t,this.physicsType=s.STATIC_BODY,a.call(this,e,i,r),this.type="StaticPhysicsGroup"},createCallbackHandler:function(t){t.body||this.world.enableBody(t,s.STATIC_BODY)},removeCallbackHandler:function(t){t.body&&this.world.disableBody(t)},createMultipleCallbackHandler:function(){this.refresh()},refresh:function(){for(var t=this.children.entries,e=0;e * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(344),r=i(521),s=i(18),o=i(0),a=i(522),h=i(60),l=i(48),c=i(9),u=i(242),d=i(123),p=i(348),f=i(349),m=i(243),g=i(244),v=i(523),y=i(6),x=i(14),b=i(208),w=i(524),T=i(10),_=i(525),E=i(526),S=i(531),M=i(532),A=i(148),C=i(533),P=i(245),R=i(25),L=i(3),O=i(66),D=new o({Extends:c,initialize:function(t,e){c.call(this),this.scene=t,this.bodies=new A,this.staticBodies=new A,this.pendingDestroy=new A,this.colliders=new b,this.gravity=new L(y(e,"gravity.x",0),y(e,"gravity.y",0)),this.bounds=new T(y(e,"x",0),y(e,"y",0),y(e,"width",t.sys.scale.width),y(e,"height",t.sys.scale.height)),this.checkCollision={up:y(e,"checkCollision.up",!0),down:y(e,"checkCollision.down",!0),left:y(e,"checkCollision.left",!0),right:y(e,"checkCollision.right",!0)},this.fps=y(e,"fps",60),this.fixedStep=y(e,"fixedStep",!0),this._elapsed=0,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this.stepsLastFrame=0,this.timeScale=y(e,"timeScale",1),this.OVERLAP_BIAS=y(e,"overlapBias",4),this.TILE_BIAS=y(e,"tileBias",16),this.forceX=y(e,"forceX",!1),this.isPaused=y(e,"isPaused",!1),this._total=0,this.drawDebug=y(e,"debug",!1),this.debugGraphic,this.defaults={debugShowBody:y(e,"debugShowBody",!0),debugShowStaticBody:y(e,"debugShowStaticBody",!0),debugShowVelocity:y(e,"debugShowVelocity",!0),bodyDebugColor:y(e,"debugBodyColor",16711935),staticBodyDebugColor:y(e,"debugStaticBodyColor",255),velocityDebugColor:y(e,"debugVelocityColor",65280)},this.maxEntries=y(e,"maxEntries",16),this.useTree=y(e,"useTree",!0),this.tree=new _(this.maxEntries),this.staticTree=new _(this.maxEntries),this.treeMinMax={minX:0,minY:0,maxX:0,maxY:0},this._tempMatrix=new R,this._tempMatrix2=new R,this.drawDebug&&this.createDebugGraphic()},enable:function(t,e){void 0===e&&(e=h.DYNAMIC_BODY),Array.isArray(t)||(t=[t]);for(var i=0;i=s;for(this.fixedStep||(r=.001*e,a=!0,this._elapsed=0),i=0;i=s;)this._elapsed-=s,this.step(r)}},step:function(t){var e,i,n=this.bodies.entries,r=n.length;for(e=0;e0){var l=this.tree,c=this.staticTree;for(n=(i=a.entries).length,t=0;t-1&&u>m&&(t.velocity.normalize().scale(m),u=m),t.speed=u},separate:function(t,e,i,n,r,s){if(!s&&!t.enable||!e.enable||t.checkCollision.none||e.checkCollision.none||!this.intersects(t,e))return!1;if(i&&!1===i.call(n,t.gameObject,e.gameObject))return!1;if(t.isCircle&&e.isCircle)return this.separateCircle(t,e,r);if(t.isCircle!==e.isCircle){var o=t.isCircle?e:t,a=t.isCircle?t:e,h={x:o.x,y:o.y,right:o.right,bottom:o.bottom},l=a.center;if((l.yh.bottom)&&(l.xh.right))return this.separateCircle(t,e,r)}var c=!1,d=!1;r?(c=S(t,e,r,this.OVERLAP_BIAS),d=M(t,e,r,this.OVERLAP_BIAS)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)o.right&&(s=l(a.x,a.y,o.right,o.y)-a.radius):a.y>o.bottom&&(a.xo.right&&(s=l(a.x,a.y,o.right,o.bottom)-a.radius)),s*=-1}else s=t.halfWidth+e.halfWidth-l(t.center.x,t.center.y,e.center.x,e.center.y);if(t.overlapR=s,e.overlapR=s,i||0===s||t.immovable&&e.immovable||t.customSeparateX||e.customSeparateX)return 0!==s&&(t.onOverlap||e.onOverlap)&&this.emit(u.OVERLAP,t.gameObject,e.gameObject,t,e),0!==s;var h=t.center.x-e.center.x,c=t.center.y-e.center.y,d=Math.sqrt(Math.pow(h,2)+Math.pow(c,2)),p=(e.center.x-t.center.x)/d||0,f=(e.center.y-t.center.y)/d||0,v=2*(t.velocity.x*p+t.velocity.y*f-e.velocity.x*p-e.velocity.y*f)/(t.mass+e.mass);(t.immovable||e.immovable)&&(v*=2),t.immovable||(t.velocity.x=t.velocity.x-v/t.mass*p,t.velocity.y=t.velocity.y-v/t.mass*f),e.immovable||(e.velocity.x=e.velocity.x+v/e.mass*p,e.velocity.y=e.velocity.y+v/e.mass*f),t.immovable||e.immovable||(s/=2);var y=n(t.center,e.center),b=(s+x.EPSILON)*Math.cos(y),w=(s+x.EPSILON)*Math.sin(y);return t.immovable||(t.x-=b,t.y-=w,t.updateCenter()),e.immovable||(e.x+=b,e.y+=w,e.updateCenter()),t.velocity.x*=t.bounce.x,t.velocity.y*=t.bounce.y,e.velocity.x*=e.bounce.x,e.velocity.y*=e.bounce.y,(t.onCollide||e.onCollide)&&this.emit(u.COLLIDE,t.gameObject,e.gameObject,t,e),!0},intersects:function(t,e){return t!==e&&(t.isCircle||e.isCircle?t.isCircle?e.isCircle?l(t.center.x,t.center.y,e.center.x,e.center.y)<=t.halfWidth+e.halfWidth:this.circleBodyIntersects(t,e):this.circleBodyIntersects(e,t):!(t.right<=e.position.x||t.bottom<=e.position.y||t.position.x>=e.right||t.position.y>=e.bottom))},circleBodyIntersects:function(t,e){var i=s(t.center.x,e.left,e.right),n=s(t.center.y,e.top,e.bottom);return(t.center.x-i)*(t.center.x-i)+(t.center.y-n)*(t.center.y-n)<=t.halfWidth*t.halfWidth},overlap:function(t,e,i,n,r){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=i),this.collideObjects(t,e,i,n,r,!0)},collide:function(t,e,i,n,r){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=i),this.collideObjects(t,e,i,n,r,!1)},collideObjects:function(t,e,i,n,r,s){var o,a;t.isParent&&void 0===t.physicsType&&(t=t.children.entries),e&&e.isParent&&void 0===e.physicsType&&(e=e.children.entries);var h=Array.isArray(t),l=Array.isArray(e);if(this._total=0,h||l)if(!h&&l)for(o=0;o0},collideHandler:function(t,e,i,n,r,s){if(void 0===e&&t.isParent)return this.collideGroupVsGroup(t,t,i,n,r,s);if(!t||!e)return!1;if(t.body){if(e.body)return this.collideSpriteVsSprite(t,e,i,n,r,s);if(e.isParent)return this.collideSpriteVsGroup(t,e,i,n,r,s);if(e.isTilemap)return this.collideSpriteVsTilemapLayer(t,e,i,n,r,s)}else if(t.isParent){if(e.body)return this.collideSpriteVsGroup(e,t,i,n,r,s);if(e.isParent)return this.collideGroupVsGroup(t,e,i,n,r,s);if(e.isTilemap)return this.collideGroupVsTilemapLayer(t,e,i,n,r,s)}else if(t.isTilemap){if(e.body)return this.collideSpriteVsTilemapLayer(e,t,i,n,r,s);if(e.isParent)return this.collideGroupVsTilemapLayer(e,t,i,n,r,s)}},collideSpriteVsSprite:function(t,e,i,n,r,s){return!(!t.body||!e.body||(this.separate(t.body,e.body,n,r,s)&&(i&&i.call(r,t,e),this._total++),0))},collideSpriteVsGroup:function(t,e,i,n,r,s){var o,a,l,c=t.body;if(0!==e.length&&c&&c.enable&&!c.checkCollision.none)if(this.useTree||e.physicsType===h.STATIC_BODY){var u=this.treeMinMax;u.minX=c.left,u.minY=c.top,u.maxX=c.right,u.maxY=c.bottom;var d=e.physicsType===h.DYNAMIC_BODY?this.tree.search(u):this.staticTree.search(u);for(a=d.length,o=0;ou.baseTileWidth){var d=(u.tileWidth-u.baseTileWidth)*e.scaleX;a-=d,l+=d}u.tileHeight>u.baseTileHeight&&(c+=(u.tileHeight-u.baseTileHeight)*e.scaleY);var p=v(a,h,l,c,null,e.scene.cameras.main,e.layer);return 0!==p.length&&this.collideSpriteVsTilesHandler(t,p,i,n,r,s,!0)},collideSpriteVsTilesHandler:function(t,e,i,n,r,s,o){for(var a,h,l=t.body,c={left:0,right:0,top:0,bottom:0},d=!1,p=0;p * @author Benjamin D. Richards * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(60),s=i(242),o=i(193),a=i(10),h=i(56),l=i(3),c=new n({initialize:function(t,e){var i=e.displayWidth?e.displayWidth:64,n=e.displayHeight?e.displayHeight:64;this.world=t,this.gameObject=e,this.transform={x:e.x,y:e.y,rotation:e.angle,scaleX:e.scaleX,scaleY:e.scaleY,displayOriginX:e.displayOriginX,displayOriginY:e.displayOriginY},this.debugShowBody=t.defaults.debugShowBody,this.debugShowVelocity=t.defaults.debugShowVelocity,this.debugBodyColor=t.defaults.bodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new l,this.position=new l(e.x-e.scaleX*e.displayOriginX,e.y-e.scaleY*e.displayOriginY),this.prev=this.position.clone(),this.prevFrame=this.position.clone(),this.allowRotation=!0,this.rotation=e.angle,this.preRotation=e.angle,this.width=i,this.height=n,this.sourceWidth=i,this.sourceHeight=n,e.frame&&(this.sourceWidth=e.frame.realWidth,this.sourceHeight=e.frame.realHeight),this.halfWidth=Math.abs(i/2),this.halfHeight=Math.abs(n/2),this.center=new l(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=new l,this.newVelocity=new l,this.deltaMax=new l,this.acceleration=new l,this.allowDrag=!0,this.drag=new l,this.allowGravity=!0,this.gravity=new l,this.bounce=new l,this.worldBounce=null,this.customBoundsRectangle=t.bounds,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.maxVelocity=new l(1e4,1e4),this.maxSpeed=-1,this.friction=new l(1,0),this.useDamping=!1,this.angularVelocity=0,this.angularAcceleration=0,this.angularDrag=0,this.maxAngular=1e3,this.mass=1,this.angle=0,this.speed=0,this.facing=r.FACING_NONE,this.immovable=!1,this.pushable=!0,this.moves=!0,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.syncBounds=!1,this.physicsType=r.DYNAMIC_BODY,this._sx=e.scaleX,this._sy=e.scaleY,this._dx=0,this._dy=0,this._tx=0,this._ty=0,this._bounds=new a},updateBounds:function(){var t=this.gameObject,e=this.transform;if(t.parentContainer){var i=t.getWorldTransformMatrix(this.world._tempMatrix,this.world._tempMatrix2);e.x=i.tx,e.y=i.ty,e.rotation=o(i.rotation),e.scaleX=i.scaleX,e.scaleY=i.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY}else e.x=t.x,e.y=t.y,e.rotation=t.angle,e.scaleX=t.scaleX,e.scaleY=t.scaleY,e.displayOriginX=t.displayOriginX,e.displayOriginY=t.displayOriginY;var n=!1;if(this.syncBounds){var r=t.getBounds(this._bounds);this.width=r.width,this.height=r.height,n=!0}else{var s=Math.abs(e.scaleX),a=Math.abs(e.scaleY);this._sx===s&&this._sy===a||(this.width=this.sourceWidth*s,this.height=this.sourceHeight*a,this._sx=s,this._sy=a,n=!0)}n&&(this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter())},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},updateFromGameObject:function(){this.updateBounds();var t=this.transform;this.position.x=t.x+t.scaleX*(this.offset.x-t.displayOriginX),this.position.y=t.y+t.scaleY*(this.offset.y-t.displayOriginY),this.updateCenter()},resetFlags:function(t){void 0===t&&(t=!1);var e=this.wasTouching,i=this.touching,n=this.blocked;t?(e.none=!0,e.up=!1,e.down=!1,e.left=!1,e.right=!1):(e.none=i.none,e.up=i.up,e.down=i.down,e.left=i.left,e.right=i.right),i.none=!0,i.up=!1,i.down=!1,i.left=!1,i.right=!1,n.none=!0,n.up=!1,n.down=!1,n.left=!1,n.right=!1,this.overlapR=0,this.overlapX=0,this.overlapY=0,this.embedded=!1},preUpdate:function(t,e){t&&this.resetFlags(),this.updateFromGameObject(),this.rotation=this.transform.rotation,this.preRotation=this.rotation,this.moves&&(this.prev.x=this.position.x,this.prev.y=this.position.y,this.prevFrame.x=this.position.x,this.prevFrame.y=this.position.y),t&&this.update(e)},update:function(t){if(this.prev.x=this.position.x,this.prev.y=this.position.y,this.moves){this.world.updateMotion(this,t);var e=this.velocity.x,i=this.velocity.y;this.newVelocity.set(e*t,i*t),this.position.add(this.newVelocity),this.updateCenter(),this.angle=Math.atan2(i,e),this.speed=Math.sqrt(e*e+i*i),this.collideWorldBounds&&this.checkWorldBounds()&&this.onWorldBounds&&this.world.emit(s.WORLD_BOUNDS,this,this.blocked.up,this.blocked.down,this.blocked.left,this.blocked.right)}this._dx=this.position.x-this.prev.x,this._dy=this.position.y-this.prev.y},postUpdate:function(){var t=this.position.x-this.prevFrame.x,e=this.position.y-this.prevFrame.y;if(this.moves){var i=this.deltaMax.x,n=this.deltaMax.y;0!==i&&0!==t&&(t<0&&t<-i?t=-i:t>0&&t>i&&(t=i)),0!==n&&0!==e&&(e<0&&e<-n?e=-n:e>0&&e>n&&(e=n)),this.gameObject.x+=t,this.gameObject.y+=e}t<0?this.facing=r.FACING_LEFT:t>0&&(this.facing=r.FACING_RIGHT),e<0?this.facing=r.FACING_UP:e>0&&(this.facing=r.FACING_DOWN),this.allowRotation&&(this.gameObject.angle+=this.deltaZ()),this._tx=t,this._ty=e},setBoundsRectangle:function(t){return this.customBoundsRectangle=t||this.world.bounds,this},checkWorldBounds:function(){var t=this.position,e=this.customBoundsRectangle,i=this.world.checkCollision,n=this.worldBounce?-this.worldBounce.x:-this.bounce.x,r=this.worldBounce?-this.worldBounce.y:-this.bounce.y,s=!1;return t.xe.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,this.blocked.right=!0,s=!0),t.ye.bottom&&i.down&&(t.y=e.bottom-this.height,this.velocity.y*=r,this.blocked.down=!0,s=!0),s&&(this.blocked.none=!1,this.updateCenter()),s},setOffset:function(t,e){return void 0===e&&(e=t),this.offset.set(t,e),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.sourceWidth=t,this.sourceHeight=e,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.updateCenter(),i&&n.getCenter){var r=(n.width-t)/2,s=(n.height-e)/2;this.offset.set(r,s)}return this.isCircle=!1,this.radius=0,this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.isCircle=!0,this.radius=t,this.sourceWidth=2*t,this.sourceHeight=2*t,this.width=this.sourceWidth*this._sx,this.height=this.sourceHeight*this._sy,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter()):this.isCircle=!1,this},reset:function(t,e){this.stop();var i=this.gameObject;i.setPosition(t,e),i.getTopLeft?i.getTopLeft(this.position):this.position.set(t,e),this.prev.copy(this.position),this.prevFrame.copy(this.position),this.rotation=i.angle,this.preRotation=i.angle,this.updateBounds(),this.updateCenter(),this.resetFlags(!0)},stop:function(){return this.velocity.set(0),this.acceleration.set(0),this.speed=0,this.angularVelocity=0,this.angularAcceleration=0,this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?this.radius>0&&t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom&&(this.center.x-t)*(this.center.x-t)+(this.center.y-e)*(this.center.y-e)<=this.radius*this.radius:h(this,t,e)},onFloor:function(){return this.blocked.down},onCeiling:function(){return this.blocked.up},onWall:function(){return this.blocked.left||this.blocked.right},deltaAbsX:function(){return this._dx>0?this._dx:-this._dx},deltaAbsY:function(){return this._dy>0?this._dy:-this._dy},deltaX:function(){return this._dx},deltaY:function(){return this._dy},deltaXFinal:function(){return this._tx},deltaYFinal:function(){return this._ty},deltaZ:function(){return this.rotation-this.preRotation},destroy:function(){this.enable=!1,this.world&&this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor),this.isCircle?t.strokeCircle(i,n,this.width/2):(this.checkCollision.up&&t.lineBetween(e.x,e.y,e.x+this.width,e.y),this.checkCollision.right&&t.lineBetween(e.x+this.width,e.y,e.x+this.width,e.y+this.height),this.checkCollision.down&&t.lineBetween(e.x,e.y+this.height,e.x+this.width,e.y+this.height),this.checkCollision.left&&t.lineBetween(e.x,e.y,e.x,e.y+this.height))),this.debugShowVelocity&&(t.lineStyle(t.defaultStrokeWidth,this.world.defaults.velocityDebugColor,1),t.lineBetween(i,n,i+this.velocity.x/2,n+this.velocity.y/2))},willDrawDebug:function(){return this.debugShowBody||this.debugShowVelocity},setCollideWorldBounds:function(t,e,i,n){void 0===t&&(t=!0),this.collideWorldBounds=t;var r=void 0!==e,s=void 0!==i;return(r||s)&&(this.worldBounce||(this.worldBounce=new l),r&&(this.worldBounce.x=e),s&&(this.worldBounce.y=i)),void 0!==n&&(this.onWorldBounds=n),this},setVelocity:function(t,e){return this.velocity.set(t,e),t=this.velocity.x,e=this.velocity.y,this.speed=Math.sqrt(t*t+e*e),this},setVelocityX:function(t){this.velocity.x=t;var e=t,i=this.velocity.y;return this.speed=Math.sqrt(e*e+i*i),this},setVelocityY:function(t){this.velocity.y=t;var e=this.velocity.x,i=t;return this.speed=Math.sqrt(e*e+i*i),this},setMaxVelocity:function(t,e){return this.maxVelocity.set(t,e),this},setMaxVelocityX:function(t){return this.maxVelocity.x=t,this},setMaxVelocityY:function(t){return this.maxVelocity.y=t,this},setMaxSpeed:function(t){return this.maxSpeed=t,this},setBounce:function(t,e){return this.bounce.set(t,e),this},setBounceX:function(t){return this.bounce.x=t,this},setBounceY:function(t){return this.bounce.y=t,this},setAcceleration:function(t,e){return this.acceleration.set(t,e),this},setAccelerationX:function(t){return this.acceleration.x=t,this},setAccelerationY:function(t){return this.acceleration.y=t,this},setAllowDrag:function(t){return void 0===t&&(t=!0),this.allowDrag=t,this},setAllowGravity:function(t){return void 0===t&&(t=!0),this.allowGravity=t,this},setAllowRotation:function(t){return void 0===t&&(t=!0),this.allowRotation=t,this},setDrag:function(t,e){return this.drag.set(t,e),this},setDamping:function(t){return this.useDamping=t,this},setDragX:function(t){return this.drag.x=t,this},setDragY:function(t){return this.drag.y=t,this},setGravity:function(t,e){return this.gravity.set(t,e),this},setGravityX:function(t){return this.gravity.x=t,this},setGravityY:function(t){return this.gravity.y=t,this},setFriction:function(t,e){return this.friction.set(t,e),this},setFrictionX:function(t){return this.friction.x=t,this},setFrictionY:function(t){return this.friction.y=t,this},setAngularVelocity:function(t){return this.angularVelocity=t,this},setAngularAcceleration:function(t){return this.angularAcceleration=t,this},setAngularDrag:function(t){return this.angularDrag=t,this},setMass:function(t){return this.mass=t,this},setImmovable:function(t){return void 0===t&&(t=!0),this.immovable=t,this},setEnable:function(t){return void 0===t&&(t=!0),this.enable=t,this},processX:function(t,e,i,n){this.x+=t,this.updateCenter(),null!==e&&(this.velocity.x=e);var r=this.blocked;i&&(r.left=!0),n&&(r.right=!0)},processY:function(t,e,i,n){this.y+=t,this.updateCenter(),null!==e&&(this.velocity.y=e);var r=this.blocked;i&&(r.up=!0),n&&(r.down=!0)},x:{get:function(){return this.position.x},set:function(t){this.position.x=t}},y:{get:function(){return this.position.y},set:function(t){this.position.y=t}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=c},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=new(i(0))({initialize:function(t,e,i,n,r,s,o){this.world=t,this.name="",this.active=!0,this.overlapOnly=e,this.object1=i,this.object2=n,this.collideCallback=r,this.processCallback=s,this.callbackContext=o},setName:function(t){return this.name=t,this},update:function(){this.world.collideObjects(this.object1,this.object2,this.collideCallback,this.processCallback,this.callbackContext,this.overlapOnly)},destroy:function(){this.world.removeCollider(this),this.active=!1,this.world=null,this.object1=null,this.object2=null,this.collideCallback=null,this.processCallback=null,this.callbackContext=null}});t.exports=n},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(26),r=i(3),s=new r,o=new r;t.exports=function(t,e,i,r,a,h,l){var c=l.tilemapLayer.tilemap._convert.WorldToTileXY;c(t,e,!0,s,h,l);var u=s.x,d=s.y;c(t+i,e+r,!1,o,h,l);var p=Math.ceil(o.x),f=Math.ceil(o.y);return n(u,d,p-u,f-d,a,l)}},function(t,e){t.exports=function(t,e){return t.collisionCallback?!t.collisionCallback.call(t.collisionCallbackContext,e,t):!t.layer.callbacks[t.index]||!t.layer.callbacks[t.index].callback.call(t.layer.callbacks[t.index].callbackContext,e,t)}},function(t,e,i){ /** * @author Vladimir Agafonkin * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(430);function r(t){if(!(this instanceof r))return new r(t,[".left",".top",".right",".bottom"]);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}function s(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n=t.minX&&e.maxY>=t.minY}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,e,i,r,s){for(var o,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=r||(o=e+Math.ceil((i-e)/r/2)*r,n(t,o,e,i,s),a.push(e,o,o,i))}r.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!f(t,e))return i;for(var r,s,o,a,h=[];e;){for(r=0,s=e.children.length;r=0&&s[e].children.length>this._maxEntries;)this._split(s,e),e--;this._adjustParentBBoxes(r,s,e)},_split:function(t,e){var i=t[e],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);var s=this._chooseSplitIndex(i,r,n),a=m(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,o(i,this.toBBox),o(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,r,s,o,h,l,c,d,p,f,m,g,v,y;for(l=c=1/0,n=e;n<=i-e;n++)r=a(t,0,n,this.toBBox),s=a(t,n,i,this.toBBox),p=r,f=s,m=void 0,g=void 0,v=void 0,y=void 0,m=Math.max(p.minX,f.minX),g=Math.max(p.minY,f.minY),v=Math.min(p.maxX,f.maxX),y=Math.min(p.maxY,f.maxY),o=Math.max(0,v-m)*Math.max(0,y-g),h=u(r)+u(s),o=e;r--)s=t.children[r],h(c,t.leaf?o(s):s),u+=d(c);return u},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)h(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():o(t[i],this.toBBox)},compareMinX:function(t,e){return t.left-e.left},compareMinY:function(t,e){return t.top-e.top},toBBox:function(t){return{minX:t.left,minY:t.top,maxX:t.right,maxY:t.bottom}}},t.exports=r},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(527),r=i(529),s=i(245);t.exports=function(t,e,i,o,a,h,l){var c=o.left,u=o.top,d=o.right,p=o.bottom,f=i.faceLeft||i.faceRight,m=i.faceTop||i.faceBottom;if(l||(f=!0,m=!0),!f&&!m)return!1;var g=0,v=0,y=0,x=1;if(e.deltaAbsX()>e.deltaAbsY()?y=-1:e.deltaAbsX() * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(528);t.exports=function(t,e,i,r,s,o){var a=0,h=e.faceLeft,l=e.faceRight,c=e.collideLeft,u=e.collideRight;return o||(h=!0,l=!0,c=!0,u=!0),t.deltaX()<0&&u&&t.checkCollision.left?l&&t.x0&&c&&t.checkCollision.right&&h&&t.right>i&&(a=t.right-i)>s&&(a=0),0!==a&&(t.customSeparateX?t.overlapX=a:n(t,a)),a}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.left=!0):e>0&&(t.blocked.none=!1,t.blocked.right=!0),t.position.x-=e,0===t.bounce.x?t.velocity.x=0:t.velocity.x=-t.velocity.x*t.bounce.x}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(530);t.exports=function(t,e,i,r,s,o){var a=0,h=e.faceTop,l=e.faceBottom,c=e.collideUp,u=e.collideDown;return o||(h=!0,l=!0,c=!0,u=!0),t.deltaY()<0&&u&&t.checkCollision.up?l&&t.y0&&c&&t.checkCollision.down&&h&&t.bottom>i&&(a=t.bottom-i)>s&&(a=0),0!==a&&(t.customSeparateY?t.overlapY=a:n(t,a)),a}},function(t,e){t.exports=function(t,e){e<0?(t.blocked.none=!1,t.blocked.up=!0):e>0&&(t.blocked.none=!1,t.blocked.down=!0),t.position.y-=e,0===t.bounce.y?t.velocity.y=0:t.velocity.y=-t.velocity.y*t.bounce.y}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(243),r=i(1383);t.exports=function(t,e,i,s){var o=n(t,e,i,s),a=t.immovable,h=e.immovable;if(i||0===o||a&&h||t.customSeparateX||e.customSeparateX)return 0!==o||t.embedded&&e.embedded;var l=r.Set(t,e,o);return a||h?(a?r.RunImmovableBody1(l):h&&r.RunImmovableBody2(l),!0):l>0||r.Check()}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(244),r=i(1384);t.exports=function(t,e,i,s){var o=n(t,e,i,s),a=t.immovable,h=e.immovable;if(i||0===o||a&&h||t.customSeparateY||e.customSeparateY)return 0!==o||t.embedded&&e.embedded;var l=r.Set(t,e,o);return a||h?(a?r.RunImmovableBody1(l):h&&r.RunImmovableBody2(l),!0):l>0||r.Check()}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(63),r=i(0),s=i(60),o=i(56),a=i(3),h=new r({initialize:function(t,e){var i=e.displayWidth?e.displayWidth:64,n=e.displayHeight?e.displayHeight:64;this.world=t,this.gameObject=e,this.debugShowBody=t.defaults.debugShowStaticBody,this.debugBodyColor=t.defaults.staticBodyDebugColor,this.enable=!0,this.isCircle=!1,this.radius=0,this.offset=new a,this.position=new a(e.x-i*e.originX,e.y-n*e.originY),this.width=i,this.height=n,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center=new a(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.velocity=a.ZERO,this.allowGravity=!1,this.gravity=a.ZERO,this.bounce=a.ZERO,this.onWorldBounds=!1,this.onCollide=!1,this.onOverlap=!1,this.mass=1,this.immovable=!0,this.pushable=!1,this.customSeparateX=!1,this.customSeparateY=!1,this.overlapX=0,this.overlapY=0,this.overlapR=0,this.embedded=!1,this.collideWorldBounds=!1,this.checkCollision={none:!1,up:!0,down:!0,left:!0,right:!0},this.touching={none:!0,up:!1,down:!1,left:!1,right:!1},this.wasTouching={none:!0,up:!1,down:!1,left:!1,right:!1},this.blocked={none:!0,up:!1,down:!1,left:!1,right:!1},this.physicsType=s.STATIC_BODY,this._dx=0,this._dy=0},setGameObject:function(t,e){return t&&t!==this.gameObject&&(this.gameObject.body=null,t.body=this,this.gameObject=t),e&&this.updateFromGameObject(),this},updateFromGameObject:function(){this.world.staticTree.remove(this);var t=this.gameObject;return t.getTopLeft(this.position),this.width=t.displayWidth,this.height=t.displayHeight,this.halfWidth=Math.abs(this.width/2),this.halfHeight=Math.abs(this.height/2),this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight),this.world.staticTree.insert(this),this},setOffset:function(t,e){return void 0===e&&(e=t),this.world.staticTree.remove(this),this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(t,e),this.position.x+=this.offset.x,this.position.y+=this.offset.y,this.updateCenter(),this.world.staticTree.insert(this),this},setSize:function(t,e,i){void 0===i&&(i=!0);var n=this.gameObject;if(!t&&n.frame&&(t=n.frame.realWidth),!e&&n.frame&&(e=n.frame.realHeight),this.world.staticTree.remove(this),this.width=t,this.height=e,this.halfWidth=Math.floor(t/2),this.halfHeight=Math.floor(e/2),i&&n.getCenter){var r=n.displayWidth/2,s=n.displayHeight/2;this.position.x-=this.offset.x,this.position.y-=this.offset.y,this.offset.set(r-this.halfWidth,s-this.halfHeight),this.position.x+=this.offset.x,this.position.y+=this.offset.y}return this.updateCenter(),this.isCircle=!1,this.radius=0,this.world.staticTree.insert(this),this},setCircle:function(t,e,i){return void 0===e&&(e=this.offset.x),void 0===i&&(i=this.offset.y),t>0?(this.world.staticTree.remove(this),this.isCircle=!0,this.radius=t,this.width=2*t,this.height=2*t,this.halfWidth=Math.floor(this.width/2),this.halfHeight=Math.floor(this.height/2),this.offset.set(e,i),this.updateCenter(),this.world.staticTree.insert(this)):this.isCircle=!1,this},updateCenter:function(){this.center.set(this.position.x+this.halfWidth,this.position.y+this.halfHeight)},reset:function(t,e){var i=this.gameObject;void 0===t&&(t=i.x),void 0===e&&(e=i.y),this.world.staticTree.remove(this),i.setPosition(t,e),i.getTopLeft(this.position),this.updateCenter(),this.world.staticTree.insert(this)},stop:function(){return this},getBounds:function(t){return t.x=this.x,t.y=this.y,t.right=this.right,t.bottom=this.bottom,t},hitTest:function(t,e){return this.isCircle?n(this,t,e):o(this,t,e)},postUpdate:function(){},deltaAbsX:function(){return 0},deltaAbsY:function(){return 0},deltaX:function(){return 0},deltaY:function(){return 0},deltaZ:function(){return 0},destroy:function(){this.enable=!1,this.world.pendingDestroy.set(this)},drawDebug:function(t){var e=this.position,i=e.x+this.halfWidth,n=e.y+this.halfHeight;this.debugShowBody&&(t.lineStyle(t.defaultStrokeWidth,this.debugBodyColor,1),this.isCircle?t.strokeCircle(i,n,this.width/2):t.strokeRect(e.x,e.y,this.width,this.height))},willDrawDebug:function(){return this.debugShowBody},setMass:function(t){return t<=0&&(t=.1),this.mass=t,this},x:{get:function(){return this.position.x},set:function(t){this.world.staticTree.remove(this),this.position.x=t,this.world.staticTree.insert(this)}},y:{get:function(){return this.position.y},set:function(t){this.world.staticTree.remove(this),this.position.y=t,this.world.staticTree.insert(this)}},left:{get:function(){return this.position.x}},right:{get:function(){return this.position.x+this.width}},top:{get:function(){return this.position.y}},bottom:{get:function(){return this.position.y+this.height}}});t.exports=h},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Bounce:i(1500),Collision:i(1501),Force:i(1502),Friction:i(1503),Gravity:i(1504),Mass:i(1505),Sensor:i(1506),SetBody:i(1507),Sleep:i(1508),Static:i(1525),Transform:i(1526),Velocity:i(1527)}},function(t,e){var i={};t.exports=i,i.create=function(t,e){var n=t.bodyA,r=t.bodyB,s={id:i.id(n,r),bodyA:n,bodyB:r,activeContacts:[],separation:0,isActive:!0,confirmedActive:!0,isSensor:n.isSensor||r.isSensor,timeCreated:e,timeUpdated:e,collision:null,inverseMass:0,friction:0,frictionStatic:0,restitution:0,slop:0};return i.update(s,t,e),s},i.update=function(t,e,n){if(t.collision=e,e.collided){var r=e.supports,s=t.activeContacts,o=e.parentA,a=e.parentB;t.inverseMass=o.inverseMass+a.inverseMass,t.friction=Math.min(o.friction,a.friction),t.frictionStatic=Math.max(o.frictionStatic,a.frictionStatic),t.restitution=Math.max(o.restitution,a.restitution),t.slop=Math.max(o.slop,a.slop);for(var h=0;h * @copyright 2020 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} */ var n=new(i(0))({initialize:function(t){this.pluginManager=t,this.game=t.game},init:function(){},start:function(){},stop:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=n},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=new(i(3));t.exports=function(t,e,i,r){var s=i.tilemapLayer,o=s.cullPaddingX,a=s.cullPaddingY,h=s.tilemap.tileToWorldXY(t,e,n,r,s);return h.x>r.worldView.x+s.scaleX*i.tileWidth*(-o-.5)&&h.xr.worldView.y+s.scaleY*i.tileHeight*(-a-1)&&h.y * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(26);t.exports=function(t,e,i,r,s,o,a){for(var h=n(i,r,s,o,null,a),l=0;l * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(10),r=i(137),s=i(76),o=new n;t.exports=function(t,e){var i=t.tilemapLayer.tilemap,n=t.tilemapLayer,a=Math.floor(i.tileWidth*n.scaleX),h=Math.floor(i.tileHeight*n.scaleY),l=s(e.worldView.x-n.x,a,0,!0)-n.cullPaddingX,c=r(e.worldView.right-n.x,a,0,!0)+n.cullPaddingX,u=s(e.worldView.y-n.y,h,0,!0)-n.cullPaddingY,d=r(e.worldView.bottom-n.y,h,0,!0)+n.cullPaddingY;return o.setTo(l,u,c-l,d-u)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(539),r=i(157);t.exports=function(t,e,i,s){void 0===i&&(i=[]),void 0===s&&(s=0),i.length=0;var o=t.tilemapLayer,a=n(t,e);return(o.skipCull||1!==o.scrollFactorX||1!==o.scrollFactorY)&&(a.left=0,a.right=t.width,a.top=0,a.bottom=t.height),r(t,a,s,i),i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(542),r=i(157);t.exports=function(t,e,i,s){void 0===i&&(i=[]),void 0===s&&(s=0),i.length=0;var o=t.tilemapLayer;if(!o.skipCull&&1===o.scrollFactorX&&1===o.scrollFactorY){var a=n(t,e);r(t,a,s,i)}return i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(137),r=i(76);t.exports=function(t,e){var i=t.tilemapLayer.tilemap,s=t.tilemapLayer,o=Math.floor(i.tileWidth*s.scaleX),a=Math.floor(i.tileHeight*s.scaleY),h=t.hexSideLength,l=(a-h)/2+h;return{left:r(e.worldView.x-s.x,o,0,!0)-s.cullPaddingX,right:n(e.worldView.right-s.x,o,0,!0)+s.cullPaddingX,top:r(e.worldView.y-s.y,l,0,!0)-s.cullPaddingY,bottom:n(e.worldView.bottom-s.y,l,0,!0)+s.cullPaddingY}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(537);t.exports=function(t,e,i,r){void 0===i&&(i=[]),void 0===r&&(r=0),i.length=0;var s,o,a,h=t.tilemapLayer,l=t.data,c=t.width,u=t.height,d=c,p=u;if(!h.skipCull)if(0===r){for(o=0;o=0;s--)if(n(s,o,t,e)){if(!(a=l[o][s])||-1===a.index||!a.visible||0===a.alpha)continue;i.push(a)}}else if(2===r){for(o=p;o>=0;o--)for(s=0;l[o]&&s=0;o--)for(s=d;l[o]&&s>=0;s--)if(n(s,o,t,e)){if(!(a=l[o][s])||-1===a.index||!a.visible||0===a.alpha)continue;i.push(a)}return h.tilesDrawn=i.length,h.tilesTotal=c*u,i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(545),r=i(157);t.exports=function(t,e,i,s){void 0===i&&(i=[]),void 0===s&&(s=0),i.length=0;var o=t.tilemapLayer;if(!o.skipCull&&1===o.scrollFactorX&&1===o.scrollFactorY){var a=n(t,e);r(t,a,s,i)}return i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(137),r=i(76);t.exports=function(t,e){var i=t.tilemapLayer.tilemap,s=t.tilemapLayer,o=Math.floor(i.tileWidth*s.scaleX),a=Math.floor(i.tileHeight*s.scaleY);return{left:r(e.worldView.x-s.x,o,0,!0)-s.cullPaddingX,right:n(e.worldView.right-s.x,o,0,!0)+s.cullPaddingX,top:r(e.worldView.y-s.y,a/2,0,!0)-s.cullPaddingY,bottom:n(e.worldView.bottom-s.y,a/2,0,!0)+s.cullPaddingY}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(3);t.exports=function(t,e,i,r,s){i||(i=new n);var o=s.baseTileWidth,a=s.baseTileHeight,h=s.tilemapLayer,l=0,c=0;h&&(r||(r=h.scene.cameras.main),l=h.x+r.scrollX*(1-h.scrollFactorX),o*=h.scaleX,c=h.y+r.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var u=s.hexSideLength,d=l+t*o+e%2*(o/2),p=c+e*((a-u)/2+u);return i.set(d,p)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(3);t.exports=function(t,e,i,r,s){i||(i=new n);var o=s.baseTileWidth,a=s.baseTileHeight,h=s.tilemapLayer,l=0,c=0;h&&(r||(r=h.scene.cameras.main),l=h.x+r.scrollX*(1-h.scrollFactorX),o*=h.scaleX,c=h.y+r.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var u=l+o/2*(t-e),d=c+(t+e)*(a/2);return i.set(u,d)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(3);t.exports=function(t,e,i,r,s){i||(i=new n);var o=s.baseTileWidth,a=s.baseTileHeight,h=s.tilemapLayer,l=0,c=0;h&&(r||(r=h.scene.cameras.main),l=h.x+r.scrollX*(1-h.scrollFactorX),o*=h.scaleX,c=h.y+r.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var u=l+t*o+e%2*(o/2),d=c+e*(a/2);return i.set(u,d)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(249),r=i(250),s=i(3);t.exports=function(t,e,i,o,a){return i||(i=new s(0,0)),i.x=n(t,o,a),i.y=r(e,o,a),i}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileHeight,r=i.tilemapLayer,s=0;r&&(void 0===e&&(e=r.scene.cameras.main),s=r.y+e.scrollY*(1-r.scrollFactorY),n*=r.scaleY);var o=r.tilemap.hexSideLength;return s+t*((n-o)/2+o)}},function(t,e){t.exports=function(t,e,i){var n=i.baseTileHeight,r=i.tilemapLayer,s=0;return r&&(void 0===e&&(e=r.scene.cameras.main),s=r.y+e.scrollY*(1-r.scrollFactorY),n*=r.scaleY),s+t*(n/2)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(3);t.exports=function(t,e,i,r,s,o){r||(r=new n);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(s||(s=l.scene.cameras.main),e-=l.y+s.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+s.scrollX*(1-l.scrollFactorX),a*=l.scaleX);var c=o.hexSideLength,u=(h-c)/2+c,d=i?Math.floor(e/u):e/u,p=i?Math.floor((t-d%2*.5*a)/a):(t-d%2*.5*a)/a;return r.set(p,d)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(3);t.exports=function(t,e,i,r,s,o){r||(r=new n);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(s||(s=l.scene.cameras.main),e-=l.y+s.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+s.scrollX*(1-l.scrollFactorX),a*=l.scaleX),t-=a/2;var c=i?Math.floor((t/(a/2)+e/(h/2))/2):(t/(a/2)+e/(h/2))/2,u=i?Math.floor((e/(h/2)-t/(a/2))/2):(e/(h/2)-t/(a/2))/2;return r.set(c,u)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(3);t.exports=function(t,e,i,r,s,o){r||(r=new n);var a=o.baseTileWidth,h=o.baseTileHeight,l=o.tilemapLayer;l&&(s||(s=l.scene.cameras.main),e-=l.y+s.scrollY*(1-l.scrollFactorY),h*=l.scaleY,t-=l.x+s.scrollX*(1-l.scrollFactorX),a*=l.scaleX);var c=i?Math.floor(e/(h/2)):e/(h/2),u=i?Math.floor((t+c%2*.5*a)/a):(t+c%2*.5*a)/a;return r.set(u,c)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(251),r=i(252),s=i(3);t.exports=function(t,e,i,o,a,h){return void 0===i&&(i=!0),o||(o=new s(0,0)),o.x=n(t,i,a,h),o.y=r(e,i,a,h),o}},function(t,e){t.exports=function(t,e,i,n){var r=n.baseTileHeight,s=n.tilemapLayer;s&&(i||(i=s.scene.cameras.main),t-=s.y+i.scrollY*(1-s.scrollFactorY),r*=s.scaleY);var o=n.hexSideLength,a=(r-o)/2+o;return e?Math.floor(t/a):t/a}},function(t,e){t.exports=function(t,e,i,n){var r=n.baseTileHeight,s=n.tilemapLayer;return s&&(i||(i=s.scene.cameras.main),t-=s.y+i.scrollY*(1-s.scrollFactorY),r*=s.scaleY),e?Math.floor(t/(r/2)):t/(r/2)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(118);t.exports=function(t,e,i){if(n(t,e,i)){var r=i.data[e][t];return null!==r&&r.index>-1}return!1}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(83),r=i(118),s=i(248);t.exports=function(t,e,i,o,a){if(void 0===i&&(i=!0),void 0===o&&(o=!0),!r(t,e,a))return null;var h=a.data[e][t];return h?(a.data[e][t]=i?null:new n(a,-1,t,e,a.tileWidth,a.tileHeight),o&&h&&h.collides&&s(t,e,a),h):null}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(39),r=i(255),s=i(561),o=i(562),a=i(573);t.exports=function(t,e,i,h,l,c){var u;switch(e){case n.ARRAY_2D:u=r(t,i,h,l,c);break;case n.CSV:u=s(t,i,h,l,c);break;case n.TILED_JSON:u=o(t,i,c);break;case n.WELTMEISTER:u=a(t,i,c);break;default:console.warn("Unrecognized tilemap data format: "+e),u=null}return u}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(39),r=i(255);t.exports=function(t,e,i,s,o){var a=e.trim().split("\n").map((function(t){return t.split(",")})),h=r(t,a,i,s,o);return h.format=n.CSV,h}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(563),r=i(564),s=i(29),o=i(39),a=i(254),h=i(120),l=i(565),c=i(566),u=i(569),d=i(571);t.exports=function(t,e,i){var p=new h({width:e.width,height:e.height,name:t,tileWidth:e.tilewidth,tileHeight:e.tileheight,orientation:a(e.orientation),format:o.TILED_JSON,version:e.version,properties:e.properties,renderOrder:e.renderorder,infinite:e.infinite});p.orientation===s.HEXAGONAL&&(p.hexSideLength=e.hexsidelength),p.layers=u(e,i),p.images=l(e);var f=d(e);return p.tilesets=f.tilesets,p.imageCollections=f.imageCollections,p.objects=c(e),p.tiles=r(p),n(p),p}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(17);t.exports=function(t){for(var e,i,r,s,o,a=0;a * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(121);t.exports=function(t){var e,i,r=[];for(e=0;e * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(2),r=i(159);t.exports=function(t){for(var e=[],i=[],s=r(t);s.i0;)if(s.i>=s.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}s=i.pop()}else{var o=s.layers[s.i];if(s.i++,"imagelayer"===o.type){var a=n(o,"offsetx",0)+n(o,"startx",0),h=n(o,"offsety",0)+n(o,"starty",0);e.push({name:s.name+o.name,image:o.image,x:s.x+a+o.x,y:s.y+h+o.y,alpha:s.opacity*o.opacity,visible:s.visible&&o.visible,properties:n(o,"properties",{})})}else if("group"===o.type){var l=r(t,o,s);i.push(s),s=l}}return e}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(2),r=i(256),s=i(568),o=i(159);t.exports=function(t){for(var e=[],i=[],a=o(t);a.i0;)if(a.i>=a.layers.length){if(i.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}a=i.pop()}else{var h=a.layers[a.i];if(a.i++,h.opacity*=a.opacity,h.visible=a.visible&&h.visible,"objectgroup"===h.type){h.name=a.name+h.name;for(var l=a.x+n(h,"startx",0)+n(h,"offsetx",0),c=a.y+n(h,"starty",0)+n(h,"offsety",0),u=[],d=0;d * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(125);t.exports=function(t,e){for(var i={},r=0;r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(2),s=new n({initialize:function(t){void 0===t&&(t={}),this.name=r(t,"name","object layer"),this.opacity=r(t,"opacity",1),this.properties=r(t,"properties",{}),this.propertyTypes=r(t,"propertytypes",{}),this.type=r(t,"type","objectgroup"),this.visible=r(t,"visible",!0),this.objects=r(t,"objects",[])}});t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(570),r=i(29),s=i(159),o=i(254),a=i(2),h=i(119),l=i(257),c=i(83);t.exports=function(t,e){for(var i=a(t,"infinite",!1),u=[],d=[],p=s(t);p.i0;)if(p.i>=p.layers.length){if(d.length<1){console.warn("TilemapParser.parseTiledJSON - Invalid layer group hierarchy");break}p=d.pop()}else{var f=p.layers[p.i];if(p.i++,"tilelayer"===f.type)if(f.compression)console.warn("TilemapParser.parseTiledJSON - Layer compression is unsupported, skipping layer '"+f.name+"'");else{if(f.encoding&&"base64"===f.encoding){if(f.chunks)for(var m=0;m0?((y=new c(g,v.gid,O,D,t.tilewidth,t.tileheight)).rotation=v.rotation,y.flipX=v.flipped,b[D][O]=y):(x=e?null:new c(g,-1,O,D,t.tilewidth,t.tileheight),b[D][O]=x),++w===M.width&&(P++,w=0)}}else{(g=new h({name:p.name+f.name,x:p.x+a(f,"offsetx",0)+f.x,y:p.y+a(f,"offsety",0)+f.y,width:f.width,height:f.height,tileWidth:t.tilewidth,tileHeight:t.tileheight,alpha:p.opacity*f.opacity,visible:p.visible&&f.visible,properties:a(f,"properties",[]),orientation:o(t.orientation)})).orientation===r.HEXAGONAL&&(g.hexSideLength=t.hexsidelength);for(var I=[],F=0,B=f.data.length;F0?((y=new c(g,v.gid,w,b.length,t.tilewidth,t.tileheight)).rotation=v.rotation,y.flipX=v.flipped,I.push(y)):(x=e?null:new c(g,-1,w,b.length,t.tilewidth,t.tileheight),I.push(x)),++w===f.width&&(b.push(I),w=0,I=[])}g.data=b,u.push(g)}else if("group"===f.type){var k=s(t,f,p);d.push(p),p=k}}return u}},function(t,e){t.exports=function(t){for(var e=window.atob(t),i=e.length,n=new Array(i/4),r=0;r>>0;return n}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(121),r=i(572),s=i(256);t.exports=function(t){for(var e,i=[],o=[],a=null,h=0;h1){if(Array.isArray(l.tiles)){for(var u={},d={},p=0;p * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=new(i(0))({initialize:function(t,e,i,n,r,s,o){(void 0===i||i<=0)&&(i=32),(void 0===n||n<=0)&&(n=32),void 0===r&&(r=0),void 0===s&&(s=0),this.name=t,this.firstgid=0|e,this.imageWidth=0|i,this.imageHeight=0|n,this.imageMargin=0|r,this.imageSpacing=0|s,this.properties=o||{},this.images=[],this.total=0},containsImageIndex:function(t){return t>=this.firstgid&&t * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(39),r=i(120),s=i(574),o=i(575);t.exports=function(t,e,i){if(0===e.layer.length)return console.warn("No layers found in the Weltmeister map: "+t),null;for(var a=0,h=0,l=0;la&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var c=new r({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:n.WELTMEISTER});return c.layers=s(e,i),c.tilesets=o(e),c}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(119),r=i(83);t.exports=function(t,e){for(var i=[],s=0;s-1?new r(a,p,u,c,o.tilesize,o.tilesize):e?null:new r(a,-1,u,c,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(121);t.exports=function(t){for(var e=[],i=[],r=0;r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(35),s=i(39),o=i(2),a=i(119),h=i(29),l=i(356),c=i(74),u=i(73),d=i(83),p=i(247),f=i(577),m=i(121),g=new n({initialize:function(t,e){this.scene=t,this.tileWidth=e.tileWidth,this.tileHeight=e.tileHeight,this.width=e.width,this.height=e.height,this.orientation=e.orientation,this.renderOrder=e.renderOrder,this.format=e.format,this.version=e.version,this.properties=e.properties,this.widthInPixels=e.widthInPixels,this.heightInPixels=e.heightInPixels,this.imageCollections=e.imageCollections,this.images=e.images,this.layers=e.layers,this.tilesets=e.tilesets,this.objects=e.objects,this.currentLayerIndex=0,this.hexSideLength=e.hexSideLength;var i=this.orientation;this._convert={WorldToTileXY:p.GetWorldToTileXYFunction(i),WorldToTileX:p.GetWorldToTileXFunction(i),WorldToTileY:p.GetWorldToTileYFunction(i),TileToWorldXY:p.GetTileToWorldXYFunction(i),TileToWorldX:p.GetTileToWorldXFunction(i),TileToWorldY:p.GetTileToWorldYFunction(i)}},createBlankDynamicLayer:function(t,e,i,n,r,s,o,a){return console.warn("createBlankDynamicLayer is deprecated. Use createBlankLayer"),this.createBlankLayer(t,e,i,n,r,s,o,a)},createDynamicLayer:function(t,e,i,n){return console.warn("createDynamicLayer is deprecated. Use createLayer"),this.createLayer(t,e,i,n)},createStaticLayer:function(t,e,i,n){return console.warn("createStaticLayer is deprecated. Use createLayer"),this.createLayer(t,e,i,n)},setRenderOrder:function(t){var e=["right-down","left-down","right-up","left-up"];return"number"==typeof t&&(t=e[t]),e.indexOf(t)>-1&&(this.renderOrder=t),this},addTilesetImage:function(t,e,i,n,r,o,a){if(void 0===t)return null;if(null==e&&(e=t),!this.scene.sys.textures.exists(e))return console.warn("Invalid Tileset Image: "+e),null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===s.TILED_JSON)return console.warn("No data found for Tileset: "+t),null;var c=this.tilesets[l];return c?(c.setTileSize(i,n),c.setSpacing(r,o),c.setImage(h),c):(void 0===i&&(i=this.tileWidth),void 0===n&&(n=this.tileHeight),void 0===r&&(r=0),void 0===o&&(o=0),void 0===a&&(a=0),(c=new m(t,a,i,n,r,o)).setImage(h),this.tilesets.push(c),c)},copy:function(t,e,i,n,r,s,o,a){return null!==(a=this.getLayer(a))?(p.Copy(t,e,i,n,r,s,o,a),this):null},createBlankLayer:function(t,e,i,n,r,s,o,h){if(void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=this.width),void 0===s&&(s=this.height),void 0===o&&(o=this.tileWidth),void 0===h&&(h=this.tileHeight),null!==this.getLayerIndex(t))return console.warn("Invalid Tilemap Layer ID: "+t),null;for(var l,c=new a({name:t,tileWidth:o,tileHeight:h,width:r,height:s,orientation:this.orientation}),u=0;u-1&&this.putTileAt(e,s.x,s.y,i,s.tilemapLayer)}return n},removeTileAt:function(t,e,i,n,r){return void 0===i&&(i=!0),void 0===n&&(n=!0),null===(r=this.getLayer(r))?null:p.RemoveTileAt(t,e,i,n,r)},removeTileAtWorldXY:function(t,e,i,n,r,s){return void 0===i&&(i=!0),void 0===n&&(n=!0),null===(s=this.getLayer(s))?null:p.RemoveTileAtWorldXY(t,e,i,n,r,s)},renderDebug:function(t,e,i){return null===(i=this.getLayer(i))?null:(this.orientation===h.ORTHOGONAL&&p.RenderDebug(t,e,i),this)},renderDebugFull:function(t,e){for(var i=this.layers,n=0;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(11),s=i(15),o=i(247),a=i(1449),h=new n({Extends:s,Mixins:[r.Alpha,r.BlendMode,r.ComputedSize,r.Depth,r.Flip,r.GetBounds,r.Origin,r.Pipeline,r.Transform,r.Visible,r.ScrollFactor,a],initialize:function(t,e,i,n,r,a){s.call(this,t,"TilemapLayer"),this.isTilemap=!0,this.tilemap=e,this.layerIndex=i,this.layer=e.layers[i],this.layer.tilemapLayer=this,this.tileset=[],this.tilesDrawn=0,this.tilesTotal=this.layer.width*this.layer.height,this.culledTiles=[],this.skipCull=!1,this.cullPaddingX=1,this.cullPaddingY=1,this.cullCallback=o.GetCullTilesFunction(this.layer.orientation),this._renderOrder=0,this.gidMap=[],this.setTilesets(n),this.setAlpha(this.layer.alpha),this.setPosition(r,a),this.setOrigin(),this.setSize(e.tileWidth*this.layer.width,e.tileHeight*this.layer.height),this.initPipeline()},setTilesets:function(t){var e=[],i=[],n=this.tilemap;Array.isArray(t)||(t=[t]);for(var r=0;r=0&&t<4&&(this._renderOrder=t),this},calculateFacesAt:function(t,e){return o.CalculateFacesAt(t,e,this.layer),this},calculateFacesWithin:function(t,e,i,n){return o.CalculateFacesWithin(t,e,i,n,this.layer),this},createFromTiles:function(t,e,i,n,r){return o.CreateFromTiles(t,e,i,n,r,this.layer)},cull:function(t){return this.cullCallback(this.layer,t,this.culledTiles,this._renderOrder)},copy:function(t,e,i,n,r,s,a){return o.Copy(t,e,i,n,r,s,a,this.layer),this},fill:function(t,e,i,n,r,s){return o.Fill(t,e,i,n,r,s,this.layer),this},filterTiles:function(t,e,i,n,r,s,a){return o.FilterTiles(t,e,i,n,r,s,a,this.layer)},findByIndex:function(t,e,i){return o.FindByIndex(t,e,i,this.layer)},findTile:function(t,e,i,n,r,s,a){return o.FindTile(t,e,i,n,r,s,a,this.layer)},forEachTile:function(t,e,i,n,r,s,a){return o.ForEachTile(t,e,i,n,r,s,a,this.layer),this},getTileAt:function(t,e,i){return o.GetTileAt(t,e,i,this.layer)},getTileAtWorldXY:function(t,e,i,n){return o.GetTileAtWorldXY(t,e,i,n,this.layer)},getTilesWithin:function(t,e,i,n,r){return o.GetTilesWithin(t,e,i,n,r,this.layer)},getTilesWithinShape:function(t,e,i){return o.GetTilesWithinShape(t,e,i,this.layer)},getTilesWithinWorldXY:function(t,e,i,n,r,s){return o.GetTilesWithinWorldXY(t,e,i,n,r,s,this.layer)},hasTileAt:function(t,e){return o.HasTileAt(t,e,this.layer)},hasTileAtWorldXY:function(t,e,i){return o.HasTileAtWorldXY(t,e,i,this.layer)},putTileAt:function(t,e,i,n){return o.PutTileAt(t,e,i,n,this.layer)},putTileAtWorldXY:function(t,e,i,n,r){return o.PutTileAtWorldXY(t,e,i,n,r,this.layer)},putTilesAt:function(t,e,i,n){return o.PutTilesAt(t,e,i,n,this.layer),this},randomize:function(t,e,i,n,r){return o.Randomize(t,e,i,n,r,this.layer),this},removeTileAt:function(t,e,i,n){return o.RemoveTileAt(t,e,i,n,this.layer)},removeTileAtWorldXY:function(t,e,i,n,r){return o.RemoveTileAtWorldXY(t,e,i,n,r,this.layer)},renderDebug:function(t,e){return o.RenderDebug(t,e,this.layer),this},replaceByIndex:function(t,e,i,n,r,s){return o.ReplaceByIndex(t,e,i,n,r,s,this.layer),this},setSkipCull:function(t){return void 0===t&&(t=!0),this.skipCull=t,this},setCullPadding:function(t,e){return void 0===t&&(t=1),void 0===e&&(e=1),this.cullPaddingX=t,this.cullPaddingY=e,this},setCollision:function(t,e,i,n){return o.SetCollision(t,e,i,this.layer,n),this},setCollisionBetween:function(t,e,i,n){return o.SetCollisionBetween(t,e,i,n,this.layer),this},setCollisionByProperty:function(t,e,i){return o.SetCollisionByProperty(t,e,i,this.layer),this},setCollisionByExclusion:function(t,e,i){return o.SetCollisionByExclusion(t,e,i,this.layer),this},setCollisionFromCollisionGroup:function(t,e){return o.SetCollisionFromCollisionGroup(t,e,this.layer),this},setTileIndexCallback:function(t,e,i){return o.SetTileIndexCallback(t,e,i,this.layer),this},setTileLocationCallback:function(t,e,i,n,r,s){return o.SetTileLocationCallback(t,e,i,n,r,s,this.layer),this},shuffle:function(t,e,i,n){return o.Shuffle(t,e,i,n,this.layer),this},swapByIndex:function(t,e,i,n,r,s){return o.SwapByIndex(t,e,i,n,r,s,this.layer),this},tileToWorldX:function(t,e){return this.tilemap.tileToWorldX(t,e,this)},tileToWorldY:function(t,e){return this.tilemap.tileToWorldY(t,e,this)},tileToWorldXY:function(t,e,i,n){return this.tilemap.tileToWorldXY(t,e,i,n,this)},weightedRandomize:function(t,e,i,n,r){return o.WeightedRandomize(e,i,n,r,t,this.layer),this},worldToTileX:function(t,e,i){return this.tilemap.worldToTileX(t,e,i,this)},worldToTileY:function(t,e,i){return this.tilemap.worldToTileY(t,e,i,this)},worldToTileXY:function(t,e,i,n,r){return this.tilemap.worldToTileXY(t,e,i,n,r,this)},destroy:function(t){void 0===t&&(t=!0),this.tilemap&&(this.layer.tilemapLayer===this&&(this.layer.tilemapLayer=void 0),t&&this.tilemap.removeLayer(this),this.tilemap=void 0,this.layer=void 0,this.culledTiles.length=0,this.cullCallback=null,this.gidMap=[],this.tileset=[],s.prototype.destroy.call(this))}});t.exports=h},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(2),s=new n({initialize:function(t){this.delay=0,this.repeat=0,this.repeatCount=0,this.loop=!1,this.callback,this.callbackScope,this.args,this.timeScale=1,this.startAt=0,this.elapsed=0,this.paused=!1,this.hasDispatched=!1,this.reset(t)},reset:function(t){return this.delay=r(t,"delay",0),this.repeat=r(t,"repeat",0),this.loop=r(t,"loop",!1),this.callback=r(t,"callback",void 0),this.callbackScope=r(t,"callbackScope",this.callback),this.args=r(t,"args",[]),this.timeScale=r(t,"timeScale",1),this.startAt=r(t,"startAt",0),this.paused=r(t,"paused",!1),this.elapsed=this.startAt,this.hasDispatched=!1,this.repeatCount=-1===this.repeat||this.loop?999999999999:this.repeat,this},getProgress:function(){return this.elapsed/this.delay},getOverallProgress:function(){if(this.repeat>0){var t=this.delay+this.delay*this.repeat;return(this.elapsed+this.delay*(this.repeat-this.repeatCount))/t}return this.getProgress()},getRepeatCount:function(){return this.repeatCount},getElapsed:function(){return this.elapsed},getElapsedSeconds:function(){return.001*this.elapsed},getRemaining:function(){return this.delay-this.elapsed},getRemainingSeconds:function(){return.001*this.getRemaining()},getOverallRemaining:function(){return this.delay*(1+this.repeatCount)-this.elapsed},getOverallRemainingSeconds:function(){return.001*this.getOverallRemaining()},remove:function(t){void 0===t&&(t=!1),this.elapsed=this.delay,this.hasDispatched=!t,this.repeatCount=0},destroy:function(){this.callback=void 0,this.callbackScope=void 0,this.args=[]}});t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1458);t.exports=function(t){var e,i=[];if(t.hasOwnProperty("props"))for(e in t.props)"_"!==e.substr(0,1)&&i.push({key:e,value:t.props[e]});else for(e in t)-1===n.indexOf(e)&&"_"!==e.substr(0,1)&&i.push({key:e,value:t[e]});return i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(6);t.exports=function(t){var e=n(t,"tweens",null);return null===e?[]:("function"==typeof e&&(e=e.call()),Array.isArray(e)||(e=[e]),e)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(261),r=i(13),s=i(96),o=i(80),a=i(160),h=i(6),l=i(260),c=i(262),u=i(264);t.exports=function(t,e,i){void 0===i&&(i=n);var d=h(e,"from",0),p=h(e,"to",1),f=[{value:d}],m=a(e,"delay",i.delay),g=a(e,"duration",i.duration),v=h(e,"easeParams",i.easeParams),y=o(h(e,"ease",i.ease),v),x=a(e,"hold",i.hold),b=a(e,"repeat",i.repeat),w=a(e,"repeatDelay",i.repeatDelay),T=s(e,"yoyo",i.yoyo),_=[],E=l("value",p),S=u(f[0],0,"value",E.getEnd,E.getStart,E.getActive,y,m,g,T,x,b,w,!1,!1);S.start=d,S.current=d,S.to=p,_.push(S);var M=new c(t,_,f);M.offset=r(e,"offset",null),M.completeDelay=r(e,"completeDelay",0),M.loop=Math.round(r(e,"loop",0)),M.loopDelay=Math.round(r(e,"loopDelay",0)),M.paused=s(e,"paused",!1),M.useFrames=s(e,"useFrames",!1);for(var A=h(e,"callbackScope",M),C=[M,null],P=c.TYPES,R=0;R * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(80),r=i(6),s=i(14);t.exports=function(t,e){void 0===e&&(e={});var i=r(e,"start",0),o=r(e,"ease",null),a=r(e,"grid",null),h=r(e,"from",0),l="first"===h,c="center"===h,u="last"===h,d="number"==typeof h,p=Array.isArray(t),f=p?parseFloat(t[0]):parseFloat(t),m=p?parseFloat(t[1]):0,g=Math.max(f,m);if(p&&(i+=f),a){var v=a[0],y=a[1],x=0,b=0,w=0,T=0,_=[];u?(x=v-1,b=y-1):d?(x=h%v,b=Math.floor(h/v)):c&&(x=(v-1)/2,b=(y-1)/2);for(var E=s.MIN_SAFE_INTEGER,S=0;SE&&(E=A),_[S][M]=A}}}var C=o?n(o):null;return a?function(t,e,n,r){var s,o=0,a=r%v,h=Math.floor(r/v);if(a>=0&&a=0&&h * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(77),r=i(261),s=i(13),o=i(96),a=i(80),h=i(160),l=i(259),c=i(580),u=i(6),d=i(584),p=i(161);t.exports=function(t,e){var i=new d(t);i.completeDelay=s(e,"completeDelay",0),i.loop=Math.round(s(e,"loop",0)),i.loopDelay=Math.round(s(e,"loopDelay",0)),i.paused=o(e,"paused",!1),i.useFrames=o(e,"useFrames",!1);var f=u(e,"callbackScope",i),m=[i],g=u(e,"onStart",!1);if(g){var v=u(e,"onStartScope",f),y=u(e,"onStartParams",[]);i.setCallback("onStart",g,m.concat(y),v)}var x=u(e,"onUpdate",!1);if(x){var b=u(e,"onUpdateScope",f),w=u(e,"onUpdateParams",[]);i.setCallback("onUpdate",x,m.concat(w),b)}var T=u(e,"onLoop",!1);if(T){var _=u(e,"onLoopScope",f),E=u(e,"onLoopParams",[]);i.setCallback("onLoop",T,m.concat(E),_)}var S=u(e,"onYoyo",!1);if(S){var M=u(e,"onYoyoScope",f),A=u(e,"onYoyoParams",[]);i.setCallback("onYoyo",S,m.concat(null,A),M)}var C=u(e,"onComplete",!1);if(C){var P=u(e,"onCompleteScope",f),R=u(e,"onCompleteParams",[]);i.setCallback("onComplete",C,m.concat(R),P)}var L=c(e);if(0===L.length)return i.paused=!0,i;var O=n(r);O.targets=l(e);var D=s(e,"totalDuration",0);O.duration=D>0?Math.floor(D/L.length):h(e,"duration",O.duration),O.delay=h(e,"delay",O.delay),O.easeParams=u(e,"easeParams",O.easeParams),O.ease=a(u(e,"ease",O.ease),O.easeParams),O.hold=h(e,"hold",O.hold),O.repeat=h(e,"repeat",O.repeat),O.repeatDelay=h(e,"repeatDelay",O.repeatDelay),O.yoyo=o(e,"yoyo",O.yoyo),O.flipX=o(e,"flipX",O.flipX),O.flipY=o(e,"flipY",O.flipY);for(var I=0;I * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(9),s=i(263),o=i(161),a=i(97),h=new n({Extends:r,initialize:function(t){r.call(this),this.manager=t,this.isTimeline=!0,this.data=[],this.totalData=0,this.useFrames=!1,this.timeScale=1,this.loop=0,this.loopDelay=0,this.loopCounter=0,this.completeDelay=0,this.countdown=0,this.state=a.PENDING_ADD,this._pausedState=a.PENDING_ADD,this.paused=!1,this.elapsed=0,this.totalElapsed=0,this.duration=0,this.progress=0,this.totalDuration=0,this.totalProgress=0,this.callbacks={onComplete:null,onLoop:null,onStart:null,onUpdate:null,onYoyo:null},this.callbackScope},dispatchTimelineEvent:function(t,e){this.emit(t,this),e&&e.func.apply(e.scope,e.params)},setTimeScale:function(t){return this.timeScale=t,this},getTimeScale:function(){return this.timeScale},isPlaying:function(){return this.state===a.ACTIVE},add:function(t){return this.queue(o(this,t))},queue:function(t){return this.isPlaying()||(t.parent=this,t.parentIsTimeline=!0,this.data.push(t),this.totalData=this.data.length),this},hasOffset:function(t){return null!==t.offset},isOffsetAbsolute:function(t){return"number"==typeof t},isOffsetRelative:function(t){if("string"==typeof t){var e=t[0];if("-"===e||"+"===e)return!0}return!1},getRelativeOffset:function(t,e){var i=t[0],n=parseFloat(t.substr(2)),r=e;switch(i){case"+":r+=n;break;case"-":r-=n}return Math.max(0,r)},calcDuration:function(){for(var t=0,e=0,i=0,n=0;n0?this.totalDuration=this.duration+this.completeDelay+(this.duration+this.loopDelay)*this.loopCounter:this.totalDuration=this.duration+this.completeDelay},init:function(){return this.calcDuration(),this.progress=0,this.totalProgress=0,!this.paused||(this.state=a.PAUSED,!1)},resetTweens:function(t){for(var e=0;e0?(this.elapsed=0,this.progress=0,this.loopCounter--,this.resetTweens(!0),this.loopDelay>0?(this.countdown=this.loopDelay,this.state=a.LOOP_DELAY):(this.state=a.ACTIVE,this.dispatchTimelineEvent(s.TIMELINE_LOOP,this.callbacks.onLoop))):this.completeDelay>0?(this.state=a.COMPLETE_DELAY,this.countdown=this.completeDelay):(this.state=a.PENDING_REMOVE,this.dispatchTimelineEvent(s.TIMELINE_COMPLETE,this.callbacks.onComplete))},update:function(t,e){if(this.state!==a.PAUSED){switch(this.useFrames&&(e=1*this.manager.timeScale),e*=this.timeScale,this.elapsed+=e,this.progress=Math.min(this.elapsed/this.duration,1),this.totalElapsed+=e,this.totalProgress=Math.min(this.totalElapsed/this.totalDuration,1),this.state){case a.ACTIVE:for(var i=this.totalData,n=0;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={AFTER_ADD:i(1509),AFTER_REMOVE:i(1510),AFTER_UPDATE:i(1511),BEFORE_ADD:i(1512),BEFORE_REMOVE:i(1513),BEFORE_UPDATE:i(1514),COLLISION_ACTIVE:i(1515),COLLISION_END:i(1516),COLLISION_START:i(1517),DRAG_END:i(1518),DRAG:i(1519),DRAG_START:i(1520),PAUSE:i(1521),RESUME:i(1522),SLEEP_END:i(1523),SLEEP_START:i(1524)}},function(t,e,i){var n={};t.exports=n;var r=i(588),s=i(535),o=i(117);n.collisions=function(t,e){for(var i=[],a=e.pairs.table,h=e.metrics,l=0;l1?1:0;d1?1:0;f0:0!=(t.mask&e.category)&&0!=(e.mask&t.category)}},function(t,e,i){var n={};t.exports=n;var r=i(94),s=i(116);n.collides=function(t,e,i){var o,a,h,l,c=!1;if(i){var u=t.parent,d=e.parent,p=u.speed*u.speed+u.angularSpeed*u.angularSpeed+d.speed*d.speed+d.angularSpeed*d.angularSpeed;c=i&&i.collided&&p<.2,l=i}else l={collided:!1,bodyA:t,bodyB:e};if(i&&c){var f=l.axisBody,m=f===t?e:t,g=[f.axes[i.axisNumber]];if(h=n._overlapAxes(f.vertices,m.vertices,g),l.reused=!0,h.overlap<=0)return l.collided=!1,l}else{if((o=n._overlapAxes(t.vertices,e.vertices,t.axes)).overlap<=0)return l.collided=!1,l;if((a=n._overlapAxes(e.vertices,t.vertices,e.axes)).overlap<=0)return l.collided=!1,l;o.overlapr?r=a:a=0?o.index-1:c.length-1],l.x=r.x-u.x,l.y=r.y-u.y,h=-s.dot(i,l),a=r,r=c[(o.index+1)%c.length],l.x=r.x-u.x,l.y=r.y-u.y,(n=-s.dot(i,l))>>0;if("function"!=typeof t)throw new TypeError;for(var n=arguments.length>=2?arguments[1]:void 0,r=0;r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(44);t.exports=function(t,e,i,r,s){return n(t,"angle",e,i,r,s)}},function(t,e){t.exports=function(t,e,i){for(var n=0;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(283),r=i(122),s=i(2),o=i(1),a=new(i(127))({sys:{queueDepthSort:o,events:{once:o}}},0,0,1,1);t.exports=function(t,e){void 0===e&&(e={});var i=e.hasOwnProperty("width"),o=e.hasOwnProperty("height"),h=s(e,"width",-1),l=s(e,"height",-1),c=s(e,"cellWidth",1),u=s(e,"cellHeight",c),d=s(e,"position",r.TOP_LEFT),p=s(e,"x",0),f=s(e,"y",0),m=0,g=0,v=h*c,y=l*u;a.setPosition(p,f),a.setSize(c,u);for(var x=0;x * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(18),r={_alpha:1,_alphaTL:1,_alphaTR:1,_alphaBL:1,_alphaBR:1,clearAlpha:function(){return this.setAlpha(1)},setAlpha:function(t,e,i,r){return void 0===t&&(t=1),void 0===e?this.alpha=t:(this._alphaTL=n(t,0,1),this._alphaTR=n(e,0,1),this._alphaBL=n(i,0,1),this._alphaBR=n(r,0,1)),this},alpha:{get:function(){return this._alpha},set:function(t){var e=n(t,0,1);this._alpha=e,this._alphaTL=e,this._alphaTR=e,this._alphaBL=e,this._alphaBR=e,0===e?this.renderFlags&=-3:this.renderFlags|=2}},alphaTopLeft:{get:function(){return this._alphaTL},set:function(t){var e=n(t,0,1);this._alphaTL=e,0!==e&&(this.renderFlags|=2)}},alphaTopRight:{get:function(){return this._alphaTR},set:function(t){var e=n(t,0,1);this._alphaTR=e,0!==e&&(this.renderFlags|=2)}},alphaBottomLeft:{get:function(){return this._alphaBL},set:function(t){var e=n(t,0,1);this._alphaBL=e,0!==e&&(this.renderFlags|=2)}},alphaBottomRight:{get:function(){return this._alphaBR},set:function(t){var e=n(t,0,1);this._alphaBR=e,0!==e&&(this.renderFlags|=2)}}};t.exports=r},function(t,e){t.exports={width:0,height:0,displayWidth:{get:function(){return this.scaleX*this.width},set:function(t){this.scaleX=t/this.width}},displayHeight:{get:function(){return this.scaleY*this.height},set:function(t){this.scaleY=t/this.height}},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=i},function(t,e){t.exports={flipX:!1,flipY:!1,toggleFlipX:function(){return this.flipX=!this.flipX,this},toggleFlipY:function(){return this.flipY=!this.flipY,this},setFlipX:function(t){return this.flipX=t,this},setFlipY:function(t){return this.flipY=t,this},setFlip:function(t,e){return this.flipX=t,this.flipY=e,this},resetFlip:function(){return this.flipX=!1,this.flipY=!1,this}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(10),r=i(302),s=i(3),o={prepareBoundsOutput:function(t,e){return void 0===e&&(e=!1),0!==this.rotation&&r(t,this.x,this.y,this.rotation),e&&this.parentContainer&&this.parentContainer.getBoundsTransformMatrix().transformPoint(t.x,t.y,t),t},getCenter:function(t){return void 0===t&&(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,t},getTopLeft:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getTopRight:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY,this.prepareBoundsOutput(t,e)},getLeftCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getRightCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight/2,this.prepareBoundsOutput(t,e)},getBottomLeft:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomCenter:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth/2,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBottomRight:function(t,e){return t||(t=new s),t.x=this.x-this.displayWidth*this.originX+this.displayWidth,t.y=this.y-this.displayHeight*this.originY+this.displayHeight,this.prepareBoundsOutput(t,e)},getBounds:function(t){var e,i,r,s,o,a,h,l;if(void 0===t&&(t=new n),this.parentContainer){var c=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),c.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),c.transformPoint(t.x,t.y,t),r=t.x,s=t.y,this.getBottomLeft(t),c.transformPoint(t.x,t.y,t),o=t.x,a=t.y,this.getBottomRight(t),c.transformPoint(t.x,t.y,t),h=t.x,l=t.y}else this.getTopLeft(t),e=t.x,i=t.y,this.getTopRight(t),r=t.x,s=t.y,this.getBottomLeft(t),o=t.x,a=t.y,this.getBottomRight(t),h=t.x,l=t.y;return t.x=Math.min(e,r,o,h),t.y=Math.min(i,s,a,l),t.width=Math.max(e,r,o,h)-t.x,t.height=Math.max(i,s,a,l)-t.y,t}};t.exports=o},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="blur"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="boot"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="contextlost"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="contextrestored"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="destroy"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="focus"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="hidden"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pause"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="postrender"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="poststep"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="prerender"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="prestep"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="ready"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="resume"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="step"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="visible"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="postrender"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="prerender"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="render"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="resize"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i={_originComponent:!0,originX:.5,originY:.5,_displayOriginX:0,_displayOriginY:0,displayOriginX:{get:function(){return this._displayOriginX},set:function(t){this._displayOriginX=t,this.originX=t/this.width}},displayOriginY:{get:function(){return this._displayOriginY},set:function(t){this._displayOriginY=t,this.originY=t/this.height}},setOrigin:function(t,e){return void 0===t&&(t=.5),void 0===e&&(e=t),this.originX=t,this.originY=e,this.updateDisplayOrigin()},setOriginFromFrame:function(){return this.frame&&this.frame.customPivot?(this.originX=this.frame.pivotX,this.originY=this.frame.pivotY,this.updateDisplayOrigin()):this.setOrigin()},setDisplayOrigin:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this.displayOriginX=t,this.displayOriginY=e,this},updateDisplayOrigin:function(){return this._displayOriginX=this.originX*this.width,this._displayOriginY=this.originY*this.height,this}};t.exports=i},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(35),r=i(96),s=i(6),o=i(97),a=i(3),h={path:null,rotateToPath:!1,pathRotationOffset:0,pathOffset:null,pathVector:null,pathDelta:null,pathTween:null,pathConfig:null,_prevDirection:o.PLAYING_FORWARD,setPath:function(t,e){void 0===e&&(e=this.pathConfig);var i=this.pathTween;return i&&i.isPlaying()&&i.stop(),this.path=t,e&&this.startFollow(e),this},setRotateToPath:function(t,e){return void 0===e&&(e=0),this.rotateToPath=t,this.pathRotationOffset=e,this},isFollowing:function(){var t=this.pathTween;return t&&t.isPlaying()},startFollow:function(t,e){void 0===t&&(t={}),void 0===e&&(e=0);var i=this.pathTween;i&&i.isPlaying()&&i.stop(),"number"==typeof t&&(t={duration:t}),t.from=s(t,"from",0),t.to=s(t,"to",1);var h=r(t,"positionOnPath",!1);this.rotateToPath=r(t,"rotateToPath",!1),this.pathRotationOffset=s(t,"rotationOffset",0);var l=s(t,"startAt",e);if(l&&(t.onStart=function(t){var e=t.data[0];e.progress=l,e.elapsed=e.duration*l;var i=e.ease(e.progress);e.current=e.start+(e.end-e.start)*i,e.target[e.key]=e.current}),this.pathOffset||(this.pathOffset=new a(this.x,this.y)),this.pathVector||(this.pathVector=new a),this.pathDelta||(this.pathDelta=new a),this.pathDelta.reset(),this.pathTween=this.scene.sys.tweens.addCounter(t),this.path.getStartPoint(this.pathOffset),h&&(this.x=this.pathOffset.x,this.y=this.pathOffset.y),this.pathOffset.x=this.x-this.pathOffset.x,this.pathOffset.y=this.y-this.pathOffset.y,this._prevDirection=o.PLAYING_FORWARD,this.rotateToPath){var c=this.path.getPoint(.1);this.rotation=Math.atan2(c.y-this.y,c.x-this.x)+n(this.pathRotationOffset)}return this.pathConfig=t,this},pauseFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.pause(),this},resumeFollow:function(){var t=this.pathTween;return t&&t.isPaused()&&t.resume(),this},stopFollow:function(){var t=this.pathTween;return t&&t.isPlaying()&&t.stop(),this},pathUpdate:function(){var t=this.pathTween;if(t){var e=t.data[0],i=this.pathDelta,r=this.pathVector;if(i.copy(r).negate(),e.state===o.COMPLETE)return this.path.getPoint(1,r),i.add(r),r.add(this.pathOffset),void this.setPosition(r.x,r.y);if(e.state!==o.PLAYING_FORWARD&&e.state!==o.PLAYING_BACKWARD)return;this.path.getPoint(t.getValue(),r),i.add(r),r.add(this.pathOffset);var s=this.x,a=this.y;this.setPosition(r.x,r.y);var h=this.x-s,l=this.y-a;if(0===h&&0===l)return;if(e.state!==this._prevDirection)return void(this._prevDirection=e.state);this.rotateToPath&&(this.rotation=Math.atan2(l,h)+n(this.pathRotationOffset))}}};t.exports=h},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i={_sizeComponent:!0,width:0,height:0,displayWidth:{get:function(){return Math.abs(this.scaleX*this.frame.realWidth)},set:function(t){this.scaleX=t/this.frame.realWidth}},displayHeight:{get:function(){return Math.abs(this.scaleY*this.frame.realHeight)},set:function(t){this.scaleY=t/this.frame.realHeight}},setSizeToFrame:function(t){return void 0===t&&(t=this.frame),this.width=t.realWidth,this.height=t.realHeight,this},setSize:function(t,e){return this.width=t,this.height=e,this},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=e,this}};t.exports=i},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i={texture:null,frame:null,isCropped:!1,setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this}};t.exports=i},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i={texture:null,frame:null,isCropped:!1,setCrop:function(t,e,i,n){if(void 0===t)this.isCropped=!1;else if(this.frame){if("number"==typeof t)this.frame.setCropUVs(this._crop,t,e,i,n,this.flipX,this.flipY);else{var r=t;this.frame.setCropUVs(this._crop,r.x,r.y,r.width,r.height,this.flipX,this.flipY)}this.isCropped=!0}return this},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),this.frame=this.texture.get(t),this.frame.cutWidth&&this.frame.cutHeight?this.renderFlags|=8:this.renderFlags&=-9,this._sizeComponent&&e&&this.setSizeToFrame(),this._originComponent&&i&&(this.frame.customPivot?this.setOrigin(this.frame.pivotX,this.frame.pivotY):this.updateDisplayOrigin()),this.isCropped&&this.frame.updateCropUVs(this._crop,this.flipX,this.flipY),this},resetCropObject:function(){return{u0:0,v0:0,u1:0,v1:0,width:0,height:0,x:0,y:0,flipX:!1,flipY:!1,cx:0,cy:0,cw:0,ch:0}}};t.exports=i},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i={tintTopLeft:16777215,tintTopRight:16777215,tintBottomLeft:16777215,tintBottomRight:16777215,tintFill:!1,clearTint:function(){return this.setTint(16777215),this},setTint:function(t,e,i,n){return void 0===t&&(t=16777215),void 0===e&&(e=t,i=t,n=t),this.tintTopLeft=t,this.tintTopRight=e,this.tintBottomLeft=i,this.tintBottomRight=n,this.tintFill=!1,this},setTintFill:function(t,e,i,n){return this.setTint(t,e,i,n),this.tintFill=!0,this},tint:{set:function(t){this.setTint(t,t,t,t)}},isTinted:{get:function(){return this.tintFill||16777215!==this.tintTopLeft||16777215!==this.tintTopRight||16777215!==this.tintBottomLeft||16777215!==this.tintBottomRight}}};t.exports=i},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="changedata"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="changedata-"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="destroy"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="removedata"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="setdata"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="addedtoscene"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="destroy"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="removedfromscene"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="complete"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="created"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="error"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="loop"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="play"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="seeked"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="seeking"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="stop"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="timeout"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="unlocked"},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(44);t.exports=function(t,e,i,r,s){return n(t,"alpha",e,i,r,s)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(44);t.exports=function(t,e,i,r,s){return n(t,"x",e,i,r,s)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(44);t.exports=function(t,e,i,r,s,o,a){return null==i&&(i=e),n(t,"x",e,r,o,a),n(t,"y",i,s,o,a)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(44);t.exports=function(t,e,i,r,s){return n(t,"y",e,i,r,s)}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=6.28);for(var r=i,s=(n-i)/t.length,o=0;o * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(168);t.exports=function(t,e){for(var i=n(e,t.length),r=0;r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(310),r=i(175),s=i(176);t.exports=function(t,e,i){void 0===i&&(i=0);var o=n(e,!1,t.length);i>0?r(o,i):i<0&&s(o,Math.abs(i));for(var a=0;a * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(311);t.exports=function(t,e,i){var r=n({x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2},i),s=n({x1:e.x2,y1:e.y2,x2:e.x3,y2:e.y3},i),o=n({x1:e.x3,y1:e.y3,x2:e.x1,y2:e.y1},i);r.pop(),s.pop(),o.pop();for(var a=(r=r.concat(s,o)).length/t.length,h=0,l=0;l * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(166);t.exports=function(t,e){for(var i=0;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(177);t.exports=function(t,e){for(var i=0;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(169);t.exports=function(t,e){for(var i=0;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(170);t.exports=function(t,e){for(var i=0;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(178);t.exports=function(t,e){for(var i=0;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(44);t.exports=function(t,e,i,r,s){return n(t,"rotation",e,i,r,s)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(179),r=i(48);t.exports=function(t,e,i){for(var s=e.x,o=e.y,a=0;a * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(179);t.exports=function(t,e,i,r){var s=e.x,o=e.y;if(0===r)return t;for(var a=0;a * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(44);t.exports=function(t,e,i,r,s){return n(t,"scaleX",e,i,r,s)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(44);t.exports=function(t,e,i,r,s,o,a){return null==i&&(i=e),n(t,"scaleX",e,r,o,a),n(t,"scaleY",i,s,o,a)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(44);t.exports=function(t,e,i,r,s){return n(t,"scaleY",e,i,r,s)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"alpha",e,i,r,s)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(27);t.exports=function(t,e,i,r){return n(t,"blendMode",e,0,i,r)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"depth",e,i,r,s)}},function(t,e){t.exports=function(t,e,i){for(var n=0;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(27);t.exports=function(t,e,i,r,s,o,a){return null==i&&(i=e),n(t,"originX",e,r,o,a),n(t,"originY",i,s,o,a),t.forEach((function(t){t.updateDisplayOrigin()})),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"rotation",e,i,r,s)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(27);t.exports=function(t,e,i,r,s,o,a){return null==i&&(i=e),n(t,"scaleX",e,r,o,a),n(t,"scaleY",i,s,o,a)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"scaleX",e,i,r,s)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"scaleY",e,i,r,s)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(27);t.exports=function(t,e,i,r,s,o,a){return null==i&&(i=e),n(t,"scrollFactorX",e,r,o,a),n(t,"scrollFactorY",i,s,o,a)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"scrollFactorX",e,i,r,s)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"scrollFactorY",e,i,r,s)}},function(t,e){t.exports=function(t,e,i,n,r){for(var s=0;s * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(27);t.exports=function(t,e,i,r){return n(t,"visible",e,0,i,r)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"x",e,i,r,s)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(27);t.exports=function(t,e,i,r,s,o,a){return null==i&&(i=e),n(t,"x",e,r,o,a),n(t,"y",i,s,o,a)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"y",e,i,r,s)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(3);t.exports=function(t,e,i,r,s){var o,a,h,l,c,u;if(void 0===r&&(r=0),void 0===s&&(s=new n),t.length>1)if(0===r){var d=t.length-1;for(o=t[d].x,a=t[d].y,h=d-1;h>=0;h--)l=(u=t[h]).x,c=u.y,u.x=o,u.y=a,o=l,a=c;t[d].x=e,t[d].y=i}else{for(o=t[0].x,a=t[0].y,h=1;h * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(129);t.exports=function(t){return n(t)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(180);t.exports=function(t,e,i,r,s){void 0===s&&(s=!1);var o,a=Math.abs(r-i)/t.length;if(s)for(o=0;o * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(181);t.exports=function(t,e,i,r,s){void 0===s&&(s=!1);var o,a=Math.abs(r-i)/t.length;if(s)for(o=0;o * @author samme * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(66);t.exports=function(t,e,i){void 0===i&&(i=0);for(var r=0;r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Animation:i(182),AnimationFrame:i(313),AnimationManager:i(315),AnimationState:i(162),Events:i(130)}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="add"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="animationcomplete"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="animationcomplete-"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="animationrepeat"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="animationrestart"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="animationstart"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="animationstop"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="animationupdate"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pauseall"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="remove"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="resumeall"},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={BaseCache:i(317),CacheManager:i(319),Events:i(318)}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="add"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="remove"},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Controls:i(715),Scene2D:i(718)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={FixedKeyControl:i(716),SmoothedKeyControl:i(717)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(6),s=new n({initialize:function(t){this.camera=r(t,"camera",null),this.left=r(t,"left",null),this.right=r(t,"right",null),this.up=r(t,"up",null),this.down=r(t,"down",null),this.zoomIn=r(t,"zoomIn",null),this.zoomOut=r(t,"zoomOut",null),this.zoomSpeed=r(t,"zoomSpeed",.01),this.speedX=0,this.speedY=0;var e=r(t,"speed",null);"number"==typeof e?(this.speedX=e,this.speedY=e):(this.speedX=r(t,"speed.x",0),this.speedY=r(t,"speed.y",0)),this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this.up&&this.up.isDown?e.scrollY-=this.speedY*t|0:this.down&&this.down.isDown&&(e.scrollY+=this.speedY*t|0),this.left&&this.left.isDown?e.scrollX-=this.speedX*t|0:this.right&&this.right.isDown&&(e.scrollX+=this.speedX*t|0),this.zoomIn&&this.zoomIn.isDown?(e.zoom-=this.zoomSpeed,e.zoom<.1&&(e.zoom=.1)):this.zoomOut&&this.zoomOut.isDown&&(e.zoom+=this.zoomSpeed)}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(6),s=new n({initialize:function(t){this.camera=r(t,"camera",null),this.left=r(t,"left",null),this.right=r(t,"right",null),this.up=r(t,"up",null),this.down=r(t,"down",null),this.zoomIn=r(t,"zoomIn",null),this.zoomOut=r(t,"zoomOut",null),this.zoomSpeed=r(t,"zoomSpeed",.01),this.accelX=0,this.accelY=0;var e=r(t,"acceleration",null);"number"==typeof e?(this.accelX=e,this.accelY=e):(this.accelX=r(t,"acceleration.x",0),this.accelY=r(t,"acceleration.y",0)),this.dragX=0,this.dragY=0;var i=r(t,"drag",null);"number"==typeof i?(this.dragX=i,this.dragY=i):(this.dragX=r(t,"drag.x",0),this.dragY=r(t,"drag.y",0)),this.maxSpeedX=0,this.maxSpeedY=0;var n=r(t,"maxSpeed",null);"number"==typeof n?(this.maxSpeedX=n,this.maxSpeedY=n):(this.maxSpeedX=r(t,"maxSpeed.x",0),this.maxSpeedY=r(t,"maxSpeed.y",0)),this._speedX=0,this._speedY=0,this._zoom=0,this.active=null!==this.camera},start:function(){return this.active=null!==this.camera,this},stop:function(){return this.active=!1,this},setCamera:function(t){return this.camera=t,this},update:function(t){if(this.active){void 0===t&&(t=1);var e=this.camera;this._speedX>0?(this._speedX-=this.dragX*t,this._speedX<0&&(this._speedX=0)):this._speedX<0&&(this._speedX+=this.dragX*t,this._speedX>0&&(this._speedX=0)),this._speedY>0?(this._speedY-=this.dragY*t,this._speedY<0&&(this._speedY=0)):this._speedY<0&&(this._speedY+=this.dragY*t,this._speedY>0&&(this._speedY=0)),this.up&&this.up.isDown?(this._speedY+=this.accelY,this._speedY>this.maxSpeedY&&(this._speedY=this.maxSpeedY)):this.down&&this.down.isDown&&(this._speedY-=this.accelY,this._speedY<-this.maxSpeedY&&(this._speedY=-this.maxSpeedY)),this.left&&this.left.isDown?(this._speedX+=this.accelX,this._speedX>this.maxSpeedX&&(this._speedX=this.maxSpeedX)):this.right&&this.right.isDown&&(this._speedX-=this.accelX,this._speedX<-this.maxSpeedX&&(this._speedX=-this.maxSpeedX)),this.zoomIn&&this.zoomIn.isDown?this._zoom=-this.zoomSpeed:this.zoomOut&&this.zoomOut.isDown?this._zoom=this.zoomSpeed:this._zoom=0,0!==this._speedX&&(e.scrollX-=this._speedX*t|0),0!==this._speedY&&(e.scrollY-=this._speedY*t|0),0!==this._zoom&&(e.zoom+=this._zoom,e.zoom<.001&&(e.zoom=.001))}},destroy:function(){this.camera=null,this.left=null,this.right=null,this.up=null,this.down=null,this.zoomIn=null,this.zoomOut=null}});t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Camera:i(320),BaseCamera:i(131),CameraManager:i(775),Effects:i(327),Events:i(36)}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="cameradestroy"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="camerafadeincomplete"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="camerafadeinstart"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="camerafadeoutcomplete"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="camerafadeoutstart"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="cameraflashcomplete"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="cameraflashstart"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="followupdate"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="camerapancomplete"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="camerapanstart"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="postrender"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="prerender"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="camerarotatecomplete"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="camerarotatestart"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="camerashakecomplete"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="camerashakestart"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="camerazoomcomplete"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="camerazoomstart"},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(18),r=i(0),s=i(36),o=new r({initialize:function(t){this.camera=t,this.isRunning=!1,this.isComplete=!1,this.direction=!0,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,r,o,a,h){if(void 0===t&&(t=!0),void 0===e&&(e=1e3),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=0),void 0===o&&(o=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),!o&&this.isRunning)return this.camera;this.isRunning=!0,this.isComplete=!1,this.duration=e,this.direction=t,this.progress=0,this.red=i,this.green=n,this.blue=r,this.alpha=t?Number.MIN_VALUE:1,this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h;var l=t?s.FADE_OUT_START:s.FADE_IN_START;return this.camera.emit(l,this.camera,this,e,i,n,r),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(18),r=i(0),s=i(36),o=new r({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.red=0,this.green=0,this.blue=0,this.alpha=0,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,r,o,a){return void 0===t&&(t=250),void 0===e&&(e=255),void 0===i&&(i=255),void 0===n&&(n=255),void 0===r&&(r=!1),void 0===o&&(o=null),void 0===a&&(a=this.camera.scene),!r&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,this.red=e,this.green=i,this.blue=n,this.alpha=1,this._elapsed=0,this._onUpdate=o,this._onUpdateScope=a,this.camera.emit(s.FLASH_START,this.camera,this,t,e,i,n)),this.camera},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(18),r=i(0),s=i(132),o=i(36),a=i(3),h=new r({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=new a,this.current=new a,this.destination=new a,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,r,a,h){void 0===i&&(i=1e3),void 0===n&&(n=s.Linear),void 0===r&&(r=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene);var l=this.camera;return!r&&this.isRunning||(this.isRunning=!0,this.duration=i,this.progress=0,this.source.set(l.scrollX,l.scrollY),this.destination.set(t,e),l.getScroll(t,e,this.current),"string"==typeof n&&s.hasOwnProperty(n)?this.ease=s[n]:"function"==typeof n&&(this.ease=n),this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h,this.camera.emit(o.PAN_START,this.camera,this,i,t,e)),l},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=n(this._elapsed/this.duration,0,1);this.progress=i;var r=this.camera;if(this._elapsed=1?1:1/e*(1+(e*t|0))}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(18),r=i(0),s=i(36),o=i(3),a=new r({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.intensity=new o,this.progress=0,this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,r){return void 0===t&&(t=100),void 0===e&&(e=.05),void 0===i&&(i=!1),void 0===n&&(n=null),void 0===r&&(r=this.camera.scene),!i&&this.isRunning||(this.isRunning=!0,this.duration=t,this.progress=0,"number"==typeof e?this.intensity.set(e):this.intensity.set(e.x,e.y),this._elapsed=0,this._offsetX=0,this._offsetY=0,this._onUpdate=n,this._onUpdateScope=r,this.camera.emit(s.SHAKE_START,this.camera,this,t,e)),this.camera},preRender:function(){this.isRunning&&this.camera.matrix.translate(this._offsetX,this._offsetY)},update:function(t,e){if(this.isRunning)if(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress),this._elapsed * @copyright 2018 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} */ var n=i(18),r=i(0),s=i(36),o=i(132),a=new r({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=0,this.current=0,this.destination=0,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope,this.clockwise=!0,this.shortestPath=!1},start:function(t,e,i,n,r,a,h){void 0===i&&(i=1e3),void 0===n&&(n=o.Linear),void 0===r&&(r=!1),void 0===a&&(a=null),void 0===h&&(h=this.camera.scene),void 0===e&&(e=!1),this.shortestPath=e;var l=t;t<0?(l=-1*t,this.clockwise=!1):this.clockwise=!0;var c=360*Math.PI/180;l-=Math.floor(l/c)*c;var u=this.camera;if(!r&&this.isRunning)return u;if(this.isRunning=!0,this.duration=i,this.progress=0,this.source=u.rotation,this.destination=l,"string"==typeof n&&o.hasOwnProperty(n)?this.ease=o[n]:"function"==typeof n&&(this.ease=n),this._elapsed=0,this._onUpdate=a,this._onUpdateScope=h,this.shortestPath){var d=0,p=0;(d=this.destination>this.source?Math.abs(this.destination-this.source):Math.abs(this.destination+c)-this.source)<(p=this.source>this.destination?Math.abs(this.source-this.destination):Math.abs(this.source+c)-this.destination)?this.clockwise=!0:d>p&&(this.clockwise=!1)}return this.camera.emit(s.ROTATE_START,this.camera,this,i,l),u},update:function(t,e){if(this.isRunning){this._elapsed+=e;var i=n(this._elapsed/this.duration,0,1);this.progress=i;var r=this.camera;if(this._elapsed=l?Math.abs(h-l):Math.abs(h+a)-l;var c=0;c=this.clockwise?r.rotation+o*s:r.rotation-o*s,r.rotation=c,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,r,i,c)}else r.rotation=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,r,i,this.destination),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(s.ROTATE_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.source=null,this.destination=null}});t.exports=a},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(18),r=i(0),s=i(132),o=i(36),a=new r({initialize:function(t){this.camera=t,this.isRunning=!1,this.duration=0,this.source=1,this.destination=1,this.ease,this.progress=0,this._elapsed=0,this._onUpdate,this._onUpdateScope},start:function(t,e,i,n,r,a){void 0===e&&(e=1e3),void 0===i&&(i=s.Linear),void 0===n&&(n=!1),void 0===r&&(r=null),void 0===a&&(a=this.camera.scene);var h=this.camera;return!n&&this.isRunning||(this.isRunning=!0,this.duration=e,this.progress=0,this.source=h.zoom,this.destination=t,"string"==typeof i&&s.hasOwnProperty(i)?this.ease=s[i]:"function"==typeof i&&(this.ease=i),this._elapsed=0,this._onUpdate=r,this._onUpdateScope=a,this.camera.emit(o.ZOOM_START,this.camera,this,e,t)),h},update:function(t,e){this.isRunning&&(this._elapsed+=e,this.progress=n(this._elapsed/this.duration,0,1),this._elapsed * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(320),r=i(0),s=i(2),o=i(24),a=i(56),h=i(101),l=i(21),c=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.roundPixels=t.sys.game.config.roundPixels,this.cameras=[],this.main,this.default,t.sys.events.once(l.BOOT,this.boot,this),t.sys.events.on(l.START,this.start,this)},boot:function(){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0],this.default=new n(0,0,t.scale.width,t.scale.height).setScene(this.scene),t.game.scale.on(h.RESIZE,this.onResize,this),this.systems.events.once(l.DESTROY,this.destroy,this)},start:function(){if(!this.main){var t=this.systems;t.settings.cameras?this.fromJSON(t.settings.cameras):this.add(),this.main=this.cameras[0]}var e=this.systems.events;e.on(l.UPDATE,this.update,this),e.once(l.SHUTDOWN,this.shutdown,this)},add:function(t,e,i,r,s,o){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===r&&(r=this.scene.sys.scale.height),void 0===s&&(s=!1),void 0===o&&(o="");var a=new n(t,e,i,r);return a.setName(o),a.setScene(this.scene),a.setRoundPixels(this.roundPixels),a.id=this.getNextID(),this.cameras.push(a),s&&(this.main=a),a},addExisting:function(t,e){return void 0===e&&(e=!1),-1===this.cameras.indexOf(t)?(t.id=this.getNextID(),t.setRoundPixels(this.roundPixels),this.cameras.push(t),e&&(this.main=t),t):null},getNextID:function(){for(var t=this.cameras,e=1,i=0;i<32;i++){for(var n=!1,r=0;r0){s.preRender();var o=this.getVisibleChildren(e.getChildren(),s);t.render(i,o,s)}}},getVisibleChildren:function(t,e){for(var i=[],n=0;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="enterfullscreen"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="fullscreenfailed"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="fullscreenunsupported"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="leavefullscreen"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="orientationchange"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="resize"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="addedtoscene"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="boot"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="create"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="destroy"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pause"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="postupdate"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="preupdate"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="ready"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="removedfromscene"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="render"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="resume"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="shutdown"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="sleep"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="start"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="transitioncomplete"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="transitioninit"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="transitionout"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="transitionstart"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="transitionwake"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="update"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="wake"},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Config:i(340),CreateRenderer:i(360),DebugHeader:i(378),Events:i(22),TimeStep:i(379),VisibilityHandler:i(381)}},function(t,e){var i,n,r=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(i===setTimeout)return setTimeout(t,0);if((i===s||!i)&&setTimeout)return i=setTimeout,setTimeout(t,0);try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}!function(){try{i="function"==typeof setTimeout?setTimeout:s}catch(t){i=s}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(t){n=o}}();var h,l=[],c=!1,u=-1;function d(){c&&h&&(c=!1,h.length?l=h.concat(l):u=-1,l.length&&p())}function p(){if(!c){var t=a(d);c=!0;for(var e=l.length;e;){for(h=l,l=[];++u1)for(var i=1;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(134),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=(("ontouchstart"in document.documentElement||navigator.maxTouchPoints&&navigator.maxTouchPoints>=1)&&(r.touch=!0),(navigator.msPointerEnabled||navigator.pointerEnabled)&&(r.mspointer=!0),navigator.getGamepads&&(r.gamepads=!0),"onwheel"in window||n.ie&&"WheelEvent"in window?r.wheelEvent="wheel":"onmousewheel"in window?r.wheelEvent="mousewheel":n.firefox&&"MouseScrollEvent"in window&&(r.wheelEvent="DOMMouseScroll"),r)},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(134),r={audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){r.audioData=!!window.Audio,r.webAudio=!(!window.AudioContext&&!window.webkitAudioContext);var t=document.createElement("audio"),e=!!t.canPlayType;try{if(e&&(t.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,"")&&(r.ogg=!0),(t.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,"")||t.canPlayType("audio/opus;").replace(/^no$/,""))&&(r.opus=!0),t.canPlayType("audio/mpeg;").replace(/^no$/,"")&&(r.mp3=!0),t.canPlayType("audio/wav").replace(/^no$/,"")&&(r.wav=!0),(t.canPlayType("audio/x-m4a;")||t.canPlayType("audio/aac;").replace(/^no$/,""))&&(r.m4a=!0),t.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")&&(r.webm=!0),""!==t.canPlayType('audio/mp4;codecs="ec-3"')))if(n.edge)r.dolby=!0;else if(n.safari&&n.safariVersion>=9&&/Mac OS X (\d+)_(\d+)/.test(navigator.userAgent)){var i=parseInt(RegExp.$1,10),s=parseInt(RegExp.$2,10);(10===i&&s>=11||i>10)&&(r.dolby=!0)}}catch(t){}return r}()},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i={h264:!1,hls:!1,mp4:!1,ogg:!1,vp9:!1,webm:!1};t.exports=function(){var t=document.createElement("video"),e=!!t.canPlayType;try{e&&(t.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,"")&&(i.ogg=!0),t.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.h264=!0,i.mp4=!0),t.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")&&(i.webm=!0),t.canPlayType('video/webm; codecs="vp9"').replace(/^no$/,"")&&(i.vp9=!0),t.canPlayType('application/x-mpegURL; codecs="avc1.42E01E"').replace(/^no$/,"")&&(i.hls=!0))}catch(t){}return i}()},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){var t,e="Fullscreen",n="FullScreen",r=["request"+e,"request"+n,"webkitRequest"+e,"webkitRequest"+n,"msRequest"+e,"msRequest"+n,"mozRequest"+n,"mozRequest"+e];for(t=0;t * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Between:i(343),BetweenPoints:i(344),BetweenPointsY:i(810),BetweenY:i(811),CounterClockwise:i(812),Normalize:i(345),Random:i(813),RandomDegrees:i(814),Reverse:i(815),RotateTo:i(816),ShortestBetween:i(817),Wrap:i(265),WrapDegrees:i(266)}},function(t,e){t.exports=function(t,e){return Math.atan2(e.x-t.x,e.y-t.y)}},function(t,e){t.exports=function(t,e,i,n){return Math.atan2(i-t,n-e)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(14);t.exports=function(t){return t>Math.PI&&(t-=n.PI2),Math.abs(((t+n.TAU)%n.PI2-n.PI2)%n.PI2)}},function(t,e,i){ /** * @author Richard Davey * @author @samme * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(135);t.exports=function(){return n(-Math.PI,Math.PI)}},function(t,e,i){ /** * @author Richard Davey * @author @samme * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(135);t.exports=function(){return n(-180,180)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(345);t.exports=function(t){return n(t+Math.PI)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(14);t.exports=function(t,e,i){return void 0===i&&(i=.05),t===e||(Math.abs(e-t)<=i||Math.abs(e-t)>=n.PI2-i?t=e:(Math.abs(e-t)>Math.PI&&(et?t+=i:e * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Between:i(48),BetweenPoints:i(346),BetweenPointsSquared:i(819),Chebyshev:i(820),Power:i(821),Snake:i(822),Squared:i(347)}},function(t,e){t.exports=function(t,e){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n}},function(t,e){t.exports=function(t,e,i,n){return Math.max(Math.abs(t-i),Math.abs(e-n))}},function(t,e){t.exports=function(t,e,i,n,r){return void 0===r&&(r=2),Math.sqrt(Math.pow(i-t,r)+Math.pow(n-e,r))}},function(t,e){t.exports=function(t,e,i,n){return Math.abs(t-i)+Math.abs(e-n)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Back:i(328),Bounce:i(329),Circular:i(330),Cubic:i(331),Elastic:i(332),Expo:i(333),Linear:i(334),Quadratic:i(335),Quartic:i(336),Quintic:i(337),Sine:i(338),Stepped:i(339)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Ceil:i(825),Equal:i(123),Floor:i(826),GreaterThan:i(348),LessThan:i(349)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.ceil(t-e)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1e-4),Math.floor(t+e)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Bezier:i(828),CatmullRom:i(829),CubicBezier:i(352),Linear:i(830),QuadraticBezier:i(353),SmoothStep:i(354),SmootherStep:i(831)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(350);t.exports=function(t,e){for(var i=0,r=t.length-1,s=0;s<=r;s++)i+=Math.pow(1-e,r-s)*Math.pow(e,s)*t[s]*n(r,s);return i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(191);t.exports=function(t,e){var i=t.length-1,r=i*e,s=Math.floor(r);return t[0]===t[i]?(e<0&&(s=Math.floor(r=i*(1+e))),n(r-s,t[(s-1+i)%i],t[s],t[(s+1)%i],t[(s+2)%i])):e<0?t[0]-(n(-r,t[0],t[0],t[1],t[1])-t[0]):e>1?t[i]-(n(r-i,t[i],t[i],t[i-1],t[i-1])-t[i]):n(r-s,t[s?s-1:0],t[s],t[i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(133);t.exports=function(t,e){var i=t.length-1,r=i*e,s=Math.floor(r);return e<0?n(t[0],t[1],r):e>1?n(t[i],t[i-1],i-r):n(t[s],t[s+1>i?i:s+1],r-s)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(180);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={GetNext:i(355),IsSize:i(136),IsValue:i(833)}},function(t,e){t.exports=function(t){return t>0&&0==(t&t-1)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Ceil:i(137),Floor:i(76),To:i(835)}},function(t,e){t.exports=function(t,e,i,n){return void 0===i&&(i=0),0===e?t:(t-=i,t=e*Math.round(t/e),n?(i+t)/e:i+t)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=new(i(0))({initialize:function(t){void 0===t&&(t=[(Date.now()*Math.random()).toString()]),this.c=1,this.s0=0,this.s1=0,this.s2=0,this.n=0,this.signs=[-1,1],t&&this.init(t)},rnd:function(){var t=2091639*this.s0+2.3283064365386963e-10*this.c;return this.c=0|t,this.s0=this.s1,this.s1=this.s2,this.s2=t-this.c,this.s2},hash:function(t){var e,i=this.n;t=t.toString();for(var n=0;n>>0,i=(e*=i)>>>0,i+=4294967296*(e-=i);return this.n=i,2.3283064365386963e-10*(i>>>0)},init:function(t){"string"==typeof t?this.state(t):this.sow(t)},sow:function(t){if(this.n=4022871197,this.s0=this.hash(" "),this.s1=this.hash(" "),this.s2=this.hash(" "),this.c=1,t)for(var e=0;e0;e--){var i=Math.floor(this.frac()*(e+1)),n=t[i];t[i]=t[e],t[e]=n}return t}});t.exports=n},function(t,e){t.exports=function(t){for(var e=0,i=0;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(18),r=i(0),s=i(67),o=i(1),a=new s,h=new r({initialize:function t(e,i,n,r){void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),void 0===r&&(r=t.DefaultOrder),this._x=e,this._y=i,this._z=n,this._order=r,this.onChangeCallback=o},x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback(this)}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback(this)}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback(this)}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback(this)}},set:function(t,e,i,n){return void 0===n&&(n=this._order),this._x=t,this._y=e,this._z=i,this._order=n,this.onChangeCallback(this),this},copy:function(t){return this.set(t.x,t.y,t.z,t.order)},setFromQuaternion:function(t,e,i){return void 0===e&&(e=this._order),void 0===i&&(i=!1),a.fromQuat(t),this.setFromRotationMatrix(a,e,i)},setFromRotationMatrix:function(t,e,i){void 0===e&&(e=this._order),void 0===i&&(i=!1);var r=t.val,s=r[0],o=r[4],a=r[8],h=r[1],l=r[5],c=r[9],u=r[2],d=r[6],p=r[10],f=0,m=0,g=0;switch(e){case"XYZ":m=Math.asin(n(a,-1,1)),Math.abs(a)<.99999?(f=Math.atan2(-c,p),g=Math.atan2(-o,s)):f=Math.atan2(d,l);break;case"YXZ":f=Math.asin(-n(c,-1,1)),Math.abs(c)<.99999?(m=Math.atan2(a,p),g=Math.atan2(h,l)):m=Math.atan2(-u,s);break;case"ZXY":f=Math.asin(n(d,-1,1)),Math.abs(d)<.99999?(m=Math.atan2(-u,p),g=Math.atan2(-o,l)):g=Math.atan2(h,s);break;case"ZYX":m=Math.asin(-n(u,-1,1)),Math.abs(u)<.99999?(f=Math.atan2(d,p),g=Math.atan2(h,s)):g=Math.atan2(-o,l);break;case"YZX":g=Math.asin(n(h,-1,1)),Math.abs(h)<.99999?(f=Math.atan2(-c,l),m=Math.atan2(-u,s)):m=Math.atan2(a,p);break;case"XZY":g=Math.asin(-n(o,-1,1)),Math.abs(o)<.99999?(f=Math.atan2(d,l),m=Math.atan2(a,s)):f=Math.atan2(-c,p)}return this._x=f,this._y=m,this._z=g,this._order=e,i&&this.onChangeCallback(this),this}});h.RotationOrders=["XYZ","YXZ","ZXY","ZYX","YZX","XZY"],h.DefaultOrder="XYZ",t.exports=h},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.floor(t*n)/n}},function(t,e){t.exports=function(t,e){return t/e/1e3}},function(t,e){t.exports=function(t){return t==parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t){return t===parseFloat(t)?!(t%2):void 0}},function(t,e){t.exports=function(t,e,i){return Math.min(t+e,i)}},function(t,e){t.exports=function(t,e,i){return Math.max(t-e,i)}},function(t,e){t.exports=function(t,e,i,n){void 0===i&&(i=e+1);var r=(t-e)/(i-e);return r>1?void 0!==n?(r=(n-t)/(n-i))<0&&(r=0):r=1:r<0&&(r=0),r}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI;return t.x=Math.cos(i)*e,t.y=Math.sin(i)*e,t}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);var i=2*Math.random()*Math.PI,n=2*Math.random()-1,r=Math.sqrt(1-n*n)*e;return t.x=Math.cos(i)*r,t.y=Math.sin(i)*r,t.z=n*e,t}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t.x=(2*Math.random()-1)*e,t.y=(2*Math.random()-1)*e,t.z=(2*Math.random()-1)*e,t.w=(2*Math.random()-1)*e,t}},function(t,e){t.exports=function(t,e,i,n,r){return t.x=e+r*Math.cos(n),t.y=i+r*Math.sin(n),t}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=10);var n=Math.pow(i,-e);return Math.round(t*n)/n}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=1),n*=Math.PI/t;for(var r=[],s=[],o=0;o * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(3);t.exports=function(t,e,i,r){void 0===r&&(r=new n);var s=0,o=0;return t>0&&t<=e*i&&(s=t>e-1?t-(o=Math.floor(t/e))*e:t,r.set(s,o)),r}},function(t,e){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(38),r=i(67),s=i(359),o=new r,a=new s,h=new n;t.exports=function(t,e,i){return a.setAxisAngle(e,i),o.fromRotationTranslation(a,h.set(0,0,0)),t.transformMat4(o)}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="addtexture"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="onerror"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="onload"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="ready"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="removetexture"},function(t,e){t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uMaskSampler;","uniform bool uInvertMaskAlpha;","","void main ()","{"," vec2 uv = gl_FragCoord.xy / uResolution;"," vec4 mainColor = texture2D(uMainSampler, uv);"," vec4 maskColor = texture2D(uMaskSampler, uv);"," float alpha = mainColor.a;",""," if (!uInvertMaskAlpha)"," {"," alpha *= (maskColor.a);"," }"," else"," {"," alpha *= (1.0 - maskColor.a);"," }",""," gl_FragColor = vec4(mainColor.rgb * alpha, alpha);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_BITMAP_MASK_VS","","precision mediump float;","","attribute vec2 inPosition;","","void main ()","{"," gl_Position = vec4(inPosition, 0.0, 1.0);","}",""].join("\n")},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pipelineafterflush"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pipelinebeforeflush"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pipelinebind"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pipelineboot"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pipelinedestroy"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pipelinerebind"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pipelineresize"},function(t,e){t.exports=["#define SHADER_NAME PHASER_GRAPHICS_FS","","precision mediump float;","","varying vec4 outColor;","","void main ()","{"," gl_FragColor = vec4(outColor.bgr * outColor.a, outColor.a);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_GRAPHICS_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec4 inColor;","","varying vec4 outColor;","","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",""," outColor = inColor;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_LIGHT_FS","","precision mediump float;","","struct Light","{"," vec2 position;"," vec3 color;"," float intensity;"," float radius;","};","","const int kMaxLights = %LIGHT_COUNT%;","","uniform vec4 uCamera; /* x, y, rotation, zoom */","uniform vec2 uResolution;","uniform sampler2D uMainSampler;","uniform sampler2D uNormSampler;","uniform vec3 uAmbientLightColor;","uniform Light uLights[kMaxLights];","uniform mat3 uInverseRotationMatrix;","","varying vec2 outTexCoord;","varying vec4 outTint;","","void main()","{"," vec3 finalColor = vec3(0.0, 0.0, 0.0);"," vec4 color = texture2D(uMainSampler, outTexCoord) * vec4(outTint.bgr * outTint.a, outTint.a);"," vec3 normalMap = texture2D(uNormSampler, outTexCoord).rgb;"," vec3 normal = normalize(uInverseRotationMatrix * vec3(normalMap * 2.0 - 1.0));"," vec2 res = vec2(min(uResolution.x, uResolution.y)) * uCamera.w;",""," for (int index = 0; index < kMaxLights; ++index)"," {"," Light light = uLights[index];"," vec3 lightDir = vec3((light.position.xy / res) - (gl_FragCoord.xy / res), 0.1);"," vec3 lightNormal = normalize(lightDir);"," float distToSurf = length(lightDir) * uCamera.w;"," float diffuseFactor = max(dot(normal, lightNormal), 0.0);"," float radius = (light.radius / res.x * uCamera.w) * uCamera.w;"," float attenuation = clamp(1.0 - distToSurf * distToSurf / (radius * radius), 0.0, 1.0);"," vec3 diffuse = light.color * diffuseFactor;"," finalColor += (attenuation * diffuse) * light.intensity;"," }",""," vec4 colorOutput = vec4(uAmbientLightColor + finalColor, 1.0);",""," gl_FragColor = color * vec4(colorOutput.rgb * colorOutput.a, colorOutput.a);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_MULTI_FS","","precision mediump float;","","uniform sampler2D uMainSampler[%count%];","","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," vec4 texture;",""," %forloop%",""," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);",""," // Multiply texture tint"," vec4 color = texture * texel;",""," if (outTintEffect == 1.0)"," {"," // Solid color + texture alpha"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," // Solid color, no texture"," color = texel;"," }",""," gl_FragColor = color;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_MULTI_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTexId;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",""," outTexCoord = inTexCoord;"," outTexId = inTexId;"," outTint = inTint;"," outTintEffect = inTintEffect;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_POINTLIGHT_FS","","precision mediump float;","","uniform vec2 uResolution;","uniform float uCameraZoom;","","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","","void main ()","{"," vec2 center = (lightPosition.xy + 1.0) * (uResolution.xy * 0.5);",""," float distToSurf = length(center - gl_FragCoord.xy);",""," float radius = 1.0 - distToSurf / (lightRadius * uCameraZoom);",""," float intensity = smoothstep(0.0, 1.0, radius * lightAttenuation);",""," vec4 color = vec4(intensity, intensity, intensity, 0.0) * lightColor;",""," gl_FragColor = vec4(color.rgb * lightColor.a, color.a);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_POINTLIGHT_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inLightPosition;","attribute vec4 inLightColor;","attribute float inLightRadius;","attribute float inLightAttenuation;","","varying vec4 lightPosition;","varying vec4 lightColor;","varying float lightRadius;","varying float lightAttenuation;","","void main ()","{"," lightColor = inLightColor;"," lightRadius = inLightRadius;"," lightAttenuation = inLightAttenuation;"," lightPosition = uProjectionMatrix * vec4(inLightPosition, 1.0, 1.0);",""," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_SINGLE_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," vec4 texture = texture2D(uMainSampler, outTexCoord);"," vec4 texel = vec4(outTint.bgr * outTint.a, outTint.a);",""," // Multiply texture tint"," vec4 color = texture * texel;",""," if (outTintEffect == 1.0)"," {"," // Solid color + texture alpha"," color.rgb = mix(texture.rgb, outTint.bgr * outTint.a, texture.a);"," }"," else if (outTintEffect == 2.0)"," {"," // Solid color, no texture"," color = texel;"," }",""," gl_FragColor = color;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_SINGLE_VS","","precision mediump float;","","uniform mat4 uProjectionMatrix;","","attribute vec2 inPosition;","attribute vec2 inTexCoord;","attribute float inTexId;","attribute float inTintEffect;","attribute vec4 inTint;","","varying vec2 outTexCoord;","varying float outTintEffect;","varying vec4 outTint;","","void main ()","{"," gl_Position = uProjectionMatrix * vec4(inPosition, 1.0, 1.0);",""," outTexCoord = inTexCoord;"," outTint = inTint;"," outTintEffect = inTintEffect;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_ADD_BLEND_FS","","precision mediump float;","","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);",""," gl_FragColor = frame1 + frame2 * uStrength;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_COLORMATRIX_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","uniform float uColorMatrix[20];","uniform float uAlpha;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 c = texture2D(uMainSampler, outTexCoord);",""," if (uAlpha == 0.0)"," {"," gl_FragColor = c;",""," return;"," }",""," if (c.a > 0.0)"," {"," c.rgb /= c.a;"," }",""," vec4 result;",""," result.r = (uColorMatrix[0] * c.r) + (uColorMatrix[1] * c.g) + (uColorMatrix[2] * c.b) + (uColorMatrix[3] * c.a) + uColorMatrix[4];"," result.g = (uColorMatrix[5] * c.r) + (uColorMatrix[6] * c.g) + (uColorMatrix[7] * c.b) + (uColorMatrix[8] * c.a) + uColorMatrix[9];"," result.b = (uColorMatrix[10] * c.r) + (uColorMatrix[11] * c.g) + (uColorMatrix[12] * c.b) + (uColorMatrix[13] * c.a) + uColorMatrix[14];"," result.a = (uColorMatrix[15] * c.r) + (uColorMatrix[16] * c.g) + (uColorMatrix[17] * c.b) + (uColorMatrix[18] * c.a) + uColorMatrix[19];",""," vec3 rgb = mix(c.rgb, result.rgb, uAlpha);",""," rgb *= result.a;",""," gl_FragColor = vec4(rgb, result.a);","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_COPY_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","uniform float uBrightness;","","varying vec2 outTexCoord;","","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord) * uBrightness;","}",""].join("\n")},function(t,e){t.exports=["#define SHADER_NAME PHASER_LINEAR_BLEND_FS","","precision mediump float;","","uniform sampler2D uMainSampler1;","uniform sampler2D uMainSampler2;","uniform float uStrength;","","varying vec2 outTexCoord;","","void main ()","{"," vec4 frame1 = texture2D(uMainSampler1, outTexCoord);"," vec4 frame2 = texture2D(uMainSampler2, outTexCoord);",""," gl_FragColor = mix(frame1, frame2 * uStrength, 0.5);","}",""].join("\n")},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={GenerateTexture:i(382),Palettes:i(885)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={ARNE16:i(383),C64:i(886),CGA:i(887),JMP:i(888),MSX:i(889)}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={0:"#000",1:"#fff",2:"#8b4131",3:"#7bbdc5",4:"#8b41ac",5:"#6aac41",6:"#3931a4",7:"#d5de73",8:"#945a20",9:"#5a4100",A:"#bd736a",B:"#525252",C:"#838383",D:"#acee8b",E:"#7b73de",F:"#acacac"}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={0:"#000",1:"#2234d1",2:"#0c7e45",3:"#44aacc",4:"#8a3622",5:"#5c2e78",6:"#aa5c3d",7:"#b5b5b5",8:"#5e606e",9:"#4c81fb",A:"#6cd947",B:"#7be2f9",C:"#eb8a60",D:"#e23d69",E:"#ffd93f",F:"#fff"}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#f5f4eb"}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={0:"#000",1:"#191028",2:"#46af45",3:"#a1d685",4:"#453e78",5:"#7664fe",6:"#833129",7:"#9ec2e8",8:"#dc534b",9:"#e18d79",A:"#d6b97b",B:"#e9d8a1",C:"#216c4b",D:"#d365c8",E:"#afaab9",F:"#fff"}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Path:i(891),MoveTo:i(387),CubicBezier:i(384),Curve:i(90),Ellipse:i(385),Line:i(386),QuadraticBezier:i(388),Spline:i(389)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(384),s=i(385),o=i(5),a=i(386),h=i(387),l=i(388),c=i(10),u=i(389),d=i(3),p=i(14),f=new n({initialize:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.name="",this.curves=[],this.cacheLengths=[],this.autoClose=!1,this.startPoint=new d,this._tmpVec2A=new d,this._tmpVec2B=new d,"object"==typeof t?this.fromJSON(t):this.startPoint.set(t,e)},add:function(t){return this.curves.push(t),this},circleTo:function(t,e,i){return void 0===e&&(e=!1),this.ellipseTo(t,t,0,360,e,i)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);return t.equals(e)||this.curves.push(new a(e,t)),this},cubicBezierTo:function(t,e,i,n,s,o){var a,h,l,c=this.getEndPoint();return t instanceof d?(a=t,h=e,l=i):(a=new d(i,n),h=new d(s,o),l=new d(t,e)),this.add(new r(c,a,h,l))},quadraticBezierTo:function(t,e,i,n){var r,s,o=this.getEndPoint();return t instanceof d?(r=t,s=e):(r=new d(i,n),s=new d(t,e)),this.add(new l(o,r,s))},draw:function(t,e){for(var i=0;i0?this.curves[this.curves.length-1].getPoint(1,t):t.copy(this.startPoint),t},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},getPoint:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),n=this.getCurveLengths(),r=0;r=i){var s=n[r]-i,o=this.curves[r],a=o.getLength(),h=0===a?0:1-s/a;return o.getPointAt(h,e)}r++}return null},getPoints:function(t){void 0===t&&(t=12);for(var e,i=[],n=0;n1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},getRandomPoint:function(t){return void 0===t&&(t=new d),this.getPoint(Math.random(),t)},getSpacedPoints:function(t){void 0===t&&(t=40);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e},getStartPoint:function(t){return void 0===t&&(t=new d),t.copy(this.startPoint)},getTangent:function(t,e){void 0===e&&(e=new d);for(var i=t*this.getLength(),n=this.getCurveLengths(),r=0;r=i){var s=n[r]-i,o=this.curves[r],a=o.getLength(),h=0===a?0:1-s/a;return o.getTangentAt(h,e)}r++}return null},lineTo:function(t,e){t instanceof d?this._tmpVec2B.copy(t):this._tmpVec2B.set(t,e);var i=this.getEndPoint(this._tmpVec2A);return this.add(new a([i.x,i.y,this._tmpVec2B.x,this._tmpVec2B.y]))},splineTo:function(t){return t.unshift(this.getEndPoint()),this.add(new u(t))},moveTo:function(t,e){return t instanceof d?this.add(new h(t.x,t.y)):this.add(new h(t,e))},toJSON:function(){for(var t=[],e=0;e * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={DataManager:i(98),DataManagerPlugin:i(893),Events:i(309)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(98),s=i(24),o=i(21),a=new n({Extends:r,initialize:function(t){r.call(this,t,t.sys.events),this.scene=t,this.systems=t.sys,t.sys.events.once(o.BOOT,this.boot,this),t.sys.events.on(o.START,this.start,this)},boot:function(){this.events=this.systems.events,this.events.once(o.DESTROY,this.destroy,this)},start:function(){this.events.once(o.SHUTDOWN,this.shutdown,this)},shutdown:function(){this.systems.events.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){r.prototype.destroy.call(this),this.events.off(o.START,this.start,this),this.scene=null,this.systems=null}});s.register("DataManagerPlugin",a,"data"),t.exports=a},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Align:i(895),BaseShader:i(390),Bounds:i(898),Canvas:i(902),Color:i(391),ColorMatrix:i(195),Masks:i(912),RGB:i(197)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(122),r=i(17),s={In:i(896),To:i(897)};s=r(!1,s,n),t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={BottomCenter:i(284),BottomLeft:i(285),BottomRight:i(286),Center:i(287),LeftCenter:i(289),QuickSet:i(283),RightCenter:i(290),TopCenter:i(291),TopLeft:i(292),TopRight:i(293)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={BottomCenter:i(271),BottomLeft:i(272),BottomRight:i(273),LeftBottom:i(274),LeftCenter:i(275),LeftTop:i(276),QuickSet:i(270),RightBottom:i(277),RightCenter:i(278),RightTop:i(279),TopCenter:i(280),TopLeft:i(281),TopRight:i(282)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={CenterOn:i(288),GetBottom:i(40),GetBounds:i(899),GetCenterX:i(84),GetCenterY:i(86),GetLeft:i(41),GetOffsetX:i(900),GetOffsetY:i(901),GetRight:i(42),GetTop:i(43),SetBottom:i(54),SetCenterX:i(85),SetCenterY:i(87),SetLeft:i(52),SetRight:i(53),SetTop:i(51)}},function(t,e,i){ /** * @author samme * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(40),r=i(41),s=i(42),o=i(43);t.exports=function(t,e){void 0===e&&(e={});var i=r(t),a=o(t);return e.x=i,e.y=a,e.width=s(t)-i,e.height=n(t)-a,e}},function(t,e){t.exports=function(t){return t.width*t.originX}},function(t,e){t.exports=function(t){return t.height*t.originY}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={CanvasInterpolation:i(361),CanvasPool:i(31),Smoothing:i(189),TouchAction:i(903),UserSelect:i(904)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e="none"),t.style.msTouchAction=e,t.style["ms-touch-action"]=e,t.style["touch-action"]=e,t}},function(t,e){t.exports=function(t,e){return void 0===e&&(e="none"),["-webkit-","-khtml-","-moz-","-ms-",""].forEach((function(i){t.style[i+"user-select"]=e})),t.style["-webkit-touch-callout"]=e,t.style["-webkit-tap-highlight-color"]="rgba(0, 0, 0, 0)",t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(100);t.exports=function(t){void 0===t&&(t=1024);var e,i=[],r=255,s=0,o=0;for(e=0;e<=255;e++)i.push({r:r,g:e,b:o,color:n(r,e,o)});for(s=255,e=255;e>=0;e--)i.push({r:e,g:s,b:o,color:n(e,s,o)});for(r=0,e=0;e<=255;e++,s--)i.push({r:r,g:s,b:e,color:n(r,s,e)});for(s=0,o=255,e=0;e<=255;e++,o--,r++)i.push({r:r,g:s,b:o,color:n(r,s,o)});if(1024===t)return i;var a=[],h=0,l=1024/t;for(e=0;e>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(37),r=i(393);t.exports=function(t,e,i){var s=i,o=i,a=i;if(0!==e){var h=i<.5?i*(1+e):i+e-i*e,l=2*i-h;s=r(l,h,t+1/3),o=r(l,h,t),a=r(l,h,t-1/3)}return(new n).setGLTo(s,o,a,1)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(185);t.exports=function(t,e){void 0===t&&(t=1),void 0===e&&(e=1);for(var i=[],r=0;r<=359;r++)i.push(n(r/359,t,e));return i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(133),r=function(t,e,i,r,s,o,a,h){void 0===a&&(a=100),void 0===h&&(h=0);var l=h/a;return{r:n(t,r,l),g:n(e,s,l),b:n(i,o,l)}};t.exports={RGBWithRGB:r,ColorWithRGB:function(t,e,i,n,s,o){return void 0===s&&(s=100),void 0===o&&(o=0),r(t.r,t.g,t.b,e,i,n,s,o)},ColorWithColor:function(t,e,i,n){return void 0===i&&(i=100),void 0===n&&(n=0),r(t.r,t.g,t.b,e.r,e.g,e.b,i,n)}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(192),r=i(37);t.exports=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=255),new r(n(t,e),n(t,e),n(t,e))}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(392);t.exports=function(t,e,i,r,s){return void 0===r&&(r=255),void 0===s&&(s="#"),"#"===s?"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1):"0x"+n(r)+n(t)+n(e)+n(i)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={BitmapMask:i(304),GeometryMask:i(305)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n={AddToDOM:i(140),DOMContentLoaded:i(394),GetInnerHeight:i(395),GetScreenOrientation:i(396),GetTarget:i(401),ParseXML:i(402),RemoveFromDOM:i(199),RequestAnimationFrame:i(380)};t.exports=n},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={EventEmitter:i(915)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(9),s=i(24),o=new n({Extends:r,initialize:function(){r.call(this)},shutdown:function(){this.removeAllListeners()},destroy:function(){this.removeAllListeners()}});s.register("EventEmitter",o,"events"),t.exports=o},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(140),r=i(315),s=i(319),o=i(31),a=i(0),h=i(340),l=i(917),c=i(360),u=i(98),d=i(378),p=i(341),f=i(394),m=i(9),g=i(22),v=i(403),y=i(24),x=i(408),b=i(409),w=i(411),T=i(103),_=i(416),E=i(379),S=i(381),M=i(420),A=new a({initialize:function(t){this.config=new h(t),this.renderer=null,this.domContainer=null,this.canvas=null,this.context=null,this.isBooted=!1,this.isRunning=!1,this.events=new m,this.anims=new r(this),this.textures=new _(this),this.cache=new s(this),this.registry=new u(this),this.input=new v(this,this.config),this.scene=new w(this,this.config.sceneConfig),this.device=p,this.scale=new b(this,this.config),this.sound=null,this.sound=M.create(this),this.loop=new E(this,this.config.fps),this.plugins=new x(this,this.config),this.pendingDestroy=!1,this.removeCanvas=!1,this.noReturn=!1,this.hasFocus=!1,f(this.boot.bind(this))},boot:function(){y.hasCore("EventEmitter")?(this.isBooted=!0,this.config.preBoot(this),this.scale.preBoot(),c(this),l(this),d(this),n(this.canvas,this.config.parent),this.textures.once(T.READY,this.texturesReady,this),this.events.emit(g.BOOT)):console.warn("Aborting. Core Plugins missing.")},texturesReady:function(){this.events.emit(g.READY),this.start()},start:function(){this.isRunning=!0,this.config.postBoot(this),this.renderer?this.loop.start(this.step.bind(this)):this.loop.start(this.headlessStep.bind(this)),S(this);var t=this.events;t.on(g.HIDDEN,this.onHidden,this),t.on(g.VISIBLE,this.onVisible,this),t.on(g.BLUR,this.onBlur,this),t.on(g.FOCUS,this.onFocus,this)},step:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(g.PRE_STEP,t,e),i.emit(g.STEP,t,e),this.scene.update(t,e),i.emit(g.POST_STEP,t,e);var n=this.renderer;n.preRender(),i.emit(g.PRE_RENDER,n,t,e),this.scene.render(n),n.postRender(),i.emit(g.POST_RENDER,n,t,e)},headlessStep:function(t,e){if(this.pendingDestroy)return this.runDestroy();var i=this.events;i.emit(g.PRE_STEP,t,e),i.emit(g.STEP,t,e),this.scene.update(t,e),i.emit(g.POST_STEP,t,e),i.emit(g.PRE_RENDER),i.emit(g.POST_RENDER)},onHidden:function(){this.loop.pause(),this.events.emit(g.PAUSE)},onVisible:function(){this.loop.resume(),this.events.emit(g.RESUME)},onBlur:function(){this.hasFocus=!1,this.loop.blur()},onFocus:function(){this.hasFocus=!0,this.loop.focus()},getFrame:function(){return this.loop.frame},getTime:function(){return this.loop.now},destroy:function(t,e){void 0===e&&(e=!1),this.pendingDestroy=!0,this.removeCanvas=t,this.noReturn=e},runDestroy:function(){this.scene.destroy(),this.events.emit(g.DESTROY),this.events.removeAllListeners(),this.renderer&&this.renderer.destroy(),this.removeCanvas&&this.canvas&&(o.remove(this.canvas),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)),this.domContainer&&this.domContainer.parentNode.removeChild(this.domContainer),this.loop.destroy(),this.pendingDestroy=!1}});t.exports=A},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(140);t.exports=function(t){var e=t.config;if(e.parent&&e.domCreateContainer){var i=document.createElement("div");i.style.cssText=["display: block;","width: "+t.scale.width+"px;","height: "+t.scale.height+"px;","padding: 0; margin: 0;","position: absolute;","overflow: hidden;","pointer-events: none;","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=i,n(i,e.parent)}}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="boot"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="destroy"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="dragend"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="dragenter"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="drag"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="dragleave"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="dragover"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="dragstart"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="drop"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="gameout"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="gameover"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="gameobjectdown"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="dragend"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="dragenter"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="drag"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="dragleave"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="dragover"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="dragstart"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="drop"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="gameobjectmove"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="gameobjectout"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="gameobjectover"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pointerdown"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pointermove"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pointerout"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pointerover"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pointerup"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="wheel"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="gameobjectup"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="gameobjectwheel"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="boot"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="process"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="update"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pointerdown"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pointerdownoutside"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pointermove"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pointerout"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pointerover"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pointerup"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pointerupoutside"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="wheel"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pointerlockchange"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="preupdate"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="shutdown"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="start"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="update"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="addfile"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="complete"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="filecomplete"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="filecomplete-"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="loaderror"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="load"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="fileprogress"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="postprocess"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="progress"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="start"},function(t,e,i){t.exports={game:"game",renderer:"renderer",anims:"anims",cache:"cache",plugins:"plugins",registry:"registry",scale:"scale",sound:"sound",textures:"textures",events:"events",cameras:"cameras",add:"add",make:"make",scenePlugin:"scene",displayList:"children",lights:"lights",data:"data",input:"input",load:"load",time:"time",tweens:"tweens",arcadePhysics:"physics",impactPhysics:"impact",matterPhysics:"matter"}},function(t,e){t.exports=function(t,e,i){if(i.getElementsByTagName("TextureAtlas")){var n=t.source[e];t.add("__BASE",e,0,0,n.width,n.height);for(var r,s=i.getElementsByTagName("SubTexture"),o=0;o * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(77);t.exports=function(t,e,i){if(i.frames||i.textures){var r=t.source[e];t.add("__BASE",e,0,0,r.width,r.height);for(var s,o=Array.isArray(i.textures)?i.textures[e].frames:i.frames,a=0;a * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(77);t.exports=function(t,e,i){if(i.frames){var r=t.source[e];t.add("__BASE",e,0,0,r.width,r.height);var s,o=i.frames;for(var a in o)if(o.hasOwnProperty(a)){var h=o[a];s=t.add(a,e,h.frame.x,h.frame.y,h.frame.w,h.frame.h),h.trimmed&&s.setTrim(h.sourceSize.w,h.sourceSize.h,h.spriteSourceSize.x,h.spriteSourceSize.y,h.spriteSourceSize.w,h.spriteSourceSize.h),h.rotated&&(s.rotated=!0,s.updateUVsInverted());var l=h.anchor||h.pivot;l&&(s.customPivot=!0,s.pivotX=l.x,s.pivotY=l.y),s.customData=n(h)}for(var c in i)"frames"!==c&&(Array.isArray(i[c])?t.customData[c]=i[c].slice(0):t.customData[c]=i[c]);return t}console.warn("Invalid Texture Atlas JSON Hash given, missing 'frames' Object")}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(2);t.exports=function(t,e,i,r,s,o,a){var h=n(a,"frameWidth",null),l=n(a,"frameHeight",h);if(null===h)throw new Error("TextureManager.SpriteSheet: Invalid frameWidth given.");var c=t.source[e];t.add("__BASE",e,0,0,c.width,c.height);var u=n(a,"startFrame",0),d=n(a,"endFrame",-1),p=n(a,"margin",0),f=n(a,"spacing",0),m=Math.floor((s-p+f)/(h+f))*Math.floor((o-p+f)/(l+f));0===m&&console.warn("SpriteSheet frame dimensions will result in zero frames for texture:",t.key),(u>m||u<-m)&&(u=0),u<0&&(u=m+u),-1!==d&&(m=u+(d+1));for(var g=p,v=p,y=0,x=0,b=0;bs&&(y=w-s),T>o&&(x=T-o),t.add(b,e,i+g,r+v,h-y,l-x),(g+=h+f)+h>s&&(g=p,v+=l+f)}return t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(2);t.exports=function(t,e,i){var r=n(i,"frameWidth",null),s=n(i,"frameHeight",r);if(!r)throw new Error("TextureManager.SpriteSheetFromAtlas: Invalid frameWidth given.");var o=t.source[0];t.add("__BASE",0,0,0,o.width,o.height);var a,h=n(i,"startFrame",0),l=n(i,"endFrame",-1),c=n(i,"margin",0),u=n(i,"spacing",0),d=e.cutX,p=e.cutY,f=e.cutWidth,m=e.cutHeight,g=e.realWidth,v=e.realHeight,y=Math.floor((g-c+u)/(r+u)),x=Math.floor((v-c+u)/(s+u)),b=y*x,w=e.x,T=r-w,_=r-(g-f-w),E=e.y,S=s-E,M=s-(v-m-E);(h>b||h<-b)&&(h=0),h<0&&(h=b+h),-1!==l&&(b=h+(l+1));for(var A=c,C=c,P=0,R=e.sourceIndex,L=0;L * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i=0,n=function(t,e,n,r){var s=i-r.y-r.height;t.add(n,e,r.x,s,r.width,r.height)};t.exports=function(t,e,r){var s=t.source[e];t.add("__BASE",e,0,0,s.width,s.height),i=s.height;for(var o=r.split("\n"),a=/^[ ]*(- )*(\w+)+[: ]+(.*)/,h="",l="",c={x:0,y:0,width:0,height:0},u=0;u * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="complete"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="decoded"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="decodedall"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="destroy"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="detune"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="detune"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="mute"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="rate"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="volume"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="loop"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="looped"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="mute"},function(t,e){ /** * @author pi-kei * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pan"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pauseall"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pause"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="play"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="rate"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="resumeall"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="resume"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="seek"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="stopall"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="stop"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="unlocked"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="volume"},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n={Events:i(75),DisplayList:i(1008),GameObjectCreator:i(16),GameObjectFactory:i(5),UpdateList:i(1034),Components:i(11),GetCalcMatrix:i(19),BuildGameObject:i(28),BuildGameObjectAnimation:i(433),GameObject:i(15),BitmapText:i(147),Blitter:i(210),Bob:i(434),Container:i(211),DOMElement:i(436),DynamicBitmapText:i(212),Extern:i(438),Graphics:i(213),Group:i(110),Image:i(124),Layer:i(216),Particles:i(1068),PathFollower:i(451),RenderTexture:i(218),RetroFont:i(1076),Rope:i(220),Sprite:i(73),Text:i(221),GetTextSize:i(452),MeasureText:i(454),TextStyle:i(453),TileSprite:i(222),Zone:i(127),Video:i(223),Shape:i(33),Arc:i(455),Curve:i(456),Ellipse:i(457),Grid:i(458),IsoBox:i(459),IsoTriangle:i(460),Line:i(461),Polygon:i(462),Rectangle:i(467),Star:i(468),Triangle:i(469),Factories:{Blitter:i(1124),Container:i(1125),DOMElement:i(1126),DynamicBitmapText:i(1127),Extern:i(1128),Graphics:i(1129),Group:i(1130),Image:i(1131),Layer:i(1132),Particles:i(1133),PathFollower:i(1134),RenderTexture:i(1135),Rope:i(1136),Sprite:i(1137),StaticBitmapText:i(1138),Text:i(1139),TileSprite:i(1140),Zone:i(1141),Video:i(1142),Arc:i(1143),Curve:i(1144),Ellipse:i(1145),Grid:i(1146),IsoBox:i(1147),IsoTriangle:i(1148),Line:i(1149),Polygon:i(1150),Rectangle:i(1151),Star:i(1152),Triangle:i(1153)},Creators:{Blitter:i(1154),Container:i(1155),DynamicBitmapText:i(1156),Graphics:i(1157),Group:i(1158),Image:i(1159),Layer:i(1160),Particles:i(1161),RenderTexture:i(1162),Rope:i(1163),Sprite:i(1164),StaticBitmapText:i(1165),Text:i(1166),TileSprite:i(1167),Zone:i(1168),Video:i(1169)}};n.Shader=i(226),n.Mesh=i(227),n.PointLight=i(149),n.Factories.Shader=i(1178),n.Factories.Mesh=i(1179),n.Factories.PointLight=i(1180),n.Creators.Shader=i(1181),n.Creators.Mesh=i(1182),n.Creators.PointLight=i(1183),n.Light=i(475),n.LightsManager=i(476),n.LightsPlugin=i(1184),t.exports=n},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(107),s=i(24),o=i(75),a=i(21),h=i(79),l=new n({Extends:r,initialize:function(t){r.call(this,t),this.sortChildrenFlag=!1,this.scene=t,this.systems=t.sys,this.events=t.sys.events,this.addCallback=this.addChildCallback,this.removeCallback=this.removeChildCallback,this.events.once(a.BOOT,this.boot,this),this.events.on(a.START,this.start,this)},boot:function(){this.events.once(a.DESTROY,this.destroy,this)},addChildCallback:function(t){t.emit(o.ADDED_TO_SCENE,t,this.scene),t.displayList&&t.displayList.remove(t),t.displayList=this,this.queueDepthSort(),this.events.emit(a.ADDED_TO_SCENE,t,this.scene)},removeChildCallback:function(t){t.emit(o.REMOVED_FROM_SCENE,t,this.scene),t.displayList=null,this.queueDepthSort(),this.events.emit(a.REMOVED_FROM_SCENE,t,this.scene)},start:function(){this.events.once(a.SHUTDOWN,this.shutdown,this)},queueDepthSort:function(){this.sortChildrenFlag=!0},depthSort:function(){this.sortChildrenFlag&&(h(this.list,this.sortByDepth),this.sortChildrenFlag=!1)},sortByDepth:function(t,e){return t._depth-e._depth},getChildren:function(){return this.list},shutdown:function(){for(var t=this.list,e=t.length;e--;)t[e].destroy(!0);t.length=0,this.events.off(a.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.events.off(a.START,this.start,this),this.scene=null,this.systems=null,this.events=null}});s.register("DisplayList",l,"displayList"),t.exports=l},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={CheckMatrix:i(206),MatrixToString:i(1010),ReverseColumns:i(1011),ReverseRows:i(1012),Rotate180:i(1013),RotateLeft:i(1014),RotateMatrix:i(146),RotateRight:i(1015),Translate:i(1016),TransposeMatrix:i(429)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(183),r=i(206);t.exports=function(t){var e="";if(!r(t))return e;for(var i=0;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(146);t.exports=function(t){return n(t,180)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(146);t.exports=function(t){return n(t,90)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(146);t.exports=function(t){return n(t,-90)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(175),r=i(176);t.exports=function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),0!==i&&(i<0?n(t,Math.abs(i)):r(t,i)),0!==e)for(var s=0;s0){var s=i-t.length;if(s<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.push(e),n&&n.call(r,e),e):null;for(var o=e.length-1;o>=0;)-1!==t.indexOf(e[o])&&e.splice(o,1),o--;if(0===(o=e.length))return null;i>0&&o>s&&(e.splice(s),o=s);for(var a=0;a0){var o=n-t.length;if(o<=0)return null}if(!Array.isArray(e))return-1===t.indexOf(e)?(t.splice(i,0,e),r&&r.call(s,e),e):null;for(var a=e.length-1;a>=0;)-1!==t.indexOf(e[a])&&e.pop(),a--;if(0===(a=e.length))return null;n>0&&a>o&&(e.splice(o),a=o);for(var h=a-1;h>=0;h--){var l=e[h];t.splice(i,0,l),r&&r.call(s,l)}return e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(78);t.exports=function(t,e,i,r,s){void 0===r&&(r=0),void 0===s&&(s=t.length);var o=0;if(n(t,r,s))for(var a=r;a * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(78);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s)){var o,a=[null];for(o=5;o0){var n=t[i-1],r=t.indexOf(n);t[i]=n,t[r]=e}return t}},function(t,e){t.exports=function(t,e,i){var n=t.indexOf(e);if(-1===n||i<0||i>=t.length)throw new Error("Supplied index out of bounds");return n!==i&&(t.splice(n,1),t.splice(i,0,e)),e}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(-1!==i&&i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(357);t.exports=function(t,e,i){void 0===t&&(t=0),void 0===e&&(e=null),void 0===i&&(i=1),null===e&&(e=t,t=0);for(var r=[],s=Math.max(n((e-t)/(i||1)),0),o=0;o * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(74);t.exports=function(t,e,i,r){if(void 0===r&&(r=t),e<0||e>t.length-1)throw new Error("Index out of bounds");var s=n(t,e);return i&&i.call(r,s),s}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(78);t.exports=function(t,e,i,r,s){if(void 0===e&&(e=0),void 0===i&&(i=t.length),void 0===s&&(s=t),n(t,e,i)){var o=i-e,a=t.splice(e,o);if(r)for(var h=0;h * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(74);t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var r=e+Math.floor(Math.random()*i);return n(t,r)}},function(t,e){t.exports=function(t,e,i){var n=t.indexOf(e),r=t.indexOf(i);return-1!==n&&-1===r&&(t[n]=i,!0)}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);return-1!==i&&i>0&&(t.splice(i,1),t.unshift(e)),e}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(78);t.exports=function(t,e,i,r,s){if(void 0===r&&(r=0),void 0===s&&(s=t.length),n(t,r,s))for(var o=r;o * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(208),s=i(24),o=i(21),a=new n({Extends:r,initialize:function(t){r.call(this),this.checkQueue=!0,this.scene=t,this.systems=t.sys,t.sys.events.once(o.BOOT,this.boot,this),t.sys.events.on(o.START,this.start,this)},boot:function(){this.systems.events.once(o.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(o.PRE_UPDATE,this.update,this),t.on(o.UPDATE,this.sceneUpdate,this),t.once(o.SHUTDOWN,this.shutdown,this)},sceneUpdate:function(t,e){for(var i=this._active,n=i.length,r=0;r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="add"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="remove"},function(t,e){t.exports=function(t,e,i,n){if(void 0===i&&(i=!1),void 0===n)return n={local:{x:0,y:0,width:0,height:0},global:{x:0,y:0,width:0,height:0},lines:{shortest:0,longest:0,lengths:null,height:0},wrappedText:"",words:[],characters:[],scaleX:0,scaleY:0};var r,s,o,a,h=t.text,l=h.length,c=t.maxWidth,u=t.wordWrapCharCode,d=Number.MAX_VALUE,p=Number.MAX_VALUE,f=0,m=0,g=t.fontData.chars,v=t.fontData.lineHeight,y=t.letterSpacing,x=0,b=0,w=0,T=null,_=t._align,E=0,S=0,M=t.fontSize/t.fontData.size,A=M*t.scaleX,C=M*t.scaleY,P=null,R=0,L=[],O=Number.MAX_VALUE,D=0,I=0,F=0,B=[],k=[],N=null;if(c>0){for(r=0;rc||X-G>c?(V.push(H.i-1),H.cr?(V.push(H.i+H.word.length),G=0,z=null):z=H):H.cr&&(V.push(H.i+H.word.length),G=0,z=null)}for(r=V.length-1;r>=0;r--)s=h,o=V[r],a="\n",h=s.substr(0,o)+a+s.substr(o+1);n.wrappedText=h,l=h.length,B=[],N=null}var j=0;for(r=0;rE&&(d=E),p>S&&(p=S);var q=E+T.xAdvance,Z=S+v;fD&&(D=F),FD&&(D=F),F0)for(var J=0;J * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(209);t.exports=function(t,e,i,r,s,o,a){var h=t.sys.textures.get(i),l=h.get(r),c=t.sys.cache.xml.get(s);if(l&&c){var u=n(c,l,o,a,h);return t.sys.cache.bitmapFont.add(e,{data:u,texture:i,frame:r}),!0}return!1}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1040),r=i(1042),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1041),r=i(19),s=i(12);t.exports=function(t,e,i,o){if(0!==e._text.length){i.addToRenderList(e);var a,h,l,c=t.pipelines.set(e.pipeline,e),u=r(e,i,o).calc,d=i.roundPixels,p=i.alpha,f=e.charColors,m=e.tintFill,g=s.getTintAppendFloatAlpha,v=g(e.tintTopLeft,p*e._alphaTL),y=g(e.tintTopRight,p*e._alphaTR),x=g(e.tintBottomLeft,p*e._alphaBL),b=g(e.tintBottomRight,p*e._alphaBR),w=e.frame.glTexture,T=c.setGameObject(e),_=e.getTextBounds(!1).characters,E=e.dropShadowX,S=e.dropShadowY,M=0!==E||0!==S;if(t.pipelines.preBatch(e),M){var A=e.dropShadowColor,C=e.dropShadowAlpha,P=g(A,p*C*e._alphaTL),R=g(A,p*C*e._alphaTR),L=g(A,p*C*e._alphaBL),O=g(A,p*C*e._alphaBR);for(a=0;a<_.length;a++)l=(h=_[a]).glyph,32!==h.code&&0!==l.width&&0!==l.height&&n(c,e,h,l,E,S,u,d,P,R,L,O,1,w,T)}for(a=0;a<_.length;a++)if(l=(h=_[a]).glyph,32!==h.code&&0!==l.width&&0!==l.height)if(f[h.i]){var D=f[h.i],I=D.tintEffect,F=g(D.tintTL,p*e._alphaTL),B=g(D.tintTR,p*e._alphaTR),k=g(D.tintBL,p*e._alphaBL),N=g(D.tintBR,p*e._alphaBR);n(c,e,h,l,0,0,u,d,F,B,k,N,I,w,T)}else n(c,e,h,l,0,0,u,d,v,y,x,b,m,w,T);t.pipelines.postBatch(e)}}},function(t,e){t.exports=function(t,e,i,n,r,s,o,a,h,l,c,u,d,p,f){var m=i.x-e.displayOriginX+r,g=i.y-e.displayOriginY+s,v=m+i.w,y=g+i.h,x=o.getXRound(m,g,a),b=o.getYRound(m,g,a),w=o.getXRound(m,y,a),T=o.getYRound(m,y,a),_=o.getXRound(v,y,a),E=o.getYRound(v,y,a),S=o.getXRound(v,g,a),M=o.getYRound(v,g,a);t.batchQuad(e,x,b,w,T,_,E,S,M,n.u0,n.v0,n.u1,n.v1,h,l,c,u,d,p,f)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(30);t.exports=function(t,e,i,r){var s=e._text,o=s.length,a=t.currentContext;if(0!==o&&n(t,a,e,i,r)){i.addToRenderList(e);var h=e.texture.frames.__BASE,l=e.fontData.chars,c=e.fontData.lineHeight,u=e._letterSpacing,d=0,p=0,f=0,m=null,g=0,v=0,y=0,x=0,b=0,w=0,T=null,_=0,E=h.source.image,S=h.cutX,M=h.cutY,A=e._fontSize/e.fontData.size,C=e._align,P=0,R=0,L=e.getTextBounds(!1);e.maxWidth>0&&(o=(s=L.wrappedText).length);var O=e._bounds.lines;1===C?R=(O.longest-O.lengths[0])/2:2===C&&(R=O.longest-O.lengths[0]),a.translate(-e.displayOriginX,-e.displayOriginY);for(var D=i.roundPixels,I=0;I * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1044),r=i(1045),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(25),r=i(12),s=new n;t.exports=function(t,e,i,n){var o=e.getRenderList();if(0===o.length)return e.clearRenderDepth(i);e.setRenderDepth(i);var a=t.pipelines.set(this.pipeline,e),h=i.scrollX*e.scrollFactorX,l=i.scrollY*e.scrollFactorY,c=s.copyFrom(i.matrix);n&&(c.multiplyWithOffset(n,-h,-l),h=0,l=0);var u=e.x-h,d=e.y-l,p=-1,f=i.alpha*e.alpha,m=i.roundPixels;t.pipelines.preBatch(e);for(var g=0;g * @author Felipe Alfonso <@bitnenfer> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1047),r=i(1048),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e){t.exports=function(t,e,i,n){var r=e.list,s=r.length;if(0!==s){var o=e.localTransform;n?(o.loadIdentity(),o.multiply(n),o.translate(e.x,e.y),o.rotate(e.rotation),o.scale(e.scaleX,e.scaleY)):o.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),t.pipelines.preBatch(e);var a=-1!==e.blendMode;a||t.setBlendMode(0);for(var h=e.alpha,l=e.scrollFactorX,c=e.scrollFactorY,u=0;u * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(437),r=i(437),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports=["normal","multiply","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1052),r=i(1053),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(19),r=i(25),s=i(12),o=new r;t.exports=function(t,e,i,r){var a=e.text,h=a.length;if(0!==h){i.addToRenderList(e);var l=t.pipelines.set(e.pipeline,e),c=n(e,i,r),u=c.sprite,d=c.calc,p=o,f=e.cropWidth>0||e.cropHeight>0;f&&(l.flush(),t.pushScissor(d.tx,d.ty,e.cropWidth*d.scaleX,e.cropHeight*d.scaleY));var m,g,v=e.frame.glTexture,y=e.tintFill,x=s.getTintAppendFloatAlpha(e.tintTopLeft,i.alpha*e._alphaTL),b=s.getTintAppendFloatAlpha(e.tintTopRight,i.alpha*e._alphaTR),w=s.getTintAppendFloatAlpha(e.tintBottomLeft,i.alpha*e._alphaBL),T=s.getTintAppendFloatAlpha(e.tintBottomRight,i.alpha*e._alphaBR),_=l.setGameObject(e),E=0,S=0,M=0,A=0,C=e.letterSpacing,P=0,R=0,L=e.scrollX,O=e.scrollY,D=e.fontData,I=D.chars,F=D.lineHeight,B=e.fontSize/D.size,k=0,N=e._align,U=0,z=0,G=e.getTextBounds(!1);e.maxWidth>0&&(h=(a=G.wrappedText).length);var V=e._bounds.lines;1===N?z=(V.longest-V.lengths[0])/2:2===N&&(z=V.longest-V.lengths[0]);var H=i.roundPixels,W=e.displayCallback,X=e.callbackData;t.pipelines.preBatch(e);for(var j=0;j * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(30);t.exports=function(t,e,i,r){var s=e._text,o=s.length,a=t.currentContext;if(0!==o&&n(t,a,e,i,r)){i.addToRenderList(e);var h=e.frame,l=e.displayCallback,c=e.callbackData,u=e.fontData.chars,d=e.fontData.lineHeight,p=e._letterSpacing,f=0,m=0,g=0,v=null,y=0,x=0,b=0,w=0,T=0,_=0,E=null,S=0,M=e.frame.source.image,A=h.cutX,C=h.cutY,P=0,R=0,L=e._fontSize/e.fontData.size,O=e._align,D=0,I=0;e.getTextBounds(!1);var F=e._bounds.lines;1===O?I=(F.longest-F.lengths[0])/2:2===O&&(I=F.longest-F.lengths[0]),a.translate(-e.displayOriginX,-e.displayOriginY);var B=i.roundPixels;e.cropWidth>0&&e.cropHeight>0&&(a.beginPath(),a.rect(0,0,e.cropWidth,e.cropHeight),a.clip());for(var k=0;k * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1055),r=i(1056),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(19);t.exports=function(t,e,i,r){t.pipelines.clear();var s=n(e,i,r).calc;e.render.call(e,t,i,s),t.pipelines.rebind()}},function(t,e){},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1058),r=i(442),r=i(442),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(214),r=i(19),s=i(25),o=i(12),a=function(t,e,i){this.x=t,this.y=e,this.width=i},h=function(t,e,i){this.points=[],this.pointsLength=1,this.points[0]=new a(t,e,i)},l=[],c=new s;t.exports=function(t,e,i,s){if(0!==e.commandBuffer.length){i.addToRenderList(e);var u=t.pipelines.set(e.pipeline,e);t.pipelines.preBatch(e);for(var d=r(e,i,s).calc,p=c.loadIdentity(),f=e.commandBuffer,m=i.alpha*e.alpha,g=1,v=u.fillTint,y=u.strokeTint,x=0,b=0,w=0,T=2*Math.PI,_=[],E=0,S=!0,M=null,A=o.getTintAppendFloatAlpha,C=0;C0&&(G=G%T-T):G>T?G=T:G<0&&(G=T+G%T),null===M&&(M=new h(k+Math.cos(z)*U,N+Math.sin(z)*U,g),_.push(M),B+=.01);B<1+H;)w=G*B+z,x=k+Math.cos(w)*U,b=N+Math.sin(w)*U,M.points.push(new a(x,b,g)),B+=.01;w=G+z,x=k+Math.cos(w)*U,b=N+Math.sin(w)*U,M.points.push(new a(x,b,g));break;case n.FILL_RECT:u.batchFillRect(f[++C],f[++C],f[++C],f[++C],p,d);break;case n.FILL_TRIANGLE:u.batchFillTriangle(f[++C],f[++C],f[++C],f[++C],f[++C],f[++C],p,d);break;case n.STROKE_TRIANGLE:u.batchStrokeTriangle(f[++C],f[++C],f[++C],f[++C],f[++C],f[++C],g,p,d);break;case n.LINE_TO:null!==M?M.points.push(new a(f[++C],f[++C],g)):(M=new h(f[++C],f[++C],g),_.push(M));break;case n.MOVE_TO:M=new h(f[++C],f[++C],g),_.push(M);break;case n.SAVE:l.push(p.copyToArray());break;case n.RESTORE:p.copyFromArray(l.pop());break;case n.TRANSLATE:k=f[++C],N=f[++C],p.translate(k,N);break;case n.SCALE:k=f[++C],N=f[++C],p.scale(k,N);break;case n.ROTATE:p.rotate(f[++C])}t.pipelines.postBatch(e)}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1060),r=i(1061),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e){t.exports=function(t,e,i,n){i.addToRenderList(e),e.pipeline.batchSprite(e,i,n)}},function(t,e){t.exports=function(t,e,i,n){i.addToRenderList(e),t.batchSprite(e,e.frame,i,n)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1063),r=i(1064),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e){t.exports=function(t,e,i,n){i.addToRenderList(e),this.pipeline.batchSprite(e,i,n)}},function(t,e){t.exports=function(t,e,i,n){i.addToRenderList(e),t.batchSprite(e,e.frame,i,n)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1066),r=i(1067),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e){t.exports=function(t,e,i){var n=e.list,r=n.length;if(0!==r){e.depthSort(),t.pipelines.preBatch(e);var s=-1!==e.blendMode;s||t.setBlendMode(0);for(var o=e.alpha,a=0;a * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={EmitterOp:i(443),GravityWell:i(444),Particle:i(445),ParticleEmitter:i(446),ParticleEmitterManager:i(217),Zones:i(1072)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1070),r=i(1071),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(25),r=i(12),s=new n,o=new n,a=new n,h=new n;t.exports=function(t,e,i,n){var l=e.emitters.list,c=l.length;if(0!==c){var u=t.pipelines.set(e.pipeline),d=s,p=o,f=a,m=h;n?(m.loadIdentity(),m.multiply(n),m.translate(e.x,e.y),m.rotate(e.rotation),m.scale(e.scaleX,e.scaleY)):m.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var g=i.roundPixels,v=e.defaultFrame.glTexture,y=r.getTintAppendFloatAlpha,x=u.setGameObject(e,e.defaultFrame);t.pipelines.preBatch(e);for(var b=0;b * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(25),r=new n,s=new n,o=new n,a=new n;t.exports=function(t,e,i,n){var h=e.emitters.list,l=h.length;if(0!==l){var c=r.copyFrom(i.matrix),u=s,d=o,p=a;n?(p.loadIdentity(),p.multiply(n),p.translate(e.x,e.y),p.rotate(e.rotation),p.scale(e.scaleX,e.scaleY)):p.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);for(var f=t.currentContext,m=i.roundPixels,g=0;g * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={DeathZone:i(447),EdgeZone:i(448),RandomZone:i(450)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1074),r=i(1075),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(12);t.exports=function(t,e,i,r){i.addToRenderList(e);var s=i.alpha,o=e.renderTarget,a=o.width,h=o.height,l=n.getTintAppendFloatAlpha,c=t.pipelines.set(e.pipeline),u=c.setTexture2D(o.texture);t.pipelines.preBatch(e),c.batchTexture(e,o.texture,a,h,e.x,e.y,a,h,e.scaleX,e.scaleY,e.rotation,e.flipX,!e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,a,h,l(e.tintTopLeft,s*e._alphaTL),l(e.tintTopRight,s*e._alphaTR),l(e.tintBottomLeft,s*e._alphaBL),l(e.tintBottomRight,s*e._alphaBR),e.tintFill,0,0,i,r,!0,u),t.resetTextures(),t.pipelines.postBatch(e)}},function(t,e){t.exports=function(t,e,i,n){i.addToRenderList(e),t.batchSprite(e,e.frame,i,n)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1077),r=i(17),s={Parse:i(1078)};s=r(!1,s,n),t.exports=s},function(t,e){t.exports={TEXT_SET1:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",TEXT_SET2:" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET3:"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ",TEXT_SET4:"ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789",TEXT_SET5:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,/() '!?-*:0123456789",TEXT_SET6:"ABCDEFGHIJKLMNOPQRSTUVWXYZ!?:;0123456789\"(),-.' ",TEXT_SET7:"AGMSY+:4BHNTZ!;5CIOU.?06DJPV,(17EKQW\")28FLRX-'39",TEXT_SET8:"0123456789 .ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET9:"ABCDEFGHIJKLMNOPQRSTUVWXYZ()-0123456789.:,'\"?!",TEXT_SET10:"ABCDEFGHIJKLMNOPQRSTUVWXYZ",TEXT_SET11:"ABCDEFGHIJKLMNOPQRSTUVWXYZ.,\"-+!?()':;0123456789"}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(6);t.exports=function(t,e){var i=e.width,r=e.height,s=Math.floor(i/2),o=Math.floor(r/2),a=n(e,"chars","");if(""!==a){var h=n(e,"image",""),l=t.sys.textures.getFrame(h),c=l.cutX,u=l.cutY,d=l.source.width,p=l.source.height,f=n(e,"offset.x",0),m=n(e,"offset.y",0),g=n(e,"spacing.x",0),v=n(e,"spacing.y",0),y=n(e,"lineSpacing",0),x=n(e,"charsPerRow",null);null===x&&(x=d/i)>a.length&&(x=a.length);for(var b=f,w=m,T={retroFont:!0,font:h,size:i,lineHeight:r+y,chars:{}},_=0,E=0;E * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1080),r=i(1081),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(19),r=i(12);t.exports=function(t,e,i,s){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline,e),a=n(e,i,s).calc,h=e.vertices,l=e.uv,c=e.colors,u=e.alphas,d=e.alpha,p=r.getTintAppendFloatAlpha,f=i.roundPixels,m=h.length,g=Math.floor(.5*m);o.flush(),t.pipelines.preBatch(e);var v=o.setGameObject(e),y=o.vertexViewF32,x=o.vertexViewU32,b=o.vertexCount*o.currentShader.vertexComponentCount-1,w=0,T=e.tintFill;e.dirty&&e.updateVertices();for(var _=e.debugCallback,E=[],S=0;S * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1083),r=i(1084),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(12);t.exports=function(t,e,i,r){if(0!==e.width&&0!==e.height){i.addToRenderList(e);var s=e.frame,o=s.width,a=s.height,h=n.getTintAppendFloatAlpha,l=t.pipelines.set(e.pipeline,e),c=l.setTexture2D(s.glTexture,e);t.pipelines.preBatch(e),l.batchTexture(e,s.glTexture,o,a,e.x,e.y,o/e.style.resolution,a/e.style.resolution,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.displayOriginX,e.displayOriginY,0,0,o,a,h(e.tintTopLeft,i.alpha*e._alphaTL),h(e.tintTopRight,i.alpha*e._alphaTR),h(e.tintBottomLeft,i.alpha*e._alphaBL),h(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,0,0,i,r,!1,c),t.pipelines.postBatch(e)}}},function(t,e){t.exports=function(t,e,i,n){0!==e.width&&0!==e.height&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,n))}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1086),r=i(1087),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(12);t.exports=function(t,e,i,r){e.updateCanvas();var s=e.width,o=e.height;if(0!==s&&0!==o){i.addToRenderList(e),t.pipelines.preBatch(e);var a=n.getTintAppendFloatAlpha,h=t.pipelines.set(e.pipeline,e),l=h.setTexture2D(e.fillPattern,e);h.batchTexture(e,e.fillPattern,e.displayFrame.width*e.tileScaleX,e.displayFrame.height*e.tileScaleY,e.x,e.y,s,o,e.scaleX,e.scaleY,e.rotation,e.flipX,e.flipY,e.scrollFactorX,e.scrollFactorY,e.originX*s,e.originY*o,0,0,s,o,a(e.tintTopLeft,i.alpha*e._alphaTL),a(e.tintTopRight,i.alpha*e._alphaTR),a(e.tintBottomLeft,i.alpha*e._alphaBL),a(e.tintBottomRight,i.alpha*e._alphaBR),e.tintFill,e.tilePositionX%e.displayFrame.width/e.displayFrame.width,e.tilePositionY%e.displayFrame.height/e.displayFrame.height,i,r,!1,l),t.pipelines.postBatch(e)}}},function(t,e){t.exports=function(t,e,i,n){e.updateCanvas(),i.addToRenderList(e),t.batchSprite(e,e.frame,i,n)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1089),r=i(1090),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e){t.exports=function(t,e,i,n){e.videoTexture&&(i.addToRenderList(e),e.pipeline.batchSprite(e,i,n))}},function(t,e){t.exports=function(t,e,i,n){e.videoTexture&&(i.addToRenderList(e),t.batchSprite(e,e.frame,i,n))}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1092),r=i(1093),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(19),r=i(111),s=i(81);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o),l=a.calcMatrix.copyFrom(h.calc),c=e._displayOriginX,u=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&r(a,l,e,d,c,u),e.isStroked&&s(a,e,d,c,u),t.pipelines.postBatch(e)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(35),r=i(46),s=i(58),o=i(30);t.exports=function(t,e,i,a){i.addToRenderList(e);var h=t.currentContext;if(o(t,h,e,i,a)){var l=e.radius;h.beginPath(),h.arc(l-e.originX*(2*l),l-e.originY*(2*l),l,n(e._startAngle),n(e._endAngle),e.anticlockwise),e.closePath&&h.closePath(),e.isFilled&&(r(h,e),h.fill()),e.isStroked&&(s(h,e),h.stroke()),h.restore()}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1095),r=i(1096),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(111),r=i(19),s=i(81);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=r(e,i,o),l=a.calcMatrix.copyFrom(h.calc),c=e._displayOriginX+e._curveBounds.x,u=e._displayOriginY+e._curveBounds.y,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&n(a,l,e,d,c,u),e.isStroked&&s(a,e,d,c,u),t.pipelines.postBatch(e)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(46),r=i(58),s=i(30);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,o)){var h=e._displayOriginX+e._curveBounds.x,l=e._displayOriginY+e._curveBounds.y,c=e.pathData,u=c.length-1,d=c[0]-h,p=c[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(u-=2);for(var f=2;f * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1098),r=i(1099),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(111),r=i(19),s=i(81);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=r(e,i,o),l=a.calcMatrix.copyFrom(h.calc),c=e._displayOriginX,u=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&n(a,l,e,d,c,u),e.isStroked&&s(a,e,d,c,u),t.pipelines.postBatch(e)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(46),r=i(58),s=i(30);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,c=e.pathData,u=c.length-1,d=c[0]-h,p=c[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(u-=2);for(var f=2;f * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1101),r=i(1102),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(19),r=i(12);t.exports=function(t,e,i,s){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=n(e,i,s);o.calcMatrix.copyFrom(a.calc).translate(-e._displayOriginX,-e._displayOriginY);var h,l,c=i.alpha*e.alpha,u=e.width,d=e.height,p=e.cellWidth,f=e.cellHeight,m=Math.ceil(u/p),g=Math.ceil(d/f),v=p,y=f,x=p-(m*p-u),b=f-(g*f-d),w=e.showCells,T=e.showAltCells,_=e.showOutline,E=0,S=0,M=0,A=0,C=0;if(_&&(v--,y--,x===p&&x--,b===f&&b--),t.pipelines.preBatch(e),w&&e.fillAlpha>0)for(h=o.fillTint,l=r.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c),h.TL=l,h.TR=l,h.BL=l,h.BR=l,S=0;S0)for(h=o.fillTint,l=r.getTintAppendFloatAlpha(e.altFillColor,e.altFillAlpha*c),h.TL=l,h.TR=l,h.BL=l,h.BR=l,S=0;S0){var P=o.strokeTint,R=r.getTintAppendFloatAlpha(e.outlineFillColor,e.outlineFillAlpha*c);for(P.TL=R,P.TR=R,P.BL=R,P.BR=R,E=1;E * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(46),r=i(58),s=i(30);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,o)){var h=-e._displayOriginX,l=-e._displayOriginY,c=i.alpha*e.alpha,u=e.width,d=e.height,p=e.cellWidth,f=e.cellHeight,m=Math.ceil(u/p),g=Math.ceil(d/f),v=p,y=f,x=p-(m*p-u),b=f-(g*f-d),w=e.showCells,T=e.showAltCells,_=e.showOutline,E=0,S=0,M=0,A=0,C=0;if(_&&(v--,y--,x===p&&x--,b===f&&b--),w&&e.fillAlpha>0)for(n(a,e),S=0;S0)for(n(a,e,e.altFillColor,e.altFillAlpha*c),S=0;S0){for(r(a,e,e.outlineFillColor,e.outlineFillAlpha*c),E=1;E * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1104),r=i(1105),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(19),r=i(12);t.exports=function(t,e,i,s){i.addToRenderList(e);var o,a,h,l,c,u,d,p,f,m=t.pipelines.set(e.pipeline),g=n(e,i,s),v=m.calcMatrix.copyFrom(g.calc),y=e.width,x=e.height,b=y/2,w=y/e.projection,T=i.alpha*e.alpha;e.isFilled&&(t.pipelines.preBatch(e),e.showTop&&(o=r.getTintAppendFloatAlpha(e.fillTop,T),a=v.getX(-b,-x),h=v.getY(-b,-x),l=v.getX(0,-w-x),c=v.getY(0,-w-x),u=v.getX(b,-x),d=v.getY(b,-x),p=v.getX(0,w-x),f=v.getY(0,w-x),m.batchQuad(a,h,l,c,u,d,p,f,o,o,o,o)),e.showLeft&&(o=r.getTintAppendFloatAlpha(e.fillLeft,T),a=v.getX(-b,0),h=v.getY(-b,0),l=v.getX(0,w),c=v.getY(0,w),u=v.getX(0,w-x),d=v.getY(0,w-x),p=v.getX(-b,-x),f=v.getY(-b,-x),m.batchQuad(a,h,l,c,u,d,p,f,o,o,o,o)),e.showRight&&(o=r.getTintAppendFloatAlpha(e.fillRight,T),a=v.getX(b,0),h=v.getY(b,0),l=v.getX(0,w),c=v.getY(0,w),u=v.getX(0,w-x),d=v.getY(0,w-x),p=v.getX(b,-x),f=v.getY(b,-x),m.batchQuad(a,h,l,c,u,d,p,f,o,o,o,o)),t.pipelines.postBatch(e))}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(46),r=i(30);t.exports=function(t,e,i,s){i.addToRenderList(e);var o=t.currentContext;if(r(t,o,e,i,s)&&e.isFilled){var a=e.width,h=e.height,l=a/2,c=a/e.projection;e.showTop&&(n(o,e,e.fillTop),o.beginPath(),o.moveTo(-l,-h),o.lineTo(0,-c-h),o.lineTo(l,-h),o.lineTo(l,-1),o.lineTo(0,c-1),o.lineTo(-l,-1),o.lineTo(-l,-h),o.fill()),e.showLeft&&(n(o,e,e.fillLeft),o.beginPath(),o.moveTo(-l,0),o.lineTo(0,c),o.lineTo(0,c-h),o.lineTo(-l,-h),o.lineTo(-l,0),o.fill()),e.showRight&&(n(o,e,e.fillRight),o.beginPath(),o.moveTo(l,0),o.lineTo(0,c),o.lineTo(0,c-h),o.lineTo(l,-h),o.lineTo(l,0),o.fill()),o.restore()}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1107),r=i(1108),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(19),r=i(12);t.exports=function(t,e,i,s){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=n(e,i,s),h=o.calcMatrix.copyFrom(a.calc),l=e.width,c=e.height,u=l/2,d=l/e.projection,p=e.isReversed,f=i.alpha*e.alpha;if(e.isFilled){var m,g,v,y,x,b,w;if(t.pipelines.preBatch(e),e.showTop&&p){m=r.getTintAppendFloatAlpha(e.fillTop,f),g=h.getX(-u,-c),v=h.getY(-u,-c),y=h.getX(0,-d-c),x=h.getY(0,-d-c),b=h.getX(u,-c),w=h.getY(u,-c);var T=h.getX(0,d-c),_=h.getY(0,d-c);o.batchQuad(g,v,y,x,b,w,T,_,m,m,m,m)}e.showLeft&&(m=r.getTintAppendFloatAlpha(e.fillLeft,f),p?(g=h.getX(-u,-c),v=h.getY(-u,-c),y=h.getX(0,d),x=h.getY(0,d),b=h.getX(0,d-c),w=h.getY(0,d-c)):(g=h.getX(-u,0),v=h.getY(-u,0),y=h.getX(0,d),x=h.getY(0,d),b=h.getX(0,d-c),w=h.getY(0,d-c)),o.batchTri(g,v,y,x,b,w,m,m,m)),e.showRight&&(m=r.getTintAppendFloatAlpha(e.fillRight,f),p?(g=h.getX(u,-c),v=h.getY(u,-c),y=h.getX(0,d),x=h.getY(0,d),b=h.getX(0,d-c),w=h.getY(0,d-c)):(g=h.getX(u,0),v=h.getY(u,0),y=h.getX(0,d),x=h.getY(0,d),b=h.getX(0,d-c),w=h.getY(0,d-c)),o.batchTri(g,v,y,x,b,w,m,m,m)),t.pipelines.postBatch(e)}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(46),r=i(30);t.exports=function(t,e,i,s){i.addToRenderList(e);var o=t.currentContext;if(r(t,o,e,i,s)&&e.isFilled){var a=e.width,h=e.height,l=a/2,c=a/e.projection,u=e.isReversed;e.showTop&&u&&(n(o,e,e.fillTop),o.beginPath(),o.moveTo(-l,-h),o.lineTo(0,-c-h),o.lineTo(l,-h),o.lineTo(0,c-h),o.fill()),e.showLeft&&(n(o,e,e.fillLeft),o.beginPath(),u?(o.moveTo(-l,-h),o.lineTo(0,c),o.lineTo(0,c-h)):(o.moveTo(-l,0),o.lineTo(0,c),o.lineTo(0,c-h)),o.fill()),e.showRight&&(n(o,e,e.fillRight),o.beginPath(),u?(o.moveTo(l,-h),o.lineTo(0,c),o.lineTo(0,c-h)):(o.moveTo(l,0),o.lineTo(0,c),o.lineTo(0,c-h)),o.fill()),o.restore()}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1110),r=i(1111),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(19),r=i(12);t.exports=function(t,e,i,s){i.addToRenderList(e);var o=t.pipelines.set(e.pipeline),a=n(e,i,s);o.calcMatrix.copyFrom(a.calc);var h=e._displayOriginX,l=e._displayOriginY,c=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isStroked){var u=o.strokeTint,d=r.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*c);u.TL=d,u.TR=d,u.BL=d,u.BR=d;var p=e._startWidth,f=e._endWidth;o.batchLine(e.geom.x1-h,e.geom.y1-l,e.geom.x2-h,e.geom.y2-l,p,f,1,0,!1,a.sprite,a.camera)}t.pipelines.postBatch(e)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(58),r=i(30);t.exports=function(t,e,i,s){i.addToRenderList(e);var o=t.currentContext;if(r(t,o,e,i,s)){var a=e._displayOriginX,h=e._displayOriginY;e.isStroked&&(n(o,e),o.beginPath(),o.moveTo(e.geom.x1-a,e.geom.y1-h),o.lineTo(e.geom.x2-a,e.geom.y2-h),o.stroke()),o.restore()}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1113),r=i(1114),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(111),r=i(19),s=i(81);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=r(e,i,o),l=a.calcMatrix.copyFrom(h.calc),c=e._displayOriginX,u=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&n(a,l,e,d,c,u),e.isStroked&&s(a,e,d,c,u),t.pipelines.postBatch(e)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(46),r=i(58),s=i(30);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,c=e.pathData,u=c.length-1,d=c[0]-h,p=c[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(u-=2);for(var f=2;f * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1116),r=i(1117),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(19),r=i(81),s=i(12);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o);a.calcMatrix.copyFrom(h.calc);var l=e._displayOriginX,c=e._displayOriginY,u=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=a.fillTint,p=s.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*u);d.TL=p,d.TR=p,d.BL=p,d.BR=p,a.batchFillRect(-l,-c,e.width,e.height)}e.isStroked&&r(a,e,u,l,c),t.pipelines.postBatch(e)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(46),r=i(58),s=i(30);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY;e.isFilled&&(n(a,e),a.fillRect(-h,-l,e.width,e.height)),e.isStroked&&(r(a,e),a.beginPath(),a.rect(-h,-l,e.width,e.height),a.stroke()),a.restore()}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1119),r=i(1120),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(111),r=i(19),s=i(81);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=r(e,i,o),l=a.calcMatrix.copyFrom(h.calc),c=e._displayOriginX,u=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&n(a,l,e,d,c,u),e.isStroked&&s(a,e,d,c,u),t.pipelines.postBatch(e)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(46),r=i(58),s=i(30);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,c=e.pathData,u=c.length-1,d=c[0]-h,p=c[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(u-=2);for(var f=2;f * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1122),r=i(1123),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(19),r=i(81),s=i(12);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline),h=n(e,i,o);a.calcMatrix.copyFrom(h.calc);var l=e._displayOriginX,c=e._displayOriginY,u=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=a.fillTint,p=s.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*u);d.TL=p,d.TR=p,d.BL=p,d.BR=p;var f=e.geom.x1-l,m=e.geom.y1-c,g=e.geom.x2-l,v=e.geom.y2-c,y=e.geom.x3-l,x=e.geom.y3-c;a.batchFillTriangle(f,m,g,v,y,x,h.sprite,h.camera)}e.isStroked&&r(a,e,u,l,c),t.pipelines.postBatch(e)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(46),r=i(58),s=i(30);t.exports=function(t,e,i,o){i.addToRenderList(e);var a=t.currentContext;if(s(t,a,e,i,o)){var h=e._displayOriginX,l=e._displayOriginY,c=e.geom.x1-h,u=e.geom.y1-l,d=e.geom.x2-h,p=e.geom.y2-l,f=e.geom.x3-h,m=e.geom.y3-l;a.beginPath(),a.moveTo(c,u),a.lineTo(d,p),a.lineTo(f,m),a.closePath(),e.isFilled&&(n(a,e),a.fill()),e.isStroked&&(r(a,e),a.stroke()),a.restore()}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(210);i(5).register("blitter",(function(t,e,i,r){return this.displayList.add(new n(this.scene,t,e,i,r))}))},function(t,e,i){ /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(211);i(5).register("container",(function(t,e,i){return this.displayList.add(new n(this.scene,t,e,i))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(436);i(5).register("dom",(function(t,e,i,r,s){var o=new n(this.scene,t,e,i,r,s);return this.displayList.add(o),o}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(212);i(5).register("dynamicBitmapText",(function(t,e,i,r,s){return this.displayList.add(new n(this.scene,t,e,i,r,s))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(438);i(5).register("extern",(function(){var t=new n(this.scene);return this.displayList.add(t),t}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(213);i(5).register("graphics",(function(t){return this.displayList.add(new n(this.scene,t))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(110);i(5).register("group",(function(t,e){return this.updateList.add(new n(this.scene,t,e))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(124);i(5).register("image",(function(t,e,i,r){return this.displayList.add(new n(this.scene,t,e,i,r))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(216);i(5).register("layer",(function(t){return this.displayList.add(new n(this.scene,t))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(5),r=i(217);n.register("particles",(function(t,e,i){return this.displayList.add(new r(this.scene,t,e,i))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(5),r=i(451);n.register("follower",(function(t,e,i,n,s){var o=new r(this.scene,t,e,i,n,s);return this.displayList.add(o),this.updateList.add(o),o}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(5),r=i(218);n.register("renderTexture",(function(t,e,i,n,s,o){return this.displayList.add(new r(this.scene,t,e,i,n,s,o))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(220);i(5).register("rope",(function(t,e,i,r,s,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,r,s,o,a,h))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(5),r=i(73);n.register("sprite",(function(t,e,i,n){var s=new r(this.scene,t,e,i,n);return this.displayList.add(s),s}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(147);i(5).register("bitmapText",(function(t,e,i,r,s,o){return this.displayList.add(new n(this.scene,t,e,i,r,s,o))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(221);i(5).register("text",(function(t,e,i,r){return this.displayList.add(new n(this.scene,t,e,i,r))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(222);i(5).register("tileSprite",(function(t,e,i,r,s,o){return this.displayList.add(new n(this.scene,t,e,i,r,s,o))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(127);i(5).register("zone",(function(t,e,i,r){return this.displayList.add(new n(this.scene,t,e,i,r))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(223);i(5).register("video",(function(t,e,i){return this.displayList.add(new n(this.scene,t,e,i))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(455),r=i(5);r.register("arc",(function(t,e,i,r,s,o,a,h){return this.displayList.add(new n(this.scene,t,e,i,r,s,o,a,h))})),r.register("circle",(function(t,e,i,r,s){return this.displayList.add(new n(this.scene,t,e,i,0,360,!1,r,s))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(5),r=i(456);n.register("curve",(function(t,e,i,n,s){return this.displayList.add(new r(this.scene,t,e,i,n,s))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(457);i(5).register("ellipse",(function(t,e,i,r,s,o){return this.displayList.add(new n(this.scene,t,e,i,r,s,o))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(5),r=i(458);n.register("grid",(function(t,e,i,n,s,o,a,h,l,c){return this.displayList.add(new r(this.scene,t,e,i,n,s,o,a,h,l,c))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(5),r=i(459);n.register("isobox",(function(t,e,i,n,s,o,a){return this.displayList.add(new r(this.scene,t,e,i,n,s,o,a))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(5),r=i(460);n.register("isotriangle",(function(t,e,i,n,s,o,a,h){return this.displayList.add(new r(this.scene,t,e,i,n,s,o,a,h))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(5),r=i(461);n.register("line",(function(t,e,i,n,s,o,a,h){return this.displayList.add(new r(this.scene,t,e,i,n,s,o,a,h))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(5),r=i(462);n.register("polygon",(function(t,e,i,n,s){return this.displayList.add(new r(this.scene,t,e,i,n,s))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(5),r=i(467);n.register("rectangle",(function(t,e,i,n,s,o){return this.displayList.add(new r(this.scene,t,e,i,n,s,o))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(468);i(5).register("star",(function(t,e,i,r,s,o,a){return this.displayList.add(new n(this.scene,t,e,i,r,s,o,a))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(5),r=i(469);n.register("triangle",(function(t,e,i,n,s,o,a,h,l,c){return this.displayList.add(new r(this.scene,t,e,i,n,s,o,a,h,l,c))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(210),r=i(28),s=i(16),o=i(13);s.register("blitter",(function(t,e){void 0===t&&(t={});var i=o(t,"key",null),s=o(t,"frame",null),a=new n(this.scene,0,0,i,s);return void 0!==e&&(t.add=e),r(this.scene,a,t),a}))},function(t,e,i){ /** * @author Richard Davey * @author Felipe Alfonso <@bitnenfer> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(28),r=i(211),s=i(16),o=i(13);s.register("container",(function(t,e){void 0===t&&(t={});var i=o(t,"x",0),s=o(t,"y",0),a=o(t,"children",null),h=new r(this.scene,i,s,a);return void 0!==e&&(t.add=e),n(this.scene,h,t),h}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(212),r=i(28),s=i(16),o=i(13);s.register("dynamicBitmapText",(function(t,e){void 0===t&&(t={});var i=o(t,"font",""),s=o(t,"text",""),a=o(t,"size",!1),h=new n(this.scene,0,0,i,s,a);return void 0!==e&&(t.add=e),r(this.scene,h,t),h}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(16),r=i(213);n.register("graphics",(function(t,e){void 0===t&&(t={}),void 0!==e&&(t.add=e);var i=new r(this.scene,t);return t.add&&this.scene.sys.displayList.add(i),i}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(16),r=i(110);n.register("group",(function(t){return new r(this.scene,null,t)}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(28),r=i(16),s=i(13),o=i(124);r.register("image",(function(t,e){void 0===t&&(t={});var i=s(t,"key",null),r=s(t,"frame",null),a=new o(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),n(this.scene,a,t),a}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(28),r=i(216),s=i(16),o=i(13);s.register("layer",(function(t,e){void 0===t&&(t={});var i=o(t,"children",null),s=new r(this.scene,i);return void 0!==e&&(t.add=e),n(this.scene,s,t),s}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(16),r=i(13),s=i(2),o=i(217);n.register("particles",(function(t,e){void 0===t&&(t={});var i=r(t,"key",null),n=r(t,"frame",null),a=s(t,"emitters",null),h=new o(this.scene,i,n,a);return void 0!==e&&(t.add=e),s(t,"add",!1)?this.displayList.add(h):this.updateList.add(h),h}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(28),r=i(16),s=i(13),o=i(218);r.register("renderTexture",(function(t,e){void 0===t&&(t={});var i=s(t,"x",0),r=s(t,"y",0),a=s(t,"width",32),h=s(t,"height",32),l=s(t,"key",void 0),c=s(t,"frame",void 0),u=new o(this.scene,i,r,a,h,l,c);return void 0!==e&&(t.add=e),n(this.scene,u,t),u}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(28),r=i(16),s=i(13),o=i(6),a=i(220);r.register("rope",(function(t,e){void 0===t&&(t={});var i=s(t,"key",null),r=s(t,"frame",null),h=s(t,"horizontal",!0),l=o(t,"points",void 0),c=o(t,"colors",void 0),u=o(t,"alphas",void 0),d=new a(this.scene,0,0,i,r,l,h,c,u);return void 0!==e&&(t.add=e),n(this.scene,d,t),t.add||this.updateList.add(d),d}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(28),r=i(433),s=i(16),o=i(13),a=i(73);s.register("sprite",(function(t,e){void 0===t&&(t={});var i=o(t,"key",null),s=o(t,"frame",null),h=new a(this.scene,0,0,i,s);return void 0!==e&&(t.add=e),n(this.scene,h,t),r(h,t),h}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(147),r=i(28),s=i(16),o=i(13),a=i(6);s.register("bitmapText",(function(t,e){void 0===t&&(t={});var i=a(t,"font",""),s=o(t,"text",""),h=o(t,"size",!1),l=a(t,"align",0),c=new n(this.scene,0,0,i,s,h,l);return void 0!==e&&(t.add=e),r(this.scene,c,t),c}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(28),r=i(16),s=i(13),o=i(221);r.register("text",(function(t,e){void 0===t&&(t={});var i=s(t,"text",""),r=s(t,"style",null),a=s(t,"padding",null);null!==a&&(r.padding=a);var h=new o(this.scene,0,0,i,r);return void 0!==e&&(t.add=e),n(this.scene,h,t),h.autoRound=s(t,"autoRound",!0),h.resolution=s(t,"resolution",1),h}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(28),r=i(16),s=i(13),o=i(222);r.register("tileSprite",(function(t,e){void 0===t&&(t={});var i=s(t,"x",0),r=s(t,"y",0),a=s(t,"width",512),h=s(t,"height",512),l=s(t,"key",""),c=s(t,"frame",""),u=new o(this.scene,i,r,a,h,l,c);return void 0!==e&&(t.add=e),n(this.scene,u,t),u}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(16),r=i(13),s=i(127);n.register("zone",(function(t){var e=r(t,"x",0),i=r(t,"y",0),n=r(t,"width",1),o=r(t,"height",n);return new s(this.scene,e,i,n,o)}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(28),r=i(16),s=i(13),o=i(223);r.register("video",(function(t,e){void 0===t&&(t={});var i=s(t,"key",null),r=new o(this.scene,0,0,i);return void 0!==e&&(t.add=e),n(this.scene,r,t),t.add||this.updateList.add(r),r}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1171),r=i(1172),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(19);t.exports=function(t,e,i,r){if(e.shader){if(i.addToRenderList(e),t.pipelines.clear(),e.renderToTexture)e.load(),e.flush();else{var s=n(e,i,r).calc;t.width===e._rendererWidth&&t.height===e._rendererHeight||e.projOrtho(0,t.width,t.height,0),e.load(s.matrix),e.flush()}t.pipelines.rebind()}}},function(t,e){t.exports=function(){}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1174),r=i(1175),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(19);t.exports=function(t,e,i,r){var s=e.faces,o=s.length;if(0!==o){i.addToRenderList(e);var a=t.pipelines.set(e.pipeline,e),h=n(e,i,r).calc,l=a.setGameObject(e),c=a.vertexViewF32,u=a.vertexViewU32,d=a.vertexCount*a.currentShader.vertexComponentCount-1,p=e.tintFill,f=[],m=e.debugCallback,g=h.a,v=h.b,y=h.c,x=h.d,b=h.e,w=h.f,T=e.viewPosition.z,_=e.hideCCW,E=i.roundPixels,S=i.alpha*e.alpha,M=0;t.pipelines.preBatch(e);for(var A=0;A * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1177),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(19);t.exports=function(t,e,i,r){i.addToRenderList(e);var s=t.pipelines.set(e.pipeline),o=n(e,i,r).calc,a=e.width,h=e.height,l=-e._radius,c=-e._radius,u=l+a,d=c+h,p=o.getX(0,0),f=o.getY(0,0),m=o.getX(l,c),g=o.getY(l,c),v=o.getX(l,d),y=o.getY(l,d),x=o.getX(u,d),b=o.getY(u,d),w=o.getX(u,c),T=o.getY(u,c);t.pipelines.preBatch(e),s.batchPointLight(e,i,m,g,v,y,x,b,w,T,p,f),t.pipelines.postBatch(e)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(226);i(5).register("shader",(function(t,e,i,r,s,o,a){return this.displayList.add(new n(this.scene,t,e,i,r,s,o,a))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(227);i(5).register("mesh",(function(t,e,i,r,s,o,a,h,l,c,u){return this.displayList.add(new n(this.scene,t,e,i,r,s,o,a,h,l,c,u))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(5),r=i(149);n.register("pointlight",(function(t,e,i,n,s,o){return this.displayList.add(new r(this.scene,t,e,i,n,s,o))}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(28),r=i(16),s=i(13),o=i(226);r.register("shader",(function(t,e){void 0===t&&(t={});var i=s(t,"key",null),r=s(t,"x",0),a=s(t,"y",0),h=s(t,"width",128),l=s(t,"height",128),c=new o(this.scene,i,r,a,h,l);return void 0!==e&&(t.add=e),n(this.scene,c,t),c}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(28),r=i(16),s=i(13),o=i(6),a=i(227);r.register("mesh",(function(t,e){void 0===t&&(t={});var i=s(t,"key",null),r=s(t,"frame",null),h=o(t,"vertices",[]),l=o(t,"uvs",[]),c=o(t,"indicies",[]),u=o(t,"containsZ",!1),d=o(t,"normals",[]),p=o(t,"colors",16777215),f=o(t,"alphas",1),m=new a(this.scene,0,0,i,r,h,l,c,u,d,p,f);return void 0!==e&&(t.add=e),n(this.scene,m,t),m}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(28),r=i(16),s=i(13),o=i(149);r.register("pointlight",(function(t,e){void 0===t&&(t={});var i=s(t,"color",16777215),r=s(t,"radius",128),a=s(t,"intensity",1),h=s(t,"attenuation",.1),l=new o(this.scene,0,0,i,r,a,h);return void 0!==e&&(t.add=e),n(this.scene,l,t),l}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(476),s=i(24),o=i(21),a=new n({Extends:r,initialize:function(t){this.scene=t,this.systems=t.sys,t.sys.settings.isBooted||t.sys.events.once(o.BOOT,this.boot,this),r.call(this)},boot:function(){var t=this.systems.events;t.on(o.SHUTDOWN,this.shutdown,this),t.on(o.DESTROY,this.destroy,this)},destroy:function(){this.shutdown(),this.scene=void 0,this.systems=void 0}});s.register("LightsPlugin",a,"lights"),t.exports=a},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(62);n.Area=i(1186),n.Circumference=i(296),n.CircumferencePoint=i(165),n.Clone=i(1187),n.Contains=i(63),n.ContainsPoint=i(1188),n.ContainsRect=i(1189),n.CopyFrom=i(1190),n.Equals=i(1191),n.GetBounds=i(1192),n.GetPoint=i(294),n.GetPoints=i(295),n.Offset=i(1193),n.OffsetPoint=i(1194),n.Random=i(166),t.exports=n},function(t,e){t.exports=function(t){return t.radius>0?Math.PI*t.radius*t.radius:0}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(62);t.exports=function(t){return new n(t.x,t.y,t.radius)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(63);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(63);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.radius)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.radius===e.radius}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(10);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.diameter,e.height=t.diameter,e}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(108);n.Area=i(1196),n.Circumference=i(441),n.CircumferencePoint=i(215),n.Clone=i(1197),n.Contains=i(109),n.ContainsPoint=i(1198),n.ContainsRect=i(1199),n.CopyFrom=i(1200),n.Equals=i(1201),n.GetBounds=i(1202),n.GetPoint=i(439),n.GetPoints=i(440),n.Offset=i(1203),n.OffsetPoint=i(1204),n.Random=i(177),t.exports=n},function(t,e){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(108);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(109);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(109);t.exports=function(t,e){return n(t,e.x,e.y)&&n(t,e.right,e.y)&&n(t,e.x,e.bottom)&&n(t,e.right,e.bottom)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(10);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.left,e.y=t.top,e.width=t.width,e.height=t.height,e}},function(t,e){t.exports=function(t,e,i){return t.x+=e,t.y+=i,t}},function(t,e){t.exports=function(t,e){return t.x+=e.x,t.y+=e.y,t}},function(t,e,i){ /** * @author Florian Vazelle * @author Geoffrey Glaive * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4),r=i(228);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var s,o,a,h,l=t.x,c=t.y,u=t.radius,d=e.x,p=e.y,f=e.radius;if(c===p)0==(a=(o=-2*p)*o-4*(s=1)*(d*d+(h=(f*f-u*u-d*d+l*l)/(2*(l-d)))*h-2*d*h+p*p-f*f))?i.push(new n(h,-o/(2*s))):a>0&&(i.push(new n(h,(-o+Math.sqrt(a))/(2*s))),i.push(new n(h,(-o-Math.sqrt(a))/(2*s))));else{var m=(l-d)/(c-p),g=(f*f-u*u-d*d+l*l-p*p+c*c)/(2*(c-p));0==(a=(o=2*c*m-2*g*m-2*l)*o-4*(s=m*m+1)*(l*l+c*c+g*g-u*u-2*c*g))?(h=-o/(2*s),i.push(new n(h,g-h*m))):a>0&&(h=(-o+Math.sqrt(a))/(2*s),i.push(new n(h,g-h*m)),h=(-o-Math.sqrt(a))/(2*s),i.push(new n(h,g-h*m)))}}return i}},function(t,e,i){ /** * @author Florian Vazelle * @author Geoffrey Glaive * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(229),r=i(150);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var s=e.getLineA(),o=e.getLineB(),a=e.getLineC(),h=e.getLineD();n(s,t,i),n(o,t,i),n(a,t,i),n(h,t,i)}return i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(138),r=i(481),s=new(i(45));function o(t,e,i,o,a){var h=Math.cos(t),l=Math.sin(t);s.setTo(e,i,e+h,i+l);var c=r(s,o);c&&a.push(new n(c.x,c.y,t,c.w))}function a(t,e){return t.z-e.z}t.exports=function(t,e,i){Array.isArray(i)||(i=[i]);for(var n=[],r=[],s=0;s * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(10),r=i(114);t.exports=function(t,e,i){return void 0===i&&(i=new n),r(t,e)&&(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y),i}},function(t,e,i){ /** * @author Florian Vazelle * @author Geoffrey Glaive * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(231),r=i(114);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var s=t.getLineA(),o=t.getLineB(),a=t.getLineC(),h=t.getLineD();n(s,e,i),n(o,e,i),n(a,e,i),n(h,e,i)}return i}},function(t,e,i){ /** * @author Florian Vazelle * @author Geoffrey Glaive * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(483),r=i(231);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var s=e.getLineA(),o=e.getLineB(),a=e.getLineC();r(s,t,i),r(o,t,i),r(a,t,i)}return i}},function(t,e,i){ /** * @author Florian Vazelle * @author Geoffrey Glaive * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(229),r=i(485);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var s=t.getLineA(),o=t.getLineB(),a=t.getLineC();n(s,e,i),n(o,e,i),n(a,e,i)}return i}},function(t,e,i){ /** * @author Florian Vazelle * @author Geoffrey Glaive * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(488),r=i(486);t.exports=function(t,e,i){if(void 0===i&&(i=[]),n(t,e)){var s=e.getLineA(),o=e.getLineB(),a=e.getLineC();r(t,s,i),r(t,o,i),r(t,a,i)}return i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(490);t.exports=function(t,e){if(!n(t,e))return!1;var i=Math.min(e.x1,e.x2),r=Math.max(e.x1,e.x2),s=Math.min(e.y1,e.y2),o=Math.max(e.y1,e.y2);return t.x>=i&&t.x<=r&&t.y>=s&&t.y<=o}},function(t,e){t.exports=function(t,e,i,n,r,s){return void 0===s&&(s=0),!(e>t.right+s||it.bottom+s||r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(45);n.Angle=i(93),n.BresenhamPoints=i(311),n.CenterOn=i(1216),n.Clone=i(1217),n.CopyFrom=i(1218),n.Equals=i(1219),n.Extend=i(1220),n.GetEasedPoints=i(1221),n.GetMidPoint=i(1222),n.GetNearestPoint=i(1223),n.GetNormal=i(1224),n.GetPoint=i(301),n.GetPoints=i(168),n.GetShortestDistance=i(1225),n.Height=i(1226),n.Length=i(64),n.NormalAngle=i(491),n.NormalX=i(1227),n.NormalY=i(1228),n.Offset=i(1229),n.PerpSlope=i(1230),n.Random=i(169),n.ReflectAngle=i(1231),n.Rotate=i(1232),n.RotateAroundPoint=i(1233),n.RotateAroundXY=i(233),n.SetToAngle=i(1234),n.Slope=i(1235),n.Width=i(1236),t.exports=n},function(t,e){t.exports=function(t,e,i){var n=e-(t.x1+t.x2)/2,r=i-(t.y1+t.y2)/2;return t.x1+=n,t.y1+=r,t.x2+=n,t.y2+=r,t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(45);t.exports=function(t){return new n(t.x1,t.y1,t.x2,t.y2)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2)}},function(t,e){t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(64);t.exports=function(t,e,i){void 0===i&&(i=e);var r=n(t),s=t.x2-t.x1,o=t.y2-t.y1;return e&&(t.x1=t.x1-s/r*e,t.y1=t.y1-o/r*e),i&&(t.x2=t.x2+s/r*i,t.y2=t.y2+o/r*i),t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(346),r=i(80),s=i(4);t.exports=function(t,e,i,o,a){void 0===o&&(o=0),void 0===a&&(a=[]);var h,l,c=[],u=t.x1,d=t.y1,p=t.x2-u,f=t.y2-d,m=r(e,a),g=i-1;for(h=0;h0){var v=c[0],y=[v];for(h=1;h=o&&(y.push(x),v=x)}var b=c[c.length-1];return n(v,b) * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=(t.x1+t.x2)/2,e.y=(t.y1+t.y2)/2,e}},function(t,e,i){ /** * @author Richard Davey * @author Florian Mertens * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=t.x1,s=t.y1,o=t.x2,a=t.y2,h=(o-r)*(o-r)+(a-s)*(a-s);if(0===h)return i;var l=((e.x-r)*(o-r)+(e.y-s)*(a-s))/h;return i.x=r+l*(o-r),i.y=s+l*(a-s),i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(14),r=i(93),s=i(4);t.exports=function(t,e){void 0===e&&(e=new s);var i=r(t)-n.TAU;return e.x=Math.cos(i),e.y=Math.sin(i),e}},function(t,e){t.exports=function(t,e){var i=t.x1,n=t.y1,r=t.x2,s=t.y2,o=(r-i)*(r-i)+(s-n)*(s-n);if(0===o)return!1;var a=((n-e.y)*(r-i)-(i-e.x)*(s-n))/o;return Math.abs(a)*Math.sqrt(o)}},function(t,e){t.exports=function(t){return Math.abs(t.y1-t.y2)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(14),r=i(93);t.exports=function(t){return Math.cos(r(t)-n.TAU)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(14),r=i(93);t.exports=function(t){return Math.sin(r(t)-n.TAU)}},function(t,e){t.exports=function(t,e,i){return t.x1+=e,t.y1+=i,t.x2+=e,t.y2+=i,t}},function(t,e){t.exports=function(t){return-(t.x2-t.x1)/(t.y2-t.y1)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(93),r=i(491);t.exports=function(t,e){return 2*r(e)-Math.PI-n(t)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(233);t.exports=function(t,e){var i=(t.x1+t.x2)/2,r=(t.y1+t.y2)/2;return n(t,i,r,e)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(233);t.exports=function(t,e,i){return n(t,e.x,e.y,i)}},function(t,e){t.exports=function(t,e,i,n,r){return t.x1=e,t.y1=i,t.x2=e+Math.cos(n)*r,t.y2=i+Math.sin(n)*r,t}},function(t,e){t.exports=function(t){return(t.y2-t.y1)/(t.x2-t.x1)}},function(t,e){t.exports=function(t){return Math.abs(t.x1-t.x2)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n={Face:i(113),GenerateGridVerts:i(1238),GenerateObjVerts:i(474),GenerateVerts:i(473),ParseObj:i(492),ParseObjMaterial:i(493),RotateFace:i(1239),Vertex:i(115)};t.exports=n},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(113),r=i(2),s=i(67),o=i(38),a=i(115),h=new o,l=new o,c=new s;t.exports=function(t){var e=r(t,"mesh"),i=r(t,"texture",null),s=r(t,"frame"),o=r(t,"width",1),u=r(t,"height",o),d=r(t,"widthSegments",1),p=r(t,"heightSegments",d),f=r(t,"x",0),m=r(t,"y",0),g=r(t,"z",0),v=r(t,"rotateX",0),y=r(t,"rotateY",0),x=r(t,"rotateZ",0),b=r(t,"zIsUp",!0),w=r(t,"isOrtho",!!e&&e.dirtyCache[11]),T=r(t,"colors",[16777215]),_=r(t,"alphas",[1]),E=r(t,"tile",!1),S=r(t,"flipY",!1),M=r(t,"width",null),A={faces:[],verts:[]};if(h.set(f,m,g),l.set(v,y,x),c.fromRotationXYTranslation(l,h,b),!i&&e)i=e.texture;else{if(!e||"string"!=typeof i)return A;i=e.scene.sys.textures.get(i)}var C=i.get(s);!M&&w&&i&&e&&(o=C.width/e.height,u=C.height/e.height);var P,R,L=o/2,O=u/2,D=Math.floor(d),I=Math.floor(p),F=D+1,B=I+1,k=o/D,N=u/I,U=[],z=[],G=0,V=1,H=0,W=1;C&&(G=C.u0,V=C.u1,S?(H=C.v1,W=C.v0):(H=C.v0,W=C.v1));var X=V-G,j=W-H;for(R=0;R * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4);n.Ceil=i(1241),n.Clone=i(1242),n.CopyFrom=i(1243),n.Equals=i(1244),n.Floor=i(1245),n.GetCentroid=i(1246),n.GetMagnitude=i(494),n.GetMagnitudeSq=i(495),n.GetRectangleFromPoints=i(1247),n.Interpolate=i(1248),n.Invert=i(1249),n.Negative=i(1250),n.Project=i(1251),n.ProjectUnit=i(1252),n.SetMagnitude=i(1253),t.exports=n},function(t,e){t.exports=function(t){return t.setTo(Math.ceil(t.x),Math.ceil(t.y))}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4);t.exports=function(t){return new n(t.x,t.y)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y}},function(t,e){t.exports=function(t){return t.setTo(Math.floor(t.x),Math.floor(t.y))}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4);t.exports=function(t,e){if(void 0===e&&(e=new n),!Array.isArray(t))throw new Error("GetCentroid points argument must be an array");var i=t.length;if(i<1)throw new Error("GetCentroid points array must not be empty");if(1===i)e.x=t[0].x,e.y=t[0].y;else{for(var r=0;r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(10);t.exports=function(t,e){void 0===e&&(e=new n);for(var i=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,a=0;ai&&(i=h.x),h.xs&&(s=h.y),h.y * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4);t.exports=function(t,e,i,r){return void 0===i&&(i=0),void 0===r&&(r=new n),r.x=t.x+(e.x-t.x)*i,r.y=t.y+(e.y-t.y)*i,r}},function(t,e){t.exports=function(t){return t.setTo(t.y,t.x)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.setTo(-t.x,-t.y)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4),r=i(495);t.exports=function(t,e,i){void 0===i&&(i=new n);var s=(t.x*e.x+t.y*e.y)/r(e);return 0!==s&&(i.x=s*e.x,i.y=s*e.y),i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4);t.exports=function(t,e,i){void 0===i&&(i=new n);var r=t.x*e.x+t.y*e.y;return 0!==r&&(i.x=r*e.x,i.y=r*e.y),i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(494);t.exports=function(t,e){if(0!==t.x||0!==t.y){var i=n(t);t.x/=i,t.y/=i}return t.x*=e,t.y*=e,t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(224);n.Clone=i(1255),n.Contains=i(225),n.ContainsPoint=i(1256),n.Earcut=i(68),n.GetAABB=i(463),n.GetNumberArray=i(1257),n.GetPoints=i(464),n.Perimeter=i(465),n.Reverse=i(1258),n.Simplify=i(1259),n.Smooth=i(466),n.Translate=i(1260),t.exports=n},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(224);t.exports=function(t){return new n(t.points)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(225);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e){t.exports=function(t,e){void 0===e&&(e=[]);for(var i=0;i1?(n=i.x,r=i.y):a>0&&(n+=s*a,r+=o*a)}return(s=t.x-n)*s+(o=t.y-r)*o}function n(t,e){var n=t.length-1,r=[t[0]];return function t(e,n,r,s,o){for(var a,h=s,l=n+1;lh&&(a=l,h=c)}h>s&&(a-n>1&&t(e,n,a,s,o),o.push(e[a]),r-a>1&&t(e,a,r,s,o))}(t,0,n,e,r),r.push(t[n]),r}t.exports=function(t,e,i){void 0===e&&(e=1),void 0===i&&(i=!1);var r=t.points;if(r.length>2){var s=e*e;i||(r=function(t,e){for(var i,n,r,s,o,a=t[0],h=[a],l=1,c=t.length;le&&(h.push(i),a=i);return a!==i&&h.push(i),h}(r,s)),t.setTo(n(r,s))}return t}},function(t,e){t.exports=function(t,e,i){for(var n=t.points,r=0;r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(10);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(56);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x,t.y,t.width,t.height)}},function(t,e){t.exports=function(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(234);t.exports=function(t,e){var i=n(t);return i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(234);t.exports=function(t,e){var i=n(t);return i>n(e)?t.setSize(e.height*i,e.height):t.setSize(e.width,e.width/i),t.setPosition(e.centerX-t.width/2,e.centerY-t.height/2)}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t}},function(t,e){t.exports=function(t){return t.x=Math.floor(t.x),t.y=Math.floor(t.y),t.width=Math.floor(t.width),t.height=Math.floor(t.height),t}},function(t,e,i){ /** * @author samme * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(10);t.exports=function(t,e,i,r,s){return void 0===s&&(s=new n),s.setTo(Math.min(t,i),Math.min(e,r),Math.abs(t-i),Math.abs(e-r))}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.centerX,e.y=t.centerY,e}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4);t.exports=function(t,e){return void 0===e&&(e=new n),e.x=t.width,e.y=t.height,e}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(187);t.exports=function(t,e,i){var r=t.centerX,s=t.centerY;return t.setSize(t.width+2*e,t.height+2*i),n(t,r,s)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(10),r=i(114);t.exports=function(t,e,i){return void 0===i&&(i=new n),r(t,e)?(i.x=Math.max(t.x,e.x),i.y=Math.max(t.y,e.y),i.width=Math.min(t.right,e.right)-i.x,i.height=Math.min(t.bottom,e.bottom)-i.y):i.setEmpty(),i}},function(t,e){t.exports=function(t,e){for(var i=t.x,n=t.right,r=t.y,s=t.bottom,o=0;oe.x&&t.ye.y}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(4),r=i(35);t.exports=function(t,e,i){void 0===i&&(i=new n),e=r(e);var s=Math.sin(e),o=Math.cos(e),a=o>0?t.width/2:t.width/-2,h=s>0?t.height/2:t.height/-2;return Math.abs(a*s) * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(192),r=i(497),s=i(4);t.exports=function(t,e,i){if(void 0===i&&(i=new s),r(t,e))switch(n(0,3)){case 0:i.x=t.x+Math.random()*(e.right-t.x),i.y=t.y+Math.random()*(e.top-t.y);break;case 1:i.x=e.x+Math.random()*(t.right-e.x),i.y=e.bottom+Math.random()*(t.bottom-e.bottom);break;case 2:i.x=t.x+Math.random()*(e.x-t.x),i.y=e.y+Math.random()*(t.bottom-e.y);break;case 3:i.x=e.right+Math.random()*(t.right-e.right),i.y=t.y+Math.random()*(e.bottom-t.y)}return i}},function(t,e){t.exports=function(t,e){return t.width===e.width&&t.height===e.height}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=e),t.width*=e,t.height*=i,t}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(82);n.Area=i(1288),n.BuildEquilateral=i(1289),n.BuildFromPolygon=i(1290),n.BuildRight=i(1291),n.CenterOn=i(1292),n.Centroid=i(498),n.CircumCenter=i(1293),n.CircumCircle=i(1294),n.Clone=i(1295),n.Contains=i(112),n.ContainsArray=i(232),n.ContainsPoint=i(1296),n.CopyFrom=i(1297),n.Decompose=i(489),n.Equals=i(1298),n.GetPoint=i(470),n.GetPoints=i(471),n.InCenter=i(500),n.Perimeter=i(1299),n.Offset=i(499),n.Random=i(178),n.Rotate=i(1300),n.RotateAroundPoint=i(1301),n.RotateAroundXY=i(235),t.exports=n},function(t,e){t.exports=function(t){var e=t.x1,i=t.y1,n=t.x2,r=t.y2,s=t.x3,o=t.y3;return Math.abs(((s-e)*(r-i)-(n-e)*(o-i))/2)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(82);t.exports=function(t,e,i){var r=i*(Math.sqrt(3)/2);return new n(t,e,t+i/2,e+r,t-i/2,e+r)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(68),r=i(82);t.exports=function(t,e,i,s,o){void 0===e&&(e=null),void 0===i&&(i=1),void 0===s&&(s=1),void 0===o&&(o=[]);for(var a,h,l,c,u,d,p,f,m,g=n(t,e),v=0;v * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(82);t.exports=function(t,e,i,r){return void 0===r&&(r=i),new n(t,e,t,e-r,t+i,e)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(498),r=i(499);t.exports=function(t,e,i,s){void 0===s&&(s=n);var o=s(t),a=e-o.x,h=i-o.y;return r(t,a,h)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(3);function r(t,e,i,n){return t*n-e*i}t.exports=function(t,e){void 0===e&&(e=new n);var i=t.x3,s=t.y3,o=t.x1-i,a=t.y1-s,h=t.x2-i,l=t.y2-s,c=2*r(o,a,h,l),u=r(a,o*o+a*a,l,h*h+l*l),d=r(o,o*o+a*a,h,h*h+l*l);return e.x=i-u/c,e.y=s+d/c,e}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(62);t.exports=function(t,e){void 0===e&&(e=new n);var i,r,s=t.x1,o=t.y1,a=t.x2,h=t.y2,l=t.x3,c=t.y3,u=a-s,d=h-o,p=l-s,f=c-o,m=u*(s+a)+d*(o+h),g=p*(s+l)+f*(o+c),v=2*(u*(c-h)-d*(l-a));if(Math.abs(v)<1e-6){var y=Math.min(s,a,l),x=Math.min(o,h,c);i=.5*(Math.max(s,a,l)-y),r=.5*(Math.max(o,h,c)-x),e.x=y+i,e.y=x+r,e.radius=Math.sqrt(i*i+r*r)}else e.x=(f*m-d*g)/v,e.y=(u*g-p*m)/v,i=e.x-s,r=e.y-o,e.radius=Math.sqrt(i*i+r*r);return e}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(82);t.exports=function(t){return new n(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(112);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e){t.exports=function(t,e){return e.setTo(t.x1,t.y1,t.x2,t.y2,t.x3,t.y3)}},function(t,e){t.exports=function(t,e){return t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2&&t.x3===e.x3&&t.y3===e.y3}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(64);t.exports=function(t){var e=t.getLineA(),i=t.getLineB(),r=t.getLineC();return n(e)+n(i)+n(r)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(235),r=i(500);t.exports=function(t,e){var i=r(t);return n(t,i.x,i.y,e)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(235);t.exports=function(t,e,i){return n(t,e.x,e.y,i)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(200),r=i(17),s={CreatePixelPerfectHandler:i(501),CreateInteractiveObject:i(502),Events:i(49),Gamepad:i(1303),InputManager:i(403),InputPlugin:i(1315),InputPluginCache:i(151),Keyboard:i(1316),Mouse:i(1330),Pointer:i(406),Touch:i(1331)};s=r(!1,s,n),t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Axis:i(503),Button:i(504),Events:i(236),Gamepad:i(505),GamepadPlugin:i(1310),Configs:i(1311)}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="down"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="up"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="connected"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="disconnected"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="down"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="up"},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(9),s=i(236),o=i(505),a=i(6),h=i(151),l=i(49),c=new n({Extends:r,initialize:function(t){r.call(this),this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.enabled=!0,this.target,this.gamepads=[],this.queue=[],this.onGamepadHandler,this._pad1,this._pad2,this._pad3,this._pad4,t.pluginEvents.once(l.BOOT,this.boot,this),t.pluginEvents.on(l.START,this.start,this)},boot:function(){var t=this.scene.sys.game,e=this.settings.input,i=t.config;this.enabled=a(e,"gamepad",i.inputGamepad)&&t.device.input.gamepads,this.target=a(e,"gamepad.target",i.inputGamepadEventTarget),this.sceneInputPlugin.pluginEvents.once(l.DESTROY,this.destroy,this)},start:function(){this.enabled&&(this.startListeners(),this.refreshPads()),this.sceneInputPlugin.pluginEvents.once(l.SHUTDOWN,this.shutdown,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},startListeners:function(){var t=this,e=this.target,i=function(e){!e.defaultPrevented&&t.isActive()&&(t.refreshPads(),t.queue.push(e))};this.onGamepadHandler=i,e.addEventListener("gamepadconnected",i,!1),e.addEventListener("gamepaddisconnected",i,!1),this.sceneInputPlugin.pluginEvents.on(l.UPDATE,this.update,this)},stopListeners:function(){this.target.removeEventListener("gamepadconnected",this.onGamepadHandler),this.target.removeEventListener("gamepaddisconnected",this.onGamepadHandler),this.sceneInputPlugin.pluginEvents.off(l.UPDATE,this.update);for(var t=0;t * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={DUALSHOCK_4:i(1312),SNES_USB:i(1313),XBOX_360:i(1314)}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SHARE:8,OPTIONS:9,PS:16,TOUCHBAR:17,X:0,CIRCLE:1,SQUARE:2,TRIANGLE:3,L1:4,R1:5,L2:6,R2:7,L3:10,R3:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,SELECT:8,START:9,B:0,A:1,Y:2,X:3,LEFT_SHOULDER:4,RIGHT_SHOULDER:5}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={UP:12,DOWN:13,LEFT:14,RIGHT:15,MENU:16,A:0,B:1,X:2,Y:3,LB:4,RB:5,LT:6,RT:7,BACK:8,START:9,LS:10,RS:11,LEFT_STICK_H:0,LEFT_STICK_V:1,RIGHT_STICK_H:2,RIGHT_STICK_V:3}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(62),r=i(63),s=i(0),o=i(200),a=i(502),h=i(501),l=i(48),c=i(108),u=i(109),d=i(49),p=i(9),f=i(2),m=i(55),g=i(151),v=i(7),y=i(24),x=i(10),b=i(56),w=i(21),T=i(82),_=i(112),E=new s({Extends:p,initialize:function(t){p.call(this),this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.manager=t.sys.game.input,this.pluginEvents=new p,this.enabled=!0,this.displayList,this.cameras,g.install(this),this.mouse=this.manager.mouse,this.topOnly=!0,this.pollRate=-1,this._pollTimer=0;var e={cancelled:!1};this._eventContainer={stopPropagation:function(){e.cancelled=!0}},this._eventData=e,this.dragDistanceThreshold=0,this.dragTimeThreshold=0,this._temp=[],this._tempZones=[],this._list=[],this._pendingInsertion=[],this._pendingRemoval=[],this._draggable=[],this._drag={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._dragState=[],this._over={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[],8:[],9:[],10:[]},this._validTypes=["onDown","onUp","onOver","onOut","onMove","onDragStart","onDrag","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop"],this._updatedThisFrame=!1,t.sys.events.once(w.BOOT,this.boot,this),t.sys.events.on(w.START,this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once(w.DESTROY,this.destroy,this),this.pluginEvents.emit(d.BOOT)},start:function(){var t=this.systems.events;t.on(w.TRANSITION_START,this.transitionIn,this),t.on(w.TRANSITION_OUT,this.transitionOut,this),t.on(w.TRANSITION_COMPLETE,this.transitionComplete,this),t.on(w.PRE_UPDATE,this.preUpdate,this),t.once(w.SHUTDOWN,this.shutdown,this),this.manager.events.on(d.GAME_OUT,this.onGameOut,this),this.manager.events.on(d.GAME_OVER,this.onGameOver,this),this.enabled=!0,this._dragState=[0,0,0,0,0,0,0,0,0,0],this.pluginEvents.emit(d.START)},onGameOver:function(t){this.isActive()&&this.emit(d.GAME_OVER,t.timeStamp,t)},onGameOut:function(t){this.isActive()&&this.emit(d.GAME_OUT,t.timeStamp,t)},preUpdate:function(){this.pluginEvents.emit(d.PRE_UPDATE);var t=this._pendingRemoval,e=this._pendingInsertion,i=t.length,n=e.length;if(0!==i||0!==n){for(var r=this._list,s=0;s-1&&(r.splice(a,1),this.clear(o,!0))}t.length=0,this._pendingRemoval.length=0,this._list=r.concat(e.splice(0))}},isActive:function(){return this.enabled&&this.scene.sys.isActive()},updatePoll:function(t,e){if(!this.isActive())return!1;if(this.pluginEvents.emit(d.UPDATE,t,e),this._updatedThisFrame)return this._updatedThisFrame=!1,!1;var i,n=this.manager,r=n.pointers,s=n.pointersTotal;for(i=0;i0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var a=!1;for(i=0;i0&&(a=!0)}return a},update:function(t,e){if(!this.isActive())return!1;for(var i=e.length,n=!1,r=0;r0&&(n=!0)}return this._updatedThisFrame=!0,n},clear:function(t,e){void 0===e&&(e=!1);var i=t.input;if(i){e||this.queueForRemoval(t),i.gameObject=void 0,i.target=void 0,i.hitArea=void 0,i.hitAreaCallback=void 0,i.callbackContext=void 0,t.input=null;var n=this._draggable.indexOf(t);return n>-1&&this._draggable.splice(n,1),(n=this._drag[0].indexOf(t))>-1&&this._drag[0].splice(n,1),(n=this._over[0].indexOf(t))>-1&&(this._over[0].splice(n,1),this.manager.resetCursor(i)),t}},disable:function(t){t.input.enabled=!1},enable:function(t,e,i,n){return void 0===n&&(n=!1),t.input?t.input.enabled=!0:this.setHitArea(t,e,i),t.input&&n&&!t.input.dropZone&&(t.input.dropZone=n),this},hitTestPointer:function(t){for(var e=this.cameras.getCamerasBelowPointer(t),i=0;i0)return t.camera=n,r}return t.camera=e[0],[]},processDownEvents:function(t){var e=0,i=this._temp,n=this._eventData,r=this._eventContainer;n.cancelled=!1;for(var s=!1,o=0;o0&&l(t.x,t.y,t.downX,t.downY)>=r||n>0&&e>=t.downTime+n)&&(i=!0),i)return this.setDragState(t,3),this.processDragStartList(t)},processDragStartList:function(t){if(3!==this.getDragState(t))return 0;for(var e=this._drag[t.id],i=0;i1&&(this.sortGameObjects(i,t),this.topOnly&&i.splice(1)),this._drag[t.id]=i,0===this.dragDistanceThreshold&&0===this.dragTimeThreshold?(this.setDragState(t,3),this.processDragStartList(t)):(this.setDragState(t,2),0))},processDragMoveEvent:function(t){if(2===this.getDragState(t)&&this.processDragThresholdEvent(t,this.manager.game.loop.now),4!==this.getDragState(t))return 0;for(var e=this._tempZones,i=this._drag[t.id],n=0;n0?(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):(o.emit(d.GAMEOBJECT_DRAG_LEAVE,t,h),this.emit(d.DRAG_LEAVE,t,o,h),e[0]?(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h)):a.target=null)}else!h&&e[0]&&(a.target=e[0],h=a.target,o.emit(d.GAMEOBJECT_DRAG_ENTER,t,h),this.emit(d.DRAG_ENTER,t,o,h));if(o.parentContainer){var c=t.worldX-a.dragStartXGlobal,u=t.worldY-a.dragStartYGlobal,p=o.getParentRotation(),f=c*Math.cos(p)+u*Math.sin(p),m=u*Math.cos(p)-c*Math.sin(p);f*=1/o.parentContainer.scaleX,m*=1/o.parentContainer.scaleY,r=f+a.dragStartX,s=m+a.dragStartY}else r=t.worldX-a.dragX,s=t.worldY-a.dragY;o.emit(d.GAMEOBJECT_DRAG,t,r,s),this.emit(d.DRAG,t,o,r,s)}return i.length},processDragUpEvent:function(t){for(var e=this._drag[t.id],i=0;i0){var s=this.manager,o=this._eventData,a=this._eventContainer;o.cancelled=!1;for(var h=!1,l=0;l0){var r=this.manager,s=this._eventData,o=this._eventContainer;s.cancelled=!1;var a=!1;this.sortGameObjects(e,t);for(var h=0;h0){for(this.sortGameObjects(r,t),e=0;e0){for(this.sortGameObjects(s,t),e=0;e-1&&this._draggable.splice(r,1)}return this},makePixelPerfect:function(t){void 0===t&&(t=1);var e=this.systems.textures;return h(e,t)},setHitArea:function(t,e,i){if(void 0===e)return this.setHitAreaFromTexture(t);Array.isArray(t)||(t=[t]);var n=!1,r=!1,s=!1,o=!1,h=!1,l=!0;if(v(e)){var c=e;e=f(c,"hitArea",null),i=f(c,"hitAreaCallback",null),n=f(c,"draggable",!1),r=f(c,"dropZone",!1),s=f(c,"cursor",!1),o=f(c,"useHandCursor",!1),h=f(c,"pixelPerfect",!1);var u=f(c,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(u)),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var d=0;d * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Events:i(152),KeyboardManager:i(404),KeyboardPlugin:i(1324),Key:i(506),KeyCodes:i(141),KeyCombo:i(507),AdvanceKeyCombo:i(509),ProcessKeyCombo:i(508),ResetKeyCombo:i(510),JustDown:i(1326),JustUp:i(1327),DownDuration:i(1328),UpDuration:i(1329)}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="keydown"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="keyup"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="keycombomatch"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="down"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="keydown-"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="keyup-"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="up"},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(9),s=i(152),o=i(22),a=i(6),h=i(49),l=i(151),c=i(506),u=i(141),d=i(507),p=i(1325),f=i(21),m=i(76),g=new n({Extends:r,initialize:function(t){r.call(this),this.game=t.systems.game,this.scene=t.scene,this.settings=this.scene.sys.settings,this.sceneInputPlugin=t,this.manager=t.manager.keyboard,this.enabled=!0,this.keys=[],this.combos=[],this.prevCode=null,this.prevTime=0,this.prevType=null,t.pluginEvents.once(h.BOOT,this.boot,this),t.pluginEvents.on(h.START,this.start,this)},boot:function(){var t=this.settings.input;this.enabled=a(t,"keyboard",!0);var e=a(t,"keyboard.capture",null);e&&this.addCaptures(e),this.sceneInputPlugin.pluginEvents.once(h.DESTROY,this.destroy,this)},start:function(){this.sceneInputPlugin.manager.events.on(h.MANAGER_PROCESS,this.update,this),this.sceneInputPlugin.pluginEvents.once(h.SHUTDOWN,this.shutdown,this),this.game.events.on(o.BLUR,this.resetKeys,this),this.scene.sys.events.on(f.PAUSE,this.resetKeys,this),this.scene.sys.events.on(f.SLEEP,this.resetKeys,this)},isActive:function(){return this.enabled&&this.scene.sys.isActive()},addCapture:function(t){return this.manager.addCapture(t),this},removeCapture:function(t){return this.manager.removeCapture(t),this},getCaptures:function(){return this.manager.captures},enableGlobalCapture:function(){return this.manager.preventDefault=!0,this},disableGlobalCapture:function(){return this.manager.preventDefault=!1,this},clearCaptures:function(){return this.manager.clearCaptures(),this},createCursorKeys:function(){return this.addKeys({up:u.UP,down:u.DOWN,left:u.LEFT,right:u.RIGHT,space:u.SPACE,shift:u.SHIFT})},addKeys:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var n={};if("string"==typeof t){t=t.split(",");for(var r=0;r-1?n[r]=t:n[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=u[t.toUpperCase()]),n[t]||(n[t]=new c(this,t),e&&this.addCapture(t),n[t].setEmitOnRepeat(i)),n[t]},removeKey:function(t,e){void 0===e&&(e=!1);var i,n=this.keys;if(t instanceof c){var r=n.indexOf(t);r>-1&&(i=this.keys[r],this.keys[r]=void 0)}else"string"==typeof t&&(t=u[t.toUpperCase()]);return n[t]&&(i=n[t],n[t]=void 0),i&&(i.plugin=null,e&&i.destroy()),this},removeAllKeys:function(t){for(var e=this.keys,i=0;it._tick)return t._tick=i,!0}return!1},update:function(){var t=this.manager.queue,e=t.length;if(this.isActive()&&0!==e)for(var i=this.keys,n=0;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(141),r={};for(var s in n)r[n[s]]=s;t.exports=r},function(t,e){t.exports=function(t){return!!t._justDown&&(t._justDown=!1,!0)}},function(t,e){t.exports=function(t){return!!t._justUp&&(t._justUp=!1,!0)}},function(t,e){t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeDown;return t.isDown&&i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={MouseManager:i(405)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={TouchManager:i(407)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(20),r=i(17),s={Events:i(91),FileTypes:i(1333),File:i(23),FileTypesManager:i(8),GetURL:i(153),LoaderPlugin:i(1359),MergeXHRSettings:i(237),MultiFile:i(47),XHRLoader:i(511),XHRSettings:i(154)};s=r(!1,s,n),t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={AnimationJSONFile:i(1334),AsepriteFile:i(1335),AtlasJSONFile:i(1336),AtlasXMLFile:i(1337),AudioFile:i(512),AudioSpriteFile:i(1338),BinaryFile:i(1339),BitmapFontFile:i(1340),CSSFile:i(1341),GLSLFile:i(1342),HTML5AudioFile:i(513),HTMLFile:i(1343),HTMLTextureFile:i(1344),ImageFile:i(70),JSONFile:i(59),MultiAtlasFile:i(1345),MultiScriptFile:i(1346),OBJFile:i(1347),PackFile:i(1348),PluginFile:i(1349),SceneFile:i(1350),ScenePluginFile:i(1351),ScriptFile:i(514),SpriteSheetFile:i(1352),SVGFile:i(1353),TextFile:i(239),TilemapCSVFile:i(1354),TilemapImpactFile:i(1355),TilemapJSONFile:i(1356),UnityAtlasFile:i(1357),VideoFile:i(1358),XMLFile:i(238)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(8),s=i(59),o=i(91),a=new n({Extends:s,initialize:function(t,e,i,n,r){s.call(this,t,e,i,n,r),this.type="animationJSON"},onProcess:function(){this.loader.once(o.POST_PROCESS,this.onLoadComplete,this),s.prototype.onProcess.call(this)},onLoadComplete:function(){this.loader.systems.anims.fromJSON(this.data)}});r.register("animation",(function(t,e,i,n){if(Array.isArray(t))for(var r=0;r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(8),s=i(2),o=i(70),a=i(7),h=i(59),l=i(47),c=new n({Extends:l,initialize:function(t,e,i,n,r,c){var u,d;if(a(e)){var p=e;e=s(p,"key"),u=new o(t,{key:e,url:s(p,"textureURL"),extension:s(p,"textureExtension","png"),normalMap:s(p,"normalMap"),xhrSettings:s(p,"textureXhrSettings")}),d=new h(t,{key:e,url:s(p,"atlasURL"),extension:s(p,"atlasExtension","json"),xhrSettings:s(p,"atlasXhrSettings")})}else u=new o(t,e,i,r),d=new h(t,e,n,c);u.linkFile?l.call(this,t,"atlasjson",e,[u,d,u.linkFile]):l.call(this,t,"atlasjson",e,[u,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),e.addToCache(),this.complete=!0}}});r.register("aseprite",(function(t,e,i,n,r){var s;if(Array.isArray(t))for(var o=0;o * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(8),s=i(2),o=i(70),a=i(7),h=i(59),l=i(47),c=new n({Extends:l,initialize:function(t,e,i,n,r,c){var u,d;if(a(e)){var p=e;e=s(p,"key"),u=new o(t,{key:e,url:s(p,"textureURL"),extension:s(p,"textureExtension","png"),normalMap:s(p,"normalMap"),xhrSettings:s(p,"textureXhrSettings")}),d=new h(t,{key:e,url:s(p,"atlasURL"),extension:s(p,"atlasExtension","json"),xhrSettings:s(p,"atlasXhrSettings")})}else u=new o(t,e,i,r),d=new h(t,e,n,c);u.linkFile?l.call(this,t,"atlasjson",e,[u,d,u.linkFile]):l.call(this,t,"atlasjson",e,[u,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlas(t.key,t.data,e.data,i),e.pendingDestroy(),this.complete=!0}}});r.register("atlas",(function(t,e,i,n,r){var s;if(Array.isArray(t))for(var o=0;o * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(8),s=i(2),o=i(70),a=i(7),h=i(47),l=i(238),c=new n({Extends:h,initialize:function(t,e,i,n,r,c){var u,d;if(a(e)){var p=e;e=s(p,"key"),u=new o(t,{key:e,url:s(p,"textureURL"),extension:s(p,"textureExtension","png"),normalMap:s(p,"normalMap"),xhrSettings:s(p,"textureXhrSettings")}),d=new l(t,{key:e,url:s(p,"atlasURL"),extension:s(p,"atlasExtension","xml"),xhrSettings:s(p,"atlasXhrSettings")})}else u=new o(t,e,i,r),d=new l(t,e,n,c);u.linkFile?h.call(this,t,"atlasxml",e,[u,d,u.linkFile]):h.call(this,t,"atlasxml",e,[u,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addAtlasXML(t.key,t.data,e.data,i),e.pendingDestroy(),this.complete=!0}}});r.register("atlasXML",(function(t,e,i,n,r){var s;if(Array.isArray(t))for(var o=0;o * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(512),r=i(0),s=i(8),o=i(2),a=i(7),h=i(59),l=i(47),c=new r({Extends:l,initialize:function(t,e,i,r,s,c,u){if(a(e)){var d=e;e=o(d,"key"),i=o(d,"jsonURL"),r=o(d,"audioURL"),s=o(d,"audioConfig"),c=o(d,"audioXhrSettings"),u=o(d,"jsonXhrSettings")}var p;if(r){var f=n.create(t,e,r,s,c);f&&(p=new h(t,e,i,u),l.call(this,t,"audiosprite",e,[f,p]),this.config.resourceLoad=!1)}else p=new h(t,e,i,u),l.call(this,t,"audiosprite",e,[p]),this.config.resourceLoad=!0,this.config.audioConfig=s,this.config.audioXhrSettings=c},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,this.config.resourceLoad&&"json"===t.type&&t.data.hasOwnProperty("resources"))){var e=t.data.resources,i=o(this.config,"audioConfig"),r=o(this.config,"audioXhrSettings"),s=n.create(this.loader,t.key,e,i,r);s&&(this.addToMultiFile(s),this.loader.addFile(s))}},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.addToCache(),this.complete=!0}}});s.register("audioSprite",(function(t,e,i,n,r,s){var o,a=this.systems.game,h=a.config.audio,l=a.device.audio;if(h&&h.noAudio||!l.webAudio&&!l.audioData)return this;if(Array.isArray(t))for(var u=0;u * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=new n({Extends:s,initialize:function(t,e,i,n,r){var o="bin";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),n=a(l,"xhrSettings"),o=a(l,"extension",o),r=a(l,"dataType",r)}var c={type:"binary",cache:t.cacheManager.binary,extension:o,responseType:"arraybuffer",key:e,url:i,xhrSettings:n,config:{dataType:r}};s.call(this,t,c)},onProcess:function(){this.state=r.FILE_PROCESSING;var t=this.config.dataType;this.data=t?new t(this.xhrLoader.response):this.xhrLoader.response,this.onProcessComplete()}});o.register("binary",(function(t,e,i,n){if(Array.isArray(t))for(var r=0;r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(8),s=i(2),o=i(70),a=i(7),h=i(47),l=i(209),c=i(238),u=new n({Extends:h,initialize:function(t,e,i,n,r,l){var u,d;if(a(e)){var p=e;e=s(p,"key"),u=new o(t,{key:e,url:s(p,"textureURL"),extension:s(p,"textureExtension","png"),normalMap:s(p,"normalMap"),xhrSettings:s(p,"textureXhrSettings")}),d=new c(t,{key:e,url:s(p,"fontDataURL"),extension:s(p,"fontDataExtension","xml"),xhrSettings:s(p,"fontDataXhrSettings")})}else u=new o(t,e,i,r),d=new c(t,e,n,l);u.linkFile?h.call(this,t,"bitmapfont",e,[u,d,u.linkFile]):h.call(this,t,"bitmapfont",e,[u,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1];t.addToCache(),e.pendingDestroy();var i=t.cache.get(t.key),n=l(e.data,t.cache.getFrame(t.key),0,0,i);this.loader.cacheManager.bitmapFont.add(t.key,{data:n,texture:t.key,frame:null}),this.complete=!0}}});r.register("bitmapFont",(function(t,e,i,n,r){var s;if(Array.isArray(t))for(var o=0;o * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=new n({Extends:s,initialize:function(t,e,i,n){var r="css";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),r=a(o,"extension",r)}var l={type:"script",cache:!1,extension:r,responseType:"text",key:e,url:i,xhrSettings:n};s.call(this,t,l)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=document.createElement("style"),this.data.defer=!1,this.data.innerHTML=this.xhrLoader.responseText,document.head.appendChild(this.data),this.onProcessComplete()}});o.register("css",(function(t,e,i){if(Array.isArray(t))for(var n=0;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=i(390),c=new n({Extends:s,initialize:function(t,e,i,n,r){var o="glsl";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),n=a(l,"shaderType","fragment"),r=a(l,"xhrSettings"),o=a(l,"extension",o)}else void 0===n&&(n="fragment");var c={type:"glsl",cache:t.cacheManager.shader,extension:o,responseType:"text",key:e,url:i,config:{shaderType:n},xhrSettings:r};s.call(this,t,c)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.split("\n"),e=this.extractBlock(t,0);if(e)for(;e;){var i=this.getShaderName(e.header),n=this.getShaderType(e.header),r=this.getShaderUniforms(e.header),s=e.shader;if(this.cache.has(i)){var o=this.cache.get(i);"fragment"===n?o.fragmentSrc=s:o.vertexSrc=s,o.uniforms||(o.uniforms=r)}else"fragment"===n?this.cache.add(i,new l(i,s,"",r)):this.cache.add(i,new l(i,"",s,r));e=this.extractBlock(t,e.offset)}else"fragment"===this.config.shaderType?this.cache.add(this.key,new l(this.key,this.data)):this.cache.add(this.key,new l(this.key,"",this.data));this.pendingDestroy()},getShaderName:function(t){for(var e=0;e * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=new n({Extends:s,initialize:function(t,e,i,n){var r="html";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),r=a(o,"extension",r)}var l={type:"text",cache:t.cacheManager.html,extension:r,responseType:"text",key:e,url:i,xhrSettings:n};s.call(this,t,l)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()}});o.register("html",(function(t,e,i){if(Array.isArray(t))for(var n=0;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=new n({Extends:s,initialize:function(t,e,i,n,r,o){void 0===n&&(n=512),void 0===r&&(r=512);var l="html";if(h(e)){var c=e;e=a(c,"key"),i=a(c,"url"),o=a(c,"xhrSettings"),l=a(c,"extension",l),n=a(c,"width",n),r=a(c,"height",r)}var u={type:"html",cache:t.textureManager,extension:l,responseType:"text",key:e,url:i,xhrSettings:o,config:{width:n,height:r}};s.call(this,t,u)},onProcess:function(){this.state=r.FILE_PROCESSING;var t=this.config.width,e=this.config.height,i=[];i.push(''),i.push(''),i.push(''),i.push(this.xhrLoader.responseText),i.push(""),i.push(""),i.push("");var n=[i.join("\n")],o=this;try{var a=new window.Blob(n,{type:"image/svg+xml;charset=utf-8"})}catch(t){return o.state=r.FILE_ERRORED,void o.onProcessComplete()}this.data=new Image,this.data.crossOrigin=this.crossOrigin,this.data.onload=function(){s.revokeObjectURL(o.data),o.onProcessComplete()},this.data.onerror=function(){s.revokeObjectURL(o.data),o.onProcessError()},s.createObjectURL(this.data,a,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("htmlTexture",(function(t,e,i,n,r){if(Array.isArray(t))for(var s=0;s * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(8),s=i(2),o=i(70),a=i(7),h=i(59),l=i(47),c=new n({Extends:l,initialize:function(t,e,i,n,r,o,c){if(a(e)){var u=e;e=s(u,"key"),i=s(u,"url",!1)?s(u,"url"):s(u,"atlasURL"),o=s(u,"xhrSettings"),n=s(u,"path"),r=s(u,"baseURL"),c=s(u,"textureXhrSettings")}var d=new h(t,e,i,o);l.call(this,t,"multiatlas",e,[d]),this.config.path=n,this.config.baseURL=r,this.config.textureXhrSettings=c},onFileComplete:function(t){if(-1!==this.files.indexOf(t)&&(this.pending--,"json"===t.type&&t.data.hasOwnProperty("textures"))){var e=t.data.textures,i=this.config,n=this.loader,r=n.baseURL,a=n.path,h=n.prefix,l=s(i,"baseURL",this.baseURL),c=s(i,"path",this.path),u=s(i,"prefix",this.prefix),d=s(i,"textureXhrSettings");n.setBaseURL(l),n.setPath(c),n.setPrefix(u);for(var p=0;p * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(8),s=i(2),o=i(7),a=i(47),h=i(514),l=new n({Extends:a,initialize:function(t,e,i,n){var r="js",l=[];if(o(e)){var c=e;e=s(c,"key"),i=s(c,"url"),n=s(c,"xhrSettings"),r=s(c,"extension",r)}Array.isArray(i)||(i=[i]);for(var u=0;u * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(8),s=i(2),o=i(7),a=i(47),h=i(492),l=i(493),c=i(239),u=new n({Extends:a,initialize:function(t,e,i,n,r,h){var l,u,d=t.cacheManager.obj;if(o(e)){var p=e;e=s(p,"key"),l=new c(t,{key:e,type:"obj",cache:d,url:s(p,"url"),extension:s(p,"extension","obj"),xhrSettings:s(p,"xhrSettings"),config:{flipUV:s(p,"flipUV",r)}}),(n=s(p,"matURL"))&&(u=new c(t,{key:e,type:"mat",cache:d,url:n,extension:s(p,"matExtension","mat"),xhrSettings:s(p,"xhrSettings")}))}else l=new c(t,{key:e,url:i,type:"obj",cache:d,extension:"obj",xhrSettings:h,config:{flipUV:r}}),n&&(u=new c(t,{key:e,url:n,type:"mat",cache:d,extension:"mat",xhrSettings:h}));a.call(this,t,"obj",e,[l,u])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=h(t.data,t.config.flipUV);e&&(i.materials=l(e.data)),t.cache.add(t.key,i),this.complete=!0}}});r.register("obj",(function(t,e,i,n,r){var s;if(Array.isArray(t))for(var o=0;o * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(20),s=i(8),o=i(59),a=new n({Extends:o,initialize:function(t,e,i,n,r){o.call(this,t,e,i,n,r),this.type="packfile"},onProcess:function(){this.state!==r.FILE_POPULATED&&(this.state=r.FILE_PROCESSING,this.data=JSON.parse(this.xhrLoader.responseText)),this.loader.addPack(this.data,this.config),this.onProcessComplete()}});s.register("pack",(function(t,e,i,n){if(Array.isArray(t))for(var r=0;r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=new n({Extends:s,initialize:function(t,e,i,n,o,l){var c="js";if(h(e)){var u=e;e=a(u,"key"),i=a(u,"url"),l=a(u,"xhrSettings"),c=a(u,"extension",c),n=a(u,"start"),o=a(u,"mapping")}var d={type:"plugin",cache:!1,extension:c,responseType:"text",key:e,url:i,xhrSettings:l,config:{start:n,mapping:o}};s.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=r.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=a(e,"start",!1),n=a(e,"mapping",null);if(this.state===r.FILE_POPULATED)t.install(this.key,this.data,i,n);else{this.state=r.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data);var s=t.install(this.key,window[this.key],i,n);(i||n)&&(this.loader.systems[n]=s,this.loader.scene[n]=s)}this.onProcessComplete()}});o.register("plugin",(function(t,e,i,n,r){if(Array.isArray(t))for(var s=0;s * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=new n({Extends:s,initialize:function(t,e,i,n){var r="js";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),r=a(o,"extension",r)}var l={type:"text",extension:r,responseType:"text",key:e,url:i,xhrSettings:n};s.call(this,t,l)},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t=this.data.concat("(function(){\nreturn new "+this.key+"();\n}).call(this);"),e=eval;this.loader.sceneManager.add(this.key,e(t)),this.complete=!0}});o.register("sceneFile",(function(t,e,i){if(Array.isArray(t))for(var n=0;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=new n({Extends:s,initialize:function(t,e,i,n,o,l){var c="js";if(h(e)){var u=e;e=a(u,"key"),i=a(u,"url"),l=a(u,"xhrSettings"),c=a(u,"extension",c),n=a(u,"systemKey"),o=a(u,"sceneKey")}var d={type:"scenePlugin",cache:!1,extension:c,responseType:"text",key:e,url:i,xhrSettings:l,config:{systemKey:n,sceneKey:o}};s.call(this,t,d),"function"==typeof i&&(this.data=i,this.state=r.FILE_POPULATED)},onProcess:function(){var t=this.loader.systems.plugins,e=this.config,i=this.key,n=a(e,"systemKey",i),s=a(e,"sceneKey",i);this.state===r.FILE_POPULATED?t.installScenePlugin(n,this.data,s,this.loader.scene,!0):(this.state=r.FILE_PROCESSING,this.data=document.createElement("script"),this.data.language="javascript",this.data.type="text/javascript",this.data.defer=!1,this.data.text=this.xhrLoader.responseText,document.head.appendChild(this.data),t.installScenePlugin(n,window[this.key],s,this.loader.scene,!0)),this.onProcessComplete()}});o.register("scenePlugin",(function(t,e,i,n,r){if(Array.isArray(t))for(var s=0;s * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(8),s=i(70),o=new n({Extends:s,initialize:function(t,e,i,n,r){s.call(this,t,e,i,r,n),this.type="spritesheet"},addToCache:function(){var t=this.cache.addSpriteSheet(this.key,this.data,this.config);this.pendingDestroy(t)}});r.register("spritesheet",(function(t,e,i,n){if(Array.isArray(t))for(var r=0;r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=new n({Extends:s,initialize:function(t,e,i,n,r){var o="svg";if(h(e)){var l=e;e=a(l,"key"),i=a(l,"url"),n=a(l,"svgConfig",{}),r=a(l,"xhrSettings"),o=a(l,"extension",o)}var c={type:"svg",cache:t.textureManager,extension:o,responseType:"text",key:e,url:i,xhrSettings:r,config:{width:a(n,"width"),height:a(n,"height"),scale:a(n,"scale")}};s.call(this,t,c)},onProcess:function(){this.state=r.FILE_PROCESSING;var t=this.xhrLoader.responseText,e=[t],i=this.config.width,n=this.config.height,o=this.config.scale;t:if(i&&n||o){var a=(new DOMParser).parseFromString(t,"text/xml").getElementsByTagName("svg")[0],h=a.hasAttribute("viewBox"),l=parseFloat(a.getAttribute("width")),c=parseFloat(a.getAttribute("height"));if(!h&&l&&c)a.setAttribute("viewBox","0 0 "+l+" "+c);else if(h&&!l&&!c){var u=a.getAttribute("viewBox").split(/\s+|,/);l=u[2],c=u[3]}if(o){if(!l||!c)break t;i=l*o,n=c*o}a.setAttribute("width",i.toString()+"px"),a.setAttribute("height",n.toString()+"px"),e=[(new XMLSerializer).serializeToString(a)]}try{var d=new window.Blob(e,{type:"image/svg+xml;charset=utf-8"})}catch(t){return void this.onProcessError()}this.data=new Image,this.data.crossOrigin=this.crossOrigin;var p=this,f=!1;this.data.onload=function(){f||s.revokeObjectURL(p.data),p.onProcessComplete()},this.data.onerror=function(){f?p.onProcessError():(f=!0,s.revokeObjectURL(p.data),p.data.src="data:image/svg+xml,"+encodeURIComponent(e.join("")))},s.createObjectURL(this.data,d,"image/svg+xml")},addToCache:function(){var t=this.cache.addImage(this.key,this.data);this.pendingDestroy(t)}});o.register("svg",(function(t,e,i,n){if(Array.isArray(t))for(var r=0;r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(20),s=i(23),o=i(8),a=i(2),h=i(7),l=i(39),c=new n({Extends:s,initialize:function(t,e,i,n){var r="csv";if(h(e)){var o=e;e=a(o,"key"),i=a(o,"url"),n=a(o,"xhrSettings"),r=a(o,"extension",r)}var c={type:"tilemapCSV",cache:t.cacheManager.tilemap,extension:r,responseType:"text",key:e,url:i,xhrSettings:n};s.call(this,t,c),this.tilemapFormat=l.CSV},onProcess:function(){this.state=r.FILE_PROCESSING,this.data=this.xhrLoader.responseText,this.onProcessComplete()},addToCache:function(){var t={format:this.tilemapFormat,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});o.register("tilemapCSV",(function(t,e,i){if(Array.isArray(t))for(var n=0;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(8),s=i(59),o=i(39),a=new n({Extends:s,initialize:function(t,e,i,n){s.call(this,t,e,i,n),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:o.WELTMEISTER,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});r.register("tilemapImpact",(function(t,e,i){if(Array.isArray(t))for(var n=0;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(8),s=i(59),o=i(39),a=new n({Extends:s,initialize:function(t,e,i,n){s.call(this,t,e,i,n),this.type="tilemapJSON",this.cache=t.cacheManager.tilemap},addToCache:function(){var t={format:o.TILED_JSON,data:this.data};this.cache.add(this.key,t),this.pendingDestroy(t)}});r.register("tilemapTiledJSON",(function(t,e,i){if(Array.isArray(t))for(var n=0;n * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(8),s=i(2),o=i(70),a=i(7),h=i(47),l=i(239),c=new n({Extends:h,initialize:function(t,e,i,n,r,c){var u,d;if(a(e)){var p=e;e=s(p,"key"),u=new o(t,{key:e,url:s(p,"textureURL"),extension:s(p,"textureExtension","png"),normalMap:s(p,"normalMap"),xhrSettings:s(p,"textureXhrSettings")}),d=new l(t,{key:e,url:s(p,"atlasURL"),extension:s(p,"atlasExtension","txt"),xhrSettings:s(p,"atlasXhrSettings")})}else u=new o(t,e,i,r),d=new l(t,e,n,c);u.linkFile?h.call(this,t,"unityatlas",e,[u,d,u.linkFile]):h.call(this,t,"unityatlas",e,[u,d])},addToCache:function(){if(this.isReadyToProcess()){var t=this.files[0],e=this.files[1],i=this.files[2]?this.files[2].data:null;this.loader.textureManager.addUnityAtlas(t.key,t.data,e.data,i),e.pendingDestroy(),this.complete=!0}}});r.register("unityAtlas",(function(t,e,i,n,r){var s;if(Array.isArray(t))for(var o=0;o * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(20),s=i(23),o=i(8),a=i(153),h=i(2),l=i(7),c=new n({Extends:s,initialize:function(t,e,i,n,r,o,a){void 0===n&&(n="loadeddata"),void 0===r&&(r=!1),void 0===o&&(o=!1),"loadeddata"!==n&&"canplay"!==n&&"canplaythrough"!==n&&(n="loadeddata");var h={type:"video",cache:t.cacheManager.video,extension:i.type,responseType:"blob",key:e,url:i.url,xhrSettings:a,config:{loadEvent:n,asBlob:r,noAudio:o}};this.onLoadCallback=this.onVideoLoadHandler.bind(this),this.onErrorCallback=this.onVideoErrorHandler.bind(this),s.call(this,t,h)},onProcess:function(){if(this.state=r.FILE_PROCESSING,this.config.asBlob){var t=this.createVideoElement();this.data=t;var e=this;this.data.onloadeddata=function(){e.onProcessComplete()},this.data.onerror=function(){s.revokeObjectURL(e.data),e.onProcessError()},s.createObjectURL(t,this.xhrLoader.response,""),t.load()}else this.onProcessComplete()},createVideoElement:function(){var t=document.createElement("video");return t.controls=!1,t.crossOrigin=this.loader.crossOrigin,this.config.noAudio&&(t.muted=!0,t.defaultMuted=!0,t.setAttribute("autoplay","autoplay")),t.setAttribute("playsinline","playsinline"),t.setAttribute("preload","auto"),t},onVideoLoadHandler:function(t){var e=t.target;e.removeEventListener(this.config.loadEvent,this.onLoadCallback,!0),e.removeEventListener("error",this.onErrorCallback,!0),this.data=e,this.resetXHR(),this.loader.nextFile(this,!0)},onVideoErrorHandler:function(t){var e=t.target;e&&(e.removeEventListener(this.config.loadEvent,this.onLoadCallback,!0),e.removeEventListener("error",this.onErrorCallback,!0)),this.resetXHR(),this.loader.nextFile(this,!1)},load:function(){var t=this.config.loadEvent;if(this.config.asBlob)s.prototype.load.call(this);else{this.percentComplete=0;var e=this.createVideoElement();e.addEventListener(t,this.onLoadCallback,!0),e.addEventListener("error",this.onErrorCallback,!0),e.src=a(this,this.loader.baseURL),e.load()}}});c.create=function(t,e,i,n,r,s,o){var a=t.systems.game;l(e)&&(i=h(e,"url",[]),n=h(e,"loadEvent","loadeddata"),r=h(e,"asBlob",!1),s=h(e,"noAudio",!1),o=h(e,"xhrSettings"));var u=c.getVideoURL(a,i);if(u)return new c(t,e,u,n,r,s,o)},c.getVideoURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(20),s=i(148),o=i(9),a=i(91),h=i(8),l=i(2),c=i(24),u=i(21),d=i(154),p=new n({Extends:o,initialize:function(t){o.call(this);var e=t.sys.game.config,i=t.sys.settings.loader;this.scene=t,this.systems=t.sys,this.cacheManager=t.sys.cache,this.textureManager=t.sys.textures,this.sceneManager=t.sys.game.scene,h.install(this),this.prefix="",this.path="",this.baseURL="",this.setBaseURL(l(i,"baseURL",e.loaderBaseURL)),this.setPath(l(i,"path",e.loaderPath)),this.setPrefix(l(i,"prefix",e.loaderPrefix)),this.maxParallelDownloads=l(i,"maxParallelDownloads",e.loaderMaxParallelDownloads),this.xhr=d(l(i,"responseType",e.loaderResponseType),l(i,"async",e.loaderAsync),l(i,"user",e.loaderUser),l(i,"password",e.loaderPassword),l(i,"timeout",e.loaderTimeout),l(i,"withCredentials",e.loaderWithCredentials)),this.crossOrigin=l(i,"crossOrigin",e.loaderCrossOrigin),this.totalToLoad=0,this.progress=0,this.list=new s,this.inflight=new s,this.queue=new s,this._deleteQueue=new s,this.totalFailed=0,this.totalComplete=0,this.state=r.LOADER_IDLE,this.multiKeyIndex=0,t.sys.events.once(u.BOOT,this.boot,this),t.sys.events.on(u.START,this.pluginStart,this)},boot:function(){this.systems.events.once(u.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(u.SHUTDOWN,this.shutdown,this)},setBaseURL:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.baseURL=t,this},setPath:function(t){return void 0===t&&(t=""),""!==t&&"/"!==t.substr(-1)&&(t=t.concat("/")),this.path=t,this},setPrefix:function(t){return void 0===t&&(t=""),this.prefix=t,this},setCORS:function(t){return this.crossOrigin=t,this},addFile:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e0},isLoading:function(){return this.state===r.LOADER_LOADING||this.state===r.LOADER_PROCESSING},isReady:function(){return this.state===r.LOADER_IDLE||this.state===r.LOADER_COMPLETE},start:function(){this.isReady()&&(this.progress=0,this.totalFailed=0,this.totalComplete=0,this.totalToLoad=this.list.size,this.emit(a.START,this),0===this.list.size?this.loadComplete():(this.state=r.LOADER_LOADING,this.inflight.clear(),this.queue.clear(),this.updateProgress(),this.checkLoadQueue(),this.systems.events.on(u.UPDATE,this.update,this)))},updateProgress:function(){this.progress=1-(this.list.size+this.inflight.size)/this.totalToLoad,this.emit(a.PROGRESS,this.progress)},update:function(){this.state===r.LOADER_LOADING&&this.list.size>0&&this.inflight.size * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(60),r=i(17),s={ArcadePhysics:i(1361),Body:i(521),Collider:i(522),Components:i(240),Events:i(242),Factory:i(515),GetOverlapX:i(243),GetOverlapY:i(244),SeparateX:i(531),SeparateY:i(532),Group:i(518),Image:i(516),Sprite:i(155),StaticBody:i(533),StaticGroup:i(519),Tilemap:i(1385),World:i(520)};s=r(!1,s,n),t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(35),s=i(48),o=i(347),a=i(515),h=i(2),l=i(143),c=i(517),u=i(241),d=i(24),p=i(21),f=i(3),m=i(520),g=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,t.sys.events.once(p.BOOT,this.boot,this),t.sys.events.on(p.START,this.start,this)},boot:function(){this.world=new m(this.scene,this.config),this.add=new a(this.world),this.systems.events.once(p.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new m(this.scene,this.config),this.add=new a(this.world));var t=this.systems.events;h(this.config,"customUpdate",!1)||t.on(p.UPDATE,this.world.update,this.world),t.on(p.POST_UPDATE,this.world.postUpdate,this.world),t.once(p.SHUTDOWN,this.shutdown,this)},enableUpdate:function(){this.systems.events.on(p.UPDATE,this.world.update,this.world)},disableUpdate:function(){this.systems.events.off(p.UPDATE,this.world.update,this.world)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return l(h(e,"arcade",{}),h(t,"arcade",{}))},overlap:function(t,e,i,n,r){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=i),this.world.collideObjects(t,e,i,n,r,!0)},collide:function(t,e,i,n,r){return void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=i),this.world.collideObjects(t,e,i,n,r,!1)},collideTiles:function(t,e,i,n,r){return this.world.collideTiles(t,e,i,n,r)},overlapTiles:function(t,e,i,n,r){return this.world.overlapTiles(t,e,i,n,r)},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},accelerateTo:function(t,e,i,n,r,s){void 0===n&&(n=60);var o=Math.atan2(i-t.y,e-t.x);return t.body.acceleration.setToPolar(o,n),void 0!==r&&void 0!==s&&t.body.maxVelocity.set(r,s),o},accelerateToObject:function(t,e,i,n,r){return this.accelerateTo(t,e.x,e.y,i,n,r)},closest:function(t,e){e||(e=this.world.bodies.entries);for(var i=Number.MAX_VALUE,n=null,r=t.x,s=t.y,a=e.length,h=0;hi&&(n=l,i=u)}}return n},moveTo:function(t,e,i,n,r){void 0===n&&(n=60),void 0===r&&(r=0);var o=Math.atan2(i-t.y,e-t.x);return r>0&&(n=s(t.x,t.y,e,i)/(r/1e3)),t.body.velocity.setToPolar(o,n),o},moveToObject:function(t,e,i,n){return this.moveTo(t,e.x,e.y,i,n)},velocityFromAngle:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(r(t),e)},velocityFromRotation:function(t,e,i){return void 0===e&&(e=60),void 0===i&&(i=new f),i.setToPolar(t,e)},overlapRect:function(t,e,i,n,r,s){return u(this.world,t,e,i,n,r,s)},overlapCirc:function(t,e,i,n,r){return c(this.world,t,e,i,n,r)},shutdown:function(){if(this.world){var t=this.systems.events;t.off(p.UPDATE,this.world.update,this.world),t.off(p.POST_UPDATE,this.world.postUpdate,this.world),t.off(p.SHUTDOWN,this.shutdown,this),this.add.destroy(),this.world.destroy(),this.add=null,this.world=null}},destroy:function(){this.shutdown(),this.scene.sys.events.off(p.START,this.start,this),this.scene=null,this.systems=null}});d.register("ArcadePhysics",g,"arcadePhysics"),t.exports=g},function(t,e){t.exports={setAcceleration:function(t,e){return this.body.acceleration.set(t,e),this},setAccelerationX:function(t){return this.body.acceleration.x=t,this},setAccelerationY:function(t){return this.body.acceleration.y=t,this}}},function(t,e){t.exports={setAngularVelocity:function(t){return this.body.angularVelocity=t,this},setAngularAcceleration:function(t){return this.body.angularAcceleration=t,this},setAngularDrag:function(t){return this.body.angularDrag=t,this}}},function(t,e){t.exports={setBounce:function(t,e){return this.body.bounce.set(t,e),this},setBounceX:function(t){return this.body.bounce.x=t,this},setBounceY:function(t){return this.body.bounce.y=t,this},setCollideWorldBounds:function(t,e,i){return this.body.setCollideWorldBounds(t,e,i),this}}},function(t,e){t.exports={setDebug:function(t,e,i){return this.debugShowBody=t,this.debugShowVelocity=e,this.debugBodyColor=i,this},setDebugBodyColor:function(t){return this.body.debugBodyColor=t,this},debugShowBody:{get:function(){return this.body.debugShowBody},set:function(t){this.body.debugShowBody=t}},debugShowVelocity:{get:function(){return this.body.debugShowVelocity},set:function(t){this.body.debugShowVelocity=t}},debugBodyColor:{get:function(){return this.body.debugBodyColor},set:function(t){this.body.debugBodyColor=t}}}},function(t,e){t.exports={setDrag:function(t,e){return this.body.drag.set(t,e),this},setDragX:function(t){return this.body.drag.x=t,this},setDragY:function(t){return this.body.drag.y=t,this},setDamping:function(t){return this.body.useDamping=t,this}}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i={enableBody:function(t,e,i,n,r){return t&&this.body.reset(e,i),n&&(this.body.gameObject.active=!0),r&&(this.body.gameObject.visible=!0),this.body.enable=!0,this},disableBody:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.body.stop(),this.body.enable=!1,t&&(this.body.gameObject.active=!1),e&&(this.body.gameObject.visible=!1),this},refreshBody:function(){return this.body.updateFromGameObject(),this}};t.exports=i},function(t,e){t.exports={setFriction:function(t,e){return this.body.friction.set(t,e),this},setFrictionX:function(t){return this.body.friction.x=t,this},setFrictionY:function(t){return this.body.friction.y=t,this}}},function(t,e){t.exports={setGravity:function(t,e){return this.body.gravity.set(t,e),this},setGravityX:function(t){return this.body.gravity.x=t,this},setGravityY:function(t){return this.body.gravity.y=t,this}}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i={setImmovable:function(t){return void 0===t&&(t=!0),this.body.immovable=t,this}};t.exports=i},function(t,e){t.exports={setMass:function(t){return this.body.mass=t,this}}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i={setPushable:function(t){return void 0===t&&(t=!0),this.body.pushable=t,this}};t.exports=i},function(t,e){t.exports={setOffset:function(t,e){return this.body.setOffset(t,e),this},setSize:function(t,e,i){return this.body.setSize(t,e,i),this},setBodySize:function(t,e,i){return this.body.setSize(t,e,i),this},setCircle:function(t,e,i){return this.body.setCircle(t,e,i),this}}},function(t,e){t.exports={setVelocity:function(t,e){return this.body.setVelocity(t,e),this},setVelocityX:function(t){return this.body.setVelocityX(t),this},setVelocityY:function(t){return this.body.setVelocityY(t),this},setMaxVelocity:function(t,e){return this.body.maxVelocity.set(t,e),this}}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="collide"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="overlap"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pause"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="resume"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="tilecollide"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="tileoverlap"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="worldbounds"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="worldstep"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i,n,r,s,o,a,h,l,c,u,d,p,f,m,g,v,y,x=function(){return u&&g&&n.blocked.right?(i.processX(-y,h,!1,!0),1):c&&v&&n.blocked.left?(i.processX(y,h,!0),1):f&&v&&i.blocked.right?(n.processX(-y,l,!1,!0),2):p&&g&&i.blocked.left?(n.processX(y,l,!0),2):0},b=function(t){if(r&&s)y*=.5,0===t||3===t?(i.processX(y,o),n.processX(-y,a)):(i.processX(-y,o),n.processX(y,a));else if(r&&!s)0===t||3===t?i.processX(y,h,!0):i.processX(-y,h,!1,!0);else if(!r&&s)0===t||3===t?n.processX(-y,l,!1,!0):n.processX(y,l,!0);else{var e=.5*y;0===t?m?(i.processX(y,0,!0),n.processX(0,null,!1,!0)):f?(i.processX(e,0,!0),n.processX(-e,0,!1,!0)):(i.processX(e,n.velocity.x,!0),n.processX(-e,null,!1,!0)):1===t?d?(i.processX(0,null,!1,!0),n.processX(y,0,!0)):u?(i.processX(-e,0,!1,!0),n.processX(e,0,!0)):(i.processX(-e,null,!1,!0),n.processX(e,i.velocity.x,!0)):2===t?m?(i.processX(-y,0,!1,!0),n.processX(0,null,!0)):p?(i.processX(-e,0,!1,!0),n.processX(e,0,!0)):(i.processX(-e,n.velocity.x,!1,!0),n.processX(e,null,!0)):3===t&&(d?(i.processX(0,null,!0),n.processX(-y,0,!1,!0)):c?(i.processX(e,0,!0),n.processX(-e,0,!1,!0)):(i.processX(e,n.velocity.y,!0),n.processX(-e,null,!1,!0)))}return!0};t.exports={BlockCheck:x,Check:function(){var t=i.velocity.x,e=n.velocity.x,r=Math.sqrt(e*e*n.mass/i.mass)*(e>0?1:-1),s=Math.sqrt(t*t*i.mass/n.mass)*(t>0?1:-1),h=.5*(r+s);return s-=h,o=h+(r-=h)*i.bounce.x,a=h+s*n.bounce.x,c&&v?b(0):p&&g?b(1):u&&g?b(2):!(!f||!v)&&b(3)},Set:function(t,e,o){n=e;var a=(i=t).velocity.x,b=n.velocity.x;return r=i.pushable,c=i._dx<0,u=i._dx>0,d=0===i._dx,g=Math.abs(i.right-n.x)<=Math.abs(n.right-i.x),h=b-a*i.bounce.x,s=n.pushable,p=n._dx<0,f=n._dx>0,m=0===n._dx,v=!g,l=a-b*n.bounce.x,y=Math.abs(o),x()},Run:b,RunImmovableBody1:function(t){1===t?n.velocity.x=0:g?n.processX(y,l,!0):n.processX(-y,l,!1,!0),i.moves&&(n.y+=(i.y-i.prev.y)*i.friction.y,n._dy=n.y-n.prev.y)},RunImmovableBody2:function(t){2===t&&(i.velocity.x=0),v?i.processX(y,h,!0):i.processX(-y,h,!1,!0),n.moves&&(i.y+=(n.y-n.prev.y)*n.friction.y,i._dy=i.y-i.prev.y)}}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i,n,r,s,o,a,h,l,c,u,d,p,f,m,g,v,y,x=function(){return u&&g&&n.blocked.down?(i.processY(-y,h,!1,!0),1):c&&v&&n.blocked.up?(i.processY(y,h,!0),1):f&&v&&i.blocked.down?(n.processY(-y,l,!1,!0),2):p&&g&&i.blocked.up?(n.processY(y,l,!0),2):0},b=function(t){if(r&&s)y*=.5,0===t||3===t?(i.processY(y,o),n.processY(-y,a)):(i.processY(-y,o),n.processY(y,a));else if(r&&!s)0===t||3===t?i.processY(y,h,!0):i.processY(-y,h,!1,!0);else if(!r&&s)0===t||3===t?n.processY(-y,l,!1,!0):n.processY(y,l,!0);else{var e=.5*y;0===t?m?(i.processY(y,0,!0),n.processY(0,null,!1,!0)):f?(i.processY(e,0,!0),n.processY(-e,0,!1,!0)):(i.processY(e,n.velocity.y,!0),n.processY(-e,null,!1,!0)):1===t?d?(i.processY(0,null,!1,!0),n.processY(y,0,!0)):u?(i.processY(-e,0,!1,!0),n.processY(e,0,!0)):(i.processY(-e,null,!1,!0),n.processY(e,i.velocity.y,!0)):2===t?m?(i.processY(-y,0,!1,!0),n.processY(0,null,!0)):p?(i.processY(-e,0,!1,!0),n.processY(e,0,!0)):(i.processY(-e,n.velocity.y,!1,!0),n.processY(e,null,!0)):3===t&&(d?(i.processY(0,null,!0),n.processY(-y,0,!1,!0)):c?(i.processY(e,0,!0),n.processY(-e,0,!1,!0)):(i.processY(e,n.velocity.y,!0),n.processY(-e,null,!1,!0)))}return!0};t.exports={BlockCheck:x,Check:function(){var t=i.velocity.y,e=n.velocity.y,r=Math.sqrt(e*e*n.mass/i.mass)*(e>0?1:-1),s=Math.sqrt(t*t*i.mass/n.mass)*(t>0?1:-1),h=.5*(r+s);return s-=h,o=h+(r-=h)*i.bounce.y,a=h+s*n.bounce.y,c&&v?b(0):p&&g?b(1):u&&g?b(2):!(!f||!v)&&b(3)},Set:function(t,e,o){n=e;var a=(i=t).velocity.y,b=n.velocity.y;return r=i.pushable,c=i._dy<0,u=i._dy>0,d=0===i._dy,g=Math.abs(i.bottom-n.y)<=Math.abs(n.bottom-i.y),h=b-a*i.bounce.y,s=n.pushable,p=n._dy<0,f=n._dy>0,m=0===n._dy,v=!g,l=a-b*n.bounce.y,y=Math.abs(o),x()},Run:b,RunImmovableBody1:function(t){1===t?n.velocity.y=0:g?n.processY(y,l,!0):n.processY(-y,l,!1,!0),i.moves&&(n.x+=(i.x-i.prev.x)*i.friction.x,n._dx=n.x-n.prev.x)},RunImmovableBody2:function(t){2===t?i.velocity.y=0:v?i.processY(y,h,!0):i.processY(-y,h,!1,!0),n.moves&&(i.x+=(n.x-n.prev.x)*n.friction.x,i._dx=i.x-i.prev.x)}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n={ProcessTileCallbacks:i(524),ProcessTileSeparationX:i(528),ProcessTileSeparationY:i(530),SeparateTile:i(526),TileCheckX:i(527),TileCheckY:i(529),TileIntersectsBody:i(245)};t.exports=n},function(t,e,i){ /** * @author Joachim Grill * @author Richard Davey * @copyright 2018 CodeAndWeb GmbH * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(126),r=i(71),s=i(50),o=i(2),a=i(94),h={parseBody:function(t,e,i,n){void 0===n&&(n={});for(var a=o(i,"fixtures",[]),h=[],l=0;l * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(126),r=i(71),s={parseBody:function(t,e,i,s){var o;void 0===s&&(s={});var a=i.vertices;if(1===a.length)s.vertices=a[0],o=r.create(s),n.flagCoincidentParts(o.parts);else{for(var h=[],l=0;lm&&(m=y),a.translate(v,{x:.5*x,y:.5*y}),u=v.bounds.max.x+s,r.addBody(c,v),l=v,p+=1}else u+=s}d+=m+o,u=t}return c},n.chain=function(t,e,i,n,a,h){for(var l=t.bodies,c=1;c0)for(l=0;l0&&(d=p[l-1+(h-1)*e],r.addConstraint(t,s.create(o.extend({bodyA:d,bodyB:u},a)))),n&&ld||o<(l=d-l)||o>i-1-l))return 1===u&&a.translate(c,{x:(o+(i%2==1?1:-1))*p,y:0}),h(t+(c?o*p:0)+o*s,n,o,l,c,u)}))},n.newtonsCradle=function(t,e,i,n,o){for(var a=r.create({label:"Newtons Cradle"}),l=0;l1;if(!d||t!=d.x||e!=d.y){d&&n?(p=d.x,f=d.y):(p=0,f=0);var r={x:p+t,y:f+e};!n&&d||(d=r),m.push(r),v=p+t,y=f+e}},b=function(t){var e=t.pathSegTypeAsLetter.toUpperCase();if("Z"!==e){switch(e){case"M":case"L":case"T":case"C":case"S":case"Q":v=t.x,y=t.y;break;case"H":v=t.x;break;case"V":y=t.y}x(v,y,t.pathSegType)}};for(n._svgPathToAbsolute(t),o=t.getTotalLength(),l=[],i=0;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(126),r=i(71),s=i(0),o=i(534),a=i(9),h=i(2),l=i(125),c=i(94),u=new s({Extends:a,Mixins:[o.Bounce,o.Collision,o.Friction,o.Gravity,o.Mass,o.Sensor,o.Sleep,o.Static],initialize:function(t,e,i){a.call(this),this.tile=e,this.world=t,e.physics.matterBody&&e.physics.matterBody.destroy(),e.physics.matterBody=this;var n=h(i,"body",null),r=h(i,"addToWorld",!0);if(n)this.setBody(n,r);else{var s=e.getCollisionGroup();h(s,"objects",[]).length>0?this.setFromTileCollision(i):this.setFromTileRectangle(i)}},setFromTileRectangle:function(t){void 0===t&&(t={}),l(t,"isStatic")||(t.isStatic=!0),l(t,"addToWorld")||(t.addToWorld=!0);var e=this.tile.getBounds(),i=e.x+e.width/2,r=e.y+e.height/2,s=n.rectangle(i,r,e.width,e.height,t);return this.setBody(s,t.addToWorld),this},setFromTileCollision:function(t){void 0===t&&(t={}),l(t,"isStatic")||(t.isStatic=!0),l(t,"addToWorld")||(t.addToWorld=!0);for(var e=this.tile.tilemapLayer.scaleX,i=this.tile.tilemapLayer.scaleY,s=this.tile.getLeft(),o=this.tile.getTop(),a=this.tile.getCollisionGroup(),u=h(a,"objects",[]),d=[],p=0;p1&&(t.parts=d,this.setBody(r.create(t),t.addToWorld)),this},setBody:function(t,e){return void 0===e&&(e=!0),this.body&&this.removeBody(),this.body=t,this.body.gameObject=this,e&&this.world.add(this.body),this},removeBody:function(){return this.body&&(this.world.remove(this.body),this.body.gameObject=void 0,this.body=void 0),this},destroy:function(){this.removeBody(),this.tile.physics.matterBody=void 0,this.removeAllListeners()}});t.exports=u},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1493);n.Body=i(71),n.Composite=i(163),n.World=i(1393),n.Detector=i(587),n.Grid=i(1394),n.Pairs=i(1395),n.Pair=i(535),n.Query=i(1494),n.Resolver=i(1396),n.SAT=i(588),n.Constraint=i(246),n.Common=i(50),n.Engine=i(1495),n.Events=i(268),n.Sleeping=i(267),n.Plugin=i(1392),n.Bodies=i(126),n.Composites=i(1388),n.Axes=i(585),n.Bounds=i(117),n.Svg=i(1389),n.Vector=i(116),n.Vertices=i(94),n.World.add=n.Composite.add,n.World.remove=n.Composite.remove,n.World.addComposite=n.Composite.addComposite,n.World.addBody=n.Composite.addBody,n.World.addConstraint=n.Composite.addConstraint,n.World.clear=n.Composite.clear,t.exports=n},function(t,e,i){var n={};t.exports=n;var r=i(50);n._registry={},n.register=function(t){if(n.isPlugin(t)||r.warn("Plugin.register:",n.toString(t),"does not implement all required fields."),t.name in n._registry){var e=n._registry[t.name],i=n.versionParse(t.version).number,s=n.versionParse(e.version).number;i>s?(r.warn("Plugin.register:",n.toString(e),"was upgraded to",n.toString(t)),n._registry[t.name]=t):i-1},n.isFor=function(t,e){var i=t.for&&n.dependencyParse(t.for);return!t.for||e.name===i.name&&n.versionSatisfies(e.version,i.range)},n.use=function(t,e){if(t.uses=(t.uses||[]).concat(e||[]),0!==t.uses.length){for(var i=n.dependencies(t),s=r.topologicalSort(i),o=[],a=0;a0&&!h.silent&&r.info(o.join(" "))}else r.warn("Plugin.use:",n.toString(t),"does not specify any dependencies to install.")},n.dependencies=function(t,e){var i=n.dependencyParse(t),s=i.name;if(!(s in(e=e||{}))){t=n.resolve(t)||t,e[s]=r.map(t.uses||[],(function(e){n.isPlugin(e)&&n.register(e);var s=n.dependencyParse(e),o=n.resolve(e);return o&&!n.versionSatisfies(o.version,s.range)?(r.warn("Plugin.dependencies:",n.toString(o),"does not satisfy",n.toString(s),"used by",n.toString(i)+"."),o._warned=!0,t._warned=!0):o||(r.warn("Plugin.dependencies:",n.toString(e),"used by",n.toString(i),"could not be resolved."),t._warned=!0),s.name}));for(var o=0;o=r[2];if("^"===i.operator)return r[0]>0?o[0]===r[0]&&s.number>=i.number:r[1]>0?o[1]===r[1]&&o[2]>=r[2]:o[2]===r[2]}return t===e||"*"===t}},function(t,e,i){var n={};t.exports=n;var r=i(163),s=(i(246),i(50));n.create=function(t){var e=r.create(),i={label:"World",gravity:{x:0,y:1,scale:.001},bounds:{min:{x:-1/0,y:-1/0},max:{x:1/0,y:1/0}}};return s.extend(e,i,t)}},function(t,e,i){var n={};t.exports=n;var r=i(535),s=i(587),o=i(50);n.create=function(t){var e={controller:n,detector:s.collisions,buckets:{},pairs:{},pairsList:[],bucketWidth:48,bucketHeight:48};return o.extend(e,t)},n.update=function(t,e,i,r){var s,o,a,h,l,c=i.world,u=t.buckets,d=!1,p=i.metrics;for(p.broadphaseTests=0,s=0;sc.bounds.max.x||f.bounds.max.yc.bounds.max.y)){var m=n._getRegion(t,f);if(!f.region||m.id!==f.region.id||r){p.broadphaseTests+=1,f.region&&!r||(f.region=m);var g=n._regionUnion(m,f.region);for(o=g.startCol;o<=g.endCol;o++)for(a=g.startRow;a<=g.endRow;a++){h=u[l=n._getBucketId(o,a)];var v=o>=m.startCol&&o<=m.endCol&&a>=m.startRow&&a<=m.endRow,y=o>=f.region.startCol&&o<=f.region.endCol&&a>=f.region.startRow&&a<=f.region.endRow;!v&&y&&y&&h&&n._bucketRemoveBody(t,h,f),(f.region===m||v&&!y||r)&&(h||(h=n._createBucket(u,l)),n._bucketAddBody(t,h,f))}f.region=m,d=!0}}}d&&(t.pairsList=n._createActivePairsList(t))},n.clear=function(t){t.buckets={},t.pairs={},t.pairsList=[]},n._regionUnion=function(t,e){var i=Math.min(t.startCol,e.startCol),r=Math.max(t.endCol,e.endCol),s=Math.min(t.startRow,e.startRow),o=Math.max(t.endRow,e.endRow);return n._createRegion(i,r,s,o)},n._getRegion=function(t,e){var i=e.bounds,r=Math.floor(i.min.x/t.bucketWidth),s=Math.floor(i.max.x/t.bucketWidth),o=Math.floor(i.min.y/t.bucketHeight),a=Math.floor(i.max.y/t.bucketHeight);return n._createRegion(r,s,o,a)},n._createRegion=function(t,e,i,n){return{id:t+","+e+","+i+","+n,startCol:t,endCol:e,startRow:i,endRow:n}},n._getBucketId=function(t,e){return"C"+t+"R"+e},n._createBucket=function(t,e){return t[e]=[]},n._bucketAddBody=function(t,e,i){for(var n=0;n0?n.push(i):delete t.pairs[e[r]];return n}},function(t,e,i){var n={};t.exports=n;var r=i(535),s=i(50);n._pairMaxIdleLife=1e3,n.create=function(t){return s.extend({table:{},list:[],collisionStart:[],collisionActive:[],collisionEnd:[]},t)},n.update=function(t,e,i){var n,s,o,a,h=t.list,l=t.table,c=t.collisionStart,u=t.collisionEnd,d=t.collisionActive;for(c.length=0,u.length=0,d.length=0,a=0;an._pairMaxIdleLife&&l.push(o);for(o=0;op.friction*p.frictionStatic*I*i&&(B=L,F=o.clamp(p.friction*O*i,-B,B));var k=s.cross(E,v),N=s.cross(S,v),U=b/(m.inverseMass+g.inverseMass+m.inverseInertia*k*k+g.inverseInertia*N*N);if(D*=U,F*=U,P<0&&P*P>n._restingThresh*i)T.normalImpulse=0;else{var z=T.normalImpulse;T.normalImpulse=Math.min(T.normalImpulse+D,0),D=T.normalImpulse-z}if(R*R>n._restingThreshTangent*i)T.tangentImpulse=0;else{var G=T.tangentImpulse;T.tangentImpulse=o.clamp(T.tangentImpulse+F,-B,B),F=T.tangentImpulse-G}r.x=v.x*D+y.x*F,r.y=v.y*D+y.y*F,m.isStatic||m.isSleeping||(m.positionPrev.x+=r.x*m.inverseMass,m.positionPrev.y+=r.y*m.inverseMass,m.anglePrev+=s.cross(E,r)*m.inverseInertia),g.isStatic||g.isSleeping||(g.positionPrev.x-=r.x*g.inverseMass,g.positionPrev.y-=r.y*g.inverseMass,g.anglePrev-=s.cross(S,r)*g.inverseInertia)}}}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={BasePlugin:i(536),DefaultPlugins:i(194),PluginCache:i(24),PluginManager:i(408),ScenePlugin:i(1398)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://github.com/photonstorm/phaser3-plugin-template/blob/master/LICENSE|MIT License} */ var n=i(536),r=i(0),s=i(21),o=new r({Extends:n,initialize:function(t,e){n.call(this,e),this.scene=t,this.systems=t.sys,t.sys.events.once(s.BOOT,this.boot,this)},boot:function(){},destroy:function(){this.pluginManager=null,this.game=null,this.scene=null,this.systems=null}});t.exports=o},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Canvas:i(1400),Events:i(88),Snapshot:i(1401),WebGL:i(1402)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={CanvasRenderer:i(362),GetBlendModes:i(364),SetTransform:i(30)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Canvas:i(363),WebGL:i(377)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(104),r=i(17),s={PipelineManager:i(366),Pipelines:i(1403),RenderTarget:i(139),Utils:i(12),WebGLPipeline:i(57),WebGLRenderer:i(365),WebGLShader:i(369)};s=r(!1,s,n),t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(65),r=i(17),s={BitmapMaskPipeline:i(367),Events:i(368),GraphicsPipeline:i(370),LightPipeline:i(371),MultiPipeline:i(105),PointLightPipeline:i(372),PostFXPipeline:i(1404),RopePipeline:i(373),SinglePipeline:i(374),UtilityPipeline:i(375)};s=r(!1,s,n),t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(195),s=i(2),o=i(1405),a=i(376),h=i(57),l=new n({Extends:h,initialize:function(t){t.renderTarget=s(t,"renderTarget",1),t.fragShader=s(t,"fragShader",o),t.vertShader=s(t,"vertShader",a),t.attributes=s(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2}]),t.batchSize=1,t.vertices=[-1,-1,0,0,-1,1,0,1,1,1,1,1,-1,-1,0,0,1,1,1,1,1,-1,1,0],h.call(this,t),this.isPostFX=!0,this.gameObject,this.colorMatrix=new r,this.fullFrame1,this.fullFrame2,this.halfFrame1,this.halfFrame2,this.renderer.isBooted&&(this.manager=this.renderer.pipelines,this.boot())},boot:function(){h.prototype.boot.call(this);var t=this.manager.UTILITY_PIPELINE;this.fullFrame1=t.fullFrame1,this.fullFrame2=t.fullFrame2,this.halfFrame1=t.halfFrame1,this.halfFrame2=t.halfFrame2,this.set1i("uMainSampler",0)},onDraw:function(t){this.bindAndDraw(t)},copyFrame:function(t,e,i,n,r){this.manager.copyFrame(t,e,i,n,r)},copyToGame:function(t){this.manager.copyToGame(t)},drawFrame:function(t,e,i){this.manager.drawFrame(t,e,i,this.colorMatrix)},blendFrames:function(t,e,i,n,r){this.manager.blendFrames(t,e,i,n,r)},blendFramesAdditive:function(t,e,i,n,r){this.manager.blendFramesAdditive(t,e,i,n,r)},clearFrame:function(t,e){this.manager.clearFrame(t,e)},blitFrame:function(t,e,i,n,r,s){this.manager.blitFrame(t,e,i,n,r,s)},copyFrameRect:function(t,e,i,n,r,s,o,a){this.manager.copyFrameRect(t,e,i,n,r,s,o,a)},bindAndDraw:function(t,e,i,n,r){void 0===i&&(i=!0),void 0===n&&(n=!0);var s=this.gl,o=this.renderer;this.bind(r),this.set1i("uMainSampler",0),e?(s.viewport(0,0,e.width,e.height),s.bindFramebuffer(s.FRAMEBUFFER,e.framebuffer),s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,e.texture,0),i&&(n?s.clearColor(0,0,0,0):s.clearColor(0,0,0,1),s.clear(s.COLOR_BUFFER_BIT))):(o.popFramebuffer(!1,!1,!1),o.currentFramebuffer||s.viewport(0,0,o.width,o.height)),s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,t.texture),s.bufferData(s.ARRAY_BUFFER,this.vertexData,s.STATIC_DRAW),s.drawArrays(s.TRIANGLES,0,6),e?(s.bindTexture(s.TEXTURE_2D,null),s.bindFramebuffer(s.FRAMEBUFFER,null)):o.resetTextures()}});t.exports=l},function(t,e){t.exports=["#define SHADER_NAME PHASER_POSTFX_FS","","precision mediump float;","","uniform sampler2D uMainSampler;","","varying vec2 outTexCoord;","","void main ()","{"," gl_FragColor = texture2D(uMainSampler, outTexCoord);","}",""].join("\n")},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(17),r=i(198),s={Center:i(397),Events:i(101),Orientation:i(398),ScaleManager:i(409),ScaleModes:i(399),Zoom:i(400)};s=n(!1,s,r.CENTER),s=n(!1,s,r.ORIENTATION),s=n(!1,s,r.SCALE_MODE),s=n(!1,s,r.ZOOM),t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(142),r=i(17),s={Events:i(21),GetPhysicsPlugins:i(413),GetScenePlugins:i(414),SceneManager:i(411),ScenePlugin:i(1408),Settings:i(415),Systems:i(201)};s=r(!1,s,n),t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(18),r=i(0),s=i(21),o=i(2),a=i(24),h=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.settings=t.sys.settings,this.key=t.sys.settings.key,this.manager=t.sys.game.scene,this.transitionProgress=0,this._elapsed=0,this._target=null,this._duration=0,this._onUpdate,this._onUpdateScope,this._willSleep=!1,this._willRemove=!1,t.sys.events.once(s.BOOT,this.boot,this),t.sys.events.on(s.START,this.pluginStart,this)},boot:function(){this.systems.events.once(s.DESTROY,this.destroy,this)},pluginStart:function(){this._target=null,this.systems.events.once(s.SHUTDOWN,this.shutdown,this)},start:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",this.key),this.manager.queueOp("start",t,e),this},restart:function(t){var e=this.key;return this.manager.queueOp("stop",e),this.manager.queueOp("start",e,t),this},transition:function(t){void 0===t&&(t={});var e=o(t,"target",!1),i=this.manager.getScene(e);if(!e||!this.checkValidTransition(i))return!1;var n=o(t,"duration",1e3);this._elapsed=0,this._target=i,this._duration=n,this._willSleep=o(t,"sleep",!1),this._willRemove=o(t,"remove",!1);var r=o(t,"onUpdate",null);r&&(this._onUpdate=r,this._onUpdateScope=o(t,"onUpdateScope",this.scene));var a=o(t,"allowInput",!1);this.settings.transitionAllowInput=a;var h=i.sys.settings;return h.isTransition=!0,h.transitionFrom=this.scene,h.transitionDuration=n,h.transitionAllowInput=a,o(t,"moveAbove",!1)?this.manager.moveAbove(this.key,e):o(t,"moveBelow",!1)&&this.manager.moveBelow(this.key,e),i.sys.isSleeping()?i.sys.wake(o(t,"data")):this.manager.start(e,o(t,"data")),this.systems.events.emit(s.TRANSITION_OUT,i,n),this.systems.events.on(s.UPDATE,this.step,this),!0},checkValidTransition:function(t){return!(!t||t.sys.isActive()||t.sys.isTransitioning()||t===this.scene||this.systems.isTransitioning())},step:function(t,e){this._elapsed+=e,this.transitionProgress=n(this._elapsed/this._duration,0,1),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.transitionProgress),this._elapsed>=this._duration&&this.transitionComplete()},transitionComplete:function(){var t=this._target.sys,e=this._target.sys.settings;this.systems.events.off(s.UPDATE,this.step,this),t.events.emit(s.TRANSITION_COMPLETE,this.scene),e.isTransition=!1,e.transitionFrom=null,this._duration=0,this._target=null,this._onUpdate=null,this._onUpdateScope=null,this._willRemove?this.manager.remove(this.key):this._willSleep?this.systems.sleep():this.manager.stop(this.key)},add:function(t,e,i,n){return this.manager.add(t,e,i,n)},launch:function(t,e){return t&&t!==this.key&&this.manager.queueOp("start",t,e),this},run:function(t,e){return t&&t!==this.key&&this.manager.queueOp("run",t,e),this},pause:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("pause",t,e),this},resume:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("resume",t,e),this},sleep:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("sleep",t,e),this},wake:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("wake",t,e),this},switch:function(t){return t!==this.key&&this.manager.queueOp("switch",this.key,t),this},stop:function(t,e){return void 0===t&&(t=this.key),this.manager.queueOp("stop",t,e),this},setActive:function(t,e,i){void 0===e&&(e=this.key);var n=this.manager.getScene(e);return n&&n.sys.setActive(t,i),this},setVisible:function(t,e){void 0===e&&(e=this.key);var i=this.manager.getScene(e);return i&&i.sys.setVisible(t),this},isSleeping:function(t){return void 0===t&&(t=this.key),this.manager.isSleeping(t)},isActive:function(t){return void 0===t&&(t=this.key),this.manager.isActive(t)},isPaused:function(t){return void 0===t&&(t=this.key),this.manager.isPaused(t)},isVisible:function(t){return void 0===t&&(t=this.key),this.manager.isVisible(t)},swapPosition:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.swapPosition(t,e),this},moveAbove:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveAbove(t,e),this},moveBelow:function(t,e){return void 0===e&&(e=this.key),t!==e&&this.manager.moveBelow(t,e),this},remove:function(t){return void 0===t&&(t=this.key),this.manager.remove(t),this},moveUp:function(t){return void 0===t&&(t=this.key),this.manager.moveUp(t),this},moveDown:function(t){return void 0===t&&(t=this.key),this.manager.moveDown(t),this},bringToTop:function(t){return void 0===t&&(t=this.key),this.manager.bringToTop(t),this},sendToBack:function(t){return void 0===t&&(t=this.key),this.manager.sendToBack(t),this},get:function(t){return this.manager.getScene(t)},getIndex:function(t){return void 0===t&&(t=this.key),this.manager.getIndex(t)},shutdown:function(){var t=this.systems.events;t.off(s.SHUTDOWN,this.shutdown,this),t.off(s.POST_UPDATE,this.step,this),t.off(s.TRANSITION_OUT)},destroy:function(){this.shutdown(),this.scene.sys.events.off(s.START,this.start,this),this.scene=null,this.systems=null,this.settings=null,this.manager=null}});a.register("ScenePlugin",h,"scenePlugin"),t.exports=h},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Events:i(432),List:i(107),Map:i(99),ProcessQueue:i(208),RTree:i(525),Set:i(148),Size:i(410)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(17),r=i(1411),s={CanvasTexture:i(417),Events:i(103),FilterMode:r,Frame:i(106),Parsers:i(419),Texture:i(203),TextureManager:i(416),TextureSource:i(418)};s=n(!1,s,r),t.exports=s},function(t,e){t.exports={LINEAR:0,NEAREST:1}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(17),r=i(1413),s={Components:i(247),Parsers:i(1446),Formats:i(39),ImageCollection:i(572),ParseToTilemap:i(258),Tile:i(83),Tilemap:i(576),TilemapCreator:i(1452),TilemapFactory:i(1453),Tileset:i(121),TilemapLayer:i(577),Orientation:i(29),LayerData:i(119),MapData:i(120),ObjectLayer:i(568)};s=n(!1,s,r.ORIENTATION),t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n={ORIENTATION:i(29)};t.exports=n},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(26),r=i(61);t.exports=function(t,e,i,s,o,a,h,l){void 0===h&&(h=!0),t<0&&(t=0),e<0&&(e=0);for(var c=n(t,e,i,s,null,l),u=o-t,d=a-e,p=0;p=0&&f=0&&m * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(26),r=i(538);t.exports=function(t,e,i,s,o,a){i||(i={}),Array.isArray(t)||(t=[t]);var h=a.tilemapLayer;s||(s=h.scene),o||(o=s.cameras.main);var l,c=n(0,0,a.width,a.height,null,a),u=[];for(l=0;l * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(26),r=i(61),s=i(72);t.exports=function(t,e,i,o,a,h,l){for(var c=-1!==l.collideIndexes.indexOf(t),u=n(e,i,o,a,null,l),d=0;d * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(26);t.exports=function(t,e,i,r,s,o,a,h){return n(i,r,s,o,a,h).filter(t,e)}},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=!1);var r,s,o,a=0;if(i){for(s=n.height-1;s>=0;s--)for(r=n.width-1;r>=0;r--)if((o=n.data[s][r])&&o.index===t){if(a===e)return o;a+=1}}else for(s=0;s * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(26);t.exports=function(t,e,i,r,s,o,a,h){return n(i,r,s,o,a,h).find(t,e)||null}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(26);t.exports=function(t,e,i,r,s,o,a,h){n(i,r,s,o,a,h).forEach(t,e)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(29),r=i(540),s=i(541),o=i(543),a=i(1),h=i(544);t.exports=function(t){return t===n.ORTHOGONAL?r:t===n.HEXAGONAL?s:t===n.STAGGERED?h:t===n.ISOMETRIC?o:a}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(156),r=new(i(3));t.exports=function(t,e,i,s,o){return o.tilemapLayer.worldToTileXY(t,e,!0,r,s),n(r.x,r.y,i,o)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(477),r=i(26),s=i(478),o=i(1),a=i(3),h=function(t,e){return s.RectangleToTriangle(e,t)},l=new a,c=new a,u=new a;t.exports=function(t,e,i,a){if(void 0===t)return[];var d=o;t instanceof n.Circle?d=s.CircleToRectangle:t instanceof n.Rectangle?d=s.RectangleToRectangle:t instanceof n.Triangle?d=h:t instanceof n.Line&&(d=s.LineToRectangle),a.tilemapLayer.worldToTileXY(t.left,t.top,!0,c,i);var p=c.x,f=c.y;a.tilemapLayer.worldToTileXY(t.right,t.bottom,!0,u,i);var m=Math.ceil(u.x),g=Math.ceil(u.y),v=Math.max(m-p,1),y=Math.max(g-f,1),x=r(p,f,v,y,e,a),b=a.tileWidth,w=a.tileHeight;a.tilemapLayer&&(b*=a.tilemapLayer.scaleX,w*=a.tilemapLayer.scaleY);for(var T=[],_=new n.Rectangle(0,0,b,w),E=0;E * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(29),r=i(1),s=i(249);t.exports=function(t){return t===n.ORTHOGONAL?s:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(29),r=i(546),s=i(547),o=i(1),a=i(548),h=i(549);t.exports=function(t){return t===n.ORTHOGONAL?h:t===n.ISOMETRIC?s:t===n.HEXAGONAL?r:t===n.STAGGERED?a:o}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(29),r=i(550),s=i(1),o=i(551),a=i(250);t.exports=function(t){return t===n.ORTHOGONAL?a:t===n.HEXAGONAL?r:t===n.STAGGERED?o:s}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(29),r=i(1),s=i(251);t.exports=function(t){return t===n.ORTHOGONAL?s:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(29),r=i(552),s=i(553),o=i(1),a=i(554),h=i(555);t.exports=function(t){return t===n.ORTHOGONAL?h:t===n.ISOMETRIC?s:t===n.HEXAGONAL?r:t===n.STAGGERED?a:o}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(29),r=i(556),s=i(1),o=i(557),a=i(252);t.exports=function(t){return t===n.ORTHOGONAL?a:t===n.HEXAGONAL?r:t===n.STAGGERED?o:s}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(558),r=new(i(3));t.exports=function(t,e,i,s){s.tilemapLayer.worldToTileXY(t,e,!0,r,i);var o=r.x,a=r.y;return n(o,a,s)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(253),r=new(i(3));t.exports=function(t,e,i,s,o,a){return a.tilemapLayer.worldToTileXY(e,i,!0,r,o,a),n(t,r.x,r.y,s,a)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(61),r=i(253);t.exports=function(t,e,i,s,o){if(void 0===s&&(s=!0),!Array.isArray(t))return null;Array.isArray(t[0])||(t=[t]);for(var a=t.length,h=t[0].length,l=0;l * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(26),r=i(207);t.exports=function(t,e,i,s,o,a){var h,l=n(t,e,i,s,{},a);if(!o)for(o=[],h=0;h * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(559),r=new(i(3));t.exports=function(t,e,i,s,o,a){return a.tilemapLayer.worldToTileXY(t,e,!0,r,o,a),n(r.x,r.y,i,s,a)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(26),r=i(391),s=new r(105,210,231,150),o=new r(243,134,48,200),a=new r(40,39,37,150);t.exports=function(t,e,i){void 0===e&&(e={});var r=void 0!==e.tileColor?e.tileColor:s,h=void 0!==e.collidingTileColor?e.collidingTileColor:o,l=void 0!==e.faceColor?e.faceColor:a,c=n(0,0,i.width,i.height,null,i);t.translateCanvas(i.tilemapLayer.x,i.tilemapLayer.y),t.scaleCanvas(i.tilemapLayer.scaleX,i.tilemapLayer.scaleY);for(var u=0;u * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(72),r=i(61),s=i(158);t.exports=function(t,e,i,o,a){void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===a&&(a=!0),Array.isArray(t)||(t=[t]);for(var h=0;h * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(72),r=i(61),s=i(158);t.exports=function(t,e,i,o,a,h){if(void 0===i&&(i=!0),void 0===o&&(o=!0),void 0===h&&(h=!0),!(t>e)){for(var l=t;l<=e;l++)s(l,i,a);if(h)for(var c=0;c=t&&d.index<=e&&n(d,i)}o&&r(0,0,a.width,a.height,a)}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(72),r=i(61),s=i(158);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0),Array.isArray(t)||(t=[t]);for(var a=0;a * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(72),r=i(61),s=i(125);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var a=0;a * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(72),r=i(61);t.exports=function(t,e,i){void 0===t&&(t=!0),void 0===e&&(e=!0);for(var s=0;s0&&n(a,t)}}e&&r(0,0,i.width,i.height,i)}},function(t,e){t.exports=function(t,e,i,n){if("number"==typeof t)n.callbacks[t]=null!==e?{callback:e,callbackContext:i}:void 0;else for(var r=0,s=t.length;r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(26);t.exports=function(t,e,i,r,s,o,a){for(var h=n(t,e,i,r,null,a),l=0;l * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(26),r=i(129);t.exports=function(t,e,i,s,o){var a=n(t,e,i,s,null,o),h=a.map((function(t){return t.index}));r(h);for(var l=0;l * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(26);t.exports=function(t,e,i,r,s,o,a){for(var h=n(i,r,s,o,null,a),l=0;l * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(26);t.exports=function(t,e,i,r,s,o){if(s){var a,h=n(t,e,i,r,null,o),l=0;for(a=0;a * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={FromOrientationString:i(254),Parse:i(560),Parse2DArray:i(255),ParseCSV:i(561),Impact:i(1447),Tiled:i(1448)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={ParseTileLayers:i(574),ParseTilesets:i(575),ParseWeltmeister:i(573)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={AssignTileProperties:i(563),Base64Decode:i(570),BuildTilesetIndex:i(564),CreateGroupLayer:i(159),ParseGID:i(257),ParseImageLayers:i(565),ParseJSONTiled:i(562),ParseObject:i(256),ParseObjectLayers:i(566),ParseTileLayers:i(569),ParseTilesets:i(571)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(1),r=i(1);n=i(1450),r=i(1451),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(12);t.exports=function(t,e,i){var r=e.cull(i),s=r.length,o=i.alpha*e.alpha;if(!(0===s||o<=0)){var a=e.gidMap,h=t.pipelines.set(e.pipeline,e),l=n.getTintAppendFloatAlpha,c=e.scrollFactorX,u=e.scrollFactorY,d=e.x,p=e.y,f=e.scaleX,m=e.scaleY;t.pipelines.preBatch(e);for(var g=0;g * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(25),r=new n,s=new n,o=new n;t.exports=function(t,e,i,n){var a=e.cull(i),h=a.length,l=i.alpha*e.alpha;if(!(0===h||l<=0)){var c=r,u=s,d=o;u.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),c.copyFrom(i.matrix);var p=t.currentContext,f=e.gidMap;p.save(),n?(c.multiplyWithOffset(n,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),u.e=e.x,u.f=e.y,c.multiply(u,d),d.copyToContext(p)):(u.e-=i.scrollX*e.scrollFactorX,u.f-=i.scrollY*e.scrollFactorY,u.copyToContext(p)),(!t.antialias||e.scaleX>1||e.scaleY>1)&&(p.imageSmoothingEnabled=!1);for(var m=0;m * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(16),r=i(258);n.register("tilemap",(function(t){var e=void 0!==t?t:{};return r(this.scene,e.key,e.tileWidth,e.tileHeight,e.width,e.height,e.data,e.insertNull)}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(5),r=i(258);n.register("tilemap",(function(t,e,i,n,s,o,a){return null===t&&(t=void 0),null===e&&(e=void 0),null===i&&(i=void 0),null===n&&(n=void 0),null===s&&(s=void 0),r(this.scene,t,e,i,n,s,o,a)}))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Clock:i(1455),TimerEvent:i(578)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(24),s=i(21),o=i(578),a=i(89),h=new n({initialize:function(t){this.scene=t,this.systems=t.sys,this.now=0,this.timeScale=1,this.paused=!1,this._active=[],this._pendingInsertion=[],this._pendingRemoval=[],t.sys.events.once(s.BOOT,this.boot,this),t.sys.events.on(s.START,this.start,this)},boot:function(){this.now=this.systems.game.loop.time,this.systems.events.once(s.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(s.PRE_UPDATE,this.preUpdate,this),t.on(s.UPDATE,this.update,this),t.once(s.SHUTDOWN,this.shutdown,this)},addEvent:function(t){var e;return t instanceof o?(e=t,this.removeEvent(e),e.elapsed=e.startAt,e.hasDispatched=!1,e.repeatCount=-1===e.repeat||e.loop?999999999999:e.repeat):e=new o(t),this._pendingInsertion.push(e),e},delayedCall:function(t,e,i,n){return this.addEvent({delay:t,callback:e,args:i,callbackScope:n})},clearPendingEvents:function(){return this._pendingInsertion=[],this},removeEvent:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e-1&&this._active.splice(r,1),n.destroy()}for(i=0;i=n.delay)){var r=n.elapsed-n.delay;n.elapsed=n.delay,!n.hasDispatched&&n.callback&&(n.hasDispatched=!0,n.callback.apply(n.callbackScope,n.args)),n.repeatCount>0?(n.repeatCount--,n.elapsed=r,n.hasDispatched=!1):this._pendingRemoval.push(n)}}}},shutdown:function(){var t;for(t=0;t * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(97),r=i(17),s={Builders:i(1457),Events:i(263),TweenManager:i(1473),Tween:i(262),TweenData:i(264),Timeline:i(584)};s=r(!1,s,n),t.exports=s},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={GetBoolean:i(96),GetEaseFunction:i(80),GetNewValue:i(160),GetProps:i(579),GetTargets:i(259),GetTweens:i(580),GetValueOp:i(260),NumberTweenBuilder:i(581),StaggerBuilder:i(582),TimelineBuilder:i(583),TweenBuilder:i(161)}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports=["callbackScope","completeDelay","delay","duration","ease","easeParams","flipX","flipY","hold","loop","loopDelay","offset","onActive","onActiveParams","onActiveScope","onComplete","onCompleteParams","onCompleteScope","onLoop","onLoopParams","onLoopScope","onRepeat","onRepeatParams","onRepeatScope","onStart","onStartParams","onStartScope","onStop","onStopParams","onStopScope","onUpdate","onUpdateParams","onUpdateScope","onYoyo","onYoyoParams","onYoyoScope","paused","props","repeat","repeatDelay","targets","useFrames","yoyo"]},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="complete"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="loop"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pause"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="resume"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="start"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="update"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="active"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="complete"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="loop"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="repeat"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="start"},function(t,e){ /** * @author samme * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="stop"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="update"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="yoyo"},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(89),r=i(0),s=i(581),o=i(24),a=i(21),h=i(582),l=i(583),c=i(97),u=i(161),d=new r({initialize:function(t){this.scene=t,this.systems=t.sys,this.timeScale=1,this._add=[],this._pending=[],this._active=[],this._destroy=[],this._toProcess=0,t.sys.events.once(a.BOOT,this.boot,this),t.sys.events.on(a.START,this.start,this)},boot:function(){this.systems.events.once(a.DESTROY,this.destroy,this)},start:function(){var t=this.systems.events;t.on(a.PRE_UPDATE,this.preUpdate,this),t.on(a.UPDATE,this.update,this),t.once(a.SHUTDOWN,this.shutdown,this),this.timeScale=1},createTimeline:function(t){return l(this,t)},timeline:function(t){var e=l(this,t);return e.paused||(this._add.push(e),this._toProcess++),e},create:function(t){return u(this,t)},add:function(t){var e=u(this,t);return this._add.push(e),this._toProcess++,e},existing:function(t){return this._add.push(t),this._toProcess++,this},addCounter:function(t){var e=s(this,t);return this._add.push(e),this._toProcess++,e},stagger:function(t,e){return h(t,e)},preUpdate:function(){if(0!==this._toProcess){var t,e,i=this._destroy,n=this._active,r=this._pending;for(t=0;t-1&&(e.state=c.REMOVED,r.splice(s,1)):(e.state=c.REMOVED,n.splice(s,1))}for(i.length=0,i=this._add,t=0;t * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Array:i(205),Base64:i(1475),Objects:i(1477),String:i(1481),NOOP:i(1)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={ArrayBufferToBase64:i(1476),Base64ToArrayBuffer:i(427)}},function(t,e){ /** * @author Niklas von Hertzen (https://github.com/niklasvh/base64-arraybuffer) * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";t.exports=function(t,e){for(var n=new Uint8Array(t),r=n.length,s=e?"data:"+e+";base64,":"",o=0;o>2],s+=i[(3&n[o])<<4|n[o+1]>>4],s+=i[(15&n[o+1])<<2|n[o+2]>>6],s+=i[63&n[o+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Clone:i(77),DeepCopy:i(172),Extend:i(17),GetAdvancedValue:i(13),GetFastValue:i(2),GetMinMaxValue:i(1478),GetValue:i(6),HasAll:i(1479),HasAny:i(449),HasValue:i(125),IsPlainObject:i(7),Merge:i(143),MergeRight:i(1480),Pick:i(567),SetValue:i(472)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(6),r=i(18);t.exports=function(t,e,i,s,o){void 0===o&&(o=i);var a=n(t,e,o);return r(a,i,s)}},function(t,e){t.exports=function(t,e){for(var i=0;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(77);t.exports=function(t,e){var i=n(t);for(var r in e)i.hasOwnProperty(r)&&(i[r]=e[r]);return i}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Format:i(1482),Pad:i(183),RemoveAt:i(1483),Reverse:i(1484),UppercaseFirst:i(202),UUID:i(219)}},function(t,e){t.exports=function(t,e){return t.replace(/%([0-9]+)/g,(function(t,i){return e[Number(i)-1]}))}},function(t,e){t.exports=function(t,e){return 0===e?t.slice(1):t.slice(0,e-1)+t.slice(e)}},function(t,e){t.exports=function(t){return t.split("").reverse().join("")}},function(t,e,i){ /** * @author Richard Davey * @author Pavle Goloskokovic (http://prunegames.com) * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={SoundManagerCreator:i(420),Events:i(69),BaseSound:i(145),BaseSoundManager:i(144),WebAudioSound:i(428),WebAudioSoundManager:i(426),HTML5AudioSound:i(423),HTML5AudioSoundManager:i(421),NoAudioSound:i(425),NoAudioSoundManager:i(424)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(3),s=new n({initialize:function(){this.boundsCenter=new r,this.centerDiff=new r},parseBody:function(t){if(!(t=t.hasOwnProperty("body")?t.body:t).hasOwnProperty("bounds")||!t.hasOwnProperty("centerOfMass"))return!1;var e=this.boundsCenter,i=this.centerDiff,n=t.bounds.max.x-t.bounds.min.x,r=t.bounds.max.y-t.bounds.min.y,s=n*t.centerOfMass.x,o=r*t.centerOfMass.y;return e.set(n/2,r/2),i.set(s-e.x,o-e.y),!0},getTopLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var n=this.boundsCenter,s=this.centerDiff;return new r(e+n.x+s.x,i+n.y+s.y)}return!1},getTopCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var n=this.boundsCenter,s=this.centerDiff;return new r(e+s.x,i+n.y+s.y)}return!1},getTopRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var n=this.boundsCenter,s=this.centerDiff;return new r(e-(n.x-s.x),i+n.y+s.y)}return!1},getLeftCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var n=this.boundsCenter,s=this.centerDiff;return new r(e+n.x+s.x,i+s.y)}return!1},getCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var n=this.centerDiff;return new r(e+n.x,i+n.y)}return!1},getRightCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var n=this.boundsCenter,s=this.centerDiff;return new r(e-(n.x-s.x),i+s.y)}return!1},getBottomLeft:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var n=this.boundsCenter,s=this.centerDiff;return new r(e+n.x+s.x,i-(n.y-s.y))}return!1},getBottomCenter:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var n=this.boundsCenter,s=this.centerDiff;return new r(e+s.x,i-(n.y-s.y))}return!1},getBottomRight:function(t,e,i){if(void 0===e&&(e=0),void 0===i&&(i=0),this.parseBody(t)){var n=this.boundsCenter,s=this.centerDiff;return new r(e-(n.x-s.x),i-(n.y-s.y))}return!1}});t.exports=s},function(t,e){function i(t,e,i){i=i||0;var n,r,s,o,a,h,l,c=[0,0];return n=t[1][1]-t[0][1],r=t[0][0]-t[1][0],s=n*t[0][0]+r*t[0][1],o=e[1][1]-e[0][1],a=e[0][0]-e[1][0],h=o*e[0][0]+a*e[0][1],T(l=n*a-o*r,0,i)||(c[0]=(a*s-r*h)/l,c[1]=(n*h-o*s)/l),c}function n(t,e,i,n){var r=e[0]-t[0],s=e[1]-t[1],o=n[0]-i[0],a=n[1]-i[1];if(o*s-a*r==0)return!1;var h=(r*(i[1]-t[1])+s*(t[0]-i[0]))/(o*s-a*r),l=(o*(t[1]-i[1])+a*(i[0]-t[0]))/(a*r-o*s);return h>=0&&h<=1&&l>=0&&l<=1}function r(t,e,i){return(e[0]-t[0])*(i[1]-t[1])-(i[0]-t[0])*(e[1]-t[1])}function s(t,e,i){return r(t,e,i)>0}function o(t,e,i){return r(t,e,i)>=0}function a(t,e,i){return r(t,e,i)<0}function h(t,e,i){return r(t,e,i)<=0} /** * @author Stefan Hedman (http://steffe.se) * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={decomp:function(t){var e=function t(e){for(var i=[],n=[],r=[],s=[],o=Number.MAX_VALUE,a=0;a0?function t(e,i){if(0===i.length)return[e];if(i instanceof Array&&i.length&&i[0]instanceof Array&&2===i[0].length&&i[0][0]instanceof Array){for(var n=[e],r=0;rc)return console.warn("quickDecomp: max level ("+c+") reached."),i;for(var O=0;OS&&(S+=e.length),E=Number.MAX_VALUE,S3&&n>=0;--n)u(p(t,n-1),p(t,n),p(t,n+1),e)&&(t.splice(n%t.length,1),i++);return i},removeDuplicatePoints:function(t,e){for(var i=t.length-1;i>=1;--i)for(var n=t[i],r=i-1;r>=0;--r)_(n,t[r],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,n=1;ni[e][0])&&(e=n);return!s(p(t,e-1),p(t,e),p(t,e+1))&&(function(t){for(var e=[],i=t.length,n=0;n!==i;n++)e.push(t.pop());for(n=0;n!==i;n++)t[n]=e[n]}(t),!0)}};var l=[],c=[];function u(t,e,i,n){if(n){var s=l,o=c;s[0]=e[0]-t[0],s[1]=e[1]-t[1],o[0]=i[0]-e[0],o[1]=i[1]-e[1];var a=s[0]*o[0]+s[1]*o[1],h=Math.sqrt(s[0]*s[0]+s[1]*s[1]),u=Math.sqrt(o[0]*o[0]+o[1]*o[1]);return Math.acos(a/(h*u)) * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(126),r=i(0),s=i(1388),o=i(246),a=i(1389),h=i(1489),l=i(1490),c=i(1491),u=i(1390),d=i(1386),p=i(1387),f=i(1492),m=i(94),g=new r({initialize:function(t){this.world=t,this.scene=t.scene,this.sys=t.scene.sys},rectangle:function(t,e,i,r,s){var o=n.rectangle(t,e,i,r,s);return this.world.add(o),o},trapezoid:function(t,e,i,r,s,o){var a=n.trapezoid(t,e,i,r,s,o);return this.world.add(a),a},circle:function(t,e,i,r,s){var o=n.circle(t,e,i,r,s);return this.world.add(o),o},polygon:function(t,e,i,r,s){var o=n.polygon(t,e,i,r,s);return this.world.add(o),o},fromVertices:function(t,e,i,r,s,o,a){"string"==typeof i&&(i=m.fromPath(i));var h=n.fromVertices(t,e,i,r,s,o,a);return this.world.add(h),h},fromPhysicsEditor:function(t,e,i,n,r){void 0===r&&(r=!0);var s=d.parseBody(t,e,i,n);return r&&!this.world.has(s)&&this.world.add(s),s},fromSVG:function(t,e,i,r,s,o){void 0===r&&(r=1),void 0===s&&(s={}),void 0===o&&(o=!0);for(var h=i.getElementsByTagName("path"),l=[],c=0;c * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(534),r=i(2),s=i(3);t.exports=function(t,e,i,o){void 0===i&&(i={}),void 0===o&&(o=!0);var a=e.x,h=e.y;if(e.body={temp:!0,position:{x:a,y:h}},[n.Bounce,n.Collision,n.Force,n.Friction,n.Gravity,n.Mass,n.Sensor,n.SetBody,n.Sleep,n.Static,n.Transform,n.Velocity].forEach((function(t){for(var i in t)(n=t[i]).get&&"function"==typeof n.get||n.set&&"function"==typeof n.set?Object.defineProperty(e,i,{get:t[i].get,set:t[i].set}):Object.defineProperty(e,i,{value:t[i]});var n})),e.world=t,e._tempVec2=new s(a,h),i.hasOwnProperty("type")&&"body"===i.type)e.setExistingBody(i,o);else{var l=r(i,"shape",null);l||(l="rectangle"),i.addToWorld=o,e.setBody(l,i)}return e}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(0),r=i(534),s=i(15),o=i(2),a=i(124),h=i(171),l=i(3),c=new n({Extends:a,Mixins:[r.Bounce,r.Collision,r.Force,r.Friction,r.Gravity,r.Mass,r.Sensor,r.SetBody,r.Sleep,r.Static,r.Transform,r.Velocity,h],initialize:function(t,e,i,n,r,a){s.call(this,t.scene,"Image"),this._crop=this.resetCropObject(),this.setTexture(n,r),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new l(e,i);var h=o(a,"shape",null);h?this.setBody(h,a):this.setRectangle(this.width,this.height,a),this.setPosition(e,i),this.initPipeline()}});t.exports=c},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(162),r=i(0),s=i(534),o=i(15),a=i(2),h=i(171),l=i(73),c=i(3),u=new r({Extends:l,Mixins:[s.Bounce,s.Collision,s.Force,s.Friction,s.Gravity,s.Mass,s.Sensor,s.SetBody,s.Sleep,s.Static,s.Transform,s.Velocity,h],initialize:function(t,e,i,r,s,h){o.call(this,t.scene,"Sprite"),this._crop=this.resetCropObject(),this.anims=new n(this),this.setTexture(r,s),this.setSizeToFrame(),this.setOrigin(),this.world=t,this._tempVec2=new c(e,i);var l=a(h,"shape",null);l?this.setBody(l,h):this.setRectangle(this.width,this.height,h),this.setPosition(e,i),this.initPipeline()}});t.exports=u},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(117),r=i(0),s=i(163),o=i(246),a=i(587),h=i(586),l=i(49),c=i(143),u=i(267),d=i(3),p=i(94),f=new r({initialize:function(t,e,i){void 0===i&&(i={}),this.scene=t,this.world=e,this.camera=null,this.pointer=null,this.active=!0,this.position=new d,this.body=null,this.part=null,this.constraint=o.create(c(i,{label:"Pointer Constraint",pointA:{x:0,y:0},pointB:{x:0,y:0},length:.01,stiffness:.1,angularStiffness:1,collisionFilter:{category:1,mask:4294967295,group:0}})),this.world.on(h.BEFORE_UPDATE,this.update,this),t.sys.input.on(l.POINTER_DOWN,this.onDown,this),t.sys.input.on(l.POINTER_UP,this.onUp,this)},onDown:function(t){this.pointer||(this.pointer=t,this.camera=t.camera)},onUp:function(t){t===this.pointer&&(this.pointer=null)},getBody:function(t){var e=this.position,i=this.constraint;this.camera.getWorldPoint(t.x,t.y,e);for(var r=s.allBodies(this.world.localWorld),o=0;o1?1:0;r0&&c.trigger(t,"collisionStart",{pairs:b.collisionStart}),o.preSolvePosition(b.list),r=0;r0&&c.trigger(t,"collisionActive",{pairs:b.collisionActive}),b.collisionEnd.length>0&&c.trigger(t,"collisionEnd",{pairs:b.collisionEnd}),h.update(t.metrics,t),n._bodiesClearForces(v),c.trigger(t,"afterUpdate",g),t},n.merge=function(t,e){if(p.extend(t,e),e.world){t.world=e.world,n.clear(t);for(var i=u.allBodies(t.world),r=0;r * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(126),r=i(71),s=i(0),o=i(50),a=i(163),h=i(1495),l=i(9),c=i(586),u=i(2),d=i(6),p=i(71),f=i(268),m=i(1390),g=i(1393),v=i(116),y=new s({Extends:l,initialize:function(t,e){l.call(this),this.scene=t,this.engine=h.create(e),this.localWorld=this.engine.world;var i=d(e,"gravity",null);i?this.setGravity(i.x,i.y,i.scale):!1===i&&this.setGravity(0,0,0),this.walls={left:null,right:null,top:null,bottom:null},this.enabled=d(e,"enabled",!0),this.correction=d(e,"correction",1),this.getDelta=d(e,"getDelta",this.update60Hz);var n=u(e,"runner",{}),r=u(n,"fps",!1),s=u(n,"fps",60),o=u(n,"delta",1e3/s),a=u(n,"deltaMin",1e3/s),c=u(n,"deltaMax",1e3/(.5*s));r||(s=1e3/o),this.runner={fps:s,correction:u(n,"correction",1),deltaSampleSize:u(n,"deltaSampleSize",60),counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,timeScalePrev:1,frameRequestId:null,isFixed:u(n,"isFixed",!1),delta:o,deltaMin:a,deltaMax:c},this.autoUpdate=d(e,"autoUpdate",!0);var p=d(e,"debug",!1);if(this.drawDebug="object"==typeof p||p,this.debugGraphic,this.debugConfig={showAxes:u(p,"showAxes",!1),showAngleIndicator:u(p,"showAngleIndicator",!1),angleColor:u(p,"angleColor",15208787),showBroadphase:u(p,"showBroadphase",!1),broadphaseColor:u(p,"broadphaseColor",16757760),showBounds:u(p,"showBounds",!1),boundsColor:u(p,"boundsColor",16777215),showVelocity:u(p,"showVelocity",!1),velocityColor:u(p,"velocityColor",44783),showCollisions:u(p,"showCollisions",!1),collisionColor:u(p,"collisionColor",16094476),showSeparations:u(p,"showSeparations",!1),separationColor:u(p,"separationColor",16753920),showBody:u(p,"showBody",!0),showStaticBody:u(p,"showStaticBody",!0),showInternalEdges:u(p,"showInternalEdges",!1),renderFill:u(p,"renderFill",!1),renderLine:u(p,"renderLine",!0),fillColor:u(p,"fillColor",1075465),fillOpacity:u(p,"fillOpacity",1),lineColor:u(p,"lineColor",2678297),lineOpacity:u(p,"lineOpacity",1),lineThickness:u(p,"lineThickness",1),staticFillColor:u(p,"staticFillColor",857979),staticLineColor:u(p,"staticLineColor",1255396),showSleeping:u(p,"showSleeping",!1),staticBodySleepOpacity:u(p,"staticBodySleepOpacity",.7),sleepFillColor:u(p,"sleepFillColor",4605510),sleepLineColor:u(p,"sleepLineColor",10066585),showSensors:u(p,"showSensors",!0),sensorFillColor:u(p,"sensorFillColor",857979),sensorLineColor:u(p,"sensorLineColor",1255396),showPositions:u(p,"showPositions",!0),positionSize:u(p,"positionSize",4),positionColor:u(p,"positionColor",14697178),showJoint:u(p,"showJoint",!0),jointColor:u(p,"jointColor",14737474),jointLineOpacity:u(p,"jointLineOpacity",1),jointLineThickness:u(p,"jointLineThickness",2),pinSize:u(p,"pinSize",4),pinColor:u(p,"pinColor",4382944),springColor:u(p,"springColor",14697184),anchorColor:u(p,"anchorColor",15724527),anchorSize:u(p,"anchorSize",4),showConvexHulls:u(p,"showConvexHulls",!1),hullColor:u(p,"hullColor",14091216)},this.drawDebug&&this.createDebugGraphic(),this.setEventsProxy(),u(e,"setBounds",!1)){var f=e.setBounds;if("boolean"==typeof f)this.setBounds();else{var m=u(f,"x",0),g=u(f,"y",0),v=u(f,"width",t.sys.scale.width),y=u(f,"height",t.sys.scale.height),x=u(f,"thickness",64),b=u(f,"left",!0),w=u(f,"right",!0),T=u(f,"top",!0),_=u(f,"bottom",!0);this.setBounds(m,g,v,y,x,b,w,T,_)}}},setCompositeRenderStyle:function(t){var e,i,n,r=t.bodies,s=t.constraints,o=t.composites;for(e=0;e0&&(i=r[0].bodyA,n=r[0].bodyB),t.emit(c.COLLISION_START,e,i,n)})),f.on(e,"collisionActive",(function(e){var i,n,r=e.pairs;r.length>0&&(i=r[0].bodyA,n=r[0].bodyB),t.emit(c.COLLISION_ACTIVE,e,i,n)})),f.on(e,"collisionEnd",(function(e){var i,n,r=e.pairs;r.length>0&&(i=r[0].bodyA,n=r[0].bodyB),t.emit(c.COLLISION_END,e,i,n)}))},setBounds:function(t,e,i,n,r,s,o,a,h){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.scene.sys.scale.width),void 0===n&&(n=this.scene.sys.scale.height),void 0===r&&(r=64),void 0===s&&(s=!0),void 0===o&&(o=!0),void 0===a&&(a=!0),void 0===h&&(h=!0),this.updateWall(s,"left",t-r,e-r,r,n+2*r),this.updateWall(o,"right",t+i,e-r,r,n+2*r),this.updateWall(a,"top",t,e-r,i,r),this.updateWall(h,"bottom",t,e+n,i,r),this},updateWall:function(t,e,i,n,r,s){var o=this.walls[e];t?(o&&g.remove(this.localWorld,o),i+=r/2,n+=s/2,this.walls[e]=this.create(i,n,r,s,{isStatic:!0,friction:0,frictionStatic:0})):(o&&g.remove(this.localWorld,o),this.walls[e]=null)},createDebugGraphic:function(){var t=this.scene.sys.add.graphics({x:0,y:0});return t.setDepth(Number.MAX_VALUE),this.debugGraphic=t,this.drawDebug=!0,t},disableGravity:function(){return this.localWorld.gravity.x=0,this.localWorld.gravity.y=0,this.localWorld.gravity.scale=0,this},setGravity:function(t,e,i){return void 0===t&&(t=0),void 0===e&&(e=1),this.localWorld.gravity.x=t,this.localWorld.gravity.y=e,void 0!==i&&(this.localWorld.gravity.scale=i),this},create:function(t,e,i,r,s){var o=n.rectangle(t,e,i,r,s);return g.add(this.localWorld,o),o},add:function(t){return g.add(this.localWorld,t),this},remove:function(t,e){Array.isArray(t)||(t=[t]);for(var i=0;in.deltaMax?n.deltaMax:e)/n.delta,n.delta=e),0!==n.timeScalePrev&&(s*=r.timeScale/n.timeScalePrev),0===r.timeScale&&(s=0),n.timeScalePrev=r.timeScale,n.correction=s,n.frameCounter+=1,t-n.counterTimestamp>=1e3&&(n.fps=n.frameCounter*((t-n.counterTimestamp)/1e3),n.counterTimestamp=t,n.frameCounter=0),h.update(i,e,s)}},step:function(t,e){h.update(this.engine,t,e)},update60Hz:function(){return 1e3/60},update30Hz:function(){return 1e3/30},has:function(t){var e=t.hasOwnProperty("body")?t.body:t;return null!==a.get(this.localWorld,e.id,e.type)},getAllBodies:function(){return a.allBodies(this.localWorld)},getAllConstraints:function(){return a.allConstraints(this.localWorld)},getAllComposites:function(){return a.allComposites(this.localWorld)},postUpdate:function(){if(this.drawDebug){var t=this.debugConfig,e=this.engine,i=this.debugGraphic,n=a.allBodies(this.localWorld);this.debugGraphic.clear(),t.showBroadphase&&e.broadphase.controller&&this.renderGrid(e.broadphase,i,t.broadphaseColor,.5),t.showBounds&&this.renderBodyBounds(n,i,t.boundsColor,.5),(t.showBody||t.showStaticBody)&&this.renderBodies(n),t.showJoint&&this.renderJoints(),(t.showAxes||t.showAngleIndicator)&&this.renderBodyAxes(n,i,t.showAxes,t.angleColor,.5),t.showVelocity&&this.renderBodyVelocity(n,i,t.velocityColor,1,2),t.showSeparations&&this.renderSeparations(e.pairs.list,i,t.separationColor),t.showCollisions&&this.renderCollisions(e.pairs.list,i,t.collisionColor)}},renderGrid:function(t,e,i,n){e.lineStyle(1,i,n);for(var r=o.keys(t.buckets),s=0;s0){var l=h[0].vertex.x,c=h[0].vertex.y;2===h.length&&(l=(h[0].vertex.x+h[1].vertex.x)/2,c=(h[0].vertex.y+h[1].vertex.y)/2),a.bodyB===a.supports[0].body||a.bodyA.isStatic?e.lineBetween(l-8*a.normal.x,c-8*a.normal.y,l,c):e.lineBetween(l+8*a.normal.x,c+8*a.normal.y,l,c)}}return this},renderBodyBounds:function(t,e,i,n){e.lineStyle(1,i,n);for(var r=0;r1?1:0;h1?1:0;a1?1:0;a1&&this.renderConvexHull(m,e,p,y)}}},renderBody:function(t,e,i,n,r,s,o,a){void 0===n&&(n=null),void 0===r&&(r=null),void 0===s&&(s=1),void 0===o&&(o=null),void 0===a&&(a=null);for(var h=this.debugConfig,l=h.sensorFillColor,c=h.sensorLineColor,u=t.parts,d=u.length,p=d>1?1:0;p1){var r=t.vertices;e.lineStyle(n,i),e.beginPath(),e.moveTo(r[0].x,r[0].y);for(var s=1;s0&&(e.fillStyle(a),e.fillCircle(c.x,c.y,h),e.fillCircle(u.x,u.y,h)),this},resetCollisionIDs:function(){return r._nextCollidingGroupId=1,r._nextNonCollidingGroupId=-1,r._nextCategory=1,this},shutdown:function(){f.off(this.engine),this.removeAllListeners(),g.clear(this.localWorld,!1),h.clear(this.engine),this.drawDebug&&this.debugGraphic.destroy()},destroy:function(){this.shutdown()}});t.exports=y},function(t,e,i){(function(e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ i(590);var n=i(32),r=i(17),s={Actions:i(269),Animations:i(699),BlendModes:i(34),Cache:i(711),Cameras:i(714),Core:i(803),Class:i(0),Create:i(884),Curves:i(890),Data:i(892),Display:i(894),DOM:i(913),Events:i(914),Game:i(916),GameObjects:i(1007),Geom:i(477),Input:i(1302),Loader:i(1332),Math:i(190),Physics:i(1498),Plugins:i(1397),Renderer:i(1399),Scale:i(1406),ScaleModes:i(164),Scene:i(412),Scenes:i(1407),Structs:i(1409),Textures:i(1410),Tilemaps:i(1412),Time:i(1454),Tweens:i(1456),Utils:i(1474)};s.Sound=i(1485),s=r(!1,s,n),t.exports=s,e.Phaser=s}).call(this,i(589))},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={Arcade:i(1360),Matter:i(1499)}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports={BodyBounds:i(1486),Components:i(534),Events:i(586),Factory:i(1488),MatterGameObject:i(1489),Image:i(1490),Matter:i(1391),MatterPhysics:i(1529),PolyDecomp:i(1487),Sprite:i(1491),TileBody:i(1390),PhysicsEditorParser:i(1386),PhysicsJSONParser:i(1387),PointerConstraint:i(1492),World:i(1496)}},function(t,e){t.exports={setBounce:function(t){return this.body.restitution=t,this}}},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i={setCollisionCategory:function(t){return this.body.collisionFilter.category=t,this},setCollisionGroup:function(t){return this.body.collisionFilter.group=t,this},setCollidesWith:function(t){var e=0;if(Array.isArray(t))for(var i=0;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(71),r={applyForce:function(t){return this._tempVec2.set(this.body.position.x,this.body.position.y),n.applyForce(this.body,this._tempVec2,t),this},applyForceFrom:function(t,e){return n.applyForce(this.body,t,e),this},thrust:function(t){var e=this.body.angle;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustLeft:function(t){var e=this.body.angle-Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustRight:function(t){var e=this.body.angle+Math.PI/2;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this},thrustBack:function(t){var e=this.body.angle-Math.PI;return this._tempVec2.set(t*Math.cos(e),t*Math.sin(e)),n.applyForce(this.body,{x:this.body.position.x,y:this.body.position.y},this._tempVec2),this}};t.exports=r},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var i={setFriction:function(t,e,i){return this.body.friction=t,void 0!==e&&(this.body.frictionAir=e),void 0!==i&&(this.body.frictionStatic=i),this},setFrictionAir:function(t){return this.body.frictionAir=t,this},setFrictionStatic:function(t){return this.body.frictionStatic=t,this}};t.exports=i},function(t,e){t.exports={setIgnoreGravity:function(t){return this.body.ignoreGravity=t,this}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(71),r=i(3),s={setMass:function(t){return n.setMass(this.body,t),this},setDensity:function(t){return n.setDensity(this.body,t),this},centerOfMass:{get:function(){return new r(this.body.centerOfMass.x,this.body.centerOfMass.y)}}};t.exports=s},function(t,e){t.exports={setSensor:function(t){return this.body.isSensor=t,this},isSensor:function(){return this.body.isSensor}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(126),r=i(71),s=i(123),o=i(2),a=i(1386),h=i(1387),l=i(94),c={setRectangle:function(t,e,i){return this.setBody({type:"rectangle",width:t,height:e},i)},setCircle:function(t,e){return this.setBody({type:"circle",radius:t},e)},setPolygon:function(t,e,i){return this.setBody({type:"polygon",sides:e,radius:t},i)},setTrapezoid:function(t,e,i,n){return this.setBody({type:"trapezoid",width:t,height:e,slope:i},n)},setExistingBody:function(t,e){void 0===e&&(e=!0),this.body&&this.world.remove(this.body,!0),this.body=t;for(var i=0;i * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(586),r=i(267),s=i(268),o={setToSleep:function(){r.set(this.body,!0)},setAwake:function(){r.set(this.body,!1)},setSleepThreshold:function(t){return void 0===t&&(t=60),this.body.sleepThreshold=t,this},setSleepEvents:function(t,e){return this.setSleepStartEvent(t),this.setSleepEndEvent(e),this},setSleepStartEvent:function(t){if(t){var e=this.world;s.on(this.body,"sleepStart",(function(t){e.emit(n.SLEEP_START,t,this)}))}else s.off(this.body,"sleepStart");return this},setSleepEndEvent:function(t){if(t){var e=this.world;s.on(this.body,"sleepEnd",(function(t){e.emit(n.SLEEP_END,t,this)}))}else s.off(this.body,"sleepEnd");return this}};t.exports=o},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="afteradd"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="afterremove"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="afterupdate"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="beforeadd"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="beforeremove"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="beforeupdate"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="collisionactive"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="collisionend"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="collisionstart"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="dragend"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="drag"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="dragstart"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="pause"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="resume"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="sleepend"},function(t,e){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ t.exports="sleepstart"},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(71),r={setStatic:function(t){return n.setStatic(this.body,t),this},isStatic:function(){return this.body.isStatic}};t.exports=r},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(71),r=i(14),s=i(265),o=i(266),a={x:{get:function(){return this.body.position.x},set:function(t){this._tempVec2.set(t,this.y),n.setPosition(this.body,this._tempVec2)}},y:{get:function(){return this.body.position.y},set:function(t){this._tempVec2.set(this.x,t),n.setPosition(this.body,this._tempVec2)}},scaleX:{get:function(){return this._scaleX},set:function(t){var e=1/this._scaleX,i=1/this._scaleY;this._scaleX=t,0===this._scaleX?this.renderFlags&=-5:this.renderFlags|=4,n.scale(this.body,e,i),n.scale(this.body,t,this._scaleY)}},scaleY:{get:function(){return this._scaleY},set:function(t){var e=1/this._scaleX,i=1/this._scaleY;this._scaleY=t,0===this._scaleY?this.renderFlags&=-5:this.renderFlags|=4,n.scale(this.body,e,i),n.scale(this.body,this._scaleX,t)}},angle:{get:function(){return o(this.body.angle*r.RAD_TO_DEG)},set:function(t){this.rotation=o(t)*r.DEG_TO_RAD}},rotation:{get:function(){return this.body.angle},set:function(t){this._rotation=s(t),n.setAngle(this.body,this._rotation)}},setPosition:function(t,e){return void 0===t&&(t=0),void 0===e&&(e=t),this._tempVec2.set(t,e),n.setPosition(this.body,this._tempVec2),this},setRotation:function(t){return void 0===t&&(t=0),this._rotation=s(t),n.setAngle(this.body,t),this},setFixedRotation:function(){return n.setInertia(this.body,1/0),this},setAngle:function(t){return void 0===t&&(t=0),this.angle=t,n.setAngle(this.body,this.rotation),this},setScale:function(t,e,i){void 0===t&&(t=1),void 0===e&&(e=t);var r=1/this._scaleX,s=1/this._scaleY;return this._scaleX=t,this._scaleY=e,n.scale(this.body,r,s,i),n.scale(this.body,t,e,i),this}};t.exports=a},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(71),r={setAngularVelocity:function(t){return n.setAngularVelocity(this.body,t),this},setVelocityX:function(t){return this._tempVec2.set(t,this.body.velocity.y),n.setVelocity(this.body,this._tempVec2),this},setVelocityY:function(t){return this._tempVec2.set(this.body.velocity.x,t),n.setVelocity(this.body,this._tempVec2),this},setVelocity:function(t,e){return this._tempVec2.set(t,e),n.setVelocity(this.body,this._tempVec2),this}};t.exports=r},function(t,e,i){var n={};t.exports=n;var r=i(163),s=i(50);n.create=function(t){return s.extend({extended:!1,narrowDetections:0,narrowphaseTests:0,narrowReuse:0,narrowReuseCount:0,midphaseTests:0,broadphaseTests:0,narrowEff:1e-4,midEff:1e-4,broadEff:1e-4,collisions:0,buckets:0,bodies:0,pairs:0},!1,t)},n.reset=function(t){t.extended&&(t.narrowDetections=0,t.narrowphaseTests=0,t.narrowReuse=0,t.narrowReuseCount=0,t.midphaseTests=0,t.broadphaseTests=0,t.narrowEff=0,t.midEff=0,t.broadEff=0,t.collisions=0,t.buckets=0,t.pairs=0,t.bodies=0)},n.update=function(t,e){if(t.extended){var i=e.world,n=r.allBodies(i);t.collisions=t.narrowDetections,t.pairs=e.pairs.list.length,t.bodies=n.length,t.midEff=(t.narrowDetections/(t.midphaseTests||1)).toFixed(2),t.narrowEff=(t.narrowDetections/(t.narrowphaseTests||1)).toFixed(2),t.broadEff=(1-t.broadphaseTests/(n.length||1)).toFixed(2),t.narrowReuse=(t.narrowReuseCount/(t.narrowphaseTests||1)).toFixed(2)}}},function(t,e,i){ /** * @author Richard Davey * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var n=i(122),r=i(585),s=i(126),o=i(71),a=i(1486),h=i(117),l=i(0),c=i(163),u=i(1388),d=i(246),p=i(587),f=i(48),m=i(1488),g=i(2),v=i(6),y=i(1394),x=i(1530),b=i(1531),w=i(1493),T=i(1532),_=i(143),E=i(535),S=i(1395),M=i(1392),A=i(24),C=i(1494),P=i(1396),R=i(588),L=i(21),O=i(1389),D=i(116),I=i(94),F=i(1496),B=new l({initialize:function(t){this.scene=t,this.systems=t.sys,this.config=this.getConfig(),this.world,this.add,this.bodyBounds,this.body=o,this.composite=c,this.detector=p,this.grid=y,this.pair=E,this.pairs=S,this.query=C,this.resolver=P,this.sat=R,this.constraint=d,this.bodies=s,this.composites=u,this.axes=r,this.bounds=h,this.svg=O,this.vector=D,this.vertices=I,this.verts=I,this._tempVec2=D.create(),v(this.config,"plugins.collisionevents",!0)&&this.enableCollisionEventsPlugin(),v(this.config,"plugins.attractors",!1)&&this.enableAttractorPlugin(),v(this.config,"plugins.wrap",!1)&&this.enableWrapPlugin(),P._restingThresh=v(this.config,"restingThresh",4),P._restingThreshTangent=v(this.config,"restingThreshTangent",6),P._positionDampen=v(this.config,"positionDampen",.9),P._positionWarming=v(this.config,"positionWarming",.8),P._frictionNormalMultiplier=v(this.config,"frictionNormalMultiplier",5),t.sys.events.once(L.BOOT,this.boot,this),t.sys.events.on(L.START,this.start,this)},boot:function(){this.world=new F(this.scene,this.config),this.add=new m(this.world),this.bodyBounds=new a,this.systems.events.once(L.DESTROY,this.destroy,this)},start:function(){this.world||(this.world=new F(this.scene,this.config),this.add=new m(this.world));var t=this.systems.events;t.on(L.UPDATE,this.world.update,this.world),t.on(L.POST_UPDATE,this.world.postUpdate,this.world),t.once(L.SHUTDOWN,this.shutdown,this)},getConfig:function(){var t=this.systems.game.config.physics,e=this.systems.settings.physics;return _(g(e,"matter",{}),g(t,"matter",{}))},enableAttractorPlugin:function(){return M.register(x),M.use(w,x),this},enableWrapPlugin:function(){return M.register(T),M.use(w,T),this},enableCollisionEventsPlugin:function(){return M.register(b),M.use(w,b),this},pause:function(){return this.world.pause()},resume:function(){return this.world.resume()},set60Hz:function(){return this.world.getDelta=this.world.update60Hz,this.world.autoUpdate=!0,this},set30Hz:function(){return this.world.getDelta=this.world.update30Hz,this.world.autoUpdate=!0,this},step:function(t,e){this.world.step(t,e)},containsPoint:function(t,e,i){t=this.getMatterBodies(t);var n=D.create(e,i);return C.point(t,n).length>0},intersectPoint:function(t,e,i){i=this.getMatterBodies(i);var n=D.create(t,e),r=[];return C.point(i,n).forEach((function(t){-1===r.indexOf(t)&&r.push(t)})),r},intersectRect:function(t,e,i,n,r,s){void 0===r&&(r=!1),s=this.getMatterBodies(s);var o={min:{x:t,y:e},max:{x:t+i,y:e+n}},a=[];return C.region(s,o,r).forEach((function(t){-1===a.indexOf(t)&&a.push(t)})),a},intersectRay:function(t,e,i,n,r,s){void 0===r&&(r=1),s=this.getMatterBodies(s);for(var o=[],a=C.ray(s,D.create(t,e),D.create(i,n),r),h=0;h0)for(var o=0;oe.max.x?i=e.min.x-t.max.x:t.max.xe.max.y?n=e.min.y-t.max.y:t.max.ythis.makePlane(t,e),box:(t={},e={})=>this.makeBox(t,e),sphere:(t={},e={})=>this.makeSphere(t,e),cylinder:(t={},e={})=>this.makeCylinder(t,e),cone:(t={},e={})=>this.makeCone(t,e),torus:(t={},e={})=>this.makeTorus(t,e),extrude:(t,e={})=>this.makeExtrude(t,e)}}get add(){return{mesh:t=>this.addMesh(t),existing:t=>this.addExisting(t),plane:(t={},e={})=>this.addPlane(t,e),box:(t={},e={})=>this.addBox(t,e),ground:(t,e={})=>this.addGround(t,e),sphere:(t={},e={})=>this.addSphere(t,e),cylinder:(t={},e={})=>this.addCylinder(t,e),cone:(t={},e={})=>this.addCone(t,e),torus:(t={},e={})=>this.addTorus(t,e),extrude:(t,e={})=>this.addExtrude(t,e),material:(t={})=>this.addMaterial(t)}}addExisting(...t){"headless"!==this.scene&&this.scene.add(...t)}addMesh(t){if(Array.isArray(t))for(let e=0;e{try{if("object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate){const t=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(t instanceof WebAssembly.Module)return new WebAssembly.Instance(t)instanceof WebAssembly.Instance}}catch(t){}return!1})(),r=(t,e)=>{var i=document.createElement("script");i.onload=()=>{e()},i.onerror=()=>{throw new Error("failed to load "+t)},i.async=!0,i.src=t,document.head.appendChild(i)};e.default=(t,e)=>{r(n?t+"/ammo.wasm.js":t+"/ammo.js",()=>e())}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fromGeometry=void 0;const n=i(2),r=i(59);e.fromGeometry=(t,e)=>{const i=(new r.DirectGeometry).fromGeometry(e);return s(t,i)};const s=(t,e)=>{var i,r;const s=new Float32Array(3*e.vertices.length);if(t.setAttribute("position",new n.BufferAttribute(s,3).copyVector3sArray(e.vertices)),e.normals.length>0){const i=new Float32Array(3*e.normals.length);t.setAttribute("normal",new n.BufferAttribute(i,3).copyVector3sArray(e.normals))}if(e.colors.length>0){const i=new Float32Array(3*e.colors.length);t.setAttribute("color",new n.BufferAttribute(i,3).copyColorsArray(e.colors))}if(e.uvs.length>0){const i=new Float32Array(2*e.uvs.length);t.setAttribute("uv",new n.BufferAttribute(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){const i=new Float32Array(2*e.uvs2.length);t.setAttribute("uv2",new n.BufferAttribute(i,2).copyVector2sArray(e.uvs2))}t.groups=e.groups;for(const i in e.morphTargets){const r=[],s=e.morphTargets[i];for(let t=0,e=s.length;t0){const i=new n.Float32BufferAttribute(4*e.skinIndices.length,4);t.setAttribute("skinIndex",i.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){const i=new n.Float32BufferAttribute(4*e.skinWeights.length,4);t.setAttribute("skinWeight",i.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(t.boundingSphere=null===(i=e.boundingSphere)||void 0===i?void 0:i.clone()),null!==e.boundingBox&&(t.boundingBox=null===(r=e.boundingBox)||void 0===r?void 0:r.clone()),t}},function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(t){"object"==typeof window&&(i=window)}t.exports=i},,,function(t,e,i){"use strict"; /** * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Scene3D=void 0;const r=i(24),s=i(13),o=i(2);class a extends s.Scene{constructor(t){super(t)}warpSpeed(...t){return n(this,void 0,void 0,(function*(){return yield this.third.warpSpeed(...t)}))}haveSomeFun(t=20){this.third.haveSomeFun(t)}requestThirdDimension(){console.warn("[enable3d] You do not need requestThirdDimension() anymore. Place accessThirdDimension() inside init() instead!")}clearThirdDimension(){for(let t in this.third)delete this.third[t];delete this.third}accessThirdDimension(t={}){this.clearThirdDimension(),this.third=new r.default(this,t),this.cameras.main.transparent=!0,this.cameras.main.setBackgroundColor("rgba(0,0,0,0)"),this.third.scene.background=new o.Color("white")}updateLoopXR(t,e){this.preUpdateXR(t,e),this.updateXR(t,e),this.postUpdateXR(t,e)}preUpdateXR(t,e){}updateXR(t,e){}postUpdateXR(t,e){this.third.isXrEnabled&&(this.time.update(t,e),this.third.physics.update(e),this.third.physics.updateDebugger(),this.third.animationMixers.update(e))}}e.Scene3D=a},function(t,e,i){"use strict"; /** * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const r=i(25),s=i(54);class o extends r.ThreeGraphics{constructor(t,e={}){var i;const n=document.getElementById("enable3d-three-canvas");let o={};n&&(o={canvas:n}),e.renderer=new r.WebGLRenderer(Object.assign(Object.assign({},o),{antialias:e.antialias||!1})),super(e),null===(i=t.sys.game.canvas.parentElement)||void 0===i||i.insertBefore(e.renderer.domElement,t.sys.game.canvas),t.sys.game.canvas.style.position="relative";const a=()=>{var i,n;if(!e.renderer)return;const{width:r,height:s,marginLeft:o,marginTop:a}=t.sys.game.canvas.style;e.renderer.domElement.id="enable3d-three-canvas",null===(i=this.camera)||void 0===i||(i.aspect=t.sys.game.scale.baseSize.width/t.sys.game.scale.baseSize.height),null===(n=this.camera)||void 0===n||n.updateProjectionMatrix(),e.renderer.setSize(t.sys.game.scale.baseSize.width,t.sys.game.scale.baseSize.height),e.renderer.domElement.style.width=r,e.renderer.domElement.style.height=s,e.renderer.domElement.style.marginLeft=o,e.renderer.domElement.style.marginTop=a};a(),t.scale.on("resize",()=>{a()});const h=document.createElement("style");h.innerText="\n #enable3d-phaser-canvas:focus,\n #enable3d-three-canvas:focus {\n outline: none;\n }\n\n #enable3d-three-canvas {\n position: absolute;\n }\n ",document.head.appendChild(h);const{enableXR:l=!1}=e;if(this.isXrEnabled=l,this.scene3D=t,l&&(this.webXR=new s.WebXR(this.renderer,this.scene,this.camera)),this.isXrEnabled){let e=0;this.renderer.setAnimationLoop(i=>{if(this.renderer.xr.isPresenting){const n=i-e;e=i,t.updateLoopXR(i,n),this.renderer.state.reset(),this.preRender(),this.composer?this.composer.render():this.renderer.render(this.scene,this.camera),this.postRender()}})}t.add.extern().render=t=>{this.renderer.xr.isPresenting||(this.preRender(),this.composer?this.composer.render():this.renderer.render(this.scene,this.camera),this.postRender())},t.events.on("postupdate",(t,e)=>{var i,n,r;null===(i=this.animationMixers)||void 0===i||i.update(e),null===(n=this.physics)||void 0===n||n.update(e),null===(r=this.physics)||void 0===r||r.updateDebugger()}),this.load=new s.Loaders(this.cache,this.textureAnisotropy),this.lights=new s.Lights(this.scene),this.transform=new s.Transform(this.camera,this.renderer),this.csg=new s.CSG(this.scene,this.transform),this.heightMap=new s.HeightMap(this.scene),this.factories=new s.Factories(this.scene),this.misc=new s.Misc(this.scene,this.renderer,this.factories),this.cameras=new s.Cameras,this.ws=new s.WarpSpeed(this.scene,this.renderer,this.camera,this.lights,this.physics,this.load,this.factories),this.mixers=new s.Mixers,t.events.once("shutdown",()=>{t.clearThirdDimension(),t.events.removeListener("update")})}preRender(){}postRender(){}destroy(t){var e;null===(e=this.physics)||void 0===e||e.destroy(t.body),this.scene.remove(t),t=null}warpSpeed(...t){return n(this,void 0,void 0,(function*(){return yield this.ws.warpSpeed(...t)}))}haveSomeFun(t=20){s.HaveSomeFun(t,this.physics)}get animationMixers(){var t;return null===(t=this.mixers)||void 0===t?void 0:t.mixers}get make(){return this.factories.make}get add(){return this.factories.add}}e.default=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MathUtils=e.Vector3=e.Vector2=e.Object3D=e.FBXLoader=e.GLTFLoader=e.RGBAFormat=e.Texture=e.WebGLRenderer=e.Types=e.THREE=e.PhysicsLoader=e.ThreeGraphics=void 0;const n=i(26);Object.defineProperty(e,"ThreeGraphics",{enumerable:!0,get:function(){return n.ThreeGraphics}});const r=i(11);Object.defineProperty(e,"PhysicsLoader",{enumerable:!0,get:function(){return r.PhysicsLoader}});const s=i(2);e.THREE=s;const o=i(4);e.Types=o;const a=i(53);var h=i(2);Object.defineProperty(e,"WebGLRenderer",{enumerable:!0,get:function(){return h.WebGLRenderer}}),Object.defineProperty(e,"Texture",{enumerable:!0,get:function(){return h.Texture}}),Object.defineProperty(e,"RGBAFormat",{enumerable:!0,get:function(){return h.RGBAFormat}}),Object.defineProperty(e,"GLTFLoader",{enumerable:!0,get:function(){return h.GLTFLoader}}),Object.defineProperty(e,"FBXLoader",{enumerable:!0,get:function(){return h.FBXLoader}}),Object.defineProperty(e,"Object3D",{enumerable:!0,get:function(){return h.Object3D}}),Object.defineProperty(e,"Vector2",{enumerable:!0,get:function(){return h.Vector2}}),Object.defineProperty(e,"Vector3",{enumerable:!0,get:function(){return h.Vector3}}),Object.defineProperty(e,"MathUtils",{enumerable:!0,get:function(){return h.MathUtils}});const l="Powered by enable3d v"+a.VERSION;console.log(`%c %c %c %c %c ${l} %c https://enable3d.io/`,"background: #ff0000","background: #ffff00","background: #00ff00","background: #00ffff","color: #fff; background: #000000;","background: none")},function(t,e,i){"use strict"; /** * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */Object.defineProperty(e,"__esModule",{value:!0}),e.ThreeGraphics=void 0;const n=i(2),r=i(14),s=i(36);e.ThreeGraphics=class{constructor(t={}){this.threeGraphicsConfig=t;const{anisotropy:e=1,camera:i=r.default.Perspective({z:25,y:5}),antialias:o=!1,usePhysics:a=!0,renderer:h}=t;this.textureAnisotropy=e,this.camera=i,this.scene=new n.Scene,this.renderer=h||new n.WebGLRenderer({antialias:o}),this.renderer.shadowMap.enabled=!0,this.renderer.shadowMap.type=n.PCFSoftShadowMap,this.cache=n.Cache,this.cache.enabled=!0,a&&("undefined"!=typeof Ammo?this.physics=new s.AmmoPhysics(this.scene,t):console.log("[enable3d]: Are you sure you included ammo.js?"))}}},function(t,e,i){"use strict";i.r(e),i.d(e,"Geometry",(function(){return a}));var n=i(0);const r=new n.Matrix4,s=new n.Object3D,o=new n.Vector3;function a(){this.uuid=n.MathUtils.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}a.prototype=Object.assign(Object.create(n.EventDispatcher.prototype),{constructor:a,isGeometry:!0,applyMatrix4:function(t){const e=(new n.Matrix3).getNormalMatrix(t);for(let e=0,i=this.vertices.length;e0)for(let t=0;t0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){this.computeFaceNormals();for(let t=0,e=this.faces.length;t0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(let t=0,e=this.faces.length;t=0;t--){const e=s[t];this.faces.splice(e,1);for(let t=0,i=this.faceVertexUvs.length;t0,a=e.vertexNormals.length>0,h=1!==e.color.r||1!==e.color.g||1!==e.color.b,p=e.vertexColors.length>0;let f=0;if(f=l(f,0,0),f=l(f,1,n),f=l(f,2,r),f=l(f,3,s),f=l(f,4,o),f=l(f,5,a),f=l(f,6,h),f=l(f,7,p),i.push(f),i.push(e.a,e.b,e.c),i.push(e.materialIndex),s){const e=this.faceVertexUvs[0][t];i.push(d(e[0]),d(e[1]),d(e[2]))}if(o&&i.push(c(e.normal)),a){const t=e.vertexNormals;i.push(c(t[0]),c(t[1]),c(t[2]))}if(h&&i.push(u(e.color)),p){const t=e.vertexColors;i.push(u(t[0]),u(t[1]),u(t[2]))}}function l(t,e,i){return i?t|1<0&&(t.data.colors=s),a.length>0&&(t.data.uvs=[a]),t.data.faces=i,t},clone:function(){return(new a).copy(this)},copy:function(t){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;const e=t.vertices;for(let t=0,i=e.length;t0){const i=new Float32Array(3*t.normals.length);e.setAttribute("normal",new n.BufferAttribute(i,3).copyVector3sArray(t.normals))}if(t.colors.length>0){const i=new Float32Array(3*t.colors.length);e.setAttribute("color",new n.BufferAttribute(i,3).copyColorsArray(t.colors))}if(t.uvs.length>0){const i=new Float32Array(2*t.uvs.length);e.setAttribute("uv",new n.BufferAttribute(i,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){const i=new Float32Array(2*t.uvs2.length);e.setAttribute("uv2",new n.BufferAttribute(i,2).copyVector2sArray(t.uvs2))}e.groups=t.groups;for(const i in t.morphTargets){const r=[],s=t.morphTargets[i];for(let t=0,e=s.length;t0){const i=new n.Float32BufferAttribute(4*t.skinIndices.length,4);e.setAttribute("skinIndex",i.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){const i=new n.Float32BufferAttribute(4*t.skinWeights.length,4);e.setAttribute("skinWeight",i.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(e.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(e.boundingBox=t.boundingBox.clone()),e},computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(t){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)},dispose:function(){this.dispatchEvent({type:"dispose"})}}),a.createBufferGeometryFromObject=function(t){let e=new n.BufferGeometry;const i=t.geometry;if(t.isPoints||t.isLine){const t=new n.Float32BufferAttribute(3*i.vertices.length,3),r=new n.Float32BufferAttribute(3*i.colors.length,3);if(e.setAttribute("position",t.copyVector3sArray(i.vertices)),e.setAttribute("color",r.copyColorsArray(i.colors)),i.lineDistances&&i.lineDistances.length===i.vertices.length){const t=new n.Float32BufferAttribute(i.lineDistances.length,1);e.setAttribute("lineDistance",t.copyArray(i.lineDistances))}null!==i.boundingSphere&&(e.boundingSphere=i.boundingSphere.clone()),null!==i.boundingBox&&(e.boundingBox=i.boundingBox.clone())}else t.isMesh&&(e=i.toBufferGeometry());return e};class h{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(t){const e=[];let i,n,r=void 0;const s=t.faces;for(n=0;n0,o=r[1]&&r[1].length>0,a=t.morphTargets,h=a.length;let l;if(h>0){l=[];for(let t=0;t0){d=[];for(let t=0;t0&&0===e.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let t=0;t1){var y=Math.sqrt(v);p=(e*=y)*e,f=(i*=y)*i}var x=p*g+f*m,b=(p*f-x)/x,w=Math.sqrt(Math.max(0,b));s===o&&(w=-w);var T=w*e*d/i,_=-w*i*u/e,E=Math.cos(r)*T-Math.sin(r)*_+(a.x+h.x)/2,S=Math.sin(r)*T+Math.cos(r)*_+(a.y+h.y)/2,M=n(1,0,(u-T)/e,(d-_)/i),A=n((u-T)/e,(d-_)/i,(-u-T)/e,(-d-_)/i)%(2*Math.PI);t.currentPath.absellipse(E,S,e,i,M,M+A,0===o,r)}else t.lineTo(h.x,h.y)}function n(t,e,i,n){var r=t*i+e*n,s=Math.sqrt(t*t+e*e)*Math.sqrt(i*i+n*n),o=Math.acos(Math.max(-1,Math.min(1,r/s)));return t*n-e*i<0&&(o=-o),o}function r(t,e){e=Object.assign({},e);var i={};if(t.hasAttribute("class"))for(var n=t.getAttribute("class").split(/\s/).filter(Boolean).map(t=>t.trim()),r=0;r=0;a--){var h=s[a].trim();if(""!==h){var c=h.indexOf("("),u=h.length;if(c>0&&c=1){r=n=p[0];p.length>=2&&(r=p[1]),i.translate(n,r)}break;case"rotate":if(p.length>=1){var f,x=0,w=0;f=-p[0]*Math.PI/180,p.length>=3&&(x=p[1],w=p[2]),g.identity().translate(-x,-w),v.identity().rotate(f),y.multiplyMatrices(v,g),g.identity().translate(x,w),i.multiplyMatrices(g,y)}break;case"scale":if(p.length>=1){var T=p[0],_=T;p.length>=2&&(_=p[1]),i.scale(T,_)}break;case"skewX":1===p.length&&i.set(1,Math.tan(p[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":1===p.length&&i.set(1,0,0,Math.tan(p[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":6===p.length&&i.set(p[0],p[2],p[4],p[1],p[3],p[5],0,0,1)}}e.premultiply(i)}}return e}(t);f.length>0&&e.premultiply(f[f.length-1]);return T.copy(e),f.push(e),e}(e),h=!0,_=null;switch(e.nodeName){case"svg":break;case"style":!function(t){if(!t.sheet||!t.sheet.cssRules||!t.sheet.cssRules.length)return;for(var e=0;et.trim()),r=0;r0&&(n.copy(a),e.currentPath.currentPoint.copy(n),h=!0);break;default:console.warn(p)}l=!1}return e}(e));break;case"rect":n=r(e,n),_=function(t){var e=l(t.getAttribute("x")||0),i=l(t.getAttribute("y")||0),n=l(t.getAttribute("rx")||0),r=l(t.getAttribute("ry")||0),s=l(t.getAttribute("width")),o=l(t.getAttribute("height")),a=new b.ShapePath;a.moveTo(e+2*n,i),a.lineTo(e+s-2*n,i),(0!==n||0!==r)&&a.bezierCurveTo(e+s,i,e+s,i,e+s,i+2*r);a.lineTo(e+s,i+o-2*r),(0!==n||0!==r)&&a.bezierCurveTo(e+s,i+o,e+s,i+o,e+s-2*n,i+o);a.lineTo(e+2*n,i+o),(0!==n||0!==r)&&a.bezierCurveTo(e,i+o,e,i+o,e,i+o-2*r);a.lineTo(e,i+2*r),(0!==n||0!==r)&&a.bezierCurveTo(e,i,e,i,e+2*n,i);return a}(e);break;case"polygon":n=r(e,n),_=function(t){function e(t,e,r){var s=l(e),o=l(r);0===n?i.moveTo(s,o):i.lineTo(s,o),n++}var i=new b.ShapePath,n=0;return t.getAttribute("points").replace(/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,e),i.currentPath.autoClose=!0,i}(e);break;case"polyline":n=r(e,n),_=function(t){function e(t,e,r){var s=l(e),o=l(r);0===n?i.moveTo(s,o):i.lineTo(s,o),n++}var i=new b.ShapePath,n=0;return t.getAttribute("points").replace(/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,e),i.currentPath.autoClose=!1,i}(e);break;case"circle":n=r(e,n),_=function(t){var e=l(t.getAttribute("cx")),i=l(t.getAttribute("cy")),n=l(t.getAttribute("r")),r=new b.Path;r.absarc(e,i,n,0,2*Math.PI);var s=new b.ShapePath;return s.subPaths.push(r),s}(e);break;case"ellipse":n=r(e,n),_=function(t){var e=l(t.getAttribute("cx")),i=l(t.getAttribute("cy")),n=l(t.getAttribute("rx")),r=l(t.getAttribute("ry")),s=new b.Path;s.absellipse(e,i,n,r,0,2*Math.PI);var o=new b.ShapePath;return o.subPaths.push(s),o}(e);break;case"line":n=r(e,n),_=function(t){var e=l(t.getAttribute("x1")),i=l(t.getAttribute("y1")),n=l(t.getAttribute("x2")),r=l(t.getAttribute("y2")),s=new b.ShapePath;return s.moveTo(e,i),s.lineTo(n,r),s.currentPath.autoClose=!1,s}(e);break;case"defs":h=!1;break;case"use":n=r(e,n);var E=e.href.baseVal.substring(1),S=e.viewportElement.getElementById(E);S?t(S,n):console.warn("SVGLoader: 'use node' references non-existent node id: "+E)}if(_&&(void 0!==n.fill&&"none"!==n.fill&&_.color.setStyle(n.fill),function(t,e){function i(t){w.set(t.x,t.y,1).applyMatrix3(e),t.set(w.x,w.y)}for(var n=function(t){return 0!==t.elements[1]||0!==t.elements[3]}(e),r=t.subPaths,s=0,o=r.length;s0?T.copy(f[f.length-1]):T.identity())}}(_.documentElement,{fill:"#000",fillOpacity:1,strokeOpacity:1,strokeWidth:1,strokeLineJoin:"miter",strokeLineCap:"butt",strokeMiterLimit:4}),{paths:d,xml:_.documentElement}}}),w.getStrokeStyle=function(t,e,i,n,r){return{strokeColor:e=void 0!==e?e:"#000",strokeWidth:t=void 0!==t?t:1,strokeLineJoin:i=void 0!==i?i:"miter",strokeLineCap:n=void 0!==n?n:"butt",strokeMiterLimit:r=void 0!==r?r:4}},w.pointsToStroke=function(t,e,i,n){var r=[],s=[],o=[];if(0===w.pointsToStrokeWithBuffers(t,e,i,n,r,s,o))return null;var a=new b.BufferGeometry;return a.setAttribute("position",new b.Float32BufferAttribute(r,3)),a.setAttribute("normal",new b.Float32BufferAttribute(s,3)),a.setAttribute("uv",new b.Float32BufferAttribute(o,2)),a},w.pointsToStrokeWithBuffers=(n=new b.Vector2,r=new b.Vector2,s=new b.Vector2,o=new b.Vector2,a=new b.Vector2,h=new b.Vector2,l=new b.Vector2,c=new b.Vector2,u=new b.Vector2,d=new b.Vector2,p=new b.Vector2,f=new b.Vector2,m=new b.Vector2,g=new b.Vector2,v=new b.Vector2,y=new b.Vector2,x=new b.Vector2,function(t,e,i,b,w,T,_,E){i=void 0!==i?i:12,b=void 0!==b?b:.001,E=void 0!==E?E:0;var S=(t=function(t){for(var e=!1,i=1,n=t.length-1;i=b&&r.push(t[i]);return r.push(t[t.length-1]),r}(t)).length;if(S<2)return 0;var M,A,C,P,R,L=t[0].equals(t[S-1]),O=t[0],D=e.strokeWidth/2,I=1/(S-1),F=0,B=!1,k=0,N=3*E,U=2*E;J(t[0],t[1],n).multiplyScalar(D),c.copy(t[0]).sub(n),u.copy(t[0]).add(n),d.copy(c),p.copy(u);for(var z=1;z","#include ","}"].join("\n")}},function(t,e,i){"use strict";i.r(e),i.d(e,"OrbitControls",(function(){return r})),i.d(e,"MapControls",(function(){return s}));var n=i(0),r=function(t,e){var i,r,s,o,a,h;void 0===e&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),e===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=t,this.domElement=e,this.enabled=!0,this.target=new n.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:n.MOUSE.ROTATE,MIDDLE:n.MOUSE.DOLLY,RIGHT:n.MOUSE.PAN},this.touches={ONE:n.TOUCH.ROTATE,TWO:n.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return g.phi},this.getAzimuthalAngle=function(){return g.theta},this.listenToKeyEvents=function(t){t.addEventListener("keydown",J),this._domElementKeyEvents=t},this.saveState=function(){l.target0.copy(l.target),l.position0.copy(l.object.position),l.zoom0=l.object.zoom},this.reset=function(){l.target.copy(l.target0),l.object.position.copy(l.position0),l.object.zoom=l.zoom0,l.object.updateProjectionMatrix(),l.dispatchEvent(c),l.update(),f=p.NONE},this.update=(i=new n.Vector3,r=(new n.Quaternion).setFromUnitVectors(t.up,new n.Vector3(0,1,0)),s=r.clone().invert(),o=new n.Vector3,a=new n.Quaternion,h=2*Math.PI,function(){var t=l.object.position;i.copy(t).sub(l.target),i.applyQuaternion(r),g.setFromVector3(i),l.autoRotate&&f===p.NONE&&L(2*Math.PI/60/60*l.autoRotateSpeed),l.enableDamping?(g.theta+=v.theta*l.dampingFactor,g.phi+=v.phi*l.dampingFactor):(g.theta+=v.theta,g.phi+=v.phi);var e=l.minAzimuthAngle,n=l.maxAzimuthAngle;return isFinite(e)&&isFinite(n)&&(e<-Math.PI?e+=h:e>Math.PI&&(e-=h),n<-Math.PI?n+=h:n>Math.PI&&(n-=h),g.theta=e<=n?Math.max(e,Math.min(n,g.theta)):g.theta>(e+n)/2?Math.max(e,g.theta):Math.min(n,g.theta)),g.phi=Math.max(l.minPolarAngle,Math.min(l.maxPolarAngle,g.phi)),g.makeSafe(),g.radius*=y,g.radius=Math.max(l.minDistance,Math.min(l.maxDistance,g.radius)),!0===l.enableDamping?l.target.addScaledVector(x,l.dampingFactor):l.target.add(x),i.setFromSpherical(g),i.applyQuaternion(s),t.copy(l.target).add(i),l.object.lookAt(l.target),!0===l.enableDamping?(v.theta*=1-l.dampingFactor,v.phi*=1-l.dampingFactor,x.multiplyScalar(1-l.dampingFactor)):(v.set(0,0,0),x.set(0,0,0)),y=1,!!(b||o.distanceToSquared(l.object.position)>m||8*(1-a.dot(l.object.quaternion))>m)&&(l.dispatchEvent(c),o.copy(l.object.position),a.copy(l.object.quaternion),b=!1,!0)}),this.dispose=function(){l.domElement.removeEventListener("contextmenu",et),l.domElement.removeEventListener("pointerdown",Y),l.domElement.removeEventListener("wheel",K),l.domElement.removeEventListener("touchstart",Q),l.domElement.removeEventListener("touchend",tt),l.domElement.removeEventListener("touchmove",$),l.domElement.ownerDocument.removeEventListener("pointermove",q),l.domElement.ownerDocument.removeEventListener("pointerup",Z),null!==l._domElementKeyEvents&&l._domElementKeyEvents.removeEventListener("keydown",J)};var l=this,c={type:"change"},u={type:"start"},d={type:"end"},p={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},f=p.NONE,m=1e-6,g=new n.Spherical,v=new n.Spherical,y=1,x=new n.Vector3,b=!1,w=new n.Vector2,T=new n.Vector2,_=new n.Vector2,E=new n.Vector2,S=new n.Vector2,M=new n.Vector2,A=new n.Vector2,C=new n.Vector2,P=new n.Vector2;function R(){return Math.pow(.95,l.zoomSpeed)}function L(t){v.theta-=t}function O(t){v.phi-=t}var D,I=(D=new n.Vector3,function(t,e){D.setFromMatrixColumn(e,0),D.multiplyScalar(-t),x.add(D)}),F=function(){var t=new n.Vector3;return function(e,i){!0===l.screenSpacePanning?t.setFromMatrixColumn(i,1):(t.setFromMatrixColumn(i,0),t.crossVectors(l.object.up,t)),t.multiplyScalar(e),x.add(t)}}(),B=function(){var t=new n.Vector3;return function(e,i){var n=l.domElement;if(l.object.isPerspectiveCamera){var r=l.object.position;t.copy(r).sub(l.target);var s=t.length();s*=Math.tan(l.object.fov/2*Math.PI/180),I(2*e*s/n.clientHeight,l.object.matrix),F(2*i*s/n.clientHeight,l.object.matrix)}else l.object.isOrthographicCamera?(I(e*(l.object.right-l.object.left)/l.object.zoom/n.clientWidth,l.object.matrix),F(i*(l.object.top-l.object.bottom)/l.object.zoom/n.clientHeight,l.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),l.enablePan=!1)}}();function k(t){l.object.isPerspectiveCamera?y/=t:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom*t)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function N(t){l.object.isPerspectiveCamera?y*=t:l.object.isOrthographicCamera?(l.object.zoom=Math.max(l.minZoom,Math.min(l.maxZoom,l.object.zoom/t)),l.object.updateProjectionMatrix(),b=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),l.enableZoom=!1)}function U(t){w.set(t.clientX,t.clientY)}function z(t){E.set(t.clientX,t.clientY)}function G(t){if(1==t.touches.length)w.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),i=.5*(t.touches[0].pageY+t.touches[1].pageY);w.set(e,i)}}function V(t){if(1==t.touches.length)E.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),i=.5*(t.touches[0].pageY+t.touches[1].pageY);E.set(e,i)}}function H(t){var e=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(e*e+i*i);A.set(0,n)}function W(t){if(1==t.touches.length)T.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),i=.5*(t.touches[0].pageY+t.touches[1].pageY);T.set(e,i)}_.subVectors(T,w).multiplyScalar(l.rotateSpeed);var n=l.domElement;L(2*Math.PI*_.x/n.clientHeight),O(2*Math.PI*_.y/n.clientHeight),w.copy(T)}function X(t){if(1==t.touches.length)S.set(t.touches[0].pageX,t.touches[0].pageY);else{var e=.5*(t.touches[0].pageX+t.touches[1].pageX),i=.5*(t.touches[0].pageY+t.touches[1].pageY);S.set(e,i)}M.subVectors(S,E).multiplyScalar(l.panSpeed),B(M.x,M.y),E.copy(S)}function j(t){var e=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(e*e+i*i);C.set(0,n),P.set(0,Math.pow(C.y/A.y,l.zoomSpeed)),k(P.y),A.copy(C)}function Y(t){if(!1!==l.enabled)switch(t.pointerType){case"mouse":case"pen":!function(t){var e;switch(t.preventDefault(),l.domElement.focus?l.domElement.focus():window.focus(),t.button){case 0:e=l.mouseButtons.LEFT;break;case 1:e=l.mouseButtons.MIDDLE;break;case 2:e=l.mouseButtons.RIGHT;break;default:e=-1}switch(e){case n.MOUSE.DOLLY:if(!1===l.enableZoom)return;!function(t){A.set(t.clientX,t.clientY)}(t),f=p.DOLLY;break;case n.MOUSE.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===l.enablePan)return;z(t),f=p.PAN}else{if(!1===l.enableRotate)return;U(t),f=p.ROTATE}break;case n.MOUSE.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===l.enableRotate)return;U(t),f=p.ROTATE}else{if(!1===l.enablePan)return;z(t),f=p.PAN}break;default:f=p.NONE}f!==p.NONE&&(l.domElement.ownerDocument.addEventListener("pointermove",q),l.domElement.ownerDocument.addEventListener("pointerup",Z),l.dispatchEvent(u))}(t)}}function q(t){if(!1!==l.enabled)switch(t.pointerType){case"mouse":case"pen":!function(t){if(!1===l.enabled)return;switch(t.preventDefault(),f){case p.ROTATE:if(!1===l.enableRotate)return;!function(t){T.set(t.clientX,t.clientY),_.subVectors(T,w).multiplyScalar(l.rotateSpeed);var e=l.domElement;L(2*Math.PI*_.x/e.clientHeight),O(2*Math.PI*_.y/e.clientHeight),w.copy(T),l.update()}(t);break;case p.DOLLY:if(!1===l.enableZoom)return;!function(t){C.set(t.clientX,t.clientY),P.subVectors(C,A),P.y>0?k(R()):P.y<0&&N(R()),A.copy(C),l.update()}(t);break;case p.PAN:if(!1===l.enablePan)return;!function(t){S.set(t.clientX,t.clientY),M.subVectors(S,E).multiplyScalar(l.panSpeed),B(M.x,M.y),E.copy(S),l.update()}(t)}}(t)}}function Z(t){switch(t.pointerType){case"mouse":case"pen":!function(t){if(l.domElement.ownerDocument.removeEventListener("pointermove",q),l.domElement.ownerDocument.removeEventListener("pointerup",Z),!1===l.enabled)return;l.dispatchEvent(d),f=p.NONE}()}}function K(t){!1===l.enabled||!1===l.enableZoom||f!==p.NONE&&f!==p.ROTATE||(t.preventDefault(),t.stopPropagation(),l.dispatchEvent(u),function(t){t.deltaY<0?N(R()):t.deltaY>0&&k(R()),l.update()}(t),l.dispatchEvent(d))}function J(t){!1!==l.enabled&&!1!==l.enablePan&&function(t){var e=!1;switch(t.keyCode){case l.keys.UP:B(0,l.keyPanSpeed),e=!0;break;case l.keys.BOTTOM:B(0,-l.keyPanSpeed),e=!0;break;case l.keys.LEFT:B(l.keyPanSpeed,0),e=!0;break;case l.keys.RIGHT:B(-l.keyPanSpeed,0),e=!0}e&&(t.preventDefault(),l.update())}(t)}function Q(t){if(!1!==l.enabled){switch(t.preventDefault(),t.touches.length){case 1:switch(l.touches.ONE){case n.TOUCH.ROTATE:if(!1===l.enableRotate)return;G(t),f=p.TOUCH_ROTATE;break;case n.TOUCH.PAN:if(!1===l.enablePan)return;V(t),f=p.TOUCH_PAN;break;default:f=p.NONE}break;case 2:switch(l.touches.TWO){case n.TOUCH.DOLLY_PAN:if(!1===l.enableZoom&&!1===l.enablePan)return;!function(t){l.enableZoom&&H(t),l.enablePan&&V(t)}(t),f=p.TOUCH_DOLLY_PAN;break;case n.TOUCH.DOLLY_ROTATE:if(!1===l.enableZoom&&!1===l.enableRotate)return;!function(t){l.enableZoom&&H(t),l.enableRotate&&G(t)}(t),f=p.TOUCH_DOLLY_ROTATE;break;default:f=p.NONE}break;default:f=p.NONE}f!==p.NONE&&l.dispatchEvent(u)}}function $(t){if(!1!==l.enabled)switch(t.preventDefault(),t.stopPropagation(),f){case p.TOUCH_ROTATE:if(!1===l.enableRotate)return;W(t),l.update();break;case p.TOUCH_PAN:if(!1===l.enablePan)return;X(t),l.update();break;case p.TOUCH_DOLLY_PAN:if(!1===l.enableZoom&&!1===l.enablePan)return;!function(t){l.enableZoom&&j(t),l.enablePan&&X(t)}(t),l.update();break;case p.TOUCH_DOLLY_ROTATE:if(!1===l.enableZoom&&!1===l.enableRotate)return;!function(t){l.enableZoom&&j(t),l.enableRotate&&W(t)}(t),l.update();break;default:f=p.NONE}}function tt(t){!1!==l.enabled&&(l.dispatchEvent(d),f=p.NONE)}function et(t){!1!==l.enabled&&t.preventDefault()}l.domElement.addEventListener("contextmenu",et),l.domElement.addEventListener("pointerdown",Y),l.domElement.addEventListener("wheel",K),l.domElement.addEventListener("touchstart",Q),l.domElement.addEventListener("touchend",tt),l.domElement.addEventListener("touchmove",$),this.update()};r.prototype=Object.create(n.EventDispatcher.prototype),r.prototype.constructor=r;var s=function(t,e){r.call(this,t,e),this.screenSpacePanning=!1,this.mouseButtons.LEFT=n.MOUSE.PAN,this.mouseButtons.RIGHT=n.MOUSE.ROTATE,this.touches.ONE=n.TOUCH.PAN,this.touches.TWO=n.TOUCH.DOLLY_ROTATE};s.prototype=Object.create(n.EventDispatcher.prototype),s.prototype.constructor=s},function(t,e,i){"use strict";i.r(e),i.d(e,"WEBGL",(function(){return n}));var n={isWebGLAvailable:function(){try{var t=document.createElement("canvas");return!(!window.WebGLRenderingContext||!t.getContext("webgl")&&!t.getContext("experimental-webgl"))}catch(t){return!1}},isWebGL2Available:function(){try{var t=document.createElement("canvas");return!(!window.WebGL2RenderingContext||!t.getContext("webgl2"))}catch(t){return!1}},getWebGLErrorMessage:function(){return this.getErrorMessage(1)},getWebGL2ErrorMessage:function(){return this.getErrorMessage(2)},getErrorMessage:function(t){var e={1:window.WebGLRenderingContext,2:window.WebGL2RenderingContext},i='Your $0 does not seem to support $1',n=document.createElement("div");return n.id="webglmessage",n.style.fontFamily="monospace",n.style.fontSize="13px",n.style.fontWeight="normal",n.style.textAlign="center",n.style.background="#fff",n.style.color="#000",n.style.padding="1.5em",n.style.width="400px",n.style.margin="5em auto 0",i=(i=e[t]?i.replace("$0","graphics card"):i.replace("$0","browser")).replace("$1",{1:"WebGL",2:"WebGL 2"}[t]),n.innerHTML=i,n}}},function(t,e,i){"use strict";i.r(e),i.d(e,"RenderPass",(function(){return s}));var n=i(0),r=i(3),s=function(t,e,i,s,o){r.a.call(this),this.scene=t,this.camera=e,this.overrideMaterial=i,this.clearColor=s,this.clearAlpha=void 0!==o?o:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new n.Color};s.prototype=Object.assign(Object.create(r.a.prototype),{constructor:s,render:function(t,e,i){var n,r,s=t.autoClear;t.autoClear=!1,void 0!==this.overrideMaterial&&(r=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),this.clearColor&&(t.getClearColor(this._oldClearColor),n=t.getClearAlpha(),t.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&t.clearDepth(),t.setRenderTarget(this.renderToScreen?null:i),this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),t.render(this.scene,this.camera),this.clearColor&&t.setClearColor(this._oldClearColor,n),void 0!==this.overrideMaterial&&(this.scene.overrideMaterial=r),t.autoClear=s}})},function(t,e,i){"use strict";i.r(e),i.d(e,"DotScreenShader",(function(){return r}));var n=i(0),r={uniforms:{tDiffuse:{value:null},tSize:{value:new n.Vector2(256,256)},center:{value:new n.Vector2(.5,.5)},angle:{value:1.57},scale:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec2 center;","uniform float angle;","uniform float scale;","uniform vec2 tSize;","uniform sampler2D tDiffuse;","varying vec2 vUv;","float pattern() {","\tfloat s = sin( angle ), c = cos( angle );","\tvec2 tex = vUv * tSize - center;","\tvec2 point = vec2( c * tex.x - s * tex.y, s * tex.x + c * tex.y ) * scale;","\treturn ( sin( point.x ) * sin( point.y ) ) * 4.0;","}","void main() {","\tvec4 color = texture2D( tDiffuse, vUv );","\tfloat average = ( color.r + color.g + color.b ) / 3.0;","\tgl_FragColor = vec4( vec3( average * 10.0 - 5.0 + pattern() ), color.a );","}"].join("\n")}},function(t,e,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[i]}})}:function(t,e,i,n){void 0===n&&(n=i),t[n]=e[i]}),r=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),i(37),i(38),r(i(39),e)},function(t,e,i){},function(t,e,i){},function(t,e,i){"use strict"; /** * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */Object.defineProperty(e,"__esModule",{value:!0}),e.AmmoPhysics=e.Clock=e.Types=e.AllHitsRaycaster=e.ClosestRaycaster=e.PhysicsLoader=e.ExtendedGroup=e.ExtendedMesh=e.ExtendedObject3D=void 0;const n=i(9),r=i(40),s=i(10);Object.defineProperty(e,"ExtendedObject3D",{enumerable:!0,get:function(){return s.ExtendedObject3D}});const o=i(6);Object.defineProperty(e,"ExtendedMesh",{enumerable:!0,get:function(){return o.ExtendedMesh}});const a=i(15);Object.defineProperty(e,"ExtendedGroup",{enumerable:!0,get:function(){return a.ExtendedGroup}});const h=i(41),l=i(42),c=i(5),u=i(2),d=i(43),p=i(44),f=i(16),m=i(45),g=i(46),v=i(47),y=i(11);Object.defineProperty(e,"PhysicsLoader",{enumerable:!0,get:function(){return y.PhysicsLoader}});const x=i(17),b=i(4);e.Types=b;const w=i(48);Object.defineProperty(e,"ClosestRaycaster",{enumerable:!0,get:function(){return w.ClosestRaycaster}}),Object.defineProperty(e,"AllHitsRaycaster",{enumerable:!0,get:function(){return w.AllHitsRaycaster}});var T=i(52);Object.defineProperty(e,"Clock",{enumerable:!0,get:function(){return T.Clock}});class _ extends c.EventEmitter{constructor(t,e={}){super(),this.scene=t,this.config=e,this.rigidBodies=[],this.earlierDetectedCollisions=[],this.complexShapes=["plane","hull","hacd","vhacd","convexMesh","concaveMesh"],this.gravity=e.gravity||{x:0,y:-9.81,z:0},this.isHeadless="headless"===t,this.tmpEuler=new u.Euler,this.tmpQuaternion=new u.Quaternion,this.tmpVector3=new u.Vector3,this.tmpVector3a=new u.Vector3,this.tmpMatrix4=new u.Matrix4,this.tmpMatrix4a=new u.Matrix4,this.tmpBtVector3=new Ammo.btVector3,this.tmpBtQuaternion=new Ammo.btQuaternion(0,0,0,1),this.emptyV3=new u.Vector3,this.impactPoint=new u.Vector3,this.impactNormal=new u.Vector3,"headless"!==t&&(this.defaultMaterial=new x.default),this.start()}get tmpTrans(){return console.warn("Use worldTransform instead of tmpTrans."),this.worldTransform}set tmpTrans(t){console.warn("Use worldTransform instead of tmpTrans."),this.worldTransform=t}destroy(t){var e;const i=Object.keys(t).includes("body")?t.body:t;if(void 0===(null==i?void 0:i.ammo))return;const n=i.ammo.name;let r=i.ammo.threeObject;if(n&&r&&(null===(e=null==r?void 0:r.body)||void 0===e?void 0:e.ammo)){r.body.isSoftBody?this.physicsWorld.removeSoftBody(r.body.ammo):this.physicsWorld.removeRigidBody(r.body.ammo),r.body.destructor(),r.body=void 0,r.hasBody=!1,delete i.ammo.threeObject;for(let t=0;tthis.addExisting(t,e)),this.constraints=new l.default(this.worldTransform,this.physicsWorld),"headless"!==this.scene&&(this.debugDrawer=new g.default(this.scene,this.physicsWorld,{}))}updateDebugger(){"headless"!==this.scene&&this.debugDrawer&&this.debugDrawer.enabled&&this.debugDrawer.update()}setupPhysicsWorld(){const t=this.gravity,{softBodies:e=!1}=this.config;let i;if(!e){const t=new Ammo.btDefaultCollisionConfiguration,e=new Ammo.btCollisionDispatcher(t),n=new Ammo.btDbvtBroadphase,r=new Ammo.btSequentialImpulseConstraintSolver;i=new Ammo.btDiscreteDynamicsWorld(e,n,r,t)}if(e){const t=new Ammo.btSoftBodyRigidBodyCollisionConfiguration,e=new Ammo.btCollisionDispatcher(t),n=new Ammo.btDbvtBroadphase,r=new Ammo.btSequentialImpulseConstraintSolver,s=new Ammo.btDefaultSoftBodySolver;i=new Ammo.btSoftRigidDynamicsWorld(e,n,r,t,s)}return i.setGravity(new Ammo.btVector3(t.x,t.y,t.z)),i}createDebrisFromBreakableObject(t,e){"headless"!==this.scene&&(t.material=this.defaultMaterial.get(),t.shape="hull",t.fragmentDepth=e.fragmentDepth+1,this.scene.add(t),this.addExisting(t),t.body.breakable=!1,setTimeout(()=>{t.body.breakable=!0},2500))}removeDebris(t){"headless"!==this.scene&&(this.scene.remove(t),this.destroy(t))}update(t){this.updatePhysics(t),this.detectCollisions()}updatePhysics(t){const e=t/1e3;this.physicsWorld.stepSimulation(e,this.config.maxSubSteps||4,this.config.fixedTimeStep||1/60);for(let t=0;t=123?this.tmpMatrix4a.copy(e.parent.matrixWorld).invert():this.tmpMatrix4a.getInverse(e.parent.matrixWorld):this.tmpMatrix4a.identity(),this.tmpMatrix4a.multiply(this.tmpMatrix4),this.tmpMatrix4a.decompose(e.position,e.quaternion,e.scale)}}}detectCollisions(){var t,e;const i=[];this.impactPoint.set(0,0,0),this.impactNormal.set(0,0,0);const n=this.physicsWorld.getDispatcher(),r=n.getNumManifolds();for(let s=0;st.combinedName===e)&&(y="collision"),i.find(t=>t.combinedName===e)||(i.push({combinedName:e,collision:!0}),this.collisionEvents.emit("collision",{bodies:[l,c],event:y}))}t>=v&&(v=t,(p||f)&&(this.impactPoint.set(n.x(),n.y(),n.z()),this.impactNormal.set(r.x(),r.y(),r.z())));break}}if(!g)continue;if(!m)continue;const x=5,b=2;if(this.emptyV3.set(0,0,0),l.userData.ammoPhysicsData={mass:1,velocity:this.emptyV3,angularVelocity:this.emptyV3,breakable:p,physicsBody:a},c.userData.ammoPhysicsData={mass:1,velocity:this.emptyV3,angularVelocity:this.emptyV3,breakable:f,physicsBody:h},void 0===l.fragmentDepth&&(l.fragmentDepth=0),void 0===c.fragmentDepth&&(c.fragmentDepth=0),p&&v>x&&l.fragmentDepthx&&c.fragmentDepth{const{combinedName:e}=t;if(!i.find(t=>t.combinedName===e)){const t=e.split("__"),i=this.rigidBodies.find(e=>e.name===t[0]),n=this.rigidBodies.find(e=>e.name===t[1]),r="end";i&&n&&this.collisionEvents.emit("collision",{bodies:[i,n],event:r})}}),this.earlierDetectedCollisions=[...i]}setGravity(t=0,e=-9.8,i=0){this.tmpBtVector3.setValue(t,e,i),this.physicsWorld.setGravity(this.tmpBtVector3)}get debug(){return this.isHeadless?null:{enable:()=>{this.debugDrawer.enable()},mode:(t=1)=>{this.debugDrawer.setDebugMode(t)},disable:()=>{this.debugDrawer.disable()}}}start(){"undefined"!=typeof Ammo?"function"==typeof Ammo?Ammo().then(()=>{this.setup()}):this.setup():n.default("Are you sure you included ammo.js?")}get add(){return{collider:(t,e,i)=>this.collisionEvents.addCollider(t,e,i),constraints:this.constraints.addConstraints,existing:(t,e)=>this.addExisting(t,e),plane:(t={},e={})=>this.shapes.addPlane(t,e),sphere:(t={},e={})=>this.shapes.addSphere(t,e),ground:(t={},e={})=>this.shapes.addGround(t,e),box:(t={},e={})=>this.shapes.addBox(t,e),cylinder:(t={},e={})=>this.shapes.addCylinder(t,e),cone:(t={},e={})=>this.shapes.addCone(t,e),torus:(t={},e={})=>this.shapes.addTorus(t,e),extrude:(t,e={})=>this.shapes.addExtrude(t,e),raycaster:(t="closest")=>"closest"===t?new w.ClosestRaycaster(this):new w.AllHitsRaycaster(this)}}prepareThreeObjectForCollisionShape(t,e={}){var i,r;const{autoCenter:s=!1}=e,o={width:1,height:1,depth:1,radius:1,radiusTop:1,radiusBottom:1,tube:.4,tubularSegments:6};let a="unknown";const h=(null===(i=t.geometry)||void 0===i?void 0:i.type)||"unknown";/box/i.test(h)?a="box":/cone/i.test(h)?a="cone":/cylinder/i.test(h)?a="cylinder":/extrude/i.test(h)?a="extrude":/plane/i.test(h)?a="plane":/sphere/i.test(h)?a="sphere":/torus/i.test(h)&&(a="torus");let l=Object.assign(Object.assign({},o),null===(r=null==t?void 0:t.geometry)||void 0===r?void 0:r.parameters);return e.shape?(l=Object.assign(Object.assign({},o),e),a=e.shape):t.shape&&(a=t.shape),Object.keys(l).forEach(t=>{void 0===l[t]&&o[t]&&(l[t]=o[t])}),s&&t.geometry.center(),"cylinder"===a&&(l.radius=e.radius||l.radiusTop),"extrude"===a&&(a="hacd"),"mesh"!==a&&"convex"!==a||(a="convexMesh"),"concave"===a&&(a="concaveMesh"),"unknown"===a&&(n.default(`Shape for ${null==t?void 0:t.name} not recognized! Will fallback to box.`),a="box"),{shape:a,params:l,object:t}}createCollisionShape(t,e,i){const n=(null==i?void 0:i.quaternion)?null==i?void 0:i.quaternion:new u.Quaternion(0,0,0,1),{axis:r="y"}=e,s=new Ammo.btVector3,o=null==i?void 0:i.geometry;i&&(null==o?void 0:o.isGeometry)&&(i.geometry=(new u.BufferGeometry).fromGeometry(o));let a,h={};switch(-1!==this.complexShapes.indexOf(t)&&(h=(t=>{const e=(new u.Matrix4).elements,i=[],n=[],r=[];return d.iterateGeometries(t,{},(t,e,s)=>{i.push(t),n.push(e),r.push(s)}),{vertices:i,matrices:n,indexes:r,matrixWorld:e}})(i)),t){case"box":s.setValue(e.width/2,e.height/2,e.depth/2),a=new Ammo.btBoxShape(s);break;case"sphere":a=new Ammo.btSphereShape(e.radius);break;case"cylinder":switch(r){case"y":s.setValue(e.radius,e.height/2,e.radius),a=new Ammo.btCylinderShape(s);break;case"x":s.setValue(e.height/2,e.radius,e.radius),a=new Ammo.btCylinderShapeX(s);break;case"z":s.setValue(e.radius,e.radius,e.height/2),a=new Ammo.btCylinderShapeZ(s)}break;case"cone":switch(r){case"y":a=new Ammo.btConeShape(e.radius,e.height);break;case"x":a=new Ammo.btConeShapeX(e.radius,e.height);break;case"z":a=new Ammo.btConeShapeZ(e.radius,e.height)}break;case"capsule":switch(r){case"y":a=new Ammo.btCapsuleShape(e.radius,e.height);break;case"x":a=new Ammo.btCapsuleShapeX(e.radius,e.height);break;case"z":a=new Ammo.btCapsuleShapeZ(e.radius,e.height)}break;case"torus":a=p.createTorusShape(e,n);break;case"plane":a=d.createTriMeshShape(h.vertices,h.matrices,h.indexes,h.matrixWorld,Object.assign(Object.assign({},e),{concave:!1}));break;case"hull":a=d.createHullShape(h.vertices,h.matrices,h.matrixWorld,e);break;case"hacd":a=d.createHACDShapes(h.vertices,h.matrices,h.indexes,h.matrixWorld,e);break;case"vhacd":a=d.createVHACDShapes(h.vertices,h.matrices,h.indexes,h.matrixWorld,e);break;case"convexMesh":a=d.createTriMeshShape(h.vertices,h.matrices,h.indexes,h.matrixWorld,Object.assign(Object.assign({},e),{concave:!1}));break;case"concaveMesh":a=d.createTriMeshShape(h.vertices,h.matrices,h.indexes,h.matrixWorld,Object.assign(Object.assign({},e),{concave:!0}))}Ammo.destroy(s);const{x:l,y:c,z:f}=e;return(l||c||f)&&(a.offset={x:l||0,y:c||0,z:f||0}),Array.isArray(a)&&(a=this.mergeCollisionShapesToCompoundShape(a)),a}mergeCollisionShapesToCompoundShape(t){const e=new Ammo.btCompoundShape;return t.forEach(t=>{const{offset:i}=t,n=new Ammo.btTransform;n.setIdentity(),i&&n.getOrigin().setValue(i.x||0,i.y||0,i.z||0),e.addChildShape(n,t)}),e}addExisting(t,e={}){const{hasBody:i}=t;if(i)return void console.warn(`[Enable3d]: Object "${t.name}" already has a physical body!`);const n=new u.Vector3,r=new u.Quaternion,s=new u.Vector3;t.getWorldPosition(n),t.getWorldQuaternion(r),t.getWorldScale(s);const o="1"===(e.collisionFlags||0).toString(2).slice(-1),a="1"===(e.collisionFlags||0).toString(2).slice(-2,-1),{shape:h="unknown",compound:l=[],mass:c=(o||a?0:1),collisionFlags:d=0,collisionGroup:p=1,collisionMask:f=-1,offset:m,breakable:g=!1,addChildren:v=!0,margin:y=.01,ignoreScale:x=!1}=e;if(x&&s.set(1,1,1),l.length>=1){const e=l.map(t=>this.createCollisionShape(t.shape,t)),i=this.mergeCollisionShapesToCompoundShape(e),o=this.finishCollisionShape(i,n,r,s,y),h=this.collisionShapeToRigidBody(i,o,c,a);return this.addRigidBodyToWorld(t,h,d,p,f,g,m),void(t.body.ignoreScale=x)}const b=[];if("unknown"!==h||t.isMesh){const i=this.prepareThreeObjectForCollisionShape(t,e),n=this.createCollisionShape(i.shape,i.params,i.object);b.push(n)}if("unknown"===h&&v&&t.children.length>=1&&t.children.forEach(t=>{if(t.isMesh){const e=this.prepareThreeObjectForCollisionShape(t),i=this.createCollisionShape(e.shape,e.params,e.object);i.offset=t.position.clone(),b.push(i)}}),0===b.length){const i=this.prepareThreeObjectForCollisionShape(t,e),n=this.createCollisionShape(i.shape,i.params,i.object);b.push(n)}const w=1===b.length?b[0]:this.mergeCollisionShapesToCompoundShape(b),T=this.finishCollisionShape(w,n,r,s,y),_=this.collisionShapeToRigidBody(w,T,c,a);this.addRigidBodyToWorld(t,_,d,p,f,g,m),t.body.ignoreScale=x}addRigidBodyToWorld(t,e,i,n,s,o,a){this.rigidBodies.push(t),this.physicsWorld.addRigidBody(e,n,s);const h=Object.values(e)[0];e.name=t.name,t.body=new r.default(this,e),t.hasBody=!0,t.ptr=h,e.threeObject=t,o&&(t.body.breakable=!0),a&&(t.body.offset=Object.assign({x:0,y:0,z:0},a)),t.body.setCollisionFlags(i)}finishCollisionShape(t,e,i,n,r){t.setMargin(r);const s=new Ammo.btQuaternion(0,0,0,1);s.setValue(i.x,i.y,i.z,i.w);const o=new Ammo.btTransform;o.setIdentity(),o.getOrigin().setValue(e.x,e.y,e.z),o.setRotation(s),Ammo.destroy(s);const a=new Ammo.btVector3(n.x,n.y,n.z);return t.setLocalScaling(a),Ammo.destroy(a),o}collisionShapeToRigidBody(t,e,i,n){const r=new Ammo.btDefaultMotionState(e),s=new Ammo.btVector3(0,0,0);i>0&&t.calculateLocalInertia(i,s);const o=new Ammo.btRigidBodyConstructionInfo(i,r,t,s),a=new Ammo.btRigidBody(o);return(i>0||n)&&a.setActivationState(4),a}}e.AmmoPhysics=_},function(t,e,i){"use strict"; /** * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */Object.defineProperty(e,"__esModule",{value:!0});const n=i(5),r=i(2);e.default=class{constructor(t,e){this.physics=t,this.ammo=e,this.ignoreScale=!1,this.isSoftBody=!1,this.offset={x:0,y:0,z:0},this.errors=[],this.checkCollisions=!1,this.breakable=!1,this.didUpdate=!1,this.skipUpdate=!1,this._emitUpdateEvents=!1,this._needUpdate=!1,this.tmpEuler=new r.Euler,this.tmpQuaternion=new r.Quaternion,this.tmpBtVector3=new Ammo.btVector3,this.tmpBtVector3_1=new Ammo.btVector3,this.tmpBtQuaternion=new Ammo.btQuaternion(0,0,0,1),this.eventEmitter=new n.EventEmitter,this.name=e.name}destructor(){this.eventEmitter&&this.eventEmitter.removeAllListeners(),Ammo.destroy(this.tmpBtVector3),Ammo.destroy(this.tmpBtVector3_1),Ammo.destroy(this.tmpBtQuaternion),Ammo.destroy(this.ammo.getCollisionShape()),Ammo.destroy(this.ammo)}setupEventEmitter(){void 0===this.eventEmitter&&(this.eventEmitter=new n.EventEmitter)}get needUpdate(){return this._needUpdate}set needUpdate(t){!t&&this._needUpdate&&(this.didUpdate=!0),this._needUpdate=t}onUpdateEvent(t,e=!1){this.setupEventEmitter(),this._emitUpdateEvents=!0,e?this.eventEmitter.once("update",()=>{t()}):this.eventEmitter.on("update",()=>{t()})}get on(){return{update:t=>this.onUpdateEvent(t),collision:t=>this.onCollision(t)}}get once(){return{update:t=>this.onUpdateEvent(t,!0)}}onCollision(t){this.checkCollisions=!0,this.physics.collisionEvents.on("collision",e=>{const{bodies:i,event:n}=e;i[0].name===this.name?t(i[1],n):i[1].name===this.name&&t(i[0],n)})}transform(){const t=this.physics.worldTransform;this.ammo.getMotionState().getWorldTransform(t)}refresh(){const t=this.physics.worldTransform;this.ammo.getMotionState().setWorldTransform(t)}setRotation(t,e,i){const n=this.tmpEuler.set(t,e,i),r=this.tmpQuaternion.set(0,0,0,1);r.setFromEuler(n),this.tmpBtQuaternion.setValue(0,0,0,1);const s=this.tmpBtQuaternion;s.setValue(r.x,r.y,r.z,r.w);this.physics.worldTransform.setRotation(s)}get rotation(){let t,e,i;const n=this.physics.worldTransform.getRotation();let r=this.tmpQuaternion.set(n.x(),n.y(),n.z(),n.w());r.w>1&&(r=r.normalize());const s=2*Math.acos(r.w),o=Math.sqrt(1-r.w*r.w);return o<.001?(t=r.x,e=r.y,i=r.z):(t=r.x/o,e=r.y/o,i=r.z/o),{x:t*s,y:e*s,z:i*s}}get quaternion(){const t=this.physics.worldTransform.getRotation();return{x:t.x(),y:t.y(),z:t.z(),w:t.w()}}setPosition(t,e,i){this.physics.worldTransform.getOrigin().setValue(t,e,i)}get position(){const t=this.physics.worldTransform;return{x:t.getOrigin().x(),y:t.getOrigin().y(),z:t.getOrigin().z()}}get velocity(){return{x:this.ammo.getLinearVelocity().x(),y:this.ammo.getLinearVelocity().y(),z:this.ammo.getLinearVelocity().z()}}get angularVelocity(){return{x:this.ammo.getAngularVelocity().x(),y:this.ammo.getAngularVelocity().y(),z:this.ammo.getAngularVelocity().z()}}setVelocity(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.setLinearVelocity(this.tmpBtVector3)}setVelocityX(t){this.tmpBtVector3.setValue(t,this.velocity.y,this.velocity.z),this.ammo.setLinearVelocity(this.tmpBtVector3)}setVelocityY(t){this.tmpBtVector3.setValue(this.velocity.x,t,this.velocity.z),this.ammo.setLinearVelocity(this.tmpBtVector3)}setVelocityZ(t){this.tmpBtVector3.setValue(this.velocity.x,this.velocity.y,t),this.ammo.setLinearVelocity(this.tmpBtVector3)}setAngularVelocity(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.setAngularVelocity(this.tmpBtVector3)}setAngularVelocityX(t){this.tmpBtVector3.setValue(t,this.angularVelocity.y,this.angularVelocity.z),this.ammo.setAngularVelocity(this.tmpBtVector3)}setAngularVelocityY(t){this.tmpBtVector3.setValue(this.angularVelocity.x,t,this.angularVelocity.z),this.ammo.setAngularVelocity(this.tmpBtVector3)}setAngularVelocityZ(t){this.tmpBtVector3.setValue(this.angularVelocity.x,this.angularVelocity.y,t),this.ammo.setAngularVelocity(this.tmpBtVector3)}applyForce(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.applyCentralImpulse(this.tmpBtVector3)}applyForceX(t){this.tmpBtVector3.setValue(t,0,0),this.ammo.applyCentralImpulse(this.tmpBtVector3)}applyForceY(t){this.tmpBtVector3.setValue(0,t,0),this.ammo.applyCentralImpulse(this.tmpBtVector3)}applyForceZ(t){this.tmpBtVector3.setValue(0,0,t),this.ammo.applyCentralImpulse(this.tmpBtVector3)}applyCentralForce(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.applyCentralForce(this.tmpBtVector3)}applyCentralImpulse(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.applyCentralImpulse(this.tmpBtVector3)}applyCentralLocalForce(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.applyCentralLocalForce(this.tmpBtVector3)}applyImpulse(t,e){this.tmpBtVector3.setValue(t.x||0,t.y||0,t.z||0),this.tmpBtVector3_1.setValue(e.x||0,e.y||0,e.z||0),this.ammo.applyImpulse(this.tmpBtVector3,this.tmpBtVector3_1)}applyLocalTorque(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.applyLocalTorque(this.tmpBtVector3)}applyTorque(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.applyTorque(this.tmpBtVector3)}applyTorqueImpulse(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.applyTorqueImpulse(this.tmpBtVector3)}setCollisionFlags(t){this.ammo.setCollisionFlags(t)}getCollisionFlags(){return this.ammo.getCollisionFlags()}setRestitution(t){this.ammo.setRestitution(t)}setBounciness(t){this.setRestitution(t)}setFriction(t){this.ammo.setFriction(t)}setDamping(t,e){this.ammo.setDamping(t,e)}setGravity(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.setGravity(this.tmpBtVector3)}setLinearFactor(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.setLinearFactor(this.tmpBtVector3)}setAngularFactor(t,e,i){this.tmpBtVector3.setValue(t,e,i),this.ammo.setAngularFactor(this.tmpBtVector3)}setCcdMotionThreshold(t){this.ammo.setCcdMotionThreshold(t)}setCcdSweptSphereRadius(t){this.ammo.setCcdSweptSphereRadius(t)}}},function(t,e,i){"use strict"; /** * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(t,e){this.factory=t,this.addExisting=e}addPlane(t={},e={}){const i=this.factory.add.plane(t,e);return this.addExisting(i,t),i}addSphere(t={},e={}){const i=this.factory.add.sphere(t,e);return this.addExisting(i,t),i}addBox(t={},e={}){const i=this.factory.add.box(t,e);return this.addExisting(i,t),i}addGround(t,e={}){const i=this.factory.add.ground(t,e),n=Object.assign(Object.assign({},t),{mass:0,collisionFlags:1});return this.addExisting(i,n),i}addCylinder(t={},e={}){const i=this.factory.add.cylinder(t,e);return this.addExisting(i,t),i}addCone(t={},e={}){const i=this.factory.add.cone(t,e);return this.addExisting(i,t),i}addTorus(t={},e={}){const i=this.factory.add.torus(t,e);return this.addExisting(i,t),i}addExtrude(t,e={}){const i=this.factory.add.extrude(t,e);return i.translateX(1),this.addExisting(i),i}}},function(t,e,i){"use strict"; /** * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(t,e){this.worldTransform=t,this.physicsWorld=e,this.tmpBtVector3=new Ammo.btVector3}toAmmoV3(t,e=0){return new Ammo.btVector3(void 0!==(null==t?void 0:t.x)?t.x:e,void 0!==(null==t?void 0:t.y)?t.y:e,void 0!==(null==t?void 0:t.z)?t.z:e)}get addConstraints(){return{lock:(t,e,i)=>this.lock(t,e,i),fixed:(t,e,i)=>this.fixed(t,e,i),pointToPoint:(t,e,i,n)=>this.pointToPoint(t,e,i,n),hinge:(t,e,i,n)=>this.hinge(t,e,i,n),slider:(t,e,i={},n)=>this.slider(t,e,i,n),spring:(t,e,i={},n)=>this.spring(t,e,i,n),coneTwist:(t,e,i={frameA:{},frameB:{}},n)=>this.coneTwist(t,e,i,n),dof:(t,e,i,n)=>this.dof(t,e,i,n)}}getTransform(t,e,i={x:0,y:0,z:0},n=!1){i=Object.assign({x:0,y:0,z:0},i);const r=new Ammo.btTransform;if(r.setIdentity(),n){const n=(s=t.getWorldTransform().getOrigin(),o=e.getWorldTransform().getOrigin(),a=(s.x()-o.x())/2+i.x,h=(s.y()-o.y())/2+i.y,l=(s.z()-o.z())/2+i.z,new Ammo.btVector3(a,h,l)),r=new Ammo.btTransform;r.setIdentity(),r.setOrigin(n);const c=t.getCenterOfMassTransform().inverse().op_mul(e.getWorldTransform());return c.op_mul(r),{transformA:c,transformB:r}}r.setOrigin(new Ammo.btVector3(i.x,i.y,i.z));return{transformA:t.getCenterOfMassTransform().inverse().op_mul(e.getWorldTransform()).op_mul(r),transformB:r};var s,o,a,h,l}lock(t,e,i=!0){const n={x:0,y:0,z:0};return this.dof(t,e,{angularLowerLimit:n,angularUpperLimit:n},i)}fixed(t,e,i=!0){const n=this.getTransform(t.ammo,e.ammo);n.transformA.setRotation(t.ammo.getWorldTransform().getRotation()),n.transformB.setRotation(e.ammo.getWorldTransform().getRotation());const r=new Ammo.btFixedConstraint(t.ammo,e.ammo,n.transformA,n.transformB);return this.physicsWorld.addConstraint(r,i),r}pointToPoint(t,e,i={},n=!0){const{pivotA:r,pivotB:s}=i,o=new Ammo.btVector3((null==r?void 0:r.x)||0,(null==r?void 0:r.y)||0,(null==r?void 0:r.z)||0),a=new Ammo.btVector3((null==s?void 0:s.x)||0,(null==s?void 0:s.y)||0,(null==s?void 0:s.z)||0),h=new Ammo.btPoint2PointConstraint(t.ammo,e.ammo,o,a);return this.physicsWorld.addConstraint(h,n),h}hinge(t,e,i={},n=!0){const{pivotA:r,pivotB:s,axisA:o,axisB:a}=i,h=new Ammo.btVector3((null==r?void 0:r.x)||0,(null==r?void 0:r.y)||0,(null==r?void 0:r.z)||0),l=new Ammo.btVector3((null==s?void 0:s.x)||0,(null==s?void 0:s.y)||0,(null==s?void 0:s.z)||0),c=new Ammo.btVector3((null==o?void 0:o.x)||0,(null==o?void 0:o.y)||0,(null==o?void 0:o.z)||0),u=new Ammo.btVector3((null==a?void 0:a.x)||0,(null==a?void 0:a.y)||0,(null==a?void 0:a.z)||0),d=new Ammo.btHingeConstraint(t.ammo,e.ammo,h,l,c,u,!0);return this.physicsWorld.addConstraint(d,n),d}slider(t,e,i={},n=!0){const r=this.getTransform(t.ammo,e.ammo),{frameA:s={},frameB:o={},linearLowerLimit:a=0,linearUpperLimit:h=0,angularLowerLimit:l=0,angularUpperLimit:c=0}=i,u=r.transformA.getRotation();u.setEulerZYX(s.x||0,s.y||0,s.z||0),r.transformA.setRotation(u);const d=r.transformB.getRotation();d.setEulerZYX(o.x||0,o.y||0,o.z||0),r.transformB.setRotation(d);const p=new Ammo.btSliderConstraint(t.ammo,e.ammo,r.transformA,r.transformB,!0);return p.setLowerLinLimit(a),p.setUpperLinLimit(h),p.setLowerAngLimit(l),p.setUpperAngLimit(c),this.physicsWorld.addConstraint(p,n),p}spring(t,e,i={},n=!0){const{stiffness:r=50,damping:s=.01,angularLock:o=!1,linearLowerLimit:a={},linearUpperLimit:h={},angularLowerLimit:l={},angularUpperLimit:c={},offset:u={},center:d=!1,enableSpring:p=!0}=i,f=Object.assign({x:0,y:0,z:0},u),m=this.getTransform(t.ammo,e.ammo,f,d),g=new Ammo.btGeneric6DofSpringConstraint(t.ammo,e.ammo,m.transformA,m.transformB,!0);this.tmpBtVector3.setValue(a.x||0,a.y||0,a.z||0),g.setLinearLowerLimit(this.tmpBtVector3),this.tmpBtVector3.setValue(h.x||0,h.y||0,h.z||0),g.setLinearUpperLimit(this.tmpBtVector3),o?(this.tmpBtVector3.setValue(0,0,0),g.setAngularLowerLimit(this.tmpBtVector3),g.setAngularUpperLimit(this.tmpBtVector3)):(console.log(l,c),g.setAngularLowerLimit(this.toAmmoV3(l,-Math.PI)),g.setAngularUpperLimit(this.toAmmoV3(c,Math.PI)));for(let t=0;t<3;t++)g.enableSpring(t,p),g.setStiffness(t,r),g.setDamping(t,s);return this.physicsWorld.addConstraint(g,n),g}coneTwist(t,e,i,n=!0){const{frameA:r,frameB:s}=i,o=new Ammo.btTransform;o.setIdentity(),o.getOrigin().setValue((null==r?void 0:r.x)||0,(null==r?void 0:r.y)||0,(null==r?void 0:r.z)||0);const a=new Ammo.btTransform;a.setIdentity(),a.getOrigin().setValue((null==s?void 0:s.x)||0,(null==s?void 0:s.y)||0,(null==s?void 0:s.z)||0);this.getTransform(t.ammo,e.ammo);const h=new Ammo.btConeTwistConstraint(e.ammo,t.ammo,o,a);return h.setAngularOnly(!0),this.physicsWorld.addConstraint(h,n),h}dof(t,e,i={},n=!0){const{offset:r,center:s=!1}=i,o=Object.assign({x:0,y:0,z:0},r),a=this.getTransform(t.ammo,e.ammo,o,s),h=new Ammo.btGeneric6DofConstraint(t.ammo,e.ammo,a.transformA,a.transformB,!0),{linearLowerLimit:l,linearUpperLimit:c,angularLowerLimit:u,angularUpperLimit:d}=i,p=this.toAmmoV3(l),f=this.toAmmoV3(c),m=this.toAmmoV3(u,-Math.PI),g=this.toAmmoV3(d,Math.PI);return h.setLinearLowerLimit(p),h.setLinearUpperLimit(f),h.setAngularLowerLimit(m),h.setAngularUpperLimit(g),Ammo.destroy(p),Ammo.destroy(f),Ammo.destroy(m),Ammo.destroy(g),this.physicsWorld.addConstraint(h,n),h}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.iterateGeometries=e.createHeightfieldTerrainShape=e.createTriMeshShape=e.createVHACDShapes=e.createHACDShapes=e.createHullShape=e.createSphereShape=e.createConeShape=e.createCapsuleShape=e.createCylinderShape=e.createBoxShape=e.createCollisionShapes=e.HEIGHTFIELD_DATA_TYPE=e.FIT=e.TYPE=void 0; /** * @author Kevin Lee (https://github.com/InfiniteLee) * @copyright Copyright (c) 2020 Kevin Lee; Project Url: https://github.com/InfiniteLee/three-to-ammo * @license {@link https://github.com/InfiniteLee/three-to-ammo/blob/master/LICENSE|MPL-2.0} */ const n=i(2);e.TYPE={BOX:"box",CYLINDER:"cylinder",SPHERE:"sphere",CAPSULE:"capsule",CONE:"cone",HULL:"hull",HACD:"hacd",VHACD:"vhacd",MESH:"mesh",HEIGHTFIELD:"heightfield"},e.FIT={ALL:"all",MANUAL:"manual"},e.HEIGHTFIELD_DATA_TYPE={short:"short",float:"float"};e.createCollisionShapes=function(t,i,n,r,s={}){switch(s.type){case e.TYPE.BOX:return[e.createBoxShape(t,i,r,s)];case e.TYPE.CYLINDER:return[e.createCylinderShape(t,i,r,s)];case e.TYPE.CAPSULE:return[e.createCapsuleShape(t,i,r,s)];case e.TYPE.CONE:return[e.createConeShape(t,i,r,s)];case e.TYPE.SPHERE:return[e.createSphereShape(t,i,r,s)];case e.TYPE.HULL:return[e.createHullShape(t,i,r,s)];case e.TYPE.HACD:return e.createHACDShapes(t,i,n,r,s);case e.TYPE.VHACD:return e.createVHACDShapes(t,i,n,r,s);case e.TYPE.MESH:return[e.createTriMeshShape(t,i,n,r,s)];case e.TYPE.HEIGHTFIELD:return[e.createHeightfieldTerrainShape(s)];default:return console.warn(s.type+" is not currently supported"),[]}};e.createBoxShape=function(t,i,n,a={}){a.type=e.TYPE.BOX,r(a),a.fit===e.FIT.ALL&&(a.halfExtents=h(l(t,i),a.minHalfExtent,a.maxHalfExtent));const c=new Ammo.btVector3(a.halfExtents.x,a.halfExtents.y,a.halfExtents.z),u=new Ammo.btBoxShape(c);return Ammo.destroy(c),s(u,a,o(n,a)),u};e.createCylinderShape=function(t,i,n,a={}){a.type=e.TYPE.CYLINDER,r(a),a.fit===e.FIT.ALL&&(a.halfExtents=h(l(t,i),a.minHalfExtent,a.maxHalfExtent));const c=new Ammo.btVector3(a.halfExtents.x,a.halfExtents.y,a.halfExtents.z),u=(()=>{switch(a.cylinderAxis){case"y":return new Ammo.btCylinderShape(c);case"x":return new Ammo.btCylinderShapeX(c);case"z":return new Ammo.btCylinderShapeZ(c)}return null})();return Ammo.destroy(c),s(u,a,o(n,a)),u};e.createCapsuleShape=function(t,i,n,a={}){a.type=e.TYPE.CAPSULE,r(a),a.fit===e.FIT.ALL&&(a.halfExtents=h(l(t,i),a.minHalfExtent,a.maxHalfExtent));const{x:c,y:u,z:d}=a.halfExtents,p=(()=>{switch(a.cylinderAxis){case"y":return new Ammo.btCapsuleShape(Math.max(c,d),2*u);case"x":return new Ammo.btCapsuleShapeX(Math.max(u,d),2*c);case"z":return new Ammo.btCapsuleShapeZ(Math.max(c,u),2*d)}return null})();return s(p,a,o(n,a)),p};e.createConeShape=function(t,i,n,a={}){a.type=e.TYPE.CONE,r(a),a.fit===e.FIT.ALL&&(a.halfExtents=h(l(t,i),a.minHalfExtent,a.maxHalfExtent));const{x:c,y:u,z:d}=a.halfExtents,p=(()=>{switch(a.cylinderAxis){case"y":return new Ammo.btConeShape(Math.max(c,d),2*u);case"x":return new Ammo.btConeShapeX(Math.max(u,d),2*c);case"z":return new Ammo.btConeShapeZ(Math.max(c,u),2*d)}return null})();return s(p,a,o(n,a)),p};e.createSphereShape=function(t,i,n,h={}){let c;h.type=e.TYPE.SPHERE,r(h),c=h.fit!==e.FIT.MANUAL||isNaN(h.sphereRadius)?a(t,i,l(t,i)):h.sphereRadius;const u=new Ammo.btSphereShape(c);return s(u,h,o(n,h)),u},e.createHullShape=function(){const t=new n.Vector3,i=new n.Vector3,a=new n.Matrix4;return function(n,h,c,u={}){if(u.type=e.TYPE.HULL,r(u),u.fit===e.FIT.MANUAL)return console.warn("cannot use fit: manual with type: hull"),null;const d=l(n,h),p=new Ammo.btVector3,f=new Ammo.btConvexHullShape;f.setMargin(u.margin),i.addVectors(d.max,d.min).multiplyScalar(.5);let m=0;for(let t=0;tg&&console.warn(`too many vertices for hull shape; sampling ~${g} from ~${m} vertices`);const v=Math.min(1,g/m);for(let e=0;e=100){const t=new Ammo.btShapeHull(f);t.buildHull(u.margin),Ammo.destroy(f),y=new Ammo.btConvexHullShape(Ammo.getPointer(t.getVertexPointer()),t.numVertices()),Ammo.destroy(t)}return Ammo.destroy(p),s(y,u,o(c,u)),y}}(),e.createHACDShapes=function(){const t=new n.Vector3,i=new n.Vector3,a=new n.Matrix4;return function(n,h,c,u,d={}){if(d.type=e.TYPE.HACD,r(d),d.fit===e.FIT.MANUAL)return console.warn("cannot use fit: manual with type: hacd"),[];if(!Ammo.hasOwnProperty("HACD"))return console.warn("HACD unavailable in included build of Ammo.js. Visit https://github.com/mozillareality/ammo.js for the latest version."),[];const p=l(n,h),f=o(u,d);let m=0,g=0;i.addVectors(p.max,p.min).multiplyScalar(.5);for(let t=0;t{switch(t.heightDataType){case"short":return Ammo.PHY_SHORT;case"float":default:return Ammo.PHY_FLOAT}})(),l=!t.hasOwnProperty("flipQuadEdges")||t.flipQuadEdges,c=n.length,u=c>0?n[0].length:0,d=Ammo._malloc(c*u*4),p=d/4;let f=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,g=0;for(let t=0;t=123?t.copy(e.matrixWorld).invert():t.getInverse(e.matrixWorld);(new n.Vector3).setFromMatrixScale(e.matrixWorld),e.traverse(s=>{const o=new n.Matrix4;s.isMesh&&(i.includeInvisible||s.el&&s.el.object3D.visible||s.visible)&&(s===e?o.identity():(s.updateWorldMatrix(!0),o.multiplyMatrices(t,s.matrixWorld)),r(s.geometry.isBufferGeometry?s.geometry.attributes.position.array:s.geometry.vertices,o.elements,s.geometry.index?s.geometry.index.array:null))})}}();const o=function(){const t=new n.Matrix4;return function(i,r={}){const s=new n.Vector3(1,1,1);return r.fit===e.FIT.ALL&&(t.fromArray(i),s.setFromMatrixScale(t)),s}}(),a=function(){const t=new n.Vector3;return function(e,i,n){let r=0,{x:s,y:o,z:a}=n.getCenter(t);return c(e,i,t=>{const e=s-t.x,i=o-t.y,n=a-t.z;r=Math.max(r,e*e+i*i+n*n)}),Math.sqrt(r)}}(),h=function(t,e,i){return(new n.Vector3).subVectors(t.max,t.min).multiplyScalar(.5).clampScalar(e,i)},l=function(t,e){const i=new n.Box3;let r=1/0,s=1/0,o=1/0,a=-1/0,h=-1/0,l=-1/0;return i.min.set(0,0,0),i.max.set(0,0,0),c(t,e,t=>{t.xa&&(a=t.x),t.y>h&&(h=t.y),t.z>l&&(l=t.z)}),i.min.set(r,s,o),i.max.set(a,h,l),i},c=function(){const t=new n.Vector3,e=new n.Matrix4;return function(i,n,r){for(let s=0;s{const{radius:i=1,tube:n=.4,tubularSegments:r=8}=t,s=Math.PI,o=r,a=Math.sqrt(2*n*n-2*n*n*Math.cos(2*s/o)),h=new Ammo.btVector3(n,s/o+.5*a,n),l=new Ammo.btCylinderShape(h);l.setMargin(.05);const c=new Ammo.btCompoundShape,u=new Ammo.btVector3(0,0,1),d=new Ammo.btVector3(0,i,0),p=new Ammo.btQuaternion(e.x,e.y,e.z,e.w);for(let t=0;t{var r,s;const{bodies:o,event:a}=n;(null===(r=o[0])||void 0===r?void 0:r.name)&&(null===(s=o[1])||void 0===s?void 0:s.name)&&(null==t?void 0:t.name)&&(null==e?void 0:e.name)&&(o[0].name===t.name&&o[1].name===e.name||o[1].name===t.name&&o[0].name===e.name)&&i(a)}))}}e.CollisionEvents=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}); /** * @author Kevin Lee (https://github.com/InfiniteLee) * @copyright Copyright (c) 2019 Kevin Lee; Project Url: https://github.com/InfiniteLee/ammo-debug-drawer * @license {@link https://github.com/InfiniteLee/ammo-debug-drawer/blob/master/LICENSE|MPL-2.0} */ const n=i(2),r=1,s=32768;e.default=class{constructor(t,e,i={}){this.scene=t,this.world=e,this.options=i,this.debugDrawMode=i.debugDrawMode||r;const o=this.debugDrawMode&s||!1,a=i.maxBufferSize||1e6;this.geometry=new n.BufferGeometry;const h=new Float32Array(3*a),l=new Float32Array(3*a);this.geometry.setAttribute("position",new n.BufferAttribute(h,3).setUsage(n.StaticDrawUsage)),this.geometry.setAttribute("color",new n.BufferAttribute(l,3).setUsage(n.StaticDrawUsage)),this.index=0;const c=new n.LineBasicMaterial({vertexColors:!0,depthTest:!o});this.mesh=new n.LineSegments(this.geometry,c),o&&(this.mesh.renderOrder=999),this.mesh.frustumCulled=!1,this.enabled=!1,this.debugDrawer=new Ammo.DebugDrawer,this.debugDrawer.drawLine=this.drawLine.bind(this),this.debugDrawer.drawContactPoint=this.drawContactPoint.bind(this),this.debugDrawer.reportErrorWarning=this.reportErrorWarning.bind(this),this.debugDrawer.draw3dText=this.draw3dText.bind(this),this.debugDrawer.setDebugMode=this.setDebugMode.bind(this),this.debugDrawer.getDebugMode=this.getDebugMode.bind(this),this.world.setDebugDrawer(this.debugDrawer)}enable(){this.enabled=!0,this.scene.add(this.mesh)}disable(){this.enabled=!1,this.scene.remove(this.mesh)}update(){this.enabled&&(0!=this.index&&(this.geometry.attributes.position.needsUpdate=!0,this.geometry.attributes.color.needsUpdate=!0),this.index=0,this.world.debugDrawWorld(),this.geometry.setDrawRange(0,this.index))}drawLine(t,e,i){const n=Ammo.HEAPF32,r=n[(i+0)/4],s=n[(i+4)/4],o=n[(i+8)/4],a=n[(t+0)/4],h=n[(t+4)/4],l=n[(t+8)/4];this.geometry.attributes.position.setXYZ(this.index,a,h,l),this.geometry.attributes.color.setXYZ(this.index++,r,s,o);const c=n[(e+0)/4],u=n[(e+4)/4],d=n[(e+8)/4];this.geometry.attributes.position.setXYZ(this.index,c,u,d),this.geometry.attributes.color.setXYZ(this.index++,r,s,o)}drawContactPoint(t,e,i,n,r){const s=Ammo.HEAPF32,o=s[(r+0)/4],a=s[(r+4)/4],h=s[(r+8)/4],l=s[(t+0)/4],c=s[(t+4)/4],u=s[(t+8)/4];this.geometry.attributes.position.setXYZ(this.index,l,c,u),this.geometry.attributes.color.setXYZ(this.index++,o,a,h);const d=s[(e+0)/4]*i,p=s[(e+4)/4]*i,f=s[(e+8)/4]*i;this.geometry.attributes.position.setXYZ(this.index,l+d,c+p,u+f),this.geometry.attributes.color.setXYZ(this.index++,o,a,h)}reportErrorWarning(t){Ammo.hasOwnProperty("Pointer_stringify")?console.warn(Ammo.Pointer_stringify(t)):this.warnedOnce||(this.warnedOnce=!0,console.warn("Cannot print warningString, please rebuild Ammo.js using 'debug' flag"))}draw3dText(t,e){console.warn("TODO: draw3dText")}setDebugMode(t){this.debugDrawMode=t}getDebugMode(){return this.debugDrawMode}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ConvexObjectBreaker=void 0;const n=i(2),r=i(2),s=i(9),o=function(t,e){this.minSizeForBreak=t||1.4,this.smallDelta=e||1e-4,this.tempLine1=new n.Line3,this.tempPlane1=new n.Plane,this.tempPlane2=new n.Plane,this.tempPlane_Cut=new n.Plane,this.tempCM1=new n.Vector3,this.tempCM2=new n.Vector3,this.tempVector3=new n.Vector3,this.tempVector3_2=new n.Vector3,this.tempVector3_3=new n.Vector3,this.tempVector3_P0=new n.Vector3,this.tempVector3_P1=new n.Vector3,this.tempVector3_P2=new n.Vector3,this.tempVector3_N0=new n.Vector3,this.tempVector3_N1=new n.Vector3,this.tempVector3_AB=new n.Vector3,this.tempVector3_CB=new n.Vector3,this.tempResultObjects={object1:null,object2:null},this.segments=[];for(var i=0;i<900;i++)this.segments[i]=!1};var a;e.ConvexObjectBreaker=o,o.prototype={constructor:o,prepareBreakableObject:function(t,e,i,n,r){t.geometry.isBufferGeometry||console.error("THREE.ConvexObjectBreaker.prepareBreakableObject(): Parameter object must have a BufferGeometry."),t.userData.ammoPhysicsData={};var s=t.userData.ammoPhysicsData;s.mass=e,s.velocity=i.clone(),s.angularVelocity=n.clone(),s.breakable=r},subdivideByImpact:function(t,e,i,n,r){var s=[],o=this.tempPlane1,a=this.tempPlane2;this.tempVector3.addVectors(e,i),o.setFromCoplanarPoints(e,t.position,this.tempVector3);var h=r+n,l=this;return function r(c,u,d,p){if(Math.random()<.05*p||p>h)s.push(c);else{var f=Math.PI;0===p?(a.normal.copy(o.normal),a.constant=o.constant):p<=n?(f=(d-u)*(.2+.6*Math.random())+u,l.tempVector3_2.copy(t.position).sub(e).applyAxisAngle(i,f).add(e),a.setFromCoplanarPoints(e,l.tempVector3,l.tempVector3_2)):(f=(.5*(1&p)+.2*(2-Math.random()))*Math.PI,l.tempVector3_2.copy(e).sub(c.position).applyAxisAngle(i,f).add(c.position),l.tempVector3_3.copy(i).add(c.position),a.setFromCoplanarPoints(c.position,l.tempVector3_3,l.tempVector3_2)),l.cutByPlane(c,a,l.tempResultObjects);var m=l.tempResultObjects.object1,g=l.tempResultObjects.object2;m&&r(m,u,f,p+1),g&&r(g,f,d,p+1)}}(t,0,2*Math.PI,0),s},cutByPlane:function(t,e,i){var a=t.geometry,h=a.attributes.position.array,l=a.attributes.normal.array,c=h.length/3,u=c/3,d=a.getIndex();function p(t,e){var i=3*t+e;return d?d[i]:i}d&&(u=(d=d.array).length/3);for(var f=[],m=[],g=this.smallDelta,v=c*c,y=0;yg?(k=2,m.push(x.clone())):N<-g?(k=1,f.push(x.clone())):(k=3,f.push(x.clone()),m.push(x.clone()));var N,U=0;if((N=R.distanceToPoint(b))>g?(U=2,m.push(b.clone())):N<-g?(U=1,f.push(b.clone())):(U=3,f.push(b.clone()),m.push(b.clone())),1===k&&2===U||2===k&&1===U){this.tempLine1.start.copy(x),this.tempLine1.end.copy(b);var z=new n.Vector3;if(void 0===(z=R.intersectLine(this.tempLine1,z)))return console.error("Internal error: segment does not intersect plane."),i.segmentedObject1=null,i.segmentedObject2=null,0;f.push(z),m.push(z.clone())}}}var G=.5*t.userData.ammoPhysicsData.mass;this.tempCM1.set(0,0,0);var V=0,H=f.length;if(H>0){for(y=0;y0){for(y=0;y4)try{(Y=new n.Mesh(new r.ConvexGeometry(f),t.material)).position.copy(this.tempCM1),Y.quaternion.copy(t.quaternion),Y.userData=t.userData,this.prepareBreakableObject(Y,G,t.userData.ammoPhysicsData.velocity,t.userData.ammoPhysicsData.angularVelocity,2*V>this.minSizeForBreak),Z++}catch(t){s.default("Error in ConvexObjectBreaker.ts"),s.default(t)}if(X>4)try{(q=new n.Mesh(new r.ConvexGeometry(m),t.material)).position.copy(this.tempCM2),q.quaternion.copy(t.quaternion),q.userData=t.userData,this.prepareBreakableObject(q,G,t.userData.ammoPhysicsData.velocity,t.userData.ammoPhysicsData.angularVelocity,2*W>this.minSizeForBreak),Z++}catch(t){s.default("Error in ConvexObjectBreaker.ts"),s.default(t)}return i.object1=Y,i.object2=q,Z}},o.transformFreeVector=function(t,e){var i=t.x,n=t.y,r=t.z,s=e.elements;return t.x=s[0]*i+s[4]*n+s[8]*r,t.y=s[1]*i+s[5]*n+s[9]*r,t.z=s[2]*i+s[6]*n+s[10]*r,t},o.transformFreeVectorInverse=function(t,e){var i=t.x,n=t.y,r=t.z,s=e.elements;return t.x=s[0]*i+s[1]*n+s[2]*r,t.y=s[4]*i+s[5]*n+s[6]*r,t.z=s[8]*i+s[9]*n+s[10]*r,t},o.transformTiedVectorInverse=function(t,e){var i=t.x,n=t.y,r=t.z,s=e.elements;return t.x=s[0]*i+s[1]*n+s[2]*r-s[12],t.y=s[4]*i+s[5]*n+s[6]*r-s[13],t.z=s[8]*i+s[9]*n+s[10]*r-s[14],t},o.transformPlaneToLocalSpace=(a=new n.Vector3,function(t,e,i){i.normal.copy(t.normal),i.constant=t.constant;var n=o.transformTiedVectorInverse(t.coplanarPoint(a),e);o.transformFreeVectorInverse(i.normal,e),i.constant=-n.dot(i.normal)})},function(t,e,i){"use strict"; /** * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */Object.defineProperty(e,"__esModule",{value:!0}),e.AllHitsRaycaster=e.ClosestRaycaster=void 0;const n=i(49),r=i(50),s=i(51);class o{constructor(t){this.physics=t}setRayFromWorld(t=0,e=0,i=0){this._btRayFrom.setValue(t,e,i)}setRayToWorld(t=0,e=0,i=0){this._btRayTo.setValue(t,e,i)}hasHit(){return this._btRayCallback.hasHit()}rayTest(){void 0!==this._btRayCallback&&Ammo.destroy(this._btRayCallback),this._btRayCallback="closest"===this.type?new Ammo.ClosestRayResultCallback(this._btRayFrom,this._btRayTo):new Ammo.AllHitsRayResultCallback(this._btRayFrom,this._btRayTo),this.physics.physicsWorld.rayTest(this._btRayFrom,this._btRayTo,this._btRayCallback)}destroy(){void 0!==this._btRayFrom&&Ammo.destroy(this._btRayFrom),void 0!==this._btRayTo&&Ammo.destroy(this._btRayTo),void 0!==this._btRayCallback&&Ammo.destroy(this._btRayCallback)}}class a{constructor(t){this.physics=t,this.type="closest",this._btRayFrom=new Ammo.btVector3(0,0,0),this._btRayTo=new Ammo.btVector3(0,0,0)}}e.ClosestRaycaster=a;class h{constructor(t){this.physics=t,this.type="allHits",this._btRayFrom=new Ammo.btVector3(0,0,0),this._btRayTo=new Ammo.btVector3(0,0,0)}}e.AllHitsRaycaster=h,n.default(a,[o,r.default]),n.default(h,[o,s.default])},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=(t,e)=>{e.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(i=>{Object.defineProperty(t.prototype,i,Object.getOwnPropertyDescriptor(e.prototype,i))})})}},function(t,e,i){"use strict"; /** * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(t){this.physics=t}getHitPointWorld(){const t=this._btRayCallback.get_m_hitPointWorld();return{x:t.x(),y:t.y(),z:t.z()}}getHitNormalWorld(){const t=this._btRayCallback.get_m_hitNormalWorld();return{x:t.x(),y:t.y(),z:t.z()}}getCollisionObject(){return Ammo.castObject(this._btRayCallback.get_m_collisionObject(),Ammo.btRigidBody).threeObject}}},function(t,e,i){"use strict"; /** * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */Object.defineProperty(e,"__esModule",{value:!0});e.default=class{constructor(t){this.physics=t}getHitPointsWorld(){const t=this._btRayCallback.get_m_hitPointWorld(),e=[];for(let i=t.size()-1;i>=0;i--){const n=t.at(i);e.push({x:n.x(),y:n.y(),z:n.z()})}return e}getHitPointWorld(){return console.warn("[enable3d] Use getHitPointsWorld() instead of getHitPointWorld() for the AllHitsRayCaster!"),this.getHitPointsWorld()}getHitNormalsWorld(){const t=this._btRayCallback.get_m_hitNormalWorld(),e=[];for(let i=t.size()-1;i>=0;i--){const n=t.at(i);e.push({x:n.x(),y:n.y(),z:n.z()})}return e}getCollisionObjects(){const t=[],e=this._btRayCallback.get_m_collisionObjects();for(let i=e.size()-1;i>=0;i--){const n=Ammo.castObject(e.at(i),Ammo.btRigidBody);t.push(n.threeObject)}return t}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Clock=void 0;e.Clock=class{constructor(t=!0){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){let e=("undefined"==typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERSION=void 0,e.VERSION="0.22.0-dev.0"},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Cameras=e.HaveSomeFun=e.WebXR=e.Transform=e.TextureCube=e.Misc=e.Mixers=e.WarpSpeed=e.HeightMap=e.CSG=e.Factories=e.Lights=e.Loaders=void 0;const n=i(55);e.Loaders=n.default;const r=i(56);e.Lights=r.default;const s=i(16);e.Factories=s.default;const o=i(57);e.CSG=o.default;const a=i(58);e.HeightMap=a.default;const h=i(60);e.WarpSpeed=h.default;const l=i(61);e.Mixers=l.default;const c=i(62);e.Misc=c.default,Object.defineProperty(e,"TextureCube",{enumerable:!0,get:function(){return c.TextureCube}});const u=i(64);e.Transform=u.default;const d=i(65);e.WebXR=d.default;const p=i(66);e.HaveSomeFun=p.default;const f=i(14);e.Cameras=f.default},function(t,e,i){"use strict"; /** * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */var n=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,s){function o(t){try{h(n.next(t))}catch(t){s(t)}}function a(t){try{h(n.throw(t))}catch(t){s(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}h((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const r=i(2);e.default=class{constructor(t,e){this.cache=t,this.textureAnisotropy=e}get fileLoader(){return this._fileLoader||(this._fileLoader=new r.FileLoader),this._fileLoader}get imageLoader(){return this._imgLoader||(this._imgLoader=new r.ImageLoader),this._imgLoader}get svgLoader(){return this._svgLoader||(this._svgLoader=new r.SVGLoader),this._svgLoader}get textureLoader(){return this._textureLoader||(this._textureLoader=new r.TextureLoader),this._textureLoader}get objectLoader(){return this._objectLoader||(this._objectLoader=new r.ObjectLoader),this._objectLoader}get gltfLoader(){return this._gltfLoader||(this._gltfLoader=new r.GLTFLoader),this._gltfLoader}get fbxLoader(){return this._fbxLoader||(this._fbxLoader=new r.FBXLoader),this._fbxLoader}preload(t,e){return n(this,void 0,void 0,(function*(){return this.cache.add(t,e),new Promise(t=>{const i=/\.fbx$|\.glb$|\.gltf$/.test(e);/\.jpe?g$|\.png$/.test(e)?this.textureLoader.load(e,e=>t(e)):(i&&this.fileLoader.setResponseType("arraybuffer"),this.fileLoader.load(e,e=>t(e)))})}))}textureAtlas(t,e,i="JSONHash"){return n(this,void 0,void 0,(function*(){let i=JSON.parse(yield this.file(e));if(i.textures){const t=i.textures[0].frames;let e={frames:{}};t.forEach(t=>{e=Object.assign(Object.assign({},e),{frames:Object.assign(Object.assign({},e.frames),{[t.filename]:{frame:t.frame,rotated:t.rotated,sourceSize:t.sourceSize,spriteSourceSize:t.spriteSourceSize,trimmed:t.trimmed}})})}),i=e}return{texture:yield this.texture(t),json:i}}))}file(t){const e=this.cache.get(t);return t=e||t,new Promise(e=>{this.fileLoader.load(t,t=>e(t))})}svg(t){const e=this.cache.get(t);return t=e||t,new Promise(e=>{this.svgLoader.load(t,t=>e(t))})}texture(t,e){let i=null!=e?e:t,n=e?t:void 0;if(!/^data:image\/[\S]+;base64,/gm.test(i)){const t=this.cache.get(i);i=t||i}return new Promise(t=>{this.textureLoader.load(i,e=>{n&&this.cache.add(n,e),e.anisotropy=this.textureAnisotropy,e.needsUpdate=!0,t(e)})})}object(t){const e=this.cache.get(t);return t=e||t,new Promise(e=>{this.objectLoader.load(t,t=>{e(t)})})}gltf(t){const e=this.cache.get(t);return t=e||t,new Promise(e=>{this.gltfLoader.load(t,t=>{e(t)})})}fbx(t){const e=this.cache.get(t);return t=e||t,new Promise(e=>{this.fbxLoader.load(t,t=>{e(t)})})}}},function(t,e,i){"use strict"; /** * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */Object.defineProperty(e,"__esModule",{value:!0});const n=i(2),r=i(2),s=i(2);class o extends n.Object3D{constructor(t,e,i,r){super(),this.scene=t,this.light=e,this.size=i,this.color=r,this.geo=new n.SphereBufferGeometry(i||.2,16,8),this.mat=new n.MeshBasicMaterial({color:r||e.color}),this.mesh=new n.Mesh(this.geo,this.mat),this.add(this.mesh),e.add(this)}dispose(){this.mesh.geometry.dispose(),Array.isArray(this.mesh.material)?this.mesh.material.forEach(t=>t.dispose()):this.mesh.material.dispose(),this.remove(this.mesh)}update(){}}e.default=class{constructor(t){this.scene=t}get helper(){return{directionalLightHelper:(t,e,i)=>{const n=new s.DirectionalLightHelper(t,e,i);return this.scene.add(n),n},spotLightHelper:(t,e)=>{const i=new s.SpotLightHelper(t,e);return this.scene.add(i),i},pointLightHelper:(t,e,i)=>new o(this.scene,t,e,i)}}directionalLight(t={}){const{color:e=16777215,intensity:i=1}=t,n=new r.DirectionalLight(e,i);return n.castShadow=!0,this.scene.add(n),n}hemisphereLight(t={}){const{skyColor:e=16777215,groundColor:i=16777215,intensity:n=1}=t,s=new r.HemisphereLight(e,i,n);return this.scene.add(s),s}ambientLight(t={}){const{color:e=16777215,intensity:i=1}=t,n=new r.AmbientLight(e,i);return this.scene.add(n),n}pointLight(t={}){const{color:e=16777215,intensity:i=1,distance:n=0,decay:s=1}=t,o=new r.PointLight(e,i,n,s);return o.castShadow=!0,this.scene.add(o),o}spotLight(t={}){const{color:e=16777215,intensity:i=1,distance:n=0,angle:s=Math.PI/8,penumbra:o=0,decay:a=1}=t,h=new r.SpotLight(e,i,n,s,o,a);return h.castShadow=!0,this.scene.add(h),h}rectAreaLight(t={}){const{color:e=16777215,intensity:i=1,width:n=10,height:s=10}=t,o=new r.RectAreaLight(e,i,n,s);return this.scene.add(o),o}}},function(t,e,i){"use strict"; /** * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */Object.defineProperty(e,"__esModule",{value:!0});const n=i(2);e.default=class{constructor(t,e){this.scene=t,this.transform=e}toGeometry(t,e){t.geometry=this.transform.bufferGeometryToGeometry(t.geometry),e.geometry=this.transform.bufferGeometryToGeometry(e.geometry)}toBufferGeometry(t){t.geometry=this.transform.geometryToBufferGeometry(t.geometry)}union(t,e){this.toGeometry(t,e);const i=this.doCSG(t,e,"union");return this.toBufferGeometry(i),i}subtract(t,e){this.toGeometry(t,e);const i=this.doCSG(t,e,"subtract");return this.toBufferGeometry(i),i}intersect(t,e){this.toGeometry(t,e);const i=this.doCSG(t,e,"intersect");return this.toBufferGeometry(i),i}doCSG(t,e,i){t.updateMatrix(),e.updateMatrix();const n=r.fromMesh(t),s=r.fromMesh(e),o=n[i](s);return r.toMesh(o,t.matrix)}};class r{constructor(){this.polygons=[]}static fromPolygons(t){const e=new r;return e.polygons=t,e}static fromGeometry(t){t.isBufferGeometry&&(t=(new n.Geometry).fromBufferGeometry(t));const e=t.faces,i=t.vertices,s=[],a=["a","b","c"];for(let n=0;n=123?(new n.Matrix4).copy(e).invert():(new n.Matrix4).getInverse(e);i.applyMatrix4(a),i.verticesNeedUpdate=i.elementsNeedUpdate=i.normalsNeedUpdate=!0,i.computeBoundingSphere(),i.computeBoundingBox();const h=new n.Mesh(i);return h.matrix.copy(e),h.matrix.decompose(h.position,h.rotation,h.scale),h.updateMatrixWorld(),h}static iEval(t,e=0){var i;if("string"==typeof t)r.currentOp=t;else if(t instanceof Array)for(const e of t)r.iEval(e,0);else if("object"==typeof t){const e=r.currentOp;t.updateMatrix(),t.updateMatrixWorld(),r.sourceMesh?(r.nextPrim=r.fromMesh(t),r.currentPrim=r.currentPrim[e](r.nextPrim)):r.currentPrim=r.fromMesh(r.sourceMesh=t),r.doRemove&&(null===(i=null==t?void 0:t.parent)||void 0===i||i.remove(t))}}static eval(t,e){delete r.currentOp,delete r.sourceMesh,r.doRemove=e,r.iEval(t);const i=r.toMesh(r.currentPrim,r.sourceMesh.matrix);return i.material=r.sourceMesh.material,i.castShadow=i.receiveShadow=!0,i}clone(){const t=new r;return t.polygons=this.polygons.map(t=>t.clone()),t}toPolygons(){return this.polygons}union(t){const e=new l(this.clone().polygons),i=new l(t.clone().polygons);return e.clipTo(i),i.clipTo(e),i.invert(),i.clipTo(e),i.invert(),e.build(i.allPolygons()),r.fromPolygons(e.allPolygons())}subtract(t){const e=new l(this.clone().polygons),i=new l(t.clone().polygons);return e.invert(),e.clipTo(i),i.clipTo(e),i.invert(),i.clipTo(e),i.invert(),e.build(i.allPolygons()),e.invert(),r.fromPolygons(e.allPolygons())}intersect(t){const e=new l(this.clone().polygons),i=new l(t.clone().polygons);return e.invert(),i.clipTo(e),i.invert(),e.clipTo(i),i.clipTo(e),e.build(i.allPolygons()),e.invert(),r.fromPolygons(e.allPolygons())}inverse(){const t=this.clone();return t.polygons.map(t=>{t.flip()}),t}}r._tmpm3=new n.Matrix3;class s extends n.Vector3{constructor(t,e,i){if(3===arguments.length)super(t,e,i);else if(Array.isArray(t))super(t[0],t[1],t[2]);else{if("object"!=typeof t)throw new Error("Invalid constructor to vector");this.copy(t)}}clone(){return new s(this.x,this.y,this.z)}negated(){return this.clone().multiplyScalar(-1)}plus(t){return this.clone().add(t)}minus(t){return this.clone().sub(t)}times(t){return this.clone().multiplyScalar(t)}dividedBy(t){return this.clone().divideScalar(t)}lerp(t,e){return this.plus(t.minus(this).times(e))}unit(){return this.dividedBy(this.length())}cross(t,e){return n.Vector3.prototype.cross.call(this.clone(),t)}}class o{constructor(t,e,i){this.pos=new s(t.x,t.y,t.z),this.normal=new s(e.x,e.y,e.z),i&&(this.uv=new s(i.x,i.y,i.z))}clone(){return new o(this.pos.clone(),this.normal.clone(),this.uv?this.uv.clone():void 0)}flip(){this.normal=this.normal.negated()}interpolate(t,e){return new o(this.pos.lerp(t.pos,e),this.normal.lerp(t.normal,e),this.uv?this.uv.lerp(t.uv,e):void 0)}}class a{constructor(t,e){this.normal=t,this.w=e}static fromPoints(t,e,i){const n=e.minus(t).cross(i.minus(t)).unit();return new a(n,n.dot(t))}clone(){return new a(this.normal.clone(),this.w)}flip(){this.normal=this.normal.negated(),this.w=-this.w}splitPolygon(t,e,i,n,r){let s=0;const o=[];for(const e of t.vertices){const t=this.normal.dot(e.pos)-this.w,i=t<-a.EPSILON?2:t>a.EPSILON?1:0;s|=i,o.push(i)}switch(s){case 0:(this.normal.dot(t.plane.normal)>0?e:i).push(t);break;case 1:n.push(t);break;case 2:r.push(t);break;case 3:const s=[],a=[];for(let e=0;e=3&&n.push(new h(s,t.shared)),a.length>=3&&r.push(new h(a,t.shared))}}}a.EPSILON=1e-5;class h{constructor(t,e=null){this.vertices=t,this.shared=e,this.plane=a.fromPoints(t[0].pos,t[1].pos,t[2].pos)}clone(){const t=this.vertices.map(t=>t.clone());return new h(t,this.shared)}flip(){this.vertices.reverse().map(t=>{t.flip()}),this.plane.flip()}}class l{constructor(t){delete this.plane,delete this.front,delete this.back,this.polygons=[],t&&this.build(t)}clone(){const t=new l;return t.plane=this.plane&&this.plane.clone(),t.front=this.front&&this.front.clone(),t.back=this.back&&this.back.clone(),t.polygons=this.polygons.map(t=>t.clone()),t}invert(){for(const t of this.polygons)t.flip();this.plane.flip(),this.front&&this.front.invert(),this.back&&this.back.invert();const t=this.front;this.front=this.back,this.back=t}clipPolygons(t){if(!this.plane)return t.slice();let e=[],i=[];for(const n of t)this.plane.splitPolygon(n,e,i,e,i);return this.front&&(e=this.front.clipPolygons(e)),i=this.back?this.back.clipPolygons(i):[],e.concat(i)}clipTo(t){this.polygons=t.clipPolygons(this.polygons),this.front&&this.front.clipTo(t),this.back&&this.back.clipTo(t)}allPolygons(){let t=this.polygons.slice();return this.front&&(t=t.concat(this.front.allPolygons())),this.back&&(t=t.concat(this.back.allPolygons())),t}build(t){if(!t.length)return;this.plane||(this.plane=t[0].plane.clone());const e=[],i=[];for(const n of t)this.plane.splitPolygon(n,this.polygons,this.polygons,e,i);e.length&&(this.front||(this.front=new l),this.front.build(e)),i.length&&(this.back||(this.back=new l),this.back.build(i))}}},function(t,e,i){"use strict"; /** * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */Object.defineProperty(e,"__esModule",{value:!0});const n=i(2),r=i(4),s=i(19);e.default=class{constructor(t){this.scene=t}add(t,e={}){const i=this.make(t,e);return i?this.scene.add(i):console.warn("Could not make heightmap"),i}make(t,e={}){const{image:i}=t,{width:o,height:a}=i,{colorScale:h}=e,l=document.createElement("canvas");l.width=o,l.height=a;const c=l.getContext("2d");if(!c)return;c.drawImage(t.image,0,0);const u=c.getImageData(0,0,o,a),d=(new n.Geometry).fromBufferGeometry(new n.PlaneBufferGeometry(10,10,o-1,a-1));let p={color:13421772,side:n.DoubleSide};h&&(p=Object.assign(Object.assign({},p),{vertexColors:!0}));const f=new n.MeshPhongMaterial(p),m=new r.ExtendedMesh(d,f);m.receiveShadow=m.castShadow=!0,m.shape="concave";const g=m.geometry;for(let t=0;tt.color=new n.Color(h(((t,e)=>{var i=t.vertices[e.a].z,n=t.vertices[e.b].z,r=t.vertices[e.c].z;return Math.max(i,n,r)})(g,t)).hex())),m.rotateX(-Math.PI/2),m.updateMatrix(),d.computeFaceNormals(),d.computeVertexNormals(),m.name="heightmap",m.geometry=s.fromGeometry(new n.BufferGeometry,m.geometry),m}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DirectGeometry=void 0;const n=i(2);e.DirectGeometry=class{constructor(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}computeGroups(t){const e=[];let i,n,r=void 0;const s=t.faces;for(n=0;n0,o=r[1]&&r[1].length>0,a=t.morphTargets,h=a.length;let l;if(h>0){l=[];for(let t=0;t0){d=[];for(let t=0;t0&&0===e.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let t=0;t/^-\w+/.test(t)),n=i.length>0;if((0===t.length||n)&&(t=["light","camera","lookAtCenter","ground","grid","orbitControls","fog","sky"]),n){i.map(t=>t.substr(1)).forEach(e=>{const i=t.indexOf(e);t.splice(i,1)})}if(t.includes("fog"),t.includes("sky")){const t=["varying vec3 vWorldPosition;","","void main() {","","vec4 worldPosition = modelMatrix * vec4( position, 1.0 );","vWorldPosition = worldPosition.xyz;","","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","","}"].join("\n"),e=["uniform vec3 topColor;","uniform vec3 bottomColor;","uniform float offset;","uniform float exponent;","","varying vec3 vWorldPosition;","","void main() {","","float h = normalize( vWorldPosition + offset ).y;","gl_FragColor = vec4( mix( bottomColor, topColor, max( pow( max( h , 0.0), exponent ), 0.0 ) ), 1.0 );","","}"].join("\n"),i={topColor:{value:new s.Color(0)},bottomColor:{value:new s.Color(0)},offset:{value:33},exponent:{value:.6}};var o=new s.SphereBufferGeometry(5e3,32,15),a=new s.ShaderMaterial({uniforms:i,vertexShader:t,fragmentShader:e,side:s.BackSide}),h=new s.Mesh(o,a);this.scene.add(h)}if(t.includes("camera")&&(this.camera.position.set(0,6,12),e=Object.assign({camera:this.camera},e)),t.includes("light")){const t=.4,i=this.lights.hemisphereLight({skyColor:16777215,groundColor:0,intensity:t}),n=this.lights.ambientLight({color:16777215,intensity:t}),r=this.lights.directionalLight({color:16777215,intensity:t});r.position.set(100,200,50);const s=20;r.shadow.camera.top=s,r.shadow.camera.bottom=-s,r.shadow.camera.left=-s,r.shadow.camera.right=s,r.shadow.mapSize.set(1024,1024);const o={ambientLight:n,directionalLight:r,hemisphereLight:i};e=Object.assign({lights:o},e)}if(t.includes("lookAtCenter")&&this.camera.lookAt(this.scene.position),t.includes("ground")){const i=t.includes("grid"),n="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOnAAADusBZ+q87AAAAJtJREFUeJzt0EENwDAAxLDbNP6UOxh+NEYQ5dl2drFv286598GrA7QG6ACtATpAa4AO0BqgA7QG6ACtATpAa4AO0BqgA7QG6ACtATpAa4AO0BqgA7QG6ACtATpAa4AO0BqgA7QG6ACtATpAa4AO0BqgA7QG6ACtATpAa4AO0BqgA7QG6ACtATpAa4AO0BqgA7QG6ACtATpAu37AD8eaBH5JQdVbAAAAAElFTkSuQmCC",r=yield this.load.texture(n);r.wrapS=r.wrapT=s.RepeatWrapping,r.repeat.set(21,21);const o={name:"ground",width:21,height:21,depth:1,y:-.5},a={phong:{map:i?r:null,transparent:!0,opacity:.8,color:16777215}};let h;window.__loadPhysics?(h=this.physics.add.ground(o,a),h.body.setRestitution(1)):h=this.factories.add.ground(o,a),h.receiveShadow=!0,e=Object.assign({ground:h},e)}if(t.includes("orbitControls")){const t=new r.OrbitControls(this.camera,document.getElementById("enable3d-phaser-canvas")||this.renderer.domElement);e=Object.assign({orbitControls:t},e)}return e}))}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(4);e.default=class{constructor(){this._mixers=[]}animationMixer(t){const e=new n.AnimationMixer(t);return this.mixers.add(e),e}get mixers(){return{create:t=>this.animationMixer(t),add:t=>this._mixers.push(t),get:()=>this._mixers,update:t=>{var e;return null===(e=this._mixers)||void 0===e?void 0:e.forEach(e=>e.update(t/1e3))}}}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TextureCube=void 0;const n=i(63),r=i(2);e.default=class{constructor(t,e,i){this.scene=t,this.renderer=e,this.factories=i}water(t={}){n.addWater(this.scene,this.renderer,t)}textureCube(t){6!==t.length&&console.log("[enable3d] You need to pass 6 urls to textureCube()");const e=new s;return t.forEach((t,i)=>{t.wrapS=t.wrapT=r.RepeatWrapping;const n=this.factories.add.material({phong:{map:t}});e.materials[i]=n}),e}};class s{constructor(){this.materials=new Array(6)}get texture(){return{left:this.getTexture(0),right:this.getTexture(1),up:this.getTexture(2),down:this.getTexture(3),front:this.getTexture(4),back:this.getTexture(5)}}getTexture(t){return this.materials[t].map}}e.TextureCube=s},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.addWater=void 0;const n=i(2);e.addWater=(t,e,i={})=>{const{width:r=20,height:s=20,x:o=0,y:a=0,z:h=0,color:l="#ffffff",scale:c=4,flowX:u=1,flowY:d=1,normalMap0:p,normalMap1:f}=i,m=new n.PlaneBufferGeometry(r,s),g=new n.MeshStandardMaterial({color:30654,transparent:!0,opacity:.8}),v=new n.Mesh(m,g);v.position.set(o,a,h),v.rotation.x=-.5*Math.PI,t.add(v);const y=new n.PlaneBufferGeometry(r,s),x=new n.Water(y,{color:l,scale:c,flowDirection:new n.Vector2(u,d),textureWidth:1024,textureHeight:1024,normalMap0:p,normalMap1:f,encoding:e.outputEncoding});return x.position.set(o,a+.1,h),x.rotation.x=-.5*Math.PI,t.add(x),{ground:v,water:x}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=i(2),r=i(2),s=i(19);e.default= /** * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */ class{constructor(t,e){this.camera=t,this.renderer=e}geometryToBufferGeometry(t){return t.isGeometry?s.fromGeometry(new n.BufferGeometry,t):t}bufferGeometryToGeometry(t){return t.isBufferGeometry?(new n.Geometry).fromBufferGeometry(t):t}fromSVGtoShape(t,e=!1,i){if(t){const n=new r.SVGLoader,s=[];return n.parse(t).paths.forEach(t=>{t.toShapes(e,i).forEach(t=>{s.push(t)})}),s}return[]}from3dto2d(t){const e=new n.Vector3(t.x,t.y,t.z),i=this.renderer.domElement;this.camera.updateMatrixWorld(),e.project(this.camera);const r=Math.round((e.x+1)*(i.width/2)),s=Math.round((1-e.y)*(i.height/2));return new n.Vector2(r,s)}from2dto3d(t,e,i){var r;if(!this.tmpPlane){const t=new n.PlaneBufferGeometry(1e4,1e4),e=new n.MeshBasicMaterial({transparent:!0,opacity:.25});this.tmpPlane=new n.Mesh(t,e),this.tmpPlane.name="_tmp_raycast_plane"}let s;this.tmpRaycaster||(this.tmpRaycaster=new n.Raycaster),this.tmpVector3||(this.tmpVector3=new n.Vector3),this.tmpPlane.setRotationFromEuler(this.camera.rotation);const o=this.camera.position;this.tmpPlane.position.set(o.x,o.y,o.z),this.camera.getWorldDirection(this.tmpVector3),this.tmpPlane.position.add(this.tmpVector3.clone().multiplyScalar(i)),this.tmpPlane.updateMatrix(),this.tmpPlane.updateMatrixWorld(!0),this.tmpRaycaster.setFromCamera({x:t,y:e},this.camera);const a=this.tmpRaycaster.intersectObjects([this.tmpPlane]);return"_tmp_raycast_plane"===(null===(r=a[0])||void 0===r?void 0:r.object.name)&&(s=a[0].point),s}}},function(t,e,i){"use strict"; /** * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */Object.defineProperty(e,"__esModule",{value:!0});const n=i(2);e.default=class{constructor(t,e,i){this._renderer=t,this._scene=e,this._camera=i,this.controllerModelFactory=new n.XRControllerModelFactory,this.cameraGroup=new n.Group,this.cameraGroup.add(i),e.add(this.cameraGroup),t.xr.enabled=!0;const r=n.VRButton.createButton(t);r.style.cssText+="background: rgba(0, 0, 0, 0.8); ",document.body.appendChild(r)}get isPresenting(){var t,e;return!!(null===(e=null===(t=this._renderer)||void 0===t?void 0:t.xr)||void 0===e?void 0:e.isPresenting)}getController(t){const e=this._renderer.xr.getController(t);return this.cameraGroup.add(e),e}getControllerGrip(t){const e=this._renderer.xr.getControllerGrip(t),i=this.controllerModelFactory.createControllerModel(e);return e.add(i),this.cameraGroup.add(e),e}getControllerRay(t){const{targetRayMode:e}=t;if("tracked-pointer"===e){let t=new n.BufferGeometry;t.setAttribute("position",new n.Float32BufferAttribute([0,0,0,0,0,-1],3)),t.setAttribute("color",new n.Float32BufferAttribute([1,0,0,1,1,1],3));let e=new n.LineBasicMaterial({vertexColors:!0});return new n.Line(t,e)}if("gaze"===e){let t=new n.RingBufferGeometry(.02,.04,32).translate(0,0,-1),e=new n.MeshBasicMaterial({color:"red",opacity:.5,transparent:!0});return new n.Mesh(t,e)}}get camera(){return this.WebXRCamera}get WebXRCamera(){var t;return{group:this.cameraGroup,position:null===(t=this.cameraGroup)||void 0===t?void 0:t.position,rotation:this.isPresenting?this._renderer.xr.getCamera(this._camera).rotation:void 0,getWorldDirection:t=>this.isPresenting?this._renderer.xr.getCamera(this._camera).getWorldDirection(t):void 0}}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default=(t=20,e)=>{if(window.__loadPhysics)for(let i=0;iMath.floor(Math.random()*(e-t+1)+t),n=t=>t[Math.floor(Math.random()*t.length)];Math.random()>.5?e.add.box({x:i(-10,10),y:i(10,20),z:i(-10,10),width:i(1,2)/10,height:i(1,2)/10,depth:i(1,2)/10,mass:1},{[n(t)]:{color:Math.floor(16777215*Math.random())}}).body.setRestitution(Math.floor(10*Math.random())/20):e.add.sphere({x:i(-10,10),y:i(10,20),z:i(-10,10),radius:i(1,2)/10,mass:1},{[n(t)]:{color:Math.floor(16777215*Math.random())}}).body.setRestitution(Math.floor(10*Math.random())/20)}else console.log("There is not much fun without physics enabled!")}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.enable3d=void 0;const n=i(18);window.__loadPhysics=!1,window.__ammoPath="";e.enable3d=t=>(window.setTimeout(()=>{window.__loadPhysics?n.default(window.__ammoPath,()=>{Ammo().then(()=>{t()})}):t()},50),{withPhysics(t){window.__loadPhysics=!0,window.__ammoPath=t}}),e.default=e.enable3d},function(t,e,i){"use strict"; /** * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */Object.defineProperty(e,"__esModule",{value:!0});const n=i(2);e.default=(t={})=>{const{antialias:e=!0,parent:i,canvasId:r="enable3d-phaser-canvas"}=t,s=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");s.id=r;const o=i?document.getElementById(i):document.body;o?o.appendChild(s):console.error(`[enable3d] parent "${i}" not found!`);const a={antialias:e},h={alpha:void 0===a.alpha||a.alpha,depth:void 0===a.depth||a.depth,stencil:void 0===a.stencil||a.stencil,antialias:void 0!==a.antialias&&a.antialias,premultipliedAlpha:void 0===a.premultipliedAlpha||a.premultipliedAlpha,preserveDrawingBuffer:void 0!==a.preserveDrawingBuffer&&a.preserveDrawingBuffer,powerPreference:void 0!==a.powerPreference?a.powerPreference:"default",failIfMajorPerformanceCaveat:void 0!==a.failIfMajorPerformanceCaveat&&a.failIfMajorPerformanceCaveat,xrCompatible:!0},l=Object.assign({},h),c=n.WEBGL.isWebGL2Available()?"webgl2":"webgl",u=s.getContext(c,l);return{canvas:s,context:u}}},function(t,e,i){"use strict"; /** * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */Object.defineProperty(e,"__esModule",{value:!0}),e.JoyStick=void 0;const n=i(5);class r extends n.EventEmitter{constructor(){super(...arguments),this.id=-1}get add(){return{axis:(t={})=>this.addAxis(t),button:(t={})=>this.addButton(t)}}addAxis(t={}){this.id++;const{styles:e={left:35,bottom:35,size:100}}=t,i=this.circle({styles:e}),n=this.thumb({styles:e});i.appendChild(n),document.body.appendChild(i);const{maxRadius:r=40,rotationDamping:s=.06,moveDamping:o=.01}=t,a={id:this.id,domElement:n,maxRadius:r,maxRadiusSquared:r*r,origin:{left:n.offsetLeft,top:n.offsetTop},offset:{x:0,y:0},rotationDamping:s,moveDamping:o};if(null==a?void 0:a.domElement){const{domElement:t}=a;"ontouchstart"in window?t.addEventListener("touchstart",t=>{t.preventDefault(),this.tap(t,a),t.stopPropagation()}):t.addEventListener("mousedown",t=>{t.preventDefault(),this.tap(t,a),t.stopPropagation()})}return{onMove:t=>{this.on("axis_onmove_"+a.id,e=>{t(e)})}}}addButton(t={}){this.id++;const{styles:e={right:35,bottom:35,size:80},letter:i="A"}=t,n=this.circle({styles:e}),r=this.letter({letter:i});n.appendChild(r),document.body.appendChild(n);const s={id:this.id,domElement:n,offset:{x:0,y:0}};return(null==s?void 0:s.domElement)&&this.click(s),{onClick:t=>{this.on("button_onclick_"+s.id,e=>{t(e)})},onRelease:t=>{this.on("button_onrelease_"+s.id,e=>{t(e)})}}}circle(t={}){const{styles:e}=t,{top:i,right:n,bottom:r,left:s,size:o}=e,a=document.createElement("div");let h=`position:absolute; width:${o}px; height:${o}px; background:rgba(126, 126, 126, 0.5); border:#444 solid medium; border-radius:50%; cursor: pointer; `;return i&&(h+=`top:${i}px; `),n&&(h+=`right:${n}px; `),r&&(h+=`bottom:${r}px; `),s&&(h+=`left:${s}px; `),a.style.cssText=h,a}thumb(t={}){const{styles:e}=t,{size:i}=e,n=document.createElement("div");return n.style.cssText=`position: absolute; left: ${i/4}px; top: ${i/4}px; width: ${i/2}px; height: ${i/2}px; border-radius: 50%; background: #fff; `,n}letter(t={}){const{letter:e}=t,i=document.createElement("span");return i.innerText=e,i.style.cssText="position: absolute; text-align: center; top: 4px; width: 80px; height: 80px; font-size: 64px; color: #fff; ",i}click(t){const{id:e,domElement:i}=t;"ontouchstart"in window?(i.addEventListener("touchstart",t=>{t.preventDefault(),this.emit("button_onclick_"+e)}),i.addEventListener("touchend",t=>{t.preventDefault(),this.emit("button_onrelease_"+e)})):(i.addEventListener("mousedown",t=>{t.preventDefault(),this.emit("button_onclick_"+e),t.stopPropagation()}),i.addEventListener("mouseup",t=>{t.preventDefault(),this.emit("button_onrelease_"+e),t.stopPropagation()}))}tap(t,e){t=t||window.event,e.offset=this.getMousePosition(t),"ontouchstart"in window?(document.ontouchmove=t=>{t.target===e.domElement&&this.move(t,e)},document.ontouchend=t=>{t.target===e.domElement&&this.up(e)}):(document.onmousemove=t=>{t.target===e.domElement&&this.move(t,e)},document.onmouseup=t=>{this.up(e)})}move(t,e){const{domElement:i,maxRadius:n,maxRadiusSquared:r,origin:s,offset:o,id:a}=e;t=t||window.event;const h=this.getMousePosition(t);let l=h.x-o.x,c=h.y-o.y;const u=l*l+c*c;if(u>r){const t=Math.sqrt(u);l/=t,c/=t,l*=n,c*=n}i.style.top=c+i.clientHeight/2+"px",i.style.left=l+i.clientWidth/2+"px";const d=-(c-s.top+i.clientHeight/2)/n,p=(l-s.left+i.clientWidth/2)/n;this.emit("axis_onmove_"+a,{top:d,right:p})}up(t){const{domElement:e,origin:i,id:n}=t;"ontouchstart"in window?(document.ontouchmove=null,document.touchend=null):(document.onmousemove=null,document.onmouseup=null),e.style.top=i.top+"px",e.style.left=i.left+"px",this.emit("axis_onmove_"+n,{top:0,right:0})}getMousePosition(t){return{x:t.targetTouches?t.targetTouches[0].pageX:t.clientX,y:t.targetTouches?t.targetTouches[0].pageY:t.clientY}}}e.JoyStick=r},function(t,e,i){"use strict"; /** * @description This code has originally been copied from Sketchbook * * @author swift502 (http://jblaha.art/) * @copyright Copyright (c) 2018 swift502; Project Url: https://github.com/swift502/Sketchbook * @license {@link https://github.com/swift502/Sketchbook/blob/master/LICENSE|GPL-3.0} * * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */Object.defineProperty(e,"__esModule",{value:!0}),e.ThirdPersonControls=void 0;const n=i(2);e.ThirdPersonControls=class{constructor(t,e,i){this.camera=t,this.target=e,this.config=i;const{offset:r=new n.Vector3(0,0,0),sensitivity:s=new n.Vector2(1,1),radius:o=8,targetRadius:a=10,interpolationFactor:h=.05,pointerLock:l=!0,autoUpdate:c=!0,theta:u=0,phi:d=0,maxPhi:p=85,minPhi:f=-85}=i;this.offset=r,this.sensitivity=s,this.radius=o,this.targetRadius=a,this.interpolationFactor=h,this.theta=u,this.phi=d,this.maxPhi=p,this.minPhi=f}update(t,e){const i=this.target.position.clone().add(this.offset);this.theta-=t*(this.sensitivity.x/2),this.theta%=360,this.phi+=e*(this.sensitivity.y/2),this.phi=Math.min(this.maxPhi,Math.max(this.minPhi,this.phi)),this.radius=n.MathUtils.lerp(this.radius,this.targetRadius,this.interpolationFactor),this.camera.position.x=i.x+this.radius*Math.sin(this.theta*Math.PI/180)*Math.cos(this.phi*Math.PI/180),this.camera.position.y=i.y+this.radius*Math.sin(this.phi*Math.PI/180),this.camera.position.z=i.z+this.radius*Math.cos(this.theta*Math.PI/180)*Math.cos(this.phi*Math.PI/180),this.camera.updateMatrix(),this.camera.lookAt(i)}}},function(t,e,i){"use strict"; /** * @description This code has originally been copied from Sketchbook * * @author swift502 (http://jblaha.art/) * @copyright Copyright (c) 2018 swift502; Project Url: https://github.com/swift502/Sketchbook * @license {@link https://github.com/swift502/Sketchbook/blob/master/LICENSE|GPL-3.0} * * @author Yannick Deubel (https://github.com/yandeu) * @copyright Copyright (c) 2020 Yannick Deubel; Project Url: https://github.com/enable3d/enable3d * @license {@link https://github.com/enable3d/enable3d/blob/master/LICENSE|GNU GPLv3} */Object.defineProperty(e,"__esModule",{value:!0}),e.FirstPersonControls=void 0;const n=i(2);e.FirstPersonControls=class{constructor(t,e,i){this.camera=t,this.target=e,this.config=i;const{offset:r=new n.Vector3(0,0,0),sensitivity:s=new n.Vector2(1,1),radius:o=8,targetRadius:a=10,interpolationFactor:h=.05,pointerLock:l=!0,autoUpdate:c=!0}=i;this.offset=r,this.sensitivity=s,this.radius=o,this.targetRadius=a,this.interpolationFactor=h,this.theta=0,this.phi=0}update(t,e){const i=this.target.position.clone().add(this.offset);this.camera.position.copy(i),this.theta-=t*(this.sensitivity.x/2),this.theta%=360,this.phi+=e*(-this.sensitivity.y/2),this.phi=Math.min(85,Math.max(-85,this.phi));const r=new n.Vector3;r.x=i.x+this.radius*Math.sin(this.theta*Math.PI/180)*Math.cos(this.phi*Math.PI/180),r.y=i.y+this.radius*Math.sin(this.phi*Math.PI/180),r.z=i.z+this.radius*Math.cos(this.theta*Math.PI/180)*Math.cos(this.phi*Math.PI/180),this.camera.updateMatrix(),this.camera.lookAt(r)}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PointerLock=void 0;e.PointerLock=class{constructor(t,e=!0){this._element=t,this._isRunning=!1,e&&this.request()}isLocked(){return!!document.pointerLockElement}exit(){this._isRunning=!1,document.exitPointerLock(),this.removeListeners()}removeListeners(){document.removeEventListener("pointerlockchange",()=>this.pointerLockChangeHandler()),this._element.removeEventListener("pointerdown",()=>this.pointerDownHandlerHandler())}pointerLockChangeHandler(){this._isRunning&&this._request()}pointerDownHandlerHandler(){this._isRunning&&this._element.requestPointerLock()}request(){this._isRunning=!0,this._request()}_request(){document.addEventListener("pointerlockchange",()=>this.pointerLockChangeHandler(),{once:!0}),document.pointerLockElement||this._element.addEventListener("pointerdown",()=>this.pointerDownHandlerHandler(),{once:!0})}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PointerDrag=void 0;e.PointerDrag=class{constructor(t,e=!0){this._element=t,this._isRunning=!1,this._position={x:0,y:0},this._delta={x:0,y:0},this._onMoveCallback=()=>{},this._isPointerDown=!1,e&&this.start()}get isTouchDevice(){return"ontouchstart"in window}get isPointerDown(){return this._isPointerDown}start(){this._isRunning||(this._isRunning=!0,this.isTouchDevice?(this._element.addEventListener("touchstart",t=>this.onTouchStart(t)),this._element.addEventListener("touchend",t=>this.onTouchEnd(t)),this._element.addEventListener("touchmove",t=>this.onTouchMove(t))):(this._element.addEventListener("mousedown",t=>this.onPointerDown(t)),this._element.addEventListener("mouseup",t=>this.onPointerUp(t)),this._element.addEventListener("mouseleave",t=>this.onPointerLeave(t)),this._element.addEventListener("mouseover",t=>this.onPointerOver(t)),this._element.addEventListener("mousemove",t=>this.onPointerMove(t))))}stop(){this.isTouchDevice?(this._element.removeEventListener("touchstart",t=>this.onTouchStart(t)),this._element.removeEventListener("touchend",t=>this.onTouchEnd(t)),this._element.removeEventListener("touchmove",t=>this.onTouchMove(t))):(this._element.removeEventListener("mousedown",t=>this.onPointerDown(t)),this._element.removeEventListener("mouseleave",t=>this.onPointerLeave(t)),this._element.removeEventListener("mouseup",t=>this.onPointerUp(t)),this._element.removeEventListener("mouseover",t=>this.onPointerOver(t)),this._element.removeEventListener("mousemove",t=>this.onPointerMove(t))),this._isRunning=!1}removeListeners(){this.stop()}onMove(t){this._onMoveCallback=t}onPointerDown(t){this._isPointerDown=!0}onPointerUp(t){this._isPointerDown=!1}onPointerLeave(t){this._isPointerDown=!1}onPointerMove(t){const e=t.movementX,i=t.movementY;this._delta={x:e,y:i},this._onMoveCallback(this._delta)}onPointerOver(t){}onTouchStart(t){const e=t.touches[0].clientX,i=t.touches[0].clientY;this._position={x:e,y:i}}onTouchEnd(t){this._position={x:0,y:0},this._delta={x:0,y:0},this._onMoveCallback(this._delta)}onTouchMove(t){const e=t.touches[0].clientX,i=t.touches[0].clientY;this._delta={x:e-this._position.x,y:i-this._position.y},this._onMoveCallback(this._delta),this._position={x:e,y:i}}}},,,,,,,,,,,,,,,,,function(t,e,i){"use strict";i.r(e),i.d(e,"FBXLoader",(function(){return Se}));var n={};i.r(n),i.d(n,"Deflate",(function(){return Tt})),i.d(n,"AsyncDeflate",(function(){return _t})),i.d(n,"deflate",(function(){return Et})),i.d(n,"deflateSync",(function(){return St})),i.d(n,"Inflate",(function(){return Mt})),i.d(n,"AsyncInflate",(function(){return At})),i.d(n,"inflate",(function(){return Ct})),i.d(n,"inflateSync",(function(){return Pt})),i.d(n,"Gzip",(function(){return Rt})),i.d(n,"AsyncGzip",(function(){return Lt})),i.d(n,"gzip",(function(){return Ot})),i.d(n,"gzipSync",(function(){return Dt})),i.d(n,"Gunzip",(function(){return It})),i.d(n,"AsyncGunzip",(function(){return Ft})),i.d(n,"gunzip",(function(){return Bt})),i.d(n,"gunzipSync",(function(){return kt})),i.d(n,"Zlib",(function(){return Nt})),i.d(n,"AsyncZlib",(function(){return Ut})),i.d(n,"zlib",(function(){return zt})),i.d(n,"zlibSync",(function(){return Gt})),i.d(n,"Unzlib",(function(){return Vt})),i.d(n,"AsyncUnzlib",(function(){return Ht})),i.d(n,"unzlib",(function(){return Wt})),i.d(n,"unzlibSync",(function(){return Xt})),i.d(n,"compress",(function(){return Ot})),i.d(n,"AsyncCompress",(function(){return Lt})),i.d(n,"compressSync",(function(){return Dt})),i.d(n,"Compress",(function(){return Rt})),i.d(n,"Decompress",(function(){return jt})),i.d(n,"AsyncDecompress",(function(){return Yt})),i.d(n,"decompress",(function(){return qt})),i.d(n,"decompressSync",(function(){return Zt})),i.d(n,"DecodeUTF8",(function(){return ee})),i.d(n,"EncodeUTF8",(function(){return ie})),i.d(n,"strToU8",(function(){return ne})),i.d(n,"strFromU8",(function(){return re})),i.d(n,"ZipPassThrough",(function(){return ue})),i.d(n,"ZipDeflate",(function(){return de})),i.d(n,"AsyncZipDeflate",(function(){return pe})),i.d(n,"Zip",(function(){return fe})),i.d(n,"zip",(function(){return me})),i.d(n,"zipSync",(function(){return ge})),i.d(n,"UnzipPassThrough",(function(){return ve})),i.d(n,"UnzipInflate",(function(){return ye})),i.d(n,"AsyncUnzipInflate",(function(){return xe})),i.d(n,"Unzip",(function(){return be})),i.d(n,"unzip",(function(){return we})),i.d(n,"unzipSync",(function(){return Te}));var r=i(0),s={},o=Uint8Array,a=Uint16Array,h=Uint32Array,l=new o([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),c=new o([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),u=new o([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=function(t,e){for(var i=new a(31),n=0;n<31;++n)i[n]=e+=1< Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE */f[28]=258,m[258]=28;for(var g=d(c,0),v=g[0],y=g[1],x=new a(32768),b=0;b<32768;++b){var w=(43690&b)>>>1|(21845&b)<<1;w=(61680&(w=(52428&w)>>>2|(13107&w)<<2))>>>4|(3855&w)<<4,x[b]=((65280&w)>>>8|(255&w)<<8)>>>1}var T=function(t,e,i){for(var n=t.length,r=0,s=new a(e);r>>l]=c}else for(o=new a(n),r=0;r>>15-t[r];return o},_=new o(288);for(b=0;b<144;++b)_[b]=8;for(b=144;b<256;++b)_[b]=9;for(b=256;b<280;++b)_[b]=7;for(b=280;b<288;++b)_[b]=8;var E=new o(32);for(b=0;b<32;++b)E[b]=5;var S=T(_,9,0),M=T(_,9,1),A=T(E,5,0),C=T(E,5,1),P=function(t){for(var e=t[0],i=1;ie&&(e=t[i]);return e},R=function(t,e,i){var n=e/8>>0;return(t[n]|t[n+1]<<8)>>>(7&e)&i},L=function(t,e){var i=e/8>>0;return(t[i]|t[i+1]<<8|t[i+2]<<16)>>>(7&e)},O=function(t){return(t/8>>0)+(7&t&&1)},D=function(t,e,i){(null==e||e<0)&&(e=0),(null==i||i>t.length)&&(i=t.length);var n=new(t instanceof a?a:t instanceof h?h:o)(i-e);return n.set(t.subarray(e,i)),n},I=function(t,e,i){var n=t.length,r=!e||i,s=!i||i.i;i||(i={}),e||(e=new o(3*n));var a=function(t){var i=e.length;if(t>i){var n=new o(Math.max(2*i,t));n.set(e),e=n}},h=i.f||0,d=i.p||0,p=i.b||0,m=i.l,g=i.d,y=i.m,x=i.n,b=8*n;do{if(!m){i.f=h=R(t,d,1);var w=R(t,d+1,3);if(d+=3,!w){var _=t[(G=O(d)+4)-4]|t[G-3]<<8,E=G+_;if(E>n){if(s)throw"unexpected EOF";break}r&&a(p+_),e.set(t.subarray(G,E),p),i.b=p+=_,i.p=d=8*E;continue}if(1==w)m=M,g=C,y=9,x=5;else{if(2!=w)throw"invalid block type";var S=R(t,d,31)+257,A=R(t,d+10,15)+4,I=S+R(t,d+5,31)+1;d+=14;for(var F=new o(I),B=new o(19),k=0;kb)break;var z=T(B,N,1);for(k=0;k>>4)<16)F[k++]=G;else{var H=0,W=0;for(16==G?(W=3+R(t,d,3),d+=2,H=F[k-1]):17==G?(W=3+R(t,d,7),d+=3):18==G&&(W=11+R(t,d,127),d+=7);W--;)F[k++]=H}}var X=F.subarray(0,S),j=F.subarray(S);y=P(X),x=P(j),m=T(X,y,1),g=T(j,x,1)}if(d>b)throw"unexpected EOF"}r&&a(p+131072);for(var Y=(1<>>4;if((d+=15&H)>b)throw"unexpected EOF";if(!H)throw"invalid length/literal";if(K<256)e[p++]=K;else{if(256==K){m=null;break}var J=K-254;if(K>264){var Q=l[k=K-257];J=R(t,d,(1<>>4;if(!$)throw"invalid distance";if(d+=15&$,j=v[tt],tt>3&&(Q=c[tt],j+=L(t,d)&(1<b)throw"unexpected EOF";r&&a(p+131072);for(var et=p+J;p>0;t[n]|=i,t[n+1]|=i>>>8},B=function(t,e,i){i<<=7&e;var n=e/8>>0;t[n]|=i,t[n+1]|=i>>>8,t[n+2]|=i>>>16},k=function(t,e){for(var i=[],n=0;nf&&(f=s[n].s);var m=new a(f+1),g=N(i[d-1],m,0);if(g>e){n=0;var v=0,y=g-e,x=1<e))break;v+=x-(1<>>=y;v>0;){var w=s[n].s;m[w]=0&&v;--n){var T=s[n].s;m[T]==e&&(--m[T],++v)}g=e}return[new o(m),g]},N=function(t,e,i){return-1==t.s?Math.max(N(t.l,e,i+1),N(t.r,e,i+1)):e[t.s]=i},U=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new a(++e),n=0,r=t[0],s=1,o=function(t){i[n++]=t},h=1;h<=e;++h)if(t[h]==r&&h!=e)++s;else{if(!r&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=t[h]}return[i.subarray(0,n),e]},z=function(t,e){for(var i=0,n=0;n>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var s=0;s4&&!N[u[H-1]];--H);var W,X,j,Y,q=p+5<<3,Z=z(r,_)+z(s,E)+o,K=z(r,g)+z(s,x)+o+14+3*H+z(O,N)+(2*O[16]+3*O[17]+7*O[18]);if(q<=Z&&q<=K)return G(e,f,t.subarray(d,d+p));if(F(e,f,1+(K15&&(F(e,f,tt[D]>>>5&127),f+=tt[D]>>>12)}}}else W=S,X=_,j=A,Y=E;for(D=0;D255){et=n[D]>>>18&31,B(e,f,W[et+257]),f+=X[et+257],et>7&&(F(e,f,n[D]>>>23&31),f+=l[et]);var it=31&n[D];B(e,f,j[it]),f+=Y[it],it>3&&(B(e,f,n[D]>>>5&8191),f+=c[it])}else B(e,f,W[n[D]]),f+=X[n[D]];return B(e,f,W[256]),f+X[256]},H=new h([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),W=new o(0),X=function(t,e,i,n,r,s){var u=t.length,d=new o(n+u+5*(1+Math.ceil(u/7e3))+r),p=d.subarray(n,d.length-r),f=0;if(!e||u<8)for(var g=0;g<=u;g+=65535){var v=g+65535;v>>13,w=8191&x,T=(1<7e3||F>24576)&&X>423){f=V(t,p,0,C,P,R,I,F,k,g-k,f),F=L=I=0,k=g;for(var j=0;j<286;++j)P[j]=0;for(j=0;j<30;++j)R[j]=0}var Y=2,q=0,Z=w,K=U-z&32767;if(X>2&&N==A(g-K))for(var J=Math.min(b,X)-1,Q=Math.min(32767,g),$=Math.min(258,X);K<=Q&&--Z&&U!=z;){if(t[g+Y]==t[g+Y-K]){for(var tt=0;tt<$&&t[g+tt]==t[g+tt-K];++tt);if(tt>Y){if(Y=tt,q=K,tt>J)break;var et=Math.min(K,tt-2),it=0;for(j=0;jit&&(it=rt,z=nt)}}}K+=(U=z)-(z=_[U])+32768&32767}if(q){C[F++]=268435456|m[Y]<<18|y[q];var st=31&m[Y],ot=31&y[q];I+=l[st]+c[ot],++P[257+st],++R[ot],B=g+Y,++L}else C[F++]=t[g],++P[t[g]]}}f=V(t,p,s,C,P,R,I,F,k,g-k,f),!s&&7&f&&(f=G(p,f+1,W))}return D(d,0,n+O(f)+r)},j=function(){for(var t=new h(256),e=0;e<256;++e){for(var i=e,n=9;--n;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),Y=function(){var t=4294967295;return{p:function(e){for(var i=t,n=0;n>>8;t=i},d:function(){return 4294967295^t}}},q=function(){var t=1,e=0;return{p:function(i){for(var n=t,r=e,s=i.length,o=0;o!=s;){for(var a=Math.min(o+5552,s);o>>8<<16|(255&e)<<8|e>>>8)+2*((255&t)<<23)}}},Z=function(t,e,i,n,r){return X(t,null==e.level?6:e.level,null==e.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,i,n,!r)},K=function(t,e){var i={};for(var n in t)i[n]=t[n];for(var n in e)i[n]=e[n];return i},J=function(t,e,i){for(var n=t(),r=t.toString(),s=r.slice(r.indexOf("[")+1,r.lastIndexOf("]")).replace(/ /g,"").split(","),o=0;o>>=8},mt=function(t,e){var i=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&ft(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),i){t[3]=8;for(var n=0;n<=i.length;++n)t[n+10]=i.charCodeAt(n)}},gt=function(t){if(31!=t[0]||139!=t[1]||8!=t[2])throw"invalid gzip data";var e=t[3],i=10;4&e&&(i+=t[10]|2+(t[11]<<8));for(var n=(e>>3&1)+(e>>4&1);n>0;n-=!t[i++]);return i+(2&e)},vt=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16)+2*(t[e-1]<<23)},yt=function(t){return 10+(t.filename&&t.filename.length+1||0)},xt=function(t,e){var i=e.level,n=0==i?0:i<6?1:9==i?3:2;t[0]=120,t[1]=n<<6|(n?32-2*n:1)},bt=function(t){if(8!=(15&t[0])||t[0]>>>4>7||(t[0]<<8|t[1])%31)throw"invalid zlib data";if(32&t[1])throw"invalid zlib data: preset dictionaries not supported"};function wt(t,e){return e||"function"!=typeof t||(e=t,t={}),this.ondata=e,t}var Tt=function(){function t(t,e){e||"function"!=typeof t||(e=t,t={}),this.ondata=e,this.o=t||{}}return t.prototype.p=function(t,e){this.ondata(Z(t,this.o,0,0,!e),e)},t.prototype.push=function(t,e){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";this.d=e,this.p(t,e||!1)},t}(),_t=function(t,e){ct([et,function(){return[lt,Tt]}],this,wt.call(this,t,e),(function(t){var e=new Tt(t.data);onmessage=lt(e)}),6)};function Et(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";return ht(t,e,[et],(function(t){return ot(St(t.data[0],t.data[1]))}),0,i)}function St(t,e){return void 0===e&&(e={}),Z(t,e,0,0)}var Mt=function(){function t(t){this.s={},this.p=new o(0),this.ondata=t}return t.prototype.e=function(t){if(this.d)throw"stream finished";if(!this.ondata)throw"no stream handler";var e=this.p.length,i=new o(e+t.length);i.set(this.p),i.set(t,e),this.p=i},t.prototype.c=function(t){this.d=this.s.i=t||!1;var e=this.s.b,i=I(this.p,this.o,this.s);this.ondata(D(i,e,this.s.b),this.d),this.o=D(i,this.s.b-32768),this.s.b=this.o.length,this.p=D(this.p,this.s.p/8>>0),this.s.p&=7},t.prototype.push=function(t,e){this.e(t),this.c(e)},t}(),At=function(t){this.ondata=t,ct([tt,function(){return[lt,Mt]}],this,0,(function(){var t=new Mt;onmessage=lt(t)}),7)};function Ct(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";return ht(t,e,[tt],(function(t){return ot(Pt(t.data[0],at(t.data[1])))}),1,i)}function Pt(t,e){return I(t,e)}var Rt=function(){function t(t,e){this.c=Y(),this.l=0,this.v=1,Tt.call(this,t,e)}return t.prototype.push=function(t,e){Tt.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t),this.l+=t.length;var i=Z(t,this.o,this.v&&yt(this.o),e&&8,!e);this.v&&(mt(i,this.o),this.v=0),e&&(ft(i,i.length-8,this.c.d()),ft(i,i.length-4,this.l)),this.ondata(i,e)},t}(),Lt=function(t,e){ct([et,it,function(){return[lt,Tt,Rt]}],this,wt.call(this,t,e),(function(t){var e=new Rt(t.data);onmessage=lt(e)}),8)};function Ot(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";return ht(t,e,[et,it,function(){return[Dt]}],(function(t){return ot(Dt(t.data[0],t.data[1]))}),2,i)}function Dt(t,e){void 0===e&&(e={});var i=Y(),n=t.length;i.p(t);var r=Z(t,e,yt(e),8),s=r.length;return mt(r,e),ft(r,s-8,i.d()),ft(r,s-4,n),r}var It=function(){function t(t){this.v=1,Mt.call(this,t)}return t.prototype.push=function(t,e){if(Mt.prototype.e.call(this,t),this.v){var i=gt(this.p);if(i>=this.p.length&&!e)return;this.p=this.p.subarray(i),this.v=0}if(e){if(this.p.length<8)throw"invalid gzip stream";this.p=this.p.subarray(0,-8)}Mt.prototype.c.call(this,e)},t}(),Ft=function(t){this.ondata=t,ct([tt,nt,function(){return[lt,Mt,It]}],this,0,(function(){var t=new It;onmessage=lt(t)}),9)};function Bt(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";return ht(t,e,[tt,nt,function(){return[kt]}],(function(t){return ot(kt(t.data[0]))}),3,i)}function kt(t,e){return I(t.subarray(gt(t),-8),e||new o(vt(t)))}var Nt=function(){function t(t,e){this.c=q(),this.v=1,Tt.call(this,t,e)}return t.prototype.push=function(t,e){Tt.prototype.push.call(this,t,e)},t.prototype.p=function(t,e){this.c.p(t);var i=Z(t,this.o,this.v&&2,e&&4,!e);this.v&&(xt(i,this.o),this.v=0),e&&ft(i,i.length-4,this.c.d()),this.ondata(i,e)},t}(),Ut=function(t,e){ct([et,rt,function(){return[lt,Tt,Nt]}],this,wt.call(this,t,e),(function(t){var e=new Nt(t.data);onmessage=lt(e)}),10)};function zt(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";return ht(t,e,[et,rt,function(){return[Gt]}],(function(t){return ot(Gt(t.data[0],t.data[1]))}),4,i)}function Gt(t,e){void 0===e&&(e={});var i=q();i.p(t);var n=Z(t,e,2,4);return xt(n,e),ft(n,n.length-4,i.d()),n}var Vt=function(){function t(t){this.v=1,Mt.call(this,t)}return t.prototype.push=function(t,e){if(Mt.prototype.e.call(this,t),this.v){if(this.p.length<2&&!e)return;this.p=this.p.subarray(2),this.v=0}if(e){if(this.p.length<4)throw"invalid zlib stream";this.p=this.p.subarray(0,-4)}Mt.prototype.c.call(this,e)},t}(),Ht=function(t){this.ondata=t,ct([tt,st,function(){return[lt,Mt,Vt]}],this,0,(function(){var t=new Vt;onmessage=lt(t)}),11)};function Wt(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";return ht(t,e,[tt,st,function(){return[Xt]}],(function(t){return ot(Xt(t.data[0],at(t.data[1])))}),5,i)}function Xt(t,e){return I((bt(t),t.subarray(2,-4)),e)}var jt=function(){function t(t){this.G=It,this.I=Mt,this.Z=Vt,this.ondata=t}return t.prototype.push=function(t,e){if(!this.ondata)throw"no stream handler";if(this.s)this.s.push(t,e);else{if(this.p&&this.p.length){var i=new o(this.p.length+t.length);i.set(this.p),i.set(t,this.p.length)}else this.p=t;if(this.p.length>2){var n=this,r=function(){n.ondata.apply(n,arguments)};this.s=31==this.p[0]&&139==this.p[1]&&8==this.p[2]?new this.G(r):8!=(15&this.p[0])||this.p[0]>>4>7||(this.p[0]<<8|this.p[1])%31?new this.I(r):new this.Z(r),this.s.push(this.p,e),this.p=null}}},t}(),Yt=function(){function t(t){this.G=Ft,this.I=At,this.Z=Ht,this.ondata=t}return t.prototype.push=function(t,e){jt.prototype.push.call(this,t,e)},t}();function qt(t,e,i){if(i||(i=e,e={}),"function"!=typeof i)throw"no callback";return 31==t[0]&&139==t[1]&&8==t[2]?Bt(t,e,i):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Ct(t,e,i):Wt(t,e,i)}function Zt(t,e){return 31==t[0]&&139==t[1]&&8==t[2]?kt(t,e):8!=(15&t[0])||t[0]>>4>7||(t[0]<<8|t[1])%31?Pt(t,e):Xt(t,e)}var Kt=function(t,e,i,n){for(var r in t){var s=t[r],a=e+r;s instanceof o?i[a]=[s,n]:Array.isArray(s)?i[a]=[s[0],K(n,s[1])]:Kt(s,a+"/",i,n)}},Jt="undefined"!=typeof TextEncoder&&new TextEncoder,Qt="undefined"!=typeof TextDecoder&&new TextDecoder,$t=0;try{Qt.decode(W,{stream:!0}),$t=1}catch(t){}var te=function(t){for(var e="",i=0;;){var n=t[i++],r=(n>127)+(n>223)+(n>239);if(i+r>t.length)return[e,t.slice(i-1)];r?3==r?(n=((15&n)<<18|(63&t[i++])<<12|(63&t[i++])<<6|63&t[i++])-65536,e+=String.fromCharCode(55296|n>>10,56320|1023&n)):e+=1&r?String.fromCharCode((31&n)<<6|63&t[i++]):String.fromCharCode((15&n)<<12|(63&t[i++])<<6|63&t[i++]):e+=String.fromCharCode(n)}},ee=function(){function t(t){this.ondata=t,$t?this.t=new TextDecoder:this.p=W}return t.prototype.push=function(t,e){if(!this.ondata)throw"no callback";if(e||(e=!1),this.t)return this.ondata(this.t.decode(t,{stream:!e}),e);var i=new o(this.p.length+t.length);i.set(this.p),i.set(t,this.p.length);var n=te(i),r=n[0],s=n[1];if(e&&s.length)throw"invalid utf-8 data";this.p=s,this.ondata(r,e)},t}(),ie=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,e){if(!this.ondata)throw"no callback";this.ondata(ne(t),e||!1)},t}();function ne(t,e){if(e){for(var i=new o(t.length),n=0;n>1)),a=0,h=function(t){s[a++]=t};for(n=0;ns.length){var l=new o(a+8+(r-n<<1));l.set(s),s=l}var c=t.charCodeAt(n);c<128||e?h(c):c<2048?(h(192|c>>>6),h(128|63&c)):c>55295&&c<57344?(h(240|(c=65536+(1047552&c)|1023&t.charCodeAt(++n))>>>18),h(128|c>>>12&63),h(128|c>>>6&63),h(128|63&c)):(h(224|c>>>12),h(128|c>>>6&63),h(128|63&c))}return D(s,0,a)}function re(t,e){if(e){for(var i="",n=0;n>8;var h=new Date(null==i.mtime?Date.now():i.mtime),l=h.getFullYear()-1980;if(l<0||l>119)throw"date not in range 1980-2099";return ft(t,e,2*(l<<24)|h.getMonth()+1<<21|h.getDate()<<16|h.getHours()<<11|h.getMinutes()<<5|h.getSeconds()>>>1),e+=4,null!=s&&(ft(t,e,i.crc),ft(t,e+4,s),ft(t,e+8,i.size)),ft(t,e+12,a),e+=16,null!=o&&(ft(t,e+6,i.attrs),ft(t,e+10,o),e+=14),t.set(n,e),e+a},ce=function(t,e,i,n,r){ft(t,e,101010256),ft(t,e+8,i),ft(t,e+10,i),ft(t,e+12,n),ft(t,e+16,r)},ue=function(){function t(t){this.filename=t,this.c=Y(),this.size=0,this.compression=0}return t.prototype.process=function(t,e){this.ondata(null,t,e)},t.prototype.push=function(t,e){if(!this.ondata)throw"no callback - add to ZIP archive before pushing";this.c.p(t),this.size+=t.length,e&&(this.crc=this.c.d()),this.process(t,e||!1)},t}(),de=function(){function t(t,e){var i=this;void 0===e&&(e={}),ue.call(this,t),this.d=new Tt(e,(function(t,e){i.ondata(null,t,e)})),this.compression=8,this.flag=se(e.level)}return t.prototype.process=function(t,e){try{this.d.push(t,e)}catch(t){this.ondata(t,null,e)}},t.prototype.push=function(t,e){ue.prototype.push.call(this,t,e)},t}(),pe=function(){function t(t,e){var i=this;void 0===e&&(e={}),ue.call(this,t),this.d=new _t(e,(function(t,e,n){i.ondata(t,e,n)})),this.compression=8,this.flag=se(e.level),this.terminate=this.d.terminate}return t.prototype.process=function(t,e){this.d.push(t,e)},t.prototype.push=function(t,e){ue.prototype.push.call(this,t,e)},t}(),fe=function(){function t(t){this.ondata=t,this.u=[],this.d=1}return t.prototype.add=function(t){var e=this;if(2&this.d)throw"stream finished";var i=ne(t.filename),n=i.length,r=n!=t.filename.length,s=n+30;if(n>65535)throw"filename too long";var a=new o(s);le(a,0,t,i,r);var h=[a],l=function(){for(var t=0,i=h;t65535&&b("filename too long",null),x)if(g<16e4)try{b(null,St(l,f))}catch(t){b(t,null)}else u.push(Et(l,f,b));else b(null,l)},m=0;m65535)throw"filename too long";var p=u?St(l,c):l,f=p.length,m=Y();m.p(l),n.push(K(c,{size:l.length,crc:m.d(),c:p,f:b,u:d!=a.length,o:r,compression:u})),r+=30+d+f,s+=76+2*d+f}for(var g=new o(s+22),v=r,y=s-r,x=0;xh+30+u+d){var f=[];m.k.unshift(f),a=2,l=h;var g=dt(c,h+18),v=re(c.subarray(h+30,h+=30+u),!r);if(s&&(g=-1),4294967295==g&&(g=he(c,h)[0]),!m.o[e])return m.onfile("unknown compression type "+e,v,null),"break";m.c=g;var y={start:function(){if(!y.ondata)throw"no callback";if(g){var t=new i.o[e];t.ondata=function(t,e,i){y.ondata(t,e,i)};for(var n=0,r=f;n65558)return void e("invalid zip file",null);var a=ut(t,s+8);a||e(null,{});var h=a,l=dt(t,s+16),c=4294967295==l;if(c){if(s=dt(t,s-12),101075792!=dt(t,s))return void e("invalid zip file",null);h=a=dt(t,s+32),l=dt(t,s+48)}for(var u=function(s){var h=ae(t,l,c),u=h[0],d=h[1],p=h[2],f=h[3],m=h[4],g=h[5],v=oe(t,g);l=m;var y=function(t,i){t?(n(),e(t,null)):(r[f]=i,--a||e(null,r))};if(u)if(8==u){var x=t.subarray(v,v+d);if(d<32e4)try{y(null,Pt(x,new o(p)))}catch(t){y(t,null)}else i.push(Ct(x,{size:p},y))}else y("unknown compression type "+u,null);else y(null,D(t,v,v+d))},d=0;d65558)throw"invalid zip file";var n=ut(t,i+8);if(!n)return{};var r=dt(t,i+16),s=4294967295==r;if(s){if(i=dt(t,i-12),101075792!=dt(t,i))throw"invalid zip file";n=dt(t,i+32),r=dt(t,i+48)}for(var a=0;a=i[n])return n-1;if(e<=i[t])return t;for(var r=t,s=n,o=Math.floor((r+s)/2);e=i[o+1];)e=b&&(x[y][0]=x[v][0]/h[_+1][T],w=x[y][0]*h[T][_]);var E=p-1<=_?b-1:i-p;for(u=T>=-1?1:-T;u<=E;++u)x[y][u]=(x[v][u]-x[v][u-1])/h[_+1][T+u],w+=x[y][u]*h[T+u][_];p<=_&&(x[y][b]=-x[v][b-1]/h[_+1][p],w+=x[y][b]*h[p][_]),a[b][p]=w;u=v;v=y,y=u}}for(p=i,b=1;b<=n;++b){for(u=0;u<=i;++u)a[b][u]*=p;p*=i-b}return a},calcBSplineDerivatives:function(t,e,i,n,s){for(var o=s=a.length&&a===T(s,0,a.length))t=(new c).parse(e);else{var n=T(e);if(!function(t){var e=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],i=0;for(var n=0;n0,a="string"==typeof s.Content&&""!==s.Content;if(o||a){var h=this.parseImage(n[r]);i[s.RelativeFilename||s.Filename]=h}}}}for(var l in e){var c=e[l];void 0!==i[c]?e[l]=i[c]:e[l]=e[l].split("\\").pop()}return e},parseImage:function(t){var e,i=t.Content,n=t.RelativeFilename||t.Filename,r=n.slice(n.lastIndexOf(".")+1).toLowerCase();switch(r){case"bmp":e="image/bmp";break;case"jpg":case"jpeg":e="image/jpeg";break;case"png":e="image/png";break;case"tif":e="image/tiff";break;case"tga":null===this.manager.getHandler(".tga")&&console.warn("FBXLoader: TGA loader not found, skipping ",n),e="image/tga";break;default:return void console.warn('FBXLoader: Image type "'+r+'" is not supported.')}if("string"==typeof i)return"data:"+e+";base64,"+i;var s=new Uint8Array(i);return window.URL.createObjectURL(new Blob([s],{type:e}))},parseTextures:function(e){var i=new Map;if("Texture"in t.Objects){var n=t.Objects.Texture;for(var r in n){var s=this.parseTexture(n[r],e);i.set(parseInt(r),s)}}return i},parseTexture:function(t,e){var i=this.loadTexture(t,e);i.ID=t.id,i.name=t.attrName;var n=t.WrapModeU,s=t.WrapModeV,o=void 0!==n?n.value:0,a=void 0!==s?s.value:0;if(i.wrapS=0===o?r.RepeatWrapping:r.ClampToEdgeWrapping,i.wrapT=0===a?r.RepeatWrapping:r.ClampToEdgeWrapping,"Scaling"in t){var h=t.Scaling.value;i.repeat.x=h[0],i.repeat.y=h[1]}return i},loadTexture:function(t,i){var n,s,o=this.textureLoader.path,a=e.get(t.id).children;void 0!==a&&a.length>0&&void 0!==i[a[0].ID]&&(0!==(n=i[a[0].ID]).indexOf("blob:")&&0!==n.indexOf("data:")||this.textureLoader.setPath(void 0));var h=t.FileName.slice(-3).toLowerCase();if("tga"===h){var l=this.manager.getHandler(".tga");null===l?(console.warn("FBXLoader: TGA loader not found, creating placeholder texture for",t.RelativeFilename),s=new r.Texture):s=l.load(n)}else"psd"===h?(console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",t.RelativeFilename),s=new r.Texture):s=this.textureLoader.load(n);return this.textureLoader.setPath(o),s},parseMaterials:function(e){var i=new Map;if("Material"in t.Objects){var n=t.Objects.Material;for(var r in n){var s=this.parseMaterial(n[r],e);null!==s&&i.set(parseInt(r),s)}}return i},parseMaterial:function(t,i){var n=t.id,s=t.attrName,o=t.ShadingModel;if("object"==typeof o&&(o=o.value),!e.has(n))return null;var a,h=this.parseParameters(t,i,n);switch(o.toLowerCase()){case"phong":a=new r.MeshPhongMaterial;break;case"lambert":a=new r.MeshLambertMaterial;break;default:console.warn('THREE.FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',o),a=new r.MeshPhongMaterial}return a.setValues(h),a.name=s,a},parseParameters:function(t,i,n){var s={};t.BumpFactor&&(s.bumpScale=t.BumpFactor.value),t.Diffuse?s.color=(new r.Color).fromArray(t.Diffuse.value):!t.DiffuseColor||"Color"!==t.DiffuseColor.type&&"ColorRGB"!==t.DiffuseColor.type||(s.color=(new r.Color).fromArray(t.DiffuseColor.value)),t.DisplacementFactor&&(s.displacementScale=t.DisplacementFactor.value),t.Emissive?s.emissive=(new r.Color).fromArray(t.Emissive.value):!t.EmissiveColor||"Color"!==t.EmissiveColor.type&&"ColorRGB"!==t.EmissiveColor.type||(s.emissive=(new r.Color).fromArray(t.EmissiveColor.value)),t.EmissiveFactor&&(s.emissiveIntensity=parseFloat(t.EmissiveFactor.value)),t.Opacity&&(s.opacity=parseFloat(t.Opacity.value)),s.opacity<1&&(s.transparent=!0),t.ReflectionFactor&&(s.reflectivity=t.ReflectionFactor.value),t.Shininess&&(s.shininess=t.Shininess.value),t.Specular?s.specular=(new r.Color).fromArray(t.Specular.value):t.SpecularColor&&"Color"===t.SpecularColor.type&&(s.specular=(new r.Color).fromArray(t.SpecularColor.value));var o=this;return e.get(n).children.forEach((function(t){var e=t.relationship;switch(e){case"Bump":s.bumpMap=o.getTexture(i,t.ID);break;case"Maya|TEX_ao_map":s.aoMap=o.getTexture(i,t.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":s.map=o.getTexture(i,t.ID),s.map.encoding=r.sRGBEncoding;break;case"DisplacementColor":s.displacementMap=o.getTexture(i,t.ID);break;case"EmissiveColor":s.emissiveMap=o.getTexture(i,t.ID),s.emissiveMap.encoding=r.sRGBEncoding;break;case"NormalMap":case"Maya|TEX_normal_map":s.normalMap=o.getTexture(i,t.ID);break;case"ReflectionColor":s.envMap=o.getTexture(i,t.ID),s.envMap.mapping=r.EquirectangularReflectionMapping,s.envMap.encoding=r.sRGBEncoding;break;case"SpecularColor":s.specularMap=o.getTexture(i,t.ID),s.specularMap.encoding=r.sRGBEncoding;break;case"TransparentColor":case"TransparencyFactor":s.alphaMap=o.getTexture(i,t.ID),s.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("THREE.FBXLoader: %s map is not supported in three.js, skipping texture.",e)}})),s},getTexture:function(i,n){return"LayeredTexture"in t.Objects&&n in t.Objects.LayeredTexture&&(console.warn("THREE.FBXLoader: layered textures are not supported in three.js. Discarding all but first layer."),n=e.get(n).children[0].ID),i.get(n)},parseDeformers:function(){var i={},n={};if("Deformer"in t.Objects){var r=t.Objects.Deformer;for(var s in r){var o=r[s],a=e.get(parseInt(s));if("Skin"===o.attrType){var h=this.parseSkeleton(a,r);h.ID=s,a.parents.length>1&&console.warn("THREE.FBXLoader: skeleton attached to more than one geometry is not supported."),h.geometryID=a.parents[0].ID,i[s]=h}else if("BlendShape"===o.attrType){var l={id:s};l.rawTargets=this.parseMorphTargets(a,r),l.id=s,a.parents.length>1&&console.warn("THREE.FBXLoader: morph target attached to more than one geometry is not supported."),n[s]=l}}}return{skeletons:i,morphTargets:n}},parseSkeleton:function(t,e){var i=[];return t.children.forEach((function(t){var n=e[t.ID];if("Cluster"===n.attrType){var s={ID:t.ID,indices:[],weights:[],transformLink:(new r.Matrix4).fromArray(n.TransformLink.a)};"Indexes"in n&&(s.indices=n.Indexes.a,s.weights=n.Weights.a),i.push(s)}})),{rawBones:i,bones:[]}},parseMorphTargets:function(t,i){for(var n=[],r=0;r1?o=a:a.length>0?o=a[0]:(o=new r.MeshPhongMaterial({color:13421772}),a.push(o)),"color"in s.attributes&&a.forEach((function(t){t.vertexColors=!0})),s.FBX_Deformer?(a.forEach((function(t){t.skinning=!0})),(n=new r.SkinnedMesh(s,o)).normalizeSkinWeights()):n=new r.Mesh(s,o),n},createCurve:function(t,e){var i=t.children.reduce((function(t,i){return e.has(i.ID)&&(t=e.get(i.ID)),t}),null),n=new r.LineBasicMaterial({color:3342591,linewidth:1});return new r.Line(i,n)},getTransformData:function(t,e){var i={};"InheritType"in e&&(i.inheritType=parseInt(e.InheritType.value)),i.eulerOrder="RotationOrder"in e?b(e.RotationOrder.value):"ZYX","Lcl_Translation"in e&&(i.translation=e.Lcl_Translation.value),"PreRotation"in e&&(i.preRotation=e.PreRotation.value),"Lcl_Rotation"in e&&(i.rotation=e.Lcl_Rotation.value),"PostRotation"in e&&(i.postRotation=e.PostRotation.value),"Lcl_Scaling"in e&&(i.scale=e.Lcl_Scaling.value),"ScalingOffset"in e&&(i.scalingOffset=e.ScalingOffset.value),"ScalingPivot"in e&&(i.scalingPivot=e.ScalingPivot.value),"RotationOffset"in e&&(i.rotationOffset=e.RotationOffset.value),"RotationPivot"in e&&(i.rotationPivot=e.RotationPivot.value),t.userData.transformData=i},setLookAtProperties:function(n,s){"LookAtProperty"in s&&e.get(n.ID).children.forEach((function(e){if("LookAtProperty"===e.relationship){var s=t.Objects.Model[e.ID];if("Lcl_Translation"in s){var o=s.Lcl_Translation.value;void 0!==n.target?(n.target.position.fromArray(o),i.add(n.target)):n.lookAt((new r.Vector3).fromArray(o))}}}))},bindSkeleton:function(t,i,n){var s=this.parsePoseNodes();for(var o in t){var a=t[o];e.get(parseInt(a.ID)).parents.forEach((function(t){if(i.has(t.ID)){var o=t.ID;e.get(o).parents.forEach((function(t){n.has(t.ID)&&n.get(t.ID).bind(new r.Skeleton(a.bones),s[t.ID])}))}}))}},parsePoseNodes:function(){var e={};if("Pose"in t.Objects){var i=t.Objects.Pose;for(var n in i)if("BindPose"===i[n].attrType){var s=i[n].PoseNode;Array.isArray(s)?s.forEach((function(t){e[t.Node]=(new r.Matrix4).fromArray(t.Matrix.a)})):e[s.Node]=(new r.Matrix4).fromArray(s.Matrix.a)}}return e},createAmbientLight:function(){if("GlobalSettings"in t&&"AmbientColor"in t.GlobalSettings){var e=t.GlobalSettings.AmbientColor.value,n=e[0],s=e[1],o=e[2];if(0!==n||0!==s||0!==o){var a=new r.Color(n,s,o);i.add(new r.AmbientLight(a,1))}}},setupMorphMaterials:function(){var t=this;i.traverse((function(e){e.isMesh&&e.geometry.morphAttributes.position&&e.geometry.morphAttributes.position.length&&(Array.isArray(e.material)?e.material.forEach((function(i,n){t.setupMorphMaterial(e,i,n)})):t.setupMorphMaterial(e,e.material))}))},setupMorphMaterial:function(t,e,n){var r=t.uuid,s=e.uuid,o=!1;if(i.traverse((function(t){t.isMesh&&(Array.isArray(t.material)?t.material.forEach((function(e){e.uuid===s&&t.uuid!==r&&(o=!0)})):t.material.uuid===s&&t.uuid!==r&&(o=!0))})),!0===o){var a=e.clone();a.morphTargets=!0,void 0===n?t.material=a:t.material[n]=a}else e.morphTargets=!0}},a.prototype={constructor:a,parse:function(i){var n=new Map;if("Geometry"in t.Objects){var r=t.Objects.Geometry;for(var s in r){var o=e.get(parseInt(s)),a=this.parseGeometry(o,r[s],i);n.set(parseInt(s),a)}}return n},parseGeometry:function(t,e,i){switch(e.attrType){case"Mesh":return this.parseMeshGeometry(t,e,i);case"NurbsCurve":return this.parseNurbsGeometry(e)}},parseMeshGeometry:function(e,i,n){var r=n.skeletons,s=[],o=e.parents.map((function(e){return t.Objects.Model[e.ID]}));if(0!==o.length){var a=e.children.reduce((function(t,e){return void 0!==r[e.ID]&&(t=r[e.ID]),t}),null);e.children.forEach((function(t){void 0!==n.morphTargets[t.ID]&&s.push(n.morphTargets[t.ID])}));var h=o[0],l={};"RotationOrder"in h&&(l.eulerOrder=b(h.RotationOrder.value)),"InheritType"in h&&(l.inheritType=parseInt(h.InheritType.value)),"GeometricTranslation"in h&&(l.translation=h.GeometricTranslation.value),"GeometricRotation"in h&&(l.rotation=h.GeometricRotation.value),"GeometricScaling"in h&&(l.scale=h.GeometricScaling.value);var c=x(l);return this.genGeometry(i,a,s,c)}},genGeometry:function(t,e,i,n){var s=new r.BufferGeometry;t.attrName&&(s.name=t.attrName);var o=this.parseGeoNode(t,e),a=this.genBuffers(o),h=new r.Float32BufferAttribute(a.vertex,3);if(h.applyMatrix4(n),s.setAttribute("position",h),a.colors.length>0&&s.setAttribute("color",new r.Float32BufferAttribute(a.colors,3)),e&&(s.setAttribute("skinIndex",new r.Uint16BufferAttribute(a.weightsIndices,4)),s.setAttribute("skinWeight",new r.Float32BufferAttribute(a.vertexWeights,4)),s.FBX_Deformer=e),a.normal.length>0){var l=(new r.Matrix3).getNormalMatrix(n),c=new r.Float32BufferAttribute(a.normal,3);c.applyNormalMatrix(l),s.setAttribute("normal",c)}if(a.uvs.forEach((function(t,e){var i="uv"+(e+1).toString();0===e&&(i="uv"),s.setAttribute(i,new r.Float32BufferAttribute(a.uvs[e],2))})),o.material&&"AllSame"!==o.material.mappingType){var u=a.materialIndex[0],d=0;if(a.materialIndex.forEach((function(t,e){t!==u&&(s.addGroup(d,e-d,u),u=t,d=e)})),s.groups.length>0){var p=s.groups[s.groups.length-1],f=p.start+p.count;f!==a.materialIndex.length&&s.addGroup(f,a.materialIndex.length-f,u)}0===s.groups.length&&s.addGroup(0,a.materialIndex.length,a.materialIndex[0])}return this.addMorphTargets(s,t,i,n),s},parseGeoNode:function(t,e){var i={};if(i.vertexPositions=void 0!==t.Vertices?t.Vertices.a:[],i.vertexIndices=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],t.LayerElementColor&&(i.color=this.parseVertexColors(t.LayerElementColor[0])),t.LayerElementMaterial&&(i.material=this.parseMaterialIndices(t.LayerElementMaterial[0])),t.LayerElementNormal&&(i.normal=this.parseNormals(t.LayerElementNormal[0])),t.LayerElementUV){i.uv=[];for(var n=0;t.LayerElementUV[n];)t.LayerElementUV[n].UV&&i.uv.push(this.parseUVs(t.LayerElementUV[n])),n++}return i.weightTable={},null!==e&&(i.skeleton=e,e.rawBones.forEach((function(t,e){t.indices.forEach((function(n,r){void 0===i.weightTable[n]&&(i.weightTable[n]=[]),i.weightTable[n].push({id:e,weight:t.weights[r]})}))}))),i},genBuffers:function(t){var e={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]},i=0,n=0,r=!1,s=[],o=[],a=[],h=[],l=[],c=[],u=this;return t.vertexIndices.forEach((function(d,p){var f=!1;d<0&&(d^=-1,f=!0);var m=[],v=[];if(s.push(3*d,3*d+1,3*d+2),t.color){var y=g(p,i,d,t.color);a.push(y[0],y[1],y[2])}if(t.skeleton){if(void 0!==t.weightTable[d]&&t.weightTable[d].forEach((function(t){v.push(t.weight),m.push(t.id)})),v.length>4){r||(console.warn("THREE.FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),r=!0);var x=[0,0,0,0],b=[0,0,0,0];v.forEach((function(t,e){var i=t,n=m[e];b.forEach((function(t,e,r){if(i>t){r[e]=i,i=t;var s=x[e];x[e]=n,n=s}}))})),m=x,v=b}for(;v.length<4;)v.push(0),m.push(0);for(var w=0;w<4;++w)l.push(v[w]),c.push(m[w])}if(t.normal){y=g(p,i,d,t.normal);o.push(y[0],y[1],y[2])}if(t.material&&"AllSame"!==t.material.mappingType)var T=g(p,i,d,t.material)[0];t.uv&&t.uv.forEach((function(t,e){var n=g(p,i,d,t);void 0===h[e]&&(h[e]=[]),h[e].push(n[0]),h[e].push(n[1])})),n++,f&&(u.genFace(e,t,s,T,o,a,h,l,c,n),i++,n=0,s=[],o=[],a=[],h=[],l=[],c=[])})),e},genFace:function(t,e,i,n,r,s,o,a,h,l){for(var c=2;c1&&console.warn("THREE.FBXLoader: Encountered an animation stack with multiple layers, this is currently not supported. Ignoring subsequent layers.");var a=i.get(o[0].ID);r[s]={name:n[s].attrName,layer:a}}return r},addClip:function(t){var e=[],i=this;return t.layer.forEach((function(t){e=e.concat(i.generateTracks(t))})),new r.AnimationClip(t.name,-1,e)},generateTracks:function(t){var e=[],i=new r.Vector3,n=new r.Quaternion,s=new r.Vector3;if(t.transform&&t.transform.decompose(i,n,s),i=i.toArray(),n=(new r.Euler).setFromQuaternion(n,t.eulerOrder).toArray(),s=s.toArray(),void 0!==t.T&&Object.keys(t.T.curves).length>0){var o=this.generateVectorTrack(t.modelName,t.T.curves,i,"position");void 0!==o&&e.push(o)}if(void 0!==t.R&&Object.keys(t.R.curves).length>0){var a=this.generateRotationTrack(t.modelName,t.R.curves,n,t.preRotation,t.postRotation,t.eulerOrder);void 0!==a&&e.push(a)}if(void 0!==t.S&&Object.keys(t.S.curves).length>0){var h=this.generateVectorTrack(t.modelName,t.S.curves,s,"scale");void 0!==h&&e.push(h)}if(void 0!==t.DeformPercent){var l=this.generateMorphTrack(t);void 0!==l&&e.push(l)}return e},generateVectorTrack:function(t,e,i,n){var s=this.getTimesForAllAxes(e),o=this.getKeyframeTrackValues(s,e,i);return new r.VectorKeyframeTrack(t+"."+n,s,o)},generateRotationTrack:function(t,e,i,n,s,o){void 0!==e.x&&(this.interpolateRotations(e.x),e.x.values=e.x.values.map(r.MathUtils.degToRad)),void 0!==e.y&&(this.interpolateRotations(e.y),e.y.values=e.y.values.map(r.MathUtils.degToRad)),void 0!==e.z&&(this.interpolateRotations(e.z),e.z.values=e.z.values.map(r.MathUtils.degToRad));var a=this.getTimesForAllAxes(e),h=this.getKeyframeTrackValues(a,e,i);void 0!==n&&((n=n.map(r.MathUtils.degToRad)).push(o),n=(new r.Euler).fromArray(n),n=(new r.Quaternion).setFromEuler(n)),void 0!==s&&((s=s.map(r.MathUtils.degToRad)).push(o),s=(new r.Euler).fromArray(s),s=(new r.Quaternion).setFromEuler(s).invert());for(var l=new r.Quaternion,c=new r.Euler,u=[],d=0;d1){for(var i=1,n=e[0],r=1;r=180){for(var s=r/180,o=n/s,a=i+o,h=t.times[e-1],l=(t.times[e]-h)/s,c=h+l,u=[],d=[];c1&&(i=t[1].replace(/^(\w+)::/,""),n=t[2]),{id:e,name:i,type:n}},parseNodeProperty:function(t,e,i){var n=e[1].replace(/^"/,"").replace(/"$/,"").trim(),r=e[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===n&&","===r&&(r=i.replace(/"/g,"").replace(/,$/,"").trim());var s=this.getCurrentNode();if("Properties70"!==s.name){if("C"===n){var o=r.split(",").slice(1),a=parseInt(o[0]),h=parseInt(o[1]),l=r.split(",").slice(3);n="connections",function(t,e){for(var i=0,n=t.length,r=e.length;i=t.size():t.getOffset()+160+16>=t.size()},parseNode:function(t,e){var i={},n=e>=7500?t.getUint64():t.getUint32(),r=e>=7500?t.getUint64():t.getUint32();e>=7500?t.getUint64():t.getUint32();var s=t.getUint8(),o=t.getString(s);if(0===n)return null;for(var a=[],h=0;h0?a[0]:"",c=a.length>1?a[1]:"",u=a.length>2?a[2]:"";for(i.singleProperty=1===r&&t.getOffset()===n;n>t.getOffset();){var d=this.parseNode(t,e);null!==d&&this.parseSubNode(o,i,d)}return i.propertyList=a,"number"==typeof l&&(i.id=l),""!==c&&(i.attrName=c),""!==u&&(i.attrType=u),""!==o&&(i.name=o),i},parseSubNode:function(t,e,i){if(!0===i.singleProperty){var n=i.propertyList[0];Array.isArray(n)?(e[i.name]=i,i.a=n):e[i.name]=n}else if("Connections"===t&&"C"===i.name){var r=[];i.propertyList.forEach((function(t,e){0!==e&&r.push(t)})),void 0===e.connections&&(e.connections=[]),e.connections.push(r)}else if("Properties70"===i.name){Object.keys(i).forEach((function(t){e[t]=i[t]}))}else if("Properties70"===t&&"P"===i.name){var s,o=i.propertyList[0],a=i.propertyList[1],h=i.propertyList[2],l=i.propertyList[3];0===o.indexOf("Lcl ")&&(o=o.replace("Lcl ","Lcl_")),0===a.indexOf("Lcl ")&&(a=a.replace("Lcl ","Lcl_")),s="Color"===a||"ColorRGB"===a||"Vector"===a||"Vector3D"===a||0===a.indexOf("Lcl_")?[i.propertyList[4],i.propertyList[5],i.propertyList[6]]:i.propertyList[4],e[o]={type:a,type2:h,flag:l,value:s}}else void 0===e[i.name]?"number"==typeof i.id?(e[i.name]={},e[i.name][i.id]=i):e[i.name]=i:"PoseNode"===i.name?(Array.isArray(e[i.name])||(e[i.name]=[e[i.name]]),e[i.name].push(i)):void 0===e[i.name][i.id]&&(e[i.name][i.id]=i)},parseProperty:function(t){var e=t.getString(1);switch(e){case"C":return t.getBoolean();case"D":return t.getFloat64();case"F":return t.getFloat32();case"I":return t.getInt32();case"L":return t.getInt64();case"R":var i=t.getUint32();return t.getArrayBuffer(i);case"S":i=t.getUint32();return t.getString(i);case"Y":return t.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":var r=t.getUint32(),s=t.getUint32(),o=t.getUint32();if(0===s)switch(e){case"b":case"c":return t.getBooleanArray(r);case"d":return t.getFloat64Array(r);case"f":return t.getFloat32Array(r);case"i":return t.getInt32Array(r);case"l":return t.getInt64Array(r)}void 0===n&&console.error("THREE.FBXLoader: External library fflate.min.js required.");var a=new u(Xt(new Uint8Array(t.getArrayBuffer(o))).buffer);switch(e){case"b":case"c":return a.getBooleanArray(r);case"d":return a.getFloat64Array(r);case"f":return a.getFloat32Array(r);case"i":return a.getInt32Array(r);case"l":return a.getInt64Array(r)}default:throw new Error("THREE.FBXLoader: Unknown property type "+e)}}},u.prototype={constructor:u,getOffset:function(){return this.offset},size:function(){return this.dv.buffer.byteLength},skip:function(t){this.offset+=t},getBoolean:function(){return 1==(1&this.getUint8())},getBooleanArray:function(t){for(var e=[],i=0;i=0&&(e=e.slice(0,n)),r.LoaderUtils.decodeText(new Uint8Array(e))}},d.prototype={constructor:d,add:function(t,e){this[t]=e}};var m=[];function g(t,e,i,n){var r;switch(n.mappingType){case"ByPolygonVertex":r=t;break;case"ByPolygon":r=e;break;case"ByVertice":r=i;break;case"AllSame":r=n.indices[0];break;default:console.warn("THREE.FBXLoader: unknown attribute mapping type "+n.mappingType)}"IndexToDirect"===n.referenceType&&(r=n.indices[r]);var s=r*n.dataSize,o=s+n.dataSize;return function(t,e,i,n){for(var r=i,s=0;r0)){v.reflect(u).negate(),v.add(d),f.extractRotation(n.matrixWorld),m.set(0,0,-1),m.applyMatrix4(f),m.add(p),y.subVectors(d,m),y.reflect(u).negate(),y.add(d),w.position.copy(v),w.up.set(0,1,0),w.up.applyMatrix4(f),w.up.reflect(u),w.lookAt(y),w.far=n.far,w.updateMatrixWorld(),w.projectionMatrix.copy(n.projectionMatrix),b.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),b.multiply(w.projectionMatrix),b.multiply(w.matrixWorldInverse),b.multiply(i.matrixWorld),c.setFromNormalAndCoplanarPoint(u,d),c.applyMatrix4(w.matrixWorldInverse),g.set(c.normal.x,c.normal.y,c.normal.z,c.constant);var r=w.projectionMatrix;x.x=(Math.sign(g.x)+r.elements[8])/r.elements[0],x.y=(Math.sign(g.y)+r.elements[9])/r.elements[5],x.z=-1,x.w=(1+r.elements[10])/r.elements[14],g.multiplyScalar(2/g.dot(x)),r.elements[2]=g.x,r.elements[6]=g.y,r.elements[10]=g.z+1-h,r.elements[14]=g.w,_.texture.encoding=t.outputEncoding,i.visible=!1;var s=t.getRenderTarget(),o=t.xr.enabled,a=t.shadowMap.autoUpdate;t.xr.enabled=!1,t.shadowMap.autoUpdate=!1,t.setRenderTarget(_),t.state.buffers.depth.setMask(!0),!1===t.autoClear&&t.clear(),t.render(e,w),t.xr.enabled=o,t.shadowMap.autoUpdate=a,t.setRenderTarget(s);var l=n.viewport;void 0!==l&&t.state.viewport(l),i.visible=!0}},this.getRenderTarget=function(){return _}};r.prototype=Object.create(n.Mesh.prototype),r.prototype.constructor=r,r.ReflectorShader={uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:["uniform mat4 textureMatrix;","varying vec4 vUv;","void main() {","\tvUv = textureMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec4 vUv;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );","}","void main() {","\tvec4 base = texture2DProj( tDiffuse, vUv );","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );","}"].join("\n")};var s=function(t,e){n.Mesh.call(this,t),this.type="Refractor";var i=this,r=void 0!==(e=e||{}).color?new n.Color(e.color):new n.Color(8355711),o=e.textureWidth||512,a=e.textureHeight||512,h=e.clipBias||0,l=e.shader||s.RefractorShader,c=new n.PerspectiveCamera;c.matrixAutoUpdate=!1,c.userData.refractor=!0;var u=new n.Plane,d=new n.Matrix4,p={minFilter:n.LinearFilter,magFilter:n.LinearFilter,format:n.RGBFormat},f=new n.WebGLRenderTarget(o,a,p);n.MathUtils.isPowerOfTwo(o)&&n.MathUtils.isPowerOfTwo(a)||(f.texture.generateMipmaps=!1),this.material=new n.ShaderMaterial({uniforms:n.UniformsUtils.clone(l.uniforms),vertexShader:l.vertexShader,fragmentShader:l.fragmentShader,transparent:!0}),this.material.uniforms.color.value=r,this.material.uniforms.tDiffuse.value=f.texture,this.material.uniforms.textureMatrix.value=d;var m,g,v,y,x,b,w,T,_=(m=new n.Vector3,g=new n.Vector3,v=new n.Matrix4,y=new n.Vector3,x=new n.Vector3,function(t){return m.setFromMatrixPosition(i.matrixWorld),g.setFromMatrixPosition(t.matrixWorld),y.subVectors(m,g),v.extractRotation(i.matrixWorld),x.set(0,0,1),x.applyMatrix4(v),y.dot(x)<0}),E=function(){var t=new n.Vector3,e=new n.Vector3,r=new n.Quaternion,s=new n.Vector3;return function(){i.matrixWorld.decompose(e,r,s),t.set(0,0,1).applyQuaternion(r).normalize(),t.negate(),u.setFromNormalAndCoplanarPoint(t,e)}}(),S=(b=new n.Plane,w=new n.Vector4,T=new n.Vector4,function(t){c.matrixWorld.copy(t.matrixWorld),c.matrixWorldInverse.copy(c.matrixWorld).invert(),c.projectionMatrix.copy(t.projectionMatrix),c.far=t.far,b.copy(u),b.applyMatrix4(c.matrixWorldInverse),w.set(b.normal.x,b.normal.y,b.normal.z,b.constant);var e=c.projectionMatrix;T.x=(Math.sign(w.x)+e.elements[8])/e.elements[0],T.y=(Math.sign(w.y)+e.elements[9])/e.elements[5],T.z=-1,T.w=(1+e.elements[10])/e.elements[14],w.multiplyScalar(2/w.dot(T)),e.elements[2]=w.x,e.elements[6]=w.y,e.elements[10]=w.z+1-h,e.elements[14]=w.w});this.onBeforeRender=function(t,e,n){f.texture.encoding=t.outputEncoding,!0!==n.userData.refractor&&!0!=!_(n)&&(E(),function(t){d.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),d.multiply(t.projectionMatrix),d.multiply(t.matrixWorldInverse),d.multiply(i.matrixWorld)}(n),S(n),function(t,e,n){i.visible=!1;var r=t.getRenderTarget(),s=t.xr.enabled,o=t.shadowMap.autoUpdate;t.xr.enabled=!1,t.shadowMap.autoUpdate=!1,t.setRenderTarget(f),!1===t.autoClear&&t.clear(),t.render(e,c),t.xr.enabled=s,t.shadowMap.autoUpdate=o,t.setRenderTarget(r);var a=n.viewport;void 0!==a&&t.state.viewport(a),i.visible=!0}(t,e,n))},this.getRenderTarget=function(){return f}};s.prototype=Object.create(n.Mesh.prototype),s.prototype.constructor=s,s.RefractorShader={uniforms:{color:{value:null},tDiffuse:{value:null},textureMatrix:{value:null}},vertexShader:["uniform mat4 textureMatrix;","varying vec4 vUv;","void main() {","\tvUv = textureMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec4 vUv;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );","}","void main() {","\tvec4 base = texture2DProj( tDiffuse, vUv );","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), 1.0 );","}"].join("\n")};var o=function(t,e){n.Mesh.call(this,t),this.type="Water";var i=this,a=void 0!==(e=e||{}).color?new n.Color(e.color):new n.Color(16777215),h=e.textureWidth||512,l=e.textureHeight||512,c=e.clipBias||0,u=e.flowDirection||new n.Vector2(1,0),d=e.flowSpeed||.03,p=e.reflectivity||.02,f=e.scale||1,m=e.shader||o.WaterShader,g=void 0!==e.encoding?e.encoding:n.LinearEncoding,v=new n.TextureLoader,y=e.flowMap||void 0,x=e.normalMap0||v.load("textures/water/Water_1_M_Normal.jpg"),b=e.normalMap1||v.load("textures/water/Water_2_M_Normal.jpg"),w=new n.Matrix4,T=new n.Clock;if(void 0!==r)if(void 0!==s){var _=new r(t,{textureWidth:h,textureHeight:l,clipBias:c,encoding:g}),E=new s(t,{textureWidth:h,textureHeight:l,clipBias:c,encoding:g});_.matrixAutoUpdate=!1,E.matrixAutoUpdate=!1,this.material=new n.ShaderMaterial({uniforms:n.UniformsUtils.merge([n.UniformsLib.fog,m.uniforms]),vertexShader:m.vertexShader,fragmentShader:m.fragmentShader,transparent:!0,fog:!0}),void 0!==y?(this.material.defines.USE_FLOWMAP="",this.material.uniforms.tFlowMap={type:"t",value:y}):this.material.uniforms.flowDirection={type:"v2",value:u},x.wrapS=x.wrapT=n.RepeatWrapping,b.wrapS=b.wrapT=n.RepeatWrapping,this.material.uniforms.tReflectionMap.value=_.getRenderTarget().texture,this.material.uniforms.tRefractionMap.value=E.getRenderTarget().texture,this.material.uniforms.tNormalMap0.value=x,this.material.uniforms.tNormalMap1.value=b,this.material.uniforms.color.value=a,this.material.uniforms.reflectivity.value=p,this.material.uniforms.textureMatrix.value=w,this.material.uniforms.config.value.x=0,this.material.uniforms.config.value.y=.075,this.material.uniforms.config.value.z=.075,this.material.uniforms.config.value.w=f,this.onBeforeRender=function(t,e,n){var r,s;!function(t){w.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),w.multiply(t.projectionMatrix),w.multiply(t.matrixWorldInverse),w.multiply(i.matrixWorld)}(n),r=T.getDelta(),(s=i.material.uniforms.config).value.x+=d*r,s.value.y=s.value.x+.075,s.value.x>=.15?(s.value.x=0,s.value.y=.075):s.value.y>=.15&&(s.value.y=s.value.y-.15),i.visible=!1,_.matrixWorld.copy(i.matrixWorld),E.matrixWorld.copy(i.matrixWorld),_.onBeforeRender(t,e,n),E.onBeforeRender(t,e,n),i.visible=!0}}else console.error("THREE.Water: Required component Refractor not found.");else console.error("THREE.Water: Required component Reflector not found.")};o.prototype=Object.create(n.Mesh.prototype),o.prototype.constructor=o,o.WaterShader={uniforms:{color:{type:"c",value:null},reflectivity:{type:"f",value:0},tReflectionMap:{type:"t",value:null},tRefractionMap:{type:"t",value:null},tNormalMap0:{type:"t",value:null},tNormalMap1:{type:"t",value:null},textureMatrix:{type:"m4",value:null},config:{type:"v4",value:new n.Vector4}},vertexShader:["#include ","#include ","#include ","uniform mat4 textureMatrix;","varying vec4 vCoord;","varying vec2 vUv;","varying vec3 vToEye;","void main() {","\tvUv = uv;","\tvCoord = textureMatrix * vec4( position, 1.0 );","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tvToEye = cameraPosition - worldPosition.xyz;","\tvec4 mvPosition = viewMatrix * worldPosition;","\tgl_Position = projectionMatrix * mvPosition;","\t#include ","\t#include ","}"].join("\n"),fragmentShader:["#include ","#include ","#include ","uniform sampler2D tReflectionMap;","uniform sampler2D tRefractionMap;","uniform sampler2D tNormalMap0;","uniform sampler2D tNormalMap1;","#ifdef USE_FLOWMAP","\tuniform sampler2D tFlowMap;","#else","\tuniform vec2 flowDirection;","#endif","uniform vec3 color;","uniform float reflectivity;","uniform vec4 config;","varying vec4 vCoord;","varying vec2 vUv;","varying vec3 vToEye;","void main() {","\t#include ","\tfloat flowMapOffset0 = config.x;","\tfloat flowMapOffset1 = config.y;","\tfloat halfCycle = config.z;","\tfloat scale = config.w;","\tvec3 toEye = normalize( vToEye );","\tvec2 flow;","\t#ifdef USE_FLOWMAP","\t\tflow = texture2D( tFlowMap, vUv ).rg * 2.0 - 1.0;","\t#else","\t\tflow = flowDirection;","\t#endif","\tflow.x *= - 1.0;","\tvec4 normalColor0 = texture2D( tNormalMap0, ( vUv * scale ) + flow * flowMapOffset0 );","\tvec4 normalColor1 = texture2D( tNormalMap1, ( vUv * scale ) + flow * flowMapOffset1 );","\tfloat flowLerp = abs( halfCycle - flowMapOffset0 ) / halfCycle;","\tvec4 normalColor = mix( normalColor0, normalColor1, flowLerp );","\tvec3 normal = normalize( vec3( normalColor.r * 2.0 - 1.0, normalColor.b, normalColor.g * 2.0 - 1.0 ) );","\tfloat theta = max( dot( toEye, normal ), 0.0 );","\tfloat reflectance = reflectivity + ( 1.0 - reflectivity ) * pow( ( 1.0 - theta ), 5.0 );","\tvec3 coord = vCoord.xyz / vCoord.w;","\tvec2 uv = coord.xy + coord.z * normal.xz * 0.05;","\tvec4 reflectColor = texture2D( tReflectionMap, vec2( 1.0 - uv.x, uv.y ) );","\tvec4 refractColor = texture2D( tRefractionMap, uv );","\tgl_FragColor = vec4( color, 1.0 ) * mix( refractColor, reflectColor, reflectance );","\t#include ","\t#include ","\t#include ","}"].join("\n")}},function(t,e,i){"use strict";i.r(e),i.d(e,"EffectComposer",(function(){return l})),i.d(e,"Pass",(function(){return p}));var n=i(0),r={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tgl_FragColor = opacity * texel;","}"].join("\n")},s=i(8),o=i(3),a=function(t,e){o.a.call(this),this.scene=t,this.camera=e,this.clear=!0,this.needsSwap=!1,this.inverse=!1};a.prototype=Object.assign(Object.create(o.a.prototype),{constructor:a,render:function(t,e,i){var n,r,s=t.getContext(),o=t.state;o.buffers.color.setMask(!1),o.buffers.depth.setMask(!1),o.buffers.color.setLocked(!0),o.buffers.depth.setLocked(!0),this.inverse?(n=0,r=1):(n=1,r=0),o.buffers.stencil.setTest(!0),o.buffers.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.buffers.stencil.setFunc(s.ALWAYS,n,4294967295),o.buffers.stencil.setClear(r),o.buffers.stencil.setLocked(!0),t.setRenderTarget(i),this.clear&&t.clear(),t.render(this.scene,this.camera),t.setRenderTarget(e),this.clear&&t.clear(),t.render(this.scene,this.camera),o.buffers.color.setLocked(!1),o.buffers.depth.setLocked(!1),o.buffers.stencil.setLocked(!1),o.buffers.stencil.setFunc(s.EQUAL,1,4294967295),o.buffers.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.buffers.stencil.setLocked(!0)}});var h=function(){o.a.call(this),this.needsSwap=!1};h.prototype=Object.create(o.a.prototype),Object.assign(h.prototype,{render:function(t){t.state.buffers.stencil.setLocked(!1),t.state.buffers.stencil.setTest(!1)}});var l=function(t,e){if(this.renderer=t,void 0===e){var i={minFilter:n.LinearFilter,magFilter:n.LinearFilter,format:n.RGBAFormat},o=t.getSize(new n.Vector2);this._pixelRatio=t.getPixelRatio(),this._width=o.width,this._height=o.height,(e=new n.WebGLRenderTarget(this._width*this._pixelRatio,this._height*this._pixelRatio,i)).texture.name="EffectComposer.rt1"}else this._pixelRatio=1,this._width=e.width,this._height=e.height;this.renderTarget1=e,this.renderTarget2=e.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],void 0===r&&console.error("THREE.EffectComposer relies on CopyShader"),void 0===s.ShaderPass&&console.error("THREE.EffectComposer relies on ShaderPass"),this.copyPass=new s.ShaderPass(r),this.clock=new n.Clock};Object.assign(l.prototype,{swapBuffers:function(){var t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t},addPass:function(t){this.passes.push(t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)},insertPass:function(t,e){this.passes.splice(e,0,t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)},removePass:function(t){const e=this.passes.indexOf(t);-1!==e&&this.passes.splice(e,1)},isLastEnabledPass:function(t){for(var e=t+1;e{const i=r[t];return i&&(s={profileId:t,profilePath:`${e}/${i.path}`,deprecated:!!i.deprecated}),!!s}),!s){if(!i)throw new Error("No matching profile name found");const t=r[i];if(!t)throw new Error(`No matching profile name found and default profile "${i}" missing.`);s={profileId:i,profilePath:`${e}/${t.path}`,deprecated:!!t.deprecated}}const a=await o(s.profilePath);let h;if(n){let e;if(e="any"===t.handedness?a.layouts[Object.keys(a.layouts)[0]]:a.layouts[t.handedness],!e)throw new Error(`No matching handedness, ${t.handedness}, in profile ${s.profileId}`);e.assetPath&&(h=s.profilePath.replace("profile.json",e.assetPath))}return{profile:a,assetPath:h}}const h={xAxis:0,yAxis:0,button:0,state:s.ComponentState.DEFAULT};class l{constructor(t){this.componentProperty=t.componentProperty,this.states=t.states,this.valueNodeName=t.valueNodeName,this.valueNodeProperty=t.valueNodeProperty,this.valueNodeProperty===s.VisualResponseProperty.TRANSFORM&&(this.minNodeName=t.minNodeName,this.maxNodeName=t.maxNodeName),this.value=0,this.updateFromComponent(h)}updateFromComponent({xAxis:t,yAxis:e,button:i,state:n}){const{normalizedXAxis:r,normalizedYAxis:o}=function(t=0,e=0){let i=t,n=e;if(Math.sqrt(t*t+e*e)>1){const r=Math.atan2(e,t);i=Math.cos(r),n=Math.sin(r)}return{normalizedXAxis:.5*i+.5,normalizedYAxis:.5*n+.5}}(t,e);switch(this.componentProperty){case s.ComponentProperty.X_AXIS:this.value=this.states.includes(n)?r:.5;break;case s.ComponentProperty.Y_AXIS:this.value=this.states.includes(n)?o:.5;break;case s.ComponentProperty.BUTTON:this.value=this.states.includes(n)?i:0;break;case s.ComponentProperty.STATE:this.valueNodeProperty===s.VisualResponseProperty.VISIBILITY?this.value=this.states.includes(n):this.value=this.states.includes(n)?1:0;break;default:throw new Error("Unexpected visualResponse componentProperty "+this.componentProperty)}}}class c{constructor(t,e){if(!(t&&e&&e.visualResponses&&e.gamepadIndices&&0!==Object.keys(e.gamepadIndices).length))throw new Error("Invalid arguments supplied");this.id=t,this.type=e.type,this.rootNodeName=e.rootNodeName,this.touchPointNodeName=e.touchPointNodeName,this.visualResponses={},Object.keys(e.visualResponses).forEach(t=>{const i=new l(e.visualResponses[t]);this.visualResponses[t]=i}),this.gamepadIndices=Object.assign({},e.gamepadIndices),this.values={state:s.ComponentState.DEFAULT,button:void 0!==this.gamepadIndices.button?0:void 0,xAxis:void 0!==this.gamepadIndices.xAxis?0:void 0,yAxis:void 0!==this.gamepadIndices.yAxis?0:void 0}}get data(){return{id:this.id,...this.values}}updateFromGamepad(t){if(this.values.state=s.ComponentState.DEFAULT,void 0!==this.gamepadIndices.button&&t.buttons.length>this.gamepadIndices.button){const e=t.buttons[this.gamepadIndices.button];this.values.button=e.value,this.values.button=this.values.button<0?0:this.values.button,this.values.button=this.values.button>1?1:this.values.button,e.pressed||1===this.values.button?this.values.state=s.ComponentState.PRESSED:(e.touched||this.values.button>s.ButtonTouchThreshold)&&(this.values.state=s.ComponentState.TOUCHED)}void 0!==this.gamepadIndices.xAxis&&t.axes.length>this.gamepadIndices.xAxis&&(this.values.xAxis=t.axes[this.gamepadIndices.xAxis],this.values.xAxis=this.values.xAxis<-1?-1:this.values.xAxis,this.values.xAxis=this.values.xAxis>1?1:this.values.xAxis,this.values.state===s.ComponentState.DEFAULT&&Math.abs(this.values.xAxis)>s.AxisTouchThreshold&&(this.values.state=s.ComponentState.TOUCHED)),void 0!==this.gamepadIndices.yAxis&&t.axes.length>this.gamepadIndices.yAxis&&(this.values.yAxis=t.axes[this.gamepadIndices.yAxis],this.values.yAxis=this.values.yAxis<-1?-1:this.values.yAxis,this.values.yAxis=this.values.yAxis>1?1:this.values.yAxis,this.values.state===s.ComponentState.DEFAULT&&Math.abs(this.values.yAxis)>s.AxisTouchThreshold&&(this.values.state=s.ComponentState.TOUCHED)),Object.values(this.visualResponses).forEach(t=>{t.updateFromComponent(this.values)})}}class u{constructor(t,e,i){if(!t)throw new Error("No xrInputSource supplied");if(!e)throw new Error("No profile supplied");this.xrInputSource=t,this.assetUrl=i,this.id=e.profileId,this.layoutDescription=e.layouts[t.handedness],this.components={},Object.keys(this.layoutDescription.components).forEach(t=>{const e=this.layoutDescription.components[t];this.components[t]=new c(t,e)}),this.updateFromGamepad()}get gripSpace(){return this.xrInputSource.gripSpace}get targetRaySpace(){return this.xrInputSource.targetRaySpace}get data(){const t=[];return Object.values(this.components).forEach(e=>{t.push(e.data)}),t}updateFromGamepad(){Object.values(this.components).forEach(t=>{t.updateFromGamepad(this.xrInputSource.gamepad)})}}function d(){n.Object3D.call(this),this.motionController=null,this.envMap=null}function p(t,e){!function(t,e){Object.values(t.components).forEach(t=>{const{type:i,touchPointNodeName:r,visualResponses:o}=t;if(i===s.ComponentType.TOUCHPAD)if(t.touchPointNode=e.getObjectByName(r),t.touchPointNode){const e=new n.SphereGeometry(.001),i=new n.MeshBasicMaterial({color:255}),r=new n.Mesh(e,i);t.touchPointNode.add(r)}else console.warn(`Could not find touch dot, ${t.touchPointNodeName}, in touchpad component ${t.id}`);Object.values(o).forEach(t=>{const{valueNodeName:i,minNodeName:n,maxNodeName:r,valueNodeProperty:o}=t;if(o===s.VisualResponseProperty.TRANSFORM){if(t.minNode=e.getObjectByName(n),t.maxNode=e.getObjectByName(r),!t.minNode)return void console.warn(`Could not find ${n} in the model`);if(!t.maxNode)return void console.warn(`Could not find ${r} in the model`)}t.valueNode=e.getObjectByName(i),t.valueNode||console.warn(`Could not find ${i} in the model`)})})}(t.motionController,e),t.envMap&&e.traverse(e=>{e.isMesh&&(e.material.envMap=t.envMap,e.material.needsUpdate=!0)}),t.add(e)}d.prototype=Object.assign(Object.create(n.Object3D.prototype),{constructor:d,setEnvironmentMap:function(t){return this.envMap==t||(this.envMap=t,this.traverse(t=>{t.isMesh&&(t.material.envMap=this.envMap,t.material.needsUpdate=!0)})),this},updateMatrixWorld:function(t){n.Object3D.prototype.updateMatrixWorld.call(this,t),this.motionController&&(this.motionController.updateFromGamepad(),Object.values(this.motionController.components).forEach(t=>{Object.values(t.visualResponses).forEach(t=>{const{valueNode:e,minNode:i,maxNode:r,value:o,valueNodeProperty:a}=t;e&&(a===s.VisualResponseProperty.VISIBILITY?e.visible=o:a===s.VisualResponseProperty.TRANSFORM&&(n.Quaternion.slerp(i.quaternion,r.quaternion,e.quaternion,o),e.position.lerpVectors(i.position,r.position,o)))})}))}});var f=function(){function t(t=null){this.gltfLoader=t,this.path="https://cdn.jsdelivr.net/npm/@webxr-input-profiles/assets@1.0/dist/profiles",this._assetCache={},this.gltfLoader||(this.gltfLoader=new r.GLTFLoader)}return t.prototype={constructor:t,createControllerModel:function(t){const e=new d;let i=null;return t.addEventListener("connected",t=>{const n=t.data;"tracked-pointer"===n.targetRayMode&&n.gamepad&&a(n,this.path,"generic-trigger").then(({profile:t,assetPath:r})=>{e.motionController=new u(n,t,r);const s=this._assetCache[e.motionController.assetUrl];if(s)i=s.scene.clone(),p(e,i);else{if(!this.gltfLoader)throw new Error("GLTFLoader not set.");this.gltfLoader.setPath(""),this.gltfLoader.load(e.motionController.assetUrl,t=>{this._assetCache[e.motionController.assetUrl]=t,i=t.scene.clone(),p(e,i)},null,()=>{throw new Error(`Asset ${e.motionController.assetUrl} missing or malformed.`)})}}).catch(t=>{console.warn(t)})}),t.addEventListener("disconnected",()=>{e.motionController=null,e.remove(i),i=null}),e}},t}()},function(t,e,i){"use strict";i.r(e),i.d(e,"AnimationAction",(function(){return n}));class n{constructor(t,e,i=null,n=e.blendMode){this._mixer=t,this._clip=e,this._localRoot=i,this.blendMode=n;const r=e.tracks,s=r.length,o=new Array(s),a={endingStart:2400,endingEnd:2400};for(let t=0;t!==s;++t){const e=r[t].createInterpolant(null);o[t]=e,e.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(s),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=2201,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(t){return this._startTime=t,this}setLoop(t,e){return this.loop=t,this.repetitions=e,this}setEffectiveWeight(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(t){return this._scheduleFading(t,0,1)}fadeOut(t){return this._scheduleFading(t,1,0)}crossFadeFrom(t,e,i){if(t.fadeOut(e),this.fadeIn(e),i){const i=this._clip.duration,n=t._clip.duration,r=n/i,s=i/n;t.warp(1,r,e),this.warp(s,1,e)}return this}crossFadeTo(t,e,i){return t.crossFadeFrom(this,e,i)}stopFading(){const t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}setEffectiveTimeScale(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(t){return this.timeScale=this._clip.duration/t,this.stopWarping()}syncWith(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()}halt(t){return this.warp(this._effectiveTimeScale,0,t)}warp(t,e,i){const n=this._mixer,r=n.time,s=this.timeScale;let o=this._timeScaleInterpolant;null===o&&(o=n._lendControlInterpolant(),this._timeScaleInterpolant=o);const a=o.parameterPositions,h=o.sampleValues;return a[0]=r,a[1]=r+i,h[0]=t/s,h[1]=e/s,this}stopWarping(){const t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(t,e,i,n){if(!this.enabled)return void this._updateWeight(t);const r=this._startTime;if(null!==r){const n=(t-r)*i;if(n<0||0===i)return;this._startTime=null,e=i*n}e*=this._updateTimeScale(t);const s=this._updateTime(e),o=this._updateWeight(t);if(o>0){const t=this._interpolants,e=this._propertyBindings;switch(this.blendMode){case 2501:for(let i=0,n=t.length;i!==n;++i)t[i].evaluate(s),e[i].accumulateAdditive(o);break;case 2500:default:for(let i=0,r=t.length;i!==r;++i)t[i].evaluate(s),e[i].accumulate(n,o)}}}_updateWeight(t){let e=0;if(this.enabled){e=this.weight;const i=this._weightInterpolant;if(null!==i){const n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e}_updateTimeScale(t){let e=0;if(!this.paused){e=this.timeScale;const 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(t){const e=this._clip.duration,i=this.loop;let n=this.time+t,r=this._loopCount;const s=2202===i;if(0===t)return-1===r?n:s&&1==(1&r)?e-n:n;if(2200===i){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(n>=e)n=e;else{if(!(n<0)){this.time=n;break t}n=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=n,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,s)):this._setEndings(0===this.repetitions,!0,s)),n>=e||n<0){const i=Math.floor(n/e);n-=e*i,r+=Math.abs(i);const o=this.repetitions-r;if(o<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,n=t>0?e:0,this.time=n,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===o){const e=t<0;this._setEndings(e,!e,s)}else this._setEndings(!1,!1,s);this._loopCount=r,this.time=n,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:i})}}else this.time=n;if(s&&1==(1&r))return e-n}return n}_setEndings(t,e,i){const n=this._interpolantSettings;i?(n.endingStart=2401,n.endingEnd=2401):(n.endingStart=t?this.zeroSlopeAtStart?2401:2400:2402,n.endingEnd=e?this.zeroSlopeAtEnd?2401:2400:2402)}_scheduleFading(t,e,i){const n=this._mixer,r=n.time;let s=this._weightInterpolant;null===s&&(s=n._lendControlInterpolant(),this._weightInterpolant=s);const o=s.parameterPositions,a=s.sampleValues;return o[0]=r,a[0]=e,o[1]=r+t,a[1]=i,this}}},function(t,e,i){"use strict";i.r(e),i.d(e,"ConvexGeometry",(function(){return s}));var n=i(0),r=function(){var t,e,i,r,s=new n.Vector3;function o(){this.tolerance=-1,this.faces=[],this.newFaces=[],this.assigned=new c,this.unassigned=new c,this.vertices=[]}function a(){this.normal=new n.Vector3,this.midpoint=new n.Vector3,this.area=0,this.constant=0,this.outside=null,this.mark=0,this.edge=null}function h(t,e){this.vertex=t,this.prev=null,this.next=null,this.twin=null,this.face=e}function l(t){this.point=t,this.prev=null,this.next=null,this.face=null}function c(){this.head=null,this.tail=null}return Object.assign(o.prototype,{setFromPoints:function(t){!0!==Array.isArray(t)&&console.error("THREE.ConvexHull: Points parameter is not an array."),t.length<4&&console.error("THREE.ConvexHull: The algorithm needs at least four points."),this.makeEmpty();for(var e=0,i=t.length;ethis.tolerance)return!1}return!0},intersectRay:function(t,e){for(var i=this.faces,n=-1/0,r=1/0,s=0,o=i.length;s0&&l>=0)return null;var c=0!==l?-h/l:0;if(!(c<=0)&&(l>0?r=Math.min(c,r):n=Math.max(c,n),n>r))return null}return n!==-1/0?t.at(n,e):t.at(r,e),e},intersectsRay:function(t){return null!==this.intersectRay(t,s)},makeEmpty:function(){return this.faces=[],this.vertices=[],this},addVertexToFace:function(t,e){return t.face=e,null===e.outside?this.assigned.append(t):this.assigned.insertBefore(e.outside,t),e.outside=t,this},removeVertexFromFace:function(t,e){return t===e.outside&&(null!==t.next&&t.next.face===e?e.outside=t.next:e.outside=null),this.assigned.remove(t),this},removeAllVerticesFromFace:function(t){if(null!==t.outside){for(var e=t.outside,i=t.outside;null!==i.next&&i.next.face===t;)i=i.next;return this.assigned.removeSubList(e,i),e.prev=i.next=null,t.outside=null,e}},deleteFaceVertices:function(t,e){var i=this.removeAllVerticesFromFace(t);if(void 0!==i)if(void 0===e)this.unassigned.appendChain(i);else{var n=i;do{var r=n.next;e.distanceToPoint(n.point)>this.tolerance?this.addVertexToFace(n,e):this.unassigned.append(n),n=r}while(null!==n)}return this},resolveUnassignedPoints:function(t){if(!1===this.unassigned.isEmpty()){var e=this.unassigned.first();do{for(var i=e.next,n=this.tolerance,r=null,s=0;sn&&(n=a,r=o),n>1e3*this.tolerance)break}}null!==r&&this.addVertexToFace(e,r),e=i}while(null!==e)}return this},computeExtremes:function(){var t,e,i,r=new n.Vector3,s=new n.Vector3,o=[],a=[];for(t=0;t<3;t++)o[t]=a[t]=this.vertices[0];for(r.copy(this.vertices[0].point),s.copy(this.vertices[0].point),t=0,e=this.vertices.length;ts.getComponent(i)&&(s.setComponent(i,l.getComponent(i)),a[i]=h)}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(r.x),Math.abs(s.x))+Math.max(Math.abs(r.y),Math.abs(s.y))+Math.max(Math.abs(r.z),Math.abs(s.z))),{min:o,max:a}},computeInitialHull:function(){void 0===t&&(t=new n.Line3,e=new n.Plane,i=new n.Vector3);var r,s,o,h,l,c,u,d,p,f=this.vertices,m=this.computeExtremes(),g=m.min,v=m.max,y=0,x=0;for(c=0;c<3;c++)(p=v[c].point.getComponent(c)-g[c].point.getComponent(c))>y&&(y=p,x=c);for(s=g[x],o=v[x],y=0,t.set(s.point,o.point),c=0,u=this.vertices.length;cy&&(y=p,h=r));for(y=-1,e.setFromCoplanarPoints(s.point,o.point,h.point),c=0,u=this.vertices.length;cy&&(y=p,l=r);var b=[];if(e.distanceToPoint(l.point)<0)for(b.push(a.create(s,o,h),a.create(l,o,s),a.create(l,h,o),a.create(l,s,h)),c=0;c<3;c++)d=(c+1)%3,b[c+1].getEdge(2).setTwin(b[0].getEdge(d)),b[c+1].getEdge(1).setTwin(b[d+1].getEdge(0));else for(b.push(a.create(s,h,o),a.create(l,s,o),a.create(l,o,h),a.create(l,h,s)),c=0;c<3;c++)d=(c+1)%3,b[c+1].getEdge(2).setTwin(b[0].getEdge((3-c)%3)),b[c+1].getEdge(0).setTwin(b[d+1].getEdge(1));for(c=0;c<4;c++)this.faces.push(b[c]);for(c=0,u=f.length;cy&&(y=p,w=this.faces[d]);null!==w&&this.addVertexToFace(r,w)}return this},reindexFaces:function(){for(var t=[],e=0;ee&&(e=r,t=n),n=n.next}while(null!==n&&n.face===i);return t}},computeHorizon:function(t,e,i,n){var r;this.deleteFaceVertices(i),i.mark=1,r=null===e?e=i.getEdge(0):e.next;do{var s=r.twin,o=s.face;0===o.mark&&(o.distanceToPoint(t)>this.tolerance?this.computeHorizon(t,s,o,n):n.push(r)),r=r.next}while(r!==e);return this},addAdjoiningFace:function(t,e){var i=a.create(t,e.tail(),e.head());return this.faces.push(i),i.getEdge(-1).setTwin(e.twin),i.getEdge(0)},addNewFaces:function(t,e){this.newFaces=[];for(var i=null,n=null,r=0;r0;)e=e.next,t--;for(;t<0;)e=e.prev,t++;return e},compute:function(){void 0===r&&(r=new n.Triangle);var t=this.edge.tail(),e=this.edge.head(),i=this.edge.next.head();return r.set(t.point,e.point,i.point),r.getNormal(this.normal),r.getMidpoint(this.midpoint),this.area=r.getArea(),this.constant=this.normal.dot(this.midpoint),this},distanceToPoint:function(t){return this.normal.dot(t)-this.constant}}),Object.assign(h.prototype,{head:function(){return this.vertex},tail:function(){return this.prev?this.prev.vertex:null},length:function(){var t=this.head(),e=this.tail();return null!==e?e.point.distanceTo(t.point):-1},lengthSquared:function(){var t=this.head(),e=this.tail();return null!==e?e.point.distanceToSquared(t.point):-1},setTwin:function(t){return this.twin=t,t.twin=this,this}}),Object.assign(c.prototype,{first:function(){return this.head},last:function(){return this.tail},clear:function(){return this.head=this.tail=null,this},insertBefore:function(t,e){return e.prev=t.prev,e.next=t,null===e.prev?this.head=e:e.prev.next=e,t.prev=e,this},insertAfter:function(t,e){return e.prev=t,e.next=t.next,null===e.next?this.tail=e:e.next.prev=e,t.next=e,this},append:function(t){return null===this.head?this.head=t:this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t,this},appendChain:function(t){for(null===this.head?this.head=t:this.tail.next=t,t.prev=this.tail;null!==t.next;)t=t.next;return this.tail=t,this},remove:function(t){return null===t.prev?this.head=t.next:t.prev.next=t.next,null===t.next?this.tail=t.prev:t.next.prev=t.prev,this},removeSubList:function(t,e){return null===t.prev?this.head=e.next:t.prev.next=e.next,null===e.next?this.tail=t.prev:e.next.prev=t.prev,this},isEmpty:function(){return null===this.head}}),o}(),s=function(t){n.BufferGeometry.call(this);var e=[],i=[];void 0===r&&console.error("THREE.ConvexBufferGeometry: ConvexBufferGeometry relies on ConvexHull");for(var s=(new r).setFromPoints(t).faces,o=0;odistortion_x-col_s*seed) {","\t\t\tif(seed_x>0.){","\t\t\t\tp.y = 1. - (p.y + distortion_y);","\t\t\t}","\t\t\telse {","\t\t\t\tp.y = distortion_y;","\t\t\t}","\t\t}","\t\tif(p.xdistortion_y-col_s*seed) {","\t\t\tif(seed_y>0.){","\t\t\t\tp.x=distortion_x;","\t\t\t}","\t\t\telse {","\t\t\t\tp.x = 1. - (p.x + distortion_x);","\t\t\t}","\t\t}","\t\tp.x+=normal.x*seed_x*(seed/5.);","\t\tp.y+=normal.y*seed_y*(seed/5.);","\t\tvec2 offset = amount * vec2( cos(angle), sin(angle));","\t\tvec4 cr = texture2D(tDiffuse, p + offset);","\t\tvec4 cga = texture2D(tDiffuse, p);","\t\tvec4 cb = texture2D(tDiffuse, p - offset);","\t\tgl_FragColor = vec4(cr.r, cga.g, cb.b, cga.a);","\t\tvec4 snow = 200.*amount*vec4(rand(vec2(xs * seed,ys * seed*50.))*0.2);","\t\tgl_FragColor = gl_FragColor+ snow;","\t}","\telse {","\t\tgl_FragColor=texture2D (tDiffuse, vUv);","\t}","}"].join("\n")},o=function(t){r.a.call(this),void 0===s&&console.error("THREE.GlitchPass relies on DigitalGlitch");var e=s;this.uniforms=n.UniformsUtils.clone(e.uniforms),null==t&&(t=64),this.uniforms.tDisp.value=this.generateHeightmap(t),this.material=new n.ShaderMaterial({uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader}),this.fsQuad=new r.a.FullScreenQuad(this.material),this.goWild=!1,this.curF=0,this.generateTrigger()};o.prototype=Object.assign(Object.create(r.a.prototype),{constructor:o,render:function(t,e,i){this.uniforms.tDiffuse.value=i.texture,this.uniforms.seed.value=Math.random(),this.uniforms.byp.value=0,this.curF%this.randX==0||1==this.goWild?(this.uniforms.amount.value=Math.random()/30,this.uniforms.angle.value=n.MathUtils.randFloat(-Math.PI,Math.PI),this.uniforms.seed_x.value=n.MathUtils.randFloat(-1,1),this.uniforms.seed_y.value=n.MathUtils.randFloat(-1,1),this.uniforms.distortion_x.value=n.MathUtils.randFloat(0,1),this.uniforms.distortion_y.value=n.MathUtils.randFloat(0,1),this.curF=0,this.generateTrigger()):this.curF%this.randX