1
0
forked from sent/waves
waves-fork/public/assets/g/drawclimber/main.js
2025-04-09 17:11:14 -05:00

2 lines
2.5 MiB

/*! For license information please see main.js.LICENSE.txt */
!function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=66)}([function(t,e,i){"use strict";i.r(e),i.d(e,"ACESFilmicToneMapping",(function(){return it})),i.d(e,"AddEquation",(function(){return E})),i.d(e,"AddOperation",(function(){return J})),i.d(e,"AdditiveAnimationBlendMode",(function(){return Ce})),i.d(e,"AdditiveBlending",(function(){return b})),i.d(e,"AlphaFormat",(function(){return Bt})),i.d(e,"AlwaysDepth",(function(){return H})),i.d(e,"AlwaysStencilFunc",(function(){return ii})),i.d(e,"AmbientLight",(function(){return zc})),i.d(e,"AmbientLightProbe",(function(){return id})),i.d(e,"AnimationClip",(function(){return uc})),i.d(e,"AnimationLoader",(function(){return yc})),i.d(e,"AnimationMixer",(function(){return Dd})),i.d(e,"AnimationObjectGroup",(function(){return Ld})),i.d(e,"AnimationUtils",(function(){return Ju})),i.d(e,"ArcCurve",(function(){return xl})),i.d(e,"ArrayCamera",(function(){return Za})),i.d(e,"ArrowHelper",(function(){return bp})),i.d(e,"Audio",(function(){return fd})),i.d(e,"AudioAnalyser",(function(){return wd})),i.d(e,"AudioContext",(function(){return $c})),i.d(e,"AudioListener",(function(){return pd})),i.d(e,"AudioLoader",(function(){return td})),i.d(e,"AxesHelper",(function(){return Ap})),i.d(e,"AxisHelper",(function(){return rf})),i.d(e,"BackSide",(function(){return m})),i.d(e,"BasicDepthPacking",(function(){return Be})),i.d(e,"BasicShadowMap",(function(){return u})),i.d(e,"BinaryTextureLoader",(function(){return lf})),i.d(e,"Bone",(function(){return Nh})),i.d(e,"BooleanKeyframeTrack",(function(){return nc})),i.d(e,"BoundingBoxHelper",(function(){return sf})),i.d(e,"Box2",(function(){return Gd})),i.d(e,"Box3",(function(){return ln})),i.d(e,"Box3Helper",(function(){return gp})),i.d(e,"BoxBufferGeometry",(function(){return ls})),i.d(e,"BoxGeometry",(function(){return ls})),i.d(e,"BoxHelper",(function(){return mp})),i.d(e,"BufferAttribute",(function(){return Er})),i.d(e,"BufferGeometry",(function(){return Gr})),i.d(e,"BufferGeometryLoader",(function(){return Xc})),i.d(e,"ByteType",(function(){return St})),i.d(e,"Cache",(function(){return dc})),i.d(e,"Camera",(function(){return fs})),i.d(e,"CameraHelper",(function(){return dp})),i.d(e,"CanvasRenderer",(function(){return cf})),i.d(e,"CanvasTexture",(function(){return gl})),i.d(e,"CapsuleBufferGeometry",(function(){return Ul})),i.d(e,"CapsuleGeometry",(function(){return Ul})),i.d(e,"CatmullRomCurve3",(function(){return El})),i.d(e,"CineonToneMapping",(function(){return et})),i.d(e,"CircleBufferGeometry",(function(){return Vl})),i.d(e,"CircleGeometry",(function(){return Vl})),i.d(e,"ClampToEdgeWrapping",(function(){return ct})),i.d(e,"Clock",(function(){return ad})),i.d(e,"Color",(function(){return Wi})),i.d(e,"ColorKeyframeTrack",(function(){return rc})),i.d(e,"ColorManagement",(function(){return ki})),i.d(e,"CompressedTexture",(function(){return ml})),i.d(e,"CompressedTextureLoader",(function(){return xc})),i.d(e,"ConeBufferGeometry",(function(){return Gl})),i.d(e,"ConeGeometry",(function(){return Gl})),i.d(e,"CubeCamera",(function(){return gs})),i.d(e,"CubeReflectionMapping",(function(){return st})),i.d(e,"CubeRefractionMapping",(function(){return ot})),i.d(e,"CubeTexture",(function(){return vs})),i.d(e,"CubeTextureLoader",(function(){return bc})),i.d(e,"CubeUVReflectionMapping",(function(){return lt})),i.d(e,"CubicBezierCurve",(function(){return Pl})),i.d(e,"CubicBezierCurve3",(function(){return Rl})),i.d(e,"CubicInterpolant",(function(){return $u})),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 vl})),i.d(e,"CurvePath",(function(){return kl})),i.d(e,"CustomBlending",(function(){return S})),i.d(e,"CustomToneMapping",(function(){return nt})),i.d(e,"CylinderBufferGeometry",(function(){return Hl})),i.d(e,"CylinderGeometry",(function(){return Hl})),i.d(e,"Cylindrical",(function(){return Vd})),i.d(e,"Data3DTexture",(function(){return en})),i.d(e,"DataArrayTexture",(function(){return $i})),i.d(e,"DataTexture",(function(){return zh})),i.d(e,"DataTexture2DArray",(function(){return bf})),i.d(e,"DataTexture3D",(function(){return Af})),i.d(e,"DataTextureLoader",(function(){return Ac})),i.d(e,"DataUtils",(function(){return Sp})),i.d(e,"DecrementStencilOp",(function(){return Ye})),i.d(e,"DecrementWrapStencilOp",(function(){return je})),i.d(e,"DefaultLoadingManager",(function(){return fc})),i.d(e,"DepthFormat",(function(){return zt})),i.d(e,"DepthStencilFormat",(function(){return Ut})),i.d(e,"DepthTexture",(function(){return ih})),i.d(e,"DirectionalLight",(function(){return Nc})),i.d(e,"DirectionalLightHelper",(function(){return lp})),i.d(e,"DiscreteInterpolant",(function(){return ec})),i.d(e,"DodecahedronBufferGeometry",(function(){return Yl})),i.d(e,"DodecahedronGeometry",(function(){return Yl})),i.d(e,"DoubleSide",(function(){return g})),i.d(e,"DstAlphaFactor",(function(){return F})),i.d(e,"DstColorFactor",(function(){return N})),i.d(e,"DynamicBufferAttribute",(function(){return jp})),i.d(e,"DynamicCopyUsage",(function(){return ui})),i.d(e,"DynamicDrawUsage",(function(){return ri})),i.d(e,"DynamicReadUsage",(function(){return ai})),i.d(e,"EdgesGeometry",(function(){return Kl})),i.d(e,"EdgesHelper",(function(){return of})),i.d(e,"EllipseCurve",(function(){return yl})),i.d(e,"EqualDepth",(function(){return Y})),i.d(e,"EqualStencilFunc",(function(){return Je})),i.d(e,"EquirectangularReflectionMapping",(function(){return at})),i.d(e,"EquirectangularRefractionMapping",(function(){return ht})),i.d(e,"Euler",(function(){return jn})),i.d(e,"EventDispatcher",(function(){return mi})),i.d(e,"ExtrudeBufferGeometry",(function(){return Mu})),i.d(e,"ExtrudeGeometry",(function(){return Mu})),i.d(e,"FaceColors",(function(){return Fp})),i.d(e,"FileLoader",(function(){return vc})),i.d(e,"FlatShading",(function(){return v})),i.d(e,"Float16BufferAttribute",(function(){return Dr})),i.d(e,"Float32Attribute",(function(){return ef})),i.d(e,"Float32BufferAttribute",(function(){return Br})),i.d(e,"Float64Attribute",(function(){return nf})),i.d(e,"Float64BufferAttribute",(function(){return Ir})),i.d(e,"FloatType",(function(){return Pt})),i.d(e,"Fog",(function(){return hh})),i.d(e,"FogExp2",(function(){return ah})),i.d(e,"Font",(function(){return yf})),i.d(e,"FontLoader",(function(){return vf})),i.d(e,"FramebufferTexture",(function(){return fl})),i.d(e,"FrontSide",(function(){return f})),i.d(e,"Frustum",(function(){return Es})),i.d(e,"GLBufferAttribute",(function(){return Fd})),i.d(e,"GLSL1",(function(){return di})),i.d(e,"GLSL3",(function(){return pi})),i.d(e,"GreaterDepth",(function(){return j})),i.d(e,"GreaterEqualDepth",(function(){return X})),i.d(e,"GreaterEqualStencilFunc",(function(){return ei})),i.d(e,"GreaterStencilFunc",(function(){return $e})),i.d(e,"GridHelper",(function(){return rp})),i.d(e,"Group",(function(){return $a})),i.d(e,"HalfFloatType",(function(){return Rt})),i.d(e,"HemisphereLight",(function(){return Ec})),i.d(e,"HemisphereLightHelper",(function(){return np})),i.d(e,"HemisphereLightProbe",(function(){return ed})),i.d(e,"IcosahedronBufferGeometry",(function(){return Cu})),i.d(e,"IcosahedronGeometry",(function(){return Cu})),i.d(e,"ImageBitmapLoader",(function(){return Jc})),i.d(e,"ImageLoader",(function(){return wc})),i.d(e,"ImageUtils",(function(){return Xi})),i.d(e,"ImmediateRenderObject",(function(){return xf})),i.d(e,"IncrementStencilOp",(function(){return We})),i.d(e,"IncrementWrapStencilOp",(function(){return Xe})),i.d(e,"InstancedBufferAttribute",(function(){return Gh})),i.d(e,"InstancedBufferGeometry",(function(){return Yc})),i.d(e,"InstancedInterleavedBuffer",(function(){return Id})),i.d(e,"InstancedMesh",(function(){return qh})),i.d(e,"Int16Attribute",(function(){return Jp})),i.d(e,"Int16BufferAttribute",(function(){return Pr})),i.d(e,"Int32Attribute",(function(){return $p})),i.d(e,"Int32BufferAttribute",(function(){return Lr})),i.d(e,"Int8Attribute",(function(){return qp})),i.d(e,"Int8BufferAttribute",(function(){return Mr})),i.d(e,"IntType",(function(){return _t})),i.d(e,"InterleavedBuffer",(function(){return uh})),i.d(e,"InterleavedBufferAttribute",(function(){return dh})),i.d(e,"Interpolant",(function(){return Zu})),i.d(e,"InterpolateDiscrete",(function(){return be})),i.d(e,"InterpolateLinear",(function(){return Ae})),i.d(e,"InterpolateSmooth",(function(){return Te})),i.d(e,"InvertStencilOp",(function(){return qe})),i.d(e,"JSONLoader",(function(){return df})),i.d(e,"KeepStencilOp",(function(){return He})),i.d(e,"KeyframeTrack",(function(){return ic})),i.d(e,"LOD",(function(){return Lh})),i.d(e,"LatheBufferGeometry",(function(){return zl})),i.d(e,"LatheGeometry",(function(){return zl})),i.d(e,"Layers",(function(){return qn})),i.d(e,"LensFlare",(function(){return ff})),i.d(e,"LessDepth",(function(){return G})),i.d(e,"LessEqualDepth",(function(){return W})),i.d(e,"LessEqualStencilFunc",(function(){return Ze})),i.d(e,"LessStencilFunc",(function(){return Ke})),i.d(e,"Light",(function(){return Sc})),i.d(e,"LightProbe",(function(){return Hc})),i.d(e,"Line",(function(){return el})),i.d(e,"Line3",(function(){return Xd})),i.d(e,"LineBasicMaterial",(function(){return Qh})),i.d(e,"LineCurve",(function(){return Ll})),i.d(e,"LineCurve3",(function(){return Ol})),i.d(e,"LineDashedMaterial",(function(){return Qu})),i.d(e,"LineLoop",(function(){return sl})),i.d(e,"LinePieces",(function(){return Bp})),i.d(e,"LineSegments",(function(){return rl})),i.d(e,"LineStrip",(function(){return Dp})),i.d(e,"LinearEncoding",(function(){return Oe})),i.d(e,"LinearFilter",(function(){return yt})),i.d(e,"LinearInterpolant",(function(){return tc})),i.d(e,"LinearMipMapLinearFilter",(function(){return At})),i.d(e,"LinearMipMapNearestFilter",(function(){return wt})),i.d(e,"LinearMipmapLinearFilter",(function(){return bt})),i.d(e,"LinearMipmapNearestFilter",(function(){return xt})),i.d(e,"LinearSRGBColorSpace",(function(){return Ue})),i.d(e,"LinearToneMapping",(function(){return $})),i.d(e,"Loader",(function(){return mc})),i.d(e,"LoaderUtils",(function(){return Wc})),i.d(e,"LoadingManager",(function(){return pc})),i.d(e,"LoopOnce",(function(){return ye})),i.d(e,"LoopPingPong",(function(){return we})),i.d(e,"LoopRepeat",(function(){return xe})),i.d(e,"LuminanceAlphaFormat",(function(){return Nt})),i.d(e,"LuminanceFormat",(function(){return kt})),i.d(e,"MOUSE",(function(){return r})),i.d(e,"Material",(function(){return br})),i.d(e,"MaterialLoader",(function(){return Gc})),i.d(e,"Math",(function(){return _i})),i.d(e,"MathUtils",(function(){return _i})),i.d(e,"Matrix3",(function(){return Pi})),i.d(e,"Matrix4",(function(){return kn})),i.d(e,"MaxEquation",(function(){return P})),i.d(e,"Mesh",(function(){return as})),i.d(e,"MeshBasicMaterial",(function(){return Ar})),i.d(e,"MeshDepthMaterial",(function(){return Xa})),i.d(e,"MeshDistanceMaterial",(function(){return ja})),i.d(e,"MeshFaceMaterial",(function(){return Np})),i.d(e,"MeshLambertMaterial",(function(){return ju})),i.d(e,"MeshMatcapMaterial",(function(){return qu})),i.d(e,"MeshNormalMaterial",(function(){return Xu})),i.d(e,"MeshPhongMaterial",(function(){return Wu})),i.d(e,"MeshPhysicalMaterial",(function(){return Gu})),i.d(e,"MeshStandardMaterial",(function(){return Hu})),i.d(e,"MeshToonMaterial",(function(){return Yu})),i.d(e,"MinEquation",(function(){return C})),i.d(e,"MirroredRepeatWrapping",(function(){return dt})),i.d(e,"MixOperation",(function(){return K})),i.d(e,"MultiMaterial",(function(){return zp})),i.d(e,"MultiplyBlending",(function(){return T})),i.d(e,"MultiplyOperation",(function(){return Q})),i.d(e,"NearestFilter",(function(){return pt})),i.d(e,"NearestMipMapLinearFilter",(function(){return vt})),i.d(e,"NearestMipMapNearestFilter",(function(){return mt})),i.d(e,"NearestMipmapLinearFilter",(function(){return gt})),i.d(e,"NearestMipmapNearestFilter",(function(){return ft})),i.d(e,"NeverDepth",(function(){return V})),i.d(e,"NeverStencilFunc",(function(){return Qe})),i.d(e,"NoBlending",(function(){return x})),i.d(e,"NoColorSpace",(function(){return Ne})),i.d(e,"NoColors",(function(){return Ip})),i.d(e,"NoToneMapping",(function(){return Z})),i.d(e,"NormalAnimationBlendMode",(function(){return _e})),i.d(e,"NormalBlending",(function(){return w})),i.d(e,"NotEqualDepth",(function(){return q})),i.d(e,"NotEqualStencilFunc",(function(){return ti})),i.d(e,"NumberKeyframeTrack",(function(){return sc})),i.d(e,"Object3D",(function(){return hr})),i.d(e,"ObjectLoader",(function(){return jc})),i.d(e,"ObjectSpaceNormalMap",(function(){return ke})),i.d(e,"OctahedronBufferGeometry",(function(){return Pu})),i.d(e,"OctahedronGeometry",(function(){return Pu})),i.d(e,"OneFactor",(function(){return L})),i.d(e,"OneMinusDstAlphaFactor",(function(){return k})),i.d(e,"OneMinusDstColorFactor",(function(){return z})),i.d(e,"OneMinusSrcAlphaFactor",(function(){return I})),i.d(e,"OneMinusSrcColorFactor",(function(){return D})),i.d(e,"OrthographicCamera",(function(){return Ns})),i.d(e,"PCFShadowMap",(function(){return c})),i.d(e,"PCFSoftShadowMap",(function(){return d})),i.d(e,"PMREMGenerator",(function(){return Xs})),i.d(e,"ParametricGeometry",(function(){return mf})),i.d(e,"Particle",(function(){return Vp})),i.d(e,"ParticleBasicMaterial",(function(){return Wp})),i.d(e,"ParticleSystem",(function(){return Hp})),i.d(e,"ParticleSystemMaterial",(function(){return Yp})),i.d(e,"Path",(function(){return Nl})),i.d(e,"PerspectiveCamera",(function(){return ms})),i.d(e,"Plane",(function(){return As})),i.d(e,"PlaneBufferGeometry",(function(){return Cs})),i.d(e,"PlaneGeometry",(function(){return Cs})),i.d(e,"PlaneHelper",(function(){return vp})),i.d(e,"PointCloud",(function(){return Up})),i.d(e,"PointCloudMaterial",(function(){return Gp})),i.d(e,"PointLight",(function(){return Fc})),i.d(e,"PointLightHelper",(function(){return $d})),i.d(e,"Points",(function(){return cl})),i.d(e,"PointsMaterial",(function(){return ol})),i.d(e,"PolarGridHelper",(function(){return sp})),i.d(e,"PolyhedronBufferGeometry",(function(){return Wl})),i.d(e,"PolyhedronGeometry",(function(){return Wl})),i.d(e,"PositionalAudio",(function(){return xd})),i.d(e,"PropertyBinding",(function(){return Rd})),i.d(e,"PropertyMixer",(function(){return bd})),i.d(e,"QuadraticBezierCurve",(function(){return Dl})),i.d(e,"QuadraticBezierCurve3",(function(){return Bl})),i.d(e,"Quaternion",(function(){return sn})),i.d(e,"QuaternionKeyframeTrack",(function(){return ac})),i.d(e,"QuaternionLinearInterpolant",(function(){return oc})),i.d(e,"REVISION",(function(){return n})),i.d(e,"RGBADepthPacking",(function(){return Ie})),i.d(e,"RGBAFormat",(function(){return Ft})),i.d(e,"RGBAIntegerFormat",(function(){return Yt})),i.d(e,"RGBA_ASTC_10x10_Format",(function(){return fe})),i.d(e,"RGBA_ASTC_10x5_Format",(function(){return ce})),i.d(e,"RGBA_ASTC_10x6_Format",(function(){return de})),i.d(e,"RGBA_ASTC_10x8_Format",(function(){return pe})),i.d(e,"RGBA_ASTC_12x10_Format",(function(){return me})),i.d(e,"RGBA_ASTC_12x12_Format",(function(){return ge})),i.d(e,"RGBA_ASTC_4x4_Format",(function(){return ne})),i.d(e,"RGBA_ASTC_5x4_Format",(function(){return re})),i.d(e,"RGBA_ASTC_5x5_Format",(function(){return se})),i.d(e,"RGBA_ASTC_6x5_Format",(function(){return oe})),i.d(e,"RGBA_ASTC_6x6_Format",(function(){return ae})),i.d(e,"RGBA_ASTC_8x5_Format",(function(){return he})),i.d(e,"RGBA_ASTC_8x6_Format",(function(){return le})),i.d(e,"RGBA_ASTC_8x8_Format",(function(){return ue})),i.d(e,"RGBA_BPTC_Format",(function(){return ve})),i.d(e,"RGBA_ETC2_EAC_Format",(function(){return ie})),i.d(e,"RGBA_PVRTC_2BPPV1_Format",(function(){return $t})),i.d(e,"RGBA_PVRTC_4BPPV1_Format",(function(){return Zt})),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 Qt})),i.d(e,"RGBFormat",(function(){return It})),i.d(e,"RGB_ETC1_Format",(function(){return te})),i.d(e,"RGB_ETC2_Format",(function(){return ee})),i.d(e,"RGB_PVRTC_2BPPV1_Format",(function(){return Jt})),i.d(e,"RGB_PVRTC_4BPPV1_Format",(function(){return Kt})),i.d(e,"RGB_S3TC_DXT1_Format",(function(){return Xt})),i.d(e,"RGFormat",(function(){return Gt})),i.d(e,"RGIntegerFormat",(function(){return Wt})),i.d(e,"RawShaderMaterial",(function(){return Vu})),i.d(e,"Ray",(function(){return Fn})),i.d(e,"Raycaster",(function(){return kd})),i.d(e,"RectAreaLight",(function(){return Uc})),i.d(e,"RedFormat",(function(){return Vt})),i.d(e,"RedIntegerFormat",(function(){return Ht})),i.d(e,"ReinhardToneMapping",(function(){return tt})),i.d(e,"RepeatWrapping",(function(){return ut})),i.d(e,"ReplaceStencilOp",(function(){return Ge})),i.d(e,"ReverseSubtractEquation",(function(){return _})),i.d(e,"RingBufferGeometry",(function(){return Ru})),i.d(e,"RingGeometry",(function(){return Ru})),i.d(e,"SRGBColorSpace",(function(){return ze})),i.d(e,"Scene",(function(){return lh})),i.d(e,"SceneUtils",(function(){return pf})),i.d(e,"ShaderChunk",(function(){return Ps})),i.d(e,"ShaderLib",(function(){return Ls})),i.d(e,"ShaderMaterial",(function(){return ps})),i.d(e,"ShadowMaterial",(function(){return Uu})),i.d(e,"Shape",(function(){return Jl})),i.d(e,"ShapeBufferGeometry",(function(){return Lu})),i.d(e,"ShapeGeometry",(function(){return Lu})),i.d(e,"ShapePath",(function(){return Tp})),i.d(e,"ShapeUtils",(function(){return Tu})),i.d(e,"ShortType",(function(){return Et})),i.d(e,"Skeleton",(function(){return Hh})),i.d(e,"SkeletonHelper",(function(){return Zd})),i.d(e,"SkinnedMesh",(function(){return kh})),i.d(e,"SmoothShading",(function(){return y})),i.d(e,"Source",(function(){return ji})),i.d(e,"Sphere",(function(){return Cn})),i.d(e,"SphereBufferGeometry",(function(){return Ou})),i.d(e,"SphereGeometry",(function(){return Ou})),i.d(e,"Spherical",(function(){return Ud})),i.d(e,"SphericalHarmonics3",(function(){return Vc})),i.d(e,"SplineCurve",(function(){return Il})),i.d(e,"SpotLight",(function(){return Lc})),i.d(e,"SpotLightHelper",(function(){return qd})),i.d(e,"Sprite",(function(){return _h})),i.d(e,"SpriteMaterial",(function(){return ph})),i.d(e,"SrcAlphaFactor",(function(){return B})),i.d(e,"SrcAlphaSaturateFactor",(function(){return U})),i.d(e,"SrcColorFactor",(function(){return O})),i.d(e,"StaticCopyUsage",(function(){return li})),i.d(e,"StaticDrawUsage",(function(){return ni})),i.d(e,"StaticReadUsage",(function(){return oi})),i.d(e,"StereoCamera",(function(){return od})),i.d(e,"StreamCopyUsage",(function(){return ci})),i.d(e,"StreamDrawUsage",(function(){return si})),i.d(e,"StreamReadUsage",(function(){return hi})),i.d(e,"StringKeyframeTrack",(function(){return hc})),i.d(e,"SubtractEquation",(function(){return M})),i.d(e,"SubtractiveBlending",(function(){return A})),i.d(e,"TOUCH",(function(){return s})),i.d(e,"TangentSpaceNormalMap",(function(){return Fe})),i.d(e,"TetrahedronBufferGeometry",(function(){return Du})),i.d(e,"TetrahedronGeometry",(function(){return Du})),i.d(e,"TextGeometry",(function(){return gf})),i.d(e,"Texture",(function(){return Ki})),i.d(e,"TextureLoader",(function(){return Tc})),i.d(e,"TorusBufferGeometry",(function(){return Bu})),i.d(e,"TorusGeometry",(function(){return Bu})),i.d(e,"TorusKnotBufferGeometry",(function(){return Iu})),i.d(e,"TorusKnotGeometry",(function(){return Iu})),i.d(e,"Triangle",(function(){return xr})),i.d(e,"TriangleFanDrawMode",(function(){return Le})),i.d(e,"TriangleStripDrawMode",(function(){return Re})),i.d(e,"TrianglesDrawMode",(function(){return Pe})),i.d(e,"TubeBufferGeometry",(function(){return Fu})),i.d(e,"TubeGeometry",(function(){return Fu})),i.d(e,"UVMapping",(function(){return rt})),i.d(e,"Uint16Attribute",(function(){return Zp})),i.d(e,"Uint16BufferAttribute",(function(){return Rr})),i.d(e,"Uint32Attribute",(function(){return tf})),i.d(e,"Uint32BufferAttribute",(function(){return Or})),i.d(e,"Uint8Attribute",(function(){return Qp})),i.d(e,"Uint8BufferAttribute",(function(){return _r})),i.d(e,"Uint8ClampedAttribute",(function(){return Kp})),i.d(e,"Uint8ClampedBufferAttribute",(function(){return Cr})),i.d(e,"Uniform",(function(){return Bd})),i.d(e,"UniformsLib",(function(){return Rs})),i.d(e,"UniformsUtils",(function(){return ds})),i.d(e,"UnsignedByteType",(function(){return Tt})),i.d(e,"UnsignedInt248Type",(function(){return Dt})),i.d(e,"UnsignedIntType",(function(){return Ct})),i.d(e,"UnsignedShort4444Type",(function(){return Lt})),i.d(e,"UnsignedShort5551Type",(function(){return Ot})),i.d(e,"UnsignedShortType",(function(){return Mt})),i.d(e,"VSMShadowMap",(function(){return p})),i.d(e,"Vector2",(function(){return Ci})),i.d(e,"Vector3",(function(){return on})),i.d(e,"Vector4",(function(){return Ji})),i.d(e,"VectorKeyframeTrack",(function(){return lc})),i.d(e,"Vertex",(function(){return Xp})),i.d(e,"VertexColors",(function(){return kp})),i.d(e,"VideoTexture",(function(){return pl})),i.d(e,"WebGL1Renderer",(function(){return oh})),i.d(e,"WebGL3DRenderTarget",(function(){return nn})),i.d(e,"WebGLArrayRenderTarget",(function(){return tn})),i.d(e,"WebGLCubeRenderTarget",(function(){return ys})),i.d(e,"WebGLMultipleRenderTargets",(function(){return rn})),i.d(e,"WebGLMultisampleRenderTarget",(function(){return wf})),i.d(e,"WebGLRenderTarget",(function(){return Zi})),i.d(e,"WebGLRenderTargetCube",(function(){return uf})),i.d(e,"WebGLRenderer",(function(){return sh})),i.d(e,"WebGLUtils",(function(){return Ja})),i.d(e,"WireframeGeometry",(function(){return ku})),i.d(e,"WireframeHelper",(function(){return af})),i.d(e,"WrapAroundEnding",(function(){return Me})),i.d(e,"XHRLoader",(function(){return hf})),i.d(e,"ZeroCurvatureEnding",(function(){return Se})),i.d(e,"ZeroFactor",(function(){return R})),i.d(e,"ZeroSlopeEnding",(function(){return Ee})),i.d(e,"ZeroStencilOp",(function(){return Ve})),i.d(e,"_SRGBAFormat",(function(){return fi})),i.d(e,"sRGBEncoding",(function(){return De}));const n="140",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,u=0,c=1,d=2,p=3,f=0,m=1,g=2,v=1,y=2,x=0,w=1,b=2,A=3,T=4,S=5,E=100,M=101,_=102,C=103,P=104,R=200,L=201,O=202,D=203,B=204,I=205,F=206,k=207,N=208,z=209,U=210,V=0,H=1,G=2,W=3,Y=4,X=5,j=6,q=7,Q=0,K=1,J=2,Z=0,$=1,tt=2,et=3,it=4,nt=5,rt=300,st=301,ot=302,at=303,ht=304,lt=306,ut=1e3,ct=1001,dt=1002,pt=1003,ft=1004,mt=1004,gt=1005,vt=1005,yt=1006,xt=1007,wt=1007,bt=1008,At=1008,Tt=1009,St=1010,Et=1011,Mt=1012,_t=1013,Ct=1014,Pt=1015,Rt=1016,Lt=1017,Ot=1018,Dt=1020,Bt=1021,It=1022,Ft=1023,kt=1024,Nt=1025,zt=1026,Ut=1027,Vt=1028,Ht=1029,Gt=1030,Wt=1031,Yt=1033,Xt=33776,jt=33777,qt=33778,Qt=33779,Kt=35840,Jt=35841,Zt=35842,$t=35843,te=36196,ee=37492,ie=37496,ne=37808,re=37809,se=37810,oe=37811,ae=37812,he=37813,le=37814,ue=37815,ce=37816,de=37817,pe=37818,fe=37819,me=37820,ge=37821,ve=36492,ye=2200,xe=2201,we=2202,be=2300,Ae=2301,Te=2302,Se=2400,Ee=2401,Me=2402,_e=2500,Ce=2501,Pe=0,Re=1,Le=2,Oe=3e3,De=3001,Be=3200,Ie=3201,Fe=0,ke=1,Ne="",ze="srgb",Ue="srgb-linear",Ve=0,He=7680,Ge=7681,We=7682,Ye=7683,Xe=34055,je=34056,qe=5386,Qe=512,Ke=513,Je=514,Ze=515,$e=516,ti=517,ei=518,ii=519,ni=35044,ri=35048,si=35040,oi=35045,ai=35049,hi=35041,li=35046,ui=35050,ci=35042,di="100",pi="300 es",fi=1035;class mi{addEventListener(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(t,e){if(void 0===this._listeners)return!1;const i=this._listeners;return void 0!==i[t]&&-1!==i[t].indexOf(e)}removeEventListener(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(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<n;e++)i[e].call(this,t);t.target=null}}}const gi=[];for(let t=0;t<256;t++)gi[t]=(t<16?"0":"")+t.toString(16);let vi=1234567;const yi=Math.PI/180,xi=180/Math.PI;function wi(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0;return(gi[255&t]+gi[t>>8&255]+gi[t>>16&255]+gi[t>>24&255]+"-"+gi[255&e]+gi[e>>8&255]+"-"+gi[e>>16&15|64]+gi[e>>24&255]+"-"+gi[63&i|128]+gi[i>>8&255]+"-"+gi[i>>16&255]+gi[i>>24&255]+gi[255&n]+gi[n>>8&255]+gi[n>>16&255]+gi[n>>24&255]).toLowerCase()}function bi(t,e,i){return Math.max(e,Math.min(i,t))}function Ai(t,e){return(t%e+e)%e}function Ti(t,e,i){return(1-i)*t+i*e}function Si(t){return 0==(t&t-1)&&0!==t}function Ei(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function Mi(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}var _i=Object.freeze({__proto__:null,DEG2RAD:yi,RAD2DEG:xi,generateUUID:wi,clamp:bi,euclideanModulo:Ai,mapLinear:function(t,e,i,n,r){return n+(t-e)*(r-n)/(i-e)},inverseLerp:function(t,e,i){return t!==e?(i-t)/(e-t):0},lerp:Ti,damp:function(t,e,i,n){return Ti(t,e,1-Math.exp(-i*n))},pingpong:function(t,e=1){return e-Math.abs(Ai(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){void 0!==t&&(vi=t);let e=vi+=1831565813;return e=Math.imul(e^e>>>15,1|e),e^=e+Math.imul(e^e>>>7,61|e),((e^e>>>14)>>>0)/4294967296},degToRad:function(t){return t*yi},radToDeg:function(t){return t*xi},isPowerOfTwo:Si,ceilPowerOfTwo:Ei,floorPowerOfTwo:Mi,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),u=o((e+n)/2),c=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*u,h*c,h*d,a*l);break;case"YZY":t.set(h*d,a*u,h*c,a*l);break;case"ZXZ":t.set(h*c,h*d,a*u,a*l);break;case"XZX":t.set(a*u,h*f,h*p,a*l);break;case"YXY":t.set(h*p,a*u,h*f,a*l);break;case"ZYZ":t.set(h*f,h*p,a*u,a*l)}},normalize:function(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return Math.round(65535*t);case Uint8Array:return Math.round(255*t);case Int16Array:return Math.round(32767*t);case Int8Array:return Math.round(127*t);default:throw new Error("Invalid component type.")}},denormalize:function(t,e){switch(e.constructor){case Float32Array:return t;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}});class Ci{constructor(t=0,e=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?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?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 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}*[Symbol.iterator](){yield this.x,yield this.y}}Ci.prototype.isVector2=!0;class Pi{constructor(){this.elements=[1,0,0,0,1,0,0,0,1]}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}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],u=i[7],c=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],w=n[2],b=n[5],A=n[8];return r[0]=s*f+o*v+a*w,r[3]=s*m+o*y+a*b,r[6]=s*g+o*x+a*A,r[1]=h*f+l*v+u*w,r[4]=h*m+l*y+u*b,r[7]=h*g+l*x+u*A,r[2]=c*f+d*v+p*w,r[5]=c*m+d*y+p*b,r[8]=c*g+d*x+p*A,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],u=l*s-o*h,c=o*a-l*r,d=h*r-s*a,p=e*u+i*c+n*d;if(0===p)return this.set(0,0,0,0,0,0,0,0,0);const f=1/p;return t[0]=u*f,t[1]=(n*h-l*i)*f,t[2]=(o*i-n*s)*f,t[3]=c*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).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}clone(){return(new this.constructor).fromArray(this.elements)}}function Ri(t){for(let e=t.length-1;e>=0;--e)if(t[e]>65535)return!0;return!1}Pi.prototype.isMatrix3=!0;const Li={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:Uint8ClampedArray,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function Oi(t,e){return new Li[t](e)}function Di(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function Bi(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Ii(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const Fi={[ze]:{[Ue]:Bi},[Ue]:{[ze]:Ii}},ki={legacyMode:!0,get workingColorSpace(){return Ue},set workingColorSpace(t){},convert:function(t,e,i){if(this.legacyMode||e===i||!e||!i)return t;if(Fi[e]&&void 0!==Fi[e][i]){const n=Fi[e][i];return t.r=n(t.r),t.g=n(t.g),t.b=n(t.b),t}throw new Error("Unsupported color space conversion.")},fromWorkingColorSpace:function(t,e){return this.convert(t,this.workingColorSpace,e)},toWorkingColorSpace:function(t,e){return this.convert(t,e,this.workingColorSpace)}},Ni={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},zi={r:0,g:0,b:0},Ui={h:0,s:0,l:0},Vi={h:0,s:0,l:0};function Hi(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 Gi(t,e){return e.r=t.r,e.g=t.g,e.b=t.b,e}class Wi{constructor(t,e,i){return 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,e=ze){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,ki.toWorkingColorSpace(this,e),this}setRGB(t,e,i,n=Ue){return this.r=t,this.g=e,this.b=i,ki.toWorkingColorSpace(this,n),this}setHSL(t,e,i,n=Ue){if(t=Ai(t,1),e=bi(e,0,1),i=bi(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=Hi(r,n,t+1/3),this.g=Hi(r,n,t),this.b=Hi(r,n,t-1/3)}return ki.toWorkingColorSpace(this,n),this}setStyle(t,e=ze){function i(t){void 0!==t&&parseFloat(t)}let n;if(n=/^((?:rgb|hsl)a?)\(([^\)]*)\)/.exec(t)){let t;const r=n[1],s=n[2];switch(r){case"rgb":case"rgba":if(t=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))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,ki.toWorkingColorSpace(this,e),i(t[4]),this;if(t=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(s))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,ki.toWorkingColorSpace(this,e),i(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(s)){const n=parseFloat(t[1])/360,r=parseInt(t[2],10)/100,s=parseInt(t[3],10)/100;return i(t[4]),this.setHSL(n,r,s,e)}}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(t)){const t=n[1],i=t.length;if(3===i)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,ki.toWorkingColorSpace(this,e),this;if(6===i)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,ki.toWorkingColorSpace(this,e),this}return t&&t.length>0?this.setColorName(t,e):this}setColorName(t,e=ze){const i=Ni[t.toLowerCase()];return void 0!==i&&this.setHex(i,e),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}copySRGBToLinear(t){return this.r=Bi(t.r),this.g=Bi(t.g),this.b=Bi(t.b),this}copyLinearToSRGB(t){return this.r=Ii(t.r),this.g=Ii(t.g),this.b=Ii(t.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(t=ze){return ki.fromWorkingColorSpace(Gi(this,zi),t),bi(255*zi.r,0,255)<<16^bi(255*zi.g,0,255)<<8^bi(255*zi.b,0,255)<<0}getHexString(t=ze){return("000000"+this.getHex(t).toString(16)).slice(-6)}getHSL(t,e=Ue){ki.fromWorkingColorSpace(Gi(this,zi),e);const i=zi.r,n=zi.g,r=zi.b,s=Math.max(i,n,r),o=Math.min(i,n,r);let a,h;const l=(o+s)/2;if(o===s)a=0,h=0;else{const t=s-o;switch(h=l<=.5?t/(s+o):t/(2-s-o),s){case i:a=(n-r)/t+(n<r?6:0);break;case n:a=(r-i)/t+2;break;case r:a=(i-n)/t+4}a/=6}return t.h=a,t.s=h,t.l=l,t}getRGB(t,e=Ue){return ki.fromWorkingColorSpace(Gi(this,zi),e),t.r=zi.r,t.g=zi.g,t.b=zi.b,t}getStyle(t=ze){return ki.fromWorkingColorSpace(Gi(this,zi),t),t!==ze?`color(${t} ${zi.r} ${zi.g} ${zi.b})`:`rgb(${255*zi.r|0},${255*zi.g|0},${255*zi.b|0})`}offsetHSL(t,e,i){return this.getHSL(Ui),Ui.h+=t,Ui.s+=e,Ui.l+=i,this.setHSL(Ui.h,Ui.s,Ui.l),this}add(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this}addColors(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this}addScalar(t){return this.r+=t,this.g+=t,this.b+=t,this}sub(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this}multiply(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this}multiplyScalar(t){return this.r*=t,this.g*=t,this.b*=t,this}lerp(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this}lerpColors(t,e,i){return this.r=t.r+(e.r-t.r)*i,this.g=t.g+(e.g-t.g)*i,this.b=t.b+(e.b-t.b)*i,this}lerpHSL(t,e){this.getHSL(Ui),t.getHSL(Vi);const i=Ti(Ui.h,Vi.h,e),n=Ti(Ui.s,Vi.s,e),r=Ti(Ui.l,Vi.l,e);return this.setHSL(i,n,r),this}equals(t){return t.r===this.r&&t.g===this.g&&t.b===this.b}fromArray(t,e=0){return this.r=t[e],this.g=t[e+1],this.b=t[e+2],this}toArray(t=[],e=0){return t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t}fromBufferAttribute(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),!0===t.normalized&&(this.r/=255,this.g/=255,this.b/=255),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}let Yi;Wi.NAMES=Ni,Wi.prototype.isColor=!0,Wi.prototype.r=1,Wi.prototype.g=1,Wi.prototype.b=1;class Xi{static getDataURL(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===Yi&&(Yi=Di("canvas")),Yi.width=t.width,Yi.height=t.height;const i=Yi.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=Yi}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}static sRGBToLinear(t){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const e=Di("canvas");e.width=t.width,e.height=t.height;const i=e.getContext("2d");i.drawImage(t,0,0,t.width,t.height);const n=i.getImageData(0,0,t.width,t.height),r=n.data;for(let t=0;t<r.length;t++)r[t]=255*Bi(r[t]/255);return i.putImageData(n,0,0),e}if(t.data){const e=t.data.slice(0);for(let t=0;t<e.length;t++)e instanceof Uint8Array||e instanceof Uint8ClampedArray?e[t]=Math.floor(255*Bi(e[t]/255)):e[t]=Bi(e[t]);return{data:e,width:t.width,height:t.height}}return t}}class ji{constructor(t=null){this.uuid=wi(),this.data=t,this.version=0}set needsUpdate(t){!0===t&&this.version++}toJSON(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.images[this.uuid])return t.images[this.uuid];const i={uuid:this.uuid,url:""},n=this.data;if(null!==n){let t;if(Array.isArray(n)){t=[];for(let e=0,i=n.length;e<i;e++)n[e].isDataTexture?t.push(qi(n[e].image)):t.push(qi(n[e]))}else t=qi(n);i.url=t}return e||(t.images[this.uuid]=i),i}}function qi(t){return"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap?Xi.getDataURL(t):t.data?{data:Array.prototype.slice.call(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:{}}ji.prototype.isSource=!0;let Qi=0;class Ki extends mi{constructor(t=Ki.DEFAULT_IMAGE,e=Ki.DEFAULT_MAPPING,i=ct,n=ct,r=yt,s=bt,o=Ft,a=Tt,h=1,l=Oe){super(),Object.defineProperty(this,"id",{value:Qi++}),this.uuid=wi(),this.name="",this.source=new ji(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 Ci(0,0),this.repeat=new Ci(1,1),this.center=new Ci(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Pi,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=l,this.userData={},this.version=0,this.onUpdate=null,this.isRenderTargetTexture=!1,this.needsPMREMUpdate=!1}get image(){return this.source.data}set image(t){this.source.data=t}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return(new this.constructor).copy(this)}copy(t){return this.name=t.name,this.source=t.source,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.userData=JSON.parse(JSON.stringify(t.userData)),this.needsUpdate=!0,this}toJSON(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,image:this.source.toJSON(t).uuid,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};return"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),e||(t.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(t){if(this.mapping!==rt)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case ut:t.x=t.x-Math.floor(t.x);break;case ct:t.x=t.x<0?0:1;break;case dt: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 ct:t.y=t.y<0?0:1;break;case dt: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}set needsUpdate(t){!0===t&&(this.version++,this.source.needsUpdate=!0)}}Ki.DEFAULT_IMAGE=null,Ki.DEFAULT_MAPPING=rt,Ki.prototype.isTexture=!0;class Ji{constructor(t=0,e=0,i=0,n=1){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?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?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],u=s[5],c=s[9],d=s[2],p=s[6],f=s[10];if(Math.abs(a-l)<.01&&Math.abs(h-d)<.01&&Math.abs(c-p)<.01){if(Math.abs(a+l)<.1&&Math.abs(h+d)<.1&&Math.abs(c+p)<.1&&Math.abs(o+u+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const t=(o+1)/2,s=(u+1)/2,m=(f+1)/2,g=(a+l)/4,v=(h+d)/4,y=(c+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-c)*(p-c)+(h-d)*(h-d)+(l-a)*(l-a));return Math.abs(m)<.001&&(m=1),this.x=(p-c)/m,this.y=(h-d)/m,this.z=(l-a)/m,this.w=Math.acos((o+u+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 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}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}Ji.prototype.isVector4=!0;class Zi extends mi{constructor(t,e,i={}){super(),this.width=t,this.height=e,this.depth=1,this.scissor=new Ji(0,0,t,e),this.scissorTest=!1,this.viewport=new Ji(0,0,t,e);const n={width:t,height:e,depth:1};this.texture=new Ki(n,i.mapping,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,this.texture.internalFormat=void 0!==i.internalFormat?i.internalFormat:null,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:yt,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,this.samples=void 0!==i.samples?i.samples:0}setSize(t,e,i=1){this.width===t&&this.height===e&&this.depth===i||(this.width=t,this.height=e,this.depth=i,this.texture.image.width=t,this.texture.image.height=e,this.texture.image.depth=i,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.depth=t.depth,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.texture.isRenderTargetTexture=!0,this.texture.image=Object.assign({},t.texture.image),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.samples=t.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}Zi.prototype.isWebGLRenderTarget=!0;class $i extends Ki{constructor(t=null,e=1,i=1,n=1){super(null),this.image={data:t,width:e,height:i,depth:n},this.magFilter=pt,this.minFilter=pt,this.wrapR=ct,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}$i.prototype.isDataArrayTexture=!0;class tn extends Zi{constructor(t,e,i){super(t,e),this.depth=i,this.texture=new $i(null,t,e,i),this.texture.isRenderTargetTexture=!0}}tn.prototype.isWebGLArrayRenderTarget=!0;class en extends Ki{constructor(t=null,e=1,i=1,n=1){super(null),this.image={data:t,width:e,height:i,depth:n},this.magFilter=pt,this.minFilter=pt,this.wrapR=ct,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}en.prototype.isData3DTexture=!0;class nn extends Zi{constructor(t,e,i){super(t,e),this.depth=i,this.texture=new en(null,t,e,i),this.texture.isRenderTargetTexture=!0}}nn.prototype.isWebGL3DRenderTarget=!0;class rn extends Zi{constructor(t,e,i,n={}){super(t,e,n);const r=this.texture;this.texture=[];for(let t=0;t<i;t++)this.texture[t]=r.clone(),this.texture[t].isRenderTargetTexture=!0}setSize(t,e,i=1){if(this.width!==t||this.height!==e||this.depth!==i){this.width=t,this.height=e,this.depth=i;for(let n=0,r=this.texture.length;n<r;n++)this.texture[n].image.width=t,this.texture[n].image.height=e,this.texture[n].image.depth=i;this.dispose()}return this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e),this}copy(t){this.dispose(),this.width=t.width,this.height=t.height,this.depth=t.depth,this.viewport.set(0,0,this.width,this.height),this.scissor.set(0,0,this.width,this.height),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,null!==t.depthTexture&&(this.depthTexture=t.depthTexture.clone()),this.texture.length=0;for(let e=0,i=t.texture.length;e<i;e++)this.texture[e]=t.texture[e].clone(),this.texture[e].isRenderTargetTexture=!0;return this}}rn.prototype.isWebGLMultipleRenderTargets=!0;class sn{constructor(t=0,e=0,i=0,n=1){this._x=t,this._y=e,this._z=i,this._w=n}static slerp(t,e,i,n){return i.slerpQuaternions(t,e,n)}static slerpFlat(t,e,i,n,r,s,o){let a=i[n+0],h=i[n+1],l=i[n+2],u=i[n+3];const c=r[s+0],d=r[s+1],p=r[s+2],f=r[s+3];if(0===o)return t[e+0]=a,t[e+1]=h,t[e+2]=l,void(t[e+3]=u);if(1===o)return t[e+0]=c,t[e+1]=d,t[e+2]=p,void(t[e+3]=f);if(u!==f||a!==c||h!==d||l!==p){let t=1-o;const e=a*c+h*d+l*p+u*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+c*r,h=h*t+d*r,l=l*t+p*r,u=u*t+f*r,t===1-o){const t=1/Math.sqrt(a*a+h*h+l*l+u*u);a*=t,h*=t,l*=t,u*=t}}t[e]=a,t[e+1]=h,t[e+2]=l,t[e+3]=u}static multiplyQuaternionsFlat(t,e,i,n,r,s){const o=i[n],a=i[n+1],h=i[n+2],l=i[n+3],u=r[s],c=r[s+1],d=r[s+2],p=r[s+3];return t[e]=o*p+l*u+a*d-h*c,t[e+1]=a*p+l*c+h*u-o*d,t[e+2]=h*p+l*d+o*c-a*u,t[e+3]=l*p-o*u-a*c-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),u=o(r/2),c=a(i/2),d=a(n/2),p=a(r/2);switch(s){case"XYZ":this._x=c*l*u+h*d*p,this._y=h*d*u-c*l*p,this._z=h*l*p+c*d*u,this._w=h*l*u-c*d*p;break;case"YXZ":this._x=c*l*u+h*d*p,this._y=h*d*u-c*l*p,this._z=h*l*p-c*d*u,this._w=h*l*u+c*d*p;break;case"ZXY":this._x=c*l*u-h*d*p,this._y=h*d*u+c*l*p,this._z=h*l*p+c*d*u,this._w=h*l*u-c*d*p;break;case"ZYX":this._x=c*l*u-h*d*p,this._y=h*d*u+c*l*p,this._z=h*l*p-c*d*u,this._w=h*l*u+c*d*p;break;case"YZX":this._x=c*l*u+h*d*p,this._y=h*d*u+c*l*p,this._z=h*l*p-c*d*u,this._w=h*l*u-c*d*p;break;case"XZY":this._x=c*l*u-h*d*p,this._y=h*d*u-c*l*p,this._z=h*l*p+c*d*u,this._w=h*l*u+c*d*p}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],u=e[10],c=i+o+u;if(c>0){const t=.5/Math.sqrt(c+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>u){const t=2*Math.sqrt(1+i-o-u);this._w=(l-a)/t,this._x=.25*t,this._y=(n+s)/t,this._z=(r+h)/t}else if(o>u){const t=2*Math.sqrt(1+o-i-u);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+u-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<Number.EPSILON?(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(bi(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?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),u=Math.sin((1-e)*l)/h,c=Math.sin(e*l)/h;return this._w=s*u+this._w*c,this._x=i*u+this._x*c,this._y=n*u+this._y*c,this._z=r*u+this._z*c,this._onChangeCallback(),this}slerpQuaternions(t,e,i){return this.copy(t).slerp(e,i)}random(){const t=Math.random(),e=Math.sqrt(1-t),i=Math.sqrt(t),n=2*Math.PI*Math.random(),r=2*Math.PI*Math.random();return this.set(e*Math.cos(n),i*Math.sin(r),i*Math.cos(r),e*Math.sin(n))}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(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}sn.prototype.isQuaternion=!0;class on{constructor(t=0,e=0,i=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?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?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?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,this.applyQuaternion(hn.setFromEuler(t))}applyAxisAngle(t,e){return this.applyQuaternion(hn.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,u=a*n+r*i-s*e,c=-r*e-s*i-o*n;return this.x=h*a+c*-r+l*-o-u*-s,this.y=l*a+c*-s+u*-r-h*-o,this.z=u*a+c*-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?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 an.copy(this).projectOnVector(t),this.sub(an)}reflect(t){return this.sub(an.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(bi(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)}setFromEuler(t){return this.x=t._x,this.y=t._y,this.z=t._z,this}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 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}randomDirection(){const t=2*(Math.random()-.5),e=Math.random()*Math.PI*2,i=Math.sqrt(1-t**2);return this.x=i*Math.cos(e),this.y=i*Math.sin(e),this.z=t,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}on.prototype.isVector3=!0;const an=new on,hn=new sn;class ln{constructor(t=new on(1/0,1/0,1/0),e=new on(-1/0,-1/0,-1/0)){this.min=t,this.max=e}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;a<h;a+=3){const h=t[a],l=t[a+1],u=t[a+2];h<e&&(e=h),l<i&&(i=l),u<n&&(n=u),h>r&&(r=h),l>s&&(s=l),u>o&&(o=u)}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;a<h;a++){const h=t.getX(a),l=t.getY(a),u=t.getZ(a);h<e&&(e=h),l<i&&(i=l),u<n&&(n=u),h>r&&(r=h),l>s&&(s=l),u>o&&(o=u)}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;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=cn.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}setFromObject(t,e=!1){return this.makeEmpty(),this.expandByObject(t,e)}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(t){return this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}expandByObject(t,e=!1){t.updateWorldMatrix(!1,!1);const i=t.geometry;if(void 0!==i)if(e&&null!=i.attributes&&void 0!==i.attributes.position){const e=i.attributes.position;for(let i=0,n=e.count;i<n;i++)cn.fromBufferAttribute(e,i).applyMatrix4(t.matrixWorld),this.expandByPoint(cn)}else null===i.boundingBox&&i.computeBoundingBox(),dn.copy(i.boundingBox),dn.applyMatrix4(t.matrixWorld),this.union(dn);const n=t.children;for(let t=0,i=n.length;t<i;t++)this.expandByObject(n[t],e);return this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)}containsBox(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 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.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)}intersectsSphere(t){return this.clampPoint(t.center,cn),cn.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(xn),wn.subVectors(this.max,xn),pn.subVectors(t.a,xn),fn.subVectors(t.b,xn),mn.subVectors(t.c,xn),gn.subVectors(fn,pn),vn.subVectors(mn,fn),yn.subVectors(pn,mn);let e=[0,-gn.z,gn.y,0,-vn.z,vn.y,0,-yn.z,yn.y,gn.z,0,-gn.x,vn.z,0,-vn.x,yn.z,0,-yn.x,-gn.y,gn.x,0,-vn.y,vn.x,0,-yn.y,yn.x,0];return!!Tn(e,pn,fn,mn,wn)&&(e=[1,0,0,0,1,0,0,0,1],!!Tn(e,pn,fn,mn,wn)&&(bn.crossVectors(gn,vn),e=[bn.x,bn.y,bn.z],Tn(e,pn,fn,mn,wn)))}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return cn.copy(t).clamp(this.min,this.max).sub(t).length()}getBoundingSphere(t){return this.getCenter(t.center),t.radius=.5*this.getSize(cn).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()||(un[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),un[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),un[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),un[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),un[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),un[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),un[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),un[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(un)),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)}}ln.prototype.isBox3=!0;const un=[new on,new on,new on,new on,new on,new on,new on,new on],cn=new on,dn=new ln,pn=new on,fn=new on,mn=new on,gn=new on,vn=new on,yn=new on,xn=new on,wn=new on,bn=new on,An=new on;function Tn(t,e,i,n,r){for(let s=0,o=t.length-3;s<=o;s+=3){An.fromArray(t,s);const o=r.x*Math.abs(An.x)+r.y*Math.abs(An.y)+r.z*Math.abs(An.z),a=e.dot(An),h=i.dot(An),l=n.dot(An);if(Math.max(-Math.max(a,h,l),Math.min(a,h,l))>o)return!1}return!0}const Sn=new ln,En=new on,Mn=new on,_n=new on;class Cn{constructor(t=new on,e=-1){this.center=t,this.radius=e}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):Sn.setFromPoints(t).getCenter(i);let n=0;for(let e=0,r=t.length;e<r;e++)n=Math.max(n,i.distanceToSquared(t[e]));return this.radius=Math.sqrt(n),this}copy(t){return this.center.copy(t.center),this.radius=t.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(t){return t.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(t){return t.distanceTo(this.center)-this.radius}intersectsSphere(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e}intersectsBox(t){return t.intersectsSphere(this)}intersectsPlane(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius}clampPoint(t,e){const i=this.center.distanceToSquared(t);return e.copy(t),i>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e}getBoundingBox(t){return 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}expandByPoint(t){_n.subVectors(t,this.center);const e=_n.lengthSq();if(e>this.radius*this.radius){const t=Math.sqrt(e),i=.5*(t-this.radius);this.center.add(_n.multiplyScalar(i/t)),this.radius+=i}return this}union(t){return!0===this.center.equals(t.center)?Mn.set(0,0,1).multiplyScalar(t.radius):Mn.subVectors(t.center,this.center).normalize().multiplyScalar(t.radius),this.expandByPoint(En.copy(t.center).add(Mn)),this.expandByPoint(En.copy(t.center).sub(Mn)),this}equals(t){return t.center.equals(this.center)&&t.radius===this.radius}clone(){return(new this.constructor).copy(this)}}const Pn=new on,Rn=new on,Ln=new on,On=new on,Dn=new on,Bn=new on,In=new on;class Fn{constructor(t=new on,e=new on(0,0,-1)){this.origin=t,this.direction=e}set(t,e){return this.origin.copy(t),this.direction.copy(e),this}copy(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this}at(t,e){return 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,Pn)),this}closestPointToPoint(t,e){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=Pn.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Pn.copy(this.direction).multiplyScalar(e).add(this.origin),Pn.distanceToSquared(t))}distanceSqToSegment(t,e,i,n){Rn.copy(t).add(e).multiplyScalar(.5),Ln.copy(e).sub(t).normalize(),On.copy(this.origin).sub(Rn);const r=.5*t.distanceTo(e),s=-this.direction.dot(Ln),o=On.dot(this.direction),a=-On.dot(Ln),h=On.lengthSq(),l=Math.abs(1-s*s);let u,c,d,p;if(l>0)if(u=s*a-o,c=s*o-a,p=r*l,u>=0)if(c>=-p)if(c<=p){const t=1/l;u*=t,c*=t,d=u*(u+s*c+2*o)+c*(s*u+c+2*a)+h}else c=r,u=Math.max(0,-(s*c+o)),d=-u*u+c*(c+2*a)+h;else c=-r,u=Math.max(0,-(s*c+o)),d=-u*u+c*(c+2*a)+h;else c<=-p?(u=Math.max(0,-(-s*r+o)),c=u>0?-r:Math.min(Math.max(-r,-a),r),d=-u*u+c*(c+2*a)+h):c<=p?(u=0,c=Math.min(Math.max(-r,-a),r),d=c*(c+2*a)+h):(u=Math.max(0,-(s*r+o)),c=u>0?r:Math.min(Math.max(-r,-a),r),d=-u*u+c*(c+2*a)+h);else c=s>0?-r:r,u=Math.max(0,-(s*c+o)),d=-u*u+c*(c+2*a)+h;return i&&i.copy(this.direction).multiplyScalar(u).add(this.origin),n&&n.copy(Ln).multiplyScalar(c).add(Rn),d}intersectSphere(t,e){Pn.subVectors(t.center,this.origin);const i=Pn.dot(this.direction),n=Pn.dot(Pn)-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,u=1/this.direction.z,c=this.origin;return h>=0?(i=(t.min.x-c.x)*h,n=(t.max.x-c.x)*h):(i=(t.max.x-c.x)*h,n=(t.min.x-c.x)*h),l>=0?(r=(t.min.y-c.y)*l,s=(t.max.y-c.y)*l):(r=(t.max.y-c.y)*l,s=(t.min.y-c.y)*l),i>s||r>n?null:((r>i||i!=i)&&(i=r),(s<n||n!=n)&&(n=s),u>=0?(o=(t.min.z-c.z)*u,a=(t.max.z-c.z)*u):(o=(t.max.z-c.z)*u,a=(t.min.z-c.z)*u),i>a||o>n?null:((o>i||i!=i)&&(i=o),(a<n||n!=n)&&(n=a),n<0?null:this.at(i>=0?i:n,e)))}intersectsBox(t){return null!==this.intersectBox(t,Pn)}intersectTriangle(t,e,i,n,r){Dn.subVectors(e,t),Bn.subVectors(i,t),In.crossVectors(Dn,Bn);let s,o=this.direction.dot(In);if(o>0){if(n)return null;s=1}else{if(!(o<0))return null;s=-1,o=-o}On.subVectors(this.origin,t);const a=s*this.direction.dot(Bn.crossVectors(On,Bn));if(a<0)return null;const h=s*this.direction.dot(Dn.cross(On));if(h<0)return null;if(a+h>o)return null;const l=-s*On.dot(In);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)}clone(){return(new this.constructor).copy(this)}}class kn{constructor(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}set(t,e,i,n,r,s,o,a,h,l,u,c,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]=u,g[14]=c,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 kn).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/Nn.setFromMatrixColumn(t,0).length(),r=1/Nn.setFromMatrixColumn(t,1).length(),s=1/Nn.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;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),u=Math.sin(r);if("XYZ"===t.order){const t=s*l,i=s*u,n=o*l,r=o*u;e[0]=a*l,e[4]=-a*u,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*u,n=h*l,r=h*u;e[0]=t+r*o,e[4]=n*o-i,e[8]=s*h,e[1]=s*u,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*u,n=h*l,r=h*u;e[0]=t-r*o,e[4]=-s*u,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*u,n=o*l,r=o*u;e[0]=a*l,e[4]=n*h-i,e[8]=t*h+r,e[1]=a*u,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*u,e[8]=n*u+i,e[1]=u,e[5]=s*l,e[9]=-o*l,e[2]=-h*l,e[6]=i*u+n,e[10]=t-r*u}else if("XZY"===t.order){const t=s*a,i=s*h,n=o*a,r=o*h;e[0]=a*l,e[4]=-u,e[8]=h*l,e[1]=t*u+r,e[5]=s*l,e[9]=i*u-n,e[2]=n*u-i,e[6]=o*l,e[10]=r*u+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(Un,t,Vn)}lookAt(t,e,i){const n=this.elements;return Wn.subVectors(t,e),0===Wn.lengthSq()&&(Wn.z=1),Wn.normalize(),Hn.crossVectors(i,Wn),0===Hn.lengthSq()&&(1===Math.abs(i.z)?Wn.x+=1e-4:Wn.z+=1e-4,Wn.normalize(),Hn.crossVectors(i,Wn)),Hn.normalize(),Gn.crossVectors(Wn,Hn),n[0]=Hn.x,n[4]=Gn.x,n[8]=Wn.x,n[1]=Hn.y,n[5]=Gn.y,n[9]=Wn.y,n[2]=Hn.z,n[6]=Gn.z,n[10]=Wn.z,this}multiply(t,e){return void 0!==e?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],u=i[5],c=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],v=i[3],y=i[7],x=i[11],w=i[15],b=n[0],A=n[4],T=n[8],S=n[12],E=n[1],M=n[5],_=n[9],C=n[13],P=n[2],R=n[6],L=n[10],O=n[14],D=n[3],B=n[7],I=n[11],F=n[15];return r[0]=s*b+o*E+a*P+h*D,r[4]=s*A+o*M+a*R+h*B,r[8]=s*T+o*_+a*L+h*I,r[12]=s*S+o*C+a*O+h*F,r[1]=l*b+u*E+c*P+d*D,r[5]=l*A+u*M+c*R+d*B,r[9]=l*T+u*_+c*L+d*I,r[13]=l*S+u*C+c*O+d*F,r[2]=p*b+f*E+m*P+g*D,r[6]=p*A+f*M+m*R+g*B,r[10]=p*T+f*_+m*L+g*I,r[14]=p*S+f*C+m*O+g*F,r[3]=v*b+y*E+x*P+w*D,r[7]=v*A+y*M+x*R+w*B,r[11]=v*T+y*_+x*L+w*I,r[15]=v*S+y*C+x*O+w*F,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],u=t[6],c=t[10],d=t[14];return t[3]*(+r*a*u-n*h*u-r*o*c+i*h*c+n*o*d-i*a*d)+t[7]*(+e*a*d-e*h*c+r*s*c-n*s*d+n*h*l-r*a*l)+t[11]*(+e*h*u-e*o*d-r*s*u+i*s*d+r*o*l-i*h*l)+t[15]*(-n*o*l-e*a*u+e*o*c+n*s*u-i*s*c+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],u=t[9],c=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15],v=u*m*h-f*c*h+f*a*d-o*m*d-u*a*g+o*c*g,y=p*c*h-l*m*h-p*a*d+s*m*d+l*a*g-s*c*g,x=l*f*h-p*u*h+p*o*d-s*f*d-l*o*g+s*u*g,w=p*u*a-l*f*a-p*o*c+s*f*c+l*o*m-s*u*m,b=e*v+i*y+n*x+r*w;if(0===b)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const A=1/b;return t[0]=v*A,t[1]=(f*c*r-u*m*r-f*n*d+i*m*d+u*n*g-i*c*g)*A,t[2]=(o*m*r-f*a*r+f*n*h-i*m*h-o*n*g+i*a*g)*A,t[3]=(u*a*r-o*c*r-u*n*h+i*c*h+o*n*d-i*a*d)*A,t[4]=y*A,t[5]=(l*m*r-p*c*r+p*n*d-e*m*d-l*n*g+e*c*g)*A,t[6]=(p*a*r-s*m*r-p*n*h+e*m*h+s*n*g-e*a*g)*A,t[7]=(s*c*r-l*a*r+l*n*h-e*c*h-s*n*d+e*a*d)*A,t[8]=x*A,t[9]=(p*u*r-l*f*r-p*i*d+e*f*d+l*i*g-e*u*g)*A,t[10]=(s*f*r-p*o*r+p*i*h-e*f*h-s*i*g+e*o*g)*A,t[11]=(l*o*r-s*u*r-l*i*h+e*u*h+s*i*d-e*o*d)*A,t[12]=w*A,t[13]=(l*f*n-p*u*n+p*i*c-e*f*c-l*i*m+e*u*m)*A,t[14]=(p*o*n-s*f*n-p*i*a+e*f*a+s*i*m-e*o*m)*A,t[15]=(s*u*n-l*o*n+l*i*a-e*u*a-s*i*c+e*o*c)*A,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,n,r,s){return this.set(1,i,r,0,t,1,s,0,e,n,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,u=o+o,c=r*h,d=r*l,p=r*u,f=s*l,m=s*u,g=o*u,v=a*h,y=a*l,x=a*u,w=i.x,b=i.y,A=i.z;return n[0]=(1-(f+g))*w,n[1]=(d+x)*w,n[2]=(p-y)*w,n[3]=0,n[4]=(d-x)*b,n[5]=(1-(c+g))*b,n[6]=(m+v)*b,n[7]=0,n[8]=(p+y)*A,n[9]=(m-v)*A,n[10]=(1-(c+f))*A,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=Nn.set(n[0],n[1],n[2]).length();const s=Nn.set(n[4],n[5],n[6]).length(),o=Nn.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],zn.copy(this);const a=1/r,h=1/s,l=1/o;return zn.elements[0]*=a,zn.elements[1]*=a,zn.elements[2]*=a,zn.elements[4]*=h,zn.elements[5]*=h,zn.elements[6]*=h,zn.elements[8]*=l,zn.elements[9]*=l,zn.elements[10]*=l,e.setFromRotationMatrix(zn),i.x=r,i.y=s,i.z=o,this}makePerspective(t,e,i,n,r,s){const o=this.elements,a=2*r/(e-t),h=2*r/(i-n),l=(e+t)/(e-t),u=(i+n)/(i-n),c=-(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]=u,o[13]=0,o[2]=0,o[6]=0,o[10]=c,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),u=(e+t)*a,c=(i+n)*h,d=(s+r)*l;return o[0]=2*a,o[4]=0,o[8]=0,o[12]=-u,o[1]=0,o[5]=2*h,o[9]=0,o[13]=-c,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}}kn.prototype.isMatrix4=!0;const Nn=new on,zn=new kn,Un=new on(0,0,0),Vn=new on(1,1,1),Hn=new on,Gn=new on,Wn=new on,Yn=new kn,Xn=new sn;class jn{constructor(t=0,e=0,i=0,n=jn.DefaultOrder){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=this._order){return this._x=t,this._y=e,this._z=i,this._order=n,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=this._order,i=!0){const n=t.elements,r=n[0],s=n[4],o=n[8],a=n[1],h=n[5],l=n[9],u=n[2],c=n[6],d=n[10];switch(e){case"XYZ":this._y=Math.asin(bi(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-l,d),this._z=Math.atan2(-s,r)):(this._x=Math.atan2(c,h),this._z=0);break;case"YXZ":this._x=Math.asin(-bi(l,-1,1)),Math.abs(l)<.9999999?(this._y=Math.atan2(o,d),this._z=Math.atan2(a,h)):(this._y=Math.atan2(-u,r),this._z=0);break;case"ZXY":this._x=Math.asin(bi(c,-1,1)),Math.abs(c)<.9999999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-s,h)):(this._y=0,this._z=Math.atan2(a,r));break;case"ZYX":this._y=Math.asin(-bi(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(c,d),this._z=Math.atan2(a,r)):(this._x=0,this._z=Math.atan2(-s,h));break;case"YZX":this._z=Math.asin(bi(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-l,h),this._y=Math.atan2(-u,r)):(this._x=0,this._y=Math.atan2(o,d));break;case"XZY":this._z=Math.asin(-bi(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(c,h),this._y=Math.atan2(o,r)):(this._x=Math.atan2(-l,d),this._y=0)}return this._order=e,!0===i&&this._onChangeCallback(),this}setFromQuaternion(t,e,i){return Yn.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Yn,e,i)}setFromVector3(t,e=this._order){return this.set(t.x,t.y,t.z,e)}reorder(t){return Xn.setFromEuler(this),this.setFromQuaternion(Xn,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}_onChange(t){return this._onChangeCallback=t,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}jn.prototype.isEuler=!0,jn.DefaultOrder="XYZ",jn.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"];class qn{constructor(){this.mask=1}set(t){this.mask=(1<<t|0)>>>0}enable(t){this.mask|=1<<t|0}enableAll(){this.mask=-1}toggle(t){this.mask^=1<<t|0}disable(t){this.mask&=~(1<<t|0)}disableAll(){this.mask=0}test(t){return 0!=(this.mask&t.mask)}isEnabled(t){return 0!=(this.mask&(1<<t|0))}}let Qn=0;const Kn=new on,Jn=new sn,Zn=new kn,$n=new on,tr=new on,er=new on,ir=new sn,nr=new on(1,0,0),rr=new on(0,1,0),sr=new on(0,0,1),or={type:"added"},ar={type:"removed"};class hr extends mi{constructor(){super(),Object.defineProperty(this,"id",{value:Qn++}),this.uuid=wi(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=hr.DefaultUp.clone();const t=new on,e=new jn,i=new sn,n=new on(1,1,1);e._onChange((function(){i.setFromEuler(e,!1)})),i._onChange((function(){e.setFromQuaternion(i,void 0,!1)})),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:n},modelViewMatrix:{value:new kn},normalMatrix:{value:new Pi}}),this.matrix=new kn,this.matrixWorld=new kn,this.matrixAutoUpdate=hr.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new qn,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.userData={}}onBeforeRender(){}onAfterRender(){}applyMatrix4(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(t){return this.quaternion.premultiply(t),this}setRotationFromAxisAngle(t,e){this.quaternion.setFromAxisAngle(t,e)}setRotationFromEuler(t){this.quaternion.setFromEuler(t,!0)}setRotationFromMatrix(t){this.quaternion.setFromRotationMatrix(t)}setRotationFromQuaternion(t){this.quaternion.copy(t)}rotateOnAxis(t,e){return Jn.setFromAxisAngle(t,e),this.quaternion.multiply(Jn),this}rotateOnWorldAxis(t,e){return Jn.setFromAxisAngle(t,e),this.quaternion.premultiply(Jn),this}rotateX(t){return this.rotateOnAxis(nr,t)}rotateY(t){return this.rotateOnAxis(rr,t)}rotateZ(t){return this.rotateOnAxis(sr,t)}translateOnAxis(t,e){return Kn.copy(t).applyQuaternion(this.quaternion),this.position.add(Kn.multiplyScalar(e)),this}translateX(t){return this.translateOnAxis(nr,t)}translateY(t){return this.translateOnAxis(rr,t)}translateZ(t){return this.translateOnAxis(sr,t)}localToWorld(t){return t.applyMatrix4(this.matrixWorld)}worldToLocal(t){return t.applyMatrix4(Zn.copy(this.matrixWorld).invert())}lookAt(t,e,i){t.isVector3?$n.copy(t):$n.set(t,e,i);const n=this.parent;this.updateWorldMatrix(!0,!1),tr.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Zn.lookAt(tr,$n,this.up):Zn.lookAt($n,tr,this.up),this.quaternion.setFromRotationMatrix(Zn),n&&(Zn.extractRotation(n.matrixWorld),Jn.setFromRotationMatrix(Zn),this.quaternion.premultiply(Jn.invert()))}add(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this||t&&t.isObject3D&&(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(or)),this}remove(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(ar)),this}removeFromParent(){const t=this.parent;return null!==t&&t.remove(this),this}clear(){for(let t=0;t<this.children.length;t++){const e=this.children[t];e.parent=null,e.dispatchEvent(ar)}return this.children.length=0,this}attach(t){return this.updateWorldMatrix(!0,!1),Zn.copy(this.matrixWorld).invert(),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),Zn.multiply(t.parent.matrixWorld)),t.applyMatrix4(Zn),this.add(t),t.updateWorldMatrix(!1,!0),this}getObjectById(t){return this.getObjectByProperty("id",t)}getObjectByName(t){return this.getObjectByProperty("name",t)}getObjectByProperty(t,e){if(this[t]===e)return this;for(let i=0,n=this.children.length;i<n;i++){const n=this.children[i].getObjectByProperty(t,e);if(void 0!==n)return n}}getWorldPosition(t){return this.updateWorldMatrix(!0,!1),t.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(tr,t,er),t}getWorldScale(t){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(tr,ir,t),t}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()}raycast(){}traverse(t){t(this);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].traverse(t)}traverseVisible(t){if(!1===this.visible)return;t(this);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].traverseVisible(t)}traverseAncestors(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let i=0,n=e.length;i<n;i++)e[i].updateMatrixWorld(t)}updateWorldMatrix(t,e){const i=this.parent;if(!0===t&&null!==i&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e){const t=this.children;for(let e=0,i=t.length;e<i;e++)t[e].updateWorldMatrix(!1,!0)}}toJSON(t){const e=void 0===t||"string"==typeof t,i={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const n={};function r(e,i){return void 0===e[i.uuid]&&(e[i.uuid]=i.toJSON(t)),i.uuid}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),this.isInstancedMesh&&(n.type="InstancedMesh",n.count=this.count,n.instanceMatrix=this.instanceMatrix.toJSON(),null!==this.instanceColor&&(n.instanceColor=this.instanceColor.toJSON())),this.isScene)this.background&&(this.background.isColor?n.background=this.background.toJSON():this.background.isTexture&&(n.background=this.background.toJSON(t).uuid)),this.environment&&this.environment.isTexture&&(n.environment=this.environment.toJSON(t).uuid);else if(this.isMesh||this.isLine||this.isPoints){n.geometry=r(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const i=e.shapes;if(Array.isArray(i))for(let e=0,n=i.length;e<n;e++){const n=i[e];r(t.shapes,n)}else r(t.shapes,i)}}if(this.isSkinnedMesh&&(n.bindMode=this.bindMode,n.bindMatrix=this.bindMatrix.toArray(),void 0!==this.skeleton&&(r(t.skeletons,this.skeleton),n.skeleton=this.skeleton.uuid)),void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let i=0,n=this.material.length;i<n;i++)e.push(r(t.materials,this.material[i]));n.material=e}else n.material=r(t.materials,this.material);if(this.children.length>0){n.children=[];for(let e=0;e<this.children.length;e++)n.children.push(this.children[e].toJSON(t).object)}if(this.animations.length>0){n.animations=[];for(let e=0;e<this.animations.length;e++){const i=this.animations[e];n.animations.push(r(t.animations,i))}}if(e){const e=s(t.geometries),n=s(t.materials),r=s(t.textures),o=s(t.images),a=s(t.shapes),h=s(t.skeletons),l=s(t.animations),u=s(t.nodes);e.length>0&&(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),u.length>0&&(i.nodes=u)}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(t){return(new this.constructor).copy(this,t)}copy(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;e<t.children.length;e++){const i=t.children[e];this.add(i.clone())}return this}}hr.DefaultUp=new on(0,1,0),hr.DefaultMatrixAutoUpdate=!0,hr.prototype.isObject3D=!0;const lr=new on,ur=new on,cr=new on,dr=new on,pr=new on,fr=new on,mr=new on,gr=new on,vr=new on,yr=new on;class xr{constructor(t=new on,e=new on,i=new on){this.a=t,this.b=e,this.c=i}static getNormal(t,e,i,n){n.subVectors(i,e),lr.subVectors(t,e),n.cross(lr);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){lr.subVectors(n,e),ur.subVectors(i,e),cr.subVectors(t,e);const s=lr.dot(lr),o=lr.dot(ur),a=lr.dot(cr),h=ur.dot(ur),l=ur.dot(cr),u=s*h-o*o;if(0===u)return r.set(-2,-1,-1);const c=1/u,d=(h*a-o*l)*c,p=(s*l-o*a)*c;return r.set(1-d-p,p,d)}static containsPoint(t,e,i,n){return this.getBarycoord(t,e,i,n,dr),dr.x>=0&&dr.y>=0&&dr.x+dr.y<=1}static getUV(t,e,i,n,r,s,o,a){return this.getBarycoord(t,e,i,n,dr),a.set(0,0),a.addScaledVector(r,dr.x),a.addScaledVector(s,dr.y),a.addScaledVector(o,dr.z),a}static isFrontFacing(t,e,i,n){return lr.subVectors(i,e),ur.subVectors(t,e),lr.cross(ur).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}setFromAttributeAndIndices(t,e,i,n){return this.a.fromBufferAttribute(t,e),this.b.fromBufferAttribute(t,i),this.c.fromBufferAttribute(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 lr.subVectors(this.c,this.b),ur.subVectors(this.a,this.b),.5*lr.cross(ur).length()}getMidpoint(t){return t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(t){return xr.getNormal(this.a,this.b,this.c,t)}getPlane(t){return t.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(t,e){return xr.getBarycoord(t,this.a,this.b,this.c,e)}getUV(t,e,i,n,r){return xr.getUV(t,this.a,this.b,this.c,e,i,n,r)}containsPoint(t){return xr.containsPoint(t,this.a,this.b,this.c)}isFrontFacing(t){return xr.isFrontFacing(this.a,this.b,this.c,t)}intersectsBox(t){return t.intersectsTriangle(this)}closestPointToPoint(t,e){const i=this.a,n=this.b,r=this.c;let s,o;pr.subVectors(n,i),fr.subVectors(r,i),gr.subVectors(t,i);const a=pr.dot(gr),h=fr.dot(gr);if(a<=0&&h<=0)return e.copy(i);vr.subVectors(t,n);const l=pr.dot(vr),u=fr.dot(vr);if(l>=0&&u<=l)return e.copy(n);const c=a*u-l*h;if(c<=0&&a>=0&&l<=0)return s=a/(a-l),e.copy(i).addScaledVector(pr,s);yr.subVectors(t,r);const d=pr.dot(yr),p=fr.dot(yr);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(fr,o);const m=l*p-d*u;if(m<=0&&u-l>=0&&d-p>=0)return mr.subVectors(r,n),o=(u-l)/(u-l+(d-p)),e.copy(n).addScaledVector(mr,o);const g=1/(m+f+c);return s=f*g,o=c*g,e.copy(i).addScaledVector(pr,s).addScaledVector(fr,o)}equals(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}let wr=0;class br extends mi{constructor(){super(),Object.defineProperty(this,"id",{value:wr++}),this.uuid=wi(),this.name="",this.type="Material",this.blending=w,this.side=f,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=B,this.blendDst=I,this.blendEquation=E,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=W,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=ii,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=He,this.stencilZFail=He,this.stencilZPass=He,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(t){this._alphaTest>0!=t>0&&this.version++,this._alphaTest=t}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(t){if(void 0!==t)for(const e in t){const i=t[e];if(void 0===i)continue;if("shading"===e){this.flatShading=i===v;continue}const n=this[e];void 0!==n&&(n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[e]=i)}}toJSON(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function n(t){const e=[];for(const i in t){const n=t[i];delete n.metadata,e.push(n)}return e}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),void 0!==this.roughness&&(i.roughness=this.roughness),void 0!==this.metalness&&(i.metalness=this.metalness),void 0!==this.sheen&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),void 0!==this.sheenRoughness&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),void 0!==this.specularIntensity&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),void 0!==this.shininess&&(i.shininess=this.shininess),void 0!==this.clearcoat&&(i.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(t).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(t).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(t).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(t).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(t).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(t).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(t).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,void 0!==this.combine&&(i.combine=this.combine)),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity),void 0!==this.reflectivity&&(i.reflectivity=this.reflectivity),void 0!==this.refractionRatio&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.transmission&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(t).uuid),void 0!==this.thickness&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(t).uuid),void 0!==this.attenuationDistance&&(i.attenuationDistance=this.attenuationDistance),void 0!==this.attenuationColor&&(i.attenuationColor=this.attenuationColor.getHex()),void 0!==this.size&&(i.size=this.size),null!==this.shadowSide&&(i.shadowSide=this.shadowSide),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==w&&(i.blending=this.blending),this.side!==f&&(i.side=this.side),this.vertexColors&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),!0===this.transparent&&(i.transparent=this.transparent),i.depthFunc=this.depthFunc,i.depthTest=this.depthTest,i.depthWrite=this.depthWrite,i.colorWrite=this.colorWrite,i.stencilWrite=this.stencilWrite,i.stencilWriteMask=this.stencilWriteMask,i.stencilFunc=this.stencilFunc,i.stencilRef=this.stencilRef,i.stencilFuncMask=this.stencilFuncMask,i.stencilFail=this.stencilFail,i.stencilZFail=this.stencilZFail,i.stencilZPass=this.stencilZPass,void 0!==this.rotation&&0!==this.rotation&&(i.rotation=this.rotation),!0===this.polygonOffset&&(i.polygonOffset=!0),0!==this.polygonOffsetFactor&&(i.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(i.polygonOffsetUnits=this.polygonOffsetUnits),void 0!==this.linewidth&&1!==this.linewidth&&(i.linewidth=this.linewidth),void 0!==this.dashSize&&(i.dashSize=this.dashSize),void 0!==this.gapSize&&(i.gapSize=this.gapSize),void 0!==this.scale&&(i.scale=this.scale),!0===this.dithering&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),!0===this.alphaToCoverage&&(i.alphaToCoverage=this.alphaToCoverage),!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.flatShading&&(i.flatShading=this.flatShading),!1===this.visible&&(i.visible=!1),!1===this.toneMapped&&(i.toneMapped=!1),!1===this.fog&&(i.fog=!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(){return(new this.constructor).copy(this)}copy(t){this.name=t.name,this.blending=t.blending,this.side=t.side,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.alphaToCoverage=t.alphaToCoverage,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(t){!0===t&&this.version++}}br.prototype.isMaterial=!0,br.fromType=function(){return null};class Ar extends br{constructor(t){super(),this.type="MeshBasicMaterial",this.color=new Wi(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Q,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(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.fog=t.fog,this}}Ar.prototype.isMeshBasicMaterial=!0;const Tr=new on,Sr=new Ci;class Er{constructor(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=ni,this.updateRange={offset:0,count:-1},this.version=0}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(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(t,e,i){t*=this.itemSize,i*=e.itemSize;for(let n=0,r=this.itemSize;n<r;n++)this.array[t+n]=e.array[i+n];return this}copyArray(t){return this.array.set(t),this}copyColorsArray(t){const e=this.array;let i=0;for(let n=0,r=t.length;n<r;n++){let r=t[n];void 0===r&&(r=new Wi),e[i++]=r.r,e[i++]=r.g,e[i++]=r.b}return this}copyVector2sArray(t){const e=this.array;let i=0;for(let n=0,r=t.length;n<r;n++){let r=t[n];void 0===r&&(r=new Ci),e[i++]=r.x,e[i++]=r.y}return this}copyVector3sArray(t){const e=this.array;let i=0;for(let n=0,r=t.length;n<r;n++){let r=t[n];void 0===r&&(r=new on),e[i++]=r.x,e[i++]=r.y,e[i++]=r.z}return this}copyVector4sArray(t){const e=this.array;let i=0;for(let n=0,r=t.length;n<r;n++){let r=t[n];void 0===r&&(r=new Ji),e[i++]=r.x,e[i++]=r.y,e[i++]=r.z,e[i++]=r.w}return this}applyMatrix3(t){if(2===this.itemSize)for(let e=0,i=this.count;e<i;e++)Sr.fromBufferAttribute(this,e),Sr.applyMatrix3(t),this.setXY(e,Sr.x,Sr.y);else if(3===this.itemSize)for(let e=0,i=this.count;e<i;e++)Tr.fromBufferAttribute(this,e),Tr.applyMatrix3(t),this.setXYZ(e,Tr.x,Tr.y,Tr.z);return this}applyMatrix4(t){for(let e=0,i=this.count;e<i;e++)Tr.fromBufferAttribute(this,e),Tr.applyMatrix4(t),this.setXYZ(e,Tr.x,Tr.y,Tr.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)Tr.fromBufferAttribute(this,e),Tr.applyNormalMatrix(t),this.setXYZ(e,Tr.x,Tr.y,Tr.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)Tr.fromBufferAttribute(this,e),Tr.transformDirection(t),this.setXYZ(e,Tr.x,Tr.y,Tr.z);return this}set(t,e=0){return this.array.set(t,e),this}getX(t){return this.array[t*this.itemSize]}setX(t,e){return this.array[t*this.itemSize]=e,this}getY(t){return this.array[t*this.itemSize+1]}setY(t,e){return this.array[t*this.itemSize+1]=e,this}getZ(t){return this.array[t*this.itemSize+2]}setZ(t,e){return this.array[t*this.itemSize+2]=e,this}getW(t){return this.array[t*this.itemSize+3]}setW(t,e){return this.array[t*this.itemSize+3]=e,this}setXY(t,e,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this}setXYZ(t,e,i,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this}setXYZW(t,e,i,n,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this.array[t+2]=n,this.array[t+3]=r,this}onUpload(t){return this.onUploadCallback=t,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const t={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized};return""!==this.name&&(t.name=this.name),this.usage!==ni&&(t.usage=this.usage),0===this.updateRange.offset&&-1===this.updateRange.count||(t.updateRange=this.updateRange),t}}Er.prototype.isBufferAttribute=!0;class Mr extends Er{constructor(t,e,i){super(new Int8Array(t),e,i)}}class _r extends Er{constructor(t,e,i){super(new Uint8Array(t),e,i)}}class Cr extends Er{constructor(t,e,i){super(new Uint8ClampedArray(t),e,i)}}class Pr extends Er{constructor(t,e,i){super(new Int16Array(t),e,i)}}class Rr extends Er{constructor(t,e,i){super(new Uint16Array(t),e,i)}}class Lr extends Er{constructor(t,e,i){super(new Int32Array(t),e,i)}}class Or extends Er{constructor(t,e,i){super(new Uint32Array(t),e,i)}}class Dr extends Er{constructor(t,e,i){super(new Uint16Array(t),e,i)}}Dr.prototype.isFloat16BufferAttribute=!0;class Br extends Er{constructor(t,e,i){super(new Float32Array(t),e,i)}}class Ir extends Er{constructor(t,e,i){super(new Float64Array(t),e,i)}}let Fr=0;const kr=new kn,Nr=new hr,zr=new on,Ur=new ln,Vr=new ln,Hr=new on;class Gr extends mi{constructor(){super(),Object.defineProperty(this,"id",{value:Fr++}),this.uuid=wi(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(t){return Array.isArray(t)?this.index=new(Ri(t)?Or:Rr)(t,1):this.index=t,this}getAttribute(t){return this.attributes[t]}setAttribute(t,e){return this.attributes[t]=e,this}deleteAttribute(t){return delete this.attributes[t],this}hasAttribute(t){return void 0!==this.attributes[t]}addGroup(t,e,i=0){this.groups.push({start:t,count:e,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(t,e){this.drawRange.start=t,this.drawRange.count=e}applyMatrix4(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 Pi).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}applyQuaternion(t){return kr.makeRotationFromQuaternion(t),this.applyMatrix4(kr),this}rotateX(t){return kr.makeRotationX(t),this.applyMatrix4(kr),this}rotateY(t){return kr.makeRotationY(t),this.applyMatrix4(kr),this}rotateZ(t){return kr.makeRotationZ(t),this.applyMatrix4(kr),this}translate(t,e,i){return kr.makeTranslation(t,e,i),this.applyMatrix4(kr),this}scale(t,e,i){return kr.makeScale(t,e,i),this.applyMatrix4(kr),this}lookAt(t){return Nr.lookAt(t),Nr.updateMatrix(),this.applyMatrix4(Nr.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(zr).negate(),this.translate(zr.x,zr.y,zr.z),this}setFromPoints(t){const e=[];for(let i=0,n=t.length;i<n;i++){const n=t[i];e.push(n.x,n.y,n.z||0)}return this.setAttribute("position",new Br(e,3)),this}computeBoundingBox(){null===this.boundingBox&&(this.boundingBox=new ln);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)this.boundingBox.set(new on(-1/0,-1/0,-1/0),new on(1/0,1/0,1/0));else{if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){const i=e[t];Ur.setFromBufferAttribute(i),this.morphTargetsRelative?(Hr.addVectors(this.boundingBox.min,Ur.min),this.boundingBox.expandByPoint(Hr),Hr.addVectors(this.boundingBox.max,Ur.max),this.boundingBox.expandByPoint(Hr)):(this.boundingBox.expandByPoint(Ur.min),this.boundingBox.expandByPoint(Ur.max))}}else this.boundingBox.makeEmpty();isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z)}}computeBoundingSphere(){null===this.boundingSphere&&(this.boundingSphere=new Cn);const t=this.attributes.position,e=this.morphAttributes.position;if(t&&t.isGLBufferAttribute)this.boundingSphere.set(new on,1/0);else if(t){const i=this.boundingSphere.center;if(Ur.setFromBufferAttribute(t),e)for(let t=0,i=e.length;t<i;t++){const i=e[t];Vr.setFromBufferAttribute(i),this.morphTargetsRelative?(Hr.addVectors(Ur.min,Vr.min),Ur.expandByPoint(Hr),Hr.addVectors(Ur.max,Vr.max),Ur.expandByPoint(Hr)):(Ur.expandByPoint(Vr.min),Ur.expandByPoint(Vr.max))}Ur.getCenter(i);let n=0;for(let e=0,r=t.count;e<r;e++)Hr.fromBufferAttribute(t,e),n=Math.max(n,i.distanceToSquared(Hr));if(e)for(let r=0,s=e.length;r<s;r++){const s=e[r],o=this.morphTargetsRelative;for(let e=0,r=s.count;e<r;e++)Hr.fromBufferAttribute(s,e),o&&(zr.fromBufferAttribute(t,e),Hr.add(zr)),n=Math.max(n,i.distanceToSquared(Hr))}this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)}}computeTangents(){const t=this.index,e=this.attributes;if(null===t||void 0===e.position||void 0===e.normal||void 0===e.uv)return;const i=t.array,n=e.position.array,r=e.normal.array,s=e.uv.array,o=n.length/3;!1===this.hasAttribute("tangent")&&this.setAttribute("tangent",new Er(new Float32Array(4*o),4));const a=this.getAttribute("tangent").array,h=[],l=[];for(let t=0;t<o;t++)h[t]=new on,l[t]=new on;const u=new on,c=new on,d=new on,p=new Ci,f=new Ci,m=new Ci,g=new on,v=new on;function y(t,e,i){u.fromArray(n,3*t),c.fromArray(n,3*e),d.fromArray(n,3*i),p.fromArray(s,2*t),f.fromArray(s,2*e),m.fromArray(s,2*i),c.sub(u),d.sub(u),f.sub(p),m.sub(p);const r=1/(f.x*m.y-m.x*f.y);isFinite(r)&&(g.copy(c).multiplyScalar(m.y).addScaledVector(d,-f.y).multiplyScalar(r),v.copy(d).multiplyScalar(f.x).addScaledVector(c,-m.x).multiplyScalar(r),h[t].add(g),h[e].add(g),h[i].add(g),l[t].add(v),l[e].add(v),l[i].add(v))}let x=this.groups;0===x.length&&(x=[{start:0,count:i.length}]);for(let t=0,e=x.length;t<e;++t){const e=x[t],n=e.start;for(let t=n,r=n+e.count;t<r;t+=3)y(i[t+0],i[t+1],i[t+2])}const w=new on,b=new on,A=new on,T=new on;function S(t){A.fromArray(r,3*t),T.copy(A);const e=h[t];w.copy(e),w.sub(A.multiplyScalar(A.dot(e))).normalize(),b.crossVectors(T,e);const i=b.dot(l[t])<0?-1:1;a[4*t]=w.x,a[4*t+1]=w.y,a[4*t+2]=w.z,a[4*t+3]=i}for(let t=0,e=x.length;t<e;++t){const e=x[t],n=e.start;for(let t=n,r=n+e.count;t<r;t+=3)S(i[t+0]),S(i[t+1]),S(i[t+2])}}computeVertexNormals(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let i=this.getAttribute("normal");if(void 0===i)i=new Er(new Float32Array(3*e.count),3),this.setAttribute("normal",i);else for(let t=0,e=i.count;t<e;t++)i.setXYZ(t,0,0,0);const n=new on,r=new on,s=new on,o=new on,a=new on,h=new on,l=new on,u=new on;if(t)for(let c=0,d=t.count;c<d;c+=3){const d=t.getX(c+0),p=t.getX(c+1),f=t.getX(c+2);n.fromBufferAttribute(e,d),r.fromBufferAttribute(e,p),s.fromBufferAttribute(e,f),l.subVectors(s,r),u.subVectors(n,r),l.cross(u),o.fromBufferAttribute(i,d),a.fromBufferAttribute(i,p),h.fromBufferAttribute(i,f),o.add(l),a.add(l),h.add(l),i.setXYZ(d,o.x,o.y,o.z),i.setXYZ(p,a.x,a.y,a.z),i.setXYZ(f,h.x,h.y,h.z)}else for(let t=0,o=e.count;t<o;t+=3)n.fromBufferAttribute(e,t+0),r.fromBufferAttribute(e,t+1),s.fromBufferAttribute(e,t+2),l.subVectors(s,r),u.subVectors(n,r),l.cross(u),i.setXYZ(t+0,l.x,l.y,l.z),i.setXYZ(t+1,l.x,l.y,l.z),i.setXYZ(t+2,l.x,l.y,l.z);this.normalizeNormals(),i.needsUpdate=!0}}merge(t,e){if(!t||!t.isBufferGeometry)return;void 0===e&&(e=0);const i=this.attributes;for(const n in i){if(void 0===t.attributes[n])continue;const r=i[n].array,s=t.attributes[n],o=s.array,a=s.itemSize*e,h=Math.min(o.length,r.length-a);for(let t=0,e=a;t<h;t++,e++)r[e]=o[t]}return this}normalizeNormals(){const t=this.attributes.normal;for(let e=0,i=t.count;e<i;e++)Hr.fromBufferAttribute(t,e),Hr.normalize(),t.setXYZ(e,Hr.x,Hr.y,Hr.z)}toNonIndexed(){function t(t,e){const i=t.array,n=t.itemSize,r=t.normalized,s=new i.constructor(e.length*n);let o=0,a=0;for(let r=0,h=e.length;r<h;r++){o=t.isInterleavedBufferAttribute?e[r]*t.data.stride+t.offset:e[r]*n;for(let t=0;t<n;t++)s[a++]=i[o++]}return new Er(s,n,r)}if(null===this.index)return this;const e=new Gr,i=this.index.array,n=this.attributes;for(const r in n){const s=t(n[r],i);e.setAttribute(r,s)}const r=this.morphAttributes;for(const n in r){const s=[],o=r[n];for(let e=0,n=o.length;e<n;e++){const n=t(o[e],i);s.push(n)}e.morphAttributes[n]=s}e.morphTargetsRelative=this.morphTargetsRelative;const s=this.groups;for(let t=0,i=s.length;t<i;t++){const i=s[t];e.addGroup(i.start,i.count,i.materialIndex)}return e}toJSON(){const t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){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];t.data.attributes[e]=n.toJSON(t.data)}const n={};let r=!1;for(const e in this.morphAttributes){const i=this.morphAttributes[e],s=[];for(let e=0,n=i.length;e<n;e++){const n=i[e];s.push(n.toJSON(t.data))}s.length>0&&(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(){return(new this.constructor).copy(this)}copy(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;t<r;t++)i.push(n[t].clone(e));this.morphAttributes[t]=i}this.morphTargetsRelative=t.morphTargetsRelative;const s=t.groups;for(let t=0,e=s.length;t<e;t++){const e=s[t];this.addGroup(e.start,e.count,e.materialIndex)}const o=t.boundingBox;null!==o&&(this.boundingBox=o.clone());const a=t.boundingSphere;return null!==a&&(this.boundingSphere=a.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,void 0!==t.parameters&&(this.parameters=Object.assign({},t.parameters)),this}dispose(){this.dispatchEvent({type:"dispose"})}}Gr.prototype.isBufferGeometry=!0;const Wr=new kn,Yr=new Fn,Xr=new Cn,jr=new on,qr=new on,Qr=new on,Kr=new on,Jr=new on,Zr=new on,$r=new on,ts=new on,es=new on,is=new Ci,ns=new Ci,rs=new Ci,ss=new on,os=new on;class as extends hr{constructor(t=new Gr,e=new Ar){super(),this.type="Mesh",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(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(){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;e<i;e++){const i=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=e}}}}else{const e=t.morphTargets;void 0!==e&&e.length}}raycast(t,e){const i=this.geometry,n=this.material,r=this.matrixWorld;if(void 0===n)return;if(null===i.boundingSphere&&i.computeBoundingSphere(),Xr.copy(i.boundingSphere),Xr.applyMatrix4(r),!1===t.ray.intersectsSphere(Xr))return;if(Wr.copy(r).invert(),Yr.copy(t.ray).applyMatrix4(Wr),null!==i.boundingBox&&!1===Yr.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,u=i.attributes.uv2,c=i.groups,d=i.drawRange;if(null!==r)if(Array.isArray(n))for(let i=0,p=c.length;i<p;i++){const p=c[i],f=n[p.materialIndex];for(let i=Math.max(p.start,d.start),n=Math.min(r.count,Math.min(p.start+p.count,d.start+d.count));i<n;i+=3){const n=r.getX(i),c=r.getX(i+1),d=r.getX(i+2);s=hs(this,f,t,Yr,o,a,h,l,u,n,c,d),s&&(s.faceIndex=Math.floor(i/3),s.face.materialIndex=p.materialIndex,e.push(s))}}else{for(let i=Math.max(0,d.start),c=Math.min(r.count,d.start+d.count);i<c;i+=3){const c=r.getX(i),d=r.getX(i+1),p=r.getX(i+2);s=hs(this,n,t,Yr,o,a,h,l,u,c,d,p),s&&(s.faceIndex=Math.floor(i/3),e.push(s))}}else if(void 0!==o)if(Array.isArray(n))for(let i=0,r=c.length;i<r;i++){const r=c[i],p=n[r.materialIndex];for(let i=Math.max(r.start,d.start),n=Math.min(o.count,Math.min(r.start+r.count,d.start+d.count));i<n;i+=3){s=hs(this,p,t,Yr,o,a,h,l,u,i,i+1,i+2),s&&(s.faceIndex=Math.floor(i/3),s.face.materialIndex=r.materialIndex,e.push(s))}}else{for(let i=Math.max(0,d.start),r=Math.min(o.count,d.start+d.count);i<r;i+=3){s=hs(this,n,t,Yr,o,a,h,l,u,i,i+1,i+2),s&&(s.faceIndex=Math.floor(i/3),e.push(s))}}}else i.isGeometry}}function hs(t,e,i,n,r,s,o,a,h,l,u,c){jr.fromBufferAttribute(r,l),qr.fromBufferAttribute(r,u),Qr.fromBufferAttribute(r,c);const d=t.morphTargetInfluences;if(s&&d){$r.set(0,0,0),ts.set(0,0,0),es.set(0,0,0);for(let t=0,e=s.length;t<e;t++){const e=d[t],i=s[t];0!==e&&(Kr.fromBufferAttribute(i,l),Jr.fromBufferAttribute(i,u),Zr.fromBufferAttribute(i,c),o?($r.addScaledVector(Kr,e),ts.addScaledVector(Jr,e),es.addScaledVector(Zr,e)):($r.addScaledVector(Kr.sub(jr),e),ts.addScaledVector(Jr.sub(qr),e),es.addScaledVector(Zr.sub(Qr),e)))}jr.add($r),qr.add(ts),Qr.add(es)}t.isSkinnedMesh&&(t.boneTransform(l,jr),t.boneTransform(u,qr),t.boneTransform(c,Qr));const p=function(t,e,i,n,r,s,o,a){let h;if(h=e.side===m?n.intersectTriangle(o,s,r,!0,a):n.intersectTriangle(r,s,o,e.side!==g,a),null===h)return null;os.copy(a),os.applyMatrix4(t.matrixWorld);const l=i.ray.origin.distanceTo(os);return l<i.near||l>i.far?null:{distance:l,point:os.clone(),object:t}}(t,e,i,n,jr,qr,Qr,ss);if(p){a&&(is.fromBufferAttribute(a,l),ns.fromBufferAttribute(a,u),rs.fromBufferAttribute(a,c),p.uv=xr.getUV(ss,jr,qr,Qr,is,ns,rs,new Ci)),h&&(is.fromBufferAttribute(h,l),ns.fromBufferAttribute(h,u),rs.fromBufferAttribute(h,c),p.uv2=xr.getUV(ss,jr,qr,Qr,is,ns,rs,new Ci));const t={a:l,b:u,c:c,normal:new on,materialIndex:0};xr.getNormal(jr,qr,Qr,t.normal),p.face=t}return p}as.prototype.isMesh=!0;class ls extends Gr{constructor(t=1,e=1,i=1,n=1,r=1,s=1){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:n,heightSegments:r,depthSegments:s};const o=this;n=Math.floor(n),r=Math.floor(r),s=Math.floor(s);const a=[],h=[],l=[],u=[];let c=0,d=0;function p(t,e,i,n,r,s,p,f,m,g,v){const y=s/m,x=p/g,w=s/2,b=p/2,A=f/2,T=m+1,S=g+1;let E=0,M=0;const _=new on;for(let s=0;s<S;s++){const o=s*x-b;for(let a=0;a<T;a++){const c=a*y-w;_[t]=c*n,_[e]=o*r,_[i]=A,h.push(_.x,_.y,_.z),_[t]=0,_[e]=0,_[i]=f>0?1:-1,l.push(_.x,_.y,_.z),u.push(a/m),u.push(1-s/g),E+=1}}for(let t=0;t<g;t++)for(let e=0;e<m;e++){const i=c+e+T*t,n=c+e+T*(t+1),r=c+(e+1)+T*(t+1),s=c+(e+1)+T*t;a.push(i,n,s),a.push(n,r,s),M+=6}o.addGroup(d,M,v),d+=M,c+=E}p("z","y","x",-1,-1,i,e,t,s,r,0),p("z","y","x",1,-1,i,e,-t,s,r,1),p("x","z","y",1,1,t,i,e,n,s,2),p("x","z","y",1,-1,t,i,-e,n,s,3),p("x","y","z",1,-1,t,e,i,n,r,4),p("x","y","z",-1,-1,t,e,-i,n,r,5),this.setIndex(a),this.setAttribute("position",new Br(h,3)),this.setAttribute("normal",new Br(l,3)),this.setAttribute("uv",new Br(u,2))}static fromJSON(t){return new ls(t.width,t.height,t.depth,t.widthSegments,t.heightSegments,t.depthSegments)}}function us(t){const e={};for(const i in t){e[i]={};for(const n in t[i]){const r=t[i][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture||r.isQuaternion)?e[i][n]=r.clone():Array.isArray(r)?e[i][n]=r.slice():e[i][n]=r}}return e}function cs(t){const e={};for(let i=0;i<t.length;i++){const n=us(t[i]);for(const t in n)e[t]=n[t]}return e}const ds={clone:us,merge:cs};class ps extends br{constructor(t){super(),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,void 0!==t&&(t.attributes,this.setValues(t))}copy(t){return super.copy(t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=us(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.fog=t.fog,this.lights=t.lights,this.clipping=t.clipping,this.extensions=Object.assign({},t.extensions),this.glslVersion=t.glslVersion,this}toJSON(t){const e=super.toJSON(t);e.glslVersion=this.glslVersion,e.uniforms={};for(const i in this.uniforms){const n=this.uniforms[i].value;n&&n.isTexture?e.uniforms[i]={type:"t",value:n.toJSON(t).uuid}:n&&n.isColor?e.uniforms[i]={type:"c",value:n.getHex()}:n&&n.isVector2?e.uniforms[i]={type:"v2",value:n.toArray()}:n&&n.isVector3?e.uniforms[i]={type:"v3",value:n.toArray()}:n&&n.isVector4?e.uniforms[i]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?e.uniforms[i]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?e.uniforms[i]={type:"m4",value:n.toArray()}:e.uniforms[i]={value:n}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;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}}ps.prototype.isShaderMaterial=!0;class fs extends hr{constructor(){super(),this.type="Camera",this.matrixWorldInverse=new kn,this.projectionMatrix=new kn,this.projectionMatrixInverse=new kn}copy(t,e){return super.copy(t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this}getWorldDirection(t){this.updateWorldMatrix(!0,!1);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()}updateMatrixWorld(t){super.updateMatrixWorld(t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(t,e){super.updateWorldMatrix(t,e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return(new this.constructor).copy(this)}}fs.prototype.isCamera=!0;class ms extends fs{constructor(t=50,e=1,i=.1,n=2e3){super(),this.type="PerspectiveCamera",this.fov=t,this.zoom=1,this.near=i,this.far=n,this.focus=10,this.aspect=e,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(t,e){return super.copy(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(t){const e=.5*this.getFilmHeight()/t;this.fov=2*xi*Math.atan(e),this.updateProjectionMatrix()}getFocalLength(){const t=Math.tan(.5*yi*this.fov);return.5*this.getFilmHeight()/t}getEffectiveFOV(){return 2*xi*Math.atan(Math.tan(.5*yi*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(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(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=this.near;let e=t*Math.tan(.5*yi*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(t){const e=super.toJSON(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}}ms.prototype.isPerspectiveCamera=!0;class gs extends hr{constructor(t,e,i){if(super(),this.type="CubeCamera",!0!==i.isWebGLCubeRenderTarget)return;this.renderTarget=i;const n=new ms(90,1,t,e);n.layers=this.layers,n.up.set(0,-1,0),n.lookAt(new on(1,0,0)),this.add(n);const r=new ms(90,1,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new on(-1,0,0)),this.add(r);const s=new ms(90,1,t,e);s.layers=this.layers,s.up.set(0,0,1),s.lookAt(new on(0,1,0)),this.add(s);const o=new ms(90,1,t,e);o.layers=this.layers,o.up.set(0,0,-1),o.lookAt(new on(0,-1,0)),this.add(o);const a=new ms(90,1,t,e);a.layers=this.layers,a.up.set(0,-1,0),a.lookAt(new on(0,0,1)),this.add(a);const h=new ms(90,1,t,e);h.layers=this.layers,h.up.set(0,-1,0),h.lookAt(new on(0,0,-1)),this.add(h)}update(t,e){null===this.parent&&this.updateMatrixWorld();const i=this.renderTarget,[n,r,s,o,a,h]=this.children,l=t.getRenderTarget(),u=t.toneMapping,c=t.xr.enabled;t.toneMapping=Z,t.xr.enabled=!1;const d=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=d,t.setRenderTarget(i,5),t.render(e,h),t.setRenderTarget(l),t.toneMapping=u,t.xr.enabled=c,i.texture.needsPMREMUpdate=!0}}class vs extends Ki{constructor(t,e,i,n,r,s,o,a,h,l){super(t=void 0!==t?t:[],e=void 0!==e?e:st,i,n,r,s,o,a,h,l),this.flipY=!1}get images(){return this.image}set images(t){this.image=t}}vs.prototype.isCubeTexture=!0;class ys extends Zi{constructor(t,e={}){super(t,t,e);const i={width:t,height:t,depth:1},n=[i,i,i,i,i,i];this.texture=new vs(n,e.mapping,e.wrapS,e.wrapT,e.magFilter,e.minFilter,e.format,e.type,e.anisotropy,e.encoding),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=void 0!==e.generateMipmaps&&e.generateMipmaps,this.texture.minFilter=void 0!==e.minFilter?e.minFilter:yt}fromEquirectangularTexture(t,e){this.texture.type=e.type,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 <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\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 <common>\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 ls(5,5,5),r=new ps({name:"CubemapFromEquirect",uniforms:us(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:m,blending:x});r.uniforms.tEquirect.value=e;const s=new as(n,r),o=e.minFilter;e.minFilter===bt&&(e.minFilter=yt);return new gs(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)}}ys.prototype.isWebGLCubeRenderTarget=!0;const xs=new on,ws=new on,bs=new Pi;class As{constructor(t=new on(1,0,0),e=0){this.normal=t,this.constant=e}set(t,e){return this.normal.copy(t),this.constant=e,this}setComponents(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this}setFromNormalAndCoplanarPoint(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this}setFromCoplanarPoints(t,e,i){const n=xs.subVectors(i,e).cross(ws.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(n,t),this}copy(t){return this.normal.copy(t.normal),this.constant=t.constant,this}normalize(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(t){return this.normal.dot(t)+this.constant}distanceToSphere(t){return this.distanceToPoint(t.center)-t.radius}projectPoint(t,e){return e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)}intersectLine(t,e){const i=t.delta(xs),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(t.start)?e.copy(t.start):null;const r=-(t.start.dot(this.normal)+this.constant)/n;return r<0||r>1?null: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 t.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(t,e){const i=e||bs.getNormalMatrix(t),n=this.coplanarPoint(xs).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}clone(){return(new this.constructor).copy(this)}}As.prototype.isPlane=!0;const Ts=new Cn,Ss=new on;class Es{constructor(t=new As,e=new As,i=new As,n=new As,r=new As,s=new As){this.planes=[t,e,i,n,r,s]}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}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],u=i[7],c=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],v=i[14],y=i[15];return e[0].setComponents(o-n,u-a,f-c,y-m).normalize(),e[1].setComponents(o+n,u+a,f+c,y+m).normalize(),e[2].setComponents(o+r,u+h,f+d,y+g).normalize(),e[3].setComponents(o-r,u-h,f-d,y-g).normalize(),e[4].setComponents(o-s,u-l,f-p,y-v).normalize(),e[5].setComponents(o+s,u+l,f+p,y+v).normalize(),this}intersectsObject(t){const e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Ts.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Ts)}intersectsSprite(t){return Ts.center.set(0,0,0),Ts.radius=.7071067811865476,Ts.applyMatrix4(t.matrixWorld),this.intersectsSphere(Ts)}intersectsSphere(t){const e=this.planes,i=t.center,n=-t.radius;for(let t=0;t<6;t++){if(e[t].distanceToPoint(i)<n)return!1}return!0}intersectsBox(t){const e=this.planes;for(let i=0;i<6;i++){const n=e[i];if(Ss.x=n.normal.x>0?t.max.x:t.min.x,Ss.y=n.normal.y>0?t.max.y:t.min.y,Ss.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(Ss)<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}clone(){return(new this.constructor).copy(this)}}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 _s(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<e.version)&&n.set(e,{buffer:e.buffer,type:e.type,bytesPerElement:e.elementSize,version:e.version}))}e.isInterleavedBufferAttribute&&(e=e.data);const s=n.get(e);void 0===s?n.set(e,function(e,n){const r=e.array,s=e.usage,o=t.createBuffer();let a;if(t.bindBuffer(n,o),t.bufferData(n,r,s),e.onUploadCallback(),r instanceof Float32Array)a=5126;else if(r instanceof Uint16Array)if(e.isFloat16BufferAttribute){if(!i)throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");a=5131}else a=5123;else if(r instanceof Int16Array)a=5122;else if(r instanceof Uint32Array)a=5125;else if(r instanceof Int32Array)a=5124;else if(r instanceof Int8Array)a=5120;else if(r instanceof Uint8Array)a=5121;else{if(!(r instanceof Uint8ClampedArray))throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+r);a=5121}return{buffer:o,type:a,bytesPerElement:r.BYTES_PER_ELEMENT,version:e.version}}(e,r)):s.version<e.version&&(!function(e,n,r){const s=n.array,o=n.updateRange;t.bindBuffer(r,e),-1===o.count?t.bufferSubData(r,0,s):(i?t.bufferSubData(r,o.offset*s.BYTES_PER_ELEMENT,s,o.offset,o.count):t.bufferSubData(r,o.offset*s.BYTES_PER_ELEMENT,s.subarray(o.offset,o.offset+o.count)),o.count=-1)}(s.buffer,e,r),s.version=e.version)}}}class Cs extends Gr{constructor(t=1,e=1,i=1,n=1){super(),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:n};const r=t/2,s=e/2,o=Math.floor(i),a=Math.floor(n),h=o+1,l=a+1,u=t/o,c=e/a,d=[],p=[],f=[],m=[];for(let t=0;t<l;t++){const e=t*c-s;for(let i=0;i<h;i++){const n=i*u-r;p.push(n,-e,0),f.push(0,0,1),m.push(i/o),m.push(1-t/a)}}for(let t=0;t<a;t++)for(let e=0;e<o;e++){const i=e+h*t,n=e+h*(t+1),r=e+1+h*(t+1),s=e+1+h*t;d.push(i,n,s),d.push(n,r,s)}this.setIndex(d),this.setAttribute("position",new Br(p,3)),this.setAttribute("normal",new Br(f,3)),this.setAttribute("uv",new Br(m,2))}static fromJSON(t){return new Cs(t.width,t.height,t.widthSegments,t.heightSegments)}}const Ps={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif",alphatest_pars_fragment:"#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",bsdfs:"vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat V_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_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * 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}\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_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\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, float faceDirection ) {\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 ) * faceDirection;\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:"#if defined( USE_COLOR_ALPHA )\n\tdiffuseColor *= vColor;\n#elif defined( USE_COLOR )\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR )\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvarying vec3 vColor;\n#endif",color_vertex:"#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\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 max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\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 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 USE_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}\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_minMipLevel 4.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\tvec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\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\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\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_MAX_MIP );\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\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:"vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\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}",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#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\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\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\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\tvFogDepth = - mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float vFogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\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 vFogDepth;\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 vec3( texture2D( gradientMap, coord ).r );\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\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\treflectedLight.indirectDiffuse += lightMapIrradiance;\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.normal );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\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\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = 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\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = 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\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = 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.normal );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\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 vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\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 getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.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 getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.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 getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.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 vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif",lights_toon_fragment:"ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",lights_toon_pars_fragment:"varying vec3 vViewPosition;\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\treflectedLight.directDiffuse += irradiance * BRDF_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_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;\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\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, 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_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.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\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 = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.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}\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.roughness;\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#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\treflectedLight.directDiffuse += irradiance * BRDF_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_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 USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += 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 USE_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\tgetPointLightInfo( 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\tgetSpotLightInfo( 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\tgetDirectionalLightInfo( 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.normal );\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.normal );\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 = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\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 sampledDiffuseColor = texture2D( map, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tsampledDiffuseColor = vec4( mix( pow( sampledDiffuseColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), sampledDiffuseColor.rgb * 0.0773993808, vec3( lessThanEqual( sampledDiffuseColor.rgb, vec3( 0.04045 ) ) ) ), sampledDiffuseColor.w );\n\t#endif\n\tdiffuseColor *= sampledDiffuseColor;\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\tdiffuseColor *= texture2D( map, uv );\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",morphcolor_vertex:"#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif",normal_fragment_begin:"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#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 * faceDirection;\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 * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\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 * faceDirection;\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, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif",normal_pars_fragment:"#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",normal_pars_vertex:"#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",normal_vertex:"#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",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, float faceDirection ) {\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\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif",clearcoat_normal_fragment_begin:"#ifdef USE_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, faceDirection );\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",output_fragment:"#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );",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\tuniform highp sampler2D boneTexture;\n\tuniform int boneTextureSize;\n\tmat4 getBoneMatrix( const in float i ) {\n\t\tfloat j = i * 4.0;\n\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\ty = dy * ( y + 0.5 );\n\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\treturn bone;\n\t}\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; }",transmission_fragment:"#ifdef USE_TRANSMISSION\n\tfloat transmissionAlpha = 1.0;\n\tfloat transmissionFactor = transmission;\n\tfloat thicknessFactor = thickness;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\n\t\tattenuationColor, attenuationDistance );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\n\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\n#endif",transmission_pars_fragment:"#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef texture2DLodEXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( attenuationDistance == 0.0 ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\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 ) || defined ( USE_TRANSMISSION )\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_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}",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tgl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );\n\t#endif\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",cube_frag:"#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_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_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshnormal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",meshnormal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}",meshphysical_frag:"#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULARINTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n\t#ifdef USE_SPECULARCOLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshtoon_vert:"#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshtoon_frag:"#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",shadow_vert:"#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}"},Rs={common:{diffuse:{value:new Wi(16777215)},opacity:{value:1},map:{value:null},uvTransform:{value:new Pi},uv2Transform:{value:new Pi},alphaMap:{value:null},alphaTest:{value:0}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},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 Ci(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 Wi(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 Wi(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Pi}},sprite:{diffuse:{value:new Wi(16777215)},opacity:{value:1},center:{value:new Ci(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},alphaTest:{value:0},uvTransform:{value:new Pi}}},Ls={basic:{uniforms:cs([Rs.common,Rs.specularmap,Rs.envmap,Rs.aomap,Rs.lightmap,Rs.fog]),vertexShader:Ps.meshbasic_vert,fragmentShader:Ps.meshbasic_frag},lambert:{uniforms:cs([Rs.common,Rs.specularmap,Rs.envmap,Rs.aomap,Rs.lightmap,Rs.emissivemap,Rs.fog,Rs.lights,{emissive:{value:new Wi(0)}}]),vertexShader:Ps.meshlambert_vert,fragmentShader:Ps.meshlambert_frag},phong:{uniforms:cs([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 Wi(0)},specular:{value:new Wi(1118481)},shininess:{value:30}}]),vertexShader:Ps.meshphong_vert,fragmentShader:Ps.meshphong_frag},standard:{uniforms:cs([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 Wi(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Ps.meshphysical_vert,fragmentShader:Ps.meshphysical_frag},toon:{uniforms:cs([Rs.common,Rs.aomap,Rs.lightmap,Rs.emissivemap,Rs.bumpmap,Rs.normalmap,Rs.displacementmap,Rs.gradientmap,Rs.fog,Rs.lights,{emissive:{value:new Wi(0)}}]),vertexShader:Ps.meshtoon_vert,fragmentShader:Ps.meshtoon_frag},matcap:{uniforms:cs([Rs.common,Rs.bumpmap,Rs.normalmap,Rs.displacementmap,Rs.fog,{matcap:{value:null}}]),vertexShader:Ps.meshmatcap_vert,fragmentShader:Ps.meshmatcap_frag},points:{uniforms:cs([Rs.points,Rs.fog]),vertexShader:Ps.points_vert,fragmentShader:Ps.points_frag},dashed:{uniforms:cs([Rs.common,Rs.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Ps.linedashed_vert,fragmentShader:Ps.linedashed_frag},depth:{uniforms:cs([Rs.common,Rs.displacementmap]),vertexShader:Ps.depth_vert,fragmentShader:Ps.depth_frag},normal:{uniforms:cs([Rs.common,Rs.bumpmap,Rs.normalmap,Rs.displacementmap,{opacity:{value:1}}]),vertexShader:Ps.meshnormal_vert,fragmentShader:Ps.meshnormal_frag},sprite:{uniforms:cs([Rs.sprite,Rs.fog]),vertexShader:Ps.sprite_vert,fragmentShader:Ps.sprite_frag},background:{uniforms:{uvTransform:{value:new Pi},t2D:{value:null}},vertexShader:Ps.background_vert,fragmentShader:Ps.background_frag},cube:{uniforms:cs([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:cs([Rs.common,Rs.displacementmap,{referencePosition:{value:new on},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Ps.distanceRGBA_vert,fragmentShader:Ps.distanceRGBA_frag},shadow:{uniforms:cs([Rs.lights,Rs.fog,{color:{value:new Wi(0)},opacity:{value:1}}]),vertexShader:Ps.shadow_vert,fragmentShader:Ps.shadow_frag}};function Os(t,e,i,n,r,s){const o=new Wi(0);let a,h,l=!0===r?0:1,u=null,c=0,d=null;function p(t,e){i.buffers.color.setClear(t.r,t.g,t.b,e,s)}return{getClearColor:function(){return o},setClearColor:function(t,e=1){o.set(t),l=e,p(o,l)},getClearAlpha:function(){return l},setClearAlpha:function(t){l=t,p(o,l)},render:function(i,r){let s=!1,g=!0===r.isScene?r.background:null;g&&g.isTexture&&(g=e.get(g));const v=t.xr,y=v.getSession&&v.getSession();y&&"additive"===y.environmentBlendMode&&(g=null),null===g?p(o,l):g&&g.isColor&&(p(g,1),s=!0),(t.autoClear||s)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),g&&(g.isCubeTexture||g.mapping===lt)?(void 0===h&&(h=new as(new ls(1,1,1),new ps({name:"BackgroundCubeMaterial",uniforms:us(Ls.cube.uniforms),vertexShader:Ls.cube.vertexShader,fragmentShader:Ls.cube.fragmentShader,side:m,depthTest:!1,depthWrite:!1,fog:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(t,e,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(h)),h.material.uniforms.envMap.value=g,h.material.uniforms.flipEnvMap.value=g.isCubeTexture&&!1===g.isRenderTargetTexture?-1:1,u===g&&c===g.version&&d===t.toneMapping||(h.material.needsUpdate=!0,u=g,c=g.version,d=t.toneMapping),h.layers.enableAll(),i.unshift(h,h.geometry,h.material,0,0,null)):g&&g.isTexture&&(void 0===a&&(a=new as(new Cs(2,2),new ps({name:"BackgroundMaterial",uniforms:us(Ls.background.uniforms),vertexShader:Ls.background.vertexShader,fragmentShader:Ls.background.fragmentShader,side:f,depthTest:!1,depthWrite:!1,fog:!1})),a.geometry.deleteAttribute("normal"),Object.defineProperty(a.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(a)),a.material.uniforms.t2D.value=g,!0===g.matrixAutoUpdate&&g.updateMatrix(),a.material.uniforms.uvTransform.value.copy(g.matrix),u===g&&c===g.version&&d===t.toneMapping||(a.material.needsUpdate=!0,u=g,c=g.version,d=t.toneMapping),a.layers.enableAll(),i.unshift(a,a.geometry,a.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=p(null);let l=h,u=!1;function c(e){return n.isWebGL2?t.bindVertexArray(e):s.bindVertexArrayOES(e)}function d(e){return n.isWebGL2?t.deleteVertexArray(e):s.deleteVertexArrayOES(e)}function p(t){const e=[],i=[],n=[];for(let t=0;t<r;t++)e[t]=0,i[t]=0,n[t]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:e,enabledAttributes:i,attributeDivisors:n,object:t,attributes:{},index:null}}function f(){const t=l.newAttributes;for(let e=0,i=t.length;e<i;e++)t[e]=0}function m(t){g(t,0)}function g(i,r){const s=l.newAttributes,o=l.enabledAttributes,a=l.attributeDivisors;if(s[i]=1,0===o[i]&&(t.enableVertexAttribArray(i),o[i]=1),a[i]!==r){(n.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](i,r),a[i]=r}}function v(){const e=l.newAttributes,i=l.enabledAttributes;for(let n=0,r=i.length;n<r;n++)i[n]!==e[n]&&(t.disableVertexAttribArray(n),i[n]=0)}function y(e,i,r,s,o,a){!0!==n.isWebGL2||5124!==r&&5125!==r?t.vertexAttribPointer(e,i,r,s,o,a):t.vertexAttribIPointer(e,i,r,o,a)}function x(){w(),u=!0,l!==h&&(l=h,c(l.object))}function w(){h.geometry=null,h.program=null,h.wireframe=!1}return{setup:function(r,h,d,x,w){let b=!1;if(o){const e=function(e,i,r){const o=!0===r.wireframe;let h=a[e.id];void 0===h&&(h={},a[e.id]=h);let l=h[i.id];void 0===l&&(l={},h[i.id]=l);let u=l[o];void 0===u&&(u=p(n.isWebGL2?t.createVertexArray():s.createVertexArrayOES()),l[o]=u);return u}(x,d,h);l!==e&&(l=e,c(l.object)),b=function(t,e,i,n){const r=l.attributes,s=e.attributes;let o=0;const a=i.getAttributes();for(const e in a){if(a[e].location>=0){const i=r[e];let n=s[e];if(void 0===n&&("instanceMatrix"===e&&t.instanceMatrix&&(n=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(n=t.instanceColor)),void 0===i)return!0;if(i.attribute!==n)return!0;if(n&&i.data!==n.data)return!0;o++}}return l.attributesNum!==o||l.index!==n}(r,x,d,w),b&&function(t,e,i,n){const r={},s=e.attributes;let o=0;const a=i.getAttributes();for(const e in a){if(a[e].location>=0){let i=s[e];void 0===i&&("instanceMatrix"===e&&t.instanceMatrix&&(i=t.instanceMatrix),"instanceColor"===e&&t.instanceColor&&(i=t.instanceColor));const n={};n.attribute=i,i&&i.data&&(n.data=i.data),r[e]=n,o++}}l.attributes=r,l.attributesNum=o,l.index=n}(r,x,d,w)}else{const t=!0===h.wireframe;l.geometry===x.id&&l.program===d.id&&l.wireframe===t||(l.geometry=x.id,l.program=d.id,l.wireframe=t,b=!0)}null!==w&&i.update(w,34963),(b||u)&&(u=!1,function(r,s,o,a){if(!1===n.isWebGL2&&(r.isInstancedMesh||a.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;f();const h=a.attributes,l=o.getAttributes(),u=s.defaultAttributeValues;for(const e in l){const n=l[e];if(n.location>=0){let s=h[e];if(void 0===s&&("instanceMatrix"===e&&r.instanceMatrix&&(s=r.instanceMatrix),"instanceColor"===e&&r.instanceColor&&(s=r.instanceColor)),void 0!==s){const e=s.normalized,o=s.itemSize,h=i.get(s);if(void 0===h)continue;const l=h.buffer,u=h.type,c=h.bytesPerElement;if(s.isInterleavedBufferAttribute){const i=s.data,h=i.stride,d=s.offset;if(i.isInstancedInterleavedBuffer){for(let t=0;t<n.locationSize;t++)g(n.location+t,i.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=i.meshPerAttribute*i.count)}else for(let t=0;t<n.locationSize;t++)m(n.location+t);t.bindBuffer(34962,l);for(let t=0;t<n.locationSize;t++)y(n.location+t,o/n.locationSize,u,e,h*c,(d+o/n.locationSize*t)*c)}else{if(s.isInstancedBufferAttribute){for(let t=0;t<n.locationSize;t++)g(n.location+t,s.meshPerAttribute);!0!==r.isInstancedMesh&&void 0===a._maxInstanceCount&&(a._maxInstanceCount=s.meshPerAttribute*s.count)}else for(let t=0;t<n.locationSize;t++)m(n.location+t);t.bindBuffer(34962,l);for(let t=0;t<n.locationSize;t++)y(n.location+t,o/n.locationSize,u,e,o*c,o/n.locationSize*t*c)}}else if(void 0!==u){const i=u[e];if(void 0!==i)switch(i.length){case 2:t.vertexAttrib2fv(n.location,i);break;case 3:t.vertexAttrib3fv(n.location,i);break;case 4:t.vertexAttrib4fv(n.location,i);break;default:t.vertexAttrib1fv(n.location,i)}}}}v()}(r,h,d,x),null!==w&&t.bindBuffer(34963,i.get(w).buffer))},reset:x,resetDefaultState:w,dispose:function(){x();for(const t in a){const e=a[t];for(const t in e){const i=e[t];for(const t in i)d(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)d(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)d(n[t].object),delete n[t];delete i[t.id]}},initAttributes:f,enableAttribute:m,disableUnusedAttributes:v}}function Bs(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;h[l](s,n,o,a),i.update(o,s,a)}}function Is(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&&(o=a);const h=s||e.has("WEBGL_draw_buffers"),l=!0===i.logarithmicDepthBuffer,u=t.getParameter(34930),c=t.getParameter(35660),d=t.getParameter(3379),p=t.getParameter(34076),f=t.getParameter(34921),m=t.getParameter(36347),g=t.getParameter(36348),v=t.getParameter(36349),y=c>0,x=s||e.has("OES_texture_float");return{isWebGL2:s,drawBuffers:h,getMaxAnisotropy:function(){if(void 0!==n)return n;if(!0===e.has("EXT_texture_filter_anisotropic")){const i=e.get("EXT_texture_filter_anisotropic");n=t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else n=0;return n},getMaxPrecision:r,precision:o,logarithmicDepthBuffer:l,maxTextures:u,maxVertexTextures:c,maxTextureSize:d,maxCubemapSize:p,maxAttributes:f,maxVertexUniforms:m,maxVaryings:g,maxFragmentUniforms:v,vertexTextures:y,floatFragmentTextures:x,floatVertexTextures:y&&x,maxSamples:s?t.getParameter(36183):0}}function Fs(t){const e=this;let i=null,n=0,r=!1,s=!1;const o=new As,a=new Pi,h={value:null,needsUpdate:!1};function l(){h.value!==i&&(h.value=i,h.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(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.length<e)&&(l=new Float32Array(e));for(let e=0,i=n;e!==s;++e,i+=4)o.copy(t[e]).applyMatrix4(r,a),o.normal.toArray(l,i),l[i+3]=o.constant}h.value=l,h.needsUpdate=!0}return e.numPlanes=s,e.numIntersection=0,l}this.uniform=h,this.numPlanes=0,this.numIntersection=0,this.init=function(t,e,s){const o=0!==t.length||e||0!==n||r;return r=e,i=u(t,s,0),n=t.length,o},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1,l()},this.setState=function(e,o,a){const c=e.clippingPlanes,d=e.clipIntersection,p=e.clipShadows,f=t.get(e);if(!r||null===c||0===c.length||s&&!p)s?u(null):l();else{const t=s?0:n,e=4*t;let r=f.clippingState||null;h.value=r,r=u(c,o,e,a);for(let t=0;t!==e;++t)r[t]=i[t];f.clippingState=r,this.numIntersection=d?this.numPlanes:0,this.numPlanes+=t}}}function ks(t){let e=new WeakMap;function i(t,e){return e===at?t.mapping=st:e===ht&&(t.mapping=ot),t}function n(t){const i=t.target;i.removeEventListener("dispose",n);const r=e.get(i);void 0!==r&&(e.delete(i),r.dispose())}return{get:function(r){if(r&&r.isTexture&&!1===r.isRenderTargetTexture){const s=r.mapping;if(s===at||s===ht){if(e.has(r)){return i(e.get(r).texture,r.mapping)}{const s=r.image;if(s&&s.height>0){const o=new ys(s.height/2);return o.fromEquirectangularTexture(t,r),e.set(r,o),r.addEventListener("dispose",n),i(o.texture,r.mapping)}return null}}}return r},dispose:function(){e=new WeakMap}}}Ls.physical={uniforms:cs([Ls.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Ci(1,1)},clearcoatNormalMap:{value:null},sheen:{value:0},sheenColor:{value:new Wi(0)},sheenColorMap:{value:null},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},transmission:{value:0},transmissionMap:{value:null},transmissionSamplerSize:{value:new Ci},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},attenuationDistance:{value:0},attenuationColor:{value:new Wi(0)},specularIntensity:{value:1},specularIntensityMap:{value:null},specularColor:{value:new Wi(1,1,1)},specularColorMap:{value:null}}]),vertexShader:Ps.meshphysical_vert,fragmentShader:Ps.meshphysical_frag};class Ns extends fs{constructor(t=-1,e=1,i=1,n=-1,r=.1,s=2e3){super(),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=t,this.right=e,this.top=i,this.bottom=n,this.near=r,this.far=s,this.updateProjectionMatrix()}copy(t,e){return super.copy(t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this}setViewOffset(t,e,i,n,r,s){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(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,n=(this.top+this.bottom)/2;let r=i-t,s=i+t,o=n+e,a=n-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;r+=t*this.view.offsetX,s=r+t*this.view.width,o-=e*this.view.offsetY,a=o-e*this.view.height}this.projectionMatrix.makeOrthographic(r,s,o,a,this.near,this.far),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(t){const e=super.toJSON(t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}Ns.prototype.isOrthographicCamera=!0;const zs=[.125,.215,.35,.446,.526,.582],Us=new Ns,Vs=new Wi;let Hs=null;const Gs=(1+Math.sqrt(5))/2,Ws=1/Gs,Ys=[new on(1,1,1),new on(-1,1,1),new on(1,1,-1),new on(-1,1,-1),new on(0,Gs,Ws),new on(0,Gs,-Ws),new on(Ws,0,Gs),new on(-Ws,0,Gs),new on(Gs,Ws,0),new on(-Gs,Ws,0)];class Xs{constructor(t){this._renderer=t,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(t,e=0,i=.1,n=100){Hs=this._renderer.getRenderTarget(),this._setSize(256);const r=this._allocateTargets();return r.depthBuffer=!0,this._sceneToCubeUV(t,i,n,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r}fromEquirectangular(t,e=null){return this._fromTexture(t,e)}fromCubemap(t,e=null){return this._fromTexture(t,e)}compileCubemapShader(){null===this._cubemapMaterial&&(this._cubemapMaterial=Ks(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){null===this._equirectMaterial&&(this._equirectMaterial=Qs(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),null!==this._cubemapMaterial&&this._cubemapMaterial.dispose(),null!==this._equirectMaterial&&this._equirectMaterial.dispose()}_setSize(t){this._lodMax=Math.floor(Math.log2(t)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){null!==this._blurMaterial&&this._blurMaterial.dispose(),null!==this._pingPongRenderTarget&&this._pingPongRenderTarget.dispose();for(let t=0;t<this._lodPlanes.length;t++)this._lodPlanes[t].dispose()}_cleanup(t){this._renderer.setRenderTarget(Hs),t.scissorTest=!1,qs(t,0,0,t.width,t.height)}_fromTexture(t,e){t.mapping===st||t.mapping===ot?this._setSize(0===t.image.length?16:t.image[0].width||t.image[0].image.width):this._setSize(t.image.width/4),Hs=this._renderer.getRenderTarget();const i=e||this._allocateTargets();return this._textureToCubeUV(t,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){const t=3*Math.max(this._cubeSize,112),e=4*this._cubeSize,i={magFilter:yt,minFilter:yt,generateMipmaps:!1,type:Rt,format:Ft,encoding:Oe,depthBuffer:!1},n=js(t,e,i);if(null===this._pingPongRenderTarget||this._pingPongRenderTarget.width!==t){null!==this._pingPongRenderTarget&&this._dispose(),this._pingPongRenderTarget=js(t,e,i);const{_lodMax:n}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=function(t){const e=[],i=[],n=[];let r=t;const s=t-4+1+zs.length;for(let o=0;o<s;o++){const s=Math.pow(2,r);i.push(s);let a=1/s;o>t-4?a=zs[o-t+4-1]:0===o&&(a=0),n.push(a);const h=1/(s-2),l=-h,u=1+h,c=[l,l,u,l,u,u,l,l,u,u,l,u],d=6,p=6,f=3,m=2,g=1,v=new Float32Array(f*p*d),y=new Float32Array(m*p*d),x=new Float32Array(g*p*d);for(let t=0;t<d;t++){const e=t%3*2/3-1,i=t>2?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];v.set(n,f*p*t),y.set(c,m*p*t);const r=[t,t,t,t,t,t];x.set(r,g*p*t)}const w=new Gr;w.setAttribute("position",new Er(v,f)),w.setAttribute("uv",new Er(y,m)),w.setAttribute("faceIndex",new Er(x,g)),e.push(w),r>4&&r--}return{lodPlanes:e,sizeLods:i,sigmas:n}}(n)),this._blurMaterial=function(t,e,i){const n=new Float32Array(20),r=new on(0,1,0);return new ps({name:"SphericalGaussianBlur",defines:{n:20,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/i,CUBEUV_MAX_MIP:t+".0"},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:r}},vertexShader:Js(),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#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t",blending:x,depthTest:!1,depthWrite:!1})}(n,t,e)}return n}_compileMaterial(t){const e=new as(this._lodPlanes[0],t);this._renderer.compile(e,Us)}_sceneToCubeUV(t,e,i,n){const r=new ms(90,1,e,i),s=[1,-1,1,1,1,1],o=[1,1,1,-1,-1,-1],a=this._renderer,h=a.autoClear,l=a.toneMapping;a.getClearColor(Vs),a.toneMapping=Z,a.autoClear=!1;const u=new Ar({name:"PMREM.Background",side:m,depthWrite:!1,depthTest:!1}),c=new as(new ls,u);let d=!1;const p=t.background;p?p.isColor&&(u.color.copy(p),t.background=null,d=!0):(u.color.copy(Vs),d=!0);for(let e=0;e<6;e++){const i=e%3;0===i?(r.up.set(0,s[e],0),r.lookAt(o[e],0,0)):1===i?(r.up.set(0,0,s[e]),r.lookAt(0,o[e],0)):(r.up.set(0,s[e],0),r.lookAt(0,0,o[e]));const h=this._cubeSize;qs(n,i*h,e>2?h:0,h,h),a.setRenderTarget(n),d&&a.render(c,r),a.render(t,r)}c.geometry.dispose(),c.material.dispose(),a.toneMapping=l,a.autoClear=h,t.background=p}_textureToCubeUV(t,e){const i=this._renderer,n=t.mapping===st||t.mapping===ot;n?(null===this._cubemapMaterial&&(this._cubemapMaterial=Ks()),this._cubemapMaterial.uniforms.flipEnvMap.value=!1===t.isRenderTargetTexture?-1:1):null===this._equirectMaterial&&(this._equirectMaterial=Qs());const r=n?this._cubemapMaterial:this._equirectMaterial,s=new as(this._lodPlanes[0],r);r.uniforms.envMap.value=t;const o=this._cubeSize;qs(e,0,0,3*o,2*o),i.setRenderTarget(e),i.render(s,Us)}_applyPMREM(t){const e=this._renderer,i=e.autoClear;e.autoClear=!1;for(let e=1;e<this._lodPlanes.length;e++){const i=Math.sqrt(this._sigmas[e]*this._sigmas[e]-this._sigmas[e-1]*this._sigmas[e-1]),n=Ys[(e-1)%Ys.length];this._blur(t,e-1,e,i,n)}e.autoClear=i}_blur(t,e,i,n,r){const s=this._pingPongRenderTarget;this._halfBlur(t,s,e,i,n,"latitudinal",r),this._halfBlur(s,t,i,i,n,"longitudinal",r)}_halfBlur(t,e,i,n,r,s,o){const a=this._renderer,h=this._blurMaterial,l=new as(this._lodPlanes[n],h),u=h.uniforms,c=this._sizeLods[i]-1,d=isFinite(r)?Math.PI/(2*c):2*Math.PI/39,p=r/d,f=isFinite(r)?1+Math.floor(3*p):20,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:t<f&&(g+=2*i)}for(let t=0;t<m.length;t++)m[t]=m[t]/g;u.envMap.value=t.texture,u.samples.value=f,u.weights.value=m,u.latitudinal.value="latitudinal"===s,o&&(u.poleAxis.value=o);const{_lodMax:v}=this;u.dTheta.value=d,u.mipInt.value=v-i;const y=this._sizeLods[n];qs(e,3*y*(n>v-4?n-v+4:0),4*(this._cubeSize-y),3*y,2*y),a.setRenderTarget(e),a.render(l,Us)}}function js(t,e,i){const n=new Zi(t,e,i);return n.texture.mapping=lt,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function qs(t,e,i,n,r){t.viewport.set(e,i,n,r),t.scissor.set(e,i,n,r)}function Qs(){return new ps({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:Js(),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\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tgl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );\n\n\t\t\t}\n\t\t",blending:x,depthTest:!1,depthWrite:!1})}function Ks(){return new ps({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:Js(),fragmentShader:"\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tuniform float flipEnvMap;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );\n\n\t\t\t}\n\t\t",blending:x,depthTest:!1,depthWrite:!1})}function Js(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\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 Zs(t){let e=new WeakMap,i=null;function n(t){const i=t.target;i.removeEventListener("dispose",n);const r=e.get(i);void 0!==r&&(e.delete(i),r.dispose())}return{get:function(r){if(r&&r.isTexture){const s=r.mapping,o=s===at||s===ht,a=s===st||s===ot;if(o||a){if(r.isRenderTargetTexture&&!0===r.needsPMREMUpdate){r.needsPMREMUpdate=!1;let n=e.get(r);return null===i&&(i=new Xs(t)),n=o?i.fromEquirectangular(r,n):i.fromCubemap(r,n),e.set(r,n),n.texture}if(e.has(r))return e.get(r).texture;{const s=r.image;if(o&&s&&s.height>0||a&&s&&function(t){let e=0;for(let i=0;i<6;i++)void 0!==t[i]&&e++;return 6===e}(s)){null===i&&(i=new Xs(t));const s=o?i.fromEquirectangular(r):i.fromCubemap(r);return e.set(r,s),r.addEventListener("dispose",n),s.texture}return null}}}return r},dispose:function(){e=new WeakMap,null!==i&&(i.dispose(),i=null)}}}function $s(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"),i("WEBGL_multisampled_render_to_texture")},get:function(t){const e=i(t);return e}}}function to(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;e<n;e+=3){const n=t[e+0],r=t[e+1],s=t[e+2];i.push(n,r,r,s,s,n)}}else{const t=r.array;o=r.version;for(let e=0,n=t.length/3-1;e<n;e+=3){const t=e+0,n=e+1,r=e+2;i.push(t,n,n,r,r,t)}}const a=new(Ri(i)?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;t<n;t++)e.update(i[t],34962)}},getWireframeAttribute:function(t){const e=s.get(t);if(e){const i=t.index;null!==i&&e.version<i.version&&a(t)}else a(t);return s.get(t)}}}function eo(t,e,i,n){const r=n.isWebGL2;let s,o,a;this.setMode=function(t){s=t},this.setIndex=function(t){o=t.type,a=t.bytesPerElement},this.render=function(e,n){t.drawElements(s,n,o,e*a),i.update(n,s,1)},this.renderInstances=function(n,h,l){if(0===l)return;let u,c;if(r)u=t,c="drawElementsInstanced";else if(u=e.get("ANGLE_instanced_arrays"),c="drawElementsInstancedANGLE",null===u)return;u[c](s,h,o,n*a,l),i.update(h,s,l)}}function io(t){const e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(t,i,n){switch(e.calls++,i){case 4:e.triangles+=n*(t/3);break;case 1:e.lines+=n*(t/2);break;case 3:e.lines+=n*(t-1);break;case 2:e.lines+=n*t;break;case 0:e.points+=n*t}}}}function no(t,e){return t[0]-e[0]}function ro(t,e){return Math.abs(e[1])-Math.abs(t[1])}function so(t,e){let i=1;const n=e.isInterleavedBufferAttribute?e.data.array:e.array;n instanceof Int8Array?i=127:n instanceof Int16Array?i=32767:n instanceof Int32Array&&(i=2147483647),t.divideScalar(i)}function oo(t,e,i){const n={},r=new Float32Array(8),s=new WeakMap,o=new Ji,a=[];for(let t=0;t<8;t++)a[t]=[t,0];return{update:function(h,l,u,c){const d=h.morphTargetInfluences;if(!0===e.isWebGL2){const n=l.morphAttributes.position||l.morphAttributes.normal||l.morphAttributes.color,r=void 0!==n?n.length:0;let a=s.get(l);if(void 0===a||a.count!==r){void 0!==a&&a.texture.dispose();const t=void 0!==l.morphAttributes.position,i=void 0!==l.morphAttributes.normal,n=void 0!==l.morphAttributes.color,h=l.morphAttributes.position||[],u=l.morphAttributes.normal||[],c=l.morphAttributes.color||[];let d=0;!0===t&&(d=1),!0===i&&(d=2),!0===n&&(d=3);let p=l.attributes.position.count*d,f=1;p>e.maxTextureSize&&(f=Math.ceil(p/e.maxTextureSize),p=e.maxTextureSize);const m=new Float32Array(p*f*4*r),g=new $i(m,p,f,r);g.type=Pt,g.needsUpdate=!0;const v=4*d;for(let e=0;e<r;e++){const r=h[e],s=u[e],a=c[e],l=p*f*4*e;for(let e=0;e<r.count;e++){const h=e*v;!0===t&&(o.fromBufferAttribute(r,e),!0===r.normalized&&so(o,r),m[l+h+0]=o.x,m[l+h+1]=o.y,m[l+h+2]=o.z,m[l+h+3]=0),!0===i&&(o.fromBufferAttribute(s,e),!0===s.normalized&&so(o,s),m[l+h+4]=o.x,m[l+h+5]=o.y,m[l+h+6]=o.z,m[l+h+7]=0),!0===n&&(o.fromBufferAttribute(a,e),!0===a.normalized&&so(o,a),m[l+h+8]=o.x,m[l+h+9]=o.y,m[l+h+10]=o.z,m[l+h+11]=4===a.itemSize?o.w:1)}}a={count:r,texture:g,size:new Ci(p,f)},s.set(l,a),l.addEventListener("dispose",(function t(){g.dispose(),s.delete(l),l.removeEventListener("dispose",t)}))}let h=0;for(let t=0;t<d.length;t++)h+=d[t];const u=l.morphTargetsRelative?1:1-h;c.getUniforms().setValue(t,"morphTargetBaseInfluence",u),c.getUniforms().setValue(t,"morphTargetInfluences",d),c.getUniforms().setValue(t,"morphTargetsTexture",a.texture,i),c.getUniforms().setValue(t,"morphTargetsTextureSize",a.size)}else{const e=void 0===d?0:d.length;let i=n[l.id];if(void 0===i||i.length!==e){i=[];for(let t=0;t<e;t++)i[t]=[t,0];n[l.id]=i}for(let t=0;t<e;t++){const e=i[t];e[0]=t,e[1]=d[t]}i.sort(ro);for(let t=0;t<8;t++)t<e&&i[t][1]?(a[t][0]=i[t][0],a[t][1]=i[t][1]):(a[t][0]=Number.MAX_SAFE_INTEGER,a[t][1]=0);a.sort(no);const s=l.morphAttributes.position,o=l.morphAttributes.normal;let h=0;for(let t=0;t<8;t++){const e=a[t],i=e[0],n=e[1];i!==Number.MAX_SAFE_INTEGER&&n?(s&&l.getAttribute("morphTarget"+t)!==s[i]&&l.setAttribute("morphTarget"+t,s[i]),o&&l.getAttribute("morphNormal"+t)!==o[i]&&l.setAttribute("morphNormal"+t,o[i]),r[t]=n,h+=n):(s&&!0===l.hasAttribute("morphTarget"+t)&&l.deleteAttribute("morphTarget"+t),o&&!0===l.hasAttribute("morphNormal"+t)&&l.deleteAttribute("morphNormal"+t),r[t]=0)}const u=l.morphTargetsRelative?1:1-h;c.getUniforms().setValue(t,"morphTargetBaseInfluence",u),c.getUniforms().setValue(t,"morphTargetInfluences",r)}}}}function ao(t,e,i,n){let r=new WeakMap;function s(t){const e=t.target;e.removeEventListener("dispose",s),i.remove(e.instanceMatrix),null!==e.instanceColor&&i.remove(e.instanceColor)}return{update:function(t){const o=n.render.frame,a=t.geometry,h=e.get(t,a);return r.get(h)!==o&&(e.update(h),r.set(h,o)),t.isInstancedMesh&&(!1===t.hasEventListener("dispose",s)&&t.addEventListener("dispose",s),i.update(t.instanceMatrix,34962),null!==t.instanceColor&&i.update(t.instanceColor,34962)),h},dispose:function(){r=new WeakMap}}}const ho=new Ki,lo=new $i,uo=new en,co=new vs,po=[],fo=[],mo=new Float32Array(16),go=new Float32Array(9),vo=new Float32Array(4);function yo(t,e,i){const n=t[0];if(n<=0||n>0)return t;const r=e*i;let s=po[r];if(void 0===s&&(s=new Float32Array(r),po[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 xo(t,e){if(t.length!==e.length)return!1;for(let i=0,n=t.length;i<n;i++)if(t[i]!==e[i])return!1;return!0}function wo(t,e){for(let i=0,n=e.length;i<n;i++)t[i]=e[i]}function bo(t,e){let i=fo[e];void 0===i&&(i=new Int32Array(e),fo[e]=i);for(let n=0;n!==e;++n)i[n]=t.allocateTextureUnit();return i}function Ao(t,e){const i=this.cache;i[0]!==e&&(t.uniform1f(this.addr,e),i[0]=e)}function To(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),i[0]=e.x,i[1]=e.y);else{if(xo(i,e))return;t.uniform2fv(this.addr,e),wo(i,e)}}function So(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),i[0]=e.x,i[1]=e.y,i[2]=e.z);else if(void 0!==e.r)i[0]===e.r&&i[1]===e.g&&i[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),i[0]=e.r,i[1]=e.g,i[2]=e.b);else{if(xo(i,e))return;t.uniform3fv(this.addr,e),wo(i,e)}}function Eo(t,e){const i=this.cache;if(void 0!==e.x)i[0]===e.x&&i[1]===e.y&&i[2]===e.z&&i[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),i[0]=e.x,i[1]=e.y,i[2]=e.z,i[3]=e.w);else{if(xo(i,e))return;t.uniform4fv(this.addr,e),wo(i,e)}}function Mo(t,e){const i=this.cache,n=e.elements;if(void 0===n){if(xo(i,e))return;t.uniformMatrix2fv(this.addr,!1,e),wo(i,e)}else{if(xo(i,n))return;vo.set(n),t.uniformMatrix2fv(this.addr,!1,vo),wo(i,n)}}function _o(t,e){const i=this.cache,n=e.elements;if(void 0===n){if(xo(i,e))return;t.uniformMatrix3fv(this.addr,!1,e),wo(i,e)}else{if(xo(i,n))return;go.set(n),t.uniformMatrix3fv(this.addr,!1,go),wo(i,n)}}function Co(t,e){const i=this.cache,n=e.elements;if(void 0===n){if(xo(i,e))return;t.uniformMatrix4fv(this.addr,!1,e),wo(i,e)}else{if(xo(i,n))return;mo.set(n),t.uniformMatrix4fv(this.addr,!1,mo),wo(i,n)}}function Po(t,e){const i=this.cache;i[0]!==e&&(t.uniform1i(this.addr,e),i[0]=e)}function Ro(t,e){const i=this.cache;xo(i,e)||(t.uniform2iv(this.addr,e),wo(i,e))}function Lo(t,e){const i=this.cache;xo(i,e)||(t.uniform3iv(this.addr,e),wo(i,e))}function Oo(t,e){const i=this.cache;xo(i,e)||(t.uniform4iv(this.addr,e),wo(i,e))}function Do(t,e){const i=this.cache;i[0]!==e&&(t.uniform1ui(this.addr,e),i[0]=e)}function Bo(t,e){const i=this.cache;xo(i,e)||(t.uniform2uiv(this.addr,e),wo(i,e))}function Io(t,e){const i=this.cache;xo(i,e)||(t.uniform3uiv(this.addr,e),wo(i,e))}function Fo(t,e){const i=this.cache;xo(i,e)||(t.uniform4uiv(this.addr,e),wo(i,e))}function ko(t,e,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTexture2D(e||ho,r)}function No(t,e,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTexture3D(e||uo,r)}function zo(t,e,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTextureCube(e||co,r)}function Uo(t,e,i){const n=this.cache,r=i.allocateTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTexture2DArray(e||lo,r)}function Vo(t,e){t.uniform1fv(this.addr,e)}function Ho(t,e){const i=yo(e,this.size,2);t.uniform2fv(this.addr,i)}function Go(t,e){const i=yo(e,this.size,3);t.uniform3fv(this.addr,i)}function Wo(t,e){const i=yo(e,this.size,4);t.uniform4fv(this.addr,i)}function Yo(t,e){const i=yo(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,i)}function Xo(t,e){const i=yo(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,i)}function jo(t,e){const i=yo(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,i)}function qo(t,e){t.uniform1iv(this.addr,e)}function Qo(t,e){t.uniform2iv(this.addr,e)}function Ko(t,e){t.uniform3iv(this.addr,e)}function Jo(t,e){t.uniform4iv(this.addr,e)}function Zo(t,e){t.uniform1uiv(this.addr,e)}function $o(t,e){t.uniform2uiv(this.addr,e)}function ta(t,e){t.uniform3uiv(this.addr,e)}function ea(t,e){t.uniform4uiv(this.addr,e)}function ia(t,e,i){const n=e.length,r=bo(i,n);t.uniform1iv(this.addr,r);for(let t=0;t!==n;++t)i.setTexture2D(e[t]||ho,r[t])}function na(t,e,i){const n=e.length,r=bo(i,n);t.uniform1iv(this.addr,r);for(let t=0;t!==n;++t)i.setTexture3D(e[t]||uo,r[t])}function ra(t,e,i){const n=e.length,r=bo(i,n);t.uniform1iv(this.addr,r);for(let t=0;t!==n;++t)i.setTextureCube(e[t]||co,r[t])}function sa(t,e,i){const n=e.length,r=bo(i,n);t.uniform1iv(this.addr,r);for(let t=0;t!==n;++t)i.setTexture2DArray(e[t]||lo,r[t])}function oa(t,e,i){this.id=t,this.addr=i,this.cache=[],this.setValue=function(t){switch(t){case 5126:return Ao;case 35664:return To;case 35665:return So;case 35666:return Eo;case 35674:return Mo;case 35675:return _o;case 35676:return Co;case 5124:case 35670:return Po;case 35667:case 35671:return Ro;case 35668:case 35672:return Lo;case 35669:case 35673:return Oo;case 5125:return Do;case 36294:return Bo;case 36295:return Io;case 36296:return Fo;case 35678:case 36198:case 36298:case 36306:case 35682:return ko;case 35679:case 36299:case 36307:return No;case 35680:case 36300:case 36308:case 36293:return zo;case 36289:case 36303:case 36311:case 36292:return Uo}}(e.type)}function aa(t,e,i){this.id=t,this.addr=i,this.cache=[],this.size=e.size,this.setValue=function(t){switch(t){case 5126:return Vo;case 35664:return Ho;case 35665:return Go;case 35666:return Wo;case 35674:return Yo;case 35675:return Xo;case 35676:return jo;case 5124:case 35670:return qo;case 35667:case 35671:return Qo;case 35668:case 35672:return Ko;case 35669:case 35673:return Jo;case 5125:return Zo;case 36294:return $o;case 36295:return ta;case 36296:return ea;case 35678:case 36198:case 36298:case 36306:case 35682:return ia;case 35679:case 36299:case 36307:return na;case 35680:case 36300:case 36308:case 36293:return ra;case 36289:case 36303:case 36311:case 36292:return sa}}(e.type)}function ha(t){this.id=t,this.seq=[],this.map={}}ha.prototype.setValue=function(t,e,i){const n=this.seq;for(let r=0,s=n.length;r!==s;++r){const s=n[r];s.setValue(t,e[s.id],i)}};const la=/(\w+)(\])?(\[|\.)?/g;function ua(t,e){t.seq.push(e),t.map[e.id]=e}function ca(t,e,i){const n=t.name,r=n.length;for(la.lastIndex=0;;){const s=la.exec(n),o=la.lastIndex;let a=s[1];const h="]"===s[2],l=s[3];if(h&&(a|=0),void 0===l||"["===l&&o+2===r){ua(i,void 0===l?new oa(a,t,e):new aa(a,t,e));break}{let t=i.map[a];void 0===t&&(t=new ha(a),ua(i,t)),i=t}}}function da(t,e){this.seq=[],this.map={};const i=t.getProgramParameter(e,35718);for(let n=0;n<i;++n){const i=t.getActiveUniform(e,n);ca(i,t.getUniformLocation(e,i.name),this)}}function pa(t,e,i){const n=t.createShader(e);return t.shaderSource(n,i),t.compileShader(n),n}da.prototype.setValue=function(t,e,i,n){const r=this.map[e];void 0!==r&&r.setValue(t,i,n)},da.prototype.setOptional=function(t,e,i){const n=e[i];void 0!==n&&this.setValue(t,i,n)},da.upload=function(t,e,i,n){for(let r=0,s=e.length;r!==s;++r){const s=e[r],o=i[s.id];!1!==o.needsUpdate&&s.setValue(t,o.value,n)}},da.seqWithValue=function(t,e){const i=[];for(let n=0,r=t.length;n!==r;++n){const r=t[n];r.id in e&&i.push(r)}return i};let fa=0;function ma(t,e,i){const n=t.getShaderParameter(e,35713),r=t.getShaderInfoLog(e).trim();if(n&&""===r)return"";const s=/ERROR: 0:(\d+)/.exec(r);if(s){const n=parseInt(s[0]);return i.toUpperCase()+"\n\n"+r+"\n\n"+function(t,e){const i=t.split("\n"),n=[],r=Math.max(e-6,0),s=Math.min(e+6,i.length);for(let t=r;t<s;t++)n.push(t+1+": "+i[t]);return n.join("\n")}(t.getShaderSource(e),n)}return r}function ga(t,e){const i=function(t){switch(t){case Oe:return["Linear","( value )"];case De:return["sRGB","( value )"];default:return["Linear","( value )"]}}(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+i[0]+i[1]+"; }"}function va(t,e){let i;switch(e){case $:i="Linear";break;case tt:i="Reinhard";break;case et:i="OptimizedCineon";break;case it:i="ACESFilmic";break;case nt:i="Custom";break;default:i="Linear"}return"vec3 "+t+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function ya(t){return""!==t}function xa(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function wa(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const ba=/^[ \t]*#include +<([\w\d./]+)>/gm;function Aa(t){return t.replace(ba,Ta)}function Ta(t,e){const i=Ps[e];if(void 0===i)throw new Error("Can not resolve #include <"+e+">");return Aa(i)}const Sa=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Ea=/#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 Ma(t){return t.replace(Ea,Ca).replace(Sa,_a)}function _a(t,e,i,n){return Ca(t,e,i,n)}function Ca(t,e,i,n){let r="";for(let t=parseInt(e);t<parseInt(i);t++)r+=n.replace(/\[\s*i\s*\]/g,"[ "+t+" ]").replace(/UNROLLED_LOOP_INDEX/g,t);return r}function Pa(t){let e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function Ra(t,e,i,n){const r=t.getContext(),s=i.defines;let o=i.vertexShader,a=i.fragmentShader;const h=function(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===c?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===d?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===p&&(e="SHADOWMAP_TYPE_VSM"),e}(i),l=function(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case st:case ot:e="ENVMAP_TYPE_CUBE";break;case lt:e="ENVMAP_TYPE_CUBE_UV"}return e}(i),u=function(t){let e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case ot:e="ENVMAP_MODE_REFRACTION"}return e}(i),f=function(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case Q:e="ENVMAP_BLENDING_MULTIPLY";break;case K:e="ENVMAP_BLENDING_MIX";break;case J:e="ENVMAP_BLENDING_ADD"}return e}(i),m=function(t){const e=t.envMapCubeUVHeight;if(null===e)return null;const i=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,i),112)),texelHeight:n,maxMip:i}}(i),g=i.isWebGL2?"":function(t){return[t.extensionDerivatives||t.envMapCubeUVHeight||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.transmission)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(ya).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,w,b=i.glslVersion?"#version "+i.glslVersion+"\n":"";i.isRawShaderMaterial?(x=[v].filter(ya).join("\n"),x.length>0&&(x+="\n"),w=[g,v].filter(ya).join("\n"),w.length>0&&(w+="\n")):(x=[Pa(i),"#define SHADER_NAME "+i.shaderName,v,i.instancing?"#define USE_INSTANCING":"",i.instancingColor?"#define USE_INSTANCING_COLOR":"",i.supportsVertexTextures?"#define VERTEX_TEXTURES":"",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 "+u:"",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.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularColorMap?"#define USE_SPECULARCOLORMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.sheenColorMap?"#define USE_SHEENCOLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",i.vertexUvs?"#define USE_UV":"",i.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",i.flatShading?"#define FLAT_SHADED":"",i.skinning?"#define USE_SKINNING":"",i.morphTargets?"#define USE_MORPHTARGETS":"",i.morphNormals&&!1===i.flatShading?"#define USE_MORPHNORMALS":"",i.morphColors&&i.isWebGL2?"#define USE_MORPHCOLORS":"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+i.morphTextureStride:"",i.morphTargetsCount>0&&i.isWebGL2?"#define MORPHTARGETS_COUNT "+i.morphTargetsCount:"",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","#if defined( USE_COLOR_ALPHA )","\tattribute vec4 color;","#elif defined( USE_COLOR )","\tattribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )","\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(ya).join("\n"),w=[g,Pa(i),"#define SHADER_NAME "+i.shaderName,v,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 "+u:"",i.envMap?"#define "+f:"",m?"#define CUBEUV_TEXEL_WIDTH "+m.texelWidth:"",m?"#define CUBEUV_TEXEL_HEIGHT "+m.texelHeight:"",m?"#define CUBEUV_MAX_MIP "+m.maxMip+".0":"",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.clearcoat?"#define USE_CLEARCOAT":"",i.clearcoatMap?"#define USE_CLEARCOATMAP":"",i.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",i.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",i.specularMap?"#define USE_SPECULARMAP":"",i.specularIntensityMap?"#define USE_SPECULARINTENSITYMAP":"",i.specularColorMap?"#define USE_SPECULARCOLORMAP":"",i.roughnessMap?"#define USE_ROUGHNESSMAP":"",i.metalnessMap?"#define USE_METALNESSMAP":"",i.alphaMap?"#define USE_ALPHAMAP":"",i.alphaTest?"#define USE_ALPHATEST":"",i.sheen?"#define USE_SHEEN":"",i.sheenColorMap?"#define USE_SHEENCOLORMAP":"",i.sheenRoughnessMap?"#define USE_SHEENROUGHNESSMAP":"",i.transmission?"#define USE_TRANSMISSION":"",i.transmissionMap?"#define USE_TRANSMISSIONMAP":"",i.thicknessMap?"#define USE_THICKNESSMAP":"",i.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",i.vertexTangents?"#define USE_TANGENT":"",i.vertexColors||i.instancingColor?"#define USE_COLOR":"",i.vertexAlphas?"#define USE_COLOR_ALPHA":"",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":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",i.toneMapping!==Z?"#define TONE_MAPPING":"",i.toneMapping!==Z?Ps.tonemapping_pars_fragment:"",i.toneMapping!==Z?va("toneMapping",i.toneMapping):"",i.dithering?"#define DITHERING":"",i.opaque?"#define OPAQUE":"",Ps.encodings_pars_fragment,ga("linearToOutputTexel",i.outputEncoding),i.useDepthPacking?"#define DEPTH_PACKING "+i.depthPacking:"","\n"].filter(ya).join("\n")),o=Aa(o),o=xa(o,i),o=wa(o,i),a=Aa(a),a=xa(a,i),a=wa(a,i),o=Ma(o),a=Ma(a),i.isWebGL2&&!0!==i.isRawShaderMaterial&&(b="#version 300 es\n",x=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+x,w=["#define varying in",i.glslVersion===pi?"":"layout(location = 0) out highp vec4 pc_fragColor;",i.glslVersion===pi?"":"#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"+w);const A=b+w+a,T=pa(r,35633,b+x+o),S=pa(r,35632,A);if(r.attachShader(y,T),r.attachShader(y,S),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(T).trim(),i=r.getShaderInfoLog(S).trim();let n=!0,s=!0;if(!1===r.getProgramParameter(y,35714)){n=!1;ma(r,T,"vertex"),ma(r,S,"fragment")}else""!==t||""!==e&&""!==i||(s=!1);s&&(this.diagnostics={runnable:n,programLog:t,vertexShader:{log:e,prefix:x},fragmentShader:{log:i,prefix:w}})}let E,M;return r.deleteShader(T),r.deleteShader(S),this.getUniforms=function(){return void 0===E&&(E=new da(r,y)),E},this.getAttributes=function(){return void 0===M&&(M=function(t,e){const i={},n=t.getProgramParameter(e,35721);for(let r=0;r<n;r++){const n=t.getActiveAttrib(e,r),s=n.name;let o=1;35674===n.type&&(o=2),35675===n.type&&(o=3),35676===n.type&&(o=4),i[s]={type:n.type,location:t.getAttribLocation(e,s),locationSize:o}}return i}(r,y)),M},this.destroy=function(){n.releaseStatesOfProgram(this),r.deleteProgram(y),this.program=void 0},this.name=i.shaderName,this.id=fa++,this.cacheKey=e,this.usedTimes=1,this.program=y,this.vertexShader=T,this.fragmentShader=S,this}let La=0;class Oa{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(t){const e=t.vertexShader,i=t.fragmentShader,n=this._getShaderStage(e),r=this._getShaderStage(i),s=this._getShaderCacheForMaterial(t);return!1===s.has(n)&&(s.add(n),n.usedTimes++),!1===s.has(r)&&(s.add(r),r.usedTimes++),this}remove(t){const e=this.materialCache.get(t);for(const t of e)t.usedTimes--,0===t.usedTimes&&this.shaderCache.delete(t.code);return this.materialCache.delete(t),this}getVertexShaderID(t){return this._getShaderStage(t.vertexShader).id}getFragmentShaderID(t){return this._getShaderStage(t.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(t){const e=this.materialCache;return!1===e.has(t)&&e.set(t,new Set),e.get(t)}_getShaderStage(t){const e=this.shaderCache;if(!1===e.has(t)){const i=new Da(t);e.set(t,i)}return e.get(t)}}class Da{constructor(t){this.id=La++,this.code=t,this.usedTimes=0}}function Ba(t,e,i,n,r,s,o){const a=new qn,h=new Oa,l=[],u=r.isWebGL2,c=r.logarithmicDepthBuffer,d=r.vertexTextures;let p=r.precision;const f={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};return{getParameters:function(s,a,l,v,y){const x=v.fog,b=y.geometry,A=s.isMeshStandardMaterial?v.environment:null,T=(s.isMeshStandardMaterial?i:e).get(s.envMap||A),S=T&&T.mapping===lt?T.image.height:null,E=f[s.type];null!==s.precision&&(p=r.getMaxPrecision(s.precision),s.precision);const M=b.morphAttributes.position||b.morphAttributes.normal||b.morphAttributes.color,_=void 0!==M?M.length:0;let C,P,R,L,O=0;if(void 0!==b.morphAttributes.position&&(O=1),void 0!==b.morphAttributes.normal&&(O=2),void 0!==b.morphAttributes.color&&(O=3),E){const t=Ls[E];C=t.vertexShader,P=t.fragmentShader}else C=s.vertexShader,P=s.fragmentShader,h.update(s),R=h.getVertexShaderID(s),L=h.getFragmentShaderID(s);const D=t.getRenderTarget(),B=s.alphaTest>0,I=s.clearcoat>0;return{isWebGL2:u,shaderID:E,shaderName:s.type,vertexShader:C,fragmentShader:P,defines:s.defines,customVertexShaderID:R,customFragmentShaderID:L,isRawShaderMaterial:!0===s.isRawShaderMaterial,glslVersion:s.glslVersion,precision:p,instancing:!0===y.isInstancedMesh,instancingColor:!0===y.isInstancedMesh&&null!==y.instanceColor,supportsVertexTextures:d,outputEncoding:null===D?t.outputEncoding:!0===D.isXRRenderTarget?D.texture.encoding:Oe,map:!!s.map,matcap:!!s.matcap,envMap:!!T,envMapMode:T&&T.mapping,envMapCubeUVHeight:S,lightMap:!!s.lightMap,aoMap:!!s.aoMap,emissiveMap:!!s.emissiveMap,bumpMap:!!s.bumpMap,normalMap:!!s.normalMap,objectSpaceNormalMap:s.normalMapType===ke,tangentSpaceNormalMap:s.normalMapType===Fe,decodeVideoTexture:!!s.map&&!0===s.map.isVideoTexture&&s.map.encoding===De,clearcoat:I,clearcoatMap:I&&!!s.clearcoatMap,clearcoatRoughnessMap:I&&!!s.clearcoatRoughnessMap,clearcoatNormalMap:I&&!!s.clearcoatNormalMap,displacementMap:!!s.displacementMap,roughnessMap:!!s.roughnessMap,metalnessMap:!!s.metalnessMap,specularMap:!!s.specularMap,specularIntensityMap:!!s.specularIntensityMap,specularColorMap:!!s.specularColorMap,opaque:!1===s.transparent&&s.blending===w,alphaMap:!!s.alphaMap,alphaTest:B,gradientMap:!!s.gradientMap,sheen:s.sheen>0,sheenColorMap:!!s.sheenColorMap,sheenRoughnessMap:!!s.sheenRoughnessMap,transmission:s.transmission>0,transmissionMap:!!s.transmissionMap,thicknessMap:!!s.thicknessMap,combine:s.combine,vertexTangents:!!s.normalMap&&!!b.attributes.tangent,vertexColors:s.vertexColors,vertexAlphas:!0===s.vertexColors&&!!b.attributes.color&&4===b.attributes.color.itemSize,vertexUvs:!!(s.map||s.bumpMap||s.normalMap||s.specularMap||s.alphaMap||s.emissiveMap||s.roughnessMap||s.metalnessMap||s.clearcoatMap||s.clearcoatRoughnessMap||s.clearcoatNormalMap||s.displacementMap||s.transmissionMap||s.thicknessMap||s.specularIntensityMap||s.specularColorMap||s.sheenColorMap||s.sheenRoughnessMap),uvsVertexOnly:!(s.map||s.bumpMap||s.normalMap||s.specularMap||s.alphaMap||s.emissiveMap||s.roughnessMap||s.metalnessMap||s.clearcoatNormalMap||s.transmission>0||s.transmissionMap||s.thicknessMap||s.specularIntensityMap||s.specularColorMap||s.sheen>0||s.sheenColorMap||s.sheenRoughnessMap||!s.displacementMap),fog:!!x,useFog:!0===s.fog,fogExp2:x&&x.isFogExp2,flatShading:!!s.flatShading,sizeAttenuation:s.sizeAttenuation,logarithmicDepthBuffer:c,skinning:!0===y.isSkinnedMesh,morphTargets:void 0!==b.morphAttributes.position,morphNormals:void 0!==b.morphAttributes.normal,morphColors:void 0!==b.morphAttributes.color,morphTargetsCount:_,morphTextureStride:O,numDirLights:a.directional.length,numPointLights:a.point.length,numSpotLights:a.spot.length,numRectAreaLights:a.rectArea.length,numHemiLights:a.hemi.length,numDirLightShadows:a.directionalShadowMap.length,numPointLightShadows:a.pointShadowMap.length,numSpotLightShadows:a.spotShadowMap.length,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:s.dithering,shadowMapEnabled:t.shadowMap.enabled&&l.length>0,shadowMapType:t.shadowMap.type,toneMapping:s.toneMapped?t.toneMapping:Z,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:s.premultipliedAlpha,doubleSided:s.side===g,flipSided:s.side===m,useDepthPacking:!!s.depthPacking,depthPacking:s.depthPacking||0,index0AttributeName:s.index0AttributeName,extensionDerivatives:s.extensions&&s.extensions.derivatives,extensionFragDepth:s.extensions&&s.extensions.fragDepth,extensionDrawBuffers:s.extensions&&s.extensions.drawBuffers,extensionShaderTextureLOD:s.extensions&&s.extensions.shaderTextureLOD,rendererExtensionFragDepth:u||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||n.has("EXT_shader_texture_lod"),customProgramCacheKey:s.customProgramCacheKey()}},getProgramCacheKey:function(e){const i=[];if(e.shaderID?i.push(e.shaderID):(i.push(e.customVertexShaderID),i.push(e.customFragmentShaderID)),void 0!==e.defines)for(const t in e.defines)i.push(t),i.push(e.defines[t]);return!1===e.isRawShaderMaterial&&(!function(t,e){t.push(e.precision),t.push(e.outputEncoding),t.push(e.envMapMode),t.push(e.envMapCubeUVHeight),t.push(e.combine),t.push(e.vertexUvs),t.push(e.fogExp2),t.push(e.sizeAttenuation),t.push(e.morphTargetsCount),t.push(e.morphAttributeCount),t.push(e.numDirLights),t.push(e.numPointLights),t.push(e.numSpotLights),t.push(e.numHemiLights),t.push(e.numRectAreaLights),t.push(e.numDirLightShadows),t.push(e.numPointLightShadows),t.push(e.numSpotLightShadows),t.push(e.shadowMapType),t.push(e.toneMapping),t.push(e.numClippingPlanes),t.push(e.numClipIntersection),t.push(e.depthPacking)}(i,e),function(t,e){a.disableAll(),e.isWebGL2&&a.enable(0);e.supportsVertexTextures&&a.enable(1);e.instancing&&a.enable(2);e.instancingColor&&a.enable(3);e.map&&a.enable(4);e.matcap&&a.enable(5);e.envMap&&a.enable(6);e.lightMap&&a.enable(7);e.aoMap&&a.enable(8);e.emissiveMap&&a.enable(9);e.bumpMap&&a.enable(10);e.normalMap&&a.enable(11);e.objectSpaceNormalMap&&a.enable(12);e.tangentSpaceNormalMap&&a.enable(13);e.clearcoat&&a.enable(14);e.clearcoatMap&&a.enable(15);e.clearcoatRoughnessMap&&a.enable(16);e.clearcoatNormalMap&&a.enable(17);e.displacementMap&&a.enable(18);e.specularMap&&a.enable(19);e.roughnessMap&&a.enable(20);e.metalnessMap&&a.enable(21);e.gradientMap&&a.enable(22);e.alphaMap&&a.enable(23);e.alphaTest&&a.enable(24);e.vertexColors&&a.enable(25);e.vertexAlphas&&a.enable(26);e.vertexUvs&&a.enable(27);e.vertexTangents&&a.enable(28);e.uvsVertexOnly&&a.enable(29);e.fog&&a.enable(30);t.push(a.mask),a.disableAll(),e.useFog&&a.enable(0);e.flatShading&&a.enable(1);e.logarithmicDepthBuffer&&a.enable(2);e.skinning&&a.enable(3);e.morphTargets&&a.enable(4);e.morphNormals&&a.enable(5);e.morphColors&&a.enable(6);e.premultipliedAlpha&&a.enable(7);e.shadowMapEnabled&&a.enable(8);e.physicallyCorrectLights&&a.enable(9);e.doubleSided&&a.enable(10);e.flipSided&&a.enable(11);e.useDepthPacking&&a.enable(12);e.dithering&&a.enable(13);e.specularIntensityMap&&a.enable(14);e.specularColorMap&&a.enable(15);e.transmission&&a.enable(16);e.transmissionMap&&a.enable(17);e.thicknessMap&&a.enable(18);e.sheen&&a.enable(19);e.sheenColorMap&&a.enable(20);e.sheenRoughnessMap&&a.enable(21);e.decodeVideoTexture&&a.enable(22);e.opaque&&a.enable(23);t.push(a.mask)}(i,e),i.push(t.outputEncoding)),i.push(e.customProgramCacheKey),i.join()},getUniforms:function(t){const e=f[t.type];let i;if(e){const t=Ls[e];i=ds.clone(t.uniforms)}else i=t.uniforms;return i},acquireProgram:function(e,i){let n;for(let t=0,e=l.length;t<e;t++){const e=l[t];if(e.cacheKey===i){n=e,++n.usedTimes;break}}return void 0===n&&(n=new Ra(t,i,e,s),l.push(n)),n},releaseProgram:function(t){if(0==--t.usedTimes){const e=l.indexOf(t);l[e]=l[l.length-1],l.pop(),t.destroy()}},releaseShaderCache:function(t){h.remove(t)},programs:l,dispose:function(){h.dispose()}}}function Ia(){let t=new WeakMap;return{get:function(e){let i=t.get(e);return void 0===i&&(i={},t.set(e,i)),i},remove:function(e){t.delete(e)},update:function(e,i,n){t.get(e)[i]=n},dispose:function(){t=new WeakMap}}}function Fa(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function ka(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Na(){const t=[];let e=0;const i=[],n=[],r=[];function s(i,n,r,s,o,a){let h=t[e];return void 0===h?(h={id:i.id,object:i,geometry:n,material:r,groupOrder:s,renderOrder:i.renderOrder,z:o,group:a},t[e]=h):(h.id=i.id,h.object=i,h.geometry=n,h.material=r,h.groupOrder=s,h.renderOrder=i.renderOrder,h.z=o,h.group=a),e++,h}return{opaque:i,transmissive:n,transparent:r,init:function(){e=0,i.length=0,n.length=0,r.length=0},push:function(t,e,o,a,h,l){const u=s(t,e,o,a,h,l);o.transmission>0?n.push(u):!0===o.transparent?r.push(u):i.push(u)},unshift:function(t,e,o,a,h,l){const u=s(t,e,o,a,h,l);o.transmission>0?n.unshift(u):!0===o.transparent?r.unshift(u):i.unshift(u)},finish:function(){for(let i=e,n=t.length;i<n;i++){const e=t[i];if(null===e.id)break;e.id=null,e.object=null,e.geometry=null,e.material=null,e.group=null}},sort:function(t,e){i.length>1&&i.sort(t||Fa),n.length>1&&n.sort(e||ka),r.length>1&&r.sort(e||ka)}}}function za(){let t=new WeakMap;return{get:function(e,i){let n;return!1===t.has(e)?(n=new Na,t.set(e,[n])):i>=t.get(e).length?(n=new Na,t.get(e).push(n)):n=t.get(e)[i],n},dispose:function(){t=new WeakMap}}}function Ua(){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 on,color:new Wi};break;case"SpotLight":i={position:new on,direction:new on,color:new Wi,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":i={position:new on,color:new Wi,distance:0,decay:0};break;case"HemisphereLight":i={direction:new on,skyColor:new Wi,groundColor:new Wi};break;case"RectAreaLight":i={color:new Wi,position:new on,halfWidth:new on,halfHeight:new on}}return t[e.id]=i,i}}}let Va=0;function Ha(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function Ga(t,e){const i=new Ua,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 Ci};break;case"PointLight":i={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Ci,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 on);const s=new on,o=new kn,a=new kn;return{setup:function(s,o){let a=0,h=0,l=0;for(let t=0;t<9;t++)r.probe[t].set(0,0,0);let u=0,c=0,d=0,p=0,f=0,m=0,g=0,v=0;s.sort(Ha);const y=!0!==o?Math.PI:1;for(let t=0,e=s.length;t<e;t++){const e=s[t],o=e.color,x=e.intensity,w=e.distance,b=e.shadow&&e.shadow.map?e.shadow.map.texture:null;if(e.isAmbientLight)a+=o.r*x*y,h+=o.g*x*y,l+=o.b*x*y;else if(e.isLightProbe)for(let t=0;t<9;t++)r.probe[t].addScaledVector(e.sh.coefficients[t],x);else if(e.isDirectionalLight){const t=i.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*y),e.castShadow){const t=e.shadow,i=n.get(e);i.shadowBias=t.bias,i.shadowNormalBias=t.normalBias,i.shadowRadius=t.radius,i.shadowMapSize=t.mapSize,r.directionalShadow[u]=i,r.directionalShadowMap[u]=b,r.directionalShadowMatrix[u]=e.shadow.matrix,m++}r.directional[u]=t,u++}else if(e.isSpotLight){const t=i.get(e);if(t.position.setFromMatrixPosition(e.matrixWorld),t.color.copy(o).multiplyScalar(x*y),t.distance=w,t.coneCos=Math.cos(e.angle),t.penumbraCos=Math.cos(e.angle*(1-e.penumbra)),t.decay=e.decay,e.castShadow){const t=e.shadow,i=n.get(e);i.shadowBias=t.bias,i.shadowNormalBias=t.normalBias,i.shadowRadius=t.radius,i.shadowMapSize=t.mapSize,r.spotShadow[d]=i,r.spotShadowMap[d]=b,r.spotShadowMatrix[d]=e.shadow.matrix,v++}r.spot[d]=t,d++}else if(e.isRectAreaLight){const t=i.get(e);t.color.copy(o).multiplyScalar(x),t.halfWidth.set(.5*e.width,0,0),t.halfHeight.set(0,.5*e.height,0),r.rectArea[p]=t,p++}else if(e.isPointLight){const t=i.get(e);if(t.color.copy(e.color).multiplyScalar(e.intensity*y),t.distance=e.distance,t.decay=e.decay,e.castShadow){const t=e.shadow,i=n.get(e);i.shadowBias=t.bias,i.shadowNormalBias=t.normalBias,i.shadowRadius=t.radius,i.shadowMapSize=t.mapSize,i.shadowCameraNear=t.camera.near,i.shadowCameraFar=t.camera.far,r.pointShadow[c]=i,r.pointShadowMap[c]=b,r.pointShadowMatrix[c]=e.shadow.matrix,g++}r.point[c]=t,c++}else if(e.isHemisphereLight){const t=i.get(e);t.skyColor.copy(e.color).multiplyScalar(x*y),t.groundColor.copy(e.groundColor).multiplyScalar(x*y),r.hemi[f]=t,f++}}p>0&&(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)),r.ambient[0]=a,r.ambient[1]=h,r.ambient[2]=l;const x=r.hash;x.directionalLength===u&&x.pointLength===c&&x.spotLength===d&&x.rectAreaLength===p&&x.hemiLength===f&&x.numDirectionalShadows===m&&x.numPointShadows===g&&x.numSpotShadows===v||(r.directional.length=u,r.spot.length=d,r.rectArea.length=p,r.point.length=c,r.hemi.length=f,r.directionalShadow.length=m,r.directionalShadowMap.length=m,r.pointShadow.length=g,r.pointShadowMap.length=g,r.spotShadow.length=v,r.spotShadowMap.length=v,r.directionalShadowMatrix.length=m,r.pointShadowMatrix.length=g,r.spotShadowMatrix.length=v,x.directionalLength=u,x.pointLength=c,x.spotLength=d,x.rectAreaLength=p,x.hemiLength=f,x.numDirectionalShadows=m,x.numPointShadows=g,x.numSpotShadows=v,r.version=Va++)},setupView:function(t,e){let i=0,n=0,h=0,l=0,u=0;const c=e.matrixWorldInverse;for(let e=0,d=t.length;e<d;e++){const d=t[e];if(d.isDirectionalLight){const t=r.directional[i];t.direction.setFromMatrixPosition(d.matrixWorld),s.setFromMatrixPosition(d.target.matrixWorld),t.direction.sub(s),t.direction.transformDirection(c),i++}else if(d.isSpotLight){const t=r.spot[h];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(c),t.direction.setFromMatrixPosition(d.matrixWorld),s.setFromMatrixPosition(d.target.matrixWorld),t.direction.sub(s),t.direction.transformDirection(c),h++}else if(d.isRectAreaLight){const t=r.rectArea[l];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(c),a.identity(),o.copy(d.matrixWorld),o.premultiply(c),a.extractRotation(o),t.halfWidth.set(.5*d.width,0,0),t.halfHeight.set(0,.5*d.height,0),t.halfWidth.applyMatrix4(a),t.halfHeight.applyMatrix4(a),l++}else if(d.isPointLight){const t=r.point[n];t.position.setFromMatrixPosition(d.matrixWorld),t.position.applyMatrix4(c),n++}else if(d.isHemisphereLight){const t=r.hemi[u];t.direction.setFromMatrixPosition(d.matrixWorld),t.direction.transformDirection(c),u++}}},state:r}}function Wa(t,e){const i=new Ga(t,e),n=[],r=[];return{init:function(){n.length=0,r.length=0},state:{lightsArray:n,shadowsArray:r,lights:i},setupLights:function(t){i.setup(n,t)},setupLightsView:function(t){i.setupView(n,t)},pushLight:function(t){n.push(t)},pushShadow:function(t){r.push(t)}}}function Ya(t,e){let i=new WeakMap;return{get:function(n,r=0){let s;return!1===i.has(n)?(s=new Wa(t,e),i.set(n,[s])):r>=i.get(n).length?(s=new Wa(t,e),i.get(n).push(s)):s=i.get(n)[r],s},dispose:function(){i=new WeakMap}}}class Xa extends br{constructor(t){super(),this.type="MeshDepthMaterial",this.depthPacking=Be,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(t)}copy(t){return super.copy(t),this.depthPacking=t.depthPacking,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}}Xa.prototype.isMeshDepthMaterial=!0;class ja extends br{constructor(t){super(),this.type="MeshDistanceMaterial",this.referencePosition=new on,this.nearDistance=1,this.farDistance=1e3,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(t)}copy(t){return super.copy(t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this}}ja.prototype.isMeshDistanceMaterial=!0;function qa(t,e,i){let n=new Es;const r=new Ci,s=new Ci,o=new Ji,a=new Xa({depthPacking:Ie}),h=new ja,l={},u=i.maxTextureSize,d={0:m,1:f,2:g},v=new ps({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new Ci},radius:{value:4}},vertexShader:"void main() {\n\tgl_Position = vec4( position, 1.0 );\n}",fragmentShader:"uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 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, uvOffset ) * radius ) / resolution ) );\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( squared_mean - mean * mean );\n\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}"}),y=v.clone();y.defines.HORIZONTAL_PASS=1;const w=new Gr;w.setAttribute("position",new Er(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const b=new as(w,v),A=this;function T(i,n){const r=e.update(b);v.defines.VSM_SAMPLES!==i.blurSamples&&(v.defines.VSM_SAMPLES=i.blurSamples,y.defines.VSM_SAMPLES=i.blurSamples,v.needsUpdate=!0,y.needsUpdate=!0),v.uniforms.shadow_pass.value=i.map.texture,v.uniforms.resolution.value=i.mapSize,v.uniforms.radius.value=i.radius,t.setRenderTarget(i.mapPass),t.clear(),t.renderBufferDirect(n,null,r,v,b,null),y.uniforms.shadow_pass.value=i.mapPass.texture,y.uniforms.resolution.value=i.mapSize,y.uniforms.radius.value=i.radius,t.setRenderTarget(i.map),t.clear(),t.renderBufferDirect(n,null,r,y,b,null)}function S(e,i,n,r,s,o){let u=null;const c=!0===n.isPointLight?e.customDistanceMaterial:e.customDepthMaterial;if(u=void 0!==c?c:!0===n.isPointLight?h:a,t.localClippingEnabled&&!0===i.clipShadows&&0!==i.clippingPlanes.length||i.displacementMap&&0!==i.displacementScale||i.alphaMap&&i.alphaTest>0){const t=u.uuid,e=i.uuid;let n=l[t];void 0===n&&(n={},l[t]=n);let r=n[e];void 0===r&&(r=u.clone(),n[e]=r),u=r}return u.visible=i.visible,u.wireframe=i.wireframe,u.side=o===p?null!==i.shadowSide?i.shadowSide:i.side:null!==i.shadowSide?i.shadowSide:d[i.side],u.alphaMap=i.alphaMap,u.alphaTest=i.alphaTest,u.clipShadows=i.clipShadows,u.clippingPlanes=i.clippingPlanes,u.clipIntersection=i.clipIntersection,u.displacementMap=i.displacementMap,u.displacementScale=i.displacementScale,u.displacementBias=i.displacementBias,u.wireframeLinewidth=i.wireframeLinewidth,u.linewidth=i.linewidth,!0===n.isPointLight&&!0===u.isMeshDistanceMaterial&&(u.referencePosition.setFromMatrixPosition(n.matrixWorld),u.nearDistance=r,u.farDistance=s),u}function E(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;h<l;h++){const l=e[h],u=r[l.materialIndex];if(u&&u.visible){const e=S(i,u,o,s.near,s.far,a);t.renderBufferDirect(s,null,n,e,i,l)}}}else if(r.visible){const e=S(i,r,o,s.near,s.far,a);t.renderBufferDirect(s,null,n,e,i,null)}}const h=i.children;for(let t=0,e=h.length;t<e;t++)E(h[t],r,s,o,a)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=c,this.render=function(e,i,a){if(!1===A.enabled)return;if(!1===A.autoUpdate&&!1===A.needsUpdate)return;if(0===e.length)return;const h=t.getRenderTarget(),l=t.getActiveCubeFace(),c=t.getActiveMipmapLevel(),d=t.state;d.setBlending(x),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(let h=0,l=e.length;h<l;h++){const l=e[h],c=l.shadow;if(void 0===c)continue;if(!1===c.autoUpdate&&!1===c.needsUpdate)continue;r.copy(c.mapSize);const f=c.getFrameExtents();if(r.multiply(f),s.copy(c.mapSize),(r.x>u||r.y>u)&&(r.x>u&&(s.x=Math.floor(u/f.x),r.x=s.x*f.x,c.mapSize.x=s.x),r.y>u&&(s.y=Math.floor(u/f.y),r.y=s.y*f.y,c.mapSize.y=s.y)),null!==c.map||c.isPointLightShadow||this.type!==p||(c.map=new Zi(r.x,r.y),c.map.texture.name=l.name+".shadowMap",c.mapPass=new Zi(r.x,r.y),c.camera.updateProjectionMatrix()),null===c.map){const t={minFilter:pt,magFilter:pt,format:Ft};c.map=new Zi(r.x,r.y,t),c.map.texture.name=l.name+".shadowMap",c.camera.updateProjectionMatrix()}t.setRenderTarget(c.map),t.clear();const m=c.getViewportCount();for(let t=0;t<m;t++){const e=c.getViewport(t);o.set(s.x*e.x,s.y*e.y,s.x*e.z,s.y*e.w),d.viewport(o),c.updateMatrices(l,t),n=c.getFrustum(),E(i,a,c.camera,l,this.type)}c.isPointLightShadow||this.type!==p||T(c,a),c.needsUpdate=!1}A.needsUpdate=!1,t.setRenderTarget(h,l,c)}}function Qa(t,e,i){const n=i.isWebGL2;const r=new function(){let e=!1;const i=new Ji;let n=null;const r=new Ji(0,0,0,0);return{setMask:function(i){n===i||e||(t.colorMask(i,i,i,i),n=i)},setLocked:function(t){e=t},setClear:function(e,n,s,o,a){!0===a&&(e*=o,n*=o,s*=o),i.set(e,n,s,o),!1===r.equals(i)&&(t.clearColor(e,n,s,o),r.copy(i))},reset:function(){e=!1,n=null,r.set(-1,0,0,0)}}},s=new function(){let e=!1,i=null,n=null,r=null;return{setTest:function(t){t?xt(2929):wt(2929)},setMask:function(n){i===n||e||(t.depthMask(n),i=n)},setFunc:function(e){if(n!==e){if(e)switch(e){case V:t.depthFunc(512);break;case H:t.depthFunc(519);break;case G:t.depthFunc(513);break;case W:t.depthFunc(515);break;case Y:t.depthFunc(514);break;case X:t.depthFunc(518);break;case j:t.depthFunc(516);break;case q:t.depthFunc(517);break;default:t.depthFunc(515)}else t.depthFunc(515);n=e}},setLocked:function(t){e=t},setClear:function(e){r!==e&&(t.clearDepth(e),r=e)},reset:function(){e=!1,i=null,n=null,r=null}}},l=new function(){let e=!1,i=null,n=null,r=null,s=null,o=null,a=null,h=null,l=null;return{setTest:function(t){e||(t?xt(2960):wt(2960))},setMask:function(n){i===n||e||(t.stencilMask(n),i=n)},setFunc:function(e,i,o){n===e&&r===i&&s===o||(t.stencilFunc(e,i,o),n=e,r=i,s=o)},setOp:function(e,i,n){o===e&&a===i&&h===n||(t.stencilOp(e,i,n),o=e,a=i,h=n)},setLocked:function(t){e=t},setClear:function(e){l!==e&&(t.clearStencil(e),l=e)},reset:function(){e=!1,i=null,n=null,r=null,s=null,o=null,a=null,h=null,l=null}}};let u={},c={},d=new WeakMap,p=[],f=null,v=!1,y=null,Q=null,K=null,J=null,Z=null,$=null,tt=null,et=!1,it=null,nt=null,rt=null,st=null,ot=null;const at=t.getParameter(35661);let ht=!1,lt=0;const ut=t.getParameter(7938);-1!==ut.indexOf("WebGL")?(lt=parseFloat(/^WebGL (\d)/.exec(ut)[1]),ht=lt>=1):-1!==ut.indexOf("OpenGL ES")&&(lt=parseFloat(/^OpenGL ES (\d)/.exec(ut)[1]),ht=lt>=2);let ct=null,dt={};const pt=t.getParameter(3088),ft=t.getParameter(2978),mt=(new Ji).fromArray(pt),gt=(new Ji).fromArray(ft);function vt(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;e<n;e++)t.texImage2D(i+e,0,6408,1,1,0,6408,5121,r);return s}const yt={};function xt(e){!0!==u[e]&&(t.enable(e),u[e]=!0)}function wt(e){!1!==u[e]&&(t.disable(e),u[e]=!1)}yt[3553]=vt(3553,3553,1),yt[34067]=vt(34067,34069,6),r.setClear(0,0,0,1),s.setClear(1),l.setClear(0),xt(2929),s.setFunc(W),St(!1),Et(a),xt(2884),Tt(x);const bt={[E]:32774,[M]:32778,[_]:32779};if(n)bt[C]=32775,bt[P]=32776;else{const t=e.get("EXT_blend_minmax");null!==t&&(bt[C]=t.MIN_EXT,bt[P]=t.MAX_EXT)}const At={[R]:0,[L]:1,[O]:768,[B]:770,[U]:776,[N]:774,[F]:772,[D]:769,[I]:771,[z]:775,[k]:773};function Tt(e,i,n,r,s,o,a,h){if(e!==x){if(!1===v&&(xt(3042),v=!0),e===S)s=s||i,o=o||n,a=a||r,i===Q&&s===Z||(t.blendEquationSeparate(bt[i],bt[s]),Q=i,Z=s),n===K&&r===J&&o===$&&a===tt||(t.blendFuncSeparate(At[n],At[r],At[o],At[a]),K=n,J=r,$=o,tt=a),y=e,et=null;else if(e!==y||h!==et){if(Q===E&&Z===E||(t.blendEquation(32774),Q=E,Z=E),h)switch(e){case w:t.blendFuncSeparate(1,771,1,771);break;case b:t.blendFunc(1,1);break;case A:t.blendFuncSeparate(0,769,0,1);break;case T:t.blendFuncSeparate(0,768,0,770)}else switch(e){case w:t.blendFuncSeparate(770,771,1,771);break;case b:t.blendFunc(770,1);break;case A:t.blendFuncSeparate(0,769,0,1);break;case T:t.blendFunc(0,768)}K=null,J=null,$=null,tt=null,y=e,et=h}}else!0===v&&(wt(3042),v=!1)}function St(e){it!==e&&(e?t.frontFace(2304):t.frontFace(2305),it=e)}function Et(e){e!==o?(xt(2884),e!==nt&&(e===a?t.cullFace(1029):e===h?t.cullFace(1028):t.cullFace(1032))):wt(2884),nt=e}function Mt(e,i,n){e?(xt(32823),st===i&&ot===n||(t.polygonOffset(i,n),st=i,ot=n)):wt(32823)}function _t(e){void 0===e&&(e=33984+at-1),ct!==e&&(t.activeTexture(e),ct=e)}return{buffers:{color:r,depth:s,stencil:l},enable:xt,disable:wt,bindFramebuffer:function(e,i){return c[e]!==i&&(t.bindFramebuffer(e,i),c[e]=i,n&&(36009===e&&(c[36160]=i),36160===e&&(c[36009]=i)),!0)},drawBuffers:function(n,r){let s=p,o=!1;if(n)if(s=d.get(r),void 0===s&&(s=[],d.set(r,s)),n.isWebGLMultipleRenderTargets){const t=n.texture;if(s.length!==t.length||36064!==s[0]){for(let e=0,i=t.length;e<i;e++)s[e]=36064+e;s.length=t.length,o=!0}}else 36064!==s[0]&&(s[0]=36064,o=!0);else 1029!==s[0]&&(s[0]=1029,o=!0);o&&(i.isWebGL2?t.drawBuffers(s):e.get("WEBGL_draw_buffers").drawBuffersWEBGL(s))},useProgram:function(e){return f!==e&&(t.useProgram(e),f=e,!0)},setBlending:Tt,setMaterial:function(t,e){t.side===g?wt(2884):xt(2884);let i=t.side===m;e&&(i=!i),St(i),t.blending===w&&!1===t.transparent?Tt(x):Tt(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),s.setFunc(t.depthFunc),s.setTest(t.depthTest),s.setMask(t.depthWrite),r.setMask(t.colorWrite);const n=t.stencilWrite;l.setTest(n),n&&(l.setMask(t.stencilWriteMask),l.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),l.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),Mt(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits),!0===t.alphaToCoverage?xt(32926):wt(32926)},setFlipSided:St,setCullFace:Et,setLineWidth:function(e){e!==rt&&(ht&&t.lineWidth(e),rt=e)},setPolygonOffset:Mt,setScissorTest:function(t){t?xt(3089):wt(3089)},activeTexture:_t,bindTexture:function(e,i){null===ct&&_t();let n=dt[ct];void 0===n&&(n={type:void 0,texture:void 0},dt[ct]=n),n.type===e&&n.texture===i||(t.bindTexture(e,i||yt[e]),n.type=e,n.texture=i)},unbindTexture:function(){const e=dt[ct];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(t){}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(t){}},texStorage2D:function(){try{t.texStorage2D.apply(t,arguments)}catch(t){}},texStorage3D:function(){try{t.texStorage3D.apply(t,arguments)}catch(t){}},texSubImage2D:function(){try{t.texSubImage2D.apply(t,arguments)}catch(t){}},texSubImage3D:function(){try{t.texSubImage3D.apply(t,arguments)}catch(t){}},compressedTexSubImage2D:function(){try{t.compressedTexSubImage2D.apply(t,arguments)}catch(t){}},scissor:function(e){!1===mt.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),mt.copy(e))},viewport:function(e){!1===gt.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),gt.copy(e))},reset:function(){t.disable(3042),t.disable(2884),t.disable(2929),t.disable(32823),t.disable(3089),t.disable(2960),t.disable(32926),t.blendEquation(32774),t.blendFunc(1,0),t.blendFuncSeparate(1,0,1,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(513),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(519,0,4294967295),t.stencilOp(7680,7680,7680),t.clearStencil(0),t.cullFace(1029),t.frontFace(2305),t.polygonOffset(0,0),t.activeTexture(33984),t.bindFramebuffer(36160,null),!0===n&&(t.bindFramebuffer(36009,null),t.bindFramebuffer(36008,null)),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),u={},ct=null,dt={},c={},d=new WeakMap,p=[],f=null,v=!1,y=null,Q=null,K=null,J=null,Z=null,$=null,tt=null,et=!1,it=null,nt=null,rt=null,st=null,ot=null,mt.set(0,0,t.canvas.width,t.canvas.height),gt.set(0,0,t.canvas.width,t.canvas.height),r.reset(),s.reset(),l.reset()}}}function Ka(t,e,i,n,r,s,o){const a=r.isWebGL2,h=(r.maxTextures,r.maxCubemapSize),l=r.maxTextureSize,u=r.maxSamples,c=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,d=/OculusBrowser/g.test(navigator.userAgent),p=new WeakMap;let f;const m=new WeakMap;let g=!1;try{g="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(t){}function v(t,e){return g?new OffscreenCanvas(t,e):Di("canvas")}function y(t,e,i,n){let r=1;if((t.width>n||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?Mi:Math.floor,s=n(r*t.width),o=n(r*t.height);void 0===f&&(f=v(s,o));const a=i?v(s,o):f;a.width=s,a.height=o;return a.getContext("2d").drawImage(t,0,0,s,o),a}return t}return t}function x(t){return Si(t.width)&&Si(t.height)}function w(t,e){return t.generateMipmaps&&e&&t.minFilter!==pt&&t.minFilter!==yt}function b(e){t.generateMipmap(e)}function A(i,n,r,s,o=!1){if(!1===a)return n;if(null!==i&&void 0!==t[i])return t[i];let h=n;return 6403===n&&(5126===r&&(h=33326),5131===r&&(h=33325),5121===r&&(h=33321)),33319===n&&(5126===r&&(h=33328),5131===r&&(h=33327),5121===r&&(h=33323)),6408===n&&(5126===r&&(h=34836),5131===r&&(h=34842),5121===r&&(h=s===De&&!1===o?35907:32856),32819===r&&(h=32854),32820===r&&(h=32855)),33325!==h&&33326!==h&&33327!==h&&33328!==h&&34842!==h&&34836!==h||e.get("EXT_color_buffer_float"),h}function T(t,e,i){return!0===w(t,i)||t.isFramebufferTexture&&t.minFilter!==pt&&t.minFilter!==yt?Math.log2(Math.max(e.width,e.height))+1:void 0!==t.mipmaps&&t.mipmaps.length>0?t.mipmaps.length:t.isCompressedTexture&&Array.isArray(t.image)?e.mipmaps.length:1}function S(t){return t===pt||t===ft||t===gt?9728:9729}function E(t){const e=t.target;e.removeEventListener("dispose",E),function(t){const e=n.get(t);if(void 0===e.__webglInit)return;const i=t.source,r=m.get(i);if(r){const n=r[e.__cacheKey];n.usedTimes--,0===n.usedTimes&&_(t),0===Object.keys(r).length&&m.delete(i)}n.remove(t)}(e),e.isVideoTexture&&p.delete(e)}function M(e){const i=e.target;i.removeEventListener("dispose",M),function(e){const i=e.texture,r=n.get(e),s=n.get(i);void 0!==s.__webglTexture&&(t.deleteTexture(s.__webglTexture),o.memory.textures--);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let e=0;e<6;e++)t.deleteFramebuffer(r.__webglFramebuffer[e]),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer[e]);else t.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&t.deleteRenderbuffer(r.__webglDepthbuffer),r.__webglMultisampledFramebuffer&&t.deleteFramebuffer(r.__webglMultisampledFramebuffer),r.__webglColorRenderbuffer&&t.deleteRenderbuffer(r.__webglColorRenderbuffer),r.__webglDepthRenderbuffer&&t.deleteRenderbuffer(r.__webglDepthRenderbuffer);if(e.isWebGLMultipleRenderTargets)for(let e=0,r=i.length;e<r;e++){const r=n.get(i[e]);r.__webglTexture&&(t.deleteTexture(r.__webglTexture),o.memory.textures--),n.remove(i[e])}n.remove(i),n.remove(e)}(i)}function _(e){const i=n.get(e);t.deleteTexture(i.__webglTexture);const r=e.source;delete m.get(r)[i.__cacheKey],o.memory.textures--}let C=0;function P(t,e){const r=n.get(t);if(t.isVideoTexture&&function(t){const e=o.render.frame;p.get(t)!==e&&(p.set(t,e),t.update())}(t),!1===t.isRenderTargetTexture&&t.version>0&&r.__version!==t.version){const i=t.image;if(null===i);else if(!1!==i.complete)return void B(r,t,e)}i.activeTexture(33984+e),i.bindTexture(3553,r.__webglTexture)}const R={[ut]:10497,[ct]:33071,[dt]:33648},L={[pt]:9728,[ft]:9984,[gt]:9986,[yt]:9729,[xt]:9985,[bt]:9987};function O(i,s,o){if(o?(t.texParameteri(i,10242,R[s.wrapS]),t.texParameteri(i,10243,R[s.wrapT]),32879!==i&&35866!==i||t.texParameteri(i,32882,R[s.wrapR]),t.texParameteri(i,10240,L[s.magFilter]),t.texParameteri(i,10241,L[s.minFilter])):(t.texParameteri(i,10242,33071),t.texParameteri(i,10243,33071),32879!==i&&35866!==i||t.texParameteri(i,32882,33071),s.wrapS!==ct||s.wrapT,t.texParameteri(i,10240,S(s.magFilter)),t.texParameteri(i,10241,S(s.minFilter)),s.minFilter!==pt&&s.minFilter),!0===e.has("EXT_texture_filter_anisotropic")){const o=e.get("EXT_texture_filter_anisotropic");if(s.type===Pt&&!1===e.has("OES_texture_float_linear"))return;if(!1===a&&s.type===Rt&&!1===e.has("OES_texture_half_float_linear"))return;(s.anisotropy>1||n.get(s).__currentAnisotropy)&&(t.texParameterf(i,o.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(s.anisotropy,r.getMaxAnisotropy())),n.get(s).__currentAnisotropy=s.anisotropy)}}function D(e,i){let n=!1;void 0===e.__webglInit&&(e.__webglInit=!0,i.addEventListener("dispose",E));const r=i.source;let s=m.get(r);void 0===s&&(s={},m.set(r,s));const a=function(t){const e=[];return e.push(t.wrapS),e.push(t.wrapT),e.push(t.magFilter),e.push(t.minFilter),e.push(t.anisotropy),e.push(t.internalFormat),e.push(t.format),e.push(t.type),e.push(t.generateMipmaps),e.push(t.premultiplyAlpha),e.push(t.flipY),e.push(t.unpackAlignment),e.push(t.encoding),e.join()}(i);if(a!==e.__cacheKey){void 0===s[a]&&(s[a]={texture:t.createTexture(),usedTimes:0},o.memory.textures++,n=!0),s[a].usedTimes++;const r=s[e.__cacheKey];void 0!==r&&(s[e.__cacheKey].usedTimes--,0===r.usedTimes&&_(i)),e.__cacheKey=a,e.__webglTexture=s[a].texture}return n}function B(e,n,r){let o=3553;n.isDataArrayTexture&&(o=35866),n.isData3DTexture&&(o=32879);const h=D(e,n),u=n.source;if(i.activeTexture(33984+r),i.bindTexture(o,e.__webglTexture),u.version!==u.__currentVersion||!0===h){t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment),t.pixelStorei(37443,0);const r=function(t){return!a&&(t.wrapS!==ct||t.wrapT!==ct||t.minFilter!==pt&&t.minFilter!==yt)}(n)&&!1===x(n.image);let c=y(n.image,r,!1,l);c=U(n,c);const d=x(c)||a,p=s.convert(n.format,n.encoding);let f,m=s.convert(n.type),g=A(n.internalFormat,p,m,n.encoding,n.isVideoTexture);O(o,n,d);const v=n.mipmaps,S=a&&!0!==n.isVideoTexture,E=void 0===e.__version||!0===h,M=T(n,c,d);if(n.isDepthTexture)g=6402,a?g=n.type===Pt?36012:n.type===Ct?33190:n.type===Dt?35056:33189:n.type,n.format===zt&&6402===g&&n.type!==Mt&&n.type!==Ct&&(n.type=Mt,m=s.convert(n.type)),n.format===Ut&&6402===g&&(g=34041,n.type!==Dt&&(n.type=Dt,m=s.convert(n.type))),E&&(S?i.texStorage2D(3553,1,g,c.width,c.height):i.texImage2D(3553,0,g,c.width,c.height,0,p,m,null));else if(n.isDataTexture)if(v.length>0&&d){S&&E&&i.texStorage2D(3553,M,g,v[0].width,v[0].height);for(let t=0,e=v.length;t<e;t++)f=v[t],S?i.texSubImage2D(3553,t,0,0,f.width,f.height,p,m,f.data):i.texImage2D(3553,t,g,f.width,f.height,0,p,m,f.data);n.generateMipmaps=!1}else S?(E&&i.texStorage2D(3553,M,g,c.width,c.height),i.texSubImage2D(3553,0,0,0,c.width,c.height,p,m,c.data)):i.texImage2D(3553,0,g,c.width,c.height,0,p,m,c.data);else if(n.isCompressedTexture){S&&E&&i.texStorage2D(3553,M,g,v[0].width,v[0].height);for(let t=0,e=v.length;t<e;t++)f=v[t],n.format!==Ft?null!==p&&(S?i.compressedTexSubImage2D(3553,t,0,0,f.width,f.height,p,f.data):i.compressedTexImage2D(3553,t,g,f.width,f.height,0,f.data)):S?i.texSubImage2D(3553,t,0,0,f.width,f.height,p,m,f.data):i.texImage2D(3553,t,g,f.width,f.height,0,p,m,f.data)}else if(n.isDataArrayTexture)S?(E&&i.texStorage3D(35866,M,g,c.width,c.height,c.depth),i.texSubImage3D(35866,0,0,0,0,c.width,c.height,c.depth,p,m,c.data)):i.texImage3D(35866,0,g,c.width,c.height,c.depth,0,p,m,c.data);else if(n.isData3DTexture)S?(E&&i.texStorage3D(32879,M,g,c.width,c.height,c.depth),i.texSubImage3D(32879,0,0,0,0,c.width,c.height,c.depth,p,m,c.data)):i.texImage3D(32879,0,g,c.width,c.height,c.depth,0,p,m,c.data);else if(n.isFramebufferTexture){if(E)if(S)i.texStorage2D(3553,M,g,c.width,c.height);else{let t=c.width,e=c.height;for(let n=0;n<M;n++)i.texImage2D(3553,n,g,t,e,0,p,m,null),t>>=1,e>>=1}}else if(v.length>0&&d){S&&E&&i.texStorage2D(3553,M,g,v[0].width,v[0].height);for(let t=0,e=v.length;t<e;t++)f=v[t],S?i.texSubImage2D(3553,t,0,0,p,m,f):i.texImage2D(3553,t,g,p,m,f);n.generateMipmaps=!1}else S?(E&&i.texStorage2D(3553,M,g,c.width,c.height),i.texSubImage2D(3553,0,0,0,p,m,c)):i.texImage2D(3553,0,g,p,m,c);w(n,d)&&b(o),u.__currentVersion=u.version,n.onUpdate&&n.onUpdate(n)}e.__version=n.version}function I(e,r,o,a,h){const l=s.convert(o.format,o.encoding),u=s.convert(o.type),d=A(o.internalFormat,l,u,o.encoding);n.get(r).__hasExternalTextures||(32879===h||35866===h?i.texImage3D(h,0,d,r.width,r.height,r.depth,0,l,u,null):i.texImage2D(h,0,d,r.width,r.height,0,l,u,null)),i.bindFramebuffer(36160,e),z(r)?c.framebufferTexture2DMultisampleEXT(36160,a,h,n.get(o).__webglTexture,0,N(r)):t.framebufferTexture2D(36160,a,h,n.get(o).__webglTexture,0),i.bindFramebuffer(36160,null)}function F(e,i,n){if(t.bindRenderbuffer(36161,e),i.depthBuffer&&!i.stencilBuffer){let r=33189;if(n||z(i)){const e=i.depthTexture;e&&e.isDepthTexture&&(e.type===Pt?r=36012:e.type===Ct&&(r=33190));const n=N(i);z(i)?c.renderbufferStorageMultisampleEXT(36161,n,r,i.width,i.height):t.renderbufferStorageMultisample(36161,n,r,i.width,i.height)}else t.renderbufferStorage(36161,r,i.width,i.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(i.depthBuffer&&i.stencilBuffer){const r=N(i);n&&!1===z(i)?t.renderbufferStorageMultisample(36161,r,35056,i.width,i.height):z(i)?c.renderbufferStorageMultisampleEXT(36161,r,35056,i.width,i.height):t.renderbufferStorage(36161,34041,i.width,i.height),t.framebufferRenderbuffer(36160,33306,36161,e)}else{const e=!0===i.isWebGLMultipleRenderTargets?i.texture[0]:i.texture,r=s.convert(e.format,e.encoding),o=s.convert(e.type),a=A(e.internalFormat,r,o,e.encoding),h=N(i);n&&!1===z(i)?t.renderbufferStorageMultisample(36161,h,a,i.width,i.height):z(i)?c.renderbufferStorageMultisampleEXT(36161,h,a,i.width,i.height):t.renderbufferStorage(36161,a,i.width,i.height)}t.bindRenderbuffer(36161,null)}function k(e){const r=n.get(e),s=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture&&!r.__autoAllocateDepthBuffer){if(s)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,r){if(r&&r.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(i.bindFramebuffer(36160,e),!r.depthTexture||!r.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(r.depthTexture).__webglTexture&&r.depthTexture.image.width===r.width&&r.depthTexture.image.height===r.height||(r.depthTexture.image.width=r.width,r.depthTexture.image.height=r.height,r.depthTexture.needsUpdate=!0),P(r.depthTexture,0);const s=n.get(r.depthTexture).__webglTexture,o=N(r);if(r.depthTexture.format===zt)z(r)?c.framebufferTexture2DMultisampleEXT(36160,36096,3553,s,0,o):t.framebufferTexture2D(36160,36096,3553,s,0);else{if(r.depthTexture.format!==Ut)throw new Error("Unknown depthTexture format");z(r)?c.framebufferTexture2DMultisampleEXT(36160,33306,3553,s,0,o):t.framebufferTexture2D(36160,33306,3553,s,0)}}(r.__webglFramebuffer,e)}else if(s){r.__webglDepthbuffer=[];for(let n=0;n<6;n++)i.bindFramebuffer(36160,r.__webglFramebuffer[n]),r.__webglDepthbuffer[n]=t.createRenderbuffer(),F(r.__webglDepthbuffer[n],e,!1)}else i.bindFramebuffer(36160,r.__webglFramebuffer),r.__webglDepthbuffer=t.createRenderbuffer(),F(r.__webglDepthbuffer,e,!1);i.bindFramebuffer(36160,null)}function N(t){return Math.min(u,t.samples)}function z(t){const i=n.get(t);return a&&t.samples>0&&!0===e.has("WEBGL_multisampled_render_to_texture")&&!1!==i.__useRenderToTexture}function U(t,i){const n=t.encoding,r=t.format;t.type;return!0===t.isCompressedTexture||!0===t.isVideoTexture||t.format===fi||n!==Oe&&n===De&&!1===a&&(!0===e.has("EXT_sRGB")&&r===Ft?(t.format=fi,t.minFilter=yt,t.generateMipmaps=!1):i=Xi.sRGBToLinear(i)),i}this.allocateTextureUnit=function(){const t=C;return C+=1,t},this.resetTextureUnits=function(){C=0},this.setTexture2D=P,this.setTexture2DArray=function(t,e){const r=n.get(t);t.version>0&&r.__version!==t.version?B(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?B(r,t,e):(i.activeTexture(33984+e),i.bindTexture(32879,r.__webglTexture))},this.setTextureCube=function(e,r){const o=n.get(e);e.version>0&&o.__version!==e.version?function(e,n,r){if(6!==n.image.length)return;const o=D(e,n),l=n.source;if(i.activeTexture(33984+r),i.bindTexture(34067,e.__webglTexture),l.version!==l.__currentVersion||!0===o){t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment),t.pixelStorei(37443,0);const r=n.isCompressedTexture||n.image[0].isCompressedTexture,o=n.image[0]&&n.image[0].isDataTexture,u=[];for(let t=0;t<6;t++)u[t]=r||o?o?n.image[t].image:n.image[t]:y(n.image[t],!1,!0,h),u[t]=U(n,u[t]);const c=u[0],d=x(c)||a,p=s.convert(n.format,n.encoding),f=s.convert(n.type),m=A(n.internalFormat,p,f,n.encoding),g=a&&!0!==n.isVideoTexture,v=void 0===e.__version;let S,E=T(n,c,d);if(O(34067,n,d),r){g&&v&&i.texStorage2D(34067,E,m,c.width,c.height);for(let t=0;t<6;t++){S=u[t].mipmaps;for(let e=0;e<S.length;e++){const r=S[e];n.format!==Ft?null!==p&&(g?i.compressedTexSubImage2D(34069+t,e,0,0,r.width,r.height,p,r.data):i.compressedTexImage2D(34069+t,e,m,r.width,r.height,0,r.data)):g?i.texSubImage2D(34069+t,e,0,0,r.width,r.height,p,f,r.data):i.texImage2D(34069+t,e,m,r.width,r.height,0,p,f,r.data)}}}else{S=n.mipmaps,g&&v&&(S.length>0&&E++,i.texStorage2D(34067,E,m,u[0].width,u[0].height));for(let t=0;t<6;t++)if(o){g?i.texSubImage2D(34069+t,0,0,0,u[t].width,u[t].height,p,f,u[t].data):i.texImage2D(34069+t,0,m,u[t].width,u[t].height,0,p,f,u[t].data);for(let e=0;e<S.length;e++){const n=S[e].image[t].image;g?i.texSubImage2D(34069+t,e+1,0,0,n.width,n.height,p,f,n.data):i.texImage2D(34069+t,e+1,m,n.width,n.height,0,p,f,n.data)}}else{g?i.texSubImage2D(34069+t,0,0,0,p,f,u[t]):i.texImage2D(34069+t,0,m,p,f,u[t]);for(let e=0;e<S.length;e++){const n=S[e];g?i.texSubImage2D(34069+t,e+1,0,0,p,f,n.image[t]):i.texImage2D(34069+t,e+1,m,p,f,n.image[t])}}}w(n,d)&&b(34067),l.__currentVersion=l.version,n.onUpdate&&n.onUpdate(n)}e.__version=n.version}(o,e,r):(i.activeTexture(33984+r),i.bindTexture(34067,o.__webglTexture))},this.rebindTextures=function(t,e,i){const r=n.get(t);void 0!==e&&I(r.__webglFramebuffer,t,t.texture,36064,3553),void 0!==i&&k(t)},this.setupRenderTarget=function(e){const h=e.texture,l=n.get(e),u=n.get(h);e.addEventListener("dispose",M),!0!==e.isWebGLMultipleRenderTargets&&(void 0===u.__webglTexture&&(u.__webglTexture=t.createTexture()),u.__version=h.version,o.memory.textures++);const c=!0===e.isWebGLCubeRenderTarget,d=!0===e.isWebGLMultipleRenderTargets,p=x(e)||a;if(c){l.__webglFramebuffer=[];for(let e=0;e<6;e++)l.__webglFramebuffer[e]=t.createFramebuffer()}else if(l.__webglFramebuffer=t.createFramebuffer(),d){if(r.drawBuffers){const i=e.texture;for(let e=0,r=i.length;e<r;e++){const r=n.get(i[e]);void 0===r.__webglTexture&&(r.__webglTexture=t.createTexture(),o.memory.textures++)}}}else if(a&&e.samples>0&&!1===z(e)){l.__webglMultisampledFramebuffer=t.createFramebuffer(),l.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,l.__webglColorRenderbuffer);const n=s.convert(h.format,h.encoding),r=s.convert(h.type),o=A(h.internalFormat,n,r,h.encoding),a=N(e);t.renderbufferStorageMultisample(36161,a,o,e.width,e.height),i.bindFramebuffer(36160,l.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,l.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(l.__webglDepthRenderbuffer=t.createRenderbuffer(),F(l.__webglDepthRenderbuffer,e,!0)),i.bindFramebuffer(36160,null)}if(c){i.bindTexture(34067,u.__webglTexture),O(34067,h,p);for(let t=0;t<6;t++)I(l.__webglFramebuffer[t],e,h,36064,34069+t);w(h,p)&&b(34067),i.unbindTexture()}else if(d){const t=e.texture;for(let r=0,s=t.length;r<s;r++){const s=t[r],o=n.get(s);i.bindTexture(3553,o.__webglTexture),O(3553,s,p),I(l.__webglFramebuffer,e,s,36064+r,3553),w(s,p)&&b(3553)}i.unbindTexture()}else{let t=3553;(e.isWebGL3DRenderTarget||e.isWebGLArrayRenderTarget)&&a&&(t=e.isWebGL3DRenderTarget?32879:35866),i.bindTexture(t,u.__webglTexture),O(t,h,p),I(l.__webglFramebuffer,e,h,36064,t),w(h,p)&&b(t),i.unbindTexture()}e.depthBuffer&&k(e)},this.updateRenderTargetMipmap=function(t){const e=x(t)||a,r=!0===t.isWebGLMultipleRenderTargets?t.texture:[t.texture];for(let s=0,o=r.length;s<o;s++){const o=r[s];if(w(o,e)){const e=t.isWebGLCubeRenderTarget?34067:3553,r=n.get(o).__webglTexture;i.bindTexture(e,r),b(e),i.unbindTexture()}}},this.updateMultisampleRenderTarget=function(e){if(a&&e.samples>0&&!1===z(e)){const r=e.width,s=e.height;let o=16384;const a=[36064],h=e.stencilBuffer?33306:36096;e.depthBuffer&&a.push(h);const l=n.get(e),u=void 0!==l.__ignoreDepthValues&&l.__ignoreDepthValues;!1===u&&(e.depthBuffer&&(o|=256),e.stencilBuffer&&(o|=1024)),i.bindFramebuffer(36008,l.__webglMultisampledFramebuffer),i.bindFramebuffer(36009,l.__webglFramebuffer),!0===u&&(t.invalidateFramebuffer(36008,[h]),t.invalidateFramebuffer(36009,[h])),t.blitFramebuffer(0,0,r,s,0,0,r,s,o,9728),d&&t.invalidateFramebuffer(36008,a),i.bindFramebuffer(36008,null),i.bindFramebuffer(36009,l.__webglMultisampledFramebuffer)}},this.setupDepthRenderbuffer=k,this.setupFrameBufferTexture=I,this.useMultisampledRTT=z}function Ja(t,e,i){const n=i.isWebGL2;return{convert:function(i,r=null){let s;if(i===Tt)return 5121;if(i===Lt)return 32819;if(i===Ot)return 32820;if(i===St)return 5120;if(i===Et)return 5122;if(i===Mt)return 5123;if(i===_t)return 5124;if(i===Ct)return 5125;if(i===Pt)return 5126;if(i===Rt)return n?5131:(s=e.get("OES_texture_half_float"),null!==s?s.HALF_FLOAT_OES:null);if(i===Bt)return 6406;if(i===Ft)return 6408;if(i===kt)return 6409;if(i===Nt)return 6410;if(i===zt)return 6402;if(i===Ut)return 34041;if(i===Vt)return 6403;if(i===It)return 6408;if(i===fi)return s=e.get("EXT_sRGB"),null!==s?s.SRGB_ALPHA_EXT:null;if(i===Ht)return 36244;if(i===Gt)return 33319;if(i===Wt)return 33320;if(i===Yt)return 36249;if(i===Xt||i===jt||i===qt||i===Qt)if(r===De){if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),null===s)return null;if(i===Xt)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===jt)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===qt)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Qt)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else{if(s=e.get("WEBGL_compressed_texture_s3tc"),null===s)return null;if(i===Xt)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===jt)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===qt)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Qt)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(i===Kt||i===Jt||i===Zt||i===$t){if(s=e.get("WEBGL_compressed_texture_pvrtc"),null===s)return null;if(i===Kt)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===Jt)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===Zt)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===$t)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(i===te)return s=e.get("WEBGL_compressed_texture_etc1"),null!==s?s.COMPRESSED_RGB_ETC1_WEBGL:null;if(i===ee||i===ie){if(s=e.get("WEBGL_compressed_texture_etc"),null===s)return null;if(i===ee)return r===De?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===ie)return r===De?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}if(i===ne||i===re||i===se||i===oe||i===ae||i===he||i===le||i===ue||i===ce||i===de||i===pe||i===fe||i===me||i===ge){if(s=e.get("WEBGL_compressed_texture_astc"),null===s)return null;if(i===ne)return r===De?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===re)return r===De?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===se)return r===De?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===oe)return r===De?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===ae)return r===De?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===he)return r===De?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===le)return r===De?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===ue)return r===De?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===ce)return r===De?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===de)return r===De?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===pe)return r===De?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===fe)return r===De?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===me)return r===De?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===ge)return r===De?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}if(i===ve){if(s=e.get("EXT_texture_compression_bptc"),null===s)return null;if(i===ve)return r===De?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT}return i===Dt?n?34042:(s=e.get("WEBGL_depth_texture"),null!==s?s.UNSIGNED_INT_24_8_WEBGL:null):void 0!==t[i]?t[i]:null}}}class Za extends ms{constructor(t=[]){super(),this.cameras=t}}Za.prototype.isArrayCamera=!0;class $a extends hr{constructor(){super(),this.type="Group"}}$a.prototype.isGroup=!0;const th={type:"move"};class eh{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return null===this._hand&&(this._hand=new $a,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return null===this._targetRay&&(this._targetRay=new $a,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new on,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new on),this._targetRay}getGripSpace(){return null===this._grip&&(this._grip=new $a,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new on,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new on),this._grip}dispatchEvent(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(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(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(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),n.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(n.linearVelocity)):o.hasLinearVelocity=!1,n.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(n.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(th))),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 $a;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!==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),r.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(r.linearVelocity)):a.hasLinearVelocity=!1,r.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(r.angularVelocity)):a.hasAngularVelocity=!1));return null!==o&&(o.visible=null!==n),null!==a&&(a.visible=null!==r),null!==h&&(h.visible=null!==s),this}}class ih extends Ki{constructor(t,e,i,n,r,s,o,a,h,l){if((l=void 0!==l?l:zt)!==zt&&l!==Ut)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&l===zt&&(i=Mt),void 0===i&&l===Ut&&(i=Dt),super(null,n,r,s,o,a,l,i,h),this.image={width:t,height:e},this.magFilter=void 0!==o?o:pt,this.minFilter=void 0!==a?a:pt,this.flipY=!1,this.generateMipmaps=!1}}ih.prototype.isDepthTexture=!0;class nh extends mi{constructor(t,e){super();const i=this;let n=null,r=1,s=null,o="local-floor",a=null,h=null,l=null,u=null,c=null,d=null;const p=e.getContextAttributes();let f=null,m=null;const g=[],v=new Map,y=new ms;y.layers.enable(1),y.viewport=new Ji;const x=new ms;x.layers.enable(2),x.viewport=new Ji;const w=[y,x],b=new Za;b.layers.enable(1),b.layers.enable(2);let A=null,T=null;function S(t){const e=v.get(t.inputSource);e&&e.dispatchEvent({type:t.type,data:t.inputSource})}function E(){v.forEach((function(t,e){t.disconnect(e)})),v.clear(),A=null,T=null,t.setRenderTarget(f),c=null,u=null,l=null,n=null,m=null,L.stop(),i.isPresenting=!1,i.dispatchEvent({type:"sessionend"})}function M(t){const e=n.inputSources;for(let t=0;t<e.length;t++){const i="right"===e[t].handedness?1:0;v.set(e[t],g[i])}for(let e=0;e<t.removed.length;e++){const i=t.removed[e],n=v.get(i);n&&(n.dispatchEvent({type:"disconnected",data:i}),v.delete(i))}for(let e=0;e<t.added.length;e++){const i=t.added[e],n=v.get(i);n&&n.dispatchEvent({type:"connected",data:i})}}this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=g[t];return void 0===e&&(e=new eh,g[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=g[t];return void 0===e&&(e=new eh,g[t]=e),e.getGripSpace()},this.getHand=function(t){let e=g[t];return void 0===e&&(e=new eh,g[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){r=t,i.isPresenting},this.setReferenceSpaceType=function(t){o=t,i.isPresenting},this.getReferenceSpace=function(){return a||s},this.setReferenceSpace=function(t){a=t},this.getBaseLayer=function(){return null!==u?u:c},this.getBinding=function(){return l},this.getFrame=function(){return d},this.getSession=function(){return n},this.setSession=async function(a){if(n=a,null!==n){if(f=t.getRenderTarget(),n.addEventListener("select",S),n.addEventListener("selectstart",S),n.addEventListener("selectend",S),n.addEventListener("squeeze",S),n.addEventListener("squeezestart",S),n.addEventListener("squeezeend",S),n.addEventListener("end",E),n.addEventListener("inputsourceschange",M),!0!==p.xrCompatible&&await e.makeXRCompatible(),void 0===n.renderState.layers||!1===t.capabilities.isWebGL2){const i={antialias:void 0!==n.renderState.layers||p.antialias,alpha:p.alpha,depth:p.depth,stencil:p.stencil,framebufferScaleFactor:r};c=new XRWebGLLayer(n,e,i),n.updateRenderState({baseLayer:c}),m=new Zi(c.framebufferWidth,c.framebufferHeight,{format:Ft,type:Tt,encoding:t.outputEncoding})}else{let i=null,s=null,o=null;p.depth&&(o=p.stencil?35056:33190,i=p.stencil?Ut:zt,s=p.stencil?Dt:Mt);const a={colorFormat:t.outputEncoding===De?35907:32856,depthFormat:o,scaleFactor:r};l=new XRWebGLBinding(n,e),u=l.createProjectionLayer(a),n.updateRenderState({layers:[u]}),m=new Zi(u.textureWidth,u.textureHeight,{format:Ft,type:Tt,depthTexture:new ih(u.textureWidth,u.textureHeight,s,void 0,void 0,void 0,void 0,void 0,void 0,i),stencilBuffer:p.stencil,encoding:t.outputEncoding,samples:p.antialias?4:0});t.properties.get(m).__ignoreDepthValues=u.ignoreDepthValues}m.isXRRenderTarget=!0,this.setFoveation(1),s=await n.requestReferenceSpace(o),L.setContext(n),L.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}};const _=new on,C=new on;function P(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.copy(t.matrixWorld).invert()}this.updateCamera=function(t){if(null===n)return;b.near=x.near=y.near=t.near,b.far=x.far=y.far=t.far,A===b.near&&T===b.far||(n.updateRenderState({depthNear:b.near,depthFar:b.far}),A=b.near,T=b.far);const e=t.parent,i=b.cameras;P(b,e);for(let t=0;t<i.length;t++)P(i[t],e);b.matrixWorld.decompose(b.position,b.quaternion,b.scale),t.position.copy(b.position),t.quaternion.copy(b.quaternion),t.scale.copy(b.scale),t.matrix.copy(b.matrix),t.matrixWorld.copy(b.matrixWorld);const r=t.children;for(let t=0,e=r.length;t<e;t++)r[t].updateMatrixWorld(!0);2===i.length?function(t,e,i){_.setFromMatrixPosition(e.matrixWorld),C.setFromMatrixPosition(i.matrixWorld);const n=_.distanceTo(C),r=e.projectionMatrix.elements,s=i.projectionMatrix.elements,o=r[14]/(r[10]-1),a=r[14]/(r[10]+1),h=(r[9]+1)/r[5],l=(r[9]-1)/r[5],u=(r[8]-1)/r[0],c=(s[8]+1)/s[0],d=o*u,p=o*c,f=n/(-u+c),m=f*-u;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.copy(t.matrixWorld).invert();const g=o+f,v=a+f,y=d-m,x=p+(n-m),w=h*a/v*g,b=l*a/v*g;t.projectionMatrix.makePerspective(y,x,w,b,g,v)}(b,y,x):b.projectionMatrix.copy(y.projectionMatrix)},this.getCamera=function(){return b},this.getFoveation=function(){return null!==u?u.fixedFoveation:null!==c?c.fixedFoveation:void 0},this.setFoveation=function(t){null!==u&&(u.fixedFoveation=t),null!==c&&void 0!==c.fixedFoveation&&(c.fixedFoveation=t)};let R=null;const L=new Ms;L.setAnimationLoop((function(e,i){if(h=i.getViewerPose(a||s),d=i,null!==h){const e=h.views;null!==c&&(t.setRenderTargetFramebuffer(m,c.framebuffer),t.setRenderTarget(m));let i=!1;e.length!==b.cameras.length&&(b.cameras.length=0,i=!0);for(let n=0;n<e.length;n++){const r=e[n];let s=null;if(null!==c)s=c.getViewport(r);else{const e=l.getViewSubImage(u,r);s=e.viewport,0===n&&(t.setRenderTargetTextures(m,e.colorTexture,u.ignoreDepthValues?void 0:e.depthStencilTexture),t.setRenderTarget(m))}const o=w[n];o.matrix.fromArray(r.transform.matrix),o.projectionMatrix.fromArray(r.projectionMatrix),o.viewport.set(s.x,s.y,s.width,s.height),0===n&&b.matrix.copy(o.matrix),!0===i&&b.cameras.push(o)}}const r=n.inputSources;for(let t=0;t<g.length;t++){const e=r[t],n=v.get(e);void 0!==n&&n.update(e,i,a||s)}R&&R(e,i),d=null})),this.setAnimationLoop=function(t){R=t},this.dispose=function(){}}}function rh(t,e){function i(i,n){i.opacity.value=n.opacity,n.color&&i.diffuse.value.copy(n.color),n.emissive&&i.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(i.map.value=n.map),n.alphaMap&&(i.alphaMap.value=n.alphaMap),n.bumpMap&&(i.bumpMap.value=n.bumpMap,i.bumpScale.value=n.bumpScale,n.side===m&&(i.bumpScale.value*=-1)),n.displacementMap&&(i.displacementMap.value=n.displacementMap,i.displacementScale.value=n.displacementScale,i.displacementBias.value=n.displacementBias),n.emissiveMap&&(i.emissiveMap.value=n.emissiveMap),n.normalMap&&(i.normalMap.value=n.normalMap,i.normalScale.value.copy(n.normalScale),n.side===m&&i.normalScale.value.negate()),n.specularMap&&(i.specularMap.value=n.specularMap),n.alphaTest>0&&(i.alphaTest.value=n.alphaTest);const r=e.get(n).envMap;if(r&&(i.envMap.value=r,i.flipEnvMap.value=r.isCubeTexture&&!1===r.isRenderTargetTexture?-1:1,i.reflectivity.value=n.reflectivity,i.ior.value=n.ior,i.refractionRatio.value=n.refractionRatio),n.lightMap){i.lightMap.value=n.lightMap;const e=!0!==t.physicallyCorrectLights?Math.PI:1;i.lightMapIntensity.value=n.lightMapIntensity*e}let s,o;n.aoMap&&(i.aoMap.value=n.aoMap,i.aoMapIntensity.value=n.aoMapIntensity),n.map?s=n.map:n.specularMap?s=n.specularMap:n.displacementMap?s=n.displacementMap:n.normalMap?s=n.normalMap:n.bumpMap?s=n.bumpMap:n.roughnessMap?s=n.roughnessMap:n.metalnessMap?s=n.metalnessMap:n.alphaMap?s=n.alphaMap:n.emissiveMap?s=n.emissiveMap:n.clearcoatMap?s=n.clearcoatMap:n.clearcoatNormalMap?s=n.clearcoatNormalMap:n.clearcoatRoughnessMap?s=n.clearcoatRoughnessMap:n.specularIntensityMap?s=n.specularIntensityMap:n.specularColorMap?s=n.specularColorMap:n.transmissionMap?s=n.transmissionMap:n.thicknessMap?s=n.thicknessMap:n.sheenColorMap?s=n.sheenColorMap:n.sheenRoughnessMap&&(s=n.sheenRoughnessMap),void 0!==s&&(s.isWebGLRenderTarget&&(s=s.texture),!0===s.matrixAutoUpdate&&s.updateMatrix(),i.uvTransform.value.copy(s.matrix)),n.aoMap?o=n.aoMap:n.lightMap&&(o=n.lightMap),void 0!==o&&(o.isWebGLRenderTarget&&(o=o.texture),!0===o.matrixAutoUpdate&&o.updateMatrix(),i.uv2Transform.value.copy(o.matrix))}return{refreshFogUniforms:function(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)},refreshMaterialUniforms:function(t,n,r,s,o){n.isMeshBasicMaterial||n.isMeshLambertMaterial?i(t,n):n.isMeshToonMaterial?(i(t,n),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(t,n)):n.isMeshPhongMaterial?(i(t,n),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4)}(t,n)):n.isMeshStandardMaterial?(i(t,n),function(t,i){t.roughness.value=i.roughness,t.metalness.value=i.metalness,i.roughnessMap&&(t.roughnessMap.value=i.roughnessMap);i.metalnessMap&&(t.metalnessMap.value=i.metalnessMap);e.get(i).envMap&&(t.envMapIntensity.value=i.envMapIntensity)}(t,n),n.isMeshPhysicalMaterial&&function(t,e,i){t.ior.value=e.ior,e.sheen>0&&(t.sheenColor.value.copy(e.sheenColor).multiplyScalar(e.sheen),t.sheenRoughness.value=e.sheenRoughness,e.sheenColorMap&&(t.sheenColorMap.value=e.sheenColorMap),e.sheenRoughnessMap&&(t.sheenRoughnessMap.value=e.sheenRoughnessMap));e.clearcoat>0&&(t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap),e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,e.side===m&&t.clearcoatNormalScale.value.negate()));e.transmission>0&&(t.transmission.value=e.transmission,t.transmissionSamplerMap.value=i.texture,t.transmissionSamplerSize.value.set(i.width,i.height),e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap),t.thickness.value=e.thickness,e.thicknessMap&&(t.thicknessMap.value=e.thicknessMap),t.attenuationDistance.value=e.attenuationDistance,t.attenuationColor.value.copy(e.attenuationColor));t.specularIntensity.value=e.specularIntensity,t.specularColor.value.copy(e.specularColor),e.specularIntensityMap&&(t.specularIntensityMap.value=e.specularIntensityMap);e.specularColorMap&&(t.specularColorMap.value=e.specularColorMap)}(t,n,o)):n.isMeshMatcapMaterial?(i(t,n),function(t,e){e.matcap&&(t.matcap.value=e.matcap)}(t,n)):n.isMeshDepthMaterial?i(t,n):n.isMeshDistanceMaterial?(i(t,n),function(t,e){t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(t,n)):n.isMeshNormalMaterial?i(t,n):n.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}(t,n),n.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,n)):n.isPointsMaterial?function(t,e,i,n){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*i,t.scale.value=.5*n,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);e.alphaTest>0&&(t.alphaTest.value=e.alphaTest);let r;e.map?r=e.map:e.alphaMap&&(r=e.alphaMap);void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uvTransform.value.copy(r.matrix))}(t,n,r,s):n.isSpriteMaterial?function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map);e.alphaMap&&(t.alphaMap.value=e.alphaMap);e.alphaTest>0&&(t.alphaTest.value=e.alphaTest);let i;e.map?i=e.map:e.alphaMap&&(i=e.alphaMap);void 0!==i&&(!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix))}(t,n):n.isShadowMaterial?(t.color.value.copy(n.color),t.opacity.value=n.opacity):n.isShaderMaterial&&(n.uniformsNeedUpdate=!1)}}}function sh(t={}){const e=void 0!==t.canvas?t.canvas:function(){const t=Di("canvas");return t.style.display="block",t}(),i=void 0!==t.context?t.context:null,r=void 0===t.depth||t.depth,s=void 0===t.stencil||t.stencil,o=void 0!==t.antialias&&t.antialias,a=void 0===t.premultipliedAlpha||t.premultipliedAlpha,h=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,l=void 0!==t.powerPreference?t.powerPreference:"default",u=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat;let c;c=null!==i?i.getContextAttributes().alpha:void 0!==t.alpha&&t.alpha;let d=null,p=null;const v=[],y=[];this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputEncoding=Oe,this.physicallyCorrectLights=!1,this.toneMapping=Z,this.toneMappingExposure=1;const x=this;let w=!1,b=0,A=0,T=null,S=-1,E=null;const M=new Ji,_=new Ji;let C=null,P=e.width,R=e.height,L=1,O=null,D=null;const B=new Ji(0,0,P,R),I=new Ji(0,0,P,R);let F=!1;const k=new Es;let N=!1,z=!1,U=null;const V=new kn,H=new Ci,G=new on,W={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function Y(){return null===T?L:1}let X,j,q,Q,K,J,$,tt,et,it,nt,rt,st,ot,at,ht,lt,ut,ct,dt,pt,ft,mt,gt=i;function vt(t,i){for(let n=0;n<t.length;n++){const r=t[n],s=e.getContext(r,i);if(null!==s)return s}return null}try{const t={alpha:!0,depth:r,stencil:s,antialias:o,premultipliedAlpha:a,preserveDrawingBuffer:h,powerPreference:l,failIfMajorPerformanceCaveat:u};if("setAttribute"in e&&e.setAttribute("data-engine","three.js r"+n),e.addEventListener("webglcontextlost",wt,!1),e.addEventListener("webglcontextrestored",At,!1),null===gt){const e=["webgl2","webgl","experimental-webgl"];if(!0===x.isWebGL1Renderer&&e.shift(),gt=vt(e,t),null===gt)throw vt(e)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===gt.getShaderPrecisionFormat&&(gt.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){throw t}function yt(){X=new $s(gt),j=new Is(gt,X,t),X.init(j),ft=new Ja(gt,X,j),q=new Qa(gt,X,j),Q=new io(gt),K=new Ia,J=new Ka(gt,X,q,K,j,ft,Q),$=new ks(x),tt=new Zs(x),et=new _s(gt,j),mt=new Ds(gt,X,et,j),it=new to(gt,et,Q,mt),nt=new ao(gt,it,et,Q),ct=new oo(gt,j,J),ht=new Fs(K),rt=new Ba(x,$,tt,X,j,mt,ht),st=new rh(x,K),ot=new za,at=new Ya(X,j),ut=new Os(x,$,q,nt,c,a),lt=new qa(x,nt,j),dt=new Bs(gt,X,Q,j),pt=new eo(gt,X,Q,j),Q.programs=rt.programs,x.capabilities=j,x.extensions=X,x.properties=K,x.renderLists=ot,x.shadowMap=lt,x.state=q,x.info=Q}yt();const xt=new nh(x,gt);function wt(t){t.preventDefault(),w=!0}function At(){w=!1;const t=Q.autoReset,e=lt.enabled,i=lt.autoUpdate,n=lt.needsUpdate,r=lt.type;yt(),Q.autoReset=t,lt.enabled=e,lt.autoUpdate=i,lt.needsUpdate=n,lt.type=r}function St(t){const e=t.target;e.removeEventListener("dispose",St),function(t){(function(t){const e=K.get(t).programs;void 0!==e&&(e.forEach((function(t){rt.releaseProgram(t)})),t.isShaderMaterial&&rt.releaseShaderCache(t))})(t),K.remove(t)}(e)}this.xr=xt,this.getContext=function(){return gt},this.getContextAttributes=function(){return gt.getContextAttributes()},this.forceContextLoss=function(){const t=X.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){const t=X.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return L},this.setPixelRatio=function(t){void 0!==t&&(L=t,this.setSize(P,R,!1))},this.getSize=function(t){return t.set(P,R)},this.setSize=function(t,i,n){xt.isPresenting||(P=t,R=i,e.width=Math.floor(t*L),e.height=Math.floor(i*L),!1!==n&&(e.style.width=t+"px",e.style.height=i+"px"),this.setViewport(0,0,t,i))},this.getDrawingBufferSize=function(t){return t.set(P*L,R*L).floor()},this.setDrawingBufferSize=function(t,i,n){P=t,R=i,L=n,e.width=Math.floor(t*n),e.height=Math.floor(i*n),this.setViewport(0,0,t,i)},this.getCurrentViewport=function(t){return t.copy(M)},this.getViewport=function(t){return t.copy(B)},this.setViewport=function(t,e,i,n){t.isVector4?B.set(t.x,t.y,t.z,t.w):B.set(t,e,i,n),q.viewport(M.copy(B).multiplyScalar(L).floor())},this.getScissor=function(t){return t.copy(I)},this.setScissor=function(t,e,i,n){t.isVector4?I.set(t.x,t.y,t.z,t.w):I.set(t,e,i,n),q.scissor(_.copy(I).multiplyScalar(L).floor())},this.getScissorTest=function(){return F},this.setScissorTest=function(t){q.setScissorTest(F=t)},this.setOpaqueSort=function(t){O=t},this.setTransparentSort=function(t){D=t},this.getClearColor=function(t){return t.copy(ut.getClearColor())},this.setClearColor=function(){ut.setClearColor.apply(ut,arguments)},this.getClearAlpha=function(){return ut.getClearAlpha()},this.setClearAlpha=function(){ut.setClearAlpha.apply(ut,arguments)},this.clear=function(t=!0,e=!0,i=!0){let n=0;t&&(n|=16384),e&&(n|=256),i&&(n|=1024),gt.clear(n)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",wt,!1),e.removeEventListener("webglcontextrestored",At,!1),ot.dispose(),at.dispose(),K.dispose(),$.dispose(),tt.dispose(),nt.dispose(),mt.dispose(),rt.dispose(),xt.dispose(),xt.removeEventListener("sessionstart",Mt),xt.removeEventListener("sessionend",_t),U&&(U.dispose(),U=null),Ct.stop()},this.renderBufferDirect=function(t,e,i,n,r,s){null===e&&(e=W);const o=r.isMesh&&r.matrixWorld.determinant()<0,a=function(t,e,i,n,r){!0!==e.isScene&&(e=W);J.resetTextureUnits();const s=e.fog,o=n.isMeshStandardMaterial?e.environment:null,a=null===T?x.outputEncoding:!0===T.isXRRenderTarget?T.texture.encoding:Oe,h=(n.isMeshStandardMaterial?tt:$).get(n.envMap||o),l=!0===n.vertexColors&&!!i.attributes.color&&4===i.attributes.color.itemSize,u=!!n.normalMap&&!!i.attributes.tangent,c=!!i.morphAttributes.position,d=!!i.morphAttributes.normal,f=!!i.morphAttributes.color,m=n.toneMapped?x.toneMapping:Z,g=i.morphAttributes.position||i.morphAttributes.normal||i.morphAttributes.color,v=void 0!==g?g.length:0,y=K.get(n),w=p.state.lights;if(!0===N&&(!0===z||t!==E)){const e=t===E&&n.id===S;ht.setState(n,t,e)}let b=!1;n.version===y.__version?y.needsLights&&y.lightsStateVersion!==w.state.version||y.outputEncoding!==a||r.isInstancedMesh&&!1===y.instancing?b=!0:r.isInstancedMesh||!0!==y.instancing?r.isSkinnedMesh&&!1===y.skinning?b=!0:r.isSkinnedMesh||!0!==y.skinning?y.envMap!==h||!0===n.fog&&y.fog!==s?b=!0:void 0===y.numClippingPlanes||y.numClippingPlanes===ht.numPlanes&&y.numIntersection===ht.numIntersection?(y.vertexAlphas!==l||y.vertexTangents!==u||y.morphTargets!==c||y.morphNormals!==d||y.morphColors!==f||y.toneMapping!==m||!0===j.isWebGL2&&y.morphTargetsCount!==v)&&(b=!0):b=!0:b=!0:b=!0:(b=!0,y.__version=n.version);let A=y.currentProgram;!0===b&&(A=Bt(n,e,r));let M=!1,_=!1,C=!1;const P=A.getUniforms(),O=y.uniforms;q.useProgram(A.program)&&(M=!0,_=!0,C=!0);n.id!==S&&(S=n.id,_=!0);if(M||E!==t){if(P.setValue(gt,"projectionMatrix",t.projectionMatrix),j.logarithmicDepthBuffer&&P.setValue(gt,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),E!==t&&(E=t,_=!0,C=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){const e=P.map.cameraPosition;void 0!==e&&e.setValue(gt,G.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&P.setValue(gt,"isOrthographic",!0===t.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.isShadowMaterial||r.isSkinnedMesh)&&P.setValue(gt,"viewMatrix",t.matrixWorldInverse)}if(r.isSkinnedMesh){P.setOptional(gt,r,"bindMatrix"),P.setOptional(gt,r,"bindMatrixInverse");const t=r.skeleton;t&&j.floatVertexTextures&&(null===t.boneTexture&&t.computeBoneTexture(),P.setValue(gt,"boneTexture",t.boneTexture,J),P.setValue(gt,"boneTextureSize",t.boneTextureSize))}const D=i.morphAttributes;(void 0!==D.position||void 0!==D.normal||void 0!==D.color&&!0===j.isWebGL2)&&ct.update(r,i,n,A);(_||y.receiveShadow!==r.receiveShadow)&&(y.receiveShadow=r.receiveShadow,P.setValue(gt,"receiveShadow",r.receiveShadow));_&&(P.setValue(gt,"toneMappingExposure",x.toneMappingExposure),y.needsLights&&(I=C,(B=O).ambientLightColor.needsUpdate=I,B.lightProbe.needsUpdate=I,B.directionalLights.needsUpdate=I,B.directionalLightShadows.needsUpdate=I,B.pointLights.needsUpdate=I,B.pointLightShadows.needsUpdate=I,B.spotLights.needsUpdate=I,B.spotLightShadows.needsUpdate=I,B.rectAreaLights.needsUpdate=I,B.hemisphereLights.needsUpdate=I),s&&!0===n.fog&&st.refreshFogUniforms(O,s),st.refreshMaterialUniforms(O,n,L,R,U),da.upload(gt,y.uniformsList,O,J));var B,I;n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(da.upload(gt,y.uniformsList,O,J),n.uniformsNeedUpdate=!1);n.isSpriteMaterial&&P.setValue(gt,"center",r.center);return P.setValue(gt,"modelViewMatrix",r.modelViewMatrix),P.setValue(gt,"normalMatrix",r.normalMatrix),P.setValue(gt,"modelMatrix",r.matrixWorld),A}(t,e,i,n,r);q.setMaterial(n,o);let h=i.index;const l=i.attributes.position;if(null===h){if(void 0===l||0===l.count)return}else if(0===h.count)return;let u,c=1;!0===n.wireframe&&(h=it.getWireframeAttribute(i),c=2),mt.setup(r,n,a,i,h);let d=dt;null!==h&&(u=et.get(h),d=pt,d.setIndex(u));const f=null!==h?h.count:l.count,m=i.drawRange.start*c,g=i.drawRange.count*c,v=null!==s?s.start*c:0,y=null!==s?s.count*c:1/0,w=Math.max(m,v),b=Math.min(f,m+g,v+y)-1,A=Math.max(0,b-w+1);if(0!==A){if(r.isMesh)!0===n.wireframe?(q.setLineWidth(n.wireframeLinewidth*Y()),d.setMode(1)):d.setMode(4);else if(r.isLine){let t=n.linewidth;void 0===t&&(t=1),q.setLineWidth(t*Y()),r.isLineSegments?d.setMode(1):r.isLineLoop?d.setMode(2):d.setMode(3)}else r.isPoints?d.setMode(0):r.isSprite&&d.setMode(4);if(r.isInstancedMesh)d.renderInstances(w,A,r.count);else if(i.isInstancedBufferGeometry){const t=Math.min(i.instanceCount,i._maxInstanceCount);d.renderInstances(w,A,t)}else d.render(w,A)}},this.compile=function(t,e){p=at.get(t),p.init(),y.push(p),t.traverseVisible((function(t){t.isLight&&t.layers.test(e.layers)&&(p.pushLight(t),t.castShadow&&p.pushShadow(t))})),p.setupLights(x.physicallyCorrectLights),t.traverse((function(e){const i=e.material;if(i)if(Array.isArray(i))for(let n=0;n<i.length;n++){Bt(i[n],t,e)}else Bt(i,t,e)})),y.pop(),p=null};let Et=null;function Mt(){Ct.stop()}function _t(){Ct.start()}const Ct=new Ms;function Lt(t,e,i,n){const r=t.opaque,s=t.transmissive,a=t.transparent;p.setupLightsView(i),s.length>0&&function(t,e,i){const n=j.isWebGL2;null===U&&(U=new Zi(1,1,{generateMipmaps:!0,type:X.has("EXT_color_buffer_half_float")?Rt:Tt,minFilter:bt,samples:n&&!0===o?4:0}));x.getDrawingBufferSize(H),n?U.setSize(H.x,H.y):U.setSize(Mi(H.x),Mi(H.y));const r=x.getRenderTarget();x.setRenderTarget(U),x.clear();const s=x.toneMapping;x.toneMapping=Z,Ot(t,e,i),x.toneMapping=s,J.updateMultisampleRenderTarget(U),J.updateRenderTargetMipmap(U),x.setRenderTarget(r)}(r,e,i),n&&q.viewport(M.copy(n)),r.length>0&&Ot(r,e,i),s.length>0&&Ot(s,e,i),a.length>0&&Ot(a,e,i),q.buffers.depth.setTest(!0),q.buffers.depth.setMask(!0),q.buffers.color.setMask(!0),q.setPolygonOffset(!1)}function Ot(t,e,i){const n=!0===e.isScene?e.overrideMaterial:null;for(let r=0,s=t.length;r<s;r++){const s=t[r],o=s.object,a=s.geometry,h=null===n?s.material:n,l=s.group;o.layers.test(i.layers)&&Dt(o,e,i,a,h,l)}}function Dt(t,e,i,n,r,s){t.onBeforeRender(x,e,i,n,r,s),t.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),r.onBeforeRender(x,e,i,n,t,s),!0===r.transparent&&r.side===g?(r.side=m,r.needsUpdate=!0,x.renderBufferDirect(i,e,n,r,t,s),r.side=f,r.needsUpdate=!0,x.renderBufferDirect(i,e,n,r,t,s),r.side=g):x.renderBufferDirect(i,e,n,r,t,s),t.onAfterRender(x,e,i,n,r,s)}function Bt(t,e,i){!0!==e.isScene&&(e=W);const n=K.get(t),r=p.state.lights,s=p.state.shadowsArray,o=r.state.version,a=rt.getParameters(t,r.state,s,e,i),h=rt.getProgramCacheKey(a);let l=n.programs;n.environment=t.isMeshStandardMaterial?e.environment:null,n.fog=e.fog,n.envMap=(t.isMeshStandardMaterial?tt:$).get(t.envMap||n.environment),void 0===l&&(t.addEventListener("dispose",St),l=new Map,n.programs=l);let u=l.get(h);if(void 0!==u){if(n.currentProgram===u&&n.lightsStateVersion===o)return It(t,a),u}else a.uniforms=rt.getUniforms(t),t.onBuild(i,a,x),t.onBeforeCompile(a,x),u=rt.acquireProgram(a,h),l.set(h,u),n.uniforms=a.uniforms;const c=n.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(c.clippingPlanes=ht.uniform),It(t,a),n.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),n.lightsStateVersion=o,n.needsLights&&(c.ambientLightColor.value=r.state.ambient,c.lightProbe.value=r.state.probe,c.directionalLights.value=r.state.directional,c.directionalLightShadows.value=r.state.directionalShadow,c.spotLights.value=r.state.spot,c.spotLightShadows.value=r.state.spotShadow,c.rectAreaLights.value=r.state.rectArea,c.ltc_1.value=r.state.rectAreaLTC1,c.ltc_2.value=r.state.rectAreaLTC2,c.pointLights.value=r.state.point,c.pointLightShadows.value=r.state.pointShadow,c.hemisphereLights.value=r.state.hemi,c.directionalShadowMap.value=r.state.directionalShadowMap,c.directionalShadowMatrix.value=r.state.directionalShadowMatrix,c.spotShadowMap.value=r.state.spotShadowMap,c.spotShadowMatrix.value=r.state.spotShadowMatrix,c.pointShadowMap.value=r.state.pointShadowMap,c.pointShadowMatrix.value=r.state.pointShadowMatrix);const d=u.getUniforms(),f=da.seqWithValue(d.seq,c);return n.currentProgram=u,n.uniformsList=f,u}function It(t,e){const i=K.get(t);i.outputEncoding=e.outputEncoding,i.instancing=e.instancing,i.skinning=e.skinning,i.morphTargets=e.morphTargets,i.morphNormals=e.morphNormals,i.morphColors=e.morphColors,i.morphTargetsCount=e.morphTargetsCount,i.numClippingPlanes=e.numClippingPlanes,i.numIntersection=e.numClipIntersection,i.vertexAlphas=e.vertexAlphas,i.vertexTangents=e.vertexTangents,i.toneMapping=e.toneMapping}Ct.setAnimationLoop((function(t){Et&&Et(t)})),"undefined"!=typeof self&&Ct.setContext(self),this.setAnimationLoop=function(t){Et=t,xt.setAnimationLoop(t),null===t?Ct.stop():Ct.start()},xt.addEventListener("sessionstart",Mt),xt.addEventListener("sessionend",_t),this.render=function(t,e){if(void 0!==e&&!0!==e.isCamera)return;if(!0===w)return;!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),!0===xt.enabled&&!0===xt.isPresenting&&(!0===xt.cameraAutoUpdate&&xt.updateCamera(e),e=xt.getCamera()),!0===t.isScene&&t.onBeforeRender(x,t,e,T),p=at.get(t,y.length),p.init(),y.push(p),V.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),k.setFromProjectionMatrix(V),z=this.localClippingEnabled,N=ht.init(this.clippingPlanes,z,e),d=ot.get(t,v.length),d.init(),v.push(d),function t(e,i,n,r){if(!1===e.visible)return;if(e.layers.test(i.layers))if(e.isGroup)n=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(i);else if(e.isLight)p.pushLight(e),e.castShadow&&p.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||k.intersectsSprite(e)){r&&G.setFromMatrixPosition(e.matrixWorld).applyMatrix4(V);const t=nt.update(e),i=e.material;i.visible&&d.push(e,t,i,n,G.z,null)}}else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==Q.render.frame&&(e.skeleton.update(),e.skeleton.frame=Q.render.frame),!e.frustumCulled||k.intersectsObject(e))){r&&G.setFromMatrixPosition(e.matrixWorld).applyMatrix4(V);const t=nt.update(e),i=e.material;if(Array.isArray(i)){const r=t.groups;for(let s=0,o=r.length;s<o;s++){const o=r[s],a=i[o.materialIndex];a&&a.visible&&d.push(e,t,a,n,G.z,o)}}else i.visible&&d.push(e,t,i,n,G.z,null)}const s=e.children;for(let e=0,o=s.length;e<o;e++)t(s[e],i,n,r)}(t,e,0,x.sortObjects),d.finish(),!0===x.sortObjects&&d.sort(O,D),!0===N&&ht.beginShadows();const i=p.state.shadowsArray;if(lt.render(i,t,e),!0===N&&ht.endShadows(),!0===this.info.autoReset&&this.info.reset(),ut.render(d,t),p.setupLights(x.physicallyCorrectLights),e.isArrayCamera){const i=e.cameras;for(let e=0,n=i.length;e<n;e++){const n=i[e];Lt(d,t,n,n.viewport)}}else Lt(d,t,e);null!==T&&(J.updateMultisampleRenderTarget(T),J.updateRenderTargetMipmap(T)),!0===t.isScene&&t.onAfterRender(x,t,e),mt.resetDefaultState(),S=-1,E=null,y.pop(),p=y.length>0?y[y.length-1]:null,v.pop(),d=v.length>0?v[v.length-1]:null},this.getActiveCubeFace=function(){return b},this.getActiveMipmapLevel=function(){return A},this.getRenderTarget=function(){return T},this.setRenderTargetTextures=function(t,e,i){K.get(t.texture).__webglTexture=e,K.get(t.depthTexture).__webglTexture=i;const n=K.get(t);n.__hasExternalTextures=!0,n.__hasExternalTextures&&(n.__autoAllocateDepthBuffer=void 0===i,n.__autoAllocateDepthBuffer||!0===X.has("WEBGL_multisampled_render_to_texture")&&(n.__useRenderToTexture=!1))},this.setRenderTargetFramebuffer=function(t,e){const i=K.get(t);i.__webglFramebuffer=e,i.__useDefaultFramebuffer=void 0===e},this.setRenderTarget=function(t,e=0,i=0){T=t,b=e,A=i;let n=!0;if(t){const e=K.get(t);void 0!==e.__useDefaultFramebuffer?(q.bindFramebuffer(36160,null),n=!1):void 0===e.__webglFramebuffer?J.setupRenderTarget(t):e.__hasExternalTextures&&J.rebindTextures(t,K.get(t.texture).__webglTexture,K.get(t.depthTexture).__webglTexture)}let r=null,s=!1,o=!1;if(t){const i=t.texture;(i.isData3DTexture||i.isDataArrayTexture)&&(o=!0);const n=K.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(r=n[e],s=!0):r=j.isWebGL2&&t.samples>0&&!1===J.useMultisampledRTT(t)?K.get(t).__webglMultisampledFramebuffer:n,M.copy(t.viewport),_.copy(t.scissor),C=t.scissorTest}else M.copy(B).multiplyScalar(L).floor(),_.copy(I).multiplyScalar(L).floor(),C=F;if(q.bindFramebuffer(36160,r)&&j.drawBuffers&&n&&q.drawBuffers(t,r),q.viewport(M),q.scissor(_),q.setScissorTest(C),s){const n=K.get(t.texture);gt.framebufferTexture2D(36160,36064,34069+e,n.__webglTexture,i)}else if(o){const n=K.get(t.texture),r=e||0;gt.framebufferTextureLayer(36160,36064,n.__webglTexture,i||0,r)}S=-1},this.readRenderTargetPixels=function(t,e,i,n,r,s,o){if(!t||!t.isWebGLRenderTarget)return;let a=K.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==o&&(a=a[o]),a){q.bindFramebuffer(36160,a);try{const o=t.texture,a=o.format,h=o.type;if(a!==Ft&&ft.convert(a)!==gt.getParameter(35739))return;const l=h===Rt&&(X.has("EXT_color_buffer_half_float")||j.isWebGL2&&X.has("EXT_color_buffer_float"));if(!(h===Tt||ft.convert(h)===gt.getParameter(35738)||h===Pt&&(j.isWebGL2||X.has("OES_texture_float")||X.has("WEBGL_color_buffer_float"))||l))return;e>=0&&e<=t.width-n&&i>=0&&i<=t.height-r&&gt.readPixels(e,i,n,r,ft.convert(a),ft.convert(h),s)}finally{const t=null!==T?K.get(T).__webglFramebuffer:null;q.bindFramebuffer(36160,t)}}},this.copyFramebufferToTexture=function(t,e,i=0){if(!0!==e.isFramebufferTexture)return;const n=Math.pow(2,-i),r=Math.floor(e.image.width*n),s=Math.floor(e.image.height*n);J.setTexture2D(e,0),gt.copyTexSubImage2D(3553,i,0,0,t.x,t.y,r,s),q.unbindTexture()},this.copyTextureToTexture=function(t,e,i,n=0){const r=e.image.width,s=e.image.height,o=ft.convert(i.format),a=ft.convert(i.type);J.setTexture2D(i,0),gt.pixelStorei(37440,i.flipY),gt.pixelStorei(37441,i.premultiplyAlpha),gt.pixelStorei(3317,i.unpackAlignment),e.isDataTexture?gt.texSubImage2D(3553,n,t.x,t.y,r,s,o,a,e.image.data):e.isCompressedTexture?gt.compressedTexSubImage2D(3553,n,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,o,e.mipmaps[0].data):gt.texSubImage2D(3553,n,t.x,t.y,o,a,e.image),0===n&&i.generateMipmaps&&gt.generateMipmap(3553),q.unbindTexture()},this.copyTextureToTexture3D=function(t,e,i,n,r=0){if(x.isWebGL1Renderer)return;const s=t.max.x-t.min.x+1,o=t.max.y-t.min.y+1,a=t.max.z-t.min.z+1,h=ft.convert(n.format),l=ft.convert(n.type);let u;if(n.isData3DTexture)J.setTexture3D(n,0),u=32879;else{if(!n.isDataArrayTexture)return;J.setTexture2DArray(n,0),u=35866}gt.pixelStorei(37440,n.flipY),gt.pixelStorei(37441,n.premultiplyAlpha),gt.pixelStorei(3317,n.unpackAlignment);const c=gt.getParameter(3314),d=gt.getParameter(32878),p=gt.getParameter(3316),f=gt.getParameter(3315),m=gt.getParameter(32877),g=i.isCompressedTexture?i.mipmaps[0]:i.image;gt.pixelStorei(3314,g.width),gt.pixelStorei(32878,g.height),gt.pixelStorei(3316,t.min.x),gt.pixelStorei(3315,t.min.y),gt.pixelStorei(32877,t.min.z),i.isDataTexture||i.isData3DTexture?gt.texSubImage3D(u,r,e.x,e.y,e.z,s,o,a,h,l,g.data):i.isCompressedTexture?gt.compressedTexSubImage3D(u,r,e.x,e.y,e.z,s,o,a,h,g.data):gt.texSubImage3D(u,r,e.x,e.y,e.z,s,o,a,h,l,g),gt.pixelStorei(3314,c),gt.pixelStorei(32878,d),gt.pixelStorei(3316,p),gt.pixelStorei(3315,f),gt.pixelStorei(32877,m),0===r&&n.generateMipmaps&&gt.generateMipmap(u),q.unbindTexture()},this.initTexture=function(t){J.setTexture2D(t,0),q.unbindTexture()},this.resetState=function(){b=0,A=0,T=null,q.reset(),mt.reset()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}sh.prototype.isWebGLRenderer=!0;class oh extends sh{}oh.prototype.isWebGL1Renderer=!0;class ah{constructor(t,e=25e-5){this.name="",this.color=new Wi(t),this.density=e}clone(){return new ah(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}ah.prototype.isFogExp2=!0;class hh{constructor(t,e=1,i=1e3){this.name="",this.color=new Wi(t),this.near=e,this.far=i}clone(){return new hh(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}hh.prototype.isFog=!0;class lh extends hr{constructor(){super(),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.fog&&(e.object.fog=this.fog.toJSON()),e}}lh.prototype.isScene=!0;class uh{constructor(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=ni,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=wi()}onUploadCallback(){}set needsUpdate(t){!0===t&&this.version++}setUsage(t){return this.usage=t,this}copy(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this}copyAt(t,e,i){t*=this.stride,i*=e.stride;for(let n=0,r=this.stride;n<r;n++)this.array[t+n]=e.array[i+n];return this}set(t,e=0){return this.array.set(t,e),this}clone(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=wi()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(e,this.stride);return i.setUsage(this.usage),i}onUpload(t){return this.onUploadCallback=t,this}toJSON(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=wi()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}uh.prototype.isInterleavedBuffer=!0;const ch=new on;class dh{constructor(t,e,i,n=!1){this.name="",this.data=t,this.itemSize=e,this.offset=i,this.normalized=!0===n}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(t){this.data.needsUpdate=t}applyMatrix4(t){for(let e=0,i=this.data.count;e<i;e++)ch.fromBufferAttribute(this,e),ch.applyMatrix4(t),this.setXYZ(e,ch.x,ch.y,ch.z);return this}applyNormalMatrix(t){for(let e=0,i=this.count;e<i;e++)ch.fromBufferAttribute(this,e),ch.applyNormalMatrix(t),this.setXYZ(e,ch.x,ch.y,ch.z);return this}transformDirection(t){for(let e=0,i=this.count;e<i;e++)ch.fromBufferAttribute(this,e),ch.transformDirection(t),this.setXYZ(e,ch.x,ch.y,ch.z);return this}setX(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this}setY(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this}setZ(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this}setW(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this}getX(t){return this.data.array[t*this.data.stride+this.offset]}getY(t){return this.data.array[t*this.data.stride+this.offset+1]}getZ(t){return this.data.array[t*this.data.stride+this.offset+2]}getW(t){return this.data.array[t*this.data.stride+this.offset+3]}setXY(t,e,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this}setXYZ(t,e,i,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=n,this}setXYZW(t,e,i,n,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this.data.array[t+2]=n,this.data.array[t+3]=r,this}clone(t){if(void 0===t){const t=[];for(let e=0;e<this.count;e++){const i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return new Er(new this.array.constructor(t),this.itemSize,this.normalized)}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new dh(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(t){if(void 0===t){const t=[];for(let e=0;e<this.count;e++){const i=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[i+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}dh.prototype.isInterleavedBufferAttribute=!0;class ph extends br{constructor(t){super(),this.type="SpriteMaterial",this.color=new Wi(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}let fh;ph.prototype.isSpriteMaterial=!0;const mh=new on,gh=new on,vh=new on,yh=new Ci,xh=new Ci,wh=new kn,bh=new on,Ah=new on,Th=new on,Sh=new Ci,Eh=new Ci,Mh=new Ci;class _h extends hr{constructor(t){if(super(),this.type="Sprite",void 0===fh){fh=new Gr;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),e=new uh(t,5);fh.setIndex([0,1,2,0,2,3]),fh.setAttribute("position",new dh(e,3,0,!1)),fh.setAttribute("uv",new dh(e,2,3,!1))}this.geometry=fh,this.material=void 0!==t?t:new ph,this.center=new Ci(.5,.5)}raycast(t,e){t.camera,gh.setFromMatrixScale(this.matrixWorld),wh.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),vh.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&gh.multiplyScalar(-vh.z);const i=this.material.rotation;let n,r;0!==i&&(r=Math.cos(i),n=Math.sin(i));const s=this.center;Ch(bh.set(-.5,-.5,0),vh,s,gh,n,r),Ch(Ah.set(.5,-.5,0),vh,s,gh,n,r),Ch(Th.set(.5,.5,0),vh,s,gh,n,r),Sh.set(0,0),Eh.set(1,0),Mh.set(1,1);let o=t.ray.intersectTriangle(bh,Ah,Th,!1,mh);if(null===o&&(Ch(Ah.set(-.5,.5,0),vh,s,gh,n,r),Eh.set(0,1),o=t.ray.intersectTriangle(bh,Th,Ah,!1,mh),null===o))return;const a=t.ray.origin.distanceTo(mh);a<t.near||a>t.far||e.push({distance:a,point:mh.clone(),uv:xr.getUV(mh,bh,Ah,Th,Sh,Eh,Mh,new Ci),face:null,object:this})}copy(t){return super.copy(t),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}}function Ch(t,e,i,n,r,s){yh.subVectors(t,i).addScalar(.5).multiply(n),void 0!==r?(xh.x=s*yh.x-r*yh.y,xh.y=r*yh.x+s*yh.y):xh.copy(yh),t.copy(e),t.x+=xh.x,t.y+=xh.y,t.applyMatrix4(wh)}_h.prototype.isSprite=!0;const Ph=new on,Rh=new on;class Lh extends hr{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(t){super.copy(t,!1);const e=t.levels;for(let t=0,i=e.length;t<i;t++){const i=e[t];this.addLevel(i.object.clone(),i.distance)}return this.autoUpdate=t.autoUpdate,this}addLevel(t,e=0){e=Math.abs(e);const i=this.levels;let n;for(n=0;n<i.length&&!(e<i[n].distance);n++);return i.splice(n,0,{distance:e,object:t}),this.add(t),this}getCurrentLevel(){return this._currentLevel}getObjectForDistance(t){const e=this.levels;if(e.length>0){let i,n;for(i=1,n=e.length;i<n&&!(t<e[i].distance);i++);return e[i-1].object}return null}raycast(t,e){if(this.levels.length>0){Ph.setFromMatrixPosition(this.matrixWorld);const i=t.ray.origin.distanceTo(Ph);this.getObjectForDistance(i).raycast(t,e)}}update(t){const e=this.levels;if(e.length>1){Ph.setFromMatrixPosition(t.matrixWorld),Rh.setFromMatrixPosition(this.matrixWorld);const i=Ph.distanceTo(Rh)/t.zoom;let n,r;for(e[0].object.visible=!0,n=1,r=e.length;n<r&&i>=e[n].distance;n++)e[n-1].object.visible=!1,e[n].object.visible=!0;for(this._currentLevel=n-1;n<r;n++)e[n].object.visible=!1}}toJSON(t){const e=super.toJSON(t);!1===this.autoUpdate&&(e.object.autoUpdate=!1),e.object.levels=[];const i=this.levels;for(let t=0,n=i.length;t<n;t++){const n=i[t];e.object.levels.push({object:n.object.uuid,distance:n.distance})}return e}}const Oh=new on,Dh=new Ji,Bh=new Ji,Ih=new on,Fh=new kn;class kh extends as{constructor(t,e){super(t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new kn,this.bindMatrixInverse=new kn}copy(t){return super.copy(t),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,this}bind(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.copy(e).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const t=new Ji,e=this.geometry.attributes.skinWeight;for(let i=0,n=e.count;i<n;i++){t.fromBufferAttribute(e,i);const n=1/t.manhattanLength();n!==1/0?t.multiplyScalar(n):t.set(1,0,0,0),e.setXYZW(i,t.x,t.y,t.z,t.w)}}updateMatrixWorld(t){super.updateMatrixWorld(t),"attached"===this.bindMode?this.bindMatrixInverse.copy(this.matrixWorld).invert():"detached"===this.bindMode&&this.bindMatrixInverse.copy(this.bindMatrix).invert()}boneTransform(t,e){const i=this.skeleton,n=this.geometry;Dh.fromBufferAttribute(n.attributes.skinIndex,t),Bh.fromBufferAttribute(n.attributes.skinWeight,t),Oh.copy(e).applyMatrix4(this.bindMatrix),e.set(0,0,0);for(let t=0;t<4;t++){const n=Bh.getComponent(t);if(0!==n){const r=Dh.getComponent(t);Fh.multiplyMatrices(i.bones[r].matrixWorld,i.boneInverses[r]),e.addScaledVector(Ih.copy(Oh).applyMatrix4(Fh),n)}}return e.applyMatrix4(this.bindMatrixInverse)}}kh.prototype.isSkinnedMesh=!0;class Nh extends hr{constructor(){super(),this.type="Bone"}}Nh.prototype.isBone=!0;class zh extends Ki{constructor(t=null,e=1,i=1,n,r,s,o,a,h=pt,l=pt,u,c){super(null,s,o,a,h,l,n,r,u,c),this.image={data:t,width:e,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}zh.prototype.isDataTexture=!0;const Uh=new kn,Vh=new kn;class Hh{constructor(t=[],e=[]){this.uuid=wi(),this.bones=t.slice(0),this.boneInverses=e,this.boneMatrices=null,this.boneTexture=null,this.boneTextureSize=0,this.frame=-1,this.init()}init(){const t=this.bones,e=this.boneInverses;if(this.boneMatrices=new Float32Array(16*t.length),0===e.length)this.calculateInverses();else if(t.length!==e.length){this.boneInverses=[];for(let t=0,e=this.bones.length;t<e;t++)this.boneInverses.push(new kn)}}calculateInverses(){this.boneInverses.length=0;for(let t=0,e=this.bones.length;t<e;t++){const e=new kn;this.bones[t]&&e.copy(this.bones[t].matrixWorld).invert(),this.boneInverses.push(e)}}pose(){for(let t=0,e=this.bones.length;t<e;t++){const e=this.bones[t];e&&e.matrixWorld.copy(this.boneInverses[t]).invert()}for(let t=0,e=this.bones.length;t<e;t++){const e=this.bones[t];e&&(e.parent&&e.parent.isBone?(e.matrix.copy(e.parent.matrixWorld).invert(),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))}}update(){const t=this.bones,e=this.boneInverses,i=this.boneMatrices,n=this.boneTexture;for(let n=0,r=t.length;n<r;n++){const r=t[n]?t[n].matrixWorld:Vh;Uh.multiplyMatrices(r,e[n]),Uh.toArray(i,16*n)}null!==n&&(n.needsUpdate=!0)}clone(){return new Hh(this.bones,this.boneInverses)}computeBoneTexture(){let t=Math.sqrt(4*this.bones.length);t=Ei(t),t=Math.max(t,4);const e=new Float32Array(t*t*4);e.set(this.boneMatrices);const i=new zh(e,t,t,Ft,Pt);return i.needsUpdate=!0,this.boneMatrices=e,this.boneTexture=i,this.boneTextureSize=t,this}getBoneByName(t){for(let e=0,i=this.bones.length;e<i;e++){const i=this.bones[e];if(i.name===t)return i}}dispose(){null!==this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(t,e){this.uuid=t.uuid;for(let i=0,n=t.bones.length;i<n;i++){let n=e[t.bones[i]];void 0===n&&(n=new Nh),this.bones.push(n),this.boneInverses.push((new kn).fromArray(t.boneInverses[i]))}return this.init(),this}toJSON(){const t={metadata:{version:4.5,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};t.uuid=this.uuid;const e=this.bones,i=this.boneInverses;for(let n=0,r=e.length;n<r;n++){const r=e[n];t.bones.push(r.uuid);const s=i[n];t.boneInverses.push(s.toArray())}return t}}class Gh extends Er{constructor(t,e,i,n=1){"number"==typeof i&&(n=i,i=!1),super(t,e,i),this.meshPerAttribute=n}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}toJSON(){const t=super.toJSON();return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}Gh.prototype.isInstancedBufferAttribute=!0;const Wh=new kn,Yh=new kn,Xh=[],jh=new as;class qh extends as{constructor(t,e,i){super(t,e),this.instanceMatrix=new Gh(new Float32Array(16*i),16),this.instanceColor=null,this.count=i,this.frustumCulled=!1}copy(t){return super.copy(t),this.instanceMatrix.copy(t.instanceMatrix),null!==t.instanceColor&&(this.instanceColor=t.instanceColor.clone()),this.count=t.count,this}getColorAt(t,e){e.fromArray(this.instanceColor.array,3*t)}getMatrixAt(t,e){e.fromArray(this.instanceMatrix.array,16*t)}raycast(t,e){const i=this.matrixWorld,n=this.count;if(jh.geometry=this.geometry,jh.material=this.material,void 0!==jh.material)for(let r=0;r<n;r++){this.getMatrixAt(r,Wh),Yh.multiplyMatrices(i,Wh),jh.matrixWorld=Yh,jh.raycast(t,Xh);for(let t=0,i=Xh.length;t<i;t++){const i=Xh[t];i.instanceId=r,i.object=this,e.push(i)}Xh.length=0}}setColorAt(t,e){null===this.instanceColor&&(this.instanceColor=new Gh(new Float32Array(3*this.instanceMatrix.count),3)),e.toArray(this.instanceColor.array,3*t)}setMatrixAt(t,e){e.toArray(this.instanceMatrix.array,16*t)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"})}}qh.prototype.isInstancedMesh=!0;class Qh extends br{constructor(t){super(),this.type="LineBasicMaterial",this.color=new Wi(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.fog=t.fog,this}}Qh.prototype.isLineBasicMaterial=!0;const Kh=new on,Jh=new on,Zh=new kn,$h=new Fn,tl=new Cn;class el extends hr{constructor(t=new Gr,e=new Qh){super(),this.type="Line",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),this.material=t.material,this.geometry=t.geometry,this}computeLineDistances(){const t=this.geometry;if(t.isBufferGeometry){if(null===t.index){const e=t.attributes.position,i=[0];for(let t=1,n=e.count;t<n;t++)Kh.fromBufferAttribute(e,t-1),Jh.fromBufferAttribute(e,t),i[t]=i[t-1],i[t]+=Kh.distanceTo(Jh);t.setAttribute("lineDistance",new Br(i,1))}}else t.isGeometry;return this}raycast(t,e){const i=this.geometry,n=this.matrixWorld,r=t.params.Line.threshold,s=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),tl.copy(i.boundingSphere),tl.applyMatrix4(n),tl.radius+=r,!1===t.ray.intersectsSphere(tl))return;Zh.copy(n).invert(),$h.copy(t.ray).applyMatrix4(Zh);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o,h=new on,l=new on,u=new on,c=new on,d=this.isLineSegments?2:1;if(i.isBufferGeometry){const n=i.index,r=i.attributes.position;if(null!==n){for(let i=Math.max(0,s.start),o=Math.min(n.count,s.start+s.count)-1;i<o;i+=d){const s=n.getX(i),o=n.getX(i+1);h.fromBufferAttribute(r,s),l.fromBufferAttribute(r,o);if($h.distanceSqToSegment(h,l,c,u)>a)continue;c.applyMatrix4(this.matrixWorld);const d=t.ray.origin.distanceTo(c);d<t.near||d>t.far||e.push({distance:d,point:u.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else{for(let i=Math.max(0,s.start),n=Math.min(r.count,s.start+s.count)-1;i<n;i+=d){h.fromBufferAttribute(r,i),l.fromBufferAttribute(r,i+1);if($h.distanceSqToSegment(h,l,c,u)>a)continue;c.applyMatrix4(this.matrixWorld);const n=t.ray.origin.distanceTo(c);n<t.near||n>t.far||e.push({distance:n,point:u.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}}else i.isGeometry}updateMorphTargets(){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;e<i;e++){const i=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=e}}}}else{const e=t.morphTargets;void 0!==e&&e.length}}}el.prototype.isLine=!0;const il=new on,nl=new on;class rl extends el{constructor(t,e){super(t,e),this.type="LineSegments"}computeLineDistances(){const t=this.geometry;if(t.isBufferGeometry){if(null===t.index){const e=t.attributes.position,i=[];for(let t=0,n=e.count;t<n;t+=2)il.fromBufferAttribute(e,t),nl.fromBufferAttribute(e,t+1),i[t]=0===t?0:i[t-1],i[t+1]=i[t]+il.distanceTo(nl);t.setAttribute("lineDistance",new Br(i,1))}}else t.isGeometry;return this}}rl.prototype.isLineSegments=!0;class sl extends el{constructor(t,e){super(t,e),this.type="LineLoop"}}sl.prototype.isLineLoop=!0;class ol extends br{constructor(t){super(),this.type="PointsMaterial",this.color=new Wi(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.fog=t.fog,this}}ol.prototype.isPointsMaterial=!0;const al=new kn,hl=new Fn,ll=new Cn,ul=new on;class cl extends hr{constructor(t=new Gr,e=new ol){super(),this.type="Points",this.geometry=t,this.material=e,this.updateMorphTargets()}copy(t){return super.copy(t),this.material=t.material,this.geometry=t.geometry,this}raycast(t,e){const i=this.geometry,n=this.matrixWorld,r=t.params.Points.threshold,s=i.drawRange;if(null===i.boundingSphere&&i.computeBoundingSphere(),ll.copy(i.boundingSphere),ll.applyMatrix4(n),ll.radius+=r,!1===t.ray.intersectsSphere(ll))return;al.copy(n).invert(),hl.copy(t.ray).applyMatrix4(al);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),a=o*o;if(i.isBufferGeometry){const r=i.index,o=i.attributes.position;if(null!==r){for(let i=Math.max(0,s.start),h=Math.min(r.count,s.start+s.count);i<h;i++){const s=r.getX(i);ul.fromBufferAttribute(o,s),dl(ul,s,a,n,t,e,this)}}else{for(let i=Math.max(0,s.start),r=Math.min(o.count,s.start+s.count);i<r;i++)ul.fromBufferAttribute(o,i),dl(ul,i,a,n,t,e,this)}}}updateMorphTargets(){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;e<i;e++){const i=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=e}}}}else{const e=t.morphTargets;void 0!==e&&e.length}}}function dl(t,e,i,n,r,s,o){const a=hl.distanceSqToPoint(t);if(a<i){const i=new on;hl.closestPointToPoint(t,i),i.applyMatrix4(n);const h=r.ray.origin.distanceTo(i);if(h<r.near||h>r.far)return;s.push({distance:h,distanceToRay:Math.sqrt(a),point:i,index:e,face:null,object:o})}}cl.prototype.isPoints=!0;class pl extends Ki{constructor(t,e,i,n,r,s,o,a,h){super(t,e,i,n,r,s,o,a,h),this.minFilter=void 0!==s?s:yt,this.magFilter=void 0!==r?r:yt,this.generateMipmaps=!1;const l=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback((function e(){l.needsUpdate=!0,t.requestVideoFrameCallback(e)}))}clone(){return new this.constructor(this.image).copy(this)}update(){const t=this.image;!1==="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}pl.prototype.isVideoTexture=!0;class fl extends Ki{constructor(t,e,i){super({width:t,height:e}),this.format=i,this.magFilter=pt,this.minFilter=pt,this.generateMipmaps=!1,this.needsUpdate=!0}}fl.prototype.isFramebufferTexture=!0;class ml extends Ki{constructor(t,e,i,n,r,s,o,a,h,l,u,c){super(null,s,o,a,h,l,n,r,u,c),this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}}ml.prototype.isCompressedTexture=!0;class gl extends Ki{constructor(t,e,i,n,r,s,o,a,h){super(t,e,i,n,r,s,o,a,h),this.needsUpdate=!0}}gl.prototype.isCanvasTexture=!0;class vl{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return null}getPointAt(t,e){const i=this.getUtoTmapping(t);return this.getPoint(i,e)}getPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return e}getSpacedPoints(t=5){const e=[];for(let i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e}getLength(){const t=this.getLengths();return t[t.length-1]}getLengths(t=this.arcLengthDivisions){if(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(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(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(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 Ci:new on);return o.copy(s).sub(r).normalize(),o}getTangentAt(t,e){const i=this.getUtoTmapping(t);return this.getTangent(i,e)}computeFrenetFrames(t,e){const i=new on,n=[],r=[],s=[],o=new on,a=new kn;for(let e=0;e<=t;e++){const i=e/t;n[e]=this.getTangentAt(i,new on)}r[0]=new on,s[0]=new on;let h=Number.MAX_VALUE;const l=Math.abs(n[0].x),u=Math.abs(n[0].y),c=Math.abs(n[0].z);l<=h&&(h=l,i.set(1,0,0)),u<=h&&(h=u,i.set(0,1,0)),c<=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(bi(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(bi(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(){return(new this.constructor).copy(this)}copy(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}toJSON(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t}fromJSON(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}class yl extends vl{constructor(t=0,e=0,i=1,n=1,r=0,s=2*Math.PI,o=!1,a=0){super(),this.type="EllipseCurve",this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=n,this.aStartAngle=r,this.aEndAngle=s,this.aClockwise=o,this.aRotation=a}getPoint(t,e){const i=e||new Ci,n=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const s=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=n;for(;r>n;)r-=n;r<Number.EPSILON&&(r=s?0:n),!0!==this.aClockwise||s||(r===n?r=-n:r-=n);const o=this.aStartAngle+t*r;let a=this.aX+this.xRadius*Math.cos(o),h=this.aY+this.yRadius*Math.sin(o);if(0!==this.aRotation){const t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),i=a-this.aX,n=h-this.aY;a=i*t-n*e+this.aX,h=i*e+n*t+this.aY}return i.set(a,h)}copy(t){return super.copy(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}toJSON(){const t=super.toJSON();return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t}fromJSON(t){return super.fromJSON(t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this}}yl.prototype.isEllipseCurve=!0;class xl extends yl{constructor(t,e,i,n,r,s){super(t,e,i,i,n,r,s),this.type="ArcCurve"}}function wl(){let t=0,e=0,i=0,n=0;function r(r,s,o,a){t=r,e=o,i=-3*r+3*s-2*o-a,n=2*r-2*s+o+a}return{initCatmullRom:function(t,e,i,n,s){r(e,i,s*(i-t),s*(n-e))},initNonuniformCatmullRom:function(t,e,i,n,s,o,a){let h=(e-t)/s-(i-t)/(s+o)+(i-e)/o,l=(i-e)/o-(n-e)/(o+a)+(n-i)/a;h*=o,l*=o,r(e,i,h,l)},calc:function(r){const s=r*r;return t+e*r+i*s+n*(s*r)}}}xl.prototype.isArcCurve=!0;const bl=new on,Al=new wl,Tl=new wl,Sl=new wl;class El extends vl{constructor(t=[],e=!1,i="centripetal",n=.5){super(),this.type="CatmullRomCurve3",this.points=t,this.closed=e,this.curveType=i,this.tension=n}getPoint(t,e=new on){const i=e,n=this.points,r=n.length,s=(r-(this.closed?0:1))*t;let o,a,h=Math.floor(s),l=s-h;this.closed?h+=h>0?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]:(bl.subVectors(n[0],n[1]).add(n[0]),o=bl);const u=n[h%r],c=n[(h+1)%r];if(this.closed||h+2<r?a=n[(h+2)%r]:(bl.subVectors(n[r-1],n[r-2]).add(n[r-1]),a=bl),"centripetal"===this.curveType||"chordal"===this.curveType){const t="chordal"===this.curveType?.5:.25;let e=Math.pow(o.distanceToSquared(u),t),i=Math.pow(u.distanceToSquared(c),t),n=Math.pow(c.distanceToSquared(a),t);i<1e-4&&(i=1),e<1e-4&&(e=i),n<1e-4&&(n=i),Al.initNonuniformCatmullRom(o.x,u.x,c.x,a.x,e,i,n),Tl.initNonuniformCatmullRom(o.y,u.y,c.y,a.y,e,i,n),Sl.initNonuniformCatmullRom(o.z,u.z,c.z,a.z,e,i,n)}else"catmullrom"===this.curveType&&(Al.initCatmullRom(o.x,u.x,c.x,a.x,this.tension),Tl.initCatmullRom(o.y,u.y,c.y,a.y,this.tension),Sl.initCatmullRom(o.z,u.z,c.z,a.z,this.tension));return i.set(Al.calc(l),Tl.calc(l),Sl.calc(l)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push(i.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){const i=this.points[e];t.points.push(i.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push((new on).fromArray(i))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this}}function Ml(t,e,i,n,r){const 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 _l(t,e,i,n){return function(t,e){const 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 Cl(t,e,i,n,r){return function(t,e){const i=1-t;return i*i*i*e}(t,e)+function(t,e){const 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)}El.prototype.isCatmullRomCurve3=!0;class Pl extends vl{constructor(t=new Ci,e=new Ci,i=new Ci,n=new Ci){super(),this.type="CubicBezierCurve",this.v0=t,this.v1=e,this.v2=i,this.v3=n}getPoint(t,e=new Ci){const i=e,n=this.v0,r=this.v1,s=this.v2,o=this.v3;return i.set(Cl(t,n.x,r.x,s.x,o.x),Cl(t,n.y,r.y,s.y,o.y)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}Pl.prototype.isCubicBezierCurve=!0;class Rl extends vl{constructor(t=new on,e=new on,i=new on,n=new on){super(),this.type="CubicBezierCurve3",this.v0=t,this.v1=e,this.v2=i,this.v3=n}getPoint(t,e=new on){const i=e,n=this.v0,r=this.v1,s=this.v2,o=this.v3;return i.set(Cl(t,n.x,r.x,s.x,o.x),Cl(t,n.y,r.y,s.y,o.y),Cl(t,n.z,r.z,s.z,o.z)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this}}Rl.prototype.isCubicBezierCurve3=!0;class Ll extends vl{constructor(t=new Ci,e=new Ci){super(),this.type="LineCurve",this.v1=t,this.v2=e}getPoint(t,e=new Ci){const i=e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}getTangent(t,e){const i=e||new Ci;return i.copy(this.v2).sub(this.v1).normalize(),i}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}Ll.prototype.isLineCurve=!0;class Ol extends vl{constructor(t=new on,e=new on){super(),this.type="LineCurve3",this.isLineCurve3=!0,this.v1=t,this.v2=e}getPoint(t,e=new on){const i=e;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i}getPointAt(t,e){return this.getPoint(t,e)}copy(t){return super.copy(t),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}class Dl extends vl{constructor(t=new Ci,e=new Ci,i=new Ci){super(),this.type="QuadraticBezierCurve",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new Ci){const i=e,n=this.v0,r=this.v1,s=this.v2;return i.set(_l(t,n.x,r.x,s.x),_l(t,n.y,r.y,s.y)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}Dl.prototype.isQuadraticBezierCurve=!0;class Bl extends vl{constructor(t=new on,e=new on,i=new on){super(),this.type="QuadraticBezierCurve3",this.v0=t,this.v1=e,this.v2=i}getPoint(t,e=new on){const i=e,n=this.v0,r=this.v1,s=this.v2;return i.set(_l(t,n.x,r.x,s.x),_l(t,n.y,r.y,s.y),_l(t,n.z,r.z,s.z)),i}copy(t){return super.copy(t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this}toJSON(){const t=super.toJSON();return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t}fromJSON(t){return super.fromJSON(t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this}}Bl.prototype.isQuadraticBezierCurve3=!0;class Il extends vl{constructor(t=[]){super(),this.type="SplineCurve",this.points=t}getPoint(t,e=new Ci){const i=e,n=this.points,r=(n.length-1)*t,s=Math.floor(r),o=r-s,a=n[0===s?s:s-1],h=n[s],l=n[s>n.length-2?n.length-1:s+1],u=n[s>n.length-3?n.length-1:s+2];return i.set(Ml(o,a.x,h.x,l.x,u.x),Ml(o,a.y,h.y,l.y,u.y)),i}copy(t){super.copy(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push(i.clone())}return this}toJSON(){const t=super.toJSON();t.points=[];for(let e=0,i=this.points.length;e<i;e++){const i=this.points[e];t.points.push(i.toArray())}return t}fromJSON(t){super.fromJSON(t),this.points=[];for(let e=0,i=t.points.length;e<i;e++){const i=t.points[e];this.points.push((new Ci).fromArray(i))}return this}}Il.prototype.isSplineCurve=!0;var Fl=Object.freeze({__proto__:null,ArcCurve:xl,CatmullRomCurve3:El,CubicBezierCurve:Pl,CubicBezierCurve3:Rl,EllipseCurve:yl,LineCurve:Ll,LineCurve3:Ol,QuadraticBezierCurve:Dl,QuadraticBezierCurve3:Bl,SplineCurve:Il});class kl extends vl{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(t){this.curves.push(t)}closePath(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new Ll(e,t))}getPoint(t,e){const i=t*this.getLength(),n=this.getCurveLengths();let r=0;for(;r<n.length;){if(n[r]>=i){const t=n[r]-i,s=this.curves[r],o=s.getLength(),a=0===o?0:1-t/o;return s.getPointAt(a,e)}r++}return null}getLength(){const t=this.getCurveLengths();return t[t.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){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;i<n;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t}getSpacedPoints(t=40){const e=[];for(let i=0;i<=t;i++)e.push(this.getPoint(i/t));return this.autoClose&&e.push(e[0]),e}getPoints(t=12){const e=[];let i;for(let n=0,r=this.curves;n<r.length;n++){const s=r[n],o=s.isEllipseCurve?2*t:s.isLineCurve||s.isLineCurve3?1:s.isSplineCurve?t*s.points.length:t,a=s.getPoints(o);for(let t=0;t<a.length;t++){const n=a[t];i&&i.equals(n)||(e.push(n),i=n)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e}copy(t){super.copy(t),this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){const i=t.curves[e];this.curves.push(i.clone())}return this.autoClose=t.autoClose,this}toJSON(){const t=super.toJSON();t.autoClose=this.autoClose,t.curves=[];for(let e=0,i=this.curves.length;e<i;e++){const i=this.curves[e];t.curves.push(i.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,i=t.curves.length;e<i;e++){const i=t.curves[e];this.curves.push((new Fl[i.type]).fromJSON(i))}return this}}class Nl extends kl{constructor(t){super(),this.type="Path",this.currentPoint=new Ci,t&&this.setFromPoints(t)}setFromPoints(t){this.moveTo(t[0].x,t[0].y);for(let e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y);return this}moveTo(t,e){return this.currentPoint.set(t,e),this}lineTo(t,e){const i=new Ll(this.currentPoint.clone(),new Ci(t,e));return this.curves.push(i),this.currentPoint.set(t,e),this}quadraticCurveTo(t,e,i,n){const r=new Dl(this.currentPoint.clone(),new Ci(t,e),new Ci(i,n));return this.curves.push(r),this.currentPoint.set(i,n),this}bezierCurveTo(t,e,i,n,r,s){const o=new Pl(this.currentPoint.clone(),new Ci(t,e),new Ci(i,n),new Ci(r,s));return this.curves.push(o),this.currentPoint.set(r,s),this}splineThru(t){const e=[this.currentPoint.clone()].concat(t),i=new Il(e);return this.curves.push(i),this.currentPoint.copy(t[t.length-1]),this}arc(t,e,i,n,r,s){const o=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(t+o,e+a,i,n,r,s),this}absarc(t,e,i,n,r,s){return this.absellipse(t,e,i,i,n,r,s),this}ellipse(t,e,i,n,r,s,o,a){const h=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(t+h,e+l,i,n,r,s,o,a),this}absellipse(t,e,i,n,r,s,o,a){const h=new yl(t,e,i,n,r,s,o,a);if(this.curves.length>0){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(t){return super.copy(t),this.currentPoint.copy(t.currentPoint),this}toJSON(){const t=super.toJSON();return t.currentPoint=this.currentPoint.toArray(),t}fromJSON(t){return super.fromJSON(t),this.currentPoint.fromArray(t.currentPoint),this}}class zl extends Gr{constructor(t=[new Ci(0,.5),new Ci(.5,0),new Ci(0,-.5)],e=12,i=0,n=2*Math.PI){super(),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:n},e=Math.floor(e),n=bi(n,0,2*Math.PI);const r=[],s=[],o=[],a=[],h=[],l=1/e,u=new on,c=new Ci,d=new on,p=new on,f=new on;let m=0,g=0;for(let e=0;e<=t.length-1;e++)switch(e){case 0:m=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-m,d.z=0*g,f.copy(d),d.normalize(),a.push(d.x,d.y,d.z);break;case t.length-1:a.push(f.x,f.y,f.z);break;default:m=t[e+1].x-t[e].x,g=t[e+1].y-t[e].y,d.x=1*g,d.y=-m,d.z=0*g,p.copy(d),d.x+=f.x,d.y+=f.y,d.z+=f.z,d.normalize(),a.push(d.x,d.y,d.z),f.copy(p)}for(let r=0;r<=e;r++){const d=i+r*l*n,p=Math.sin(d),f=Math.cos(d);for(let i=0;i<=t.length-1;i++){u.x=t[i].x*p,u.y=t[i].y,u.z=t[i].x*f,s.push(u.x,u.y,u.z),c.x=r/e,c.y=i/(t.length-1),o.push(c.x,c.y);const n=a[3*i+0]*p,l=a[3*i+1],d=a[3*i+0]*f;h.push(n,l,d)}}for(let i=0;i<e;i++)for(let e=0;e<t.length-1;e++){const n=e+i*t.length,s=n,o=n+t.length,a=n+t.length+1,h=n+1;r.push(s,o,h),r.push(a,h,o)}this.setIndex(r),this.setAttribute("position",new Br(s,3)),this.setAttribute("uv",new Br(o,2)),this.setAttribute("normal",new Br(h,3))}static fromJSON(t){return new zl(t.points,t.segments,t.phiStart,t.phiLength)}}class Ul extends zl{constructor(t=1,e=1,i=4,n=8){const r=new Nl;r.absarc(0,-e/2,t,1.5*Math.PI,0),r.absarc(0,e/2,t,0,.5*Math.PI),super(r.getPoints(i),n),this.type="CapsuleGeometry",this.parameters={radius:t,height:e,capSegments:i,radialSegments:n}}static fromJSON(t){return new Ul(t.radius,t.length,t.capSegments,t.radialSegments)}}class Vl extends Gr{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 on,l=new Ci;s.push(0,0,0),o.push(0,0,1),a.push(.5,.5);for(let r=0,u=3;r<=e;r++,u+=3){const c=i+r/e*n;h.x=t*Math.cos(c),h.y=t*Math.sin(c),s.push(h.x,h.y,h.z),o.push(0,0,1),l.x=(s[u]/t+1)/2,l.y=(s[u+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 Br(s,3)),this.setAttribute("normal",new Br(o,3)),this.setAttribute("uv",new Br(a,2))}static fromJSON(t){return new Vl(t.radius,t.segments,t.thetaStart,t.thetaLength)}}class Hl extends Gr{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=[],u=[],c=[],d=[];let p=0;const f=[],m=i/2;let g=0;function v(i){const r=p,s=new Ci,f=new on;let v=0;const y=!0===i?t:e,x=!0===i?1:-1;for(let t=1;t<=n;t++)u.push(0,m*x,0),c.push(0,x,0),d.push(.5,.5),p++;const w=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,u.push(f.x,f.y,f.z),c.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;t<n;t++){const e=r+t,n=w+t;!0===i?l.push(n,n+1,e):l.push(n+1,n,e),v+=3}h.addGroup(g,v,!0===i?1:2),g+=v}!function(){const s=new on,v=new on;let y=0;const x=(e-t)/i;for(let h=0;h<=r;h++){const l=[],g=h/r,y=g*(e-t)+t;for(let t=0;t<=n;t++){const e=t/n,r=e*a+o,h=Math.sin(r),f=Math.cos(r);v.x=y*h,v.y=-g*i+m,v.z=y*f,u.push(v.x,v.y,v.z),s.set(h,x,f).normalize(),c.push(s.x,s.y,s.z),d.push(e,1-g),l.push(p++)}f.push(l)}for(let t=0;t<n;t++)for(let e=0;e<r;e++){const i=f[e][t],n=f[e+1][t],r=f[e+1][t+1],s=f[e][t+1];l.push(i,n,s),l.push(n,r,s),y+=6}h.addGroup(g,y,0),g+=y}(),!1===s&&(t>0&&v(!0),e>0&&v(!1)),this.setIndex(l),this.setAttribute("position",new Br(u,3)),this.setAttribute("normal",new Br(c,3)),this.setAttribute("uv",new Br(d,2))}static fromJSON(t){return new Hl(t.radiusTop,t.radiusBottom,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class Gl extends Hl{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}}static fromJSON(t){return new Gl(t.radius,t.height,t.radialSegments,t.heightSegments,t.openEnded,t.thetaStart,t.thetaLength)}}class Wl extends Gr{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<r;t++)for(let e=0;e<2*(r-t)-1;e++){const i=Math.floor(e/2);e%2==0?(a(s[t][i+1]),a(s[t+1][i]),a(s[t][i])):(a(s[t][i+1]),a(s[t+1][i+1]),a(s[t+1][i]))}}function a(t){r.push(t.x,t.y,t.z)}function h(e,i){const n=3*e;i.x=t[n+0],i.y=t[n+1],i.z=t[n+2]}function l(t,e,i,n){n<0&&1===t.x&&(s[e]=t.x-1),0===i.x&&0===i.z&&(s[e]=n/2/Math.PI+.5)}function u(t){return Math.atan2(t.z,-t.x)}!function(t){const i=new on,n=new on,r=new on;for(let s=0;s<e.length;s+=3)h(e[s+0],i),h(e[s+1],n),h(e[s+2],r),o(i,n,r,t)}(n),function(t){const e=new on;for(let i=0;i<r.length;i+=3)e.x=r[i+0],e.y=r[i+1],e.z=r[i+2],e.normalize().multiplyScalar(t),r[i+0]=e.x,r[i+1]=e.y,r[i+2]=e.z}(i),function(){const t=new on;for(let i=0;i<r.length;i+=3){t.x=r[i+0],t.y=r[i+1],t.z=r[i+2];const n=u(t)/2/Math.PI+.5,o=(e=t,Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))/Math.PI+.5);s.push(n,1-o)}var e;(function(){const t=new on,e=new on,i=new on,n=new on,o=new Ci,a=new Ci,h=new Ci;for(let c=0,d=0;c<r.length;c+=9,d+=6){t.set(r[c+0],r[c+1],r[c+2]),e.set(r[c+3],r[c+4],r[c+5]),i.set(r[c+6],r[c+7],r[c+8]),o.set(s[d+0],s[d+1]),a.set(s[d+2],s[d+3]),h.set(s[d+4],s[d+5]),n.copy(t).add(e).add(i).divideScalar(3);const p=u(n);l(o,d+0,t,p),l(a,d+2,e,p),l(h,d+4,i,p)}})(),function(){for(let t=0;t<s.length;t+=6){const e=s[t+0],i=s[t+2],n=s[t+4],r=Math.max(e,i,n),o=Math.min(e,i,n);r>.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 Br(r,3)),this.setAttribute("normal",new Br(r.slice(),3)),this.setAttribute("uv",new Br(s,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}static fromJSON(t){return new Wl(t.vertices,t.indices,t.radius,t.details)}}class Yl extends Wl{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}}static fromJSON(t){return new Yl(t.radius,t.detail)}}const Xl=new on,jl=new on,ql=new on,Ql=new xr;class Kl extends Gr{constructor(t=null,e=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:t,thresholdAngle:e},null!==t){const i=4,n=Math.pow(10,i),r=Math.cos(yi*e),s=t.getIndex(),o=t.getAttribute("position"),a=s?s.count:o.count,h=[0,0,0],l=["a","b","c"],u=new Array(3),c={},d=[];for(let t=0;t<a;t+=3){s?(h[0]=s.getX(t),h[1]=s.getX(t+1),h[2]=s.getX(t+2)):(h[0]=t,h[1]=t+1,h[2]=t+2);const{a:e,b:i,c:a}=Ql;if(e.fromBufferAttribute(o,h[0]),i.fromBufferAttribute(o,h[1]),a.fromBufferAttribute(o,h[2]),Ql.getNormal(ql),u[0]=`${Math.round(e.x*n)},${Math.round(e.y*n)},${Math.round(e.z*n)}`,u[1]=`${Math.round(i.x*n)},${Math.round(i.y*n)},${Math.round(i.z*n)}`,u[2]=`${Math.round(a.x*n)},${Math.round(a.y*n)},${Math.round(a.z*n)}`,u[0]!==u[1]&&u[1]!==u[2]&&u[2]!==u[0])for(let t=0;t<3;t++){const e=(t+1)%3,i=u[t],n=u[e],s=Ql[l[t]],o=Ql[l[e]],a=`${i}_${n}`,p=`${n}_${i}`;p in c&&c[p]?(ql.dot(c[p].normal)<=r&&(d.push(s.x,s.y,s.z),d.push(o.x,o.y,o.z)),c[p]=null):a in c||(c[a]={index0:h[t],index1:h[e],normal:ql.clone()})}}for(const t in c)if(c[t]){const{index0:e,index1:i}=c[t];Xl.fromBufferAttribute(o,e),jl.fromBufferAttribute(o,i),d.push(Xl.x,Xl.y,Xl.z),d.push(jl.x,jl.y,jl.z)}this.setAttribute("position",new Br(d,3))}}}class Jl extends Nl{constructor(t){super(t),this.uuid=wi(),this.type="Shape",this.holes=[]}getPointsHoles(t){const e=[];for(let i=0,n=this.holes.length;i<n;i++)e[i]=this.holes[i].getPoints(t);return e}extractPoints(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}}copy(t){super.copy(t),this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){const i=t.holes[e];this.holes.push(i.clone())}return this}toJSON(){const t=super.toJSON();t.uuid=this.uuid,t.holes=[];for(let e=0,i=this.holes.length;e<i;e++){const i=this.holes[e];t.holes.push(i.toJSON())}return t}fromJSON(t){super.fromJSON(t),this.uuid=t.uuid,this.holes=[];for(let e=0,i=t.holes.length;e<i;e++){const i=t.holes[e];this.holes.push((new Nl).fromJSON(i))}return this}}const Zl=function(t,e,i=2){const n=e&&e.length,r=n?e[0]*i:t.length;let s=$l(t,0,r,i,!0);const o=[];if(!s||s.next===s.prev)return o;let a,h,l,u,c,d,p;if(n&&(s=function(t,e,i,n){const r=[];let s,o,a,h,l;for(s=0,o=e.length;s<o;s++)a=e[s]*n,h=s<o-1?e[s+1]*n:t.length,l=$l(t,a,h,n,!1),l===l.next&&(l.steiner=!0),r.push(uu(l));for(r.sort(ou),s=0;s<r.length;s++)au(r[s],i),i=tu(i,i.next);return i}(t,e,s,i)),t.length>80*i){a=l=t[0],h=u=t[1];for(let e=i;e<r;e+=i)c=t[e],d=t[e+1],c<a&&(a=c),d<h&&(h=d),c>l&&(l=c),d>u&&(u=d);p=Math.max(l-a,u-h),p=0!==p?1/p:0}return eu(s,o,i,a,h,p),o};function $l(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;s<i;s+=n)r+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return r}(t,e,i,n)>0)for(s=e;s<i;s+=n)o=wu(s,t[s],t[s+1],o);else for(s=i-n;s>=e;s-=n)o=wu(s,t[s],t[s+1],o);return o&&fu(o,o.next)&&(bu(o),o=o.next),o}function tu(t,e){if(!t)return t;e||(e=t);let i,n=t;do{if(i=!1,n.steiner||!fu(n,n.next)&&0!==pu(n.prev,n,n.next))n=n.next;else{if(bu(n),n=e=n.prev,n===n.next)break;i=!0}}while(i||n!==e);return e}function eu(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=lu(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;e<l&&(a++,n=n.nextZ,n);e++);for(h=l;a>0||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?nu(t,n,r,s):iu(t))e.push(a.i/i),e.push(t.i/i),e.push(h.i/i),bu(t),t=h.next,l=h.next;else if((t=h)===l){o?1===o?eu(t=ru(tu(t),e,i),e,i,n,r,s,2):2===o&&su(t,e,i,n,r,s):eu(tu(t),e,i,n,r,s,1);break}}function iu(t){const e=t.prev,i=t,n=t.next;if(pu(e,i,n)>=0)return!1;let r=t.next.next;for(;r!==t.prev;){if(cu(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&pu(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function nu(t,e,i,n){const r=t.prev,s=t,o=t.next;if(pu(r,s,o)>=0)return!1;const a=r.x<s.x?r.x<o.x?r.x:o.x:s.x<o.x?s.x:o.x,h=r.y<s.y?r.y<o.y?r.y:o.y:s.y<o.y?s.y:o.y,l=r.x>s.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,u=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,c=lu(a,h,e,i,n),d=lu(l,u,e,i,n);let p=t.prevZ,f=t.nextZ;for(;p&&p.z>=c&&f&&f.z<=d;){if(p!==t.prev&&p!==t.next&&cu(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&pu(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,f!==t.prev&&f!==t.next&&cu(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&pu(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&cu(r.x,r.y,s.x,s.y,o.x,o.y,p.x,p.y)&&pu(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&cu(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&pu(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function ru(t,e,i){let n=t;do{const r=n.prev,s=n.next.next;!fu(r,s)&&mu(r,n,n.next,s)&&yu(r,s)&&yu(s,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(s.i/i),bu(n),bu(n.next),n=t=s),n=n.next}while(n!==t);return tu(n)}function su(t,e,i,n,r,s){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&du(o,t)){let a=xu(o,t);return o=tu(o,o.next),a=tu(a,a.next),eu(o,e,i,n,r,s),void eu(a,e,i,n,r,s)}t=t.next}o=o.next}while(o!==t)}function ou(t,e){return t.x-e.x}function au(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.next.x?i:i.next}}i=i.next}while(i!==e);if(!s)return null;if(n===o)return s;const a=s,h=s.x,l=s.y;let u,c=1/0;i=s;do{n>=i.x&&i.x>=h&&n!==i.x&&cu(r<l?n:o,r,h,l,r<l?o:n,r,i.x,i.y)&&(u=Math.abs(r-i.y)/(n-i.x),yu(i,t)&&(u<c||u===c&&(i.x>s.x||i.x===s.x&&hu(s,i)))&&(s=i,c=u)),i=i.next}while(i!==a);return s}(t,e)){const i=xu(e,t);tu(e,e.next),tu(i,i.next)}}function hu(t,e){return pu(t.prev,t,e.prev)<0&&pu(e.next,t,t.next)<0}function lu(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 uu(t){let e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function cu(t,e,i,n,r,s,o,a){return(r-o)*(e-a)-(t-o)*(s-a)>=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(s-a)-(r-o)*(n-a)>=0}function du(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&&mu(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(yu(t,e)&&yu(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)&&(pu(t.prev,t,e.prev)||pu(t,e.prev,e))||fu(t,e)&&pu(t.prev,t,t.next)>0&&pu(e.prev,e,e.next)>0)}function pu(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function fu(t,e){return t.x===e.x&&t.y===e.y}function mu(t,e,i,n){const r=vu(pu(t,e,i)),s=vu(pu(t,e,n)),o=vu(pu(i,n,t)),a=vu(pu(i,n,e));return r!==s&&o!==a||(!(0!==r||!gu(t,i,e))||(!(0!==s||!gu(t,n,e))||(!(0!==o||!gu(i,t,n))||!(0!==a||!gu(i,e,n)))))}function gu(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 vu(t){return t>0?1:t<0?-1:0}function yu(t,e){return pu(t.prev,t,t.next)<0?pu(t,e,t.next)>=0&&pu(t,t.prev,e)>=0:pu(t,e,t.prev)<0||pu(t,t.next,e)<0}function xu(t,e){const i=new Au(t.i,t.x,t.y),n=new Au(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 wu(t,e,i,n){const r=new Au(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 bu(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 Au(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}class Tu{static area(t){const e=t.length;let i=0;for(let n=e-1,r=0;r<e;n=r++)i+=t[n].x*t[r].y-t[r].x*t[n].y;return.5*i}static isClockWise(t){return Tu.area(t)<0}static triangulateShape(t,e){const i=[],n=[],r=[];Su(t),Eu(i,t);let s=t.length;e.forEach(Su);for(let t=0;t<e.length;t++)n.push(s),s+=e[t].length,Eu(i,e[t]);const o=Zl(i,n);for(let t=0;t<o.length;t+=3)r.push(o.slice(t,t+3));return r}}function Su(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function Eu(t,e){for(let i=0;i<e.length;i++)t.push(e[i].x),t.push(e[i].y)}class Mu extends Gr{constructor(t=new Jl([new Ci(.5,.5),new Ci(-.5,.5),new Ci(-.5,-.5),new Ci(.5,-.5)]),e={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const i=this,n=[],r=[];for(let e=0,i=t.length;e<i;e++){s(t[e])}function s(t){const s=[],o=void 0!==e.curveSegments?e.curveSegments:12,a=void 0!==e.steps?e.steps:1;let h=void 0!==e.depth?e.depth:1,l=void 0===e.bevelEnabled||e.bevelEnabled,u=void 0!==e.bevelThickness?e.bevelThickness:.2,c=void 0!==e.bevelSize?e.bevelSize:u-.1,d=void 0!==e.bevelOffset?e.bevelOffset:0,p=void 0!==e.bevelSegments?e.bevelSegments:3;const f=e.extrudePath,m=void 0!==e.UVGenerator?e.UVGenerator:_u;void 0!==e.amount&&(h=e.amount);let g,v,y,x,w,b=!1;f&&(g=f.getSpacedPoints(a),b=!0,l=!1,v=f.computeFrenetFrames(a,!1),y=new on,x=new on,w=new on),l||(p=0,u=0,c=0,d=0);const A=t.extractPoints(o);let T=A.shape;const S=A.holes;if(!Tu.isClockWise(T)){T=T.reverse();for(let t=0,e=S.length;t<e;t++){const e=S[t];Tu.isClockWise(e)&&(S[t]=e.reverse())}}const E=Tu.triangulateShape(T,S),M=T;for(let t=0,e=S.length;t<e;t++){const e=S[t];T=T.concat(e)}function _(t,e,i){return e.clone().multiplyScalar(i).add(t)}const C=T.length,P=E.length;function R(t,e,i){let n,r,s;const o=t.x-e.x,a=t.y-e.y,h=i.x-t.x,l=i.y-t.y,u=o*o+a*a,c=o*l-a*h;if(Math.abs(c)>Number.EPSILON){const c=Math.sqrt(u),d=Math.sqrt(h*h+l*l),p=e.x-a/c,f=e.y+o/c,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 Ci(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(u)):(n=o,r=a,s=Math.sqrt(u/2))}return new Ci(n/s,r/s)}const L=[];for(let t=0,e=M.length,i=e-1,n=t+1;t<e;t++,i++,n++)i===e&&(i=0),n===e&&(n=0),L[t]=R(M[t],M[i],M[n]);const O=[];let D,B=L.concat();for(let t=0,e=S.length;t<e;t++){const e=S[t];D=[];for(let t=0,i=e.length,n=i-1,r=t+1;t<i;t++,n++,r++)n===i&&(n=0),r===i&&(r=0),D[t]=R(e[t],e[n],e[r]);O.push(D),B=B.concat(D)}for(let t=0;t<p;t++){const e=t/p,i=u*Math.cos(e*Math.PI/2),n=c*Math.sin(e*Math.PI/2)+d;for(let t=0,e=M.length;t<e;t++){const e=_(M[t],L[t],n);k(e.x,e.y,-i)}for(let t=0,e=S.length;t<e;t++){const e=S[t];D=O[t];for(let t=0,r=e.length;t<r;t++){const r=_(e[t],D[t],n);k(r.x,r.y,-i)}}}const I=c+d;for(let t=0;t<C;t++){const e=l?_(T[t],B[t],I):T[t];b?(x.copy(v.normals[0]).multiplyScalar(e.x),y.copy(v.binormals[0]).multiplyScalar(e.y),w.copy(g[0]).add(x).add(y),k(w.x,w.y,w.z)):k(e.x,e.y,0)}for(let t=1;t<=a;t++)for(let e=0;e<C;e++){const i=l?_(T[e],B[e],I):T[e];b?(x.copy(v.normals[t]).multiplyScalar(i.x),y.copy(v.binormals[t]).multiplyScalar(i.y),w.copy(g[t]).add(x).add(y),k(w.x,w.y,w.z)):k(i.x,i.y,h/a*t)}for(let t=p-1;t>=0;t--){const e=t/p,i=u*Math.cos(e*Math.PI/2),n=c*Math.sin(e*Math.PI/2)+d;for(let t=0,e=M.length;t<e;t++){const e=_(M[t],L[t],n);k(e.x,e.y,h+i)}for(let t=0,e=S.length;t<e;t++){const e=S[t];D=O[t];for(let t=0,r=e.length;t<r;t++){const r=_(e[t],D[t],n);b?k(r.x,r.y+g[a-1].y,g[a-1].x+i):k(r.x,r.y,h+i)}}}function F(t,e){let i=t.length;for(;--i>=0;){const n=i;let r=i-1;r<0&&(r=t.length-1);for(let t=0,i=a+2*p;t<i;t++){const i=C*t,s=C*(t+1);z(e+n+i,e+r+i,e+r+s,e+n+s)}}}function k(t,e,i){s.push(t),s.push(e),s.push(i)}function N(t,e,r){U(t),U(e),U(r);const s=n.length/3,o=m.generateTopUV(i,n,s-3,s-2,s-1);V(o[0]),V(o[1]),V(o[2])}function z(t,e,r,s){U(t),U(e),U(s),U(e),U(r),U(s);const o=n.length/3,a=m.generateSideWallUV(i,n,o-6,o-3,o-2,o-1);V(a[0]),V(a[1]),V(a[3]),V(a[1]),V(a[2]),V(a[3])}function U(t){n.push(s[3*t+0]),n.push(s[3*t+1]),n.push(s[3*t+2])}function V(t){r.push(t.x),r.push(t.y)}!function(){const t=n.length/3;if(l){let t=0,e=C*t;for(let t=0;t<P;t++){const i=E[t];N(i[2]+e,i[1]+e,i[0]+e)}t=a+2*p,e=C*t;for(let t=0;t<P;t++){const i=E[t];N(i[0]+e,i[1]+e,i[2]+e)}}else{for(let t=0;t<P;t++){const e=E[t];N(e[2],e[1],e[0])}for(let t=0;t<P;t++){const e=E[t];N(e[0]+C*a,e[1]+C*a,e[2]+C*a)}}i.addGroup(t,n.length/3-t,0)}(),function(){const t=n.length/3;let e=0;F(M,e),e+=M.length;for(let t=0,i=S.length;t<i;t++){const i=S[t];F(i,e),e+=i.length}i.addGroup(t,n.length/3-t,1)}()}this.setAttribute("position",new Br(n,3)),this.setAttribute("uv",new Br(r,2)),this.computeVertexNormals()}toJSON(){const t=super.toJSON();return function(t,e,i){if(i.shapes=[],Array.isArray(t))for(let e=0,n=t.length;e<n;e++){const n=t[e];i.shapes.push(n.uuid)}else i.shapes.push(t.uuid);void 0!==e.extrudePath&&(i.options.extrudePath=e.extrudePath.toJSON());return i}(this.parameters.shapes,this.parameters.options,t)}static fromJSON(t,e){const i=[];for(let n=0,r=t.shapes.length;n<r;n++){const r=e[t.shapes[n]];i.push(r)}const n=t.options.extrudePath;return void 0!==n&&(t.options.extrudePath=(new Fl[n.type]).fromJSON(n)),new Mu(i,t.options)}}const _u={generateTopUV:function(t,e,i,n,r){const s=e[3*i],o=e[3*i+1],a=e[3*n],h=e[3*n+1],l=e[3*r],u=e[3*r+1];return[new Ci(s,o),new Ci(a,h),new Ci(l,u)]},generateSideWallUV:function(t,e,i,n,r,s){const o=e[3*i],a=e[3*i+1],h=e[3*i+2],l=e[3*n],u=e[3*n+1],c=e[3*n+2],d=e[3*r],p=e[3*r+1],f=e[3*r+2],m=e[3*s],g=e[3*s+1],v=e[3*s+2];return Math.abs(a-u)<Math.abs(o-l)?[new Ci(o,1-h),new Ci(l,1-c),new Ci(d,1-f),new Ci(m,1-v)]:[new Ci(a,1-h),new Ci(u,1-c),new Ci(p,1-f),new Ci(g,1-v)]}};class Cu extends Wl{constructor(t=1,e=0){const i=(1+Math.sqrt(5))/2;super([-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Cu(t.radius,t.detail)}}class Pu extends Wl{constructor(t=1,e=0){super([1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Pu(t.radius,t.detail)}}class Ru extends Gr{constructor(t=.5,e=1,i=8,n=1,r=0,s=2*Math.PI){super(),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:s},i=Math.max(3,i);const o=[],a=[],h=[],l=[];let u=t;const c=(e-t)/(n=Math.max(1,n)),d=new on,p=new Ci;for(let t=0;t<=n;t++){for(let t=0;t<=i;t++){const n=r+t/i*s;d.x=u*Math.cos(n),d.y=u*Math.sin(n),a.push(d.x,d.y,d.z),h.push(0,0,1),p.x=(d.x/e+1)/2,p.y=(d.y/e+1)/2,l.push(p.x,p.y)}u+=c}for(let t=0;t<n;t++){const e=t*(i+1);for(let t=0;t<i;t++){const n=t+e,r=n,s=n+i+1,a=n+i+2,h=n+1;o.push(r,s,h),o.push(s,a,h)}}this.setIndex(o),this.setAttribute("position",new Br(a,3)),this.setAttribute("normal",new Br(h,3)),this.setAttribute("uv",new Br(l,2))}static fromJSON(t){return new Ru(t.innerRadius,t.outerRadius,t.thetaSegments,t.phiSegments,t.thetaStart,t.thetaLength)}}class Lu extends Gr{constructor(t=new Jl([new Ci(0,.5),new Ci(-.5,-.5),new Ci(.5,-.5)]),e=12){super(),this.type="ShapeGeometry",this.parameters={shapes:t,curveSegments:e};const i=[],n=[],r=[],s=[];let o=0,a=0;if(!1===Array.isArray(t))h(t);else for(let e=0;e<t.length;e++)h(t[e]),this.addGroup(o,a,e),o+=a,a=0;function h(t){const o=n.length/3,h=t.extractPoints(e);let l=h.shape;const u=h.holes;!1===Tu.isClockWise(l)&&(l=l.reverse());for(let t=0,e=u.length;t<e;t++){const e=u[t];!0===Tu.isClockWise(e)&&(u[t]=e.reverse())}const c=Tu.triangulateShape(l,u);for(let t=0,e=u.length;t<e;t++){const e=u[t];l=l.concat(e)}for(let t=0,e=l.length;t<e;t++){const e=l[t];n.push(e.x,e.y,0),r.push(0,0,1),s.push(e.x,e.y)}for(let t=0,e=c.length;t<e;t++){const e=c[t],n=e[0]+o,r=e[1]+o,s=e[2]+o;i.push(n,r,s),a+=3}}this.setIndex(i),this.setAttribute("position",new Br(n,3)),this.setAttribute("normal",new Br(r,3)),this.setAttribute("uv",new Br(s,2))}toJSON(){const t=super.toJSON();return function(t,e){if(e.shapes=[],Array.isArray(t))for(let i=0,n=t.length;i<n;i++){const n=t[i];e.shapes.push(n.uuid)}else e.shapes.push(t.uuid);return e}(this.parameters.shapes,t)}static fromJSON(t,e){const i=[];for(let n=0,r=t.shapes.length;n<r;n++){const r=e[t.shapes[n]];i.push(r)}return new Lu(i,t.curveSegments)}}class Ou extends Gr{constructor(t=1,e=32,i=16,n=0,r=2*Math.PI,s=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:n,phiLength:r,thetaStart:s,thetaLength:o},e=Math.max(3,Math.floor(e)),i=Math.max(2,Math.floor(i));const a=Math.min(s+o,Math.PI);let h=0;const l=[],u=new on,c=new on,d=[],p=[],f=[],m=[];for(let d=0;d<=i;d++){const g=[],v=d/i;let y=0;0==d&&0==s?y=.5/e:d==i&&a==Math.PI&&(y=-.5/e);for(let i=0;i<=e;i++){const a=i/e;u.x=-t*Math.cos(n+a*r)*Math.sin(s+v*o),u.y=t*Math.cos(s+v*o),u.z=t*Math.sin(n+a*r)*Math.sin(s+v*o),p.push(u.x,u.y,u.z),c.copy(u).normalize(),f.push(c.x,c.y,c.z),m.push(a+y,1-v),g.push(h++)}l.push(g)}for(let t=0;t<i;t++)for(let n=0;n<e;n++){const e=l[t][n+1],r=l[t][n],o=l[t+1][n],h=l[t+1][n+1];(0!==t||s>0)&&d.push(e,r,h),(t!==i-1||a<Math.PI)&&d.push(r,o,h)}this.setIndex(d),this.setAttribute("position",new Br(p,3)),this.setAttribute("normal",new Br(f,3)),this.setAttribute("uv",new Br(m,2))}static fromJSON(t){return new Ou(t.radius,t.widthSegments,t.heightSegments,t.phiStart,t.phiLength,t.thetaStart,t.thetaLength)}}class Du extends Wl{constructor(t=1,e=0){super([1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e}}static fromJSON(t){return new Du(t.radius,t.detail)}}class Bu extends Gr{constructor(t=1,e=.4,i=8,n=6,r=2*Math.PI){super(),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:n,arc:r},i=Math.floor(i),n=Math.floor(n);const s=[],o=[],a=[],h=[],l=new on,u=new on,c=new on;for(let s=0;s<=i;s++)for(let d=0;d<=n;d++){const p=d/n*r,f=s/i*Math.PI*2;u.x=(t+e*Math.cos(f))*Math.cos(p),u.y=(t+e*Math.cos(f))*Math.sin(p),u.z=e*Math.sin(f),o.push(u.x,u.y,u.z),l.x=t*Math.cos(p),l.y=t*Math.sin(p),c.subVectors(u,l).normalize(),a.push(c.x,c.y,c.z),h.push(d/n),h.push(s/i)}for(let t=1;t<=i;t++)for(let e=1;e<=n;e++){const i=(n+1)*t+e-1,r=(n+1)*(t-1)+e-1,o=(n+1)*(t-1)+e,a=(n+1)*t+e;s.push(i,r,a),s.push(r,o,a)}this.setIndex(s),this.setAttribute("position",new Br(o,3)),this.setAttribute("normal",new Br(a,3)),this.setAttribute("uv",new Br(h,2))}static fromJSON(t){return new Bu(t.radius,t.tube,t.radialSegments,t.tubularSegments,t.arc)}}class Iu extends Gr{constructor(t=1,e=.4,i=64,n=8,r=2,s=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:i,radialSegments:n,p:r,q:s},i=Math.floor(i),n=Math.floor(n);const o=[],a=[],h=[],l=[],u=new on,c=new on,d=new on,p=new on,f=new on,m=new on,g=new on;for(let o=0;o<=i;++o){const y=o/i*r*Math.PI*2;v(y,r,s,t,d),v(y+.01,r,s,t,p),m.subVectors(p,d),g.addVectors(p,d),f.crossVectors(m,g),g.crossVectors(f,m),f.normalize(),g.normalize();for(let t=0;t<=n;++t){const r=t/n*Math.PI*2,s=-e*Math.cos(r),p=e*Math.sin(r);u.x=d.x+(s*g.x+p*f.x),u.y=d.y+(s*g.y+p*f.y),u.z=d.z+(s*g.z+p*f.z),a.push(u.x,u.y,u.z),c.subVectors(u,d).normalize(),h.push(c.x,c.y,c.z),l.push(o/i),l.push(t/n)}}for(let t=1;t<=i;t++)for(let e=1;e<=n;e++){const i=(n+1)*(t-1)+(e-1),r=(n+1)*t+(e-1),s=(n+1)*t+e,a=(n+1)*(t-1)+e;o.push(i,r,a),o.push(r,s,a)}function v(t,e,i,n,r){const s=Math.cos(t),o=Math.sin(t),a=i/e*t,h=Math.cos(a);r.x=n*(2+h)*.5*s,r.y=n*(2+h)*o*.5,r.z=n*Math.sin(a)*.5}this.setIndex(o),this.setAttribute("position",new Br(a,3)),this.setAttribute("normal",new Br(h,3)),this.setAttribute("uv",new Br(l,2))}static fromJSON(t){return new Iu(t.radius,t.tube,t.tubularSegments,t.radialSegments,t.p,t.q)}}class Fu extends Gr{constructor(t=new Bl(new on(-1,-1,0),new on(-1,1,0),new on(1,1,0)),e=64,i=1,n=8,r=!1){super(),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:i,radialSegments:n,closed:r};const s=t.computeFrenetFrames(e,r);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals;const o=new on,a=new on,h=new Ci;let l=new on;const u=[],c=[],d=[],p=[];function f(r){l=t.getPointAt(r/e,l);const h=s.normals[r],d=s.binormals[r];for(let t=0;t<=n;t++){const e=t/n*Math.PI*2,r=Math.sin(e),s=-Math.cos(e);a.x=s*h.x+r*d.x,a.y=s*h.y+r*d.y,a.z=s*h.z+r*d.z,a.normalize(),c.push(a.x,a.y,a.z),o.x=l.x+i*a.x,o.y=l.y+i*a.y,o.z=l.z+i*a.z,u.push(o.x,o.y,o.z)}}!function(){for(let t=0;t<e;t++)f(t);f(!1===r?e:0),function(){for(let t=0;t<=e;t++)for(let i=0;i<=n;i++)h.x=t/e,h.y=i/n,d.push(h.x,h.y)}(),function(){for(let t=1;t<=e;t++)for(let e=1;e<=n;e++){const i=(n+1)*(t-1)+(e-1),r=(n+1)*t+(e-1),s=(n+1)*t+e,o=(n+1)*(t-1)+e;p.push(i,r,o),p.push(r,s,o)}}()}(),this.setIndex(p),this.setAttribute("position",new Br(u,3)),this.setAttribute("normal",new Br(c,3)),this.setAttribute("uv",new Br(d,2))}toJSON(){const t=super.toJSON();return t.path=this.parameters.path.toJSON(),t}static fromJSON(t){return new Fu((new Fl[t.path.type]).fromJSON(t.path),t.tubularSegments,t.radius,t.radialSegments,t.closed)}}class ku extends Gr{constructor(t=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:t},null!==t){const e=[],i=new Set,n=new on,r=new on;if(null!==t.index){const s=t.attributes.position,o=t.index;let a=t.groups;0===a.length&&(a=[{start:0,count:o.count,materialIndex:0}]);for(let t=0,h=a.length;t<h;++t){const h=a[t],l=h.start;for(let t=l,a=l+h.count;t<a;t+=3)for(let a=0;a<3;a++){const h=o.getX(t+a),l=o.getX(t+(a+1)%3);n.fromBufferAttribute(s,h),r.fromBufferAttribute(s,l),!0===Nu(n,r,i)&&(e.push(n.x,n.y,n.z),e.push(r.x,r.y,r.z))}}}else{const s=t.attributes.position;for(let t=0,o=s.count/3;t<o;t++)for(let o=0;o<3;o++){const a=3*t+o,h=3*t+(o+1)%3;n.fromBufferAttribute(s,a),r.fromBufferAttribute(s,h),!0===Nu(n,r,i)&&(e.push(n.x,n.y,n.z),e.push(r.x,r.y,r.z))}}this.setAttribute("position",new Br(e,3))}}}function Nu(t,e,i){const n=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`,r=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`;return!0!==i.has(n)&&!0!==i.has(r)&&(i.add(n),i.add(r),!0)}var zu=Object.freeze({__proto__:null,BoxGeometry:ls,BoxBufferGeometry:ls,CapsuleGeometry:Ul,CapsuleBufferGeometry:Ul,CircleGeometry:Vl,CircleBufferGeometry:Vl,ConeGeometry:Gl,ConeBufferGeometry:Gl,CylinderGeometry:Hl,CylinderBufferGeometry:Hl,DodecahedronGeometry:Yl,DodecahedronBufferGeometry:Yl,EdgesGeometry:Kl,ExtrudeGeometry:Mu,ExtrudeBufferGeometry:Mu,IcosahedronGeometry:Cu,IcosahedronBufferGeometry:Cu,LatheGeometry:zl,LatheBufferGeometry:zl,OctahedronGeometry:Pu,OctahedronBufferGeometry:Pu,PlaneGeometry:Cs,PlaneBufferGeometry:Cs,PolyhedronGeometry:Wl,PolyhedronBufferGeometry:Wl,RingGeometry:Ru,RingBufferGeometry:Ru,ShapeGeometry:Lu,ShapeBufferGeometry:Lu,SphereGeometry:Ou,SphereBufferGeometry:Ou,TetrahedronGeometry:Du,TetrahedronBufferGeometry:Du,TorusGeometry:Bu,TorusBufferGeometry:Bu,TorusKnotGeometry:Iu,TorusKnotBufferGeometry:Iu,TubeGeometry:Fu,TubeBufferGeometry:Fu,WireframeGeometry:ku});class Uu extends br{constructor(t){super(),this.type="ShadowMaterial",this.color=new Wi(0),this.transparent=!0,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.fog=t.fog,this}}Uu.prototype.isShadowMaterial=!0;class Vu extends ps{constructor(t){super(t),this.type="RawShaderMaterial"}}Vu.prototype.isRawShaderMaterial=!0;class Hu extends br{constructor(t){super(),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Wi(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Wi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Fe,this.normalScale=new Ci(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}Hu.prototype.isMeshStandardMaterial=!0;class Gu extends Hu{constructor(t){super(),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Ci(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return bi(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.sheenColor=new Wi(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=0,this.attenuationColor=new Wi(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Wi(1,1,1),this.specularColorMap=null,this._sheen=0,this._clearcoat=0,this._transmission=0,this.setValues(t)}get sheen(){return this._sheen}set sheen(t){this._sheen>0!=t>0&&this.version++,this._sheen=t}get clearcoat(){return this._clearcoat}set clearcoat(t){this._clearcoat>0!=t>0&&this.version++,this._clearcoat=t}get transmission(){return this._transmission}set transmission(t){this._transmission>0!=t>0&&this.version++,this._transmission=t}copy(t){return super.copy(t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.ior=t.ior,this.sheen=t.sheen,this.sheenColor.copy(t.sheenColor),this.sheenColorMap=t.sheenColorMap,this.sheenRoughness=t.sheenRoughness,this.sheenRoughnessMap=t.sheenRoughnessMap,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this.thickness=t.thickness,this.thicknessMap=t.thicknessMap,this.attenuationDistance=t.attenuationDistance,this.attenuationColor.copy(t.attenuationColor),this.specularIntensity=t.specularIntensity,this.specularIntensityMap=t.specularIntensityMap,this.specularColor.copy(t.specularColor),this.specularColorMap=t.specularColorMap,this}}Gu.prototype.isMeshPhysicalMaterial=!0;class Wu extends br{constructor(t){super(),this.type="MeshPhongMaterial",this.color=new Wi(16777215),this.specular=new Wi(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Wi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Fe,this.normalScale=new Ci(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Q,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.flatShading=t.flatShading,this.fog=t.fog,this}}Wu.prototype.isMeshPhongMaterial=!0;class Yu extends br{constructor(t){super(),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Wi(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Wi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Fe,this.normalScale=new Ci(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}Yu.prototype.isMeshToonMaterial=!0;class Xu extends br{constructor(t){super(),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Fe,this.normalScale=new Ci(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(t)}copy(t){return super.copy(t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.flatShading=t.flatShading,this}}Xu.prototype.isMeshNormalMaterial=!0;class ju extends br{constructor(t){super(),this.type="MeshLambertMaterial",this.color=new Wi(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Wi(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=Q,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.fog=t.fog,this}}ju.prototype.isMeshLambertMaterial=!0;class qu extends br{constructor(t){super(),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Wi(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Fe,this.normalScale=new Ci(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(t)}copy(t){return super.copy(t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.flatShading=t.flatShading,this.fog=t.fog,this}}qu.prototype.isMeshMatcapMaterial=!0;class Qu extends Qh{constructor(t){super(),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}copy(t){return super.copy(t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this}}Qu.prototype.isLineDashedMaterial=!0;const Ku={ShadowMaterial:Uu,SpriteMaterial:ph,RawShaderMaterial:Vu,ShaderMaterial:ps,PointsMaterial:ol,MeshPhysicalMaterial:Gu,MeshStandardMaterial:Hu,MeshPhongMaterial:Wu,MeshToonMaterial:Yu,MeshNormalMaterial:Xu,MeshLambertMaterial:ju,MeshDepthMaterial:Xa,MeshDistanceMaterial:ja,MeshBasicMaterial:Ar,MeshMatcapMaterial:qu,LineDashedMaterial:Qu,LineBasicMaterial:Qh,Material:br};br.fromType=function(t){return new Ku[t]};const Ju={arraySlice:function(t,e,i){return Ju.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==i?i:t.length)):t.slice(e,i)},convertArray:function(t,e,i){return!t||!i&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){const e=t.length,i=new Array(e);for(let t=0;t!==e;++t)i[t]=t;return i.sort((function(e,i){return t[e]-t[i]})),i},sortedArray:function(t,e,i){const n=t.length,r=new t.constructor(n);for(let s=0,o=0;o!==n;++s){const n=i[s]*e;for(let i=0;i!==e;++i)r[o++]=t[n+i]}return r},flattenJSON:function(t,e,i,n){let r=1,s=t[0];for(;void 0!==s&&void 0===s[n];)s=t[r++];if(void 0===s)return;let o=s[n];if(void 0!==o)if(Array.isArray(o))do{o=s[n],void 0!==o&&(e.push(s.time),i.push.apply(i,o)),s=t[r++]}while(void 0!==s);else if(void 0!==o.toArray)do{o=s[n],void 0!==o&&(e.push(s.time),o.toArray(i,i.length)),s=t[r++]}while(void 0!==s);else do{o=s[n],void 0!==o&&(e.push(s.time),i.push(o)),s=t[r++]}while(void 0!==s)},subclip:function(t,e,i,n,r=30){const s=t.clone();s.name=e;const o=[];for(let t=0;t<s.tracks.length;++t){const e=s.tracks[t],a=e.getValueSize(),h=[],l=[];for(let t=0;t<e.times.length;++t){const s=e.times[t]*r;if(!(s<i||s>=n)){h.push(e.times[t]);for(let i=0;i<a;++i)l.push(e.values[t*a+i])}}0!==h.length&&(e.times=Ju.convertArray(h,e.times.constructor),e.values=Ju.convertArray(l,e.values.constructor),o.push(e))}s.tracks=o;let a=1/0;for(let t=0;t<s.tracks.length;++t)a>s.tracks[t].times[0]&&(a=s.tracks[t].times[0]);for(let t=0;t<s.tracks.length;++t)s.tracks[t].shift(-1*a);return s.resetDuration(),s},makeClipAdditive:function(t,e=0,i=t,n=30){n<=0&&(n=30);const r=i.tracks.length,s=e/n;for(let e=0;e<r;++e){const n=i.tracks[e],r=n.ValueTypeName;if("bool"===r||"string"===r)continue;const o=t.tracks.find((function(t){return t.name===n.name&&t.ValueTypeName===r}));if(void 0===o)continue;let a=0;const h=n.getValueSize();n.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(a=h/3);let l=0;const u=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(l=u/3);const c=n.times.length-1;let d;if(s<=n.times[0]){const t=a,e=h-a;d=Ju.arraySlice(n.values,t,e)}else if(s>=n.times[c]){const t=c*h+a,e=t+h-a;d=Ju.arraySlice(n.values,t,e)}else{const t=n.createInterpolant(),e=a,i=h-a;t.evaluate(s),d=Ju.arraySlice(t.resultBuffer,e,i)}if("quaternion"===r){(new sn).fromArray(d).normalize().conjugate().toArray(d)}const p=o.times.length;for(let t=0;t<p;++t){const e=t*u+l;if("quaternion"===r)sn.multiplyQuaternionsFlat(o.values,e,d,0,o.values,e);else{const t=u-2*l;for(let i=0;i<t;++i)o.values[e+i]-=d[i]}}}return t.blendMode=Ce,t}};class Zu{constructor(t,e,i,n){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new e.constructor(i),this.sampleValues=e,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(t){const e=this.parameterPositions;let i=this._cachedIndex,n=e[i],r=e[i-1];t:{e:{let s;i:{n:if(!(t<n)){for(let s=i+2;;){if(void 0===n){if(t<r)break n;return i=e.length,this._cachedIndex=i,this.afterEnd_(i-1,t,r)}if(i===s)break;if(r=n,n=e[++i],t<n)break e}s=e.length;break i}if(t>=r)break t;{const o=e[1];t<o&&(i=2,r=o);for(let s=i-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,n);if(i===s)break;if(n=r,r=e[--i-1],t>=r)break e}s=i,i=0}}for(;i<s;){const n=i+s>>>1;t<e[n]?s=n:i=n+1}if(n=e[i],r=e[i-1],void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,n);if(void 0===n)return i=e.length,this._cachedIndex=i,this.afterEnd_(i-1,r,t)}this._cachedIndex=i,this.intervalChanged_(i,r,n)}return this.interpolate_(i,r,t,n)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(t){const e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=t*n;for(let t=0;t!==n;++t)e[t]=i[r+t];return e}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}Zu.prototype.beforeStart_=Zu.prototype.copySampleValue_,Zu.prototype.afterEnd_=Zu.prototype.copySampleValue_;class $u extends Zu{constructor(t,e,i,n){super(t,e,i,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:Se,endingEnd:Se}}intervalChanged_(t,e,i){const n=this.parameterPositions;let r=t-2,s=t+1,o=n[r],a=n[s];if(void 0===o)switch(this.getSettings_().endingStart){case Ee:r=t,o=2*e-i;break;case Me:r=n.length-2,o=e+n[r]-n[r+1];break;default:r=t,o=i}if(void 0===a)switch(this.getSettings_().endingEnd){case Ee:s=t,a=2*i-e;break;case Me:s=1,a=i+n[1]-n[0];break;default:s=t-1,a=e}const h=.5*(i-e),l=this.valueSize;this._weightPrev=h/(e-o),this._weightNext=h/(a-i),this._offsetPrev=r*l,this._offsetNext=s*l}interpolate_(t,e,i,n){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=t*o,h=a-o,l=this._offsetPrev,u=this._offsetNext,c=this._weightPrev,d=this._weightNext,p=(i-e)/(n-e),f=p*p,m=f*p,g=-c*m+2*c*f-c*p,v=(1+c)*m+(-1.5-2*c)*f+(-.5+c)*p+1,y=(-1-d)*m+(1.5+d)*f+.5*p,x=d*m-d*f;for(let t=0;t!==o;++t)r[t]=g*s[l+t]+v*s[h+t]+y*s[a+t]+x*s[u+t];return r}}class tc extends Zu{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t,e,i,n){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=t*o,h=a-o,l=(i-e)/(n-e),u=1-l;for(let t=0;t!==o;++t)r[t]=s[h+t]*u+s[a+t]*l;return r}}class ec extends Zu{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(t){return this.copySampleValue_(t-1)}}class ic{constructor(t,e,i,n){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=Ju.convertArray(e,this.TimeBufferType),this.values=Ju.convertArray(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}static toJSON(t){const e=t.constructor;let i;if(e.toJSON!==this.toJSON)i=e.toJSON(t);else{i={name:t.name,times:Ju.convertArray(t.times,Array),values:Ju.convertArray(t.values,Array)};const e=t.getInterpolation();e!==t.DefaultInterpolation&&(i.interpolation=e)}return i.type=t.ValueTypeName,i}InterpolantFactoryMethodDiscrete(t){return new ec(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodLinear(t){return new tc(this.times,this.values,this.getValueSize(),t)}InterpolantFactoryMethodSmooth(t){return new $u(this.times,this.values,this.getValueSize(),t)}setInterpolation(t){let e;switch(t){case be:e=this.InterpolantFactoryMethodDiscrete;break;case Ae:e=this.InterpolantFactoryMethodLinear;break;case Te:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){const e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return this}return this.createInterpolant=e,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return be;case this.InterpolantFactoryMethodLinear:return Ae;case this.InterpolantFactoryMethodSmooth:return Te}}getValueSize(){return this.values.length/this.times.length}shift(t){if(0!==t){const e=this.times;for(let i=0,n=e.length;i!==n;++i)e[i]+=t}return this}scale(t){if(1!==t){const e=this.times;for(let i=0,n=e.length;i!==n;++i)e[i]*=t}return this}trim(t,e){const i=this.times,n=i.length;let r=0,s=n-1;for(;r!==n&&i[r]<t;)++r;for(;-1!==s&&i[s]>e;)--s;if(++s,0!==r||s!==n){r>=s&&(s=Math.max(s,1),r=s-1);const t=this.getValueSize();this.times=Ju.arraySlice(i,r,s),this.values=Ju.arraySlice(this.values,r*t,s*t)}return this}validate(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(t=!1);const i=this.times,n=this.values,r=i.length;0===r&&(t=!1);let s=null;for(let e=0;e!==r;e++){const n=i[e];if("number"==typeof n&&isNaN(n)){t=!1;break}if(null!==s&&s>n){t=!1;break}s=n}if(void 0!==n&&Ju.isTypedArray(n))for(let e=0,i=n.length;e!==i;++e){const i=n[e];if(isNaN(i)){t=!1;break}}return t}optimize(){const t=Ju.arraySlice(this.times),e=Ju.arraySlice(this.values),i=this.getValueSize(),n=this.getInterpolation()===Te,r=t.length-1;let s=1;for(let o=1;o<r;++o){let r=!1;const a=t[o];if(a!==t[o+1]&&(1!==o||a!==t[0]))if(n)r=!0;else{const t=o*i,n=t-i,s=t+i;for(let o=0;o!==i;++o){const i=e[t+o];if(i!==e[n+o]||i!==e[s+o]){r=!0;break}}}if(r){if(o!==s){t[s]=t[o];const n=o*i,r=s*i;for(let t=0;t!==i;++t)e[r+t]=e[n+t]}++s}}if(r>0){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=Ju.arraySlice(t,0,s),this.values=Ju.arraySlice(e,0,s*i)):(this.times=t,this.values=e),this}clone(){const t=Ju.arraySlice(this.times,0),e=Ju.arraySlice(this.values,0),i=new(0,this.constructor)(this.name,t,e);return i.createInterpolant=this.createInterpolant,i}}ic.prototype.TimeBufferType=Float32Array,ic.prototype.ValueBufferType=Float32Array,ic.prototype.DefaultInterpolation=Ae;class nc extends ic{}nc.prototype.ValueTypeName="bool",nc.prototype.ValueBufferType=Array,nc.prototype.DefaultInterpolation=be,nc.prototype.InterpolantFactoryMethodLinear=void 0,nc.prototype.InterpolantFactoryMethodSmooth=void 0;class rc extends ic{}rc.prototype.ValueTypeName="color";class sc extends ic{}sc.prototype.ValueTypeName="number";class oc extends Zu{constructor(t,e,i,n){super(t,e,i,n)}interpolate_(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)sn.slerpFlat(r,0,s,h-o,s,h,a);return r}}class ac extends ic{InterpolantFactoryMethodLinear(t){return new oc(this.times,this.values,this.getValueSize(),t)}}ac.prototype.ValueTypeName="quaternion",ac.prototype.DefaultInterpolation=Ae,ac.prototype.InterpolantFactoryMethodSmooth=void 0;class hc extends ic{}hc.prototype.ValueTypeName="string",hc.prototype.ValueBufferType=Array,hc.prototype.DefaultInterpolation=be,hc.prototype.InterpolantFactoryMethodLinear=void 0,hc.prototype.InterpolantFactoryMethodSmooth=void 0;class lc extends ic{}lc.prototype.ValueTypeName="vector";class uc{constructor(t,e=-1,i,n=_e){this.name=t,this.tracks=i,this.duration=e,this.blendMode=n,this.uuid=wi(),this.duration<0&&this.resetDuration()}static parse(t){const e=[],i=t.tracks,n=1/(t.fps||1);for(let t=0,r=i.length;t!==r;++t)e.push(cc(i[t]).scale(n));const r=new this(t.name,t.duration,e,t.blendMode);return r.uuid=t.uuid,r}static toJSON(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(ic.toJSON(i[t]));return n}static CreateFromMorphTargetSequence(t,e,i,n){const r=e.length,s=[];for(let t=0;t<r;t++){let o=[],a=[];o.push((t+r-1)%r,t,(t+1)%r),a.push(0,1,0);const h=Ju.getKeyframeOrder(o);o=Ju.sortedArray(o,1,h),a=Ju.sortedArray(a,1,h),n||0!==o[0]||(o.push(r),a.push(a[0])),s.push(new sc(".morphTargetInfluences["+e[t].name+"]",o,a).scale(1/i))}return new this(t,-1,s)}static findByName(t,e){let i=t;if(!Array.isArray(t)){const e=t;i=e.geometry&&e.geometry.animations||e.animations}for(let t=0;t<i.length;t++)if(i[t].name===e)return i[t];return null}static CreateClipsFromMorphTargetSequences(t,e,i){const n={},r=/^([\w-]*?)([\d]+)$/;for(let e=0,i=t.length;e<i;e++){const i=t[e],s=i.name.match(r);if(s&&s.length>1){const t=s[1];let e=n[t];e||(n[t]=e=[]),e.push(i)}}const s=[];for(const t in n)s.push(this.CreateFromMorphTargetSequence(t,n[t],e,i));return s}static parseAnimation(t,e){if(!t)return null;const i=function(t,e,i,n,r){if(0!==i.length){const s=[],o=[];Ju.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;t<h.length;t++){const r=h[t].keys;if(r&&0!==r.length)if(r[0].morphTargets){const t={};let e;for(e=0;e<r.length;e++)if(r[e].morphTargets)for(let i=0;i<r[e].morphTargets.length;i++)t[r[e].morphTargets[i]]=-1;for(const i in t){const t=[],s=[];for(let n=0;n!==r[e].morphTargets.length;++n){const n=r[e];t.push(n.time),s.push(n.morphTarget===i?1:0)}n.push(new sc(".morphTargetInfluence["+i+"]",t,s))}a=t.length*s}else{const s=".bones["+e[t].name+"]";i(lc,s+".position",r,"pos",n),i(ac,s+".quaternion",r,"rot",n),i(lc,s+".scale",r,"scl",n)}}if(0===n.length)return null;return new this(r,a,n,o)}resetDuration(){let t=0;for(let e=0,i=this.tracks.length;e!==i;++e){const i=this.tracks[e];t=Math.max(t,i.times[i.times.length-1])}return this.duration=t,this}trim(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this}validate(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t}optimize(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}clone(){const t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new this.constructor(this.name,this.duration,t,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function cc(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return sc;case"vector":case"vector2":case"vector3":case"vector4":return lc;case"color":return rc;case"quaternion":return ac;case"bool":case"boolean":return nc;case"string":return hc}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){const e=[],i=[];Ju.flattenJSON(t.keys,e,i,"value"),t.times=e,t.values=i}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}const dc={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class pc{constructor(t,e,i){const n=this;let r=!1,s=0,o=0,a=void 0;const h=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(t){o++,!1===r&&void 0!==n.onStart&&n.onStart(t,s,o),r=!0},this.itemEnd=function(t){s++,void 0!==n.onProgress&&n.onProgress(t,s,o),s===o&&(r=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(t){void 0!==n.onError&&n.onError(t)},this.resolveURL=function(t){return a?a(t):t},this.setURLModifier=function(t){return a=t,this},this.addHandler=function(t,e){return h.push(t,e),this},this.removeHandler=function(t){const e=h.indexOf(t);return-1!==e&&h.splice(e,2),this},this.getHandler=function(t){for(let e=0,i=h.length;e<i;e+=2){const i=h[e],n=h[e+1];if(i.global&&(i.lastIndex=0),i.test(t))return n}return null}}}const fc=new pc;class mc{constructor(t){this.manager=void 0!==t?t:fc,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(t,e){const i=this;return new Promise((function(n,r){i.load(t,n,e,r)}))}parse(){}setCrossOrigin(t){return this.crossOrigin=t,this}setWithCredentials(t){return this.withCredentials=t,this}setPath(t){return this.path=t,this}setResourcePath(t){return this.resourcePath=t,this}setRequestHeader(t){return this.requestHeader=t,this}}const gc={};class vc extends mc{constructor(t){super(t)}load(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=dc.get(t);if(void 0!==r)return this.manager.itemStart(t),setTimeout(()=>{e&&e(r),this.manager.itemEnd(t)},0),r;if(void 0!==gc[t])return void gc[t].push({onLoad:e,onProgress:i,onError:n});gc[t]=[],gc[t].push({onLoad:e,onProgress:i,onError:n});const s=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),o=this.mimeType,a=this.responseType;fetch(s).then(e=>{if(200===e.status||0===e.status){if(e.status,"undefined"==typeof ReadableStream||void 0===e.body||void 0===e.body.getReader)return e;const i=gc[t],n=e.body.getReader(),r=e.headers.get("Content-Length"),s=r?parseInt(r):0,o=0!==s;let a=0;const h=new ReadableStream({start(t){!function e(){n.read().then(({done:n,value:r})=>{if(n)t.close();else{a+=r.byteLength;const n=new ProgressEvent("progress",{lengthComputable:o,loaded:a,total:s});for(let t=0,e=i.length;t<e;t++){const e=i[t];e.onProgress&&e.onProgress(n)}t.enqueue(r),e()}})}()}});return new Response(h)}throw Error(`fetch for "${e.url}" responded with ${e.status}: ${e.statusText}`)}).then(t=>{switch(a){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"document":return t.text().then(t=>(new DOMParser).parseFromString(t,o));case"json":return t.json();default:if(void 0===o)return t.text();{const e=/charset="?([^;"\s]*)"?/i.exec(o),i=e&&e[1]?e[1].toLowerCase():void 0,n=new TextDecoder(i);return t.arrayBuffer().then(t=>n.decode(t))}}}).then(e=>{dc.add(t,e);const i=gc[t];delete gc[t];for(let t=0,n=i.length;t<n;t++){const n=i[t];n.onLoad&&n.onLoad(e)}}).catch(e=>{const i=gc[t];if(void 0===i)throw this.manager.itemError(t),e;delete gc[t];for(let t=0,n=i.length;t<n;t++){const n=i[t];n.onError&&n.onError(e)}this.manager.itemError(t)}).finally(()=>{this.manager.itemEnd(t)}),this.manager.itemStart(t)}setResponseType(t){return this.responseType=t,this}setMimeType(t){return this.mimeType=t,this}}class yc extends mc{constructor(t){super(t)}load(t,e,i,n){const r=this,s=new vc(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,(function(i){try{e(r.parse(JSON.parse(i)))}catch(e){n&&n(e),r.manager.itemError(t)}}),i,n)}parse(t){const e=[];for(let i=0;i<t.length;i++){const n=uc.parse(t[i]);e.push(n)}return e}}class xc extends mc{constructor(t){super(t)}load(t,e,i,n){const r=this,s=[],o=new ml,a=new vc(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(r.withCredentials);let h=0;function l(l){a.load(t[l],(function(t){const i=r.parse(t,!0);s[l]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps},h+=1,6===h&&(1===i.mipmapCount&&(o.minFilter=yt),o.image=s,o.format=i.format,o.needsUpdate=!0,e&&e(o))}),i,n)}if(Array.isArray(t))for(let e=0,i=t.length;e<i;++e)l(e);else a.load(t,(function(t){const i=r.parse(t,!0);if(i.isCubemap){const t=i.mipmaps.length/i.mipmapCount;for(let e=0;e<t;e++){s[e]={mipmaps:[]};for(let t=0;t<i.mipmapCount;t++)s[e].mipmaps.push(i.mipmaps[e*i.mipmapCount+t]),s[e].format=i.format,s[e].width=i.width,s[e].height=i.height}o.image=s}else o.image.width=i.width,o.image.height=i.height,o.mipmaps=i.mipmaps;1===i.mipmapCount&&(o.minFilter=yt),o.format=i.format,o.needsUpdate=!0,e&&e(o)}),i,n);return o}}class wc extends mc{constructor(t){super(t)}load(t,e,i,n){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,s=dc.get(t);if(void 0!==s)return r.manager.itemStart(t),setTimeout((function(){e&&e(s),r.manager.itemEnd(t)}),0),s;const o=Di("img");function a(){l(),dc.add(t,this),e&&e(this),r.manager.itemEnd(t)}function h(e){l(),n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)}function l(){o.removeEventListener("load",a,!1),o.removeEventListener("error",h,!1)}return o.addEventListener("load",a,!1),o.addEventListener("error",h,!1),"data:"!==t.slice(0,5)&&void 0!==this.crossOrigin&&(o.crossOrigin=this.crossOrigin),r.manager.itemStart(t),o.src=t,o}}class bc extends mc{constructor(t){super(t)}load(t,e,i,n){const r=new vs,s=new wc(this.manager);s.setCrossOrigin(this.crossOrigin),s.setPath(this.path);let o=0;function a(i){s.load(t[i],(function(t){r.images[i]=t,o++,6===o&&(r.needsUpdate=!0,e&&e(r))}),void 0,n)}for(let e=0;e<t.length;++e)a(e);return r}}class Ac extends mc{constructor(t){super(t)}load(t,e,i,n){const r=this,s=new zh,o=new vc(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(r.withCredentials),o.load(t,(function(t){const i=r.parse(t);i&&(void 0!==i.image?s.image=i.image:void 0!==i.data&&(s.image.width=i.width,s.image.height=i.height,s.image.data=i.data),s.wrapS=void 0!==i.wrapS?i.wrapS:ct,s.wrapT=void 0!==i.wrapT?i.wrapT:ct,s.magFilter=void 0!==i.magFilter?i.magFilter:yt,s.minFilter=void 0!==i.minFilter?i.minFilter:yt,s.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.encoding&&(s.encoding=i.encoding),void 0!==i.flipY&&(s.flipY=i.flipY),void 0!==i.format&&(s.format=i.format),void 0!==i.type&&(s.type=i.type),void 0!==i.mipmaps&&(s.mipmaps=i.mipmaps,s.minFilter=bt),1===i.mipmapCount&&(s.minFilter=yt),void 0!==i.generateMipmaps&&(s.generateMipmaps=i.generateMipmaps),s.needsUpdate=!0,e&&e(s,i))}),i,n),s}}class Tc extends mc{constructor(t){super(t)}load(t,e,i,n){const r=new Ki,s=new wc(this.manager);return s.setCrossOrigin(this.crossOrigin),s.setPath(this.path),s.load(t,(function(t){r.image=t,r.needsUpdate=!0,void 0!==e&&e(r)}),i,n),r}}class Sc extends hr{constructor(t,e=1){super(),this.type="Light",this.color=new Wi(t),this.intensity=e}dispose(){}copy(t){return super.copy(t),this.color.copy(t.color),this.intensity=t.intensity,this}toJSON(t){const e=super.toJSON(t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}Sc.prototype.isLight=!0;class Ec extends Sc{constructor(t,e,i){super(t,i),this.type="HemisphereLight",this.position.copy(hr.DefaultUp),this.updateMatrix(),this.groundColor=new Wi(e)}copy(t){return Sc.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}Ec.prototype.isHemisphereLight=!0;const Mc=new kn,_c=new on,Cc=new on;class Pc{constructor(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new Ci(512,512),this.map=null,this.mapPass=null,this.matrix=new kn,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Es,this._frameExtents=new Ci(1,1),this._viewportCount=1,this._viewports=[new Ji(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(t){const e=this.camera,i=this.matrix;_c.setFromMatrixPosition(t.matrixWorld),e.position.copy(_c),Cc.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(Cc),e.updateMatrixWorld(),Mc.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Mc),i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(e.projectionMatrix),i.multiply(e.matrixWorldInverse)}getViewport(t){return this._viewports[t]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this}clone(){return(new this.constructor).copy(this)}toJSON(){const t={};return 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}class Rc extends Pc{constructor(){super(new ms(50,1,.5,500)),this.focus=1}updateMatrices(t){const e=this.camera,i=2*xi*t.angle*this.focus,n=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;i===e.fov&&n===e.aspect&&r===e.far||(e.fov=i,e.aspect=n,e.far=r,e.updateProjectionMatrix()),super.updateMatrices(t)}copy(t){return super.copy(t),this.focus=t.focus,this}}Rc.prototype.isSpotLightShadow=!0;class Lc extends Sc{constructor(t,e,i=0,n=Math.PI/3,r=0,s=1){super(t,e),this.type="SpotLight",this.position.copy(hr.DefaultUp),this.updateMatrix(),this.target=new hr,this.distance=i,this.angle=n,this.penumbra=r,this.decay=s,this.shadow=new Rc}get power(){return this.intensity*Math.PI}set power(t){this.intensity=t/Math.PI}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}Lc.prototype.isSpotLight=!0;const Oc=new kn,Dc=new on,Bc=new on;class Ic extends Pc{constructor(){super(new ms(90,1,.5,500)),this._frameExtents=new Ci(4,2),this._viewportCount=6,this._viewports=[new Ji(2,1,1,1),new Ji(0,1,1,1),new Ji(3,1,1,1),new Ji(1,1,1,1),new Ji(3,0,1,1),new Ji(1,0,1,1)],this._cubeDirections=[new on(1,0,0),new on(-1,0,0),new on(0,0,1),new on(0,0,-1),new on(0,1,0),new on(0,-1,0)],this._cubeUps=[new on(0,1,0),new on(0,1,0),new on(0,1,0),new on(0,1,0),new on(0,0,1),new on(0,0,-1)]}updateMatrices(t,e=0){const i=this.camera,n=this.matrix,r=t.distance||i.far;r!==i.far&&(i.far=r,i.updateProjectionMatrix()),Dc.setFromMatrixPosition(t.matrixWorld),i.position.copy(Dc),Bc.copy(i.position),Bc.add(this._cubeDirections[e]),i.up.copy(this._cubeUps[e]),i.lookAt(Bc),i.updateMatrixWorld(),n.makeTranslation(-Dc.x,-Dc.y,-Dc.z),Oc.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(Oc)}}Ic.prototype.isPointLightShadow=!0;class Fc extends Sc{constructor(t,e,i=0,n=1){super(t,e),this.type="PointLight",this.distance=i,this.decay=n,this.shadow=new Ic}get power(){return 4*this.intensity*Math.PI}set power(t){this.intensity=t/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}Fc.prototype.isPointLight=!0;class kc extends Pc{constructor(){super(new Ns(-5,5,5,-5,.5,500))}}kc.prototype.isDirectionalLightShadow=!0;class Nc extends Sc{constructor(t,e){super(t,e),this.type="DirectionalLight",this.position.copy(hr.DefaultUp),this.updateMatrix(),this.target=new hr,this.shadow=new kc}dispose(){this.shadow.dispose()}copy(t){return super.copy(t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}Nc.prototype.isDirectionalLight=!0;class zc extends Sc{constructor(t,e){super(t,e),this.type="AmbientLight"}}zc.prototype.isAmbientLight=!0;class Uc extends Sc{constructor(t,e,i=10,n=10){super(t,e),this.type="RectAreaLight",this.width=i,this.height=n}get power(){return this.intensity*this.width*this.height*Math.PI}set power(t){this.intensity=t/(this.width*this.height*Math.PI)}copy(t){return super.copy(t),this.width=t.width,this.height=t.height,this}toJSON(t){const e=super.toJSON(t);return e.object.width=this.width,e.object.height=this.height,e}}Uc.prototype.isRectAreaLight=!0;class Vc{constructor(){this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new on)}set(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this}zero(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this}getAt(t,e){const i=t.x,n=t.y,r=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.282095),e.addScaledVector(s[1],.488603*n),e.addScaledVector(s[2],.488603*r),e.addScaledVector(s[3],.488603*i),e.addScaledVector(s[4],i*n*1.092548),e.addScaledVector(s[5],n*r*1.092548),e.addScaledVector(s[6],.315392*(3*r*r-1)),e.addScaledVector(s[7],i*r*1.092548),e.addScaledVector(s[8],.546274*(i*i-n*n)),e}getIrradianceAt(t,e){const i=t.x,n=t.y,r=t.z,s=this.coefficients;return e.copy(s[0]).multiplyScalar(.886227),e.addScaledVector(s[1],1.023328*n),e.addScaledVector(s[2],1.023328*r),e.addScaledVector(s[3],1.023328*i),e.addScaledVector(s[4],.858086*i*n),e.addScaledVector(s[5],.858086*n*r),e.addScaledVector(s[6],.743125*r*r-.247708),e.addScaledVector(s[7],.858086*i*r),e.addScaledVector(s[8],.429043*(i*i-n*n)),e}add(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this}addScaledSH(t,e){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(t.coefficients[i],e);return this}scale(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this}lerp(t,e){for(let i=0;i<9;i++)this.coefficients[i].lerp(t.coefficients[i],e);return this}equals(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0}copy(t){return this.set(t.coefficients)}clone(){return(new this.constructor).copy(this)}fromArray(t,e=0){const i=this.coefficients;for(let n=0;n<9;n++)i[n].fromArray(t,e+3*n);return this}toArray(t=[],e=0){const i=this.coefficients;for(let n=0;n<9;n++)i[n].toArray(t,e+3*n);return t}static getBasisAt(t,e){const i=t.x,n=t.y,r=t.z;e[0]=.282095,e[1]=.488603*n,e[2]=.488603*r,e[3]=.488603*i,e[4]=1.092548*i*n,e[5]=1.092548*n*r,e[6]=.315392*(3*r*r-1),e[7]=1.092548*i*r,e[8]=.546274*(i*i-n*n)}}Vc.prototype.isSphericalHarmonics3=!0;class Hc extends Sc{constructor(t=new Vc,e=1){super(void 0,e),this.sh=t}copy(t){return super.copy(t),this.sh.copy(t.sh),this}fromJSON(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this}toJSON(t){const e=super.toJSON(t);return e.object.sh=this.sh.toArray(),e}}Hc.prototype.isLightProbe=!0;class Gc extends mc{constructor(t){super(t),this.textures={}}load(t,e,i,n){const r=this,s=new vc(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(t,(function(i){try{e(r.parse(JSON.parse(i)))}catch(e){n&&n(e),r.manager.itemError(t)}}),i,n)}parse(t){const e=this.textures;function i(t){return e[t],e[t]}const n=br.fromType(t.type);if(void 0!==t.uuid&&(n.uuid=t.uuid),void 0!==t.name&&(n.name=t.name),void 0!==t.color&&void 0!==n.color&&n.color.setHex(t.color),void 0!==t.roughness&&(n.roughness=t.roughness),void 0!==t.metalness&&(n.metalness=t.metalness),void 0!==t.sheen&&(n.sheen=t.sheen),void 0!==t.sheenColor&&(n.sheenColor=(new Wi).setHex(t.sheenColor)),void 0!==t.sheenRoughness&&(n.sheenRoughness=t.sheenRoughness),void 0!==t.emissive&&void 0!==n.emissive&&n.emissive.setHex(t.emissive),void 0!==t.specular&&void 0!==n.specular&&n.specular.setHex(t.specular),void 0!==t.specularIntensity&&(n.specularIntensity=t.specularIntensity),void 0!==t.specularColor&&void 0!==n.specularColor&&n.specularColor.setHex(t.specularColor),void 0!==t.shininess&&(n.shininess=t.shininess),void 0!==t.clearcoat&&(n.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(n.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.transmission&&(n.transmission=t.transmission),void 0!==t.thickness&&(n.thickness=t.thickness),void 0!==t.attenuationDistance&&(n.attenuationDistance=t.attenuationDistance),void 0!==t.attenuationColor&&void 0!==n.attenuationColor&&n.attenuationColor.setHex(t.attenuationColor),void 0!==t.fog&&(n.fog=t.fog),void 0!==t.flatShading&&(n.flatShading=t.flatShading),void 0!==t.blending&&(n.blending=t.blending),void 0!==t.combine&&(n.combine=t.combine),void 0!==t.side&&(n.side=t.side),void 0!==t.shadowSide&&(n.shadowSide=t.shadowSide),void 0!==t.opacity&&(n.opacity=t.opacity),void 0!==t.transparent&&(n.transparent=t.transparent),void 0!==t.alphaTest&&(n.alphaTest=t.alphaTest),void 0!==t.depthTest&&(n.depthTest=t.depthTest),void 0!==t.depthWrite&&(n.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(n.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(n.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(n.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(n.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(n.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(n.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(n.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(n.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(n.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(n.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(n.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(n.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(n.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(n.rotation=t.rotation),1!==t.linewidth&&(n.linewidth=t.linewidth),void 0!==t.dashSize&&(n.dashSize=t.dashSize),void 0!==t.gapSize&&(n.gapSize=t.gapSize),void 0!==t.scale&&(n.scale=t.scale),void 0!==t.polygonOffset&&(n.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(n.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(n.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.dithering&&(n.dithering=t.dithering),void 0!==t.alphaToCoverage&&(n.alphaToCoverage=t.alphaToCoverage),void 0!==t.premultipliedAlpha&&(n.premultipliedAlpha=t.premultipliedAlpha),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.toneMapped&&(n.toneMapped=t.toneMapped),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?n.vertexColors=t.vertexColors>0: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 Wi).setHex(r.value);break;case"v2":n.uniforms[e].value=(new Ci).fromArray(r.value);break;case"v3":n.uniforms[e].value=(new on).fromArray(r.value);break;case"v4":n.uniforms[e].value=(new Ji).fromArray(r.value);break;case"m3":n.uniforms[e].value=(new Pi).fromArray(r.value);break;case"m4":n.uniforms[e].value=(new kn).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 Ci).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.specularIntensityMap&&(n.specularIntensityMap=i(t.specularIntensityMap)),void 0!==t.specularColorMap&&(n.specularColorMap=i(t.specularColorMap)),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 Ci).fromArray(t.clearcoatNormalScale)),void 0!==t.transmissionMap&&(n.transmissionMap=i(t.transmissionMap)),void 0!==t.thicknessMap&&(n.thicknessMap=i(t.thicknessMap)),void 0!==t.sheenColorMap&&(n.sheenColorMap=i(t.sheenColorMap)),void 0!==t.sheenRoughnessMap&&(n.sheenRoughnessMap=i(t.sheenRoughnessMap)),n}setTextures(t){return this.textures=t,this}}class Wc{static decodeText(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let i=0,n=t.length;i<n;i++)e+=String.fromCharCode(t[i]);try{return decodeURIComponent(escape(e))}catch(t){return e}}static extractUrlBase(t){const e=t.lastIndexOf("/");return-1===e?"./":t.slice(0,e+1)}static resolveURL(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)}}class Yc extends Gr{constructor(){super(),this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(t){return super.copy(t),this.instanceCount=t.instanceCount,this}clone(){return(new this.constructor).copy(this)}toJSON(){const t=super.toJSON(this);return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}Yc.prototype.isInstancedBufferGeometry=!0;class Xc extends mc{constructor(t){super(t)}load(t,e,i,n){const r=this,s=new vc(r.manager);s.setPath(r.path),s.setRequestHeader(r.requestHeader),s.setWithCredentials(r.withCredentials),s.load(t,(function(i){try{e(r.parse(JSON.parse(i)))}catch(e){n&&n(e),r.manager.itemError(t)}}),i,n)}parse(t){const e={},i={};function n(t,n){if(void 0!==e[n])return e[n];const r=t.interleavedBuffers[n],s=function(t,e){if(void 0!==i[e])return i[e];const n=t.arrayBuffers[e],r=new Uint32Array(n).buffer;return i[e]=r,r}(t,r.buffer),o=Oi(r.type,s),a=new uh(o,r.stride);return a.uuid=r.uuid,e[n]=a,a}const r=t.isInstancedBufferGeometry?new Yc:new Gr,s=t.data.index;if(void 0!==s){const t=Oi(s.type,s.array);r.setIndex(new Er(t,1))}const o=t.data.attributes;for(const e in o){const i=o[e];let s;if(i.isInterleavedBufferAttribute){const e=n(t.data,i.data);s=new dh(e,i.itemSize,i.offset,i.normalized)}else{const t=Oi(i.type,i.array);s=new(i.isInstancedBufferAttribute?Gh:Er)(t,i.itemSize,i.normalized)}void 0!==i.name&&(s.name=i.name),void 0!==i.usage&&s.setUsage(i.usage),void 0!==i.updateRange&&(s.updateRange.offset=i.updateRange.offset,s.updateRange.count=i.updateRange.count),r.setAttribute(e,s)}const a=t.data.morphAttributes;if(a)for(const e in a){const i=a[e],s=[];for(let e=0,r=i.length;e<r;e++){const r=i[e];let o;if(r.isInterleavedBufferAttribute){const e=n(t.data,r.data);o=new dh(e,r.itemSize,r.offset,r.normalized)}else{const t=Oi(r.type,r.array);o=new Er(t,r.itemSize,r.normalized)}void 0!==r.name&&(o.name=r.name),s.push(o)}r.morphAttributes[e]=s}t.data.morphTargetsRelative&&(r.morphTargetsRelative=!0);const h=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==h)for(let t=0,e=h.length;t!==e;++t){const e=h[t];r.addGroup(e.start,e.count,e.materialIndex)}const l=t.data.boundingSphere;if(void 0!==l){const t=new on;void 0!==l.center&&t.fromArray(l.center),r.boundingSphere=new Cn(t,l.radius)}return t.name&&(r.name=t.name),t.userData&&(r.userData=t.userData),r}}class jc extends mc{constructor(t){super(t)}load(t,e,i,n){const r=this,s=""===this.path?Wc.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||s;const o=new vc(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,(function(t){let i=null;try{i=JSON.parse(t)}catch(t){return void(void 0!==n&&n(t))}const s=i.metadata;void 0!==s&&void 0!==s.type&&"geometry"!==s.type.toLowerCase()&&r.parse(i,e)}),i,n)}async loadAsync(t,e){const i=""===this.path?Wc.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||i;const n=new vc(this.manager);n.setPath(this.path),n.setRequestHeader(this.requestHeader),n.setWithCredentials(this.withCredentials);const r=await n.loadAsync(t,e),s=JSON.parse(r),o=s.metadata;if(void 0===o||void 0===o.type||"geometry"===o.type.toLowerCase())throw new Error("THREE.ObjectLoader: Can't load "+t);return await this.parseAsync(s)}parse(t,e){const i=this.parseAnimations(t.animations),n=this.parseShapes(t.shapes),r=this.parseGeometries(t.geometries,n),s=this.parseImages(t.images,(function(){void 0!==e&&e(h)})),o=this.parseTextures(t.textures,s),a=this.parseMaterials(t.materials,o),h=this.parseObject(t.object,r,a,o,i),l=this.parseSkeletons(t.skeletons,h);if(this.bindSkeletons(h,l),void 0!==e){let t=!1;for(const e in s)if(s[e]instanceof HTMLImageElement){t=!0;break}!1===t&&e(h)}return h}async parseAsync(t){const e=this.parseAnimations(t.animations),i=this.parseShapes(t.shapes),n=this.parseGeometries(t.geometries,i),r=await this.parseImagesAsync(t.images),s=this.parseTextures(t.textures,r),o=this.parseMaterials(t.materials,s),a=this.parseObject(t.object,n,o,s,e),h=this.parseSkeletons(t.skeletons,a);return this.bindSkeletons(a,h),a}parseShapes(t){const e={};if(void 0!==t)for(let i=0,n=t.length;i<n;i++){const n=(new Jl).fromJSON(t[i]);e[n.uuid]=n}return e}parseSkeletons(t,e){const i={},n={};if(e.traverse((function(t){t.isBone&&(n[t.uuid]=t)})),void 0!==t)for(let e=0,r=t.length;e<r;e++){const r=(new Hh).fromJSON(t[e],n);i[r.uuid]=r}return i}parseGeometries(t,e){const i={};if(void 0!==t){const n=new Xc;for(let r=0,s=t.length;r<s;r++){let s;const o=t[r];switch(o.type){case"BufferGeometry":case"InstancedBufferGeometry":s=n.parse(o);break;case"Geometry":break;default:o.type in zu&&(s=zu[o.type].fromJSON(o,e))}s.uuid=o.uuid,void 0!==o.name&&(s.name=o.name),!0===s.isBufferGeometry&&void 0!==o.userData&&(s.userData=o.userData),i[o.uuid]=s}}return i}parseMaterials(t,e){const i={},n={};if(void 0!==t){const r=new Gc;r.setTextures(e);for(let e=0,s=t.length;e<s;e++){const s=t[e];if("MultiMaterial"===s.type){const t=[];for(let e=0;e<s.materials.length;e++){const n=s.materials[e];void 0===i[n.uuid]&&(i[n.uuid]=r.parse(n)),t.push(i[n.uuid])}n[s.uuid]=t}else void 0===i[s.uuid]&&(i[s.uuid]=r.parse(s)),n[s.uuid]=i[s.uuid]}}return n}parseAnimations(t){const e={};if(void 0!==t)for(let i=0;i<t.length;i++){const n=t[i],r=uc.parse(n);e[r.uuid]=r}return e}parseImages(t,e){const i=this,n={};let r;function s(t){if("string"==typeof t){const e=t;return function(t){return i.manager.itemStart(t),r.load(t,(function(){i.manager.itemEnd(t)}),void 0,(function(){i.manager.itemError(t),i.manager.itemEnd(t)}))}(/^(\/\/)|([a-z]+:(\/\/)?)/i.test(e)?e:i.resourcePath+e)}return t.data?{data:Oi(t.type,t.data),width:t.width,height:t.height}:null}if(void 0!==t&&t.length>0){const i=new pc(e);r=new wc(i),r.setCrossOrigin(this.crossOrigin);for(let e=0,i=t.length;e<i;e++){const i=t[e],r=i.url;if(Array.isArray(r)){const t=[];for(let e=0,i=r.length;e<i;e++){const i=s(r[e]);null!==i&&(i instanceof HTMLImageElement?t.push(i):t.push(new zh(i.data,i.width,i.height)))}n[i.uuid]=new ji(t)}else{const t=s(i.url);n[i.uuid]=new ji(t)}}}return n}async parseImagesAsync(t){const e=this,i={};let n;async function r(t){if("string"==typeof t){const i=t,r=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(i)?i:e.resourcePath+i;return await n.loadAsync(r)}return t.data?{data:Oi(t.type,t.data),width:t.width,height:t.height}:null}if(void 0!==t&&t.length>0){n=new wc(this.manager),n.setCrossOrigin(this.crossOrigin);for(let e=0,n=t.length;e<n;e++){const n=t[e],s=n.url;if(Array.isArray(s)){const t=[];for(let e=0,i=s.length;e<i;e++){const i=s[e],n=await r(i);null!==n&&(n instanceof HTMLImageElement?t.push(n):t.push(new zh(n.data,n.width,n.height)))}i[n.uuid]=new ji(t)}else{const t=await r(n.url);i[n.uuid]=new ji(t)}}}return i}parseTextures(t,e){function i(t,e){return"number"==typeof t?t:e[t]}const n={};if(void 0!==t)for(let r=0,s=t.length;r<s;r++){const s=t[r];s.image,e[s.image];const o=e[s.image],a=o.data;let h;Array.isArray(a)?(h=new vs,6===a.length&&(h.needsUpdate=!0)):(h=a&&a.data?new zh:new Ki,a&&(h.needsUpdate=!0)),h.source=o,h.uuid=s.uuid,void 0!==s.name&&(h.name=s.name),void 0!==s.mapping&&(h.mapping=i(s.mapping,qc)),void 0!==s.offset&&h.offset.fromArray(s.offset),void 0!==s.repeat&&h.repeat.fromArray(s.repeat),void 0!==s.center&&h.center.fromArray(s.center),void 0!==s.rotation&&(h.rotation=s.rotation),void 0!==s.wrap&&(h.wrapS=i(s.wrap[0],Qc),h.wrapT=i(s.wrap[1],Qc)),void 0!==s.format&&(h.format=s.format),void 0!==s.type&&(h.type=s.type),void 0!==s.encoding&&(h.encoding=s.encoding),void 0!==s.minFilter&&(h.minFilter=i(s.minFilter,Kc)),void 0!==s.magFilter&&(h.magFilter=i(s.magFilter,Kc)),void 0!==s.anisotropy&&(h.anisotropy=s.anisotropy),void 0!==s.flipY&&(h.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(h.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(h.unpackAlignment=s.unpackAlignment),void 0!==s.userData&&(h.userData=s.userData),n[s.uuid]=h}return n}parseObject(t,e,i,n,r){let s,o,a;function h(t){return e[t],e[t]}function l(t){if(void 0!==t){if(Array.isArray(t)){const e=[];for(let n=0,r=t.length;n<r;n++){const r=t[n];i[r],e.push(i[r])}return e}return i[t],i[t]}}function u(t){return n[t],n[t]}switch(t.type){case"Scene":s=new lh,void 0!==t.background&&(Number.isInteger(t.background)?s.background=new Wi(t.background):s.background=u(t.background)),void 0!==t.environment&&(s.environment=u(t.environment)),void 0!==t.fog&&("Fog"===t.fog.type?s.fog=new hh(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(s.fog=new ah(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":s=new ms(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(s.focus=t.focus),void 0!==t.zoom&&(s.zoom=t.zoom),void 0!==t.filmGauge&&(s.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(s.filmOffset=t.filmOffset),void 0!==t.view&&(s.view=Object.assign({},t.view));break;case"OrthographicCamera":s=new Ns(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(s.zoom=t.zoom),void 0!==t.view&&(s.view=Object.assign({},t.view));break;case"AmbientLight":s=new zc(t.color,t.intensity);break;case"DirectionalLight":s=new Nc(t.color,t.intensity);break;case"PointLight":s=new Fc(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":s=new Uc(t.color,t.intensity,t.width,t.height);break;case"SpotLight":s=new Lc(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":s=new Ec(t.color,t.groundColor,t.intensity);break;case"LightProbe":s=(new Hc).fromJSON(t);break;case"SkinnedMesh":o=h(t.geometry),a=l(t.material),s=new kh(o,a),void 0!==t.bindMode&&(s.bindMode=t.bindMode),void 0!==t.bindMatrix&&s.bindMatrix.fromArray(t.bindMatrix),void 0!==t.skeleton&&(s.skeleton=t.skeleton);break;case"Mesh":o=h(t.geometry),a=l(t.material),s=new as(o,a);break;case"InstancedMesh":o=h(t.geometry),a=l(t.material);const e=t.count,i=t.instanceMatrix,n=t.instanceColor;s=new qh(o,a,e),s.instanceMatrix=new Gh(new Float32Array(i.array),16),void 0!==n&&(s.instanceColor=new Gh(new Float32Array(n.array),n.itemSize));break;case"LOD":s=new Lh;break;case"Line":s=new el(h(t.geometry),l(t.material));break;case"LineLoop":s=new sl(h(t.geometry),l(t.material));break;case"LineSegments":s=new rl(h(t.geometry),l(t.material));break;case"PointCloud":case"Points":s=new cl(h(t.geometry),l(t.material));break;case"Sprite":s=new _h(l(t.material));break;case"Group":s=new $a;break;case"Bone":s=new Nh;break;default:s=new hr}if(s.uuid=t.uuid,void 0!==t.name&&(s.name=t.name),void 0!==t.matrix?(s.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(s.matrixAutoUpdate=t.matrixAutoUpdate),s.matrixAutoUpdate&&s.matrix.decompose(s.position,s.quaternion,s.scale)):(void 0!==t.position&&s.position.fromArray(t.position),void 0!==t.rotation&&s.rotation.fromArray(t.rotation),void 0!==t.quaternion&&s.quaternion.fromArray(t.quaternion),void 0!==t.scale&&s.scale.fromArray(t.scale)),void 0!==t.castShadow&&(s.castShadow=t.castShadow),void 0!==t.receiveShadow&&(s.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(s.shadow.bias=t.shadow.bias),void 0!==t.shadow.normalBias&&(s.shadow.normalBias=t.shadow.normalBias),void 0!==t.shadow.radius&&(s.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&s.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(s.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(s.visible=t.visible),void 0!==t.frustumCulled&&(s.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(s.renderOrder=t.renderOrder),void 0!==t.userData&&(s.userData=t.userData),void 0!==t.layers&&(s.layers.mask=t.layers),void 0!==t.children){const o=t.children;for(let t=0;t<o.length;t++)s.add(this.parseObject(o[t],e,i,n,r))}if(void 0!==t.animations){const e=t.animations;for(let t=0;t<e.length;t++){const i=e[t];s.animations.push(r[i])}}if("LOD"===t.type){void 0!==t.autoUpdate&&(s.autoUpdate=t.autoUpdate);const e=t.levels;for(let t=0;t<e.length;t++){const i=e[t],n=s.getObjectByProperty("uuid",i.object);void 0!==n&&s.addLevel(n,i.distance)}}return s}bindSkeletons(t,e){0!==Object.keys(e).length&&t.traverse((function(t){if(!0===t.isSkinnedMesh&&void 0!==t.skeleton){const i=e[t.skeleton];void 0===i||t.bind(i,t.bindMatrix)}}))}setTexturePath(t){return this.setResourcePath(t)}}const qc={UVMapping:rt,CubeReflectionMapping:st,CubeRefractionMapping:ot,EquirectangularReflectionMapping:at,EquirectangularRefractionMapping:ht,CubeUVReflectionMapping:lt},Qc={RepeatWrapping:ut,ClampToEdgeWrapping:ct,MirroredRepeatWrapping:dt},Kc={NearestFilter:pt,NearestMipmapNearestFilter:ft,NearestMipmapLinearFilter:gt,LinearFilter:yt,LinearMipmapNearestFilter:xt,LinearMipmapLinearFilter:bt};class Jc extends mc{constructor(t){super(t),this.options={premultiplyAlpha:"none"}}setOptions(t){return this.options=t,this}load(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,s=dc.get(t);if(void 0!==s)return r.manager.itemStart(t),setTimeout((function(){e&&e(s),r.manager.itemEnd(t)}),0),s;const o={};o.credentials="anonymous"===this.crossOrigin?"same-origin":"include",o.headers=this.requestHeader,fetch(t,o).then((function(t){return t.blob()})).then((function(t){return createImageBitmap(t,Object.assign(r.options,{colorSpaceConversion:"none"}))})).then((function(i){dc.add(t,i),e&&e(i),r.manager.itemEnd(t)})).catch((function(e){n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)})),r.manager.itemStart(t)}}let Zc;Jc.prototype.isImageBitmapLoader=!0;const $c={getContext:function(){return void 0===Zc&&(Zc=new(window.AudioContext||window.webkitAudioContext)),Zc},setContext:function(t){Zc=t}};class td extends mc{constructor(t){super(t)}load(t,e,i,n){const r=this,s=new vc(this.manager);s.setResponseType("arraybuffer"),s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials),s.load(t,(function(i){try{const t=i.slice(0);$c.getContext().decodeAudioData(t,(function(t){e(t)}))}catch(e){n&&n(e),r.manager.itemError(t)}}),i,n)}}class ed extends Hc{constructor(t,e,i=1){super(void 0,i);const n=(new Wi).set(t),r=(new Wi).set(e),s=new on(n.r,n.g,n.b),o=new on(r.r,r.g,r.b),a=Math.sqrt(Math.PI),h=a*Math.sqrt(.75);this.sh.coefficients[0].copy(s).add(o).multiplyScalar(a),this.sh.coefficients[1].copy(s).sub(o).multiplyScalar(h)}}ed.prototype.isHemisphereLightProbe=!0;class id extends Hc{constructor(t,e=1){super(void 0,e);const i=(new Wi).set(t);this.sh.coefficients[0].set(i.r,i.g,i.b).multiplyScalar(2*Math.sqrt(Math.PI))}}id.prototype.isAmbientLightProbe=!0;const nd=new kn,rd=new kn,sd=new kn;class od{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new ms,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ms,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(t){const e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep,sd.copy(t.projectionMatrix);const i=e.eyeSep/2,n=i*e.near/e.focus,r=e.near*Math.tan(yi*e.fov*.5)/e.zoom;let s,o;rd.elements[12]=-i,nd.elements[12]=i,s=-r*e.aspect+n,o=r*e.aspect+n,sd.elements[0]=2*e.near/(o-s),sd.elements[8]=(o+s)/(o-s),this.cameraL.projectionMatrix.copy(sd),s=-r*e.aspect-n,o=r*e.aspect-n,sd.elements[0]=2*e.near/(o-s),sd.elements[8]=(o+s)/(o-s),this.cameraR.projectionMatrix.copy(sd)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(rd),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(nd)}}class ad{constructor(t=!0){this.autoStart=t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=hd(),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){const e=hd();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}function hd(){return("undefined"==typeof performance?Date:performance).now()}const ld=new on,ud=new sn,cd=new on,dd=new on;class pd extends hr{constructor(){super(),this.type="AudioListener",this.context=$c.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new ad}getInput(){return this.gain}removeFilter(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}updateMatrixWorld(t){super.updateMatrixWorld(t);const e=this.context.listener,i=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(ld,ud,cd),dd.set(0,0,-1).applyQuaternion(ud),e.positionX){const t=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(ld.x,t),e.positionY.linearRampToValueAtTime(ld.y,t),e.positionZ.linearRampToValueAtTime(ld.z,t),e.forwardX.linearRampToValueAtTime(dd.x,t),e.forwardY.linearRampToValueAtTime(dd.y,t),e.forwardZ.linearRampToValueAtTime(dd.z,t),e.upX.linearRampToValueAtTime(i.x,t),e.upY.linearRampToValueAtTime(i.y,t),e.upZ.linearRampToValueAtTime(i.z,t)}else e.setPosition(ld.x,ld.y,ld.z),e.setOrientation(dd.x,dd.y,dd.z,i.x,i.y,i.z)}}class fd extends hr{constructor(t){super(),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this}setMediaElementSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this}setMediaStreamSource(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this}setBuffer(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this}play(t=0){if(!0===this.isPlaying)return;if(!1===this.hasPlaybackControl)return;this._startedAt=this.context.currentTime+t;const e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}getFilters(){return this.filters}setFilters(t){return t||(t=[]),!0===this._connected?(this.disconnect(),this.filters=t.slice(),this.connect()):this.filters=t.slice(),this}setDetune(t){if(this.detune=t,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(t){return this.setFilters(t?[t]:[])}setPlaybackRate(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1}getLoop(){return!1!==this.hasPlaybackControl&&this.loop}setLoop(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this}setLoopStart(t){return this.loopStart=t,this}setLoopEnd(t){return this.loopEnd=t,this}getVolume(){return this.gain.gain.value}setVolume(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}}const md=new on,gd=new sn,vd=new on,yd=new on;class xd extends fd{constructor(t){super(t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}disconnect(){super.disconnect(),this.panner.disconnect(this.gain)}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(t){return this.panner.refDistance=t,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(t){return this.panner.rolloffFactor=t,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(t){return this.panner.distanceModel=t,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(t){return this.panner.maxDistance=t,this}setDirectionalCone(t,e,i){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=i,this}updateMatrixWorld(t){if(super.updateMatrixWorld(t),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(md,gd,vd),yd.set(0,0,1).applyQuaternion(gd);const e=this.panner;if(e.positionX){const t=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(md.x,t),e.positionY.linearRampToValueAtTime(md.y,t),e.positionZ.linearRampToValueAtTime(md.z,t),e.orientationX.linearRampToValueAtTime(yd.x,t),e.orientationY.linearRampToValueAtTime(yd.y,t),e.orientationZ.linearRampToValueAtTime(yd.z,t)}else e.setPosition(md.x,md.y,md.z),e.setOrientation(yd.x,yd.y,yd.z)}}class wd{constructor(t,e=2048){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=e,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let t=0;const e=this.getFrequencyData();for(let i=0;i<e.length;i++)t+=e[i];return t/e.length}}class bd{constructor(t,e,i){let n,r,s;switch(this.binding=t,this.valueSize=i,e){case"quaternion":n=this._slerp,r=this._slerpAdditive,s=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*i),this._workIndex=5;break;case"string":case"bool":n=this._select,r=this._select,s=this._setAdditiveIdentityOther,this.buffer=new Array(5*i);break;default:n=this._lerp,r=this._lerpAdditive,s=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*i)}this._mixBufferRegion=n,this._mixBufferRegionAdditive=r,this._setIdentity=s,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(t,e){const i=this.buffer,n=this.valueSize,r=t*n+n;let s=this.cumulativeWeight;if(0===s){for(let t=0;t!==n;++t)i[r+t]=i[t];s=e}else{s+=e;const t=e/s;this._mixBufferRegion(i,r,0,t,n)}this.cumulativeWeight=s}accumulateAdditive(t){const e=this.buffer,i=this.valueSize,n=i*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,n,0,t,i),this.cumulativeWeightAdditive+=t}apply(t){const e=this.valueSize,i=this.buffer,n=t*e+e,r=this.cumulativeWeight,s=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){const t=e*this._origIndex;this._mixBufferRegion(i,n,t,1-r,e)}s>0&&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(){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(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)}_setAdditiveIdentityNumeric(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let i=t;i<e;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[e+i]=this.buffer[t+i]}_select(t,e,i,n,r){if(n>=.5)for(let n=0;n!==r;++n)t[e+n]=t[i+n]}_slerp(t,e,i,n){sn.slerpFlat(t,e,t,e,t,i,n)}_slerpAdditive(t,e,i,n,r){const s=this._workIndex*r;sn.multiplyQuaternionsFlat(t,s,t,e,t,i),sn.slerpFlat(t,e,t,e,t,s,n)}_lerp(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(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 Ad=new RegExp("[\\[\\]\\.:\\/]","g"),Td="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",Sd=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),Ed=/(WCOD+)?/.source.replace("WCOD",Td),Md=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),_d=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),Cd=new RegExp("^"+Sd+Ed+Md+_d+"$"),Pd=["material","materials","bones"];class Rd{constructor(t,e,i){this.path=e,this.parsedPath=i||Rd.parseTrackName(e),this.node=Rd.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(t,e,i){return t&&t.isAnimationObjectGroup?new Rd.Composite(t,e,i):new Rd(t,e,i)}static sanitizeNodeName(t){return t.replace(/\s/g,"_").replace(Ad,"")}static parseTrackName(t){const e=Cd.exec(t);if(null===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!==Pd.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}static findNode(t,e){if(void 0===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<t.length;n++){const r=t[n];if(r.name===e||r.uuid===e)return r;const s=i(r.children);if(s)return s}return null},n=i(t.children);if(n)return n}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(t,e){t[e]=this.targetObject[this.propertyName]}_getValue_array(t,e){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)t[e++]=i[n]}_getValue_arrayElement(t,e){t[e]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(t,e){this.resolvedProperty.toArray(t,e)}_setValue_direct(t,e){this.targetObject[this.propertyName]=t[e]}_setValue_direct_setNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(t,e){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=t[e++]}_setValue_array_setNeedsUpdate(t,e){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=t[e++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(t,e){const i=this.resolvedProperty;for(let n=0,r=i.length;n!==r;++n)i[n]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(t,e){this.resolvedProperty[this.propertyIndex]=t[e]}_setValue_arrayElement_setNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(t,e){this.resolvedProperty.fromArray(t,e)}_setValue_fromArray_setNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(t,e){this.bind(),this.getValue(t,e)}_setValue_unbound(t,e){this.bind(),this.setValue(t,e)}bind(){let t=this.node;const e=this.parsedPath,i=e.objectName,n=e.propertyName;let r=e.propertyIndex;if(t||(t=Rd.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return;if(i){let n=e.objectIndex;switch(i){case"materials":if(!t.material)return;if(!t.material.materials)return;t=t.material.materials;break;case"bones":if(!t.skeleton)return;t=t.skeleton.bones;for(let e=0;e<t.length;e++)if(t[e].name===n){n=e;break}break;default:if(void 0===t[i])return;t=t[i]}if(void 0!==n){if(void 0===t[n])return;t=t[n]}}const s=t[n];if(void 0===s){e.nodeName;return}let o=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?o=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(o=this.Versioning.MatrixWorldNeedsUpdate);let a=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===n){if(!t.geometry)return;if(!t.geometry.isBufferGeometry)return;if(!t.geometry.morphAttributes)return;void 0!==t.morphTargetDictionary[r]&&(r=t.morphTargetDictionary[r])}a=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(a=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(a=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=n;this.getValue=this.GetterByBindingType[a],this.setValue=this.SetterByBindingTypeAndVersioning[a][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}Rd.Composite=class{constructor(t,e,i){const n=i||Rd.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,n)}getValue(t,e){this.bind();const i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(t,e)}setValue(t,e){const i=this._bindings;for(let n=this._targetGroup.nCachedObjects_,r=i.length;n!==r;++n)i[n].setValue(t,e)}bind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()}unbind(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}},Rd.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Rd.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},Rd.prototype.GetterByBindingType=[Rd.prototype._getValue_direct,Rd.prototype._getValue_array,Rd.prototype._getValue_arrayElement,Rd.prototype._getValue_toArray],Rd.prototype.SetterByBindingTypeAndVersioning=[[Rd.prototype._setValue_direct,Rd.prototype._setValue_direct_setNeedsUpdate,Rd.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[Rd.prototype._setValue_array,Rd.prototype._setValue_array_setNeedsUpdate,Rd.prototype._setValue_array_setMatrixWorldNeedsUpdate],[Rd.prototype._setValue_arrayElement,Rd.prototype._setValue_arrayElement_setNeedsUpdate,Rd.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[Rd.prototype._setValue_fromArray,Rd.prototype._setValue_fromArray_setNeedsUpdate,Rd.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class Ld{constructor(){this.uuid=wi(),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}}}add(){const t=this._objects,e=this._indicesByUUID,i=this._paths,n=this._parsedPaths,r=this._bindings,s=r.length;let o=void 0,a=t.length,h=this.nCachedObjects_;for(let l=0,u=arguments.length;l!==u;++l){const u=arguments[l],c=u.uuid;let d=e[c];if(void 0===d){d=a++,e[c]=d,t.push(u);for(let t=0,e=s;t!==e;++t)r[t].push(new Rd(u,i[t],n[t]))}else if(d<h){o=t[d];const a=--h,l=t[a];e[l.uuid]=d,t[d]=l,e[c]=a,t[a]=u;for(let t=0,e=s;t!==e;++t){const e=r[t],s=e[a];let o=e[d];e[d]=s,void 0===o&&(o=new Rd(u,i[t],n[t])),e[a]=o}}else t[d]}this.nCachedObjects_=h}remove(){const t=this._objects,e=this._indicesByUUID,i=this._bindings,n=i.length;let r=this.nCachedObjects_;for(let s=0,o=arguments.length;s!==o;++s){const o=arguments[s],a=o.uuid,h=e[a];if(void 0!==h&&h>=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(){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],h<r){const o=--r,a=t[o],l=--s,u=t[l];e[a.uuid]=h,t[h]=a,e[u.uuid]=o,t[o]=u,t.pop();for(let t=0,e=n;t!==e;++t){const e=i[t],n=e[o],r=e[l];e[h]=n,e[o]=r,e.pop()}}else{const r=--s,o=t[r];r>0&&(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_(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_,u=new Array(h);n=r.length,i[t]=n,s.push(t),o.push(e),r.push(u);for(let i=l,n=a.length;i!==n;++i){const n=a[i];u[i]=new Rd(n,t,e)}return u}unsubscribe_(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()}}}Ld.prototype.isAnimationObjectGroup=!0;class Od{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:Se,endingEnd:Se};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=xe,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 Ce:for(let i=0,n=t.length;i!==n;++i)t[i].evaluate(s),e[i].accumulateAdditive(o);break;case _e: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===we;if(0===t)return-1===r?n:s&&1==(1&r)?e-n:n;if(i===ye){-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=Ee,n.endingEnd=Ee):(n.endingStart=t?this.zeroSlopeAtStart?Ee:Se:Me,n.endingEnd=e?this.zeroSlopeAtEnd?Ee:Se:Me)}_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}}class Dd extends mi{constructor(t){super(),this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(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 u=l[h];if(void 0!==u)++u.referenceCount,s[t]=u;else{if(u=s[t],void 0!==u){null===u._cacheIndex&&(++u.referenceCount,this._addInactiveBinding(u,a,h));continue}const n=e&&e._propertyBindings[t].binding.parsedPath;u=new bd(Rd.create(i,h,n),r.ValueTypeName,r.getValueSize()),++u.referenceCount,this._addInactiveBinding(u,a,h),s[t]=u}o[t].resultBuffer=u.buffer}}_activateAction(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(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(){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(t){const e=t._cacheIndex;return null!==e&&e<this._nActiveActions}_addInactiveAction(t,e,i){const n=this._actions,r=this._actionsByClip;let s=r[e];if(void 0===s)s={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=s;else{const e=s.knownActions;t._byClipCacheIndex=e.length,e.push(t)}t._cacheIndex=n.length,n.push(t),s.actionByRoot[i]=t}_removeInactiveAction(t){const e=this._actions,i=e[e.length-1],n=t._cacheIndex;i._cacheIndex=n,e[n]=i,e.pop(),t._cacheIndex=null;const r=t._clip.uuid,s=this._actionsByClip,o=s[r],a=o.knownActions,h=a[a.length-1],l=t._byClipCacheIndex;h._byClipCacheIndex=l,a[l]=h,a.pop(),t._byClipCacheIndex=null;delete o.actionByRoot[(t._localRoot||this._root).uuid],0===a.length&&delete s[r],this._removeInactiveBindingsForAction(t)}_removeInactiveBindingsForAction(t){const e=t._propertyBindings;for(let t=0,i=e.length;t!==i;++t){const i=e[t];0==--i.referenceCount&&this._removeInactiveBinding(i)}}_lendAction(t){const e=this._actions,i=t._cacheIndex,n=this._nActiveActions++,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r}_takeBackAction(t){const e=this._actions,i=t._cacheIndex,n=--this._nActiveActions,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r}_addInactiveBinding(t,e,i){const n=this._bindingsByRootAndName,r=this._bindings;let s=n[e];void 0===s&&(s={},n[e]=s),s[i]=t,t._cacheIndex=r.length,r.push(t)}_removeInactiveBinding(t){const e=this._bindings,i=t.binding,n=i.rootNode.uuid,r=i.path,s=this._bindingsByRootAndName,o=s[n],a=e[e.length-1],h=t._cacheIndex;a._cacheIndex=h,e[h]=a,e.pop(),delete o[r],0===Object.keys(o).length&&delete s[n]}_lendBinding(t){const e=this._bindings,i=t._cacheIndex,n=this._nActiveBindings++,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r}_takeBackBinding(t){const e=this._bindings,i=t._cacheIndex,n=--this._nActiveBindings,r=e[n];t._cacheIndex=n,e[n]=t,r._cacheIndex=i,e[i]=r}_lendControlInterpolant(){const t=this._controlInterpolants,e=this._nActiveControlInterpolants++;let i=t[e];return void 0===i&&(i=new tc(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),i.__cacheIndex=e,t[e]=i),i}_takeBackControlInterpolant(t){const e=this._controlInterpolants,i=t.__cacheIndex,n=--this._nActiveControlInterpolants,r=e[n];t.__cacheIndex=n,e[n]=t,r.__cacheIndex=i,e[i]=r}clipAction(t,e,i){const n=e||this._root,r=n.uuid;let s="string"==typeof t?uc.findByName(n,t):t;const o=null!==s?s.uuid:t,a=this._actionsByClip[o];let h=null;if(void 0===i&&(i=null!==s?s.blendMode:_e),void 0!==a){const t=a.actionByRoot[r];if(void 0!==t&&t.blendMode===i)return t;h=a.knownActions[0],null===s&&(s=h._clip)}if(null===s)return null;const l=new Od(this,s,e,i);return this._bindAction(l,h),this._addInactiveAction(l,o,r),l}existingAction(t,e){const i=e||this._root,n=i.uuid,r="string"==typeof t?uc.findByName(i,t):t,s=r?r.uuid:t,o=this._actionsByClip[s];return void 0!==o&&o.actionByRoot[n]||null}stopAllAction(){const t=this._actions;for(let e=this._nActiveActions-1;e>=0;--e)t[e].stop();return this}update(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(t){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(t)}getRoot(){return this._root}uncacheClip(t){const e=this._actions,i=t.uuid,n=this._actionsByClip,r=n[i];if(void 0!==r){const t=r.knownActions;for(let i=0,n=t.length;i!==n;++i){const n=t[i];this._deactivateAction(n);const r=n._cacheIndex,s=e[e.length-1];n._cacheIndex=null,n._byClipCacheIndex=null,s._cacheIndex=r,e[r]=s,e.pop(),this._removeInactiveBindingsForAction(n)}delete n[i]}}uncacheRoot(t){const e=t.uuid,i=this._actionsByClip;for(const t in i){const n=i[t].actionByRoot[e];void 0!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}const n=this._bindingsByRootAndName[e];if(void 0!==n)for(const t in n){const e=n[t];e.restoreOriginalState(),this._removeInactiveBinding(e)}}uncacheAction(t,e){const i=this.existingAction(t,e);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}}Dd.prototype._controlInterpolantsResultBuffer=new Float32Array(1);class Bd{constructor(t){"string"==typeof t&&(t=arguments[1]),this.value=t}clone(){return new Bd(void 0===this.value.clone?this.value:this.value.clone())}}class Id extends uh{constructor(t,e,i=1){super(t,e),this.meshPerAttribute=i}copy(t){return super.copy(t),this.meshPerAttribute=t.meshPerAttribute,this}clone(t){const e=super.clone(t);return e.meshPerAttribute=this.meshPerAttribute,e}toJSON(t){const e=super.toJSON(t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}Id.prototype.isInstancedInterleavedBuffer=!0;class Fd{constructor(t,e,i,n,r){this.buffer=t,this.type=e,this.itemSize=i,this.elementSize=n,this.count=r,this.version=0}set needsUpdate(t){!0===t&&this.version++}setBuffer(t){return this.buffer=t,this}setType(t,e){return this.type=t,this.elementSize=e,this}setItemSize(t){return this.itemSize=t,this}setCount(t){return this.count=t,this}}Fd.prototype.isGLBufferAttribute=!0;class kd{constructor(t,e,i=0,n=1/0){this.ray=new Fn(t,e),this.near=i,this.far=n,this.camera=null,this.layers=new qn,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(t,e){this.ray.set(t,e)}setFromCamera(t,e){e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e.isOrthographicCamera&&(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e)}intersectObject(t,e=!0,i=[]){return zd(t,this,i,e),i.sort(Nd),i}intersectObjects(t,e=!0,i=[]){for(let n=0,r=t.length;n<r;n++)zd(t[n],this,i,e);return i.sort(Nd),i}}function Nd(t,e){return t.distance-e.distance}function zd(t,e,i,n){if(t.layers.test(e.layers)&&t.raycast(e,i),!0===n){const n=t.children;for(let t=0,r=n.length;t<r;t++)zd(n[t],e,i,!0)}}class Ud{constructor(t=1,e=0,i=0){return this.radius=t,this.phi=e,this.theta=i,this}set(t,e,i){return this.radius=t,this.phi=e,this.theta=i,this}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,i){return this.radius=Math.sqrt(t*t+e*e+i*i),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,i),this.phi=Math.acos(bi(e/this.radius,-1,1))),this}clone(){return(new this.constructor).copy(this)}}class Vd{constructor(t=1,e=0,i=0){return this.radius=t,this.theta=e,this.y=i,this}set(t,e,i){return this.radius=t,this.theta=e,this.y=i,this}copy(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,i){return this.radius=Math.sqrt(t*t+i*i),this.theta=Math.atan2(t,i),this.y=e,this}clone(){return(new this.constructor).copy(this)}}const Hd=new Ci;class Gd{constructor(t=new Ci(1/0,1/0),e=new Ci(-1/0,-1/0)){this.min=t,this.max=e}set(t,e){return this.min.copy(t),this.max.copy(e),this}setFromPoints(t){this.makeEmpty();for(let e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this}setFromCenterAndSize(t,e){const i=Hd.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}clone(){return(new this.constructor).copy(this)}copy(t){return this.min.copy(t.min),this.max.copy(t.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(t){return this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(t){return this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)}expandByPoint(t){return this.min.min(t),this.max.max(t),this}expandByVector(t){return this.min.sub(t),this.max.add(t),this}expandByScalar(t){return this.min.addScalar(-t),this.max.addScalar(t),this}containsPoint(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.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 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.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)}clampPoint(t,e){return e.copy(t).clamp(this.min,this.max)}distanceToPoint(t){return Hd.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)}}Gd.prototype.isBox2=!0;const Wd=new on,Yd=new on;class Xd{constructor(t=new on,e=new on){this.start=t,this.end=e}set(t,e){return this.start.copy(t),this.end.copy(e),this}copy(t){return this.start.copy(t.start),this.end.copy(t.end),this}getCenter(t){return t.addVectors(this.start,this.end).multiplyScalar(.5)}delta(t){return t.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(t,e){return this.delta(e).multiplyScalar(t).add(this.start)}closestPointToPointParameter(t,e){Wd.subVectors(t,this.start),Yd.subVectors(this.end,this.start);const i=Yd.dot(Yd);let n=Yd.dot(Wd)/i;return e&&(n=bi(n,0,1)),n}closestPointToPoint(t,e,i){const n=this.closestPointToPointParameter(t,e);return 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)}clone(){return(new this.constructor).copy(this)}}const jd=new on;class qd extends hr{constructor(t,e){super(),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;const i=new Gr,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<i;t++,e++){const r=t/i*Math.PI*2,s=e/i*Math.PI*2;n.push(Math.cos(r),Math.sin(r),1,Math.cos(s),Math.sin(s),1)}i.setAttribute("position",new Br(n,3));const r=new Qh({fog:!1,toneMapped:!1});this.cone=new rl(i,r),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateMatrixWorld();const t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),jd.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(jd),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Qd=new on,Kd=new kn,Jd=new kn;class Zd extends rl{constructor(t){const e=function t(e){const i=[];!0===e.isBone&&i.push(e);for(let n=0;n<e.children.length;n++)i.push.apply(i,t(e.children[n]));return i}(t),i=new Gr,n=[],r=[],s=new Wi(0,0,1),o=new Wi(0,1,0);for(let t=0;t<e.length;t++){const i=e[t];i.parent&&i.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),r.push(s.r,s.g,s.b),r.push(o.r,o.g,o.b))}i.setAttribute("position",new Br(n,3)),i.setAttribute("color",new Br(r,3));super(i,new Qh({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0})),this.type="SkeletonHelper",this.isSkeletonHelper=!0,this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(t){const e=this.bones,i=this.geometry,n=i.getAttribute("position");Jd.copy(this.root.matrixWorld).invert();for(let t=0,i=0;t<e.length;t++){const r=e[t];r.parent&&r.parent.isBone&&(Kd.multiplyMatrices(Jd,r.matrixWorld),Qd.setFromMatrixPosition(Kd),n.setXYZ(i,Qd.x,Qd.y,Qd.z),Kd.multiplyMatrices(Jd,r.parent.matrixWorld),Qd.setFromMatrixPosition(Kd),n.setXYZ(i+1,Qd.x,Qd.y,Qd.z),i+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(t)}}class $d extends as{constructor(t,e,i){super(new Ou(e,4,2),new Ar({wireframe:!0,fog:!1,toneMapped:!1})),this.light=t,this.light.updateMatrixWorld(),this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const tp=new on,ep=new Wi,ip=new Wi;class np extends hr{constructor(t,e,i){super(),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i;const n=new Pu(e);n.rotateY(.5*Math.PI),this.material=new Ar({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const r=n.getAttribute("position"),s=new Float32Array(3*r.count);n.setAttribute("color",new Er(s,3)),this.add(new as(n,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const e=t.geometry.getAttribute("color");ep.copy(this.light.color),ip.copy(this.light.groundColor);for(let t=0,i=e.count;t<i;t++){const n=t<i/2?ep:ip;e.setXYZ(t,n.r,n.g,n.b)}e.needsUpdate=!0}t.lookAt(tp.setFromMatrixPosition(this.light.matrixWorld).negate())}}class rp extends rl{constructor(t=10,e=10,i=4473924,n=8947848){i=new Wi(i),n=new Wi(n);const r=e/2,s=t/e,o=t/2,a=[],h=[];for(let t=0,l=0,u=-o;t<=e;t++,u+=s){a.push(-o,0,u,o,0,u),a.push(u,0,-o,u,0,o);const e=t===r?i:n;e.toArray(h,l),l+=3,e.toArray(h,l),l+=3,e.toArray(h,l),l+=3,e.toArray(h,l),l+=3}const l=new Gr;l.setAttribute("position",new Br(a,3)),l.setAttribute("color",new Br(h,3));super(l,new Qh({vertexColors:!0,toneMapped:!1})),this.type="GridHelper"}}class sp extends rl{constructor(t=10,e=16,i=8,n=64,r=4473924,s=8947848){r=new Wi(r),s=new Wi(s);const o=[],a=[];for(let i=0;i<=e;i++){const n=i/e*(2*Math.PI),h=Math.sin(n)*t,l=Math.cos(n)*t;o.push(0,0,0),o.push(h,0,l);const u=1&i?r:s;a.push(u.r,u.g,u.b),a.push(u.r,u.g,u.b)}for(let e=0;e<=i;e++){const h=1&e?r:s,l=t-t/i*e;for(let t=0;t<n;t++){let e=t/n*(2*Math.PI),i=Math.sin(e)*l,r=Math.cos(e)*l;o.push(i,0,r),a.push(h.r,h.g,h.b),e=(t+1)/n*(2*Math.PI),i=Math.sin(e)*l,r=Math.cos(e)*l,o.push(i,0,r),a.push(h.r,h.g,h.b)}}const h=new Gr;h.setAttribute("position",new Br(o,3)),h.setAttribute("color",new Br(a,3));super(h,new Qh({vertexColors:!0,toneMapped:!1})),this.type="PolarGridHelper"}}const op=new on,ap=new on,hp=new on;class lp extends hr{constructor(t,e,i){super(),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,void 0===e&&(e=1);let n=new Gr;n.setAttribute("position",new Br([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));const r=new Qh({fog:!1,toneMapped:!1});this.lightPlane=new el(n,r),this.add(this.lightPlane),n=new Gr,n.setAttribute("position",new Br([0,0,0,0,0,1],3)),this.targetLine=new el(n,r),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){op.setFromMatrixPosition(this.light.matrixWorld),ap.setFromMatrixPosition(this.light.target.matrixWorld),hp.subVectors(ap,op),this.lightPlane.lookAt(ap),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(ap),this.targetLine.scale.z=hp.length()}}const up=new on,cp=new fs;class dp extends rl{constructor(t){const e=new Gr,i=new Qh({color:16777215,vertexColors:!0,toneMapped:!1}),n=[],r=[],s={},o=new Wi(16755200),a=new Wi(16711680),h=new Wi(43775),l=new Wi(16777215),u=new Wi(3355443);function c(t,e,i){d(t,i),d(e,i)}function d(t,e){n.push(0,0,0),r.push(e.r,e.g,e.b),void 0===s[t]&&(s[t]=[]),s[t].push(n.length/3-1)}c("n1","n2",o),c("n2","n4",o),c("n4","n3",o),c("n3","n1",o),c("f1","f2",o),c("f2","f4",o),c("f4","f3",o),c("f3","f1",o),c("n1","f1",o),c("n2","f2",o),c("n3","f3",o),c("n4","f4",o),c("p","n1",a),c("p","n2",a),c("p","n3",a),c("p","n4",a),c("u1","u2",h),c("u2","u3",h),c("u3","u1",h),c("c","t",l),c("p","c",u),c("cn1","cn2",u),c("cn3","cn4",u),c("cf1","cf2",u),c("cf3","cf4",u),e.setAttribute("position",new Br(n,3)),e.setAttribute("color",new Br(r,3)),super(e,i),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=s,this.update()}update(){const t=this.geometry,e=this.pointMap;cp.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),pp("c",e,t,cp,0,0,-1),pp("t",e,t,cp,0,0,1),pp("n1",e,t,cp,-1,-1,-1),pp("n2",e,t,cp,1,-1,-1),pp("n3",e,t,cp,-1,1,-1),pp("n4",e,t,cp,1,1,-1),pp("f1",e,t,cp,-1,-1,1),pp("f2",e,t,cp,1,-1,1),pp("f3",e,t,cp,-1,1,1),pp("f4",e,t,cp,1,1,1),pp("u1",e,t,cp,.7,1.1,-1),pp("u2",e,t,cp,-.7,1.1,-1),pp("u3",e,t,cp,0,2,-1),pp("cf1",e,t,cp,-1,0,1),pp("cf2",e,t,cp,1,0,1),pp("cf3",e,t,cp,0,-1,1),pp("cf4",e,t,cp,0,1,1),pp("cn1",e,t,cp,-1,0,-1),pp("cn2",e,t,cp,1,0,-1),pp("cn3",e,t,cp,0,-1,-1),pp("cn4",e,t,cp,0,1,-1),t.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function pp(t,e,i,n,r,s,o){up.set(r,s,o).unproject(n);const a=e[t];if(void 0!==a){const t=i.getAttribute("position");for(let e=0,i=a.length;e<i;e++)t.setXYZ(a[e],up.x,up.y,up.z)}}const fp=new ln;class mp extends rl{constructor(t,e=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new Float32Array(24),r=new Gr;r.setIndex(new Er(i,1)),r.setAttribute("position",new Er(n,3)),super(r,new Qh({color:e,toneMapped:!1})),this.object=t,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(t){if(void 0!==this.object&&fp.setFromObject(this.object),fp.isEmpty())return;const e=fp.min,i=fp.max,n=this.geometry.attributes.position,r=n.array;r[0]=i.x,r[1]=i.y,r[2]=i.z,r[3]=e.x,r[4]=i.y,r[5]=i.z,r[6]=e.x,r[7]=e.y,r[8]=i.z,r[9]=i.x,r[10]=e.y,r[11]=i.z,r[12]=i.x,r[13]=i.y,r[14]=e.z,r[15]=e.x,r[16]=i.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=i.x,r[22]=e.y,r[23]=e.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(t){return this.object=t,this.update(),this}copy(t){return rl.prototype.copy.call(this,t),this.object=t.object,this}}class gp extends rl{constructor(t,e=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new Gr;n.setIndex(new Er(i,1)),n.setAttribute("position",new Br([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),super(n,new Qh({color:e,toneMapped:!1})),this.box=t,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(t){const e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(t))}}class vp extends el{constructor(t,e=1,i=16776960){const n=i,r=new Gr;r.setAttribute("position",new Br([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),r.computeBoundingSphere(),super(r,new Qh({color:n,toneMapped:!1})),this.type="PlaneHelper",this.plane=t,this.size=e;const s=new Gr;s.setAttribute("position",new Br([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),s.computeBoundingSphere(),this.add(new as(s,new Ar({color:n,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(t){let e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?m:f,this.lookAt(this.plane.normal),super.updateMatrixWorld(t)}}const yp=new on;let xp,wp;class bp extends hr{constructor(t=new on(0,0,1),e=new on(0,0,0),i=1,n=16776960,r=.2*i,s=.2*r){super(),this.type="ArrowHelper",void 0===xp&&(xp=new Gr,xp.setAttribute("position",new Br([0,0,0,0,1,0],3)),wp=new Hl(0,.5,1,5,1),wp.translate(0,-.5,0)),this.position.copy(e),this.line=new el(xp,new Qh({color:n,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new as(wp,new Ar({color:n,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(i,r,s)}setDirection(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{yp.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(yp,e)}}setLength(t,e=.2*t,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 Ap extends rl{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 Gr;i.setAttribute("position",new Br(e,3)),i.setAttribute("color",new Br([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));super(i,new Qh({vertexColors:!0,toneMapped:!1})),this.type="AxesHelper"}setColors(t,e,i){const n=new Wi,r=this.geometry.attributes.color.array;return n.set(t),n.toArray(r,0),n.toArray(r,3),n.set(e),n.toArray(r,6),n.toArray(r,9),n.set(i),n.toArray(r,12),n.toArray(r,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class Tp{constructor(){this.type="ShapePath",this.color=new Wi,this.subPaths=[],this.currentPath=null}moveTo(t,e){return this.currentPath=new Nl,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this}lineTo(t,e){return this.currentPath.lineTo(t,e),this}quadraticCurveTo(t,e,i,n){return this.currentPath.quadraticCurveTo(t,e,i,n),this}bezierCurveTo(t,e,i,n,r,s){return this.currentPath.bezierCurveTo(t,e,i,n,r,s),this}splineThru(t){return this.currentPath.splineThru(t),this}toShapes(t,e){function i(t){const e=[];for(let i=0,n=t.length;i<n;i++){const n=t[i],r=new Jl;r.curves=n.curves,e.push(r)}return e}function n(t,e){const i=e.length;let n=!1;for(let r=i-1,s=0;s<i;r=s++){let i=e[r],o=e[s],a=o.x-i.x,h=o.y-i.y;if(Math.abs(h)>Number.EPSILON){if(h<0&&(i=e[s],a=-a,o=e[r],h=-h),t.y<i.y||t.y>o.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=Tu.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 Jl,h.curves=a.curves,l.push(h),l;let u=!r(s[0].getPoints());u=t?!u:u;const c=[],d=[];let p,f,m=[],g=0;d[g]=void 0,m[g]=[];for(let e=0,i=s.length;e<i;e++)a=s[e],p=a.getPoints(),o=r(p),o=t?!o:o,o?(!u&&d[g]&&g++,d[g]={s:new Jl,p:p},d[g].s.curves=a.curves,u&&g++,m[g]=[]):m[g].push({h:a,p:p[0]});if(!d[0])return i(s);if(d.length>1){let t=!1,e=0;for(let t=0,e=d.length;t<e;t++)c[t]=[];for(let i=0,r=d.length;i<r;i++){const r=m[i];for(let s=0;s<r.length;s++){const o=r[s];let a=!0;for(let r=0;r<d.length;r++)n(o.p,d[r].p)&&(i!==r&&e++,a?(a=!1,c[r].push(o)):t=!0);a&&c[i].push(o)}}e>0&&!1===t&&(m=c)}for(let t=0,e=d.length;t<e;t++){h=d[t].s,l.push(h),f=m[t];for(let t=0,e=f.length;t<e;t++)h.holes.push(f[t].h)}return l}}class Sp{static toHalfFloat(t){Math.abs(t),t=bi(t,-65504,65504),Mp[0]=t;const e=_p[0],i=e>>23&511;return Cp[i]+((8388607&e)>>Pp[i])}static fromHalfFloat(t){const e=t>>10;return _p[0]=Rp[Op[e]+(1023&t)]+Lp[e],Mp[0]}}const Ep=new ArrayBuffer(4),Mp=new Float32Array(Ep),_p=new Uint32Array(Ep),Cp=new Uint32Array(512),Pp=new Uint32Array(512);for(let t=0;t<256;++t){const e=t-127;e<-27?(Cp[t]=0,Cp[256|t]=32768,Pp[t]=24,Pp[256|t]=24):e<-14?(Cp[t]=1024>>-e-14,Cp[256|t]=1024>>-e-14|32768,Pp[t]=-e-1,Pp[256|t]=-e-1):e<=15?(Cp[t]=e+15<<10,Cp[256|t]=e+15<<10|32768,Pp[t]=13,Pp[256|t]=13):e<128?(Cp[t]=31744,Cp[256|t]=64512,Pp[t]=24,Pp[256|t]=24):(Cp[t]=31744,Cp[256|t]=64512,Pp[t]=13,Pp[256|t]=13)}const Rp=new Uint32Array(2048),Lp=new Uint32Array(64),Op=new Uint32Array(64);for(let t=1;t<1024;++t){let e=t<<13,i=0;for(;0==(8388608&e);)e<<=1,i-=8388608;e&=-8388609,i+=947912704,Rp[t]=e|i}for(let t=1024;t<2048;++t)Rp[t]=939524096+(t-1024<<13);for(let t=1;t<31;++t)Lp[t]=t<<23;Lp[31]=1199570944,Lp[32]=2147483648;for(let t=33;t<63;++t)Lp[t]=2147483648+(t-32<<23);Lp[63]=3347054592;for(let t=1;t<64;++t)32!==t&&(Op[t]=1024);const Dp=0,Bp=1,Ip=0,Fp=1,kp=2;function Np(t){return t}function zp(t=[]){return t.isMultiMaterial=!0,t.materials=t,t.clone=function(){return t.slice()},t}class Up extends cl{constructor(t,e){super(t,e)}}class Vp extends _h{constructor(t){super(t)}}class Hp extends cl{constructor(t,e){super(t,e)}}class Gp extends ol{constructor(t){super(t)}}class Wp extends ol{constructor(t){super(t)}}class Yp extends ol{constructor(t){super(t)}}class Xp extends on{constructor(t,e,i){super(t,e,i)}}class jp extends Er{constructor(t,e){super(t,e),this.setUsage(ri)}}class qp extends Mr{constructor(t,e){super(t,e)}}class Qp extends _r{constructor(t,e){super(t,e)}}class Kp extends Cr{constructor(t,e){super(t,e)}}class Jp extends Pr{constructor(t,e){super(t,e)}}class Zp extends Rr{constructor(t,e){super(t,e)}}class $p extends Lr{constructor(t,e){super(t,e)}}class tf extends Or{constructor(t,e){super(t,e)}}class ef extends Br{constructor(t,e){super(t,e)}}class nf extends Ir{constructor(t,e){super(t,e)}}vl.create=function(t,e){return t.prototype=Object.create(vl.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Nl.prototype.fromPoints=function(t){return this.setFromPoints(t)};class rf extends Ap{constructor(t){super(t)}}class sf extends mp{constructor(t,e){super(t,e)}}class of extends rl{constructor(t,e){super(new Kl(t.geometry),new Qh({color:void 0!==e?e:16777215}))}}rp.prototype.setColors=function(){},Zd.prototype.update=function(){};class af extends rl{constructor(t,e){super(new ku(t.geometry),new Qh({color:void 0!==e?e:16777215}))}}mc.prototype.extractUrlBase=function(t){return Wc.extractUrlBase(t)},mc.Handlers={add:function(){},get:function(){}};class hf extends vc{constructor(t){super(t)}}class lf extends Ac{constructor(t){super(t)}}Gd.prototype.center=function(t){return this.getCenter(t)},Gd.prototype.empty=function(){return this.isEmpty()},Gd.prototype.isIntersectionBox=function(t){return this.intersectsBox(t)},Gd.prototype.size=function(t){return this.getSize(t)},ln.prototype.center=function(t){return this.getCenter(t)},ln.prototype.empty=function(){return this.isEmpty()},ln.prototype.isIntersectionBox=function(t){return this.intersectsBox(t)},ln.prototype.isIntersectionSphere=function(t){return this.intersectsSphere(t)},ln.prototype.size=function(t){return this.getSize(t)},jn.prototype.toVector3=function(){},Cn.prototype.empty=function(){return this.isEmpty()},Es.prototype.setFromMatrix=function(t){return this.setFromProjectionMatrix(t)},Xd.prototype.center=function(t){return this.getCenter(t)},Pi.prototype.flattenToArrayOffset=function(t,e){return this.toArray(t,e)},Pi.prototype.multiplyVector3=function(t){return t.applyMatrix3(this)},Pi.prototype.multiplyVector3Array=function(){},Pi.prototype.applyToBufferAttribute=function(t){return t.applyMatrix3(this)},Pi.prototype.applyToVector3Array=function(){},Pi.prototype.getInverse=function(t){return this.copy(t).invert()},kn.prototype.extractPosition=function(t){return this.copyPosition(t)},kn.prototype.flattenToArrayOffset=function(t,e){return this.toArray(t,e)},kn.prototype.getPosition=function(){return(new on).setFromMatrixColumn(this,3)},kn.prototype.setRotationFromQuaternion=function(t){return this.makeRotationFromQuaternion(t)},kn.prototype.multiplyToArray=function(){},kn.prototype.multiplyVector3=function(t){return t.applyMatrix4(this)},kn.prototype.multiplyVector4=function(t){return t.applyMatrix4(this)},kn.prototype.multiplyVector3Array=function(){},kn.prototype.rotateAxis=function(t){t.transformDirection(this)},kn.prototype.crossVector=function(t){return t.applyMatrix4(this)},kn.prototype.translate=function(){},kn.prototype.rotateX=function(){},kn.prototype.rotateY=function(){},kn.prototype.rotateZ=function(){},kn.prototype.rotateByAxis=function(){},kn.prototype.applyToBufferAttribute=function(t){return t.applyMatrix4(this)},kn.prototype.applyToVector3Array=function(){},kn.prototype.makeFrustum=function(t,e,i,n,r,s){return this.makePerspective(t,e,n,i,r,s)},kn.prototype.getInverse=function(t){return this.copy(t).invert()},As.prototype.isIntersectionLine=function(t){return this.intersectsLine(t)},sn.prototype.multiplyVector3=function(t){return t.applyQuaternion(this)},sn.prototype.inverse=function(){return this.invert()},Fn.prototype.isIntersectionBox=function(t){return this.intersectsBox(t)},Fn.prototype.isIntersectionPlane=function(t){return this.intersectsPlane(t)},Fn.prototype.isIntersectionSphere=function(t){return this.intersectsSphere(t)},xr.prototype.area=function(){return this.getArea()},xr.prototype.barycoordFromPoint=function(t,e){return this.getBarycoord(t,e)},xr.prototype.midpoint=function(t){return this.getMidpoint(t)},xr.prototypenormal=function(t){return this.getNormal(t)},xr.prototype.plane=function(t){return this.getPlane(t)},xr.barycoordFromPoint=function(t,e,i,n,r){return xr.getBarycoord(t,e,i,n,r)},xr.normal=function(t,e,i,n){return xr.getNormal(t,e,i,n)},Jl.prototype.extractAllPoints=function(t){return this.extractPoints(t)},Jl.prototype.extrude=function(t){return new Mu(this,t)},Jl.prototype.makeGeometry=function(t){return new Lu(this,t)},Ci.prototype.fromAttribute=function(t,e,i){return this.fromBufferAttribute(t,e,i)},Ci.prototype.distanceToManhattan=function(t){return this.manhattanDistanceTo(t)},Ci.prototype.lengthManhattan=function(){return this.manhattanLength()},on.prototype.setEulerFromRotationMatrix=function(){},on.prototype.setEulerFromQuaternion=function(){},on.prototype.getPositionFromMatrix=function(t){return this.setFromMatrixPosition(t)},on.prototype.getScaleFromMatrix=function(t){return this.setFromMatrixScale(t)},on.prototype.getColumnFromMatrix=function(t,e){return this.setFromMatrixColumn(e,t)},on.prototype.applyProjection=function(t){return this.applyMatrix4(t)},on.prototype.fromAttribute=function(t,e,i){return this.fromBufferAttribute(t,e,i)},on.prototype.distanceToManhattan=function(t){return this.manhattanDistanceTo(t)},on.prototype.lengthManhattan=function(){return this.manhattanLength()},Ji.prototype.fromAttribute=function(t,e,i){return this.fromBufferAttribute(t,e,i)},Ji.prototype.lengthManhattan=function(){return this.manhattanLength()},hr.prototype.getChildByName=function(t){return this.getObjectByName(t)},hr.prototype.renderDepth=function(){},hr.prototype.translate=function(t,e){return this.translateOnAxis(e,t)},hr.prototype.getWorldRotation=function(){},hr.prototype.applyMatrix=function(t){return this.applyMatrix4(t)},Object.defineProperties(hr.prototype,{eulerOrder:{get:function(){return this.rotation.order},set:function(t){this.rotation.order=t}},useQuaternion:{get:function(){},set:function(){}}}),as.prototype.setDrawMode=function(){},Object.defineProperties(as.prototype,{drawMode:{get:function(){return Pe},set:function(){}}}),kh.prototype.initBones=function(){},ms.prototype.setLens=function(t,e){void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(Sc.prototype,{onlyShadow:{set:function(){}},shadowCameraFov:{set:function(t){this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){}},shadowBias:{set:function(t){this.shadow.bias=t}},shadowDarkness:{set:function(){}},shadowMapWidth:{set:function(t){this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){this.shadow.mapSize.height=t}}}),Object.defineProperties(Er.prototype,{length:{get:function(){return this.array.length}},dynamic:{get:function(){return this.usage===ri},set:function(){this.setUsage(ri)}}}),Er.prototype.setDynamic=function(t){return this.setUsage(!0===t?ri:ni),this},Er.prototype.copyIndicesArray=function(){},Er.prototype.setArray=function(){},Gr.prototype.addIndex=function(t){this.setIndex(t)},Gr.prototype.addAttribute=function(t,e){return e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(this.setIndex(e),this):this.setAttribute(t,e):this.setAttribute(t,new Er(arguments[1],arguments[2]))},Gr.prototype.addDrawCall=function(t,e,i){this.addGroup(t,e)},Gr.prototype.clearDrawCalls=function(){this.clearGroups()},Gr.prototype.computeOffsets=function(){},Gr.prototype.removeAttribute=function(t){return this.deleteAttribute(t)},Gr.prototype.applyMatrix=function(t){return this.applyMatrix4(t)},Object.defineProperties(Gr.prototype,{drawcalls:{get:function(){return this.groups}},offsets:{get:function(){return this.groups}}}),uh.prototype.setDynamic=function(t){return this.setUsage(!0===t?ri:ni),this},uh.prototype.setArray=function(){},Mu.prototype.getArrays=function(){},Mu.prototype.addShapeList=function(){},Mu.prototype.addShape=function(){},lh.prototype.dispose=function(){},Bd.prototype.onUpdate=function(){return this},Object.defineProperties(br.prototype,{wrapAround:{get:function(){},set:function(){}},overdraw:{get:function(){},set:function(){}},wrapRGB:{get:function(){return new Wi}},shading:{get:function(){},set:function(t){this.flatShading=t===v}},stencilMask:{get:function(){return this.stencilFuncMask},set:function(t){this.stencilFuncMask=t}},vertexTangents:{get:function(){},set:function(){}}}),Object.defineProperties(ps.prototype,{derivatives:{get:function(){return this.extensions.derivatives},set:function(t){this.extensions.derivatives=t}}}),sh.prototype.clearTarget=function(t,e,i,n){this.setRenderTarget(t),this.clear(e,i,n)},sh.prototype.animate=function(t){this.setAnimationLoop(t)},sh.prototype.getCurrentRenderTarget=function(){return this.getRenderTarget()},sh.prototype.getMaxAnisotropy=function(){return this.capabilities.getMaxAnisotropy()},sh.prototype.getPrecision=function(){return this.capabilities.precision},sh.prototype.resetGLState=function(){return this.state.reset()},sh.prototype.supportsFloatTextures=function(){return this.extensions.get("OES_texture_float")},sh.prototype.supportsHalfFloatTextures=function(){return this.extensions.get("OES_texture_half_float")},sh.prototype.supportsStandardDerivatives=function(){return this.extensions.get("OES_standard_derivatives")},sh.prototype.supportsCompressedTextureS3TC=function(){return this.extensions.get("WEBGL_compressed_texture_s3tc")},sh.prototype.supportsCompressedTexturePVRTC=function(){return this.extensions.get("WEBGL_compressed_texture_pvrtc")},sh.prototype.supportsBlendMinMax=function(){return this.extensions.get("EXT_blend_minmax")},sh.prototype.supportsVertexTextures=function(){return this.capabilities.vertexTextures},sh.prototype.supportsInstancedArrays=function(){return this.extensions.get("ANGLE_instanced_arrays")},sh.prototype.enableScissorTest=function(t){this.setScissorTest(t)},sh.prototype.initMaterial=function(){},sh.prototype.addPrePlugin=function(){},sh.prototype.addPostPlugin=function(){},sh.prototype.updateShadowMap=function(){},sh.prototype.setFaceCulling=function(){},sh.prototype.allocTextureUnit=function(){},sh.prototype.setTexture=function(){},sh.prototype.setTexture2D=function(){},sh.prototype.setTextureCube=function(){},sh.prototype.getActiveMipMapLevel=function(){return this.getActiveMipmapLevel()},Object.defineProperties(sh.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){this.shadowMap.type=t}},shadowMapCullFace:{get:function(){},set:function(){}},context:{get:function(){return this.getContext()}},vr:{get:function(){return this.xr}},gammaInput:{get:function(){return!1},set:function(){}},gammaOutput:{get:function(){return!1},set:function(t){this.outputEncoding=!0===t?De:Oe}},toneMappingWhitePoint:{get:function(){return 1},set:function(){}},gammaFactor:{get:function(){return 2},set:function(){}}}),Object.defineProperties(qa.prototype,{cullFace:{get:function(){},set:function(){}},renderReverseSided:{get:function(){},set:function(){}},renderSingleSided:{get:function(){},set:function(){}}});class uf extends ys{constructor(t,e,i){super(t,i)}}function cf(){}function df(){}Object.defineProperties(Zi.prototype,{wrapS:{get:function(){return this.texture.wrapS},set:function(t){this.texture.wrapS=t}},wrapT:{get:function(){return this.texture.wrapT},set:function(t){this.texture.wrapT=t}},magFilter:{get:function(){return this.texture.magFilter},set:function(t){this.texture.magFilter=t}},minFilter:{get:function(){return this.texture.minFilter},set:function(t){this.texture.minFilter=t}},anisotropy:{get:function(){return this.texture.anisotropy},set:function(t){this.texture.anisotropy=t}},offset:{get:function(){return this.texture.offset},set:function(t){this.texture.offset=t}},repeat:{get:function(){return this.texture.repeat},set:function(t){this.texture.repeat=t}},format:{get:function(){return this.texture.format},set:function(t){this.texture.format=t}},type:{get:function(){return this.texture.type},set:function(t){this.texture.type=t}},generateMipmaps:{get:function(){return this.texture.generateMipmaps},set:function(t){this.texture.generateMipmaps=t}}}),fd.prototype.load=function(t){const e=this;return(new td).load(t,(function(t){e.setBuffer(t)})),this},wd.prototype.getData=function(){return this.getFrequencyData()},gs.prototype.updateCubeMap=function(t,e){return this.update(t,e)},gs.prototype.clear=function(t,e,i,n){return this.renderTarget.clear(t,e,i,n)},Xi.crossOrigin=void 0,Xi.loadTexture=function(t,e,i,n){const r=new Tc;r.setCrossOrigin(this.crossOrigin);const s=r.load(t,i,void 0,n);return e&&(s.mapping=e),s},Xi.loadTextureCube=function(t,e,i,n){const r=new bc;r.setCrossOrigin(this.crossOrigin);const s=r.load(t,i,void 0,n);return e&&(s.mapping=e),s},Xi.loadCompressedTexture=function(){},Xi.loadCompressedTextureCube=function(){};const pf={createMultiMaterialObject:function(){},detach:function(){},attach:function(){}};function ff(){}class mf extends Gr{constructor(){super()}}class gf extends Gr{constructor(){super()}}function vf(){}function yf(){}function xf(){}class wf extends Zi{constructor(t,e,i){super(t,e,i),this.samples=4}}class bf extends $i{constructor(t,e,i,n){super(t,e,i,n)}}class Af extends en{constructor(t,e,i,n){super(t,e,i,n)}}"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:n}})),"undefined"!=typeof window&&(window.__THREE__||(window.__THREE__=n))},function(t,e,i){"use strict";i(34);var n=i(4),r=i(55),s=i.n(r),o={soundEnabled:!0,bgMusicEnabled:!1,soundVolume:1,bgMusicVolume:.5,bgMusicLoop:!0,playerSpeed:1,playerColor:"#42c0ff",enemySpeed:.75,enemyDiffRaise:.05,enemyColor:"#55C53E",playerArmColor:"#464346",levelCount:10,selectedLevel1:0,selectedLevel2:1,selectedLevel3:0,skipCountdown:!1,skipSearchingOpponent:!1,countdownStart:3,countdownSpeed:600,enableBgStars:!0,enableStarTrails:!1,level1_bgTop:"#807EFF",level1_bgBottom:"#F1E8FF",level2_bgTop:"#FFEBA5",level2_bgBottom:"#FFACA7",level3_bgTop:"#9CE479",level3_bgBottom:"#E3FFC8",level3_floorColor1:"#FD94FE",level3_floorColor2:"#ED53FD",level3_floorMetalness:.5,level4_bgTop:"#96E4FF",level4_bgBottom:"#44BDFD",level5_bgTop:"#F5FFAD",level5_bgBottom:"#7AFE70",level6_bgTop:"#FFB890",level6_bgBottom:"#FF627A",level6_coinPlacementType:2,level7_bgTop:"#FFF0AE",level7_bgBottom:"#FFB0AD",level7_floorColor1:"#FFFEFF",level7_floorColor2:"#DDDADD",level7_floorMetalness:.5,level8_bgTop:"#CCC3FF",level8_bgBottom:"#4BC5FD",level8_floorColor1:"#FFDE60",level8_floorColor2:"#F7A645",level8_floorMetalness:.5,level9_bgTop:"#FFFFA9",level9_bgBottom:"#E6E033",level10_bgTop:"#5CEF7F",level10_bgBottom:"#F4F3FB",level10_coinPlacementType:2};function a(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var h=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,n;return e=t,n=[{key:"cloneAsset",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=d.models[t],n=i.scene.clone();return i.animations&&(n.animations=i.animations),n.scale.multiplyScalar(e),n}},{key:"cloneAssetSkeleton",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=d.models[t],n=THREE.SkeletonUtils.clone(i.scene);return n.animations=i.animations,n.scale.multiplyScalar(e),n}},{key:"getTexture",value:function(t){return d.textures[t]}}],(i=null)&&a(e.prototype,i),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),l=i(12),u=i(56),c=(i(37),{phaserGame:null,phaserScene:null,threeScene:null,threeRenderer:null,threeCamera:null,uiScene:null,audioIcon:null,resolution:1.2,minResolution:1,lowEndDevice:!1,enableShadows:!1,antialiasDefault:!0,data:o,postprocessEnabled:!1,showGpuInfo:!1,showLevelButtons:!1,eventEmitter:new s.a,gpuTier:null,deltaMultiplier:1,locales:u,addToGame:n.a.addToGame,addToUpdate:n.a.addToUpdateables,guiHelper:l.a,cloneAsset:h.cloneAsset,cloneAssetSkeleton:h.cloneAssetSkeleton,getTexture:h.getTexture,vibrateOn:!0,soundOn:!0,currentCoin:0,currentScore:0,lastScore:0,lastCoin:0,playerData:{score:0,coin:0,level:0,speedUpgradeLevel:1,bestScore:0},saveData:{coin:0,level:0,speedUpgradeLevel:1,bestScore:0},bestScore:0,lastLevelIndex:0,upgrades:{speedUpgrade:{get name(){return c.locales.UPGRADE_SPEED},get level(){return c.playerData.speedUpgradeLevel},set level(t){c.playerData.speedUpgradeLevel=t},startingCost:15,get cost(){return this.startingCost+20*(this.level-1)}}},vibrateFeedback:function(t){c.vibrateOn&&H5SDK.getHapticModule().performHapticFeedBack(t)}}),d=e.a=c},function(t,e,i){"use strict";i.r(e),i.d(e,"AABB",(function(){return u})),i.d(e,"ArrayCollisionMatrix",(function(){return p})),i.d(e,"BODY_SLEEP_STATES",(function(){return L})),i.d(e,"BODY_TYPES",(function(){return R})),i.d(e,"Body",(function(){return O})),i.d(e,"Box",(function(){return _})),i.d(e,"Broadphase",(function(){return X})),i.d(e,"COLLISION_TYPES",(function(){return vn})),i.d(e,"ConeTwistConstraint",(function(){return ce})),i.d(e,"Constraint",(function(){return Ut})),i.d(e,"ContactEquation",(function(){return Qt})),i.d(e,"ContactMaterial",(function(){return be})),i.d(e,"ConvexPolyhedron",(function(){return A})),i.d(e,"Cylinder",(function(){return wi})),i.d(e,"DistanceConstraint",(function(){return de})),i.d(e,"Equation",(function(){return Ht})),i.d(e,"EventTarget",(function(){return f})),i.d(e,"FrictionEquation",(function(){return ye})),i.d(e,"GSSolver",(function(){return tn})),i.d(e,"GridBroadphase",(function(){return J})),i.d(e,"Heightfield",(function(){return Si})),i.d(e,"HingeConstraint",(function(){return me})),i.d(e,"JacobianElement",(function(){return Vt})),i.d(e,"LockConstraint",(function(){return pe})),i.d(e,"Mat3",(function(){return r})),i.d(e,"Material",(function(){return Ae})),i.d(e,"NaiveBroadphase",(function(){return $})),i.d(e,"Narrowphase",(function(){return yn})),i.d(e,"ObjectCollisionMatrix",(function(){return n})),i.d(e,"Particle",(function(){return bi})),i.d(e,"Plane",(function(){return Ai})),i.d(e,"PointToPointConstraint",(function(){return re})),i.d(e,"Pool",(function(){return mn})),i.d(e,"Quaternion",(function(){return m})),i.d(e,"RAY_MODES",(function(){return ht})),i.d(e,"Ray",(function(){return lt})),i.d(e,"RaycastResult",(function(){return tt})),i.d(e,"RaycastVehicle",(function(){return Ne})),i.d(e,"RigidVehicle",(function(){return li})),i.d(e,"RotationalEquation",(function(){return he})),i.d(e,"RotationalMotorEquation",(function(){return fe})),i.d(e,"SAPBroadphase",(function(){return Nt})),i.d(e,"SHAPE_TYPES",(function(){return y})),i.d(e,"SPHSystem",(function(){return di})),i.d(e,"Shape",(function(){return x})),i.d(e,"Solver",(function(){return $i})),i.d(e,"Sphere",(function(){return hi})),i.d(e,"SplitSolver",(function(){return sn})),i.d(e,"Spring",(function(){return Te})),i.d(e,"Transform",(function(){return w})),i.d(e,"Trimesh",(function(){return zi})),i.d(e,"Vec3",(function(){return o})),i.d(e,"Vec3Pool",(function(){return gn})),i.d(e,"WheelInfo",(function(){return Ie})),i.d(e,"World",(function(){return zr}));class n{constructor(){this.matrix={}}get(t,e){let{id:i}=t,{id:n}=e;if(n>i){const t=n;n=i,i=t}return`${i}-${n}`in this.matrix}set(t,e,i){let{id:n}=t,{id:r}=e;if(r>n){const t=r;r=n,n=t}i?this.matrix[`${n}-${r}`]=!0:delete this.matrix[`${n}-${r}`]}reset(){this.matrix={}}setNumObjects(t){}}class r{constructor(t){void 0===t&&(t=[0,0,0,0,0,0,0,0,0]),this.elements=t}identity(){const t=this.elements;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}setZero(){const t=this.elements;t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0}setTrace(t){const e=this.elements;e[0]=t.x,e[4]=t.y,e[8]=t.z}getTrace(t){void 0===t&&(t=new o);const e=this.elements;return t.x=e[0],t.y=e[4],t.z=e[8],t}vmult(t,e){void 0===e&&(e=new o);const i=this.elements,n=t.x,r=t.y,s=t.z;return e.x=i[0]*n+i[1]*r+i[2]*s,e.y=i[3]*n+i[4]*r+i[5]*s,e.z=i[6]*n+i[7]*r+i[8]*s,e}smult(t){for(let e=0;e<this.elements.length;e++)this.elements[e]*=t}mmult(t,e){void 0===e&&(e=new r);const i=this.elements,n=t.elements,s=e.elements,o=i[0],a=i[1],h=i[2],l=i[3],u=i[4],c=i[5],d=i[6],p=i[7],f=i[8],m=n[0],g=n[1],v=n[2],y=n[3],x=n[4],w=n[5],b=n[6],A=n[7],T=n[8];return s[0]=o*m+a*y+h*b,s[1]=o*g+a*x+h*A,s[2]=o*v+a*w+h*T,s[3]=l*m+u*y+c*b,s[4]=l*g+u*x+c*A,s[5]=l*v+u*w+c*T,s[6]=d*m+p*y+f*b,s[7]=d*g+p*x+f*A,s[8]=d*v+p*w+f*T,e}scale(t,e){void 0===e&&(e=new r);const i=this.elements,n=e.elements;for(let e=0;3!==e;e++)n[3*e+0]=t.x*i[3*e+0],n[3*e+1]=t.y*i[3*e+1],n[3*e+2]=t.z*i[3*e+2];return e}solve(t,e){void 0===e&&(e=new o);const i=[];let n,r;for(n=0;n<12;n++)i.push(0);for(n=0;n<3;n++)for(r=0;r<3;r++)i[n+4*r]=this.elements[n+3*r];i[3]=t.x,i[7]=t.y,i[11]=t.z;let s=3;const a=s;let h;let l;do{if(n=a-s,0===i[n+4*n])for(r=n+1;r<a;r++)if(0!==i[n+4*r]){h=4;do{l=4-h,i[l+4*n]+=i[l+4*r]}while(--h);break}if(0!==i[n+4*n])for(r=n+1;r<a;r++){const t=i[n+4*r]/i[n+4*n];h=4;do{l=4-h,i[l+4*r]=l<=n?0:i[l+4*r]-i[l+4*n]*t}while(--h)}}while(--s);if(e.z=i[11]/i[10],e.y=(i[7]-i[6]*e.z)/i[5],e.x=(i[3]-i[2]*e.z-i[1]*e.y)/i[0],isNaN(e.x)||isNaN(e.y)||isNaN(e.z)||e.x===1/0||e.y===1/0||e.z===1/0)throw`Could not solve equation! Got x=[${e.toString()}], b=[${t.toString()}], A=[${this.toString()}]`;return e}e(t,e,i){if(void 0===i)return this.elements[e+3*t];this.elements[e+3*t]=i}copy(t){for(let e=0;e<t.elements.length;e++)this.elements[e]=t.elements[e];return this}toString(){let t="";for(let e=0;e<9;e++)t+=this.elements[e]+",";return t}reverse(t){void 0===t&&(t=new r);const e=s;let i,n;for(i=0;i<3;i++)for(n=0;n<3;n++)e[i+6*n]=this.elements[i+3*n];e[3]=1,e[9]=0,e[15]=0,e[4]=0,e[10]=1,e[16]=0,e[5]=0,e[11]=0,e[17]=1;let o=3;const a=o;let h;let l;do{if(i=a-o,0===e[i+6*i])for(n=i+1;n<a;n++)if(0!==e[i+6*n]){h=6;do{l=6-h,e[l+6*i]+=e[l+6*n]}while(--h);break}if(0!==e[i+6*i])for(n=i+1;n<a;n++){const t=e[i+6*n]/e[i+6*i];h=6;do{l=6-h,e[l+6*n]=l<=i?0:e[l+6*n]-e[l+6*i]*t}while(--h)}}while(--o);i=2;do{n=i-1;do{const t=e[i+6*n]/e[i+6*i];h=6;do{l=6-h,e[l+6*n]=e[l+6*n]-e[l+6*i]*t}while(--h)}while(n--)}while(--i);i=2;do{const t=1/e[i+6*i];h=6;do{l=6-h,e[l+6*i]=e[l+6*i]*t}while(--h)}while(i--);i=2;do{n=2;do{if(l=e[3+n+6*i],isNaN(l)||l===1/0)throw`Could not reverse! A=[${this.toString()}]`;t.e(i,n,l)}while(n--)}while(i--);return t}setRotationFromQuaternion(t){const 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,u=e*a,c=i*o,d=i*a,p=n*a,f=r*s,m=r*o,g=r*a,v=this.elements;return v[0]=1-(c+p),v[1]=l-g,v[2]=u+m,v[3]=l+g,v[4]=1-(h+p),v[5]=d-f,v[6]=u-m,v[7]=d+f,v[8]=1-(h+c),this}transpose(t){void 0===t&&(t=new r);const e=this.elements,i=t.elements;let n;return i[0]=e[0],i[4]=e[4],i[8]=e[8],n=e[1],i[1]=e[3],i[3]=n,n=e[2],i[2]=e[6],i[6]=n,n=e[5],i[5]=e[7],i[7]=n,t}}const s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];class o{constructor(t,e,i){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),this.x=t,this.y=e,this.z=i}cross(t,e){void 0===e&&(e=new o);const i=t.x,n=t.y,r=t.z,s=this.x,a=this.y,h=this.z;return e.x=a*r-h*n,e.y=h*i-s*r,e.z=s*n-a*i,e}set(t,e,i){return this.x=t,this.y=e,this.z=i,this}setZero(){this.x=this.y=this.z=0}vadd(t,e){if(!e)return new o(this.x+t.x,this.y+t.y,this.z+t.z);e.x=t.x+this.x,e.y=t.y+this.y,e.z=t.z+this.z}vsub(t,e){if(!e)return new o(this.x-t.x,this.y-t.y,this.z-t.z);e.x=this.x-t.x,e.y=this.y-t.y,e.z=this.z-t.z}crossmat(){return new r([0,-this.z,this.y,this.z,0,-this.x,-this.y,this.x,0])}normalize(){const t=this.x,e=this.y,i=this.z,n=Math.sqrt(t*t+e*e+i*i);if(n>0){const t=1/n;this.x*=t,this.y*=t,this.z*=t}else this.x=0,this.y=0,this.z=0;return n}unit(t){void 0===t&&(t=new o);const e=this.x,i=this.y,n=this.z;let r=Math.sqrt(e*e+i*i+n*n);return r>0?(r=1/r,t.x=e*r,t.y=i*r,t.z=n*r):(t.x=1,t.y=0,t.z=0),t}length(){const t=this.x,e=this.y,i=this.z;return Math.sqrt(t*t+e*e+i*i)}lengthSquared(){return this.dot(this)}distanceTo(t){const e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,o=t.z;return Math.sqrt((r-e)*(r-e)+(s-i)*(s-i)+(o-n)*(o-n))}distanceSquared(t){const e=this.x,i=this.y,n=this.z,r=t.x,s=t.y,o=t.z;return(r-e)*(r-e)+(s-i)*(s-i)+(o-n)*(o-n)}scale(t,e){void 0===e&&(e=new o);const i=this.x,n=this.y,r=this.z;return e.x=t*i,e.y=t*n,e.z=t*r,e}vmul(t,e){return void 0===e&&(e=new o),e.x=t.x*this.x,e.y=t.y*this.y,e.z=t.z*this.z,e}addScaledVector(t,e,i){return void 0===i&&(i=new o),i.x=this.x+t*e.x,i.y=this.y+t*e.y,i.z=this.z+t*e.z,i}dot(t){return this.x*t.x+this.y*t.y+this.z*t.z}isZero(){return 0===this.x&&0===this.y&&0===this.z}negate(t){return void 0===t&&(t=new o),t.x=-this.x,t.y=-this.y,t.z=-this.z,t}tangents(t,e){const i=this.length();if(i>0){const n=a,r=1/i;n.set(this.x*r,this.y*r,this.z*r);const s=h;Math.abs(n.x)<.9?(s.set(1,0,0),n.cross(s,t)):(s.set(0,1,0),n.cross(s,t)),n.cross(t,e)}else t.set(1,0,0),e.set(0,1,0)}toString(){return`${this.x},${this.y},${this.z}`}toArray(){return[this.x,this.y,this.z]}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this}lerp(t,e,i){const n=this.x,r=this.y,s=this.z;i.x=n+(t.x-n)*e,i.y=r+(t.y-r)*e,i.z=s+(t.z-s)*e}almostEquals(t,e){return void 0===e&&(e=1e-6),!(Math.abs(this.x-t.x)>e||Math.abs(this.y-t.y)>e||Math.abs(this.z-t.z)>e)}almostZero(t){return void 0===t&&(t=1e-6),!(Math.abs(this.x)>t||Math.abs(this.y)>t||Math.abs(this.z)>t)}isAntiparallelTo(t,e){return this.negate(l),l.almostEquals(t,e)}clone(){return new o(this.x,this.y,this.z)}}o.ZERO=new o(0,0,0),o.UNIT_X=new o(1,0,0),o.UNIT_Y=new o(0,1,0),o.UNIT_Z=new o(0,0,1);const a=new o,h=new o,l=new o;class u{constructor(t){void 0===t&&(t={}),this.lowerBound=new o,this.upperBound=new o,t.lowerBound&&this.lowerBound.copy(t.lowerBound),t.upperBound&&this.upperBound.copy(t.upperBound)}setFromPoints(t,e,i,n){const r=this.lowerBound,s=this.upperBound,o=i;r.copy(t[0]),o&&o.vmult(r,r),s.copy(r);for(let e=1;e<t.length;e++){let i=t[e];o&&(o.vmult(i,c),i=c),i.x>s.x&&(s.x=i.x),i.x<r.x&&(r.x=i.x),i.y>s.y&&(s.y=i.y),i.y<r.y&&(r.y=i.y),i.z>s.z&&(s.z=i.z),i.z<r.z&&(r.z=i.z)}return e&&(e.vadd(r,r),e.vadd(s,s)),n&&(r.x-=n,r.y-=n,r.z-=n,s.x+=n,s.y+=n,s.z+=n),this}copy(t){return this.lowerBound.copy(t.lowerBound),this.upperBound.copy(t.upperBound),this}clone(){return(new u).copy(this)}extend(t){this.lowerBound.x=Math.min(this.lowerBound.x,t.lowerBound.x),this.upperBound.x=Math.max(this.upperBound.x,t.upperBound.x),this.lowerBound.y=Math.min(this.lowerBound.y,t.lowerBound.y),this.upperBound.y=Math.max(this.upperBound.y,t.upperBound.y),this.lowerBound.z=Math.min(this.lowerBound.z,t.lowerBound.z),this.upperBound.z=Math.max(this.upperBound.z,t.upperBound.z)}overlaps(t){const e=this.lowerBound,i=this.upperBound,n=t.lowerBound,r=t.upperBound,s=n.x<=i.x&&i.x<=r.x||e.x<=r.x&&r.x<=i.x,o=n.y<=i.y&&i.y<=r.y||e.y<=r.y&&r.y<=i.y,a=n.z<=i.z&&i.z<=r.z||e.z<=r.z&&r.z<=i.z;return s&&o&&a}volume(){const t=this.lowerBound,e=this.upperBound;return(e.x-t.x)*(e.y-t.y)*(e.z-t.z)}contains(t){const e=this.lowerBound,i=this.upperBound,n=t.lowerBound,r=t.upperBound;return e.x<=n.x&&i.x>=r.x&&e.y<=n.y&&i.y>=r.y&&e.z<=n.z&&i.z>=r.z}getCorners(t,e,i,n,r,s,o,a){const h=this.lowerBound,l=this.upperBound;t.copy(h),e.set(l.x,h.y,h.z),i.set(l.x,l.y,h.z),n.set(h.x,l.y,l.z),r.set(l.x,h.y,l.z),s.set(h.x,l.y,h.z),o.set(h.x,h.y,l.z),a.copy(l)}toLocalFrame(t,e){const i=d,n=i[0],r=i[1],s=i[2],o=i[3],a=i[4],h=i[5],l=i[6],u=i[7];this.getCorners(n,r,s,o,a,h,l,u);for(let e=0;8!==e;e++){const n=i[e];t.pointToLocal(n,n)}return e.setFromPoints(i)}toWorldFrame(t,e){const i=d,n=i[0],r=i[1],s=i[2],o=i[3],a=i[4],h=i[5],l=i[6],u=i[7];this.getCorners(n,r,s,o,a,h,l,u);for(let e=0;8!==e;e++){const n=i[e];t.pointToWorld(n,n)}return e.setFromPoints(i)}overlapsRay(t){const{direction:e,from:i}=t,n=1/e.x,r=1/e.y,s=1/e.z,o=(this.lowerBound.x-i.x)*n,a=(this.upperBound.x-i.x)*n,h=(this.lowerBound.y-i.y)*r,l=(this.upperBound.y-i.y)*r,u=(this.lowerBound.z-i.z)*s,c=(this.upperBound.z-i.z)*s,d=Math.max(Math.max(Math.min(o,a),Math.min(h,l)),Math.min(u,c)),p=Math.min(Math.min(Math.max(o,a),Math.max(h,l)),Math.max(u,c));return!(p<0)&&!(d>p)}}const c=new o,d=[new o,new o,new o,new o,new o,new o,new o,new o];class p{constructor(){this.matrix=[]}get(t,e){let{index:i}=t,{index:n}=e;if(n>i){const t=n;n=i,i=t}return this.matrix[(i*(i+1)>>1)+n-1]}set(t,e,i){let{index:n}=t,{index:r}=e;if(r>n){const t=r;r=n,n=t}this.matrix[(n*(n+1)>>1)+r-1]=i?1:0}reset(){for(let t=0,e=this.matrix.length;t!==e;t++)this.matrix[t]=0}setNumObjects(t){this.matrix.length=t*(t-1)>>1}}class f{addEventListener(t,e){void 0===this._listeners&&(this._listeners={});const i=this._listeners;return void 0===i[t]&&(i[t]=[]),i[t].includes(e)||i[t].push(e),this}hasEventListener(t,e){if(void 0===this._listeners)return!1;const i=this._listeners;return!(void 0===i[t]||!i[t].includes(e))}hasAnyEventListener(t){if(void 0===this._listeners)return!1;return void 0!==this._listeners[t]}removeEventListener(t,e){if(void 0===this._listeners)return this;const i=this._listeners;if(void 0===i[t])return this;const n=i[t].indexOf(e);return-1!==n&&i[t].splice(n,1),this}dispatchEvent(t){if(void 0===this._listeners)return this;const e=this._listeners[t.type];if(void 0!==e){t.target=this;for(let i=0,n=e.length;i<n;i++)e[i].call(this,t)}return this}}class m{constructor(t,e,i,n){void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=1),this.x=t,this.y=e,this.z=i,this.w=n}set(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this}toString(){return`${this.x},${this.y},${this.z},${this.w}`}toArray(){return[this.x,this.y,this.z,this.w]}setFromAxisAngle(t,e){const i=Math.sin(.5*e);return this.x=t.x*i,this.y=t.y*i,this.z=t.z*i,this.w=Math.cos(.5*e),this}toAxisAngle(t){void 0===t&&(t=new o),this.normalize();const e=2*Math.acos(this.w),i=Math.sqrt(1-this.w*this.w);return i<.001?(t.x=this.x,t.y=this.y,t.z=this.z):(t.x=this.x/i,t.y=this.y/i,t.z=this.z/i),[t,e]}setFromVectors(t,e){if(t.isAntiparallelTo(e)){const e=g,i=v;t.tangents(e,i),this.setFromAxisAngle(e,Math.PI)}else{const i=t.cross(e);this.x=i.x,this.y=i.y,this.z=i.z,this.w=Math.sqrt(t.length()**2*e.length()**2)+t.dot(e),this.normalize()}return this}mult(t,e){void 0===e&&(e=new m);const i=this.x,n=this.y,r=this.z,s=this.w,o=t.x,a=t.y,h=t.z,l=t.w;return e.x=i*l+s*o+n*h-r*a,e.y=n*l+s*a+r*o-i*h,e.z=r*l+s*h+i*a-n*o,e.w=s*l-i*o-n*a-r*h,e}inverse(t){void 0===t&&(t=new m);const e=this.x,i=this.y,n=this.z,r=this.w;this.conjugate(t);const s=1/(e*e+i*i+n*n+r*r);return t.x*=s,t.y*=s,t.z*=s,t.w*=s,t}conjugate(t){return void 0===t&&(t=new m),t.x=-this.x,t.y=-this.y,t.z=-this.z,t.w=this.w,t}normalize(){let t=Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w);return 0===t?(this.x=0,this.y=0,this.z=0,this.w=0):(t=1/t,this.x*=t,this.y*=t,this.z*=t,this.w*=t),this}normalizeFast(){const t=(3-(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w))/2;return 0===t?(this.x=0,this.y=0,this.z=0,this.w=0):(this.x*=t,this.y*=t,this.z*=t,this.w*=t),this}vmult(t,e){void 0===e&&(e=new o);const i=t.x,n=t.y,r=t.z,s=this.x,a=this.y,h=this.z,l=this.w,u=l*i+a*r-h*n,c=l*n+h*i-s*r,d=l*r+s*n-a*i,p=-s*i-a*n-h*r;return e.x=u*l+p*-s+c*-h-d*-a,e.y=c*l+p*-a+d*-s-u*-h,e.z=d*l+p*-h+u*-a-c*-s,e}copy(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this}toEuler(t,e){let i,n,r;void 0===e&&(e="YZX");const s=this.x,o=this.y,a=this.z,h=this.w;switch(e){case"YZX":const t=s*o+a*h;if(t>.499&&(i=2*Math.atan2(s,h),n=Math.PI/2,r=0),t<-.499&&(i=-2*Math.atan2(s,h),n=-Math.PI/2,r=0),void 0===i){const e=s*s,l=o*o,u=a*a;i=Math.atan2(2*o*h-2*s*a,1-2*l-2*u),n=Math.asin(2*t),r=Math.atan2(2*s*h-2*o*a,1-2*e-2*u)}break;default:throw new Error(`Euler order ${e} not supported yet.`)}t.y=i,t.z=n,t.x=r}setFromEuler(t,e,i,n){void 0===n&&(n="XYZ");const r=Math.cos(t/2),s=Math.cos(e/2),o=Math.cos(i/2),a=Math.sin(t/2),h=Math.sin(e/2),l=Math.sin(i/2);return"XYZ"===n?(this.x=a*s*o+r*h*l,this.y=r*h*o-a*s*l,this.z=r*s*l+a*h*o,this.w=r*s*o-a*h*l):"YXZ"===n?(this.x=a*s*o+r*h*l,this.y=r*h*o-a*s*l,this.z=r*s*l-a*h*o,this.w=r*s*o+a*h*l):"ZXY"===n?(this.x=a*s*o-r*h*l,this.y=r*h*o+a*s*l,this.z=r*s*l+a*h*o,this.w=r*s*o-a*h*l):"ZYX"===n?(this.x=a*s*o-r*h*l,this.y=r*h*o+a*s*l,this.z=r*s*l-a*h*o,this.w=r*s*o+a*h*l):"YZX"===n?(this.x=a*s*o+r*h*l,this.y=r*h*o+a*s*l,this.z=r*s*l-a*h*o,this.w=r*s*o-a*h*l):"XZY"===n&&(this.x=a*s*o-r*h*l,this.y=r*h*o-a*s*l,this.z=r*s*l+a*h*o,this.w=r*s*o+a*h*l),this}clone(){return new m(this.x,this.y,this.z,this.w)}slerp(t,e,i){void 0===i&&(i=new m);const n=this.x,r=this.y,s=this.z,o=this.w;let a,h,l,u,c,d=t.x,p=t.y,f=t.z,g=t.w;return h=n*d+r*p+s*f+o*g,h<0&&(h=-h,d=-d,p=-p,f=-f,g=-g),1-h>1e-6?(a=Math.acos(h),l=Math.sin(a),u=Math.sin((1-e)*a)/l,c=Math.sin(e*a)/l):(u=1-e,c=e),i.x=u*n+c*d,i.y=u*r+c*p,i.z=u*s+c*f,i.w=u*o+c*g,i}integrate(t,e,i,n){void 0===n&&(n=new m);const r=t.x*i.x,s=t.y*i.y,o=t.z*i.z,a=this.x,h=this.y,l=this.z,u=this.w,c=.5*e;return n.x+=c*(r*u+s*l-o*h),n.y+=c*(s*u+o*a-r*l),n.z+=c*(o*u+r*h-s*a),n.w+=c*(-r*a-s*h-o*l),n}}const g=new o,v=new o,y={SPHERE:1,PLANE:2,BOX:4,COMPOUND:8,CONVEXPOLYHEDRON:16,HEIGHTFIELD:32,PARTICLE:64,CYLINDER:128,TRIMESH:256};class x{constructor(t){void 0===t&&(t={}),this.id=x.idCounter++,this.type=t.type||0,this.boundingSphereRadius=0,this.collisionResponse=!t.collisionResponse||t.collisionResponse,this.collisionFilterGroup=void 0!==t.collisionFilterGroup?t.collisionFilterGroup:1,this.collisionFilterMask=void 0!==t.collisionFilterMask?t.collisionFilterMask:-1,this.material=t.material?t.material:null,this.body=null}updateBoundingSphereRadius(){throw"computeBoundingSphereRadius() not implemented for shape type "+this.type}volume(){throw"volume() not implemented for shape type "+this.type}calculateLocalInertia(t,e){throw"calculateLocalInertia() not implemented for shape type "+this.type}calculateWorldAABB(t,e,i,n){throw"calculateWorldAABB() not implemented for shape type "+this.type}}x.idCounter=0,x.types=y;class w{constructor(t){void 0===t&&(t={}),this.position=new o,this.quaternion=new m,t.position&&this.position.copy(t.position),t.quaternion&&this.quaternion.copy(t.quaternion)}pointToLocal(t,e){return w.pointToLocalFrame(this.position,this.quaternion,t,e)}pointToWorld(t,e){return w.pointToWorldFrame(this.position,this.quaternion,t,e)}vectorToWorldFrame(t,e){return void 0===e&&(e=new o),this.quaternion.vmult(t,e),e}static pointToLocalFrame(t,e,i,n){return void 0===n&&(n=new o),i.vsub(t,n),e.conjugate(b),b.vmult(n,n),n}static pointToWorldFrame(t,e,i,n){return void 0===n&&(n=new o),e.vmult(i,n),n.vadd(t,n),n}static vectorToWorldFrame(t,e,i){return void 0===i&&(i=new o),t.vmult(e,i),i}static vectorToLocalFrame(t,e,i,n){return void 0===n&&(n=new o),e.w*=-1,e.vmult(i,n),e.w*=-1,n}}const b=new m;class A extends x{constructor(t){void 0===t&&(t={});const{vertices:e=[],faces:i=[],normals:n=[],axes:r,boundingSphereRadius:s}=t;super({type:x.types.CONVEXPOLYHEDRON}),this.vertices=e,this.faces=i,this.faceNormals=n,0===this.faceNormals.length&&this.computeNormals(),s?this.boundingSphereRadius=s:this.updateBoundingSphereRadius(),this.worldVertices=[],this.worldVerticesNeedsUpdate=!0,this.worldFaceNormals=[],this.worldFaceNormalsNeedsUpdate=!0,this.uniqueAxes=r?r.slice():null,this.uniqueEdges=[],this.computeEdges()}computeEdges(){const t=this.faces,e=this.vertices,i=this.uniqueEdges;i.length=0;const n=new o;for(let r=0;r!==t.length;r++){const s=t[r],o=s.length;for(let t=0;t!==o;t++){const r=(t+1)%o;e[s[t]].vsub(e[s[r]],n),n.normalize();let a=!1;for(let t=0;t!==i.length;t++)if(i[t].almostEquals(n)||i[t].almostEquals(n)){a=!0;break}a||i.push(n.clone())}}}computeNormals(){this.faceNormals.length=this.faces.length;for(let t=0;t<this.faces.length;t++){for(let e=0;e<this.faces[t].length;e++)if(!this.vertices[this.faces[t][e]])throw new Error(`Vertex ${this.faces[t][e]} not found!`);const e=this.faceNormals[t]||new o;this.getFaceNormal(t,e),e.negate(e),this.faceNormals[t]=e;const i=this.vertices[this.faces[t][0]];if(e.dot(i)<0)for(let e=0;e<this.faces[t].length;e++);}}getFaceNormal(t,e){const i=this.faces[t],n=this.vertices[i[0]],r=this.vertices[i[1]],s=this.vertices[i[2]];A.computeNormal(n,r,s,e)}static computeNormal(t,e,i,n){const r=new o,s=new o;e.vsub(t,s),i.vsub(e,r),r.cross(s,n),n.isZero()||n.normalize()}clipAgainstHull(t,e,i,n,r,s,a,h,l){const u=new o;let c=-1,d=-Number.MAX_VALUE;for(let t=0;t<i.faces.length;t++){u.copy(i.faceNormals[t]),r.vmult(u,u);const e=u.dot(s);e>d&&(d=e,c=t)}const p=[];for(let t=0;t<i.faces[c].length;t++){const e=i.vertices[i.faces[c][t]],s=new o;s.copy(e),r.vmult(s,s),n.vadd(s,s),p.push(s)}c>=0&&this.clipFaceAgainstHull(s,t,e,p,a,h,l)}findSeparatingAxis(t,e,i,n,r,s,a,h){const l=new o,u=new o,c=new o,d=new o,p=new o,f=new o;let m=Number.MAX_VALUE;const g=this;if(g.uniqueAxes)for(let o=0;o!==g.uniqueAxes.length;o++){i.vmult(g.uniqueAxes[o],l);const a=g.testSepAxis(l,t,e,i,n,r);if(!1===a)return!1;a<m&&(m=a,s.copy(l))}else{const o=a?a.length:g.faces.length;for(let h=0;h<o;h++){const o=a?a[h]:h;l.copy(g.faceNormals[o]),i.vmult(l,l);const u=g.testSepAxis(l,t,e,i,n,r);if(!1===u)return!1;u<m&&(m=u,s.copy(l))}}if(t.uniqueAxes)for(let o=0;o!==t.uniqueAxes.length;o++){r.vmult(t.uniqueAxes[o],u);const a=g.testSepAxis(u,t,e,i,n,r);if(!1===a)return!1;a<m&&(m=a,s.copy(u))}else{const o=h?h.length:t.faces.length;for(let a=0;a<o;a++){const o=h?h[a]:a;u.copy(t.faceNormals[o]),r.vmult(u,u);const l=g.testSepAxis(u,t,e,i,n,r);if(!1===l)return!1;l<m&&(m=l,s.copy(u))}}for(let o=0;o!==g.uniqueEdges.length;o++){i.vmult(g.uniqueEdges[o],d);for(let o=0;o!==t.uniqueEdges.length;o++)if(r.vmult(t.uniqueEdges[o],p),d.cross(p,f),!f.almostZero()){f.normalize();const o=g.testSepAxis(f,t,e,i,n,r);if(!1===o)return!1;o<m&&(m=o,s.copy(f))}}return n.vsub(e,c),c.dot(s)>0&&s.negate(s),!0}testSepAxis(t,e,i,n,r,s){A.project(this,t,i,n,T),A.project(e,t,r,s,S);const o=T[0],a=T[1],h=S[0],l=S[1];if(o<l||h<a)return!1;const u=o-l,c=h-a;return u<c?u:c}calculateLocalInertia(t,e){const i=new o,n=new o;this.computeLocalAABB(n,i);const r=i.x-n.x,s=i.y-n.y,a=i.z-n.z;e.x=1/12*t*(2*s*2*s+2*a*2*a),e.y=1/12*t*(2*r*2*r+2*a*2*a),e.z=1/12*t*(2*s*2*s+2*r*2*r)}getPlaneConstantOfFace(t){const e=this.faces[t],i=this.faceNormals[t],n=this.vertices[e[0]];return-i.dot(n)}clipFaceAgainstHull(t,e,i,n,r,s,a){const h=new o,l=new o,u=new o,c=new o,d=new o,p=new o,f=new o,m=new o,g=this,v=n,y=[];let x=-1,w=Number.MAX_VALUE;for(let e=0;e<g.faces.length;e++){h.copy(g.faceNormals[e]),i.vmult(h,h);const n=h.dot(t);n<w&&(w=n,x=e)}if(x<0)return;const b=g.faces[x];b.connectedFaces=[];for(let t=0;t<g.faces.length;t++)for(let e=0;e<g.faces[t].length;e++)-1!==b.indexOf(g.faces[t][e])&&t!==x&&-1===b.connectedFaces.indexOf(t)&&b.connectedFaces.push(t);const A=b.length;for(let t=0;t<A;t++){const n=g.vertices[b[t]],r=g.vertices[b[(t+1)%A]];n.vsub(r,l),u.copy(l),i.vmult(u,u),e.vadd(u,u),c.copy(this.faceNormals[x]),i.vmult(c,c),e.vadd(c,c),u.cross(c,d),d.negate(d),p.copy(n),i.vmult(p,p),e.vadd(p,p);const s=b.connectedFaces[t];f.copy(this.faceNormals[s]);const o=this.getPlaneConstantOfFace(s);m.copy(f),i.vmult(m,m);const a=o-m.dot(e);for(this.clipFaceAgainstPlane(v,y,m,a);v.length;)v.shift();for(;y.length;)v.push(y.shift())}f.copy(this.faceNormals[x]);const T=this.getPlaneConstantOfFace(x);m.copy(f),i.vmult(m,m);const S=T-m.dot(e);for(let t=0;t<v.length;t++){let e=m.dot(v[t])+S;if(e<=r&&(e=r),e<=s){const i=v[t];if(e<=1e-6){const t={point:i,normal:m,depth:e};a.push(t)}}}}clipFaceAgainstPlane(t,e,i,n){let r,s;const a=t.length;if(a<2)return e;let h=t[t.length-1],l=t[0];r=i.dot(h)+n;for(let u=0;u<a;u++){if(l=t[u],s=i.dot(l)+n,r<0)if(s<0){const t=new o;t.copy(l),e.push(t)}else{const t=new o;h.lerp(l,r/(r-s),t),e.push(t)}else if(s<0){const t=new o;h.lerp(l,r/(r-s),t),e.push(t),e.push(l)}h=l,r=s}return e}computeWorldVertices(t,e){for(;this.worldVertices.length<this.vertices.length;)this.worldVertices.push(new o);const i=this.vertices,n=this.worldVertices;for(let r=0;r!==this.vertices.length;r++)e.vmult(i[r],n[r]),t.vadd(n[r],n[r]);this.worldVerticesNeedsUpdate=!1}computeLocalAABB(t,e){const i=this.vertices;t.set(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),e.set(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let n=0;n<this.vertices.length;n++){const r=i[n];r.x<t.x?t.x=r.x:r.x>e.x&&(e.x=r.x),r.y<t.y?t.y=r.y:r.y>e.y&&(e.y=r.y),r.z<t.z?t.z=r.z:r.z>e.z&&(e.z=r.z)}}computeWorldFaceNormals(t){const e=this.faceNormals.length;for(;this.worldFaceNormals.length<e;)this.worldFaceNormals.push(new o);const i=this.faceNormals,n=this.worldFaceNormals;for(let r=0;r!==e;r++)t.vmult(i[r],n[r]);this.worldFaceNormalsNeedsUpdate=!1}updateBoundingSphereRadius(){let t=0;const e=this.vertices;for(let i=0;i!==e.length;i++){const n=e[i].lengthSquared();n>t&&(t=n)}this.boundingSphereRadius=Math.sqrt(t)}calculateWorldAABB(t,e,i,n){const r=this.vertices;let s,a,h,l,u,c,d=new o;for(let i=0;i<r.length;i++){d.copy(r[i]),e.vmult(d,d),t.vadd(d,d);const n=d;(void 0===s||n.x<s)&&(s=n.x),(void 0===l||n.x>l)&&(l=n.x),(void 0===a||n.y<a)&&(a=n.y),(void 0===u||n.y>u)&&(u=n.y),(void 0===h||n.z<h)&&(h=n.z),(void 0===c||n.z>c)&&(c=n.z)}i.set(s,a,h),n.set(l,u,c)}volume(){return 4*Math.PI*this.boundingSphereRadius/3}getAveragePointLocal(t){void 0===t&&(t=new o);const e=this.vertices;for(let i=0;i<e.length;i++)t.vadd(e[i],t);return t.scale(1/e.length,t),t}transformAllPoints(t,e){const i=this.vertices.length,n=this.vertices;if(e){for(let t=0;t<i;t++){const i=n[t];e.vmult(i,i)}for(let t=0;t<this.faceNormals.length;t++){const i=this.faceNormals[t];e.vmult(i,i)}}if(t)for(let e=0;e<i;e++){const i=n[e];i.vadd(t,i)}}pointIsInside(t){const e=this.vertices,i=this.faces,n=this.faceNormals,r=new o;this.getAveragePointLocal(r);for(let s=0;s<this.faces.length;s++){let a=n[s];const h=e[i[s][0]],l=new o;t.vsub(h,l);const u=a.dot(l),c=new o;r.vsub(h,c);const d=a.dot(c);if(u<0&&d>0||u>0&&d<0)return!1}return-1}static project(t,e,i,n,r){const s=t.vertices.length,o=E;let a=0,h=0;const l=M,u=t.vertices;l.setZero(),w.vectorToLocalFrame(i,n,e,o),w.pointToLocalFrame(i,n,l,l);const c=l.dot(o);h=a=u[0].dot(o);for(let t=1;t<s;t++){const e=u[t].dot(o);e>a&&(a=e),e<h&&(h=e)}if(h-=c,a-=c,h>a){const t=h;h=a,a=t}r[0]=a,r[1]=h}}const T=[],S=[],E=(new o,new o),M=new o;class _ extends x{constructor(t){super({type:x.types.BOX}),this.halfExtents=t,this.convexPolyhedronRepresentation=null,this.updateConvexPolyhedronRepresentation(),this.updateBoundingSphereRadius()}updateConvexPolyhedronRepresentation(){const t=this.halfExtents.x,e=this.halfExtents.y,i=this.halfExtents.z,n=o,r=[new n(-t,-e,-i),new n(t,-e,-i),new n(t,e,-i),new n(-t,e,-i),new n(-t,-e,i),new n(t,-e,i),new n(t,e,i),new n(-t,e,i)],s=[new n(0,0,1),new n(0,1,0),new n(1,0,0)],a=new A({vertices:r,faces:[[3,2,1,0],[4,5,6,7],[5,4,0,1],[2,3,7,6],[0,4,7,3],[1,2,6,5]],axes:s});this.convexPolyhedronRepresentation=a,a.material=this.material}calculateLocalInertia(t,e){return void 0===e&&(e=new o),_.calculateInertia(this.halfExtents,t,e),e}static calculateInertia(t,e,i){const n=t;i.x=1/12*e*(2*n.y*2*n.y+2*n.z*2*n.z),i.y=1/12*e*(2*n.x*2*n.x+2*n.z*2*n.z),i.z=1/12*e*(2*n.y*2*n.y+2*n.x*2*n.x)}getSideNormals(t,e){const i=t,n=this.halfExtents;if(i[0].set(n.x,0,0),i[1].set(0,n.y,0),i[2].set(0,0,n.z),i[3].set(-n.x,0,0),i[4].set(0,-n.y,0),i[5].set(0,0,-n.z),void 0!==e)for(let t=0;t!==i.length;t++)e.vmult(i[t],i[t]);return i}volume(){return 8*this.halfExtents.x*this.halfExtents.y*this.halfExtents.z}updateBoundingSphereRadius(){this.boundingSphereRadius=this.halfExtents.length()}forEachWorldCorner(t,e,i){const n=this.halfExtents,r=[[n.x,n.y,n.z],[-n.x,n.y,n.z],[-n.x,-n.y,n.z],[-n.x,-n.y,-n.z],[n.x,-n.y,-n.z],[n.x,n.y,-n.z],[-n.x,n.y,-n.z],[n.x,-n.y,n.z]];for(let n=0;n<r.length;n++)C.set(r[n][0],r[n][1],r[n][2]),e.vmult(C,C),t.vadd(C,C),i(C.x,C.y,C.z)}calculateWorldAABB(t,e,i,n){const r=this.halfExtents;P[0].set(r.x,r.y,r.z),P[1].set(-r.x,r.y,r.z),P[2].set(-r.x,-r.y,r.z),P[3].set(-r.x,-r.y,-r.z),P[4].set(r.x,-r.y,-r.z),P[5].set(r.x,r.y,-r.z),P[6].set(-r.x,r.y,-r.z),P[7].set(r.x,-r.y,r.z);const s=P[0];e.vmult(s,s),t.vadd(s,s),n.copy(s),i.copy(s);for(let r=1;r<8;r++){const s=P[r];e.vmult(s,s),t.vadd(s,s);const o=s.x,a=s.y,h=s.z;o>n.x&&(n.x=o),a>n.y&&(n.y=a),h>n.z&&(n.z=h),o<i.x&&(i.x=o),a<i.y&&(i.y=a),h<i.z&&(i.z=h)}}}const C=new o,P=[new o,new o,new o,new o,new o,new o,new o,new o],R={DYNAMIC:1,STATIC:2,KINEMATIC:4},L={AWAKE:0,SLEEPY:1,SLEEPING:2};class O extends f{constructor(t){void 0===t&&(t={}),super(),this.id=O.idCounter++,this.index=-1,this.world=null,this.vlambda=new o,this.collisionFilterGroup="number"==typeof t.collisionFilterGroup?t.collisionFilterGroup:1,this.collisionFilterMask="number"==typeof t.collisionFilterMask?t.collisionFilterMask:-1,this.collisionResponse="boolean"!=typeof t.collisionResponse||t.collisionResponse,this.position=new o,this.previousPosition=new o,this.interpolatedPosition=new o,this.initPosition=new o,t.position&&(this.position.copy(t.position),this.previousPosition.copy(t.position),this.interpolatedPosition.copy(t.position),this.initPosition.copy(t.position)),this.velocity=new o,t.velocity&&this.velocity.copy(t.velocity),this.initVelocity=new o,this.force=new o;const e="number"==typeof t.mass?t.mass:0;this.mass=e,this.invMass=e>0?1/e:0,this.material=t.material||null,this.linearDamping="number"==typeof t.linearDamping?t.linearDamping:.01,this.type=e<=0?O.STATIC:O.DYNAMIC,typeof t.type==typeof O.STATIC&&(this.type=t.type),this.allowSleep=void 0===t.allowSleep||t.allowSleep,this.sleepState=O.AWAKE,this.sleepSpeedLimit=void 0!==t.sleepSpeedLimit?t.sleepSpeedLimit:.1,this.sleepTimeLimit=void 0!==t.sleepTimeLimit?t.sleepTimeLimit:1,this.timeLastSleepy=0,this.wakeUpAfterNarrowphase=!1,this.torque=new o,this.quaternion=new m,this.initQuaternion=new m,this.previousQuaternion=new m,this.interpolatedQuaternion=new m,t.quaternion&&(this.quaternion.copy(t.quaternion),this.initQuaternion.copy(t.quaternion),this.previousQuaternion.copy(t.quaternion),this.interpolatedQuaternion.copy(t.quaternion)),this.angularVelocity=new o,t.angularVelocity&&this.angularVelocity.copy(t.angularVelocity),this.initAngularVelocity=new o,this.shapes=[],this.shapeOffsets=[],this.shapeOrientations=[],this.inertia=new o,this.invInertia=new o,this.invInertiaWorld=new r,this.invMassSolve=0,this.invInertiaSolve=new o,this.invInertiaWorldSolve=new r,this.fixedRotation=void 0!==t.fixedRotation&&t.fixedRotation,this.angularDamping=void 0!==t.angularDamping?t.angularDamping:.01,this.linearFactor=new o(1,1,1),t.linearFactor&&this.linearFactor.copy(t.linearFactor),this.angularFactor=new o(1,1,1),t.angularFactor&&this.angularFactor.copy(t.angularFactor),this.aabb=new u,this.aabbNeedsUpdate=!0,this.boundingRadius=0,this.wlambda=new o,this.isTrigger=Boolean(t.isTrigger),t.shape&&this.addShape(t.shape),this.updateMassProperties()}wakeUp(){const t=this.sleepState;this.sleepState=O.AWAKE,this.wakeUpAfterNarrowphase=!1,t===O.SLEEPING&&this.dispatchEvent(O.wakeupEvent)}sleep(){this.sleepState=O.SLEEPING,this.velocity.set(0,0,0),this.angularVelocity.set(0,0,0),this.wakeUpAfterNarrowphase=!1}sleepTick(t){if(this.allowSleep){const e=this.sleepState,i=this.velocity.lengthSquared()+this.angularVelocity.lengthSquared(),n=this.sleepSpeedLimit**2;e===O.AWAKE&&i<n?(this.sleepState=O.SLEEPY,this.timeLastSleepy=t,this.dispatchEvent(O.sleepyEvent)):e===O.SLEEPY&&i>n?this.wakeUp():e===O.SLEEPY&&t-this.timeLastSleepy>this.sleepTimeLimit&&(this.sleep(),this.dispatchEvent(O.sleepEvent))}}updateSolveMassProperties(){this.sleepState===O.SLEEPING||this.type===O.KINEMATIC?(this.invMassSolve=0,this.invInertiaSolve.setZero(),this.invInertiaWorldSolve.setZero()):(this.invMassSolve=this.invMass,this.invInertiaSolve.copy(this.invInertia),this.invInertiaWorldSolve.copy(this.invInertiaWorld))}pointToLocalFrame(t,e){return void 0===e&&(e=new o),t.vsub(this.position,e),this.quaternion.conjugate().vmult(e,e),e}vectorToLocalFrame(t,e){return void 0===e&&(e=new o),this.quaternion.conjugate().vmult(t,e),e}pointToWorldFrame(t,e){return void 0===e&&(e=new o),this.quaternion.vmult(t,e),e.vadd(this.position,e),e}vectorToWorldFrame(t,e){return void 0===e&&(e=new o),this.quaternion.vmult(t,e),e}addShape(t,e,i){const n=new o,r=new m;return e&&n.copy(e),i&&r.copy(i),this.shapes.push(t),this.shapeOffsets.push(n),this.shapeOrientations.push(r),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,t.body=this,this}removeShape(t){const e=this.shapes.indexOf(t);return-1===e||(this.shapes.splice(e,1),this.shapeOffsets.splice(e,1),this.shapeOrientations.splice(e,1),this.updateMassProperties(),this.updateBoundingRadius(),this.aabbNeedsUpdate=!0,t.body=null),this}updateBoundingRadius(){const t=this.shapes,e=this.shapeOffsets,i=t.length;let n=0;for(let r=0;r!==i;r++){const i=t[r];i.updateBoundingSphereRadius();const s=e[r].length(),o=i.boundingSphereRadius;s+o>n&&(n=s+o)}this.boundingRadius=n}updateAABB(){const t=this.shapes,e=this.shapeOffsets,i=this.shapeOrientations,n=t.length,r=D,s=B,o=this.quaternion,a=this.aabb,h=I;for(let l=0;l!==n;l++){const n=t[l];o.vmult(e[l],r),r.vadd(this.position,r),o.mult(i[l],s),n.calculateWorldAABB(r,s,h.lowerBound,h.upperBound),0===l?a.copy(h):a.extend(h)}this.aabbNeedsUpdate=!1}updateInertiaWorld(t){const e=this.invInertia;if(e.x!==e.y||e.y!==e.z||t){const t=F,i=k;t.setRotationFromQuaternion(this.quaternion),t.transpose(i),t.scale(e,t),t.mmult(i,this.invInertiaWorld)}else;}applyForce(t,e){if(void 0===e&&(e=new o),this.type!==O.DYNAMIC)return;this.sleepState===O.SLEEPING&&this.wakeUp();const i=N;e.cross(t,i),this.force.vadd(t,this.force),this.torque.vadd(i,this.torque)}applyLocalForce(t,e){if(void 0===e&&(e=new o),this.type!==O.DYNAMIC)return;const i=z,n=U;this.vectorToWorldFrame(t,i),this.vectorToWorldFrame(e,n),this.applyForce(i,n)}applyTorque(t){this.type===O.DYNAMIC&&(this.sleepState===O.SLEEPING&&this.wakeUp(),this.torque.vadd(t,this.torque))}applyImpulse(t,e){if(void 0===e&&(e=new o),this.type!==O.DYNAMIC)return;this.sleepState===O.SLEEPING&&this.wakeUp();const i=e,n=V;n.copy(t),n.scale(this.invMass,n),this.velocity.vadd(n,this.velocity);const r=H;i.cross(t,r),this.invInertiaWorld.vmult(r,r),this.angularVelocity.vadd(r,this.angularVelocity)}applyLocalImpulse(t,e){if(void 0===e&&(e=new o),this.type!==O.DYNAMIC)return;const i=G,n=W;this.vectorToWorldFrame(t,i),this.vectorToWorldFrame(e,n),this.applyImpulse(i,n)}updateMassProperties(){const t=Y;this.invMass=this.mass>0?1/this.mass:0;const e=this.inertia,i=this.fixedRotation;this.updateAABB(),t.set((this.aabb.upperBound.x-this.aabb.lowerBound.x)/2,(this.aabb.upperBound.y-this.aabb.lowerBound.y)/2,(this.aabb.upperBound.z-this.aabb.lowerBound.z)/2),_.calculateInertia(t,this.mass,e),this.invInertia.set(e.x>0&&!i?1/e.x:0,e.y>0&&!i?1/e.y:0,e.z>0&&!i?1/e.z:0),this.updateInertiaWorld(!0)}getVelocityAtWorldPoint(t,e){const i=new o;return t.vsub(this.position,i),this.angularVelocity.cross(i,e),this.velocity.vadd(e,e),e}integrate(t,e,i){if(this.previousPosition.copy(this.position),this.previousQuaternion.copy(this.quaternion),this.type!==O.DYNAMIC&&this.type!==O.KINEMATIC||this.sleepState===O.SLEEPING)return;const n=this.velocity,r=this.angularVelocity,s=this.position,o=this.force,a=this.torque,h=this.quaternion,l=this.invMass,u=this.invInertiaWorld,c=this.linearFactor,d=l*t;n.x+=o.x*d*c.x,n.y+=o.y*d*c.y,n.z+=o.z*d*c.z;const p=u.elements,f=this.angularFactor,m=a.x*f.x,g=a.y*f.y,v=a.z*f.z;r.x+=t*(p[0]*m+p[1]*g+p[2]*v),r.y+=t*(p[3]*m+p[4]*g+p[5]*v),r.z+=t*(p[6]*m+p[7]*g+p[8]*v),s.x+=n.x*t,s.y+=n.y*t,s.z+=n.z*t,h.integrate(this.angularVelocity,t,this.angularFactor,h),e&&(i?h.normalizeFast():h.normalize()),this.aabbNeedsUpdate=!0,this.updateInertiaWorld()}}O.idCounter=0,O.COLLIDE_EVENT_NAME="collide",O.DYNAMIC=R.DYNAMIC,O.STATIC=R.STATIC,O.KINEMATIC=R.KINEMATIC,O.AWAKE=L.AWAKE,O.SLEEPY=L.SLEEPY,O.SLEEPING=L.SLEEPING,O.wakeupEvent={type:"wakeup"},O.sleepyEvent={type:"sleepy"},O.sleepEvent={type:"sleep"};const D=new o,B=new m,I=new u,F=new r,k=new r,N=(new r,new o),z=new o,U=new o,V=new o,H=new o,G=new o,W=new o,Y=new o;class X{constructor(){this.world=null,this.useBoundingBoxes=!1,this.dirty=!0}collisionPairs(t,e,i){throw new Error("collisionPairs not implemented for this BroadPhase class!")}needBroadphaseCollision(t,e){return 0!=(t.collisionFilterGroup&e.collisionFilterMask)&&0!=(e.collisionFilterGroup&t.collisionFilterMask)&&(0==(t.type&O.STATIC)&&t.sleepState!==O.SLEEPING||0==(e.type&O.STATIC)&&e.sleepState!==O.SLEEPING)}intersectionTest(t,e,i,n){this.useBoundingBoxes?this.doBoundingBoxBroadphase(t,e,i,n):this.doBoundingSphereBroadphase(t,e,i,n)}doBoundingSphereBroadphase(t,e,i,n){const r=j;e.position.vsub(t.position,r);const s=(t.boundingRadius+e.boundingRadius)**2;r.lengthSquared()<s&&(i.push(t),n.push(e))}doBoundingBoxBroadphase(t,e,i,n){t.aabbNeedsUpdate&&t.updateAABB(),e.aabbNeedsUpdate&&e.updateAABB(),t.aabb.overlaps(e.aabb)&&(i.push(t),n.push(e))}makePairsUnique(t,e){const i=q,n=Q,r=K,s=t.length;for(let i=0;i!==s;i++)n[i]=t[i],r[i]=e[i];t.length=0,e.length=0;for(let t=0;t!==s;t++){const e=n[t].id,s=r[t].id,o=e<s?`${e},${s}`:`${s},${e}`;i[o]=t,i.keys.push(o)}for(let s=0;s!==i.keys.length;s++){const s=i.keys.pop(),o=i[s];t.push(n[o]),e.push(r[o]),delete i[s]}}setWorld(t){}static boundingSphereCheck(t,e){const i=new o;t.position.vsub(e.position,i);const n=t.shapes[0],r=e.shapes[0];return Math.pow(n.boundingSphereRadius+r.boundingSphereRadius,2)>i.lengthSquared()}aabbQuery(t,e,i){return[]}}const j=new o;new o,new m,new o;const q={keys:[]},Q=[],K=[];new o;class J extends X{constructor(t,e,i,n,r){void 0===t&&(t=new o(100,100,100)),void 0===e&&(e=new o(-100,-100,-100)),void 0===i&&(i=10),void 0===n&&(n=10),void 0===r&&(r=10),super(),this.nx=i,this.ny=n,this.nz=r,this.aabbMin=t,this.aabbMax=e;const s=this.nx*this.ny*this.nz;if(s<=0)throw"GridBroadphase: Each dimension's n must be >0";this.bins=[],this.binLengths=[],this.bins.length=s,this.binLengths.length=s;for(let t=0;t<s;t++)this.bins[t]=[],this.binLengths[t]=0}collisionPairs(t,e,i){const n=t.bodies.length,r=t.bodies,s=this.aabbMax,o=this.aabbMin,a=this.nx,h=this.ny,l=this.nz,u=h*l,c=l,d=s.x,p=s.y,f=s.z,m=o.x,g=o.y,v=o.z,y=a/(d-m),w=h/(p-g),b=l/(f-v),A=(d-m)/a,T=(p-g)/h,S=(f-v)/l,E=.5*Math.sqrt(A*A+T*T+S*S),M=x.types,_=M.SPHERE,C=M.PLANE;M.BOX,M.COMPOUND,M.CONVEXPOLYHEDRON;const P=this.bins,R=this.binLengths,L=this.bins.length;for(let t=0;t!==L;t++)R[t]=0;const O=Math.ceil;function D(t,e,i,n,r,s,o){let d=(t-m)*y|0,p=(e-g)*w|0,f=(i-v)*b|0,x=O((n-m)*y),A=O((r-g)*w),T=O((s-v)*b);d<0?d=0:d>=a&&(d=a-1),p<0?p=0:p>=h&&(p=h-1),f<0?f=0:f>=l&&(f=l-1),x<0?x=0:x>=a&&(x=a-1),A<0?A=0:A>=h&&(A=h-1),T<0?T=0:T>=l&&(T=l-1),d*=u,p*=c,f*=1,x*=u,A*=c,T*=1;for(let t=d;t<=x;t+=u)for(let e=p;e<=A;e+=c)for(let i=f;i<=T;i+=1){const n=t+e+i;P[n][R[n]++]=o}}for(let t=0;t!==n;t++){const e=r[t],i=e.shapes[0];switch(i.type){case _:{const t=i,n=e.position.x,r=e.position.y,s=e.position.z,o=t.radius;D(n-o,r-o,s-o,n+o,r+o,s+o,e);break}case C:{const t=i;t.worldNormalNeedsUpdate&&t.computeWorldNormal(e.quaternion);const n=t.worldNormal,r=m+.5*A-e.position.x,s=g+.5*T-e.position.y,o=v+.5*S-e.position.z,d=Z;d.set(r,s,o);for(let t=0,i=0;t!==a;t++,i+=u,d.y=s,d.x+=A)for(let t=0,r=0;t!==h;t++,r+=c,d.z=o,d.y+=T)for(let t=0,s=0;t!==l;t++,s+=1,d.z+=S)if(d.dot(n)<E){const t=i+r+s;P[t][R[t]++]=e}break}default:e.aabbNeedsUpdate&&e.updateAABB(),D(e.aabb.lowerBound.x,e.aabb.lowerBound.y,e.aabb.lowerBound.z,e.aabb.upperBound.x,e.aabb.upperBound.y,e.aabb.upperBound.z,e)}}for(let t=0;t!==L;t++){const n=R[t];if(n>1){const r=P[t];for(let t=0;t!==n;t++){const n=r[t];for(let s=0;s!==t;s++){const t=r[s];this.needBroadphaseCollision(n,t)&&this.intersectionTest(n,t,e,i)}}}}this.makePairsUnique(e,i)}}const Z=new o;new o;class $ extends X{constructor(){super()}collisionPairs(t,e,i){const n=t.bodies,r=n.length;let s,o;for(let t=0;t!==r;t++)for(let r=0;r!==t;r++)s=n[t],o=n[r],this.needBroadphaseCollision(s,o)&&this.intersectionTest(s,o,e,i)}aabbQuery(t,e,i){void 0===i&&(i=[]);for(let n=0;n<t.bodies.length;n++){const r=t.bodies[n];r.aabbNeedsUpdate&&r.updateAABB(),r.aabb.overlaps(e)&&i.push(r)}return i}}class tt{constructor(){this.rayFromWorld=new o,this.rayToWorld=new o,this.hitNormalWorld=new o,this.hitPointWorld=new o,this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}reset(){this.rayFromWorld.setZero(),this.rayToWorld.setZero(),this.hitNormalWorld.setZero(),this.hitPointWorld.setZero(),this.hasHit=!1,this.shape=null,this.body=null,this.hitFaceIndex=-1,this.distance=-1,this.shouldStop=!1}abort(){this.shouldStop=!0}set(t,e,i,n,r,s,o){this.rayFromWorld.copy(t),this.rayToWorld.copy(e),this.hitNormalWorld.copy(i),this.hitPointWorld.copy(n),this.shape=r,this.body=s,this.distance=o}}let et,it,nt,rt,st,ot,at;const ht={CLOSEST:1,ANY:2,ALL:4};et=x.types.SPHERE,it=x.types.PLANE,nt=x.types.BOX,rt=x.types.CYLINDER,st=x.types.CONVEXPOLYHEDRON,ot=x.types.HEIGHTFIELD,at=x.types.TRIMESH;class lt{get[et](){return this._intersectSphere}get[it](){return this._intersectPlane}get[nt](){return this._intersectBox}get[rt](){return this._intersectConvex}get[st](){return this._intersectConvex}get[ot](){return this._intersectHeightfield}get[at](){return this._intersectTrimesh}constructor(t,e){void 0===t&&(t=new o),void 0===e&&(e=new o),this.from=t.clone(),this.to=e.clone(),this.direction=new o,this.precision=1e-4,this.checkCollisionResponse=!0,this.skipBackfaces=!1,this.collisionFilterMask=-1,this.collisionFilterGroup=-1,this.mode=lt.ANY,this.result=new tt,this.hasHit=!1,this.callback=t=>{}}intersectWorld(t,e){return this.mode=e.mode||lt.ANY,this.result=e.result||new tt,this.skipBackfaces=!!e.skipBackfaces,this.collisionFilterMask=void 0!==e.collisionFilterMask?e.collisionFilterMask:-1,this.collisionFilterGroup=void 0!==e.collisionFilterGroup?e.collisionFilterGroup:-1,this.checkCollisionResponse=void 0===e.checkCollisionResponse||e.checkCollisionResponse,e.from&&this.from.copy(e.from),e.to&&this.to.copy(e.to),this.callback=e.callback||(()=>{}),this.hasHit=!1,this.result.reset(),this.updateDirection(),this.getAABB(ut),ct.length=0,t.broadphase.aabbQuery(t,ut,ct),this.intersectBodies(ct),this.hasHit}intersectBody(t,e){e&&(this.result=e,this.updateDirection());const i=this.checkCollisionResponse;if(i&&!t.collisionResponse)return;if(0==(this.collisionFilterGroup&t.collisionFilterMask)||0==(t.collisionFilterGroup&this.collisionFilterMask))return;const n=ft,r=mt;for(let e=0,s=t.shapes.length;e<s;e++){const s=t.shapes[e];if((!i||s.collisionResponse)&&(t.quaternion.mult(t.shapeOrientations[e],r),t.quaternion.vmult(t.shapeOffsets[e],n),n.vadd(t.position,n),this.intersectShape(s,r,n,t),this.result.shouldStop))break}}intersectBodies(t,e){e&&(this.result=e,this.updateDirection());for(let e=0,i=t.length;!this.result.shouldStop&&e<i;e++)this.intersectBody(t[e])}updateDirection(){this.to.vsub(this.from,this.direction),this.direction.normalize()}intersectShape(t,e,i,n){if(function(t,e,i){i.vsub(t,Ft);const n=Ft.dot(e);e.scale(n,kt),kt.vadd(t,kt);return i.distanceTo(kt)}(this.from,this.direction,i)>t.boundingSphereRadius)return;const r=this[t.type];r&&r.call(this,t,e,i,n,t)}_intersectBox(t,e,i,n,r){return this._intersectConvex(t.convexPolyhedronRepresentation,e,i,n,r)}_intersectPlane(t,e,i,n,r){const s=this.from,a=this.to,h=this.direction,l=new o(0,0,1);e.vmult(l,l);const u=new o;s.vsub(i,u);const c=u.dot(l);a.vsub(i,u);if(c*u.dot(l)>0)return;if(s.distanceTo(a)<c)return;const d=l.dot(h);if(Math.abs(d)<this.precision)return;const p=new o,f=new o,m=new o;s.vsub(i,p);const g=-l.dot(p)/d;h.scale(g,f),s.vadd(f,m),this.reportIntersection(l,m,r,n,-1)}getAABB(t){const{lowerBound:e,upperBound:i}=t,n=this.to,r=this.from;e.x=Math.min(n.x,r.x),e.y=Math.min(n.y,r.y),e.z=Math.min(n.z,r.z),i.x=Math.max(n.x,r.x),i.y=Math.max(n.y,r.y),i.z=Math.max(n.z,r.z)}_intersectHeightfield(t,e,i,n,r){t.data,t.elementSize;const s=At;s.from.copy(this.from),s.to.copy(this.to),w.pointToLocalFrame(i,e,s.from,s.from),w.pointToLocalFrame(i,e,s.to,s.to),s.updateDirection();const o=Tt;let a,h,l,c;a=h=0,l=c=t.data.length-1;const d=new u;s.getAABB(d),t.getIndexOfPosition(d.lowerBound.x,d.lowerBound.y,o,!0),a=Math.max(a,o[0]),h=Math.max(h,o[1]),t.getIndexOfPosition(d.upperBound.x,d.upperBound.y,o,!0),l=Math.min(l,o[0]+1),c=Math.min(c,o[1]+1);for(let o=a;o<l;o++)for(let a=h;a<c;a++){if(this.result.shouldStop)return;if(t.getAabbAtIndex(o,a,d),d.overlapsRay(s)){if(t.getConvexTrianglePillar(o,a,!1),w.pointToWorldFrame(i,e,t.pillarOffset,bt),this._intersectConvex(t.pillarConvex,e,bt,n,r,wt),this.result.shouldStop)return;t.getConvexTrianglePillar(o,a,!0),w.pointToWorldFrame(i,e,t.pillarOffset,bt),this._intersectConvex(t.pillarConvex,e,bt,n,r,wt)}}}_intersectSphere(t,e,i,n,r){const s=this.from,o=this.to,a=t.radius,h=(o.x-s.x)**2+(o.y-s.y)**2+(o.z-s.z)**2,l=2*((o.x-s.x)*(s.x-i.x)+(o.y-s.y)*(s.y-i.y)+(o.z-s.z)*(s.z-i.z)),u=l**2-4*h*((s.x-i.x)**2+(s.y-i.y)**2+(s.z-i.z)**2-a**2),c=St,d=Et;if(!(u<0))if(0===u)s.lerp(o,u,c),c.vsub(i,d),d.normalize(),this.reportIntersection(d,c,r,n,-1);else{const t=(-l-Math.sqrt(u))/(2*h),e=(-l+Math.sqrt(u))/(2*h);if(t>=0&&t<=1&&(s.lerp(o,t,c),c.vsub(i,d),d.normalize(),this.reportIntersection(d,c,r,n,-1)),this.result.shouldStop)return;e>=0&&e<=1&&(s.lerp(o,e,c),c.vsub(i,d),d.normalize(),this.reportIntersection(d,c,r,n,-1))}}_intersectConvex(t,e,i,n,r,s){const o=Mt,a=_t,h=s&&s.faceList||null,l=t.faces,u=t.vertices,c=t.faceNormals,d=this.direction,p=this.from,f=this.to,m=p.distanceTo(f),g=h?h.length:l.length,v=this.result;for(let t=0;!v.shouldStop&&t<g;t++){const s=h?h[t]:t,f=l[s],g=c[s],y=e,x=i;a.copy(u[f[0]]),y.vmult(a,a),a.vadd(x,a),a.vsub(p,a),y.vmult(g,o);const w=d.dot(o);if(Math.abs(w)<this.precision)continue;const b=o.dot(a)/w;if(!(b<0)){d.scale(b,gt),gt.vadd(p,gt),vt.copy(u[f[0]]),y.vmult(vt,vt),x.vadd(vt,vt);for(let t=1;!v.shouldStop&&t<f.length-1;t++){yt.copy(u[f[t]]),xt.copy(u[f[t+1]]),y.vmult(yt,yt),y.vmult(xt,xt),x.vadd(yt,yt),x.vadd(xt,xt);const e=gt.distanceTo(p);!lt.pointInTriangle(gt,vt,yt,xt)&&!lt.pointInTriangle(gt,yt,vt,xt)||e>m||this.reportIntersection(o,gt,r,n,s)}}}}_intersectTrimesh(t,e,i,n,r,s){const o=Ct,a=Bt,h=It,l=_t,u=Pt,c=Rt,d=Lt,p=Dt,f=Ot,m=t.indices;t.vertices;const g=this.from,v=this.to,y=this.direction;h.position.copy(i),h.quaternion.copy(e),w.vectorToLocalFrame(i,e,y,u),w.pointToLocalFrame(i,e,g,c),w.pointToLocalFrame(i,e,v,d),d.x*=t.scale.x,d.y*=t.scale.y,d.z*=t.scale.z,c.x*=t.scale.x,c.y*=t.scale.y,c.z*=t.scale.z,d.vsub(c,u),u.normalize();const x=c.distanceSquared(d);t.tree.rayQuery(this,h,a);for(let s=0,h=a.length;!this.result.shouldStop&&s!==h;s++){const h=a[s];t.getNormal(h,o),t.getVertex(m[3*h],vt),vt.vsub(c,l);const d=u.dot(o),g=o.dot(l)/d;if(g<0)continue;u.scale(g,gt),gt.vadd(c,gt),t.getVertex(m[3*h+1],yt),t.getVertex(m[3*h+2],xt);const v=gt.distanceSquared(c);!lt.pointInTriangle(gt,yt,vt,xt)&&!lt.pointInTriangle(gt,vt,yt,xt)||v>x||(w.vectorToWorldFrame(e,o,f),w.pointToWorldFrame(i,e,gt,p),this.reportIntersection(f,p,r,n,h))}a.length=0}reportIntersection(t,e,i,n,r){const s=this.from,o=this.to,a=s.distanceTo(e),h=this.result;if(!(this.skipBackfaces&&t.dot(this.direction)>0))switch(h.hitFaceIndex=void 0!==r?r:-1,this.mode){case lt.ALL:this.hasHit=!0,h.set(s,o,t,e,i,n,a),h.hasHit=!0,this.callback(h);break;case lt.CLOSEST:(a<h.distance||!h.hasHit)&&(this.hasHit=!0,h.hasHit=!0,h.set(s,o,t,e,i,n,a));break;case lt.ANY:this.hasHit=!0,h.hasHit=!0,h.set(s,o,t,e,i,n,a),h.shouldStop=!0}}static pointInTriangle(t,e,i,n){n.vsub(e,Ft),i.vsub(e,dt),t.vsub(e,pt);const r=Ft.dot(Ft),s=Ft.dot(dt),o=Ft.dot(pt),a=dt.dot(dt),h=dt.dot(pt);let l,u;return(l=a*o-s*h)>=0&&(u=r*h-s*o)>=0&&l+u<r*a-s*s}}lt.CLOSEST=ht.CLOSEST,lt.ANY=ht.ANY,lt.ALL=ht.ALL;const ut=new u,ct=[],dt=new o,pt=new o,ft=new o,mt=new m,gt=new o,vt=new o,yt=new o,xt=new o;new o,new tt;const wt={faceList:[0]},bt=new o,At=new lt,Tt=[],St=new o,Et=new o,Mt=new o,_t=(new o,new o,new o),Ct=new o,Pt=new o,Rt=new o,Lt=new o,Ot=new o,Dt=new o;new u;const Bt=[],It=new w,Ft=new o,kt=new o;class Nt extends X{static checkBounds(t,e,i){let n,r;0===i?(n=t.position.x,r=e.position.x):1===i?(n=t.position.y,r=e.position.y):2===i&&(n=t.position.z,r=e.position.z);const s=t.boundingRadius;return r-e.boundingRadius<n+s}static insertionSortX(t){for(let e=1,i=t.length;e<i;e++){const i=t[e];let n;for(n=e-1;n>=0&&!(t[n].aabb.lowerBound.x<=i.aabb.lowerBound.x);n--)t[n+1]=t[n];t[n+1]=i}return t}static insertionSortY(t){for(let e=1,i=t.length;e<i;e++){const i=t[e];let n;for(n=e-1;n>=0&&!(t[n].aabb.lowerBound.y<=i.aabb.lowerBound.y);n--)t[n+1]=t[n];t[n+1]=i}return t}static insertionSortZ(t){for(let e=1,i=t.length;e<i;e++){const i=t[e];let n;for(n=e-1;n>=0&&!(t[n].aabb.lowerBound.z<=i.aabb.lowerBound.z);n--)t[n+1]=t[n];t[n+1]=i}return t}constructor(t){super(),this.axisList=[],this.world=null,this.axisIndex=0;const e=this.axisList;this._addBodyHandler=t=>{e.push(t.body)},this._removeBodyHandler=t=>{const i=e.indexOf(t.body);-1!==i&&e.splice(i,1)},t&&this.setWorld(t)}setWorld(t){this.axisList.length=0;for(let e=0;e<t.bodies.length;e++)this.axisList.push(t.bodies[e]);t.removeEventListener("addBody",this._addBodyHandler),t.removeEventListener("removeBody",this._removeBodyHandler),t.addEventListener("addBody",this._addBodyHandler),t.addEventListener("removeBody",this._removeBodyHandler),this.world=t,this.dirty=!0}collisionPairs(t,e,i){const n=this.axisList,r=n.length,s=this.axisIndex;let o,a;for(this.dirty&&(this.sortList(),this.dirty=!1),o=0;o!==r;o++){const t=n[o];for(a=o+1;a<r;a++){const r=n[a];if(this.needBroadphaseCollision(t,r)){if(!Nt.checkBounds(t,r,s))break;this.intersectionTest(t,r,e,i)}}}}sortList(){const t=this.axisList,e=this.axisIndex,i=t.length;for(let e=0;e!==i;e++){const i=t[e];i.aabbNeedsUpdate&&i.updateAABB()}0===e?Nt.insertionSortX(t):1===e?Nt.insertionSortY(t):2===e&&Nt.insertionSortZ(t)}autoDetectAxis(){let t=0,e=0,i=0,n=0,r=0,s=0;const o=this.axisList,a=o.length,h=1/a;for(let h=0;h!==a;h++){const a=o[h],l=a.position.x;t+=l,e+=l*l;const u=a.position.y;i+=u,n+=u*u;const c=a.position.z;r+=c,s+=c*c}const l=e-t*t*h,u=n-i*i*h,c=s-r*r*h;this.axisIndex=l>u?l>c?0:2:u>c?1:2}aabbQuery(t,e,i){void 0===i&&(i=[]),this.dirty&&(this.sortList(),this.dirty=!1);const n=this.axisIndex;let r="x";1===n&&(r="y"),2===n&&(r="z");const s=this.axisList;e.lowerBound[r],e.upperBound[r];for(let t=0;t<s.length;t++){const n=s[t];n.aabbNeedsUpdate&&n.updateAABB(),n.aabb.overlaps(e)&&i.push(n)}return i}}class zt{static defaults(t,e){void 0===t&&(t={});for(let i in e)i in t||(t[i]=e[i]);return t}}class Ut{constructor(t,e,i){void 0===i&&(i={}),i=zt.defaults(i,{collideConnected:!0,wakeUpBodies:!0}),this.equations=[],this.bodyA=t,this.bodyB=e,this.id=Ut.idCounter++,this.collideConnected=i.collideConnected,i.wakeUpBodies&&(t&&t.wakeUp(),e&&e.wakeUp())}update(){throw new Error("method update() not implmemented in this Constraint subclass!")}enable(){const t=this.equations;for(let e=0;e<t.length;e++)t[e].enabled=!0}disable(){const t=this.equations;for(let e=0;e<t.length;e++)t[e].enabled=!1}}Ut.idCounter=0;class Vt{constructor(){this.spatial=new o,this.rotational=new o}multiplyElement(t){return t.spatial.dot(this.spatial)+t.rotational.dot(this.rotational)}multiplyVectors(t,e){return t.dot(this.spatial)+e.dot(this.rotational)}}class Ht{constructor(t,e,i,n){void 0===i&&(i=-1e6),void 0===n&&(n=1e6),this.id=Ht.idCounter++,this.minForce=i,this.maxForce=n,this.bi=t,this.bj=e,this.a=0,this.b=0,this.eps=0,this.jacobianElementA=new Vt,this.jacobianElementB=new Vt,this.enabled=!0,this.multiplier=0,this.setSpookParams(1e7,4,1/60)}setSpookParams(t,e,i){const n=e,r=t,s=i;this.a=4/(s*(1+4*n)),this.b=4*n/(1+4*n),this.eps=4/(s*s*r*(1+4*n))}computeB(t,e,i){const n=this.computeGW();return-this.computeGq()*t-n*e-this.computeGiMf()*i}computeGq(){const t=this.jacobianElementA,e=this.jacobianElementB,i=this.bi,n=this.bj,r=i.position,s=n.position;return t.spatial.dot(r)+e.spatial.dot(s)}computeGW(){const t=this.jacobianElementA,e=this.jacobianElementB,i=this.bi,n=this.bj,r=i.velocity,s=n.velocity,o=i.angularVelocity,a=n.angularVelocity;return t.multiplyVectors(r,o)+e.multiplyVectors(s,a)}computeGWlambda(){const t=this.jacobianElementA,e=this.jacobianElementB,i=this.bi,n=this.bj,r=i.vlambda,s=n.vlambda,o=i.wlambda,a=n.wlambda;return t.multiplyVectors(r,o)+e.multiplyVectors(s,a)}computeGiMf(){const t=this.jacobianElementA,e=this.jacobianElementB,i=this.bi,n=this.bj,r=i.force,s=i.torque,o=n.force,a=n.torque,h=i.invMassSolve,l=n.invMassSolve;return r.scale(h,Gt),o.scale(l,Wt),i.invInertiaWorldSolve.vmult(s,Yt),n.invInertiaWorldSolve.vmult(a,Xt),t.multiplyVectors(Gt,Yt)+e.multiplyVectors(Wt,Xt)}computeGiMGt(){const t=this.jacobianElementA,e=this.jacobianElementB,i=this.bi,n=this.bj,r=i.invMassSolve,s=n.invMassSolve,o=i.invInertiaWorldSolve,a=n.invInertiaWorldSolve;let h=r+s;return o.vmult(t.rotational,jt),h+=jt.dot(t.rotational),a.vmult(e.rotational,jt),h+=jt.dot(e.rotational),h}addToWlambda(t){const e=this.jacobianElementA,i=this.jacobianElementB,n=this.bi,r=this.bj,s=qt;n.vlambda.addScaledVector(n.invMassSolve*t,e.spatial,n.vlambda),r.vlambda.addScaledVector(r.invMassSolve*t,i.spatial,r.vlambda),n.invInertiaWorldSolve.vmult(e.rotational,s),n.wlambda.addScaledVector(t,s,n.wlambda),r.invInertiaWorldSolve.vmult(i.rotational,s),r.wlambda.addScaledVector(t,s,r.wlambda)}computeC(){return this.computeGiMGt()+this.eps}}Ht.idCounter=0;const Gt=new o,Wt=new o,Yt=new o,Xt=new o,jt=new o,qt=new o;class Qt extends Ht{constructor(t,e,i){void 0===i&&(i=1e6),super(t,e,0,i),this.restitution=0,this.ri=new o,this.rj=new o,this.ni=new o}computeB(t){const e=this.a,i=this.b,n=this.bi,r=this.bj,s=this.ri,o=this.rj,a=Kt,h=Jt,l=n.velocity,u=n.angularVelocity;n.force,n.torque;const c=r.velocity,d=r.angularVelocity;r.force,r.torque;const p=Zt,f=this.jacobianElementA,m=this.jacobianElementB,g=this.ni;s.cross(g,a),o.cross(g,h),g.negate(f.spatial),a.negate(f.rotational),m.spatial.copy(g),m.rotational.copy(h),p.copy(r.position),p.vadd(o,p),p.vsub(n.position,p),p.vsub(s,p);const v=g.dot(p),y=this.restitution+1;return-v*e-(y*c.dot(g)-y*l.dot(g)+d.dot(h)-u.dot(a))*i-t*this.computeGiMf()}getImpactVelocityAlongNormal(){const t=$t,e=te,i=ee,n=ie,r=ne;return this.bi.position.vadd(this.ri,i),this.bj.position.vadd(this.rj,n),this.bi.getVelocityAtWorldPoint(i,t),this.bj.getVelocityAtWorldPoint(n,e),t.vsub(e,r),this.ni.dot(r)}}const Kt=new o,Jt=new o,Zt=new o,$t=new o,te=new o,ee=new o,ie=new o,ne=new o;class re extends Ut{constructor(t,e,i,n,r){void 0===e&&(e=new o),void 0===n&&(n=new o),void 0===r&&(r=1e6),super(t,i),this.pivotA=e.clone(),this.pivotB=n.clone();const s=this.equationX=new Qt(t,i),a=this.equationY=new Qt(t,i),h=this.equationZ=new Qt(t,i);this.equations.push(s,a,h),s.minForce=a.minForce=h.minForce=-r,s.maxForce=a.maxForce=h.maxForce=r,s.ni.set(1,0,0),a.ni.set(0,1,0),h.ni.set(0,0,1)}update(){const t=this.bodyA,e=this.bodyB,i=this.equationX,n=this.equationY,r=this.equationZ;t.quaternion.vmult(this.pivotA,i.ri),e.quaternion.vmult(this.pivotB,i.rj),n.ri.copy(i.ri),n.rj.copy(i.rj),r.ri.copy(i.ri),r.rj.copy(i.rj)}}class se extends Ht{constructor(t,e,i){void 0===i&&(i={});const n=void 0!==i.maxForce?i.maxForce:1e6;super(t,e,-n,n),this.axisA=i.axisA?i.axisA.clone():new o(1,0,0),this.axisB=i.axisB?i.axisB.clone():new o(0,1,0),this.angle=void 0!==i.angle?i.angle:0}computeB(t){const e=this.a,i=this.b,n=this.axisA,r=this.axisB,s=oe,o=ae,a=this.jacobianElementA,h=this.jacobianElementB;n.cross(r,s),r.cross(n,o),a.rotational.copy(o),h.rotational.copy(s);return-(Math.cos(this.angle)-n.dot(r))*e-this.computeGW()*i-t*this.computeGiMf()}}const oe=new o,ae=new o;class he extends Ht{constructor(t,e,i){void 0===i&&(i={});const n=void 0!==i.maxForce?i.maxForce:1e6;super(t,e,-n,n),this.axisA=i.axisA?i.axisA.clone():new o(1,0,0),this.axisB=i.axisB?i.axisB.clone():new o(0,1,0),this.maxAngle=Math.PI/2}computeB(t){const e=this.a,i=this.b,n=this.axisA,r=this.axisB,s=le,o=ue,a=this.jacobianElementA,h=this.jacobianElementB;n.cross(r,s),r.cross(n,o),a.rotational.copy(o),h.rotational.copy(s);return-(Math.cos(this.maxAngle)-n.dot(r))*e-this.computeGW()*i-t*this.computeGiMf()}}const le=new o,ue=new o;class ce extends re{constructor(t,e,i){void 0===i&&(i={});const n=void 0!==i.maxForce?i.maxForce:1e6;super(t,i.pivotA?i.pivotA.clone():new o,e,i.pivotB?i.pivotB.clone():new o,n),this.axisA=i.axisA?i.axisA.clone():new o,this.axisB=i.axisB?i.axisB.clone():new o,this.collideConnected=!!i.collideConnected,this.angle=void 0!==i.angle?i.angle:0;const r=this.coneEquation=new se(t,e,i),s=this.twistEquation=new he(t,e,i);this.twistAngle=void 0!==i.twistAngle?i.twistAngle:0,r.maxForce=0,r.minForce=-n,s.maxForce=0,s.minForce=-n,this.equations.push(r,s)}update(){const t=this.bodyA,e=this.bodyB,i=this.coneEquation,n=this.twistEquation;super.update(),t.vectorToWorldFrame(this.axisA,i.axisA),e.vectorToWorldFrame(this.axisB,i.axisB),this.axisA.tangents(n.axisA,n.axisA),t.vectorToWorldFrame(n.axisA,n.axisA),this.axisB.tangents(n.axisB,n.axisB),e.vectorToWorldFrame(n.axisB,n.axisB),i.angle=this.angle,n.maxAngle=this.twistAngle}}new o,new o;class de extends Ut{constructor(t,e,i,n){void 0===n&&(n=1e6),super(t,e),void 0===i&&(i=t.position.distanceTo(e.position)),this.distance=i;const r=this.distanceEquation=new Qt(t,e);this.equations.push(r),r.minForce=-n,r.maxForce=n}update(){const t=this.bodyA,e=this.bodyB,i=this.distanceEquation,n=.5*this.distance,r=i.ni;e.position.vsub(t.position,r),r.normalize(),r.scale(n,i.ri),r.scale(-n,i.rj)}}class pe extends re{constructor(t,e,i){void 0===i&&(i={});const n=void 0!==i.maxForce?i.maxForce:1e6,r=new o,s=new o,a=new o;t.position.vadd(e.position,a),a.scale(.5,a),e.pointToLocalFrame(a,s),t.pointToLocalFrame(a,r),super(t,r,e,s,n),this.xA=t.vectorToLocalFrame(o.UNIT_X),this.xB=e.vectorToLocalFrame(o.UNIT_X),this.yA=t.vectorToLocalFrame(o.UNIT_Y),this.yB=e.vectorToLocalFrame(o.UNIT_Y),this.zA=t.vectorToLocalFrame(o.UNIT_Z),this.zB=e.vectorToLocalFrame(o.UNIT_Z);const h=this.rotationalEquation1=new he(t,e,i),l=this.rotationalEquation2=new he(t,e,i),u=this.rotationalEquation3=new he(t,e,i);this.equations.push(h,l,u)}update(){const t=this.bodyA,e=this.bodyB;this.motorEquation;const i=this.rotationalEquation1,n=this.rotationalEquation2,r=this.rotationalEquation3;super.update(),t.vectorToWorldFrame(this.xA,i.axisA),e.vectorToWorldFrame(this.yB,i.axisB),t.vectorToWorldFrame(this.yA,n.axisA),e.vectorToWorldFrame(this.zB,n.axisB),t.vectorToWorldFrame(this.zA,r.axisA),e.vectorToWorldFrame(this.xB,r.axisB)}}new o,new o;class fe extends Ht{constructor(t,e,i){void 0===i&&(i=1e6),super(t,e,-i,i),this.axisA=new o,this.axisB=new o,this.targetVelocity=0}computeB(t){this.a;const e=this.b;this.bi,this.bj;const i=this.axisA,n=this.axisB,r=this.jacobianElementA,s=this.jacobianElementB;r.rotational.copy(i),n.negate(s.rotational);return-(this.computeGW()-this.targetVelocity)*e-t*this.computeGiMf()}}class me extends re{constructor(t,e,i){void 0===i&&(i={});const n=void 0!==i.maxForce?i.maxForce:1e6;super(t,i.pivotA?i.pivotA.clone():new o,e,i.pivotB?i.pivotB.clone():new o,n);(this.axisA=i.axisA?i.axisA.clone():new o(1,0,0)).normalize();(this.axisB=i.axisB?i.axisB.clone():new o(1,0,0)).normalize(),this.collideConnected=!!i.collideConnected;const r=this.rotationalEquation1=new he(t,e,i),s=this.rotationalEquation2=new he(t,e,i),a=this.motorEquation=new fe(t,e,n);a.enabled=!1,this.equations.push(r,s,a)}enableMotor(){this.motorEquation.enabled=!0}disableMotor(){this.motorEquation.enabled=!1}setMotorSpeed(t){this.motorEquation.targetVelocity=t}setMotorMaxForce(t){this.motorEquation.maxForce=t,this.motorEquation.minForce=-t}update(){const t=this.bodyA,e=this.bodyB,i=this.motorEquation,n=this.rotationalEquation1,r=this.rotationalEquation2,s=ge,o=ve,a=this.axisA,h=this.axisB;super.update(),t.quaternion.vmult(a,s),e.quaternion.vmult(h,o),s.tangents(n.axisA,r.axisA),n.axisB.copy(o),r.axisB.copy(o),this.motorEquation.enabled&&(t.quaternion.vmult(this.axisA,i.axisA),e.quaternion.vmult(this.axisB,i.axisB))}}const ge=new o,ve=new o;class ye extends Ht{constructor(t,e,i){super(t,e,-i,i),this.ri=new o,this.rj=new o,this.t=new o}computeB(t){this.a;const e=this.b;this.bi,this.bj;const i=this.ri,n=this.rj,r=xe,s=we,o=this.t;i.cross(o,r),n.cross(o,s);const a=this.jacobianElementA,h=this.jacobianElementB;o.negate(a.spatial),r.negate(a.rotational),h.spatial.copy(o),h.rotational.copy(s);return-this.computeGW()*e-t*this.computeGiMf()}}const xe=new o,we=new o;class be{constructor(t,e,i){i=zt.defaults(i,{friction:.3,restitution:.3,contactEquationStiffness:1e7,contactEquationRelaxation:3,frictionEquationStiffness:1e7,frictionEquationRelaxation:3}),this.id=be.idCounter++,this.materials=[t,e],this.friction=i.friction,this.restitution=i.restitution,this.contactEquationStiffness=i.contactEquationStiffness,this.contactEquationRelaxation=i.contactEquationRelaxation,this.frictionEquationStiffness=i.frictionEquationStiffness,this.frictionEquationRelaxation=i.frictionEquationRelaxation}}be.idCounter=0;class Ae{constructor(t){void 0===t&&(t={});let e="";"string"==typeof t&&(e=t,t={}),this.name=e,this.id=Ae.idCounter++,this.friction=void 0!==t.friction?t.friction:-1,this.restitution=void 0!==t.restitution?t.restitution:-1}}Ae.idCounter=0;class Te{constructor(t,e,i){void 0===i&&(i={}),this.restLength="number"==typeof i.restLength?i.restLength:1,this.stiffness=i.stiffness||100,this.damping=i.damping||1,this.bodyA=t,this.bodyB=e,this.localAnchorA=new o,this.localAnchorB=new o,i.localAnchorA&&this.localAnchorA.copy(i.localAnchorA),i.localAnchorB&&this.localAnchorB.copy(i.localAnchorB),i.worldAnchorA&&this.setWorldAnchorA(i.worldAnchorA),i.worldAnchorB&&this.setWorldAnchorB(i.worldAnchorB)}setWorldAnchorA(t){this.bodyA.pointToLocalFrame(t,this.localAnchorA)}setWorldAnchorB(t){this.bodyB.pointToLocalFrame(t,this.localAnchorB)}getWorldAnchorA(t){this.bodyA.pointToWorldFrame(this.localAnchorA,t)}getWorldAnchorB(t){this.bodyB.pointToWorldFrame(this.localAnchorB,t)}applyForce(){const t=this.stiffness,e=this.damping,i=this.restLength,n=this.bodyA,r=this.bodyB,s=Se,o=Ee,a=Me,h=_e,l=Be,u=Ce,c=Pe,d=Re,p=Le,f=Oe,m=De;this.getWorldAnchorA(u),this.getWorldAnchorB(c),u.vsub(n.position,d),c.vsub(r.position,p),c.vsub(u,s);const g=s.length();o.copy(s),o.normalize(),r.velocity.vsub(n.velocity,a),r.angularVelocity.cross(p,l),a.vadd(l,a),n.angularVelocity.cross(d,l),a.vsub(l,a),o.scale(-t*(g-i)-e*a.dot(o),h),n.force.vsub(h,n.force),r.force.vadd(h,r.force),d.cross(h,f),p.cross(h,m),n.torque.vsub(f,n.torque),r.torque.vadd(m,r.torque)}}const Se=new o,Ee=new o,Me=new o,_e=new o,Ce=new o,Pe=new o,Re=new o,Le=new o,Oe=new o,De=new o,Be=new o;class Ie{constructor(t){void 0===t&&(t={}),t=zt.defaults(t,{chassisConnectionPointLocal:new o,chassisConnectionPointWorld:new o,directionLocal:new o,directionWorld:new o,axleLocal:new o,axleWorld:new o,suspensionRestLength:1,suspensionMaxLength:2,radius:1,suspensionStiffness:100,dampingCompression:10,dampingRelaxation:10,frictionSlip:10.5,forwardAcceleration:1,sideAcceleration:1,steering:0,rotation:0,deltaRotation:0,rollInfluence:.01,maxSuspensionForce:Number.MAX_VALUE,isFrontWheel:!0,clippedInvContactDotSuspension:1,suspensionRelativeVelocity:0,suspensionForce:0,slipInfo:0,skidInfo:0,suspensionLength:0,maxSuspensionTravel:1,useCustomSlidingRotationalSpeed:!1,customSlidingRotationalSpeed:-.1}),this.maxSuspensionTravel=t.maxSuspensionTravel,this.customSlidingRotationalSpeed=t.customSlidingRotationalSpeed,this.useCustomSlidingRotationalSpeed=t.useCustomSlidingRotationalSpeed,this.sliding=!1,this.chassisConnectionPointLocal=t.chassisConnectionPointLocal.clone(),this.chassisConnectionPointWorld=t.chassisConnectionPointWorld.clone(),this.directionLocal=t.directionLocal.clone(),this.directionWorld=t.directionWorld.clone(),this.axleLocal=t.axleLocal.clone(),this.axleWorld=t.axleWorld.clone(),this.suspensionRestLength=t.suspensionRestLength,this.suspensionMaxLength=t.suspensionMaxLength,this.radius=t.radius,this.suspensionStiffness=t.suspensionStiffness,this.dampingCompression=t.dampingCompression,this.dampingRelaxation=t.dampingRelaxation,this.frictionSlip=t.frictionSlip,this.forwardAcceleration=t.forwardAcceleration,this.sideAcceleration=t.sideAcceleration,this.steering=0,this.rotation=0,this.deltaRotation=0,this.rollInfluence=t.rollInfluence,this.maxSuspensionForce=t.maxSuspensionForce,this.engineForce=0,this.brake=0,this.isFrontWheel=t.isFrontWheel,this.clippedInvContactDotSuspension=1,this.suspensionRelativeVelocity=0,this.suspensionForce=0,this.slipInfo=0,this.skidInfo=0,this.suspensionLength=0,this.sideImpulse=0,this.forwardImpulse=0,this.raycastResult=new tt,this.worldTransform=new w,this.isInContact=!1}updateWheel(t){const e=this.raycastResult;if(this.isInContact){const i=e.hitNormalWorld.dot(e.directionWorld);e.hitPointWorld.vsub(t.position,ke),t.getVelocityAtWorldPoint(ke,Fe);const n=e.hitNormalWorld.dot(Fe);if(i>=-.1)this.suspensionRelativeVelocity=0,this.clippedInvContactDotSuspension=10;else{const t=-1/i;this.suspensionRelativeVelocity=n*t,this.clippedInvContactDotSuspension=t}}else e.suspensionLength=this.suspensionRestLength,this.suspensionRelativeVelocity=0,e.directionWorld.scale(-1,e.hitNormalWorld),this.clippedInvContactDotSuspension=1}}const Fe=new o,ke=new o;class Ne{constructor(t){this.chassisBody=t.chassisBody,this.wheelInfos=[],this.sliding=!1,this.world=null,this.indexRightAxis=void 0!==t.indexRightAxis?t.indexRightAxis:2,this.indexForwardAxis=void 0!==t.indexForwardAxis?t.indexForwardAxis:0,this.indexUpAxis=void 0!==t.indexUpAxis?t.indexUpAxis:1,this.constraints=[],this.preStepCallback=()=>{},this.currentVehicleSpeedKmHour=0,this.numWheelsOnGround=0}addWheel(t){void 0===t&&(t={});const e=new Ie(t),i=this.wheelInfos.length;return this.wheelInfos.push(e),i}setSteeringValue(t,e){this.wheelInfos[e].steering=t}applyEngineForce(t,e){this.wheelInfos[e].engineForce=t}setBrake(t,e){this.wheelInfos[e].brake=t}addToWorld(t){t.addBody(this.chassisBody);const e=this;this.preStepCallback=()=>{e.updateVehicle(t.dt)},t.addEventListener("preStep",this.preStepCallback),this.world=t}getVehicleAxisWorld(t,e){e.set(0===t?1:0,1===t?1:0,2===t?1:0),this.chassisBody.vectorToWorldFrame(e,e)}updateVehicle(t){const e=this.wheelInfos,i=e.length,n=this.chassisBody;for(let t=0;t<i;t++)this.updateWheelTransform(t);this.currentVehicleSpeedKmHour=3.6*n.velocity.length();const r=new o;this.getVehicleAxisWorld(this.indexForwardAxis,r),r.dot(n.velocity)<0&&(this.currentVehicleSpeedKmHour*=-1);for(let t=0;t<i;t++)this.castRay(e[t]);this.updateSuspension(t);const s=new o,a=new o;for(let r=0;r<i;r++){const i=e[r];let o=i.suspensionForce;o>i.maxSuspensionForce&&(o=i.maxSuspensionForce),i.raycastResult.hitNormalWorld.scale(o*t,s),i.raycastResult.hitPointWorld.vsub(n.position,a),n.applyImpulse(s,a)}this.updateFriction(t);const h=new o,l=new o,u=new o;for(let r=0;r<i;r++){const i=e[r];n.getVelocityAtWorldPoint(i.chassisConnectionPointWorld,u);let s=1;switch(this.indexUpAxis){case 1:s=-1}if(i.isInContact){this.getVehicleAxisWorld(this.indexForwardAxis,l);const e=l.dot(i.raycastResult.hitNormalWorld);i.raycastResult.hitNormalWorld.scale(e,h),l.vsub(h,l);const n=l.dot(u);i.deltaRotation=s*n*t/i.radius}!i.sliding&&i.isInContact||0===i.engineForce||!i.useCustomSlidingRotationalSpeed||(i.deltaRotation=(i.engineForce>0?1:-1)*i.customSlidingRotationalSpeed*t),Math.abs(i.brake)>Math.abs(i.engineForce)&&(i.deltaRotation=0),i.rotation+=i.deltaRotation,i.deltaRotation*=.99}}updateSuspension(t){const e=this.chassisBody.mass,i=this.wheelInfos,n=i.length;for(let t=0;t<n;t++){const n=i[t];if(n.isInContact){let t;const i=n.suspensionRestLength-n.suspensionLength;t=n.suspensionStiffness*i*n.clippedInvContactDotSuspension;const r=n.suspensionRelativeVelocity;let s;s=r<0?n.dampingCompression:n.dampingRelaxation,t-=s*r,n.suspensionForce=t*e,n.suspensionForce<0&&(n.suspensionForce=0)}else n.suspensionForce=0}}removeFromWorld(t){this.constraints,t.removeBody(this.chassisBody),t.removeEventListener("preStep",this.preStepCallback),this.world=null}castRay(t){const e=He,i=Ge;this.updateWheelTransformWorld(t);const n=this.chassisBody;let r=-1;const s=t.suspensionRestLength+t.radius;t.directionWorld.scale(s,e);const a=t.chassisConnectionPointWorld;a.vadd(e,i);const h=t.raycastResult;h.reset();const l=n.collisionResponse;n.collisionResponse=!1,this.world.rayTest(a,i,h),n.collisionResponse=l;const u=h.body;if(t.raycastResult.groundObject=0,u){r=h.distance,t.raycastResult.hitNormalWorld=h.hitNormalWorld,t.isInContact=!0;const e=h.distance;t.suspensionLength=e-t.radius;const i=t.suspensionRestLength-t.maxSuspensionTravel,s=t.suspensionRestLength+t.maxSuspensionTravel;t.suspensionLength<i&&(t.suspensionLength=i),t.suspensionLength>s&&(t.suspensionLength=s,t.raycastResult.reset());const a=t.raycastResult.hitNormalWorld.dot(t.directionWorld),l=new o;n.getVelocityAtWorldPoint(t.raycastResult.hitPointWorld,l);const u=t.raycastResult.hitNormalWorld.dot(l);if(a>=-.1)t.suspensionRelativeVelocity=0,t.clippedInvContactDotSuspension=10;else{const e=-1/a;t.suspensionRelativeVelocity=u*e,t.clippedInvContactDotSuspension=e}}else t.suspensionLength=t.suspensionRestLength+0*t.maxSuspensionTravel,t.suspensionRelativeVelocity=0,t.directionWorld.scale(-1,t.raycastResult.hitNormalWorld),t.clippedInvContactDotSuspension=1;return r}updateWheelTransformWorld(t){t.isInContact=!1;const e=this.chassisBody;e.pointToWorldFrame(t.chassisConnectionPointLocal,t.chassisConnectionPointWorld),e.vectorToWorldFrame(t.directionLocal,t.directionWorld),e.vectorToWorldFrame(t.axleLocal,t.axleWorld)}updateWheelTransform(t){const e=ze,i=Ue,n=Ve,r=this.wheelInfos[t];this.updateWheelTransformWorld(r),r.directionLocal.scale(-1,e),i.copy(r.axleLocal),e.cross(i,n),n.normalize(),i.normalize();const s=r.steering,o=new m;o.setFromAxisAngle(e,s);const a=new m;a.setFromAxisAngle(i,r.rotation);const h=r.worldTransform.quaternion;this.chassisBody.quaternion.mult(o,h),h.mult(a,h),h.normalize();const l=r.worldTransform.position;l.copy(r.directionWorld),l.scale(r.suspensionLength,l),l.vadd(r.chassisConnectionPointWorld,l)}getWheelTransformWorld(t){return this.wheelInfos[t].worldTransform}updateFriction(t){const e=Ye,i=this.wheelInfos,n=i.length,r=this.chassisBody,s=je,a=Xe;this.numWheelsOnGround=0;for(let t=0;t<n;t++){const e=i[t];e.raycastResult.body&&this.numWheelsOnGround++,e.sideImpulse=0,e.forwardImpulse=0,s[t]||(s[t]=new o),a[t]||(a[t]=new o)}for(let t=0;t<n;t++){const n=i[t],o=n.raycastResult.body;if(o){const i=a[t];this.getWheelTransformWorld(t).vectorToWorldFrame(We[this.indexRightAxis],i);const h=n.raycastResult.hitNormalWorld,l=i.dot(h);h.scale(l,e),i.vsub(e,i),i.normalize(),h.cross(i,s[t]),s[t].normalize(),n.sideImpulse=ai(r,n.raycastResult.hitPointWorld,o,n.raycastResult.hitPointWorld,i),n.sideImpulse*=qe}}this.sliding=!1;for(let e=0;e<n;e++){const n=i[e],o=n.raycastResult.body;let a=0;if(n.slipInfo=1,o){const i=0,h=n.brake?n.brake:i;a=Ze(r,o,n.raycastResult.hitPointWorld,s[e],h),a+=n.engineForce*t;const l=h/a;n.slipInfo*=l}if(n.forwardImpulse=0,n.skidInfo=1,o){n.skidInfo=1;const e=n.suspensionForce*t*n.frictionSlip,i=e*e;n.forwardImpulse=a;const r=.5*n.forwardImpulse/n.forwardAcceleration,s=1*n.sideImpulse/n.sideAcceleration,o=r*r+s*s;if(n.sliding=!1,o>i){this.sliding=!0,n.sliding=!0;const t=e/Math.sqrt(o);n.skidInfo*=t}}}if(this.sliding)for(let t=0;t<n;t++){const e=i[t];0!==e.sideImpulse&&e.skidInfo<1&&(e.forwardImpulse*=e.skidInfo,e.sideImpulse*=e.skidInfo)}for(let t=0;t<n;t++){const e=i[t],n=new o;if(e.raycastResult.hitPointWorld.vsub(r.position,n),0!==e.forwardImpulse){const i=new o;s[t].scale(e.forwardImpulse,i),r.applyImpulse(i,n)}if(0!==e.sideImpulse){const i=e.raycastResult.body,s=new o;e.raycastResult.hitPointWorld.vsub(i.position,s);const h=new o;a[t].scale(e.sideImpulse,h),r.vectorToLocalFrame(n,n),n["xyz"[this.indexUpAxis]]*=e.rollInfluence,r.vectorToWorldFrame(n,n),r.applyImpulse(h,n),h.scale(-1,h),i.applyImpulse(h,s)}}}}new o,new o,new o;const ze=new o,Ue=new o,Ve=new o;new lt,new o;const He=new o,Ge=new o,We=[new o(1,0,0),new o(0,1,0),new o(0,0,1)],Ye=new o,Xe=[],je=[],qe=1,Qe=new o,Ke=new o,Je=new o;function Ze(t,e,i,n,r){let s=0;const o=i,a=Qe,h=Ke,l=Je;t.getVelocityAtWorldPoint(o,a),e.getVelocityAtWorldPoint(o,h),a.vsub(h,l);return s=-n.dot(l)*(1/(ni(t,i,n)+ni(e,i,n))),r<s&&(s=r),s<-r&&(s=-r),s}const $e=new o,ti=new o,ei=new o,ii=new o;function ni(t,e,i){const n=$e,r=ti,s=ei,o=ii;return e.vsub(t.position,n),n.cross(i,r),t.invInertiaWorld.vmult(r,o),o.cross(n,s),t.invMass+i.dot(s)}const ri=new o,si=new o,oi=new o;function ai(t,e,i,n,r){if(r.lengthSquared()>1.1)return 0;const s=ri,o=si,a=oi;t.getVelocityAtWorldPoint(e,s),i.getVelocityAtWorldPoint(n,o),s.vsub(o,a);return-.2*r.dot(a)*(1/(t.invMass+i.invMass))}class hi extends x{constructor(t){if(super({type:x.types.SPHERE}),this.radius=void 0!==t?t:1,this.radius<0)throw new Error("The sphere radius cannot be negative.");this.updateBoundingSphereRadius()}calculateLocalInertia(t,e){void 0===e&&(e=new o);const i=2*t*this.radius*this.radius/5;return e.x=i,e.y=i,e.z=i,e}volume(){return 4*Math.PI*Math.pow(this.radius,3)/3}updateBoundingSphereRadius(){this.boundingSphereRadius=this.radius}calculateWorldAABB(t,e,i,n){const r=this.radius,s=["x","y","z"];for(let e=0;e<s.length;e++){const o=s[e];i[o]=t[o]-r,n[o]=t[o]+r}}}class li{constructor(t){void 0===t&&(t={}),this.wheelBodies=[],this.coordinateSystem=void 0!==t.coordinateSystem?t.coordinateSystem.clone():new o(1,2,3),t.chassisBody?this.chassisBody=t.chassisBody:this.chassisBody=new O({mass:1,shape:new _(new o(5,.5,2))}),this.constraints=[],this.wheelAxes=[],this.wheelForces=[]}addWheel(t){let e;void 0===t&&(t={}),e=t.body?t.body:new O({mass:1,shape:new hi(1.2)}),this.wheelBodies.push(e),this.wheelForces.push(0);const i=void 0!==t.position?t.position.clone():new o,n=new o;this.chassisBody.pointToWorldFrame(i,n),e.position.set(n.x,n.y,n.z);const r=void 0!==t.axis?t.axis.clone():new o(0,0,1);this.wheelAxes.push(r);const s=new me(this.chassisBody,e,{pivotA:i,axisA:r,pivotB:o.ZERO,axisB:r,collideConnected:!1});return this.constraints.push(s),this.wheelBodies.length-1}setSteeringValue(t,e){const i=this.wheelAxes[e],n=Math.cos(t),r=Math.sin(t),s=i.x,o=i.z;this.constraints[e].axisA.set(-n*s+r*o,0,r*s+n*o)}setMotorSpeed(t,e){const i=this.constraints[e];i.enableMotor(),i.motorTargetVelocity=t}disableMotor(t){this.constraints[t].disableMotor()}setWheelForce(t,e){this.wheelForces[e]=t}applyWheelForce(t,e){const i=this.wheelAxes[e],n=this.wheelBodies[e],r=n.torque;i.scale(t,ui),n.vectorToWorldFrame(ui,ui),r.vadd(ui,r)}addToWorld(t){const e=this.constraints,i=this.wheelBodies.concat([this.chassisBody]);for(let e=0;e<i.length;e++)t.addBody(i[e]);for(let i=0;i<e.length;i++)t.addConstraint(e[i]);t.addEventListener("preStep",this._update.bind(this))}_update(){const t=this.wheelForces;for(let e=0;e<t.length;e++)this.applyWheelForce(t[e],e)}removeFromWorld(t){const e=this.constraints,i=this.wheelBodies.concat([this.chassisBody]);for(let e=0;e<i.length;e++)t.removeBody(i[e]);for(let i=0;i<e.length;i++)t.removeConstraint(e[i])}getWheelSpeed(t){const e=this.wheelAxes[t],i=this.wheelBodies[t].angularVelocity;return this.chassisBody.vectorToWorldFrame(e,ci),i.dot(ci)}}const ui=new o,ci=new o;class di{constructor(){this.particles=[],this.density=1,this.smoothingRadius=1,this.speedOfSound=1,this.viscosity=.01,this.eps=1e-6,this.pressures=[],this.densities=[],this.neighbors=[]}add(t){this.particles.push(t),this.neighbors.length<this.particles.length&&this.neighbors.push([])}remove(t){const e=this.particles.indexOf(t);-1!==e&&(this.particles.splice(e,1),this.neighbors.length>this.particles.length&&this.neighbors.pop())}getNeighbors(t,e){const i=this.particles.length,n=t.id,r=this.smoothingRadius*this.smoothingRadius,s=pi;for(let o=0;o!==i;o++){const i=this.particles[o];i.position.vsub(t.position,s),n!==i.id&&s.lengthSquared()<r&&e.push(i)}}update(){const t=this.particles.length,e=fi,i=this.speedOfSound,n=this.eps;for(let n=0;n!==t;n++){const t=this.particles[n],r=this.neighbors[n];r.length=0,this.getNeighbors(t,r),r.push(this.particles[n]);const s=r.length;let o=0;for(let i=0;i!==s;i++){t.position.vsub(r[i].position,e);const n=e.length(),s=this.w(n);o+=r[i].mass*s}this.densities[n]=o,this.pressures[n]=i*i*(this.densities[n]-this.density)}const r=mi,s=gi,o=vi,a=yi,h=xi;for(let e=0;e!==t;e++){const t=this.particles[e];let i,l;r.set(0,0,0),s.set(0,0,0);const u=this.neighbors[e],c=u.length;for(let d=0;d!==c;d++){const c=u[d];t.position.vsub(c.position,a);const p=a.length();i=-c.mass*(this.pressures[e]/(this.densities[e]*this.densities[e]+n)+this.pressures[d]/(this.densities[d]*this.densities[d]+n)),this.gradw(a,o),o.scale(i,o),r.vadd(o,r),c.velocity.vsub(t.velocity,h),h.scale(1/(1e-4+this.densities[e]*this.densities[d])*this.viscosity*c.mass,h),l=this.nablaw(p),h.scale(l,h),s.vadd(h,s)}s.scale(t.mass,s),r.scale(t.mass,r),t.force.vadd(s,t.force),t.force.vadd(r,t.force)}}w(t){const e=this.smoothingRadius;return 315/(64*Math.PI*e**9)*(e*e-t*t)**3}gradw(t,e){const i=t.length(),n=this.smoothingRadius;t.scale(945/(32*Math.PI*n**9)*(n*n-i*i)**2,e)}nablaw(t){const e=this.smoothingRadius;return 945/(32*Math.PI*e**9)*(e*e-t*t)*(7*t*t-3*e*e)}}const pi=new o,fi=new o,mi=new o,gi=new o,vi=new o,yi=new o,xi=new o;class wi extends A{constructor(t,e,i,n){if(void 0===t&&(t=1),void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=8),t<0)throw new Error("The cylinder radiusTop cannot be negative.");if(e<0)throw new Error("The cylinder radiusBottom cannot be negative.");const r=n,s=[],a=[],h=[],l=[],u=[],c=Math.cos,d=Math.sin;s.push(new o(-e*d(0),.5*-i,e*c(0))),l.push(0),s.push(new o(-t*d(0),.5*i,t*c(0))),u.push(1);for(let n=0;n<r;n++){const p=2*Math.PI/r*(n+1),f=2*Math.PI/r*(n+.5);n<r-1?(s.push(new o(-e*d(p),.5*-i,e*c(p))),l.push(2*n+2),s.push(new o(-t*d(p),.5*i,t*c(p))),u.push(2*n+3),h.push([2*n,2*n+1,2*n+3,2*n+2])):h.push([2*n,2*n+1,1,0]),(r%2==1||n<r/2)&&a.push(new o(-d(f),0,c(f)))}h.push(l),a.push(new o(0,1,0));const p=[];for(let t=0;t<u.length;t++)p.push(u[u.length-t-1]);h.push(p),super({vertices:s,faces:h,axes:a}),this.type=x.types.CYLINDER,this.radiusTop=t,this.radiusBottom=e,this.height=i,this.numSegments=n}}class bi extends x{constructor(){super({type:x.types.PARTICLE})}calculateLocalInertia(t,e){return void 0===e&&(e=new o),e.set(0,0,0),e}volume(){return 0}updateBoundingSphereRadius(){this.boundingSphereRadius=0}calculateWorldAABB(t,e,i,n){i.copy(t),n.copy(t)}}class Ai extends x{constructor(){super({type:x.types.PLANE}),this.worldNormal=new o,this.worldNormalNeedsUpdate=!0,this.boundingSphereRadius=Number.MAX_VALUE}computeWorldNormal(t){const e=this.worldNormal;e.set(0,0,1),t.vmult(e,e),this.worldNormalNeedsUpdate=!1}calculateLocalInertia(t,e){return void 0===e&&(e=new o),e}volume(){return Number.MAX_VALUE}calculateWorldAABB(t,e,i,n){Ti.set(0,0,1),e.vmult(Ti,Ti);const r=Number.MAX_VALUE;i.set(-r,-r,-r),n.set(r,r,r),1===Ti.x?n.x=t.x:-1===Ti.x&&(i.x=t.x),1===Ti.y?n.y=t.y:-1===Ti.y&&(i.y=t.y),1===Ti.z?n.z=t.z:-1===Ti.z&&(i.z=t.z)}updateBoundingSphereRadius(){this.boundingSphereRadius=Number.MAX_VALUE}}const Ti=new o;class Si extends x{constructor(t,e){void 0===e&&(e={}),e=zt.defaults(e,{maxValue:null,minValue:null,elementSize:1}),super({type:x.types.HEIGHTFIELD}),this.data=t,this.maxValue=e.maxValue,this.minValue=e.minValue,this.elementSize=e.elementSize,null===e.minValue&&this.updateMinValue(),null===e.maxValue&&this.updateMaxValue(),this.cacheEnabled=!0,this.pillarConvex=new A,this.pillarOffset=new o,this.updateBoundingSphereRadius(),this._cachedPillars={}}update(){this._cachedPillars={}}updateMinValue(){const t=this.data;let e=t[0][0];for(let i=0;i!==t.length;i++)for(let n=0;n!==t[i].length;n++){const r=t[i][n];r<e&&(e=r)}this.minValue=e}updateMaxValue(){const t=this.data;let e=t[0][0];for(let i=0;i!==t.length;i++)for(let n=0;n!==t[i].length;n++){const r=t[i][n];r>e&&(e=r)}this.maxValue=e}setHeightValueAtIndex(t,e,i){this.data[t][e]=i,this.clearCachedConvexTrianglePillar(t,e,!1),t>0&&(this.clearCachedConvexTrianglePillar(t-1,e,!0),this.clearCachedConvexTrianglePillar(t-1,e,!1)),e>0&&(this.clearCachedConvexTrianglePillar(t,e-1,!0),this.clearCachedConvexTrianglePillar(t,e-1,!1)),e>0&&t>0&&this.clearCachedConvexTrianglePillar(t-1,e-1,!0)}getRectMinMax(t,e,i,n,r){void 0===r&&(r=[]);const s=this.data;let o=this.minValue;for(let r=t;r<=i;r++)for(let t=e;t<=n;t++){const e=s[r][t];e>o&&(o=e)}r[0]=this.minValue,r[1]=o}getIndexOfPosition(t,e,i,n){const r=this.elementSize,s=this.data;let o=Math.floor(t/r),a=Math.floor(e/r);return i[0]=o,i[1]=a,n&&(o<0&&(o=0),a<0&&(a=0),o>=s.length-1&&(o=s.length-1),a>=s[0].length-1&&(a=s[0].length-1)),!(o<0||a<0||o>=s.length-1||a>=s[0].length-1)}getTriangleAt(t,e,i,n,r,s){const o=Ei;this.getIndexOfPosition(t,e,o,i);let a=o[0],h=o[1];const l=this.data;i&&(a=Math.min(l.length-2,Math.max(0,a)),h=Math.min(l[0].length-2,Math.max(0,h)));const u=this.elementSize,c=(t/u-a)**2+(e/u-h)**2>(t/u-(a+1))**2+(e/u-(h+1))**2;return this.getTriangle(a,h,c,n,r,s),c}getNormalAt(t,e,i,n){const r=Ri,s=Li,o=Oi,a=Di,h=Bi;this.getTriangleAt(t,e,i,r,s,o),s.vsub(r,a),o.vsub(r,h),a.cross(h,n),n.normalize()}getAabbAtIndex(t,e,i){let{lowerBound:n,upperBound:r}=i;const s=this.data,o=this.elementSize;n.set(t*o,e*o,s[t][e]),r.set((t+1)*o,(e+1)*o,s[t+1][e+1])}getHeightAt(t,e,i){const n=this.data,r=_i,s=Ci,o=Pi,a=Ei;this.getIndexOfPosition(t,e,a,i);let h=a[0],l=a[1];i&&(h=Math.min(n.length-2,Math.max(0,h)),l=Math.min(n[0].length-2,Math.max(0,l)));const u=this.getTriangleAt(t,e,i,r,s,o);!function(t,e,i,n,r,s,o,a,h){h.x=((s-a)*(t-o)+(o-r)*(e-a))/((s-a)*(i-o)+(o-r)*(n-a)),h.y=((a-n)*(t-o)+(i-o)*(e-a))/((s-a)*(i-o)+(o-r)*(n-a)),h.z=1-h.x-h.y}(t,e,r.x,r.y,s.x,s.y,o.x,o.y,Mi);const c=Mi;return u?n[h+1][l+1]*c.x+n[h][l+1]*c.y+n[h+1][l]*c.z:n[h][l]*c.x+n[h+1][l]*c.y+n[h][l+1]*c.z}getCacheConvexTrianglePillarKey(t,e,i){return`${t}_${e}_${i?1:0}`}getCachedConvexTrianglePillar(t,e,i){return this._cachedPillars[this.getCacheConvexTrianglePillarKey(t,e,i)]}setCachedConvexTrianglePillar(t,e,i,n,r){this._cachedPillars[this.getCacheConvexTrianglePillarKey(t,e,i)]={convex:n,offset:r}}clearCachedConvexTrianglePillar(t,e,i){delete this._cachedPillars[this.getCacheConvexTrianglePillarKey(t,e,i)]}getTriangle(t,e,i,n,r,s){const o=this.data,a=this.elementSize;i?(n.set((t+1)*a,(e+1)*a,o[t+1][e+1]),r.set(t*a,(e+1)*a,o[t][e+1]),s.set((t+1)*a,e*a,o[t+1][e])):(n.set(t*a,e*a,o[t][e]),r.set((t+1)*a,e*a,o[t+1][e]),s.set(t*a,(e+1)*a,o[t][e+1]))}getConvexTrianglePillar(t,e,i){let n=this.pillarConvex,r=this.pillarOffset;if(this.cacheEnabled){const s=this.getCachedConvexTrianglePillar(t,e,i);if(s)return this.pillarConvex=s.convex,void(this.pillarOffset=s.offset);n=new A,r=new o,this.pillarConvex=n,this.pillarOffset=r}const s=this.data,a=this.elementSize,h=n.faces;n.vertices.length=6;for(let t=0;t<6;t++)n.vertices[t]||(n.vertices[t]=new o);h.length=5;for(let t=0;t<5;t++)h[t]||(h[t]=[]);const l=n.vertices,u=(Math.min(s[t][e],s[t+1][e],s[t][e+1],s[t+1][e+1])-this.minValue)/2+this.minValue;i?(r.set((t+.75)*a,(e+.75)*a,u),l[0].set(.25*a,.25*a,s[t+1][e+1]-u),l[1].set(-.75*a,.25*a,s[t][e+1]-u),l[2].set(.25*a,-.75*a,s[t+1][e]-u),l[3].set(.25*a,.25*a,-Math.abs(u)-1),l[4].set(-.75*a,.25*a,-Math.abs(u)-1),l[5].set(.25*a,-.75*a,-Math.abs(u)-1),h[0][0]=0,h[0][1]=1,h[0][2]=2,h[1][0]=5,h[1][1]=4,h[1][2]=3,h[2][0]=2,h[2][1]=5,h[2][2]=3,h[2][3]=0,h[3][0]=3,h[3][1]=4,h[3][2]=1,h[3][3]=0,h[4][0]=1,h[4][1]=4,h[4][2]=5,h[4][3]=2):(r.set((t+.25)*a,(e+.25)*a,u),l[0].set(-.25*a,-.25*a,s[t][e]-u),l[1].set(.75*a,-.25*a,s[t+1][e]-u),l[2].set(-.25*a,.75*a,s[t][e+1]-u),l[3].set(-.25*a,-.25*a,-Math.abs(u)-1),l[4].set(.75*a,-.25*a,-Math.abs(u)-1),l[5].set(-.25*a,.75*a,-Math.abs(u)-1),h[0][0]=0,h[0][1]=1,h[0][2]=2,h[1][0]=5,h[1][1]=4,h[1][2]=3,h[2][0]=0,h[2][1]=2,h[2][2]=5,h[2][3]=3,h[3][0]=1,h[3][1]=0,h[3][2]=3,h[3][3]=4,h[4][0]=4,h[4][1]=5,h[4][2]=2,h[4][3]=1),n.computeNormals(),n.computeEdges(),n.updateBoundingSphereRadius(),this.setCachedConvexTrianglePillar(t,e,i,n,r)}calculateLocalInertia(t,e){return void 0===e&&(e=new o),e.set(0,0,0),e}volume(){return Number.MAX_VALUE}calculateWorldAABB(t,e,i,n){i.set(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),n.set(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE)}updateBoundingSphereRadius(){const t=this.data,e=this.elementSize;this.boundingSphereRadius=new o(t.length*e,t[0].length*e,Math.max(Math.abs(this.maxValue),Math.abs(this.minValue))).length()}setHeightsFromImage(t,e){const{x:i,z:n,y:r}=e,s=document.createElement("canvas");s.width=t.width,s.height=t.height;const o=s.getContext("2d");o.drawImage(t,0,0);const a=o.getImageData(0,0,t.width,t.height),h=this.data;h.length=0,this.elementSize=Math.abs(i)/a.width;for(let t=0;t<a.height;t++){const e=[];for(let r=0;r<a.width;r++){const s=(a.data[4*(t*a.height+r)]+a.data[4*(t*a.height+r)+1]+a.data[4*(t*a.height+r)+2])/4/255*n;i<0?e.push(s):e.unshift(s)}r<0?h.unshift(e):h.push(e)}this.updateMaxValue(),this.updateMinValue(),this.update()}}const Ei=[],Mi=new o,_i=new o,Ci=new o,Pi=new o,Ri=new o,Li=new o,Oi=new o,Di=new o,Bi=new o;class Ii{constructor(t){void 0===t&&(t={}),this.root=t.root||null,this.aabb=t.aabb?t.aabb.clone():new u,this.data=[],this.children=[]}reset(){this.children.length=this.data.length=0}insert(t,e,i){void 0===i&&(i=0);const n=this.data;if(!this.aabb.contains(t))return!1;const r=this.children;if(i<(this.maxDepth||this.root.maxDepth)){let n=!1;r.length||(this.subdivide(),n=!0);for(let n=0;8!==n;n++)if(r[n].insert(t,e,i+1))return!0;n&&(r.length=0)}return n.push(e),!0}subdivide(){const t=this.aabb,e=t.lowerBound,i=t.upperBound,n=this.children;n.push(new Ii({aabb:new u({lowerBound:new o(0,0,0)})}),new Ii({aabb:new u({lowerBound:new o(1,0,0)})}),new Ii({aabb:new u({lowerBound:new o(1,1,0)})}),new Ii({aabb:new u({lowerBound:new o(1,1,1)})}),new Ii({aabb:new u({lowerBound:new o(0,1,1)})}),new Ii({aabb:new u({lowerBound:new o(0,0,1)})}),new Ii({aabb:new u({lowerBound:new o(1,0,1)})}),new Ii({aabb:new u({lowerBound:new o(0,1,0)})})),i.vsub(e,ki),ki.scale(.5,ki);const r=this.root||this;for(let t=0;8!==t;t++){const i=n[t];i.root=r;const s=i.aabb.lowerBound;s.x*=ki.x,s.y*=ki.y,s.z*=ki.z,s.vadd(e,s),s.vadd(ki,i.aabb.upperBound)}}aabbQuery(t,e){this.data,this.children;const i=[this];for(;i.length;){const n=i.pop();n.aabb.overlaps(t)&&Array.prototype.push.apply(e,n.data),Array.prototype.push.apply(i,n.children)}return e}rayQuery(t,e,i){return t.getAABB(Ni),Ni.toLocalFrame(e,Ni),this.aabbQuery(Ni,i),i}removeEmptyNodes(){for(let t=this.children.length-1;t>=0;t--)this.children[t].removeEmptyNodes(),this.children[t].children.length||this.children[t].data.length||this.children.splice(t,1)}}class Fi extends Ii{constructor(t,e){void 0===e&&(e={}),super({root:null,aabb:t}),this.maxDepth=void 0!==e.maxDepth?e.maxDepth:8}}const ki=new o,Ni=new u;class zi extends x{constructor(t,e){super({type:x.types.TRIMESH}),this.vertices=new Float32Array(t),this.indices=new Int16Array(e),this.normals=new Float32Array(e.length),this.aabb=new u,this.edges=null,this.scale=new o(1,1,1),this.tree=new Fi,this.updateEdges(),this.updateNormals(),this.updateAABB(),this.updateBoundingSphereRadius(),this.updateTree()}updateTree(){const t=this.tree;t.reset(),t.aabb.copy(this.aabb);const e=this.scale;t.aabb.lowerBound.x*=1/e.x,t.aabb.lowerBound.y*=1/e.y,t.aabb.lowerBound.z*=1/e.z,t.aabb.upperBound.x*=1/e.x,t.aabb.upperBound.y*=1/e.y,t.aabb.upperBound.z*=1/e.z;const i=new u,n=new o,r=new o,s=new o,a=[n,r,s];for(let e=0;e<this.indices.length/3;e++){const o=3*e;this._getUnscaledVertex(this.indices[o],n),this._getUnscaledVertex(this.indices[o+1],r),this._getUnscaledVertex(this.indices[o+2],s),i.setFromPoints(a),t.insert(i,e)}t.removeEmptyNodes()}getTrianglesInAABB(t,e){Vi.copy(t);const i=this.scale,n=i.x,r=i.y,s=i.z,o=Vi.lowerBound,a=Vi.upperBound;return o.x/=n,o.y/=r,o.z/=s,a.x/=n,a.y/=r,a.z/=s,this.tree.aabbQuery(Vi,e)}setScale(t){const e=this.scale.x===this.scale.y&&this.scale.y===this.scale.z,i=t.x===t.y&&t.y===t.z;e&&i||this.updateNormals(),this.scale.copy(t),this.updateAABB(),this.updateBoundingSphereRadius()}updateNormals(){const t=Ui,e=this.normals;for(let i=0;i<this.indices.length/3;i++){const n=3*i,r=this.indices[n],s=this.indices[n+1],o=this.indices[n+2];this.getVertex(r,Xi),this.getVertex(s,ji),this.getVertex(o,qi),zi.computeNormal(ji,Xi,qi,t),e[n]=t.x,e[n+1]=t.y,e[n+2]=t.z}}updateEdges(){const t={},e=(e,i)=>{t[e<i?`${e}_${i}`:`${i}_${e}`]=!0};for(let t=0;t<this.indices.length/3;t++){const i=3*t,n=this.indices[i],r=this.indices[i+1],s=this.indices[i+2];e(n,r),e(r,s),e(s,n)}const i=Object.keys(t);this.edges=new Int16Array(2*i.length);for(let t=0;t<i.length;t++){const e=i[t].split("_");this.edges[2*t]=parseInt(e[0],10),this.edges[2*t+1]=parseInt(e[1],10)}}getEdgeVertex(t,e,i){const n=this.edges[2*t+(e?1:0)];this.getVertex(n,i)}getEdgeVector(t,e){const i=Hi,n=Gi;this.getEdgeVertex(t,0,i),this.getEdgeVertex(t,1,n),n.vsub(i,e)}static computeNormal(t,e,i,n){e.vsub(t,Yi),i.vsub(e,Wi),Wi.cross(Yi,n),n.isZero()||n.normalize()}getVertex(t,e){const i=this.scale;return this._getUnscaledVertex(t,e),e.x*=i.x,e.y*=i.y,e.z*=i.z,e}_getUnscaledVertex(t,e){const i=3*t,n=this.vertices;return e.set(n[i],n[i+1],n[i+2])}getWorldVertex(t,e,i,n){return this.getVertex(t,n),w.pointToWorldFrame(e,i,n,n),n}getTriangleVertices(t,e,i,n){const r=3*t;this.getVertex(this.indices[r],e),this.getVertex(this.indices[r+1],i),this.getVertex(this.indices[r+2],n)}getNormal(t,e){const i=3*t;return e.set(this.normals[i],this.normals[i+1],this.normals[i+2])}calculateLocalInertia(t,e){this.computeLocalAABB(Qi);const i=Qi.upperBound.x-Qi.lowerBound.x,n=Qi.upperBound.y-Qi.lowerBound.y,r=Qi.upperBound.z-Qi.lowerBound.z;return e.set(1/12*t*(2*n*2*n+2*r*2*r),1/12*t*(2*i*2*i+2*r*2*r),1/12*t*(2*n*2*n+2*i*2*i))}computeLocalAABB(t){const e=t.lowerBound,i=t.upperBound,n=this.vertices.length;this.vertices;const r=Ki;this.getVertex(0,r),e.copy(r),i.copy(r);for(let t=0;t!==n;t++)this.getVertex(t,r),r.x<e.x?e.x=r.x:r.x>i.x&&(i.x=r.x),r.y<e.y?e.y=r.y:r.y>i.y&&(i.y=r.y),r.z<e.z?e.z=r.z:r.z>i.z&&(i.z=r.z)}updateAABB(){this.computeLocalAABB(this.aabb)}updateBoundingSphereRadius(){let t=0;const e=this.vertices,i=new o;for(let n=0,r=e.length/3;n!==r;n++){this.getVertex(n,i);const e=i.lengthSquared();e>t&&(t=e)}this.boundingSphereRadius=Math.sqrt(t)}calculateWorldAABB(t,e,i,n){const r=Ji,s=Zi;r.position=t,r.quaternion=e,this.aabb.toWorldFrame(r,s),i.copy(s.lowerBound),n.copy(s.upperBound)}volume(){return 4*Math.PI*this.boundingSphereRadius/3}static createTorus(t,e,i,n,r){void 0===t&&(t=1),void 0===e&&(e=.5),void 0===i&&(i=8),void 0===n&&(n=6),void 0===r&&(r=2*Math.PI);const s=[],o=[];for(let o=0;o<=i;o++)for(let a=0;a<=n;a++){const h=a/n*r,l=o/i*Math.PI*2,u=(t+e*Math.cos(l))*Math.cos(h),c=(t+e*Math.cos(l))*Math.sin(h),d=e*Math.sin(l);s.push(u,c,d)}for(let t=1;t<=i;t++)for(let e=1;e<=n;e++){const i=(n+1)*t+e-1,r=(n+1)*(t-1)+e-1,s=(n+1)*(t-1)+e,a=(n+1)*t+e;o.push(i,r,a),o.push(r,s,a)}return new zi(s,o)}}const Ui=new o,Vi=new u,Hi=new o,Gi=new o,Wi=new o,Yi=new o,Xi=new o,ji=new o,qi=new o,Qi=new u,Ki=new o,Ji=new w,Zi=new u;class $i{constructor(){this.equations=[]}solve(t,e){return 0}addEquation(t){!t.enabled||t.bi.isTrigger||t.bj.isTrigger||this.equations.push(t)}removeEquation(t){const e=this.equations,i=e.indexOf(t);-1!==i&&e.splice(i,1)}removeAllEquations(){this.equations.length=0}}class tn extends $i{constructor(){super(),this.iterations=10,this.tolerance=1e-7}solve(t,e){let i=0;const n=this.iterations,r=this.tolerance*this.tolerance,s=this.equations,o=s.length,a=e.bodies,h=a.length,l=t;let u,c,d,p,f,m;if(0!==o)for(let t=0;t!==h;t++)a[t].updateSolveMassProperties();const g=nn,v=rn,y=en;g.length=o,v.length=o,y.length=o;for(let t=0;t!==o;t++){const e=s[t];y[t]=0,v[t]=e.computeB(l),g[t]=1/e.computeC()}if(0!==o){for(let t=0;t!==h;t++){const e=a[t],i=e.vlambda,n=e.wlambda;i.set(0,0,0),n.set(0,0,0)}for(i=0;i!==n;i++){p=0;for(let t=0;t!==o;t++){const e=s[t];u=v[t],c=g[t],m=y[t],f=e.computeGWlambda(),d=c*(u-f-e.eps*m),m+d<e.minForce?d=e.minForce-m:m+d>e.maxForce&&(d=e.maxForce-m),y[t]+=d,p+=d>0?d:-d,e.addToWlambda(d)}if(p*p<r)break}for(let t=0;t!==h;t++){const e=a[t],i=e.velocity,n=e.angularVelocity;e.vlambda.vmul(e.linearFactor,e.vlambda),i.vadd(e.vlambda,i),e.wlambda.vmul(e.angularFactor,e.wlambda),n.vadd(e.wlambda,n)}let t=s.length;const e=1/l;for(;t--;)s[t].multiplier=y[t]*e}return i}}const en=[],nn=[],rn=[];class sn extends $i{constructor(t){for(super(),this.iterations=10,this.tolerance=1e-7,this.subsolver=t,this.nodes=[],this.nodePool=[];this.nodePool.length<128;)this.nodePool.push(this.createNode())}createNode(){return{body:null,children:[],eqs:[],visited:!1}}solve(t,e){const i=on,n=this.nodePool,r=e.bodies,s=this.equations,o=s.length,a=r.length,h=this.subsolver;for(;n.length<a;)n.push(this.createNode());i.length=a;for(let t=0;t<a;t++)i[t]=n[t];for(let t=0;t!==a;t++){const e=i[t];e.body=r[t],e.children.length=0,e.eqs.length=0,e.visited=!1}for(let t=0;t!==o;t++){const e=s[t],n=r.indexOf(e.bi),o=r.indexOf(e.bj),a=i[n],h=i[o];a.children.push(h),a.eqs.push(e),h.children.push(a),h.eqs.push(e)}let l,u=0,c=an;h.tolerance=this.tolerance,h.iterations=this.iterations;const d=hn;for(;l=un(i);){c.length=0,d.bodies.length=0,dn(l,pn,d.bodies,c);const e=c.length;c=c.sort(fn);for(let t=0;t!==e;t++)h.addEquation(c[t]);h.solve(t,d),h.removeAllEquations(),u++}return u}}const on=[],an=[],hn={bodies:[]},ln=O.STATIC;function un(t){const e=t.length;for(let i=0;i!==e;i++){const e=t[i];if(!(e.visited||e.body.type&ln))return e}return!1}const cn=[];function dn(t,e,i,n){for(cn.push(t),t.visited=!0,e(t,i,n);cn.length;){const t=cn.pop();let r;for(;r=un(t.children);)r.visited=!0,e(r,i,n),cn.push(r)}}function pn(t,e,i){e.push(t.body);const n=t.eqs.length;for(let e=0;e!==n;e++){const n=t.eqs[e];i.includes(n)||i.push(n)}}function fn(t,e){return e.id-t.id}class mn{constructor(){this.objects=[],this.type=Object}release(){const t=arguments.length;for(let e=0;e!==t;e++)this.objects.push(e<0||arguments.length<=e?void 0:arguments[e]);return this}get(){return 0===this.objects.length?this.constructObject():this.objects.pop()}constructObject(){throw new Error("constructObject() not implemented in this Pool subclass yet!")}resize(t){const e=this.objects;for(;e.length>t;)e.pop();for(;e.length<t;)e.push(this.constructObject());return this}}class gn extends mn{constructor(){super(...arguments),this.type=o}constructObject(){return new o}}const vn={sphereSphere:x.types.SPHERE,spherePlane:x.types.SPHERE|x.types.PLANE,boxBox:x.types.BOX|x.types.BOX,sphereBox:x.types.SPHERE|x.types.BOX,planeBox:x.types.PLANE|x.types.BOX,convexConvex:x.types.CONVEXPOLYHEDRON,sphereConvex:x.types.SPHERE|x.types.CONVEXPOLYHEDRON,planeConvex:x.types.PLANE|x.types.CONVEXPOLYHEDRON,boxConvex:x.types.BOX|x.types.CONVEXPOLYHEDRON,sphereHeightfield:x.types.SPHERE|x.types.HEIGHTFIELD,boxHeightfield:x.types.BOX|x.types.HEIGHTFIELD,convexHeightfield:x.types.CONVEXPOLYHEDRON|x.types.HEIGHTFIELD,sphereParticle:x.types.PARTICLE|x.types.SPHERE,planeParticle:x.types.PLANE|x.types.PARTICLE,boxParticle:x.types.BOX|x.types.PARTICLE,convexParticle:x.types.PARTICLE|x.types.CONVEXPOLYHEDRON,cylinderCylinder:x.types.CYLINDER,sphereCylinder:x.types.SPHERE|x.types.CYLINDER,planeCylinder:x.types.PLANE|x.types.CYLINDER,boxCylinder:x.types.BOX|x.types.CYLINDER,convexCylinder:x.types.CONVEXPOLYHEDRON|x.types.CYLINDER,heightfieldCylinder:x.types.HEIGHTFIELD|x.types.CYLINDER,particleCylinder:x.types.PARTICLE|x.types.CYLINDER,sphereTrimesh:x.types.SPHERE|x.types.TRIMESH,planeTrimesh:x.types.PLANE|x.types.TRIMESH};class yn{get[vn.sphereSphere](){return this.sphereSphere}get[vn.spherePlane](){return this.spherePlane}get[vn.boxBox](){return this.boxBox}get[vn.sphereBox](){return this.sphereBox}get[vn.planeBox](){return this.planeBox}get[vn.convexConvex](){return this.convexConvex}get[vn.sphereConvex](){return this.sphereConvex}get[vn.planeConvex](){return this.planeConvex}get[vn.boxConvex](){return this.boxConvex}get[vn.sphereHeightfield](){return this.sphereHeightfield}get[vn.boxHeightfield](){return this.boxHeightfield}get[vn.convexHeightfield](){return this.convexHeightfield}get[vn.sphereParticle](){return this.sphereParticle}get[vn.planeParticle](){return this.planeParticle}get[vn.boxParticle](){return this.boxParticle}get[vn.convexParticle](){return this.convexParticle}get[vn.cylinderCylinder](){return this.convexConvex}get[vn.sphereCylinder](){return this.sphereConvex}get[vn.planeCylinder](){return this.planeConvex}get[vn.boxCylinder](){return this.boxConvex}get[vn.convexCylinder](){return this.convexConvex}get[vn.heightfieldCylinder](){return this.heightfieldCylinder}get[vn.particleCylinder](){return this.particleCylinder}get[vn.sphereTrimesh](){return this.sphereTrimesh}get[vn.planeTrimesh](){return this.planeTrimesh}constructor(t){this.contactPointPool=[],this.frictionEquationPool=[],this.result=[],this.frictionResult=[],this.v3pool=new gn,this.world=t,this.currentContactMaterial=t.defaultContactMaterial,this.enableFrictionReduction=!1}createContactEquation(t,e,i,n,r,s){let o;this.contactPointPool.length?(o=this.contactPointPool.pop(),o.bi=t,o.bj=e):o=new Qt(t,e),o.enabled=t.collisionResponse&&e.collisionResponse&&i.collisionResponse&&n.collisionResponse;const a=this.currentContactMaterial;o.restitution=a.restitution,o.setSpookParams(a.contactEquationStiffness,a.contactEquationRelaxation,this.world.dt);const h=i.material||t.material,l=n.material||e.material;return h&&l&&h.restitution>=0&&l.restitution>=0&&(o.restitution=h.restitution*l.restitution),o.si=r||i,o.sj=s||n,o}createFrictionEquationsFromContact(t,e){const i=t.bi,n=t.bj,r=t.si,s=t.sj,o=this.world,a=this.currentContactMaterial;let h=a.friction;const l=r.material||i.material,u=s.material||n.material;if(l&&u&&l.friction>=0&&u.friction>=0&&(h=l.friction*u.friction),h>0){const r=h*o.gravity.length();let s=i.invMass+n.invMass;s>0&&(s=1/s);const l=this.frictionEquationPool,u=l.length?l.pop():new ye(i,n,r*s),c=l.length?l.pop():new ye(i,n,r*s);return u.bi=c.bi=i,u.bj=c.bj=n,u.minForce=c.minForce=-r*s,u.maxForce=c.maxForce=r*s,u.ri.copy(t.ri),u.rj.copy(t.rj),c.ri.copy(t.ri),c.rj.copy(t.rj),t.ni.tangents(u.t,c.t),u.setSpookParams(a.frictionEquationStiffness,a.frictionEquationRelaxation,o.dt),c.setSpookParams(a.frictionEquationStiffness,a.frictionEquationRelaxation,o.dt),u.enabled=c.enabled=t.enabled,e.push(u,c),!0}return!1}createFrictionFromAverage(t){let e=this.result[this.result.length-1];if(!this.createFrictionEquationsFromContact(e,this.frictionResult)||1===t)return;const i=this.frictionResult[this.frictionResult.length-2],n=this.frictionResult[this.frictionResult.length-1];xn.setZero(),wn.setZero(),bn.setZero();const r=e.bi;e.bj;for(let i=0;i!==t;i++)e=this.result[this.result.length-1-i],e.bi!==r?(xn.vadd(e.ni,xn),wn.vadd(e.ri,wn),bn.vadd(e.rj,bn)):(xn.vsub(e.ni,xn),wn.vadd(e.rj,wn),bn.vadd(e.ri,bn));const s=1/t;wn.scale(s,i.ri),bn.scale(s,i.rj),n.ri.copy(i.ri),n.rj.copy(i.rj),xn.normalize(),xn.tangents(i.t,n.t)}getContacts(t,e,i,n,r,s,o){this.contactPointPool=r,this.frictionEquationPool=o,this.result=n,this.frictionResult=s;const a=Sn,h=En,l=An,u=Tn;for(let n=0,r=t.length;n!==r;n++){const r=t[n],s=e[n];let o=null;r.material&&s.material&&(o=i.getContactMaterial(r.material,s.material)||null);const c=r.type&O.KINEMATIC&&s.type&O.STATIC||r.type&O.STATIC&&s.type&O.KINEMATIC||r.type&O.KINEMATIC&&s.type&O.KINEMATIC;for(let t=0;t<r.shapes.length;t++){r.quaternion.mult(r.shapeOrientations[t],a),r.quaternion.vmult(r.shapeOffsets[t],l),l.vadd(r.position,l);const e=r.shapes[t];for(let t=0;t<s.shapes.length;t++){s.quaternion.mult(s.shapeOrientations[t],h),s.quaternion.vmult(s.shapeOffsets[t],u),u.vadd(s.position,u);const n=s.shapes[t];if(!(e.collisionFilterMask&n.collisionFilterGroup&&n.collisionFilterMask&e.collisionFilterGroup))continue;if(l.distanceTo(u)>e.boundingSphereRadius+n.boundingSphereRadius)continue;let d=null;e.material&&n.material&&(d=i.getContactMaterial(e.material,n.material)||null),this.currentContactMaterial=d||o||i.defaultContactMaterial;const p=this[e.type|n.type];if(p){let t=!1;t=e.type<n.type?p.call(this,e,n,l,u,a,h,r,s,e,n,c):p.call(this,n,e,u,l,h,a,s,r,e,n,c),t&&c&&(i.shapeOverlapKeeper.set(e.id,n.id),i.bodyOverlapKeeper.set(r.id,s.id))}}}}}sphereSphere(t,e,i,n,r,s,o,a,h,l,u){if(u)return i.distanceSquared(n)<(t.radius+e.radius)**2;const c=this.createContactEquation(o,a,t,e,h,l);n.vsub(i,c.ni),c.ni.normalize(),c.ri.copy(c.ni),c.rj.copy(c.ni),c.ri.scale(t.radius,c.ri),c.rj.scale(-e.radius,c.rj),c.ri.vadd(i,c.ri),c.ri.vsub(o.position,c.ri),c.rj.vadd(n,c.rj),c.rj.vsub(a.position,c.rj),this.result.push(c),this.createFrictionEquationsFromContact(c,this.frictionResult)}spherePlane(t,e,i,n,r,s,o,a,h,l,u){const c=this.createContactEquation(o,a,t,e,h,l);if(c.ni.set(0,0,1),s.vmult(c.ni,c.ni),c.ni.negate(c.ni),c.ni.normalize(),c.ni.scale(t.radius,c.ri),i.vsub(n,Wn),c.ni.scale(c.ni.dot(Wn),Yn),Wn.vsub(Yn,c.rj),-Wn.dot(c.ni)<=t.radius){if(u)return!0;const t=c.ri,e=c.rj;t.vadd(i,t),t.vsub(o.position,t),e.vadd(n,e),e.vsub(a.position,e),this.result.push(c),this.createFrictionEquationsFromContact(c,this.frictionResult)}}boxBox(t,e,i,n,r,s,o,a,h,l,u){return t.convexPolyhedronRepresentation.material=t.material,e.convexPolyhedronRepresentation.material=e.material,t.convexPolyhedronRepresentation.collisionResponse=t.collisionResponse,e.convexPolyhedronRepresentation.collisionResponse=e.collisionResponse,this.convexConvex(t.convexPolyhedronRepresentation,e.convexPolyhedronRepresentation,i,n,r,s,o,a,t,e,u)}sphereBox(t,e,i,n,r,s,o,a,h,l,u){const c=this.v3pool,d=tr;i.vsub(n,Kn),e.getSideNormals(d,s);const p=t.radius;let f=!1;const m=ir,g=nr,v=rr;let y=null,x=0,w=0,b=0,A=null;for(let t=0,e=d.length;t!==e&&!1===f;t++){const e=Jn;e.copy(d[t]);const i=e.length();e.normalize();const n=Kn.dot(e);if(n<i+p&&n>0){const r=Zn,s=$n;r.copy(d[(t+1)%3]),s.copy(d[(t+2)%3]);const o=r.length(),a=s.length();r.normalize(),s.normalize();const h=Kn.dot(r),l=Kn.dot(s);if(h<o&&h>-o&&l<a&&l>-a){const t=Math.abs(n-i-p);if((null===A||t<A)&&(A=t,w=h,b=l,y=i,m.copy(e),g.copy(r),v.copy(s),x++,u))return!0}}}if(x){f=!0;const r=this.createContactEquation(o,a,t,e,h,l);m.scale(-p,r.ri),r.ni.copy(m),r.ni.negate(r.ni),m.scale(y,m),g.scale(w,g),m.vadd(g,m),v.scale(b,v),m.vadd(v,r.rj),r.ri.vadd(i,r.ri),r.ri.vsub(o.position,r.ri),r.rj.vadd(n,r.rj),r.rj.vsub(a.position,r.rj),this.result.push(r),this.createFrictionEquationsFromContact(r,this.frictionResult)}let T=c.get();const S=er;for(let r=0;2!==r&&!f;r++)for(let s=0;2!==s&&!f;s++)for(let c=0;2!==c&&!f;c++)if(T.set(0,0,0),r?T.vadd(d[0],T):T.vsub(d[0],T),s?T.vadd(d[1],T):T.vsub(d[1],T),c?T.vadd(d[2],T):T.vsub(d[2],T),n.vadd(T,S),S.vsub(i,S),S.lengthSquared()<p*p){if(u)return!0;f=!0;const r=this.createContactEquation(o,a,t,e,h,l);r.ri.copy(S),r.ri.normalize(),r.ni.copy(r.ri),r.ri.scale(p,r.ri),r.rj.copy(T),r.ri.vadd(i,r.ri),r.ri.vsub(o.position,r.ri),r.rj.vadd(n,r.rj),r.rj.vsub(a.position,r.rj),this.result.push(r),this.createFrictionEquationsFromContact(r,this.frictionResult)}c.release(T),T=null;const E=c.get(),M=c.get(),_=c.get(),C=c.get(),P=c.get(),R=d.length;for(let r=0;r!==R&&!f;r++)for(let s=0;s!==R&&!f;s++)if(r%3!=s%3){d[s].cross(d[r],E),E.normalize(),d[r].vadd(d[s],M),_.copy(i),_.vsub(M,_),_.vsub(n,_);const c=_.dot(E);E.scale(c,C);let m=0;for(;m===r%3||m===s%3;)m++;P.copy(i),P.vsub(C,P),P.vsub(M,P),P.vsub(n,P);const g=Math.abs(c),v=P.length();if(g<d[m].length()&&v<p){if(u)return!0;f=!0;const r=this.createContactEquation(o,a,t,e,h,l);M.vadd(C,r.rj),r.rj.copy(r.rj),P.negate(r.ni),r.ni.normalize(),r.ri.copy(r.rj),r.ri.vadd(n,r.ri),r.ri.vsub(i,r.ri),r.ri.normalize(),r.ri.scale(p,r.ri),r.ri.vadd(i,r.ri),r.ri.vsub(o.position,r.ri),r.rj.vadd(n,r.rj),r.rj.vsub(a.position,r.rj),this.result.push(r),this.createFrictionEquationsFromContact(r,this.frictionResult)}}c.release(E,M,_,C,P)}planeBox(t,e,i,n,r,s,o,a,h,l,u){return e.convexPolyhedronRepresentation.material=e.material,e.convexPolyhedronRepresentation.collisionResponse=e.collisionResponse,e.convexPolyhedronRepresentation.id=e.id,this.planeConvex(t,e.convexPolyhedronRepresentation,i,n,r,s,o,a,t,e,u)}convexConvex(t,e,i,n,r,s,o,a,h,l,u,c,d){const p=xr;if(!(i.distanceTo(n)>t.boundingSphereRadius+e.boundingSphereRadius)&&t.findSeparatingAxis(e,i,r,n,s,p,c,d)){const c=[],d=wr;t.clipAgainstHull(i,r,e,n,s,p,-100,100,c);let f=0;for(let r=0;r!==c.length;r++){if(u)return!0;const s=this.createContactEquation(o,a,t,e,h,l),m=s.ri,g=s.rj;p.negate(s.ni),c[r].normal.negate(d),d.scale(c[r].depth,d),c[r].point.vadd(d,m),g.copy(c[r].point),m.vsub(i,m),g.vsub(n,g),m.vadd(i,m),m.vsub(o.position,m),g.vadd(n,g),g.vsub(a.position,g),this.result.push(s),f++,this.enableFrictionReduction||this.createFrictionEquationsFromContact(s,this.frictionResult)}this.enableFrictionReduction&&f&&this.createFrictionFromAverage(f)}}sphereConvex(t,e,i,n,r,s,o,a,h,l,u){const c=this.v3pool;i.vsub(n,sr);const d=e.faceNormals,p=e.faces,f=e.vertices,m=t.radius;let g=!1;for(let r=0;r!==f.length;r++){const c=f[r],d=lr;s.vmult(c,d),n.vadd(d,d);const p=hr;if(d.vsub(i,p),p.lengthSquared()<m*m){if(u)return!0;g=!0;const r=this.createContactEquation(o,a,t,e,h,l);return r.ri.copy(p),r.ri.normalize(),r.ni.copy(r.ri),r.ri.scale(m,r.ri),d.vsub(n,r.rj),r.ri.vadd(i,r.ri),r.ri.vsub(o.position,r.ri),r.rj.vadd(n,r.rj),r.rj.vsub(a.position,r.rj),this.result.push(r),void this.createFrictionEquationsFromContact(r,this.frictionResult)}}for(let r=0,v=p.length;r!==v&&!1===g;r++){const v=d[r],y=p[r],x=ur;s.vmult(v,x);const w=cr;s.vmult(f[y[0]],w),w.vadd(n,w);const b=dr;x.scale(-m,b),i.vadd(b,b);const A=pr;b.vsub(w,A);const T=A.dot(x),S=fr;if(i.vsub(w,S),T<0&&S.dot(x)>0){const r=[];for(let t=0,e=y.length;t!==e;t++){const e=c.get();s.vmult(f[y[t]],e),n.vadd(e,e),r.push(e)}if(Qn(r,x,i)){if(u)return!0;g=!0;const s=this.createContactEquation(o,a,t,e,h,l);x.scale(-m,s.ri),x.negate(s.ni);const d=c.get();x.scale(-T,d);const p=c.get();x.scale(-m,p),i.vsub(n,s.rj),s.rj.vadd(p,s.rj),s.rj.vadd(d,s.rj),s.rj.vadd(n,s.rj),s.rj.vsub(a.position,s.rj),s.ri.vadd(i,s.ri),s.ri.vsub(o.position,s.ri),c.release(d),c.release(p),this.result.push(s),this.createFrictionEquationsFromContact(s,this.frictionResult);for(let t=0,e=r.length;t!==e;t++)c.release(r[t]);return}for(let d=0;d!==y.length;d++){const p=c.get(),g=c.get();s.vmult(f[y[(d+1)%y.length]],p),s.vmult(f[y[(d+2)%y.length]],g),n.vadd(p,p),n.vadd(g,g);const v=or;g.vsub(p,v);const x=ar;v.unit(x);const w=c.get(),b=c.get();i.vsub(p,b);const A=b.dot(x);x.scale(A,w),w.vadd(p,w);const T=c.get();if(w.vsub(i,T),A>0&&A*A<v.lengthSquared()&&T.lengthSquared()<m*m){if(u)return!0;const s=this.createContactEquation(o,a,t,e,h,l);w.vsub(n,s.rj),w.vsub(i,s.ni),s.ni.normalize(),s.ni.scale(m,s.ri),s.rj.vadd(n,s.rj),s.rj.vsub(a.position,s.rj),s.ri.vadd(i,s.ri),s.ri.vsub(o.position,s.ri),this.result.push(s),this.createFrictionEquationsFromContact(s,this.frictionResult);for(let t=0,e=r.length;t!==e;t++)c.release(r[t]);return c.release(p),c.release(g),c.release(w),c.release(T),void c.release(b)}c.release(p),c.release(g),c.release(w),c.release(T),c.release(b)}for(let t=0,e=r.length;t!==e;t++)c.release(r[t])}}}planeConvex(t,e,i,n,r,s,o,a,h,l,u){const c=mr,d=gr;d.set(0,0,1),r.vmult(d,d);let p=0;const f=vr;for(let r=0;r!==e.vertices.length;r++){c.copy(e.vertices[r]),s.vmult(c,c),n.vadd(c,c),c.vsub(i,f);if(d.dot(f)<=0){if(u)return!0;const r=this.createContactEquation(o,a,t,e,h,l),s=yr;d.scale(d.dot(f),s),c.vsub(s,s),s.vsub(i,r.ri),r.ni.copy(d),c.vsub(n,r.rj),r.ri.vadd(i,r.ri),r.ri.vsub(o.position,r.ri),r.rj.vadd(n,r.rj),r.rj.vsub(a.position,r.rj),this.result.push(r),p++,this.enableFrictionReduction||this.createFrictionEquationsFromContact(r,this.frictionResult)}}this.enableFrictionReduction&&p&&this.createFrictionFromAverage(p)}boxConvex(t,e,i,n,r,s,o,a,h,l,u){return t.convexPolyhedronRepresentation.material=t.material,t.convexPolyhedronRepresentation.collisionResponse=t.collisionResponse,this.convexConvex(t.convexPolyhedronRepresentation,e,i,n,r,s,o,a,t,e,u)}sphereHeightfield(t,e,i,n,r,s,o,a,h,l,u){const c=e.data,d=t.radius,p=e.elementSize,f=Br,m=Dr;w.pointToLocalFrame(n,s,i,m);let g=Math.floor((m.x-d)/p)-1,v=Math.ceil((m.x+d)/p)+1,y=Math.floor((m.y-d)/p)-1,x=Math.ceil((m.y+d)/p)+1;if(v<0||x<0||g>c.length||y>c[0].length)return;g<0&&(g=0),v<0&&(v=0),y<0&&(y=0),x<0&&(x=0),g>=c.length&&(g=c.length-1),v>=c.length&&(v=c.length-1),x>=c[0].length&&(x=c[0].length-1),y>=c[0].length&&(y=c[0].length-1);const b=[];e.getRectMinMax(g,y,v,x,b);const A=b[0],T=b[1];if(m.z-d>T||m.z+d<A)return;const S=this.result;for(let h=g;h<v;h++)for(let l=y;l<x;l++){const c=S.length;let d=!1;if(e.getConvexTrianglePillar(h,l,!1),w.pointToWorldFrame(n,s,e.pillarOffset,f),i.distanceTo(f)<e.pillarConvex.boundingSphereRadius+t.boundingSphereRadius&&(d=this.sphereConvex(t,e.pillarConvex,i,f,r,s,o,a,t,e,u)),u&&d)return!0;if(e.getConvexTrianglePillar(h,l,!0),w.pointToWorldFrame(n,s,e.pillarOffset,f),i.distanceTo(f)<e.pillarConvex.boundingSphereRadius+t.boundingSphereRadius&&(d=this.sphereConvex(t,e.pillarConvex,i,f,r,s,o,a,t,e,u)),u&&d)return!0;if(S.length-c>2)return}}boxHeightfield(t,e,i,n,r,s,o,a,h,l,u){return t.convexPolyhedronRepresentation.material=t.material,t.convexPolyhedronRepresentation.collisionResponse=t.collisionResponse,this.convexHeightfield(t.convexPolyhedronRepresentation,e,i,n,r,s,o,a,t,e,u)}convexHeightfield(t,e,i,n,r,s,o,a,h,l,u){const c=e.data,d=e.elementSize,p=t.boundingSphereRadius,f=Lr,m=Or,g=Rr;w.pointToLocalFrame(n,s,i,g);let v=Math.floor((g.x-p)/d)-1,y=Math.ceil((g.x+p)/d)+1,x=Math.floor((g.y-p)/d)-1,b=Math.ceil((g.y+p)/d)+1;if(y<0||b<0||v>c.length||x>c[0].length)return;v<0&&(v=0),y<0&&(y=0),x<0&&(x=0),b<0&&(b=0),v>=c.length&&(v=c.length-1),y>=c.length&&(y=c.length-1),b>=c[0].length&&(b=c[0].length-1),x>=c[0].length&&(x=c[0].length-1);const A=[];e.getRectMinMax(v,x,y,b,A);const T=A[0],S=A[1];if(!(g.z-p>S||g.z+p<T))for(let h=v;h<y;h++)for(let l=x;l<b;l++){let c=!1;if(e.getConvexTrianglePillar(h,l,!1),w.pointToWorldFrame(n,s,e.pillarOffset,f),i.distanceTo(f)<e.pillarConvex.boundingSphereRadius+t.boundingSphereRadius&&(c=this.convexConvex(t,e.pillarConvex,i,f,r,s,o,a,null,null,u,m,null)),u&&c)return!0;if(e.getConvexTrianglePillar(h,l,!0),w.pointToWorldFrame(n,s,e.pillarOffset,f),i.distanceTo(f)<e.pillarConvex.boundingSphereRadius+t.boundingSphereRadius&&(c=this.convexConvex(t,e.pillarConvex,i,f,r,s,o,a,null,null,u,m,null)),u&&c)return!0}}sphereParticle(t,e,i,n,r,s,o,a,h,l,u){const c=Sr;c.set(0,0,1),n.vsub(i,c);if(c.lengthSquared()<=t.radius*t.radius){if(u)return!0;const i=this.createContactEquation(a,o,e,t,h,l);c.normalize(),i.rj.copy(c),i.rj.scale(t.radius,i.rj),i.ni.copy(c),i.ni.negate(i.ni),i.ri.set(0,0,0),this.result.push(i),this.createFrictionEquationsFromContact(i,this.frictionResult)}}planeParticle(t,e,i,n,r,s,o,a,h,l,u){const c=br;c.set(0,0,1),o.quaternion.vmult(c,c);const d=Ar;n.vsub(o.position,d);if(c.dot(d)<=0){if(u)return!0;const i=this.createContactEquation(a,o,e,t,h,l);i.ni.copy(c),i.ni.negate(i.ni),i.ri.set(0,0,0);const r=Tr;c.scale(c.dot(n),r),n.vsub(r,r),i.rj.copy(r),this.result.push(i),this.createFrictionEquationsFromContact(i,this.frictionResult)}}boxParticle(t,e,i,n,r,s,o,a,h,l,u){return t.convexPolyhedronRepresentation.material=t.material,t.convexPolyhedronRepresentation.collisionResponse=t.collisionResponse,this.convexParticle(t.convexPolyhedronRepresentation,e,i,n,r,s,o,a,t,e,u)}convexParticle(t,e,i,n,r,s,o,a,h,l,u){let c=-1;const d=_r,p=Pr;let f=null;const m=Mr;if(m.copy(n),m.vsub(i,m),r.conjugate(Er),Er.vmult(m,m),t.pointIsInside(m)){t.worldVerticesNeedsUpdate&&t.computeWorldVertices(i,r),t.worldFaceNormalsNeedsUpdate&&t.computeWorldFaceNormals(r);for(let e=0,i=t.faces.length;e!==i;e++){const i=[t.worldVertices[t.faces[e][0]]],r=t.worldFaceNormals[e];n.vsub(i[0],Cr);const s=-r.dot(Cr);if(null===f||Math.abs(s)<Math.abs(f)){if(u)return!0;f=s,c=e,d.copy(r)}}if(-1!==c){const r=this.createContactEquation(a,o,e,t,h,l);d.scale(f,p),p.vadd(n,p),p.vsub(i,p),r.rj.copy(p),d.negate(r.ni),r.ri.set(0,0,0);const s=r.ri,u=r.rj;s.vadd(n,s),s.vsub(a.position,s),u.vadd(i,u),u.vsub(o.position,u),this.result.push(r),this.createFrictionEquationsFromContact(r,this.frictionResult)}}}heightfieldCylinder(t,e,i,n,r,s,o,a,h,l,u){return this.convexHeightfield(e,t,n,i,s,r,a,o,h,l,u)}particleCylinder(t,e,i,n,r,s,o,a,h,l,u){return this.convexParticle(e,t,n,i,s,r,a,o,h,l,u)}sphereTrimesh(t,e,i,n,r,s,o,a,h,l,u){const c=Dn,d=Bn,p=In,f=Fn,m=kn,g=Nn,v=Hn,y=On,x=Rn,b=Gn;w.pointToLocalFrame(n,s,i,m);const A=t.radius;v.lowerBound.set(m.x-A,m.y-A,m.z-A),v.upperBound.set(m.x+A,m.y+A,m.z+A),e.getTrianglesInAABB(v,b);const T=Ln,S=t.radius*t.radius;for(let r=0;r<b.length;r++)for(let c=0;c<3;c++)if(e.getVertex(e.indices[3*b[r]+c],T),T.vsub(m,x),x.lengthSquared()<=S){if(y.copy(T),w.pointToWorldFrame(n,s,y,T),T.vsub(i,x),u)return!0;let r=this.createContactEquation(o,a,t,e,h,l);r.ni.copy(x),r.ni.normalize(),r.ri.copy(r.ni),r.ri.scale(t.radius,r.ri),r.ri.vadd(i,r.ri),r.ri.vsub(o.position,r.ri),r.rj.copy(T),r.rj.vsub(a.position,r.rj),this.result.push(r),this.createFrictionEquationsFromContact(r,this.frictionResult)}for(let r=0;r<b.length;r++)for(let v=0;v<3;v++){e.getVertex(e.indices[3*b[r]+v],c),e.getVertex(e.indices[3*b[r]+(v+1)%3],d),d.vsub(c,p),m.vsub(d,g);const y=g.dot(p);m.vsub(c,g);let x=g.dot(p);if(x>0&&y<0){m.vsub(c,g),f.copy(p),f.normalize(),x=g.dot(f),f.scale(x,g),g.vadd(c,g);if(g.distanceTo(m)<t.radius){if(u)return!0;const r=this.createContactEquation(o,a,t,e,h,l);g.vsub(m,r.ni),r.ni.normalize(),r.ni.scale(t.radius,r.ri),r.ri.vadd(i,r.ri),r.ri.vsub(o.position,r.ri),w.pointToWorldFrame(n,s,g,g),g.vsub(a.position,r.rj),w.vectorToWorldFrame(s,r.ni,r.ni),w.vectorToWorldFrame(s,r.ri,r.ri),this.result.push(r),this.createFrictionEquationsFromContact(r,this.frictionResult)}}}const E=zn,M=Un,_=Vn,C=Pn;for(let r=0,c=b.length;r!==c;r++){e.getTriangleVertices(b[r],E,M,_),e.getNormal(b[r],C),m.vsub(E,g);let c=g.dot(C);if(C.scale(c,g),m.vsub(g,g),c=g.distanceTo(m),lt.pointInTriangle(g,E,M,_)&&c<t.radius){if(u)return!0;let r=this.createContactEquation(o,a,t,e,h,l);g.vsub(m,r.ni),r.ni.normalize(),r.ni.scale(t.radius,r.ri),r.ri.vadd(i,r.ri),r.ri.vsub(o.position,r.ri),w.pointToWorldFrame(n,s,g,g),g.vsub(a.position,r.rj),w.vectorToWorldFrame(s,r.ni,r.ni),w.vectorToWorldFrame(s,r.ri,r.ri),this.result.push(r),this.createFrictionEquationsFromContact(r,this.frictionResult)}}b.length=0}planeTrimesh(t,e,i,n,r,s,a,h,l,u,c){const d=new o,p=Mn;p.set(0,0,1),r.vmult(p,p);for(let r=0;r<e.vertices.length/3;r++){e.getVertex(r,d);const f=new o;f.copy(d),w.pointToWorldFrame(n,s,f,d);const m=_n;d.vsub(i,m);if(p.dot(m)<=0){if(c)return!0;const i=this.createContactEquation(a,h,t,e,l,u);i.ni.copy(p);const n=Cn;p.scale(m.dot(p),n),d.vsub(n,n),i.ri.copy(n),i.ri.vsub(a.position,i.ri),i.rj.copy(d),i.rj.vsub(h.position,i.rj),this.result.push(i),this.createFrictionEquationsFromContact(i,this.frictionResult)}}}}const xn=new o,wn=new o,bn=new o,An=new o,Tn=new o,Sn=new m,En=new m,Mn=new o,_n=new o,Cn=new o,Pn=new o,Rn=new o;new o;const Ln=new o,On=new o,Dn=new o,Bn=new o,In=new o,Fn=new o,kn=new o,Nn=new o,zn=new o,Un=new o,Vn=new o,Hn=new u,Gn=[],Wn=new o,Yn=new o,Xn=new o,jn=new o,qn=new o;function Qn(t,e,i){let n=null;const r=t.length;for(let s=0;s!==r;s++){const o=t[s],a=Xn;t[(s+1)%r].vsub(o,a);const h=jn;a.cross(e,h);const l=qn;i.vsub(o,l);const u=h.dot(l);if(!(null===n||u>0&&!0===n||u<=0&&!1===n))return!1;null===n&&(n=u>0)}return!0}const Kn=new o,Jn=new o,Zn=new o,$n=new o,tr=[new o,new o,new o,new o,new o,new o],er=new o,ir=new o,nr=new o,rr=new o,sr=new o,or=new o,ar=new o,hr=new o,lr=new o,ur=new o,cr=new o,dr=new o,pr=new o,fr=new o;new o,new o;const mr=new o,gr=new o,vr=new o,yr=new o,xr=new o,wr=new o,br=new o,Ar=new o,Tr=new o,Sr=new o,Er=new m,Mr=new o;new o;const _r=new o,Cr=new o,Pr=new o,Rr=new o,Lr=new o,Or=[0],Dr=new o,Br=new o;class Ir{constructor(){this.current=[],this.previous=[]}getKey(t,e){if(e<t){const i=e;e=t,t=i}return t<<16|e}set(t,e){const i=this.getKey(t,e),n=this.current;let r=0;for(;i>n[r];)r++;if(i!==n[r]){for(let t=n.length-1;t>=r;t--)n[t+1]=n[t];n[r]=i}}tick(){const t=this.current;this.current=this.previous,this.previous=t,this.current.length=0}getDiff(t,e){const i=this.current,n=this.previous,r=i.length,s=n.length;let o=0;for(let e=0;e<r;e++){let r=!1;const s=i[e];for(;s>n[o];)o++;r=s===n[o],r||Fr(t,s)}o=0;for(let t=0;t<s;t++){let r=!1;const s=n[t];for(;s>i[o];)o++;r=i[o]===s,r||Fr(e,s)}}}function Fr(t,e){t.push((4294901760&e)>>16,65535&e)}const kr=(t,e)=>t<e?`${t}-${e}`:`${e}-${t}`;class Nr{constructor(){this.data={keys:[]}}get(t,e){const i=kr(t,e);return this.data[i]}set(t,e,i){const n=kr(t,e);this.get(t,e)||this.data.keys.push(n),this.data[n]=i}delete(t,e){const i=kr(t,e),n=this.data.keys.indexOf(i);-1!==n&&this.data.keys.splice(n,1),delete this.data[i]}reset(){const t=this.data,e=t.keys;for(;e.length>0;){delete t[e.pop()]}}}class zr extends f{constructor(t){void 0===t&&(t={}),super(),this.dt=-1,this.allowSleep=!!t.allowSleep,this.contacts=[],this.frictionEquations=[],this.quatNormalizeSkip=void 0!==t.quatNormalizeSkip?t.quatNormalizeSkip:0,this.quatNormalizeFast=void 0!==t.quatNormalizeFast&&t.quatNormalizeFast,this.time=0,this.stepnumber=0,this.default_dt=1/60,this.nextId=0,this.gravity=new o,t.gravity&&this.gravity.copy(t.gravity),this.broadphase=void 0!==t.broadphase?t.broadphase:new $,this.bodies=[],this.hasActiveBodies=!1,this.solver=void 0!==t.solver?t.solver:new tn,this.constraints=[],this.narrowphase=new yn(this),this.collisionMatrix=new p,this.collisionMatrixPrevious=new p,this.bodyOverlapKeeper=new Ir,this.shapeOverlapKeeper=new Ir,this.contactmaterials=[],this.contactMaterialTable=new Nr,this.defaultMaterial=new Ae("default"),this.defaultContactMaterial=new be(this.defaultMaterial,this.defaultMaterial,{friction:.3,restitution:0}),this.doProfiling=!1,this.profile={solve:0,makeContactConstraints:0,broadphase:0,integrate:0,narrowphase:0},this.accumulator=0,this.subsystems=[],this.addBodyEvent={type:"addBody",body:null},this.removeBodyEvent={type:"removeBody",body:null},this.idToBodyMap={},this.broadphase.setWorld(this)}getContactMaterial(t,e){return this.contactMaterialTable.get(t.id,e.id)}collisionMatrixTick(){const t=this.collisionMatrixPrevious;this.collisionMatrixPrevious=this.collisionMatrix,this.collisionMatrix=t,this.collisionMatrix.reset(),this.bodyOverlapKeeper.tick(),this.shapeOverlapKeeper.tick()}addConstraint(t){this.constraints.push(t)}removeConstraint(t){const e=this.constraints.indexOf(t);-1!==e&&this.constraints.splice(e,1)}rayTest(t,e,i){i instanceof tt?this.raycastClosest(t,e,{skipBackfaces:!0},i):this.raycastAll(t,e,{skipBackfaces:!0},i)}raycastAll(t,e,i,n){return void 0===i&&(i={}),i.mode=lt.ALL,i.from=t,i.to=e,i.callback=n,Ur.intersectWorld(this,i)}raycastAny(t,e,i,n){return void 0===i&&(i={}),i.mode=lt.ANY,i.from=t,i.to=e,i.result=n,Ur.intersectWorld(this,i)}raycastClosest(t,e,i,n){return void 0===i&&(i={}),i.mode=lt.CLOSEST,i.from=t,i.to=e,i.result=n,Ur.intersectWorld(this,i)}addBody(t){this.bodies.includes(t)||(t.index=this.bodies.length,this.bodies.push(t),t.world=this,t.initPosition.copy(t.position),t.initVelocity.copy(t.velocity),t.timeLastSleepy=this.time,t instanceof O&&(t.initAngularVelocity.copy(t.angularVelocity),t.initQuaternion.copy(t.quaternion)),this.collisionMatrix.setNumObjects(this.bodies.length),this.addBodyEvent.body=t,this.idToBodyMap[t.id]=t,this.dispatchEvent(this.addBodyEvent))}removeBody(t){t.world=null;const e=this.bodies.length-1,i=this.bodies,n=i.indexOf(t);if(-1!==n){i.splice(n,1);for(let t=0;t!==i.length;t++)i[t].index=t;this.collisionMatrix.setNumObjects(e),this.removeBodyEvent.body=t,delete this.idToBodyMap[t.id],this.dispatchEvent(this.removeBodyEvent)}}getBodyById(t){return this.idToBodyMap[t]}getShapeById(t){const e=this.bodies;for(let i=0;i<e.length;i++){const n=e[i].shapes;for(let e=0;e<n.length;e++){const i=n[e];if(i.id===t)return i}}return null}addContactMaterial(t){this.contactmaterials.push(t),this.contactMaterialTable.set(t.materials[0].id,t.materials[1].id,t)}removeContactMaterial(t){const e=this.contactmaterials.indexOf(t);-1!==e&&(this.contactmaterials.splice(e,1),this.contactMaterialTable.delete(t.materials[0].id,t.materials[1].id))}fixedStep(t,e){void 0===t&&(t=1/60),void 0===e&&(e=10);const i=Vr.now()/1e3;if(this.lastCallTime){const n=i-this.lastCallTime;this.step(t,n,e)}else this.step(t,void 0,e);this.lastCallTime=i}step(t,e,i){if(void 0===i&&(i=10),void 0===e)this.internalStep(t),this.time+=t;else{this.accumulator+=e;const n=Vr.now();let r=0;for(;this.accumulator>=t&&r<i&&(this.internalStep(t),this.accumulator-=t,r++,!(Vr.now()-n>1e3*t)););this.accumulator=this.accumulator%t;const s=this.accumulator/t;for(let t=0;t!==this.bodies.length;t++){const e=this.bodies[t];e.previousPosition.lerp(e.position,s,e.interpolatedPosition),e.previousQuaternion.slerp(e.quaternion,s,e.interpolatedQuaternion),e.previousQuaternion.normalize()}this.time+=e}}internalStep(t){this.dt=t;const e=this.contacts,i=jr,n=qr,r=this.bodies.length,s=this.bodies,o=this.solver,a=this.gravity,h=this.doProfiling,l=this.profile,u=O.DYNAMIC;let c=-1/0;const d=this.constraints,p=Xr;a.length();const f=a.x,m=a.y,g=a.z;let v=0;for(h&&(c=Vr.now()),v=0;v!==r;v++){const t=s[v];if(t.type===u){const e=t.force,i=t.mass;e.x+=i*f,e.y+=i*m,e.z+=i*g}}for(let t=0,e=this.subsystems.length;t!==e;t++)this.subsystems[t].update();h&&(c=Vr.now()),i.length=0,n.length=0,this.broadphase.collisionPairs(this,i,n),h&&(l.broadphase=Vr.now()-c);let y=d.length;for(v=0;v!==y;v++){const t=d[v];if(!t.collideConnected)for(let e=i.length-1;e>=0;e-=1)(t.bodyA===i[e]&&t.bodyB===n[e]||t.bodyB===i[e]&&t.bodyA===n[e])&&(i.splice(e,1),n.splice(e,1))}this.collisionMatrixTick(),h&&(c=Vr.now());const x=Yr,w=e.length;for(v=0;v!==w;v++)x.push(e[v]);e.length=0;const b=this.frictionEquations.length;for(v=0;v!==b;v++)p.push(this.frictionEquations[v]);for(this.frictionEquations.length=0,this.narrowphase.getContacts(i,n,this,e,x,this.frictionEquations,p),h&&(l.narrowphase=Vr.now()-c),h&&(c=Vr.now()),v=0;v<this.frictionEquations.length;v++)o.addEquation(this.frictionEquations[v]);const A=e.length;for(let t=0;t!==A;t++){const i=e[t],n=i.bi,r=i.bj,s=i.si,a=i.sj;let h;if(h=n.material&&r.material&&this.getContactMaterial(n.material,r.material)||this.defaultContactMaterial,h.friction,n.material&&r.material&&(n.material.friction>=0&&r.material.friction>=0&&(n.material.friction,r.material.friction),n.material.restitution>=0&&r.material.restitution>=0&&(i.restitution=n.material.restitution*r.material.restitution)),o.addEquation(i),n.allowSleep&&n.type===O.DYNAMIC&&n.sleepState===O.SLEEPING&&r.sleepState===O.AWAKE&&r.type!==O.STATIC){r.velocity.lengthSquared()+r.angularVelocity.lengthSquared()>=2*r.sleepSpeedLimit**2&&(n.wakeUpAfterNarrowphase=!0)}if(r.allowSleep&&r.type===O.DYNAMIC&&r.sleepState===O.SLEEPING&&n.sleepState===O.AWAKE&&n.type!==O.STATIC){n.velocity.lengthSquared()+n.angularVelocity.lengthSquared()>=2*n.sleepSpeedLimit**2&&(r.wakeUpAfterNarrowphase=!0)}this.collisionMatrix.set(n,r,!0),this.collisionMatrixPrevious.get(n,r)||(Wr.body=r,Wr.contact=i,n.dispatchEvent(Wr),Wr.body=n,r.dispatchEvent(Wr)),this.bodyOverlapKeeper.set(n.id,r.id),this.shapeOverlapKeeper.set(s.id,a.id)}for(this.emitContactEvents(),h&&(l.makeContactConstraints=Vr.now()-c,c=Vr.now()),v=0;v!==r;v++){const t=s[v];t.wakeUpAfterNarrowphase&&(t.wakeUp(),t.wakeUpAfterNarrowphase=!1)}for(y=d.length,v=0;v!==y;v++){const t=d[v];t.update();for(let e=0,i=t.equations.length;e!==i;e++){const i=t.equations[e];o.addEquation(i)}}o.solve(t,this),h&&(l.solve=Vr.now()-c),o.removeAllEquations();const T=Math.pow;for(v=0;v!==r;v++){const e=s[v];if(e.type&u){const i=T(1-e.linearDamping,t),n=e.velocity;n.scale(i,n);const r=e.angularVelocity;if(r){const i=T(1-e.angularDamping,t);r.scale(i,r)}}}this.dispatchEvent(Gr),h&&(c=Vr.now());const S=this.stepnumber%(this.quatNormalizeSkip+1)==0,E=this.quatNormalizeFast;for(v=0;v!==r;v++)s[v].integrate(t,S,E);this.clearForces(),this.broadphase.dirty=!0,h&&(l.integrate=Vr.now()-c),this.stepnumber+=1,this.dispatchEvent(Hr);let M=!0;if(this.allowSleep)for(M=!1,v=0;v!==r;v++){const t=s[v];t.sleepTick(this.time),t.sleepState!==O.SLEEPING&&(M=!0)}this.hasActiveBodies=M}emitContactEvents(){const t=this.hasAnyEventListener("beginContact"),e=this.hasAnyEventListener("endContact");if((t||e)&&this.bodyOverlapKeeper.getDiff(Qr,Kr),t){for(let t=0,e=Qr.length;t<e;t+=2)Jr.bodyA=this.getBodyById(Qr[t]),Jr.bodyB=this.getBodyById(Qr[t+1]),this.dispatchEvent(Jr);Jr.bodyA=Jr.bodyB=null}if(e){for(let t=0,e=Kr.length;t<e;t+=2)Zr.bodyA=this.getBodyById(Kr[t]),Zr.bodyB=this.getBodyById(Kr[t+1]),this.dispatchEvent(Zr);Zr.bodyA=Zr.bodyB=null}Qr.length=Kr.length=0;const i=this.hasAnyEventListener("beginShapeContact"),n=this.hasAnyEventListener("endShapeContact");if((i||n)&&this.shapeOverlapKeeper.getDiff(Qr,Kr),i){for(let t=0,e=Qr.length;t<e;t+=2){const e=this.getShapeById(Qr[t]),i=this.getShapeById(Qr[t+1]);$r.shapeA=e,$r.shapeB=i,e&&($r.bodyA=e.body),i&&($r.bodyB=i.body),this.dispatchEvent($r)}$r.bodyA=$r.bodyB=$r.shapeA=$r.shapeB=null}if(n){for(let t=0,e=Kr.length;t<e;t+=2){const e=this.getShapeById(Kr[t]),i=this.getShapeById(Kr[t+1]);ts.shapeA=e,ts.shapeB=i,e&&(ts.bodyA=e.body),i&&(ts.bodyB=i.body),this.dispatchEvent(ts)}ts.bodyA=ts.bodyB=ts.shapeA=ts.shapeB=null}}clearForces(){const t=this.bodies,e=t.length;for(let i=0;i!==e;i++){const e=t[i];e.force,e.torque,e.force.set(0,0,0),e.torque.set(0,0,0)}}}new u;const Ur=new lt,Vr=globalThis.performance||{};if(!Vr.now){let t=Date.now();Vr.timing&&Vr.timing.navigationStart&&(t=Vr.timing.navigationStart),Vr.now=()=>Date.now()-t}new o;const Hr={type:"postStep"},Gr={type:"preStep"},Wr={type:O.COLLIDE_EVENT_NAME,body:null,contact:null},Yr=[],Xr=[],jr=[],qr=[],Qr=[],Kr=[],Jr={type:"beginContact",bodyA:null,bodyB:null},Zr={type:"endContact",bodyA:null,bodyB:null},$r={type:"beginShapeContact",bodyA:null,bodyB:null,shapeA:null,shapeB:null},ts={type:"endShapeContact",bodyA:null,bodyB:null,shapeA:null,shapeB:null}},function(t,e,i){"use strict";var n=i(1),r=i(24),s=i(2),o=i(7),a=i(0),h=i(45),l=i(27);function u(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function c(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var d=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,c;return e=t,c=[{key:"init",value:function(){if(this.player=null,this.enemy=null,this.resizeableObjects=[],this.rayableList=[],this.coinCollected=0,this.bonusCollected=0,!this.inited){this.inited=!0,r.a.init(),this.kontakMaterials={slippery:new s.Material("slippery"),hard:new s.Material("hard"),normal:new s.Material("normal")};var t=new s.ContactMaterial(this.kontakMaterials.normal,this.kontakMaterials.slippery,{friction:.001,restitution:.2,contactEquationStiffness:1e8,contactEquationRelaxation:10,frictionEquationStiffness:1e8,frictionEquationRegularization:10});o.a.world.addContactMaterial(t);var e=new s.ContactMaterial(this.kontakMaterials.normal,this.kontakMaterials.hard,{friction:1,restitution:0});o.a.world.addContactMaterial(e);var i=h.nameList;l.a.shuffleArray(i);for(var n=0;n<100;n++)this.enemySettings.push({name:i[n],flagIndex:a.MathUtils.randInt(0,240)})}}},{key:"setDelta",value:function(t){n.a.deltaMultiplier=t}},{key:"startLevel",value:function(){}}],(i=null)&&u(e.prototype,i),c&&u(e,c),Object.defineProperty(e,"prototype",{writable:!1}),t}();c(d,"sketchMutliplier",.01),c(d,"levelMultiplier",1),c(d,"modelMultiplier",1),c(d,"resizeableObjects",[]),c(d,"inited",!1),c(d,"colTypes",{PLAYER:2,PLATFORM:4,OBSTACLE:8,ENDWALL:16,TRIGGER:32,COLLECTIBLE:64,WATER:128}),c(d,"player",void 0),c(d,"enemy",void 0),c(d,"coinCollected",0),c(d,"bonusCollected",0),c(d,"diffBetweenPlatforms",-10),c(d,"enemySettings",[]),c(d,"rayableList",[]),e.a=d},function(t,e,i){"use strict";i.d(e,"a",(function(){return u}));var n=i(1),r=(i(8),i(25)),s=(i(22),i(23),i(33)),o=i(27),a=i(15),h=i(5);function l(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var u=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,u;return e=t,u=[{key:"init",value:function(){this.GameOverStates={NONE:-1,WIN:0,TIME_OUT:1,GAME_OVER:2},this.runCount=0,this.gameOverState=this.GameOverStates.NONE,this.gameEnded=!1,this.GameObjects=[],this.allGameObjects=[],app.addToGame=this.addToGame,this.currentState=null,this.stateManager=s.a,this.initManagers()}},{key:"initManagers",value:function(){r.a.init(),h.a.init(),a.a.init()}},{key:"startState",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.setState(this.stateManager.IntroState,t)}},{key:"setState",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(t!==this.currentState||e)&&(this.currentState&&this.currentState.onExit(),this.currentState=t,this.currentState.onEnter())}},{key:"calculateScore",value:function(t,e,i){var n=e*(300-i)*t;return n=Math.round(n)}},{key:"update",value:function(t){this.currentState&&this.currentState.onUpdate(t);for(var e=0;e<this.GameObjects.length;e++)this.GameObjects[e].update(t);n.a.main.isTest||n.a.camera&&n.a.camera.update(t/n.a.deltaMultiplier),a.a.update(t)}},{key:"setDeltaMultiplier",value:function(t){n.a.deltaMultiplier=t}},{key:"addToGame",value:function(e){var i=e.obj,r=e.parent,s=void 0===r?n.a.threeScene:r,o=e.update,a=void 0!==o&&o,h=e.recycle,l=void 0===h||h;s.add(i),a&&t.GameObjects.push(i),l?t.allGameObjects.push(i):i.noRecycle=!0}},{key:"addToUpdateables",value:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.recycle,r=void 0===n||n;t.GameObjects.push(e),r||(e.noRecycle=!0)}},{key:"removeFromUpdate",value:function(t){o.a.removeItemFromArray(this.GameObjects,t)}},{key:"timeOutCallback",value:function(){this.gameEnded||(t.gameEnded=!0,this.gameOverState=this.GameOverStates.TIME_OUT,t.setState(t.stateManager.EndingState))}},{key:"levelWinCallback",value:function(){this.gameEnded||(t.gameEnded=!0,this.gameOverState=this.GameOverStates.WIN,t.setState(t.stateManager.EndingState))}},{key:"levelFailedCallback",value:function(){this.gameEnded||(t.gameEnded=!0,app.playSfx("Fail"),this.gameOverState=this.GameOverStates.GAME_OVER,t.setState(t.stateManager.EndingState))}},{key:"checkGameFinishedEvents",value:function(){this.gameOverState===this.GameOverStates.WIN?n.a.gameTotallyFinished=!0:this.runCount-1>=n.a.data.maxRetryLimit&&(this.gameOverState,this.GameOverStates.TIME_OUT,n.a.gameTotallyFinished=!0)}}],(i=null)&&l(e.prototype,i),u&&l(e,u),Object.defineProperty(e,"prototype",{writable:!1}),t}()},function(t,e,i){"use strict";i.d(e,"a",(function(){return v}));var n=i(4),r=i(0),s=i(7),o=i(1),a=i(8),h=i(30),l=i(36),u=i(3),c=i(29),d=i(15);function p(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return f(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return f(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==i.return||i.return()}finally{if(a)throw s}}}}function f(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function m(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function g(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var v=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,f,g;return e=t,g=[{key:"init",value:function(){for(var t=1;t<=o.a.data.levelCount;t++){var e=t,n=void 0;try{n=i(60)("./level"+e).default}catch(t){n=new h.default(e)}n.orgIndex=t,this.levelList.push(n)}this.levelOrder=[];for(var r=o.a.data.selectedLevel1%this.levelList.length,s=0;s<this.levelList.length;s++){var a=this.levelList[r];this.levelOrder.push(a),a.indexNo=r,r=(r+1)%this.levelList.length}this.resetCount=0,this.currentLevelIndex=0,this.levelIndex=o.a.playerData.level,this.currentLevel=this.levelOrder[this.currentLevelIndex],this.currentLevel.init(),this.afterLevelLoaded(this.currentLevel)}},{key:"afterLevelLoaded",value:function(t){u.a.enemy&&(new l.a).setCompetitors([u.a.player,u.a.enemy]),H5SDK.getPlatform().notifyLevelStart(this.levelIndex+1)}},{key:"goPrevLevel",value:function(t){if(this.currentLevelIndex--,this.currentLevelIndex<0){if(!t)return;this.currentLevelIndex=this.levelOrder.length-1}this.levelIndex--,this.reset(),n.a.gameOverState=n.a.GameOverStates.NONE,this.currentLevel=this.levelOrder[this.currentLevelIndex],this.currentLevel.init(),this.afterLevelLoaded(this.currentLevel),setTimeout((function(){a.a.init(),n.a.startState(!0)}),10)}},{key:"goNextLevel",value:function(t){if(this.currentLevelIndex++,this.currentLevelIndex>=this.levelOrder.length){if(!t)return;this.currentLevelIndex=1}this.levelIndex++,o.a.playerData.level=this.levelIndex,o.a.saveGame(),this.initializeLevel()}},{key:"initializeLevel",value:function(){var t=this;this.reset(),n.a.gameEnded=!1,n.a.gameOverState=n.a.GameOverStates.NONE;var e=o.a.data.selectedLevel1+this.currentLevelIndex;e%=this.levelOrder.length,e+=1;var i=!1,r=!1;o.a.eventEmitter.once("phaserReady",(function(){i=!0,r&&(r=!1,i=!1,a.a.init(),n.a.startState(!0))})),c.a.loadModels([{name:"level"+e,path:"assets/modelsglb/level"+e+"/scene.glb"}],(function(){t.currentLevel=t.levelOrder[t.currentLevelIndex],t.currentLevel.init(),t.afterLevelLoaded(t.currentLevel),r=!0,i&&(i=!1,r=!1,a.a.init(),n.a.startState(!0))}))}},{key:"resetLevel",value:function(){n.a.resetCount++,n.a.gameEnded=!1,n.a.gameOverState=n.a.GameOverStates.NONE,this.reset(),o.a.playerData.coin=o.a.saveData.coin,this.currentLevel.init(),this.afterLevelLoaded(this.currentLevel),o.a.eventEmitter.once("phaserReady",(function(){a.a.init(),n.a.startState(!0)}))}},{key:"reset",value:function(){this.resetCount++;for(var t=[];n.a.GameObjects.length>0;){var e=n.a.GameObjects.pop();if(e){if(e.noRecycle)return void t.push(e);e.traverse((function(t){t.geometry&&t.geometry.dispose(),t.material&&(t.material.dispose(),t.material.map&&t.material.map.dispose())})),"function"==typeof e.removeObject&&e.removeObject(),o.a.main.scene.remove(e),e.body&&s.a.world.removeBody(e.body)}}for(;n.a.allGameObjects.length>0;){var i=n.a.allGameObjects.pop();"function"==typeof i.removeObject&&i.removeObject(),o.a.threeScene.remove(i),i.geometry&&i.geometry.dispose(),i.body&&s.a.world.removeBody(i.body)}this.resetCannonWorld(),o.a.phaserScene&&o.a.phaserScene.scene.restart(),t.forEach((function(t){n.a.GameObjects.push(t)})),n.a.gameEnded=!1,o.a.eventEmitter.removeAllListeners(),d.a.reset()}},{key:"resetCannonWorld",value:function(){var t=s.a.world;t.solver.removeAllEquations();for(var e=t.constraints,i=e.length;i--;)t.removeConstraint(e[i]);var n=t.bodies;for(i=n.length;i--;)t.removeBody(n[i])}},{key:"setGradientBgColor",value:function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,100],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:180,r="linear-gradient("+n+"deg",s=0,o=p(t);try{for(o.s();!(e=o.n()).done;){var a=e.value;r+=", "+a+" "+i[s]+"%",s++}}catch(t){o.e(t)}finally{o.f()}document.body.style.background=r}},{key:"setSceneBgColor",value:function(t){o.a.main.scene.background=new THREE.Color(t)}},{key:"setCssImage",value:function(t){document.body.style.backgroundImage="url("+t+")",document.body.style.backgroundRepeat="no-repeat",document.body.style.backgroundPosition="center 70%",document.body.style.backgroundSize="cover"}},{key:"addOcean",value:function(){o.a.data.oceanEnabled&&new Ocean({w:500,h:800},new r.Vector3(0,-30,0),o.a.getTexture("waterLines"),o.a.data.oceanColor)}}],(f=null)&&m(e.prototype,f),g&&m(e,g),Object.defineProperty(e,"prototype",{writable:!1}),t}();g(v,"levelList",[]),g(v,"levelOrder",[]),g(v,"currentLevel",null)},function(t,e,i){"use strict";var n=i(0);function r(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return s(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,h=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){h=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(h)throw o}}}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var o={createBox:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.w,r=void 0===i?1:i,s=e.h,o=void 0===s?1:s,a=e.d,h=void 0===a?1:a,l=e.x,u=void 0===l?0:l,c=e.y,d=void 0===c?0:c,p=e.z,f=void 0===p?0:p,m=e.color,g=void 0===m?"#ff0000":m,v=e.addToScene,y=void 0===v||v,x=e.customMat,w=new n.BoxBufferGeometry(r,o,h);t=x||new n.MeshLambertMaterial({color:g});var b=new n.Mesh(w,t);return b.position.set(u,d,f),b.initSize=new n.Vector3(r,o,h),y&&app.addToGame({obj:b}),b},createPlane:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.w,r=void 0===i?1:i,s=e.h,o=void 0===s?1:s,a=e.x,h=void 0===a?0:a,l=e.y,u=void 0===l?0:l,c=e.z,d=void 0===c?0:c,p=e.color,f=void 0===p?"#ff0000":p,m=e.addToScene,g=void 0===m||m,v=e.customMat,y=new n.PlaneGeometry(r,o,10,10);t=v||new n.MeshBasicMaterial({color:f,side:n.DoubleSide});var x=new n.Mesh(y,t);return x.position.set(h,u,d),x.rotation.x=-Math.PI/2,x.initSize=new n.Vector2(r,o),g&&app.addToGame({obj:x}),x},createCylinder:function(t){t.w,t.h,t.x,t.y,t.z,t.color,t.addToScene},detectCollisionCubes:function(t,e){var i=t.geometry.boundingBox.clone();i.applyMatrix4(t.matrixWorld);var n=e.geometry.boundingBox.clone();return n.applyMatrix4(e.matrixWorld),i.intersectsBox(n)},detectCollisionWithBox3:function(t,e){var i=t.geometry.boundingBox.clone();i.applyMatrix4(t.matrixWorld);var n=e;return i.intersectsBox(n)},moveToScene:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t.updateWorldMatrix(!0),t.getWorldPosition(t.position),t.getWorldScale(t.scale),t.getWorldQuaternion(t.quaternion),app.addToGame({obj:t,update:e,recycle:!0})},modelToBox3:function(t,e){t.updateWorldMatrix(!0);var i=(new n.Box3).setFromObject(t);if(e){var r=new Box3Helper(i);Globals.main.scene.add(r)}var s=(new n.Vector3).addVectors(i.min,i.max).multiplyScalar(.5),o=(new n.Vector3).subVectors(i.max,i.min);return t.dimensions=o,[s,o,i]},addTrail:function(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#000000",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:60,a=new THREE.TrailRenderer(t,!0),h=THREE.TrailRenderer.createBaseMaterial(),l=new THREE.Color(n);return h.uniforms.headColor.value.set(l.r,l.g,l.b,r),h.uniforms.tailColor.value.set(l.r,l.g,l.b,s),a.initialize(h,o,!1,0,i,e),a.activate(),a},createRawMaterial:function(t){var e={uMap:{type:"t",value:t}},i=new THREE.ShaderMaterial({uniforms:e,vertexShader:"\n varying vec2 vUv;\n void main()\n {\n \n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n \n //vec4 v4 = modelViewMatrix * vec4 (position, 1.0);\n //float zOff = v4.z/10.0;\n //v4.y -= 0.1*zOff*zOff;\n //gl_Position = projectionMatrix * v4;\n }\n ",fragmentShader:" \n uniform sampler2D uMap;\n varying vec2 vUv;\n void main( void ) {\n vec4 tex1 = texture2D(uMap, vUv * 1.0);\n gl_FragColor = vec4(\n tex1.r, // R\n tex1.g, // R\n tex1.b, // R\n tex1.a\n );\n } \n ",lights:!1});return i.transparent=!0,i},setRawMatNoFog:function(t){var e=t.material.map,i=t.material.transparent,r={uMap:{type:"t",value:e}},s=new THREE.ShaderMaterial({uniforms:r,vertexShader:"\n varying vec2 vUv;\n void main()\n {\n \n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n \n //vec4 v4 = modelViewMatrix * vec4 (position, 1.0);\n //float zOff = v4.z/10.0;\n //v4.y -= 0.1*zOff*zOff;\n //gl_Position = projectionMatrix * v4;\n }\n ",fragmentShader:" \n uniform sampler2D uMap;\n varying vec2 vUv;\n void main( void ) {\n vec4 tex1 = texture2D(uMap, vUv * 1.0);\n gl_FragColor = vec4(\n tex1.r, // R\n tex1.g, // R\n tex1.b, // R\n tex1.a\n );\n } \n ",lights:!1,fog:!1,side:n.DoubleSide,transparent:i});t.material=s},setRawMaterial:function(t){var e=t.material.map,i=" \n uniform sampler2D uMap;\n varying vec2 vUv;\n ".concat(THREE.ShaderChunk.common,"\n ").concat(THREE.ShaderChunk.fog_pars_fragment,"\n void main( void ) {\n vec4 tex1 = texture2D(uMap, vUv * 1.0);\n gl_FragColor = vec4(\n tex1.r, // R\n tex1.g, // R\n tex1.b, // R\n tex1.a\n );\n #ifdef USE_FOG\n #ifdef USE_LOGDEPTHBUF_EXT\n float depth = gl_FragDepthEXT / gl_FragCoord.w;\n #else\n float depth = gl_FragCoord.z / gl_FragCoord.w;\n #endif\n float fogFactor = smoothstep( fogNear, fogFar, depth );\n gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n #endif\n \n } \n "),n={uMap:{type:"t",value:e},topColor:{type:"c",value:new THREE.Color(30719)},bottomColor:{type:"c",value:new THREE.Color(16777215)},offset:{type:"f",value:33},exponent:{type:"f",value:.6},fogColor:{type:"c",value:Globals.main.scene.fog.color},fogNear:{type:"f",value:Globals.main.scene.fog.near},fogFar:{type:"f",value:Globals.main.scene.fog.far}},r=new THREE.ShaderMaterial({uniforms:n,vertexShader:"\n varying vec2 vUv;\n void main()\n {\n \n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n \n //vec4 v4 = modelViewMatrix * vec4 (position, 1.0);\n //float zOff = v4.z/10.0;\n //v4.y -= 0.1*zOff*zOff;\n //gl_Position = projectionMatrix * v4;\n }\n ",fragmentShader:i,lights:!1,fog:!0});r.transparent=!1,t.material=r},mergeModel:function(t){var e=[],i=[];t.traverse((function(t){if(t.material){var n=e.indexOf(t.material);n<0?(e.push(t.material),i.push([t])):i[n].push(t)}}));for(var n=[],r=0;r<e.length;r++){var s=i[r],o=this.mergeMeshes(s,e[r],!0);n.push(o)}return n},mergeMeshes:function(t,e,i){var s,o=[],a=r(t);try{for(a.s();!(s=a.n()).done;){var h=s.value;h.parent!=app.main.scene&&this.moveToScene(h);var l=h.geometry.clone();h.updateWorldMatrix(),h.updateMatrix(),l.applyMatrix4(h.matrix),o.push(l),h.parent.remove(h)}}catch(t){a.e(t)}finally{a.f()}var u=BufferGeometryUtils.mergeBufferGeometries(o),c=new n.Mesh(u,e);return o.forEach((function(t){return t.dispose()})),i&&app.addToGame({obj:c}),c},takeSnapshot:function(t,e,i){e&&e(),t.renderer.render(t.scene,t.camera);var n=t.renderer.domElement.toDataURL("image/jpeg",.5);return i&&i(),n},getModelSize:function(t){return this.bb8||(this.bb8=new n.Box3),this.bb8.setFromObject(t,!0),this.bb8.getSize(new n.Vector3)}};e.a=o},function(t,e,i){"use strict";var n=i(2),r=i(0);function s(t,e,i){let{color:s=65280,scale:o=1,onInit:a,onUpdate:h}=void 0===i?{}:i;const l=[],u=new r.MeshBasicMaterial({color:null!=s?s:65280,wireframe:!0}),c=new n.Vec3,d=new n.Vec3,p=new n.Vec3,f=new n.Quaternion,m=new r.SphereGeometry(1),g=new r.BoxGeometry(1,1,1),v=new r.PlaneGeometry(10,10,10,10);function y(e){let i=new r.Mesh;const{SPHERE:s,BOX:o,PLANE:a,CYLINDER:h,CONVEXPOLYHEDRON:l,TRIMESH:f,HEIGHTFIELD:y}=n.Shape.types;switch(e.type){case s:i=new r.Mesh(m,u);break;case o:i=new r.Mesh(g,u);break;case a:i=new r.Mesh(v,u);break;case h:{const t=new r.CylinderGeometry(e.radiusTop,e.radiusBottom,e.height,e.numSegments);i=new r.Mesh(t,u),e.geometryId=t.id;break}case l:{const t=function(t){const e=new r.BufferGeometry,i=[];for(let e=0;e<t.vertices.length;e++){const n=t.vertices[e];i.push(n.x,n.y,n.z)}e.setAttribute("position",new r.Float32BufferAttribute(i,3));const n=[];for(let e=0;e<t.faces.length;e++){const i=t.faces[e],r=i[0];for(let t=1;t<i.length-1;t++){const e=i[t],s=i[t+1];n.push(r,e,s)}}return e.setIndex(n),e.computeBoundingSphere(),e.computeVertexNormals(),e}(e);i=new r.Mesh(t,u),e.geometryId=t.id;break}case f:{const t=function(t){const e=new r.BufferGeometry,i=[],n=c,s=d,o=p;for(let e=0;e<t.indices.length/3;e++)t.getTriangleVertices(e,n,s,o),i.push(n.x,n.y,n.z),i.push(s.x,s.y,s.z),i.push(o.x,o.y,o.z);return e.setAttribute("position",new r.Float32BufferAttribute(i,3)),e.computeBoundingSphere(),e.computeVertexNormals(),e}(e);i=new r.Mesh(t,u),e.geometryId=t.id;break}case y:{const t=function(t){const e=new r.BufferGeometry,i=t.elementSize||1,n=t.data.flatMap((t,e)=>t.flatMap((t,n)=>[e*i,n*i,t])),s=[];for(let e=0;e<t.data.length-1;e++)for(let i=0;i<t.data[e].length-1;i++){const n=t.data[e].length,r=e*n+i;s.push(r+1,r+n,r+n+1),s.push(r+n,r+1,r)}return e.setIndex(s),e.setAttribute("position",new r.Float32BufferAttribute(n,3)),e.computeBoundingSphere(),e.computeVertexNormals(),e}(e);i=new r.Mesh(t,u),e.geometryId=t.id;break}}return t.add(i),i}function x(e,i){let s=l[e],a=!1;return function(t,e){if(!t)return!1;const{geometry:i}=t;return i instanceof r.SphereGeometry&&e.type===n.Shape.types.SPHERE||i instanceof r.BoxGeometry&&e.type===n.Shape.types.BOX||i instanceof r.PlaneGeometry&&e.type===n.Shape.types.PLANE||i.id===e.geometryId&&e.type===n.Shape.types.CYLINDER||i.id===e.geometryId&&e.type===n.Shape.types.CONVEXPOLYHEDRON||i.id===e.geometryId&&e.type===n.Shape.types.TRIMESH||i.id===e.geometryId&&e.type===n.Shape.types.HEIGHTFIELD}(s,i)||(s&&t.remove(s),l[e]=s=y(i),a=!0),function(t,e){const{SPHERE:i,BOX:r,PLANE:s,CYLINDER:a,CONVEXPOLYHEDRON:h,TRIMESH:l,HEIGHTFIELD:u}=n.Shape.types;switch(e.type){case i:{const{radius:i}=e;t.scale.set(i*o,i*o,i*o);break}case r:t.scale.copy(e.halfExtents),t.scale.multiplyScalar(2*o);break;case s:break;case a:case h:t.scale.set(1*o,1*o,1*o);break;case l:t.scale.copy(e.scale).multiplyScalar(o);break;case u:t.scale.set(1*o,1*o,1*o)}}(s,i),a}return v.translate(0,0,1e-4),{update:function(){const i=l,n=c,r=f;let s=0;for(const t of e.bodies)for(let e=0;e!==t.shapes.length;e++){const o=t.shapes[e],l=x(s,o),u=i[s];u&&(t.quaternion.vmult(t.shapeOffsets[e],n),t.position.vadd(n,n),t.quaternion.mult(t.shapeOrientations[e],r),u.position.copy(n),u.quaternion.copy(r),l&&a instanceof Function&&a(t,u,o),!l&&h instanceof Function&&h(t,u,o)),s++}for(let e=s;e<i.length;e++){const n=i[e];n&&t.remove(n)}i.length=s}}}var o=i(1);function a(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}window.CANNON=n;var h=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,r;return e=t,r=[{key:"initWorld",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{x:0,y:0,z:0},i=new n.World;return i.gravity.set(e.x,e.y,e.z),i.broadphase=new n.NaiveBroadphase,i.defaultContactMaterial.contactEquationStiffness=1e6,i.defaultContactMaterial.contactEquationRegularizationTime=3,i.solver.iterations=5,i.allowSleep=!0,i.add||(i.add=i.addBody),i.remove||(i.remove=i.removeBody),this.world=i,t.CANNON=n,app.cannonPhysics=this,i}},{key:"setWorld",value:function(e){t.CANNON=n,this.world=e}},{key:"initDebug",value:function(){var t=o.a.threeScene,e=this.world;this.debugRenderer=new s(t,e)}}],(i=null)&&a(e.prototype,i),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.a=h},function(t,e,i){"use strict";i.d(e,"a",(function(){return H}));var n=i(5),r=i(3),s=i(1),o=i(11),a=i(17);function h(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return l(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return l(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==i.return||i.return()}finally{if(a)throw s}}}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function u(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var c=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.topObj=e,this.init()}var e,i,l;return e=t,(i=[{key:"init",value:function(){this.initSpiral(),s.a.phaserScene.tweens.add({targets:this.container,props:{scale:{dynamic:!0,value:{getStart:function(t){return 0},getEnd:function(t){return t.iS}}}},duration:500,ease:Phaser.Math.Easing.Back.Out})}},{key:"videoClaimBtnCallback",value:function(t){var e=this;H.enableInput(!1),app.beforeAdShown(),H5SDK.getAdsModule().requestRewardedAd().then((function(t){app.afterAdShown(),t?e.getCoinAndGoNextLevel(e.vidClaimBtn):e.getCoinAndGoNextLevel(e.normalClaimBtn)}))}},{key:"normalClaimBtnCallback",value:function(t){H.enableInput(!1),this.getCoinAndGoNextLevel(t)}},{key:"getCoinAndGoNextLevel",value:function(t){s.a.vibrateFeedback(100),s.a.playerData.coin;var e=parseInt(t.koinText.text);s.a.uiScene.spawnCoins(e).then((function(){setTimeout((function(){app.pausegame=!1,n.a.goNextLevel(!0)}),500)}))}},{key:"initSpiral",value:function(){var t=this,e=s.a.phaserScene,i=new a.a;this.container=i;var n=e.add.image(0,0,"uiatlas","spiralBg");i.add(n),i.setInitials();var l=e.add.image(0,0,"uiatlas","multArrow");i.add(l),i.onResizeCallback=function(e,n){var r=.3;e>n&&(r=.25);var s=n-t.topObj.getBottomCenter().y;i.scale=Math.min(.5*e/i.iW,s*r/i.iH),i.x=.5*e,i.y=t.topObj.getBottomCenter().y+.6*i.displayHeight,i.iS=i.scale},n.setOrigin(.5),l.setOrigin(.5,.75),l.y=n.y+.3*n.displayHeight,i.onResizeCallback(e.lastWidth,e.lastHeight);var u=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.imgName,n=t.topObj,a=t.coinTextColor,h=void 0===a?"#fff":a,l=t.enableXMult,u=void 0!==l&&l,c=t.coinTextSkal,d=void 0===c?1:c,p=t.offsetY,f=void 0===p?1:p,m=t.skal,g=void 0===m?1:m,v=t.textOffsetY,y=void 0===v?.3:v,x=t.clickFunc,w=o.a.addButton(e,"uiatlas",i,s.a.locales.CLAIM,(function(){x&&x()}),{xRatio:.5,yRatio:y,wRatio:.45,hRatio:.35,strokePower:4,strokeColor:"#000",hasStroke:!0,fntSize:32},"Arial");w.text.setFontStyle("bold");var b=r.a.bonusCollected,A=e.add.text(0,0,b,{fontFamily:"ui-font",fontSize:32,stroke:"#000",strokeThickness:5,color:h});A.setFontStyle("bold"),A.scale=1*d,A.x=0,A.y=.2*w.displayHeight,A.setOrigin(.5);var T=e.add.image(0,0,"uiatlas","coin");if(T.scale=.3*w.scale*d,T.y=A.y,T.x=A.x+.45*A.displayWidth+.8*T.displayWidth,w.add(A),w.add(T),u){var S=e.add.text(0,0,"X2",{fontFamily:"ui-font",fontSize:32,stroke:"#000",strokeThickness:5});S.setOrigin(.5,.5),S.setFontStyle("bold"),S.scale=.45*w.displayHeight/S.height,S.x=w.x+.45*w.displayWidth-.5*S.displayWidth,S.y=.1*w.displayHeight,w.add(S),w.multText=S}return w.onResizeCallback=function(t,e){w.scale=n.scale*g,w.x=.5*t,w.y=n.getBottomCenter().y+.5*w.displayHeight*f},w.onResizeCallback(e.lastWidth,e.lastHeight),w.koinText=A,w},c=u({imgName:"claimVidBtn",coinTextColor:"#EEE776",topObj:i,enableXMult:!0,clickFunc:function(){app.playSfx("Button"),s.a.phaserScene.tweens.killTweensOf(l),t.videoClaimBtnCallback(c)}}),d=u({imgName:"claimBtn",coinTextColor:"#fff",topObj:c,coinTextSkal:.75,offsetY:1.05,skal:1,textOffsetY:.35,clickFunc:function(){app.playSfx("Button"),s.a.phaserScene.tweens.killTweensOf(l),t.normalClaimBtnCallback(d)}});this.vidClaimBtn=c,this.normalClaimBtn=d,this.vidClaimBtn.setVisible(!1),c.text.scale>d.text.scale?d.text.scale=c.text.scale:c.text.scale=d.text.scale;var p=parseInt(d.koinText.text),f=[{start:.55*-Math.PI,end:.22*-Math.PI,val:2},{start:.55*-Math.PI,end:.1*Math.PI,val:3},{start:.55*-Math.PI,end:.35*Math.PI,val:4},{start:.55*-Math.PI,end:.55*Math.PI,val:5}];e.tweens.add({targets:l,rotation:{from:.55*-Math.PI,to:.55*Math.PI},duration:1e3,yoyo:!0,repeat:-1,ease:Phaser.Math.Easing.Sine.In,onUpdate:function(){var t,e=l.rotation,i=h(f);try{for(i.s();!(t=i.n()).done;){var n=t.value;if(e<=n.end){c.multText.text="X"+n.val;var r=n.val*p;c.koinText.text=r;break}}}catch(t){i.e(t)}finally{i.f()}}}),H5SDK.getPlatform().isYoutube()?(c.setVisible(!1),n.setVisible(!1),l.setVisible(!1),d.y=c.y):H5SDK.getAdsModule().preloadRewardedAd().then((function(e){e&&t.vidClaimBtn.setVisible(!0)}))}}])&&u(e.prototype,i),l&&u(e,l),Object.defineProperty(e,"prototype",{writable:!1}),t}(),d=i(4),p=i(18),f=i(14);function m(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var g,v=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.drawArea=e,this.scene=s.a.phaserScene,this.hand=this.scene.add.image(0,0,"uiatlas","hand"),this.hand.setOrigin(.3,.1),this.hand.scale=.4,this.drawArea.padCont.add(this.hand)}var e,i,n;return e=t,(i=[{key:"stopDrawing",value:function(){this.drawTween.remove(),this.hand.visible=!1,this.drawArea.clearCanvas()}},{key:"startDrawing",value:function(){var t=this,e=f.a.getArmData(0),i={val:0},n=.25*this.drawArea.drawBg.width,r=.25*this.drawArea.drawBg.height,s=this.hand.scale,o=.5*this.drawArea.drawBg.width,a=.5*this.drawArea.drawBg.height;this.hand.x=e[0].x*o-n,this.hand.y=e[0].y*a-r,this.drawArea.clearCanvas(),this.drawTween=this.scene.tweens.add({targets:i,val:e.length-1,duration:1400,repeat:-1,hold:500,repeatDelay:500,ease:"Sine.easeInOut",onRepeat:function(){t.hand.alpha=0,t.hand.scale=0,t.scene.tweens.add({targets:t.hand,scale:{from:0,to:s},alpha:1,duration:500,ease:"Sine.easeInOut"}),t.hand.x=e[0].x*o-n,t.hand.y=e[0].y*a-r,t.drawArea.clearCanvas()},onUpdate:function(){var h=Math.floor(i.val);if(t.prevIndex!==h){var l=e[h].x*o-n,u=e[h].y*a-r;t.hand.x+=.1*(l-t.hand.x),t.hand.y+=.1*(u-t.hand.y),t.prevIndex=h,t.hand.scale<.2*s||t.drawArea.drawOnCanvas(t.hand)}}})}}])&&m(e.prototype,i),n&&m(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),y=i(33);function x(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var w=0,b=function(){function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),g=s.a.phaserScene,this.padCont=g.add.container(),this.drawBg=g.add.image(0,0,"drawArea"),w>0&&g.textures.remove("drawAreaTop"+w-1);var i=g.textures.createCanvas("drawAreaTop"+w,.95*this.drawBg.displayWidth,.95*this.drawBg.displayHeight);this.canvas=i;var n=g.add.image(0,0,"drawAreaTop"+w);n.setInteractive(),w++,this.padCont.add([this.drawBg,n]),this.padCont.iW=this.padCont.getBounds().width,this.padCont.iH=this.padCont.getBounds().height,this.padCont.onResizeCallback=function(t,e){this.setScale(Math.min(.8*t/this.iW,.3*e/this.iH)),this.x=.5*t,this.y=.9*e-this.iH*this.scale*.6},this.padCont.onResizeCallback(g.lastWidth,g.lastHeight),this.circle=g.add.circle(0,0,10,0).setOrigin(.5).setVisible(!1),this.currentPoints=[],this.tutorialEnabled=!0,this.firstDrawEnded=!1,n.on("pointerdown",(function(){e.onDrawStarts(i),e.tutorialEnabled&&(e.tutorialEnabled=!1,e.onFirstDraw())})),n.on("pointermove",(function(t){e.onPointerMoves(t,i)})),g.input.on("pointerup",(function(){e.onDrawEnds(i)})),n.on("pointerout",(function(){e.onDrawEnds(i)})),this.show(!1),this.drawTutorial=new v(this)}var e,i,n;return e=t,(i=[{key:"onFirstDraw",value:function(){this.drawTutorial.stopDrawing(),this.hideDrawText()}},{key:"show",value:function(t,e){var i=this;this.padCont.visible!==t&&(s.a.deltaMultiplier=1,e?t?(this.padCont.visible=!1,g.tweens.add({targets:this.drawBg,scaleY:{from:0,to:1},duration:500,ease:"Sine.easeOut",onStart:function(){i.padCont.visible=!0}}),this.showDrawText()):g.tweens.add({targets:this.drawBg,scaleY:{from:1,to:0},duration:500,ease:"Sine.easeOut",onComplete:function(){i.padCont.visible=!1}}):this.padCont.visible=t)}},{key:"showDrawText",value:function(){this.drawTutorial.startDrawing();var t=p.a.createText(s.a.locales.DRAW,{customResize:!0,fontSize:120});t.alpha=0,t.scale=1,this.padCont.add(t),t.setShadow(0,.5,"#000",2,!1,!0),t.x=0,t.y=.5*-this.drawBg.displayHeight-.5*t.displayHeight,s.a.phaserScene.tweens.add({targets:t,scale:{from:0,to:1},alpha:1,ease:"Linear",duration:500,onComplete:function(){s.a.phaserScene.tweens.add({targets:t,scale:.8,ease:Phaser.Math.Easing.Sine.InOut,duration:600,yoyo:!0,repeat:-1})}}),this.drawText=t}},{key:"hideDrawText",value:function(){var t=this;return new Promise((function(e){s.a.phaserScene.tweens.killTweensOf(t.drawText),s.a.phaserScene.tweens.add({targets:t.drawText,scale:0,ease:Phaser.Math.Easing.Sine.Out,duration:500,onComplete:function(){t.drawText.visible=!1,e()}})}))}},{key:"showCountDown",value:function(){if(s.a.data.skipCountdown)return Promise.resolve();var t=p.a.createText("3",{customResize:!0,fontSize:120});this.padCont.add(t);var e=s.a.data.countdownStart;t.text=e,t.setShadow(0,.5,"#000",2,!1,!0),t.x=0,t.y=.5*-this.drawBg.displayHeight-.5*t.displayHeight;var i=!1;return new Promise((function(n){var r=s.a.phaserScene.tweens.add({targets:t,scale:{from:1,to:0},ease:"Linear",duration:s.a.data.countdownSpeed,loop:e,onStart:function(){app.playSfx("Race_Start")},onUpdate:function(){r.setTimeScale(s.a.deltaMultiplier)},onLoop:function(){0!=--e||i?app.playSfx("Race_Start"):(i=!0,e=s.a.locales.START,app.playSfx("Race_End"),n()),t.setText(e)},onComplete:function(){t.destroy()}})}))}},{key:"clearCanvas",value:function(){this.canvas.clear()}},{key:"drawOnCanvas",value:function(t){var e=this.canvas;e.context.beginPath(),this.getPosReleativeToDrawArea(t.x,t.y);var i=.5*this.drawBg.width,n=.5*this.drawBg.height;e.context.arc(t.x+i,t.y+n,10,0,2*Math.PI),e.context.fill()}},{key:"onDrawStarts",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.canvas;t.clear(),this.drawingStarts=!0,this.pointDistances=0,this.currentPoints=[],this.time=0,d.a.setDeltaMultiplier(.2),s.a.vibrateFeedback(100)}},{key:"onPointerMoves",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.canvas;if(this.drawingStarts){var n=t.getInterpolatedPosition(15);i.context.fillStyle="#000",n.forEach((function(t){i.context.beginPath();var n=e.getPosReleativeToDrawArea(t.x,t.y);i.context.arc(n.x,n.y,10,0,2*Math.PI),i.context.fill()}));var r=this.getPosReleativeToDrawArea(t.x,t.y);if(r.x/=this.drawBg.displayWidth-32,r.y/=this.drawBg.displayHeight-32,this.currentPoints.push(r),this.time++,this.time>2&&(this.time=0,s.a.vibrateFeedback(10),app.playSfx("Drawing")),this.currentPoints.length>1){var o=this.currentPoints[this.currentPoints.length-2];this.pointDistances+=this.getDist(o,r)}}}},{key:"getPosReleativeToDrawArea",value:function(t,e){var i=(t-this.padCont.x)/this.padCont.scaleX+.5*this.drawBg.displayWidth,n=(e-this.padCont.y)/this.padCont.scaleY+.5*this.drawBg.displayHeight;return{x:i-=16,y:n-=16}}},{key:"getDist",value:function(t,e){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}},{key:"onDrawEnds",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.canvas;this.drawingStarts&&(d.a.setDeltaMultiplier(1),this.drawingStarts=!1,t.clear(),this.currentPoints.length<5||this.pointDistances<.1||(this.firstDrawEnded||(this.firstDrawEnded=!0,this.onFirstDrawEnded()),s.a.eventEmitter.emit("drawingEnds",{pointList:this.currentPoints})))}},{key:"onFirstDrawEnded",value:function(){this.showCountDown().then((function(){s.a.eventEmitter.emit("gameStarts"),d.a.setState(y.a.GameplayState)}))}}])&&x(e.prototype,i),n&&x(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function A(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var T,S=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.init()}var e,i,n;return e=t,(i=[{key:"init",value:function(){var t=s.a.phaserScene,e=new a.a,i=t.add.image(0,0,"uiatlas","faceBg");i.setOrigin(.5);var n=function(e,i,n){var r=t.add.text(0,0,e,{fontSize:n,color:i,stroke:"#000",strokeThickness:5,fontFamily:"ui-font"});return r.setFontStyle("bold"),r.setOrigin(.5),r.setScale(.75),r},r=n(s.a.locales.FB_CURRENT_SCORE,"#F7D602",60),h=n(s.a.playerData.score,"#ffffff",60),l=n(s.a.locales.FB_BEST_SCORE,"#FF8945",60),u=n(s.a.playerData.bestScore,"#ffffff",60),c=s.a.gameLogoImg,d=s.a.locales.INVITE_FRIENDS;d=d.replace("%s",s.a.playerData.bestScore);var p=s.a.locales.SHARE_WITH_FRIENDS;p=p.replace("%s",s.a.playerData.bestScore);var f=o.a.addButton(t,"uiatlas","invBtn",s.a.locales.FB_INVITE,(function(){H5SDK.getPlatform().inviteFriends(c,d)}),{bgSkal:1.2,wRatio:.7,hRatio:.5,xRatio:.4,yRatio:.5});f.text.setFontStyle("bold");var m=o.a.addButton(t,"uiatlas","shareBtn",s.a.locales.FB_SHARE,(function(){H5SDK.getPlatform().shareWithFriends(c,p)}),{bgSkal:1.2,wRatio:.7,hRatio:.5,xRatio:.4,yRatio:.5,strokePower:12,strokeColor:"#000",hasStroke:!1});m.text.setFontStyle("bold"),e.add(i),e.bounds=e.getBounds(),e.setInitials(),e.add([r,h,l,u,f,m]),f.text.scale>m.text.scale?f.text.scale=m.text.scale:m.text.scale=f.text.scale,e.onResizeCallback=function(t,i){e.scale=Math.min(.6*t/e.iW,.3*i/e.iH),e.x=.5*t,e.y=.36*i,e.iS=e.scale},e.onResizeCallback(t.lastWidth,t.lastHeight);var g=H5SDK.getPlatform().isFacebook(),v=.5;g||(v=.3),r.x=0,r.y=-e.bounds.height*v+.7*r.height,h.x=0,h.y=r.getBottomCenter().y+.3*h.height,r.visible=!1,h.visible=!1,l.y=-e.iH*v+.25*e.iH,u.y=l.getBottomCenter().y+.4*u.height,f.y=u.getBottomCenter().y+.75*f.height,m.y=f.y+.5*f.height+.9*m.height,this.container=e,this.container.setVisible(!1),this.show(!0),g||(f.setVisible(!1),m.setVisible(!1))}},{key:"show",value:function(t){var e=this;t?(this.container.setVisible(!0),s.a.phaserScene.tweens.add({targets:this.container,props:{scale:{dynamic:!0,value:{getStart:function(t){return 0},getEnd:function(t){return e.container.iS}}}},duration:300,ease:"Sine.easeInOut"})):this.container.setVisible(!1)}}])&&A(e.prototype,i),n&&A(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function E(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function M(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var _,C=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.openingScene,n=void 0!==i&&i;E(this,t),T=s.a.phaserScene,this.openingScene=n,this.init(),this.show(!1),this.rewardAdShown=!1,this.initEvents()}var e,i,n;return e=t,(i=[{key:"show",value:function(t){this.gameObjects.forEach((function(e){e.setVisible(t)}))}},{key:"destroy",value:function(){this.gameObjects.forEach((function(t){t.destroy(!0)}))}},{key:"initEvents",value:function(){s.a.eventEmitter.once("playBtnClicked",this.destroy.bind(this))}},{key:"init",value:function(){var t=this.initBox("speed",s.a.upgrades.speedUpgrade);t.onResizeCallback=function(e,i){t.scale=Math.min(.25*e/t.iW,.15*i/t.iH);var n=.8;e>i&&(n=.77),t.x=.5*e,t.y=i*n-1*t.displayHeight,t.iS=t.scale},t.onResizeCallback(T.lastWidth,T.lastHeight),this.gameObjects=[t]}},{key:"initBox",value:function(t,e){var i=this,n=new a.a,r=s.a.phaserScene.add.image(0,0,"uiatlas",t+"Btn");n.swapAdBg=function(o){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1];o?(r.setFrame(t+"_adoverlay"),l.setTextWithScale(s.a.locales.UPGRADE_FREE),n.alpha=1):(r.setFrame(t+"Btn"),l.setTextWithScale(e.cost),(s.a.playerData.coin<e.cost&&i.rewardAdShown||s.a.playerData.coin<e.cost&&!a)&&(n.alpha=.3))};var o=T.add.text(0,0,s.a.locales.LVL+" "+e.level,{fontSize:"60px",color:"#000",fontFamily:"ui-font"});o.setFontStyle("bold"),o.setOrigin(0,.5),o.scale=Math.min(.5*r.displayWidth/o.width),o.y=.01*r.displayHeight-.5*o.displayHeight,o.x=.1*-r.displayWidth;var h=T.add.text(0,0,e.name,{fontSize:"60px",color:"#fff",fontFamily:"ui-font"});h.alpha=.7,h.setFontStyle("bold"),h.setOrigin(0,.5),h.setScale(Math.min(.65*r.displayWidth/h.width,.17*r.displayHeight/h.height)),h.x=.1*r.width-.5*h.displayWidth,h.y=.4*-r.height+.5*h.displayHeight;var l=T.add.text(0,0,e.cost,{fontSize:"60px",color:"#fff",fontFamily:"ui-font"});return l.setFontStyle("bold"),l.setOrigin(0,.5),l.setTextWithScale=function(t){l.text=t,l.scale=Math.min(.5*r.displayWidth/l.width,.45*r.displayHeight/l.height)},l.y=.25*r.displayHeight,l.x=.05*-r.displayWidth,n.add(r),n.setInitials(),n.add(o),n.add(h),n.add(l),n.levelText=o,n.coinText=l,r.setInteractive(),r.on("pointerdown",(function(){s.a.playerData.coin>=e.cost&&i.upgradeAttribute(n,e)})),n.swapAdBg(!1),window.H5SDK.getAdsModule().preloadRewardedAd().then((function(t){var o=H5SDK.getPlatform().isYoutube();t&&s.a.playerData.coin<e.cost&&!i.rewardAdShown&&!o&&(r.on("pointerdown",(function(){if(s.a.playerData.coin>=e.cost);else{if(i.rewardAdShown)return;H.enableInput(!1),app.beforeAdShown(),window.H5SDK.getAdsModule().requestRewardedAd().then((function(t){H.enableInput(!0),app.afterAdShown(),t?(i.rewardAdShown=!0,i.upgradeAttribute(n,e,!0)):(r.disableInteractive(),i.rewardAdShown=!1,n.swapAdBg(!1))}))}})),n.swapAdBg(!0,t))})),n}},{key:"upgradeAttribute",value:function(t,e,i){i||(s.a.playerData.coin-=e.cost),s.a.playerData.coin<0&&(s.a.playerData.coin=0),e.level+=1,t.levelText.setText("LVL "+e.level),t.coinText.setTextWithScale(e.cost),t.swapAdBg(!1),s.a.saveData.speedUpgradeLevel=s.a.playerData.speedUpgradeLevel,s.a.saveData.coin=s.a.playerData.coin,s.a.saveGame(!0),s.a.eventEmitter.emit("upgradeBtnClicked",e),s.a.eventEmitter.emit("updateCoins"),s.a.vibrateFeedback(200),this.openingScene&&(H.enableInput(!1),H.introUI.show(!1),t.visible=!1,app.playSfx("Button"),r.a.player.doUpgradeAnim().then((function(){t.visible=!0,H.enableInput(!0),H.introUI.show(!0)}))),T.tweens.add({targets:t,props:{scale:{dynamic:!0,value:{getStart:function(t){return.9*t.iS},getEnd:function(t){return t.iS}}}},duration:800,ease:Phaser.Math.Easing.Back.Out})}},{key:"calculateCostValue",value:function(t){return t.startingCost*t.level}}])&&M(e.prototype,i),n&&M(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function P(t,e,i,n,r,s,o){try{var a=t[s](o),h=a.value}catch(t){return void i(t)}a.done?e(h):Promise.resolve(h).then(n,r)}function R(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var L=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),_=s.a.phaserScene}var e,i,r,a,h;return e=t,(i=[{key:"show",value:function(t){var e=this;t?(H.enableInput(!1),app.beforeAdShown(),H5SDK.getAdsModule().requestInterstitialAd().then((function(){e.showFacebookTournament((function(){H.enableInput(!0),app.afterAdShown(),app.pausegame=!0,e.showWin()}))}))):this.showFail()}},{key:"showFacebookTournament",value:function(t){H5SDK.getPlatform().isFacebook()?H5SDK.getPlatform().showTournamentCreatorPopup().then((function(){t&&t()})):t&&t()}},{key:"showWin",value:function(){var t=this.createTitle(s.a.locales.ECWIN_TITLE,"ecGreenBar");this.fbPopup=new S,this.coinMult=new c(this.fbPopup.container);var e=[t,t.textObj,t.shimmerObj];this.showAnim(e,!0),app.playSfx("Crowd_Clap")}},{key:"showFail",value:(a=regeneratorRuntime.mark((function t(){var e,i,r,a,h,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.createTitle(s.a.locales.ECFAIL_TITLE,"ecBlueBar"),(i=_.add.image(0,0,"uiatlas","failBtn")).setInteractive(),i.on("pointerdown",(function(){app.playSfx("Button"),H.enableInput(!1),app.beforeAdShown(),H5SDK.getAdsModule().requestInterstitialAd().then((function(){app.afterAdShown(),n.a.resetLevel()}))})),i.onResizeCallback=function(t,e){i.scale=Math.min(.2*t/i.width,.15*e/i.height),i.x=.5*t;var n=1;t>e&&(n=.9),i.y=e*n*.7,i.iS=i.scale},i.onResizeCallback(_.lastWidth,_.lastHeight),p.a.makePulse(i),r=H5SDK.getPlatform().isYoutube(),t.next=10,H5SDK.getAdsModule().preloadRewardedAd();case 10:t.sent&&!r?((a=o.a.addButton(s.a.phaserScene,"uiatlas","claimVidBtn",s.a.locales.SKIP_LEVEL,(function(){H.enableInput(!1),app.playSfx("Button"),app.beforeAdShown(),H5SDK.getAdsModule().requestRewardedAd().then((function(t){app.afterAdShown(),t?n.a.goNextLevel():(H.enableInput(!0),a.scale=0)}))}),{xRatio:.6,yRatio:.5,wRatio:.6,hRatio:.45,strokePower:5,strokeColor:"#000",hasStroke:!1})).text.setFontStyle("bold"),a.onResizeCallback=function(t,e){a.scale=Math.min(.35*t/a.width,.1*e/a.height),a.x=i.x,a.y=i.getBottomCenter().y+.75*a.displayHeight,a.iS=a.scale},a.onResizeCallback(_.lastWidth,_.lastHeight),h=[e,e.textObj,e.shimmerObj,i,a],this.showAnim(h,!1)):(l=[e,e.textObj,e.shimmerObj,i],this.showAnim(l,!1));case 12:case"end":return t.stop()}}),t,this)})),h=function(){var t=this,e=arguments;return new Promise((function(i,n){var r=a.apply(t,e);function s(t){P(r,i,n,s,o,"next",t)}function o(t){P(r,i,n,s,o,"throw",t)}s(void 0)}))},function(){return h.apply(this,arguments)})},{key:"createTitle",value:function(t,e){var i=_.add.image(0,0,"uiatlas",e);i.onResizeCallback=function(t,e){i.setScale(t/i.width,.1*e/i.height),i.x=.5*t,i.y=.15*e,i.iSY=i.scaleY,i.iSX=i.scaleX},i.onResizeCallback(_.lastWidth,_.lastHeight);var n=_.add.image(0,0,"uiatlas","ecShimmer");n.onResizeCallback=function(t,e){n.scale=i.displayHeight/n.height,n.x=i.x-.4*n.displayWidth,n.y=i.y,n.iPX=n.x},n.onResizeCallback(_.lastWidth,_.lastHeight);var r=_.add.text(0,0,t,{fontSize:60,fontFamily:"ui-font",color:"#ffffff",fontStyle:"bold"});return r.setOrigin(.5),r.onResizeCallback=function(t,e){r.scale=Math.min(.9*i.displayWidth/r.width,.7*i.displayHeight/r.height),r.x=i.x,r.y=i.y,r.iPX=r.x},r.onResizeCallback(_.lastWidth,_.lastHeight),i.textObj=r,i.shimmerObj=n,i}},{key:"addTitleAnim",value:function(t){t.alpha=1,_.tweens.add({targets:t,props:{scaleY:{dynamic:!0,value:{getStart:function(t){return 0*t.iSY},getEnd:function(t){return 1*t.iSY}}}},duration:1500,ease:Phaser.Math.Easing.Bounce.Out,easeParams:[2]}),_.tweens.add({targets:t.shimmerObj,props:{alpha:1,x:{dynamic:!0,value:{getStart:function(t){return 2*t.iPX},getEnd:function(t){return 1*t.iPX}}}},delay:1e3,duration:800,ease:Phaser.Math.Easing.Back.Out,easeParams:[3]}),_.tweens.add({targets:t.textObj,props:{alpha:1,x:{dynamic:!0,value:{getStart:function(t){return 2*-t.iPX},getEnd:function(t){return 1*t.iPX}}}},delay:1e3,duration:800,ease:Phaser.Math.Easing.Back.Out,easeParams:[3]})}},{key:"addScaleUpAnim",value:function(t,e,i){_.tweens.add({targets:t,delay:e,props:{alpha:1,scale:{dynamic:!0,value:{getStart:function(t){return 0*t.iS},getEnd:function(t){return 1*t.iS}}},y:{dynamic:!0,value:{getStart:function(t){return i.iPY},getEnd:function(t){return 1*t.iPY}}}},duration:800,ease:Phaser.Math.Easing.Back.Out,easeParams:[2]})}},{key:"addAlphaAnim",value:function(t,e){_.tweens.add({targets:t,alpha:1,delay:e,duration:800,ease:"Sine.easeInOut"})}},{key:"showAnim",value:function(t,e){if(t.forEach((function(t){t.alpha=0})),e){this.addTitleAnim(t[0]);for(var i=3;i<t.length;i++)this.addScaleUpAnim(t[i],500,t[t.length-1])}else this.addTitleAnim(t[0]),this.addAlphaAnim(t[t.length-1],1e3),this.addAlphaAnim(t[t.length-2],1e3)}},{key:"showWin2",value:function(){var t=this.createTitle(s.a.locales.ECWIN_TITLE,"ecGreenBar"),e=o.a.addButton(_,"uiatlas","ecWinBtn",s.a.locales.ECWIN_BTN,(function(){n.a.goNextLevel()}),{yRatio:.5,wRatio:.8});e.text.setFontStyle("bold"),e.onResizeCallback=function(t,i){e.scale=Math.min(.5*t/e.width,.1*i/e.height),e.x=.5*t,e.y=.8*i,e.iS=e.scale,e.iPY=e.y},e.onResizeCallback(_.lastWidth,_.lastHeight);var i=[t,t.textObj,t.shimmerObj,e];this.showAnim(i,!0),p.a.makePulse(e)}}])&&R(e.prototype,i),r&&R(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function O(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var D=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.feedbackText=p.a.createText("AAA",{wRatio:.2,hRatio:.1,xPos:.5,yPos:.3,customResize:!1}),this.feedbackText.alpha=0,this.feedbackList=[s.a.locales.FEEDBACK_1,s.a.locales.FEEDBACK_2,s.a.locales.FEEDBACK_3,s.a.locales.FEEDBACK_4,s.a.locales.FEEDBACK_5,s.a.locales.FEEDBACK_6,s.a.locales.FEEDBACK_7]}var e,i,n;return e=t,(i=[{key:"spawn",value:function(t){var e=s.a.phaserScene;e.tweens.killTweensOf(this.feedbackText);var i=Math.floor(Math.random()*this.feedbackList.length);this.feedbackText.text=t||this.feedbackList[i],this.feedbackText.alpha=1,e.tweens.add({targets:this.feedbackText,props:{y:{dynamic:!0,value:{getStart:function(t){return.3*e.lastHeight},getEnd:function(t){return.2*e.lastHeight}}},alpha:0,scale:{dynamic:!0,value:{getStart:function(t){return.95*t.iS},getEnd:function(t){return t.iS}}}},duration:800,ease:"Sine.easeInOut"})}}])&&O(e.prototype,i),n&&O(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),B=i(26);function I(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var F,k=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var e=s.a.phaserScene,i=e.add.container(),n=e.add.image(0,0,"uiatlas","progressBg"),r=function(t,i){var r=o.a.addButton(e,"uiatlas","progressPoint",t,null,{xRatio:.5,wRatio:.7});return r.scale=1.5,r.x=n.x+i*n.displayWidth*.5+i*r.displayWidth*.7,r.text.scale=.3,r},a=r(0,-1),h=r(10,1);i.add([a,h,n]),i.iW=i.getBounds().width,i.iH=i.getBounds().height;var l=function(t,i){var r=e.add.rectangle(0,0,7,1.5*n.height,i);return r.scale=1.3,r},u=l(0,16384257),c=l(0,297726),d=e.add.text(0,0,s.a.locales.YOU,{fontSize:60,fontFamily:"ui-font",color:"#ffffff",align:"center"});d.setOrigin(.5),d.x=c.x,d.y=-c.height,d.scale=.5*c.scale,c.youText=d,i.add([u,c,d]),i.onResizeCallback=function(t,e){this.setScale(Math.min(.8*t/this.iW,.08*e/this.iH)),this.x=.5*t,this.y=.1*e+this.iH*this.scale*.6,i.iS=this.scale,i.iSX=this.scaleX},i.onResizeCallback(e.lastWidth,e.lastHeight),this.cont=i,this.progressImg=n,this.levelFromImg=a,this.levelToImg=h,this.progressLinePlayer=c,this.progressLineEnemy=u,this.updateLevelCircles(1,2),this.updateProgression(!0,0),this.updateProgression(!1,0),u.visible=!1,this.show(!1)}var e,i,n;return e=t,(i=[{key:"updateLevelCircles",value:function(t,e){this.levelFromImg.text.text=t.toString(),this.levelToImg.text.text=e.toString()}},{key:"updateProgression",value:function(t,e){e=Phaser.Math.Clamp(e,0,1);var i=t?this.progressLinePlayer:this.progressLineEnemy;t||(this.progressLineEnemy.visible=!0),i.x=.5*-this.progressImg.width+e*this.progressImg.width,i.youText&&(i.youText.x=i.x,i.youText.y=i.y-1.2*i.height)}},{key:"show",value:function(t,e){var i=this;if(this.cont.visible!==t)if(e){var n=t?0:1,r=t?1:0;this.cont.visible=!0,t&&(this.cont.scaleX=0),s.a.phaserScene.tweens.add({targets:this.cont,props:{scaleX:{dynamic:!0,value:{getStart:function(t){return i.cont.iSX*n},getEnd:function(t){return i.cont.iSX*r}}}},duration:500,ease:Phaser.Math.Easing.Bounce.Out,easeParams:[5],onComplete:function(){t||(i.cont.visible=!1)}})}else this.cont.visible=t}}])&&I(e.prototype,i),n&&I(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function N(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var z=function(){function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),F=s.a.phaserScene,this.init(),s.a.eventEmitter.on("playBtnClicked",(function(t){e.showResetButton(!0)})),s.a.eventEmitter.on("levelfinished",(function(t){e.hideSettings()}))}var e,i,r;return e=t,(i=[{key:"init",value:function(){var t=this,e=s.a.soundOn,i=s.a.vibrateOn,n=function(t,e){var i=F.add.container(),n=F.add.image(0,0,"uiatlas","smallbg"),r=F.add.image(0,0,"uiatlas",t);return i.add([n,r]),i.width=n.width,i.height=n.height,n.setInteractive(),n.on("pointerdown",(function(t,i,n,r){e(),r.stopPropagation()})),i.icon=r,i.bg=n,i},r=F.add.container();r.setDepth(1);var o=n("settings",(function(){c=!c,o.showThings(c)}));o.showThings=function(t){s.a.phaserScene.tweens.add({targets:[h,l],y:t?0:-150,duration:300,ease:"Sine.easeInOut"})};var a=i?"vibration_on":"vibration_off",h=n(e?"audio_on":"audio_off",(function(){e=!e,t.changeSoundInParams()}));this.setSoundOn=function(){e=!0,t.changeSoundInParams()},this.setSoundOff=function(){e=!1,t.changeSoundInParams()},this.changeSoundInParams=function(){s.a.soundOn=e,h.icon.setFrame(e?"audio_on":"audio_off"),Howler.mute(!e)},window.H5SDK.addEventListener("mute",this.setSoundOff.bind(this)),window.H5SDK.addEventListener("unmute",this.setSoundOn.bind(this));var l=n(a,(function(){i=!i,l.icon.setFrame(i?"vibration_on":"vibration_off"),s.a.vibrateOn=i}));s.a.gpuTier&&!s.a.gpuTier.isMobile&&(l.visible=!1);var u=s.a.phaserScene.add.image(0,0,"uiatlas","retrybutton");u.setInteractive(),u.on("pointerdown",(function(){t.showResetPopup()})),r.add([o,u,h,l]),h.visible=!0,l.x=120,h.x=60,l.y=-150,h.y=l.y;var c=!1;r.onResizeCallback=function(t,e){var i=Math.min(.1*t/o.width,.1*e/o.height);r.setScale(i),r.x=40*i,r.y=40*i,r.defX=r.x},r.onResizeCallback(F.lastWidth,F.lastHeight),this.container=r,this.resetBtn=u,u.visible=!1,this.settingsBtn=o,r.hideSettings=function(){s.a.phaserScene.tweens.add({targets:r,x:-150,alpha:0,duration:300})},r.showSettings=function(){c=!1,h.y=-150,l.y=h.y,s.a.phaserScene.tweens.add({targets:r,x:r.defX,alpha:1,duration:300})},window.H5SDK.getPlatform().isYoutube()&&(r.visible=!1)}},{key:"showResetPopup",value:function(){app.pausegame=!0;var t=s.a.phaserScene,e=t.add.rectangle(0,0,1,1,0,.3);e.onResizeCallback=function(t,i){e.setScale(t,i),e.x=.5*t,e.y=.5*i},e.onResizeCallback(t.lastWidth,t.lastHeight),e.setInteractive(),e.on("pointerdown",(function(){}));var i=new a.a;i.setDepth(200),e.setDepth(199);var r=t.add.image(0,0,"uiatlas","Exit_Bg");r.setOrigin(.5);var h=function(e,i,n){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.5,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:.5,a=t.add.text(0,0,e,{fontSize:n,color:i,stroke:"#000",fontFamily:"ui-font"});return a.setAlign("center"),a.setFontStyle("bold"),a.setOrigin(.5),a.setScale(Math.min(r.displayWidth*s/a.width,r.displayHeight*o/a.height)),a};i.add(r),i.setInitials();var l=h(s.a.locales.EXIT_MSG,"#ffffff",60);l.y=.2*-r.displayHeight;var u=h(s.a.locales.EXIT_MSG_2,"#ffffff",60,.68,.6);u.y=.8*l.getBottomCenter().y+.5*u.displayHeight;var c=o.a.addButton(t,"uiatlas","Exit_Yes",s.a.locales.EXIT_MSG_YES,(function(){H.enableInput(!1),app.beforeAdShown(),H5SDK.getPlatform().notifyLevelEnd(n.a.levelIndex+1,s.a.playerData.bestScore,!1),H5SDK.getAdsModule().requestInterstitialAd().then((function(){app.afterAdShown(),i.hidePopup(),n.a.resetLevel()}))}),{wRatio:.7,hRatio:.7,fontSize:60});c.text.setFontStyle("bold");var d=o.a.addButton(t,"uiatlas","Exit_No",s.a.locales.EXIT_MSG_NO,(function(){i.hidePopup()}),{wRatio:.7,hRatio:.7,fontSize:60});d.text.setFontStyle("bold"),i.hidePopup=function(){app.pausegame=!1,i.destroy(),e.destroy()},c.x=.4*-r.width+.5*c.displayWidth,c.y=.4*r.height-.5*c.displayHeight,d.x=.4*r.width-.5*d.displayWidth,d.y=c.y,i.add([l,u,c,d]),i.setZ(100),i.onResizeCallback=function(t,e){i.setScale(Math.min(.7*t/i.width,.5*e/i.height)),i.x=.5*t,i.y=.5*e},i.onResizeCallback(t.lastWidth,t.lastHeight)}},{key:"showResetButton",value:function(t){this.settingsBtn.showThings(!1),this.resetBtn.visible=t,this.settingsBtn.visible=!1}},{key:"showSettings",value:function(){window.H5SDK.getPlatform().isYoutube()||this.container.showSettings()}},{key:"hideSettings",value:function(){this.container.hideSettings()}}])&&N(e.prototype,i),r&&N(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();function U(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var V=!0,H=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,a;return e=t,a=[{key:"init",value:function(){this.scene=s.a.phaserScene,this.showUpgrades=!0,(0===n.a.resetCount&&0===n.a.levelIndex&&0===s.a.playerData.coin||V)&&(this.showUpgrades=!1),V=!1,this.enableInput(!0),this.drawArea=new b,this.progress=new k,this.introUI=new B.a,this.feedbacks=new D,this.endcard=new L,this.initEvents(),this.settingsUI=new z,this.showUpgrades&&new C({openingScene:!0}).show(!0),s.a.showLevelButtons&&this.addLevelButtons(),this.inputBlocker=null}},{key:"enableInput",value:function(t){t?s.a.phaserScene.input.enable(s.a.phaserScene):s.a.phaserScene.input.disable(s.a.phaserScene)}},{key:"update",value:function(t){}},{key:"createInputBlocker",value:function(t){}},{key:"initEvents",value:function(){var t=this;s.a.eventEmitter.on("playBtnClicked",(function(){t.introUI.playBtn.visible&&(app.playSfx("Button"),t.introUI.show(!1),!s.a.data.skipSearchingOpponent&&r.a.enemy?(t.progress.show(!0,!0),t.createSearchingText()):(t.progress.show(!0,!0),t.drawArea.show(!0,!0)))}))}},{key:"createSearchingText",value:function(){var t=this,e=this.scene.add.text(0,0,s.a.locales.SEARCHING_OPPONENT,{fontSize:60,fontFamily:"ui-font",color:"#ffffff",align:"center"});return e.setOrigin(.5),e.onResizeCallback=function(t,i){e.scale=Math.min(.6*t/e.width,.2*i/e.height),e.x=.5*t,e.y=.65*i,e.iS=e.scale},e.onResizeCallback(this.scene.lastWidth,this.scene.lastHeight),this.scene.tweens.add({targets:e,props:{scale:{dynamic:!0,value:{getStart:function(t){return 0},getEnd:function(t){return e.iS}}}},duration:500,ease:Phaser.Math.Easing.Back.Out,easeParams:[2],onComplete:function(){t.scene.tweens.killTweensOf(e),p.a.makePulse(e,{skalRatio:1.1}),t.scene.time.delayedCall(700,(function(){t.scene.tweens.killTweensOf(e),t.scene.tweens.add({targets:e,scale:0,duration:400,ease:Phaser.Math.Easing.Sine.Out,onComplete:function(){e.visible=!1,s.a.eventEmitter.emit("opponentfound"),t.drawArea.show(!0,!0)}})}))}}),e}},{key:"addLevelButtons",value:function(){var t=s.a.phaserScene,e=function(e,i,n){var r=o.a.addButton(t,"ecWinBtn",null,e,(function(){i()}));return r.alpha=.2,r.onResizeCallback=function(t,e){r.scale=Math.min(.2*t/r.width,.05*e/r.height),n.customResize&&n.customResize(r,t,e)},r.onResizeCallback(t.lastWidth,t.lastHeight),r};e("<=",(function(){n.a.goPrevLevel(!0)}),{customResize:function(t,e,i){t.x=.5*t.displayWidth,t.y=.05*i+.5*t.displayHeight}}),e("O",(function(){n.a.resetLevel()}),{customResize:function(t,e,i){t.x=.5*e,t.y=.05*i+.5*t.displayHeight}}),e("=>",(function(){n.a.goNextLevel(!0)}),{customResize:function(t,e,i){t.x=e-.5*t.displayWidth,t.y=.05*i+.5*t.displayHeight}})}}],(i=null)&&U(e.prototype,i),a&&U(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t}()},function(t,e,i){"use strict";i.d(e,"a",(function(){return F}));var n=i(2),r=i(0),s=i(1),o=i(10),a=i(3),h=i(6),l=i(8),u=i(7);function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function d(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var p=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.size,s=void 0===i?new r.Vector3(1,1,1):i,h=e.callback,l=e.removeOnTouch,d=void 0===l||l,p=e.pos,f=void 0===p?new r.Vector3:p,m=e.fromMesh,g=e.skal,v=void 0===g?new r.Vector3(1,1,1):g;c(this,t),m?this.triggerBody=o.a.createBodyFromObj(m,{sizeVecMult:v}):(this.triggerBody=new n.Body({mass:0,shape:new n.Box((new n.Vec3).copy(s)),type:n.Body.STATIC}),this.triggerBody.position.copy(f),u.a.world.addBody(this.triggerBody)),this.triggerBody.collisionResponse=!1,this.triggerBody.master=this,this.triggerBody.colType=a.a.colTypes.TRIGGER,h&&this.setCallback(h),this.removeOnTouch=d}var e,i,s;return e=t,(i=[{key:"setCallback",value:function(t){this.callback=t}},{key:"onTouch",value:function(t){this.removeOnTouch&&(this.triggerBody.colType=null),this.callback&&this.callback(t)}}])&&d(e.prototype,i),s&&d(e,s),Object.defineProperty(e,"prototype",{writable:!1}),t}(),f=i(4);function m(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var g=function(){function t(e,i){var n=this;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.model=e,this.level=i,h.a.moveToScene(e),this.finalCheckPoint=this.model.name.includes("Finish"),this.model.traverse((function(t){n.model!==t&&(t.name.includes("flag")?n.flag=t:t.name.includes("Floor")||(t.visible=!1))})),this.triggerBody=o.a.createBodyFromObj(this.model),this.triggerBody.colType=a.a.colTypes.TRIGGER,this.triggerBody.master=this,this.triggerBody.collisionResponse=!1,this.finalCheckPoint){var r=this.triggerBody.position.clone();r.x+=10,this.addJumperTrigger(new THREE.Vector3(1,20,5),r)}}var e,i,n;return e=t,(i=[{key:"onTouch",value:function(t){if(!t.killed){this.triggerBody.colType=null,s.a.phaserScene.tweens.add({targets:this.flag.rotation,y:Math.PI/2,duration:600,ease:Phaser.Math.Easing.Back.Out});var e=s.a.locales.CHECKPOINT;this.finalCheckPoint?(e=s.a.locales.WINNER,t.reachedEndFlag(),s.a.eventEmitter.emit("levelfinished",t)):app.playSfx("Checkpoint"),t.isPlayer&&l.a.feedbacks.spawn(e)}}},{key:"addJumperTrigger",value:function(t,e){var i=this;new p({size:t,pos:e,callback:function(t){i.level.levelPlayer&&t!==i.level.levelPlayer||t.doLastJump()}})}}])&&m(e.prototype,i),n&&m(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),v=i(15);i(27),i(23);function y(t){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function x(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function w(t,e){return(w=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function b(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=S(t);if(e){var r=S(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return A(this,i)}}function A(t,e){if(e&&("object"===y(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return T(t)}function T(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function S(t){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var E=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&w(t,e)}(l,t);var e,i,n,h=b(l);function l(t,e){var i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,l),(i=h.call(this)).model=t,i.model.visible=!0,i.add(i.model),i.position.copy(e),s.a.addToGame({obj:T(i),update:!0}),i.body=o.a.createBodyFromObj(T(i),{sizeVecMult:new r.Vector3(2,1,3)}),i.body.collisionResponse=!1,i.body.master=T(i),i.colType=a.a.colTypes.COLLECTIBLE,i.body.colType=i.colType,i.body.master=T(i),i.timer=0,i.orgPosY=i.model.position.y,i.rotSpeed=1,i.heightOffset=.3;var n=i.position.distanceTo(new r.Vector3);return i.model.rotation.y=-n/(2*Math.PI),i}return e=l,(i=[{key:"update",value:function(t){this.model.rotation.y+=1.5*t}},{key:"onTouch",value:function(t){var e=(new r.Vector3).copy(this.body.position);t.onCoinCollected(e),app.playSfx("Coin"),this.remove()}},{key:"remove",value:function(){f.a.removeFromUpdate(this),this.model.visible=!1,this.body.sleep(),this.body.position.set(0,1e3,0),this.body.colType=null}}])&&x(e.prototype,i),n&&x(e,n),Object.defineProperty(e,"prototype",{writable:!1}),l}(r.Object3D);i(35);function M(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var C=function(){function t(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=r.mass,h=void 0===a?.1:a,l=r.isSphere,c=void 0!==l&&l;M(this,t),this.isSphere=c,c?(i=new n.Body({mass:h,shape:new CANNON.Sphere(.4),type:n.Body.DYNAMIC}),u.a.world.addBody(i),i.position.copy(e.position)):(i=o.a.createBodyFromObj(e,{mass:h,type:n.Body.DYNAMIC})).sleep(),this.sleepTimer=0,this.sleepEnd=!1,this.model=e,this.body=i,this.model.body=i,s.a.addToUpdate(e),i.orgPos=i.position.clone(),e.update=this.update.bind(this)}var e,i,r;return e=t,(i=[{key:"update",value:function(t){var e=this.model.body,i=this.model;this.sleepEnd||this.isSphere&&(this.sleepTimer+=t,this.sleepTimer>2.1&&(e.sleep(),this.sleepEnd=!0),e.position.z=e.orgPos.z,i.position.copy(e.position),i.quaternion.copy(e.quaternion)),e.sleepState!==n.Body.SLEEPING&&e.type!==n.Body.STATIC&&(e.position.y<-50&&(e.sleep(),e.type=n.Body.STATIC,this.model.visible=!1),i.position.copy(e.position),i.quaternion.copy(e.quaternion))}}])&&_(e.prototype,i),r&&_(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();i(36);function P(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return R(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return R(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==i.return||i.return()}finally{if(a)throw s}}}}function R(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function L(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function O(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var D,B,I,F=function(){function t(e){var i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length>2?arguments[2]:void 0;L(this,t),this.zOffset=n,this.colliderList=[],this.checkPointList=[],this.coinRef=[],this.keyRef=[];var l=[];this.ballsLocatorList=[],this.waterList=[],this.finalPlatformLocator,this.model=s.a.cloneAsset(e,1),this.model.position.z=this.zOffset,this.killzoneY=(new r.Box3).setFromObject(this.model).min.y-10,this.finishLine=null,s.a.addToGame({obj:this.model}),this.startObj,this.model.statik=!0,this.model.traverse((function(t){t.name.includes("Collider")&&(i.colliderList.push(t),t.visible=!1),"start"===t.name&&(t.visible=!1,i.startObj=t),t.name.includes("Floor")&&t.material&&(t.receiveShadow=!0,t.geometry.computeVertexNormals(),o&&o(t),a.a.rayableList.push(t)),t.name.includes("Winner")&&(i.finishLine=t,t.visible=!1),t.name.includes("_Locater")&&"Object3D"===t.type&&i.checkPointList.push(t),t.name.includes("Coin_ref")&&(i.coinRef.push(t),t.visible=!1),"Winner"===t.name&&(i.finalPlatformLocator=t),t.name.includes("Barriers")&&l.push(t),t.name.includes("Key_Locator")&&(i.keyRef.push(t),t.visible=!1),t.name.includes("Balls_Locator")&&i.ballsLocatorList.push(t),t.name.includes("Water")&&i.waterList.push(t)})),this.handleCollidersSeperate(this.colliderList),this.checkPointList.forEach((function(t){new g(t,i)})),this.addBarriers(l),this.addBalls(),this.initWater(),h.a.moveToScene(this.finishLine),h.a.moveToScene(this.startObj)}var e,i,l;return e=t,(i=[{key:"handleCollidersSeperate",value:function(t){var e=new r.Box3;this.seperateColliders=!0,t.forEach((function(t){var i=o.a.createBodyFromObj(t,{addToWorld:!1});i.material=a.a.kontakMaterials.hard,i.colType=a.a.colTypes.PLATFORM,t.parent.remove(t),t.body=i,e.setFromObject(t),t.curSize=e.getSize(new r.Vector3);var n=i.position.x-t.curSize.x,s=i.position.x+t.curSize.x;t.line={min:n,max:s}}))}},{key:"handleCollidersAsCompound",value:function(t){var e=new n.Body({mass:0,type:n.Body.STATIC,material:a.a.kontakMaterials.hard});e.colType=a.a.colTypes.PLATFORM,t.forEach((function(t){var i=o.a.getShape(t);e.addShape(i.shape,i.offset,i.qut),t.parent.remove(t),t.body=e})),o.a.updateCenterOfMass(e),u.a.world.addBody(e)}},{key:"setLevelPlayer",value:function(t){this.levelPlayer=t,t.setCurrentLevelPlatform(this)}},{key:"enableCollidersForNearestPos",value:function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=P(this.colliderList);try{for(n.s();!(e=n.n()).done;){var r=e.value,s=t.x-i,o=t.x+i,a=!(o<r.line.min||r.line.max<s);a&&(u.a.world.addBody(r.body),r.skip=!0)}}catch(t){n.e(t)}finally{n.f()}}},{key:"enableNearestColliders",value:function(t){if(this.seperateColliders){var e,i=P(this.colliderList);try{for(i.s();!(e=i.n()).done;){var n=e.value;if(!n.skip){var r=this.levelPlayer.position.x-1;this.levelPlayer.position.x+1<n.line.min||n.line.max<r?u.a.world.removeBody(n.body):u.a.world.addBody(n.body)}}}catch(t){i.e(t)}finally{i.f()}}}},{key:"addGameLogo",value:function(t){var e=s.a.getTexture("logo");e.encoding=3001;var i=new r.Mesh(new r.PlaneGeometry(6,6),new r.MeshBasicMaterial({map:e,transparent:!0,opacity:.3,side:THREE.FrontSide}));i.renderOrder=30,s.a.addToGame({obj:i}),i.rotation.x=.15*-Math.PI,i.position.set(2,5,0),t&&(i.position.x=t.x+2,i.position.z=t.z),i.visible=!0,i.updateMatrix(),i.matrixAutoUpdate=!1}},{key:"addFinalPlatform",value:function(t){var e,i=this,n=this.finalPlatformLocator,l=s.a.cloneAsset("finalPlatform",2);h.a.moveToScene(n),l.position.copy(n.position),l.rotation.y=.5*-Math.PI,s.a.addToGame({obj:l});var u=[],c=[];l.traverse((function(i){i.name.includes("Plane")&&(e=i,t&&(i.visible=!1)),i.name.includes("collider")&&(c.push(i),i.visible=!1),i.name.includes("plane_")&&"Object3D"===i.type&&u.push(i),t&&"final"===i.name&&(i.visible=!1)})),t||(e.body=o.a.createBodyFromObj(e),e.body.position.y+=.7,e.body.material=a.a.kontakMaterials.slippery,e.body.colType=a.a.colTypes.PLATFORM,c.forEach((function(t){o.a.createBodyFromObj(t).material=a.a.kontakMaterials.slippery})));for(var d=function(t){var e=u[t];h.a.moveToScene(e);var n=h.a.getModelSize(e).multiplyScalar(.5);n.y=50;var s=e.name,o=s.indexOf("_")+1,l=5*(s.substr(o,s.length-o)-1);l<0&&(l=1),e.coinVal=l,e.confettiList=[],e.planeList=[],e.coinMesh=null;var c={};e.traverse((function(t){t.name.includes("conf")&&e.confettiList.push(t),t.name.includes("point")&&(e.coinMesh=t),t.name.includes("Final_")&&(e.planeList.push(t),t.receiveShadow=!0,t.material&&(c[t.material.name]||(t.material=t.material.clone(),c[t.material.name]=t.material),t.material=c[t.material.name],t.material.emissiveIntensity=0))})),new p({size:n,removeOnTouch:!0,pos:e.position,callback:function(t){if(!i.levelPlayer||t===i.levelPlayer){var n=e.planeList[0].material;n.emissiveIntensity=.4,n.emissive.set("#ffffff");var s=[];e.confettiList.forEach((function(t){var e=t.getWorldPosition(new r.Vector3);e.y+=1.5,s.push(e)})),v.a.spawnConfetti(s,new r.Vector3(0,1,0)),a.a.bonusCollected=e.coinVal}}})},f=0;f<u.length;f++)d(f)}},{key:"addBarriers",value:function(t){t.forEach((function(t){h.a.moveToScene(t),new C(t).body.colType=a.a.colTypes.OBSTACLE}))}},{key:"addBalls",value:function(){for(var t=this,e=s.a.cloneAsset("ballsV",1),i=function(i){var n=t.ballsLocatorList[i];h.a.moveToScene(n),e.position.copy(n.position),s.a.addToGame({obj:e});var r=[];e.traverse((function(t){t.material&&r.push(t)})),r.forEach((function(t,e){e%3==0?(h.a.moveToScene(t),new C(t,{mass:.01,isSphere:!0}).body.colType=a.a.colTypes.OBSTACLE):t.visible=!1})),t.enableCollidersForNearestPos(r[0].position,0)},n=0;n<this.ballsLocatorList.length;n++)i(n)}},{key:"initWater",value:function(){this.waterList.forEach((function(t){var e=t.material;e.color.set("#001299"),e.opacity=.3,t.box3d=(new r.Box3).setFromObject(t),new p({fromMesh:t,callback:function(e){e.onWaterTouched(t)}})}))}},{key:"initCoins",value:function(t){null===t?this.initCoinsSolo():[this.initCoinStreak.bind(this),this.initCoinsSolo.bind(this),this.initCoinsFours.bind(this)][t]()}},{key:"initCoinStreak",value:function(){if(0!==this.coinRef.length)for(var t=this.coinRef[0].getWorldPosition(new r.Vector3),e=s.a.cloneAsset("coin4",1),i=h.a.getModelSize(e),n=function(n){var r=t.clone();r.x+=n*i.x;var s=e.clone();s.position.copy(r);var o=[];s.traverse((function(t){t.material&&o.push(t)})),o.forEach((function(t,e){h.a.moveToScene(t),r.copy(t.position),t.position.set(0,0,0),t.rotation.y=.5*Math.PI,new E(t,r)}))},o=0;o<5;o++)n(o)}},{key:"initCoinsSolo",value:function(){if(0!==this.coinRef.length)for(var t=0;t<this.coinRef.length;t++){var e=this.coinRef[t];h.a.moveToScene(e),e.visible=!1;var i=s.a.cloneAsset("coinSolo",1);i.rotation.y=.5*Math.PI,new E(i,e.position)}}},{key:"initCoinsFours",value:function(){var t=this;if(0!==this.coinRef.length)for(var e=function(e){var i=t.coinRef[e];h.a.moveToScene(i),i.visible=!1;var n=s.a.cloneAsset("coin4",1);n.position.copy(i.position);var r=[];n.traverse((function(t){t.material&&r.push(t)})),r.forEach((function(t,e){h.a.moveToScene(t);var i=t.position.clone();t.position.set(0,0,0),t.rotation.y=.5*Math.PI,new E(t,i)}))},i=0;i<this.coinRef.length;i++)e(i)}},{key:"createPlaneBody",value:function(t){var e=new n.Body({shape:new n.Plane,mass:0,type:n.Body.STATIC});e.quaternion.setFromEuler(.5*-Math.PI,0,0),t&&e.position.copy(t),e.position.y+=1,e.material=a.a.kontakMaterials.hard,u.a.world.addBody(e),this.planeBody=e}},{key:"getFinishPos",value:function(){return this.finishLine.position}},{key:"getKillY",value:function(){return this.killzoneY}}])&&O(e.prototype,i),l&&O(e,l),Object.defineProperty(e,"prototype",{writable:!1}),t}();I={STREAK:0,SOLO:1,FOURS:2},(B="CoinPlacementType")in(D=F)?Object.defineProperty(D,B,{value:I,enumerable:!0,configurable:!0,writable:!0}):D[B]=I},function(t,e,i){"use strict";var n=i(0),r=i(2),s=i(7),o={};function a(t){t.updateWorldMatrix(!0),t.getWorldPosition(t.position),t.getWorldScale(t.scale),t.getWorldQuaternion(t.quaternion),app.globals.main.scene.add(t)}o.updateCenterOfMass=function(t){var e=new r.Vec3;t.shapeOffsets.forEach((function(t){return e.vadd(t,e)})),e.scale(1/t.shapes.length,e),t.shapeOffsets.forEach((function(t){return t.vsub(e,t)}));var i=new r.Vec3;t.vectorToWorldFrame(e,i),t.position.vadd(i,t.position)},o.getShape=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.sizeVecMult,s=void 0===i?new n.Vector3(1,1,1):i,o=e.spherical,h=void 0!==o&&o,l=new n.Box3,u=new n.Vector3,c=t.position.clone(),d=t.quaternion.clone(),p=t.scale.clone(),f=t.parent;a(t);var m=t.position.clone(),g=t.quaternion.clone();t.scale.clone();t.position.set(0,0,0),t.rotation.set(0,0,0),t.updateMatrixWorld(!0),l.setFromObject(t),l.getSize(u);var v;l.getCenter(new n.Vector3);u.multiplyScalar(.5),u.x*=s.x,u.y*=s.y,u.z*=s.z,u.y<.01&&(u.y=.01),v=h?new Sphere(u.x):new r.Box(new r.Vec3(u.x,u.y,u.z)),f&&f.add(t),t.position.copy(c),t.quaternion.copy(d),t.scale.copy(p);var y=(new r.Vec3).copy(m);return{shape:v,offset:y,qut:g}},o.createBodyFromObj=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.mass,o=void 0===i?0:i,h=e.type,l=void 0===h?r.Body.STATIC:h,u=e.addToWorld,c=void 0===u||u,d=e.sizMult,p=void 0===d?1:d,f=e.sizeVecMult,m=void 0===f?new n.Vector3(1,1,1):f,g=e.leaveBodyAtScene,v=void 0!==g&&g,y=e.isTrigger,x=void 0!==y&&y,w=new n.Box3,b=new n.Vector3,A=t.position.clone(),T=t.quaternion.clone(),S=t.scale.clone(),E=t.parent;a(t);var M=t.position.clone(),_=t.quaternion.clone(),C=t.scale.clone();t.position.set(0,0,0),t.rotation.set(0,0,0),t.updateMatrixWorld(!0),w.setFromObject(t),w.getSize(b);var P=w.getCenter(new n.Vector3);b.multiplyScalar(.5*p),b.x*=m.x,b.y*=m.y,b.z*=m.z,b.y<.01&&(b.y=.01);var R=new r.Box(new r.Vec3(b.x,b.y,b.z)),L=new r.Body({mass:o,type:l,isTrigger:x});return x&&(L.collisionResponse=!1),L.bb8Size=b.clone(),L.offsetman=(new r.Vec3).copy(P),L.addShape(R,L.offsetman),L.position.copy(M),L.quaternion.copy(_),v?(t.position.copy(M),t.quaternion.copy(_),t.scale.copy(C)):(E&&E.add(t),t.position.copy(A),t.quaternion.copy(T),t.scale.copy(S)),c&&s.a.world.addBody(L),L},o.bodiesAreInContact=function(t,e){for(var i=0;i<Globals.main.world.contacts.length;i++){var n=Globals.main.world.contacts[i];if(n.bi===t&&n.bj===e||n.bi===e&&n.bj===t)return!0}return!1},o.createBox=function(t){t||(t={});var e=t,i=e.size,n=void 0===i?new r.Vec3(1,1,1):i,s=e.mass,o=void 0===s?.1:s,a=e.type,h=void 0===a?r.Body.STATIC:a,l=e.addToWorld,u=void 0===l||l,c=new r.Body({shape:new r.Box(n),mass:o,type:h});return u&&Globals.main.world.add(c),c},o.calculateVeloToReachTarget=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=arguments.length>3?arguments[3]:void 0,s=new n.Vector3(t.x,t.y,t.z),o=new n.Vector3(e.x,e.y,e.z),a=o.sub(s),h=new n.Vector3(0,1,0).multiplyScalar(Math.sqrt(-2*r*i)),l=new n.Vector3(a.x/(Math.sqrt(-2*i/r)+Math.sqrt(2*(a.y-i)/r)),h.y,a.z/(Math.sqrt(-2*i/r)+Math.sqrt(2*(a.y-i)/r)));return l},e.a=o},function(t,e,i){"use strict";var n=i(17),r={};function s(t,e,i,n,r,s,o,a,h){var l=arguments.length>9&&void 0!==arguments[9]?arguments[9]:0,u=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0;t.fillStyle(r,s),t.lineStyle(o,a,h);var c=.5*-e+l,d=.5*-i+u;if(0==n)t.fillRect(c,d,e,i),o&&t.strokeRect(c,d,e,i);else if(o)if(app.main.hasWebGL)t.fillRoundedRect(c,d,e,i,n,n),e+=.5*o,i+=.5*o,t.strokeRoundedRect(c,d,e,i,n,n);else{var p=e+o,f=i+o;t.fillStyle(a,h),t.fillRoundedRect(.5*-p,.5*-f,p,f,n,n),t.fillStyle(r,s),t.fillRoundedRect(.5*-e,.5*-i,e,i,n,n)}else t.fillRoundedRect(c,d,e,i,n,n)}r.addButton=function(t,e,i,r,s){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},a=o.bgSkal,h=void 0===a?1:a,l=o.textColor,u=void 0===l?"#ffffff":l,c=o.xRatio,d=void 0===c?.5:c,p=o.yRatio,f=void 0===p?.5:p,m=o.wRatio,g=void 0===m?.8:m,v=o.hRatio,y=void 0===v?.8:v,x=o.hasStroke,w=void 0!==x&&x,b=o.strokeColor,A=void 0===b?"#000000":b,T=o.strokePower,S=void 0===T?6:T,E=o.hasShadow,M=void 0!==E&&E,_=o.shadowX,C=void 0===_?0:_,P=o.shadowY,R=void 0===P?8:P,L=o.shadowColor,O=void 0===L?"#333333":L,D=o.shadowBlur,B=void 0===D?2:D,I=o.padding,F=void 0===I?0:I,k=o.fntSize,N=void 0===k?64:k,z=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"Arial",U=new n.a,V=t.add.image(0,0,e,i);V.scale=h;var H=t.add.text(0,0,r,{color:u,align:"center",fontSize:N,fontFamily:z,padding:F}).setOrigin(.5);return w&&H.setStroke(A,S),M&&H.setShadow(C,R,O,B,w,!w),H.setScale(Math.min(V.width*g/H.width,V.height*y/H.height)),H.x=V.width*(d-.5),H.y=V.height*(f-.5),U.add(V),U.setInitials(),U.add(H),U.bg=V,U.text=H,U.width=V.width,U.height=V.height,s&&(V.setInteractive(),V.on("pointerdown",(function(t,e,i,n){s()}))),U},r.addGraphicsButton=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#ffffff",n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{color:10027008,width:400,height:80,opacity:1,roundCorners:0,stroke:0,strokeColor:0,strokeOpacity:1,shadowX:0,shadowY:5,shadowColor:0,shadowOpacity:.5},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{xRatio:.5,yRatio:.45,wRatio:.8,hRatio:.8,hasStroke:!0,strokeColor:"#000000",strokePower:6,hasShadow:!0,shadowX:0,shadowY:8,shadowColor:"#333333",shadowBlur:2};r.stroke=r.stroke||0;var a=t.add.container(),h=t.add.graphics();h.width=r.width,h.height=r.height,(r.shadowX||r.shadowY)&&s(h,r.width+2*r.stroke,r.height+2*r.stroke,r.roundCorners,r.shadowColor,r.shadowOpacity,null,0,0,r.shadowX,r.shadowY),s(h,r.width,r.height,r.roundCorners,r.color,r.opacity,r.stroke,r.strokeColor,r.strokeOpacity);var l=t.add.text(0,0,e,{color:i,align:"center",fontSize:64,fontFamily:"Arial"}).setOrigin(.5);o.hasStroke&&l.setStroke(o.strokeColor,o.strokePower),o.hasShadow&&l.setShadow(o.shadowX,o.shadowY,o.shadowColor,o.shadowBlur,o.hasStroke,!o.hasStroke);var u=o;return l.setScale(Math.min(h.width*u.wRatio/l.width,h.height*u.hRatio/l.height)),l.x=h.width*(u.xRatio-.5),l.y=h.height*(u.yRatio-.5),a.add(h),a.add(l),a.bg=h,a.text=l,a.width=h.width,a.height=h.height,n&&(a.setInteractive(new Phaser.Geom.Rectangle(0,0,r.width,r.height),Phaser.Geom.Rectangle.Contains),a.on("pointerdown",n)),a},e.a=r},function(t,e,i){"use strict";i.d(e,"a",(function(){return T}));class n{constructor(t,e,i,r,s="div"){this.parent=t,this.object=e,this.property=i,this._disabled=!1,this.initialValue=this.getValue(),this.domElement=document.createElement("div"),this.domElement.classList.add("controller"),this.domElement.classList.add(r),this.$name=document.createElement("div"),this.$name.classList.add("name"),n.nextNameID=n.nextNameID||0,this.$name.id="lil-gui-name-"+ ++n.nextNameID,this.$widget=document.createElement(s),this.$widget.classList.add("widget"),this.$disable=this.$widget,this.domElement.appendChild(this.$name),this.domElement.appendChild(this.$widget),this.parent.children.push(this),this.parent.controllers.push(this),this.parent.$children.appendChild(this.domElement),this._listenCallback=this._listenCallback.bind(this),this.name(i)}name(t){return this._name=t,this.$name.innerHTML=t,this}onChange(t){return this._onChange=t,this}_callOnChange(){this.parent._callOnChange(this),void 0!==this._onChange&&this._onChange.call(this,this.getValue()),this._changed=!0}onFinishChange(t){return this._onFinishChange=t,this}_callOnFinishChange(){this._changed&&(this.parent._callOnFinishChange(this),void 0!==this._onFinishChange&&this._onFinishChange.call(this,this.getValue())),this._changed=!1}reset(){return this.setValue(this.initialValue),this._callOnFinishChange(),this}enable(t=!0){return this.disable(!t)}disable(t=!0){return t===this._disabled||(this._disabled=t,this.domElement.classList.toggle("disabled",t),this.$disable.toggleAttribute("disabled",t)),this}options(t){const e=this.parent.add(this.object,this.property,t);return e.name(this._name),this.destroy(),e}min(t){return this}max(t){return this}step(t){return this}listen(t=!0){return this._listening=t,void 0!==this._listenCallbackID&&(cancelAnimationFrame(this._listenCallbackID),this._listenCallbackID=void 0),this._listening&&this._listenCallback(),this}_listenCallback(){this._listenCallbackID=requestAnimationFrame(this._listenCallback);const t=this.save();t!==this._listenPrevValue&&this.updateDisplay(),this._listenPrevValue=t}getValue(){return this.object[this.property]}setValue(t){return this.object[this.property]=t,this._callOnChange(),this.updateDisplay(),this}updateDisplay(){return this}load(t){return this.setValue(t),this._callOnFinishChange(),this}save(){return this.getValue()}destroy(){this.listen(!1),this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.controllers.splice(this.parent.controllers.indexOf(this),1),this.parent.$children.removeChild(this.domElement)}}class r extends n{constructor(t,e,i){super(t,e,i,"boolean","label"),this.$input=document.createElement("input"),this.$input.setAttribute("type","checkbox"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$input.addEventListener("change",()=>{this.setValue(this.$input.checked),this._callOnFinishChange()}),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.checked=this.getValue(),this}}function s(t){let e,i;return(e=t.match(/(#|0x)?([a-f0-9]{6})/i))?i=e[2]:(e=t.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))?i=parseInt(e[1]).toString(16).padStart(2,0)+parseInt(e[2]).toString(16).padStart(2,0)+parseInt(e[3]).toString(16).padStart(2,0):(e=t.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))&&(i=e[1]+e[1]+e[2]+e[2]+e[3]+e[3]),!!i&&"#"+i}const o={isPrimitive:!0,match:t=>"string"==typeof t,fromHexString:s,toHexString:s},a={isPrimitive:!0,match:t=>"number"==typeof t,fromHexString:t=>parseInt(t.substring(1),16),toHexString:t=>"#"+t.toString(16).padStart(6,0)},h={isPrimitive:!1,match:Array.isArray,fromHexString(t,e,i=1){const n=a.fromHexString(t);e[0]=(n>>16&255)/255*i,e[1]=(n>>8&255)/255*i,e[2]=(255&n)/255*i},toHexString:([t,e,i],n=1)=>a.toHexString(t*(n=255/n)<<16^e*n<<8^i*n<<0)},l={isPrimitive:!1,match:t=>Object(t)===t,fromHexString(t,e,i=1){const n=a.fromHexString(t);e.r=(n>>16&255)/255*i,e.g=(n>>8&255)/255*i,e.b=(255&n)/255*i},toHexString:({r:t,g:e,b:i},n=1)=>a.toHexString(t*(n=255/n)<<16^e*n<<8^i*n<<0)},u=[o,a,h,l];class c extends n{constructor(t,e,i,n){var r;super(t,e,i,"color"),this.$input=document.createElement("input"),this.$input.setAttribute("type","color"),this.$input.setAttribute("tabindex",-1),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$text=document.createElement("input"),this.$text.setAttribute("type","text"),this.$text.setAttribute("spellcheck","false"),this.$text.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this.$display.appendChild(this.$input),this.$widget.appendChild(this.$display),this.$widget.appendChild(this.$text),this._format=(r=this.initialValue,u.find(t=>t.match(r))),this._rgbScale=n,this._initialValueHexString=this.save(),this._textFocused=!1,this.$input.addEventListener("input",()=>{this._setValueFromHexString(this.$input.value)}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$text.addEventListener("input",()=>{const t=s(this.$text.value);t&&this._setValueFromHexString(t)}),this.$text.addEventListener("focus",()=>{this._textFocused=!0,this.$text.select()}),this.$text.addEventListener("blur",()=>{this._textFocused=!1,this.updateDisplay(),this._callOnFinishChange()}),this.$disable=this.$text,this.updateDisplay()}reset(){return this._setValueFromHexString(this._initialValueHexString),this}_setValueFromHexString(t){if(this._format.isPrimitive){const e=this._format.fromHexString(t);this.setValue(e)}else this._format.fromHexString(t,this.getValue(),this._rgbScale),this._callOnChange(),this.updateDisplay()}save(){return this._format.toHexString(this.getValue(),this._rgbScale)}load(t){return this._setValueFromHexString(t),this._callOnFinishChange(),this}updateDisplay(){return this.$input.value=this._format.toHexString(this.getValue(),this._rgbScale),this._textFocused||(this.$text.value=this.$input.value.substring(1)),this.$display.style.backgroundColor=this.$input.value,this}}class d extends n{constructor(t,e,i){super(t,e,i,"function"),this.$button=document.createElement("button"),this.$button.appendChild(this.$name),this.$widget.appendChild(this.$button),this.$button.addEventListener("click",t=>{t.preventDefault(),this.getValue().call(this.object)}),this.$button.addEventListener("touchstart",()=>{},{passive:!0}),this.$disable=this.$button}}class p extends n{constructor(t,e,i,n,r,s){super(t,e,i,"number"),this._initInput(),this.min(n),this.max(r);const o=void 0!==s;this.step(o?s:this._getImplicitStep(),o),this.updateDisplay()}min(t){return this._min=t,this._onUpdateMinMax(),this}max(t){return this._max=t,this._onUpdateMinMax(),this}step(t,e=!0){return this._step=t,this._stepExplicit=e,this}updateDisplay(){const t=this.getValue();if(this._hasSlider){let e=(t-this._min)/(this._max-this._min);e=Math.max(0,Math.min(e,1)),this.$fill.style.width=100*e+"%"}return this._inputFocused||(this.$input.value=t),this}_initInput(){this.$input=document.createElement("input"),this.$input.setAttribute("type","number"),this.$input.setAttribute("step","any"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$widget.appendChild(this.$input),this.$disable=this.$input;const t=t=>{const e=parseFloat(this.$input.value);isNaN(e)||(this._snapClampSetValue(e+t),this.$input.value=this.getValue())};let e,i,n,r,s,o=!1;const a=t=>{if(o){const n=t.clientX-e,r=t.clientY-i;Math.abs(r)>5?(t.preventDefault(),this.$input.blur(),o=!1,this._setDraggingStyle(!0,"vertical")):Math.abs(n)>5&&h()}if(!o){const e=t.clientY-n;s-=e*this._step*this._arrowKeyMultiplier(t),r+s>this._max?s=this._max-r:r+s<this._min&&(s=this._min-r),this._snapClampSetValue(r+s)}n=t.clientY},h=()=>{this._setDraggingStyle(!1,"vertical"),this._callOnFinishChange(),window.removeEventListener("mousemove",a),window.removeEventListener("mouseup",h)};this.$input.addEventListener("input",()=>{const t=parseFloat(this.$input.value);isNaN(t)||this.setValue(this._clamp(t))}),this.$input.addEventListener("keydown",e=>{"Enter"===e.code&&this.$input.blur(),"ArrowUp"===e.code&&(e.preventDefault(),t(this._step*this._arrowKeyMultiplier(e))),"ArrowDown"===e.code&&(e.preventDefault(),t(this._step*this._arrowKeyMultiplier(e)*-1))}),this.$input.addEventListener("wheel",e=>{this._inputFocused&&(e.preventDefault(),t(this._step*this._normalizeMouseWheel(e)))},{passive:!1}),this.$input.addEventListener("mousedown",t=>{e=t.clientX,i=n=t.clientY,o=!0,r=this.getValue(),s=0,window.addEventListener("mousemove",a),window.addEventListener("mouseup",h)}),this.$input.addEventListener("focus",()=>{this._inputFocused=!0}),this.$input.addEventListener("blur",()=>{this._inputFocused=!1,this.updateDisplay(),this._callOnFinishChange()})}_initSlider(){this._hasSlider=!0,this.$slider=document.createElement("div"),this.$slider.classList.add("slider"),this.$fill=document.createElement("div"),this.$fill.classList.add("fill"),this.$slider.appendChild(this.$fill),this.$widget.insertBefore(this.$slider,this.$input),this.domElement.classList.add("hasSlider");const t=t=>{const e=this.$slider.getBoundingClientRect();let i=(n=t,r=e.left,s=e.right,o=this._min,a=this._max,(n-r)/(s-r)*(a-o)+o);var n,r,s,o,a;this._snapClampSetValue(i)},e=e=>{t(e.clientX)},i=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",i)};let n,r,s=!1;const o=e=>{e.preventDefault(),this._setDraggingStyle(!0),t(e.touches[0].clientX),s=!1},a=e=>{if(s){const t=e.touches[0].clientX-n,i=e.touches[0].clientY-r;Math.abs(t)>Math.abs(i)?o(e):(window.removeEventListener("touchmove",a),window.removeEventListener("touchend",h))}else e.preventDefault(),t(e.touches[0].clientX)},h=()=>{this._callOnFinishChange(),this._setDraggingStyle(!1),window.removeEventListener("touchmove",a),window.removeEventListener("touchend",h)},l=this._callOnFinishChange.bind(this);let u;this.$slider.addEventListener("mousedown",n=>{this._setDraggingStyle(!0),t(n.clientX),window.addEventListener("mousemove",e),window.addEventListener("mouseup",i)}),this.$slider.addEventListener("touchstart",t=>{t.touches.length>1||(this._hasScrollBar?(n=t.touches[0].clientX,r=t.touches[0].clientY,s=!0):o(t),window.addEventListener("touchmove",a),window.addEventListener("touchend",h))},{passive:!1}),this.$slider.addEventListener("wheel",t=>{if(Math.abs(t.deltaX)<Math.abs(t.deltaY)&&this._hasScrollBar)return;t.preventDefault();const e=this._normalizeMouseWheel(t)*this._step;this._snapClampSetValue(this.getValue()+e),this.$input.value=this.getValue(),clearTimeout(u),u=setTimeout(l,400)},{passive:!1})}_setDraggingStyle(t,e="horizontal"){this.$slider&&this.$slider.classList.toggle("active",t),document.body.classList.toggle("lil-gui-dragging",t),document.body.classList.toggle("lil-gui-"+e,t)}_getImplicitStep(){return this._hasMin&&this._hasMax?(this._max-this._min)/1e3:.1}_onUpdateMinMax(){!this._hasSlider&&this._hasMin&&this._hasMax&&(this._stepExplicit||this.step(this._getImplicitStep(),!1),this._initSlider(),this.updateDisplay())}_normalizeMouseWheel(t){let{deltaX:e,deltaY:i}=t;Math.floor(t.deltaY)!==t.deltaY&&t.wheelDelta&&(e=0,i=-t.wheelDelta/120,i*=this._stepExplicit?1:10);return e+-i}_arrowKeyMultiplier(t){let e=this._stepExplicit?1:10;return t.shiftKey?e*=10:t.altKey&&(e/=10),e}_snap(t){const e=Math.round(t/this._step)*this._step;return parseFloat(e.toPrecision(15))}_clamp(t){return t<this._min&&(t=this._min),t>this._max&&(t=this._max),t}_snapClampSetValue(t){this.setValue(this._clamp(this._snap(t)))}get _hasScrollBar(){const t=this.parent.root.$children;return t.scrollHeight>t.clientHeight}get _hasMin(){return void 0!==this._min}get _hasMax(){return void 0!==this._max}}class f extends n{constructor(t,e,i,n){super(t,e,i,"option"),this.$select=document.createElement("select"),this.$select.setAttribute("aria-labelledby",this.$name.id),this.$display=document.createElement("div"),this.$display.classList.add("display"),this._values=Array.isArray(n)?n:Object.values(n),this._names=Array.isArray(n)?n:Object.keys(n),this._names.forEach(t=>{const e=document.createElement("option");e.innerHTML=t,this.$select.appendChild(e)}),this.$select.addEventListener("change",()=>{this.setValue(this._values[this.$select.selectedIndex]),this._callOnFinishChange()}),this.$select.addEventListener("focus",()=>{this.$display.classList.add("focus")}),this.$select.addEventListener("blur",()=>{this.$display.classList.remove("focus")}),this.$widget.appendChild(this.$select),this.$widget.appendChild(this.$display),this.$disable=this.$select,this.updateDisplay()}updateDisplay(){const t=this.getValue(),e=this._values.indexOf(t);return this.$select.selectedIndex=e,this.$display.innerHTML=-1===e?t:this._names[e],this}}class m extends n{constructor(t,e,i){super(t,e,i,"string"),this.$input=document.createElement("input"),this.$input.setAttribute("type","text"),this.$input.setAttribute("aria-labelledby",this.$name.id),this.$input.addEventListener("input",()=>{this.setValue(this.$input.value)}),this.$input.addEventListener("keydown",t=>{"Enter"===t.code&&this.$input.blur()}),this.$input.addEventListener("blur",()=>{this._callOnFinishChange()}),this.$widget.appendChild(this.$input),this.$disable=this.$input,this.updateDisplay()}updateDisplay(){return this.$input.value=this.getValue(),this}}let g=!1;class v{constructor({parent:t,autoPlace:e=void 0===t,container:i,width:n,title:r="Controls",injectStyles:s=!0,touchStyles:o=!0}={}){if(this.parent=t,this.root=t?t.root:this,this.children=[],this.controllers=[],this.folders=[],this._closed=!1,this._hidden=!1,this.domElement=document.createElement("div"),this.domElement.classList.add("lil-gui"),this.$title=document.createElement("div"),this.$title.classList.add("title"),this.$title.setAttribute("role","button"),this.$title.setAttribute("aria-expanded",!0),this.$title.setAttribute("tabindex",0),this.$title.addEventListener("click",()=>this.openAnimated(this._closed)),this.$title.addEventListener("keydown",t=>{"Enter"!==t.code&&"Space"!==t.code||(t.preventDefault(),this.$title.click())}),this.$title.addEventListener("touchstart",()=>{},{passive:!0}),this.$children=document.createElement("div"),this.$children.classList.add("children"),this.domElement.appendChild(this.$title),this.domElement.appendChild(this.$children),this.title(r),o&&this.domElement.classList.add("allow-touch-styles"),this.parent)return this.parent.children.push(this),this.parent.folders.push(this),void this.parent.$children.appendChild(this.domElement);this.domElement.classList.add("root"),!g&&s&&(!function(t){const e=document.createElement("style");e.innerHTML=t;const i=document.querySelector("head link[rel=stylesheet], head style");i?document.head.insertBefore(e,i):document.head.appendChild(e)}('.lil-gui {\n font-family: var(--font-family);\n font-size: var(--font-size);\n line-height: 1;\n font-weight: normal;\n font-style: normal;\n text-align: left;\n background-color: var(--background-color);\n color: var(--text-color);\n user-select: none;\n -webkit-user-select: none;\n touch-action: manipulation;\n --background-color: #1f1f1f;\n --text-color: #ebebeb;\n --title-background-color: #111111;\n --title-text-color: #ebebeb;\n --widget-color: #424242;\n --hover-color: #4f4f4f;\n --focus-color: #595959;\n --number-color: #2cc9ff;\n --string-color: #a2db3c;\n --font-size: 11px;\n --input-font-size: 11px;\n --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;\n --font-family-mono: Menlo, Monaco, Consolas, "Droid Sans Mono", monospace;\n --padding: 4px;\n --spacing: 4px;\n --widget-height: 20px;\n --name-width: 45%;\n --slider-knob-width: 2px;\n --slider-input-width: 27%;\n --color-input-width: 27%;\n --slider-input-min-width: 45px;\n --color-input-min-width: 45px;\n --folder-indent: 7px;\n --widget-padding: 0 0 0 3px;\n --widget-border-radius: 2px;\n --checkbox-size: calc(0.75 * var(--widget-height));\n --scrollbar-width: 5px;\n}\n.lil-gui, .lil-gui * {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n.lil-gui.root {\n width: var(--width, 245px);\n display: flex;\n flex-direction: column;\n}\n.lil-gui.root > .title {\n background: var(--title-background-color);\n color: var(--title-text-color);\n}\n.lil-gui.root > .children {\n overflow-x: hidden;\n overflow-y: auto;\n}\n.lil-gui.root > .children::-webkit-scrollbar {\n width: var(--scrollbar-width);\n height: var(--scrollbar-width);\n background: var(--background-color);\n}\n.lil-gui.root > .children::-webkit-scrollbar-thumb {\n border-radius: var(--scrollbar-width);\n background: var(--focus-color);\n}\n@media (pointer: coarse) {\n .lil-gui.allow-touch-styles {\n --widget-height: 28px;\n --padding: 6px;\n --spacing: 6px;\n --font-size: 13px;\n --input-font-size: 16px;\n --folder-indent: 10px;\n --scrollbar-width: 7px;\n --slider-input-min-width: 50px;\n --color-input-min-width: 65px;\n }\n}\n.lil-gui.force-touch-styles {\n --widget-height: 28px;\n --padding: 6px;\n --spacing: 6px;\n --font-size: 13px;\n --input-font-size: 16px;\n --folder-indent: 10px;\n --scrollbar-width: 7px;\n --slider-input-min-width: 50px;\n --color-input-min-width: 65px;\n}\n.lil-gui.autoPlace {\n max-height: 100%;\n position: fixed;\n top: 0;\n right: 15px;\n z-index: 1001;\n}\n\n.lil-gui .controller {\n display: flex;\n align-items: center;\n padding: 0 var(--padding);\n margin: var(--spacing) 0;\n}\n.lil-gui .controller.disabled {\n opacity: 0.5;\n}\n.lil-gui .controller.disabled, .lil-gui .controller.disabled * {\n pointer-events: none !important;\n}\n.lil-gui .controller > .name {\n min-width: var(--name-width);\n flex-shrink: 0;\n white-space: pre;\n padding-right: var(--spacing);\n line-height: var(--widget-height);\n}\n.lil-gui .controller .widget {\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n min-height: var(--widget-height);\n}\n.lil-gui .controller.string input {\n color: var(--string-color);\n}\n.lil-gui .controller.boolean .widget {\n cursor: pointer;\n}\n.lil-gui .controller.color .display {\n width: 100%;\n height: var(--widget-height);\n border-radius: var(--widget-border-radius);\n position: relative;\n}\n@media (hover: hover) {\n .lil-gui .controller.color .display:hover:before {\n content: " ";\n display: block;\n position: absolute;\n border-radius: var(--widget-border-radius);\n border: 1px solid #fff9;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n }\n}\n.lil-gui .controller.color input[type=color] {\n opacity: 0;\n width: 100%;\n height: 100%;\n cursor: pointer;\n}\n.lil-gui .controller.color input[type=text] {\n margin-left: var(--spacing);\n font-family: var(--font-family-mono);\n min-width: var(--color-input-min-width);\n width: var(--color-input-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.option select {\n opacity: 0;\n position: absolute;\n width: 100%;\n max-width: 100%;\n}\n.lil-gui .controller.option .display {\n position: relative;\n pointer-events: none;\n border-radius: var(--widget-border-radius);\n height: var(--widget-height);\n line-height: var(--widget-height);\n max-width: 100%;\n overflow: hidden;\n word-break: break-all;\n padding-left: 0.55em;\n padding-right: 1.75em;\n background: var(--widget-color);\n}\n@media (hover: hover) {\n .lil-gui .controller.option .display.focus {\n background: var(--focus-color);\n }\n}\n.lil-gui .controller.option .display.active {\n background: var(--focus-color);\n}\n.lil-gui .controller.option .display:after {\n font-family: "lil-gui";\n content: "↕";\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n padding-right: 0.375em;\n}\n.lil-gui .controller.option .widget,\n.lil-gui .controller.option select {\n cursor: pointer;\n}\n@media (hover: hover) {\n .lil-gui .controller.option .widget:hover .display {\n background: var(--hover-color);\n }\n}\n.lil-gui .controller.number input {\n color: var(--number-color);\n}\n.lil-gui .controller.number.hasSlider input {\n margin-left: var(--spacing);\n width: var(--slider-input-width);\n min-width: var(--slider-input-min-width);\n flex-shrink: 0;\n}\n.lil-gui .controller.number .slider {\n width: 100%;\n height: var(--widget-height);\n background-color: var(--widget-color);\n border-radius: var(--widget-border-radius);\n padding-right: var(--slider-knob-width);\n overflow: hidden;\n cursor: ew-resize;\n touch-action: pan-y;\n}\n@media (hover: hover) {\n .lil-gui .controller.number .slider:hover {\n background-color: var(--hover-color);\n }\n}\n.lil-gui .controller.number .slider.active {\n background-color: var(--focus-color);\n}\n.lil-gui .controller.number .slider.active .fill {\n opacity: 0.95;\n}\n.lil-gui .controller.number .fill {\n height: 100%;\n border-right: var(--slider-knob-width) solid var(--number-color);\n box-sizing: content-box;\n}\n\n.lil-gui-dragging .lil-gui {\n --hover-color: var(--widget-color);\n}\n.lil-gui-dragging * {\n cursor: ew-resize !important;\n}\n\n.lil-gui-dragging.lil-gui-vertical * {\n cursor: ns-resize !important;\n}\n\n.lil-gui .title {\n --title-height: calc(var(--widget-height) + var(--spacing) * 1.25);\n height: var(--title-height);\n line-height: calc(var(--title-height) - 4px);\n font-weight: 600;\n padding: 0 var(--padding);\n -webkit-tap-highlight-color: transparent;\n cursor: pointer;\n outline: none;\n text-decoration-skip: objects;\n}\n.lil-gui .title:before {\n font-family: "lil-gui";\n content: "▾";\n padding-right: 2px;\n display: inline-block;\n}\n.lil-gui .title:active {\n background: var(--title-background-color);\n opacity: 0.75;\n}\n@media (hover: hover) {\n body:not(.lil-gui-dragging) .lil-gui .title:hover {\n background: var(--title-background-color);\n opacity: 0.85;\n }\n .lil-gui .title:focus {\n text-decoration: underline var(--focus-color);\n }\n}\n.lil-gui.root > .title:focus {\n text-decoration: none !important;\n}\n.lil-gui.closed > .title:before {\n content: "▸";\n}\n.lil-gui.closed > .children {\n transform: translateY(-7px);\n opacity: 0;\n}\n.lil-gui.closed:not(.transition) > .children {\n display: none;\n}\n.lil-gui.transition > .children {\n transition-duration: 300ms;\n transition-property: height, opacity, transform;\n transition-timing-function: cubic-bezier(0.2, 0.6, 0.35, 1);\n overflow: hidden;\n pointer-events: none;\n}\n.lil-gui .children:empty:before {\n content: "Empty";\n padding: 0 var(--padding);\n margin: var(--spacing) 0;\n display: block;\n height: var(--widget-height);\n font-style: italic;\n line-height: var(--widget-height);\n opacity: 0.5;\n}\n.lil-gui.root > .children > .lil-gui > .title {\n border: 0 solid var(--widget-color);\n border-width: 1px 0;\n transition: border-color 300ms;\n}\n.lil-gui.root > .children > .lil-gui.closed > .title {\n border-bottom-color: transparent;\n}\n.lil-gui + .controller {\n border-top: 1px solid var(--widget-color);\n margin-top: 0;\n padding-top: var(--spacing);\n}\n.lil-gui .lil-gui .lil-gui > .title {\n border: none;\n}\n.lil-gui .lil-gui .lil-gui > .children {\n border: none;\n margin-left: var(--folder-indent);\n border-left: 2px solid var(--widget-color);\n}\n.lil-gui .lil-gui .controller {\n border: none;\n}\n\n.lil-gui input {\n -webkit-tap-highlight-color: transparent;\n border: 0;\n outline: none;\n font-family: var(--font-family);\n font-size: var(--input-font-size);\n border-radius: var(--widget-border-radius);\n height: var(--widget-height);\n background: var(--widget-color);\n color: var(--text-color);\n width: 100%;\n}\n@media (hover: hover) {\n .lil-gui input:hover {\n background: var(--hover-color);\n }\n .lil-gui input:active {\n background: var(--focus-color);\n }\n}\n.lil-gui input:disabled {\n opacity: 1;\n}\n.lil-gui input[type=text],\n.lil-gui input[type=number] {\n padding: var(--widget-padding);\n}\n.lil-gui input[type=text]:focus,\n.lil-gui input[type=number]:focus {\n background: var(--focus-color);\n}\n.lil-gui input::-webkit-outer-spin-button,\n.lil-gui input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n.lil-gui input[type=number] {\n -moz-appearance: textfield;\n}\n.lil-gui input[type=checkbox] {\n appearance: none;\n -webkit-appearance: none;\n height: var(--checkbox-size);\n width: var(--checkbox-size);\n border-radius: var(--widget-border-radius);\n text-align: center;\n cursor: pointer;\n}\n.lil-gui input[type=checkbox]:checked:before {\n font-family: "lil-gui";\n content: "✓";\n font-size: var(--checkbox-size);\n line-height: var(--checkbox-size);\n}\n@media (hover: hover) {\n .lil-gui input[type=checkbox]:focus {\n box-shadow: inset 0 0 0 1px var(--focus-color);\n }\n}\n.lil-gui button {\n -webkit-tap-highlight-color: transparent;\n outline: none;\n cursor: pointer;\n font-family: var(--font-family);\n font-size: var(--font-size);\n color: var(--text-color);\n width: 100%;\n height: var(--widget-height);\n text-transform: none;\n background: var(--widget-color);\n border-radius: var(--widget-border-radius);\n border: 1px solid var(--widget-color);\n text-align: center;\n line-height: calc(var(--widget-height) - 4px);\n}\n@media (hover: hover) {\n .lil-gui button:hover {\n background: var(--hover-color);\n border-color: var(--hover-color);\n }\n .lil-gui button:focus {\n border-color: var(--focus-color);\n }\n}\n.lil-gui button:active {\n background: var(--focus-color);\n}\n\n@font-face {\n font-family: "lil-gui";\n src: url("data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAUsAAsAAAAACJwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAAH4AAADAImwmYE9TLzIAAAGIAAAAPwAAAGBKqH5SY21hcAAAAcgAAAD0AAACrukyyJBnbHlmAAACvAAAAF8AAACEIZpWH2hlYWQAAAMcAAAAJwAAADZfcj2zaGhlYQAAA0QAAAAYAAAAJAC5AHhobXR4AAADXAAAABAAAABMAZAAAGxvY2EAAANsAAAAFAAAACgCEgIybWF4cAAAA4AAAAAeAAAAIAEfABJuYW1lAAADoAAAASIAAAIK9SUU/XBvc3QAAATEAAAAZgAAAJCTcMc2eJxVjbEOgjAURU+hFRBK1dGRL+ALnAiToyMLEzFpnPz/eAshwSa97517c/MwwJmeB9kwPl+0cf5+uGPZXsqPu4nvZabcSZldZ6kfyWnomFY/eScKqZNWupKJO6kXN3K9uCVoL7iInPr1X5baXs3tjuMqCtzEuagm/AAlzQgPAAB4nGNgYRBlnMDAysDAYM/gBiT5oLQBAwuDJAMDEwMrMwNWEJDmmsJwgCFeXZghBcjlZMgFCzOiKOIFAB71Bb8AeJy1kjFuwkAQRZ+DwRAwBtNQRUGKQ8OdKCAWUhAgKLhIuAsVSpWz5Bbkj3dEgYiUIszqWdpZe+Z7/wB1oCYmIoboiwiLT2WjKl/jscrHfGg/pKdMkyklC5Zs2LEfHYpjcRoPzme9MWWmk3dWbK9ObkWkikOetJ554fWyoEsmdSlt+uR0pCJR34b6t/TVg1SY3sYvdf8vuiKrpyaDXDISiegp17p7579Gp3p++y7HPAiY9pmTibljrr85qSidtlg4+l25GLCaS8e6rRxNBmsnERunKbaOObRz7N72ju5vdAjYpBXHgJylOAVsMseDAPEP8LYoUHicY2BiAAEfhiAGJgZWBgZ7RnFRdnVJELCQlBSRlATJMoLV2DK4glSYs6ubq5vbKrJLSbGrgEmovDuDJVhe3VzcXFwNLCOILB/C4IuQ1xTn5FPilBTj5FPmBAB4WwoqAHicY2BkYGAA4sk1sR/j+W2+MnAzpDBgAyEMQUCSg4EJxAEAwUgFHgB4nGNgZGBgSGFggJMhDIwMqEAYAByHATJ4nGNgAIIUNEwmAABl3AGReJxjYAACIQYlBiMGJ3wQAEcQBEV4nGNgZGBgEGZgY2BiAAEQyQWEDAz/wXwGAAsPATIAAHicXdBNSsNAHAXwl35iA0UQXYnMShfS9GPZA7T7LgIu03SSpkwzYTIt1BN4Ak/gKTyAeCxfw39jZkjymzcvAwmAW/wgwHUEGDb36+jQQ3GXGot79L24jxCP4gHzF/EIr4jEIe7wxhOC3g2TMYy4Q7+Lu/SHuEd/ivt4wJd4wPxbPEKMX3GI5+DJFGaSn4qNzk8mcbKSR6xdXdhSzaOZJGtdapd4vVPbi6rP+cL7TGXOHtXKll4bY1Xl7EGnPtp7Xy2n00zyKLVHfkHBa4IcJ2oD3cgggWvt/V/FbDrUlEUJhTn/0azVWbNTNr0Ens8de1tceK9xZmfB1CPjOmPH4kitmvOubcNpmVTN3oFJyjzCvnmrwhJTzqzVj9jiSX911FjeAAB4nG3HMRKCMBBA0f0giiKi4DU8k0V2GWbIZDOh4PoWWvq6J5V8If9NVNQcaDhyouXMhY4rPTcG7jwYmXhKq8Wz+p762aNaeYXom2n3m2dLTVgsrCgFJ7OTmIkYbwIbC6vIB7WmFfAAAA==") format("woff");\n}'),g=!0),i?i.appendChild(this.domElement):e&&(this.domElement.classList.add("autoPlace"),document.body.appendChild(this.domElement)),n&&this.domElement.style.setProperty("--width",n+"px"),this.domElement.addEventListener("keydown",t=>t.stopPropagation()),this.domElement.addEventListener("keyup",t=>t.stopPropagation())}add(t,e,i,n,s){if(Object(i)===i)return new f(this,t,e,i);switch(typeof t[e]){case"number":return new p(this,t,e,i,n,s);case"boolean":return new r(this,t,e);case"string":return new m(this,t,e);case"function":return new d(this,t,e)}}addColor(t,e,i=1){return new c(this,t,e,i)}addFolder(t){return new v({parent:this,title:t})}load(t,e=!0){return t.controllers&&this.controllers.forEach(e=>{e instanceof d||e._name in t.controllers&&e.load(t.controllers[e._name])}),e&&t.folders&&this.folders.forEach(e=>{e._title in t.folders&&e.load(t.folders[e._title])}),this}save(t=!0){const e={controllers:{},folders:{}};return this.controllers.forEach(t=>{if(!(t instanceof d)){if(t._name in e.controllers)throw new Error(`Cannot save GUI with duplicate property "${t._name}"`);e.controllers[t._name]=t.save()}}),t&&this.folders.forEach(t=>{if(t._title in e.folders)throw new Error(`Cannot save GUI with duplicate folder "${t._title}"`);e.folders[t._title]=t.save()}),e}open(t=!0){return this._closed=!t,this.$title.setAttribute("aria-expanded",!this._closed),this.domElement.classList.toggle("closed",this._closed),this}close(){return this.open(!1)}show(t=!0){return this._hidden=!t,this.domElement.style.display=this._hidden?"none":"",this}hide(){return this.show(!1)}openAnimated(t=!0){return this._closed=!t,this.$title.setAttribute("aria-expanded",!this._closed),requestAnimationFrame(()=>{const e=this.$children.clientHeight;this.$children.style.height=e+"px",this.domElement.classList.add("transition");const i=t=>{t.target===this.$children&&(this.$children.style.height="",this.domElement.classList.remove("transition"),this.$children.removeEventListener("transitionend",i))};this.$children.addEventListener("transitionend",i);const n=t?this.$children.scrollHeight:0;this.domElement.classList.toggle("closed",!t),requestAnimationFrame(()=>{this.$children.style.height=n+"px"})}),this}title(t){return this._title=t,this.$title.innerHTML=t,this}reset(t=!0){return(t?this.controllersRecursive():this.controllers).forEach(t=>t.reset()),this}onChange(t){return this._onChange=t,this}_callOnChange(t){this.parent&&this.parent._callOnChange(t),void 0!==this._onChange&&this._onChange.call(this,{object:t.object,property:t.property,value:t.getValue(),controller:t})}onFinishChange(t){return this._onFinishChange=t,this}_callOnFinishChange(t){this.parent&&this.parent._callOnFinishChange(t),void 0!==this._onFinishChange&&this._onFinishChange.call(this,{object:t.object,property:t.property,value:t.getValue(),controller:t})}destroy(){this.parent&&(this.parent.children.splice(this.parent.children.indexOf(this),1),this.parent.folders.splice(this.parent.folders.indexOf(this),1)),this.domElement.parentElement&&this.domElement.parentElement.removeChild(this.domElement),Array.from(this.children).forEach(t=>t.destroy())}controllersRecursive(){let t=Array.from(this.controllers);return this.folders.forEach(e=>{t=t.concat(e.controllersRecursive())}),t}foldersRecursive(){let t=Array.from(this.folders);return this.folders.forEach(e=>{t=t.concat(e.foldersRecursive())}),t}}var y=v,x=i(54),w=i.n(x),b=i(6);function A(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var T=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,n;return e=t,n=[{key:"init",value:function(t){this.gui=new y,this.gui.domElement.style.opacity=.5,this.gui.close()}},{key:"initStats",value:function(){this.stats=new w.a,this.stats.showPanel(0),document.body.appendChild(this.stats.dom),this.statsEnabled=!0}},{key:"addLights",value:function(t,e){var i=t||app.dirLight,n=e||app.ambientLight,r=this.gui.addFolder("AmbientLight");r.add(n,"intensity",0,10,.1),n.colorHex="#"+n.color.getHexString(),r.addColor(n,"colorHex").onChange((function(t){n.color.set(t)}));var s=this.gui.addFolder("DirectionalLight");i.colorHex="#"+i.color.getHexString(),s.add(i,"intensity",0,10,.1),s.addColor(i,"colorHex").onChange((function(t){i.color.set(t)})),s.add(i.position,"x",-1e3,1e3,1),s.add(i.position,"y",-1e3,1e3,1),s.add(i.position,"z",-1e3,1e3,1)}},{key:"showRenderCalls",value:function(t){this.gui.add(t.info.render,"calls").name("renderCalls").listen()}},{key:"addPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2?arguments[2]:void 0,n=t.name||"jondoe",r=this.gui.addFolder(n);i?(r.add(t.position,"x",-i,i,e),r.add(t.position,"y",-i,i,e),r.add(t.position,"z",-i,i,e)):(r.add(t.position,"x").step(e),r.add(t.position,"y").step(e),r.add(t.position,"z").step(e))}},{key:"addColorThree",value:function(t,e){var i={val:"#"+t.getHexString()};this.gui.addColor(i,"val").name(e).onChange((function(e){t.set(e),t.convertSRGBToLinear()}))}},{key:"addOriginBox",value:function(){var t=b.a.createBox();return t.material.transparent=!0,t.material.depthTest=!1,t.material.depthWrite=!1,t.material.opacity=.5,t}}],(i=null)&&A(e.prototype,i),n&&A(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}()},function(t,e,i){"use strict";i.d(e,"a",(function(){return dt}));var n=i(0),r=0,s="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}";n.ShaderMaterial,n.ShaderMaterial;function o(t,e,i){return t*(e-i)-e}function a(t,e,i){return Math.min(Math.max((t+e)/(e-i),0),1)}n.ShaderMaterial,n.ShaderMaterial;var h=class extends n.ShaderMaterial{constructor(){super({name:"CopyMaterial",uniforms:{inputBuffer:new n.Uniform(null),opacity:new n.Uniform(1)},blending:n.NoBlending,depthWrite:!1,depthTest:!1,fragmentShader:"#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nuniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel;\n#include <encodings_fragment>\n}",vertexShader:s}),this.toneMapped=!1}set inputBuffer(t){this.uniforms.inputBuffer.value=t}setInputBuffer(t){this.uniforms.inputBuffer.value=t}getOpacity(t){return this.uniforms.opacity.value}setOpacity(t){this.uniforms.opacity.value=t}},l=(n.ShaderMaterial,0),u=(n.ShaderMaterial,n.ShaderMaterial,1),c=2,d=(n.ShaderMaterial,0),p=2,f=0,m=1,g=class extends n.ShaderMaterial{constructor(t=new n.Vector2,e=p){super({name:"EdgeDetectionMaterial",defines:{LOCAL_CONTRAST_ADAPTATION_FACTOR:"2.0",EDGE_THRESHOLD:"0.1",DEPTH_THRESHOLD:"0.01",PREDICATION_MODE:"0",PREDICATION_THRESHOLD:"0.01",PREDICATION_SCALE:"2.0",PREDICATION_STRENGTH:"1.0",DEPTH_PACKING:"0"},uniforms:{inputBuffer:new n.Uniform(null),depthBuffer:new n.Uniform(null),predicationBuffer:new n.Uniform(null),texelSize:new n.Uniform(t)},blending:n.NoBlending,depthWrite:!1,depthTest:!1,fragmentShader:"varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;\n#if EDGE_DETECTION_MODE != 0\nvarying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;\n#endif\n#if EDGE_DETECTION_MODE == 1\n#include <common>\n#endif\n#if EDGE_DETECTION_MODE == 0 || PREDICATION_MODE == 1\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nfloat readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}vec3 gatherNeighbors(){float p=readDepth(vUv);float pLeft=readDepth(vUv0);float pTop=readDepth(vUv1);return vec3(p,pLeft,pTop);}\n#elif PREDICATION_MODE == 2\nuniform sampler2D predicationBuffer;vec3 gatherNeighbors(){float p=texture2D(predicationBuffer,vUv).r;float pLeft=texture2D(predicationBuffer,vUv0).r;float pTop=texture2D(predicationBuffer,vUv1).r;return vec3(p,pLeft,pTop);}\n#endif\n#if PREDICATION_MODE != 0\nvec2 calculatePredicatedThreshold(){vec3 neighbours=gatherNeighbors();vec2 delta=abs(neighbours.xx-neighbours.yz);vec2 edges=step(PREDICATION_THRESHOLD,delta);return PREDICATION_SCALE*EDGE_THRESHOLD*(1.0-PREDICATION_STRENGTH*edges);}\n#endif\n#if EDGE_DETECTION_MODE != 0\nuniform sampler2D inputBuffer;\n#endif\nvoid main(){\n#if EDGE_DETECTION_MODE == 0\nconst vec2 threshold=vec2(DEPTH_THRESHOLD);\n#elif PREDICATION_MODE != 0\nvec2 threshold=calculatePredicatedThreshold();\n#else\nconst vec2 threshold=vec2(EDGE_THRESHOLD);\n#endif\n#if EDGE_DETECTION_MODE == 0\nvec3 neighbors=gatherNeighbors();vec2 delta=abs(neighbors.xx-vec2(neighbors.y,neighbors.z));vec2 edges=step(threshold,delta);if(dot(edges,vec2(1.0))==0.0){discard;}gl_FragColor=vec4(edges,0.0,1.0);\n#elif EDGE_DETECTION_MODE == 1\nfloat l=linearToRelativeLuminance(texture2D(inputBuffer,vUv).rgb);float lLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv0).rgb);float lTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv1).rgb);vec4 delta;delta.xy=abs(l-vec2(lLeft,lTop));vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}float lRight=linearToRelativeLuminance(texture2D(inputBuffer,vUv2).rgb);float lBottom=linearToRelativeLuminance(texture2D(inputBuffer,vUv3).rgb);delta.zw=abs(l-vec2(lRight,lBottom));vec2 maxDelta=max(delta.xy,delta.zw);float lLeftLeft=linearToRelativeLuminance(texture2D(inputBuffer,vUv4).rgb);float lTopTop=linearToRelativeLuminance(texture2D(inputBuffer,vUv5).rgb);delta.zw=abs(vec2(lLeft,lTop)-vec2(lLeftLeft,lTopTop));maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges.xy*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0);\n#elif EDGE_DETECTION_MODE == 2\nvec4 delta;vec3 c=texture2D(inputBuffer,vUv).rgb;vec3 cLeft=texture2D(inputBuffer,vUv0).rgb;vec3 t=abs(c-cLeft);delta.x=max(max(t.r,t.g),t.b);vec3 cTop=texture2D(inputBuffer,vUv1).rgb;t=abs(c-cTop);delta.y=max(max(t.r,t.g),t.b);vec2 edges=step(threshold,delta.xy);if(dot(edges,vec2(1.0))==0.0){discard;}vec3 cRight=texture2D(inputBuffer,vUv2).rgb;t=abs(c-cRight);delta.z=max(max(t.r,t.g),t.b);vec3 cBottom=texture2D(inputBuffer,vUv3).rgb;t=abs(c-cBottom);delta.w=max(max(t.r,t.g),t.b);vec2 maxDelta=max(delta.xy,delta.zw);vec3 cLeftLeft=texture2D(inputBuffer,vUv4).rgb;t=abs(c-cLeftLeft);delta.z=max(max(t.r,t.g),t.b);vec3 cTopTop=texture2D(inputBuffer,vUv5).rgb;t=abs(c-cTopTop);delta.w=max(max(t.r,t.g),t.b);maxDelta=max(maxDelta.xy,delta.zw);float finalDelta=max(maxDelta.x,maxDelta.y);edges*=step(finalDelta,LOCAL_CONTRAST_ADAPTATION_FACTOR*delta.xy);gl_FragColor=vec4(edges,0.0,1.0);\n#endif\n}",vertexShader:"uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;\n#if EDGE_DETECTION_MODE != 0\nvarying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;\n#endif\nvoid main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,0.0);vUv1=vUv+texelSize*vec2(0.0,-1.0);\n#if EDGE_DETECTION_MODE != 0\nvUv2=vUv+texelSize*vec2(1.0,0.0);vUv3=vUv+texelSize*vec2(0.0,1.0);vUv4=vUv+texelSize*vec2(-2.0,0.0);vUv5=vUv+texelSize*vec2(0.0,-2.0);\n#endif\ngl_Position=vec4(position.xy,1.0,1.0);}"}),this.toneMapped=!1,this.edgeDetectionMode=e}set depthBuffer(t){this.uniforms.depthBuffer.value=t}set depthPacking(t){this.defines.DEPTH_PACKING=t.toFixed(0),this.needsUpdate=!0}setDepthBuffer(t,e=n.BasicDepthPacking){this.depthBuffer=t,this.depthPacking=e}get edgeDetectionMode(){return Number(this.defines.EDGE_DETECTION_MODE)}set edgeDetectionMode(t){this.defines.EDGE_DETECTION_MODE=t.toFixed(0),this.needsUpdate=!0}getEdgeDetectionMode(){return this.edgeDetectionMode}setEdgeDetectionMode(t){this.edgeDetectionMode=t}get localContrastAdaptationFactor(){return Number(this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR)}set localContrastAdaptationFactor(t){this.defines.LOCAL_CONTRAST_ADAPTATION_FACTOR=t.toFixed("6"),this.needsUpdate=!0}getLocalContrastAdaptationFactor(){return this.localContrastAdaptationFactor}setLocalContrastAdaptationFactor(t){this.localContrastAdaptationFactor=t}get edgeDetectionThreshold(){return Number(this.defines.EDGE_THRESHOLD)}set edgeDetectionThreshold(t){this.defines.EDGE_THRESHOLD=t.toFixed("6"),this.defines.DEPTH_THRESHOLD=(.1*t).toFixed("6"),this.needsUpdate=!0}getEdgeDetectionThreshold(){return this.edgeDetectionThreshold}setEdgeDetectionThreshold(t){this.edgeDetectionThreshold=t}get predicationMode(){return Number(this.defines.PREDICATION_MODE)}set predicationMode(t){this.defines.PREDICATION_MODE=t.toFixed(0),this.needsUpdate=!0}getPredicationMode(){return this.predicationMode}setPredicationMode(t){this.predicationMode=t}set predicationBuffer(t){this.uniforms.predicationBuffer.value=t}setPredicationBuffer(t){this.uniforms.predicationBuffer.value=t}get predicationThreshold(){return Number(this.defines.PREDICATION_THRESHOLD)}set predicationThreshold(t){this.defines.PREDICATION_THRESHOLD=t.toFixed("6"),this.needsUpdate=!0}getPredicationThreshold(){return this.predicationThreshold}setPredicationThreshold(t){this.predicationThreshold=t}get predicationScale(){return Number(this.defines.PREDICATION_SCALE)}set predicationScale(t){this.defines.PREDICATION_SCALE=t.toFixed("6"),this.needsUpdate=!0}getPredicationScale(){return this.predicationScale}setPredicationScale(t){this.predicationScale=t}get predicationStrength(){return Number(this.defines.PREDICATION_STRENGTH)}set predicationStrength(t){this.defines.PREDICATION_STRENGTH=t.toFixed("6"),this.needsUpdate=!0}getPredicationStrength(){return this.predicationStrength}setPredicationStrength(t){this.predicationStrength=t}setSize(t,e){this.uniforms.texelSize.value.set(1/t,1/e)}},v={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},y=class extends n.ShaderMaterial{constructor(t,e,i,r,s=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:n.REVISION.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new n.Uniform(null),depthBuffer:new n.Uniform(null),resolution:new n.Uniform(new n.Vector2),texelSize:new n.Uniform(new n.Vector2),cameraNear:new n.Uniform(.3),cameraFar:new n.Uniform(1e3),aspect:new n.Uniform(1),time:new n.Uniform(0)},blending:n.NoBlending,depthWrite:!1,depthTest:!1,dithering:s}),this.toneMapped=!1,t&&this.setShaderParts(t),e&&this.setDefines(e),i&&this.setUniforms(i),this.adoptCameraSettings(r)}set inputBuffer(t){this.uniforms.inputBuffer.value=t}setInputBuffer(t){this.uniforms.inputBuffer.value=t}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(t){this.uniforms.depthBuffer.value=t}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(t){this.defines.DEPTH_PACKING=t.toFixed(0),this.needsUpdate=!0}setDepthBuffer(t,e=n.BasicDepthPacking){this.depthBuffer=t,this.depthPacking=e}setShaderParts(t){return this.fragmentShader="#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#define packFloatToRGBA(v) packDepthToRGBA(v)\n#define unpackRGBAToFloat(v) unpackRGBAToDepth(v)\n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\n#ifdef GL_FRAGMENT_PRECISION_HIGH\nuniform highp sampler2D depthBuffer;\n#else\nuniform mediump sampler2D depthBuffer;\n#endif\nuniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;\n#if THREE_REVISION >= 137\nvec4 sRGBToLinear(const in vec4 value){return 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#endif\nfloat readDepth(const in vec2 uv){\n#if DEPTH_PACKING == 3201\nreturn unpackRGBAToDepth(texture2D(depthBuffer,uv));\n#else\nreturn texture2D(depthBuffer,uv).r;\n#endif\n}float getViewZ(const in float depth){\n#ifdef PERSPECTIVE_CAMERA\nreturn perspectiveDepthToViewZ(depth,cameraNear,cameraFar);\n#else\nreturn orthographicDepthToViewZ(depth,cameraNear,cameraFar);\n#endif\n}FRAGMENT_HEADvoid main(){FRAGMENT_MAIN_UVvec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGEgl_FragColor=color0;\n#ifdef ENCODE_OUTPUT\n#include <encodings_fragment>\n#endif\n#include <dithering_fragment>\n}".replace(v.FRAGMENT_HEAD,t.get(v.FRAGMENT_HEAD)).replace(v.FRAGMENT_MAIN_UV,t.get(v.FRAGMENT_MAIN_UV)).replace(v.FRAGMENT_MAIN_IMAGE,t.get(v.FRAGMENT_MAIN_IMAGE)),this.vertexShader="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEADvoid main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORTgl_Position=vec4(position.xy,1.0,1.0);}".replace(v.VERTEX_HEAD,t.get(v.VERTEX_HEAD)).replace(v.VERTEX_MAIN_SUPPORT,t.get(v.VERTEX_MAIN_SUPPORT)),this.needsUpdate=!0,this}setDefines(t){for(const e of t.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(t){for(const e of t.entries())this.uniforms[e[0]]=e[1];return this}setExtensions(t){this.extensions={};for(const e of t)this.extensions[e]=!0;return this}get encodeOutput(){return void 0!==this.defines.ENCODE_OUTPUT}set encodeOutput(t){this.encodeOutput!==t&&(t?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(t){return this.encodeOutput}setOutputEncodingEnabled(t){this.encodeOutput=t}get time(){return this.uniforms.time.value}set time(t){this.uniforms.time.value=t}setDeltaTime(t){this.uniforms.time.value+=t}adoptCameraSettings(t){t&&(this.uniforms.cameraNear.value=t.near,this.uniforms.cameraFar.value=t.far,t instanceof n.PerspectiveCamera?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(t,e){const i=this.uniforms;i.resolution.value.set(t,e),i.texelSize.value.set(1/t,1/e),i.aspect.value=t/e}static get Section(){return v}},x=(n.ShaderMaterial,n.ShaderMaterial,0),w=(n.ShaderMaterial,n.ShaderMaterial,class extends n.ShaderMaterial{constructor(t=new n.Vector2,e=new n.Vector2){super({name:"SMAAWeightsMaterial",defines:{MAX_SEARCH_STEPS_INT:"16",MAX_SEARCH_STEPS_FLOAT:"16.0",MAX_SEARCH_STEPS_DIAG_INT:"8",MAX_SEARCH_STEPS_DIAG_FLOAT:"8.0",CORNER_ROUNDING:"25",CORNER_ROUNDING_NORM:"0.25",AREATEX_MAX_DISTANCE:"16.0",AREATEX_MAX_DISTANCE_DIAG:"20.0",AREATEX_PIXEL_SIZE:"(1.0 / vec2(160.0, 560.0))",AREATEX_SUBTEX_SIZE:"(1.0 / 7.0)",SEARCHTEX_SIZE:"vec2(66.0, 33.0)",SEARCHTEX_PACKED_SIZE:"vec2(64.0, 16.0)"},uniforms:{inputBuffer:new n.Uniform(null),searchTexture:new n.Uniform(null),areaTexture:new n.Uniform(null),resolution:new n.Uniform(e),texelSize:new n.Uniform(t)},blending:n.NoBlending,depthWrite:!1,depthTest:!1,fragmentShader:"#define sampleLevelZeroOffset(t, coord, offset) texture2D(t, coord + offset * texelSize)\n#if __VERSION__ < 300\n#define round(v) floor(v + 0.5)\n#endif\n#ifdef FRAMEBUFFER_PRECISION_HIGH\nuniform mediump sampler2D inputBuffer;\n#else\nuniform lowp sampler2D inputBuffer;\n#endif\nuniform lowp sampler2D areaTexture;uniform lowp sampler2D searchTexture;uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}vec2 decodeDiagBilinearAccess(in vec2 e){e.r=e.r*abs(5.0*e.r-5.0*0.75);return round(e);}vec4 decodeDiagBilinearAccess(in vec4 e){e.rb=e.rb*abs(5.0*e.rb-5.0*0.75);return round(e);}vec2 searchDiag1(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);vec3 t=vec3(texelSize,1.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(coord.z<float(MAX_SEARCH_STEPS_DIAG_INT-1)&&coord.w>0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 searchDiag2(const in vec2 texCoord,const in vec2 dir,out vec2 e){vec4 coord=vec4(texCoord,-1.0,1.0);coord.x+=0.25*texelSize.x;vec3 t=vec3(texelSize,1.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(coord.z<float(MAX_SEARCH_STEPS_DIAG_INT-1)&&coord.w>0.9)){break;}coord.xyz=t*vec3(dir,1.0)+coord.xyz;e=texture2D(inputBuffer,coord.xy).rg;e=decodeDiagBilinearAccess(e);coord.w=dot(e,vec2(0.5));}return coord.zw;}vec2 areaDiag(const in vec2 dist,const in vec2 e,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE_DIAG,AREATEX_MAX_DISTANCE_DIAG)*e+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.x+=0.5;texCoord.y+=AREATEX_SUBTEX_SIZE*offset;return texture2D(areaTexture,texCoord).rg;}vec2 calculateDiagWeights(const in vec2 texCoord,const in vec2 e,const in vec4 subsampleIndices){vec2 weights=vec2(0.0);vec4 d;vec2 end;if(e.r>0.0){d.xz=searchDiag1(texCoord,vec2(-1.0,1.0),end);d.x+=float(end.y>0.9);}else{d.xz=vec2(0.0);}d.yw=searchDiag1(texCoord,vec2(1.0,-1.0),end);if(d.x+d.y>2.0){vec4 coords=vec4(-d.x+0.25,d.x,d.y,-d.y-0.25)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.xy=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).rg;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).rg;c.yxwz=decodeDiagBilinearAccess(c.xyzw);vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.z);}d.xz=searchDiag2(texCoord,vec2(-1.0,-1.0),end);if(sampleLevelZeroOffset(inputBuffer,texCoord,vec2(1,0)).r>0.0){d.yw=searchDiag2(texCoord,vec2(1.0),end);d.y+=float(end.y>0.9);}else{d.yw=vec2(0.0);}if(d.x+d.y>2.0){vec4 coords=vec4(-d.x,-d.x,d.y,d.y)*texelSize.xyxy+texCoord.xyxy;vec4 c;c.x=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(-1,0)).g;c.y=sampleLevelZeroOffset(inputBuffer,coords.xy,vec2(0,-1)).r;c.zw=sampleLevelZeroOffset(inputBuffer,coords.zw,vec2(1,0)).gr;vec2 cc=vec2(2.0)*c.xz+c.yw;movec(bvec2(step(0.9,d.zw)),cc,vec2(0.0));weights+=areaDiag(d.xy,cc,subsampleIndices.w).gr;}return weights;}float searchLength(const in vec2 e,const in float offset){vec2 scale=SEARCHTEX_SIZE*vec2(0.5,-1.0);vec2 bias=SEARCHTEX_SIZE*vec2(offset,1.0);scale+=vec2(-1.0,1.0);bias+=vec2(0.5,-0.5);scale*=1.0/SEARCHTEX_PACKED_SIZE;bias*=1.0/SEARCHTEX_PACKED_SIZE;return texture2D(searchTexture,scale*e+bias).r;}float searchXLeft(in vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(texCoord.x>end&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(-2.0,0.0)*texelSize+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.0)+3.25;return texelSize.x*offset+texCoord.x;}float searchXRight(vec2 texCoord,const in float end){vec2 e=vec2(0.0,1.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(texCoord.x<end&&e.g>0.8281&&e.r==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(2.0,0.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e,0.5)+3.25;return-texelSize.x*offset+texCoord.x;}float searchYUp(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;++i){if(!(texCoord.y>end&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=-vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.0)+3.25;return texelSize.y*offset+texCoord.y;}float searchYDown(vec2 texCoord,const in float end){vec2 e=vec2(1.0,0.0);for(int i=0;i<MAX_SEARCH_STEPS_INT;i++){if(!(texCoord.y<end&&e.r>0.8281&&e.g==0.0)){break;}e=texture2D(inputBuffer,texCoord).rg;texCoord=vec2(0.0,2.0)*texelSize.xy+texCoord;}float offset=-(255.0/127.0)*searchLength(e.gr,0.5)+3.25;return-texelSize.y*offset+texCoord.y;}vec2 area(const in vec2 dist,const in float e1,const in float e2,const in float offset){vec2 texCoord=vec2(AREATEX_MAX_DISTANCE)*round(4.0*vec2(e1,e2))+dist;texCoord=AREATEX_PIXEL_SIZE*texCoord+0.5*AREATEX_PIXEL_SIZE;texCoord.y=AREATEX_SUBTEX_SIZE*offset+texCoord.y;return texture2D(areaTexture,texCoord).rg;}void detectHorizontalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){\n#if !defined(DISABLE_CORNER_DETECTION)\nvec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,1)).r;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).r;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(0,-2)).r;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,-2)).r;weights*=clamp(factor,0.0,1.0);\n#endif\n}void detectVerticalCornerPattern(inout vec2 weights,const in vec4 texCoord,const in vec2 d){\n#if !defined(DISABLE_CORNER_DETECTION)\nvec2 leftRight=step(d.xy,d.yx);vec2 rounding=(1.0-CORNER_ROUNDING_NORM)*leftRight;rounding/=leftRight.x+leftRight.y;vec2 factor=vec2(1.0);factor.x-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(1,0)).g;factor.x-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(1,1)).g;factor.y-=rounding.x*sampleLevelZeroOffset(inputBuffer,texCoord.xy,vec2(-2,0)).g;factor.y-=rounding.y*sampleLevelZeroOffset(inputBuffer,texCoord.zw,vec2(-2,1)).g;weights*=clamp(factor,0.0,1.0);\n#endif\n}void main(){vec4 weights=vec4(0.0);vec4 subsampleIndices=vec4(0.0);vec2 e=texture2D(inputBuffer,vUv).rg;if(e.g>0.0){\n#if !defined(DISABLE_DIAG_DETECTION)\nweights.rg=calculateDiagWeights(vUv,e,subsampleIndices);if(weights.r==-weights.g){\n#endif\nvec2 d;vec3 coords;coords.x=searchXLeft(vOffset[0].xy,vOffset[2].x);coords.y=vOffset[1].y;d.x=coords.x;float e1=texture2D(inputBuffer,coords.xy).r;coords.z=searchXRight(vOffset[0].zw,vOffset[2].y);d.y=coords.z;d=round(resolution.xx*d+-vPixCoord.xx);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.zy,vec2(1,0)).r;weights.rg=area(sqrtD,e1,e2,subsampleIndices.y);coords.y=vUv.y;detectHorizontalCornerPattern(weights.rg,coords.xyzy,d);\n#if !defined(DISABLE_DIAG_DETECTION)\n}else{e.r=0.0;}\n#endif\n}if(e.r>0.0){vec2 d;vec3 coords;coords.y=searchYUp(vOffset[1].xy,vOffset[2].z);coords.x=vOffset[0].x;d.x=coords.y;float e1=texture2D(inputBuffer,coords.xy).g;coords.z=searchYDown(vOffset[1].zw,vOffset[2].w);d.y=coords.z;d=round(resolution.yy*d-vPixCoord.yy);vec2 sqrtD=sqrt(abs(d));float e2=sampleLevelZeroOffset(inputBuffer,coords.xz,vec2(0,1)).g;weights.ba=area(sqrtD,e1,e2,subsampleIndices.x);coords.x=vUv.x;detectVerticalCornerPattern(weights.ba,coords.xyxz,d);}gl_FragColor=weights;}",vertexShader:"uniform vec2 texelSize;uniform vec2 resolution;varying vec2 vUv;varying vec4 vOffset[3];varying vec2 vPixCoord;void main(){vUv=position.xy*0.5+0.5;vPixCoord=vUv*resolution;vOffset[0]=vUv.xyxy+texelSize.xyxy*vec4(-0.25,-0.125,1.25,-0.125);vOffset[1]=vUv.xyxy+texelSize.xyxy*vec4(-0.125,-0.25,-0.125,1.25);vOffset[2]=vec4(vOffset[0].xz,vOffset[1].yw)+vec4(-2.0,2.0,-2.0,2.0)*texelSize.xxyy*MAX_SEARCH_STEPS_FLOAT;gl_Position=vec4(position.xy,1.0,1.0);}"}),this.toneMapped=!1}set inputBuffer(t){this.uniforms.inputBuffer.value=t}setInputBuffer(t){this.uniforms.inputBuffer.value=t}get searchTexture(){return this.uniforms.searchTexture.value}set searchTexture(t){this.uniforms.searchTexture.value=t}get areaTexture(){return this.uniforms.areaTexture.value}set areaTexture(t){this.uniforms.areaTexture.value=t}setLookupTextures(t,e){this.searchTexture=t,this.areaTexture=e}get orthogonalSearchSteps(){return Number(this.defines.MAX_SEARCH_STEPS_INT)}set orthogonalSearchSteps(t){const e=Math.min(Math.max(t,0),112);this.defines.MAX_SEARCH_STEPS_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setOrthogonalSearchSteps(t){this.orthogonalSearchSteps=t}get diagonalSearchSteps(){return Number(this.defines.MAX_SEARCH_STEPS_DIAG_INT)}set diagonalSearchSteps(t){const e=Math.min(Math.max(t,0),20);this.defines.MAX_SEARCH_STEPS_DIAG_INT=e.toFixed("0"),this.defines.MAX_SEARCH_STEPS_DIAG_FLOAT=e.toFixed("1"),this.needsUpdate=!0}setDiagonalSearchSteps(t){this.diagonalSearchSteps=t}get diagonalDetection(){return void 0===this.defines.DISABLE_DIAG_DETECTION}set diagonalDetection(t){t?delete this.defines.DISABLE_DIAG_DETECTION:this.defines.DISABLE_DIAG_DETECTION="1",this.needsUpdate=!0}isDiagonalDetectionEnabled(){return this.diagonalDetection}setDiagonalDetectionEnabled(t){this.diagonalDetection=t}get cornerRounding(){return Number(this.defines.CORNER_ROUNDING)}set cornerRounding(t){const e=Math.min(Math.max(t,0),100);this.defines.CORNER_ROUNDING=e.toFixed("4"),this.defines.CORNER_ROUNDING_NORM=(e/100).toFixed("4"),this.needsUpdate=!0}setCornerRounding(t){this.cornerRounding=t}get cornerDetection(){return void 0===this.defines.DISABLE_CORNER_DETECTION}set cornerDetection(t){t?delete this.defines.DISABLE_CORNER_DETECTION:this.defines.DISABLE_CORNER_DETECTION="1",this.needsUpdate=!0}isCornerRoundingEnabled(){return this.cornerDetection}setCornerRoundingEnabled(t){this.cornerDetection=t}setSize(t,e){const i=this.uniforms;i.texelSize.value.set(1/t,1/e),i.resolution.value.set(t,e)}}),b=(n.ShaderMaterial,new n.Camera),A=null;var T=class{constructor(t="Pass",e=new n.Scene,i=b){this.name=t,this.renderer=null,this.scene=e,this.camera=i,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(t){if(this.rtt===t){const e=this.getFullscreenMaterial();null!==e&&(e.needsUpdate=!0),this.rtt=!t}}setRenderer(t){this.renderer=t}isEnabled(){return this.enabled}setEnabled(t){this.enabled=t}get fullscreenMaterial(){return null!==this.screen?this.screen.material:null}set fullscreenMaterial(t){let e=this.screen;null!==e?e.material=t:(e=new n.Mesh(function(){if(null===A){const t=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);void 0!==(A=new n.BufferGeometry).setAttribute?(A.setAttribute("position",new n.BufferAttribute(t,3)),A.setAttribute("uv",new n.BufferAttribute(e,2))):(A.addAttribute("position",new n.BufferAttribute(t,3)),A.addAttribute("uv",new n.BufferAttribute(e,2)))}return A}(),t),e.frustumCulled=!1,null===this.scene&&(this.scene=new n.Scene),this.scene.add(e),this.screen=e)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(t){this.fullscreenMaterial=t}getDepthTexture(){return null}setDepthTexture(t,e=n.BasicDepthPacking){}render(t,e,i,n,r){throw new Error("Render method not implemented!")}setSize(t,e){}initialize(t,e,i){}dispose(){for(const t of Object.keys(this)){const e=this[t];if(null!==e&&"function"==typeof e.dispose){if(e instanceof n.Scene||e===this.renderer)continue;this[t].dispose()}}}},S=class extends T{constructor(t,e=!0){super("CopyPass"),this.fullscreenMaterial=new h,this.needsSwap=!1,this.renderTarget=t,void 0===t&&(this.renderTarget=new n.WebGLRenderTarget(1,1,{minFilter:n.LinearFilter,magFilter:n.LinearFilter,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=e}get resize(){return this.autoResize}set resize(t){this.autoResize=t}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(t){this.autoResize=t}render(t,e,i,n,r){this.fullscreenMaterial.inputBuffer=e.texture,t.setRenderTarget(this.renderToScreen?null:this.renderTarget),t.render(this.scene,this.camera)}setSize(t,e){this.autoResize&&this.renderTarget.setSize(t,e)}initialize(t,e,i){void 0!==i&&(this.renderTarget.texture.type=i,i!==n.UnsignedByteType?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":t.outputEncoding===n.sRGBEncoding&&(this.renderTarget.texture.encoding=n.sRGBEncoding))}},E=class extends T{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(t,e,i,n,r){const s=t.state.buffers.stencil;s.setLocked(!1),s.setTest(!1)}},M=new n.Color,_=class extends T{constructor(t=!0,e=!0,i=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=t,this.depth=e,this.stencil=i,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(t,e,i){this.color=t,this.depth=e,this.stencil=i}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(t){this.overrideClearColor=t}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(t){this.overrideClearAlpha=t}render(t,e,i,n,r){const s=this.overrideClearColor,o=this.overrideClearAlpha,a=t.getClearAlpha(),h=null!==s,l=o>=0;h?(M.copy(t.getClearColor(M)),t.setClearColor(s,l?o:a)):l&&t.setClearAlpha(o),t.setRenderTarget(this.renderToScreen?null:e),t.clear(this.color,this.depth,this.stencil),h?t.setClearColor(M,a):l&&t.setClearAlpha(a)}},C=(n.EventDispatcher,!1),P=class{constructor(t=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(t),this.meshCount=0,this.replaceMaterial=t=>{if(t.isMesh){let e;if(t.material.flatShading)switch(t.material.side){case n.DoubleSide:e=this.materialsFlatShadedDoubleSide;break;case n.BackSide:e=this.materialsFlatShadedBackSide;break;default:e=this.materialsFlatShaded}else switch(t.material.side){case n.DoubleSide:e=this.materialsDoubleSide;break;case n.BackSide:e=this.materialsBackSide;break;default:e=this.materials}this.originalMaterials.set(t,t.material),t.isSkinnedMesh?t.material=e[2]:t.isInstancedMesh?t.material=e[1]:t.material=e[0],++this.meshCount}}}setMaterial(t){if(this.disposeMaterials(),this.material=t,null!==t){const e=this.materials=[t.clone(),t.clone(),t.clone()];for(const i of e)i.uniforms=Object.assign({},t.uniforms),i.side=n.FrontSide;e[2].skinning=!0,this.materialsBackSide=e.map(e=>{const i=e.clone();return i.uniforms=Object.assign({},t.uniforms),i.side=n.BackSide,i}),this.materialsDoubleSide=e.map(e=>{const i=e.clone();return i.uniforms=Object.assign({},t.uniforms),i.side=n.DoubleSide,i}),this.materialsFlatShaded=e.map(e=>{const i=e.clone();return i.uniforms=Object.assign({},t.uniforms),i.flatShading=!0,i}),this.materialsFlatShadedBackSide=e.map(e=>{const i=e.clone();return i.uniforms=Object.assign({},t.uniforms),i.flatShading=!0,i.side=n.BackSide,i}),this.materialsFlatShadedDoubleSide=e.map(e=>{const i=e.clone();return i.uniforms=Object.assign({},t.uniforms),i.flatShading=!0,i.side=n.DoubleSide,i})}}render(t,e,i){const n=t.shadowMap.enabled;if(t.shadowMap.enabled=!1,C){const n=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),t.render(e,i);for(const t of n)t[0].material=t[1];this.meshCount!==n.size&&n.clear()}else{const n=e.overrideMaterial;e.overrideMaterial=this.material,t.render(e,i),e.overrideMaterial=n}t.shadowMap.enabled=n}disposeMaterials(){if(null!==this.material){const t=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const e of t)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return C}static set workaroundEnabled(t){C=t}},R=class extends T{constructor(t,e,i=null){super("RenderPass",t,e),this.needsSwap=!1,this.clearPass=new _,this.overrideMaterialManager=null===i?null:new P(i),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}get renderToScreen(){return super.renderToScreen}set renderToScreen(t){super.renderToScreen=t,this.clearPass.renderToScreen=t}get overrideMaterial(){const t=this.overrideMaterialManager;return null!==t?t.material:null}set overrideMaterial(t){const e=this.overrideMaterialManager;null!==t?null!==e?e.setMaterial(t):this.overrideMaterialManager=new P(t):null!==e&&(e.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(t){this.overrideMaterial=t}get clear(){return this.clearPass.enabled}set clear(t){this.clearPass.enabled=t}getSelection(){return this.selection}setSelection(t){this.selection=t}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(t){this.ignoreBackground=t}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(t){this.skipShadowMapUpdate=t}getClearPass(){return this.clearPass}render(t,e,i,n,r){const s=this.scene,o=this.camera,a=this.selection,h=o.layers.mask,l=s.background,u=t.shadowMap.autoUpdate,c=this.renderToScreen?null:e;null!==a&&o.layers.set(a.getLayer()),this.skipShadowMapUpdate&&(t.shadowMap.autoUpdate=!1),(this.ignoreBackground||null!==this.clearPass.overrideClearColor)&&(s.background=null),this.clearPass.enabled&&this.clearPass.render(t,e),t.setRenderTarget(c),null!==this.overrideMaterialManager?this.overrideMaterialManager.render(t,s,o):t.render(s,o),o.layers.mask=h,s.background=l,t.shadowMap.autoUpdate=u}};new Float32Array([255/256/256**3,255/256/65536,255/256/256,255/256]);var L=0,O=2,D=10,B=13,I=14,F=16,k=new Map([[L,null],[1,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x+y,1.0)*opacity+x*(1.0-opacity);}"],[O,"vec3 blend(const in vec3 x,const in vec3 y,const in float opacity){return y*opacity+x*(1.0-opacity);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){float a=min(y.a,opacity);return vec4(blend(x.rgb,y.rgb,a),max(x.a,a));}"],[3,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y)*0.5*opacity+x*(1.0-opacity);}"],[4,"float blend(const in float x,const in float y){return(y==0.0)?y:max(1.0-(1.0-x)/y,0.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[5,"float blend(const in float x,const in float y){return(y==1.0)?y:min(x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[6,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return min(x,y)*opacity+x*(1.0-opacity);}"],[7,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return abs(x-y)*opacity+x*(1.0-opacity);}"],[8,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(x+y-2.0*x*y)*opacity+x*(1.0-opacity);}"],[9,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x,y)*opacity+x*(1.0-opacity);}"],[D,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return x*y*opacity+x*(1.0-opacity);}"],[11,"float blend(const in float x,const in float y){return(y>0.0)?min(x/y,1.0):1.0;}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[12,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-abs(1.0-x-y))*opacity+x*(1.0-opacity);}"],[B,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y*opacity+x*(1.0-opacity);}"],[I,"float blend(const in float x,const in float y){return(x<0.5)?(2.0*x*y):(1.0-2.0*(1.0-x)*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[15,"float blend(const in float x,const in float y){return(y==1.0)?y:min(x*x/(1.0-y),1.0);}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[F,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return(1.0-(1.0-x)*(1.0-y))*opacity+x*(1.0-opacity);}"],[17,"float blend(const in float x,const in float y){return(y<0.5)?(2.0*x*y+x*x*(1.0-2.0*y)):(sqrt(x)*(2.0*y-1.0)+2.0*x*(1.0-y));}vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=vec4(blend(x.r,y.r),blend(x.g,y.g),blend(x.b,y.b),blend(x.a,y.a));return z*opacity+x*(1.0-opacity);}"],[18,"vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return max(x+y-1.0,0.0)*opacity+x*(1.0-opacity);}"]]),N=class extends n.EventDispatcher{constructor(t,e=1){super(),this.f=t,this.opacity=new n.Uniform(e)}getOpacity(){return this.opacity.value}setOpacity(t){this.opacity.value=t}get blendFunction(){return this.f}set blendFunction(t){this.f=t,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(t){this.blendFunction=t}getShaderCode(){return k.get(this.blendFunction)}},z=0,U=1,V=2,H=class extends n.EventDispatcher{constructor(t,e,{attributes:i=z,blendFunction:n=F,defines:r=new Map,uniforms:s=new Map,extensions:o=null,vertexShader:a=null}={}){super(),this.name=t,this.renderer=null,this.attributes=i,this.fragmentShader=e,this.vertexShader=a,this.defines=r,this.uniforms=s,this.extensions=o,this.blendMode=new N(n),this.blendMode.addEventListener("change",t=>this.setChanged())}getName(){return this.name}setRenderer(t){this.renderer=t}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(t){this.attributes=t,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(t){this.fragmentShader=t,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(t){this.vertexShader=t,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(t,e=n.BasicDepthPacking){}update(t,e,i){}setSize(t,e){}initialize(t,e,i){}dispose(){for(const t of Object.keys(this)){const e=this[t];if(null!==e&&"function"==typeof e.dispose){if(e instanceof n.Scene||e===this.renderer)continue;this[t].dispose()}}}};function G(t,e,i){for(const n of e){const e="$1"+t+n.charAt(0).toUpperCase()+n.slice(1),r=new RegExp("([^\\.])(\\b"+n+"\\b)","g");for(const t of i.entries())null!==t[1]&&i.set(t[0],t[1].replace(r,e))}}function W(t,e,i,n,r,s,o){const a=new Map([["fragment",e.getFragmentShader()],["vertex",e.getVertexShader()]]),h=void 0!==a.get("fragment")&&/mainImage/.test(a.get("fragment")),l=void 0!==a.get("fragment")&&/mainUv/.test(a.get("fragment"));let u=[],c=[],d=!1,p=!1;if(void 0===a.get("fragment"));else if(l&&0!=(o&V));else if(h||l){const f=/(?:\w+\s+(\w+)\([\w\s,]*\)\s*{[^}]+})/g,m=y.Section;if(l){const e=`\t${t}MainUv(UV);\n`;i.set(m.FRAGMENT_MAIN_UV,i.get(m.FRAGMENT_MAIN_UV)+e),d=!0}if(null!==a.get("vertex")&&/mainSupport/.test(a.get("vertex"))){let e=`\t${t}MainSupport(`;e+=/mainSupport *\([\w\s]*?uv\s*?\)/.test(a.get("vertex"))?"vUv);\n":");\n",i.set(m.VERTEX_MAIN_SUPPORT,i.get(m.VERTEX_MAIN_SUPPORT)+e),u=u.concat([...a.get("vertex").matchAll(/(?:varying\s+\w+\s+(\w*))/g)].map(t=>t[1])),c=c.concat(u).concat([...a.get("vertex").matchAll(f)].map(t=>t[1]))}c=c.concat([...a.get("fragment").matchAll(f)].map(t=>t[1])),c=c.concat([...e.defines.keys()].map(t=>t.replace(/\([\w\s,]*\)/g,""))),c=c.concat([...e.uniforms.keys()]),e.uniforms.forEach((e,i)=>s.set(t+i.charAt(0).toUpperCase()+i.slice(1),e)),e.defines.forEach((e,i)=>r.set(t+i.charAt(0).toUpperCase()+i.slice(1),e)),G(t,c,r),G(t,c,a);const g=e.blendMode;if(n.set(g.blendFunction,g),h){const e=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/;let n=t+"MainImage(color0, UV, ";0!=(o&U)&&e.test(a.get("fragment"))&&(n+="depth, ",p=!0),n+="color1);\n\t";const r=t+"BlendOpacity";s.set(r,g.opacity),n+=`color0 = blend${g.blendFunction}(color0, color1, ${r});\n\n\t`,i.set(m.FRAGMENT_MAIN_IMAGE,i.get(m.FRAGMENT_MAIN_IMAGE)+n),n=`uniform float ${r};\n\n`,i.set(m.FRAGMENT_HEAD,i.get(m.FRAGMENT_HEAD)+n)}i.set(m.FRAGMENT_HEAD,i.get(m.FRAGMENT_HEAD)+a.get("fragment")+"\n"),null!==a.get("vertex")&&i.set(m.VERTEX_HEAD,i.get(m.VERTEX_HEAD)+a.get("vertex")+"\n")}else;return{varyings:u,transformedUv:d,readDepth:p}}var Y=class extends T{constructor(t,...e){super("EffectPass"),this.fullscreenMaterial=new y(null,null,null,t),this.effects=e.sort((t,e)=>e.attributes-t.attributes),this.skipRendering=!1,this.uniformCount=0,this.varyingCount=0,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(t){this.fullscreenMaterial.encodeOutput=t}get dithering(){return this.fullscreenMaterial.dithering}set dithering(t){const e=this.fullscreenMaterial;e.dithering=t,e.needsUpdate=!0}verifyResources(){const t=this.renderer.capabilities;let e=Math.min(t.maxFragmentUniforms,t.maxVertexUniforms);this.uniformCount,e=t.maxVaryings,this.varyingCount}updateMaterial(){const t=y.Section,e=new Map([[t.FRAGMENT_HEAD,""],[t.FRAGMENT_MAIN_UV,""],[t.FRAGMENT_MAIN_IMAGE,""],[t.VERTEX_HEAD,""],[t.VERTEX_MAIN_SUPPORT,""]]),i=new Map,n=new Map,r=new Map,s=new Set;let o=0,a=0,h=0,l=!1,u=!1;for(const t of this.effects)if(t.blendMode.blendFunction===L)h|=t.getAttributes()&U;else if(0!=(h&t.getAttributes()&V));else{h|=t.getAttributes();const c=W("e"+o++,t,e,i,n,r,h);if(a+=c.varyings.length,l=l||c.transformedUv,u=u||c.readDepth,null!==t.extensions)for(const e of t.extensions)s.add(e)}const c=/\bblend\b/g;for(const n of i.values()){const i=n.getShaderCode().replace(c,"blend"+n.blendFunction);e.set(t.FRAGMENT_HEAD,e.get(t.FRAGMENT_HEAD)+i+"\n")}if(0!=(h&U)){if(u){const i="float depth = readDepth(UV);\n\n\t";e.set(t.FRAGMENT_MAIN_IMAGE,i+e.get(t.FRAGMENT_MAIN_IMAGE))}this.needsDepthTexture=null===this.getDepthTexture()}else this.needsDepthTexture=!1;if(l){const i="vec2 transformedUv = vUv;\n";e.set(t.FRAGMENT_MAIN_UV,i+e.get(t.FRAGMENT_MAIN_UV)),n.set("UV","transformedUv")}else n.set("UV","vUv");e.forEach((t,e,i)=>i.set(e,t.trim().replace(/^#/,"\n#"))),this.uniformCount=r.size,this.varyingCount=a,this.skipRendering=0===o,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderParts(e).setExtensions(s).setUniforms(r).setDefines(n)}recompile(){this.updateMaterial(),this.verifyResources()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(t,e=n.BasicDepthPacking){this.fullscreenMaterial.depthBuffer=t,this.fullscreenMaterial.depthPacking=e;for(const i of this.effects)i.setDepthTexture(t,e)}render(t,e,i,n,r){for(const i of this.effects)i.update(t,e,n);if(!this.skipRendering||this.renderToScreen){const r=this.fullscreenMaterial;r.inputBuffer=e.texture,r.time+=n,t.setRenderTarget(this.renderToScreen?null:i),t.render(this.scene,this.camera)}}setSize(t,e){this.fullscreenMaterial.setSize(t,e);for(const i of this.effects)i.setSize(t,e)}initialize(t,e,i){this.renderer=t;for(const n of this.effects)n.initialize(t,e,i),n.addEventListener("change",t=>this.handleEvent(t));this.updateMaterial(),this.verifyResources(),void 0!==i&&i!==n.UnsignedByteType&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const t of this.effects)t.dispose()}handleEvent(t){switch(t.type){case"change":this.recompile()}}},X=(new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10]),class extends T{constructor(t,e){super("MaskPass",t,e),this.needsSwap=!1,this.clearPass=new _(!1,!1,!0),this.inverse=!1}get inverted(){return this.inverse}set inverted(t){this.inverse=t}get clear(){return this.clearPass.enabled}set clear(t){this.clearPass.enabled=t}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(t){this.inverted=t}render(t,e,i,n,r){const s=t.getContext(),o=t.state.buffers,a=this.scene,h=this.camera,l=this.clearPass,u=this.inverted?0:1,c=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),o.stencil.setFunc(s.ALWAYS,u,4294967295),o.stencil.setClear(c),o.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?l.render(t,null):(l.render(t,e),l.render(t,i))),this.renderToScreen?(t.setRenderTarget(null),t.render(a,h)):(t.setRenderTarget(e),t.render(a,h),t.setRenderTarget(i),t.render(a,h)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(s.EQUAL,1,4294967295),o.stencil.setOp(s.KEEP,s.KEEP,s.KEEP),o.stencil.setLocked(!0)}}),j=class extends T{constructor(t,e="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=t,this.inputBufferUniform=null,this.setInput(e)}setInput(t){if(this.inputBufferUniform=null,null!==this.fullscreenMaterial){const e=this.fullscreenMaterial.uniforms;void 0!==e&&void 0!==e[t]&&(this.inputBufferUniform=e[t])}}render(t,e,i,n,r){null!==this.inputBufferUniform&&null!==e&&(this.inputBufferUniform.value=e.texture),t.setRenderTarget(this.renderToScreen?null:i),t.render(this.scene,this.camera)}initialize(t,e,i){void 0!==i&&i!==n.UnsignedByteType&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},q=(Set,class extends H{constructor({blendFunction:t=B,brightness:e=0,contrast:i=0}={}){super("BrightnessContrastEffect","uniform float brightness;uniform float contrast;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=inputColor.rgb+vec3(brightness-0.5);if(contrast>0.0){color/=vec3(1.0-contrast);}else{color*=vec3(1.0+contrast);}outputColor=vec4(min(color+vec3(0.5),1.0),inputColor.a);}",{blendFunction:t,uniforms:new Map([["brightness",new n.Uniform(e)],["contrast",new n.Uniform(i)]])})}get brightness(){return this.uniforms.get("brightness").value}set brightness(t){this.uniforms.get("brightness").value=t}getBrightness(t){return this.brightness}setBrightness(t){this.brightness=t}get contrast(){return this.uniforms.get("contrast").value}set contrast(t){this.uniforms.get("contrast").value=t}getContrast(t){return this.contrast}setContrast(t){this.contrast=t}});n.DataTexture;new n.Vector3,new n.Matrix4;var Q=class extends H{constructor({blendFunction:t=B,hue:e=0,saturation:i=0}={}){super("HueSaturationEffect","uniform vec3 hue;uniform float saturation;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec3 color=vec3(dot(inputColor.rgb,hue.xyz),dot(inputColor.rgb,hue.zxy),dot(inputColor.rgb,hue.yzx));float average=(color.r+color.g+color.b)/3.0;vec3 diff=average-color;if(saturation>0.0){color+=diff*(1.0-1.0/(1.001-saturation));}else{color+=diff*-saturation;}outputColor=vec4(min(color,1.0),inputColor.a);}",{blendFunction:t,uniforms:new Map([["hue",new n.Uniform(new n.Vector3)],["saturation",new n.Uniform(i)]])}),this.hue=e}get saturation(){return this.uniforms.get("saturation").value}set saturation(t){this.uniforms.get("saturation").value=t}getSaturation(){return this.saturation}setSaturation(t){this.saturation=t}get hue(){const t=this.uniforms.get("hue").value;return Math.acos((3*t.x-1)/2)}set hue(t){const e=Math.sin(t),i=Math.cos(t);this.uniforms.get("hue").value.set((2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3)}getHue(){return this.hue}setHue(t){this.hue=t}};function K(t,e,i){const n=document.createElement("canvas"),r=n.getContext("2d");if(n.width=t,n.height=e,i instanceof Image)r.drawImage(i,0,0);else{const n=r.createImageData(t,e);n.data.set(i),r.putImageData(n,0,0)}return n}var J=class{constructor(t=0,e=0,i=null){this.width=t,this.height=e,this.data=i}toCanvas(){return"undefined"==typeof document?null:K(this.width,this.height,this.data)}static from(t){const{width:e,height:i}=t;let n;if(t instanceof Image){const r=K(e,i,t);if(null!==r){n=r.getContext("2d").getImageData(0,0,e,i).data}}else n=t.data;return new J(e,i,n)}},Z="lut.scaleup",$=new n.Color,tt=class extends n.DataTexture3D{constructor(t,e){super(t,e,e,e),this.type=n.FloatType,this.format=n.RGBAFormat,this.encoding=n.LinearEncoding,this.minFilter=n.LinearFilter,this.magFilter=n.LinearFilter,this.wrapS=n.ClampToEdgeWrapping,this.wrapT=n.ClampToEdgeWrapping,this.wrapR=n.ClampToEdgeWrapping,this.unpackAlignment=1,this.needsUpdate=!0,this.domainMin=new n.Vector3(0,0,0),this.domainMax=new n.Vector3(1,1,1)}get isLookupTexture3D(){return!0}scaleUp(t,e=!0){const i=this.image;let n;return n=t<=i.width?Promise.reject(new Error("The target size must be greater than the current size")):new Promise((n,r)=>{const s=URL.createObjectURL(new Blob(['(()=>{var E=Math.pow;var _={SCALE_UP:"lut.scaleup"};var k=[new Float32Array(3),new Float32Array(3)],n=[new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3)],Z=[[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1])],[new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1])]];function S(a,t,r,m){let i=r[0]-t[0],e=r[1]-t[1],y=r[2]-t[2],h=a[0]-t[0],A=a[1]-t[1],w=a[2]-t[2],c=e*w-y*A,l=y*h-i*w,x=i*A-e*h,u=Math.sqrt(c*c+l*l+x*x),b=u*.5,s=c/u,F=l/u,f=x/u,p=-(a[0]*s+a[1]*F+a[2]*f),M=m[0]*s+m[1]*F+m[2]*f;return Math.abs(M+p)*b/3}function U(a,t,r,m,i,e){let y=(r+m*t+i*t*t)*4;e[0]=a[y+0],e[1]=a[y+1],e[2]=a[y+2]}function j(a,t,r,m,i,e){let y=r*(t-1),h=m*(t-1),A=i*(t-1),w=Math.floor(y),c=Math.floor(h),l=Math.floor(A),x=Math.ceil(y),u=Math.ceil(h),b=Math.ceil(A),s=y-w,F=h-c,f=A-l;if(w===y&&c===h&&l===A)U(a,t,y,h,A,e);else{let p;s>=F&&F>=f?p=Z[0]:s>=f&&f>=F?p=Z[1]:f>=s&&s>=F?p=Z[2]:F>=s&&s>=f?p=Z[3]:F>=f&&f>=s?p=Z[4]:f>=F&&F>=s&&(p=Z[5]);let[M,g,X,Y]=p,P=k[0];P[0]=s,P[1]=F,P[2]=f;let o=k[1],V=x-w,d=u-c,L=b-l;o[0]=V*M[0]+w,o[1]=d*M[1]+c,o[2]=L*M[2]+l,U(a,t,o[0],o[1],o[2],n[0]),o[0]=V*g[0]+w,o[1]=d*g[1]+c,o[2]=L*g[2]+l,U(a,t,o[0],o[1],o[2],n[1]),o[0]=V*X[0]+w,o[1]=d*X[1]+c,o[2]=L*X[2]+l,U(a,t,o[0],o[1],o[2],n[2]),o[0]=V*Y[0]+w,o[1]=d*Y[1]+c,o[2]=L*Y[2]+l,U(a,t,o[0],o[1],o[2],n[3]);let T=S(g,X,Y,P)*6,v=S(M,X,Y,P)*6,q=S(M,g,Y,P)*6,C=S(M,g,X,P)*6;n[0][0]*=T,n[0][1]*=T,n[0][2]*=T,n[1][0]*=v,n[1][1]*=v,n[1][2]*=v,n[2][0]*=q,n[2][1]*=q,n[2][2]*=q,n[3][0]*=C,n[3][1]*=C,n[3][2]*=C,e[0]=n[0][0]+n[1][0]+n[2][0]+n[3][0],e[1]=n[0][1]+n[1][1]+n[2][1]+n[3][1],e[2]=n[0][2]+n[1][2]+n[2][2]+n[3][2]}}var O=class{static expand(t,r){let m=Math.cbrt(t.length/4),i=new Float32Array(3),e=new t.constructor(E(r,3)*4),y=t instanceof Uint8Array?255:1,h=E(r,2),A=1/(r-1);for(let w=0;w<r;++w)for(let c=0;c<r;++c)for(let l=0;l<r;++l){let x=l*A,u=c*A,b=w*A,s=Math.round(l+c*r+w*h)*4;j(t,m,x,u,b,i),e[s+0]=i[0],e[s+1]=i[1],e[s+2]=i[2],e[s+3]=y}return e}};self.addEventListener("message",a=>{let t=a.data,r=t.data;switch(t.operation){case _.SCALE_UP:r=O.expand(r,t.size);break}postMessage(r,[r.buffer]),close()});})();\n'],{type:"text/javascript"})),o=new Worker(s);o.addEventListener("error",t=>r(t.error)),o.addEventListener("message",e=>{const i=new tt(e.data,t);i.encoding=this.encoding,i.type=this.type,i.name=this.name,URL.revokeObjectURL(s),n(i)});const a=e?[i.data.buffer]:[];o.postMessage({operation:Z,data:i.data,size:t},a)}),n}applyLUT(t){const e=this.image,i=t.image,r=Math.min(e.width,e.height,e.depth);if(r!==Math.min(i.width,i.height,i.depth));else if(t.type!==n.FloatType||this.type!==n.FloatType);else if(t.format!==n.RGBAFormat||this.format!==n.RGBAFormat);else{const t=e.data,n=i.data,s=r,o=s**2,a=s-1;for(let e=0,i=s**3;e<i;++e){const i=4*e,r=t[i+0]*a,h=t[i+1]*a,l=t[i+2]*a,u=4*Math.round(r+h*s+l*o);t[i+0]=n[u+0],t[i+1]=n[u+1],t[i+2]=n[u+2]}this.needsUpdate=!0}return this}convertToUint8(){if(this.type===n.FloatType){const t=this.image.data,e=new Uint8Array(t.length);for(let i=0,n=t.length;i<n;++i)e[i]=255*t[i]+.5;this.image.data=e,this.type=n.UnsignedByteType,this.needsUpdate=!0}return this}convertToFloat(){if(this.type===n.UnsignedByteType){const t=this.image.data,e=new Float32Array(t.length);for(let i=0,n=t.length;i<n;++i)e[i]=t[i]/255;this.image.data=e,this.type=n.FloatType,this.needsUpdate=!0}return this}convertToRGBA(){return this}convertLinearToSRGB(){const t=this.image.data;if(this.type===n.FloatType){for(let e=0,i=t.length;e<i;e+=4)$.fromArray(t,e).convertLinearToSRGB().toArray(t,e);this.encoding=n.sRGBEncoding,this.needsUpdate=!0}return this}convertSRGBToLinear(){const t=this.image.data;if(this.type===n.FloatType){for(let e=0,i=t.length;e<i;e+=4)$.fromArray(t,e).convertSRGBToLinear().toArray(t,e);this.encoding=n.LinearEncoding,this.needsUpdate=!0}return this}toDataTexture(){const t=this.image.width,e=this.image.height*this.image.depth,i=new n.DataTexture(this.image.data,t,e);return i.name=this.name,i.type=this.type,i.format=this.format,i.encoding=this.encoding,i.minFilter=n.LinearFilter,i.magFilter=n.LinearFilter,i.wrapS=this.wrapS,i.wrapT=this.wrapT,i.generateMipmaps=!1,i.needsUpdate=!0,i}static from(t){const e=t.image,{width:i,height:n}=e,r=Math.min(i,n);let s;if(e instanceof Image){const t=J.from(e).data;if(i>n){s=new Uint8Array(t.length);for(let e=0;e<r;++e)for(let i=0;i<r;++i)for(let n=0;n<r;++n){const o=4*(n+e*r+i*r*r),a=4*(n+i*r+e*r*r);s[a+0]=t[o+0],s[a+1]=t[o+1],s[a+2]=t[o+2],s[a+3]=t[o+3]}}else s=new Uint8Array(t.buffer)}else s=e.data.slice();const o=new tt(s,r);return o.encoding=t.encoding,o.type=t.type,o.name=t.name,o}static createNeutral(t){const e=new Float32Array(t**3*4),i=t**2,n=1/(t-1);for(let r=0;r<t;++r)for(let s=0;s<t;++s)for(let o=0;o<t;++o){const a=4*(r+s*t+o*i);e[a+0]=r*n,e[a+1]=s*n,e[a+2]=o*n,e[a+3]=1}const r=new tt(e,t);return r.name="neutral",r}},et=(Math.PI,new n.Vector3,new n.Vector3,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAYAAACm53kpAAAAeElEQVRYR+2XSwqAMAxEJ168ePEqwRSKhIIiuHjJqiU0gWE+1CQdApcVAMUAuARaMGCX1MIL/Ow13++9lW2s3mW9MWvsnWc/2fvGygwPAN4E8QzAA4CXAB6AHjG4JTHYI1ey3pcx6FHnEfhLDOIBKAmUBK6/ANUDTlROXAHd9EC1AAAAAElFTkSuQmCC"),it="data:image/png;base64,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",nt=0,rt=1,st=2,ot=3,at=class extends H{constructor({preset:t=rt,edgeDetectionMode:e=p,predicationMode:i=f}={}){let r,s;super("SMAAEffect","uniform sampler2D weightMap;varying vec2 vOffset0;varying vec2 vOffset1;void movec(const in bvec2 c,inout vec2 variable,const in vec2 value){if(c.x){variable.x=value.x;}if(c.y){variable.y=value.y;}}void movec(const in bvec4 c,inout vec4 variable,const in vec4 value){movec(c.xy,variable.xy,value.xy);movec(c.zw,variable.zw,value.zw);}void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 a;a.x=texture2D(weightMap,vOffset0).a;a.y=texture2D(weightMap,vOffset1).g;a.wz=texture2D(weightMap,uv).rb;vec4 color=inputColor;if(dot(a,vec4(1.0))>=1e-5){bool h=max(a.x,a.z)>max(a.y,a.w);vec4 blendingOffset=vec4(0.0,a.y,0.0,a.w);vec2 blendingWeight=a.yw;movec(bvec4(h),blendingOffset,vec4(a.x,0.0,a.z,0.0));movec(bvec2(h),blendingWeight,a.xz);blendingWeight/=dot(blendingWeight,vec2(1.0));vec4 blendingCoord=blendingOffset*vec4(texelSize,-texelSize)+uv.xyxy;color=blendingWeight.x*texture2D(inputBuffer,blendingCoord.xy);color+=blendingWeight.y*texture2D(inputBuffer,blendingCoord.zw);}outputColor=color;}",{vertexShader:"varying vec2 vOffset0;varying vec2 vOffset1;void mainSupport(const in vec2 uv){vOffset0=uv+texelSize*vec2(1.0,0.0);vOffset1=uv+texelSize*vec2(0.0,1.0);}",blendFunction:B,attributes:V|U,uniforms:new Map([["weightMap",new n.Uniform(null)]])}),arguments.length>1&&(r=arguments[0],s=arguments[1],arguments.length>2&&(t=arguments[2]),arguments.length>3&&(e=arguments[3])),this.renderTargetEdges=new n.WebGLRenderTarget(1,1,{minFilter:n.LinearFilter,stencilBuffer:!1,depthBuffer:!1}),this.renderTargetEdges.texture.name="SMAA.Edges",this.renderTargetWeights=this.renderTargetEdges.clone(),this.renderTargetWeights.texture.name="SMAA.Weights",this.uniforms.get("weightMap").value=this.renderTargetWeights.texture,this.clearPass=new _(!0,!1,!1),this.clearPass.overrideClearColor=new n.Color(0),this.clearPass.overrideClearAlpha=1,this.edgeDetectionPass=new j(new g),this.edgeDetectionMaterial.edgeDetectionMode=e,this.edgeDetectionMaterial.predicationMode=i,this.weightsPass=new j(new w);const o=new n.LoadingManager;o.onLoad=()=>{const t=new n.Texture(r);t.name="SMAA.Search",t.magFilter=n.NearestFilter,t.minFilter=n.NearestFilter,t.generateMipmaps=!1,t.needsUpdate=!0,t.flipY=!0,this.weightsMaterial.searchTexture=t;const e=new n.Texture(s);e.name="SMAA.Area",e.magFilter=n.LinearFilter,e.minFilter=n.LinearFilter,e.generateMipmaps=!1,e.needsUpdate=!0,e.flipY=!1,this.weightsMaterial.areaTexture=e,this.dispatchEvent({type:"load"})},o.itemStart("search"),o.itemStart("area"),void 0!==r&&void 0!==s?(o.itemEnd("search"),o.itemEnd("area")):"undefined"!=typeof Image&&(r=new Image,s=new Image,r.addEventListener("load",()=>o.itemEnd("search")),s.addEventListener("load",()=>o.itemEnd("area")),r.src=et,s.src=it),this.applyPreset(t)}get edgesTexture(){return this.renderTargetEdges.texture}getEdgesTexture(){return this.edgesTexture}get weightsTexture(){return this.renderTargetWeights.texture}getWeightsTexture(){return this.weightsTexture}get edgeDetectionMaterial(){return this.edgeDetectionPass.fullscreenMaterial}get colorEdgesMaterial(){return this.edgeDetectionMaterial}getEdgeDetectionMaterial(){return this.edgeDetectionMaterial}get weightsMaterial(){return this.weightsPass.fullscreenMaterial}getWeightsMaterial(){return this.weightsMaterial}setEdgeDetectionThreshold(t){this.edgeDetectionMaterial.edgeDetectionThreshold=t}setOrthogonalSearchSteps(t){this.weightsMaterial.orthogonalSearchSteps=t}applyPreset(t){const e=this.edgeDetectionMaterial,i=this.weightsMaterial;switch(t){case nt:e.edgeDetectionThreshold=.15,i.orthogonalSearchSteps=4,i.diagonalDetection=!1,i.cornerDetection=!1;break;case rt:e.edgeDetectionThreshold=.1,i.orthogonalSearchSteps=8,i.diagonalDetection=!1,i.cornerDetection=!1;break;case st:e.edgeDetectionThreshold=.1,i.orthogonalSearchSteps=16,i.diagonalSearchSteps=8,i.cornerRounding=25,i.diagonalDetection=!0,i.cornerDetection=!0;break;case ot:e.edgeDetectionThreshold=.05,i.orthogonalSearchSteps=32,i.diagonalSearchSteps=16,i.cornerRounding=25,i.diagonalDetection=!0,i.cornerDetection=!0}}setDepthTexture(t,e=n.BasicDepthPacking){this.edgeDetectionMaterial.depthBuffer=t,this.edgeDetectionMaterial.depthPacking=e}update(t,e,i){this.clearPass.render(t,this.renderTargetEdges),this.edgeDetectionPass.render(t,e,this.renderTargetEdges),this.weightsPass.render(t,this.renderTargetEdges,this.renderTargetWeights)}setSize(t,e){this.edgeDetectionMaterial.setSize(t,e),this.weightsMaterial.setSize(t,e),this.renderTargetEdges.setSize(t,e),this.renderTargetWeights.setSize(t,e)}dispose(){const{searchTexture:t,areaTexture:e}=this.weightsMaterial;null!==t&&null!==e&&(t.dispose(),e.dispose()),super.dispose()}static get searchImageDataURL(){return et}static get areaImageDataURL(){return it}};new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array(3),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([1,0,0]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([1,0,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([1,1,0]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,1,0]),new Float32Array([0,1,1]),new Float32Array([1,1,1]),new Float32Array([0,0,0]),new Float32Array([0,0,1]),new Float32Array([0,1,1]),new Float32Array([1,1,1]);new Float32Array(2),new Float32Array(2),new Float32Array([0,-.25,.25,-.125,.125,-.375,.375]),new Float32Array([0,0]),new Float32Array([.25,-.25]),new Float32Array([-.25,.25]),new Float32Array([.125,-.125]),new Float32Array([-.125,.125]),new Uint8Array([0,0]),new Uint8Array([3,0]),new Uint8Array([0,3]),new Uint8Array([3,3]),new Uint8Array([1,0]),new Uint8Array([4,0]),new Uint8Array([1,3]),new Uint8Array([4,3]),new Uint8Array([0,1]),new Uint8Array([3,1]),new Uint8Array([0,4]),new Uint8Array([3,4]),new Uint8Array([1,1]),new Uint8Array([4,1]),new Uint8Array([1,4]),new Uint8Array([4,4]),new Uint8Array([0,0]),new Uint8Array([1,0]),new Uint8Array([0,2]),new Uint8Array([1,2]),new Uint8Array([2,0]),new Uint8Array([3,0]),new Uint8Array([2,2]),new Uint8Array([3,2]),new Uint8Array([0,1]),new Uint8Array([1,1]),new Uint8Array([0,3]),new Uint8Array([1,3]),new Uint8Array([2,1]),new Uint8Array([3,1]),new Uint8Array([2,3]),new Uint8Array([3,3]);lt(0,0,0,0),new Float32Array([0,0,0,0]),lt(0,0,0,1),new Float32Array([0,0,0,1]),lt(0,0,1,0),new Float32Array([0,0,1,0]),lt(0,0,1,1),new Float32Array([0,0,1,1]),lt(0,1,0,0),new Float32Array([0,1,0,0]),lt(0,1,0,1),new Float32Array([0,1,0,1]),lt(0,1,1,0),new Float32Array([0,1,1,0]),lt(0,1,1,1),new Float32Array([0,1,1,1]),lt(1,0,0,0),new Float32Array([1,0,0,0]),lt(1,0,0,1),new Float32Array([1,0,0,1]),lt(1,0,1,0),new Float32Array([1,0,1,0]),lt(1,0,1,1),new Float32Array([1,0,1,1]),lt(1,1,0,0),new Float32Array([1,1,0,0]),lt(1,1,0,1),new Float32Array([1,1,0,1]),lt(1,1,1,0),new Float32Array([1,1,1,0]),lt(1,1,1,1),new Float32Array([1,1,1,1]);function ht(t,e,i){return t+(e-t)*i}function lt(t,e,i,n){const r=ht(t,e,.75),s=ht(i,n,.75);return ht(r,s,.875)}n.Loader,n.Loader,n.Loader;var ut=i(12);function ct(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var dt=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,r;return e=t,r=[{key:"init",value:function(t){t.composer=new class{constructor(t=null,{depthBuffer:e=!0,stencilBuffer:i=!1,multisampling:n=0,frameBufferType:r}={}){this.renderer=null,this.inputBuffer=this.createBuffer(e,i,r,n),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new S,this.depthTexture=null,this.passes=[],this.timer=new class{constructor(){this.previousTime=0,this.currentTime=0,this.delta=0,this.fixedDelta=1e3/60,this.elapsed=0,this.timescale=1,this.fixedDeltaEnabled=!1,this.autoReset=!1}setFixedDeltaEnabled(t){return this.fixedDeltaEnabled=t,this}isAutoResetEnabled(t){return this.autoReset}setAutoResetEnabled(t){return"undefined"!=typeof document&&void 0!==document.hidden&&(t?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this.autoReset=t),this}getDelta(){return.001*this.delta}getFixedDelta(){return.001*this.fixedDelta}setFixedDelta(t){return this.fixedDelta=1e3*t,this}getElapsed(){return.001*this.elapsed}getTimescale(){return this.timescale}setTimescale(t){return this.timescale=t,this}update(t){return this.fixedDeltaEnabled?this.delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=void 0!==t?t:performance.now(),this.delta=this.currentTime-this.previousTime),this.delta*=this.timescale,this.elapsed+=this.delta,this}reset(){return this.delta=0,this.elapsed=0,this.currentTime=performance.now(),this}handleEvent(t){document.hidden||(this.currentTime=performance.now())}dispose(){this.setAutoResetEnabled(!1)}},this.autoRenderToScreen=!0,this.setRenderer(t)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(t){const e=this.inputBuffer,i=this.multisampling;i>0&&t>0?(this.inputBuffer.samples=t,this.outputBuffer.samples=t,this.inputBuffer.dispose(),this.outputBuffer.dispose()):i!==t&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,t),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(t){if(this.renderer=t,null!==t){const e=t.getSize(new n.Vector2),i=t.getContext().getContextAttributes().alpha,r=this.inputBuffer.texture.type;r===n.UnsignedByteType&&t.outputEncoding===n.sRGBEncoding&&(this.inputBuffer.texture.encoding=n.sRGBEncoding,this.outputBuffer.texture.encoding=n.sRGBEncoding,this.inputBuffer.dispose(),this.outputBuffer.dispose()),t.autoClear=!1,this.setSize(e.width,e.height);for(const e of this.passes)e.initialize(t,i,r)}}replaceRenderer(t,e=!0){const i=this.renderer,n=i.domElement.parentNode;return this.setRenderer(t),e&&null!==n&&(n.removeChild(i.domElement),n.appendChild(t.domElement)),i}createDepthTexture(){const t=this.depthTexture=new n.DepthTexture;return this.inputBuffer.depthTexture=t,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(t.format=n.DepthStencilFormat,t.type=n.UnsignedInt248Type):t.type=n.UnsignedIntType,t}deleteDepthTexture(){if(null!==this.depthTexture){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(const t of this.passes)t.setDepthTexture(null)}}createBuffer(t,e,i,r){const s=this.renderer,o=null===s?new n.Vector2:s.getDrawingBufferSize(new n.Vector2),a={minFilter:n.LinearFilter,magFilter:n.LinearFilter,stencilBuffer:e,depthBuffer:t,type:i};let h;return r>0?(h=Number(n.REVISION.replace(/\D+/g,""))<138?new n.WebGLMultisampleRenderTarget(o.width,o.height,a):new n.WebGLRenderTarget(o.width,o.height,a),h.ignoreDepthForMultisampleCopy=!1,h.samples=r):h=new n.WebGLRenderTarget(o.width,o.height,a),i===n.UnsignedByteType&&null!==s&&s.outputEncoding===n.sRGBEncoding&&(h.texture.encoding=n.sRGBEncoding),h.texture.name="EffectComposer.Buffer",h.texture.generateMipmaps=!1,h}addPass(t,e){const i=this.passes,r=this.renderer,s=r.getDrawingBufferSize(new n.Vector2),o=r.getContext().getContextAttributes().alpha,a=this.inputBuffer.texture.type;if(t.setRenderer(r),t.setSize(s.width,s.height),t.initialize(r,o,a),this.autoRenderToScreen&&(i.length>0&&(i[i.length-1].renderToScreen=!1),t.renderToScreen&&(this.autoRenderToScreen=!1)),void 0!==e?i.splice(e,0,t):i.push(t),this.autoRenderToScreen&&(i[i.length-1].renderToScreen=!0),t.needsDepthTexture||null!==this.depthTexture)if(null===this.depthTexture){const e=this.createDepthTexture();for(t of i)t.setDepthTexture(e)}else t.setDepthTexture(this.depthTexture)}removePass(t){const e=this.passes,i=e.indexOf(t);if(-1!==i&&e.splice(i,1).length>0){if(null!==this.depthTexture){const i=(t,e)=>t||e.needsDepthTexture;e.reduce(i,!1)||(t.getDepthTexture()===this.depthTexture&&t.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&i===e.length&&(t.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){const t=this.passes;this.deleteDepthTexture(),t.length>0&&(this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!1),this.passes=[])}render(t){const e=this.renderer,i=this.copyPass;let n,r,s,o=this.inputBuffer,a=this.outputBuffer,h=!1;void 0===t&&(t=this.timer.update().getDelta());for(const l of this.passes)l.enabled&&(l.render(e,o,a,t,h),l.needsSwap&&(h&&(i.renderToScreen=l.renderToScreen,n=e.getContext(),r=e.state.buffers.stencil,r.setFunc(n.NOTEQUAL,1,4294967295),i.render(e,o,a,t,h),r.setFunc(n.EQUAL,1,4294967295)),s=o,o=a,a=s),l instanceof X?h=!0:l instanceof E&&(h=!1))}setSize(t,e,i){const r=this.renderer;if(void 0===t||void 0===e){const i=r.getSize(new n.Vector2);t=i.width,e=i.height}r.setSize(t,e,i);const s=r.getDrawingBufferSize(new n.Vector2);this.inputBuffer.setSize(s.width,s.height),this.outputBuffer.setSize(s.width,s.height);for(const t of this.passes)t.setSize(s.width,s.height)}reset(){const t=this.timer.isAutoResetEnabled();this.dispose(),this.autoRenderToScreen=!0,this.timer.setAutoResetEnabled(t)}dispose(){for(const t of this.passes)t.dispose();this.passes=[],null!==this.inputBuffer&&this.inputBuffer.dispose(),null!==this.outputBuffer&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose()}}(t.renderer);var e=new R(t.scene,t.camera);e.renderToScreen=!1,new at({preset:rt,edgeDetectionMode:d,predicationMode:m}).edgeDetectionMaterial.edgeDetectionThreshold=.001;var i=new Q({blendFunction:B,saturation:-.01,hue:0}),r=new q({blendFunction:B,brightness:-.01,contrast:.09});this.brightnessEffect=r,setTimeout((function(){if(ut.a.gui){var t={val:0};ut.a.gui.add(t,"val",-1,1,.01).onChange((function(){i.hue=t.val})),ut.a.gui.add(i,"saturation",-1,1,.01).onChange((function(){i.update()})),ut.a.gui.add(r,"brightness",-.3,.3,.01),ut.a.gui.add(r,"contrast",-1,1,.01)}}),10);var s=new Y(t.camera,i,r);t.composer.addPass(e),t.composer.addPass(s),this.inited=!0,this.main=t}},{key:"resize",value:function(t,e){this.inited&&this.main.composer.setSize(t,e)}},{key:"render",value:function(){this.inited&&this.main.composer.render()}}],(i=null)&&ct(e.prototype,i),r&&ct(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}()},function(t,e,i){"use strict";var n=i(0),r=i(48),s=i.n(r),o=i(2),a=(i(20),i(1)),h=i(49),l=i(50),u=i(51),c=i(52),d=i(53),p=i(3),f=i(15),m={};m.armDataList=[h,l,u,c,d],m.getArmData=function(t){var e=t;return void 0===e&&(e=n.MathUtils.randInt(0,m.armDataList.length-1)),m.armDataList[e]},m.createMesh=function(t,e){for(var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"#000000",o=[],a=[],h=0;h<e.length;h++){var l=e[h],u=l.x,c=l.y;i&&(u*=-1,c*=-1);var d={x:.75*u,y:.75*c};a.push(d),o.push(new n.Vector3(d.x,d.y,0))}a=s()(o,.01,!0);var p=new n.CatmullRomCurve3(a),f=p.getSpacedPoints(Math.floor(.5*a.length)),g=m.createGeometry(f,t.position,i),v=g,y=new n.MeshStandardMaterial({color:r,roughness:0,side:THREE.DoubleSide});y.color.convertSRGBToLinear();var x=new n.Mesh(v,y);x.castShadow=!0,x.visible=!0;var w=m.createBody(f,t,i);return x.pointList=f,x.reversed=i,x.catmullPath=p,x.bodyShapeList=w,x},m.createGeometryExtrude=function(t,e,i){var r=t,s=new n.Shape;s.moveTo(r[0].x,r[0].y);for(var o=[],a=[],h=1;h<r.length-1;h++){var l=r[h].clone(),u=r[h+1].clone().clone().sub(l),c=Math.atan2(u.y,u.x),d=l.x+.1*Math.cos(c+Math.PI/2),p=l.x+.1*Math.cos(c-Math.PI/2),f=l.y+.1*Math.sin(c+Math.PI/2),m=l.y+.1*Math.sin(c-Math.PI/2);o.push({x:d,y:f}),a.push({x:p,y:m})}for(var g=0;g<o.length;g++)s.lineTo(o[g].x,o[g].y);for(var v=a.length-1;v>=0;v--)s.lineTo(a[v].x,a[v].y);var y=new n.ExtrudeGeometry(s,{steps:1,depth:.1,bevelEnabled:!1});e.x,r[0].x,e.y,r[0].y;return i&&-1,y},m.animateMesh=function(t,e,i,r){var s={val:2},o=-1;e.visible=!0;var h=new n.CatmullRomCurve3(t).getSpacedPoints(100);r.createAnimStarted=!0;for(var l=[],u=0;u<r.shapes.length;u++)l.push(r.shapeOffsets[u].clone());return new Promise((function(t){e.visible=!1,a.a.phaserScene.tweens.add({targets:s,val:h.length-1,duration:5*h.length,easing:"Linear",onUpdate:function(){var t=Math.floor(s.val);if(o!==t){e.geometry.dispose(),e.visible=!0;var n=h.slice(0,t);e.pointList=n,e.geometry=m.createGeometry(n,e.position,i)}o=t},onComplete:function(){r.createAnimStarted=!1,t()}})}))},m.destroyArm=function(t,e,i){i=1-i;var r=t.pointList.slice(0,Math.floor(t.pointList.length*i));if(!(r.length<5)){for(var s=t.bodyShapeList,a=Math.floor(s.length*i),h=s.length-1,l=new n.Vector3,u=new o.Vec3,c=h;c>=a;c--){var d=s[c],p=d.offsetman;e.pointToWorldFrame(p,u),l=u,e.removeShape(d),s.pop()}for(var m=[],g=0;g<s.length;g++){var v=s[g];m.push((new n.Vector3).copy(v.offsetman))}if(m.length<3){if(m.length<1){var y=t.position.clone();y.x+=.5,m.push(y)}var x=m[m.length-1].clone(),w=(new n.Vector3).addVectors(x,t.position).multiplyScalar(.5);m=[t.position.clone(),w,x.clone()]}var b=this.createGeometry(m,t.position,t.reversed);t.geometry.dispose(),t.geometry=b,t.pointList=r;var A=l;f.a.crumbleEffect.startSpawning(A,3)}},m.destroyArmMeshOnly=function(t,e){var i=Math.floor(t.pointList.length*e),n=t.pointList.slice(0,i);if(!(n.length<5)){var r=this.createGeometry(n,t.position,t.reversed);if(t.geometry.dispose(),t.geometry=r,t.destroyTim||(t.destroyTim=0),t.destroyTim+=1/60,t.destroyTim>1){t.destroyTim=0;var s=n[n.length-1].clone().add(t.parent.position);f.a.crumbleEffect.startSpawning(s,1)}}},m.createGeometry=function(t,e,i){for(this.dummyObjList||(this.dummyObjList=[]);this.dummyObjList.length>0;){var r=this.dummyObjList.pop();a.a.main.scene.remove(r)}var s=new n.CatmullRomCurve3(t),o=new n.TubeGeometry(s,60,.15,3);o.center(),o.scale(1,1,1);var h=o.getAttribute("position"),l=(new n.Vector3).fromBufferAttribute(h,0),u=e.x-l.x,c=e.y-l.y,d=.56;return i&&(d*=-1),o.translate(u,c,d),o.curTranslate=new n.Vector3(u,c,d),o},m.createBody=function(t,e,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=new n.CatmullRomCurve3(t),a=.56;i&&(a*=-1);var h=0-(t=s.getSpacedPoints(t.length-1))[0].x+0*Math.sign(a),l=0-t[0].y+0*Math.sign(a),u=new n.CatmullRomCurve3(t).getSpacedPoints(Math.floor(t.length*r));h=0-u[0].x;for(var c=.15,d=[],f=new n.Object3D,m=0;m<u.length;m++){var g=new o.Box(new o.Vec3(c,c,c)),v=u[m].clone();v.x+=h,v.y+=l,v.z=a;var y=new o.Quaternion;m+1<u.length?(f.position.copy(u[m]),f.lookAt(u[m+1]),y.copy(f.quaternion)):(f.position.copy(u[m]),f.lookAt(u[m-1]),y.copy(f.quaternion));var x=1;e.addShape(g,v,y),g.material=p.a.kontakMaterials.normal,g.createdIndex=m*x,g.realIndex=e.shapes.length-1,g.offsetman=v,d.push(g)}return d},e.a=m},function(t,e,i){"use strict";i.d(e,"a",(function(){return Ce}));var n=i(3),r=i(0);function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function a(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),t}function h(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}function u(t){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function d(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return d(t)}function f(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=u(t);if(e){var r=u(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return p(this,i)}}function m(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==i)return;var n,r,s=[],o=!0,a=!1;try{for(i=i.call(t);!(o=(n=i.next()).done)&&(s.push(n.value),!e||s.length!==e);o=!0);}catch(t){a=!0,r=t}finally{try{o||null==i.return||i.return()}finally{if(a)throw r}}return s}(t,e)||g(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(t,e){if(t){if("string"==typeof t)return v(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?v(t,e):void 0}}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function y(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=g(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==i.return||i.return()}finally{if(a)throw s}}}}var x=function(t){l(i,t);var e=f(i);function i(t){var n;return s(this,i),h(d(n=e.call(this)),"type","ParticleEmitter"),h(d(n),"system",void 0),n.system=t,n.visible=!1,n}return a(i,[{key:"clone",value:function(){return this.system.clone().emitter}},{key:"dispose",value:function(){}},{key:"extractFromCache",value:function(t){var e=[];for(var i in t){var n=t[i];delete n.metadata,e.push(n)}return e}},{key:"toJSON",value:function(t){var e=void 0===t||"string"==typeof t,i={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{}},i.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});var n={};if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),!0===this.castShadow&&(n.castShadow=!0),!0===this.receiveShadow&&(n.receiveShadow=!0),!1===this.visible&&(n.visible=!1),!1===this.frustumCulled&&(n.frustumCulled=!1),0!==this.renderOrder&&(n.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),n.layers=this.layers.mask,n.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(n.matrixAutoUpdate=!1),null!==this.system&&(n.ps=this.system.toJSON(t)),this.children.length>0){n.children=[];for(var r=0;r<this.children.length;r++)n.children.push(this.children[r].toJSON(t).object)}if(e){var s=this.extractFromCache(t.geometries),o=this.extractFromCache(t.materials),a=this.extractFromCache(t.textures),h=this.extractFromCache(t.images);s.length>0&&(i.geometries=s),o.length>0&&(i.materials=o),a.length>0&&(i.textures=a),h.length>0&&(i.images=h)}return i.object=n,i}}]),i}(r.Object3D),w=function t(){s(this,t),h(this,"startSpeed",0),h(this,"startColor",new r.Vector4),h(this,"startSize",1),h(this,"velocity",new r.Vector3),h(this,"age",0),h(this,"life",1),h(this,"angularVelocity",void 0),h(this,"position",new r.Vector3),h(this,"rotation",0),h(this,"rotationQuat",void 0),h(this,"size",1),h(this,"color",new r.Vector4),h(this,"uvTile",0)},b=function(){function t(e){s(this,t),this.value=e,h(this,"type",void 0),this.type="value"}return a(t,[{key:"genValue",value:function(){return this.value}},{key:"toJSON",value:function(){return{type:"ConstantValue",value:this.value}}},{key:"clone",value:function(){return new t(this.value)}}],[{key:"fromJSON",value:function(e){return new t(e.value)}}]),t}(),A=function(){function t(e,i){s(this,t),this.a=e,this.b=i,h(this,"type",void 0),this.type="value"}return a(t,[{key:"genValue",value:function(){return r.MathUtils.lerp(this.a,this.b,Math.random())}},{key:"toJSON",value:function(){return{type:"IntervalValue",a:this.a,b:this.b}}},{key:"clone",value:function(){return new t(this.a,this.b)}}],[{key:"fromJSON",value:function(e){return new t(e.a,e.b)}}]),t}(),T=function(){function t(){s(this,t),h(this,"functions",void 0),this.functions=new Array}return a(t,[{key:"findFunction",value:function(t){for(var e=0,i=0,n=this.functions.length-1;i+1<n;)if(e=Math.floor((i+n)/2),t<this.getStartX(e))n=e-1;else{if(!(t>this.getEndX(e)))return e;i=e+1}for(var r=i;r<=n;r++)if(t>=this.functions[r][1]&&t<=this.getEndX(r))return r;return-1}},{key:"getStartX",value:function(t){return this.functions[t][1]}},{key:"setStartX",value:function(t,e){t>0&&(this.functions[t][1]=e)}},{key:"getEndX",value:function(t){return t+1<this.functions.length?this.functions[t+1][1]:1}},{key:"setEndX",value:function(t,e){t+1<this.functions.length&&(this.functions[t+1][1]=e)}},{key:"getFunction",value:function(t){return this.functions[t][0]}},{key:"setFunction",value:function(t,e){this.functions[t][0]=e}},{key:"numOfFunctions",get:function(){return this.functions.length}}]),t}(),S=function(){function t(e,i,n,r){s(this,t),h(this,"p",void 0),this.p=[e,i,n,r]}return a(t,[{key:"genValue",value:function(t){var e=t*t,i=t*t*t,n=1-t,r=n*n,s=r*n;return this.p[0]*s+this.p[1]*r*t*3+this.p[2]*n*e*3+this.p[3]*i}},{key:"derivativeCoefficients",value:function(t){for(var e=[],i=t,n=i.length-1;n>0;n--){for(var r=[],s=0;s<n;s++){var o=n*(i[s+1]-i[s]);r.push(o)}e.push(r),i=r}return e}},{key:"getSlope",value:function(t){var e=this.derivativeCoefficients(this.p)[0],i=1-t,n=i*t*2,r=t*t;return i*i*e[0]+n*e[1]+r*e[2]}},{key:"controlCurve",value:function(t,e){this.p[1]=t/3+this.p[0],this.p[2]=this.p[3]-e/3}},{key:"hull",value:function(t){var e,i=this.p,n=[],r=[],s=0,o=0,a=0;for(r[s++]=i[0],r[s++]=i[1],r[s++]=i[2],r[s++]=i[3];i.length>1;){for(n=[],o=0,a=i.length-1;o<a;o++)e=t*i[o]+(1-t)*i[o+1],r[s++]=e,n.push(e);i=n}return r}},{key:"split",value:function(e){var i=this.hull(e);return{left:new t(i[0],i[4],i[7],i[9]),right:new t(i[9],i[8],i[6],i[3]),span:i}}},{key:"clone",value:function(){return new t(this.p[0],this.p[1],this.p[2],this.p[3])}},{key:"toJSON",value:function(){return{p0:this.p[0],p1:this.p[1],p2:this.p[2],p3:this.p[3]}}}],[{key:"fromJSON",value:function(e){return new t(e.p0,e.p1,e.p2,e.p3)}}]),t}(),E=function(t){l(i,t);var e=f(i);function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[[new S(0,1/3,1/3*2,1),0]];return s(this,i),h(d(t=e.call(this)),"type",void 0),t.type="function",t.functions=n,t}return a(i,[{key:"genValue",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=this.findFunction(t);return-1===e?0:this.functions[e][0].genValue((t-this.getStartX(e))/(this.getEndX(e)-this.getStartX(e)))}},{key:"toSVG",value:function(t,e){if(e<1)return"";for(var i=["M",0,this.functions[0][0].p[0]].join(" "),n=1/e;n<=1;n+=1/e)i=[i,"L",n*t,this.genValue(n)].join(" ");return i}},{key:"toJSON",value:function(){return{type:"PiecewiseBezier",functions:this.functions.map((function(t){var e=m(t,2),i=e[0],n=e[1];return{function:i.toJSON(),start:n}}))}}},{key:"clone",value:function(){return new i(this.functions.map((function(t){var e=m(t,2),i=e[0],n=e[1];return[i.clone(),n]})))}}],[{key:"fromJSON",value:function(t){return new i(t.functions.map((function(t){return[S.fromJSON(t.function),t.start]})))}}]),i}(T);function M(t){switch(t.type){case"ConstantValue":return b.fromJSON(t);case"IntervalValue":return A.fromJSON(t);case"PiecewiseBezier":return E.fromJSON(t);default:return new b(0)}}var _=function(t){return{r:t.x,g:t.y,b:t.z,a:t.w}},C=function(t){return new r.Vector4(t.r,t.g,t.b,t.a)},P=function(){function t(e,i){s(this,t),this.a=e,this.b=i,h(this,"type",void 0),this.type="value"}return a(t,[{key:"genColor",value:function(t){var e=Math.random();return t.copy(this.a).lerp(this.b,e)}},{key:"toJSON",value:function(){return{type:"RandomColor",a:_(this.a),b:_(this.b)}}},{key:"clone",value:function(){return new t(this.a.clone(),this.b.clone())}}],[{key:"fromJSON",value:function(e){return new t(C(e.a),C(e.b))}}]),t}(),R=function(){function t(e,i){s(this,t),this.a=e,this.b=i,h(this,"type",void 0),this.type="function"}return a(t,[{key:"genColor",value:function(t,e){return t.copy(this.a).lerp(this.b,e)}},{key:"toJSON",value:function(){return{type:"ColorRange",a:_(this.a),b:_(this.b)}}},{key:"clone",value:function(){return new t(this.a.clone(),this.b.clone())}}],[{key:"fromJSON",value:function(e){return new t(C(e.a),C(e.b))}}]),t}(),L=function(){function t(e){s(this,t),this.color=e,h(this,"type",void 0),this.type="value"}return a(t,[{key:"genColor",value:function(t){return t.copy(this.color)}},{key:"toJSON",value:function(){return{type:"ConstantColor",color:_(this.color)}}},{key:"clone",value:function(){return new t(this.color.clone())}}],[{key:"fromJSON",value:function(e){return new t(C(e.color))}}]),t}();function O(t){switch(t.type){case"ConstantColor":return L.fromJSON(t);case"ColorRange":return R.fromJSON(t);case"RandomColor":return P.fromJSON(t);default:return new L(new r.Vector4(1,1,1,1))}}var D=function(){function t(e){s(this,t),this.func=e,h(this,"type","ColorOverLife")}return a(t,[{key:"initialize",value:function(t){}},{key:"update",value:function(t,e){this.func.genColor(t.color,t.age/t.life),t.color.x*=t.startColor.x,t.color.y*=t.startColor.y,t.color.z*=t.startColor.z,t.color.w*=t.startColor.w}},{key:"toJSON",value:function(){return{type:this.type,func:this.func.toJSON()}}},{key:"clone",value:function(){return new t(this.func.clone())}}]),t}(),B=function(){function t(e){s(this,t),this.angularVelocityFunc=e,h(this,"type","RotationOverLife")}return a(t,[{key:"initialize",value:function(t){"value"===this.angularVelocityFunc.type?t.angularVelocity=this.angularVelocityFunc.genValue():t.angularVelocity=0}},{key:"update",value:function(t,e){"value"===this.angularVelocityFunc.type?t.rotation+=e*t.angularVelocity:t.rotation+=e*this.angularVelocityFunc.genValue(t.age/t.life)}},{key:"toJSON",value:function(){return{type:this.type,func:this.angularVelocityFunc.toJSON()}}},{key:"clone",value:function(){return new t(this.angularVelocityFunc)}}]),t}(),I=function(){function t(e){s(this,t),this.func=e,h(this,"type","SizeOverLife")}return a(t,[{key:"initialize",value:function(t){}},{key:"update",value:function(t){t.size=t.startSize*this.func.genValue(t.age/t.life)}},{key:"toJSON",value:function(){return{type:this.type,func:this.func.toJSON()}}},{key:"clone",value:function(){return new t(this.func.clone())}}]),t}(),F=function(){function t(e){s(this,t),this.func=e,h(this,"type","SpeedOverLife")}return a(t,[{key:"initialize",value:function(t){}},{key:"update",value:function(t){t.velocity.normalize().multiplyScalar(t.startSpeed*this.func.genValue(t.age/t.life))}},{key:"toJSON",value:function(){return{type:this.type,func:this.func.toJSON()}}},{key:"clone",value:function(){return new t(this.func.clone())}}]),t}(),k=function(){function t(e){s(this,t),this.func=e,h(this,"type","FrameOverLife")}return a(t,[{key:"initialize",value:function(t){}},{key:"update",value:function(t,e){t.uvTile=Math.floor(this.func.genValue(t.age/t.life))}},{key:"toJSON",value:function(){return{type:this.type,func:this.func.toJSON()}}},{key:"clone",value:function(){return new t(this.func.clone())}}]),t}();new r.Vector3;var N=function(){function t(e){s(this,t),this.angularVelocityFunc=e,h(this,"type","OrbitOverLife")}return a(t,[{key:"initialize",value:function(t){"value"===this.angularVelocityFunc.type?t.angularVelocity=this.angularVelocityFunc.genValue():t.angularVelocity=0}},{key:"update",value:function(t,e){var i=Math.atan2(t.position.y,t.position.x),n=Math.sqrt(t.position.x*t.position.x+t.position.y*t.position.y);i+=this.angularVelocityFunc.genValue(t.age/t.life)*e,t.position.x=Math.cos(i)*n,t.position.y=Math.sin(i)*n}},{key:"toJSON",value:function(){return{type:this.type,func:this.angularVelocityFunc.toJSON()}}},{key:"clone",value:function(){return new t(this.angularVelocityFunc.clone())}}]),t}();var z,U=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,t),h(this,"radius",void 0),h(this,"arc",void 0),h(this,"thickness",void 0),h(this,"angle",void 0),this.radius=e.radius||10,this.arc=e.arc||2*Math.PI,this.thickness=e.thickness||1,this.angle=e.angle||Math.PI/6}return a(t,[{key:"initialize",value:function(t){var e=Math.random(),i=r.MathUtils.lerp(1-this.thickness,1,Math.random()),n=e*this.arc,s=Math.sqrt(i),o=Math.sin(n),a=Math.cos(n);t.position.x=s*a,t.position.y=s*o,t.position.z=0;var h=this.angle*s;t.velocity.set(0,0,Math.cos(h)).addScaledVector(t.position,Math.sin(h)).multiplyScalar(t.startSpeed),t.position.multiplyScalar(this.radius)}},{key:"toJSON",value:function(){return{type:"cone",radius:this.radius,arc:this.arc,thickness:this.thickness,angle:this.angle}}},{key:"clone",value:function(){return new t({radius:this.radius,arc:this.arc,thickness:this.thickness,angle:this.angle})}}]),t}(),V=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,t),h(this,"radius",void 0),h(this,"arc",void 0),h(this,"thickness",void 0),this.radius=e.radius||10,this.arc=e.arc||2*Math.PI,this.thickness=e.thickness||1}return a(t,[{key:"initialize",value:function(t){var e=Math.random(),i=Math.random(),n=r.MathUtils.lerp(1-this.thickness,1,Math.random()),s=e*this.arc,o=Math.acos(2*i-1),a=Math.cbrt(n),h=Math.sin(s),l=Math.cos(s),u=Math.sin(o),c=Math.cos(o);t.position.x=a*u*l,t.position.y=a*u*h,t.position.z=a*c,t.velocity.setScalar(0).addScaledVector(t.position,t.startSpeed),t.position.multiplyScalar(this.radius)}},{key:"toJSON",value:function(){return{type:"sphere",radius:this.radius,arc:this.arc,thickness:this.thickness}}},{key:"clone",value:function(){return new t({radius:this.radius,arc:this.arc,thickness:this.thickness})}}]),t}(),H=function(){function t(){s(this,t)}return a(t,[{key:"initialize",value:function(t){var e=Math.random(),i=Math.random(),n=e*Math.PI*2,r=Math.acos(2*i-1),s=Math.cbrt(Math.random()),o=Math.sin(n),a=Math.cos(n),h=Math.sin(r),l=Math.cos(r);t.velocity.x=s*h*a,t.velocity.y=s*h*o,t.velocity.z=s*l,t.velocity.multiplyScalar(t.startSpeed),t.position.setScalar(0)}},{key:"toJSON",value:function(){return{type:"point"}}},{key:"clone",value:function(){return new t}}]),t}(),G=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,t),h(this,"radius",void 0),h(this,"arc",void 0),h(this,"thickness",void 0),h(this,"angle",void 0),this.radius=e.radius||10,this.arc=e.arc||2*Math.PI,this.thickness=e.thickness||1,this.angle=e.angle||Math.PI/6}return a(t,[{key:"initialize",value:function(t){var e=Math.random(),i=r.MathUtils.lerp(this.thickness,1,Math.random()),n=e*this.arc,s=Math.sqrt(i),o=Math.sin(n),a=Math.cos(n);t.position.x=s*a,t.position.y=s*o,t.position.z=0;var h=this.angle*s;t.velocity.set(0,0,Math.cos(h)).addScaledVector(t.position,Math.sin(h)).multiplyScalar(t.startSpeed),t.position.multiplyScalar(this.radius)}},{key:"toJSON",value:function(){return{type:"donut",radius:this.radius,arc:this.arc,thickness:this.thickness,angle:this.angle}}},{key:"clone",value:function(){return new t({radius:this.radius,arc:this.arc,thickness:this.thickness,angle:this.angle})}}]),t}(),W="\n\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvarying vec4 vColor;\n\nvoid main() {\n\n #include <clipping_planes_fragment>\n \n vec3 outgoingLight = vec3( 0.0 );\n vec4 diffuseColor = vColor;\n \n #include <logdepthbuf_fragment>\n \n #ifdef USE_MAP\n vec4 texelColor = texture2D( map, vUv);\n diffuseColor *= texelColor;\n #endif\n\n outgoingLight = diffuseColor.rgb;\n\n gl_FragColor = vec4( outgoingLight, diffuseColor.a );\n \n #include <tonemapping_fragment>\n\n}\n";!function(t){t[t.BillBoard=0]="BillBoard",t[t.StretchedBillBoard=1]="StretchedBillBoard",t[t.LocalSpace=2]="LocalSpace"}(z||(z={}));var Y=new r.Vector3(0,0,1),X=function(t){l(i,t);var e=f(i);function i(t){var n;return s(this,i),h(d(n=e.call(this)),"type","ParticleSystemBatch"),h(d(n),"systems",void 0),h(d(n),"geometry",void 0),h(d(n),"material",void 0),h(d(n),"offsetBuffer",void 0),h(d(n),"rotationBuffer",void 0),h(d(n),"sizeBuffer",void 0),h(d(n),"colorBuffer",void 0),h(d(n),"uvTileBuffer",void 0),h(d(n),"velocityBuffer",void 0),h(d(n),"settings",void 0),h(d(n),"vector_",new r.Vector3),h(d(n),"quaternion_",new r.Quaternion),h(d(n),"quaternion2_",new r.Quaternion),h(d(n),"rotationMat_",new r.Matrix3),n.systems=new Set,n.geometry=new r.InstancedBufferGeometry,n.settings=t,n.geometry.setIndex(n.settings.instancingGeometry.getIndex()),n.geometry.setAttribute("position",n.settings.instancingGeometry.getAttribute("position")),n.geometry.setAttribute("uv",n.settings.instancingGeometry.getAttribute("uv")),n.offsetBuffer=new r.InstancedBufferAttribute(new Float32Array(3e3),3),n.offsetBuffer.setUsage(r.DynamicDrawUsage),n.geometry.setAttribute("offset",n.offsetBuffer),n.colorBuffer=new r.InstancedBufferAttribute(new Float32Array(4e3),4),n.colorBuffer.setUsage(r.DynamicDrawUsage),n.geometry.setAttribute("color",n.colorBuffer),t.renderMode===z.LocalSpace?n.rotationBuffer=new r.InstancedBufferAttribute(new Float32Array(4e3),4):n.rotationBuffer=new r.InstancedBufferAttribute(new Float32Array(1e3),1),n.rotationBuffer.setUsage(r.DynamicDrawUsage),n.geometry.setAttribute("rotation",n.rotationBuffer),n.sizeBuffer=new r.InstancedBufferAttribute(new Float32Array(1e3),1),n.sizeBuffer.setUsage(r.DynamicDrawUsage),n.geometry.setAttribute("size",n.sizeBuffer),n.uvTileBuffer=new r.InstancedBufferAttribute(new Float32Array(1e3),1),n.uvTileBuffer.setUsage(r.DynamicDrawUsage),n.geometry.setAttribute("uvTile",n.uvTileBuffer),n.rebuildMaterial(),n.frustumCulled=!1,n.renderOrder=n.settings.renderOrder,n}return a(i,[{key:"addSystem",value:function(t){this.systems.add(t)}},{key:"removeSystem",value:function(t){this.systems.delete(t)}},{key:"rebuildMaterial",value:function(){var t={},e={USE_MAP:"",USE_UV:""};t.map=new r.Uniform(this.settings.texture),t.uvTransform=new r.Uniform((new r.Matrix3).copy(this.settings.texture.matrix));var i=this.settings.uTileCount,n=this.settings.vTileCount;if(e.UV_TILE="",t.tileCount=new r.Uniform(new r.Vector2(i,n)),this.settings.renderMode===z.BillBoard||this.settings.renderMode===z.LocalSpace){var s,o;this.settings.renderMode===z.LocalSpace?(s="\n\n#include <uv_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nattribute vec3 offset;\nattribute vec4 rotation;\nattribute float size;\nattribute vec4 color;\nattribute float uvTile;\n\nvarying vec4 vColor;\n\n#ifdef UV_TILE\nuniform vec2 tileCount;\n#endif\n\nvoid main() {\n\n #ifdef UV_TILE\n vUv = vec2((mod(uvTile, tileCount.y) + uv.x) * (1.0 / tileCount.x), ((tileCount.y - floor(uvTile / tileCount.y) - 1.0) + uv.y) * (1.0 / tileCount.y));\n #else\n #include <uv_vertex>\n #endif\n \n float x2 = rotation.x + rotation.x, y2 = rotation.y + rotation.y, z2 = rotation.z + rotation.z;\n float xx = rotation.x * x2, xy = rotation.x * y2, xz = rotation.x * z2;\n float yy = rotation.y * y2, yz = rotation.y * z2, zz = rotation.z * z2;\n float wx = rotation.w * x2, wy = rotation.w * y2, wz = rotation.w * z2;\n float sx = size, sy = size, sz = size;\n \n mat4 matrix = mat4(( 1.0 - ( yy + zz ) ) * sx, ( xy + wz ) * sx, ( xz - wy ) * sx, 0.0, // 1. column\n ( xy - wz ) * sy, ( 1.0 - ( xx + zz ) ) * sy, ( yz + wx ) * sy, 0.0, // 2. column\n ( xz + wy ) * sz, ( yz - wx ) * sz, ( 1.0 - ( xx + yy ) ) * sz, 0.0, // 3. column\n offset.x, offset.y, offset.z, 1.0);\n \n vec4 mvPosition = modelViewMatrix * (matrix * vec4( position, 1.0 ));\n\n\tvColor = color;\n\n\tgl_Position = projectionMatrix * mvPosition;\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n}\n",o=r.DoubleSide):(s="\n\n#include <uv_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nattribute vec3 offset;\nattribute float rotation;\nattribute float size;\nattribute vec4 color;\nattribute float uvTile;\n\nvarying vec4 vColor;\n\n#ifdef UV_TILE\nuniform vec2 tileCount;\n#endif\n\nvoid main() {\n\n #ifdef UV_TILE\n vUv = vec2((mod(uvTile, tileCount.y) + uv.x) * (1.0 / tileCount.x), ((tileCount.y - floor(uvTile / tileCount.y) - 1.0) + uv.y) * (1.0 / tileCount.y));\n #else\n #include <uv_vertex>\n #endif\n\t\n vec4 mvPosition = modelViewMatrix * vec4( offset, 1.0 );\n\t\n vec2 alignedPosition = ( position.xy ) * size;\n \n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n \n mvPosition.xy += rotatedPosition;\n\n\tvColor = color;\n\n\tgl_Position = projectionMatrix * mvPosition;\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n}\n",o=r.FrontSide),this.material=new r.ShaderMaterial({uniforms:t,defines:e,vertexShader:s,fragmentShader:W,transparent:!0,depthWrite:!1,blending:this.settings.blending||r.AdditiveBlending,side:o})}else{if(this.settings.renderMode!==z.StretchedBillBoard)throw new Error("render mode unavailable");this.velocityBuffer=new r.InstancedBufferAttribute(new Float32Array(3e3),3),this.velocityBuffer.setUsage(r.DynamicDrawUsage),this.geometry.setAttribute("velocity",this.velocityBuffer),t.speedFactor=new r.Uniform(1),this.material=new r.ShaderMaterial({uniforms:t,defines:e,vertexShader:"\n\n#include <uv_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nattribute vec3 offset;\nattribute float rotation;\nattribute float size;\nattribute vec4 color;\nattribute vec3 velocity;\nattribute float uvTile;\n\nvarying vec4 vColor;\n\n#ifdef UV_TILE\nuniform vec2 tileCount;\n#endif\n\nuniform float speedFactor;\n\nvoid main() {\n\n #ifdef UV_TILE\n vUv = vec2((mod(uvTile, tileCount.y) + uv.x) * (1.0 / tileCount.x), ((tileCount.y - floor(uvTile / tileCount.y) - 1.0) + uv.y) * (1.0 / tileCount.y));\n #else\n #include <uv_vertex>\n #endif\n\t\n vec4 mvPosition = modelViewMatrix * vec4( offset, 1.0 );\n vec3 viewVelocity = normalMatrix * velocity;\n\n vec3 scaledPos = vec3(position.xy * size, position.z);\n mvPosition.xyz += scaledPos + dot(scaledPos, viewVelocity) * viewVelocity / length(viewVelocity) * speedFactor;\n\n\tvColor = color;\n\n\tgl_Position = projectionMatrix * mvPosition;\n\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n}\n",fragmentShader:W,transparent:!0,depthWrite:!1,blending:this.settings.blending||r.AdditiveBlending})}}},{key:"update",value:function(){var t=this,e=0;this.systems.forEach((function(i){var n=i.particles,r=i.particleNum;t.quaternion2_.setFromRotationMatrix(i.emitter.matrixWorld),t.rotationMat_.setFromMatrix4(i.emitter.matrixWorld);for(var s=0;s<r;s++,e++){var o=n[s];t.settings.renderMode===z.LocalSpace?(o.rotationQuat.setFromAxisAngle(Y,o.rotation),i.worldSpace?t.rotationBuffer.setXYZW(e,o.rotationQuat.x,o.rotationQuat.y,o.rotationQuat.z,o.rotationQuat.w):(t.quaternion_.copy(o.rotationQuat).multiply(t.quaternion2_),t.rotationBuffer.setXYZW(e,t.quaternion_.x,t.quaternion_.y,t.quaternion_.z,t.quaternion_.w))):t.rotationBuffer.setX(e,o.rotation),i.worldSpace?t.offsetBuffer.setXYZ(e,o.position.x,o.position.y,o.position.z):(t.vector_.copy(o.position).applyMatrix4(i.emitter.matrixWorld),t.offsetBuffer.setXYZ(e,t.vector_.x,t.vector_.y,t.vector_.z)),t.colorBuffer.setXYZW(e,o.color.x,o.color.y,o.color.z,o.color.w),t.sizeBuffer.setX(e,o.size),t.uvTileBuffer.setX(e,o.uvTile),t.settings.renderMode===z.StretchedBillBoard&&(i.worldSpace?t.velocityBuffer.setXYZ(e,o.velocity.x*i.speedFactor,o.velocity.y*i.speedFactor,o.velocity.z*i.speedFactor):(t.vector_.copy(o.velocity).applyMatrix3(t.rotationMat_),t.velocityBuffer.setXYZ(e,t.vector_.x*i.speedFactor,t.vector_.y*i.speedFactor,t.vector_.z*i.speedFactor)))}})),this.geometry.instanceCount=e,e>0&&(this.offsetBuffer.updateRange.count=3*e,this.offsetBuffer.needsUpdate=!0,this.sizeBuffer.updateRange.count=e,this.sizeBuffer.needsUpdate=!0,this.colorBuffer.updateRange.count=4*e,this.colorBuffer.needsUpdate=!0,this.uvTileBuffer.updateRange.count=e,this.uvTileBuffer.needsUpdate=!0,this.settings.renderMode===z.StretchedBillBoard&&(this.velocityBuffer.updateRange.count=3*e,this.velocityBuffer.needsUpdate=!0),this.settings.renderMode===z.LocalSpace?this.rotationBuffer.updateRange.count=4*e:this.rotationBuffer.updateRange.count=e,this.rotationBuffer.needsUpdate=!0)}},{key:"dispose",value:function(){this.geometry.dispose()}}]),i}(r.Mesh),j=new r.Vector3(0,0,1),q=new r.PlaneBufferGeometry(1,1,1,1),Q=function(){function t(e,i){var n,o,a,l,u,c,d,p,f,m,g,v,y,w,A,T,S,E,M,_;s(this,t),h(this,"autoDestroy",void 0),h(this,"looping",void 0),h(this,"duration",void 0),h(this,"maxParticle",void 0),h(this,"startLife",void 0),h(this,"startSpeed",void 0),h(this,"startRotation",void 0),h(this,"startSize",void 0),h(this,"startColor",void 0),h(this,"startTileIndex",void 0),h(this,"emissionOverTime",void 0),h(this,"emissionOverDistance",void 0),h(this,"emissionBursts",void 0),h(this,"worldSpace",void 0),h(this,"speedFactor",void 0),h(this,"particleNum",void 0),h(this,"burstIndex",void 0),h(this,"burstWaveIndex",void 0),h(this,"time",void 0),h(this,"paused",void 0),h(this,"waitEmiting",void 0),h(this,"emitEnded",void 0),h(this,"markForDestroy",void 0),h(this,"behaviors",void 0),h(this,"particles",void 0),h(this,"emitterShape",void 0),h(this,"emitter",void 0),h(this,"rendererSettings",void 0),h(this,"renderer",void 0),h(this,"neededToUpdateRender",void 0),h(this,"oldWorldMatrix",new r.Matrix4),h(this,"normalMatrix",new r.Matrix3),h(this,"firstTimeUpdate",!0),this.renderer=e,this.autoDestroy=void 0!==i.autoDestroy&&i.autoDestroy,this.duration=null!==(n=i.duration)&&void 0!==n?n:1,this.maxParticle=null!==(o=i.maxParticle)&&void 0!==o?o:100,this.looping=void 0===i.looping||i.looping,this.startLife=null!==(a=i.startLife)&&void 0!==a?a:new b(5),this.startSpeed=null!==(l=i.startSpeed)&&void 0!==l?l:new b(0),this.startRotation=null!==(u=i.startRotation)&&void 0!==u?u:new b(0),this.startSize=null!==(c=i.startSize)&&void 0!==c?c:new b(1),this.startColor=null!==(d=i.startColor)&&void 0!==d?d:new L(new r.Vector4(1,1,1,1)),this.emissionOverTime=null!==(p=i.emissionOverTime)&&void 0!==p?p:new b(10),this.emissionOverDistance=null!==(f=i.emissionOverDistance)&&void 0!==f?f:new b(0),this.emissionBursts=null!==(m=i.emissionBursts)&&void 0!==m?m:[],this.emitterShape=null!==(g=i.shape)&&void 0!==g?g:new V,this.behaviors=null!==(v=i.behaviors)&&void 0!==v?v:new Array,this.worldSpace=null!==(y=i.worldSpace)&&void 0!==y&&y,this.speedFactor=null!==(w=i.speedFactor)&&void 0!==w?w:0,this.rendererSettings={blending:null!==(A=i.blending)&&void 0!==A?A:r.NormalBlending,instancingGeometry:null!==(T=i.instancingGeometry)&&void 0!==T?T:q,renderMode:null!==(S=i.renderMode)&&void 0!==S?S:z.BillBoard,renderOrder:null!==(E=i.renderOrder)&&void 0!==E?E:0,texture:i.texture,uTileCount:null!==(M=i.uTileCount)&&void 0!==M?M:1,vTileCount:null!==(_=i.vTileCount)&&void 0!==_?_:1},this.neededToUpdateRender=!0,this.particles=new Array,this.startTileIndex=i.startTileIndex||0,this.emitter=new x(this),this.particleNum=0,this.burstIndex=0,this.burstWaveIndex=0,this.time=0,this.paused=!1,this.waitEmiting=0,this.emitEnded=!1,this.markForDestroy=!1}return a(t,[{key:"texture",get:function(){return this.rendererSettings.texture},set:function(t){this.rendererSettings.texture=t,this.neededToUpdateRender=!0}},{key:"uTileCount",get:function(){return this.rendererSettings.uTileCount},set:function(t){this.rendererSettings.uTileCount=t,this.neededToUpdateRender=!0}},{key:"vTileCount",get:function(){return this.rendererSettings.vTileCount},set:function(t){this.rendererSettings.vTileCount=t,this.neededToUpdateRender=!0}},{key:"renderMode",get:function(){return this.rendererSettings.renderMode},set:function(t){this.rendererSettings.renderMode=t,this.neededToUpdateRender=!0}},{key:"renderOrder",get:function(){return this.rendererSettings.renderOrder},set:function(t){this.rendererSettings.renderOrder=t,this.neededToUpdateRender=!0}},{key:"blending",get:function(){return this.rendererSettings.blending},set:function(t){this.rendererSettings.blending=t,this.neededToUpdateRender=!0}},{key:"pause",value:function(){this.paused=!0}},{key:"play",value:function(){this.paused=!1}},{key:"spawn",value:function(t){for(var e=0;e<t&&this.particleNum<this.maxParticle;e++){for(this.particleNum++;this.particles.length<this.particleNum;)this.particles.push(new w);var i=this.particles[this.particleNum-1];this.startColor.genColor(i.startColor,this.time),i.color.copy(i.startColor),i.startSpeed=this.startSpeed.genValue(this.time),i.life=this.startLife.genValue(this.time),i.age=0,i.rotation=this.startRotation.genValue(this.time),this.rendererSettings.renderMode===z.LocalSpace&&(i.rotationQuat=(new r.Quaternion).setFromAxisAngle(j,i.rotation)),i.startSize=i.size=this.startSize.genValue(this.time),i.uvTile=this.startTileIndex,this.emitterShape.initialize(i),this.worldSpace&&(i.position.applyMatrix4(this.emitter.matrixWorld),i.velocity.applyMatrix3(this.normalMatrix));for(var n=0;n<this.behaviors.length;n++)this.behaviors[n].initialize(i)}}},{key:"endEmit",value:function(){this.emitEnded=!0,this.autoDestroy&&(this.markForDestroy=!0)}},{key:"dispose",value:function(){this.renderer.deleteSystem(this),this.emitter.dispose(),this.emitter.parent&&this.emitter.parent.remove(this.emitter)}},{key:"restart",value:function(){this.paused=!1,this.particleNum=0,this.burstIndex=0,this.burstWaveIndex=0,this.time=0,this.waitEmiting=0,this.emitEnded=!1,this.markForDestroy=!1}},{key:"update",value:function(t){if(this.firstTimeUpdate&&(this.renderer.addSystem(this),this.firstTimeUpdate=!1),t>.1&&(t=.1),!this.paused)if(this.emitEnded&&0===this.particleNum)this.markForDestroy&&this.emitter.parent&&this.dispose();else{this.time>this.duration&&(this.looping?this.time-=this.duration:this.emitEnded||this.endEmit()),this.neededToUpdateRender&&(this.renderer.updateSystem(this),this.neededToUpdateRender=!1),this.normalMatrix.getNormalMatrix(this.emitter.matrixWorld);for(var e=0;e<this.particleNum;e++){var i=this.particles[e];i.age>=i.life&&(this.particles[e]=this.particles[this.particleNum-1],this.particles[this.particleNum-1]=i,this.particleNum--,e--)}if(!this.emitEnded){var n=Math.ceil(this.waitEmiting);this.spawn(n),this.waitEmiting-=n}for(;this.burstIndex<this.emissionBursts.length&&this.emissionBursts[this.burstIndex].time<=this.time;){if(Math.random()<this.emissionBursts[this.burstIndex].probability){var r=this.emissionBursts[this.burstIndex].count;this.spawn(r)}this.burstIndex++}for(var s=0;s<this.particleNum;s++){for(var o=this.particles[s],a=0;a<this.behaviors.length;a++)this.behaviors[a].update(o,t);o.position.addScaledVector(o.velocity,t),o.age+=t}this.oldWorldMatrix.copy(this.emitter.matrixWorld),this.emitEnded||(this.waitEmiting+=t*this.emissionOverTime.genValue(this.time/this.duration)),this.time+=t}}},{key:"toJSON",value:function(t){if(this.texture.toJSON(t),void 0!==this.texture.image){var e=this.texture.image;t.images[e.uuid]={uuid:e.uuid,url:this.texture.name}}return{autoDestroy:this.autoDestroy,looping:this.looping,duration:this.duration,maxParticle:this.maxParticle,shape:this.emitterShape.toJSON(),startLife:this.startLife.toJSON(),startSpeed:this.startSpeed.toJSON(),startRotation:this.startRotation.toJSON(),startSize:this.startSize.toJSON(),startColor:this.startColor.toJSON(),emissionOverTime:this.emissionOverTime.toJSON(),emissionOverDistance:this.emissionOverDistance.toJSON(),emissionBursts:this.emissionBursts,instancingGeometry:this.rendererSettings.instancingGeometry.toJSON(),renderOrder:this.renderOrder,renderMode:this.renderMode,speedFactor:this.renderMode===z.StretchedBillBoard?this.speedFactor:0,texture:this.texture.uuid,startTileIndex:this.startTileIndex,uTileCount:this.uTileCount,vTileCount:this.vTileCount,blending:this.blending,behaviors:this.behaviors.map((function(t){return t.toJSON()})),worldSpace:this.worldSpace}}},{key:"addBehavior",value:function(t){this.behaviors.push(t)}},{key:"getRendererSettings",value:function(){return this.rendererSettings}},{key:"clone",value:function(){var e,i=[],n=y(this.emissionBursts);try{for(n.s();!(e=n.n()).done;){var r=e.value,s={};Object.assign(s,r),i.push(s)}}catch(t){n.e(t)}finally{n.f()}var o,a=[],h=y(this.behaviors);try{for(h.s();!(o=h.n()).done;){var l=o.value;a.push(l.clone())}}catch(t){h.e(t)}finally{h.f()}return new t(this.renderer,{autoDestroy:this.autoDestroy,looping:this.looping,duration:this.duration,maxParticle:this.maxParticle,shape:this.emitterShape.clone(),startLife:this.startLife.clone(),startSpeed:this.startSpeed.clone(),startRotation:this.startRotation.clone(),startSize:this.startSize.clone(),startColor:this.startColor.clone(),emissionOverTime:this.emissionOverTime.clone(),emissionOverDistance:this.emissionOverDistance.clone(),emissionBursts:i,instancingGeometry:this.rendererSettings.instancingGeometry,renderMode:this.renderMode,speedFactor:this.speedFactor,texture:this.texture,startTileIndex:this.startTileIndex,uTileCount:this.uTileCount,vTileCount:this.vTileCount,blending:this.blending,behaviors:a,worldSpace:this.worldSpace})}}],[{key:"fromJSON",value:function(e,i,n){var s;switch(e.shape.type){case"cone":s=new U(e.shape);break;case"donut":s=new G(e.shape);break;case"point":s=new H;break;case"sphere":s=new V(e.shape);break;default:s=new H}return new t(n,{autoDestroy:e.autoDestroy,looping:e.looping,duration:e.duration,maxParticle:e.maxParticle,shape:s,startLife:M(e.startLife),startSpeed:M(e.startSpeed),startRotation:M(e.startRotation),startSize:M(e.startSize),startColor:O(e.startColor),emissionOverTime:M(e.emissionOverTime),emissionOverDistance:M(e.emissionOverDistance),emissionBursts:e.emissionBursts,renderMode:e.renderMode,renderOrder:e.renderOrder,speedFactor:e.speedFactor,texture:i[e.texture],startTileIndex:e.startTileIndex,uTileCount:e.uTileCount,vTileCount:e.vTileCount,blending:e.blending,behaviors:e.behaviors.map((function(t){return function(t){switch(t.type){case"ColorOverLife":return new D(O(t.func));case"RotationOverLife":return new B(M(t.func));case"SizeOverLife":return new I(M(t.func));case"SpeedOverLife":return new F(M(t.func));case"FrameOverLife":return new k(M(t.func));case"OrbitOverLife":return new N(M(t.func));default:return new D(new R(new r.Vector4(1,1,1,1),new r.Vector4(1,1,1,1)))}}(t)})),worldSpace:e.worldSpace})}}]),t}(),K=function(t){l(i,t);var e=f(i);function i(){var t;return s(this,i),h(d(t=e.call(this)),"batches",[]),h(d(t),"type","BatchedParticleRenderer"),t}return a(i,[{key:"addSystem",value:function(t){for(var e=t.getRendererSettings(),n=0;n<this.batches.length;n++)if(i.equals(this.batches[n].settings,e))return void this.batches[n].addSystem(t);var r=new X(e);r.addSystem(t),this.batches.push(r),this.add(r)}},{key:"deleteSystem",value:function(t){for(var e=t.getRendererSettings(),n=0;n<this.batches.length;n++)if(i.equals(this.batches[n].settings,e))return void this.batches[n].removeSystem(t)}},{key:"updateSystem",value:function(t){}},{key:"update",value:function(){for(var t=0;t<this.batches.length;t++)this.batches[t].update()}}],[{key:"equals",value:function(t,e){return t.texture===e.texture&&t.blending===e.blending&&t.renderMode===e.renderMode&&t.uTileCount===e.uTileCount&&t.vTileCount===e.vTileCount&&t.instancingGeometry===e.instancingGeometry&&t.renderOrder===e.renderOrder}}]),i}(r.Object3D),J={UVMapping:r.UVMapping,CubeReflectionMapping:r.CubeReflectionMapping,CubeRefractionMapping:r.CubeRefractionMapping,EquirectangularReflectionMapping:r.EquirectangularReflectionMapping,EquirectangularRefractionMapping:r.EquirectangularRefractionMapping,CubeUVReflectionMapping:r.CubeUVReflectionMapping,CubeUVRefractionMapping:r.CubeUVRefractionMapping},Z={RepeatWrapping:r.RepeatWrapping,ClampToEdgeWrapping:r.ClampToEdgeWrapping,MirroredRepeatWrapping:r.MirroredRepeatWrapping},$={NearestFilter:r.NearestFilter,NearestMipmapNearestFilter:r.NearestMipMapNearestFilter,NearestMipmapLinearFilter:r.NearestMipMapLinearFilter,LinearFilter:r.LinearFilter,LinearMipmapNearestFilter:r.LinearMipMapNearestFilter,LinearMipmapLinearFilter:r.LinearMipMapLinearFilter},tt=function(){function t(e){s(this,t),h(this,"manager",void 0),h(this,"crossOrigin","anonymous"),h(this,"path",void 0),h(this,"resourcePath",void 0),this.manager=void 0!==e?e:r.DefaultLoadingManager,this.resourcePath=""}return a(t,[{key:"setPath",value:function(t){return this.path=t,this}},{key:"setResourcePath",value:function(t){return this.resourcePath=t,this}},{key:"setCrossOrigin",value:function(t){return this.crossOrigin=t,this}},{key:"load",value:function(t,e,i,n,s){var o=this,a=void 0===this.path?r.LoaderUtils.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||a;var h=new r.FileLoader(o.manager);this.path&&h.setPath(this.path),h.load(t,(function(t){var n=null;try{n=JSON.parse(t)}catch(t){return void(void 0!==s&&s(t))}var r=n.metadata;void 0!==r&&void 0!==r.type&&"geometry"!==r.type.toLowerCase()&&o.parse(n,i,e)}),n,s)}},{key:"loadImage",value:function(t,e){var i=this;return i.manager.itemStart(e),t.load(e,(function(){i.manager.itemEnd(e)}),void 0,(function(){i.manager.itemError(e),i.manager.itemEnd(e)}))}},{key:"parseImages",value:function(t,e){var i={};if(void 0!==t&&t.length>0){var n=new r.LoadingManager(e),s=new r.ImageLoader(n);s.setCrossOrigin(this.crossOrigin);for(var o=0,a=t.length;o<a;o++){var h=t[o],l=h.url;if(Array.isArray(l)){i[h.uuid]=[];for(var u=0,c=l.length;u<c;u++){var d=l[u],p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(d)?d:this.resourcePath+d;i[h.uuid].push(this.loadImage(s,p))}}else{p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url)?h.url:this.resourcePath+h.url;i[h.uuid]=this.loadImage(s,p)}}}return i}},{key:"parseTextures",value:function(t,e){function i(t,e){return"number"==typeof t?t:e[t]}var n={};if(void 0!==t)for(var s=0,o=t.length;s<o;s++){var a,h=t[s];h.image,e[h.image],(a=Array.isArray(e[h.image])?new r.CubeTexture(e[h.image]):new r.Texture(e[h.image])).needsUpdate=!0,a.uuid=h.uuid,void 0!==h.name&&(a.name=h.name),void 0!==h.mapping&&(a.mapping=i(h.mapping,J)),void 0!==h.offset&&a.offset.fromArray(h.offset),void 0!==h.repeat&&a.repeat.fromArray(h.repeat),void 0!==h.center&&a.center.fromArray(h.center),void 0!==h.rotation&&(a.rotation=h.rotation),void 0!==h.wrap&&(a.wrapS=i(h.wrap[0],Z),a.wrapT=i(h.wrap[1],Z)),void 0!==h.format&&(a.format=h.format),void 0!==h.type&&(a.type=h.type),void 0!==h.encoding&&(a.encoding=h.encoding),void 0!==h.minFilter&&(a.minFilter=i(h.minFilter,$)),void 0!==h.magFilter&&(a.magFilter=i(h.magFilter,$)),void 0!==h.anisotropy&&(a.anisotropy=h.anisotropy),void 0!==h.flipY&&(a.flipY=h.flipY),void 0!==h.premultiplyAlpha&&(a.premultiplyAlpha=h.premultiplyAlpha),void 0!==h.unpackAlignment&&(a.unpackAlignment=h.unpackAlignment),n[h.uuid]=a}return n}},{key:"parseObject",value:function(t,e,i){var n;switch(t.type){case"ParticleEmitter":n=Q.fromJSON(t.ps,e,i).emitter;break;case"Group":n=new r.Group;break;default:n=new r.Object3D}if(n.uuid=t.uuid,void 0!==t.name&&(n.name=t.name),void 0!==t.matrix?(n.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(n.matrixAutoUpdate=t.matrixAutoUpdate),n.matrixAutoUpdate&&n.matrix.decompose(n.position,n.quaternion,n.scale)):(void 0!==t.position&&n.position.fromArray(t.position),void 0!==t.rotation&&n.rotation.fromArray(t.rotation),void 0!==t.quaternion&&n.quaternion.fromArray(t.quaternion),void 0!==t.scale&&n.scale.fromArray(t.scale)),void 0!==t.castShadow&&(n.castShadow=t.castShadow),void 0!==t.receiveShadow&&(n.receiveShadow=t.receiveShadow),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.frustumCulled&&(n.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(n.renderOrder=t.renderOrder),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.layers&&(n.layers.mask=t.layers),void 0!==t.children)for(var s=t.children,o=0;o<s.length;o++)n.add(this.parseObject(s[o],e,i));return n}},{key:"parse",value:function(t,e,i){var n=this.parseImages(t.images,(function(){void 0!==e&&e(s)})),r=this.parseTextures(t.textures,n),s=this.parseObject(t.object,r,i);return void 0!==t.images&&0!==t.images.length||void 0!==e&&e(s),s}}]),t}(),et=i(1);function it(t){return(it="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function nt(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function rt(t,e){return(rt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function st(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=ht(t);if(e){var r=ht(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ot(this,i)}}function ot(t,e){if(e&&("object"===it(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return at(t)}function at(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ht(t){return(ht=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var lt,ut,ct,dt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&rt(t,e)}(s,t);var e,i,n,r=st(s);function s(t){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s),e=r.call(this);var i=vt.loadFromJson(t);return e.add(i),e.emitterList=i.emitterList,e.emitterGroup=i,e.timeScale=1,vt.addToEffects(at(e)),et.a.threeScene.add(at(e)),e.hackSkip=!0,e.traverse((function(t){t.hackSkip=!0})),e}return e=s,(i=[{key:"update",value:function(t){for(var e=0;e<this.emitterList.length;e++)this.emitterList[e].system.update(t*this.timeScale)}},{key:"restart",value:function(){for(var t=0;t<this.emitterList.length;t++)this.emitterList[t].system.restart()}},{key:"trigger",value:function(){for(var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=0;e<this.emitterList.length;e++){var i=this.emitterList[e];i.system.looping=!1,i.system.spawn(t)}}},{key:"emit",value:function(){for(var t=0;t<this.emitterList.length;t++){var e=this.emitterList[t];e.system.looping=!0,e.system.play()}}},{key:"stop",value:function(){for(var t=0;t<this.emitterList.length;t++)this.emitterList[t].system.endEmit()}},{key:"setPos",value:function(t){for(var e=0;e<this.emitterList.length;e++)this.emitterList[e].position.copy(t)}},{key:"multiplyParticleScale",value:function(t,e){for(var i=0;i<this.emitterList.length;i++){var n=this.emitterList[i],r=n.system.startSize;n.system.orgScale||(n.system.orgScale=Object.assign({},r)),r instanceof b?(e&&(r.value=n.system.orgScale.value),r.value*=t):r instanceof A&&(e&&(r.a=n.system.orgScale.a,r.b=n.system.orgScale.b,r.value=n.system.orgScale.value),r.a*=t,r.b*=t,r.value*=t)}}}])&&nt(e.prototype,i),n&&nt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(r.Object3D);function pt(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var ft=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.manager=e,this.crossOrigin="",this.path="",this.resourcePath=""}var e,i,n;return e=t,(i=[{key:"setPath",value:function(t){this.path=t}},{key:"setResourcePath",value:function(t){this.resourcePath=t}},{key:"setCrossOrigin",value:function(t){this.crossOrigin=t}},{key:"parse",value:function(t,e){lt={UVMapping:THREE.UVMapping,CubeReflectionMapping:THREE.CubeReflectionMapping,CubeRefractionMapping:THREE.CubeRefractionMapping,EquirectangularReflectionMapping:THREE.EquirectangularReflectionMapping,EquirectangularRefractionMapping:THREE.EquirectangularRefractionMapping,CubeUVReflectionMapping:THREE.CubeUVReflectionMapping,CubeUVRefractionMapping:THREE.CubeUVRefractionMapping},ut={RepeatWrapping:THREE.RepeatWrapping,ClampToEdgeWrapping:THREE.ClampToEdgeWrapping,MirroredRepeatWrapping:THREE.MirroredRepeatWrapping},ct={NearestFilter:THREE.NearestFilter,NearestMipmapNearestFilter:THREE.NearestMipMapNearestFilter,NearestMipmapLinearFilter:THREE.NearestMipMapLinearFilter,LinearFilter:THREE.LinearFilter,LinearMipmapNearestFilter:THREE.LinearMipMapNearestFilter,LinearMipmapLinearFilter:THREE.LinearMipMapLinearFilter};var i=this.parseImages(t.images),n=this.parseTextures(t.textures,i),r=this.parseObject(t.object,n,e);return void 0===t.images||0===t.images.length?null:r}},{key:"parseTextures",value:function(t,e){function i(t,e){return"number"==typeof t?t:e[t]}var n={};if(void 0!==t)for(var r=0,s=t.length;r<s;r++){var o,a=t[r];a.image,e[a.image],(o=Array.isArray(e[a.image])?new THREE.CubeTexture(e[a.image]):e[a.image]).needsUpdate=!0,o.uuid=a.uuid,void 0!==a.name&&(o.name=a.name),void 0!==a.mapping&&(o.mapping=i(a.mapping,lt)),void 0!==a.offset&&o.offset.fromArray(a.offset),void 0!==a.repeat&&o.repeat.fromArray(a.repeat),void 0!==a.center&&o.center.fromArray(a.center),void 0!==a.rotation&&(o.rotation=a.rotation),void 0!==a.wrap&&(o.wrapS=i(a.wrap[0],ut),o.wrapT=i(a.wrap[1],ut)),void 0!==a.format&&(o.format=a.format),void 0!==a.type&&(o.type=a.type),void 0!==a.encoding&&(o.encoding=a.encoding),void 0!==a.minFilter&&(o.minFilter=i(a.minFilter,ct)),void 0!==a.magFilter&&(o.magFilter=i(a.magFilter,ct)),void 0!==a.anisotropy&&(o.anisotropy=a.anisotropy),void 0!==a.flipY&&(o.flipY=a.flipY),void 0!==a.premultiplyAlpha&&(o.premultiplyAlpha=a.premultiplyAlpha),void 0!==a.unpackAlignment&&(o.unpackAlignment=a.unpackAlignment),n[a.uuid]=o}return n}},{key:"parseImages",value:function(t){var e={};if(void 0!==t&&t.length>0)for(var i=0;i<t.length;i++){var n=t[i],r=n.url,s=et.a.getTexture(r);e[n.uuid]=s}return e}}])&&pt(e.prototype,i),n&&pt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),mt=i(46);function gt(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}tt.prototype.parse=ft.prototype.parse,tt.prototype.parseImages=ft.prototype.parseImages,tt.prototype.parseTextures=ft.prototype.parseTextures;var vt=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,n;return e=t,n=[{key:"init",value:function(){this.inited=!0,this.batchRenderer=new K,et.a.threeScene.add(this.batchRenderer),this.effectList=[],this.effects={},this.loader=new tt,this.expo=new dt(mt),this.expo.stop()}},{key:"addToEffects",value:function(t){this.effectList.push(t)}},{key:"loadFromJson",value:function(t){var e=this.loader.parse(t,this.batchRenderer);return e.emitterList=[],e.traverse((function(t){t instanceof x&&e.emitterList.push(t)})),e}},{key:"update",value:function(t){for(var e=0;e<this.effectList.length;e++)this.effectList[e].update(t);this.batchRenderer.update(t)}}],(i=[{key:"restart",value:function(){}}])&&gt(e.prototype,i),n&&gt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),yt=i(6),xt=i(35);function wt(t){return(wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function bt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function At(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Tt(t,e,i){return e&&At(t.prototype,e),i&&At(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function St(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Et(t,e)}function Et(t,e){return(Et=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Mt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Pt(t);if(e){var r=Pt(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return _t(this,i)}}function _t(t,e){if(e&&("object"===wt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ct(t)}function Ct(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pt(t){return(Pt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}r.Object3D;var Rt=function(t){St(i,t);var e=Mt(i);function i(){var t;bt(this,i),t=e.call(this);var n=et.a.getTexture("star"),s=new r.SpriteMaterial({map:n,blending:THREE.AdditiveBlending,transparent:!0,depthWrite:!1});return t.sprite=new r.Sprite(s),t.sprite.scale.multiplyScalar(1),t.add(t.sprite),et.a.data.enableStarTrails&&t.initTrail(),t.reset(),t}return Tt(i,[{key:"initTrail",value:function(){var t=[new THREE.Vector3(-.1,0,0),new THREE.Vector3(.1,0,0)];this.trail=xt.a.addTrail(this.sprite,t,"#ffffff",.5,0,60)}},{key:"reset",value:function(){this.randoDir=new r.Vector3(r.MathUtils.randFloatSpread(1),r.MathUtils.randFloatSpread(1),r.MathUtils.randFloatSpread(1)),this.speed=r.MathUtils.randFloat(5,9),this.lifeTime=0,this.maxLifeTime=r.MathUtils.randFloat(1,3);var t=et.a.main.camera.localToWorld(new r.Vector3(0,0,-50));this.position.copy(t),this.position.x+=r.MathUtils.randFloatSpread(50),this.position.y+=r.MathUtils.randFloat(-30,60),this.deadDelay=0,this.maxWaitDelay=r.MathUtils.randFloat(0,.6),this.sprite.material.opacity=0,this.fSpawn=!1,this.trail&&this.trail.reset()}},{key:"update",value:function(t){this.deadDelay+=t,this.deadDelay<=this.maxWaitDelay||(this.position.addScaledVector(this.randoDir,t*this.speed),this.trail&&this.trail.advance(t),this.fSpawn||(this.fSpawn=!0,et.a.phaserScene.tweens.add({targets:this.sprite.material,opacity:1,duration:500*this.maxLifeTime,ease:Phaser.Math.Easing.Sine.InOut,yoyo:!0})),this.lifeTime+=t,this.lifeTime>=this.maxLifeTime&&this.reset())}}]),i}(r.Object3D),Lt=i(22);function Ot(t){return(Ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Dt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bt(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function It(t,e,i){return e&&Bt(t.prototype,e),i&&Bt(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ft(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&kt(t,e)}function kt(t,e){return(kt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Nt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Vt(t);if(e){var r=Vt(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return zt(this,i)}}function zt(t,e){if(e&&("object"===Ot(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Ut(t)}function Ut(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Vt(t){return(Vt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ht=function(t){Ft(i,t);var e=Nt(i);function i(){var t;Dt(this,i);(t=e.call(this)).confettiList=[];var n=[];["#ff0000","#ff7f00","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff"].forEach((function(t){var e=yt.a.createPlane({w:.2,h:.4,d:.1});e.material.side=THREE.FrontSide,e.material.color.set(t),e.visible=!1,n.push(e)}));for(var r=0;r<30;r++){var s=n[r%n.length],o=new Gt(s);o.mesh.visible=!0,t.add(o),t.confettiList.push(o)}return et.a.addToGame({obj:Ut(t),recycle:!1}),t.visible=!1,t}return It(i,[{key:"startSpawning",value:function(t,e){this.position.copy(t),this.confettiList.forEach((function(t){t.reset(e)})),this.visible=!0,this.lifetime=0}},{key:"update",value:function(t){if(this.visible)for(var e=0;e<this.confettiList.length;e++){this.confettiList[e].update(t)}}},{key:"reset",value:function(){this.visible=!1}}]),i}(r.Object3D),Gt=function(t){Ft(i,t);var e=Nt(i);function i(t){var n;return Dt(this,i),(n=e.call(this)).mesh=t.clone(),n.add(n.mesh),n.orgSkal=n.scale.clone(),n.lastSpawnDir=new r.Vector3,n}return It(i,[{key:"reset",value:function(t){var e;this.position.set(0,0,0),this.velocity=new r.Vector3,this.lifeTime=0,this.scale.copy(this.orgSkal),t?(e=t,this.lastSpawnDir.copy(e)):e=this.lastSpawnDir;var i=(new r.Spherical).setFromVector3(e),n=.2*Math.PI;i.theta+=r.MathUtils.randFloat(-n,n),i.phi+=r.MathUtils.randFloatSpread(1),this.velocity=(new r.Vector3).setFromSpherical(i),this.velocity.y+=r.MathUtils.randFloat(.2,.3),this.moveSpeed=r.MathUtils.randFloat(1,10),this.maxLifeTime=r.MathUtils.randFloat(.5,2)}},{key:"update",value:function(t){this.position.addScaledVector(this.velocity,t*this.moveSpeed),this.velocity.y-=1.2*t;var e=this.lifeTime/this.maxLifeTime,i=Phaser.Math.Easing.Quadratic.In(e);this.scale.copy(this.orgSkal),this.scale.multiplyScalar(1-i),this.rotation.y+=this.velocity.x*i,this.rotation.z+=this.velocity.y*i,this.rotation.x+=this.velocity.z*i,this.lifeTime+=t,this.lifeTime>=this.maxLifeTime&&this.reset()}}]),i}(r.Object3D);function Wt(t){return(Wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Yt(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Xt(t,e){return(Xt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function jt(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Kt(t);if(e){var r=Kt(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return qt(this,i)}}function qt(t,e){if(e&&("object"===Wt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Qt(t)}function Qt(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Kt(t){return(Kt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Jt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Xt(t,e)}(o,t);var e,i,n,s=jt(o);function o(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);(t=s.call(this)).bloodList=[],t.mat=new r.MeshBasicMaterial({blending:THREE.AdditiveBlending});for(var e=0;e<20;e++){var i=new r.Mesh(new r.SphereGeometry(.5,16,16),t.mat);i.scale.multiplyScalar(.14),i.scale.z*=2.5,i.orgSkal=i.scale.clone(),t.bloodList.push(i),t.add(i)}return t.reset(),et.a.main.scene.add(Qt(t)),t}return e=o,(i=[{key:"resetBloodParticle",value:function(t,e,i){e||(e=t.spawnPos),i||(i=t.spawnDir),t.spawnPos=e,t.spawnDir=i,t.position.copy(e),t.scale.copy(t.orgSkal),t.scale.multiplyScalar(r.MathUtils.randFloat(.2,1)*this.mainSkal),t.scale.z*=r.MathUtils.randFloat(1,2);var n=(new r.Spherical).setFromVector3(i),s=.2*Math.PI;n.theta+=r.MathUtils.randFloat(-s,s),n.phi+=r.MathUtils.randFloat(-s,s),t.velocity=(new r.Vector3).setFromSpherical(n),t.velocity.y+=r.MathUtils.randFloat(.2,.3),t.visible=!0,t.moveSpeed=r.MathUtils.randFloat(3,15)*this.mainSpeed,t.timer=0,t.delay=r.MathUtils.randFloat(.1,1),t.maxTime=t.delay+0,t.visible=!0,t.prevPos=null}},{key:"spawn",value:function(t,e){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.color,s=void 0===r?"#ffffff":r,o=n.maxSpawnTime,a=void 0===o?2:o,h=n.speed,l=void 0===h?1:h,u=n.skal,c=void 0===u?1:u;n.gravY,this.visible=!0,s&&(this.mat.color.set(s),this.mat.color.convertSRGBToLinear()),this.mainSkal=c,this.mainSpeed=l,this.gravityY=1,this.bloodList.forEach((function(n){i.resetBloodParticle(n,t,e)})),this.bloodCounter=0,this.spawnTimer=0,this.stopSpawning=!1,this.maxSpawnTime=a}},{key:"update",value:function(t){var e=this;this.visible&&(this.stopSpawning||(this.spawnTimer+=t,this.maxSpawnTime>0&&this.spawnTimer>this.maxSpawnTime&&(this.stopSpawning=!0)),this.bloodList.forEach((function(i){if(i.visible){if(i.position.addScaledVector(i.velocity,t*i.moveSpeed),i.velocity.y-=t*e.gravityY,i.prevPos){var n=i.position.clone().sub(i.prevPos).normalize(),r=i.position.clone().add(n);i.lookAt(r)}else i.prevPos=i.position.clone();i.timer+=t,i.timer>i.delay&&(i.scale.multiplyScalar(.99),i.timer>=i.maxTime&&(e.stopSpawning?(i.visible=!1,e.bloodCounter++):e.resetBloodParticle(i),e.bloodCounter>=e.bloodList.length&&(e.visible=!1))),i.prevPos&&i.prevPos.copy(i.position)}})))}},{key:"reset",value:function(){this.visible=!1}}])&&Yt(e.prototype,i),n&&Yt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(r.Object3D);function Zt(t){return(Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function te(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ee(t,e){return(ee=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ie(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=re(t);if(e){var r=re(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ne(this,i)}}function ne(t,e){if(e&&("object"===Zt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function re(t){return(re=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var se=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ee(t,e)}(o,t);var e,i,n,s=ie(o);function o(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i.gravity,i.spherical,i.veloYMin,i.veloYMax;return $t(this,o),(e=s.call(this)).mesh=t.clone(),e.add(e.mesh),e.orgSkal=e.scale.clone(),e.lastSpawnDir=new r.Vector3,e}return e=o,(i=[{key:"reset",value:function(t){var e;this.position.set(0,0,0),this.velocity=new r.Vector3,this.lifeTime=0,this.scale.copy(this.orgSkal),t?(e=t,this.lastSpawnDir.copy(e)):e=this.lastSpawnDir;var i=(new r.Spherical).setFromVector3(e);Math.PI,i.theta+=r.MathUtils.randFloatSpread(1),i.phi=.4,this.velocity=(new r.Vector3).setFromSpherical(i),this.velocity.y+=r.MathUtils.randFloat(.6,1.3),this.moveSpeed=r.MathUtils.randFloat(3,7),this.maxLifeTime=r.MathUtils.randFloat(4,7),this.visible=!0}},{key:"update",value:function(t){if(this.visible){this.position.addScaledVector(this.velocity,t*this.moveSpeed),this.velocity.y<0?(this.velocity.y-=.2*t,this.velocity.z-=.5*t):this.velocity.y-=1.3*t;var e=this.lifeTime/this.maxLifeTime,i=Phaser.Math.Easing.Quadratic.Out(e);this.scale.copy(this.orgSkal),this.scale.multiplyScalar(1-i),this.rotation.y+=this.velocity.x*i*.5,this.rotation.z+=this.velocity.y*i*.5,this.rotation.x+=this.velocity.z*i*.5,this.lifeTime+=t,this.lifeTime>=this.maxLifeTime&&(this.visible=!1)}}}])&&te(e.prototype,i),n&&te(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(r.Object3D);function oe(t){return(oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ae(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function he(t,e){return(he=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function le(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=de(t);if(e){var r=de(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return ue(this,i)}}function ue(t,e){if(e&&("object"===oe(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return ce(t)}function ce(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function de(t){return(de=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var pe=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&he(t,e)}(o,t);var e,i,n,s=le(o);function o(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);(t=s.call(this)).confettiList=[];var e=[],i=et.a.getTexture("endstar");["#ff0000","#ff7f00","#ffff00","#00ff00","#00ffff","#0000ff","#ff00ff"].forEach((function(t){var n=yt.a.createPlane({w:.6,h:.6,customMat:new r.MeshLambertMaterial});n.visible=!1,n.material.depthWrite=!1,n.material.side=THREE.FrontSide,n.material.map=i,n.material.transparent=!0,n.material.metalness=.5,n.material.color.set(t),e.push(n),Ce.showOnScreenForCompile(n)}));for(var n=0;n<30;n++){var a=e[n%e.length],h=new se(a);h.mesh.visible=!0,h.rotation.y=r.MathUtils.randFloat(0,2*Math.PI),h.rotation.z=r.MathUtils.randFloat(0,2*Math.PI),t.add(h),t.confettiList.push(h)}return et.a.main.camera.add(ce(t)),t.visible=!1,t}return e=o,(i=[{key:"startSpawning",value:function(t,e){this.position.copy(t),this.confettiList.forEach((function(t){t.reset(e)})),this.visible=!0}},{key:"update",value:function(t){if(this.visible)for(var e=0;e<this.confettiList.length;e++)this.confettiList[e].update(t)}}])&&ae(e.prototype,i),n&&ae(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(r.Object3D),fe=i(23);function me(t){return(me="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ge(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ve(t,e){return(ve=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function ye(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=be(t);if(e){var r=be(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return xe(this,i)}}function xe(t,e){if(e&&("object"===me(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return we(t)}function we(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function be(t){return(be=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var Ae=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ve(t,e)}(o,t);var e,i,n,s=ye(o);function o(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);(t=s.call(this)).poolList=[],t.activeList=[],t.killedList=[],t.mat=new r.MeshLambertMaterial({color:et.a.data.playerArmColor}),t.mat.color.convertSRGBToLinear();for(var e=0;e<30;e++)t.createModel();return et.a.main.camera.add(we(t)),et.a.addToGame({obj:we(t),recycle:!1,update:!1}),t.visible=!0,setTimeout((function(){t.visible=!1}),1),t}return e=o,(i=[{key:"reset",value:function(){this.visible=!1}},{key:"createModel",value:function(){var t=new r.Mesh(new r.SphereBufferGeometry(.2,3,3),this.mat);return this.add(t),this.poolList.push(t),t.position.y-=.5,t.position.z=-20,t}},{key:"resetModel",value:function(t,e){t.velo=new r.Vector3(r.MathUtils.randFloat(-2,2),r.MathUtils.randFloat(1,3),r.MathUtils.randFloat(-2,2)),t.position.copy(e),t.lifeTime=0,t.maxLifeTime=1,t.moveSpeed=1,t.gravity=.3,t.scale.set(1,1,1),t.scale.multiplyScalar(r.MathUtils.randFloat(.5,.7)),t.rotation.set(r.MathUtils.randFloat(-Math.PI,Math.PI),r.MathUtils.randFloat(-Math.PI,Math.PI),r.MathUtils.randFloat(-Math.PI,Math.PI)),t.orgSkal=t.scale.clone(),t.visible=!0,t.killed=!1,t.active=!0}},{key:"updateModel",value:function(t,e){t.lifeTime+=e,t.position.addScaledVector(t.velo,e*t.moveSpeed),t.velo.y-=t.gravity;var i=t.lifeTime/t.maxLifeTime;t.scale.copy(t.orgSkal),t.scale.multiplyScalar(1-i),t.lifeTime>=t.maxLifeTime&&(t.visible=!1,t.killed=!0,t.active=!1)}},{key:"startSpawning",value:function(t,e){this.visible=!0;for(var i=0;i<e;){++i>=this.poolList.length&&this.createModel();var n=this.poolList.pop();this.resetModel(n,t),this.activeList.push(n)}}},{key:"update",value:function(t){for(var e=this.activeList.length-1;e>=0;e--){var i=this.activeList[e];i.visible&&(this.updateModel(i,t),i.killed&&(this.poolList.push(i),this.activeList.splice(e,1)))}}}])&&ge(e.prototype,i),n&&ge(e,n),Object.defineProperty(e,"prototype",{writable:!1}),o}(r.Object3D);function Te(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return Se(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Se(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==i.return||i.return()}finally{if(a)throw s}}}}function Se(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function Ee(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Me=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,n,s;return e=t,s=[{key:"init",value:function(){var t=i(59);this.SPE=t,this.effectList=[],this.initLeaf(this.SPE),this.inited=!0}},{key:"initThunder",value:function(t){var e=new r.Vector3(0,80,0),i=new t.Emitter({maxAge:{value:1},position:{value:e,spread:new THREE.Vector3(500,0,500)},size:{value:[1e3]},color:{value:[new THREE.Color("#ff0000"),new THREE.Color("#ff0000")]},particleCount:1,activeMultiplier:1e3}),n=et.a.getTexture("thunder");n.encoding=3001;var s=new t.Group({texture:{value:n,frames:new THREE.Vector2(4,2),loop:1},blending:THREE.NormalBlending,transparent:!0,fog:!1});s.addEmitter(i),s.mesh.frustumCulled=!1,Globals.main.scene.add(s.mesh),this.rainParticleEmitter=s,this.effectList.push(this.rainParticleEmitter)}},{key:"initRain",value:function(t){var e=new r.Vector3(0,100,0),i=new t.Emitter({maxAge:{value:4},position:{value:e,spread:new THREE.Vector3(500,0,500)},velocity:{value:new THREE.Vector3(0,-250,0)},size:{value:[100]},particleCount:500,activeMultiplier:1}),n=assetManager.getTexture("rain");n.magFilter=THREE.NearestFilter,n.minFilter=THREE.NearestFilter,n.encoding=3001;var s=new t.Group({texture:{value:assetManager.getTexture("rain")},blending:THREE.AdditiveBlending,transparent:!0,fog:!1,depthTest:!1,depthWrite:!1});s.addEmitter(i),s.mesh.frustumCulled=!1,Globals.main.scene.add(s.mesh),this.rainParticleEmitter=s,this.effectList.push(this.rainParticleEmitter)}},{key:"initLeaf",value:function(t){var e=new r.Vector3(100,80,-50),i=new t.Emitter({maxAge:{value:5,spread:7},position:{value:e,spread:new THREE.Vector3(300,300,0)},acceleration:{value:new THREE.Vector3(0,-.1,0),spread:new THREE.Vector3(0,-1,0)},velocity:{value:new THREE.Vector3(0,-1,0),spread:new THREE.Vector3(3,-3,0)},size:{value:[5],spread:new THREE.Vector3(5,0,0)},angle:{value:[0,2*Math.PI],spread:[0,2*Math.PI]},wiggle:{value:5,spread:2},opacity:{value:[0,1,0]},particleCount:300,activeMultiplier:2}),n=et.a.getTexture("star"),s=new t.Group({texture:{value:n},fog:!1,blending:THREE.AdditiveBlending});s.addEmitter(i),s.mesh.frustumCulled=!1,et.a.main.scene.add(s.mesh),i.owner=s,this.effectList.push(s),this.leafParticleEmitter=i,i.disable()}},{key:"initGlowingParticle",value:function(t){var e={type:t.distributions.SPHERE,position:{spread:new THREE.Vector3(.5),radius:.2},velocity:{value:new THREE.Vector3(1)},size:{value:[.3,.1]},opacity:{value:[1,0]},color:{value:[new THREE.Color("#ffffff")]},particleCount:10,duration:.05,alive:!0,maxAge:{value:1}},i=new t.Group({texture:{value:assetManager.getTexture("shine")},depthTest:!1,depthWrite:!1,blending:THREE.NormalBlending});i.addPool(20,e,!0),i.mesh.frustumCulled=!1,Globals.main.scene.add(i.mesh),this.glowParticleEmitter=i,this.effectList.push(this.glowParticleEmitter)}},{key:"initBloods",value:function(t){var e={type:t.distributions.SPHERE,position:{spread:new THREE.Vector3(1),radius:.4},velocity:{value:new THREE.Vector3(1)},size:{value:[.3,.3,0]},opacity:{value:[1,1,0]},particleCount:2,duration:.5,maxAge:{value:1}},i=new t.Group({texture:{value:assetManager.getTexture("blood")},depthTest:!1,depthWrite:!1,blending:THREE.NormalBlending});i.addPool(20,e,!0),i.mesh.frustumCulled=!1,Globals.main.scene.add(i.mesh),this.bloodEmitter=i,this.effectList.push(this.bloodEmitter)}},{key:"initMiniSmoke",value:function(t){var e={position:{type:t.distributions.BOX,spread:new r.Vector3(.2,0,-1),radius:1},velocity:{type:t.distributions.BOX,value:new THREE.Vector3(0,0,1),spread:new r.Vector3(0,0,1)},size:{value:[1,4],spread:3},opacity:{value:[1,0]},particleCount:30,maxAge:{value:.8}},i=new t.Group({texture:{value:assetManager.getTexture("smoke1")},blending:THREE.NormalBlending,depthTest:!1,depthWrite:!1});this.miniSmokeEmitterInner=new t.Emitter(e),i.addEmitter(this.miniSmokeEmitterInner),i.mesh.frustumCulled=!1,Globals.main.scene.add(i.mesh),this.miniSmokeEmitter=i,this.miniSmokeEmitterInner.disable(),this.effectList.push(i)}},{key:"initSlideSmoke",value:function(t){var e={position:{type:t.distributions.BOX,spread:new r.Vector3(1,0,0),radius:1},velocity:{type:t.distributions.BOX,value:new THREE.Vector3(0,1,-2)},size:{value:[3,7],spread:3},opacity:{value:[1,0]},particleCount:20,maxAge:{value:1}},i=new t.Group({texture:{value:assetManager.getTexture("smoke1")},blending:THREE.NormalBlending,depthTest:!1,depthWrite:!1});this.slideSmokeEmitter=new t.Emitter(e),i.addEmitter(this.slideSmokeEmitter),i.mesh.frustumCulled=!1,Globals.main.scene.add(i.mesh),this.slideSmokeGroup=i,this.slideSmokeEmitter.disable(),this.effectList.push(i)}},{key:"showCollectibleFx",value:function(t,e){var i,n=Te(this.glowParticleEmitter.emitters);try{for(n.s();!(i=n.n()).done;)i.value.color.value=e}catch(t){n.e(t)}finally{n.f()}this.glowParticleEmitter.triggerPoolEmitter(1,t)}},{key:"showBloodFx",value:function(t){this.bloodEmitter.triggerPoolEmitter(1,t)}},{key:"enableSmoke",value:function(t){this.miniSmokeEmitterInner.position.value=SceneManager.player.model.position,t?this.miniSmokeEmitterInner.enable():this.miniSmokeEmitterInner.disable()}},{key:"enableSlideSmoke",value:function(t){this.slideSmokeEmitter.position.value=SceneManager.player.model.position,t?this.slideSmokeEmitter.enable():this.slideSmokeEmitter.disable()}},{key:"startLeaf",value:function(t){t?this.leafParticleEmitter.enable():this.leafParticleEmitter.disable()}},{key:"startRain",value:function(t){t?this.rainParticleEmitter.enable():this.rainParticleEmitter.disable()}},{key:"onResize",value:function(t,e){if(this.effectList)for(var i=0;i<this.effectList.length;i++){var n=t/336;n>2&&(n=2),t>e&&(n*=.5),this.effectList[i].uniforms.aspectRat.value=n}}},{key:"update",value:function(t){for(var e=0;e<this.effectList.length;e++)this.effectList[e].tick(t)}},{key:"destroy",value:function(){}}],(n=null)&&Ee(e.prototype,n),s&&Ee(e,s),Object.defineProperty(e,"prototype",{writable:!1}),t}();function _e(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var Ce=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,s;return e=t,s=[{key:"init",value:function(){this.effectList=[],et.a.data.enableBgStars,Me.init(),fe.a.init(),Lt.a.init(),this.confettiList=[];for(var t=0;t<2;t++){var e=this.createConfetti();this.confettiList.push(e)}this.endingStars=this.createFlyingStars(),this.crumbleEffect=new Ae,this.addFx(this.crumbleEffect),vt.init(),setTimeout((function(){}),100),Me.startLeaf(!0)}},{key:"spawnSpeedUpgradeEffect",value:function(){vt.expo.position.copy(n.a.player.position),vt.expo.position.y-=.2,vt.expo.restart()}},{key:"showOnScreenForCompile",value:function(t){var e=t.clone();setTimeout((function(){var t=et.a.main.camera.localToWorld(new r.Vector3(0,0,-100));e.position.copy(t),et.a.main.scene.add(e),e.visible=!0,setTimeout((function(){et.a.main.scene.remove(e)}),10)}),100)}},{key:"createConfetti",value:function(){var t=new Ht;this.addFx(t);var e=new Jt;this.addFx(e);var i={};return i.list=[t,e],i.spawn=function(i,n){t.startSpawning(i,n),e.spawn(i,n,{color:"#ffffff",maxSpawnTime:-1})},i}},{key:"createFlyingStars",value:function(){var t={},e=new pe;this.addFx(e);var i=new pe;return this.addFx(i),t.spawn=function(t,n){e.startSpawning(t[0],n),i.startSpawning(t[1],n)},t}},{key:"reinitEffects",value:function(){}},{key:"spawnConfetti",value:function(t,e){if(!et.a.lowEndDevice)for(var i=0;i<this.confettiList.length;i++)this.confettiList[i].spawn(t[i],e)}},{key:"spawnEndingStars",value:function(){var t=new r.Vector3(-1,-8,-10),e=new r.Vector3(1,-8,-10),i=new r.Vector3(0,1,0),n=[t,e];this.endingStars.spawn(n,i)}},{key:"addFx",value:function(t){this.effectList.push(t)}},{key:"onResize",value:function(t,e){}},{key:"update",value:function(t){for(var e=0;e<this.effectList.length;e++)this.effectList[e].update(t);Me.inited&&Me.update(t),vt.inited&&vt.update(t)}},{key:"reset",value:function(){this.effectList.forEach((function(t){t.reset&&t.reset()}))}}],(i=null)&&_e(e.prototype,i),s&&_e(e,s),Object.defineProperty(e,"prototype",{writable:!1}),t}()},function(t,e,i){"use strict";i.d(e,"a",(function(){return E}));i(20);var n=i(2),r=i(0),s=i(25),o=i(28),a=(i(5),i(1)),h=i(6),l=(i(14),i(31),i(21),i(8)),u=i(22),c=i(4),d=(i(3),i(23)),p=i(32),f=(i(7),i(15));function m(t){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function g(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function y(){return(y="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=x(t,e);if(n){var r=Object.getOwnPropertyDescriptor(n,e);return r.get?r.get.call(arguments.length<3?t:i):r.value}}).apply(this,arguments)}function x(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=S(t)););return t}function w(t,e){return(w=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function b(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=S(t);if(e){var r=S(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return A(this,i)}}function A(t,e){if(e&&("object"===m(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return T(t)}function T(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function S(t){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var E=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&w(t,e)}(x,t);var e,i,p,m=b(x);function x(t,e){var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return g(this,x),(i=m.call(this,t,e,n)).calculateSpeed(a.a.upgrades.speedUpgrade.level),i.mesh.traverse((function(t){t.material&&(t.material.color.set(a.a.data.playerColor),t.material.color.convertSRGBToLinear(),setTimeout((function(){}),10))})),i.isPlayer=!0,i.createMainBody(),i.initEvents(),i.dirLightOrgPos=a.a.main.directionalLight.position.clone(),a.a.main.directionalLight.target=T(i),i.initCamHelper(new r.Spherical(17,1.2,-.35),new r.Vector3(2,-2,0)),s.a.setfollowObject(T(i),!0),i}return e=x,(i=[{key:"calculateSpeed",value:function(t){var e=a.a.data.playerSpeed+.07*(t-1);e=r.MathUtils.clamp(e,a.a.data.playerSpeed,2),this.maxForce=this.orgMaxForce*e}},{key:"initEvents",value:function(){var t=this;a.a.eventEmitter.on("gameStarts",(function(e){t.canStart=!0,t.body.type=n.Body.DYNAMIC,t.body.updateMassProperties(),t.body.wakeUp(),t.armBody&&(t.armBody.type=n.Body.DYNAMIC,t.armBody.updateMassProperties(),t.armBody.wakeUp())})),a.a.eventEmitter.on("drawingEnds",(function(e){c.a.gameEnded||t.killed||t.lastJumpMode||t.prepareToJump||(t.pointerUp(e.pointList),t.canStart||(t.body.type=n.Body.STATIC,t.armBody.type=n.Body.STATIC),l.a.feedbacks.spawn())})),a.a.eventEmitter.once("levelfinished",(function(e){l.a.drawArea.show(!1,!0),l.a.progress.show(!1,!0),e!==t?t.diedActions():t.reachedEndFlag()})),this.raiseUpTime=0}},{key:"doUpgradeAnim",value:function(){var t=this;return new Promise((function(e){t.lastJumpMode?e():(setTimeout((function(){f.a.spawnSpeedUpgradeEffect()}),300),a.a.phaserScene.tweens.add({targets:t.spherical,radius:"-=4",duration:800,hold:500,yoyo:!0,ease:"Sine.easeInOut",onComplete:function(){e()}}))}))}},{key:"reachedEndFlag",value:function(){app.playSfx("Crowd_Fly"),a.a.phaserScene.tweens.add({targets:this.spherical,radius:13.5,theta:-1.2,duration:1e3,ease:Phaser.Math.Easing.Sine.InOut,onComplete:function(){}}),f.a.spawnEndingStars(),this.prepareToJump=!0}},{key:"onCoinCollected",value:function(t){d.a.spawn(t),a.a.playerData.coin++,a.a.eventEmitter.emit("coinCollected")}},{key:"doLastJump",value:function(){var t=this;this.lastJumpMode||(setTimeout((function(){var e=t.armFront;t.armBack.catmullPath.getLength()>t.armFront.catmullPath.getLength()&&(e=t.armBack);var i=e.catmullPath.getLength()/10;i=r.MathUtils.clamp(i,.2,1);var n=r.MathUtils.lerp(.3,2.25,i);t.body.position.y+=1,t.body.velocity.y+=900,t.body.velocity.x+=600*n,t.body.wakeUp()}),10),a.a.phaserScene.tweens.add({targets:a.a.main.camera,fov:"+=10",duration:500,ease:Phaser.Math.Easing.Sine.Out,onUpdate:function(){a.a.main.camera.updateProjectionMatrix()}}),a.a.phaserScene.tweens.add({targets:this.spherical,theta:-1.5,phi:.8,duration:1e3,ease:Phaser.Math.Easing.Sine.Out}),a.a.phaserScene.tweens.add({targets:this.spherical,radius:"+=5",duration:1e3,yoyo:!0,ease:Phaser.Math.Easing.Sine.InOut,onComplete:function(){a.a.phaserScene.tweens.add({targets:a.a.main.camera,fov:"-=10",duration:500,ease:Phaser.Math.Easing.Sine.Out,onUpdate:function(){a.a.main.camera.updateProjectionMatrix()}})}}),s.a.camera.setMoveRotSpeed(.1,.1),this.lastJumpMode=!0,this.lastJumpTimer=0,this.jumpPos=this.body.position.clone(),this.destoryArmsAnim())}},{key:"update",value:function(t){if(this.currentLevelPlatform.enableNearestColliders(t),this.camHelper&&(this.camHelper.position.setFromSpherical(this.spherical),this.camHelper.position.add(this.camLookHelper.position)),this.lastJumpMode){if(this.lastJumpTimer+=t,this.lastJumpTimer>.15&&this.body.velocity.x>3){var e=this.body.position.clone();e.x-=.5,u.a.spawn(e),this.lastJumpTimer=0}this.body.position.x>this.jumpPos.x+5&&Math.abs(this.body.velocity.x)-3<.1&&(this.lastJumpMode=!1,c.a.levelWinCallback())}y(S(x.prototype),"update",this).call(this,t),this.updateProgress(),this.canStart||this.armBody||(this.raiseUpTime+=6*t,this.body.position.y=this.initPosition.y+.2*Math.sin(this.raiseUpTime))}},{key:"updateProgress",value:function(){y(S(x.prototype),"updateProgress",this).call(this,!0)}},{key:"getCamHelperPos",value:function(){return this.camHelper.getWPos()}},{key:"getCamLookAtPos",value:function(){return this.camLookHelper.getWPos()}},{key:"initCamHelper",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new r.Vector3;this.camHelper||(this.camHelper=h.a.createBox(),this.camHelper.scale.multiplyScalar(.2),this.camHelper.wPos=new r.Vector3,this.camLookHelper=this.camHelper.clone(),this.camLookHelper.position.copy(i),this.camLookHelper.wPos=new r.Vector3),this.camHelper.material.visible=!1,this.camLookHelper.material.visible=!1,this.add(this.camHelper),this.add(this.camLookHelper),this.spherical=(new r.Spherical).copy(t),this.camHelper.position.setFromSpherical(this.spherical),this.camHelper.position.add(this.camLookHelper.position),this.camHelper.getWPos=function(){return e.camHelper.getWorldPosition(e.camHelper.wPos)},this.camLookHelper.getWPos=function(){return e.camLookHelper.getWorldPosition(e.camLookHelper.wPos)}}},{key:"showDatguiCam",value:function(){a.a.guiHelper.addPosition(this.camLookHelper),a.a.guiHelper.addPosition(this.camHelper),a.a.guiHelper.gui.add(this.spherical,"radius").step(.01),a.a.guiHelper.gui.add(this.spherical,"phi").step(.01),a.a.guiHelper.gui.add(this.spherical,"theta").step(.01)}},{key:"getWPos",value:function(){return this.meshParent.getWorldPosition(this._wPos)}},{key:"getWQut",value:function(){return this.mesh.getWorldQuaternion(this._wQut)}},{key:"diedActions",value:function(){var t=this;this.killed||(this.killed=!0,a.a.camera.cameraMoveType=o.a.MoveType.FREE,setTimeout((function(){h.a.moveToScene(t.camLookHelper),c.a.levelFailedCallback()}),1e3))}},{key:"pointerDown",value:function(){}},{key:"pointerUp",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];y(S(x.prototype),"pointerUp",this).call(this,t,e)}}])&&v(e.prototype,i),p&&v(e,p),Object.defineProperty(e,"prototype",{writable:!1}),x}(p.a)},function(t,e,i){"use strict";i.d(e,"a",(function(){return f}));var n=i(1);function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return o(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function u(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=p(t);if(e){var r=p(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return c(this,i)}}function c(t,e){if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return d(t)}function d(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e)}(c,Phaser.GameObjects.Container);var e,i,r,o=u(c);function c(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.a.phaserScene,i=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;return a(this,c),(t=o.call(this,e,i,r,s)).scene=e,t.scene.add.existing(d(t)),t.excludes=[],t}return e=c,(i=[{key:"addExcludes",value:function(t){var e;this.add(t),Array.isArray(t)?(e=this.excludes).push.apply(e,s(t)):this.excludes.push(t)}},{key:"setBoundaries",value:function(){this.width=this.getWidth(),this.height=this.getHeight()}},{key:"setInitials",value:function(){if(this.setScale(1),0===this.list.length)throw new Error("The container has no child, please add at least one child!");this.iW=this.getWidth(),this.iH=this.getHeight(),this.iW,this.setSize(this.iW,this.iH)}},{key:"drawDebug",value:function(){this.graphics||(this.graphics=this.scene.add.graphics()),this.addExcludes(this.graphics),this.graphics.clear(),this.graphics.lineStyle(5,16711935,1),this.graphics.strokeRect(-this.width/2+this.centerX(),-this.height/2+this.centerY(),this.width,this.height),this.graphics.lineStyle(5,16711935,1),this.graphics.strokeRect(-this.width/2-this.centerX(),this.centerY(),this.width,1),this.graphics.lineStyle(5,16711935,1),this.graphics.strokeRect(this.centerX(),-this.height/2+this.centerY(),1,this.height),this.graphics.depth=1e3}},{key:"drawDebug1",value:function(){this.debug?(this.debug.x=this.mostLeftChild.getTopLeft().x,this.debug.y=this.mostUpChild.getTopLeft().y,this.debug.width=this.width,this.debug.height=this.height):(this.debug=this.scene.add.rectangle(this.mostLeftChild.getTopLeft().x,this.mostUpChild.getTopLeft().y,this.width,this.height,0,.2).setOrigin(0),this.addExcludes(this.debug))}},{key:"findMaxAndMinX",value:function(){for(var t=this,e=1/0,i=0,n=function(n){var r=void 0,s=t.list[n];if(t.excludes.forEach((function(t){s==t&&(r=!0)})),r)return"continue";e>s.x-s.width*s.scaleX*s.originX&&(e=s.x-s.width*s.scaleX*s.originX),i<s.x+s.width*s.scaleX*(1-s.originX)&&(i=s.x+s.width*s.scaleX*(1-s.originX))},r=0;r<this.list.length;r++)n(r);return{minX:e,maxX:i}}},{key:"findMaxAndMinY",value:function(){for(var t=this,e=1/0,i=0,n=function(n){var r=void 0,s=t.list[n];if(t.excludes.forEach((function(t){s==t&&(r=!0)})),r)return"continue";e>s.y-s.height*s.scaleY*s.originY&&(e=s.y-s.height*s.scaleY*s.originY),i<s.y+s.height*s.scaleY*(1-s.originY)&&(i=s.y+s.height*s.scaleY*(1-s.originY))},r=0;r<this.list.length;r++)n(r);return{minY:e,maxY:i}}},{key:"centerX",value:function(){var t=this.findMaxAndMinX(),e=t.minX,i=t.maxX;return e==1/0?0:Math.abs(i+e)*this.scaleX*.5}},{key:"centerY",value:function(){var t=this.findMaxAndMinY(),e=t.minY,i=t.maxY;return e==1/0?0:Math.abs(i+e)*this.scaleY*.5}},{key:"centerToChild",value:function(t){if(!this.list.includes(t))throw new Error("The object is not child of the container!");var e=this.findMaxAndMinX(),i=e.minX,n=e.maxX,r=this.findMaxAndMinY(),s=r.minY,o=r.maxY;return{x:this.scaleX*t.x/(Math.abs(n)+Math.abs(i))||0,y:this.scaleY*t.y/(Math.abs(o)+Math.abs(s))||0}}},{key:"centerTo",value:function(t,e){var i=this.findMaxAndMinX(),n=i.minX,r=i.maxX,s=this.findMaxAndMinY(),o=s.minY,a=s.maxY;return t=-m(t,0,1,-.5,.5),e=-m(e,0,1,-.5,.5),{x:(Math.abs(r)+Math.abs(n))*this.scaleX*t||0,y:(Math.abs(a)+Math.abs(o))*this.scaleX*e||0}}},{key:"getWidth",value:function(){if(0===this.list.length)return 0;var t=this.findMaxAndMinX(),e=t.minX;return(t.maxX-e)*this.scaleX}},{key:"getHeight",value:function(){if(0===this.list.length)return 0;var t=this.findMaxAndMinY(),e=t.minY;return(t.maxY-e)*this.scaleY}},{key:"getBottomCenter",value:function(){return{x:this.x,y:this.y+this.displayHeight/2}}},{key:"getTopCenter",value:function(){return{x:this.x,y:this.y-this.displayHeight/2}}},{key:"getLeftCenter",value:function(){return{x:this.x-this.displayWidth/2,y:this.y}}},{key:"getWorldPositionOf",value:function(t){if(!this.exists(t))return!1;var e=t.getBounds();return{x:e.centerX,y:e.centerY}}}])&&h(e.prototype,i),r&&h(e,r),Object.defineProperty(e,"prototype",{writable:!1}),c}();function m(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,s=(t-e)/(i-e);return n+s*(r-n)}},function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));var n=i(1);function r(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var s=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,s;return e=t,s=[{key:"makePulse",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.dur,r=void 0===i?500:i,s=e.ease,o=void 0===s?"Sine.easeInOut":s,a=e.skalRatio,h=void 0===a?.9:a,l=e.delay,u=void 0===l?0:l,c=e.scene,d=void 0===c?n.a.phaserScene:c;d.tweens.add({targets:t,props:{scale:{dynamic:!0,value:{getStart:function(e){return t.iS},getEnd:function(e){return t.iS*h}}}},duration:r,yoyo:!0,repeat:-1,ease:o,delay:u})}},{key:"createText",value:function(t,e){var i=e.wRatio,r=void 0===i?.3:i,s=e.hRatio,o=void 0===s?.1:s,a=e.color,h=void 0===a?"#ffffff":a,l=e.xPos,u=void 0===l?.5:l,c=e.yPos,d=void 0===c?.1:c,p=e.scene,f=void 0===p?n.a.phaserScene:p,m=e.customResize,g=void 0!==m&&m,v=e.fontSize,y=void 0===v?60:v,x=f.add.text(0,0,t,{fontSize:y,fontFamily:"ui-font",color:h,align:"center"});return x.setOrigin(.5),g||(x.onResizeCallback=function(t,e){x.scale=Math.min(t*r/x.width,e*o/x.height),x.x=t*u,x.y=e*d,x.iS=x.scale},x.onResizeCallback(f.lastWidth,f.lastHeight)),x}}],(i=null)&&r(e.prototype,i),s&&r(e,s),Object.defineProperty(e,"prototype",{writable:!1}),t}()},function(t,e,i){"use strict";i.d(e,"a",(function(){return _}));i(20);var n=i(2),r=i(0),s=(i(25),i(28),i(5)),o=i(1),a=(i(6),i(14)),h=(i(31),i(21),i(8),i(22)),l=(i(4),i(3)),u=i(32),c=i(38);function d(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var f=function(){function t(e,i,n,r,s,o){var a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];d(this,t),e.tilesHorizontal=n,e.tilesVertical=r,e.material.map=i,this.texture=i,e.numberOfTiles=s,i.wrapS=i.wrapT=THREE.RepeatWrapping,a||i.repeat.set(1/e.tilesHorizontal,1/e.tilesVertical),e.tileDisplayDuration=o,e.currentDisplayTime=0,e.currentTile=0,i.center.x=0,i.center.y=1,e.live=!1,this.mesh=e,this.orgSpeed=o}var e,i,n;return e=t,(i=[{key:"play",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=(e.force,e.sped),n=void 0===i?1:i;this.stopped=!1,this.reset(),this.setSpeed(n),t&&this.setFinishedCallback(t)}},{key:"playLoopedWithDelay",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.2,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,i=arguments.length>2?arguments[2]:void 0;this.stopped=!1,this.delayTimer=0,this.minDelay=t,this.maxDelay=e,this.delayWaitTime=r.MathUtils.randFloat(t,e),this.delayEnabled=!0,this.delayedCallback=i,this.play()}},{key:"stop",value:function(){this.stopped=!0,this.delayEnabled=!1,this.delayedCallback=null,this.callback=null,this.reset()}},{key:"setDelayTimes",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;t&&(this.minDelay=t),e&&(this.maxDelay=e),this.mesh.tileDisplayDuration=this.orgSpeed*i}},{key:"setSpeed",value:function(t){this.mesh.tileDisplayDuration=this.orgSpeed*t}},{key:"setFinishedCallback",value:function(t){t&&(this.callback=t)}},{key:"update",value:function(t){var e=this.mesh;if(!this.stopped&&(this.delayEnabled&&(this.delayTimer+=t,!e.live&&this.delayTimer>=this.delayWaitTime&&(this.delayTimer=0,this.delayWaitTime=r.MathUtils.randFloat(this.minDelay,this.maxDelay),this.delayedCallback&&this.delayedCallback(),this.play())),e.live&&(e.currentDisplayTime+=t,e.currentDisplayTime>e.tileDisplayDuration))){if(e.currentDisplayTime=0,e.currentTile++,e.currentTile==e.numberOfTiles)return e.live=!1,void(this.callback&&this.callback());var i=e.currentTile%e.tilesHorizontal;this.texture.offset.x=i/e.tilesHorizontal;var n=Math.floor(e.currentTile/e.tilesHorizontal);this.texture.offset.y=-n/e.tilesVertical}}},{key:"setTile",value:function(t){var e=this.mesh;this.mesh.currentTile=t;var i=e.currentTile%e.tilesHorizontal;this.texture.offset.x=i/e.tilesHorizontal;var n=Math.floor(e.currentTile/e.tilesHorizontal);this.texture.offset.y=-n/e.tilesVertical}},{key:"reset",value:function(){this.mesh.live=!0,this.mesh.currentTile=0}}])&&p(e.prototype,i),n&&p(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),m=i(24);function g(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var v=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,n;return e=t,n=[{key:"getNameFlagTag",value:function(t){var e=t.name,i=t.flagIndex;return this.setupNameFlagTag(e,i)}},{key:"setupNameFlagTag",value:function(t,e){var i,n,s=o.a.cloneAsset("flagplane",.5);s.rotation.x=-Math.PI/2,s.traverse((function(t){t.material&&(m.a.setRawBasic(t),t.material.side=THREE.DoubleSide,t.name.includes("flagNameBg")&&(i=t),t.name.includes("flagCircle")&&(n=t))}));var a=o.a.getTexture("flags");a.encoding=3001,a.wrapS=a.wrapT=THREE.RepeatWrapping,a.rotation=Math.PI/2,a.center.set(0,0),n.material.map=a,n.position.x-=1;var h,l={x:(h=c[e]).x/1024-1.5/1024,y:1-h.y/1024+12/1024};a.offset.set(l.x,l.y);var u=new r.Mesh(new r.PlaneGeometry(1,1),new r.MeshBasicMaterial);u.rotation.x=Math.PI/2,u.scale.multiplyScalar(4),u.position.copy(i.position),i.parent.add(u),u.material=i.material.clone();var d=this.createNameTagTexture(t);u.material.map=d,u.material.transparent=!0,u.position.y-=.1;var p=o.a.getTexture("namebg");return i.material.map=p,i.scale.x*=1.5,i.scale.z*=.9,i.material.transparent=!0,i.material.opacity=.9,i.material.color.set("#000000"),u.visible=!0,s}},{key:"getNameFlagTag2",value:function(t,e){if(!this.flag){var i=this.createNameTagTexture(t),n=new r.Mesh(new r.PlaneGeometry(1,1),new r.MeshBasicMaterial({map:i,transparent:!0}));n.scale.setScalar(1),n.scale.multiplyScalar(3);var s=this.createFlagPlane();this.flag=new r.Object3D,this.flag.add(n),n.position.x=2.5,this.flag.add(s)}return this.flag}},{key:"createFlagPlane",value:function(){var t=o.a.getTexture("flags");t.encoding=3001,t.wrapS=t.wrapT=THREE.RepeatWrapping,c[25],setTimeout((function(){o.a.guiHelper.gui.add(t.offset,"x",0,1,.01).name("offsetX"),o.a.guiHelper.gui.add(t.offset,"y",0,1,.01).name("offsetY"),o.a.guiHelper.gui.add(t.repeat,"x",0,1,.01).name("repeatX"),o.a.guiHelper.gui.add(t.repeat,"y",0,1,.01).name("repeatY")}),10),o.a.getTexture("flagMask");var e=new r.Mesh(new r.PlaneGeometry(1.2,1),new r.MeshBasicMaterial({transparent:!0,map:t}));return new f(e,t,16,16,256,240),e}},{key:"createNameTagTexture",value:function(t){var e=document.createElement("canvas");e.width=256,e.height=256,this.canvas=e;var i=e.getContext("2d");e.ctx=i,this.changeCanvasText(t);var n=new THREE.Texture(e);return n.needsUpdate=!0,this.canvas.texture=n,n}},{key:"changeCanvasText",value:function(t){this.canvas.ctx&&this.clearCanvas();var e=this.canvas.getContext("2d");e.font="80px ui-font",e.fillStyle="#000000",e.fillStyle="#ffffff",e.textAlign="center",e.fillText(t,.5*this.canvas.width,.5*this.canvas.height+32,this.canvas.width),this.canvas.texture&&(this.canvas.texture.needsUpdate=!0)}},{key:"clearCanvas",value:function(){this.canvas.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)}}],(i=null)&&g(e.prototype,i),n&&g(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function y(t){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function x(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function w(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function b(){return(b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(t,e,i){var n=A(t,e);if(n){var r=Object.getOwnPropertyDescriptor(n,e);return r.get?r.get.call(arguments.length<3?t:i):r.value}}).apply(this,arguments)}function A(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=M(t)););return t}function T(t,e){return(T=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function S(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=M(t);if(e){var r=M(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return E(this,i)}}function E(t,e){if(e&&("object"===y(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function M(t){return(M=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var _=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&T(t,e)}(d,t);var e,i,u,c=S(d);function d(t,e){var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;x(this,d),(i=c.call(this,t,e,n)).mesh.traverse((function(t){t.material&&(t.material=t.material.clone(),t.material.color.set(o.a.data.enemyColor))})),i.initPosition=(new r.Vector3).copy(t),i.armCreated=!1;var a=o.a.data.enemySpeed+s.a.levelIndex*o.a.data.enemyDiffRaise;a=r.MathUtils.clamp(a,1,1.6),i.maxForce*=a,i.touchedGround=!1,i.drawingCount=0,i.visible=!1,i.initEvents();var h=l.a.enemySettings[s.a.currentLevelIndex];return i.nameFlag=v.getNameFlagTag(h),i.nameFlag.position.y=2,i.nameFlag.position.z=-2,i.add(i.nameFlag),i}return e=d,(i=[{key:"initEvents",value:function(){var t=this;o.a.eventEmitter.on("gameStarts",(function(e){if(!t.body&&!t.visible){var i=a.a.getArmData();t.visible=!0,t.pointerUp(i),t.vehicle.chassisBody.type=n.Body.STATIC,t.vehicle.wheelBodies[0].type=n.Body.STATIC}t.canStart=!0,t.body.type=n.Body.DYNAMIC,t.body.updateMassProperties(),t.body.wakeUp(),t.armBody&&(t.armBody.type=n.Body.DYNAMIC,t.armBody.updateMassProperties(),t.armBody.wakeUp())})),o.a.eventEmitter.once("levelfinished",(function(e){e!==t&&t.diedActions()})),this.visible=!1,o.a.eventEmitter.once("opponentfound",(function(e){setTimeout((function(){var e=a.a.getArmData();t.visible=!0,t.pointerUp(e),t.vehicle.chassisBody.type=n.Body.STATIC,t.vehicle.wheelBodies[0].type=n.Body.STATIC}),100)}))}},{key:"doLastJump",value:function(){var t=this;this.lastJumpMode||(this.armBody.collisionResponse=!1,setTimeout((function(){t.body.position.y+=1,t.body.velocity.y+=900,t.body.velocity.x+=600,t.body.wakeUp()}),10),this.lastJumpMode=!0,this.lastJumpTimer=0,this.jumpPos=this.body.position.clone(),this.destoryArmsAnim())}},{key:"update",value:function(t){if(this.body){if(this.currentLevelPlatform.enableNearestColliders(t),this.lastJumpMode){if(this.lastJumpTimer+=t,this.lastJumpTimer>.2&&this.body.velocity.x>3){var e=this.body.position.clone();e.x-=.5,h.a.spawn(e),this.lastJumpTimer=0}this.body.position.x>this.jumpPos.x+5&&Math.abs(this.body.velocity.x)-3<.1&&(this.lastJumpMode=!1)}b(M(d.prototype),"update",this).call(this,t),this.updateProgress()}}},{key:"updateProgress",value:function(){b(M(d.prototype),"updateProgress",this).call(this,!1)}},{key:"diedActions",value:function(){this.killed||(this.killed=!0)}},{key:"pointerDown",value:function(){}},{key:"pointerUp",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];b(M(d.prototype),"pointerUp",this).call(this,t,e)}}])&&w(e.prototype,i),u&&w(e,u),Object.defineProperty(e,"prototype",{writable:!1}),d}(u.a)},function(t,e,i){"use strict";var n={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},r={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},s=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],o={CSS:{},springs:{}};function a(t,e,i){return Math.min(Math.max(t,e),i)}function h(t,e){return t.indexOf(e)>-1}function l(t,e){return t.apply(null,e)}var u={arr:function(t){return Array.isArray(t)},obj:function(t){return h(Object.prototype.toString.call(t),"Object")},pth:function(t){return u.obj(t)&&t.hasOwnProperty("totalLength")},svg:function(t){return t instanceof SVGElement},inp:function(t){return t instanceof HTMLInputElement},dom:function(t){return t.nodeType||u.svg(t)},str:function(t){return"string"==typeof t},fnc:function(t){return"function"==typeof t},und:function(t){return void 0===t},nil:function(t){return u.und(t)||null===t},hex:function(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)},rgb:function(t){return/^rgb/.test(t)},hsl:function(t){return/^hsl/.test(t)},col:function(t){return u.hex(t)||u.rgb(t)||u.hsl(t)},key:function(t){return!n.hasOwnProperty(t)&&!r.hasOwnProperty(t)&&"targets"!==t&&"keyframes"!==t}};function c(t){var e=/\(([^)]+)\)/.exec(t);return e?e[1].split(",").map((function(t){return parseFloat(t)})):[]}function d(t,e){var i=c(t),n=a(u.und(i[0])?1:i[0],.1,100),r=a(u.und(i[1])?100:i[1],.1,100),s=a(u.und(i[2])?10:i[2],.1,100),h=a(u.und(i[3])?0:i[3],.1,100),l=Math.sqrt(r/n),d=s/(2*Math.sqrt(r*n)),p=d<1?l*Math.sqrt(1-d*d):0,f=d<1?(d*l-h)/p:-h+l;function m(t){var i=e?e*t/1e3:t;return i=d<1?Math.exp(-i*d*l)*(1*Math.cos(p*i)+f*Math.sin(p*i)):(1+f*i)*Math.exp(-i*l),0===t||1===t?t:1-i}return e?m:function(){var e=o.springs[t];if(e)return e;for(var i=0,n=0;;)if(1===m(i+=1/6)){if(++n>=16)break}else n=0;var r=i*(1/6)*1e3;return o.springs[t]=r,r}}function p(t){return void 0===t&&(t=10),function(e){return Math.ceil(a(e,1e-6,1)*t)*(1/t)}}var f,m,g=function(){function t(t,e){return 1-3*e+3*t}function e(t,e){return 3*e-6*t}function i(t){return 3*t}function n(n,r,s){return((t(r,s)*n+e(r,s))*n+i(r))*n}function r(n,r,s){return 3*t(r,s)*n*n+2*e(r,s)*n+i(r)}return function(t,e,i,s){if(0<=t&&t<=1&&0<=i&&i<=1){var o=new Float32Array(11);if(t!==e||i!==s)for(var a=0;a<11;++a)o[a]=n(.1*a,t,i);return function(r){return t===e&&i===s||0===r||1===r?r:n(h(r),e,s)}}function h(e){for(var s=0,a=1;10!==a&&o[a]<=e;++a)s+=.1;--a;var h=s+.1*((e-o[a])/(o[a+1]-o[a])),l=r(h,t,i);return l>=.001?function(t,e,i,s){for(var o=0;o<4;++o){var a=r(e,i,s);if(0===a)return e;e-=(n(e,i,s)-t)/a}return e}(e,h,t,i):0===l?h:function(t,e,i,r,s){var o,a,h=0;do{(o=n(a=e+(i-e)/2,r,s)-t)>0?i=a:e=a}while(Math.abs(o)>1e-7&&++h<10);return a}(e,s,s+.1,t,i)}}}(),v=(f={linear:function(){return function(t){return t}}},m={Sine:function(){return function(t){return 1-Math.cos(t*Math.PI/2)}},Circ:function(){return function(t){return 1-Math.sqrt(1-t*t)}},Back:function(){return function(t){return t*t*(3*t-2)}},Bounce:function(){return function(t){for(var e,i=4;t<((e=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}},Elastic:function(t,e){void 0===t&&(t=1),void 0===e&&(e=.5);var i=a(t,1,10),n=a(e,.1,2);return function(t){return 0===t||1===t?t:-i*Math.pow(2,10*(t-1))*Math.sin((t-1-n/(2*Math.PI)*Math.asin(1/i))*(2*Math.PI)/n)}}},["Quad","Cubic","Quart","Quint","Expo"].forEach((function(t,e){m[t]=function(){return function(t){return Math.pow(t,e+2)}}})),Object.keys(m).forEach((function(t){var e=m[t];f["easeIn"+t]=e,f["easeOut"+t]=function(t,i){return function(n){return 1-e(t,i)(1-n)}},f["easeInOut"+t]=function(t,i){return function(n){return n<.5?e(t,i)(2*n)/2:1-e(t,i)(-2*n+2)/2}},f["easeOutIn"+t]=function(t,i){return function(n){return n<.5?(1-e(t,i)(1-2*n))/2:(e(t,i)(2*n-1)+1)/2}}})),f);function y(t,e){if(u.fnc(t))return t;var i=t.split("(")[0],n=v[i],r=c(t);switch(i){case"spring":return d(t,e);case"cubicBezier":return l(g,r);case"steps":return l(p,r);default:return l(n,r)}}function x(t){try{return document.querySelectorAll(t)}catch(t){return}}function w(t,e){for(var i=t.length,n=arguments.length>=2?arguments[1]:void 0,r=[],s=0;s<i;s++)if(s in t){var o=t[s];e.call(n,o,s,t)&&r.push(o)}return r}function b(t){return t.reduce((function(t,e){return t.concat(u.arr(e)?b(e):e)}),[])}function A(t){return u.arr(t)?t:(u.str(t)&&(t=x(t)||t),t instanceof NodeList||t instanceof HTMLCollection?[].slice.call(t):[t])}function T(t,e){return t.some((function(t){return t===e}))}function S(t){var e={};for(var i in t)e[i]=t[i];return e}function E(t,e){var i=S(t);for(var n in t)i[n]=e.hasOwnProperty(n)?e[n]:t[n];return i}function M(t,e){var i=S(t);for(var n in e)i[n]=u.und(t[n])?e[n]:t[n];return i}function _(t){return u.rgb(t)?(i=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(e=t))?"rgba("+i[1]+",1)":e:u.hex(t)?function(t){var e=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,(function(t,e,i,n){return e+e+i+i+n+n})),i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return"rgba("+parseInt(i[1],16)+","+parseInt(i[2],16)+","+parseInt(i[3],16)+",1)"}(t):u.hsl(t)?function(t){var e,i,n,r=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(t),s=parseInt(r[1],10)/360,o=parseInt(r[2],10)/100,a=parseInt(r[3],10)/100,h=r[4]||1;function l(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}if(0==o)e=i=n=a;else{var u=a<.5?a*(1+o):a+o-a*o,c=2*a-u;e=l(c,u,s+1/3),i=l(c,u,s),n=l(c,u,s-1/3)}return"rgba("+255*e+","+255*i+","+255*n+","+h+")"}(t):void 0;var e,i}function C(t){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(t);if(e)return e[1]}function P(t,e){return u.fnc(t)?t(e.target,e.id,e.total):t}function R(t,e){return t.getAttribute(e)}function L(t,e,i){if(T([i,"deg","rad","turn"],C(e)))return e;var n=o.CSS[e+i];if(!u.und(n))return n;var r=document.createElement(t.tagName),s=t.parentNode&&t.parentNode!==document?t.parentNode:document.body;s.appendChild(r),r.style.position="absolute",r.style.width=100+i;var a=100/r.offsetWidth;s.removeChild(r);var h=a*parseFloat(e);return o.CSS[e+i]=h,h}function O(t,e,i){if(e in t.style){var n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=t.style[e]||getComputedStyle(t).getPropertyValue(n)||"0";return i?L(t,r,i):r}}function D(t,e){return u.dom(t)&&!u.inp(t)&&(!u.nil(R(t,e))||u.svg(t)&&t[e])?"attribute":u.dom(t)&&T(s,e)?"transform":u.dom(t)&&"transform"!==e&&O(t,e)?"css":null!=t[e]?"object":void 0}function B(t){if(u.dom(t)){for(var e,i=t.style.transform||"",n=/(\w+)\(([^)]*)\)/g,r=new Map;e=n.exec(i);)r.set(e[1],e[2]);return r}}function I(t,e,i,n){var r=h(e,"scale")?1:0+function(t){return h(t,"translate")||"perspective"===t?"px":h(t,"rotate")||h(t,"skew")?"deg":void 0}(e),s=B(t).get(e)||r;return i&&(i.transforms.list.set(e,s),i.transforms.last=e),n?L(t,s,n):s}function F(t,e,i,n){switch(D(t,e)){case"transform":return I(t,e,n,i);case"css":return O(t,e,i);case"attribute":return R(t,e);default:return t[e]||0}}function k(t,e){var i=/^(\*=|\+=|-=)/.exec(t);if(!i)return t;var n=C(t)||0,r=parseFloat(e),s=parseFloat(t.replace(i[0],""));switch(i[0][0]){case"+":return r+s+n;case"-":return r-s+n;case"*":return r*s+n}}function N(t,e){if(u.col(t))return _(t);if(/\s/g.test(t))return t;var i=C(t),n=i?t.substr(0,t.length-i.length):t;return e?n+e:n}function z(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function U(t){for(var e,i=t.points,n=0,r=0;r<i.numberOfItems;r++){var s=i.getItem(r);r>0&&(n+=z(e,s)),e=s}return n}function V(t){if(t.getTotalLength)return t.getTotalLength();switch(t.tagName.toLowerCase()){case"circle":return function(t){return 2*Math.PI*R(t,"r")}(t);case"rect":return function(t){return 2*R(t,"width")+2*R(t,"height")}(t);case"line":return function(t){return z({x:R(t,"x1"),y:R(t,"y1")},{x:R(t,"x2"),y:R(t,"y2")})}(t);case"polyline":return U(t);case"polygon":return function(t){var e=t.points;return U(t)+z(e.getItem(e.numberOfItems-1),e.getItem(0))}(t)}}function H(t,e){var i=e||{},n=i.el||function(t){for(var e=t.parentNode;u.svg(e)&&u.svg(e.parentNode);)e=e.parentNode;return e}(t),r=n.getBoundingClientRect(),s=R(n,"viewBox"),o=r.width,a=r.height,h=i.viewBox||(s?s.split(" "):[0,0,o,a]);return{el:n,viewBox:h,x:h[0]/1,y:h[1]/1,w:o,h:a,vW:h[2],vH:h[3]}}function G(t,e,i){function n(i){void 0===i&&(i=0);var n=e+i>=1?e+i:0;return t.el.getPointAtLength(n)}var r=H(t.el,t.svg),s=n(),o=n(-1),a=n(1),h=i?1:r.w/r.vW,l=i?1:r.h/r.vH;switch(t.property){case"x":return(s.x-r.x)*h;case"y":return(s.y-r.y)*l;case"angle":return 180*Math.atan2(a.y-o.y,a.x-o.x)/Math.PI}}function W(t,e){var i=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,n=N(u.pth(t)?t.totalLength:t,e)+"";return{original:n,numbers:n.match(i)?n.match(i).map(Number):[0],strings:u.str(t)||e?n.split(i):[]}}function Y(t){return w(t?b(u.arr(t)?t.map(A):A(t)):[],(function(t,e,i){return i.indexOf(t)===e}))}function X(t){var e=Y(t);return e.map((function(t,i){return{target:t,id:i,total:e.length,transforms:{list:B(t)}}}))}function j(t,e){var i=S(e);if(/^spring/.test(i.easing)&&(i.duration=d(i.easing)),u.arr(t)){var n=t.length;2===n&&!u.obj(t[0])?t={value:t}:u.fnc(e.duration)||(i.duration=e.duration/n)}var r=u.arr(t)?t:[t];return r.map((function(t,i){var n=u.obj(t)&&!u.pth(t)?t:{value:t};return u.und(n.delay)&&(n.delay=i?0:e.delay),u.und(n.endDelay)&&(n.endDelay=i===r.length-1?e.endDelay:0),n})).map((function(t){return M(t,i)}))}function q(t,e){var i=[],n=e.keyframes;for(var r in n&&(e=M(function(t){for(var e=w(b(t.map((function(t){return Object.keys(t)}))),(function(t){return u.key(t)})).reduce((function(t,e){return t.indexOf(e)<0&&t.push(e),t}),[]),i={},n=function(n){var r=e[n];i[r]=t.map((function(t){var e={};for(var i in t)u.key(i)?i==r&&(e.value=t[i]):e[i]=t[i];return e}))},r=0;r<e.length;r++)n(r);return i}(n),e)),e)u.key(r)&&i.push({name:r,tweens:j(e[r],t)});return i}function Q(t,e){var i;return t.tweens.map((function(n){var r=function(t,e){var i={};for(var n in t){var r=P(t[n],e);u.arr(r)&&1===(r=r.map((function(t){return P(t,e)}))).length&&(r=r[0]),i[n]=r}return i.duration=parseFloat(i.duration),i.delay=parseFloat(i.delay),i}(n,e),s=r.value,o=u.arr(s)?s[1]:s,a=C(o),h=F(e.target,t.name,a,e),l=i?i.to.original:h,c=u.arr(s)?s[0]:l,d=C(c)||C(h),p=a||d;return u.und(o)&&(o=l),r.from=W(c,p),r.to=W(k(o,c),p),r.start=i?i.end:0,r.end=r.start+r.delay+r.duration+r.endDelay,r.easing=y(r.easing,r.duration),r.isPath=u.pth(s),r.isPathTargetInsideSVG=r.isPath&&u.svg(e.target),r.isColor=u.col(r.from.original),r.isColor&&(r.round=1),i=r,r}))}var K={css:function(t,e,i){return t.style[e]=i},attribute:function(t,e,i){return t.setAttribute(e,i)},object:function(t,e,i){return t[e]=i},transform:function(t,e,i,n,r){if(n.list.set(e,i),e===n.last||r){var s="";n.list.forEach((function(t,e){s+=e+"("+t+") "})),t.style.transform=s}}};function J(t,e){X(t).forEach((function(t){for(var i in e){var n=P(e[i],t),r=t.target,s=C(n),o=F(r,i,s,t),a=k(N(n,s||C(o)),o),h=D(r,i);K[h](r,i,a,t.transforms,!0)}}))}function Z(t,e){return w(b(t.map((function(t){return e.map((function(e){return function(t,e){var i=D(t.target,e.name);if(i){var n=Q(e,t),r=n[n.length-1];return{type:i,property:e.name,animatable:t,tweens:n,duration:r.end,delay:n[0].delay,endDelay:r.endDelay}}}(t,e)}))}))),(function(t){return!u.und(t)}))}function $(t,e){var i=t.length,n=function(t){return t.timelineOffset?t.timelineOffset:0},r={};return r.duration=i?Math.max.apply(Math,t.map((function(t){return n(t)+t.duration}))):e.duration,r.delay=i?Math.min.apply(Math,t.map((function(t){return n(t)+t.delay}))):e.delay,r.endDelay=i?r.duration-Math.max.apply(Math,t.map((function(t){return n(t)+t.duration-t.endDelay}))):e.endDelay,r}var tt=0;var et=[],it=function(){var t;function e(i){for(var n=et.length,r=0;r<n;){var s=et[r];s.paused?(et.splice(r,1),n--):(s.tick(i),r++)}t=r>0?requestAnimationFrame(e):void 0}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",(function(){rt.suspendWhenDocumentHidden&&(nt()?t=cancelAnimationFrame(t):(et.forEach((function(t){return t._onDocumentVisibility()})),it()))})),function(){t||nt()&&rt.suspendWhenDocumentHidden||!(et.length>0)||(t=requestAnimationFrame(e))}}();function nt(){return!!document&&document.hidden}function rt(t){void 0===t&&(t={});var e,i=0,s=0,o=0,h=0,l=null;function u(t){var e=window.Promise&&new Promise((function(t){return l=t}));return t.finished=e,e}var c=function(t){var e=E(n,t),i=E(r,t),s=q(i,t),o=X(t.targets),a=Z(o,s),h=$(a,i),l=tt;return tt++,M(e,{id:l,children:[],animatables:o,animations:a,duration:h.duration,delay:h.delay,endDelay:h.endDelay})}(t);u(c);function d(){var t=c.direction;"alternate"!==t&&(c.direction="normal"!==t?"normal":"reverse"),c.reversed=!c.reversed,e.forEach((function(t){return t.reversed=c.reversed}))}function p(t){return c.reversed?c.duration-t:t}function f(){i=0,s=p(c.currentTime)*(1/rt.speed)}function m(t,e){e&&e.seek(t-e.timelineOffset)}function g(t){for(var e=0,i=c.animations,n=i.length;e<n;){var r=i[e],s=r.animatable,o=r.tweens,h=o.length-1,l=o[h];h&&(l=w(o,(function(e){return t<e.end}))[0]||l);for(var u=a(t-l.start-l.delay,0,l.duration)/l.duration,d=isNaN(u)?1:l.easing(u),p=l.to.strings,f=l.round,m=[],g=l.to.numbers.length,v=void 0,y=0;y<g;y++){var x=void 0,b=l.to.numbers[y],A=l.from.numbers[y]||0;x=l.isPath?G(l.value,d*b,l.isPathTargetInsideSVG):A+d*(b-A),f&&(l.isColor&&y>2||(x=Math.round(x*f)/f)),m.push(x)}var T=p.length;if(T){v=p[0];for(var S=0;S<T;S++){p[S];var E=p[S+1],M=m[S];isNaN(M)||(v+=E?M+E:M+" ")}}else v=m[0];K[r.type](s.target,r.property,v,s.transforms),r.currentValue=v,e++}}function v(t){c[t]&&!c.passThrough&&c[t](c)}function y(t){var n=c.duration,r=c.delay,f=n-c.endDelay,y=p(t);c.progress=a(y/n*100,0,100),c.reversePlayback=y<c.currentTime,e&&function(t){if(c.reversePlayback)for(var i=h;i--;)m(t,e[i]);else for(var n=0;n<h;n++)m(t,e[n])}(y),!c.began&&c.currentTime>0&&(c.began=!0,v("begin")),!c.loopBegan&&c.currentTime>0&&(c.loopBegan=!0,v("loopBegin")),y<=r&&0!==c.currentTime&&g(0),(y>=f&&c.currentTime!==n||!n)&&g(n),y>r&&y<f?(c.changeBegan||(c.changeBegan=!0,c.changeCompleted=!1,v("changeBegin")),v("change"),g(y)):c.changeBegan&&(c.changeCompleted=!0,c.changeBegan=!1,v("changeComplete")),c.currentTime=a(y,0,n),c.began&&v("update"),t>=n&&(s=0,c.remaining&&!0!==c.remaining&&c.remaining--,c.remaining?(i=o,v("loopComplete"),c.loopBegan=!1,"alternate"===c.direction&&d()):(c.paused=!0,c.completed||(c.completed=!0,v("loopComplete"),v("complete"),!c.passThrough&&"Promise"in window&&(l(),u(c)))))}return c.reset=function(){var t=c.direction;c.passThrough=!1,c.currentTime=0,c.progress=0,c.paused=!0,c.began=!1,c.loopBegan=!1,c.changeBegan=!1,c.completed=!1,c.changeCompleted=!1,c.reversePlayback=!1,c.reversed="reverse"===t,c.remaining=c.loop,e=c.children;for(var i=h=e.length;i--;)c.children[i].reset();(c.reversed&&!0!==c.loop||"alternate"===t&&1===c.loop)&&c.remaining++,g(c.reversed?c.duration:0)},c._onDocumentVisibility=f,c.set=function(t,e){return J(t,e),c},c.tick=function(t){o=t,i||(i=o),y((o+(s-i))*rt.speed)},c.seek=function(t){y(p(t))},c.pause=function(){c.paused=!0,f()},c.play=function(){c.paused&&(c.completed&&c.reset(),c.paused=!1,et.push(c),f(),it())},c.reverse=function(){d(),c.completed=!c.reversed,f()},c.restart=function(){c.reset(),c.play()},c.remove=function(t){ot(Y(t),c)},c.reset(),c.autoplay&&c.play(),c}function st(t,e){for(var i=e.length;i--;)T(t,e[i].animatable.target)&&e.splice(i,1)}function ot(t,e){var i=e.animations,n=e.children;st(t,i);for(var r=n.length;r--;){var s=n[r],o=s.animations;st(t,o),o.length||s.children.length||n.splice(r,1)}i.length||n.length||e.pause()}rt.version="3.2.1",rt.speed=1,rt.suspendWhenDocumentHidden=!0,rt.running=et,rt.remove=function(t){for(var e=Y(t),i=et.length;i--;){ot(e,et[i])}},rt.get=F,rt.set=J,rt.convertPx=L,rt.path=function(t,e){var i=u.str(t)?x(t)[0]:t,n=e||100;return function(t){return{property:t,el:i,svg:H(i),totalLength:V(i)*(n/100)}}},rt.setDashoffset=function(t){var e=V(t);return t.setAttribute("stroke-dasharray",e),e},rt.stagger=function(t,e){void 0===e&&(e={});var i=e.direction||"normal",n=e.easing?y(e.easing):null,r=e.grid,s=e.axis,o=e.from||0,a="first"===o,h="center"===o,l="last"===o,c=u.arr(t),d=c?parseFloat(t[0]):parseFloat(t),p=c?parseFloat(t[1]):0,f=C(c?t[1]:t)||0,m=e.start||0+(c?d:0),g=[],v=0;return function(t,e,u){if(a&&(o=0),h&&(o=(u-1)/2),l&&(o=u-1),!g.length){for(var y=0;y<u;y++){if(r){var x=h?(r[0]-1)/2:o%r[0],w=h?(r[1]-1)/2:Math.floor(o/r[0]),b=x-y%r[0],A=w-Math.floor(y/r[0]),T=Math.sqrt(b*b+A*A);"x"===s&&(T=-b),"y"===s&&(T=-A),g.push(T)}else g.push(Math.abs(o-y));v=Math.max.apply(Math,g)}n&&(g=g.map((function(t){return n(t/v)*v}))),"reverse"===i&&(g=g.map((function(t){return s?t<0?-1*t:-t:Math.abs(v-t)})))}return m+(c?(p-d)/v:d)*(Math.round(100*g[e])/100)+f}},rt.timeline=function(t){void 0===t&&(t={});var e=rt(t);return e.duration=0,e.add=function(i,n){var s=et.indexOf(e),o=e.children;function a(t){t.passThrough=!0}s>-1&&et.splice(s,1);for(var h=0;h<o.length;h++)a(o[h]);var l=M(i,E(r,t));l.targets=l.targets||t.targets;var c=e.duration;l.autoplay=!1,l.direction=e.direction,l.timelineOffset=u.und(n)?c:k(n,c),a(e),e.seek(l.timelineOffset);var d=rt(l);a(d),o.push(d);var p=$(o,t);return e.delay=p.delay,e.endDelay=p.endDelay,e.duration=p.duration,e.seek(0),e.reset(),e.autoplay&&e.play(),e},e},rt.easing=y,rt.penner=v,rt.random=function(t,e){return Math.floor(Math.random()*(e-t+1))+t},e.a=rt},function(t,e,i){"use strict";i.d(e,"a",(function(){return a}));var n=i(0),r=i(1);function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new n.Vector3(0,1,0),r=arguments.length>2?arguments[2]:void 0;s(this,t),this.mouse=new n.Vector2,this.raycaster=new n.Raycaster,this.camera=e,this.plane=new n.Plane(i,0),this.planeVec3=new n.Vector3,r&&this.plane.translate(r)}var e,i,a;return e=t,a=[{key:"screenXYPhaser",value:function(t,e){var i=t.clone();return e.updateMatrixWorld(),i.project(e),{x:(.5*i.x+.5)*r.a.phaserScene.lastWidth,y:(-.5*i.y+.5)*r.a.phaserScene.lastHeight}}},{key:"ScreenToWorld",value:function(t,e,i){var s=e/r.a.phaserScene.lastWidth*2-1,o=-i/r.a.phaserScene.lastHeight*2+1,a=new n.Vector3(s,o,-1);return a.unproject(t),a}}],(i=[{key:"getMousePos",value:function(t,e){this.mouse.x=t/r.a.phaserScene.lastWidth*2-1,this.mouse.y=-e/r.a.phaserScene.lastHeight*2+1}},{key:"getIntersects",value:function(t,e,i){var n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.getMousePos(t,e),this.raycaster.setFromCamera(this.mouse,this.camera);var r=this.raycaster.intersectObjects(i,n);return r}},{key:"raycastFromObject",value:function(t,e,i,n){return this.raycaster.set(t,e),this.raycaster.far=i,this.raycaster.intersectObjects(n,!0)}},{key:"showArrow",value:function(){this.arrow||(this.arrow=new n.ArrowHelper(this.raycaster.ray.direction,this.raycaster.ray.origin,1,"#ff0000"),app.main.scene.add(this.arrow)),this.arrow.position.copy(this.raycaster.ray.origin),this.arrow.setDirection(this.raycaster.ray.direction),this.arrow.setLength(this.raycaster.far)}},{key:"getIntersect",value:function(t,e,i){return this.getMousePos(t,e),this.raycaster.setFromCamera(this.mouse,this.camera),this.raycaster.intersectObject(i,!0)}},{key:"getPlaneIntersection",value:function(t,e){return this.camera.updateProjectionMatrix(),this.getMousePos(t,e),this.raycaster.setFromCamera(this.mouse,this.camera),this.raycaster.ray.intersectPlane(this.plane,this.planeVec3),this.planeVec3}},{key:"screenXY",value:function(t,e){var i=t.clone();return e.updateMatrixWorld(),i.project(e),{x:(.5*i.x+.5)*r.a.screenWidth,y:(-.5*i.y+.5)*r.a.screenHeight}}}])&&o(e.prototype,i),a&&o(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t}()},function(t,e,i){"use strict";i.d(e,"a",(function(){return h}));var n=i(1),r=i(24);i(3);function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function a(t,e,i){return e&&o(t.prototype,e),i&&o(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}var h=function(){function t(){s(this,t)}return a(t,null,[{key:"init",value:function(){var t=this;this.pool=[];var e=n.a.cloneAsset("dashFx",1);e.traverse((function(t){t.material&&(r.a.setRawBasic(t),t.material.side=THREE.BackSide)}));for(var i=0;i<7;i++){var s=new l(e);this.pool.push(s)}this.curIndex=-1,setTimeout((function(){t.pool[0].mesh.visible=!0,t.pool[0].mesh.position.z=-100,t.pool[0].mesh.scale.multiplyScalar(.1),setTimeout((function(){t.pool[0].mesh.visible=!1}),1)}),1)}},{key:"spawn",value:function(t){this.curIndex++,this.curIndex>=this.pool.length&&(this.curIndex=0),this.pool[this.curIndex].playAnim(t)}}]),t}(),l=function(){function t(e){var i=this;s(this,t),this.mesh=e.clone(),n.a.addToGame({obj:this.mesh,recycle:!1}),this.mesh.visible=!1,this.mesh.rotation.y=.5*-Math.PI,this.innerMeshList=[],this.mainMat,this.matList=[],this.mesh.traverse((function(t){t.isMesh&&(t.material=t.material.clone(),i.innerMeshList.push(t))}))}return a(t,[{key:"playAnim",value:function(t){if(this.mesh.position.copy(t),this.mesh.visible=!0,this.twenList)this.twenList.forEach((function(t){t.restart()}));else{var e=[];this.innerMeshList.forEach((function(t,i){t.material.opacity=0;var r=n.a.phaserScene.tweens.addCounter({from:0,to:1,duration:850,ease:Phaser.Math.Easing.Sine.Out,onUpdate:function(e){t.morphTargetInfluences[0]=e.getValue()}});e.push(r);var s=n.a.phaserScene.tweens.createTimeline();s.add({targets:t.material,opacity:.8,duration:50}),s.add({targets:t.material,opacity:0,delay:100,duration:300}),s.play(),e.push(s)}))}}}]),t}()},function(t,e,i){"use strict";i.d(e,"a",(function(){return x}));var n=i(20),r=i(0),s=i(47),o=i.n(s);function a(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var h=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,n;return e=t,n=[{key:"createText",value:function(t){var e=new TextPlane({alignment:"center",color:"#ffffff",fontFamily:"ingame-font",backgroundColor:"rgba(0,0,0,0)",fontSize:4,text:t,strokeWidth:.03,strokeColor:"rgba(0,0,0)",lineGap:-.3,padding:.1});e.material.transparent=!0,e.renderOrder=1;var i=new r.Object3D;return i.add(e),i.scale.multiplyScalar(.25),i.text=e,i}},{key:"createSpriteText",value:function(t){var e=new o.a(t,10);return e.color="#ffffff",e.backgroundColor=!1,e.fontFace="ui-font",e.fontSize=60,e.strokeColor="black",e.strokeWidth=.3,e.padding=1,e.material.fog=!1,e.material.transparent=!0,e.material.depthTest=!1,e.material.depthWrite=!1,e}}],(i=null)&&a(e.prototype,i),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),l=i(1);function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function d(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=m(t);if(e){var r=m(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return p(this,i)}}function p(t,e){if(e&&("object"===u(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return f(t)}function f(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function m(t){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function g(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function y(t,e,i){return e&&v(t.prototype,e),i&&v(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}var x=function(){function t(){g(this,t)}return y(t,null,[{key:"init",value:function(){this.maxNumber=5,this.pool=[],this.curIndex=0;for(var t=0;t<this.maxNumber;t++){var e=this.initMesh();this.pool.push(e)}var i=this.pool[0];i.visible=!0,i.position.copy(l.a.main.camera.position),i.position.z=-10,i.position.x=-100}},{key:"initMesh",value:function(){return new w("+1")}},{key:"spawn",value:function(t){this.curIndex++,this.curIndex>=this.pool.length&&(this.curIndex=0),this.pool[this.curIndex].playAnim(t)}}]),t}(),w=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c(t,e)}(i,t);var e=d(i);function i(t){var n;return g(this,i),(n=e.call(this)).mesh=h.createSpriteText(t),n.add(n.mesh),n.mesh.scale.multiplyScalar(.03),n.initAnim(),n.visible=!1,l.a.addToGame({obj:f(n),recycle:!1}),n}return y(i,[{key:"initAnim",value:function(){var t=this;this.anim1=Object(n.a)({targets:this.mesh.position,y:[0,1],duration:1e3,easing:"linear",autoplay:!1}),this.anim2=n.a.timeline({targets:this.scale,autoplay:!1}),this.anim2.add({x:3,y:3,z:3,easing:"easeOutCubic",endDelay:200,duration:500}),this.anim2.add({targets:this.mesh.material,opacity:0,easing:"easeOutCubic",duration:300,complete:function(){t.visible=!1}})}},{key:"playAnim",value:function(t){this.mesh.material.opacity=1,this.visible=!0,this.position.copy(t),this.scale.set(1,1,1),this.anim1.restart(),this.anim2.restart()}}]),i}(r.Object3D)},function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));var n=i(0);function r(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var s=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,s;return e=t,s=[{key:"init",value:function(){for(var t in this.matList={},this.matList)this.matList[t].color.convertSRGBToLinear()}},{key:"getToonMat",value:function(){return new n.MeshToonMaterial({gradientMap:this.gradientMap})}},{key:"getCharMat",value:function(t){var e=this.getToonMat(t);return e.mat.color.convertSRGBToLinear(),e}},{key:"setsRGBColorMat",value:function(t,e){return t.color.set(e),this.convertSRGBToLinear(t),t}},{key:"convertSRGBToLinear",value:function(t){return t.color.convertSRGBToLinear(),t}},{key:"setBasicMat",value:function(t){return this.setMaterial(t,n.MeshBasicMaterial)}},{key:"setRawBasic",value:function(t){t.material=new n.MeshBasicMaterial({map:t.material.map,color:t.material.color,transparent:t.material.transparent,opacity:t.material.opacity,name:t.material.name})}},{key:"setMaterial",value:function(t,e){if(this.matList[t.name]);else{var i=t.material,n=new e({color:i.color,map:i.map,transparent:i.transparent,opacity:i.opacity});this.matList[t.name]=n}return t.material=this.matList[t.name],t.material}},{key:"getLastMat",value:function(t){return t[t.length-1]}}],(i=null)&&r(e.prototype,i),s&&r(e,s),Object.defineProperty(e,"prototype",{writable:!1}),t}()},function(t,e,i){"use strict";i.d(e,"a",(function(){return u}));var n=i(0),r=i(1),s=i(28);function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a,h,l,u=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,a;return e=t,a=[{key:"init",value:function(){this.currentState=null,this.mainCamera=r.a.threeCamera,this.camera=new s.a(this.mainCamera,new n.Vector3(0,2,3),new n.Euler(0,0,0)),this.defaultFov=73,this.defaultFovLand=65,this.camera.setMoveRotSpeed(1,1),r.a.main.scene.add(this.mainCamera),r.a.camera=this.camera,this.setState(this.states.defaultState,!0)}},{key:"setState",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t&&(this.currentState=t,this.onResize(!0),e&&this.teleportToTarget())}},{key:"teleportToTarget",value:function(){this.attachTarget&&(this.camera.cam.position.copy(this.attachTarget.getCamHelperPos()),this.camera.cam.lookAt(this.attachTarget.getCamLookAtPos()))}},{key:"setfollowObject",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.attachTarget=t,this.mainCamera.fov=this.defaultFov,this.mainCamera.updateProjectionMatrix(),this.setState(this.states.followState,e)}},{key:"onResize",value:function(){var t=app.innerWidth,e=app.innerHeight,i=this.currentState;if(this.camera&&r.a.main.camera&&i&&this.camera.enabled){i.landscapePos||(i.landscapePos=i.portraitPos),i.lrot||(i.lrot=i.prot);var n=null,s=null,o=this.defaultFov;return t>e?(n=i.landscapePos,s=i.lrot,o=this.defaultFovLand):(n=i.portraitPos,s=i.prot),i.onResize(n,s),this.camera.setFov(o),{pos:n,rot:s,fov:o}}}}],(i=null)&&o(e.prototype,i),a&&o(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t}();a=u,h="states",l={defaultState:{portraitPos:new n.Vector3(0,7.5,10.5),prot:new n.Euler(-.56,0,0),onResize:function(t,e){u.camera.setMoveAndRotTarget(t,e,!1)}},followState:{portraitPos:new n.Vector3(0,0,0),prot:new n.Euler(-.6,.5,.4),onResize:function(t,e,i){u.attachTarget&&u.camera.setFollowTarget(u.attachTarget,t,e,!0,!1)}}},h in a?Object.defineProperty(a,h,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[h]=l},function(t,e,i){"use strict";i.d(e,"a",(function(){return u}));i(5);var n,r=i(1),s=i(11),o=i(17),a=i(18),h=i(8);function l(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var u=function(){function t(){var e=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),n=r.a.phaserScene,this.levelTitle=n.add.text(0,0,"LEVEL 1",{fontSize:60,fontFamily:"ui-font",color:"#ffffff",align:"center"}),this.levelTitle.setOrigin(.5),this.levelTitle.onResizeCallback=function(t,i){e.levelTitle.scale=Math.min(.32*t/e.levelTitle.width,.1*i/e.levelTitle.height),e.levelTitle.x=.5*t,e.levelTitle.y=.15*i},this.levelTitle.onResizeCallback(n.lastWidth,n.lastHeight),this.playBtn=s.a.addButton(n,"uiatlas","playBtn",r.a.locales.PLAY,(function(){r.a.eventEmitter.emit("playBtnClicked")}),{xRatio:.58,wRatio:.45,yRatio:.5}),this.playBtn.onResizeCallback=function(t,i){e.playBtn.scale=Math.min(.45*t/e.playBtn.width,.12*i/e.playBtn.height);var n=.81;t>i&&(n=.78),h.a.showUpgrades||(n=.7),e.playBtn.x=.5*t,e.playBtn.y=i*n,e.playBtn.iS=e.playBtn.scale},this.playBtn.onResizeCallback(n.lastWidth,n.lastHeight),a.a.makePulse(this.playBtn,{skalRatio:.9}),this.gameObjects=[this.levelTitle,this.playBtn],this.show(!1),t.initCoinBar()}var e,i,u;return e=t,u=[{key:"initCoinBar",value:function(){var t=this;this.coinBar=new o.a;var e=r.a.phaserScene,i=e.add.image(0,0,"uiatlas","coin");i.setOrigin(.5),i.scale=.5;var n=e.add.image(0,0,"uiatlas","goldbg");n.setOrigin(.5),this.coinBar.add(n),this.coinBar.setInitials();var s=e.add.text(0,0,"1000000000",{fontSize:60,fontFamily:"ui-font",color:"#ffffff"});s.setFontStyle("bold"),s.setOrigin(.5),s.setTextScale=function(t){s.text=t.toFixed(0),s.scale=Math.min(.6*n.displayWidth/s.width,.75*n.displayHeight/s.height)},s.setTextScale(r.a.playerData.coin),i.x=.5*n.displayWidth,s.x=0,s.y=0,this.coinBar.add(i),this.coinBar.add(s),this.coinBar.onResizeCallback=function(e,i){t.coinBar.scale=Math.min(.2*e/t.coinBar.iW,.05*i/t.coinBar.iH),t.coinBar.x=1*e-.85*t.coinBar.displayWidth,t.coinBar.y=0*i+1.2*t.coinBar.displayHeight,t.coinBar.iS=t.coinBar.scale},this.coinBar.onResizeCallback(e.lastWidth,e.lastHeight),r.a.eventEmitter.on("coinCollected",(function(t){s.setTextScale(r.a.playerData.coin)})),r.a.eventEmitter.on("updateCoins",(function(t){s.setTextScale(r.a.playerData.coin)})),this.coinBar.addCoinWithAnim=function(e){s.setTextScale(e),s.anim&&s.anim.remove(),s.anim=r.a.phaserScene.tweens.add({targets:t.coinBar,props:{scale:{dynamic:!0,value:{getStart:function(e){return 1.15*t.coinBar.iS},getEnd:function(e){return 1*t.coinBar.iS}}}},duration:100,ease:"Sine.easeInOut"})}}}],(i=[{key:"setLevelTitle",value:function(t){this.levelTitle.setText(r.a.locales.LEVEL+" "+t)}},{key:"show",value:function(t){this.gameObjects.forEach((function(e){e.visible=t}))}}])&&l(e.prototype,i),u&&l(e,u),Object.defineProperty(e,"prototype",{writable:!1}),t}()},function(t,e,i){"use strict";var n={shuffleArray:function(t){for(var e=t.length-1;e>0;e--){var i=Math.floor(Math.random()*(e+1)),n=[t[i],t[e]];t[e]=n[0],t[i]=n[1]}},convertRgbStringToHex:function(t){var e=n.rgbStringToRgbObj(t);return n.rgbToHex(e.r,e.g,e.b)},rgbStringToRgbObj:function(t){var e=t.split(",");return{r:Number.parseInt(e[0].substring(4)),g:Number.parseInt(e[1]),b:Number.parseInt(e[2])}},rgbToHex:function(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)},hexToRgb:function(t){var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null},lightenDarkenColor:function(t,e){var i=parseInt(t.replace("#",""),16),n=Math.round(2.55*e),r=(i>>16)+n,s=(i>>8&255)+n,o=(255&i)+n;return"#"+(16777216+65536*(r<255?r<1?0:r:255)+256*(s<255?s<1?0:s:255)+(o<255?o<1?0:o:255)).toString(16).slice(1)},getRandomColor:function(){return Math.floor(16777215*Math.random()).toString(16)},formattedTime:function(t){var e=t;Math.floor(e/3600);e%=3600;var i=Math.floor(e/60),n=Math.floor(e%60);return(i=String(i).padStart(2,"0"))+":"+(n=String(n).padStart(2,"0"))},removeItemFromArray:function(t,e){var i=t.indexOf(e);return!(i<0)&&(t.splice(i,1),!0)},orderByLastIndex:function(t,e){var i=this;t.sort((function(t,n){var r,s;if(e){var o=i.indexOfFirstDigit(t.name),a=i.indexOfFirstDigit(n.name);r=t.name.substr(o),s=n.name.substr(a)}else r=t.name.substr(t.name.lastIndexOf("_")+1),s=n.name.substr(t.name.lastIndexOf("_")+1);return Number.parseInt(r)>Number.parseInt(s)?1:-1}))},indexOfFirstDigit:function(t){for(var e=0;t[e]<"0"||t[e]>"9";e++);return e==t.length?-1:e}};e.a=n},function(t,e,i){"use strict";i.d(e,"a",(function(){return u}));var n=i(0),r=i(20),s=i(1);function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a,h,l,u=function(){function t(e,i,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.cam=e,this.enabled=!0,this.moveTarget=new n.Vector3,this.moveSpeed=10,this.rotationSpeed=10,this.target=null,this.offset=new n.Vector3,this.lookPos=new n.Vector3,this.lookAtAlways=!1,this.lookQuaternion=new n.Quaternion,this.initPosition=i.clone(),this.initOffset=new n.Vector3,this.initMoveTarget=new n.Vector3,this.rotTarget=new n.Euler,this.rotationQuaternion=new n.Quaternion,this.forceEnabled=!1,this.forceDuration=0,this.forceTimer=0,this.enableLockAxis=!1,this.selectedLockAxis="",this.lockVector=new n.Vector3,this.lerpRotation=!1,this.useDelta=!1,i&&e.position.copy(i),r&&e.rotation.copy(r),this.cameraMoveType=t.MoveType.FREE}var e,i,a;return e=t,(i=[{key:"update",value:function(e){if(this.enabled){switch(this.cameraMoveType){case t.MoveType.LERP:this.lerpToTarget(e);break;case t.MoveType.FOLLOW:this.followTarget(e);break;case t.MoveType.LOCK:this.lerptoHelperTarget(e)}this.lookAtAlways&&this.lookAtWithSlerp(e),this.shakeFunction(e)}}},{key:"lookAtWithSlerp",value:function(t){if(this.target){var e=60*t;this.useDelta||(e=1);var i=this.cam.quaternion.clone();this.cam.lookAt(this.target.getCamLookAtPos());var n=this.cam.quaternion.clone();this.cam.quaternion.copy(i),this.cam.quaternion.slerp(n,this.rotationSpeed*e)}}},{key:"followTarget",value:function(t){this.moveTarget.copy(this.target.getCamHelperPos());var e=60*t;this.useDelta||(e=1),this.cam.position.lerp(this.moveTarget,this.moveSpeed*e)}},{key:"shakeFunction",value:function(t){if(this.shakeEnabled){var e=this.shakeTarget;this.shakeTimer>0?(e.rotation.x+=n.MathUtils.randFloat(-1,1)*this.shakeForce,e.rotation.y+=n.MathUtils.randFloat(-1,1)*this.shakeForce,this.shakeTimer-=t):(this.shakeEnabled=!1,this.cam.position.copy(this.moveTarget))}}},{key:"setMoveRotSpeed",value:function(t,e){this.moveSpeed=t,this.rotationSpeed=e}},{key:"setPosition",value:function(t){this.cam.position.copy(t)}},{key:"setPosAndRot",value:function(t,e){this.cam.position.copy(t),this.cam.rotation.copy(e)}},{key:"setLookDir",value:function(t){var e=this.cam.quaternion.clone();this.cam.lookAt(t),this.lookQuaternion.copy(this.cam.quaternion),this.cam.quaternion.copy(e),this.lookPos=t}},{key:"setMoveTarget",value:function(e){var i=e.x,n=void 0===i?this.cam.position.x:i,r=e.y,s=void 0===r?this.cam.position.y:r,o=e.z,a=void 0===o?this.cam.position.z:o,h=e.keepOffset,l=void 0===h||h;e.lookPos,e.lookAlways,this.moveTarget.set(n,s,a),l&&(this.moveTarget.x+=this.initPosition.x,this.moveTarget.z+=this.initPosition.z),this.cameraMoveType=t.MoveType.LERP}},{key:"setFollowTargetStatic",value:function(e,i,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];this.target=e,this.offset.copy(i),this.initOffset.copy(this.offset),this.cameraMoveType=t.MoveType.FOLLOW,this.moveTarget.addVectors(this.target.position,this.offset),s&&(this.cam.position.copy(this.moveTarget),this.cam.rotation.copy(n)),this.setOffsetAndRot(i,n),this.lookAtAlways=r}},{key:"lockMovementAxis",value:function(t,e){this.enableLockAxis=e,this.selectedLockAxis=t,this.lockVector=this.moveTarget.clone()}},{key:"setMoveTargetScalar",value:function(t,e){this.movetargetSkalar=e,this.selectedSkalarAxis=t}},{key:"setFollowTarget",value:function(e,i,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this.target=e,this.offset.copy(i),this.initOffset.copy(this.offset),this.cameraMoveType=t.MoveType.FOLLOW,this.moveTarget.addVectors(this.target.getCamHelperPos(),this.offset),s&&this.cam.position.copy(this.moveTarget),this.lookPos.copy(n),this.lookAtAlways=r}},{key:"changeTarget",value:function(t,e){this.target=t,e&&this.offset.copy(e)}},{key:"goPosAndLookAt",value:function(e,i,r){this.target=e,this.cam.position.copy(i),this.cameraMoveType=t.MoveType.FREE,this.lookAtAlways=!0,r&&this.cam.lookAt(e.getWorldPosition(new n.Vector3))}},{key:"setMoveAndRotTarget",value:function(e,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.moveTarget.copy(e),this.rotTarget.copy(i),n&&(this.cam.position.copy(e),this.cam.rotation.copy(i)),this.cameraMoveType=t.MoveType.LERP}},{key:"lerpToTarget",value:function(t){this.cam.position.lerp(this.moveTarget,this.moveSpeed*t),this.cam.rotation.x+=(this.rotTarget.x-this.cam.rotation.x)*this.moveSpeed*t,this.cam.rotation.y+=(this.rotTarget.y-this.cam.rotation.y)*this.moveSpeed*t,this.cam.rotation.z+=(this.rotTarget.z-this.cam.rotation.z)*this.moveSpeed*t}},{key:"checkLerpComplete",value:function(){return this.cam.position.manhattanDistanceTo(this.moveTarget)<.1}},{key:"followHelperObject",value:function(e){this.target=e,this.lookAtAlways=!1,this.cameraMoveType=t.MoveType.LOCK,this.lerpRotation=!0}},{key:"lerptoHelperTarget",value:function(t){this.target.getWorldPosition(this.moveTarget),this.cam.position.copy(this.moveTarget),this.target.getWorldQuaternion(this.cam.quaternion)}},{key:"setOffsetAndRot",value:function(t,e){this.offset.copy(t),this.rotTarget.copy(e),this.rotationQuaternion.setFromEuler(e)}},{key:"setOffset",value:function(t){this.offset.set(this.initOffset.x+t.x,this.initOffset.y+t.y,this.initOffset.z+t.z)}},{key:"shakeCamera",value:function(t,e,i){this.shakeEnabled=!0,this.shakeTimer=e,this.shakeForce=t,this.shakeTarget=i||this.cam}},{key:"setFov",value:function(t){this.cam.fov=t,this.cam.updateProjectionMatrix()}},{key:"setFovAnim",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"linear",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"none";return Object(r.a)({targets:this.cam,fov:t,duration:e,easing:i,direction:n,update:function(){s.a.main.camera.updateProjectionMatrix()}})}}])&&o(e.prototype,i),a&&o(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t}();l={FREE:0,LERP:1,FOLLOW:2,LOCK:3},(h="MoveType")in(a=u)?Object.defineProperty(a,h,{value:l,enumerable:!0,configurable:!0,writable:!0}):a[h]=l},function(t,e,i){"use strict";var n=i(0);class r extends n.Loader{constructor(t){super(t),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register((function(t){return new u(t)})),this.register((function(t){return new g(t)})),this.register((function(t){return new v(t)})),this.register((function(t){return new c(t)})),this.register((function(t){return new d(t)})),this.register((function(t){return new p(t)})),this.register((function(t){return new f(t)})),this.register((function(t){return new l(t)})),this.register((function(t){return new m(t)})),this.register((function(t){return new a(t)})),this.register((function(t){return new y(t)}))}load(t,e,i,r){const s=this;let o;o=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:n.LoaderUtils.extractUrlBase(t),this.manager.itemStart(t);const a=function(e){r&&r(e),s.manager.itemError(t),s.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{s.parse(i,o,(function(i){e(i),s.manager.itemEnd(t)}),a)}catch(t){a(t)}}),i,a)}setDRACOLoader(t){return this.dracoLoader=t,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(t){return this.ktx2Loader=t,this}setMeshoptDecoder(t){return this.meshoptDecoder=t,this}register(t){return-1===this.pluginCallbacks.indexOf(t)&&this.pluginCallbacks.push(t),this}unregister(t){return-1!==this.pluginCallbacks.indexOf(t)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(t),1),this}parse(t,e,i,r){let s;const a={},l={};if("string"==typeof t)s=t;else{if(n.LoaderUtils.decodeText(new Uint8Array(t,0,4))===x){try{a[o.KHR_BINARY_GLTF]=new A(t)}catch(t){return void(r&&r(t))}s=a[o.KHR_BINARY_GLTF].content}else s=n.LoaderUtils.decodeText(new Uint8Array(t))}const u=JSON.parse(s);if(void 0===u.asset||u.asset.version[0]<2)return void(r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.")));const c=new tt(u,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});c.fileLoader.setRequestHeader(this.requestHeader);for(let t=0;t<this.pluginCallbacks.length;t++){const e=this.pluginCallbacks[t](c);l[e.name]=e,a[e.name]=!0}if(u.extensionsUsed)for(let t=0;t<u.extensionsUsed.length;++t){const e=u.extensionsUsed[t],i=u.extensionsRequired||[];switch(e){case o.KHR_MATERIALS_UNLIT:a[e]=new h;break;case o.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:a[e]=new M;break;case o.KHR_DRACO_MESH_COMPRESSION:a[e]=new T(u,this.dracoLoader);break;case o.KHR_TEXTURE_TRANSFORM:a[e]=new S;break;case o.KHR_MESH_QUANTIZATION:a[e]=new _;break;default:i.indexOf(e)>=0&&l[e]}}c.setExtensions(a),c.setPlugins(l),c.parse(i,r)}parseAsync(t,e){const i=this;return new Promise((function(n,r){i.parse(t,e,n,r)}))}}function s(){let t={};return{get:function(e){return t[e]},add:function(e,i){t[e]=i},remove:function(e){delete t[e]},removeAll:function(){t={}}}}const o={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_IOR:"KHR_materials_ior",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression"};class a{constructor(t){this.parser=t,this.name=o.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const t=this.parser,e=this.parser.json.nodes||[];for(let i=0,n=e.length;i<n;i++){const n=e[i];n.extensions&&n.extensions[this.name]&&void 0!==n.extensions[this.name].light&&t._addNodeRef(this.cache,n.extensions[this.name].light)}}_loadLight(t){const e=this.parser,i="light:"+t;let r=e.cache.get(i);if(r)return r;const s=e.json,o=((s.extensions&&s.extensions[this.name]||{}).lights||[])[t];let a;const h=new n.Color(16777215);void 0!==o.color&&h.fromArray(o.color);const l=void 0!==o.range?o.range:0;switch(o.type){case"directional":a=new n.DirectionalLight(h),a.target.position.set(0,0,-1),a.add(a.target);break;case"point":a=new n.PointLight(h),a.distance=l;break;case"spot":a=new n.SpotLight(h),a.distance=l,o.spot=o.spot||{},o.spot.innerConeAngle=void 0!==o.spot.innerConeAngle?o.spot.innerConeAngle:0,o.spot.outerConeAngle=void 0!==o.spot.outerConeAngle?o.spot.outerConeAngle:Math.PI/4,a.angle=o.spot.outerConeAngle,a.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,a.target.position.set(0,0,-1),a.add(a.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return a.position.set(0,0,0),a.decay=2,void 0!==o.intensity&&(a.intensity=o.intensity),a.name=e.createUniqueName(o.name||"light_"+t),r=Promise.resolve(a),e.cache.add(i,r),r}createNodeAttachment(t){const e=this,i=this.parser,n=i.json.nodes[t],r=(n.extensions&&n.extensions[this.name]||{}).light;return void 0===r?null:this._loadLight(r).then((function(t){return i._getNodeRef(e.cache,r,t)}))}}class h{constructor(){this.name=o.KHR_MATERIALS_UNLIT}getMaterialType(){return n.MeshBasicMaterial}extendParams(t,e,i){const r=[];t.color=new n.Color(1,1,1),t.opacity=1;const s=e.pbrMetallicRoughness;if(s){if(Array.isArray(s.baseColorFactor)){const e=s.baseColorFactor;t.color.fromArray(e),t.opacity=e[3]}void 0!==s.baseColorTexture&&r.push(i.assignTexture(t,"map",s.baseColorTexture,n.sRGBEncoding))}return Promise.all(r)}}class l{constructor(t){this.parser=t,this.name=o.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(t,e){const i=this.parser.json.materials[t];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const n=i.extensions[this.name].emissiveStrength;return void 0!==n&&(e.emissiveIntensity=n),Promise.resolve()}}class u{constructor(t){this.parser=t,this.name=o.KHR_MATERIALS_CLEARCOAT}getMaterialType(t){const e=this.parser.json.materials[t];return e.extensions&&e.extensions[this.name]?n.MeshPhysicalMaterial:null}extendMaterialParams(t,e){const i=this.parser,r=i.json.materials[t];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];if(void 0!==o.clearcoatFactor&&(e.clearcoat=o.clearcoatFactor),void 0!==o.clearcoatTexture&&s.push(i.assignTexture(e,"clearcoatMap",o.clearcoatTexture)),void 0!==o.clearcoatRoughnessFactor&&(e.clearcoatRoughness=o.clearcoatRoughnessFactor),void 0!==o.clearcoatRoughnessTexture&&s.push(i.assignTexture(e,"clearcoatRoughnessMap",o.clearcoatRoughnessTexture)),void 0!==o.clearcoatNormalTexture&&(s.push(i.assignTexture(e,"clearcoatNormalMap",o.clearcoatNormalTexture)),void 0!==o.clearcoatNormalTexture.scale)){const t=o.clearcoatNormalTexture.scale;e.clearcoatNormalScale=new n.Vector2(t,t)}return Promise.all(s)}}class c{constructor(t){this.parser=t,this.name=o.KHR_MATERIALS_SHEEN}getMaterialType(t){const e=this.parser.json.materials[t];return e.extensions&&e.extensions[this.name]?n.MeshPhysicalMaterial:null}extendMaterialParams(t,e){const i=this.parser,r=i.json.materials[t];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[];e.sheenColor=new n.Color(0,0,0),e.sheenRoughness=0,e.sheen=1;const o=r.extensions[this.name];return void 0!==o.sheenColorFactor&&e.sheenColor.fromArray(o.sheenColorFactor),void 0!==o.sheenRoughnessFactor&&(e.sheenRoughness=o.sheenRoughnessFactor),void 0!==o.sheenColorTexture&&s.push(i.assignTexture(e,"sheenColorMap",o.sheenColorTexture,n.sRGBEncoding)),void 0!==o.sheenRoughnessTexture&&s.push(i.assignTexture(e,"sheenRoughnessMap",o.sheenRoughnessTexture)),Promise.all(s)}}class d{constructor(t){this.parser=t,this.name=o.KHR_MATERIALS_TRANSMISSION}getMaterialType(t){const e=this.parser.json.materials[t];return e.extensions&&e.extensions[this.name]?n.MeshPhysicalMaterial:null}extendMaterialParams(t,e){const i=this.parser,n=i.json.materials[t];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();const r=[],s=n.extensions[this.name];return void 0!==s.transmissionFactor&&(e.transmission=s.transmissionFactor),void 0!==s.transmissionTexture&&r.push(i.assignTexture(e,"transmissionMap",s.transmissionTexture)),Promise.all(r)}}class p{constructor(t){this.parser=t,this.name=o.KHR_MATERIALS_VOLUME}getMaterialType(t){const e=this.parser.json.materials[t];return e.extensions&&e.extensions[this.name]?n.MeshPhysicalMaterial:null}extendMaterialParams(t,e){const i=this.parser,r=i.json.materials[t];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];e.thickness=void 0!==o.thicknessFactor?o.thicknessFactor:0,void 0!==o.thicknessTexture&&s.push(i.assignTexture(e,"thicknessMap",o.thicknessTexture)),e.attenuationDistance=o.attenuationDistance||0;const a=o.attenuationColor||[1,1,1];return e.attenuationColor=new n.Color(a[0],a[1],a[2]),Promise.all(s)}}class f{constructor(t){this.parser=t,this.name=o.KHR_MATERIALS_IOR}getMaterialType(t){const e=this.parser.json.materials[t];return e.extensions&&e.extensions[this.name]?n.MeshPhysicalMaterial:null}extendMaterialParams(t,e){const i=this.parser.json.materials[t];if(!i.extensions||!i.extensions[this.name])return Promise.resolve();const n=i.extensions[this.name];return e.ior=void 0!==n.ior?n.ior:1.5,Promise.resolve()}}class m{constructor(t){this.parser=t,this.name=o.KHR_MATERIALS_SPECULAR}getMaterialType(t){const e=this.parser.json.materials[t];return e.extensions&&e.extensions[this.name]?n.MeshPhysicalMaterial:null}extendMaterialParams(t,e){const i=this.parser,r=i.json.materials[t];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();const s=[],o=r.extensions[this.name];e.specularIntensity=void 0!==o.specularFactor?o.specularFactor:1,void 0!==o.specularTexture&&s.push(i.assignTexture(e,"specularIntensityMap",o.specularTexture));const a=o.specularColorFactor||[1,1,1];return e.specularColor=new n.Color(a[0],a[1],a[2]),void 0!==o.specularColorTexture&&s.push(i.assignTexture(e,"specularColorMap",o.specularColorTexture,n.sRGBEncoding)),Promise.all(s)}}class g{constructor(t){this.parser=t,this.name=o.KHR_TEXTURE_BASISU}loadTexture(t){const e=this.parser,i=e.json,n=i.textures[t];if(!n.extensions||!n.extensions[this.name])return null;const r=n.extensions[this.name],s=e.options.ktx2Loader;if(!s){if(i.extensionsRequired&&i.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return e.loadTextureImage(t,r.source,s)}}class v{constructor(t){this.parser=t,this.name=o.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(t){const e=this.name,i=this.parser,n=i.json,r=n.textures[t];if(!r.extensions||!r.extensions[e])return null;const s=r.extensions[e],o=n.images[s.source];let a=i.textureLoader;if(o.uri){const t=i.options.manager.getHandler(o.uri);null!==t&&(a=t)}return this.detectSupport().then((function(r){if(r)return i.loadTextureImage(t,s.source,a);if(n.extensionsRequired&&n.extensionsRequired.indexOf(e)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return i.loadTexture(t)}))}detectSupport(){return this.isSupported||(this.isSupported=new Promise((function(t){const e=new Image;e.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",e.onload=e.onerror=function(){t(1===e.height)}}))),this.isSupported}}class y{constructor(t){this.name=o.EXT_MESHOPT_COMPRESSION,this.parser=t}loadBufferView(t){const e=this.parser.json,i=e.bufferViews[t];if(i.extensions&&i.extensions[this.name]){const t=i.extensions[this.name],n=this.parser.getDependency("buffer",t.buffer),r=this.parser.options.meshoptDecoder;if(!r||!r.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([n,r.ready]).then((function(e){const i=t.byteOffset||0,n=t.byteLength||0,s=t.count,o=t.byteStride,a=new ArrayBuffer(s*o),h=new Uint8Array(e[0],i,n);return r.decodeGltfBuffer(new Uint8Array(a),s,o,h,t.mode,t.filter),a}))}return null}}const x="glTF",w=1313821514,b=5130562;class A{constructor(t){this.name=o.KHR_BINARY_GLTF,this.content=null,this.body=null;const 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!==x)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const i=this.header.length-12,r=new DataView(t,12);let s=0;for(;s<i;){const e=r.getUint32(s,!0);s+=4;const i=r.getUint32(s,!0);if(s+=4,i===w){const i=new Uint8Array(t,12+s,e);this.content=n.LoaderUtils.decodeText(i)}else if(i===b){const i=12+s;this.body=t.slice(i,i+e)}s+=e}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class T{constructor(t,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=o.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=e,this.dracoLoader.preload()}decodePrimitive(t,e){const i=this.json,n=this.dracoLoader,r=t.extensions[this.name].bufferView,s=t.extensions[this.name].attributes,o={},a={},h={};for(const t in s){const e=H[t]||t.toLowerCase();o[e]=s[t]}for(const e in t.attributes){const n=H[e]||e.toLowerCase();if(void 0!==s[e]){const r=i.accessors[t.attributes[e]],s=N[r.componentType];h[n]=s,a[n]=!0===r.normalized}}return e.getDependency("bufferView",r).then((function(t){return new Promise((function(e){n.decodeDracoFile(t,(function(t){for(const e in t.attributes){const i=t.attributes[e],n=a[e];void 0!==n&&(i.normalized=n)}e(t)}),o,h)}))}))}}class S{constructor(){this.name=o.KHR_TEXTURE_TRANSFORM}extendTexture(t,e){return e.texCoord,void 0===e.offset&&void 0===e.rotation&&void 0===e.scale||(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),t.needsUpdate=!0),t}}class E extends n.MeshStandardMaterial{constructor(t){super(),this.isGLTFSpecularGlossinessMaterial=!0;const e=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),i=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),r=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),s=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),o=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.roughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.","material.roughness += geometryRoughness;","material.roughness = min( material.roughness, 1.0 );","material.specularColor = specularFactor;"].join("\n"),a={specular:{value:(new n.Color).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=a,this.onBeforeCompile=function(t){for(const e in a)t.uniforms[e]=a[e];t.fragmentShader=t.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",e).replace("#include <metalnessmap_pars_fragment>",i).replace("#include <roughnessmap_fragment>",r).replace("#include <metalnessmap_fragment>",s).replace("#include <lights_physical_fragment>",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)}copy(t){return super.copy(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}}class M{constructor(){this.name=o.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,this.specularGlossinessParams=["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity"]}getMaterialType(){return E}extendParams(t,e,i){const r=e.extensions[this.name];t.color=new n.Color(1,1,1),t.opacity=1;const s=[];if(Array.isArray(r.diffuseFactor)){const e=r.diffuseFactor;t.color.fromArray(e),t.opacity=e[3]}if(void 0!==r.diffuseTexture&&s.push(i.assignTexture(t,"map",r.diffuseTexture,n.sRGBEncoding)),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){const e=r.specularGlossinessTexture;s.push(i.assignTexture(t,"glossinessMap",e)),s.push(i.assignTexture(t,"specularMap",e,n.sRGBEncoding))}return Promise.all(s)}createMaterial(t){const e=new E(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=void 0===t.emissiveIntensity?1:t.emissiveIntensity,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}}class _{constructor(){this.name=o.KHR_MESH_QUANTIZATION}}class C extends n.Interpolant{constructor(t,e,i,n){super(t,e,i,n)}copySampleValue_(t){const e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=t*n*3+n;for(let t=0;t!==n;t++)e[t]=i[r+t];return e}}C.prototype.beforeStart_=C.prototype.copySampleValue_,C.prototype.afterEnd_=C.prototype.copySampleValue_,C.prototype.interpolate_=function(t,e,i,n){const r=this.resultBuffer,s=this.sampleValues,o=this.valueSize,a=2*o,h=3*o,l=n-e,u=(i-e)/l,c=u*u,d=c*u,p=t*h,f=p-h,m=-2*d+3*c,g=d-c,v=1-m,y=g-c+u;for(let t=0;t!==o;t++){const e=s[f+t+o],i=s[f+t+a]*l,n=s[p+t+o],h=s[p+t]*l;r[t]=v*e+y*i+m*n+g*h}return r};const P=new n.Quaternion;class R extends C{interpolate_(t,e,i,n){const r=super.interpolate_(t,e,i,n);return P.fromArray(r).normalize().toArray(r),r}}const L=0,O=1,D=2,B=3,I=4,F=5,k=6,N={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},z={9728:n.NearestFilter,9729:n.LinearFilter,9984:n.NearestMipmapNearestFilter,9985:n.LinearMipmapNearestFilter,9986:n.NearestMipmapLinearFilter,9987:n.LinearMipmapLinearFilter},U={33071:n.ClampToEdgeWrapping,33648:n.MirroredRepeatWrapping,10497:n.RepeatWrapping},V={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},H={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},G={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},W={CUBICSPLINE:void 0,LINEAR:n.InterpolateLinear,STEP:n.InterpolateDiscrete},Y="OPAQUE",X="MASK",j="BLEND";function q(t,e,i){for(const n in i.extensions)void 0===t[n]&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=i.extensions[n])}function Q(t,e){void 0!==e.extras&&"object"==typeof e.extras&&Object.assign(t.userData,e.extras)}function K(t,e){if(t.updateMorphTargets(),void 0!==e.weights)for(let i=0,n=e.weights.length;i<n;i++)t.morphTargetInfluences[i]=e.weights[i];if(e.extras&&Array.isArray(e.extras.targetNames)){const i=e.extras.targetNames;if(t.morphTargetInfluences.length===i.length){t.morphTargetDictionary={};for(let e=0,n=i.length;e<n;e++)t.morphTargetDictionary[i[e]]=e}}}function J(t){const e=t.extensions&&t.extensions[o.KHR_DRACO_MESH_COMPRESSION];let i;return i=e?"draco:"+e.bufferView+":"+e.indices+":"+Z(e.attributes):t.indices+":"+Z(t.attributes)+":"+t.mode,i}function Z(t){let e="";const i=Object.keys(t).sort();for(let n=0,r=i.length;n<r;n++)e+=i[n]+":"+t[i[n]]+";";return e}function $(t){switch(t){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}class tt{constructor(t={},e={}){this.json=t,this.extensions={},this.plugins={},this.options=e,this.cache=new s,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};const i=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),r=navigator.userAgent.indexOf("Firefox")>-1,o=r?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1;"undefined"==typeof createImageBitmap||i||r&&o<98?this.textureLoader=new n.TextureLoader(this.options.manager):this.textureLoader=new n.ImageBitmapLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new n.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}setExtensions(t){this.extensions=t}setPlugins(t){this.plugins=t}parse(t,e){const i=this,n=this.json,r=this.extensions;this.cache.removeAll(),this._invokeAll((function(t){return t._markDefs&&t._markDefs()})),Promise.all(this._invokeAll((function(t){return t.beforeRoot&&t.beforeRoot()}))).then((function(){return Promise.all([i.getDependencies("scene"),i.getDependencies("animation"),i.getDependencies("camera")])})).then((function(e){const s={scene:e[0][n.scene||0],scenes:e[0],animations:e[1],cameras:e[2],asset:n.asset,parser:i,userData:{}};q(r,s,n),Q(s,n),Promise.all(i._invokeAll((function(t){return t.afterRoot&&t.afterRoot(s)}))).then((function(){t(s)}))})).catch(e)}_markDefs(){const t=this.json.nodes||[],e=this.json.skins||[],i=this.json.meshes||[];for(let i=0,n=e.length;i<n;i++){const n=e[i].joints;for(let e=0,i=n.length;e<i;e++)t[n[e]].isBone=!0}for(let e=0,n=t.length;e<n;e++){const n=t[e];void 0!==n.mesh&&(this._addNodeRef(this.meshCache,n.mesh),void 0!==n.skin&&(i[n.mesh].isSkinnedMesh=!0)),void 0!==n.camera&&this._addNodeRef(this.cameraCache,n.camera)}}_addNodeRef(t,e){void 0!==e&&(void 0===t.refs[e]&&(t.refs[e]=t.uses[e]=0),t.refs[e]++)}_getNodeRef(t,e,i){if(t.refs[e]<=1)return i;const n=i.clone(),r=(t,e)=>{const i=this.associations.get(t);null!=i&&this.associations.set(e,i);for(const[i,n]of t.children.entries())r(n,e.children[i])};return r(i,n),n.name+="_instance_"+t.uses[e]++,n}_invokeOne(t){const e=Object.values(this.plugins);e.push(this);for(let i=0;i<e.length;i++){const n=t(e[i]);if(n)return n}return null}_invokeAll(t){const e=Object.values(this.plugins);e.unshift(this);const i=[];for(let n=0;n<e.length;n++){const r=t(e[n]);r&&i.push(r)}return i}getDependency(t,e){const i=t+":"+e;let n=this.cache.get(i);if(!n){switch(t){case"scene":n=this.loadScene(e);break;case"node":n=this.loadNode(e);break;case"mesh":n=this._invokeOne((function(t){return t.loadMesh&&t.loadMesh(e)}));break;case"accessor":n=this.loadAccessor(e);break;case"bufferView":n=this._invokeOne((function(t){return t.loadBufferView&&t.loadBufferView(e)}));break;case"buffer":n=this.loadBuffer(e);break;case"material":n=this._invokeOne((function(t){return t.loadMaterial&&t.loadMaterial(e)}));break;case"texture":n=this._invokeOne((function(t){return t.loadTexture&&t.loadTexture(e)}));break;case"skin":n=this.loadSkin(e);break;case"animation":n=this._invokeOne((function(t){return t.loadAnimation&&t.loadAnimation(e)}));break;case"camera":n=this.loadCamera(e);break;default:throw new Error("Unknown type: "+t)}this.cache.add(i,n)}return n}getDependencies(t){let e=this.cache.get(t);if(!e){const i=this,n=this.json[t+("mesh"===t?"es":"s")]||[];e=Promise.all(n.map((function(e,n){return i.getDependency(t,n)}))),this.cache.add(t,e)}return e}loadBuffer(t){const e=this.json.buffers[t],i=this.fileLoader;if(e.type&&"arraybuffer"!==e.type)throw new Error("THREE.GLTFLoader: "+e.type+" buffer type is not supported.");if(void 0===e.uri&&0===t)return Promise.resolve(this.extensions[o.KHR_BINARY_GLTF].body);const r=this.options;return new Promise((function(t,s){i.load(n.LoaderUtils.resolveURL(e.uri,r.path),t,void 0,(function(){s(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))}))}))}loadBufferView(t){const e=this.json.bufferViews[t];return this.getDependency("buffer",e.buffer).then((function(t){const i=e.byteLength||0,n=e.byteOffset||0;return t.slice(n,n+i)}))}loadAccessor(t){const e=this,i=this.json,r=this.json.accessors[t];if(void 0===r.bufferView&&void 0===r.sparse)return Promise.resolve(null);const s=[];return void 0!==r.bufferView?s.push(this.getDependency("bufferView",r.bufferView)):s.push(null),void 0!==r.sparse&&(s.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),s.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(s).then((function(t){const s=t[0],o=V[r.type],a=N[r.componentType],h=a.BYTES_PER_ELEMENT,l=h*o,u=r.byteOffset||0,c=void 0!==r.bufferView?i.bufferViews[r.bufferView].byteStride:void 0,d=!0===r.normalized;let p,f;if(c&&c!==l){const t=Math.floor(u/c),i="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+t+":"+r.count;let l=e.cache.get(i);l||(p=new a(s,t*c,r.count*c/h),l=new n.InterleavedBuffer(p,c/h),e.cache.add(i,l)),f=new n.InterleavedBufferAttribute(l,o,u%c/h,d)}else p=null===s?new a(r.count*o):new a(s,u,r.count*o),f=new n.BufferAttribute(p,o,d);if(void 0!==r.sparse){const e=V.SCALAR,i=N[r.sparse.indices.componentType],h=r.sparse.indices.byteOffset||0,l=r.sparse.values.byteOffset||0,u=new i(t[1],h,r.sparse.count*e),c=new a(t[2],l,r.sparse.count*o);null!==s&&(f=new n.BufferAttribute(f.array.slice(),f.itemSize,f.normalized));for(let t=0,e=u.length;t<e;t++){const e=u[t];if(f.setX(e,c[t*o]),o>=2&&f.setY(e,c[t*o+1]),o>=3&&f.setZ(e,c[t*o+2]),o>=4&&f.setW(e,c[t*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return f}))}loadTexture(t){const e=this.json,i=this.options,n=e.textures[t].source,r=e.images[n];let s=this.textureLoader;if(r.uri){const t=i.manager.getHandler(r.uri);null!==t&&(s=t)}return this.loadTextureImage(t,n,s)}loadTextureImage(t,e,i){const r=this,s=this.json,o=s.textures[t],a=s.images[e],h=(a.uri||a.bufferView)+":"+o.sampler;if(this.textureCache[h])return this.textureCache[h];const l=this.loadImageSource(e,i).then((function(e){e.flipY=!1,o.name&&(e.name=o.name);const i=(s.samplers||{})[o.sampler]||{};return e.magFilter=z[i.magFilter]||n.LinearFilter,e.minFilter=z[i.minFilter]||n.LinearMipmapLinearFilter,e.wrapS=U[i.wrapS]||n.RepeatWrapping,e.wrapT=U[i.wrapT]||n.RepeatWrapping,r.associations.set(e,{textures:t}),e})).catch((function(){return null}));return this.textureCache[h]=l,l}loadImageSource(t,e){const i=this,r=this.json,s=this.options;if(void 0!==this.sourceCache[t])return this.sourceCache[t].then(t=>t.clone());const o=r.images[t],a=self.URL||self.webkitURL;let h=o.uri||"",l=!1;if(void 0!==o.bufferView)h=i.getDependency("bufferView",o.bufferView).then((function(t){l=!0;const e=new Blob([t],{type:o.mimeType});return h=a.createObjectURL(e),h}));else if(void 0===o.uri)throw new Error("THREE.GLTFLoader: Image "+t+" is missing URI and bufferView");const u=Promise.resolve(h).then((function(t){return new Promise((function(i,r){let o=i;!0===e.isImageBitmapLoader&&(o=function(t){const e=new n.Texture(t);e.needsUpdate=!0,i(e)}),e.load(n.LoaderUtils.resolveURL(t,s.path),o,void 0,r)}))})).then((function(t){var e;return!0===l&&a.revokeObjectURL(h),t.userData.mimeType=o.mimeType||((e=o.uri).search(/\.jpe?g($|\?)/i)>0||0===e.search(/^data\:image\/jpeg/)?"image/jpeg":e.search(/\.webp($|\?)/i)>0||0===e.search(/^data\:image\/webp/)?"image/webp":"image/png"),t})).catch((function(t){throw t}));return this.sourceCache[t]=u,u}assignTexture(t,e,i,n){const r=this;return this.getDependency("texture",i.index).then((function(s){if(void 0!==i.texCoord&&0!=i.texCoord&&("aoMap"!==e||i.texCoord),r.extensions[o.KHR_TEXTURE_TRANSFORM]){const t=void 0!==i.extensions?i.extensions[o.KHR_TEXTURE_TRANSFORM]:void 0;if(t){const e=r.associations.get(s);s=r.extensions[o.KHR_TEXTURE_TRANSFORM].extendTexture(s,t),r.associations.set(s,e)}}return void 0!==n&&(s.encoding=n),t[e]=s,s}))}assignFinalMaterial(t){const e=t.geometry;let i=t.material;const r=void 0===e.attributes.tangent,s=void 0!==e.attributes.color,o=void 0===e.attributes.normal;if(t.isPoints){const t="PointsMaterial:"+i.uuid;let e=this.cache.get(t);e||(e=new n.PointsMaterial,n.Material.prototype.copy.call(e,i),e.color.copy(i.color),e.map=i.map,e.sizeAttenuation=!1,this.cache.add(t,e)),i=e}else if(t.isLine){const t="LineBasicMaterial:"+i.uuid;let e=this.cache.get(t);e||(e=new n.LineBasicMaterial,n.Material.prototype.copy.call(e,i),e.color.copy(i.color),this.cache.add(t,e)),i=e}if(r||s||o){let t="ClonedMaterial:"+i.uuid+":";i.isGLTFSpecularGlossinessMaterial&&(t+="specular-glossiness:"),r&&(t+="derivative-tangents:"),s&&(t+="vertex-colors:"),o&&(t+="flat-shading:");let e=this.cache.get(t);e||(e=i.clone(),s&&(e.vertexColors=!0),o&&(e.flatShading=!0),r&&(e.normalScale&&(e.normalScale.y*=-1),e.clearcoatNormalScale&&(e.clearcoatNormalScale.y*=-1)),this.cache.add(t,e),this.associations.set(e,this.associations.get(i))),i=e}i.aoMap&&void 0===e.attributes.uv2&&void 0!==e.attributes.uv&&e.setAttribute("uv2",e.attributes.uv),t.material=i}getMaterialType(){return n.MeshStandardMaterial}loadMaterial(t){const e=this,i=this.json,r=this.extensions,s=i.materials[t];let a;const h={},l=s.extensions||{},u=[];if(l[o.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){const t=r[o.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];a=t.getMaterialType(),u.push(t.extendParams(h,s,e))}else if(l[o.KHR_MATERIALS_UNLIT]){const t=r[o.KHR_MATERIALS_UNLIT];a=t.getMaterialType(),u.push(t.extendParams(h,s,e))}else{const i=s.pbrMetallicRoughness||{};if(h.color=new n.Color(1,1,1),h.opacity=1,Array.isArray(i.baseColorFactor)){const t=i.baseColorFactor;h.color.fromArray(t),h.opacity=t[3]}void 0!==i.baseColorTexture&&u.push(e.assignTexture(h,"map",i.baseColorTexture,n.sRGBEncoding)),h.metalness=void 0!==i.metallicFactor?i.metallicFactor:1,h.roughness=void 0!==i.roughnessFactor?i.roughnessFactor:1,void 0!==i.metallicRoughnessTexture&&(u.push(e.assignTexture(h,"metalnessMap",i.metallicRoughnessTexture)),u.push(e.assignTexture(h,"roughnessMap",i.metallicRoughnessTexture))),a=this._invokeOne((function(e){return e.getMaterialType&&e.getMaterialType(t)})),u.push(Promise.all(this._invokeAll((function(e){return e.extendMaterialParams&&e.extendMaterialParams(t,h)}))))}!0===s.doubleSided&&(h.side=n.DoubleSide);const c=s.alphaMode||Y;if(c===j?(h.transparent=!0,h.depthWrite=!1):(h.transparent=!1,c===X&&(h.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&a!==n.MeshBasicMaterial&&(u.push(e.assignTexture(h,"normalMap",s.normalTexture)),h.normalScale=new n.Vector2(1,1),void 0!==s.normalTexture.scale)){const t=s.normalTexture.scale;h.normalScale.set(t,t)}return void 0!==s.occlusionTexture&&a!==n.MeshBasicMaterial&&(u.push(e.assignTexture(h,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(h.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&a!==n.MeshBasicMaterial&&(h.emissive=(new n.Color).fromArray(s.emissiveFactor)),void 0!==s.emissiveTexture&&a!==n.MeshBasicMaterial&&u.push(e.assignTexture(h,"emissiveMap",s.emissiveTexture,n.sRGBEncoding)),Promise.all(u).then((function(){let i;return i=a===E?r[o.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(h):new a(h),s.name&&(i.name=s.name),Q(i,s),e.associations.set(i,{materials:t}),s.extensions&&q(r,i,s),i}))}createUniqueName(t){const e=n.PropertyBinding.sanitizeNodeName(t||"");let i=e;for(let t=1;this.nodeNamesUsed[i];++t)i=e+"_"+t;return this.nodeNamesUsed[i]=!0,i}loadGeometries(t){const e=this,i=this.extensions,r=this.primitiveCache;function s(t){return i[o.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(t,e).then((function(i){return it(i,t,e)}))}const a=[];for(let i=0,h=t.length;i<h;i++){const h=t[i],l=J(h),u=r[l];if(u)a.push(u.promise);else{let t;t=h.extensions&&h.extensions[o.KHR_DRACO_MESH_COMPRESSION]?s(h):it(new n.BufferGeometry,h,e),r[l]={primitive:h,promise:t},a.push(t)}}return Promise.all(a)}loadMesh(t){const e=this,i=this.json,r=this.extensions,s=i.meshes[t],o=s.primitives,a=[];for(let t=0,e=o.length;t<e;t++){const e=void 0===o[t].material?(void 0===(h=this.cache).DefaultMaterial&&(h.DefaultMaterial=new n.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:n.FrontSide})),h.DefaultMaterial):this.getDependency("material",o[t].material);a.push(e)}var h;return a.push(e.loadGeometries(o)),Promise.all(a).then((function(i){const a=i.slice(0,i.length-1),h=i[i.length-1],l=[];for(let i=0,u=h.length;i<u;i++){const u=h[i],c=o[i];let d;const p=a[i];if(c.mode===I||c.mode===F||c.mode===k||void 0===c.mode)d=!0===s.isSkinnedMesh?new n.SkinnedMesh(u,p):new n.Mesh(u,p),!0!==d.isSkinnedMesh||d.geometry.attributes.skinWeight.normalized||d.normalizeSkinWeights(),c.mode===F?d.geometry=nt(d.geometry,n.TriangleStripDrawMode):c.mode===k&&(d.geometry=nt(d.geometry,n.TriangleFanDrawMode));else if(c.mode===O)d=new n.LineSegments(u,p);else if(c.mode===B)d=new n.Line(u,p);else if(c.mode===D)d=new n.LineLoop(u,p);else{if(c.mode!==L)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+c.mode);d=new n.Points(u,p)}Object.keys(d.geometry.morphAttributes).length>0&&K(d,s),d.name=e.createUniqueName(s.name||"mesh_"+t),Q(d,s),c.extensions&&q(r,d,c),e.assignFinalMaterial(d),l.push(d)}for(let i=0,n=l.length;i<n;i++)e.associations.set(l[i],{meshes:t,primitives:i});if(1===l.length)return l[0];const u=new n.Group;e.associations.set(u,{meshes:t});for(let t=0,e=l.length;t<e;t++)u.add(l[t]);return u}))}loadCamera(t){let e;const i=this.json.cameras[t],r=i[i.type];if(r)return"perspective"===i.type?e=new n.PerspectiveCamera(n.MathUtils.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):"orthographic"===i.type&&(e=new n.OrthographicCamera(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),i.name&&(e.name=this.createUniqueName(i.name)),Q(e,i),Promise.resolve(e)}loadSkin(t){const e=this.json.skins[t],i={joints:e.joints};return void 0===e.inverseBindMatrices?Promise.resolve(i):this.getDependency("accessor",e.inverseBindMatrices).then((function(t){return i.inverseBindMatrices=t,i}))}loadAnimation(t){const e=this.json.animations[t],i=[],r=[],s=[],o=[],a=[];for(let t=0,n=e.channels.length;t<n;t++){const n=e.channels[t],h=e.samplers[n.sampler],l=n.target,u=void 0!==l.node?l.node:l.id,c=void 0!==e.parameters?e.parameters[h.input]:h.input,d=void 0!==e.parameters?e.parameters[h.output]:h.output;i.push(this.getDependency("node",u)),r.push(this.getDependency("accessor",c)),s.push(this.getDependency("accessor",d)),o.push(h),a.push(l)}return Promise.all([Promise.all(i),Promise.all(r),Promise.all(s),Promise.all(o),Promise.all(a)]).then((function(i){const r=i[0],s=i[1],o=i[2],a=i[3],h=i[4],l=[];for(let t=0,e=r.length;t<e;t++){const e=r[t],i=s[t],u=o[t],c=a[t],d=h[t];if(void 0===e)continue;let p;switch(e.updateMatrix(),e.matrixAutoUpdate=!0,G[d.path]){case G.weights:p=n.NumberKeyframeTrack;break;case G.rotation:p=n.QuaternionKeyframeTrack;break;case G.position:case G.scale:default:p=n.VectorKeyframeTrack}const f=e.name?e.name:e.uuid,m=void 0!==c.interpolation?W[c.interpolation]:n.InterpolateLinear,g=[];G[d.path]===G.weights?e.traverse((function(t){t.morphTargetInfluences&&g.push(t.name?t.name:t.uuid)})):g.push(f);let v=u.array;if(u.normalized){const t=$(v.constructor),e=new Float32Array(v.length);for(let i=0,n=v.length;i<n;i++)e[i]=v[i]*t;v=e}for(let t=0,e=g.length;t<e;t++){const e=new p(g[t]+"."+G[d.path],i.array,v,m);"CUBICSPLINE"===c.interpolation&&(e.createInterpolant=function(t){return new(this instanceof n.QuaternionKeyframeTrack?R:C)(this.times,this.values,this.getValueSize()/3,t)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),l.push(e)}}const u=e.name?e.name:"animation_"+t;return new n.AnimationClip(u,void 0,l)}))}createNodeMesh(t){const e=this.json,i=this,n=e.nodes[t];return void 0===n.mesh?null:i.getDependency("mesh",n.mesh).then((function(t){const e=i._getNodeRef(i.meshCache,n.mesh,t);return void 0!==n.weights&&e.traverse((function(t){if(t.isMesh)for(let e=0,i=n.weights.length;e<i;e++)t.morphTargetInfluences[e]=n.weights[e]})),e}))}loadNode(t){const e=this.json,i=this.extensions,r=this,s=e.nodes[t],o=s.name?r.createUniqueName(s.name):"";return function(){const e=[],i=r._invokeOne((function(e){return e.createNodeMesh&&e.createNodeMesh(t)}));return i&&e.push(i),void 0!==s.camera&&e.push(r.getDependency("camera",s.camera).then((function(t){return r._getNodeRef(r.cameraCache,s.camera,t)}))),r._invokeAll((function(e){return e.createNodeAttachment&&e.createNodeAttachment(t)})).forEach((function(t){e.push(t)})),Promise.all(e)}().then((function(e){let a;if(a=!0===s.isBone?new n.Bone:e.length>1?new n.Group:1===e.length?e[0]:new n.Object3D,a!==e[0])for(let t=0,i=e.length;t<i;t++)a.add(e[t]);if(s.name&&(a.userData.name=s.name,a.name=o),Q(a,s),s.extensions&&q(i,a,s),void 0!==s.matrix){const t=new n.Matrix4;t.fromArray(s.matrix),a.applyMatrix4(t)}else void 0!==s.translation&&a.position.fromArray(s.translation),void 0!==s.rotation&&a.quaternion.fromArray(s.rotation),void 0!==s.scale&&a.scale.fromArray(s.scale);return r.associations.has(a)||r.associations.set(a,{}),r.associations.get(a).nodes=t,a}))}loadScene(t){const e=this.json,i=this.extensions,r=this.json.scenes[t],s=this,o=new n.Group;r.name&&(o.name=s.createUniqueName(r.name)),Q(o,r),r.extensions&&q(i,o,r);const a=r.nodes||[],h=[];for(let t=0,i=a.length;t<i;t++)h.push(et(a[t],o,e,s));return Promise.all(h).then((function(){return s.associations=(t=>{const e=new Map;for(const[t,i]of s.associations)(t instanceof n.Material||t instanceof n.Texture)&&e.set(t,i);return t.traverse(t=>{const i=s.associations.get(t);null!=i&&e.set(t,i)}),e})(o),o}))}}function et(t,e,i,r){const s=i.nodes[t];return r.getDependency("node",t).then((function(t){if(void 0===s.skin)return t;let e;return r.getDependency("skin",s.skin).then((function(t){e=t;const i=[];for(let t=0,n=e.joints.length;t<n;t++)i.push(r.getDependency("node",e.joints[t]));return Promise.all(i)})).then((function(i){return t.traverse((function(t){if(!t.isMesh)return;const r=[],s=[];for(let t=0,o=i.length;t<o;t++){const o=i[t];if(o){r.push(o);const i=new n.Matrix4;void 0!==e.inverseBindMatrices&&i.fromArray(e.inverseBindMatrices.array,16*t),s.push(i)}}t.bind(new n.Skeleton(r,s),t.matrixWorld)})),t}))})).then((function(t){e.add(t);const n=[];if(s.children){const e=s.children;for(let s=0,o=e.length;s<o;s++){const o=e[s];n.push(et(o,t,i,r))}}return Promise.all(n)}))}function it(t,e,i){const r=e.attributes,s=[];function o(e,n){return i.getDependency("accessor",e).then((function(e){t.setAttribute(n,e)}))}for(const e in r){const i=H[e]||e.toLowerCase();i in t.attributes||s.push(o(r[e],i))}if(void 0!==e.indices&&!t.index){const n=i.getDependency("accessor",e.indices).then((function(e){t.setIndex(e)}));s.push(n)}return Q(t,e),function(t,e,i){const r=e.attributes,s=new n.Box3;if(void 0===r.POSITION)return;{const t=i.json.accessors[r.POSITION],e=t.min,o=t.max;if(void 0===e||void 0===o)return;if(s.set(new n.Vector3(e[0],e[1],e[2]),new n.Vector3(o[0],o[1],o[2])),t.normalized){const e=$(N[t.componentType]);s.min.multiplyScalar(e),s.max.multiplyScalar(e)}}const o=e.targets;if(void 0!==o){const t=new n.Vector3,e=new n.Vector3;for(let n=0,r=o.length;n<r;n++){const r=o[n];if(void 0!==r.POSITION){const n=i.json.accessors[r.POSITION],s=n.min,o=n.max;if(void 0!==s&&void 0!==o){if(e.setX(Math.max(Math.abs(s[0]),Math.abs(o[0]))),e.setY(Math.max(Math.abs(s[1]),Math.abs(o[1]))),e.setZ(Math.max(Math.abs(s[2]),Math.abs(o[2]))),n.normalized){const t=$(N[n.componentType]);e.multiplyScalar(t)}t.max(e)}}}s.expandByVector(t)}t.boundingBox=s;const a=new n.Sphere;s.getCenter(a.center),a.radius=s.min.distanceTo(s.max)/2,t.boundingSphere=a}(t,e,i),Promise.all(s).then((function(){return void 0!==e.targets?function(t,e,i){let n=!1,r=!1,s=!1;for(let t=0,i=e.length;t<i;t++){const i=e[t];if(void 0!==i.POSITION&&(n=!0),void 0!==i.NORMAL&&(r=!0),void 0!==i.COLOR_0&&(s=!0),n&&r&&s)break}if(!n&&!r&&!s)return Promise.resolve(t);const o=[],a=[],h=[];for(let l=0,u=e.length;l<u;l++){const u=e[l];if(n){const e=void 0!==u.POSITION?i.getDependency("accessor",u.POSITION):t.attributes.position;o.push(e)}if(r){const e=void 0!==u.NORMAL?i.getDependency("accessor",u.NORMAL):t.attributes.normal;a.push(e)}if(s){const e=void 0!==u.COLOR_0?i.getDependency("accessor",u.COLOR_0):t.attributes.color;h.push(e)}}return Promise.all([Promise.all(o),Promise.all(a),Promise.all(h)]).then((function(e){const i=e[0],o=e[1],a=e[2];return n&&(t.morphAttributes.position=i),r&&(t.morphAttributes.normal=o),s&&(t.morphAttributes.color=a),t.morphTargetsRelative=!0,t}))}(t,e.targets,i):t}))}function nt(t,e){let i=t.getIndex();if(null===i){const e=[],n=t.getAttribute("position");if(void 0===n)return t;for(let t=0;t<n.count;t++)e.push(t);t.setIndex(e),i=t.getIndex()}const r=i.count-2,s=[];if(e===n.TriangleFanDrawMode)for(let t=1;t<=r;t++)s.push(i.getX(0)),s.push(i.getX(t)),s.push(i.getX(t+1));else for(let t=0;t<r;t++)t%2==0?(s.push(i.getX(t)),s.push(i.getX(t+1)),s.push(i.getX(t+2))):(s.push(i.getX(t+2)),s.push(i.getX(t+1)),s.push(i.getX(t)));s.length;const o=t.clone();return o.setIndex(s),o}var rt=i(1);function st(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var ot=new n.TextureLoader,at=new r,ht=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,n;return e=t,n=[{key:"loadTextures",value:function(t,e){if(0!=t.length){rt.a.textures||(rt.a.textures={});var i=0;t.forEach((function(n,r){ot.load(n.path,(function(r){n.map=r,rt.a.textures[n.name]=r,++i>=t.length&&e()}),void 0,(function(t){}))}))}else e()}},{key:"loadModels",value:function(t,e){if(0!=t.length){rt.a.models||(rt.a.models={});var i=0,n=function(){++i>=t.length&&e()};t.forEach((function(t,e){rt.a.models[t.name]?n():at.load(t.path,(function(e){rt.a.models[t.name]=e,n()}),(function(t){}),(function(t){}))}))}else e()}}],(i=null)&&st(e.prototype,i),n&&st(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.a=ht},function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return m}));var n=i(5),r=i(1),s=i(9),o=i(3),a=i(16),h=i(0),l=i(19),u=i(13),c=i(6),d=i(10),p=i(2);function f(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var m=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.gameObjects=[],this.levelModelName="level"+e,this.options={bgTop:this.getAttribute("_bgTop"),bgBottom:this.getAttribute("_bgBottom"),floorColor1:this.getAttribute("_floorColor1"),floorColor2:this.getAttribute("_floorColor2"),metalness:this.getAttribute("_floorMetalness"),coinPlacementType:this.getAttribute("_coinPlacementType")}}var e,i,m;return e=t,(i=[{key:"getAttribute",value:function(t){var e=r.a.data[this.levelModelName+t];return e||(e=null),e}},{key:"init",value:function(){n.a.setGradientBgColor([this.options.bgTop,this.options.bgBottom]),o.a.init(),this.initLevel(this.levelModelName)}},{key:"initLevel",value:function(t){var e=this;r.a.postprocessEnabled&&(u.a.brightnessEffect.contrast=0);var i=function(t){e.options.metalness&&(t.material.metalness=e.options.metalness),e.options.floorColor1&&e.options.floorColor2&&(t.material.name.includes("Platform_Color1")?(t.material.color.set(e.options.floorColor1),t.material.color.convertSRGBToLinear()):t.material.name.includes("Platform_Color2")&&(t.material.color.set(e.options.floorColor2),t.material.color.convertSRGBToLinear()))};this.levelPlayer=new s.a(t,0,i),this.levelPlayer.addFinalPlatform(!1);var n=this.levelPlayer.startObj.position.clone(),c=new a.a(new h.Vector3(n.x,2,0),"char",0);o.a.player=c,this.levelPlayer.setLevelPlayer(c),this.levelPlayer.addGameLogo(n),this.levelOpponent=new s.a(t,o.a.diffBetweenPlatforms,i);var d=new l.a(new h.Vector3(n.x,2,o.a.diffBetweenPlatforms),"char",1);o.a.enemy=d,this.levelOpponent.addFinalPlatform(!0),this.levelOpponent.setLevelPlayer(d),this.levelPlayer.initCoins(this.options.coinPlacementType)}},{key:"initDummyBox",value:function(){var t=c.a.createBox({w:30,h:3,d:2});t.material.color.set("#00ff00"),t.material.transparent=!0,t.material.opacity=.5,t.position.set(0,4,0);var e=d.a.createBodyFromObj(t,{mass:0,type:p.Body.STATIC});e.material=o.a.kontakMaterials.hard,e.colType=o.a.colTypes.PLATFORM,e.touchmate=!0,o.a.rayableList.push(t)}}])&&f(e.prototype,i),m&&f(e,m),Object.defineProperty(e,"prototype",{writable:!1}),t}()},function(t,e,i){"use strict";i.d(e,"a",(function(){return x}));var n=i(0),r=i(2),s=i(1),o=i(3),a=i(14),h=(i(5),i(7)),l=i(8),u=i(10),c=(i(4),i(21));i(6);function d(t){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function f(t,e){return(f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function m(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=y(t);if(e){var r=y(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return g(this,i)}}function g(t,e){if(e&&("object"===d(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return v(t)}function v(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function y(t){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var x=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&f(t,e)}(y,t);var e,i,d,g=m(y);function y(t,e,i){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,y),(r=g.call(this)).initMesh(e),r.position.copy(t),s.a.addToGame({obj:v(r),update:!0}),r.passCheckpoint=!1,r.passFinishLine=!1,r.platformNo=i,r.finished=!1,r.canDraw=!0,r.canStart=!1,r.initPosition=(new n.Vector3).copy(t),r.armCreated=!1,r.moveSpeed=s.a.data.playerSpeed,r.touchedGround=!1,r.climbingNow=!1,r.dummyArms=!1,r.isPlayer=!1,r.drawingCount=0,r.startTimer=0,r.firstWaitTime=3,r.toucher=r.initToucher(),r.prevPos=new n.Vector3,r.stopGame=!1,r}return e=y,(i=[{key:"initToucher",value:function(){return new c.a(s.a.main.camera,new n.Vector3(0,0,-1))}},{key:"setCurrentLevelPlatform",value:function(t){this.currentLevelPlatform=t}},{key:"initMesh",value:function(t){var e=this;this.mesh=s.a.cloneAsset(t,o.a.modelMultiplier),this.mesh.position.y=0,this.mesh.visible=!0,this.add(this.mesh),this.mesh.traverse((function(t){t.material&&(t.geometry.computeVertexNormals(),t.castShadow=!0,t.receiveShadow=!0,e.mesh.mainMesh=t,e.mesh.mainMesh.geometry.computeBoundingBox(),e.boxMaterial=t.material.clone(),t.material=e.boxMaterial)}))}},{key:"createMainBody",value:function(){var t=this;this.body=u.a.createBodyFromObj(this.mesh,{mass:.1}),this.body.fixedRotation=!0,this.body.position.copy(this.position),this.body.material=o.a.kontakMaterials.normal,this.body.addEventListener("collide",(function(e){e.body.colType&&e.body.master&&e.body.master.onTouch(t),"upsidesteps"===e.body.label?(t.climbingNow=!0,t.body.velocity.x>.1&&(t.body.velocity.x=.1)):t.climbingNow=!1}))}},{key:"createArmCenterBody",value:function(){var t=this;this.armBody=new r.Body({shape:new r.Box(new r.Vec3(.1,.1,.1)),mass:.1,type:r.Body.DYNAMIC}),this.armBody.shapes[0].collisionResponse=!1,this.armBody.fixedRotation=!0,this.armBody.position.copy(this.position),h.a.world.add(this.armBody),this.armBody.material=o.a.kontakMaterials.normal;var e=new r.LockConstraint(this.body,this.armBody);h.a.world.addConstraint(e),this.currentConstraint=e,this.armBody.addEventListener("collide",(function(e){e.body.colType&&e.body.master&&e.body.master.onTouch(t)}))}},{key:"translatePointsToWorld",value:function(t){for(var e=[],i=0;i<t.length;i++){var r=t[i],s=new n.Vector3(r.x,-r.y,0);s.multiplyScalar(3),e.push(s)}return e}},{key:"update",value:function(t){if(this.startTimer+=t,this.checkDied(),this.checkLocationalEvents(),this.body){if(this.lastJumpMode||(this.body.velocity.z=0,this.body.velocity.y=2),this.body.position.z=this.initPosition.z,this.armBody&&(this.body.type===r.Body.DYNAMIC&&this.killed&&this.vehicle&&(this.vehicle.setMotorSpeed(0,0),this.vehicle.setWheelForce(0,0),this.vehicle.disableMotor(0)),this.waterTouched&&this.onWaterAction()),this.armFront&&this.armBody&&this.body.type!==r.Body.STATIC){var e=(new n.Quaternion).copy(this.armBody.quaternion),i=new n.Euler;i.setFromQuaternion(e),i.x=0,i.y=0,e.setFromEuler(i),this.armBody.position.copy(this.body.position),this.armBody.quaternion.copy(e),this.armFront.quaternion.copy(this.armBody.quaternion),this.armBack.quaternion.copy(this.armBody.quaternion),!this.vehicle||this.lastJumpMode||this.killed||1!==s.a.deltaMultiplier||this.startTimer>this.firstWaitTime&&(this.armBreakingThings(t),this.firstWaitTime=.2,this.startTimer=0)}this.position.copy(this.body.position)}}},{key:"armBreakingThings",value:function(t){if(!this.armBody.createAnimStarted){var e=this.prevPos.distanceTo(this.body.position);this.prevPos.copy(this.body.position);var i=Math.abs(this.vehicle.getWheelSpeed(0));if(!(i>1&&e>.3)&&!(e<.3&&i>1)&&e<.3&&i<1)for(var n=0;n<app.cannonPhysics.world.contacts.length;n++){var r=app.cannonPhysics.world.contacts[n];r.bj.isArms?r.bi.colType&&r.bi.colType===o.a.colTypes.PLATFORM&&this.doBreaking(r):r.bi.isArms&&r.bj.colType&&r.bj.colType===o.a.colTypes.PLATFORM&&this.doBreaking(r)}}}},{key:"doBreaking",value:function(t){var e=t.bi.position.clone().vadd(t.ri),i=(t.bj.position.clone().vadd(t.rj),e),h=this.armBody,l=h.shapes.length-1,u=(new n.Vector3).copy(i).sub(this.body.position),c=this.toucher.raycastFromObject(this.body.position,u.clone().normalize(),2*u.length(),o.a.rayableList);if(c.length>0){var d=c[0];i.copy(d.point);for(var p=new r.Vec3,f=-100,m=999999,g=l;g>=0;g--){h.shapes[g];var v=h.shapeOffsets[g];h.pointToWorldFrame(v,p);var y=p.distanceTo(i);m>y&&(m=y,f=g)}var x=new r.Vec3;this.armBody.pointToWorldFrame(this.armBody.shapeOffsets[f],x);var w=function(t){var e=t.bodyShapeList[t.bodyShapeList.length-1];if(!e)return null;var i=e.offsetman.clone(),n=new r.Vec3;return h.pointToWorldFrame(i,n),n},b=w(this.armBack),A=w(this.armFront);if(null!==b||null!==A){var T=(b?b.distanceTo(i):99999)<(A?A.distanceTo(i):99999)?this.armBack:this.armFront;this.lastArm===T&&this.doneman||(this.lastArm=T,a.a.destroyArm(T,this.armBody,.5),app.playSfx("Break_Leg"),this.doneman=!0,s.a.vibrateFeedback(200),this.prevTimeout&&clearTimeout(this.prevTimeout),this.prevTimeout=setTimeout(this.setDoneman,500))}}}},{key:"setDoneman",value:function(){this.doneman=!1}},{key:"updateProgress",value:function(t){if(this.body&&this.canStart){var e=this.body.position.x/(this.currentLevelPlatform.getFinishPos().x-0);e!==this.curPerc&&(this.curPerc=e,l.a.progress.updateProgression(t,e))}}},{key:"createArms",value:function(t,e){}},{key:"checkDied",value:function(){this.position.y<this.currentLevelPlatform.getKillY()&&this.diedActions()}},{key:"reachedEndFlag",value:function(){}},{key:"onCoinCollected",value:function(){}},{key:"diedActions",value:function(){}},{key:"checkLocationalEvents",value:function(){}},{key:"checkpointAction",value:function(){}},{key:"destoryArmsAnim",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4e3,i=this.armFront.scale.clone(),r=this.armBack.scale.clone(),o=function(t){var e=new n.Object3D;return t.parent.add(e),e.add(t),e},a=o(this.armFront),h=o(this.armBack);s.a.phaserScene.tweens.addCounter({from:1,to:0,duration:e,ease:Phaser.Math.Easing.Linear,onUpdate:function(e){var n=e.getValue();t.armFront.scale.copy(i),t.armBack.scale.copy(r),a.scale.setScalar(1),a.scale.multiplyScalar(n),h.scale.setScalar(1),h.scale.multiplyScalar(n),a.position.z=a.children[0].geometry.curTranslate.z*(1-n),h.position.z=h.children[0].geometry.curTranslate.z*(1-n),n>.99&&t.armBody.collisionResponse},onComplete:function(){t.armFront.visible=!1,t.armBack.visible=!1,t.armBody.collisionResponse=!1}})}},{key:"onWaterTouched",value:function(t){this.waterTouched=!0,this.waterMesh=t,this.onWaterAction()}},{key:"onWaterAction",value:function(){var t=this.waterMesh.box3d;t.containsPoint(this.position)?(this.insideWater=!0,this.body.velocity.y+=10,this.body.velocity.x<2&&(this.body.velocity.x+=10),this.vehicle.setWheelForce(.8*this.maxForce,0)):this.insideWater=!1,t.max.x<this.position.x&&(this.vehicle.setWheelForce(this.maxForce,0),this.waterTouched=!1)}},{key:"removeArms",value:function(){this.armFront&&(this.remove(this.armFront),this.remove(this.armBack),h.a.world.remove(this.armBody),this.currentConstraint&&h.a.world.removeConstraint(this.currentConstraint))}},{key:"removeObject",value:function(){this.removeArms(),s.a.main.scene.remove(this)}}])&&p(e.prototype,i),d&&p(e,d),Object.defineProperty(e,"prototype",{writable:!1}),y}(n.Object3D)},function(t,e,i){"use strict";i.d(e,"a",(function(){return v}));var n=i(2),r=i(1),s=i(3),o=i(14),a=(i(5),i(7)),h=(i(8),i(10)),l=i(4),u=(i(21),i(31));i(6);function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function p(t,e){return(p=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function f(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=g(t);if(e){var r=g(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return m(this,i)}}function m(t,e){if(e&&("object"===c(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function g(t){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var v=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&p(t,e)}(m,t);var e,i,u,c=f(m);function m(t,e,i){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,m),(n=c.call(this,t,e,i)).mainBodyMass=.1,n.armBodyMass=2,n.armDamping=.8,n.maxForce=-300,n.orgMaxForce=n.maxForce,n.maxSpeed=10,n}return e=m,(i=[{key:"createMainBody",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,e=h.a.createBodyFromObj(this.mesh,{mass:t,addToWorld:!1});return e.linearDamping=.9,e.angularDamping=1,e.fixedRotation=!0,this.vehicle=new n.RigidVehicle({chassisBody:e}),this.body=e,this.vehicle}},{key:"createArmCenterBody",value:function(){var t=this;this.armBody=new n.Body({shape:new n.Box(new n.Vec3(.1,.1,.1)),mass:.1,type:n.Body.DYNAMIC}),this.armBody.shapes[0].collisionResponse=!1,this.armBody.fixedRotation=!0,this.armBody.position.copy(this.position),this.armBody.material=s.a.kontakMaterials.normal,this.armBody.addEventListener("collide",(function(e){e.body.colType&&e.body.master&&e.body.master.onTouch(t)}))}},{key:"removeArms",value:function(){this.armFront&&(this.remove(this.armFront),this.remove(this.armBack),this.vehicle.removeFromWorld(a.a.world),a.a.world.removeBody(this.vehicle.chassisBody),this.vehicle.constraints=[],this.vehicle.wheelAxes=[],this.vehicle.wheelBodies=[],this.vehicle.wheelForces=[])}},{key:"pointerUp",value:function(t){var e,i=this,h=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],u=new n.Vec3,c=new n.Vec3;this.armBody&&c.copy(this.armBody.velocity),this.body&&(u.copy(this.body.velocity),this.removeArms()),this.createMainBody(this.mainBodyMass),this.dummyArms=!1,this.body.velocity.copy(u),e=h?this.translatePointsToWorld(t):t;var d,p=new n.Body({mass:this.armBodyMass,angularDamping:this.armDamping,material:s.a.kontakMaterials.normal});p.velocity.copy(c),p.addEventListener("collide",(function(t){t.body.colType&&(t.body.master&&t.body.master.onTouch(i),t.body.colType===s.a.colTypes.PLATFORM&&i.lastJumpMode&&(i.armBody.collisionResponse=!1))})),this.isPlayer&&(r.a.footstepEvent&&a.a.world.removeEventListener("beginContact",r.a.footstepEvent),r.a.footstepEvent=function(t){l.a.gameEnded||t.bodyB===p&&(t.bodyA.colType!==s.a.colTypes.PLATFORM&&t.bodyB.colType!==s.a.colTypes.OBSTACLE||d||(d=app.playSfx("Footstep"),r.a.phaserScene.time.delayedCall(200,(function(){d=null}))))},a.a.world.addEventListener("beginContact",r.a.footstepEvent)),this.armFront=o.a.createMesh(p,e,!1,r.a.data.playerArmColor),this.armBack=o.a.createMesh(p,e,!0,r.a.data.playerArmColor),this.armBody=p,this.armBody.isArms=!0,this.add(this.armFront),this.add(this.armBack),this.armCreated||(this.armCreated=!0),this.vehicle.addWheel({body:p,position:new n.Vec3(0,0,0),axis:new n.Vec3(0,0,1),direction:new n.Vec3(1,0,0)}),this.body.type=n.Body.DYNAMIC,this.body.updateMassProperties(),this.body.updateSolveMassProperties(),this.body.wakeUp(),this.armBody.type=n.Body.DYNAMIC,this.armBody.wakeUp(),this.vehicle.addToWorld(a.a.world);var f=this.maxSpeed,m=this.maxForce;this.vehicle.setMotorSpeed(f,0),this.vehicle.setWheelForce(m,0),o.a.animateMesh(this.armFront.pointList,this.armFront,!1,this.armBody).then((function(){i.drawingCount++})),o.a.animateMesh(this.armBack.pointList,this.armBack,!0,this.armBody)}}])&&d(e.prototype,i),u&&d(e,u),Object.defineProperty(e,"prototype",{writable:!1}),m}(u.a)},function(t,e,i){"use strict";i.d(e,"a",(function(){return u}));var n=i(1),r=i(8),s=i(5),o=i(4);function a(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function h(t,e,i){return e&&a(t.prototype,e),i&&a(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function l(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var u=h((function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}));l(u,"IntroState",{onEnter:function(){r.a.introUI.show(!0),r.a.introUI.setLevelTitle(s.a.levelIndex+1),r.a.progress.updateLevelCircles(s.a.levelIndex+1,s.a.levelIndex+2),o.a.setState(u.OpeningState)},onUpdate:function(t){},onExit:function(){}}),l(u,"OpeningState",{onEnter:function(){o.a.runCount++,u.OpeningState.canStart=!1,o.a.runCount},onUpdate:function(t){},onExit:function(){}}),l(u,"GameplayState",{onEnter:function(){u.gameplayTime=0,u.disableGameUpdate=!1,n.a.eventEmitter.on("levelfinished",(function(t){u.disableGameUpdate=!0}))},onUpdate:function(t){u.disableGameUpdate||(u.gameplayTime+=t)},onExit:function(){}}),l(u,"EndingState",{onEnter:function(){r.a.drawArea.show(!1,!0),r.a.progress.show(!1,!0);var t=!1,e=1;switch(o.a.gameOverState===o.a.GameOverStates.WIN&&(e=2,t=!0),n.a.playerData.score=o.a.calculateScore(s.a.levelIndex+1,e,u.gameplayTime),n.a.playerData.bestScore+=n.a.playerData.score,H5SDK.getPlatform().notifyLevelEnd(s.a.levelIndex+1,n.a.playerData.bestScore,t),o.a.gameOverState){case o.a.GameOverStates.GAME_OVER:r.a.endcard.show(!1);break;case o.a.GameOverStates.WIN:r.a.endcard.show(!0);break;case o.a.GameOverStates.TIME_OUT:r.a.endcard.show(!1)}},onUpdate:function(t){},onExit:function(){}})},function(t,e,i){"use strict";function n(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())}))}i.d(e,"a",(function(){return p}));const r=["geforce 320m","geforce 8600","geforce 8600m gt","geforce 8800 gs","geforce 8800 gt","geforce 9400","geforce 9400m g","geforce 9400m","geforce 9600m gt","geforce 9600m","geforce fx go5200","geforce gt 120","geforce gt 130","geforce gt 330m","geforce gtx 285","google swiftshader","intel g41","intel g45","intel gma 4500mhd","intel gma x3100","intel hd 3000","intel q45","legacy","mali-2","mali-3","mali-4","quadro fx 1500","quadro fx 4","quadro fx 5","radeon hd 2400","radeon hd 2600","radeon hd 4670","radeon hd 4850","radeon hd 4870","radeon hd 5670","radeon hd 5750","radeon hd 6290","radeon hd 6300","radeon hd 6310","radeon hd 6320","radeon hd 6490m","radeon hd 6630m","radeon hd 6750m","radeon hd 6770m","radeon hd 6970m","sgx 543","sgx543"];function s(t){return t.toLowerCase().replace(/^angle ?\((.+)\)*$/,"$1").replace(/\s(\d{1,2}gb|direct3d.+$)|\(r\)| \([^)]+\)$/g,"")}const o="undefined"==typeof window,a=(()=>{if(o)return;const{userAgent:t,platform:e,maxTouchPoints:i}=window.navigator,n=/(iphone|ipod|ipad)/i.test(t),r="iPad"===e||"MacIntel"===e&&i>0&&!window.MSStream;return{isIpad:r,isMobile:/android/i.test(t)||n||r,isSafari12:/Version\/12.+Safari/.test(t)}})();const h=[],l=[];function u(t,e){if(t===e)return 0;const i=t;t.length>e.length&&(t=e,e=i);let n=t.length,r=e.length;for(;n>0&&t.charCodeAt(~-n)===e.charCodeAt(~-r);)n--,r--;let s,o=0;for(;o<n&&t.charCodeAt(o)===e.charCodeAt(o);)o++;if(n-=o,r-=o,0===n)return r;let a,u,c=0,d=0,p=0;for(;d<n;)l[d]=t.charCodeAt(o+d),h[d]=++d;for(;p<r;)for(s=e.charCodeAt(o+p),a=p++,c=p,d=0;d<n;d++)u=s===l[d]?a:a+1,a=h[d],c=h[d]=a>c?u>c?c+1:u:u>a?a+1:u;return c}function c(t){return null!=t}class d extends Error{constructor(t){super(t),Object.setPrototypeOf(this,new.target.prototype)}}const p=({mobileTiers:t=[0,15,30,60],desktopTiers:e=[0,15,30,60],override:i={},glContext:h,failIfMajorPerformanceCaveat:l=!1,benchmarksURL:p="https://unpkg.com/detect-gpu@4.0.22/dist/benchmarks"}={})=>n(void 0,void 0,void 0,(function*(){const f={};if(o)return{tier:0,type:"SSR"};const{isIpad:m=!!(null==a?void 0:a.isIpad),isMobile:g=!!(null==a?void 0:a.isMobile),screenSize:v=window.screen,loadBenchmarks:y=(t=>n(void 0,void 0,void 0,(function*(){const e=yield fetch(`${p}/${t}`).then(t=>t.json());if(parseInt(e.shift().split(".")[0],10)<4)throw new d("Detect GPU benchmark data is out of date. Please update to version 4x");return e})))}=i;let{renderer:x}=i;const w=(t,e,i,n,r)=>({device:r,fps:n,gpu:i,isMobile:g,tier:t,type:e});let b,A="";if(x)x=s(x),b=[x];else{const t=h||function(t,e=!1){const i={alpha:!1,antialias:!1,depth:!1,failIfMajorPerformanceCaveat:e,powerPreference:"high-performance",stencil:!1};t&&delete i.powerPreference;const n=window.document.createElement("canvas"),r=n.getContext("webgl",i)||n.getContext("experimental-webgl",i);return null!=r?r:void 0}(null==a?void 0:a.isSafari12,l);if(!t)return w(0,"WEBGL_UNSUPPORTED");const e=t.getExtension("WEBGL_debug_renderer_info");if(e&&(x=t.getParameter(e.UNMASKED_RENDERER_WEBGL)),!x)return w(1,"FALLBACK");A=x,x=s(x),b=function(t,e,i){return"apple gpu"===e?function(t,e,i){if(!i)return[e];const n=function(t){const e=t.createShader(35633),i=t.createShader(35632),n=t.createProgram();if(!(i&&e&&n))return;t.shaderSource(e,"\n precision highp float;\n attribute vec3 aPosition;\n varying float vvv;\n void main() {\n vvv = 0.31622776601683794;\n gl_Position = vec4(aPosition, 1.0);\n }\n "),t.shaderSource(i,"\n precision highp float;\n varying float vvv;\n void main() {\n vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * vvv;\n enc = fract(enc);\n enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n gl_FragColor = enc;\n }\n "),t.compileShader(e),t.compileShader(i),t.attachShader(n,e),t.attachShader(n,i),t.linkProgram(n),t.detachShader(n,e),t.detachShader(n,i),t.deleteShader(e),t.deleteShader(i),t.useProgram(n);const r=t.createBuffer();t.bindBuffer(34962,r),t.bufferData(34962,new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),35044);const s=t.getAttribLocation(n,"aPosition");t.vertexAttribPointer(s,3,5126,!1,0,0),t.enableVertexAttribArray(s),t.clearColor(1,1,1,1),t.clear(16384),t.viewport(0,0,1,1),t.drawArrays(4,0,3);const o=new Uint8Array(4);return t.readPixels(0,0,1,1,6408,5121,o),t.deleteProgram(n),t.deleteBuffer(r),o.join("")}(t),r="801621810",s="8016218135",o="80162181161",h=(null==a?void 0:a.isIpad)?[["a7",o,12],["a8",s,15],["a8x",s,15],["a9",s,15],["a9x",s,15],["a10",s,15],["a10x",s,15],["a12",r,15],["a12x",r,15],["a12z",r,15],["a14",r,15],["m1",r,15]]:[["a7",o,12],["a8",s,12],["a9",s,15],["a10",s,15],["a11",r,15],["a12",r,15],["a13",r,15],["a14",r,15]];let l;return"80162181255"===n?l=h.filter(([,,t])=>t>=14):(l=h.filter(([,t])=>t===n),l.length||(l=h)),l.map(([t])=>`apple ${t} gpu`)}(t,e,i):[e]}(t,x,g)}const T=(yield Promise.all(b.map(t=>n(void 0,void 0,void 0,(function*(){var e;const i=(t=>{const e=g?["adreno","apple","mali-t","mali","nvidia","powervr"]:["intel","apple","amd","radeon","nvidia","geforce"];for(const i of e)if(t.includes(i))return i})(t);if(!i)return;const n=`${g?"m":"d"}-${i}${m?"-ipad":""}.json`,r=f[n]=null!==(e=f[n])&&void 0!==e?e:y(n);let s;try{s=yield r}catch(e){if(e instanceof d)throw e;return}const o=function(t){var e;const i=(t=t.replace(/\([^)]+\)/,"")).match(/\d+/)||t.match(/(\W|^)([A-Za-z]{1,3})(\W|$)/g);return null!==(e=null==i?void 0:i.join("").replace(/\W|amd/g,""))&&void 0!==e?e:""}(t);let a=s.filter(([,t])=>t===o);a.length||(a=s.filter(([e])=>e.includes(t)));const h=a.length;if(0===h)return;let l,[c,,,p]=h>1?a.map(e=>[e,u(t,e[0])]).sort(([,t],[,e])=>t-e)[0][0]:a[0],x=Number.MAX_VALUE;const{devicePixelRatio:w}=window,b=v.width*w*v.height*w;for(const t of p){const[e,i]=t,n=e*i,r=Math.abs(b-n);r<x&&(x=r,l=t)}if(!l)return;const[,,A,T]=l;return[x,A,c,T]}))))).filter(c).sort(([t=Number.MAX_VALUE,e],[i=Number.MAX_VALUE,n])=>t===i?e-n:t-i);if(!T.length){const t=r.find(t=>x.includes(t));return t?w(0,"BLOCKLISTED",t):w(1,"FALLBACK",`${x} (${A})`)}const[,S,E,M]=T[0];if(-1===S)return w(0,"BLOCKLISTED",E,S,M);const _=g?t:e;let C=0;for(let t=0;t<_.length;t++)S>=_[t]&&(C=t);return w(C,"BENCHMARK",E,S,M)}))},function(t,e,i){"use strict";var n=i(0);function r(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return s(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return s(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,h=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return a=t.done,t},e:function(t){h=!0,o=t},f:function(){try{a||null==i.return||i.return()}finally{if(h)throw o}}}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function o(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,s;return e=t,s=[{key:"simpleShader",value:function(t){var e={uMap:{type:"t",value:t.material.map},opak:{type:"f",value:t.material.opacity}},i=new THREE.ShaderMaterial({uniforms:e,vertexShader:"\n varying vec2 vUv;\n void main()\n {\n \n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }\n ",fragmentShader:" \n uniform sampler2D uMap;\n uniform float opak;\n\n varying vec2 vUv;\n void main( void ) {\n vec4 tex1 = texture2D(uMap, vUv * 1.0);\n gl_FragColor = vec4(\n tex1.r, // R\n tex1.g, // R\n tex1.b, // R\n opak * tex1.a\n );\n } \n ",lights:!1,side:THREE.DoubleSide,transparent:!0});t.material=i}},{key:"moveToScene",value:function(t){t.updateWorldMatrix(!0),t.getWorldPosition(t.position),t.getWorldScale(t.scale),t.getWorldQuaternion(t.quaternion),app.main.scene.add(t)}},{key:"modelToBox3",value:function(t,e){t.updateWorldMatrix(!0);var i=(new n.Box3).setFromObject(t);if(e){var r=new n.Box3Helper(i);app.main.scene.add(r)}var s=(new n.Vector3).addVectors(i.min,i.max).multiplyScalar(.5),o=(new n.Vector3).subVectors(i.max,i.min);return t.dimensions=o,[s,o,i]}},{key:"takeSnapshot",value:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s={antialias:!0,alpha:!0,preserveDrawingBuffer:!0},o=app.main,a=new THREE.Scene,h=new THREE.WebGLRenderer(s);h.outputEncoding=o.renderer.outputEncoding,h.gammaFactor=o.renderer.gammaFactor,h.setClearColor(0,0);var l=t;if(l){if(e)for(var u=0;u<o.scene.children.length;u++){var c=o.scene.children[u];c.type.indexOf("Light")>=0&&l.push(c)}}else l=o.scene.children.concat();var d,p=r(l);try{for(p.s();!(d=p.n()).done;){var f=d.value;a.add(f.clone())}}catch(t){p.e(t)}finally{p.f()}function m(t,e){var i=1/n;t.setAttribute("style"," -ms-transform: scale("+i+"); -webkit-transform: scale3d("+i+", 1); -moz-transform: scale("+i+"); -o-transform: scale("+i+"); transform: scale("+i+"); transform-origin: top left;");var r=window.innerWidth,s=window.innerHeight;document.body.style.maxWidth=r+"px",document.body.style.maxHeight=s+"px";var o=(r*=n)+"px",a=(s*=n)+"px";t.style.maxWidth=o,t.style.maxHeight=a,t.style.width=o,t.style.height=a,e.setSize(r,s)}m(h.domElement,h);var g=o.camera,v=g.position.clone();i&&g.position.copy(i),h.render(a,g);for(var y=h.domElement.toDataURL(),x=a.children.length-1;x>=0;x--)a.remove(a.children[x]);return g.position.copy(v),y}},{key:"addTrail",value:function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"#000000",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:60,o=app.main.scene,a=new THREE.TrailRenderer(o,!0),h=THREE.TrailRenderer.createBaseMaterial(),l=new THREE.Color(i);return h.uniforms.headColor.value.set(l.r,l.g,l.b,n),h.uniforms.tailColor.value.set(l.r,l.g,l.b,r),a.initialize(h,s,!1,0,e,t),a.activate(),a}}],(i=[{key:"addSimpleOutline",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.02,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=[];t.traverse((function(t){t.material&&n.push(t)})),n.forEach((function(t){var n=t.clone();t.parent.add(n),n.material=new MeshLambertMaterial({color:i,side:THREE.BackSide}),n.material.onBeforeCompile=function(t){var i="\n vec3 transformed = position + objectNormal*".concat(e,";\n ");t.vertexShader=t.vertexShader.replace("#include <begin_vertex>",i)}}))}}])&&o(e.prototype,i),s&&o(e,s),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.a=a},function(t,e,i){"use strict";i.d(e,"a",(function(){return f}));var n=i(0),r=i(1),s=i(6),o=i(3);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function h(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function u(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=p(t);if(e){var r=p(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return c(this,i)}}function c(t,e){if(e&&("object"===a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return d(t)}function d(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var f=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&l(t,e)}(c,t);var e,i,n,a=u(c);function c(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),(t=a.call(this)).mesh=r.a.cloneAsset("crown",o.a.modelMultiplier),t.mesh.scale.y*=1.5,t.add(t.mesh),r.a.addToGame({obj:d(t)}),t.visible=!0,t.orgSkal=t.scale.clone(),t.yPos=1,t.scale.multiplyScalar(.001),t.currentMaster=null,r.a.eventEmitter.on("gameStarts",(function(){r.a.addToUpdate(d(t))})),t}return e=c,(i=[{key:"setCompetitors",value:function(t){this.competitorList=t}},{key:"update",value:function(t){this.mesh.rotation.y+=1.5*t;for(var e=this.competitorList[0],i=0;i<this.competitorList.length;i++){var n=this.competitorList[i];n.position.x>e.position.x&&(e=n)}this.currentMaster?this.currentMaster!==e&&this.swapToChar(e,this.yPos):this.spawnOrDie(e,!0)}},{key:"spawnOrDie",value:function(t,e){s.a.moveToScene(this),t.attach(this),this.position.copy(t.position),this.position.y=this.yPos;var i=1;e||(i=.001),r.a.phaserScene.tweens.add({targets:this.scale,x:i,y:i,z:i,duration:500,ease:Phaser.Math.Easing.Back.Out}),this.currentMaster=t}},{key:"swapToChar",value:function(t,e){s.a.moveToScene(this),t.attach(this),this.moveTween&&this.moveTween.remove(),this.moveTween=r.a.phaserScene.tweens.add({targets:this.position,x:0,y:this.yPos,z:0,duration:500,ease:Phaser.Math.Easing.Quadratic.Out}),this.currentMaster=t}}])&&h(e.prototype,i),n&&h(e,n),Object.defineProperty(e,"prototype",{writable:!1}),c}(n.Object3D)},function(t,e,i){"use strict";i.d(e,"a",(function(){return c}));var n=i(0),r=i(1),s=i(21),o=(i(8),i(26));function a(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return h(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return h(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==i.return||i.return()}finally{if(a)throw s}}}}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var c=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.renderer,r=e.camera;e.dirLight,e.ambientLight;l(this,t);var o=document.createElement("canvas");document.body.append(o),o.style.zIndex=300,o.style.transformOrigin="left top";var a=new n.Scene;this.canvas=o,this.context=o.getContext("2d"),this.canvas.style.pointerEvents="none",this.scene=a,this.renderer=i,this.camera=r.clone(),this.camera.position.set(0,0,10),this.camera.lookAt(a.position),this.dirLight=new n.DirectionalLight(16777215,.5),this.ambientLight=new n.AmbientLight(16777215,.5),this.dirLight.intensity=5.7,this.dirLight.position.set(41,66,-35),this.ambientLight.intensity=1.6,this.scene.add(this.dirLight),this.scene.add(this.ambientLight),this.toucher=new s.a(this.camera,new n.Vector3(0,0,-1)),this.addCoins()}var e,i,h;return e=t,(i=[{key:"addCoins",value:function(){for(var t=new n.Object3D,e=[],i=0;i<20;i++){var s=r.a.cloneAsset("coinSolo",1);s.position.set(n.MathUtils.randFloatSpread(4),n.MathUtils.randFloatSpread(4),n.MathUtils.randFloatSpread(1)),s.rotation.set(n.MathUtils.randFloatSpread(Math.PI),n.MathUtils.randFloatSpread(Math.PI),n.MathUtils.randFloatSpread(Math.PI)),s.scale.z*=2,s.orgSkal=s.scale.clone(),t.add(s),e.push(s)}this.coinList=e,this.coinContainer=t,this.scene.add(t),this.scene.visible=!1,this.scene.skipHack=!0,this.time=0}},{key:"resetCoins",value:function(){for(var t=0;t<this.coinList.length;t++){var e=this.coinList[t];e.position.set(n.MathUtils.randFloatSpread(4),n.MathUtils.randFloatSpread(4),n.MathUtils.randFloatSpread(1)),e.rotation.set(n.MathUtils.randFloatSpread(Math.PI),n.MathUtils.randFloatSpread(Math.PI),n.MathUtils.randFloatSpread(Math.PI)),e.scale.copy(e.orgSkal),e.scale.z*=2}}},{key:"spawnCoins",value:function(t){var e=this;return r.a.lowEndDevice?this.useSameCanvas=!0:this.useSameCanvas=!1,new Promise((function(i){e.resetCoins();var n=0;e.scene.visible=!0,e.resize(r.a.threeScene.lastWidth,r.a.threeScene.lastHeight);var s=r.a.playerData.coin,a=t;e.coinList.forEach((function(t,h){t.scale.set(0,0,0),t.rando,r.a.phaserScene.tweens.addCounter({from:0,to:1,duration:800,ease:Phaser.Math.Easing.Back.Out,onUpdate:function(e){t.scale.copy(t.orgSkal).multiplyScalar(e.getValue())}});var l=e.toucher.getPlaneIntersection(1.09*o.a.coinBar.x,o.a.coinBar.y);r.a.phaserScene.tweens.add({targets:t.position,x:l.x,y:l.y,z:0,duration:1e3,delay:1e3+500*Math.random(),ease:Phaser.Math.Easing.Sine.In,onUpdate:function(e){var i=1-e.progress;i<.05&&t.scale.copy(t.orgSkal).multiplyScalar(i/.05)},onComplete:function(){e.renderer.autoClear=!0,r.a.playerData.coin+=a/e.coinList.length,r.a.playerData.coin>s+a&&(r.a.playerData.coin=s+a),o.a.coinBar.addCoinWithAnim(r.a.playerData.coin),n++,r.a.vibrateFeedback(100),app.playSfx("Coin"),n===e.coinList.length&&(r.a.playerData.coin=s+a,e.scene.visible=!1,e.context.clearRect(0,0,e.canvas.width,e.canvas.height),i())}})}))}))}},{key:"resize",value:function(t,e){if(this.scene.visible){this.canvas.width=t,this.canvas.height=e,this.canvas.style.transform=this.renderer.domElement.style.transform;var i=t/e;this.camera.aspect=i,this.camera.updateProjectionMatrix()}}},{key:"update",value:function(t){if(this.scene.visible){this.time+=t,this.time;var e,i=a(this.coinList);try{for(i.s();!(e=i.n()).done;)e.value.rotation.y+=2*Math.PI*t}catch(t){i.e(t)}finally{i.f()}this.renderer.autoClear=!1,this.useSameCanvas?(this.renderer.clearDepth(),this.renderer.render(this.scene,this.camera),this.renderer.clearDepth()):this.time>0&&(this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.renderer.render(this.scene,this.camera),this.context.drawImage(this.renderer.domElement,0,0,this.canvas.width,this.canvas.height,0,0,this.canvas.width,this.canvas.height),this.time=0)}}}])&&u(e.prototype,i),h&&u(e,h),Object.defineProperty(e,"prototype",{writable:!1}),t}()},function(t){t.exports=JSON.parse('[{"name":"sprite1","x":2,"y":12,"width":60,"height":40},{"name":"sprite2","x":66,"y":12,"width":60,"height":40},{"name":"sprite3","x":130,"y":12,"width":60,"height":40},{"name":"sprite4","x":194,"y":12,"width":60,"height":40},{"name":"sprite5","x":258,"y":12,"width":60,"height":40},{"name":"sprite6","x":322,"y":12,"width":60,"height":40},{"name":"sprite7","x":386,"y":12,"width":60,"height":40},{"name":"sprite8","x":450,"y":12,"width":60,"height":40},{"name":"sprite9","x":514,"y":12,"width":60,"height":40},{"name":"sprite10","x":578,"y":12,"width":60,"height":40},{"name":"sprite11","x":642,"y":12,"width":60,"height":40},{"name":"sprite12","x":706,"y":12,"width":60,"height":40},{"name":"sprite13","x":770,"y":12,"width":60,"height":40},{"name":"sprite14","x":834,"y":12,"width":60,"height":40},{"name":"sprite15","x":898,"y":12,"width":60,"height":40},{"name":"sprite16","x":962,"y":12,"width":60,"height":40},{"name":"sprite17","x":2,"y":76,"width":60,"height":40},{"name":"sprite18","x":66,"y":76,"width":60,"height":40},{"name":"sprite19","x":130,"y":76,"width":60,"height":40},{"name":"sprite20","x":194,"y":76,"width":60,"height":40},{"name":"sprite21","x":258,"y":76,"width":60,"height":40},{"name":"sprite22","x":322,"y":76,"width":60,"height":40},{"name":"sprite23","x":386,"y":76,"width":60,"height":40},{"name":"sprite24","x":450,"y":76,"width":60,"height":40},{"name":"sprite25","x":514,"y":76,"width":60,"height":40},{"name":"sprite26","x":578,"y":76,"width":60,"height":40},{"name":"sprite27","x":642,"y":76,"width":60,"height":40},{"name":"sprite28","x":706,"y":76,"width":60,"height":40},{"name":"sprite29","x":770,"y":76,"width":60,"height":40},{"name":"sprite30","x":834,"y":76,"width":60,"height":40},{"name":"sprite31","x":898,"y":76,"width":60,"height":40},{"name":"sprite32","x":962,"y":76,"width":60,"height":40},{"name":"sprite33","x":2,"y":140,"width":60,"height":40},{"name":"sprite34","x":66,"y":140,"width":60,"height":40},{"name":"sprite35","x":130,"y":140,"width":60,"height":40},{"name":"sprite36","x":194,"y":140,"width":60,"height":40},{"name":"sprite37","x":258,"y":140,"width":60,"height":40},{"name":"sprite38","x":322,"y":140,"width":60,"height":40},{"name":"sprite39","x":386,"y":140,"width":60,"height":40},{"name":"sprite40","x":450,"y":140,"width":60,"height":40},{"name":"sprite41","x":514,"y":140,"width":60,"height":40},{"name":"sprite42","x":588,"y":140,"width":40,"height":40},{"name":"sprite43","x":642,"y":140,"width":60,"height":40},{"name":"sprite44","x":706,"y":140,"width":60,"height":40},{"name":"sprite45","x":770,"y":140,"width":60,"height":40},{"name":"sprite46","x":834,"y":140,"width":60,"height":40},{"name":"sprite47","x":898,"y":140,"width":60,"height":40},{"name":"sprite48","x":962,"y":140,"width":60,"height":40},{"name":"sprite49","x":2,"y":204,"width":60,"height":40},{"name":"sprite50","x":66,"y":204,"width":60,"height":40},{"name":"sprite51","x":130,"y":204,"width":60,"height":40},{"name":"sprite52","x":194,"y":204,"width":60,"height":40},{"name":"sprite53","x":258,"y":204,"width":60,"height":40},{"name":"sprite54","x":322,"y":204,"width":60,"height":40},{"name":"sprite55","x":386,"y":204,"width":60,"height":40},{"name":"sprite56","x":450,"y":204,"width":60,"height":40},{"name":"sprite57","x":514,"y":204,"width":60,"height":40},{"name":"sprite58","x":578,"y":204,"width":60,"height":40},{"name":"sprite59","x":642,"y":204,"width":60,"height":40},{"name":"sprite60","x":706,"y":204,"width":60,"height":40},{"name":"sprite61","x":770,"y":204,"width":60,"height":40},{"name":"sprite62","x":834,"y":204,"width":60,"height":40},{"name":"sprite63","x":898,"y":204,"width":60,"height":40},{"name":"sprite64","x":962,"y":204,"width":60,"height":40},{"name":"sprite65","x":2,"y":268,"width":60,"height":40},{"name":"sprite66","x":66,"y":268,"width":60,"height":40},{"name":"sprite67","x":130,"y":268,"width":60,"height":40},{"name":"sprite68","x":194,"y":268,"width":60,"height":40},{"name":"sprite69","x":258,"y":268,"width":60,"height":40},{"name":"sprite70","x":322,"y":268,"width":60,"height":40},{"name":"sprite71","x":386,"y":268,"width":60,"height":40},{"name":"sprite72","x":450,"y":268,"width":60,"height":40},{"name":"sprite73","x":514,"y":268,"width":60,"height":40},{"name":"sprite74","x":578,"y":268,"width":60,"height":40},{"name":"sprite75","x":642,"y":268,"width":60,"height":40},{"name":"sprite76","x":706,"y":268,"width":60,"height":40},{"name":"sprite77","x":770,"y":268,"width":60,"height":40},{"name":"sprite78","x":834,"y":268,"width":60,"height":40},{"name":"sprite79","x":898,"y":268,"width":60,"height":40},{"name":"sprite80","x":962,"y":268,"width":60,"height":40},{"name":"sprite81","x":2,"y":332,"width":60,"height":40},{"name":"sprite82","x":66,"y":332,"width":60,"height":40},{"name":"sprite83","x":130,"y":332,"width":60,"height":40},{"name":"sprite84","x":194,"y":332,"width":60,"height":40},{"name":"sprite85","x":258,"y":332,"width":60,"height":40},{"name":"sprite86","x":322,"y":332,"width":60,"height":40},{"name":"sprite87","x":386,"y":332,"width":60,"height":40},{"name":"sprite88","x":450,"y":332,"width":60,"height":40},{"name":"sprite89","x":514,"y":332,"width":60,"height":40},{"name":"sprite90","x":578,"y":332,"width":60,"height":40},{"name":"sprite91","x":642,"y":332,"width":60,"height":40},{"name":"sprite92","x":706,"y":332,"width":60,"height":40},{"name":"sprite93","x":770,"y":332,"width":60,"height":40},{"name":"sprite94","x":834,"y":332,"width":60,"height":40},{"name":"sprite95","x":898,"y":332,"width":60,"height":40},{"name":"sprite96","x":962,"y":332,"width":60,"height":40},{"name":"sprite97","x":2,"y":396,"width":60,"height":40},{"name":"sprite98","x":66,"y":396,"width":60,"height":40},{"name":"sprite99","x":130,"y":396,"width":60,"height":40},{"name":"sprite100","x":194,"y":396,"width":60,"height":40},{"name":"sprite101","x":258,"y":396,"width":60,"height":40},{"name":"sprite102","x":322,"y":396,"width":60,"height":40},{"name":"sprite103","x":386,"y":396,"width":60,"height":40},{"name":"sprite104","x":450,"y":396,"width":60,"height":40},{"name":"sprite105","x":514,"y":396,"width":60,"height":40},{"name":"sprite106","x":578,"y":396,"width":60,"height":40},{"name":"sprite107","x":642,"y":396,"width":60,"height":40},{"name":"sprite108","x":706,"y":396,"width":60,"height":40},{"name":"sprite109","x":770,"y":396,"width":60,"height":40},{"name":"sprite110","x":834,"y":396,"width":60,"height":40},{"name":"sprite111","x":898,"y":396,"width":60,"height":40},{"name":"sprite112","x":962,"y":396,"width":60,"height":40},{"name":"sprite113","x":2,"y":460,"width":60,"height":40},{"name":"sprite114","x":66,"y":460,"width":60,"height":40},{"name":"sprite115","x":130,"y":460,"width":60,"height":40},{"name":"sprite116","x":194,"y":460,"width":60,"height":40},{"name":"sprite117","x":258,"y":460,"width":60,"height":40},{"name":"sprite118","x":322,"y":460,"width":60,"height":40},{"name":"sprite119","x":386,"y":460,"width":60,"height":40},{"name":"sprite120","x":450,"y":460,"width":60,"height":40},{"name":"sprite121","x":514,"y":460,"width":60,"height":40},{"name":"sprite122","x":578,"y":460,"width":60,"height":40},{"name":"sprite123","x":642,"y":460,"width":60,"height":40},{"name":"sprite124","x":706,"y":460,"width":60,"height":40},{"name":"sprite125","x":770,"y":460,"width":60,"height":40},{"name":"sprite126","x":834,"y":460,"width":60,"height":40},{"name":"sprite127","x":898,"y":460,"width":60,"height":40},{"name":"sprite128","x":962,"y":460,"width":60,"height":40},{"name":"sprite129","x":2,"y":524,"width":60,"height":40},{"name":"sprite130","x":66,"y":524,"width":60,"height":40},{"name":"sprite131","x":130,"y":524,"width":60,"height":40},{"name":"sprite132","x":194,"y":524,"width":60,"height":40},{"name":"sprite133","x":258,"y":524,"width":60,"height":40},{"name":"sprite134","x":322,"y":524,"width":60,"height":40},{"name":"sprite135","x":386,"y":524,"width":60,"height":40},{"name":"sprite136","x":450,"y":524,"width":60,"height":40},{"name":"sprite137","x":514,"y":524,"width":60,"height":40},{"name":"sprite138","x":578,"y":524,"width":60,"height":40},{"name":"sprite139","x":642,"y":524,"width":60,"height":40},{"name":"sprite140","x":706,"y":524,"width":60,"height":40},{"name":"sprite141","x":770,"y":524,"width":60,"height":40},{"name":"sprite142","x":834,"y":524,"width":60,"height":40},{"name":"sprite143","x":898,"y":524,"width":60,"height":40},{"name":"sprite144","x":962,"y":524,"width":60,"height":40},{"name":"sprite145","x":2,"y":588,"width":60,"height":40},{"name":"sprite146","x":66,"y":588,"width":60,"height":40},{"name":"sprite147","x":130,"y":588,"width":60,"height":40},{"name":"sprite148","x":194,"y":588,"width":60,"height":40},{"name":"sprite149","x":258,"y":588,"width":60,"height":40},{"name":"sprite150","x":322,"y":588,"width":60,"height":40},{"name":"sprite151","x":386,"y":588,"width":60,"height":40},{"name":"sprite152","x":450,"y":588,"width":60,"height":40},{"name":"sprite153","x":514,"y":588,"width":60,"height":40},{"name":"sprite154","x":578,"y":588,"width":60,"height":40},{"name":"sprite155","x":642,"y":588,"width":60,"height":40},{"name":"sprite156","x":706,"y":588,"width":60,"height":40},{"name":"sprite157","x":770,"y":588,"width":60,"height":40},{"name":"sprite158","x":834,"y":588,"width":60,"height":40},{"name":"sprite159","x":898,"y":588,"width":60,"height":40},{"name":"sprite160","x":962,"y":588,"width":60,"height":40},{"name":"sprite161","x":266,"y":645,"width":44,"height":54},{"name":"sprite162","x":2,"y":652,"width":60,"height":40},{"name":"sprite163","x":66,"y":652,"width":60,"height":40},{"name":"sprite164","x":130,"y":652,"width":60,"height":40},{"name":"sprite165","x":194,"y":652,"width":60,"height":40},{"name":"sprite166","x":322,"y":652,"width":60,"height":40},{"name":"sprite167","x":386,"y":652,"width":60,"height":40},{"name":"sprite168","x":450,"y":652,"width":60,"height":40},{"name":"sprite169","x":514,"y":652,"width":60,"height":40},{"name":"sprite170","x":578,"y":652,"width":60,"height":40},{"name":"sprite171","x":642,"y":652,"width":60,"height":40},{"name":"sprite172","x":706,"y":652,"width":60,"height":40},{"name":"sprite173","x":770,"y":652,"width":60,"height":40},{"name":"sprite174","x":834,"y":652,"width":60,"height":40},{"name":"sprite175","x":898,"y":652,"width":60,"height":40},{"name":"sprite176","x":962,"y":652,"width":60,"height":40},{"name":"sprite177","x":2,"y":716,"width":60,"height":40},{"name":"sprite178","x":66,"y":716,"width":60,"height":40},{"name":"sprite179","x":130,"y":716,"width":60,"height":40},{"name":"sprite180","x":194,"y":716,"width":60,"height":40},{"name":"sprite181","x":258,"y":716,"width":60,"height":40},{"name":"sprite182","x":322,"y":716,"width":60,"height":40},{"name":"sprite183","x":386,"y":716,"width":60,"height":40},{"name":"sprite184","x":450,"y":716,"width":60,"height":40},{"name":"sprite185","x":514,"y":716,"width":60,"height":40},{"name":"sprite186","x":578,"y":716,"width":60,"height":40},{"name":"sprite187","x":642,"y":716,"width":60,"height":40},{"name":"sprite188","x":706,"y":716,"width":60,"height":40},{"name":"sprite189","x":770,"y":716,"width":60,"height":40},{"name":"sprite190","x":834,"y":716,"width":60,"height":40},{"name":"sprite191","x":898,"y":716,"width":60,"height":40},{"name":"sprite192","x":962,"y":716,"width":60,"height":40},{"name":"sprite193","x":2,"y":780,"width":60,"height":40},{"name":"sprite194","x":66,"y":780,"width":60,"height":40},{"name":"sprite195","x":130,"y":780,"width":60,"height":40},{"name":"sprite196","x":194,"y":780,"width":60,"height":40},{"name":"sprite197","x":258,"y":780,"width":60,"height":40},{"name":"sprite198","x":322,"y":780,"width":60,"height":40},{"name":"sprite199","x":386,"y":780,"width":60,"height":40},{"name":"sprite200","x":450,"y":780,"width":60,"height":40},{"name":"sprite201","x":514,"y":780,"width":60,"height":40},{"name":"sprite202","x":578,"y":780,"width":60,"height":40},{"name":"sprite203","x":642,"y":780,"width":60,"height":40},{"name":"sprite204","x":706,"y":780,"width":60,"height":40},{"name":"sprite205","x":770,"y":780,"width":60,"height":40},{"name":"sprite206","x":834,"y":780,"width":60,"height":40},{"name":"sprite207","x":898,"y":780,"width":60,"height":40},{"name":"sprite208","x":962,"y":780,"width":60,"height":40},{"name":"sprite209","x":2,"y":844,"width":60,"height":40},{"name":"sprite210","x":66,"y":844,"width":60,"height":40},{"name":"sprite211","x":130,"y":844,"width":60,"height":40},{"name":"sprite212","x":194,"y":844,"width":60,"height":40},{"name":"sprite213","x":258,"y":844,"width":60,"height":40},{"name":"sprite214","x":322,"y":844,"width":60,"height":40},{"name":"sprite215","x":386,"y":844,"width":60,"height":40},{"name":"sprite216","x":450,"y":844,"width":60,"height":40},{"name":"sprite217","x":514,"y":844,"width":60,"height":40},{"name":"sprite218","x":578,"y":844,"width":60,"height":40},{"name":"sprite219","x":642,"y":844,"width":60,"height":40},{"name":"sprite220","x":706,"y":844,"width":60,"height":40},{"name":"sprite221","x":770,"y":844,"width":60,"height":40},{"name":"sprite222","x":834,"y":844,"width":60,"height":40},{"name":"sprite223","x":898,"y":844,"width":60,"height":40},{"name":"sprite224","x":962,"y":844,"width":60,"height":40},{"name":"sprite225","x":2,"y":908,"width":60,"height":40},{"name":"sprite226","x":66,"y":908,"width":60,"height":40},{"name":"sprite227","x":130,"y":908,"width":60,"height":40},{"name":"sprite228","x":204,"y":908,"width":40,"height":40},{"name":"sprite229","x":258,"y":908,"width":60,"height":40},{"name":"sprite230","x":322,"y":908,"width":60,"height":40},{"name":"sprite231","x":386,"y":908,"width":60,"height":40},{"name":"sprite232","x":450,"y":908,"width":60,"height":40},{"name":"sprite233","x":514,"y":908,"width":60,"height":40},{"name":"sprite234","x":578,"y":908,"width":60,"height":40},{"name":"sprite235","x":642,"y":908,"width":60,"height":40},{"name":"sprite236","x":706,"y":908,"width":60,"height":40},{"name":"sprite237","x":770,"y":908,"width":60,"height":40},{"name":"sprite238","x":834,"y":908,"width":60,"height":40},{"name":"sprite239","x":898,"y":908,"width":60,"height":40},{"name":"sprite240","x":962,"y":908,"width":60,"height":40},{"name":"sprite241","x":2,"y":972,"width":60,"height":40}]')},function(t,e,i){(function(i){var n;!function(){"use strict";var r=function(){this.init()};r.prototype={init:function(){var t=this||s;return t._counter=1e3,t._html5AudioPool=[],t.html5PoolSize=10,t._codecs={},t._howls=[],t._muted=!1,t._volume=1,t._canPlayEvent="canplaythrough",t._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,t.masterGain=null,t.noAudio=!1,t.usingWebAudio=!0,t.autoSuspend=!0,t.ctx=null,t.autoUnlock=!0,t._setup(),t},volume:function(t){var e=this||s;if(t=parseFloat(t),e.ctx||p(),void 0!==t&&t>=0&&t<=1){if(e._volume=t,e._muted)return e;e.usingWebAudio&&e.masterGain.gain.setValueAtTime(t,s.ctx.currentTime);for(var i=0;i<e._howls.length;i++)if(!e._howls[i]._webAudio)for(var n=e._howls[i]._getSoundIds(),r=0;r<n.length;r++){var o=e._howls[i]._soundById(n[r]);o&&o._node&&(o._node.volume=o._volume*t)}return e}return e._volume},mute:function(t){var e=this||s;e.ctx||p(),e._muted=t,e.usingWebAudio&&e.masterGain.gain.setValueAtTime(t?0:e._volume,s.ctx.currentTime);for(var i=0;i<e._howls.length;i++)if(!e._howls[i]._webAudio)for(var n=e._howls[i]._getSoundIds(),r=0;r<n.length;r++){var o=e._howls[i]._soundById(n[r]);o&&o._node&&(o._node.muted=!!t||o._muted)}return e},stop:function(){for(var t=this||s,e=0;e<t._howls.length;e++)t._howls[e].stop();return t},unload:function(){for(var t=this||s,e=t._howls.length-1;e>=0;e--)t._howls[e].unload();return t.usingWebAudio&&t.ctx&&void 0!==t.ctx.close&&(t.ctx.close(),t.ctx=null,p()),t},codecs:function(t){return(this||s)._codecs[t.replace(/^x-/,"")]},_setup:function(){var t=this||s;if(t.state=t.ctx&&t.ctx.state||"suspended",t._autoSuspend(),!t.usingWebAudio)if("undefined"!=typeof Audio)try{void 0===(new Audio).oncanplaythrough&&(t._canPlayEvent="canplay")}catch(e){t.noAudio=!0}else t.noAudio=!0;try{(new Audio).muted&&(t.noAudio=!0)}catch(t){}return t.noAudio||t._setupCodecs(),t},_setupCodecs:function(){var t=this||s,e=null;try{e="undefined"!=typeof Audio?new Audio:null}catch(e){return t}if(!e||"function"!=typeof e.canPlayType)return t;var i=e.canPlayType("audio/mpeg;").replace(/^no$/,""),n=t._navigator?t._navigator.userAgent:"",r=n.match(/OPR\/([0-6].)/g),o=r&&parseInt(r[0].split("/")[1],10)<33,a=-1!==n.indexOf("Safari")&&-1===n.indexOf("Chrome"),h=n.match(/Version\/(.*?) /),l=a&&h&&parseInt(h[1],10)<15;return t._codecs={mp3:!(o||!i&&!e.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!i,opus:!!e.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(e.canPlayType('audio/wav; codecs="1"')||e.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!e.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!e.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(e.canPlayType("audio/x-m4a;")||e.canPlayType("audio/m4a;")||e.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(e.canPlayType("audio/x-m4b;")||e.canPlayType("audio/m4b;")||e.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(e.canPlayType("audio/x-mp4;")||e.canPlayType("audio/mp4;")||e.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!(l||!e.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!(l||!e.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!e.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(e.canPlayType("audio/x-flac;")||e.canPlayType("audio/flac;")).replace(/^no$/,"")},t},_unlockAudio:function(){var t=this||s;if(!t._audioUnlocked&&t.ctx){t._audioUnlocked=!1,t.autoUnlock=!1,t._mobileUnloaded||44100===t.ctx.sampleRate||(t._mobileUnloaded=!0,t.unload()),t._scratchBuffer=t.ctx.createBuffer(1,1,22050);var e=function(i){for(;t._html5AudioPool.length<t.html5PoolSize;)try{var n=new Audio;n._unlocked=!0,t._releaseHtml5Audio(n)}catch(i){t.noAudio=!0;break}for(var r=0;r<t._howls.length;r++)if(!t._howls[r]._webAudio)for(var s=t._howls[r]._getSoundIds(),o=0;o<s.length;o++){var a=t._howls[r]._soundById(s[o]);a&&a._node&&!a._node._unlocked&&(a._node._unlocked=!0,a._node.load())}t._autoResume();var h=t.ctx.createBufferSource();h.buffer=t._scratchBuffer,h.connect(t.ctx.destination),void 0===h.start?h.noteOn(0):h.start(0),"function"==typeof t.ctx.resume&&t.ctx.resume(),h.onended=function(){h.disconnect(0),t._audioUnlocked=!0,document.removeEventListener("touchstart",e,!0),document.removeEventListener("touchend",e,!0),document.removeEventListener("click",e,!0),document.removeEventListener("keydown",e,!0);for(var i=0;i<t._howls.length;i++)t._howls[i]._emit("unlock")}};return document.addEventListener("touchstart",e,!0),document.addEventListener("touchend",e,!0),document.addEventListener("click",e,!0),document.addEventListener("keydown",e,!0),t}},_obtainHtml5Audio:function(){var t=this||s;if(t._html5AudioPool.length)return t._html5AudioPool.pop();var e=(new Audio).play();return e&&"undefined"!=typeof Promise&&(e instanceof Promise||"function"==typeof e.then)&&e.catch((function(){})),new Audio},_releaseHtml5Audio:function(t){var e=this||s;return t._unlocked&&e._html5AudioPool.push(t),e},_autoSuspend:function(){var t=this;if(t.autoSuspend&&t.ctx&&void 0!==t.ctx.suspend&&s.usingWebAudio){for(var e=0;e<t._howls.length;e++)if(t._howls[e]._webAudio)for(var i=0;i<t._howls[e]._sounds.length;i++)if(!t._howls[e]._sounds[i]._paused)return t;return t._suspendTimer&&clearTimeout(t._suspendTimer),t._suspendTimer=setTimeout((function(){if(t.autoSuspend){t._suspendTimer=null,t.state="suspending";var e=function(){t.state="suspended",t._resumeAfterSuspend&&(delete t._resumeAfterSuspend,t._autoResume())};t.ctx.suspend().then(e,e)}}),3e4),t}},_autoResume:function(){var t=this;if(t.ctx&&void 0!==t.ctx.resume&&s.usingWebAudio)return"running"===t.state&&"interrupted"!==t.ctx.state&&t._suspendTimer?(clearTimeout(t._suspendTimer),t._suspendTimer=null):"suspended"===t.state||"running"===t.state&&"interrupted"===t.ctx.state?(t.ctx.resume().then((function(){t.state="running";for(var e=0;e<t._howls.length;e++)t._howls[e]._emit("resume")})),t._suspendTimer&&(clearTimeout(t._suspendTimer),t._suspendTimer=null)):"suspending"===t.state&&(t._resumeAfterSuspend=!0),t}};var s=new r,o=function(t){t.src&&0!==t.src.length&&this.init(t)};o.prototype={init:function(t){var e=this;return s.ctx||p(),e._autoplay=t.autoplay||!1,e._format="string"!=typeof t.format?t.format:[t.format],e._html5=t.html5||!1,e._muted=t.mute||!1,e._loop=t.loop||!1,e._pool=t.pool||5,e._preload="boolean"!=typeof t.preload&&"metadata"!==t.preload||t.preload,e._rate=t.rate||1,e._sprite=t.sprite||{},e._src="string"!=typeof t.src?t.src:[t.src],e._volume=void 0!==t.volume?t.volume:1,e._xhr={method:t.xhr&&t.xhr.method?t.xhr.method:"GET",headers:t.xhr&&t.xhr.headers?t.xhr.headers:null,withCredentials:!(!t.xhr||!t.xhr.withCredentials)&&t.xhr.withCredentials},e._duration=0,e._state="unloaded",e._sounds=[],e._endTimers={},e._queue=[],e._playLock=!1,e._onend=t.onend?[{fn:t.onend}]:[],e._onfade=t.onfade?[{fn:t.onfade}]:[],e._onload=t.onload?[{fn:t.onload}]:[],e._onloaderror=t.onloaderror?[{fn:t.onloaderror}]:[],e._onplayerror=t.onplayerror?[{fn:t.onplayerror}]:[],e._onpause=t.onpause?[{fn:t.onpause}]:[],e._onplay=t.onplay?[{fn:t.onplay}]:[],e._onstop=t.onstop?[{fn:t.onstop}]:[],e._onmute=t.onmute?[{fn:t.onmute}]:[],e._onvolume=t.onvolume?[{fn:t.onvolume}]:[],e._onrate=t.onrate?[{fn:t.onrate}]:[],e._onseek=t.onseek?[{fn:t.onseek}]:[],e._onunlock=t.onunlock?[{fn:t.onunlock}]:[],e._onresume=[],e._webAudio=s.usingWebAudio&&!e._html5,void 0!==s.ctx&&s.ctx&&s.autoUnlock&&s._unlockAudio(),s._howls.push(e),e._autoplay&&e._queue.push({event:"play",action:function(){e.play()}}),e._preload&&"none"!==e._preload&&e.load(),e},load:function(){var t=null;if(s.noAudio)this._emit("loaderror",null,"No audio support.");else{"string"==typeof this._src&&(this._src=[this._src]);for(var e=0;e<this._src.length;e++){var i,n;if(this._format&&this._format[e])i=this._format[e];else{if("string"!=typeof(n=this._src[e])){this._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}(i=/^data:audio\/([^;,]+);/i.exec(n))||(i=/\.([^.]+)$/.exec(n.split("?",1)[0])),i&&(i=i[1].toLowerCase())}if(i&&s.codecs(i)){t=this._src[e];break}}if(t)return this._src=t,this._state="loading","https:"===window.location.protocol&&"http:"===t.slice(0,5)&&(this._html5=!0,this._webAudio=!1),new a(this),this._webAudio&&l(this),this;this._emit("loaderror",null,"No codec support for selected audio sources.")}},play:function(t,e){var i=this,n=null;if("number"==typeof t)n=t,t=null;else{if("string"==typeof t&&"loaded"===i._state&&!i._sprite[t])return null;if(void 0===t&&(t="__default",!i._playLock)){for(var r=0,o=0;o<i._sounds.length;o++)i._sounds[o]._paused&&!i._sounds[o]._ended&&(r++,n=i._sounds[o]._id);1===r?t=null:n=null}}var a=n?i._soundById(n):i._inactiveSound();if(!a)return null;if(n&&!t&&(t=a._sprite||"__default"),"loaded"!==i._state){a._sprite=t,a._ended=!1;var h=a._id;return i._queue.push({event:"play",action:function(){i.play(h)}}),h}if(n&&!a._paused)return e||i._loadQueue("play"),a._id;i._webAudio&&s._autoResume();var l=Math.max(0,a._seek>0?a._seek:i._sprite[t][0]/1e3),u=Math.max(0,(i._sprite[t][0]+i._sprite[t][1])/1e3-l),c=1e3*u/Math.abs(a._rate),d=i._sprite[t][0]/1e3,p=(i._sprite[t][0]+i._sprite[t][1])/1e3;a._sprite=t,a._ended=!1;var f=function(){a._paused=!1,a._seek=l,a._start=d,a._stop=p,a._loop=!(!a._loop&&!i._sprite[t][2])};if(!(l>=p)){var m=a._node;if(i._webAudio){var g=function(){i._playLock=!1,f(),i._refreshBuffer(a);var t=a._muted||i._muted?0:a._volume;m.gain.setValueAtTime(t,s.ctx.currentTime),a._playStart=s.ctx.currentTime,void 0===m.bufferSource.start?a._loop?m.bufferSource.noteGrainOn(0,l,86400):m.bufferSource.noteGrainOn(0,l,u):a._loop?m.bufferSource.start(0,l,86400):m.bufferSource.start(0,l,u),c!==1/0&&(i._endTimers[a._id]=setTimeout(i._ended.bind(i,a),c)),e||setTimeout((function(){i._emit("play",a._id),i._loadQueue()}),0)};"running"===s.state&&"interrupted"!==s.ctx.state?g():(i._playLock=!0,i.once("resume",g),i._clearTimer(a._id))}else{var v=function(){m.currentTime=l,m.muted=a._muted||i._muted||s._muted||m.muted,m.volume=a._volume*s.volume(),m.playbackRate=a._rate;try{var n=m.play();if(n&&"undefined"!=typeof Promise&&(n instanceof Promise||"function"==typeof n.then)?(i._playLock=!0,f(),n.then((function(){i._playLock=!1,m._unlocked=!0,e?i._loadQueue():i._emit("play",a._id)})).catch((function(){i._playLock=!1,i._emit("playerror",a._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),a._ended=!0,a._paused=!0}))):e||(i._playLock=!1,f(),i._emit("play",a._id)),m.playbackRate=a._rate,m.paused)return void i._emit("playerror",a._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==t||a._loop?i._endTimers[a._id]=setTimeout(i._ended.bind(i,a),c):(i._endTimers[a._id]=function(){i._ended(a),m.removeEventListener("ended",i._endTimers[a._id],!1)},m.addEventListener("ended",i._endTimers[a._id],!1))}catch(t){i._emit("playerror",a._id,t)}};"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===m.src&&(m.src=i._src,m.load());var y=window&&window.ejecta||!m.readyState&&s._navigator.isCocoonJS;if(m.readyState>=3||y)v();else{i._playLock=!0,i._state="loading";var x=function(){i._state="loaded",v(),m.removeEventListener(s._canPlayEvent,x,!1)};m.addEventListener(s._canPlayEvent,x,!1),i._clearTimer(a._id)}}return a._id}i._ended(a)},pause:function(t){var e=this;if("loaded"!==e._state||e._playLock)return e._queue.push({event:"pause",action:function(){e.pause(t)}}),e;for(var i=e._getSoundIds(t),n=0;n<i.length;n++){e._clearTimer(i[n]);var r=e._soundById(i[n]);if(r&&!r._paused&&(r._seek=e.seek(i[n]),r._rateSeek=0,r._paused=!0,e._stopFade(i[n]),r._node))if(e._webAudio){if(!r._node.bufferSource)continue;void 0===r._node.bufferSource.stop?r._node.bufferSource.noteOff(0):r._node.bufferSource.stop(0),e._cleanBuffer(r._node)}else isNaN(r._node.duration)&&r._node.duration!==1/0||r._node.pause();arguments[1]||e._emit("pause",r?r._id:null)}return e},stop:function(t,e){var i=this;if("loaded"!==i._state||i._playLock)return i._queue.push({event:"stop",action:function(){i.stop(t)}}),i;for(var n=i._getSoundIds(t),r=0;r<n.length;r++){i._clearTimer(n[r]);var s=i._soundById(n[r]);s&&(s._seek=s._start||0,s._rateSeek=0,s._paused=!0,s._ended=!0,i._stopFade(n[r]),s._node&&(i._webAudio?s._node.bufferSource&&(void 0===s._node.bufferSource.stop?s._node.bufferSource.noteOff(0):s._node.bufferSource.stop(0),i._cleanBuffer(s._node)):isNaN(s._node.duration)&&s._node.duration!==1/0||(s._node.currentTime=s._start||0,s._node.pause(),s._node.duration===1/0&&i._clearSound(s._node))),e||i._emit("stop",s._id))}return i},mute:function(t,e){var i=this;if("loaded"!==i._state||i._playLock)return i._queue.push({event:"mute",action:function(){i.mute(t,e)}}),i;if(void 0===e){if("boolean"!=typeof t)return i._muted;i._muted=t}for(var n=i._getSoundIds(e),r=0;r<n.length;r++){var o=i._soundById(n[r]);o&&(o._muted=t,o._interval&&i._stopFade(o._id),i._webAudio&&o._node?o._node.gain.setValueAtTime(t?0:o._volume,s.ctx.currentTime):o._node&&(o._node.muted=!!s._muted||t),i._emit("mute",o._id))}return i},volume:function(){var t,e,i,n=this,r=arguments;if(0===r.length)return n._volume;if(1===r.length||2===r.length&&void 0===r[1]){var o=n._getSoundIds(),a=o.indexOf(r[0]);a>=0?e=parseInt(r[0],10):t=parseFloat(r[0])}else r.length>=2&&(t=parseFloat(r[0]),e=parseInt(r[1],10));if(!(void 0!==t&&t>=0&&t<=1))return(i=e?n._soundById(e):n._sounds[0])?i._volume:0;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"volume",action:function(){n.volume.apply(n,r)}}),n;void 0===e&&(n._volume=t),e=n._getSoundIds(e);for(var h=0;h<e.length;h++)(i=n._soundById(e[h]))&&(i._volume=t,r[2]||n._stopFade(e[h]),n._webAudio&&i._node&&!i._muted?i._node.gain.setValueAtTime(t,s.ctx.currentTime):i._node&&!i._muted&&(i._node.volume=t*s.volume()),n._emit("volume",i._id));return n},fade:function(t,e,i,n){var r=this;if("loaded"!==r._state||r._playLock)return r._queue.push({event:"fade",action:function(){r.fade(t,e,i,n)}}),r;t=Math.min(Math.max(0,parseFloat(t)),1),e=Math.min(Math.max(0,parseFloat(e)),1),i=parseFloat(i),r.volume(t,n);for(var o=r._getSoundIds(n),a=0;a<o.length;a++){var h=r._soundById(o[a]);if(h){if(n||r._stopFade(o[a]),r._webAudio&&!h._muted){var l=s.ctx.currentTime,u=l+i/1e3;h._volume=t,h._node.gain.setValueAtTime(t,l),h._node.gain.linearRampToValueAtTime(e,u)}r._startFadeInterval(h,t,e,i,o[a],void 0===n)}}return r},_startFadeInterval:function(t,e,i,n,r,s){var o=this,a=e,h=i-e,l=Math.abs(h/.01),u=Math.max(4,l>0?n/l:n),c=Date.now();t._fadeTo=i,t._interval=setInterval((function(){var r=(Date.now()-c)/n;c=Date.now(),a+=h*r,a=Math.round(100*a)/100,a=h<0?Math.max(i,a):Math.min(i,a),o._webAudio?t._volume=a:o.volume(a,t._id,!0),s&&(o._volume=a),(i<e&&a<=i||i>e&&a>=i)&&(clearInterval(t._interval),t._interval=null,t._fadeTo=null,o.volume(i,t._id),o._emit("fade",t._id))}),u)},_stopFade:function(t){var e=this._soundById(t);return e&&e._interval&&(this._webAudio&&e._node.gain.cancelScheduledValues(s.ctx.currentTime),clearInterval(e._interval),e._interval=null,this.volume(e._fadeTo,t),e._fadeTo=null,this._emit("fade",t)),this},loop:function(){var t,e,i,n=this,r=arguments;if(0===r.length)return n._loop;if(1===r.length){if("boolean"!=typeof r[0])return!!(i=n._soundById(parseInt(r[0],10)))&&i._loop;t=r[0],n._loop=t}else 2===r.length&&(t=r[0],e=parseInt(r[1],10));for(var s=n._getSoundIds(e),o=0;o<s.length;o++)(i=n._soundById(s[o]))&&(i._loop=t,n._webAudio&&i._node&&i._node.bufferSource&&(i._node.bufferSource.loop=t,t&&(i._node.bufferSource.loopStart=i._start||0,i._node.bufferSource.loopEnd=i._stop,n.playing(s[o])&&(n.pause(s[o],!0),n.play(s[o],!0)))));return n},rate:function(){var t,e,i,n=this,r=arguments;if(0===r.length)e=n._sounds[0]._id;else if(1===r.length){var o=n._getSoundIds(),a=o.indexOf(r[0]);a>=0?e=parseInt(r[0],10):t=parseFloat(r[0])}else 2===r.length&&(t=parseFloat(r[0]),e=parseInt(r[1],10));if("number"!=typeof t)return(i=n._soundById(e))?i._rate:n._rate;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"rate",action:function(){n.rate.apply(n,r)}}),n;void 0===e&&(n._rate=t),e=n._getSoundIds(e);for(var h=0;h<e.length;h++)if(i=n._soundById(e[h])){n.playing(e[h])&&(i._rateSeek=n.seek(e[h]),i._playStart=n._webAudio?s.ctx.currentTime:i._playStart),i._rate=t,n._webAudio&&i._node&&i._node.bufferSource?i._node.bufferSource.playbackRate.setValueAtTime(t,s.ctx.currentTime):i._node&&(i._node.playbackRate=t);var l=n.seek(e[h]),u=(n._sprite[i._sprite][0]+n._sprite[i._sprite][1])/1e3-l,c=1e3*u/Math.abs(i._rate);!n._endTimers[e[h]]&&i._paused||(n._clearTimer(e[h]),n._endTimers[e[h]]=setTimeout(n._ended.bind(n,i),c)),n._emit("rate",i._id)}return n},seek:function(){var t,e,i=this,n=arguments;if(0===n.length)i._sounds.length&&(e=i._sounds[0]._id);else if(1===n.length){var r=i._getSoundIds(),o=r.indexOf(n[0]);o>=0?e=parseInt(n[0],10):i._sounds.length&&(e=i._sounds[0]._id,t=parseFloat(n[0]))}else 2===n.length&&(t=parseFloat(n[0]),e=parseInt(n[1],10));if(void 0===e)return 0;if("number"==typeof t&&("loaded"!==i._state||i._playLock))return i._queue.push({event:"seek",action:function(){i.seek.apply(i,n)}}),i;var a=i._soundById(e);if(a){if(!("number"==typeof t&&t>=0)){if(i._webAudio){var h=i.playing(e)?s.ctx.currentTime-a._playStart:0,l=a._rateSeek?a._rateSeek-a._seek:0;return a._seek+(l+h*Math.abs(a._rate))}return a._node.currentTime}var u=i.playing(e);u&&i.pause(e,!0),a._seek=t,a._ended=!1,i._clearTimer(e),i._webAudio||!a._node||isNaN(a._node.duration)||(a._node.currentTime=t);var c=function(){u&&i.play(e,!0),i._emit("seek",e)};if(u&&!i._webAudio){var d=function(){i._playLock?setTimeout(d,0):c()};setTimeout(d,0)}else c()}return i},playing:function(t){if("number"==typeof t){var e=this._soundById(t);return!!e&&!e._paused}for(var i=0;i<this._sounds.length;i++)if(!this._sounds[i]._paused)return!0;return!1},duration:function(t){var e=this._duration,i=this._soundById(t);return i&&(e=this._sprite[i._sprite][1]/1e3),e},state:function(){return this._state},unload:function(){for(var t=this,e=t._sounds,i=0;i<e.length;i++)e[i]._paused||t.stop(e[i]._id),t._webAudio||(t._clearSound(e[i]._node),e[i]._node.removeEventListener("error",e[i]._errorFn,!1),e[i]._node.removeEventListener(s._canPlayEvent,e[i]._loadFn,!1),e[i]._node.removeEventListener("ended",e[i]._endFn,!1),s._releaseHtml5Audio(e[i]._node)),delete e[i]._node,t._clearTimer(e[i]._id);var n=s._howls.indexOf(t);n>=0&&s._howls.splice(n,1);var r=!0;for(i=0;i<s._howls.length;i++)if(s._howls[i]._src===t._src||t._src.indexOf(s._howls[i]._src)>=0){r=!1;break}return h&&r&&delete h[t._src],s.noAudio=!1,t._state="unloaded",t._sounds=[],t=null,null},on:function(t,e,i,n){var r=this["_on"+t];return"function"==typeof e&&r.push(n?{id:i,fn:e,once:n}:{id:i,fn:e}),this},off:function(t,e,i){var n=this["_on"+t],r=0;if("number"==typeof e&&(i=e,e=null),e||i)for(r=0;r<n.length;r++){var s=i===n[r].id;if(e===n[r].fn&&s||!e&&s){n.splice(r,1);break}}else if(t)this["_on"+t]=[];else{var o=Object.keys(this);for(r=0;r<o.length;r++)0===o[r].indexOf("_on")&&Array.isArray(this[o[r]])&&(this[o[r]]=[])}return this},once:function(t,e,i){return this.on(t,e,i,1),this},_emit:function(t,e,i){for(var n=this["_on"+t],r=n.length-1;r>=0;r--)n[r].id&&n[r].id!==e&&"load"!==t||(setTimeout(function(t){t.call(this,e,i)}.bind(this,n[r].fn),0),n[r].once&&this.off(t,n[r].fn,n[r].id));return this._loadQueue(t),this},_loadQueue:function(t){if(this._queue.length>0){var e=this._queue[0];e.event===t&&(this._queue.shift(),this._loadQueue()),t||e.action()}return this},_ended:function(t){var e=t._sprite;if(!this._webAudio&&t._node&&!t._node.paused&&!t._node.ended&&t._node.currentTime<t._stop)return setTimeout(this._ended.bind(this,t),100),this;var i=!(!t._loop&&!this._sprite[e][2]);if(this._emit("end",t._id),!this._webAudio&&i&&this.stop(t._id,!0).play(t._id),this._webAudio&&i){this._emit("play",t._id),t._seek=t._start||0,t._rateSeek=0,t._playStart=s.ctx.currentTime;var n=1e3*(t._stop-t._start)/Math.abs(t._rate);this._endTimers[t._id]=setTimeout(this._ended.bind(this,t),n)}return this._webAudio&&!i&&(t._paused=!0,t._ended=!0,t._seek=t._start||0,t._rateSeek=0,this._clearTimer(t._id),this._cleanBuffer(t._node),s._autoSuspend()),this._webAudio||i||this.stop(t._id,!0),this},_clearTimer:function(t){if(this._endTimers[t]){if("function"!=typeof this._endTimers[t])clearTimeout(this._endTimers[t]);else{var e=this._soundById(t);e&&e._node&&e._node.removeEventListener("ended",this._endTimers[t],!1)}delete this._endTimers[t]}return this},_soundById:function(t){for(var e=0;e<this._sounds.length;e++)if(t===this._sounds[e]._id)return this._sounds[e];return null},_inactiveSound:function(){this._drain();for(var t=0;t<this._sounds.length;t++)if(this._sounds[t]._ended)return this._sounds[t].reset();return new a(this)},_drain:function(){var t=this._pool,e=0,i=0;if(!(this._sounds.length<t)){for(i=0;i<this._sounds.length;i++)this._sounds[i]._ended&&e++;for(i=this._sounds.length-1;i>=0;i--){if(e<=t)return;this._sounds[i]._ended&&(this._webAudio&&this._sounds[i]._node&&this._sounds[i]._node.disconnect(0),this._sounds.splice(i,1),e--)}}},_getSoundIds:function(t){if(void 0===t){for(var e=[],i=0;i<this._sounds.length;i++)e.push(this._sounds[i]._id);return e}return[t]},_refreshBuffer:function(t){return t._node.bufferSource=s.ctx.createBufferSource(),t._node.bufferSource.buffer=h[this._src],t._panner?t._node.bufferSource.connect(t._panner):t._node.bufferSource.connect(t._node),t._node.bufferSource.loop=t._loop,t._loop&&(t._node.bufferSource.loopStart=t._start||0,t._node.bufferSource.loopEnd=t._stop||0),t._node.bufferSource.playbackRate.setValueAtTime(t._rate,s.ctx.currentTime),this},_cleanBuffer:function(t){var e=s._navigator&&s._navigator.vendor.indexOf("Apple")>=0;if(s._scratchBuffer&&t.bufferSource&&(t.bufferSource.onended=null,t.bufferSource.disconnect(0),e))try{t.bufferSource.buffer=s._scratchBuffer}catch(t){}return t.bufferSource=null,this},_clearSound:function(t){/MSIE |Trident\//.test(s._navigator&&s._navigator.userAgent)||(t.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var a=function(t){this._parent=t,this.init()};a.prototype={init:function(){var t=this._parent;return this._muted=t._muted,this._loop=t._loop,this._volume=t._volume,this._rate=t._rate,this._seek=0,this._paused=!0,this._ended=!0,this._sprite="__default",this._id=++s._counter,t._sounds.push(this),this.create(),this},create:function(){var t=this._parent,e=s._muted||this._muted||this._parent._muted?0:this._volume;return t._webAudio?(this._node=void 0===s.ctx.createGain?s.ctx.createGainNode():s.ctx.createGain(),this._node.gain.setValueAtTime(e,s.ctx.currentTime),this._node.paused=!0,this._node.connect(s.masterGain)):s.noAudio||(this._node=s._obtainHtml5Audio(),this._errorFn=this._errorListener.bind(this),this._node.addEventListener("error",this._errorFn,!1),this._loadFn=this._loadListener.bind(this),this._node.addEventListener(s._canPlayEvent,this._loadFn,!1),this._endFn=this._endListener.bind(this),this._node.addEventListener("ended",this._endFn,!1),this._node.src=t._src,this._node.preload=!0===t._preload?"auto":t._preload,this._node.volume=e*s.volume(),this._node.load()),this},reset:function(){var t=this._parent;return this._muted=t._muted,this._loop=t._loop,this._volume=t._volume,this._rate=t._rate,this._seek=0,this._rateSeek=0,this._paused=!0,this._ended=!0,this._sprite="__default",this._id=++s._counter,this},_errorListener:function(){this._parent._emit("loaderror",this._id,this._node.error?this._node.error.code:0),this._node.removeEventListener("error",this._errorFn,!1)},_loadListener:function(){var t=this._parent;t._duration=Math.ceil(10*this._node.duration)/10,0===Object.keys(t._sprite).length&&(t._sprite={__default:[0,1e3*t._duration]}),"loaded"!==t._state&&(t._state="loaded",t._emit("load"),t._loadQueue()),this._node.removeEventListener(s._canPlayEvent,this._loadFn,!1)},_endListener:function(){var t=this._parent;t._duration===1/0&&(t._duration=Math.ceil(10*this._node.duration)/10,t._sprite.__default[1]===1/0&&(t._sprite.__default[1]=1e3*t._duration),t._ended(this)),this._node.removeEventListener("ended",this._endFn,!1)}};var h={},l=function(t){var e=t._src;if(h[e])return t._duration=h[e].duration,void d(t);if(/^data:[^;]+;base64,/.test(e)){for(var i=atob(e.split(",")[1]),n=new Uint8Array(i.length),r=0;r<i.length;++r)n[r]=i.charCodeAt(r);c(n.buffer,t)}else{var s=new XMLHttpRequest;s.open(t._xhr.method,e,!0),s.withCredentials=t._xhr.withCredentials,s.responseType="arraybuffer",t._xhr.headers&&Object.keys(t._xhr.headers).forEach((function(e){s.setRequestHeader(e,t._xhr.headers[e])})),s.onload=function(){var e=(s.status+"")[0];"0"===e||"2"===e||"3"===e?c(s.response,t):t._emit("loaderror",null,"Failed loading audio file with status: "+s.status+".")},s.onerror=function(){t._webAudio&&(t._html5=!0,t._webAudio=!1,t._sounds=[],delete h[e],t.load())},u(s)}},u=function(t){try{t.send()}catch(e){t.onerror()}},c=function(t,e){var i=function(){e._emit("loaderror",null,"Decoding audio data failed.")},n=function(t){t&&e._sounds.length>0?(h[e._src]=t,d(e,t)):i()};"undefined"!=typeof Promise&&1===s.ctx.decodeAudioData.length?s.ctx.decodeAudioData(t).then(n).catch(i):s.ctx.decodeAudioData(t,n,i)},d=function(t,e){e&&!t._duration&&(t._duration=e.duration),0===Object.keys(t._sprite).length&&(t._sprite={__default:[0,1e3*t._duration]}),"loaded"!==t._state&&(t._state="loaded",t._emit("load"),t._loadQueue())},p=function(){if(s.usingWebAudio){try{"undefined"!=typeof AudioContext?s.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?s.ctx=new webkitAudioContext:s.usingWebAudio=!1}catch(t){s.usingWebAudio=!1}s.ctx||(s.usingWebAudio=!1);var t=/iP(hone|od|ad)/.test(s._navigator&&s._navigator.platform),e=s._navigator&&s._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),i=e?parseInt(e[1],10):null;if(t&&i&&i<9){var n=/safari/.test(s._navigator&&s._navigator.userAgent.toLowerCase());s._navigator&&!n&&(s.usingWebAudio=!1)}s.usingWebAudio&&(s.masterGain=void 0===s.ctx.createGain?s.ctx.createGainNode():s.ctx.createGain(),s.masterGain.gain.setValueAtTime(s._muted?0:s._volume,s.ctx.currentTime),s.masterGain.connect(s.ctx.destination)),s._setup()}};void 0===(n=function(){return{Howler:s,Howl:o}}.apply(e,[]))||(t.exports=n),e.Howler=s,e.Howl=o,void 0!==i?(i.HowlerGlobal=r,i.Howler=s,i.Howl=o,i.Sound=a):"undefined"!=typeof window&&(window.HowlerGlobal=r,window.Howler=s,window.Howl=o,window.Sound=a)}(),function(){"use strict";var t;HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(t){if(!this.ctx||!this.ctx.listener)return this;for(var e=this._howls.length-1;e>=0;e--)this._howls[e].stereo(t);return this},HowlerGlobal.prototype.pos=function(t,e,i){return this.ctx&&this.ctx.listener?(e="number"!=typeof e?this._pos[1]:e,i="number"!=typeof i?this._pos[2]:i,"number"!=typeof t?this._pos:(this._pos=[t,e,i],void 0!==this.ctx.listener.positionX?(this.ctx.listener.positionX.setTargetAtTime(this._pos[0],Howler.ctx.currentTime,.1),this.ctx.listener.positionY.setTargetAtTime(this._pos[1],Howler.ctx.currentTime,.1),this.ctx.listener.positionZ.setTargetAtTime(this._pos[2],Howler.ctx.currentTime,.1)):this.ctx.listener.setPosition(this._pos[0],this._pos[1],this._pos[2]),this)):this},HowlerGlobal.prototype.orientation=function(t,e,i,n,r,s){if(!this.ctx||!this.ctx.listener)return this;var o=this._orientation;return e="number"!=typeof e?o[1]:e,i="number"!=typeof i?o[2]:i,n="number"!=typeof n?o[3]:n,r="number"!=typeof r?o[4]:r,s="number"!=typeof s?o[5]:s,"number"!=typeof t?o:(this._orientation=[t,e,i,n,r,s],void 0!==this.ctx.listener.forwardX?(this.ctx.listener.forwardX.setTargetAtTime(t,Howler.ctx.currentTime,.1),this.ctx.listener.forwardY.setTargetAtTime(e,Howler.ctx.currentTime,.1),this.ctx.listener.forwardZ.setTargetAtTime(i,Howler.ctx.currentTime,.1),this.ctx.listener.upX.setTargetAtTime(n,Howler.ctx.currentTime,.1),this.ctx.listener.upY.setTargetAtTime(r,Howler.ctx.currentTime,.1),this.ctx.listener.upZ.setTargetAtTime(s,Howler.ctx.currentTime,.1)):this.ctx.listener.setOrientation(t,e,i,n,r,s),this)},Howl.prototype.init=(t=Howl.prototype.init,function(e){return this._orientation=e.orientation||[1,0,0],this._stereo=e.stereo||null,this._pos=e.pos||null,this._pannerAttr={coneInnerAngle:void 0!==e.coneInnerAngle?e.coneInnerAngle:360,coneOuterAngle:void 0!==e.coneOuterAngle?e.coneOuterAngle:360,coneOuterGain:void 0!==e.coneOuterGain?e.coneOuterGain:0,distanceModel:void 0!==e.distanceModel?e.distanceModel:"inverse",maxDistance:void 0!==e.maxDistance?e.maxDistance:1e4,panningModel:void 0!==e.panningModel?e.panningModel:"HRTF",refDistance:void 0!==e.refDistance?e.refDistance:1,rolloffFactor:void 0!==e.rolloffFactor?e.rolloffFactor:1},this._onstereo=e.onstereo?[{fn:e.onstereo}]:[],this._onpos=e.onpos?[{fn:e.onpos}]:[],this._onorientation=e.onorientation?[{fn:e.onorientation}]:[],t.call(this,e)}),Howl.prototype.stereo=function(t,i){var n=this;if(!n._webAudio)return n;if("loaded"!==n._state)return n._queue.push({event:"stereo",action:function(){n.stereo(t,i)}}),n;var r=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===i){if("number"!=typeof t)return n._stereo;n._stereo=t,n._pos=[t,0,0]}for(var s=n._getSoundIds(i),o=0;o<s.length;o++){var a=n._soundById(s[o]);if(a){if("number"!=typeof t)return a._stereo;a._stereo=t,a._pos=[t,0,0],a._node&&(a._pannerAttr.panningModel="equalpower",a._panner&&a._panner.pan||e(a,r),"spatial"===r?void 0!==a._panner.positionX?(a._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),a._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),a._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):a._panner.setPosition(t,0,0):a._panner.pan.setValueAtTime(t,Howler.ctx.currentTime)),n._emit("stereo",a._id)}}return n},Howl.prototype.pos=function(t,i,n,r){var s=this;if(!s._webAudio)return s;if("loaded"!==s._state)return s._queue.push({event:"pos",action:function(){s.pos(t,i,n,r)}}),s;if(i="number"!=typeof i?0:i,n="number"!=typeof n?-.5:n,void 0===r){if("number"!=typeof t)return s._pos;s._pos=[t,i,n]}for(var o=s._getSoundIds(r),a=0;a<o.length;a++){var h=s._soundById(o[a]);if(h){if("number"!=typeof t)return h._pos;h._pos=[t,i,n],h._node&&(h._panner&&!h._panner.pan||e(h,"spatial"),void 0!==h._panner.positionX?(h._panner.positionX.setValueAtTime(t,Howler.ctx.currentTime),h._panner.positionY.setValueAtTime(i,Howler.ctx.currentTime),h._panner.positionZ.setValueAtTime(n,Howler.ctx.currentTime)):h._panner.setPosition(t,i,n)),s._emit("pos",h._id)}}return s},Howl.prototype.orientation=function(t,i,n,r){var s=this;if(!s._webAudio)return s;if("loaded"!==s._state)return s._queue.push({event:"orientation",action:function(){s.orientation(t,i,n,r)}}),s;if(i="number"!=typeof i?s._orientation[1]:i,n="number"!=typeof n?s._orientation[2]:n,void 0===r){if("number"!=typeof t)return s._orientation;s._orientation=[t,i,n]}for(var o=s._getSoundIds(r),a=0;a<o.length;a++){var h=s._soundById(o[a]);if(h){if("number"!=typeof t)return h._orientation;h._orientation=[t,i,n],h._node&&(h._panner||(h._pos||(h._pos=s._pos||[0,0,-.5]),e(h,"spatial")),void 0!==h._panner.orientationX?(h._panner.orientationX.setValueAtTime(t,Howler.ctx.currentTime),h._panner.orientationY.setValueAtTime(i,Howler.ctx.currentTime),h._panner.orientationZ.setValueAtTime(n,Howler.ctx.currentTime)):h._panner.setOrientation(t,i,n)),s._emit("orientation",h._id)}}return s},Howl.prototype.pannerAttr=function(){var t,i,n,r=this,s=arguments;if(!r._webAudio)return r;if(0===s.length)return r._pannerAttr;if(1===s.length){if("object"!=typeof s[0])return(n=r._soundById(parseInt(s[0],10)))?n._pannerAttr:r._pannerAttr;t=s[0],void 0===i&&(t.pannerAttr||(t.pannerAttr={coneInnerAngle:t.coneInnerAngle,coneOuterAngle:t.coneOuterAngle,coneOuterGain:t.coneOuterGain,distanceModel:t.distanceModel,maxDistance:t.maxDistance,refDistance:t.refDistance,rolloffFactor:t.rolloffFactor,panningModel:t.panningModel}),r._pannerAttr={coneInnerAngle:void 0!==t.pannerAttr.coneInnerAngle?t.pannerAttr.coneInnerAngle:r._coneInnerAngle,coneOuterAngle:void 0!==t.pannerAttr.coneOuterAngle?t.pannerAttr.coneOuterAngle:r._coneOuterAngle,coneOuterGain:void 0!==t.pannerAttr.coneOuterGain?t.pannerAttr.coneOuterGain:r._coneOuterGain,distanceModel:void 0!==t.pannerAttr.distanceModel?t.pannerAttr.distanceModel:r._distanceModel,maxDistance:void 0!==t.pannerAttr.maxDistance?t.pannerAttr.maxDistance:r._maxDistance,refDistance:void 0!==t.pannerAttr.refDistance?t.pannerAttr.refDistance:r._refDistance,rolloffFactor:void 0!==t.pannerAttr.rolloffFactor?t.pannerAttr.rolloffFactor:r._rolloffFactor,panningModel:void 0!==t.pannerAttr.panningModel?t.pannerAttr.panningModel:r._panningModel})}else 2===s.length&&(t=s[0],i=parseInt(s[1],10));for(var o=r._getSoundIds(i),a=0;a<o.length;a++)if(n=r._soundById(o[a])){var h=n._pannerAttr;h={coneInnerAngle:void 0!==t.coneInnerAngle?t.coneInnerAngle:h.coneInnerAngle,coneOuterAngle:void 0!==t.coneOuterAngle?t.coneOuterAngle:h.coneOuterAngle,coneOuterGain:void 0!==t.coneOuterGain?t.coneOuterGain:h.coneOuterGain,distanceModel:void 0!==t.distanceModel?t.distanceModel:h.distanceModel,maxDistance:void 0!==t.maxDistance?t.maxDistance:h.maxDistance,refDistance:void 0!==t.refDistance?t.refDistance:h.refDistance,rolloffFactor:void 0!==t.rolloffFactor?t.rolloffFactor:h.rolloffFactor,panningModel:void 0!==t.panningModel?t.panningModel:h.panningModel};var l=n._panner;l?(l.coneInnerAngle=h.coneInnerAngle,l.coneOuterAngle=h.coneOuterAngle,l.coneOuterGain=h.coneOuterGain,l.distanceModel=h.distanceModel,l.maxDistance=h.maxDistance,l.refDistance=h.refDistance,l.rolloffFactor=h.rolloffFactor,l.panningModel=h.panningModel):(n._pos||(n._pos=r._pos||[0,0,-.5]),e(n,"spatial"))}return r},Sound.prototype.init=function(t){return function(){var e=this._parent;this._orientation=e._orientation,this._stereo=e._stereo,this._pos=e._pos,this._pannerAttr=e._pannerAttr,t.call(this),this._stereo?e.stereo(this._stereo):this._pos&&e.pos(this._pos[0],this._pos[1],this._pos[2],this._id)}}(Sound.prototype.init),Sound.prototype.reset=function(t){return function(){var e=this._parent;return this._orientation=e._orientation,this._stereo=e._stereo,this._pos=e._pos,this._pannerAttr=e._pannerAttr,this._stereo?e.stereo(this._stereo):this._pos?e.pos(this._pos[0],this._pos[1],this._pos[2],this._id):this._panner&&(this._panner.disconnect(0),this._panner=void 0,e._refreshBuffer(this)),t.call(this)}}(Sound.prototype.reset);var e=function(t,e){"spatial"===(e=e||"spatial")?(t._panner=Howler.ctx.createPanner(),t._panner.coneInnerAngle=t._pannerAttr.coneInnerAngle,t._panner.coneOuterAngle=t._pannerAttr.coneOuterAngle,t._panner.coneOuterGain=t._pannerAttr.coneOuterGain,t._panner.distanceModel=t._pannerAttr.distanceModel,t._panner.maxDistance=t._pannerAttr.maxDistance,t._panner.refDistance=t._pannerAttr.refDistance,t._panner.rolloffFactor=t._pannerAttr.rolloffFactor,t._panner.panningModel=t._pannerAttr.panningModel,void 0!==t._panner.positionX?(t._panner.positionX.setValueAtTime(t._pos[0],Howler.ctx.currentTime),t._panner.positionY.setValueAtTime(t._pos[1],Howler.ctx.currentTime),t._panner.positionZ.setValueAtTime(t._pos[2],Howler.ctx.currentTime)):t._panner.setPosition(t._pos[0],t._pos[1],t._pos[2]),void 0!==t._panner.orientationX?(t._panner.orientationX.setValueAtTime(t._orientation[0],Howler.ctx.currentTime),t._panner.orientationY.setValueAtTime(t._orientation[1],Howler.ctx.currentTime),t._panner.orientationZ.setValueAtTime(t._orientation[2],Howler.ctx.currentTime)):t._panner.setOrientation(t._orientation[0],t._orientation[1],t._orientation[2])):(t._panner=Howler.ctx.createStereoPanner(),t._panner.pan.setValueAtTime(t._stereo,Howler.ctx.currentTime)),t._panner.connect(t._node),t._paused||t._parent.pause(t._id,!0).play(t._id,!0)}}()}).call(this,i(62))},function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return p}));var n=i(0),r=i(16),s=i(5),o=i(3),a=i(1),h=i(9);function l(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var u,c,d,p=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,u;return e=t,u=[{key:"init",value:function(){s.a.setGradientBgColor([a.a.data.level1_bgTop,a.a.data.level1_bgBottom]),o.a.init(),this.initLevel()}},{key:"initLevel",value:function(){this.levelPlayer=new h.a("level1"),this.levelPlayer.addFinalPlatform(!1),this.levelPlayer.addGameLogo();var t=new r.a(new n.Vector3(0,2,0),"char",0);o.a.player=t,this.levelPlayer.setLevelPlayer(t),this.levelPlayer.initCoins(h.a.CoinPlacementType.STREAK)}}],(i=null)&&l(e.prototype,i),u&&l(e,u),Object.defineProperty(e,"prototype",{writable:!1}),t}();d=[],(c="gameObjects")in(u=p)?Object.defineProperty(u,c,{value:d,enumerable:!0,configurable:!0,writable:!0}):u[c]=d},function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return f}));var n=i(5),r=i(1),s=i(9),o=i(3),a=i(16),h=i(0),l=i(19);function u(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var c,d,p,f=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,c;return e=t,c=[{key:"init",value:function(){n.a.setGradientBgColor([r.a.data.level2_bgTop,r.a.data.level2_bgBottom]),o.a.init(),this.initLevel()}},{key:"initLevel",value:function(){var t=function(t){t.material.metalness=.48};this.levelPlayer=new s.a("level2",0,t),this.levelPlayer.addFinalPlatform(!1),this.levelPlayer.addGameLogo();var e=new a.a(new h.Vector3(0,2,0),"char",0);o.a.player=e,this.levelPlayer.setLevelPlayer(e),this.levelOpponent=new s.a("level2",o.a.diffBetweenPlatforms,t),this.levelOpponent.addFinalPlatform(!0);var i=new l.a(new h.Vector3(0,2,o.a.diffBetweenPlatforms),"char",1);o.a.enemy=i,this.levelOpponent.setLevelPlayer(i),this.levelPlayer.initCoins(s.a.CoinPlacementType.FOURS)}}],(i=null)&&u(e.prototype,i),c&&u(e,c),Object.defineProperty(e,"prototype",{writable:!1}),t}();p=[],(d="gameObjects")in(c=f)?Object.defineProperty(c,d,{value:p,enumerable:!0,configurable:!0,writable:!0}):c[d]=p},function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return m}));var n=i(5),r=i(1),s=i(9),o=i(3),a=i(16),h=i(0),l=i(19),u=i(13);function c(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var d,p,f,m=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,d;return e=t,d=[{key:"init",value:function(){n.a.setGradientBgColor([r.a.data.level3_bgTop,r.a.data.level3_bgBottom]),o.a.init(),this.initLevel()}},{key:"initLevel",value:function(){r.a.postprocessEnabled&&(u.a.brightnessEffect.contrast=0);var t=function(t){t.material.metalness=.5,t.name.includes("Floor_1")?(t.material.color.set("#FD94FE"),t.material.color.convertSRGBToLinear()):t.name.includes("Floor_2")&&(t.material.color.set("#ED53FD"),t.material.color.convertSRGBToLinear())};this.levelPlayer=new s.a("level3",0,t),this.levelOpponent=new s.a("level3",o.a.diffBetweenPlatforms,t),this.levelPlayer.addFinalPlatform(!1),this.levelOpponent.addFinalPlatform(!0),this.levelPlayer.addGameLogo();var e=new a.a(new h.Vector3(0,2,0),"char",0);o.a.player=e;var i=new l.a(new h.Vector3(0,2,o.a.diffBetweenPlatforms),"char",1);o.a.enemy=i,this.levelPlayer.setLevelPlayer(e),this.levelOpponent.setLevelPlayer(i),this.levelPlayer.initCoins(s.a.CoinPlacementType.SOLO)}}],(i=null)&&c(e.prototype,i),d&&c(e,d),Object.defineProperty(e,"prototype",{writable:!1}),t}();f=[],(p="gameObjects")in(d=m)?Object.defineProperty(d,p,{value:f,enumerable:!0,configurable:!0,writable:!0}):d[p]=f},function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return m}));var n=i(5),r=i(1),s=i(9),o=i(3),a=i(16),h=i(0),l=i(19),u=i(13);function c(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var d,p,f,m=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,d;return e=t,d=[{key:"init",value:function(){n.a.setGradientBgColor([r.a.data.level4_bgTop,r.a.data.level4_bgBottom]),o.a.init(),this.initLevel()}},{key:"initLevel",value:function(){r.a.postprocessEnabled&&(u.a.brightnessEffect.contrast=0);var t=function(t){t.material.metalness=.3,t.material.name.includes("Platform_Color1")?(t.material.color.set("#FE9F0F"),t.material.color.convertSRGBToLinear()):t.material.name.includes("Platform_Color2")&&(t.material.color.set("#FE790D"),t.material.color.convertSRGBToLinear())};this.levelPlayer=new s.a("level4",0,t),this.levelOpponent=new s.a("level4",o.a.diffBetweenPlatforms,t),this.levelPlayer.addFinalPlatform(!1),this.levelOpponent.addFinalPlatform(!0),this.levelPlayer.addGameLogo();var e=new a.a(new h.Vector3(0,2,0),"char",0);o.a.player=e;var i=new l.a(new h.Vector3(0,2,o.a.diffBetweenPlatforms),"char",1);o.a.enemy=i,this.levelPlayer.setLevelPlayer(e),this.levelOpponent.setLevelPlayer(i),this.levelPlayer.initCoins(s.a.CoinPlacementType.SOLO)}}],(i=null)&&c(e.prototype,i),d&&c(e,d),Object.defineProperty(e,"prototype",{writable:!1}),t}();f=[],(p="gameObjects")in(d=m)?Object.defineProperty(d,p,{value:f,enumerable:!0,configurable:!0,writable:!0}):d[p]=f},function(t,e,i){"use strict";i.r(e),i.d(e,"default",(function(){return m}));var n=i(5),r=i(1),s=i(9),o=i(3),a=i(16),h=i(0),l=i(19),u=i(13);function c(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var d,p,f,m=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,d;return e=t,d=[{key:"init",value:function(){n.a.setGradientBgColor([r.a.data.level5_bgTop,r.a.data.level5_bgBottom]),o.a.init(),this.initLevel()}},{key:"initLevel",value:function(){r.a.postprocessEnabled&&(u.a.brightnessEffect.contrast=0);var t=function(t){t.material.metalness=.3,t.material.name.includes("Platform_Color1")?(t.material.color.set("#FD80FD"),t.material.color.convertSRGBToLinear()):t.material.name.includes("Platform_Color2")&&(t.material.color.set("#AB87FD"),t.material.color.convertSRGBToLinear())};this.levelPlayer=new s.a("level5",0,t),this.levelOpponent=new s.a("level5",o.a.diffBetweenPlatforms,t),this.levelPlayer.addFinalPlatform(!1),this.levelOpponent.addFinalPlatform(!0);var e=this.levelPlayer.startObj.position.clone();this.levelPlayer.addGameLogo(e);var i=new a.a(new h.Vector3(e.x,2,0),"char",0);o.a.player=i;var n=new l.a(new h.Vector3(e.x,2,o.a.diffBetweenPlatforms),"char",1);o.a.enemy=n,this.levelPlayer.setLevelPlayer(i),this.levelOpponent.setLevelPlayer(n),this.levelPlayer.initCoins(s.a.CoinPlacementType.SOLO)}}],(i=null)&&c(e.prototype,i),d&&c(e,d),Object.defineProperty(e,"prototype",{writable:!1}),t}();f=[],(p="gameObjects")in(d=m)?Object.defineProperty(d,p,{value:f,enumerable:!0,configurable:!0,writable:!0}):d[p]=f},function(t){t.exports=JSON.parse('{"nameList":["Shiro","Alfred","Ludmila","Arnaldo","Dany","Ralf","Carly","Greyson","Diana","Jere","Vedrana","Jolyon","Iben","Vilde","Aniketos","Eustáquio","Tamara","Valter","Pavlin","Vidal","Bailee","Dina","Betony","Deepak"]}')},function(t){t.exports=JSON.parse('{"metadata":{"version":4.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"E511396B-B0CB-41AF-B751-956537D7BEED","type":"ConeGeometry","radius":30,"height":999.6999819984571,"radialSegments":20,"heightSegments":1,"openEnded":false,"thetaStart":0,"thetaLength":-6.283185307179586},{"uuid":"C811187E-CF0F-4891-B14D-DC4D00DFCAE0","type":"SphereGeometry","radius":0,"widthSegments":12,"heightSegments":12,"phiStart":0,"phiLength":6.283185307179586,"thetaStart":0,"thetaLength":3.141592653589793},{"uuid":"282354B5-AEB3-4B1E-8EC2-07CB505F60CE","type":"SphereGeometry","radius":0,"widthSegments":12,"heightSegments":12,"phiStart":0,"phiLength":6.283185307179586,"thetaStart":0,"thetaLength":3.141592653589793},{"uuid":"6A23527F-8FD9-414C-936B-5CEB61A36B5B","type":"ConeGeometry","radius":30,"height":954.6154786132187,"radialSegments":20,"heightSegments":1,"openEnded":false,"thetaStart":0,"thetaLength":-6.283185307179586}],"materials":[{"uuid":"2EC3A296-C0F5-4C5B-A6C4-0A1F75235494","type":"MeshBasicMaterial","color":16776960,"reflectivity":1,"refractionRatio":0.98,"opacity":0.1,"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"wireframe":true},{"uuid":"6B972C8F-BF59-4DC6-9669-D24A52AB7B8B","type":"MeshBasicMaterial","color":16776960,"reflectivity":1,"refractionRatio":0.98,"opacity":0.1,"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"wireframe":true},{"uuid":"2ACC5C44-C669-486F-9EA8-954CC2E56760","type":"MeshBasicMaterial","color":16776960,"reflectivity":1,"refractionRatio":0.98,"opacity":0.1,"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"wireframe":true},{"uuid":"A8717F8F-DD2F-40A3-B932-F2D5F8E41450","type":"MeshBasicMaterial","color":16776960,"reflectivity":1,"refractionRatio":0.98,"opacity":0.1,"transparent":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"colorWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680,"wireframe":true}],"textures":[{"uuid":"0D34655E-452D-4A16-AAD0-A01456C723AA","name":"texture1.png","mapping":300,"repeat":[1,1],"offset":[0,0],"center":[0,0],"rotation":0,"wrap":[1001,1001],"format":1023,"type":1009,"encoding":3000,"minFilter":1008,"magFilter":1006,"anisotropy":1,"flipY":true,"premultiplyAlpha":false,"unpackAlignment":4,"image":"E943F7DE-9587-429A-8FB3-D9653A023CBB"}],"images":[{"uuid":"E943F7DE-9587-429A-8FB3-D9653A023CBB","url":"textures/texture1.png"}],"object":{"uuid":"BA1F043D-59CC-4BBF-9666-F2D544EE5720","type":"Group","name":"LevelUp","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"children":[{"uuid":"A043D874-0DE8-42AB-A463-CECE53611F96","type":"ParticleEmitter","name":"gatherParticles","layers":1,"matrix":[1,0,0,0,0,2.220446049250313e-16,-1.0000000000000002,0,0,1.0000000000000002,2.220446049250313e-16,0,0,-1,0,1],"ps":{"autoDestroy":false,"looping":false,"duration":1.5,"maxParticle":100,"shape":{"type":"cone","radius":1,"arc":6.283185307179586,"thickness":0.2,"angle":0.03},"startLife":{"type":"IntervalValue","a":0.4,"b":0.4},"startSpeed":{"type":"IntervalValue","a":10,"b":10},"startRotation":{"type":"ConstantValue","value":0},"startSize":{"type":"IntervalValue","a":0.5,"b":0.5},"startColor":{"type":"ConstantColor","color":{"r":0.8666666666666667,"g":0.8666666666666667,"b":0.08235294117647059,"a":1}},"emissionOverTime":{"type":"ConstantValue","value":100},"emissionOverDistance":{"type":"ConstantValue","value":0},"emissionBursts":[],"instancingGeometry":{"metadata":{"version":4.5,"type":"BufferGeometry","generator":"BufferGeometry.toJSON"},"uuid":"323E2A42-A924-4669-B63E-716281244164","type":"PlaneGeometry","width":1,"height":1,"widthSegments":1,"heightSegments":1},"renderOrder":1,"renderMode":1,"speedFactor":1,"texture":"0D34655E-452D-4A16-AAD0-A01456C723AA","startTileIndex":1,"uTileCount":10,"vTileCount":10,"blending":2,"behaviors":[{"type":"ColorOverLife","func":{"type":"ColorRange","a":{"r":1,"g":1,"b":1,"a":1},"b":{"r":0.9647058823529412,"g":0.9647058823529412,"b":0,"a":0}}},{"type":"SizeOverLife","func":{"type":"PiecewiseBezier","functions":[{"function":{"p0":-0.00625,"p1":1.05,"p2":1.04375,"p3":0.13125},"start":0}]}}],"worldSpace":false},"children":[{"uuid":"E19C0133-0B43-4509-ACD0-73462EBB3E75","type":"Mesh","name":"gatherParticles Debug Shape","layers":1,"matrix":[2.220446049250313e-16,-1,-2.220446049250313e-16,0,0,2.220446049250313e-16,-1,0,1,2.220446049250313e-16,0,0,0,0,466.52665826594665,1],"geometry":"E511396B-B0CB-41AF-B751-956537D7BEED","material":"2EC3A296-C0F5-4C5B-A6C4-0A1F75235494"}]},{"uuid":"D326AE71-D419-4203-81AD-3497BAFDA799","type":"ParticleEmitter","name":"glow","layers":1,"matrix":[1,0,0,0,0,2.220446049250313e-16,-1,0,0,1,2.220446049250313e-16,0,0,0,0,1],"ps":{"autoDestroy":false,"looping":false,"duration":1,"maxParticle":10,"shape":{"type":"point"},"startLife":{"type":"ConstantValue","value":1},"startSpeed":{"type":"ConstantValue","value":0},"startRotation":{"type":"ConstantValue","value":0},"startSize":{"type":"IntervalValue","a":10,"b":10},"startColor":{"type":"ConstantColor","color":{"r":0.9882352941176471,"g":0.9882352941176471,"b":0.7058823529411765,"a":1}},"emissionOverTime":{"type":"ConstantValue","value":3},"emissionOverDistance":{"type":"ConstantValue","value":0},"emissionBursts":[{"time":0,"count":1,"cycle":1,"interval":0.01,"probability":1}],"instancingGeometry":{"metadata":{"version":4.5,"type":"BufferGeometry","generator":"BufferGeometry.toJSON"},"uuid":"323E2A42-A924-4669-B63E-716281244164","type":"PlaneGeometry","width":1,"height":1,"widthSegments":1,"heightSegments":1},"renderOrder":0,"renderMode":2,"speedFactor":0,"texture":"0D34655E-452D-4A16-AAD0-A01456C723AA","startTileIndex":4,"uTileCount":10,"vTileCount":10,"blending":2,"behaviors":[{"type":"ColorOverLife","func":{"type":"ColorRange","a":{"r":1,"g":1,"b":1,"a":1},"b":{"r":0,"g":0,"b":0,"a":0}}},{"type":"SizeOverLife","func":{"type":"PiecewiseBezier","functions":[{"function":{"p0":0,"p1":0.3333,"p2":0.6667,"p3":1},"start":0}]}}],"worldSpace":false},"children":[{"uuid":"FA57BC07-B701-4134-87D2-6AEC5DFB6AD7","type":"Mesh","name":"glow Debug Shape","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":"C811187E-CF0F-4891-B14D-DC4D00DFCAE0","material":"6B972C8F-BF59-4DC6-9669-D24A52AB7B8B"}]},{"uuid":"E49348C9-BEB0-4D0F-B929-96C5ECE542E3","type":"ParticleEmitter","name":"glow2","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"ps":{"autoDestroy":false,"looping":false,"duration":2,"maxParticle":10,"shape":{"type":"point"},"startLife":{"type":"ConstantValue","value":2},"startSpeed":{"type":"ConstantValue","value":0},"startRotation":{"type":"ConstantValue","value":0},"startSize":{"type":"IntervalValue","a":1,"b":3},"startColor":{"type":"ConstantColor","color":{"r":0.9803921568627451,"g":0.9803921568627451,"b":0.5294117647058824,"a":1}},"emissionOverTime":{"type":"ConstantValue","value":0},"emissionOverDistance":{"type":"ConstantValue","value":0},"emissionBursts":[{"time":0,"count":1,"cycle":1,"interval":0.01,"probability":1}],"instancingGeometry":{"metadata":{"version":4.5,"type":"BufferGeometry","generator":"BufferGeometry.toJSON"},"uuid":"323E2A42-A924-4669-B63E-716281244164","type":"PlaneGeometry","width":1,"height":1,"widthSegments":1,"heightSegments":1},"renderOrder":0,"renderMode":0,"speedFactor":0,"texture":"0D34655E-452D-4A16-AAD0-A01456C723AA","startTileIndex":1,"uTileCount":10,"vTileCount":10,"blending":2,"behaviors":[{"type":"SizeOverLife","func":{"type":"PiecewiseBezier","functions":[{"function":{"p0":0,"p1":0.75,"p2":0.9,"p3":1},"start":0},{"function":{"p0":1,"p1":0.9,"p2":0.75,"p3":0},"start":0.2}]}}],"worldSpace":false},"children":[{"uuid":"7BB14B46-866A-4671-9B29-7E92EDBF7FAA","type":"Mesh","name":"glow2 Debug Shape","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":"282354B5-AEB3-4B1E-8EC2-07CB505F60CE","material":"2ACC5C44-C669-486F-9EA8-954CC2E56760"}]},{"uuid":"2D7BA121-5A00-4DD0-89EE-259A65379BD4","type":"ParticleEmitter","name":"particle","layers":1,"matrix":[1,0,0,0,0,2.220446049250313e-16,-1,0,0,1,2.220446049250313e-16,0,0,0,0,1],"ps":{"autoDestroy":false,"looping":false,"duration":1,"maxParticle":100,"shape":{"type":"cone","radius":1,"arc":6.283185307179586,"thickness":0.2,"angle":0.031415926535897934},"startLife":{"type":"IntervalValue","a":0.6,"b":0.8},"startSpeed":{"type":"IntervalValue","a":5,"b":10},"startRotation":{"type":"ConstantValue","value":0},"startSize":{"type":"IntervalValue","a":0.2,"b":0.5},"startColor":{"type":"ConstantColor","color":{"r":0.9921568627450981,"g":0.9921568627450981,"b":0.611764705882353,"a":1}},"emissionOverTime":{"type":"PiecewiseBezier","functions":[{"function":{"p0":0.15693359375,"p1":-0.07988281250000001,"p2":0,"p3":0},"start":0},{"function":{"p0":50,"p1":80,"p2":80,"p3":50},"start":0.4}]},"emissionOverDistance":{"type":"ConstantValue","value":0},"emissionBursts":[],"instancingGeometry":{"metadata":{"version":4.5,"type":"BufferGeometry","generator":"BufferGeometry.toJSON"},"uuid":"323E2A42-A924-4669-B63E-716281244164","type":"PlaneGeometry","width":1,"height":1,"widthSegments":1,"heightSegments":1},"renderOrder":2,"renderMode":0,"speedFactor":0,"texture":"0D34655E-452D-4A16-AAD0-A01456C723AA","startTileIndex":0,"uTileCount":10,"vTileCount":10,"blending":2,"behaviors":[{"type":"SizeOverLife","func":{"type":"PiecewiseBezier","functions":[{"function":{"p0":0.5802734375,"p1":1.3302734374999998,"p2":0.6302734375,"p3":0.7302734375},"start":0},{"function":{"p0":0.7302734375,"p1":0.6302734375,"p2":0.75,"p3":0},"start":0.42916666666666664}]}}],"worldSpace":false},"children":[{"uuid":"E24A0F7B-C8FD-416D-A483-7D8FE822F706","type":"Mesh","name":"particle Debug Shape","layers":1,"matrix":[2.220446049250313e-16,-1,-2.220446049250313e-16,0,0,2.220446049250313e-16,-1,0,1,2.220446049250313e-16,0,0,0,0,445.4872233528354,1],"geometry":"6A23527F-8FD9-414C-936B-5CEB61A36B5B","material":"A8717F8F-DD2F-40A3-B932-F2D5F8E41450"}]}]}}')},function(t,e,i){t.exports=function(t){"use strict";function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,(r=n.key,s=void 0,"symbol"==typeof(s=function(t,e){if("object"!=typeof t||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(r,"string"))?s:String(s)),n)}var r,s}function n(t){return(n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function r(t,e){return(r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}function s(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function o(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,r=n(t);if(e){var o=n(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return s(this,i)}}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,r,s,o,a=[],h=!0,l=!1;try{if(s=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;h=!1}else for(;!(h=(n=s.call(i)).done)&&(a.push(n.value),a.length!==e);h=!0);}catch(t){l=!0,r=t}finally{try{if(!h&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(l)throw r}}return a}}(t,e)||l(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t){return function(t){if(Array.isArray(t))return u(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||l(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){if(t){if("string"==typeof t)return u(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?u(t,e):void 0}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var c="undefined"!=typeof window&&window.THREE?window.THREE:{LinearFilter:t.LinearFilter,Sprite:t.Sprite,SpriteMaterial:t.SpriteMaterial,SRGBColorSpace:t.SRGBColorSpace,Texture:t.Texture};return function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&r(t,e)}(d,t);var n,s,l,u=o(d);function d(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"rgba(255, 255, 255, 1)";return e(this,d),(t=u.call(this,new c.SpriteMaterial))._text="".concat(i),t._textHeight=n,t._color=r,t._backgroundColor=!1,t._padding=0,t._borderWidth=0,t._borderRadius=0,t._borderColor="white",t._strokeWidth=0,t._strokeColor="white",t._fontFace="system-ui",t._fontSize=90,t._fontWeight="normal",t._canvas=document.createElement("canvas"),t._genCanvas(),t}return n=d,(s=[{key:"text",get:function(){return this._text},set:function(t){this._text=t,this._genCanvas()}},{key:"textHeight",get:function(){return this._textHeight},set:function(t){this._textHeight=t,this._genCanvas()}},{key:"color",get:function(){return this._color},set:function(t){this._color=t,this._genCanvas()}},{key:"backgroundColor",get:function(){return this._backgroundColor},set:function(t){this._backgroundColor=t,this._genCanvas()}},{key:"padding",get:function(){return this._padding},set:function(t){this._padding=t,this._genCanvas()}},{key:"borderWidth",get:function(){return this._borderWidth},set:function(t){this._borderWidth=t,this._genCanvas()}},{key:"borderRadius",get:function(){return this._borderRadius},set:function(t){this._borderRadius=t,this._genCanvas()}},{key:"borderColor",get:function(){return this._borderColor},set:function(t){this._borderColor=t,this._genCanvas()}},{key:"fontFace",get:function(){return this._fontFace},set:function(t){this._fontFace=t,this._genCanvas()}},{key:"fontSize",get:function(){return this._fontSize},set:function(t){this._fontSize=t,this._genCanvas()}},{key:"fontWeight",get:function(){return this._fontWeight},set:function(t){this._fontWeight=t,this._genCanvas()}},{key:"strokeWidth",get:function(){return this._strokeWidth},set:function(t){this._strokeWidth=t,this._genCanvas()}},{key:"strokeColor",get:function(){return this._strokeColor},set:function(t){this._strokeColor=t,this._genCanvas()}},{key:"_genCanvas",value:function(){var t=this,e=this._canvas,i=e.getContext("2d"),n=Array.isArray(this.borderWidth)?this.borderWidth:[this.borderWidth,this.borderWidth],r=n.map((function(e){return e*t.fontSize*.1})),s=(Array.isArray(this.borderRadius)?this.borderRadius:[this.borderRadius,this.borderRadius,this.borderRadius,this.borderRadius]).map((function(e){return e*t.fontSize*.1})),o=Array.isArray(this.padding)?this.padding:[this.padding,this.padding],l=o.map((function(e){return e*t.fontSize*.1})),u=this.text.split("\n"),d="".concat(this.fontWeight," ").concat(this.fontSize,"px ").concat(this.fontFace);i.font=d;var p=Math.max.apply(Math,h(u.map((function(t){return i.measureText(t).width})))),f=this.fontSize*u.length;if(e.width=p+2*r[0]+2*l[0],e.height=f+2*r[1]+2*l[1],this.borderWidth){if(i.strokeStyle=this.borderColor,r[0]){var m=r[0]/2;i.lineWidth=r[0],i.beginPath(),i.moveTo(m,s[0]),i.lineTo(m,e.height-s[3]),i.moveTo(e.width-m,s[1]),i.lineTo(e.width-m,e.height-s[2]),i.stroke()}if(r[1]){var g=r[1]/2;i.lineWidth=r[1],i.beginPath(),i.moveTo(Math.max(r[0],s[0]),g),i.lineTo(e.width-Math.max(r[0],s[1]),g),i.moveTo(Math.max(r[0],s[3]),e.height-g),i.lineTo(e.width-Math.max(r[0],s[2]),e.height-g),i.stroke()}if(this.borderRadius){var v=Math.max.apply(Math,h(r)),y=v/2;i.lineWidth=v,i.beginPath(),[!!s[0]&&[s[0],y,y,s[0]],!!s[1]&&[e.width-s[1],e.width-y,y,s[1]],!!s[2]&&[e.width-s[2],e.width-y,e.height-y,e.height-s[2]],!!s[3]&&[s[3],y,e.height-y,e.height-s[3]]].filter((function(t){return t})).forEach((function(t){var e=a(t,4),n=e[0],r=e[1],s=e[2],o=e[3];i.moveTo(n,s),i.quadraticCurveTo(r,s,r,o)})),i.stroke()}}this.backgroundColor&&(i.fillStyle=this.backgroundColor,this.borderRadius?(i.beginPath(),i.moveTo(r[0],s[0]),[[r[0],s[0],e.width-s[1],r[1],r[1],r[1]],[e.width-r[0],e.width-r[0],e.width-r[0],r[1],s[1],e.height-s[2]],[e.width-r[0],e.width-s[2],s[3],e.height-r[1],e.height-r[1],e.height-r[1]],[r[0],r[0],r[0],e.height-r[1],e.height-s[3],s[0]]].forEach((function(t){var e=a(t,6),n=e[0],r=e[1],s=e[2],o=e[3],h=e[4],l=e[5];i.quadraticCurveTo(n,o,r,h),i.lineTo(s,l)})),i.closePath(),i.fill()):i.fillRect(r[0],r[1],e.width-2*r[0],e.height-2*r[1])),i.translate.apply(i,h(r)),i.translate.apply(i,h(l)),i.font=d,i.fillStyle=this.color,i.textBaseline="bottom";var x=this.strokeWidth>0;x&&(i.lineWidth=this.strokeWidth*this.fontSize/10,i.strokeStyle=this.strokeColor),u.forEach((function(e,n){var r=(p-i.measureText(e).width)/2,s=(n+1)*t.fontSize;x&&i.strokeText(e,r,s),i.fillText(e,r,s)})),this.material.map&&this.material.map.dispose();var w=this.material.map=new c.Texture(e);w.minFilter=c.LinearFilter,w.colorSpace=c.SRGBColorSpace,w.needsUpdate=!0;var b=this.textHeight*u.length+2*n[1]+2*o[1];this.scale.set(b*e.width/e.height,b,0)}},{key:"clone",value:function(){return new this.constructor(this.text,this.textHeight,this.color).copy(this)}},{key:"copy",value:function(t){return c.Sprite.prototype.copy.call(this,t),this.color=t.color,this.backgroundColor=t.backgroundColor,this.padding=t.padding,this.borderWidth=t.borderWidth,this.borderColor=t.borderColor,this.fontFace=t.fontFace,this.fontSize=t.fontSize,this.fontWeight=t.fontWeight,this.strokeWidth=t.strokeWidth,this.strokeColor=t.strokeColor,this}}])&&i(n.prototype,s),l&&i(n,l),Object.defineProperty(n,"prototype",{writable:!1}),d}(c.Sprite)}(i(0))},function(t,e,i){var n;!function(){"use strict";function r(t,e,i){var n=e.x,r=e.y,s=i.x-n,o=i.y-r;if(0!==s||0!==o){var a=((t.x-n)*s+(t.y-r)*o)/(s*s+o*o);a>1?(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 s(t,e){var i=t.length-1,n=[t[0]];return function t(e,i,n,s,o){for(var a,h=s,l=i+1;l<n;l++){var u=r(e[l],e[i],e[n]);u>h&&(a=l,h=u)}h>s&&(a-i>1&&t(e,i,a,s,o),o.push(e[a]),n-a>1&&t(e,a,n,s,o))}(t,0,i,e,n),n.push(t[i]),n}function o(t,e,i){if(t.length<=2)return t;var n=void 0!==e?e*e:1;return t=s(t=i?t:function(t,e){for(var i,n,r,s,o,a=t[0],h=[a],l=1,u=t.length;l<u;l++)i=t[l],r=a,s=void 0,o=void 0,s=(n=i).x-r.x,o=n.y-r.y,s*s+o*o>e&&(h.push(i),a=i);return a!==i&&h.push(i),h}(t,n),n)}void 0===(n=function(){return o}.call(e,i,e,t))||(t.exports=n)}()},function(t){t.exports=JSON.parse('[{"x":0.22380737227160408,"y":0.6079311870044597},{"x":0.23085358584733323,"y":0.6016401293499298},{"x":0.23085358584733323,"y":0.589058014040869},{"x":0.23789979942306236,"y":0.5638937834227478},{"x":0.24142290621092694,"y":0.5513116681136875},{"x":0.24494601299879154,"y":0.5261474374955664},{"x":0.2590384401502498,"y":0.5009832068774459},{"x":0.2696077605138435,"y":0.47581897625932473},{"x":0.2766539740895726,"y":0.45065474564120367},{"x":0.2872232944531663,"y":0.4129083997140222},{"x":0.3013157216046246,"y":0.39403522675043157},{"x":0.31540814875608286,"y":0.35628888082325016},{"x":0.322454362331812,"y":0.33741570785965946},{"x":0.33654678948327027,"y":0.3122514772415383},{"x":0.3435930030589994,"y":0.2996693619324774},{"x":0.3506392166347286,"y":0.28708724662341717},{"x":0.3576854302104577,"y":0.2745051313143569},{"x":0.3753009641497805,"y":0.25563195835076624},{"x":0.38234717772550963,"y":0.24934090069623577},{"x":0.38939339130123873,"y":0.24304984304170532},{"x":0.40348581845269704,"y":0.22417667007811462},{"x":0.41405513881629075,"y":0.21788561242358415},{"x":0.42110135239201985,"y":0.2115945547690544},{"x":0.43519377954347815,"y":0.20530349711452392},{"x":0.452809313482801,"y":0.18013926649640277},{"x":0.4633786338463947,"y":0.18013926649640277},{"x":0.4739479542099884,"y":0.173848208841873},{"x":0.4845172745735821,"y":0.16755715118734255},{"x":0.4880403813614467,"y":0.16755715118734255},{"x":0.49508659493717583,"y":0.1612660935328121},{"x":0.502132808512905,"y":0.15497503587828232},{"x":0.5091790220886342,"y":0.15497503587828232},{"x":0.5162252356643633,"y":0.15497503587828232},{"x":0.5197483424522278,"y":0.15497503587828232},{"x":0.5232714492400923,"y":0.15497503587828232},{"x":0.5267945560279569,"y":0.15497503587828232},{"x":0.533840769603686,"y":0.15497503587828232},{"x":0.533840769603686,"y":0.1612660935328121},{"x":0.5408869831794152,"y":0.18013926649640277},{"x":0.5479331967551443,"y":0.1927213818054637},{"x":0.5514563035430089,"y":0.21788561242358415},{"x":0.5620256239066026,"y":0.23675878538717554},{"x":0.5690718374823318,"y":0.26821407365982647},{"x":0.5761180510580608,"y":0.28708724662341717},{"x":0.5796411578459255,"y":0.2996693619324774},{"x":0.5866873714216545,"y":0.3122514772415383},{"x":0.5866873714216545,"y":0.33112465020512905},{"x":0.5902104782095192,"y":0.34370676551418927},{"x":0.5972566917852483,"y":0.35628888082325016},{"x":0.6043029053609774,"y":0.3688709961323104},{"x":0.6113491189367066,"y":0.37516205378684087},{"x":0.6113491189367066,"y":0.3814531114413706},{"x":0.6148722257245711,"y":0.39403522675043157},{"x":0.6183953325124357,"y":0.39403522675043157},{"x":0.6219184393003003,"y":0.40032628440496204},{"x":0.6219184393003003,"y":0.4066173420594918},{"x":0.6289646528760294,"y":0.4129083997140222},{"x":0.6360108664517586,"y":0.4191994573685527},{"x":0.6395339732396231,"y":0.4317815726776129},{"x":0.6465801868153522,"y":0.4380726303321434},{"x":0.6536264003910814,"y":0.45694580329573403},{"x":0.6606726139668105,"y":0.4695279186047943},{"x":0.6677188275425396,"y":0.47581897625932473},{"x":0.6677188275425396,"y":0.48211003391385454},{"x":0.6747650411182687,"y":0.48211003391385454},{"x":0.6782881479061333,"y":0.48211003391385454},{"x":0.6818112546939978,"y":0.4946921492229155},{"x":0.688857468269727,"y":0.4946921492229155},{"x":0.6923805750575915,"y":0.4946921492229155},{"x":0.6994267886333208,"y":0.5072742645319757},{"x":0.7029498954211852,"y":0.5072742645319757},{"x":0.70647300220905,"y":0.5072742645319757},{"x":0.713519215784779,"y":0.5135653221865062},{"x":0.7205654293605082,"y":0.5135653221865062},{"x":0.7311347497241019,"y":0.5135653221865062},{"x":0.7452271768755602,"y":0.5198563798410366},{"x":0.7557964972391538,"y":0.5198563798410366},{"x":0.7663658176027476,"y":0.5198563798410366},{"x":0.7804582447542059,"y":0.5198563798410366},{"x":0.7945506719056641,"y":0.5198563798410366},{"x":0.7980737786935287,"y":0.5198563798410366},{"x":0.8015968854813933,"y":0.5198563798410366},{"x":0.8051199922692579,"y":0.5198563798410366},{"x":0.8051199922692579,"y":0.5261474374955664},{"x":0.8051199922692579,"y":0.5324384951500969},{"x":0.8051199922692579,"y":0.5387295528046273},{"x":0.8051199922692579,"y":0.5450206104591572},{"x":0.8051199922692579,"y":0.5513116681136875},{"x":0.8051199922692579,"y":0.557602725768218},{"x":0.8051199922692579,"y":0.5638937834227478},{"x":0.8051199922692579,"y":0.5701848410772782},{"x":0.8051199922692579,"y":0.5764758987318087},{"x":0.8051199922692579,"y":0.5827669563863392},{"x":0.8051199922692579,"y":0.589058014040869},{"x":0.8051199922692579,"y":0.5953490716953994},{"x":0.8051199922692579,"y":0.6079311870044597},{"x":0.8051199922692579,"y":0.61422224465899}]')},function(t){t.exports=JSON.parse('[{"x":0.3390667890450394,"y":0.6266586661417938},{"x":0.3390667890450394,"y":0.6266586661417938},{"x":0.34117163310001053,"y":0.6266586661417938},{"x":0.3432764771549816,"y":0.6266586661417938},{"x":0.3474861652649238,"y":0.6266586661417938},{"x":0.3495910093198949,"y":0.6266586661417938},{"x":0.35169585337486603,"y":0.6266586661417938},{"x":0.3559055414848082,"y":0.6266586661417938},{"x":0.3580103855397793,"y":0.6266586661417938},{"x":0.36222007364972153,"y":0.6266586661417938},{"x":0.36432491770469255,"y":0.6266586661417938},{"x":0.36853460581463476,"y":0.6266586661417938},{"x":0.37063944986960584,"y":0.6266586661417938},{"x":0.372744293924577,"y":0.6266586661417938},{"x":0.37484913797954805,"y":0.6266586661417938},{"x":0.3769539820345192,"y":0.6266586661417938},{"x":0.37905882608949026,"y":0.6266586661417938},{"x":0.38116367014446134,"y":0.6228996200861865},{"x":0.3832685141994325,"y":0.6228996200861865},{"x":0.3853733582544035,"y":0.6228996200861865},{"x":0.38747820230937463,"y":0.6228996200861865},{"x":0.38958304636434576,"y":0.6228996200861865},{"x":0.3937927344742879,"y":0.6228996200861865},{"x":0.395897578529259,"y":0.6228996200861865},{"x":0.39800242258423013,"y":0.6228996200861865},{"x":0.4022121106941723,"y":0.6228996200861865},{"x":0.4043169547491434,"y":0.6228996200861865},{"x":0.40852664285908563,"y":0.6228996200861865},{"x":0.4106314869140567,"y":0.6228996200861865},{"x":0.4127363309690278,"y":0.6228996200861865},{"x":0.41694601907896994,"y":0.6228996200861865},{"x":0.4190508631339411,"y":0.6228996200861865},{"x":0.4232605512438833,"y":0.6228996200861865},{"x":0.4253653952988544,"y":0.6228996200861865},{"x":0.4316799274637677,"y":0.6228996200861865},{"x":0.43378477151873873,"y":0.6228996200861865},{"x":0.43799445962868094,"y":0.6228996200861865},{"x":0.4400993036836522,"y":0.6228996200861865},{"x":0.44430899179359434,"y":0.6191405740305792},{"x":0.4464138358485655,"y":0.6191405740305792},{"x":0.45062352395850763,"y":0.6191405740305792},{"x":0.45272836801347877,"y":0.6191405740305792},{"x":0.45483321206844984,"y":0.6191405740305792},{"x":0.456938056123421,"y":0.6191405740305792},{"x":0.4590429001783921,"y":0.6153815279749714},{"x":0.46114774423336313,"y":0.6153815279749714},{"x":0.46325258828833427,"y":0.6153815279749714},{"x":0.4653574323433053,"y":0.6153815279749714},{"x":0.4674622763982764,"y":0.6153815279749714},{"x":0.46956712045324756,"y":0.6153815279749714},{"x":0.47377680856318977,"y":0.6116224819193642},{"x":0.4758816526181608,"y":0.6116224819193642},{"x":0.4779864966731319,"y":0.6116224819193642},{"x":0.48009134072810306,"y":0.6116224819193642},{"x":0.4821961847830741,"y":0.6116224819193642},{"x":0.4864058728930163,"y":0.6116224819193642},{"x":0.4885107169479874,"y":0.6116224819193642},{"x":0.4927204050579296,"y":0.6116224819193642},{"x":0.4948252491129007,"y":0.6116224819193642},{"x":0.49693009316787173,"y":0.6116224819193642},{"x":0.49903493722284287,"y":0.6116224819193642},{"x":0.501139781277814,"y":0.6116224819193642},{"x":0.5053494693877562,"y":0.6116224819193642},{"x":0.5074543134427272,"y":0.6116224819193642},{"x":0.5116640015526696,"y":0.6116224819193642},{"x":0.5137688456076406,"y":0.6078634358637567},{"x":0.5158736896626117,"y":0.6078634358637567},{"x":0.5179785337175827,"y":0.6078634358637567},{"x":0.5200833777725539,"y":0.6078634358637567},{"x":0.522188221827525,"y":0.6078634358637567},{"x":0.5263979099374672,"y":0.6041043898081495},{"x":0.5285027539924382,"y":0.6041043898081495},{"x":0.5306075980474093,"y":0.6041043898081495},{"x":0.5327124421023804,"y":0.6041043898081495},{"x":0.5348172861573515,"y":0.6003453437525417},{"x":0.5369221302123226,"y":0.6003453437525417},{"x":0.5390269742672936,"y":0.6003453437525417},{"x":0.543236662377236,"y":0.6003453437525417},{"x":0.545341506432207,"y":0.6003453437525417},{"x":0.5474463504871782,"y":0.6003453437525417},{"x":0.5495511945421492,"y":0.5965862976969344},{"x":0.5516560385971203,"y":0.5965862976969344},{"x":0.5516560385971203,"y":0.5928272516413271},{"x":0.5537608826520914,"y":0.5928272516413271},{"x":0.5537608826520914,"y":0.5890682055857198},{"x":0.5558657267070625,"y":0.5890682055857198},{"x":0.5579705707620336,"y":0.5890682055857198},{"x":0.5600754148170046,"y":0.5890682055857198},{"x":0.5621802588719758,"y":0.5890682055857198},{"x":0.5642851029269469,"y":0.5890682055857198},{"x":0.5642851029269469,"y":0.585309159530112},{"x":0.5663899469819179,"y":0.5815501134745047},{"x":0.568494791036889,"y":0.5815501134745047},{"x":0.568494791036889,"y":0.5777910674188973},{"x":0.5705996350918602,"y":0.5777910674188973},{"x":0.5727044791468313,"y":0.5777910674188973},{"x":0.5727044791468313,"y":0.5740320213632901},{"x":0.5748093232018024,"y":0.5740320213632901},{"x":0.5769141672567735,"y":0.5702729753076823},{"x":0.5769141672567735,"y":0.5665139292520749},{"x":0.5790190113117446,"y":0.5665139292520749},{"x":0.5790190113117446,"y":0.5627548831964676},{"x":0.5811238553667156,"y":0.5627548831964676},{"x":0.5811238553667156,"y":0.5589958371408603},{"x":0.5811238553667156,"y":0.5552367910852526},{"x":0.5811238553667156,"y":0.5514777450296452},{"x":0.5811238553667156,"y":0.5477186989740379},{"x":0.5832286994216868,"y":0.5439596529184307},{"x":0.5832286994216868,"y":0.5402006068628228},{"x":0.5832286994216868,"y":0.5364415608072155},{"x":0.5832286994216868,"y":0.5326825147516082},{"x":0.5832286994216868,"y":0.5289234686960009},{"x":0.5832286994216868,"y":0.5251644226403931},{"x":0.5832286994216868,"y":0.5214053765847858},{"x":0.5832286994216868,"y":0.5176463305291785},{"x":0.5832286994216868,"y":0.5138872844735712},{"x":0.5832286994216868,"y":0.5101282384179634},{"x":0.5832286994216868,"y":0.5063691923623561},{"x":0.5832286994216868,"y":0.4988511002511415},{"x":0.5832286994216868,"y":0.4875739620843191},{"x":0.5832286994216868,"y":0.4762968239174967},{"x":0.5853335434766579,"y":0.46877873180628205},{"x":0.5853335434766579,"y":0.4650196857506743},{"x":0.5853335434766579,"y":0.461260639695067},{"x":0.5853335434766579,"y":0.4575015936394597},{"x":0.5853335434766579,"y":0.45374254758385235},{"x":0.5874383875316289,"y":0.45374254758385235},{"x":0.5874383875316289,"y":0.4462244554726373},{"x":0.5874383875316289,"y":0.44246540941703},{"x":0.5874383875316289,"y":0.43870636336142266},{"x":0.5874383875316289,"y":0.4349473173058149},{"x":0.5874383875316289,"y":0.4311882712502076},{"x":0.5895432315866,"y":0.4311882712502076},{"x":0.5895432315866,"y":0.42742922519460025},{"x":0.5895432315866,"y":0.42367017913899296},{"x":0.5895432315866,"y":0.4199111330833852},{"x":0.5895432315866,"y":0.4161520870277779},{"x":0.5895432315866,"y":0.41239304097217055},{"x":0.5895432315866,"y":0.40863399491656327},{"x":0.5895432315866,"y":0.4048749488609555},{"x":0.5895432315866,"y":0.40111590280534815},{"x":0.5895432315866,"y":0.39735685674974086},{"x":0.5895432315866,"y":0.3935978106941335},{"x":0.5895432315866,"y":0.3898387646385257},{"x":0.5895432315866,"y":0.38607971858291845},{"x":0.5895432315866,"y":0.38232067252731117},{"x":0.5895432315866,"y":0.3785616264717038},{"x":0.5895432315866,"y":0.3748025804160961},{"x":0.5916480756415711,"y":0.3748025804160961},{"x":0.5916480756415711,"y":0.37104353436048865},{"x":0.5916480756415711,"y":0.3672844883048814},{"x":0.5916480756415711,"y":0.3635254422492736},{"x":0.5916480756415711,"y":0.3597663961936663},{"x":0.5916480756415711,"y":0.35600735013805906},{"x":0.5937529196965422,"y":0.3522483040824517},{"x":0.5937529196965422,"y":0.3484892580268439},{"x":0.5937529196965422,"y":0.3447302119712366},{"x":0.5937529196965422,"y":0.3409711659156293},{"x":0.5937529196965422,"y":0.337212119860022},{"x":0.5937529196965422,"y":0.3334530738044142},{"x":0.5937529196965422,"y":0.32969402774880685},{"x":0.5937529196965422,"y":0.3259349816931996},{"x":0.5937529196965422,"y":0.3221759356375923},{"x":0.5937529196965422,"y":0.3184168895819845},{"x":0.5958577637515133,"y":0.31465784352637716},{"x":0.5958577637515133,"y":0.31089879747076987},{"x":0.5958577637515133,"y":0.30338070535955475},{"x":0.5958577637515133,"y":0.29962165930394746},{"x":0.5958577637515133,"y":0.2958626132483402},{"x":0.5958577637515133,"y":0.2921035671927329},{"x":0.5958577637515133,"y":0.28834452113712505},{"x":0.5979626078064844,"y":0.2808264290259105},{"x":0.5979626078064844,"y":0.27706738297030314},{"x":0.5979626078064844,"y":0.269549290859088},{"x":0.6000674518614555,"y":0.26579024480348074},{"x":0.6000674518614555,"y":0.26203119874787345},{"x":0.6000674518614555,"y":0.25827215269226567},{"x":0.6000674518614555,"y":0.2545131066366583},{"x":0.6021722959164266,"y":0.25075406058105104},{"x":0.6021722959164266,"y":0.24699501452544376},{"x":0.6021722959164266,"y":0.24323596846983594},{"x":0.6021722959164266,"y":0.23947692241422863},{"x":0.6042771399713978,"y":0.23571787635862132},{"x":0.6063819840263689,"y":0.231958830303014},{"x":0.6084868280813399,"y":0.22819978424740625},{"x":0.6084868280813399,"y":0.22444073819179894},{"x":0.6084868280813399,"y":0.22068169213619163},{"x":0.6084868280813399,"y":0.21692264608058429},{"x":0.610591672136311,"y":0.21692264608058429},{"x":0.6126965161912821,"y":0.20940455396936922},{"x":0.6126965161912821,"y":0.2056455079137619},{"x":0.6148013602462532,"y":0.2056455079137619},{"x":0.6148013602462532,"y":0.2018864618581546},{"x":0.6148013602462532,"y":0.19812741580254684},{"x":0.6169062043012243,"y":0.19436836974693952},{"x":0.6190110483561954,"y":0.19436836974693952},{"x":0.6190110483561954,"y":0.1868502776357249},{"x":0.6211158924111665,"y":0.1868502776357249},{"x":0.6211158924111665,"y":0.1830912315801171},{"x":0.6211158924111665,"y":0.1793321855245098},{"x":0.6232207364661375,"y":0.1793321855245098},{"x":0.6232207364661375,"y":0.1755731394689025},{"x":0.6253255805211086,"y":0.17181409341329518},{"x":0.6274304245760798,"y":0.17181409341329518},{"x":0.6274304245760798,"y":0.16805504735768736},{"x":0.6295352686310508,"y":0.16429600130208005},{"x":0.6295352686310508,"y":0.1605369552464728},{"x":0.6316401126860219,"y":0.1605369552464728},{"x":0.6337449567409931,"y":0.1605369552464728},{"x":0.6337449567409931,"y":0.15301886313525767},{"x":0.6358498007959642,"y":0.15301886313525767},{"x":0.6358498007959642,"y":0.14925981707965036},{"x":0.6379546448509353,"y":0.14925981707965036},{"x":0.6400594889059064,"y":0.14174172496843576},{"x":0.6421643329608775,"y":0.13798267891282798},{"x":0.6442691770158485,"y":0.13798267891282798},{"x":0.6463740210708196,"y":0.13046458680161332},{"x":0.6463740210708196,"y":0.12670554074600607},{"x":0.6484788651257908,"y":0.12670554074600607},{"x":0.6505837091807618,"y":0.12670554074600607},{"x":0.6526885532357329,"y":0.11918744863479094},{"x":0.6526885532357329,"y":0.11542840257918363},{"x":0.654793397290704,"y":0.11542840257918363},{"x":0.6568982413456751,"y":0.11542840257918363},{"x":0.6590030854006462,"y":0.11166935652357636},{"x":0.6590030854006462,"y":0.10791031046796855},{"x":0.6611079294556172,"y":0.10415126441236124},{"x":0.6632127735105884,"y":0.10415126441236124},{"x":0.6653176175655595,"y":0.10415126441236124},{"x":0.6653176175655595,"y":0.10039221835675392},{"x":0.6674224616205306,"y":0.10039221835675392},{"x":0.6695273056755018,"y":0.10039221835675392},{"x":0.6716321497304728,"y":0.10039221835675392},{"x":0.6737369937854439,"y":0.10039221835675392},{"x":0.675841837840415,"y":0.10039221835675392},{"x":0.6779466818953861,"y":0.10039221835675392},{"x":0.6800515259503572,"y":0.10039221835675392},{"x":0.6821563700053282,"y":0.10415126441236124},{"x":0.6842612140602994,"y":0.10415126441236124},{"x":0.6863660581152704,"y":0.10791031046796855},{"x":0.6884709021702415,"y":0.10791031046796855},{"x":0.6905757462252127,"y":0.11166935652357636},{"x":0.6926805902801837,"y":0.11542840257918363},{"x":0.696890278390126,"y":0.11918744863479094},{"x":0.696890278390126,"y":0.12294649469039826},{"x":0.7010999665000682,"y":0.12670554074600607},{"x":0.7032048105550393,"y":0.13046458680161332},{"x":0.7032048105550393,"y":0.13798267891282798},{"x":0.7053096546100104,"y":0.14174172496843576},{"x":0.7074144986649814,"y":0.14925981707965036},{"x":0.7095193427199525,"y":0.14925981707965036},{"x":0.7095193427199525,"y":0.15677790919086548},{"x":0.7095193427199525,"y":0.1605369552464728},{"x":0.7095193427199525,"y":0.16429600130208005},{"x":0.7095193427199525,"y":0.16805504735768736},{"x":0.7095193427199525,"y":0.17181409341329518},{"x":0.7095193427199525,"y":0.1755731394689025},{"x":0.7095193427199525,"y":0.1793321855245098},{"x":0.7095193427199525,"y":0.1830912315801171},{"x":0.7095193427199525,"y":0.1868502776357249},{"x":0.7095193427199525,"y":0.1906093236913322},{"x":0.7095193427199525,"y":0.19436836974693952},{"x":0.7074144986649814,"y":0.19436836974693952},{"x":0.7074144986649814,"y":0.19812741580254684},{"x":0.7053096546100104,"y":0.19812741580254684},{"x":0.7053096546100104,"y":0.2018864618581546},{"x":0.7032048105550393,"y":0.2056455079137619},{"x":0.6989951224450971,"y":0.20940455396936922},{"x":0.696890278390126,"y":0.21316360002497653},{"x":0.696890278390126,"y":0.21692264608058429},{"x":0.6947854343351548,"y":0.21692264608058429},{"x":0.6926805902801837,"y":0.21692264608058429},{"x":0.6905757462252127,"y":0.22068169213619163},{"x":0.6905757462252127,"y":0.22444073819179894},{"x":0.6884709021702415,"y":0.22444073819179894},{"x":0.6842612140602994,"y":0.22819978424740625},{"x":0.6800515259503572,"y":0.231958830303014},{"x":0.6779466818953861,"y":0.231958830303014},{"x":0.6779466818953861,"y":0.23571787635862132},{"x":0.675841837840415,"y":0.23571787635862132},{"x":0.6716321497304728,"y":0.23947692241422863},{"x":0.6695273056755018,"y":0.23947692241422863},{"x":0.6674224616205306,"y":0.23947692241422863},{"x":0.6653176175655595,"y":0.23947692241422863},{"x":0.6653176175655595,"y":0.24323596846983594},{"x":0.6632127735105884,"y":0.24323596846983594},{"x":0.6611079294556172,"y":0.24323596846983594},{"x":0.6590030854006462,"y":0.24323596846983594},{"x":0.6568982413456751,"y":0.24323596846983594},{"x":0.654793397290704,"y":0.24323596846983594},{"x":0.6526885532357329,"y":0.24323596846983594},{"x":0.6505837091807618,"y":0.24323596846983594},{"x":0.6484788651257908,"y":0.24323596846983594},{"x":0.6463740210708196,"y":0.24323596846983594},{"x":0.6442691770158485,"y":0.24323596846983594},{"x":0.6421643329608775,"y":0.24323596846983594},{"x":0.6400594889059064,"y":0.24323596846983594},{"x":0.6379546448509353,"y":0.24323596846983594},{"x":0.6337449567409931,"y":0.24323596846983594},{"x":0.6316401126860219,"y":0.23947692241422863},{"x":0.6295352686310508,"y":0.23947692241422863},{"x":0.6274304245760798,"y":0.23947692241422863},{"x":0.6253255805211086,"y":0.23947692241422863},{"x":0.6211158924111665,"y":0.23571787635862132},{"x":0.6190110483561954,"y":0.22819978424740625},{"x":0.6169062043012243,"y":0.22819978424740625},{"x":0.6148013602462532,"y":0.22068169213619163},{"x":0.6148013602462532,"y":0.21692264608058429},{"x":0.6126965161912821,"y":0.2056455079137619},{"x":0.610591672136311,"y":0.2018864618581546},{"x":0.610591672136311,"y":0.19812741580254684},{"x":0.6084868280813399,"y":0.1906093236913322},{"x":0.6084868280813399,"y":0.1868502776357249},{"x":0.6084868280813399,"y":0.1830912315801171},{"x":0.6084868280813399,"y":0.17181409341329518},{"x":0.6084868280813399,"y":0.16805504735768736},{"x":0.6084868280813399,"y":0.16429600130208005},{"x":0.6084868280813399,"y":0.15677790919086548},{"x":0.6084868280813399,"y":0.15301886313525767},{"x":0.6084868280813399,"y":0.14925981707965036},{"x":0.6084868280813399,"y":0.14174172496843576},{"x":0.6084868280813399,"y":0.13798267891282798},{"x":0.6084868280813399,"y":0.13046458680161332},{"x":0.6084868280813399,"y":0.12670554074600607},{"x":0.6084868280813399,"y":0.12294649469039826},{"x":0.6084868280813399,"y":0.11542840257918363},{"x":0.6084868280813399,"y":0.11166935652357636},{"x":0.6084868280813399,"y":0.10791031046796855},{"x":0.6084868280813399,"y":0.10415126441236124},{"x":0.6084868280813399,"y":0.10039221835675392},{"x":0.610591672136311,"y":0.09663317230114665},{"x":0.610591672136311,"y":0.0928741262455388},{"x":0.6126965161912821,"y":0.0928741262455388},{"x":0.6126965161912821,"y":0.08535603413432426},{"x":0.6148013602462532,"y":0.08159698807871694},{"x":0.6148013602462532,"y":0.07783794202310909},{"x":0.6169062043012243,"y":0.07783794202310909},{"x":0.6169062043012243,"y":0.07407889596750178},{"x":0.6190110483561954,"y":0.07031984991189456},{"x":0.6211158924111665,"y":0.07031984991189456},{"x":0.6211158924111665,"y":0.06656080385628724},{"x":0.6232207364661375,"y":0.06656080385628724},{"x":0.6253255805211086,"y":0.0628017578006794},{"x":0.6274304245760798,"y":0.0628017578006794},{"x":0.6274304245760798,"y":0.05904271174507208},{"x":0.6295352686310508,"y":0.05904271174507208},{"x":0.6316401126860219,"y":0.05904271174507208},{"x":0.6337449567409931,"y":0.05904271174507208},{"x":0.6358498007959642,"y":0.055283665689464766},{"x":0.6379546448509353,"y":0.055283665689464766},{"x":0.6400594889059064,"y":0.05152461963385754},{"x":0.6421643329608775,"y":0.05152461963385754},{"x":0.6442691770158485,"y":0.05152461963385754},{"x":0.6463740210708196,"y":0.05152461963385754},{"x":0.6484788651257908,"y":0.05152461963385754},{"x":0.6505837091807618,"y":0.05152461963385754},{"x":0.6526885532357329,"y":0.05152461963385754},{"x":0.654793397290704,"y":0.05152461963385754},{"x":0.6568982413456751,"y":0.05152461963385754},{"x":0.6590030854006462,"y":0.05152461963385754},{"x":0.6611079294556172,"y":0.05152461963385754},{"x":0.6632127735105884,"y":0.05152461963385754},{"x":0.6653176175655595,"y":0.05152461963385754},{"x":0.6653176175655595,"y":0.055283665689464766},{"x":0.6674224616205306,"y":0.055283665689464766},{"x":0.6695273056755018,"y":0.055283665689464766},{"x":0.6695273056755018,"y":0.05904271174507208},{"x":0.6716321497304728,"y":0.05904271174507208},{"x":0.6737369937854439,"y":0.0628017578006794},{"x":0.675841837840415,"y":0.0628017578006794},{"x":0.675841837840415,"y":0.06656080385628724},{"x":0.6779466818953861,"y":0.07031984991189456},{"x":0.6800515259503572,"y":0.07407889596750178},{"x":0.6821563700053282,"y":0.07407889596750178},{"x":0.6821563700053282,"y":0.08159698807871694},{"x":0.6842612140602994,"y":0.08159698807871694},{"x":0.6842612140602994,"y":0.08535603413432426},{"x":0.6863660581152704,"y":0.0928741262455388},{"x":0.6884709021702415,"y":0.0928741262455388},{"x":0.6884709021702415,"y":0.09663317230114665},{"x":0.6884709021702415,"y":0.10039221835675392},{"x":0.6905757462252127,"y":0.10791031046796855},{"x":0.6926805902801837,"y":0.11166935652357636},{"x":0.6926805902801837,"y":0.11542840257918363},{"x":0.6947854343351548,"y":0.11918744863479094},{"x":0.6947854343351548,"y":0.12294649469039826},{"x":0.696890278390126,"y":0.12670554074600607},{"x":0.696890278390126,"y":0.13046458680161332},{"x":0.696890278390126,"y":0.13422363285722064},{"x":0.696890278390126,"y":0.13798267891282798},{"x":0.696890278390126,"y":0.14174172496843576},{"x":0.696890278390126,"y":0.14550077102404307},{"x":0.696890278390126,"y":0.14925981707965036},{"x":0.696890278390126,"y":0.15301886313525767},{"x":0.696890278390126,"y":0.15677790919086548},{"x":0.696890278390126,"y":0.16429600130208005},{"x":0.696890278390126,"y":0.16805504735768736},{"x":0.696890278390126,"y":0.17181409341329518},{"x":0.696890278390126,"y":0.1755731394689025},{"x":0.696890278390126,"y":0.1793321855245098},{"x":0.696890278390126,"y":0.1868502776357249},{"x":0.696890278390126,"y":0.1906093236913322},{"x":0.696890278390126,"y":0.19436836974693952},{"x":0.6947854343351548,"y":0.19812741580254684},{"x":0.6947854343351548,"y":0.2018864618581546},{"x":0.6926805902801837,"y":0.2056455079137619},{"x":0.6926805902801837,"y":0.20940455396936922},{"x":0.6905757462252127,"y":0.21692264608058429},{"x":0.6884709021702415,"y":0.21692264608058429},{"x":0.6863660581152704,"y":0.22444073819179894},{"x":0.6842612140602994,"y":0.22819978424740625},{"x":0.6800515259503572,"y":0.231958830303014},{"x":0.6800515259503572,"y":0.23571787635862132},{"x":0.6779466818953861,"y":0.23947692241422863},{"x":0.6737369937854439,"y":0.23947692241422863},{"x":0.6716321497304728,"y":0.23947692241422863},{"x":0.6716321497304728,"y":0.24323596846983594},{"x":0.6674224616205306,"y":0.24699501452544376},{"x":0.6653176175655595,"y":0.25075406058105104},{"x":0.6632127735105884,"y":0.25075406058105104},{"x":0.6590030854006462,"y":0.2545131066366583},{"x":0.6568982413456751,"y":0.2545131066366583},{"x":0.654793397290704,"y":0.25827215269226567},{"x":0.6526885532357329,"y":0.25827215269226567},{"x":0.6463740210708196,"y":0.26203119874787345},{"x":0.6442691770158485,"y":0.26579024480348074},{"x":0.6400594889059064,"y":0.26579024480348074},{"x":0.6379546448509353,"y":0.26579024480348074},{"x":0.6358498007959642,"y":0.269549290859088},{"x":0.6337449567409931,"y":0.269549290859088},{"x":0.6316401126860219,"y":0.269549290859088},{"x":0.6295352686310508,"y":0.269549290859088},{"x":0.6274304245760798,"y":0.269549290859088},{"x":0.6253255805211086,"y":0.269549290859088},{"x":0.6232207364661375,"y":0.269549290859088},{"x":0.6211158924111665,"y":0.269549290859088},{"x":0.6190110483561954,"y":0.269549290859088},{"x":0.6169062043012243,"y":0.269549290859088},{"x":0.6148013602462532,"y":0.269549290859088},{"x":0.6126965161912821,"y":0.269549290859088},{"x":0.610591672136311,"y":0.269549290859088},{"x":0.6084868280813399,"y":0.269549290859088},{"x":0.6042771399713978,"y":0.269549290859088},{"x":0.6021722959164266,"y":0.269549290859088},{"x":0.6021722959164266,"y":0.26203119874787345},{"x":0.6000674518614555,"y":0.26203119874787345},{"x":0.5979626078064844,"y":0.26203119874787345},{"x":0.5979626078064844,"y":0.25827215269226567},{"x":0.5958577637515133,"y":0.25075406058105104},{"x":0.5958577637515133,"y":0.24323596846983594},{"x":0.5958577637515133,"y":0.23947692241422863},{"x":0.5958577637515133,"y":0.23571787635862132},{"x":0.5958577637515133,"y":0.22819978424740625},{"x":0.5958577637515133,"y":0.22444073819179894},{"x":0.5958577637515133,"y":0.22068169213619163},{"x":0.5958577637515133,"y":0.21692264608058429},{"x":0.5958577637515133,"y":0.21316360002497653},{"x":0.5958577637515133,"y":0.20940455396936922},{"x":0.5958577637515133,"y":0.2056455079137619},{"x":0.5958577637515133,"y":0.2018864618581546},{"x":0.5958577637515133,"y":0.19812741580254684},{"x":0.5958577637515133,"y":0.19436836974693952},{"x":0.5979626078064844,"y":0.1868502776357249},{"x":0.5979626078064844,"y":0.1830912315801171},{"x":0.6000674518614555,"y":0.1755731394689025},{"x":0.6021722959164266,"y":0.17181409341329518},{"x":0.6042771399713978,"y":0.1605369552464728},{"x":0.6063819840263689,"y":0.1605369552464728},{"x":0.6084868280813399,"y":0.15677790919086548},{"x":0.6084868280813399,"y":0.15301886313525767},{"x":0.610591672136311,"y":0.14925981707965036},{"x":0.6126965161912821,"y":0.14550077102404307},{"x":0.6148013602462532,"y":0.14174172496843576},{"x":0.6169062043012243,"y":0.13422363285722064},{"x":0.6190110483561954,"y":0.13422363285722064},{"x":0.6211158924111665,"y":0.13422363285722064},{"x":0.6232207364661375,"y":0.12670554074600607},{"x":0.6253255805211086,"y":0.12294649469039826},{"x":0.6274304245760798,"y":0.12294649469039826},{"x":0.6316401126860219,"y":0.11542840257918363},{"x":0.6337449567409931,"y":0.11542840257918363},{"x":0.6337449567409931,"y":0.11166935652357636},{"x":0.6379546448509353,"y":0.10791031046796855},{"x":0.6400594889059064,"y":0.10415126441236124},{"x":0.6463740210708196,"y":0.10415126441236124},{"x":0.6463740210708196,"y":0.10039221835675392},{"x":0.6526885532357329,"y":0.10039221835675392},{"x":0.654793397290704,"y":0.09663317230114665},{"x":0.6568982413456751,"y":0.09663317230114665},{"x":0.6590030854006462,"y":0.09663317230114665},{"x":0.6611079294556172,"y":0.09663317230114665},{"x":0.6632127735105884,"y":0.09663317230114665},{"x":0.6653176175655595,"y":0.09663317230114665},{"x":0.6653176175655595,"y":0.10039221835675392},{"x":0.6674224616205306,"y":0.10039221835675392},{"x":0.6695273056755018,"y":0.10415126441236124},{"x":0.6716321497304728,"y":0.10415126441236124},{"x":0.6716321497304728,"y":0.10791031046796855},{"x":0.6716321497304728,"y":0.11166935652357636},{"x":0.6716321497304728,"y":0.11542840257918363},{"x":0.6737369937854439,"y":0.11918744863479094},{"x":0.675841837840415,"y":0.12294649469039826},{"x":0.675841837840415,"y":0.12670554074600607},{"x":0.675841837840415,"y":0.13046458680161332},{"x":0.6779466818953861,"y":0.13046458680161332},{"x":0.6779466818953861,"y":0.13798267891282798},{"x":0.6800515259503572,"y":0.14174172496843576},{"x":0.6800515259503572,"y":0.14550077102404307},{"x":0.6821563700053282,"y":0.14925981707965036},{"x":0.6821563700053282,"y":0.15301886313525767},{"x":0.6821563700053282,"y":0.15677790919086548},{"x":0.6821563700053282,"y":0.1605369552464728},{"x":0.6842612140602994,"y":0.1605369552464728},{"x":0.6842612140602994,"y":0.16429600130208005},{"x":0.6842612140602994,"y":0.16805504735768736},{"x":0.6863660581152704,"y":0.17181409341329518},{"x":0.6863660581152704,"y":0.1755731394689025},{"x":0.6863660581152704,"y":0.1793321855245098},{"x":0.6863660581152704,"y":0.1830912315801171},{"x":0.6884709021702415,"y":0.1868502776357249},{"x":0.6884709021702415,"y":0.1906093236913322},{"x":0.6884709021702415,"y":0.19436836974693952},{"x":0.6884709021702415,"y":0.19812741580254684},{"x":0.6884709021702415,"y":0.2018864618581546},{"x":0.6884709021702415,"y":0.2056455079137619},{"x":0.6884709021702415,"y":0.20940455396936922},{"x":0.6884709021702415,"y":0.21316360002497653},{"x":0.6884709021702415,"y":0.21692264608058429},{"x":0.6884709021702415,"y":0.22068169213619163},{"x":0.6884709021702415,"y":0.22444073819179894},{"x":0.6842612140602994,"y":0.231958830303014},{"x":0.6842612140602994,"y":0.23947692241422863},{"x":0.6821563700053282,"y":0.23947692241422863},{"x":0.6800515259503572,"y":0.23947692241422863},{"x":0.6800515259503572,"y":0.24323596846983594},{"x":0.6779466818953861,"y":0.24323596846983594},{"x":0.6779466818953861,"y":0.24699501452544376},{"x":0.675841837840415,"y":0.24699501452544376},{"x":0.6737369937854439,"y":0.25075406058105104},{"x":0.6716321497304728,"y":0.25075406058105104},{"x":0.6695273056755018,"y":0.25075406058105104},{"x":0.6674224616205306,"y":0.25075406058105104},{"x":0.6653176175655595,"y":0.25075406058105104},{"x":0.6632127735105884,"y":0.25075406058105104},{"x":0.6611079294556172,"y":0.25075406058105104},{"x":0.6590030854006462,"y":0.25075406058105104},{"x":0.6568982413456751,"y":0.25075406058105104},{"x":0.654793397290704,"y":0.24699501452544376},{"x":0.6526885532357329,"y":0.24699501452544376},{"x":0.6526885532357329,"y":0.24323596846983594},{"x":0.6505837091807618,"y":0.23947692241422863},{"x":0.6484788651257908,"y":0.23947692241422863},{"x":0.6463740210708196,"y":0.23947692241422863},{"x":0.6463740210708196,"y":0.23571787635862132},{"x":0.6463740210708196,"y":0.231958830303014},{"x":0.6463740210708196,"y":0.22819978424740625},{"x":0.6442691770158485,"y":0.22819978424740625},{"x":0.6421643329608775,"y":0.22444073819179894},{"x":0.6421643329608775,"y":0.22068169213619163},{"x":0.6400594889059064,"y":0.21692264608058429},{"x":0.6379546448509353,"y":0.2056455079137619},{"x":0.6358498007959642,"y":0.2018864618581546},{"x":0.6337449567409931,"y":0.19436836974693952},{"x":0.6337449567409931,"y":0.1906093236913322},{"x":0.6337449567409931,"y":0.1868502776357249},{"x":0.6316401126860219,"y":0.1755731394689025},{"x":0.6295352686310508,"y":0.17181409341329518},{"x":0.6274304245760798,"y":0.1605369552464728},{"x":0.6274304245760798,"y":0.15677790919086548},{"x":0.6253255805211086,"y":0.14174172496843576},{"x":0.6253255805211086,"y":0.13798267891282798},{"x":0.6232207364661375,"y":0.12670554074600607},{"x":0.6232207364661375,"y":0.12294649469039826},{"x":0.6232207364661375,"y":0.11542840257918363},{"x":0.6232207364661375,"y":0.11166935652357636},{"x":0.6232207364661375,"y":0.10415126441236124},{"x":0.6232207364661375,"y":0.10039221835675392},{"x":0.6232207364661375,"y":0.09663317230114665},{"x":0.6232207364661375,"y":0.0928741262455388},{"x":0.6232207364661375,"y":0.08911508018993149},{"x":0.6232207364661375,"y":0.08159698807871694},{"x":0.6232207364661375,"y":0.07783794202310909},{"x":0.6253255805211086,"y":0.07783794202310909},{"x":0.6253255805211086,"y":0.07407889596750178},{"x":0.6274304245760798,"y":0.07031984991189456},{"x":0.6295352686310508,"y":0.07031984991189456},{"x":0.6316401126860219,"y":0.07031984991189456},{"x":0.6337449567409931,"y":0.07783794202310909},{"x":0.6358498007959642,"y":0.08159698807871694},{"x":0.6379546448509353,"y":0.08535603413432426},{"x":0.6379546448509353,"y":0.08911508018993149},{"x":0.6400594889059064,"y":0.08911508018993149},{"x":0.6400594889059064,"y":0.0928741262455388},{"x":0.6400594889059064,"y":0.10415126441236124},{"x":0.6421643329608775,"y":0.11542840257918363},{"x":0.6421643329608775,"y":0.11918744863479094},{"x":0.6442691770158485,"y":0.12294649469039826},{"x":0.6442691770158485,"y":0.13046458680161332},{"x":0.6463740210708196,"y":0.13422363285722064},{"x":0.6463740210708196,"y":0.13798267891282798},{"x":0.6463740210708196,"y":0.14550077102404307},{"x":0.6463740210708196,"y":0.14925981707965036},{"x":0.6463740210708196,"y":0.15677790919086548},{"x":0.6463740210708196,"y":0.1605369552464728},{"x":0.6463740210708196,"y":0.16429600130208005},{"x":0.6463740210708196,"y":0.16805504735768736},{"x":0.6484788651257908,"y":0.16805504735768736},{"x":0.6484788651257908,"y":0.17181409341329518},{"x":0.6484788651257908,"y":0.1755731394689025},{"x":0.6484788651257908,"y":0.1793321855245098},{"x":0.6484788651257908,"y":0.1830912315801171},{"x":0.6484788651257908,"y":0.1868502776357249},{"x":0.6484788651257908,"y":0.1906093236913322},{"x":0.6484788651257908,"y":0.19436836974693952},{"x":0.6484788651257908,"y":0.19812741580254684},{"x":0.6484788651257908,"y":0.2018864618581546},{"x":0.6484788651257908,"y":0.2056455079137619},{"x":0.6484788651257908,"y":0.20940455396936922},{"x":0.6463740210708196,"y":0.20940455396936922},{"x":0.6463740210708196,"y":0.21316360002497653},{"x":0.6463740210708196,"y":0.21692264608058429},{"x":0.6442691770158485,"y":0.21692264608058429},{"x":0.6421643329608775,"y":0.22444073819179894},{"x":0.6400594889059064,"y":0.22444073819179894},{"x":0.6400594889059064,"y":0.22819978424740625},{"x":0.6379546448509353,"y":0.22819978424740625},{"x":0.6358498007959642,"y":0.231958830303014},{"x":0.6337449567409931,"y":0.231958830303014},{"x":0.6316401126860219,"y":0.23571787635862132},{"x":0.6295352686310508,"y":0.23571787635862132},{"x":0.6274304245760798,"y":0.23947692241422863},{"x":0.6253255805211086,"y":0.23947692241422863},{"x":0.6211158924111665,"y":0.23947692241422863},{"x":0.6190110483561954,"y":0.23947692241422863},{"x":0.6148013602462532,"y":0.23947692241422863},{"x":0.6148013602462532,"y":0.24323596846983594},{"x":0.6126965161912821,"y":0.24323596846983594},{"x":0.610591672136311,"y":0.24323596846983594},{"x":0.6084868280813399,"y":0.24323596846983594},{"x":0.6063819840263689,"y":0.24323596846983594},{"x":0.6042771399713978,"y":0.24323596846983594},{"x":0.6021722959164266,"y":0.24323596846983594},{"x":0.6000674518614555,"y":0.24323596846983594},{"x":0.6000674518614555,"y":0.23947692241422863},{"x":0.5979626078064844,"y":0.23947692241422863},{"x":0.5958577637515133,"y":0.23947692241422863},{"x":0.5916480756415711,"y":0.23571787635862132},{"x":0.5916480756415711,"y":0.231958830303014},{"x":0.5895432315866,"y":0.231958830303014},{"x":0.5895432315866,"y":0.22819978424740625},{"x":0.5874383875316289,"y":0.22819978424740625},{"x":0.5853335434766579,"y":0.22068169213619163},{"x":0.5853335434766579,"y":0.21692264608058429},{"x":0.5832286994216868,"y":0.21692264608058429},{"x":0.5832286994216868,"y":0.20940455396936922},{"x":0.5832286994216868,"y":0.2056455079137619},{"x":0.5811238553667156,"y":0.19812741580254684},{"x":0.5790190113117446,"y":0.19436836974693952},{"x":0.5790190113117446,"y":0.1906093236913322},{"x":0.5769141672567735,"y":0.1830912315801171},{"x":0.5769141672567735,"y":0.1793321855245098},{"x":0.5769141672567735,"y":0.1755731394689025},{"x":0.5769141672567735,"y":0.17181409341329518},{"x":0.5769141672567735,"y":0.16805504735768736},{"x":0.5769141672567735,"y":0.16429600130208005},{"x":0.5769141672567735,"y":0.15677790919086548},{"x":0.5769141672567735,"y":0.15301886313525767},{"x":0.5769141672567735,"y":0.14550077102404307},{"x":0.5769141672567735,"y":0.14174172496843576},{"x":0.5769141672567735,"y":0.13798267891282798},{"x":0.5769141672567735,"y":0.13422363285722064},{"x":0.5769141672567735,"y":0.13046458680161332},{"x":0.5769141672567735,"y":0.12670554074600607},{"x":0.5769141672567735,"y":0.12294649469039826},{"x":0.5790190113117446,"y":0.11918744863479094},{"x":0.5811238553667156,"y":0.11542840257918363},{"x":0.5832286994216868,"y":0.11542840257918363},{"x":0.5832286994216868,"y":0.11166935652357636},{"x":0.5853335434766579,"y":0.11166935652357636},{"x":0.5853335434766579,"y":0.10791031046796855},{"x":0.5874383875316289,"y":0.10415126441236124},{"x":0.5895432315866,"y":0.10415126441236124},{"x":0.5916480756415711,"y":0.10415126441236124},{"x":0.5937529196965422,"y":0.10415126441236124},{"x":0.5958577637515133,"y":0.10415126441236124},{"x":0.6000674518614555,"y":0.10415126441236124},{"x":0.6021722959164266,"y":0.10415126441236124},{"x":0.6042771399713978,"y":0.10415126441236124},{"x":0.6063819840263689,"y":0.10415126441236124},{"x":0.6084868280813399,"y":0.10415126441236124},{"x":0.610591672136311,"y":0.10415126441236124},{"x":0.6126965161912821,"y":0.10415126441236124},{"x":0.6148013602462532,"y":0.10415126441236124},{"x":0.6169062043012243,"y":0.10791031046796855},{"x":0.6190110483561954,"y":0.10791031046796855},{"x":0.6211158924111665,"y":0.10791031046796855},{"x":0.6211158924111665,"y":0.11166935652357636},{"x":0.6232207364661375,"y":0.11166935652357636},{"x":0.6253255805211086,"y":0.11542840257918363},{"x":0.6274304245760798,"y":0.11542840257918363},{"x":0.6274304245760798,"y":0.11918744863479094},{"x":0.6295352686310508,"y":0.11918744863479094},{"x":0.6316401126860219,"y":0.11918744863479094},{"x":0.6337449567409931,"y":0.12294649469039826},{"x":0.6358498007959642,"y":0.12294649469039826},{"x":0.6379546448509353,"y":0.12670554074600607},{"x":0.6400594889059064,"y":0.12670554074600607},{"x":0.6400594889059064,"y":0.13046458680161332},{"x":0.6421643329608775,"y":0.13046458680161332},{"x":0.6442691770158485,"y":0.13046458680161332},{"x":0.6442691770158485,"y":0.13422363285722064},{"x":0.6463740210708196,"y":0.13422363285722064},{"x":0.6463740210708196,"y":0.13798267891282798}]')},function(t){t.exports=JSON.parse('[{"x":0.1885763043929584,"y":0.3499978231687197},{"x":0.1885763043929584,"y":0.35628888082325016},{"x":0.1885763043929584,"y":0.36257993847778},{"x":0.1885763043929584,"y":0.3688709961323104},{"x":0.1885763043929584,"y":0.37516205378684087},{"x":0.18505319760509384,"y":0.3814531114413706},{"x":0.18505319760509384,"y":0.39403522675043157},{"x":0.18153009081722926,"y":0.39403522675043157},{"x":0.18153009081722926,"y":0.40032628440496204},{"x":0.18153009081722926,"y":0.4066173420594918},{"x":0.18153009081722926,"y":0.4129083997140222},{"x":0.18153009081722926,"y":0.4254905150230825},{"x":0.18153009081722926,"y":0.4317815726776129},{"x":0.1780069840293647,"y":0.44436368798667314},{"x":0.1780069840293647,"y":0.45065474564120367},{"x":0.17448387724150013,"y":0.4695279186047943},{"x":0.17448387724150013,"y":0.47581897625932473},{"x":0.17448387724150013,"y":0.4946921492229155},{"x":0.17448387724150013,"y":0.5135653221865062},{"x":0.1709607704536356,"y":0.5261474374955664},{"x":0.1709607704536356,"y":0.5387295528046273},{"x":0.1709607704536356,"y":0.5513116681136875},{"x":0.1709607704536356,"y":0.557602725768218},{"x":0.167437663665771,"y":0.5638937834227478},{"x":0.167437663665771,"y":0.5764758987318087},{"x":0.167437663665771,"y":0.5827669563863392},{"x":0.167437663665771,"y":0.589058014040869},{"x":0.167437663665771,"y":0.5953490716953994},{"x":0.167437663665771,"y":0.6016401293499298},{"x":0.167437663665771,"y":0.6079311870044597},{"x":0.167437663665771,"y":0.61422224465899},{"x":0.167437663665771,"y":0.6205133023135205},{"x":0.1709607704536356,"y":0.6205133023135205},{"x":0.17448387724150013,"y":0.6205133023135205},{"x":0.18153009081722926,"y":0.6205133023135205},{"x":0.1885763043929584,"y":0.6205133023135205},{"x":0.1991456247565521,"y":0.6268043599680503},{"x":0.20266873154441667,"y":0.6268043599680503},{"x":0.21323805190801037,"y":0.6268043599680503},{"x":0.22380737227160408,"y":0.6330954176225808},{"x":0.23789979942306236,"y":0.6330954176225808},{"x":0.24494601299879154,"y":0.6330954176225808},{"x":0.2555153333623852,"y":0.6330954176225808},{"x":0.2625615469381143,"y":0.6330954176225808},{"x":0.273130867301708,"y":0.6330954176225808},{"x":0.2801770808774372,"y":0.6330954176225808},{"x":0.2872232944531663,"y":0.6330954176225808},{"x":0.29426950802889545,"y":0.6330954176225808},{"x":0.3013157216046246,"y":0.6330954176225808},{"x":0.3083619351803537,"y":0.6330954176225808},{"x":0.3118850419682183,"y":0.6330954176225808},{"x":0.31540814875608286,"y":0.6330954176225808},{"x":0.31540814875608286,"y":0.6205133023135205},{"x":0.31540814875608286,"y":0.61422224465899},{"x":0.31540814875608286,"y":0.6016401293499298},{"x":0.31540814875608286,"y":0.5953490716953994},{"x":0.31540814875608286,"y":0.5764758987318087},{"x":0.31540814875608286,"y":0.5701848410772782},{"x":0.31540814875608286,"y":0.557602725768218},{"x":0.31540814875608286,"y":0.5450206104591572},{"x":0.31540814875608286,"y":0.5387295528046273},{"x":0.31540814875608286,"y":0.5324384951500969},{"x":0.31540814875608286,"y":0.5198563798410366},{"x":0.3189312555439474,"y":0.5009832068774459},{"x":0.3189312555439474,"y":0.488401091568385},{"x":0.3189312555439474,"y":0.48211003391385454},{"x":0.3189312555439474,"y":0.46323686095026384},{"x":0.3189312555439474,"y":0.45065474564120367},{"x":0.322454362331812,"y":0.4191994573685527},{"x":0.3295005759075411,"y":0.4066173420594918},{"x":0.3295005759075411,"y":0.40032628440496204},{"x":0.3295005759075411,"y":0.39403522675043157},{"x":0.3330236826954057,"y":0.37516205378684087},{"x":0.33654678948327027,"y":0.37516205378684087},{"x":0.33654678948327027,"y":0.3688709961323104},{"x":0.3400698962711349,"y":0.36257993847778},{"x":0.3435930030589994,"y":0.36257993847778},{"x":0.347116109846864,"y":0.36257993847778},{"x":0.3506392166347286,"y":0.36257993847778},{"x":0.35416232342259313,"y":0.35628888082325016},{"x":0.3612085369983223,"y":0.35628888082325016},{"x":0.36825475057405127,"y":0.35628888082325016},{"x":0.3753009641497805,"y":0.35628888082325016},{"x":0.38939339130123873,"y":0.35628888082325016},{"x":0.40348581845269704,"y":0.34370676551418927},{"x":0.41405513881629075,"y":0.34370676551418927},{"x":0.42110135239201985,"y":0.34370676551418927},{"x":0.428147565967749,"y":0.34370676551418927},{"x":0.4422399931192073,"y":0.34370676551418927},{"x":0.44928620669493646,"y":0.34370676551418927},{"x":0.452809313482801,"y":0.34370676551418927},{"x":0.45633242027066556,"y":0.34370676551418927},{"x":0.45633242027066556,"y":0.35628888082325016},{"x":0.45633242027066556,"y":0.36257993847778},{"x":0.452809313482801,"y":0.37516205378684087},{"x":0.452809313482801,"y":0.38774416909590104},{"x":0.44928620669493646,"y":0.40032628440496204},{"x":0.44576309990707186,"y":0.4254905150230825},{"x":0.44576309990707186,"y":0.4317815726776129},{"x":0.44576309990707186,"y":0.4380726303321434},{"x":0.44576309990707186,"y":0.45065474564120367},{"x":0.4422399931192073,"y":0.4695279186047943},{"x":0.4422399931192073,"y":0.47581897625932473},{"x":0.4422399931192073,"y":0.48211003391385454},{"x":0.43519377954347815,"y":0.5072742645319757},{"x":0.43519377954347815,"y":0.5135653221865062},{"x":0.43519377954347815,"y":0.5261474374955664},{"x":0.43519377954347815,"y":0.5387295528046273},{"x":0.43519377954347815,"y":0.5513116681136875},{"x":0.43519377954347815,"y":0.557602725768218},{"x":0.43519377954347815,"y":0.5638937834227478},{"x":0.43519377954347815,"y":0.5701848410772782},{"x":0.43519377954347815,"y":0.5764758987318087},{"x":0.43519377954347815,"y":0.5827669563863392},{"x":0.43519377954347815,"y":0.589058014040869},{"x":0.43519377954347815,"y":0.5953490716953994},{"x":0.43519377954347815,"y":0.6016401293499298},{"x":0.43519377954347815,"y":0.6079311870044597},{"x":0.43519377954347815,"y":0.61422224465899},{"x":0.43519377954347815,"y":0.6205133023135205},{"x":0.4387168863313427,"y":0.6205133023135205},{"x":0.4422399931192073,"y":0.6205133023135205},{"x":0.44576309990707186,"y":0.6205133023135205},{"x":0.452809313482801,"y":0.6205133023135205},{"x":0.45985552705853017,"y":0.6205133023135205},{"x":0.4633786338463947,"y":0.6205133023135205},{"x":0.47747106099785297,"y":0.6205133023135205},{"x":0.4845172745735821,"y":0.6205133023135205},{"x":0.49508659493717583,"y":0.6205133023135205},{"x":0.5091790220886342,"y":0.6205133023135205},{"x":0.5267945560279569,"y":0.6205133023135205},{"x":0.5373638763915506,"y":0.6205133023135205},{"x":0.5479331967551443,"y":0.6205133023135205},{"x":0.5514563035430089,"y":0.6205133023135205},{"x":0.5585025171187381,"y":0.6205133023135205},{"x":0.5655487306944671,"y":0.6205133023135205},{"x":0.5690718374823318,"y":0.6205133023135205},{"x":0.5761180510580608,"y":0.6205133023135205},{"x":0.5796411578459255,"y":0.6205133023135205},{"x":0.58316426463379,"y":0.6205133023135205},{"x":0.5866873714216545,"y":0.6205133023135205},{"x":0.5866873714216545,"y":0.61422224465899},{"x":0.5866873714216545,"y":0.6079311870044597},{"x":0.5866873714216545,"y":0.6016401293499298},{"x":0.5866873714216545,"y":0.5953490716953994},{"x":0.5866873714216545,"y":0.589058014040869},{"x":0.5866873714216545,"y":0.5701848410772782},{"x":0.5866873714216545,"y":0.557602725768218},{"x":0.5866873714216545,"y":0.5513116681136875},{"x":0.5866873714216545,"y":0.5261474374955664},{"x":0.5866873714216545,"y":0.5198563798410366},{"x":0.5866873714216545,"y":0.5009832068774459},{"x":0.5866873714216545,"y":0.4946921492229155},{"x":0.5866873714216545,"y":0.48211003391385454},{"x":0.5902104782095192,"y":0.47581897625932473},{"x":0.5902104782095192,"y":0.4695279186047943},{"x":0.5902104782095192,"y":0.46323686095026384},{"x":0.5902104782095192,"y":0.45694580329573403},{"x":0.5902104782095192,"y":0.45065474564120367},{"x":0.5937335849973837,"y":0.44436368798667314},{"x":0.5937335849973837,"y":0.4317815726776129},{"x":0.5937335849973837,"y":0.4254905150230825},{"x":0.5937335849973837,"y":0.4191994573685527},{"x":0.5972566917852483,"y":0.4129083997140222},{"x":0.6007797985731129,"y":0.40032628440496204},{"x":0.6043029053609774,"y":0.38774416909590104},{"x":0.6043029053609774,"y":0.3814531114413706},{"x":0.6043029053609774,"y":0.37516205378684087},{"x":0.6078260121488419,"y":0.37516205378684087},{"x":0.6113491189367066,"y":0.37516205378684087},{"x":0.6219184393003003,"y":0.3688709961323104},{"x":0.6289646528760294,"y":0.3688709961323104},{"x":0.6395339732396231,"y":0.3688709961323104},{"x":0.6536264003910814,"y":0.36257993847778},{"x":0.657149507178946,"y":0.36257993847778},{"x":0.6641957207546751,"y":0.36257993847778},{"x":0.6712419343304041,"y":0.35628888082325016},{"x":0.6818112546939978,"y":0.35628888082325016},{"x":0.688857468269727,"y":0.35628888082325016},{"x":0.6994267886333208,"y":0.3499978231687197},{"x":0.7029498954211852,"y":0.3499978231687197},{"x":0.7099961089969145,"y":0.3499978231687197},{"x":0.7170423225726436,"y":0.3499978231687197},{"x":0.7205654293605082,"y":0.34370676551418927},{"x":0.7276116429362374,"y":0.34370676551418927},{"x":0.7311347497241019,"y":0.34370676551418927},{"x":0.7311347497241019,"y":0.3499978231687197},{"x":0.7276116429362374,"y":0.35628888082325016},{"x":0.7240885361483727,"y":0.3688709961323104},{"x":0.7205654293605082,"y":0.3814531114413706},{"x":0.7205654293605082,"y":0.39403522675043157},{"x":0.7205654293605082,"y":0.4129083997140222},{"x":0.7170423225726436,"y":0.4129083997140222},{"x":0.7170423225726436,"y":0.4380726303321434},{"x":0.713519215784779,"y":0.44436368798667314},{"x":0.713519215784779,"y":0.45065474564120367},{"x":0.713519215784779,"y":0.4695279186047943},{"x":0.713519215784779,"y":0.47581897625932473},{"x":0.713519215784779,"y":0.48211003391385454},{"x":0.713519215784779,"y":0.488401091568385},{"x":0.7099961089969145,"y":0.5009832068774459},{"x":0.7099961089969145,"y":0.5072742645319757},{"x":0.7099961089969145,"y":0.5261474374955664},{"x":0.7099961089969145,"y":0.5387295528046273},{"x":0.7099961089969145,"y":0.5450206104591572},{"x":0.7099961089969145,"y":0.5513116681136875},{"x":0.7099961089969145,"y":0.5638937834227478},{"x":0.7099961089969145,"y":0.5701848410772782},{"x":0.7099961089969145,"y":0.5764758987318087},{"x":0.7099961089969145,"y":0.5827669563863392},{"x":0.7099961089969145,"y":0.589058014040869},{"x":0.7099961089969145,"y":0.5953490716953994},{"x":0.7099961089969145,"y":0.6016401293499298},{"x":0.7099961089969145,"y":0.6079311870044597},{"x":0.7170423225726436,"y":0.61422224465899},{"x":0.7240885361483727,"y":0.61422224465899},{"x":0.7346578565119664,"y":0.61422224465899},{"x":0.7452271768755602,"y":0.61422224465899},{"x":0.7522733904512893,"y":0.61422224465899},{"x":0.7593196040270185,"y":0.61422224465899},{"x":0.7663658176027476,"y":0.61422224465899},{"x":0.7769351379663412,"y":0.61422224465899},{"x":0.7804582447542059,"y":0.61422224465899},{"x":0.787504458329935,"y":0.61422224465899},{"x":0.7910275651177996,"y":0.61422224465899},{"x":0.7945506719056641,"y":0.61422224465899},{"x":0.7980737786935287,"y":0.61422224465899},{"x":0.8015968854813933,"y":0.61422224465899},{"x":0.8051199922692579,"y":0.61422224465899},{"x":0.8086430990571224,"y":0.61422224465899},{"x":0.812166205844987,"y":0.61422224465899},{"x":0.8156893126328515,"y":0.6079311870044597},{"x":0.8156893126328515,"y":0.6016401293499298},{"x":0.8192124194207161,"y":0.5827669563863392},{"x":0.8192124194207161,"y":0.5638937834227478},{"x":0.8227355262085807,"y":0.5513116681136875},{"x":0.8262586329964453,"y":0.5324384951500969},{"x":0.8262586329964453,"y":0.5198563798410366},{"x":0.8262586329964453,"y":0.5135653221865062},{"x":0.8262586329964453,"y":0.4946921492229155},{"x":0.8262586329964453,"y":0.48211003391385454},{"x":0.8333048465721744,"y":0.4695279186047943},{"x":0.8333048465721744,"y":0.46323686095026384},{"x":0.8333048465721744,"y":0.44436368798667314},{"x":0.8333048465721744,"y":0.4317815726776129},{"x":0.8333048465721744,"y":0.4254905150230825},{"x":0.8368279533600389,"y":0.4066173420594918},{"x":0.8368279533600389,"y":0.40032628440496204},{"x":0.8403510601479035,"y":0.38774416909590104},{"x":0.8403510601479035,"y":0.3688709961323104},{"x":0.8403510601479035,"y":0.36257993847778}]')},function(t){t.exports=JSON.parse('[{"x":0.25199222657452064,"y":0.4129083997140222},{"x":0.2625615469381143,"y":0.40032628440496204},{"x":0.2660846537259789,"y":0.39403522675043157},{"x":0.273130867301708,"y":0.37516205378684087},{"x":0.28370018766530175,"y":0.3499978231687197},{"x":0.29779261481676,"y":0.33112465020512905},{"x":0.3118850419682183,"y":0.2996693619324774},{"x":0.3189312555439474,"y":0.29337830427794764},{"x":0.32597746911967657,"y":0.2745051313143569},{"x":0.3330236826954057,"y":0.25563195835076624},{"x":0.3400698962711349,"y":0.23675878538717554},{"x":0.35416232342259313,"y":0.2115945547690544},{"x":0.3612085369983223,"y":0.20530349711452392},{"x":0.36473164378618683,"y":0.19901243945999347},{"x":0.36825475057405127,"y":0.1927213818054637},{"x":0.37177785736191593,"y":0.1927213818054637},{"x":0.3753009641497805,"y":0.1927213818054637},{"x":0.37882407093764503,"y":0.1927213818054637},{"x":0.3858702845133742,"y":0.2115945547690544},{"x":0.40348581845269704,"y":0.23675878538717554},{"x":0.41053203202842614,"y":0.24934090069623577},{"x":0.42110135239201985,"y":0.2745051313143569},{"x":0.43519377954347815,"y":0.30596041958700787},{"x":0.44928620669493646,"y":0.33112465020512905},{"x":0.4633786338463947,"y":0.34370676551418927},{"x":0.47747106099785297,"y":0.3688709961323104},{"x":0.4880403813614467,"y":0.3814531114413706},{"x":0.4915634881493113,"y":0.38774416909590104},{"x":0.5056559153007696,"y":0.4066173420594918},{"x":0.5127021288764987,"y":0.4191994573685527},{"x":0.5197483424522278,"y":0.4317815726776129},{"x":0.5267945560279569,"y":0.44436368798667314},{"x":0.533840769603686,"y":0.4695279186047943},{"x":0.5444100899672797,"y":0.488401091568385},{"x":0.5585025171187381,"y":0.5198563798410366},{"x":0.5655487306944671,"y":0.5387295528046273},{"x":0.5761180510580608,"y":0.5764758987318087},{"x":0.5866873714216545,"y":0.5953490716953994},{"x":0.5937335849973837,"y":0.6205133023135205},{"x":0.6078260121488419,"y":0.645677532931641},{"x":0.6183953325124357,"y":0.6645507058952324},{"x":0.6219184393003003,"y":0.6771328212042926},{"x":0.6254415460881648,"y":0.683423878858823},{"x":0.6289646528760294,"y":0.683423878858823},{"x":0.632487759663894,"y":0.6897149365133528},{"x":0.6360108664517586,"y":0.6897149365133528},{"x":0.6395339732396231,"y":0.6897149365133528},{"x":0.6465801868153522,"y":0.6897149365133528},{"x":0.6501032936032168,"y":0.683423878858823},{"x":0.657149507178946,"y":0.6771328212042926},{"x":0.657149507178946,"y":0.6708417635497622},{"x":0.6677188275425396,"y":0.645677532931641},{"x":0.6712419343304041,"y":0.6330954176225808},{"x":0.6782881479061333,"y":0.6079311870044597},{"x":0.6853343614818626,"y":0.5827669563863392},{"x":0.6959036818454561,"y":0.5513116681136875},{"x":0.7029498954211852,"y":0.5072742645319757},{"x":0.7029498954211852,"y":0.47581897625932473},{"x":0.7099961089969145,"y":0.4380726303321434},{"x":0.713519215784779,"y":0.4066173420594918},{"x":0.7205654293605082,"y":0.38774416909590104},{"x":0.7205654293605082,"y":0.35628888082325016},{"x":0.7240885361483727,"y":0.33112465020512905},{"x":0.7276116429362374,"y":0.3122514772415383},{"x":0.7276116429362374,"y":0.30596041958700787},{"x":0.7276116429362374,"y":0.29337830427794764},{"x":0.7276116429362374,"y":0.28708724662341717},{"x":0.7276116429362374,"y":0.28079618896888675},{"x":0.7276116429362374,"y":0.2745051313143569},{"x":0.7276116429362374,"y":0.26821407365982647},{"x":0.7276116429362374,"y":0.261923016005296},{"x":0.7276116429362374,"y":0.25563195835076624},{"x":0.7240885361483727,"y":0.25563195835076624},{"x":0.7240885361483727,"y":0.24934090069623577},{"x":0.7170423225726436,"y":0.24934090069623577},{"x":0.713519215784779,"y":0.24934090069623577},{"x":0.70647300220905,"y":0.24934090069623577},{"x":0.7029498954211852,"y":0.24934090069623577},{"x":0.6994267886333208,"y":0.24934090069623577},{"x":0.6959036818454561,"y":0.24934090069623577},{"x":0.6923805750575915,"y":0.24934090069623577},{"x":0.688857468269727,"y":0.24934090069623577},{"x":0.6818112546939978,"y":0.24934090069623577},{"x":0.6782881479061333,"y":0.24934090069623577},{"x":0.6712419343304041,"y":0.25563195835076624},{"x":0.6641957207546751,"y":0.25563195835076624},{"x":0.6536264003910814,"y":0.261923016005296},{"x":0.6465801868153522,"y":0.26821407365982647},{"x":0.6360108664517586,"y":0.26821407365982647},{"x":0.6183953325124357,"y":0.28708724662341717},{"x":0.6113491189367066,"y":0.28708724662341717},{"x":0.5972566917852483,"y":0.29337830427794764},{"x":0.5866873714216545,"y":0.2996693619324774},{"x":0.5761180510580608,"y":0.30596041958700787},{"x":0.5620256239066026,"y":0.3122514772415383},{"x":0.5514563035430089,"y":0.3122514772415383},{"x":0.5408869831794152,"y":0.31854253489606876},{"x":0.533840769603686,"y":0.31854253489606876},{"x":0.5232714492400923,"y":0.31854253489606876},{"x":0.5197483424522278,"y":0.33112465020512905},{"x":0.5127021288764987,"y":0.33112465020512905},{"x":0.5056559153007696,"y":0.33741570785965946},{"x":0.502132808512905,"y":0.33741570785965946},{"x":0.49508659493717583,"y":0.34370676551418927},{"x":0.4915634881493113,"y":0.34370676551418927},{"x":0.4809941677857176,"y":0.3499978231687197},{"x":0.47042484742212387,"y":0.3499978231687197},{"x":0.4633786338463947,"y":0.35628888082325016},{"x":0.45985552705853017,"y":0.35628888082325016},{"x":0.44928620669493646,"y":0.3688709961323104},{"x":0.4422399931192073,"y":0.3688709961323104},{"x":0.4316706727556136,"y":0.37516205378684087},{"x":0.42110135239201985,"y":0.37516205378684087},{"x":0.41053203202842614,"y":0.3814531114413706},{"x":0.4070089252405616,"y":0.38774416909590104},{"x":0.3964396048769679,"y":0.39403522675043157},{"x":0.39291649808910334,"y":0.39403522675043157},{"x":0.3858702845133742,"y":0.39403522675043157},{"x":0.38234717772550963,"y":0.39403522675043157},{"x":0.37882407093764503,"y":0.40032628440496204},{"x":0.3753009641497805,"y":0.4066173420594918},{"x":0.37177785736191593,"y":0.4129083997140222},{"x":0.36825475057405127,"y":0.4129083997140222},{"x":0.3576854302104577,"y":0.4129083997140222},{"x":0.35416232342259313,"y":0.4191994573685527},{"x":0.347116109846864,"y":0.4254905150230825},{"x":0.3435930030589994,"y":0.4254905150230825},{"x":0.3400698962711349,"y":0.4254905150230825},{"x":0.33654678948327027,"y":0.4254905150230825},{"x":0.3295005759075411,"y":0.4317815726776129},{"x":0.32597746911967657,"y":0.4317815726776129},{"x":0.322454362331812,"y":0.4317815726776129},{"x":0.3189312555439474,"y":0.4317815726776129},{"x":0.3189312555439474,"y":0.44436368798667314},{"x":0.31540814875608286,"y":0.44436368798667314},{"x":0.3118850419682183,"y":0.45065474564120367},{"x":0.3083619351803537,"y":0.45065474564120367},{"x":0.30483882839248916,"y":0.45065474564120367},{"x":0.3013157216046246,"y":0.45065474564120367},{"x":0.29779261481676,"y":0.45065474564120367},{"x":0.2907464012410309,"y":0.45065474564120367},{"x":0.2872232944531663,"y":0.45065474564120367},{"x":0.28370018766530175,"y":0.45065474564120367},{"x":0.2801770808774372,"y":0.45694580329573403},{"x":0.2766539740895726,"y":0.45694580329573403},{"x":0.273130867301708,"y":0.45694580329573403},{"x":0.2696077605138435,"y":0.45694580329573403},{"x":0.2660846537259789,"y":0.45694580329573403},{"x":0.2625615469381143,"y":0.45065474564120367},{"x":0.2625615469381143,"y":0.44436368798667314},{"x":0.2590384401502498,"y":0.44436368798667314},{"x":0.2590384401502498,"y":0.4380726303321434},{"x":0.2590384401502498,"y":0.4317815726776129},{"x":0.2555153333623852,"y":0.4317815726776129},{"x":0.25199222657452064,"y":0.4254905150230825},{"x":0.24846911978665606,"y":0.4254905150230825}]')},function(t){t.exports=JSON.parse('[{"x":0.18505319760509384,"y":0.23675878538717554},{"x":0.18505319760509384,"y":0.23046772773264507},{"x":0.18153009081722926,"y":0.22417667007811462},{"x":0.17448387724150013,"y":0.22417667007811462},{"x":0.1709607704536356,"y":0.23046772773264507},{"x":0.167437663665771,"y":0.23675878538717554},{"x":0.16391455687790643,"y":0.24304984304170532},{"x":0.16039145009004185,"y":0.24934090069623577},{"x":0.15334523651431273,"y":0.26821407365982647},{"x":0.13925280936285445,"y":0.28708724662341717},{"x":0.13925280936285445,"y":0.2996693619324774},{"x":0.12868348899926074,"y":0.33112465020512905},{"x":0.12516038221139617,"y":0.34370676551418927},{"x":0.12163727542353162,"y":0.3688709961323104},{"x":0.11459106184780245,"y":0.39403522675043157},{"x":0.11106795505993791,"y":0.4129083997140222},{"x":0.11106795505993791,"y":0.4254905150230825},{"x":0.11106795505993791,"y":0.4380726303321434},{"x":0.11106795505993791,"y":0.45694580329573403},{"x":0.11106795505993791,"y":0.46323686095026384},{"x":0.11106795505993791,"y":0.48211003391385454},{"x":0.11106795505993791,"y":0.488401091568385},{"x":0.11106795505993791,"y":0.5009832068774459},{"x":0.11106795505993791,"y":0.5072742645319757},{"x":0.11106795505993791,"y":0.5135653221865062},{"x":0.11459106184780245,"y":0.5261474374955664},{"x":0.12163727542353162,"y":0.5261474374955664},{"x":0.12868348899926074,"y":0.5324384951500969},{"x":0.13925280936285445,"y":0.5324384951500969},{"x":0.15334523651431273,"y":0.5324384951500969},{"x":0.1780069840293647,"y":0.5387295528046273},{"x":0.19562251796868754,"y":0.5387295528046273},{"x":0.22380737227160408,"y":0.5387295528046273},{"x":0.2555153333623852,"y":0.5387295528046273},{"x":0.28370018766530175,"y":0.5387295528046273},{"x":0.3189312555439474,"y":0.5387295528046273},{"x":0.3435930030589994,"y":0.5324384951500969},{"x":0.3576854302104577,"y":0.5198563798410366},{"x":0.36473164378618683,"y":0.5135653221865062},{"x":0.37177785736191593,"y":0.5009832068774459},{"x":0.3753009641497805,"y":0.4946921492229155},{"x":0.37882407093764503,"y":0.48211003391385454},{"x":0.38234717772550963,"y":0.47581897625932473},{"x":0.38234717772550963,"y":0.46323686095026384},{"x":0.38234717772550963,"y":0.44436368798667314},{"x":0.38234717772550963,"y":0.4317815726776129},{"x":0.38234717772550963,"y":0.4066173420594918},{"x":0.38234717772550963,"y":0.39403522675043157},{"x":0.38234717772550963,"y":0.3814531114413706},{"x":0.38234717772550963,"y":0.36257993847778},{"x":0.38234717772550963,"y":0.3499978231687197},{"x":0.38234717772550963,"y":0.34370676551418927},{"x":0.37882407093764503,"y":0.33112465020512905},{"x":0.3753009641497805,"y":0.3122514772415383},{"x":0.37177785736191593,"y":0.30596041958700787},{"x":0.3612085369983223,"y":0.28708724662341717},{"x":0.35416232342259313,"y":0.2745051313143569},{"x":0.347116109846864,"y":0.261923016005296},{"x":0.3435930030589994,"y":0.24934090069623577},{"x":0.3400698962711349,"y":0.24304984304170532},{"x":0.3330236826954057,"y":0.23675878538717554},{"x":0.322454362331812,"y":0.23046772773264507},{"x":0.3118850419682183,"y":0.22417667007811462},{"x":0.3013157216046246,"y":0.21788561242358415},{"x":0.2907464012410309,"y":0.21788561242358415},{"x":0.2801770808774372,"y":0.21788561242358415},{"x":0.2696077605138435,"y":0.21788561242358415},{"x":0.2590384401502498,"y":0.21788561242358415},{"x":0.2555153333623852,"y":0.21788561242358415},{"x":0.24846911978665606,"y":0.21788561242358415},{"x":0.23789979942306236,"y":0.21788561242358415},{"x":0.23437669263519778,"y":0.21788561242358415},{"x":0.22380737227160408,"y":0.21788561242358415},{"x":0.21676115869587495,"y":0.21788561242358415},{"x":0.20619183833228125,"y":0.21788561242358415},{"x":0.20266873154441667,"y":0.22417667007811462},{"x":0.19562251796868754,"y":0.23046772773264507},{"x":0.1885763043929584,"y":0.23675878538717554},{"x":0.18505319760509384,"y":0.24304984304170532},{"x":0.18153009081722926,"y":0.24304984304170532},{"x":0.1780069840293647,"y":0.24934090069623577},{"x":0.1709607704536356,"y":0.261923016005296},{"x":0.167437663665771,"y":0.2745051313143569},{"x":0.167437663665771,"y":0.28079618896888675},{"x":0.17448387724150013,"y":0.28079618896888675},{"x":0.1885763043929584,"y":0.28079618896888675},{"x":0.20266873154441667,"y":0.26821407365982647},{"x":0.22028426548373953,"y":0.24934090069623577},{"x":0.24494601299879154,"y":0.24304984304170532},{"x":0.2625615469381143,"y":0.23046772773264507},{"x":0.28370018766530175,"y":0.2115945547690544},{"x":0.3013157216046246,"y":0.20530349711452392},{"x":0.3189312555439474,"y":0.20530349711452392},{"x":0.3295005759075411,"y":0.19901243945999347},{"x":0.347116109846864,"y":0.1927213818054637},{"x":0.3576854302104577,"y":0.1927213818054637},{"x":0.3753009641497805,"y":0.1927213818054637},{"x":0.38234717772550963,"y":0.18643032415093325},{"x":0.39996271166483244,"y":0.18643032415093325},{"x":0.41053203202842614,"y":0.18013926649640277},{"x":0.42462445917988445,"y":0.18013926649640277},{"x":0.44928620669493646,"y":0.16755715118734255},{"x":0.45985552705853017,"y":0.16755715118734255},{"x":0.47747106099785297,"y":0.16755715118734255},{"x":0.4915634881493113,"y":0.16755715118734255},{"x":0.5056559153007696,"y":0.16755715118734255},{"x":0.5162252356643633,"y":0.16755715118734255},{"x":0.5267945560279569,"y":0.16755715118734255},{"x":0.5479331967551443,"y":0.173848208841873},{"x":0.5514563035430089,"y":0.18013926649640277},{"x":0.5620256239066026,"y":0.18013926649640277},{"x":0.5761180510580608,"y":0.18643032415093325},{"x":0.5866873714216545,"y":0.18643032415093325},{"x":0.6078260121488419,"y":0.1927213818054637},{"x":0.6254415460881648,"y":0.1927213818054637},{"x":0.6360108664517586,"y":0.1927213818054637},{"x":0.6641957207546751,"y":0.1927213818054637},{"x":0.6782881479061333,"y":0.19901243945999347},{"x":0.7029498954211852,"y":0.19901243945999347},{"x":0.7170423225726436,"y":0.2115945547690544},{"x":0.7276116429362374,"y":0.2115945547690544},{"x":0.7346578565119664,"y":0.21788561242358415},{"x":0.7452271768755602,"y":0.21788561242358415},{"x":0.7522733904512893,"y":0.21788561242358415},{"x":0.7593196040270185,"y":0.21788561242358415},{"x":0.7663658176027476,"y":0.22417667007811462},{"x":0.7734120311784767,"y":0.23046772773264507},{"x":0.7769351379663412,"y":0.23046772773264507},{"x":0.7804582447542059,"y":0.23046772773264507},{"x":0.7804582447542059,"y":0.23675878538717554},{"x":0.787504458329935,"y":0.23675878538717554},{"x":0.7910275651177996,"y":0.24934090069623577},{"x":0.7945506719056641,"y":0.24934090069623577},{"x":0.7945506719056641,"y":0.25563195835076624},{"x":0.7980737786935287,"y":0.261923016005296},{"x":0.7980737786935287,"y":0.26821407365982647},{"x":0.8015968854813933,"y":0.26821407365982647},{"x":0.8051199922692579,"y":0.28079618896888675},{"x":0.8051199922692579,"y":0.29337830427794764},{"x":0.8086430990571224,"y":0.30596041958700787},{"x":0.812166205844987,"y":0.3248335925505985},{"x":0.8156893126328515,"y":0.33741570785965946},{"x":0.8156893126328515,"y":0.34370676551418927},{"x":0.8192124194207161,"y":0.35628888082325016},{"x":0.8227355262085807,"y":0.37516205378684087},{"x":0.8227355262085807,"y":0.3814531114413706},{"x":0.8262586329964453,"y":0.39403522675043157},{"x":0.8262586329964453,"y":0.4129083997140222},{"x":0.8262586329964453,"y":0.4254905150230825},{"x":0.8262586329964453,"y":0.4380726303321434},{"x":0.8262586329964453,"y":0.45694580329573403},{"x":0.8262586329964453,"y":0.4695279186047943},{"x":0.8262586329964453,"y":0.488401091568385},{"x":0.8262586329964453,"y":0.5009832068774459},{"x":0.8227355262085807,"y":0.5072742645319757},{"x":0.8156893126328515,"y":0.5198563798410366},{"x":0.812166205844987,"y":0.5324384951500969},{"x":0.8086430990571224,"y":0.5324384951500969},{"x":0.8051199922692579,"y":0.5450206104591572},{"x":0.7980737786935287,"y":0.5450206104591572},{"x":0.7945506719056641,"y":0.5450206104591572},{"x":0.7839813515420705,"y":0.5638937834227478},{"x":0.7769351379663412,"y":0.5638937834227478},{"x":0.7663658176027476,"y":0.5638937834227478},{"x":0.7557964972391538,"y":0.5701848410772782},{"x":0.7452271768755602,"y":0.5701848410772782},{"x":0.738180963299831,"y":0.5701848410772782},{"x":0.7276116429362374,"y":0.5701848410772782},{"x":0.7170423225726436,"y":0.5701848410772782},{"x":0.713519215784779,"y":0.5701848410772782},{"x":0.6994267886333208,"y":0.5701848410772782},{"x":0.6923805750575915,"y":0.5701848410772782},{"x":0.6818112546939978,"y":0.5638937834227478},{"x":0.6677188275425396,"y":0.557602725768218},{"x":0.6501032936032168,"y":0.5450206104591572},{"x":0.6395339732396231,"y":0.5387295528046273},{"x":0.6289646528760294,"y":0.5324384951500969},{"x":0.6183953325124357,"y":0.5198563798410366},{"x":0.6113491189367066,"y":0.5135653221865062},{"x":0.5972566917852483,"y":0.5009832068774459},{"x":0.5902104782095192,"y":0.5009832068774459},{"x":0.5866873714216545,"y":0.488401091568385},{"x":0.58316426463379,"y":0.488401091568385},{"x":0.5796411578459255,"y":0.47581897625932473},{"x":0.5796411578459255,"y":0.46323686095026384},{"x":0.5761180510580608,"y":0.45694580329573403},{"x":0.5761180510580608,"y":0.45065474564120367},{"x":0.5761180510580608,"y":0.4380726303321434},{"x":0.5761180510580608,"y":0.4317815726776129},{"x":0.5761180510580608,"y":0.4129083997140222},{"x":0.5761180510580608,"y":0.38774416909590104},{"x":0.58316426463379,"y":0.36257993847778},{"x":0.5937335849973837,"y":0.33741570785965946},{"x":0.5972566917852483,"y":0.3248335925505985},{"x":0.6078260121488419,"y":0.30596041958700787},{"x":0.6148722257245711,"y":0.29337830427794764},{"x":0.6219184393003003,"y":0.28708724662341717},{"x":0.6289646528760294,"y":0.28079618896888675},{"x":0.632487759663894,"y":0.261923016005296},{"x":0.6395339732396231,"y":0.25563195835076624},{"x":0.657149507178946,"y":0.23675878538717554},{"x":0.6606726139668105,"y":0.23046772773264507},{"x":0.6747650411182687,"y":0.2115945547690544},{"x":0.688857468269727,"y":0.19901243945999347},{"x":0.7029498954211852,"y":0.18643032415093325},{"x":0.713519215784779,"y":0.18013926649640277},{"x":0.7205654293605082,"y":0.173848208841873},{"x":0.7240885361483727,"y":0.1612660935328121},{"x":0.7311347497241019,"y":0.1612660935328121},{"x":0.738180963299831,"y":0.1612660935328121},{"x":0.7417040700876956,"y":0.1612660935328121},{"x":0.7452271768755602,"y":0.1612660935328121},{"x":0.7487502836634248,"y":0.1612660935328121},{"x":0.7522733904512893,"y":0.1612660935328121},{"x":0.7557964972391538,"y":0.1612660935328121},{"x":0.7593196040270185,"y":0.1612660935328121},{"x":0.762842710814883,"y":0.173848208841873},{"x":0.7663658176027476,"y":0.18013926649640277},{"x":0.7663658176027476,"y":0.1927213818054637},{"x":0.7698889243906122,"y":0.2115945547690544},{"x":0.7734120311784767,"y":0.2115945547690544},{"x":0.7769351379663412,"y":0.21788561242358415},{"x":0.7839813515420705,"y":0.23675878538717554},{"x":0.7910275651177996,"y":0.24934090069623577},{"x":0.7910275651177996,"y":0.25563195835076624},{"x":0.7980737786935287,"y":0.2745051313143569},{"x":0.8015968854813933,"y":0.28079618896888675},{"x":0.8015968854813933,"y":0.2996693619324774},{"x":0.8086430990571224,"y":0.30596041958700787},{"x":0.8086430990571224,"y":0.3122514772415383},{"x":0.8086430990571224,"y":0.33112465020512905},{"x":0.8086430990571224,"y":0.33741570785965946},{"x":0.812166205844987,"y":0.34370676551418927},{"x":0.8156893126328515,"y":0.35628888082325016},{"x":0.8156893126328515,"y":0.3688709961323104},{"x":0.8156893126328515,"y":0.37516205378684087},{"x":0.8156893126328515,"y":0.3814531114413706},{"x":0.8156893126328515,"y":0.38774416909590104},{"x":0.8192124194207161,"y":0.40032628440496204},{"x":0.8227355262085807,"y":0.40032628440496204},{"x":0.8227355262085807,"y":0.4066173420594918},{"x":0.8262586329964453,"y":0.4129083997140222},{"x":0.8262586329964453,"y":0.4191994573685527},{"x":0.8262586329964453,"y":0.4254905150230825},{"x":0.8262586329964453,"y":0.4317815726776129},{"x":0.8262586329964453,"y":0.4380726303321434},{"x":0.8262586329964453,"y":0.44436368798667314},{"x":0.8262586329964453,"y":0.45065474564120367},{"x":0.8262586329964453,"y":0.45694580329573403},{"x":0.8227355262085807,"y":0.4695279186047943},{"x":0.8227355262085807,"y":0.47581897625932473},{"x":0.8156893126328515,"y":0.488401091568385},{"x":0.8086430990571224,"y":0.4946921492229155},{"x":0.8015968854813933,"y":0.5135653221865062},{"x":0.7945506719056641,"y":0.5135653221865062},{"x":0.7839813515420705,"y":0.5198563798410366},{"x":0.7734120311784767,"y":0.5261474374955664},{"x":0.762842710814883,"y":0.5324384951500969},{"x":0.7557964972391538,"y":0.5387295528046273},{"x":0.7522733904512893,"y":0.5387295528046273},{"x":0.7417040700876956,"y":0.5513116681136875},{"x":0.7346578565119664,"y":0.5513116681136875},{"x":0.7276116429362374,"y":0.557602725768218},{"x":0.7240885361483727,"y":0.557602725768218},{"x":0.7170423225726436,"y":0.557602725768218},{"x":0.7099961089969145,"y":0.557602725768218},{"x":0.70647300220905,"y":0.557602725768218},{"x":0.6959036818454561,"y":0.557602725768218},{"x":0.6923805750575915,"y":0.557602725768218},{"x":0.6853343614818626,"y":0.557602725768218},{"x":0.6782881479061333,"y":0.557602725768218},{"x":0.6712419343304041,"y":0.557602725768218},{"x":0.6641957207546751,"y":0.557602725768218},{"x":0.6536264003910814,"y":0.557602725768218},{"x":0.6501032936032168,"y":0.5513116681136875},{"x":0.6501032936032168,"y":0.5450206104591572},{"x":0.6430570800274877,"y":0.5387295528046273},{"x":0.6395339732396231,"y":0.5324384951500969},{"x":0.6360108664517586,"y":0.5324384951500969},{"x":0.6360108664517586,"y":0.5261474374955664},{"x":0.632487759663894,"y":0.5198563798410366},{"x":0.6289646528760294,"y":0.5198563798410366},{"x":0.6254415460881648,"y":0.5198563798410366},{"x":0.6219184393003003,"y":0.5198563798410366},{"x":0.6183953325124357,"y":0.5198563798410366},{"x":0.6148722257245711,"y":0.5198563798410366},{"x":0.6113491189367066,"y":0.5198563798410366},{"x":0.6078260121488419,"y":0.5198563798410366},{"x":0.6007797985731129,"y":0.5198563798410366},{"x":0.5972566917852483,"y":0.5198563798410366},{"x":0.5972566917852483,"y":0.5135653221865062},{"x":0.5937335849973837,"y":0.5135653221865062},{"x":0.5902104782095192,"y":0.5135653221865062},{"x":0.5866873714216545,"y":0.5135653221865062},{"x":0.5796411578459255,"y":0.5135653221865062},{"x":0.5761180510580608,"y":0.5135653221865062},{"x":0.5690718374823318,"y":0.5135653221865062},{"x":0.5655487306944671,"y":0.5135653221865062},{"x":0.5620256239066026,"y":0.5135653221865062},{"x":0.5585025171187381,"y":0.5135653221865062},{"x":0.5549794103308734,"y":0.5135653221865062},{"x":0.5479331967551443,"y":0.5135653221865062},{"x":0.5444100899672797,"y":0.5135653221865062},{"x":0.5408869831794152,"y":0.5135653221865062},{"x":0.533840769603686,"y":0.5135653221865062},{"x":0.5303176628158215,"y":0.5198563798410366},{"x":0.5267945560279569,"y":0.5198563798410366},{"x":0.5232714492400923,"y":0.5261474374955664},{"x":0.5197483424522278,"y":0.5324384951500969},{"x":0.5127021288764987,"y":0.5324384951500969},{"x":0.5127021288764987,"y":0.5387295528046273},{"x":0.5056559153007696,"y":0.5387295528046273},{"x":0.502132808512905,"y":0.5387295528046273},{"x":0.4986097017250404,"y":0.5513116681136875},{"x":0.49508659493717583,"y":0.5513116681136875},{"x":0.4915634881493113,"y":0.557602725768218},{"x":0.4845172745735821,"y":0.5638937834227478},{"x":0.4845172745735821,"y":0.5701848410772782},{"x":0.4809941677857176,"y":0.5701848410772782},{"x":0.47747106099785297,"y":0.5701848410772782},{"x":0.4739479542099884,"y":0.5764758987318087},{"x":0.4739479542099884,"y":0.5827669563863392},{"x":0.47042484742212387,"y":0.589058014040869},{"x":0.46690174063425927,"y":0.589058014040869},{"x":0.4633786338463947,"y":0.5953490716953994},{"x":0.45985552705853017,"y":0.6016401293499298},{"x":0.45633242027066556,"y":0.6079311870044597},{"x":0.452809313482801,"y":0.6205133023135205},{"x":0.44928620669493646,"y":0.6330954176225808},{"x":0.44576309990707186,"y":0.6393864752771112},{"x":0.4387168863313427,"y":0.645677532931641},{"x":0.43519377954347815,"y":0.6645507058952324},{"x":0.428147565967749,"y":0.6708417635497622},{"x":0.42462445917988445,"y":0.683423878858823},{"x":0.41405513881629075,"y":0.7022970518224138},{"x":0.41053203202842614,"y":0.714879167131474},{"x":0.39996271166483244,"y":0.7337523400950647},{"x":0.38939339130123873,"y":0.7526255130586553},{"x":0.3858702845133742,"y":0.7589165707131859},{"x":0.38234717772550963,"y":0.7652076283677164},{"x":0.37882407093764503,"y":0.7777897436767764},{"x":0.36825475057405127,"y":0.7903718589858367},{"x":0.36473164378618683,"y":0.7966629166403673},{"x":0.3576854302104577,"y":0.8092450319494274},{"x":0.35416232342259313,"y":0.815536089603958},{"x":0.347116109846864,"y":0.8281182049130188},{"x":0.33654678948327027,"y":0.8469913778766095},{"x":0.3330236826954057,"y":0.8532824355311394},{"x":0.32597746911967657,"y":0.8595734931856698},{"x":0.322454362331812,"y":0.8784466661492604},{"x":0.3118850419682183,"y":0.8910287814583207},{"x":0.30483882839248916,"y":0.8973198391128512},{"x":0.29779261481676,"y":0.9099019544219121},{"x":0.29426950802889545,"y":0.9161930120764419},{"x":0.2907464012410309,"y":0.9161930120764419},{"x":0.2801770808774372,"y":0.9287751273855027},{"x":0.2766539740895726,"y":0.9287751273855027},{"x":0.273130867301708,"y":0.941357242694563},{"x":0.2696077605138435,"y":0.9476483003490933},{"x":0.2660846537259789,"y":0.9539393580036231},{"x":0.2625615469381143,"y":0.9539393580036231},{"x":0.2625615469381143,"y":0.9602304156581536},{"x":0.2590384401502498,"y":0.9602304156581536},{"x":0.2590384401502498,"y":0.9665214733126841},{"x":0.2555153333623852,"y":0.9728125309672139},{"x":0.25199222657452064,"y":0.9791035886217444},{"x":0.24846911978665606,"y":0.9853946462762748},{"x":0.24846911978665606,"y":0.9791035886217444},{"x":0.2555153333623852,"y":0.9665214733126841},{"x":0.2590384401502498,"y":0.9602304156581536},{"x":0.2625615469381143,"y":0.941357242694563},{"x":0.273130867301708,"y":0.9287751273855027},{"x":0.2801770808774372,"y":0.9161930120764419},{"x":0.2872232944531663,"y":0.8973198391128512},{"x":0.29779261481676,"y":0.87215560849473},{"x":0.3083619351803537,"y":0.8469913778766095},{"x":0.3295005759075411,"y":0.8281182049130188},{"x":0.3435930030589994,"y":0.8029539742948977},{"x":0.3506392166347286,"y":0.784080801331307},{"x":0.3576854302104577,"y":0.784080801331307},{"x":0.36473164378618683,"y":0.7714986860222461},{"x":0.3753009641497805,"y":0.7526255130586553},{"x":0.37882407093764503,"y":0.7463344554041256},{"x":0.38234717772550963,"y":0.7463344554041256},{"x":0.38939339130123873,"y":0.7337523400950647},{"x":0.3964396048769679,"y":0.714879167131474},{"x":0.39996271166483244,"y":0.7085881094769435},{"x":0.4070089252405616,"y":0.6960059941678833},{"x":0.4175782456041553,"y":0.683423878858823},{"x":0.42462445917988445,"y":0.6645507058952324},{"x":0.428147565967749,"y":0.6582596482407019},{"x":0.43519377954347815,"y":0.6519685905861715},{"x":0.4387168863313427,"y":0.6519685905861715},{"x":0.4422399931192073,"y":0.645677532931641},{"x":0.44576309990707186,"y":0.645677532931641},{"x":0.452809313482801,"y":0.6330954176225808},{"x":0.45633242027066556,"y":0.6330954176225808},{"x":0.45985552705853017,"y":0.6393864752771112},{"x":0.45985552705853017,"y":0.645677532931641},{"x":0.45985552705853017,"y":0.6519685905861715},{"x":0.4633786338463947,"y":0.6645507058952324},{"x":0.4633786338463947,"y":0.6708417635497622},{"x":0.4633786338463947,"y":0.6771328212042926},{"x":0.4633786338463947,"y":0.683423878858823},{"x":0.46690174063425927,"y":0.6897149365133528},{"x":0.46690174063425927,"y":0.7085881094769435},{"x":0.47042484742212387,"y":0.7211702247860045},{"x":0.47042484742212387,"y":0.7337523400950647},{"x":0.4739479542099884,"y":0.7463344554041256},{"x":0.47747106099785297,"y":0.7526255130586553},{"x":0.47747106099785297,"y":0.7589165707131859},{"x":0.4809941677857176,"y":0.7652076283677164},{"x":0.4845172745735821,"y":0.7777897436767764},{"x":0.4845172745735821,"y":0.784080801331307},{"x":0.4880403813614467,"y":0.7903718589858367},{"x":0.49508659493717583,"y":0.7966629166403673},{"x":0.49508659493717583,"y":0.8029539742948977},{"x":0.4986097017250404,"y":0.8029539742948977},{"x":0.502132808512905,"y":0.8092450319494274},{"x":0.5091790220886342,"y":0.8218271472584885},{"x":0.5127021288764987,"y":0.8281182049130188},{"x":0.5197483424522278,"y":0.8344092625675485},{"x":0.5232714492400923,"y":0.8407003202220791},{"x":0.5267945560279569,"y":0.8407003202220791},{"x":0.5373638763915506,"y":0.8469913778766095},{"x":0.5408869831794152,"y":0.8532824355311394},{"x":0.5444100899672797,"y":0.8532824355311394},{"x":0.5514563035430089,"y":0.8658645508402001},{"x":0.5549794103308734,"y":0.8658645508402001},{"x":0.5585025171187381,"y":0.8658645508402001},{"x":0.5620256239066026,"y":0.8658645508402001},{"x":0.5725949442701963,"y":0.87215560849473},{"x":0.5761180510580608,"y":0.8784466661492604},{"x":0.5796411578459255,"y":0.8784466661492604},{"x":0.5866873714216545,"y":0.8784466661492604},{"x":0.5972566917852483,"y":0.8847377238037909},{"x":0.6043029053609774,"y":0.8973198391128512},{"x":0.6078260121488419,"y":0.8973198391128512},{"x":0.6183953325124357,"y":0.8973198391128512},{"x":0.6254415460881648,"y":0.9036108967673817},{"x":0.632487759663894,"y":0.9036108967673817},{"x":0.6395339732396231,"y":0.9036108967673817},{"x":0.6430570800274877,"y":0.9099019544219121},{"x":0.6536264003910814,"y":0.9099019544219121},{"x":0.6712419343304041,"y":0.9099019544219121},{"x":0.6853343614818626,"y":0.9099019544219121},{"x":0.6994267886333208,"y":0.9099019544219121},{"x":0.7205654293605082,"y":0.9099019544219121},{"x":0.738180963299831,"y":0.9099019544219121},{"x":0.7522733904512893,"y":0.9099019544219121},{"x":0.7698889243906122,"y":0.9099019544219121},{"x":0.7804582447542059,"y":0.9099019544219121},{"x":0.7910275651177996,"y":0.9099019544219121},{"x":0.7945506719056641,"y":0.9099019544219121},{"x":0.7980737786935287,"y":0.9036108967673817},{"x":0.8051199922692579,"y":0.9036108967673817},{"x":0.812166205844987,"y":0.8973198391128512},{"x":0.8156893126328515,"y":0.8910287814583207},{"x":0.8192124194207161,"y":0.8847377238037909},{"x":0.8227355262085807,"y":0.8784466661492604},{"x":0.8262586329964453,"y":0.8784466661492604},{"x":0.8297817397843098,"y":0.8658645508402001},{"x":0.8297817397843098,"y":0.8595734931856698},{"x":0.8333048465721744,"y":0.8595734931856698},{"x":0.8333048465721744,"y":0.8469913778766095},{"x":0.8368279533600389,"y":0.8407003202220791},{"x":0.8368279533600389,"y":0.8281182049130188},{"x":0.8368279533600389,"y":0.8218271472584885},{"x":0.8403510601479035,"y":0.815536089603958},{"x":0.8473972737236327,"y":0.8092450319494274},{"x":0.8544434872993618,"y":0.784080801331307},{"x":0.8544434872993618,"y":0.7777897436767764},{"x":0.8544434872993618,"y":0.7714986860222461},{"x":0.8614897008750909,"y":0.7652076283677164},{"x":0.8614897008750909,"y":0.7526255130586553},{"x":0.8614897008750909,"y":0.7463344554041256},{"x":0.8650128076629555,"y":0.7463344554041256},{"x":0.8650128076629555,"y":0.740043397749595},{"x":0.8685359144508201,"y":0.740043397749595},{"x":0.8720590212386846,"y":0.7337523400950647}]')},function(t,e,i){var n;t.exports=((n=function(){function t(t){return r.appendChild(t.dom),t}function e(t){for(var e=0;e<r.children.length;e++)r.children[e].style.display=e===t?"block":"none";i=t}var i=0,r=document.createElement("div");r.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",r.addEventListener("click",(function(t){t.preventDefault(),e(++i%r.children.length)}),!1);var s=(performance||Date).now(),o=s,a=0,h=t(new n.Panel("FPS","#0ff","#002")),l=t(new n.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var u=t(new n.Panel("MB","#f08","#201"));return e(0),{REVISION:16,dom:r,addPanel:t,showPanel:e,begin:function(){s=(performance||Date).now()},end:function(){a++;var t=(performance||Date).now();if(l.update(t-s,200),t>o+1e3&&(h.update(1e3*a/(t-o),100),o=t,a=0,u)){var e=performance.memory;u.update(e.usedJSHeapSize/1048576,e.jsHeapSizeLimit/1048576)}return t},update:function(){s=this.end()},domElement:r,setMode:e}}).Panel=function(t,e,i){var n=1/0,r=0,s=Math.round,o=s(window.devicePixelRatio||1),a=80*o,h=48*o,l=3*o,u=2*o,c=3*o,d=15*o,p=74*o,f=30*o,m=document.createElement("canvas");m.width=a,m.height=h,m.style.cssText="width:80px;height:48px";var g=m.getContext("2d");return g.font="bold "+9*o+"px Helvetica,Arial,sans-serif",g.textBaseline="top",g.fillStyle=i,g.fillRect(0,0,a,h),g.fillStyle=e,g.fillText(t,l,u),g.fillRect(c,d,p,f),g.fillStyle=i,g.globalAlpha=.9,g.fillRect(c,d,p,f),{dom:m,update:function(h,v){n=Math.min(n,h),r=Math.max(r,h),g.fillStyle=i,g.globalAlpha=1,g.fillRect(0,0,a,d),g.fillStyle=e,g.fillText(s(h)+" "+t+" ("+s(n)+"-"+s(r)+")",l,u),g.drawImage(m,c+o,d,p-o,f,c,d,p-o,f),g.fillRect(c+p-o,d,o,f),g.fillStyle=i,g.globalAlpha=.9,g.fillRect(c+p-o,d,o,s((1-h/v)*f))}}},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<s;n++)o[n]=i[n].fn;return o},l.prototype.listenerCount=function(t){var e=r?r+t:t,i=this._events[e];return i?i.fn?1:i.length:0},l.prototype.emit=function(t,e,i,n,s,o){var a=r?r+t:t;if(!this._events[a])return!1;var h,l,u=this._events[a],c=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,i),!0;case 4:return u.fn.call(u.context,e,i,n),!0;case 5:return u.fn.call(u.context,e,i,n,s),!0;case 6:return u.fn.call(u.context,e,i,n,s,o),!0}for(l=1,h=new Array(c-1);l<c;l++)h[l-1]=arguments[l];u.fn.apply(u.context,h)}else{var d,p=u.length;for(l=0;l<p;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),c){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,i);break;case 4:u[l].fn.call(u[l].context,e,i,n);break;default:if(!h)for(d=1,h=new Array(c-1);d<c;d++)h[d-1]=arguments[d];u[l].fn.apply(u[l].context,h)}}return!0},l.prototype.on=function(t,e,i){return a(this,t,e,i,!1)},l.prototype.once=function(t,e,i){return a(this,t,e,i,!0)},l.prototype.removeListener=function(t,e,i,n){var s=r?r+t:t;if(!this._events[s])return this;if(!e)return h(this,s),this;var o=this._events[s];if(o.fn)o.fn!==e||n&&!o.once||i&&o.context!==i||h(this,s);else{for(var a=0,l=[],u=o.length;a<u;a++)(o[a].fn!==e||n&&!o[a].once||i&&o[a].context!==i)&&l.push(o[a]);l.length?this._events[s]=1===l.length?l[0]:l:h(this,s)}return this},l.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&h(this,e)):(this._events=new s,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,t.exports=l},function(t){t.exports=JSON.parse('{"GAME_NAME":"Draw Climber","PLAY":"PLAY","SEARCHING_OPPONENT":"Searching for \\n an opponent","CHECKPOINT":"Checkpoint!","WINNER":"Winner!","START":"START!","DRAW":"Draw!","ECWIN_TITLE":"LEVEL COMPLETED!","ECWIN_BTN":"TAP TO CONTINUE","ECFAIL_TITLE":"FAILED!","ECFAIL_BTN":"RETRY","SKIP_LEVEL":"SKIP LEVEL","FB_CURRENT_SCORE":"Current Score","FB_BEST_SCORE":"Best Score","FB_INVITE":"Invite Friends","FB_SHARE":"Share With Friends","CLAIM":"CLAIM","COLLECTED":"collected","SHARE_WITH_FRIENDS":"My best score is %s! Can you beat it?","INVITE_FRIENDS":"My best score is %s! Try to beat me!","EXIT_MSG":"Reset Level?","EXIT_MSG_2":"You will lose your progression \\n on the current level.","EXIT_MSG_YES":"Yes","EXIT_MSG_NO":"No","YOU":"You","LVL":"LVL","LEVEL":"LEVEL","FEEDBACK_1":"perfect","FEEDBACK_2":"terrific","FEEDBACK_3":"wonderful","FEEDBACK_4":"great","FEEDBACK_5":"awesome","FEEDBACK_6":"marvelous","FEEDBACK_7":"gorgeous","UPGRADE_SPEED":"SPEED","UPGRADE_FREE":"FREE"}')},function(t){t.exports=JSON.parse('{"resources":["output.ogg","output.m4a","output.mp3","output.ac3"],"spritemap":{"Break_Leg":{"start":0,"end":0.3742403628117914,"loop":false},"Button":{"start":2,"end":2.109297052154195,"loop":false},"Checkpoint":{"start":4,"end":4.5121995464852604,"loop":false},"Coin":{"start":6,"end":6.162721088435374,"loop":false},"Crowd_Clap":{"start":8,"end":15.280181405895693,"loop":false},"Crowd_Fly":{"start":17,"end":21.390839002267573,"loop":false},"Drawing":{"start":23,"end":23.15437641723356,"loop":false},"Fail":{"start":25,"end":26.125396825396827,"loop":false},"Footstep":{"start":28,"end":28.35328798185941,"loop":false},"Jump":{"start":30,"end":30.160272108843536,"loop":false},"Race_End":{"start":32,"end":32.51959183673469,"loop":false},"Race_Start":{"start":34,"end":34.486666666666665,"loop":false}}}')},function(t,e,i){},function(t,e,i){var n,r;function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var o=i(0),a={distributions:{BOX:1,SPHERE:2,DISC:3,LINE:4},valueOverLifetimeLength:4};void 0===(r="function"==typeof(n=a)?n.call(e,i,e,t):n)||(t.exports=r),a.TypedArrayHelper=function(t,e,i,n){"use strict";this.componentSize=i||1,this.size=e||1,this.TypedArrayConstructor=t||Float32Array,this.array=new t(e*this.componentSize),this.indexOffset=n||0},a.TypedArrayHelper.constructor=a.TypedArrayHelper,a.TypedArrayHelper.prototype.setSize=function(t,e){"use strict";var i=this.array.length;return e||(t*=this.componentSize),t<i?this.shrink(t):t>i?this.grow(t):void 0},a.TypedArrayHelper.prototype.shrink=function(t){"use strict";return this.array=this.array.subarray(0,t),this.size=t,this},a.TypedArrayHelper.prototype.grow=function(t){"use strict";var e=this.array,i=new this.TypedArrayConstructor(t);return i.set(e),this.array=i,this.size=t,this},a.TypedArrayHelper.prototype.splice=function(t,e){"use strict";t*=this.componentSize,e*=this.componentSize;for(var i=[],n=this.array,r=n.length,s=0;s<r;++s)(s<t||s>=e)&&i.push(n[s]);return this.setFromArray(0,i),this},a.TypedArrayHelper.prototype.setFromArray=function(t,e){"use strict";var i=t+e.length;return i>this.array.length?this.grow(i):i<this.array.length&&this.shrink(i),this.array.set(e,this.indexOffset+t),this},a.TypedArrayHelper.prototype.setVec2=function(t,e){"use strict";return this.setVec2Components(t,e.x,e.y)},a.TypedArrayHelper.prototype.setVec2Components=function(t,e,i){"use strict";var n=this.array,r=this.indexOffset+t*this.componentSize;return n[r]=e,n[r+1]=i,this},a.TypedArrayHelper.prototype.setVec3=function(t,e){"use strict";return this.setVec3Components(t,e.x,e.y,e.z)},a.TypedArrayHelper.prototype.setVec3Components=function(t,e,i,n){"use strict";var r=this.array,s=this.indexOffset+t*this.componentSize;return r[s]=e,r[s+1]=i,r[s+2]=n,this},a.TypedArrayHelper.prototype.setVec4=function(t,e){"use strict";return this.setVec4Components(t,e.x,e.y,e.z,e.w)},a.TypedArrayHelper.prototype.setVec4Components=function(t,e,i,n,r){"use strict";var s=this.array,o=this.indexOffset+t*this.componentSize;return s[o]=e,s[o+1]=i,s[o+2]=n,s[o+3]=r,this},a.TypedArrayHelper.prototype.setMat3=function(t,e){"use strict";return this.setFromArray(this.indexOffset+t*this.componentSize,e.elements)},a.TypedArrayHelper.prototype.setMat4=function(t,e){"use strict";return this.setFromArray(this.indexOffset+t*this.componentSize,e.elements)},a.TypedArrayHelper.prototype.setColor=function(t,e){"use strict";return this.setVec3Components(t,e.r,e.g,e.b)},a.TypedArrayHelper.prototype.setNumber=function(t,e){"use strict";return this.array[this.indexOffset+t*this.componentSize]=e,this},a.TypedArrayHelper.prototype.getValueAtIndex=function(t){"use strict";return this.array[this.indexOffset+t]},a.TypedArrayHelper.prototype.getComponentValueAtIndex=function(t){"use strict";return this.array.subarray(this.indexOffset+t*this.componentSize)},a.ShaderAttribute=function(t,e,i){"use strict";var n=a.ShaderAttribute.typeSizeMap;this.type="string"==typeof t&&n.hasOwnProperty(t)?t:"f",this.componentSize=n[this.type],this.arrayType=i||Float32Array,this.typedArray=null,this.bufferAttribute=null,this.dynamicBuffer=!!e,this.updateMin=0,this.updateMax=0},a.ShaderAttribute.constructor=a.ShaderAttribute,a.ShaderAttribute.typeSizeMap={f:1,v2:2,v3:3,v4:4,c:3,m3:9,m4:16},a.ShaderAttribute.prototype.setUpdateRange=function(t,e){"use strict";this.updateMin=Math.min(t*this.componentSize,this.updateMin*this.componentSize),this.updateMax=Math.max(e*this.componentSize,this.updateMax*this.componentSize)},a.ShaderAttribute.prototype.flagUpdate=function(){"use strict";var t=this.bufferAttribute,e=t.updateRange;e.offset=this.updateMin,e.count=Math.min(this.updateMax-this.updateMin+this.componentSize,this.typedArray.array.length),t.needsUpdate=!0},a.ShaderAttribute.prototype.resetUpdateRange=function(){"use strict";this.updateMin=0,this.updateMax=0},a.ShaderAttribute.prototype.resetDynamic=function(){"use strict";this.bufferAttribute.usage=this.dynamicBuffer?o.DynamicDrawUsage:o.StaticDrawUsage},a.ShaderAttribute.prototype.splice=function(t,e){"use strict";this.typedArray.splice(t,e),this.forceUpdateAll()},a.ShaderAttribute.prototype.forceUpdateAll=function(){"use strict";this.bufferAttribute.array=this.typedArray.array,this.bufferAttribute.updateRange.offset=0,this.bufferAttribute.updateRange.count=-1,this.bufferAttribute.usage=o.StaticDrawUsage,this.bufferAttribute.needsUpdate=!0},a.ShaderAttribute.prototype._ensureTypedArray=function(t){"use strict";null!==this.typedArray&&this.typedArray.size===t*this.componentSize||(null!==this.typedArray&&this.typedArray.size!==t?this.typedArray.setSize(t):null===this.typedArray&&(this.typedArray=new a.TypedArrayHelper(this.arrayType,t,this.componentSize)))},a.ShaderAttribute.prototype._createBufferAttribute=function(t){"use strict";if(this._ensureTypedArray(t),null!==this.bufferAttribute)return this.bufferAttribute.array=this.typedArray.array,parseFloat(o.REVISION)>=81&&(this.bufferAttribute.count=this.bufferAttribute.array.length/this.bufferAttribute.itemSize),void(this.bufferAttribute.needsUpdate=!0);this.bufferAttribute=new o.BufferAttribute(this.typedArray.array,this.componentSize),this.bufferAttribute.usage=this.dynamicBuffer?o.DynamicDrawUsage:o.StaticDrawUsage},a.ShaderAttribute.prototype.getLength=function(){"use strict";return null===this.typedArray?0:this.typedArray.array.length},a.shaderChunks={defines:["#define PACKED_COLOR_SIZE 256.0","#define PACKED_COLOR_DIVISOR 255.0"].join("\n"),uniforms:["uniform float deltaTime;","uniform float runTime;","uniform sampler2D tex;","uniform vec4 textureAnimation;","uniform float scale;","uniform float aspectRat;"].join("\n"),attributes:["attribute vec4 acceleration;","attribute vec3 velocity;","attribute vec4 rotation;","attribute vec3 rotationCenter;","attribute vec4 params;","attribute vec4 size;","attribute vec4 angle;","attribute vec4 color;","attribute vec4 opacity;"].join("\n"),varyings:["varying vec4 vColor;","#ifdef SHOULD_ROTATE_TEXTURE"," varying float vAngle;","#endif","#ifdef SHOULD_CALCULATE_SPRITE"," varying vec4 vSpriteSheet;","#endif"].join("\n"),branchAvoidanceFunctions:["float when_gt(float x, float y) {"," return max(sign(x - y), 0.0);","}","float when_lt(float x, float y) {"," return min( max(1.0 - sign(x - y), 0.0), 1.0 );","}","float when_eq( float x, float y ) {"," return 1.0 - abs( sign( x - y ) );","}","float when_ge(float x, float y) {"," return 1.0 - when_lt(x, y);","}","float when_le(float x, float y) {"," return 1.0 - when_gt(x, y);","}","float and(float a, float b) {"," return a * b;","}","float or(float a, float b) {"," return min(a + b, 1.0);","}"].join("\n"),unpackColor:["vec3 unpackColor( in float hex ) {"," vec3 c = vec3( 0.0 );"," float r = mod( (hex / PACKED_COLOR_SIZE / PACKED_COLOR_SIZE), PACKED_COLOR_SIZE );"," float g = mod( (hex / PACKED_COLOR_SIZE), PACKED_COLOR_SIZE );"," float b = mod( hex, PACKED_COLOR_SIZE );"," c.r = r / PACKED_COLOR_DIVISOR;"," c.g = g / PACKED_COLOR_DIVISOR;"," c.b = b / PACKED_COLOR_DIVISOR;"," return c;","}"].join("\n"),unpackRotationAxis:["vec3 unpackRotationAxis( in float hex ) {"," vec3 c = vec3( 0.0 );"," float r = mod( (hex / PACKED_COLOR_SIZE / PACKED_COLOR_SIZE), PACKED_COLOR_SIZE );"," float g = mod( (hex / PACKED_COLOR_SIZE), PACKED_COLOR_SIZE );"," float b = mod( hex, PACKED_COLOR_SIZE );"," c.r = r / PACKED_COLOR_DIVISOR;"," c.g = g / PACKED_COLOR_DIVISOR;"," c.b = b / PACKED_COLOR_DIVISOR;"," c *= vec3( 2.0 );"," c -= vec3( 1.0 );"," return c;","}"].join("\n"),floatOverLifetime:["float getFloatOverLifetime( in float positionInTime, in vec4 attr ) {"," float value = 0.0;"," float deltaAge = positionInTime * float( VALUE_OVER_LIFETIME_LENGTH - 1 );"," float fIndex = 0.0;"," float shouldApplyValue = 0.0;"," value += attr[ 0 ] * when_eq( deltaAge, 0.0 );",""," for( int i = 0; i < VALUE_OVER_LIFETIME_LENGTH; ++i ) {"," fIndex = float( i );"," shouldApplyValue = when_gt( deltaAge, fIndex ) * when_le( deltaAge, fIndex + 1.0 );"," value += shouldApplyValue * mix( attr[ i ], attr[ i + 1 ], deltaAge - fIndex );"," }",""," return value;","}"].join("\n"),colorOverLifetime:["vec3 getColorOverLifetime( in float positionInTime, in vec3 color1, in vec3 color2, in vec3 color3, in vec3 color4 ) {"," vec3 value = vec3( 0.0 );"," value.x = getFloatOverLifetime( positionInTime, vec4( color1.x, color2.x, color3.x, color4.x ) );"," value.y = getFloatOverLifetime( positionInTime, vec4( color1.y, color2.y, color3.y, color4.y ) );"," value.z = getFloatOverLifetime( positionInTime, vec4( color1.z, color2.z, color3.z, color4.z ) );"," return value;","}"].join("\n"),paramFetchingFunctions:["float getAlive() {"," return params.x;","}","float getAge() {"," return params.y;","}","float getMaxAge() {"," return params.z;","}","float getWiggle() {"," return params.w;","}"].join("\n"),forceFetchingFunctions:["vec4 getPosition( in float age ) {"," return modelViewMatrix * vec4( position, 1.0 );","}","vec3 getVelocity( in float age ) {"," return velocity * age;","}","vec3 getAcceleration( in float age ) {"," return acceleration.xyz * age;","}"].join("\n"),rotationFunctions:["#ifdef SHOULD_ROTATE_PARTICLES"," mat4 getRotationMatrix( in vec3 axis, in float angle) {"," axis = normalize(axis);"," float s = sin(angle);"," float c = cos(angle);"," float oc = 1.0 - c;",""," return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0,"," oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0,"," oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0,"," 0.0, 0.0, 0.0, 1.0);"," }",""," vec3 getRotation( in vec3 pos, in float positionInTime ) {"," if( rotation.y == 0.0 ) {"," return pos;"," }",""," vec3 axis = unpackRotationAxis( rotation.x );"," vec3 center = rotationCenter;"," vec3 translated;"," mat4 rotationMatrix;"," float angle = 0.0;"," angle += when_eq( rotation.z, 0.0 ) * rotation.y;"," angle += when_gt( rotation.z, 0.0 ) * mix( 0.0, rotation.y, positionInTime );"," translated = rotationCenter - pos;"," rotationMatrix = getRotationMatrix( axis, angle );"," return center - vec3( rotationMatrix * vec4( translated, 0.0 ) );"," }","#endif"].join("\n"),rotateTexture:[" vec2 vUv = vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y );",""," #ifdef SHOULD_ROTATE_TEXTURE"," float x = gl_PointCoord.x - 0.5;"," float y = 1.0 - gl_PointCoord.y - 0.5;"," float c = cos( -vAngle );"," float s = sin( -vAngle );"," vUv = vec2( c * x + s * y + 0.5, c * y - s * x + 0.5 );"," #endif",""," #ifdef SHOULD_CALCULATE_SPRITE"," float framesX = vSpriteSheet.x;"," float framesY = vSpriteSheet.y;"," float columnNorm = vSpriteSheet.z;"," float rowNorm = vSpriteSheet.w;"," vUv.x = gl_PointCoord.x * framesX + columnNorm;"," vUv.y = 1.0 - (gl_PointCoord.y * framesY + rowNorm);"," #endif",""," vec4 rotatedTexture = texture2D( tex, vUv );"].join("\n")},a.shaders={vertex:[a.shaderChunks.defines,a.shaderChunks.uniforms,a.shaderChunks.attributes,a.shaderChunks.varyings,o.ShaderChunk.common,o.ShaderChunk.logdepthbuf_pars_vertex,o.ShaderChunk.fog_pars_vertex,a.shaderChunks.branchAvoidanceFunctions,a.shaderChunks.unpackColor,a.shaderChunks.unpackRotationAxis,a.shaderChunks.floatOverLifetime,a.shaderChunks.colorOverLifetime,a.shaderChunks.paramFetchingFunctions,a.shaderChunks.forceFetchingFunctions,a.shaderChunks.rotationFunctions,"void main() {"," float age = getAge();"," float alive = getAlive();"," float maxAge = getMaxAge();"," float positionInTime = (age / maxAge);"," float isAlive = when_gt( alive, 0.0 );"," #ifdef SHOULD_WIGGLE_PARTICLES"," float wiggleAmount = positionInTime * getWiggle();"," float wiggleSin = isAlive * sin( wiggleAmount );"," float wiggleCos = isAlive * cos( wiggleAmount );"," #endif"," vec3 vel = getVelocity( age );"," vec3 accel = getAcceleration( age );"," vec3 force = vec3( 0.0 );"," vec3 pos = vec3( position );"," float drag = 1.0 - (positionInTime * 0.5) * acceleration.w;"," force += vel;"," force *= drag;"," force += accel * age;"," pos += force;"," #ifdef SHOULD_WIGGLE_PARTICLES"," pos.x += wiggleSin;"," pos.y += wiggleCos;"," pos.z += wiggleSin;"," #endif"," #ifdef SHOULD_ROTATE_PARTICLES"," pos = getRotation( pos, positionInTime );"," #endif"," vec4 mvPosition = modelViewMatrix * vec4( pos, 1.0 );"," float pointSize = getFloatOverLifetime( positionInTime, size ) * isAlive;"," #ifdef HAS_PERSPECTIVE"," float aspek = aspectRat;"," float perspective = scale / length( mvPosition.xyz ) * (aspek);"," #else"," float perspective = 1.0;"," #endif"," float pointSizePerspective = pointSize * perspective;"," #ifdef COLORIZE"," vec3 c = isAlive * getColorOverLifetime("," positionInTime,"," unpackColor( color.x ),"," unpackColor( color.y ),"," unpackColor( color.z ),"," unpackColor( color.w )"," );"," #else"," vec3 c = vec3(1.0);"," #endif"," float o = isAlive * getFloatOverLifetime( positionInTime, opacity );"," vColor = vec4( c, o );"," #ifdef SHOULD_ROTATE_TEXTURE"," vAngle = isAlive * getFloatOverLifetime( positionInTime, angle );"," #endif"," #ifdef SHOULD_CALCULATE_SPRITE"," float framesX = textureAnimation.x;"," float framesY = textureAnimation.y;"," float loopCount = textureAnimation.w;"," float totalFrames = textureAnimation.z;"," float frameNumber = mod( (positionInTime * loopCount) * totalFrames, totalFrames );"," float column = floor(mod( frameNumber, framesX ));"," float row = floor( (frameNumber - column) / framesX );"," float columnNorm = column / framesX;"," float rowNorm = row / framesY;"," vSpriteSheet.x = 1.0 / framesX;"," vSpriteSheet.y = 1.0 / framesY;"," vSpriteSheet.z = columnNorm;"," vSpriteSheet.w = rowNorm;"," #endif"," gl_PointSize = pointSizePerspective;"," gl_Position = projectionMatrix * mvPosition;",o.ShaderChunk.logdepthbuf_vertex,o.ShaderChunk.fog_vertex,"}"].join("\n"),fragment:[a.shaderChunks.uniforms,o.ShaderChunk.common,o.ShaderChunk.fog_pars_fragment,o.ShaderChunk.logdepthbuf_pars_fragment,a.shaderChunks.varyings,a.shaderChunks.branchAvoidanceFunctions,"void main() {"," vec3 outgoingLight = vColor.xyz;"," "," #ifdef ALPHATEST"," if ( vColor.w < float(ALPHATEST) ) discard;"," #endif",a.shaderChunks.rotateTexture,o.ShaderChunk.logdepthbuf_fragment," outgoingLight = vColor.xyz * rotatedTexture.xyz;"," gl_FragColor = vec4( outgoingLight.xyz, rotatedTexture.w * vColor.w );",o.ShaderChunk.fog_fragment,"}"].join("\n")},a.utils={types:{BOOLEAN:"boolean",STRING:"string",NUMBER:"number",OBJECT:"object"},ensureTypedArg:function(t,e,i){"use strict";return s(t)===e?t:i},ensureArrayTypedArg:function(t,e,i){"use strict";if(Array.isArray(t)){for(var n=t.length-1;n>=0;--n)if(s(t[n])!==e)return i;return t}return this.ensureTypedArg(t,e,i)},ensureInstanceOf:function(t,e,i){"use strict";return void 0!==e&&t instanceof e?t:i},ensureArrayInstanceOf:function(t,e,i){"use strict";if(Array.isArray(t)){for(var n=t.length-1;n>=0;--n)if(void 0!==e&&t[n]instanceof e==!1)return i;return t}return this.ensureInstanceOf(t,e,i)},ensureValueOverLifetimeCompliance:function(t,e,i){"use strict";e=e||3,i=i||3,!1===Array.isArray(t._value)&&(t._value=[t._value]),!1===Array.isArray(t._spread)&&(t._spread=[t._spread]);var n=this.clamp(t._value.length,e,i),r=this.clamp(t._spread.length,e,i),s=Math.max(n,r);t._value.length!==s&&(t._value=this.interpolateArray(t._value,s)),t._spread.length!==s&&(t._spread=this.interpolateArray(t._spread,s))},interpolateArray:function(t,e){"use strict";for(var i=t.length,n=["function"==typeof t[0].clone?t[0].clone():t[0]],r=(i-1)/(e-1),s=1;s<e-1;++s){var o=s*r,a=Math.floor(o),h=Math.ceil(o),l=o-a;n[s]=this.lerpTypeAgnostic(t[a],t[h],l)}return n.push("function"==typeof t[i-1].clone?t[i-1].clone():t[i-1]),n},clamp:function(t,e,i){"use strict";return Math.max(e,Math.min(t,i))},zeroToEpsilon:function(t,e){"use strict";var i=t;return i=e?1e-5*Math.random()*10:1e-5,t<0&&t>-1e-5&&(i=-i),i},lerpTypeAgnostic:function(t,e,i){"use strict";var n,r=this.types;return s(t)===r.NUMBER&&s(e)===r.NUMBER?t+(e-t)*i:t instanceof o.Vector2&&e instanceof o.Vector2?((n=t.clone()).x=this.lerp(t.x,e.x,i),n.y=this.lerp(t.y,e.y,i),n):t instanceof o.Vector3&&e instanceof o.Vector3?((n=t.clone()).x=this.lerp(t.x,e.x,i),n.y=this.lerp(t.y,e.y,i),n.z=this.lerp(t.z,e.z,i),n):t instanceof o.Vector4&&e instanceof o.Vector4?((n=t.clone()).x=this.lerp(t.x,e.x,i),n.y=this.lerp(t.y,e.y,i),n.z=this.lerp(t.z,e.z,i),n.w=this.lerp(t.w,e.w,i),n):t instanceof o.Color&&e instanceof o.Color?((n=t.clone()).r=this.lerp(t.r,e.r,i),n.g=this.lerp(t.g,e.g,i),n.b=this.lerp(t.b,e.b,i),n):void 0},lerp:function(t,e,i){"use strict";return t+(e-t)*i},roundToNearestMultiple:function(t,e){"use strict";var i;return 0===e||0===(i=Math.abs(t)%e)?t:t<0?-(Math.abs(t)-i):t+e-i},arrayValuesAreEqual:function(t){"use strict";for(var e=0;e<t.length-1;++e)if(t[e]!==t[e+1])return!1;return!0},randomFloat:function(t,e){"use strict";return t+e*(Math.random()-.5)},randomVector3:function(t,e,i,n,r){"use strict";var s=i.x+(Math.random()*n.x-.5*n.x),o=i.y+(Math.random()*n.y-.5*n.y),a=i.z+(Math.random()*n.z-.5*n.z);r&&(s=.5*-r.x+this.roundToNearestMultiple(s,r.x),o=.5*-r.y+this.roundToNearestMultiple(o,r.y),a=.5*-r.z+this.roundToNearestMultiple(a,r.z)),t.typedArray.setVec3Components(e,s,o,a)},randomColor:function(t,e,i,n){"use strict";var r=i.r+Math.random()*n.x,s=i.g+Math.random()*n.y,o=i.b+Math.random()*n.z;r=this.clamp(r,0,1),s=this.clamp(s,0,1),o=this.clamp(o,0,1),t.typedArray.setVec3Components(e,r,s,o)},randomColorAsHex:function(){"use strict";var t=new o.Color;return function(e,i,n,r){for(var s=n.length,o=[],a=0;a<s;++a){var h=r[a];t.copy(n[a]),t.r+=Math.random()*h.x-.5*h.x,t.g+=Math.random()*h.y-.5*h.y,t.b+=Math.random()*h.z-.5*h.z,t.r=this.clamp(t.r,0,1),t.g=this.clamp(t.g,0,1),t.b=this.clamp(t.b,0,1),o.push(t.getHex())}e.typedArray.setVec4Components(i,o[0],o[1],o[2],o[3])}}(),randomVector3OnLine:function(t,e,i,n){"use strict";var r=i.clone();r.lerp(n,Math.random()),t.typedArray.setVec3Components(e,r.x,r.y,r.z)},randomVector3OnSphere:function(t,e,i,n,r,s,o,a){"use strict";var h=2*Math.random()-1,l=6.2832*Math.random(),u=Math.sqrt(1-h*h),c=this.randomFloat(n,r),d=0,p=0,f=0;o&&(c=Math.round(c/o)*o),d=u*Math.cos(l)*c,p=u*Math.sin(l)*c,f=h*c,d*=s.x,p*=s.y,f*=s.z,d+=i.x,p+=i.y,f+=i.z,t.typedArray.setVec3Components(e,d,p,f)},seededRandom:function(t){var e=1e4*Math.sin(t);return e-(0|e)},randomVector3OnDisc:function(t,e,i,n,r,s,o){"use strict";var a=6.2832*Math.random(),h=Math.abs(this.randomFloat(n,r)),l=0,u=0,c=0;o&&(h=Math.round(h/o)*o),l=Math.cos(a)*h,u=Math.sin(a)*h,l*=s.x,u*=s.y,l+=i.x,u+=i.y,c+=i.z,t.typedArray.setVec3Components(e,l,u,c)},randomDirectionVector3OnSphere:function(){"use strict";var t=new o.Vector3;return function(e,i,n,r,s,o,a,h){t.copy(o),t.x-=n,t.y-=r,t.z-=s,t.normalize().multiplyScalar(-this.randomFloat(a,h)),e.typedArray.setVec3Components(i,t.x,t.y,t.z)}}(),randomDirectionVector3OnDisc:function(){"use strict";var t=new o.Vector3;return function(e,i,n,r,s,o,a,h){t.copy(o),t.x-=n,t.y-=r,t.z-=s,t.normalize().multiplyScalar(-this.randomFloat(a,h)),e.typedArray.setVec3Components(i,t.x,t.y,0)}}(),getPackedRotationAxis:function(){"use strict";var t=new o.Vector3,e=new o.Vector3,i=new o.Color,n=new o.Vector3(1,1,1);return function(r,s){return t.copy(r).normalize(),e.copy(s).normalize(),t.x+=.5*-s.x+Math.random()*s.x,t.y+=.5*-s.y+Math.random()*s.y,t.z+=.5*-s.z+Math.random()*s.z,t.normalize().add(n).multiplyScalar(.5),i.setRGB(t.x,t.y,t.z),i.getHex()}}()},a.Group=function(t){"use strict";var e=a.utils,i=e.types;(t=e.ensureTypedArg(t,i.OBJECT,{})).texture=e.ensureTypedArg(t.texture,i.OBJECT,{}),this.uuid=o.Math.generateUUID(),this.fixedTimeStep=e.ensureTypedArg(t.fixedTimeStep,i.NUMBER,.016),this.texture=e.ensureInstanceOf(t.texture.value,o.Texture,null),this.textureFrames=e.ensureInstanceOf(t.texture.frames,o.Vector2,new o.Vector2(1,1)),this.textureFrameCount=e.ensureTypedArg(t.texture.frameCount,i.NUMBER,this.textureFrames.x*this.textureFrames.y),this.textureLoop=e.ensureTypedArg(t.texture.loop,i.NUMBER,1),this.textureFrames.max(new o.Vector2(1,1)),this.hasPerspective=e.ensureTypedArg(t.hasPerspective,i.BOOLEAN,!0),this.colorize=e.ensureTypedArg(t.colorize,i.BOOLEAN,!0),this.maxParticleCount=e.ensureTypedArg(t.maxParticleCount,i.NUMBER,null),this.blending=e.ensureTypedArg(t.blending,i.NUMBER,o.AdditiveBlending),this.transparent=e.ensureTypedArg(t.transparent,i.BOOLEAN,!0),this.alphaTest=parseFloat(e.ensureTypedArg(t.alphaTest,i.NUMBER,0)),this.depthWrite=e.ensureTypedArg(t.depthWrite,i.BOOLEAN,!1),this.depthTest=e.ensureTypedArg(t.depthTest,i.BOOLEAN,!0),this.fog=e.ensureTypedArg(t.fog,i.BOOLEAN,!0),this.scale=e.ensureTypedArg(t.scale,i.NUMBER,300),this.emitters=[],this.emitterIDs=[],this._pool=[],this._poolCreationSettings=null,this._createNewWhenPoolEmpty=0,this._attributesNeedRefresh=!1,this._attributesNeedDynamicReset=!1,this.particleCount=0,this.uniforms={tex:{type:"t",value:this.texture},textureAnimation:{type:"v4",value:new o.Vector4(this.textureFrames.x,this.textureFrames.y,this.textureFrameCount,Math.max(Math.abs(this.textureLoop),1))},fogColor:{type:"c",value:this.fog?new o.Color:null},fogNear:{type:"f",value:10},fogFar:{type:"f",value:200},fogDensity:{type:"f",value:.5},deltaTime:{type:"f",value:0},runTime:{type:"f",value:0},scale:{type:"f",value:this.scale},aspectRat:{type:"f",value:1}},this.defines={HAS_PERSPECTIVE:this.hasPerspective,COLORIZE:this.colorize,VALUE_OVER_LIFETIME_LENGTH:a.valueOverLifetimeLength,SHOULD_ROTATE_TEXTURE:!1,SHOULD_ROTATE_PARTICLES:!1,SHOULD_WIGGLE_PARTICLES:!1,SHOULD_CALCULATE_SPRITE:this.textureFrames.x>1||this.textureFrames.y>1},this.attributes={position:new a.ShaderAttribute("v3",!0),acceleration:new a.ShaderAttribute("v4",!0),velocity:new a.ShaderAttribute("v3",!0),rotation:new a.ShaderAttribute("v4",!0),rotationCenter:new a.ShaderAttribute("v3",!0),params:new a.ShaderAttribute("v4",!0),size:new a.ShaderAttribute("v4",!0),angle:new a.ShaderAttribute("v4",!0),color:new a.ShaderAttribute("v4",!0),opacity:new a.ShaderAttribute("v4",!0)},this.attributeKeys=Object.keys(this.attributes),this.attributeCount=this.attributeKeys.length,this.material=new o.ShaderMaterial({uniforms:this.uniforms,vertexShader:a.shaders.vertex,fragmentShader:a.shaders.fragment,blending:this.blending,transparent:this.transparent,alphaTest:this.alphaTest,depthWrite:this.depthWrite,depthTest:this.depthTest,defines:this.defines,fog:this.fog}),this.geometry=new o.BufferGeometry,this.mesh=new o.Points(this.geometry,this.material),this.maxParticleCount},a.Group.constructor=a.Group,a.Group.prototype._updateDefines=function(){"use strict";for(var t,e=this.emitters,i=e.length-1,n=this.defines;i>=0;--i)t=e[i],n.SHOULD_CALCULATE_SPRITE||(n.SHOULD_ROTATE_TEXTURE=n.SHOULD_ROTATE_TEXTURE||!!Math.max(Math.max.apply(null,t.angle.value),Math.max.apply(null,t.angle.spread))),n.SHOULD_ROTATE_PARTICLES=n.SHOULD_ROTATE_PARTICLES||!!Math.max(t.rotation.angle,t.rotation.angleSpread),n.SHOULD_WIGGLE_PARTICLES=n.SHOULD_WIGGLE_PARTICLES||!!Math.max(t.wiggle.value,t.wiggle.spread);this.material.needsUpdate=!0},a.Group.prototype._applyAttributesToGeometry=function(){"use strict";var t,e,i=this.attributes,n=this.geometry,r=n.attributes;for(var s in i)i.hasOwnProperty(s)&&(t=i[s],(e=r[s])?e.array=t.typedArray.array:n.setAttribute(s,t.bufferAttribute),t.bufferAttribute.needsUpdate=!0);this.geometry.setDrawRange(0,this.particleCount)},a.Group.prototype.addEmitter=function(t){"use strict";if(t instanceof a.Emitter!=!1&&!(this.emitterIDs.indexOf(t.uuid)>-1)&&null===t.group){var e=this.attributes,i=this.particleCount,n=i+t.particleCount;for(var r in this.particleCount=n,null!==this.maxParticleCount&&(this.particleCount,this.maxParticleCount),t._calculatePPSValue(t.maxAge._value+t.maxAge._spread),t._setBufferUpdateRanges(this.attributeKeys),t._setAttributeOffset(i),t.group=this,t.attributes=this.attributes,e)e.hasOwnProperty(r)&&e[r]._createBufferAttribute(null!==this.maxParticleCount?this.maxParticleCount:this.particleCount);for(var s=i;s<n;++s)t._assignPositionValue(s),t._assignForceValue(s,"velocity"),t._assignForceValue(s,"acceleration"),t._assignAbsLifetimeValue(s,"opacity"),t._assignAbsLifetimeValue(s,"size"),t._assignAngleValue(s),t._assignRotationValue(s),t._assignParamsValue(s),t._assignColorValue(s);return this._applyAttributesToGeometry(),this.emitters.push(t),this.emitterIDs.push(t.uuid),this._updateDefines(t),this.material.needsUpdate=!0,this.geometry.needsUpdate=!0,this._attributesNeedRefresh=!0,this}},a.Group.prototype.removeEmitter=function(t){"use strict";var e=this.emitterIDs.indexOf(t.uuid);if(t instanceof a.Emitter!=!1&&-1!==e){for(var i=t.attributeOffset,n=i+t.particleCount,r=this.attributes.params.typedArray,s=i;s<n;++s)r.array[4*s]=0,r.array[4*s+1]=0;for(var o in this.emitters.splice(e,1),this.emitterIDs.splice(e,1),this.attributes)this.attributes.hasOwnProperty(o)&&this.attributes[o].splice(i,n);this.particleCount-=t.particleCount,t._onRemove(),this._attributesNeedRefresh=!0}},a.Group.prototype.getFromPool=function(){"use strict";var t=this._pool,e=this._createNewWhenPoolEmpty;if(t.length)return t.pop();if(e){var i=new a.Emitter(this._poolCreationSettings);return this.addEmitter(i),i}return null},a.Group.prototype.releaseIntoPool=function(t){"use strict";if(t instanceof a.Emitter!=!1)return t.reset(),this._pool.unshift(t),this},a.Group.prototype.getPool=function(){"use strict";return this._pool},a.Group.prototype.addPool=function(t,e,i){"use strict";var n;this._poolCreationSettings=e,this._createNewWhenPoolEmpty=!!i;for(var r=0;r<t;++r)n=Array.isArray(e)?new a.Emitter(e[r]):new a.Emitter(e),this.addEmitter(n),this.releaseIntoPool(n);return this},a.Group.prototype._triggerSingleEmitter=function(t){"use strict";var e=this.getFromPool(),i=this;if(null!==e)return t instanceof o.Vector3&&(e.position.value.copy(t),e.position.value=e.position.value),e.enable(),setTimeout((function(){e.disable(),i.releaseIntoPool(e)}),1e3*Math.max(e.duration,e.maxAge.value+e.maxAge.spread)),this},a.Group.prototype.triggerPoolEmitter=function(t,e){"use strict";if("number"==typeof t&&t>1)for(var i=0;i<t;++i)this._triggerSingleEmitter(e);else this._triggerSingleEmitter(e);return this},a.Group.prototype._updateUniforms=function(t){"use strict";this.uniforms.runTime.value+=t,this.uniforms.deltaTime.value=t},a.Group.prototype._resetBufferRanges=function(){"use strict";for(var t=this.attributeKeys,e=this.attributeCount-1,i=this.attributes;e>=0;--e)i[t[e]].resetUpdateRange()},a.Group.prototype._updateBuffers=function(t){"use strict";for(var e,i,n,r=this.attributeKeys,s=this.attributeCount-1,o=this.attributes,a=t.bufferUpdateRanges;s>=0;--s)i=a[e=r[s]],(n=o[e]).setUpdateRange(i.min,i.max),n.flagUpdate()},a.Group.prototype.tick=function(t){"use strict";var e=this.emitters,i=e.length,n=t||this.fixedTimeStep,r=this.attributeKeys,s=this.attributes;if(this._updateUniforms(n),this._resetBufferRanges(),0!==i||!1!==this._attributesNeedRefresh||!1!==this._attributesNeedDynamicReset){for(var o,a=0;a<i;++a)(o=e[a]).tick(n),this._updateBuffers(o);if(!0===this._attributesNeedDynamicReset){for(a=this.attributeCount-1;a>=0;--a)s[r[a]].resetDynamic();this._attributesNeedDynamicReset=!1}if(!0===this._attributesNeedRefresh){for(a=this.attributeCount-1;a>=0;--a)s[r[a]].forceUpdateAll();this._attributesNeedRefresh=!1,this._attributesNeedDynamicReset=!0}}},a.Group.prototype.dispose=function(){"use strict";return this.geometry.dispose(),this.material.dispose(),this},a.Emitter=function(t){"use strict";var e=a.utils,i=e.types,n=a.valueOverLifetimeLength;for(var r in(t=e.ensureTypedArg(t,i.OBJECT,{})).position=e.ensureTypedArg(t.position,i.OBJECT,{}),t.velocity=e.ensureTypedArg(t.velocity,i.OBJECT,{}),t.acceleration=e.ensureTypedArg(t.acceleration,i.OBJECT,{}),t.radius=e.ensureTypedArg(t.radius,i.OBJECT,{}),t.drag=e.ensureTypedArg(t.drag,i.OBJECT,{}),t.rotation=e.ensureTypedArg(t.rotation,i.OBJECT,{}),t.color=e.ensureTypedArg(t.color,i.OBJECT,{}),t.opacity=e.ensureTypedArg(t.opacity,i.OBJECT,{}),t.size=e.ensureTypedArg(t.size,i.OBJECT,{}),t.angle=e.ensureTypedArg(t.angle,i.OBJECT,{}),t.wiggle=e.ensureTypedArg(t.wiggle,i.OBJECT,{}),t.maxAge=e.ensureTypedArg(t.maxAge,i.OBJECT,{}),t.onParticleSpawn,this.uuid=o.Math.generateUUID(),this.type=e.ensureTypedArg(t.type,i.NUMBER,a.distributions.BOX),this.position={_value:e.ensureInstanceOf(t.position.value,o.Vector3,new o.Vector3),_spread:e.ensureInstanceOf(t.position.spread,o.Vector3,new o.Vector3),_spreadClamp:e.ensureInstanceOf(t.position.spreadClamp,o.Vector3,new o.Vector3),_distribution:e.ensureTypedArg(t.position.distribution,i.NUMBER,this.type),_randomise:e.ensureTypedArg(t.position.randomise,i.BOOLEAN,!1),_radius:e.ensureTypedArg(t.position.radius,i.NUMBER,10),_radiusScale:e.ensureInstanceOf(t.position.radiusScale,o.Vector3,new o.Vector3(1,1,1)),_distributionClamp:e.ensureTypedArg(t.position.distributionClamp,i.NUMBER,0)},this.velocity={_value:e.ensureInstanceOf(t.velocity.value,o.Vector3,new o.Vector3),_spread:e.ensureInstanceOf(t.velocity.spread,o.Vector3,new o.Vector3),_distribution:e.ensureTypedArg(t.velocity.distribution,i.NUMBER,this.type),_randomise:e.ensureTypedArg(t.position.randomise,i.BOOLEAN,!1)},this.acceleration={_value:e.ensureInstanceOf(t.acceleration.value,o.Vector3,new o.Vector3),_spread:e.ensureInstanceOf(t.acceleration.spread,o.Vector3,new o.Vector3),_distribution:e.ensureTypedArg(t.acceleration.distribution,i.NUMBER,this.type),_randomise:e.ensureTypedArg(t.position.randomise,i.BOOLEAN,!1)},this.drag={_value:e.ensureTypedArg(t.drag.value,i.NUMBER,0),_spread:e.ensureTypedArg(t.drag.spread,i.NUMBER,0),_randomise:e.ensureTypedArg(t.position.randomise,i.BOOLEAN,!1)},this.wiggle={_value:e.ensureTypedArg(t.wiggle.value,i.NUMBER,0),_spread:e.ensureTypedArg(t.wiggle.spread,i.NUMBER,0)},this.rotation={_axis:e.ensureInstanceOf(t.rotation.axis,o.Vector3,new o.Vector3(0,1,0)),_axisSpread:e.ensureInstanceOf(t.rotation.axisSpread,o.Vector3,new o.Vector3),_angle:e.ensureTypedArg(t.rotation.angle,i.NUMBER,0),_angleSpread:e.ensureTypedArg(t.rotation.angleSpread,i.NUMBER,0),_static:e.ensureTypedArg(t.rotation.static,i.BOOLEAN,!1),_center:e.ensureInstanceOf(t.rotation.center,o.Vector3,this.position._value.clone()),_randomise:e.ensureTypedArg(t.position.randomise,i.BOOLEAN,!1)},this.maxAge={_value:e.ensureTypedArg(t.maxAge.value,i.NUMBER,2),_spread:e.ensureTypedArg(t.maxAge.spread,i.NUMBER,0)},this.color={_value:e.ensureArrayInstanceOf(t.color.value,o.Color,new o.Color),_spread:e.ensureArrayInstanceOf(t.color.spread,o.Vector3,new o.Vector3),_randomise:e.ensureTypedArg(t.position.randomise,i.BOOLEAN,!1)},this.opacity={_value:e.ensureArrayTypedArg(t.opacity.value,i.NUMBER,1),_spread:e.ensureArrayTypedArg(t.opacity.spread,i.NUMBER,0),_randomise:e.ensureTypedArg(t.position.randomise,i.BOOLEAN,!1)},this.size={_value:e.ensureArrayTypedArg(t.size.value,i.NUMBER,1),_spread:e.ensureArrayTypedArg(t.size.spread,i.NUMBER,0),_randomise:e.ensureTypedArg(t.position.randomise,i.BOOLEAN,!1)},this.angle={_value:e.ensureArrayTypedArg(t.angle.value,i.NUMBER,0),_spread:e.ensureArrayTypedArg(t.angle.spread,i.NUMBER,0),_randomise:e.ensureTypedArg(t.position.randomise,i.BOOLEAN,!1)},this.particleCount=e.ensureTypedArg(t.particleCount,i.NUMBER,100),this.duration=e.ensureTypedArg(t.duration,i.NUMBER,null),this.isStatic=e.ensureTypedArg(t.isStatic,i.BOOLEAN,!1),this.activeMultiplier=e.ensureTypedArg(t.activeMultiplier,i.NUMBER,1),this.direction=e.ensureTypedArg(t.direction,i.NUMBER,1),this.alive=e.ensureTypedArg(t.alive,i.BOOLEAN,!0),this.particlesPerSecond=0,this.activationIndex=0,this.attributeOffset=0,this.attributeEnd=0,this.age=0,this.activeParticleCount=0,this.group=null,this.attributes=null,this.paramsArray=null,this.resetFlags={position:e.ensureTypedArg(t.position.randomise,i.BOOLEAN,!1)||e.ensureTypedArg(t.radius.randomise,i.BOOLEAN,!1),velocity:e.ensureTypedArg(t.velocity.randomise,i.BOOLEAN,!1),acceleration:e.ensureTypedArg(t.acceleration.randomise,i.BOOLEAN,!1)||e.ensureTypedArg(t.drag.randomise,i.BOOLEAN,!1),rotation:e.ensureTypedArg(t.rotation.randomise,i.BOOLEAN,!1),rotationCenter:e.ensureTypedArg(t.rotation.randomise,i.BOOLEAN,!1),size:e.ensureTypedArg(t.size.randomise,i.BOOLEAN,!1),color:e.ensureTypedArg(t.color.randomise,i.BOOLEAN,!1),opacity:e.ensureTypedArg(t.opacity.randomise,i.BOOLEAN,!1),angle:e.ensureTypedArg(t.angle.randomise,i.BOOLEAN,!1)},this.updateFlags={},this.updateCounts={},this.updateMap={maxAge:"params",position:"position",velocity:"velocity",acceleration:"acceleration",drag:"acceleration",wiggle:"params",rotation:"rotation",size:"size",color:"color",opacity:"opacity",angle:"angle"},this.updateMap)this.updateMap.hasOwnProperty(r)&&(this.updateCounts[this.updateMap[r]]=0,this.updateFlags[this.updateMap[r]]=!1,this._createGetterSetters(this[r],r));this.bufferUpdateRanges={},this.attributeKeys=null,this.attributeCount=0,e.ensureValueOverLifetimeCompliance(this.color,n,n),e.ensureValueOverLifetimeCompliance(this.opacity,n,n),e.ensureValueOverLifetimeCompliance(this.size,n,n),e.ensureValueOverLifetimeCompliance(this.angle,n,n)},a.Emitter.constructor=a.Emitter,a.Emitter.prototype._createGetterSetters=function(t,e){"use strict";var i=this;for(var n in t)if(t.hasOwnProperty(n)){var r=n.replace("_","");Object.defineProperty(t,r,{get:function(t){return function(){return this[t]}}(n),set:function(t){return function(n){var r=i.updateMap[e],s=this[t],o=a.valueOverLifetimeLength;"_rotationCenter"===t?(i.updateFlags.rotationCenter=!0,i.updateCounts.rotationCenter=0):"_randomise"===t?i.resetFlags[r]=n:(i.updateFlags[r]=!0,i.updateCounts[r]=0),i.group._updateDefines(),this[t]=n,Array.isArray(s)&&a.utils.ensureValueOverLifetimeCompliance(i[e],o,o)}}(n)})}},a.Emitter.prototype._setBufferUpdateRanges=function(t){"use strict";this.attributeKeys=t,this.attributeCount=t.length;for(var e=this.attributeCount-1;e>=0;--e)this.bufferUpdateRanges[t[e]]={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY}},a.Emitter.prototype._calculatePPSValue=function(t){"use strict";var e=this.particleCount;this.duration?this.particlesPerSecond=e/(t<this.duration?t:this.duration):this.particlesPerSecond=e/t},a.Emitter.prototype._setAttributeOffset=function(t){this.attributeOffset=t,this.activationIndex=t,this.activationEnd=t+this.particleCount},a.Emitter.prototype._assignValue=function(t,e){"use strict";switch(t){case"position":this._assignPositionValue(e);break;case"velocity":case"acceleration":this._assignForceValue(e,t);break;case"size":case"opacity":this._assignAbsLifetimeValue(e,t);break;case"angle":this._assignAngleValue(e);break;case"params":this._assignParamsValue(e);break;case"rotation":this._assignRotationValue(e);break;case"color":this._assignColorValue(e)}},a.Emitter.prototype._assignPositionValue=function(t){"use strict";var e=a.distributions,i=a.utils,n=this.position,r=this.attributes.position,s=n._value,o=n._spread;switch(n._distribution){case e.BOX:i.randomVector3(r,t,s,o,n._spreadClamp);break;case e.SPHERE:i.randomVector3OnSphere(r,t,s,n._radius,n._spread.x,n._radiusScale,n._spreadClamp.x,n._distributionClamp||this.particleCount);break;case e.DISC:i.randomVector3OnDisc(r,t,s,n._radius,n._spread.x,n._radiusScale,n._spreadClamp.x);break;case e.LINE:i.randomVector3OnLine(r,t,s,o)}},a.Emitter.prototype._assignForceValue=function(t,e){"use strict";var i,n,r,s,o,h=a.distributions,l=a.utils,u=this[e],c=u._value,d=u._spread;switch(u._distribution){case h.BOX:l.randomVector3(this.attributes[e],t,c,d);break;case h.SPHERE:n=(i=this.attributes.position.typedArray.array)[o=3*t],r=i[o+1],s=i[o+2],l.randomDirectionVector3OnSphere(this.attributes[e],t,n,r,s,this.position._value,u._value.x,u._spread.x);break;case h.DISC:n=(i=this.attributes.position.typedArray.array)[o=3*t],r=i[o+1],s=i[o+2],l.randomDirectionVector3OnDisc(this.attributes[e],t,n,r,s,this.position._value,u._value.x,u._spread.x);break;case h.LINE:l.randomVector3OnLine(this.attributes[e],t,c,d)}if("acceleration"===e){var p=l.clamp(l.randomFloat(this.drag._value,this.drag._spread),0,1);this.attributes.acceleration.typedArray.array[4*t+3]=p}},a.Emitter.prototype._assignAbsLifetimeValue=function(t,e){"use strict";var i,n=this.attributes[e].typedArray,r=this[e],s=a.utils;s.arrayValuesAreEqual(r._value)&&s.arrayValuesAreEqual(r._spread)?(i=Math.abs(s.randomFloat(r._value[0],r._spread[0])),n.setVec4Components(t,i,i,i,i)):n.setVec4Components(t,Math.abs(s.randomFloat(r._value[0],r._spread[0])),Math.abs(s.randomFloat(r._value[1],r._spread[1])),Math.abs(s.randomFloat(r._value[2],r._spread[2])),Math.abs(s.randomFloat(r._value[3],r._spread[3])))},a.Emitter.prototype._assignAngleValue=function(t){"use strict";var e,i=this.attributes.angle.typedArray,n=this.angle,r=a.utils;r.arrayValuesAreEqual(n._value)&&r.arrayValuesAreEqual(n._spread)?(e=r.randomFloat(n._value[0],n._spread[0]),i.setVec4Components(t,e,e,e,e)):i.setVec4Components(t,r.randomFloat(n._value[0],n._spread[0]),r.randomFloat(n._value[1],n._spread[1]),r.randomFloat(n._value[2],n._spread[2]),r.randomFloat(n._value[3],n._spread[3]))},a.Emitter.prototype._assignParamsValue=function(t){"use strict";this.attributes.params.typedArray.setVec4Components(t,this.isStatic?1:0,0,Math.abs(a.utils.randomFloat(this.maxAge._value,this.maxAge._spread)),a.utils.randomFloat(this.wiggle._value,this.wiggle._spread))},a.Emitter.prototype._assignRotationValue=function(t){"use strict";this.attributes.rotation.typedArray.setVec3Components(t,a.utils.getPackedRotationAxis(this.rotation._axis,this.rotation._axisSpread),a.utils.randomFloat(this.rotation._angle,this.rotation._angleSpread),this.rotation._static?0:1),this.attributes.rotationCenter.typedArray.setVec3(t,this.rotation._center)},a.Emitter.prototype._assignColorValue=function(t){"use strict";a.utils.randomColorAsHex(this.attributes.color,t,this.color._value,this.color._spread)},a.Emitter.prototype._resetParticle=function(t){"use strict";for(var e,i,n=this.resetFlags,r=this.updateFlags,s=this.updateCounts,o=this.attributeKeys,a=this.attributeCount-1;a>=0;--a)i=r[e=o[a]],!0!==n[e]&&!0!==i||(this._assignValue(e,t),this._updateAttributeUpdateRange(e,t),!0===i&&s[e]===this.particleCount?(r[e]=!1,s[e]=0):1==i&&++s[e])},a.Emitter.prototype._updateAttributeUpdateRange=function(t,e){"use strict";var i=this.bufferUpdateRanges[t];i.min=Math.min(e,i.min),i.max=Math.max(e,i.max)},a.Emitter.prototype._resetBufferRanges=function(){"use strict";for(var t,e=this.bufferUpdateRanges,i=this.bufferUpdateKeys,n=this.bufferUpdateCount-1;n>=0;--n)e[t=i[n]].min=Number.POSITIVE_INFINITY,e[t].max=Number.NEGATIVE_INFINITY},a.Emitter.prototype._onRemove=function(){"use strict";this.particlesPerSecond=0,this.attributeOffset=0,this.activationIndex=0,this.activeParticleCount=0,this.group=null,this.attributes=null,this.paramsArray=null,this.age=0},a.Emitter.prototype._decrementParticleCount=function(){"use strict";--this.activeParticleCount},a.Emitter.prototype._incrementParticleCount=function(){"use strict";++this.activeParticleCount},a.Emitter.prototype._checkParticleAges=function(t,e,i,n){"use strict";for(var r,s,o,a,h=e-1;h>=t;--h)0!==(a=i[r=4*h])&&(o=i[r+1],s=i[r+2],1===this.direction?(o+=n)>=s&&(o=0,a=0,this._decrementParticleCount()):(o-=n)<=0&&(o=s,a=0,this._decrementParticleCount()),i[r]=a,i[r+1]=o,this._updateAttributeUpdateRange("params",h))},a.Emitter.prototype._activateParticles=function(t,e,i,n){"use strict";for(var r,s,o=this.direction,a=t;a<e;++a)0!=i[r=4*a]&&1!==this.particleCount||(this._incrementParticleCount(),i[r]=1,this._resetParticle(a),s=n*(a-t),i[r+1]=-1===o?i[r+2]-s:s,this._updateAttributeUpdateRange("params",a))},a.Emitter.prototype.tick=function(t){"use strict";if(!this.isStatic){null===this.paramsArray&&(this.paramsArray=this.attributes.params.typedArray.array);var e=this.attributeOffset,i=e+this.particleCount,n=this.paramsArray,r=this.particlesPerSecond*this.activeMultiplier*t,s=this.activationIndex;if(this._resetBufferRanges(),this._checkParticleAges(e,i,n,t),!1!==this.alive){if(null!==this.duration&&this.age>this.duration)return this.alive=!1,void(this.age=0);var o=1===this.particleCount?s:0|s,a=Math.min(o+r,this.activationEnd),h=a-this.activationIndex|0,l=h>0?t/h:0;this._activateParticles(o,a,n,l),this.activationIndex+=r,this.activationIndex>i&&(this.activationIndex=e),this.age+=t}else this.age=0}},a.Emitter.prototype.sendParticles=function(t){"use strict";if(!this.isStatic){null===this.paramsArray&&(this.paramsArray=this.attributes.params.typedArray.array);var e=this.attributeOffset,i=e+this.particleCount,n=this.paramsArray,r=this.particlesPerSecond*this.activeMultiplier*t,s=this.activationIndex,o=1===this.particleCount?s:0|s,a=Math.min(o+r,this.activationEnd),h=a-this.activationIndex|0,l=h>0?t/h:0;this._activateParticles(o,a,n,l),this.activationIndex+=r,this.activationIndex>i&&(this.activationIndex=e)}},a.Emitter.prototype.reset=function(t){"use strict";if(this.age=0,this.alive=!1,!0===t){for(var e,i=this.attributeOffset,n=i+this.particleCount,r=this.paramsArray,s=this.attributes.params.bufferAttribute,o=n-1;o>=i;--o)r[e=4*o]=0,r[e+1]=0;s.updateRange.offset=0,s.updateRange.count=-1,s.needsUpdate=!0}return this},a.Emitter.prototype.enable=function(){"use strict";return this.alive=!0,this},a.Emitter.prototype.disable=function(){"use strict";return this.alive=!1,this},a.Emitter.prototype.remove=function(){"use strict";return null!==this.group&&this.group.removeEmitter(this),this}},function(t,e,i){var n={"./level1":40,"./level1.js":40,"./level2":41,"./level2.js":41,"./level3":42,"./level3.js":42,"./level4":43,"./level4.js":43,"./level5":44,"./level5.js":44,"./levelX":30,"./levelX.js":30};function r(t){var e=s(t);return i(e)}function s(t){if(!i.o(n,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return n[t]}r.keys=function(){return Object.keys(n)},r.resolve=s,t.exports=r,r.id=60},function(t,e,i){var n;n=function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=1528)}([function(t,e){function i(t,e,i){var n=i?t[e]:Object.getOwnPropertyDescriptor(t,e);return!i&&n.value&&"object"==typeof n.value&&(n=n.value),!(!n||!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<e.length;i++)r(t,e[i].prototype||e[i])}}function o(t){var e,i;if(t||(t={}),t.initialize){if("function"!=typeof t.initialize)throw new Error("initialize must be a function");e=t.initialize,delete t.initialize}else if(t.Extends){var n=t.Extends;e=function(){n.apply(this,arguments)}}else e=function(){};t.Extends?(e.prototype=Object.create(t.Extends.prototype),e.prototype.constructor=e,i=t.Extends,delete t.Extends):e.prototype.constructor=e;var o=null;return t.Mixins&&(o=t.Mixins,delete t.Mixins),s(e,o),r(e,t,!0,i),e}o.extend=r,o.mixin=s,o.ignoreFinals=!1,t.exports=o},function(t,e){t.exports=function(){}},function(t,e){t.exports=function(t,e,i){var n=typeof t;return t&&"number"!==n&&"string"!==n&&t.hasOwnProperty(e)&&void 0!==t[e]?t[e]:i}},function(t,e,i){var n=i(0),r=i(124),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){var n=i(0),r=i(56),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){var n=i(0),r=i(24),s=i(20),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<n.length;o++){if(!r.hasOwnProperty(n[o])){s=i;break}s=r[n[o]],r=r[n[o]]}return s}return i}return i}},function(t,e){t.exports=function(t){if("object"!=typeof t||t.nodeType||t===t.window)return!1;try{if(t.constructor&&!{}.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0}},function(t,e){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<s;n++)o[n]=i[n].fn;return o},l.prototype.listenerCount=function(t){var e=r?r+t:t,i=this._events[e];return i?i.fn?1:i.length:0},l.prototype.emit=function(t,e,i,n,s,o){var a=r?r+t:t;if(!this._events[a])return!1;var h,l,u=this._events[a],c=arguments.length;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,e),!0;case 3:return u.fn.call(u.context,e,i),!0;case 4:return u.fn.call(u.context,e,i,n),!0;case 5:return u.fn.call(u.context,e,i,n,s),!0;case 6:return u.fn.call(u.context,e,i,n,s,o),!0}for(l=1,h=new Array(c-1);l<c;l++)h[l-1]=arguments[l];u.fn.apply(u.context,h)}else{var d,p=u.length;for(l=0;l<p;l++)switch(u[l].once&&this.removeListener(t,u[l].fn,void 0,!0),c){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,e);break;case 3:u[l].fn.call(u[l].context,e,i);break;case 4:u[l].fn.call(u[l].context,e,i,n);break;default:if(!h)for(d=1,h=new Array(c-1);d<c;d++)h[d-1]=arguments[d];u[l].fn.apply(u[l].context,h)}}return!0},l.prototype.on=function(t,e,i){return a(this,t,e,i,!1)},l.prototype.once=function(t,e,i){return a(this,t,e,i,!0)},l.prototype.removeListener=function(t,e,i,n){var s=r?r+t:t;if(!this._events[s])return this;if(!e)return h(this,s),this;var o=this._events[s];if(o.fn)o.fn!==e||n&&!o.once||i&&o.context!==i||h(this,s);else{for(var a=0,l=[],u=o.length;a<u;a++)(o[a].fn!==e||n&&!o[a].once||i&&o[a].context!==i)&&l.push(o[a]);l.length?this._events[s]=1===l.length?l[0]:l:h(this,s)}return this},l.prototype.removeAllListeners=function(t){var e;return t?(e=r?r+t:t,this._events[e]&&h(this,e)):(this._events=new s,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,t.exports=l},function(t,e,i){var n=i(0),r=i(57),s=i(171),o=i(306),a=i(56),h=i(47),l=i(174),u=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=u},function(t,e,i){t.exports={Alpha:i(607),AlphaSingle:i(303),BlendMode:i(304),ComputedSize:i(608),Crop:i(609),Depth:i(305),Flip:i(610),GetBounds:i(611),Mask:i(309),Origin:i(632),PathFollower:i(633),Pipeline:i(167),ScrollFactor:i(312),Size:i(634),Texture:i(635),TextureCrop:i(636),Tint:i(637),ToJSON:i(176),Transform:i(313),TransformMatrix:i(25),Visible:i(314)}},function(t,e){function i(t){for(var e="",i=0;i<t;++i)i>0&&(e+="\nelse "),i<t-1&&(e+="if(test == "+i+".0){}");return e}t.exports={getTintFromFloats:function(t,e,i,n){return((255&(255*n|0))<<24|(255&(255*t|0))<<16|(255&(255*e|0))<<8|255&(255*i|0))>>>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;n<e;n++)n>0&&(i+="\n\telse "),n<e-1&&(i+="if (outTexId < "+n+".5)"),i+="\n\t{",i+="\n\t\ttexture = texture2D(uMainSampler["+n+"], outTexCoord);",i+="\n\t}";return(t=t.replace(/%count%/gi,e.toString())).replace(/%forloop%/gi,i)}}},function(t,e,i){var n=i(193),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){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){var n=i(0),r=i(176),s=i(101),o=i(9),a=i(75),h=i(20),l=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!(l.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},addToDisplayList:function(t){return void 0===t&&(t=this.scene.sys.displayList),this.displayList&&this.displayList!==t&&this.removeFromDisplayList(),t.exists(this)||(this.displayList=t,t.add(this,!0),t.queueDepthSort(),this.emit(a.ADDED_TO_SCENE,this,this.scene),t.events.emit(h.ADDED_TO_SCENE,this,this.scene)),this},addToUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.add(this),this},removeFromDisplayList:function(){var t=this.displayList||this.scene.sys.displayList;return t.exists(this)&&(t.remove(this,!0),t.queueDepthSort(),this.displayList=null,this.emit(a.REMOVED_FROM_SCENE,this,this.scene),t.events.emit(h.REMOVED_FROM_SCENE,this,this.scene)),this},removeFromUpdateList:function(){return this.scene&&this.preUpdate&&this.scene.sys.updateList.remove(this),this},destroy:function(t){this.scene&&!this.ignoreDestroy&&(void 0===t&&(t=!1),this.preDestroy&&this.preDestroy.call(this),this.emit(a.DESTROY,this,t),this.removeAllListeners(),this.postPipelines&&this.resetPostPipeline(!0),this.removeFromDisplayList(),this.removeFromUpdateList(),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.parentContainer=void 0)}});l.RENDER_MASK=15,t.exports=l},function(t,e,i){var n=i(0),r=i(24),s=i(20),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){var n=i(7),r=function(){var t,e,i,s,o,a,h=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof h&&(c=h,h=arguments[1]||{},l=2),u===l&&(h=this,--l);l<u;l++)if(null!=(t=arguments[l]))for(e in t)i=h[e],h!==(s=t[e])&&(c&&s&&(n(s)||(o=Array.isArray(s)))?(o?(o=!1,a=i&&Array.isArray(i)?i:[]):a=i&&n(i)?i:{},h[e]=r(c,a,s)):void 0!==s&&(h[e]=s));return h};t.exports=r},function(t,e){t.exports=function(t,e,i){return Math.max(e,Math.min(i,t))}},function(t,e,i){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,i){t.exports={ADDED_TO_SCENE:i(656),BOOT:i(657),CREATE:i(658),DESTROY:i(659),PAUSE:i(660),POST_UPDATE:i(661),PRE_RENDER:i(662),PRE_UPDATE:i(663),READY:i(664),REMOVED_FROM_SCENE:i(665),RENDER:i(666),RESUME:i(667),SHUTDOWN:i(668),SLEEP:i(669),START:i(670),TRANSITION_COMPLETE:i(671),TRANSITION_INIT:i(672),TRANSITION_OUT:i(673),TRANSITION_START:i(674),TRANSITION_WAKE:i(675),UPDATE:i(676),WAKE:i(677)}},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){t.exports={BLUR:i(612),BOOT:i(613),CONTEXT_LOST:i(614),CONTEXT_RESTORED:i(615),DESTROY:i(616),FOCUS:i(617),HIDDEN:i(618),PAUSE:i(619),POST_RENDER:i(620),POST_STEP:i(621),PRE_RENDER:i(622),PRE_STEP:i(623),READY:i(624),RESUME:i(625),STEP:i(626),VISIBLE:i(627)}},function(t,e,i){var n=i(0),r=i(21),s=i(95),o=i(2),a=i(155),h=i(240),l=i(517),u=i(156),c=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=u(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:")||(this.xhrLoader=l(this,this.loader.xhr)))},onLoad:function(t,e){var i=t.responseURL&&(0===t.responseURL.indexOf("file://")||0===t.responseURL.indexOf("capacitor://"))&&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}});c.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)}},c.revokeObjectURL=function(t){"function"==typeof URL&&URL.revokeObjectURL(t.src)},t.exports=c},function(t,e){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){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],u=n[0],c=n[1],d=n[2],p=n[3],f=n[4],m=n[5],g=void 0===e?this:e;return g.a=u*r+c*o,g.b=u*s+c*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],u=e*o+i*h+n[5],c=r[0],d=r[1],p=r[2],f=r[3],m=r[4],g=r[5];return n[0]=c*s+d*a,n[1]=c*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+u,this},transform:function(t,e,i,n,r,s){var o=this.matrix,a=o[0],h=o[1],l=o[2],u=o[3],c=o[4],d=o[5];return o[0]=t*a+e*l,o[1]=t*h+e*u,o[2]=i*a+n*l,o[3]=i*h+n*u,o[4]=r*a+s*l+c,o[5]=r*h+s*u+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],u=n[5],c=1/(r*h+a*-o);return i.x=h*c*t+-a*c*e+(u*a-l*h)*c,i.y=r*c*e+-o*c*t+(-u*r+l*o)*c,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){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 u=[],c=e;c<e+r;c++)for(var d=t;d<t+i;d++){var p=o.data[c][d];if(null!==p){if(a&&-1===p.index)continue;if(h&&!p.collides)continue;if(l&&!p.hasInterestingFace)continue;u.push(p)}}return u}},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<h;o++)t[o][e]=i+a*n,a++;else for(o=r;o>=0;o--)t[o][e]=i+a*n,a++;return t}},function(t,e,i){var n=i(35),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),u=r(h,"y",.5);e.setOrigin(l,u)}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){t.exports={ORTHOGONAL:0,ISOMETRIC:1,STAGGERED:2,HEXAGONAL:3}},function(t,e,i){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){var n,r,s,o=i(33),a=i(192),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 u;void 0===e&&(e=1),void 0===i&&(i=1),void 0===n&&(n=o.CANVAS),void 0===s&&(s=!1);var c=r(n);return null===c?(c={parent:t,canvas:document.createElement("canvas"),type:n},n===o.CANVAS&&h.push(c),u=c.canvas):(c.parent=t,u=c.canvas),s&&(c.parent=u),u.width=e,u.height=i,l&&n===o.CANVAS&&a.disable(u.getContext("2d")),u},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<h.length;e++){var i=h[e];if(!i.parent&&i.type===t)return i}return null},free:function(){return h.length-s()},pool:h,remove:function(t){var e=t instanceof HTMLCanvasElement;h.forEach((function(i){(e&&i.canvas===t||!e&&i.parent===t)&&(i.parent=null,i.canvas.width=1,i.canvas.height=1)}))},total:s})},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;s<arguments.length;s++){var o=arguments[s];if(o)for(var a in o)r&&o[a]&&o[a].constructor===Object?t[a]&&t[a].constructor!==Object?t[a]=o[a]:(t[a]=t[a]||{},i.extend(t[a],r,o[a])):t[a]=o[a]}return t},i.clone=function(t,e){return i.extend({},e,t)},i.keys=function(t){if(Object.keys)return Object.keys(t);var e=[];for(var i in t)e.push(i);return e},i.values=function(t){var e=[];if(Object.keys){for(var i=Object.keys(t),n=0;n<i.length;n++)e.push(t[i[n]]);return e}for(var r in t)e.push(t[r]);return e},i.get=function(t,e,i,n){e=e.split(".").slice(i,n);for(var r=0;r<e.length;r+=1)t=t[e[r]];return t},i.set=function(t,e,n,r,s){var o=e.split(".").slice(r,s);return i.get(t,e,0,-1)[o[o.length-1]]=n,n},i.shuffle=function(t){for(var e=t.length-1;e>0;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 t<e?e:t>i?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},i.info=function(){console&&i.logLevel>0&&i.logLevel},i.warn=function(){console&&i.logLevel>0&&i.logLevel},i.nextId=function(){return i._nextId++},i.indexOf=function(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1},i.map=function(t,e){if(t.map)return t.map(e);for(var i=[],n=0;n<t.length;n+=1)i.push(e(t[n]));return i},i.topologicalSort=function(t){var e=[],n=[],r=[];for(var s in t)n[s]||r[s]||i._topologicalSort(s,n,r,t,e);return e},i._topologicalSort=function(t,e,n,r,s){var o=r[t]||[];n[t]=!0;for(var a=0;a<o.length;a+=1){var h=o[a];n[h]||e[h]||i._topologicalSort(h,e,n,r,s)}n[t]=!1,e[t]=!0,s.push(t)},i.chain=function(){for(var t=[],e=0;e<arguments.length;e+=1){var i=arguments[e];i._chained?t.push.apply(t,i._chained):t.push(i)}var n=function(){for(var e,i=new Array(arguments.length),n=0,r=arguments.length;n<r;n++)i[n]=arguments[n];for(n=0;n<t.length;n+=1){var s=t[n].apply(e,i);void 0!==s&&(e=s)}return e};return n._chained=t,n},i.chainPathBefore=function(t,e,n){return i.set(t,e,i.chain(n,i.get(t,e)))},i.chainPathAfter=function(t,e,n){return i.set(t,e,i.chain(i.get(t,e),n))}}()},function(t,e,i){var n={VERSION:"3.55.2",BlendModes:i(35),ScaleModes:i(168),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){var n=i(0),r=i(11),s=i(15),o=i(47),a=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()},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},setDisplaySize:function(t,e){return this.displayWidth=t,this.displayHeight=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=a},function(t,e){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){var n=i(14);t.exports=function(t){return t*n.DEG_TO_RAD}},function(t,e,i){t.exports={DESTROY:i(743),FADE_IN_COMPLETE:i(744),FADE_IN_START:i(745),FADE_OUT_COMPLETE:i(746),FADE_OUT_START:i(747),FLASH_COMPLETE:i(748),FLASH_START:i(749),FOLLOW_UPDATE:i(750),PAN_COMPLETE:i(751),PAN_START:i(752),POST_RENDER:i(753),PRE_RENDER:i(754),ROTATE_COMPLETE:i(755),ROTATE_START:i(756),SHAKE_COMPLETE:i(757),SHAKE_START:i(758),ZOOM_COMPLETE:i(759),ZOOM_START:i(760)}},function(t,e,i){var n=i(0),r=i(103),s=i(328),o=i(188),a=i(329),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){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,u=a*n+r*i-s*e,c=-r*e-s*i-o*n;return this.x=h*a+c*-r+l*-o-u*-s,this.y=l*a+c*-s+u*-r-h*-o,this.z=u*a+c*-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],u=r[5],c=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],w=1/(e*h+i*d+n*g+r[15]);return this.x=(e*s+i*l+n*p+v)*w,this.y=(e*o+i*u+n*f+y)*w,this.z=(e*a+i*c+n*m+x)*w,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){t.exports={CSV:0,TILED_JSON:1,ARRAY_2D:2,WELTMEISTER:3}},function(t,e,i){var n={};t.exports=n;var r=i(64),s=i(83),o=i(165),a=i(32),h=i(84),l=i(271);!function(){n._inertiaScale=4,n._nextCollidingGroupId=1,n._nextNonCollidingGroupId=-1,n._nextCategory=1,n.create=function(e){var i={id:a.nextId(),type:"body",label:"Body",parts:[],plugin:{},angle:0,vertices:null,position:{x:0,y:0},force:{x:0,y:0},torque:0,positionImpulse:{x:0,y:0},previousPositionImpulse:{x:0,y:0},constraintImpulse:{x:0,y:0,angle:0},totalContacts:0,speed:0,angularSpeed:0,velocity:{x:0,y:0},angularVelocity:0,isSensor:!1,isStatic:!1,isSleeping:!1,motion:0,sleepThreshold:60,density:.001,restitution:0,friction:.1,frictionStatic:.5,frictionAir:.01,collisionFilter:{category:1,mask:4294967295,group:0},slop:.05,timeScale:1,events:null,bounds:null,chamfer:null,circleRadius:0,positionPrev:null,anglePrev:0,parent:null,axes:null,area:0,mass:0,inverseMass:0,inertia:0,inverseInertia:0,_original:null,render:{visible:!0,opacity:1,sprite:{xOffset:0,yOffset:0},fillColor:null,fillOpacity:null,lineColor:null,lineOpacity:null,lineThickness:null},gameObject:null,scale:{x:1,y:1},centerOfMass:{x:0,y:0},centerOffset:{x:0,y:0},gravityScale:{x:1,y:1},ignoreGravity:!1,ignorePointer:!1,onCollideCallback:null,onCollideEndCallback:null,onCollideActiveCallback:null,onCollideWith:{}};!e.hasOwnProperty("position")&&e.hasOwnProperty("vertices")?e.position=r.centre(e.vertices):e.hasOwnProperty("vertices")||(i.vertices=r.fromPath("L 0 0 L 40 0 L 40 40 L 0 40"));var n=a.extend(i,e);return t(n,e),n.setOnCollideWith=function(t,e){return e?this.onCollideWith[t.id]=e:delete this.onCollideWith[t.id],this},n},n.nextGroup=function(t){return t?n._nextNonCollidingGroupId--:n._nextCollidingGroupId++},n.nextCategory=function(){return n._nextCategory=n._nextCategory<<1,n._nextCategory};var t=function(t,e){e=e||{},n.set(t,{bounds:t.bounds||h.create(t.vertices),positionPrev:t.positionPrev||s.clone(t.position),anglePrev:t.anglePrev||t.angle,vertices:t.vertices,parts:t.parts||[t],isStatic:t.isStatic,isSleeping:t.isSleeping,parent:t.parent||t});var i=t.bounds;if(r.rotate(t.vertices,t.angle,t.position),l.rotate(t.axes,t.angle),h.update(i,t.vertices,t.velocity),n.set(t,{axes:e.axes||t.axes,area:e.area||t.area,mass:e.mass||t.mass,inertia:e.inertia||t.inertia}),1===t.parts.length){var o=t.centerOfMass,a=t.centerOffset,u=i.max.x-i.min.x,c=i.max.y-i.min.y;o.x=-(i.min.x-t.position.x)/u,o.y=-(i.min.y-t.position.y)/c,a.x=u*o.x,a.y=c*o.y}};n.set=function(t,e,i){var r;for(r in"string"==typeof e&&(r=e,(e={})[r]=i),e)if(Object.prototype.hasOwnProperty.call(e,r))switch(i=e[r],r){case"isStatic":n.setStatic(t,i);break;case"isSleeping":o.set(t,i);break;case"mass":n.setMass(t,i);break;case"density":n.setDensity(t,i);break;case"inertia":n.setInertia(t,i);break;case"vertices":n.setVertices(t,i);break;case"position":n.setPosition(t,i);break;case"angle":n.setAngle(t,i);break;case"velocity":n.setVelocity(t,i);break;case"angularVelocity":n.setAngularVelocity(t,i);break;case"parts":n.setParts(t,i);break;case"centre":n.setCentre(t,i);break;default:t[r]=i}},n.setStatic=function(t,e){for(var i=0;i<t.parts.length;i++){var n=t.parts[i];n.isStatic=e,e?(n._original={restitution:n.restitution,friction:n.friction,mass:n.mass,inertia:n.inertia,density:n.density,inverseMass:n.inverseMass,inverseInertia:n.inverseInertia},n.restitution=0,n.friction=1,n.mass=n.inertia=n.density=1/0,n.inverseMass=n.inverseInertia=0,n.positionPrev.x=n.position.x,n.positionPrev.y=n.position.y,n.anglePrev=n.angle,n.angularVelocity=0,n.speed=0,n.angularSpeed=0,n.motion=0):n._original&&(n.restitution=n._original.restitution,n.friction=n._original.friction,n.mass=n._original.mass,n.inertia=n._original.inertia,n.density=n._original.density,n.inverseMass=n._original.inverseMass,n.inverseInertia=n._original.inverseInertia,n._original=null)}},n.setMass=function(t,e){var i=t.inertia/(t.mass/6);t.inertia=i*(e/6),t.inverseInertia=1/t.inertia,t.mass=e,t.inverseMass=1/t.mass,t.density=t.mass/t.area},n.setDensity=function(t,e){n.setMass(t,e*t.area),t.density=e},n.setInertia=function(t,e){t.inertia=e,t.inverseInertia=1/t.inertia},n.setVertices=function(t,e){e[0].body===t?t.vertices=e:t.vertices=r.create(e,t),t.axes=l.fromVertices(t.vertices),t.area=r.area(t.vertices),n.setMass(t,t.density*t.area);var i=r.centre(t.vertices);r.translate(t.vertices,i,-1),n.setInertia(t,n._inertiaScale*r.inertia(t.vertices,t.mass)),r.translate(t.vertices,t.position),h.update(t.bounds,t.vertices,t.velocity)},n.setParts=function(t,e,i){var s;for(e=e.slice(0),t.parts.length=0,t.parts.push(t),t.parent=t,s=0;s<e.length;s++){var o=e[s];o!==t&&(o.parent=t,t.parts.push(o))}if(1!==t.parts.length){if(i=void 0===i||i){var a=[];for(s=0;s<e.length;s++)a=a.concat(e[s].vertices);r.clockwiseSort(a);var l=r.hull(a),u=r.centre(l);n.setVertices(t,l),r.translate(t.vertices,u)}var c=n._totalProperties(t),d=c.centre.x,p=c.centre.y,f=t.bounds,m=t.centerOfMass,g=t.centerOffset;h.update(f,t.vertices,t.velocity),m.x=-(f.min.x-d)/(f.max.x-f.min.x),m.y=-(f.min.y-p)/(f.max.y-f.min.y),g.x=d,g.y=p,t.area=c.area,t.parent=t,t.position.x=d,t.position.y=p,t.positionPrev.x=d,t.positionPrev.y=p,n.setMass(t,c.mass),n.setInertia(t,c.inertia),n.setPosition(t,c.centre)}},n.setCentre=function(t,e,i){i?(t.positionPrev.x+=e.x,t.positionPrev.y+=e.y,t.position.x+=e.x,t.position.y+=e.y):(t.positionPrev.x=e.x-(t.position.x-t.positionPrev.x),t.positionPrev.y=e.y-(t.position.y-t.positionPrev.y),t.position.x=e.x,t.position.y=e.y)},n.setPosition=function(t,e){var i=s.sub(e,t.position);t.positionPrev.x+=i.x,t.positionPrev.y+=i.y;for(var n=0;n<t.parts.length;n++){var o=t.parts[n];o.position.x+=i.x,o.position.y+=i.y,r.translate(o.vertices,i),h.update(o.bounds,o.vertices,t.velocity)}},n.setAngle=function(t,e){var i=e-t.angle;t.anglePrev+=i;for(var n=0;n<t.parts.length;n++){var o=t.parts[n];o.angle+=i,r.rotate(o.vertices,i,t.position),l.rotate(o.axes,i),h.update(o.bounds,o.vertices,t.velocity),n>0&&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 u=0;u<t.parts.length;u++){var c=t.parts[u];c.scale.x=e,c.scale.y=i,r.scale(c.vertices,e,i,s),c.axes=l.fromVertices(c.vertices),c.area=r.area(c.vertices),n.setMass(c,t.density*c.area),r.translate(c.vertices,{x:-c.position.x,y:-c.position.y}),n.setInertia(c,n._inertiaScale*r.inertia(c.vertices,c.mass)),r.translate(c.vertices,{x:c.position.x,y:c.position.y}),u>0&&(o+=c.area,a+=c.inertia),c.position.x=s.x+(c.position.x-s.x)*e,c.position.y=s.y+(c.position.y-s.y)*i,h.update(c.bounds,c.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,u=t.position.x-t.positionPrev.x,c=t.position.y-t.positionPrev.y;t.velocity.x=u*a*n+t.force.x/t.mass*o,t.velocity.y=c*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;d<t.parts.length;d++){var p=t.parts[d];r.translate(p.vertices,t.velocity),d>0&&(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<t.parts.length;i++){var n=t.parts[i],r=n.mass!==1/0?n.mass:1;e.mass+=r,e.area+=n.area,e.inertia+=n.inertia,e.centre=s.add(e.centre,s.mult(n.position,r))}return e.centre=s.div(e.centre,e.mass),e}}()},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<h;o++)t[o][e]+=i+a*n,a++;else for(o=r;o>=0;o--)t[o][e]+=i+a*n,a++;return t}},function(t,e,i){var n=i(0),r=i(307),s=i(172),o=i(56),a=i(173),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){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<r.length;s++)r[s].multiFile=this},isReadyToProcess:function(){return 0===this.pending&&0===this.failed&&!this.complete},addToMultiFile:function(t){return this.files.push(t),t.multiFile=this,this.pending++,this.complete=!1,this},onFileComplete:function(t){-1!==this.files.indexOf(t)&&this.pending--},onFileFailed:function(t){-1!==this.files.indexOf(t)&&this.failed++}});t.exports=n},function(t,e){t.exports=function(t,e,i,n){var r=t-i,s=e-n;return Math.sqrt(r*r+s*s)}},function(t,e,i){t.exports={BOOT:i(922),DESTROY:i(923),DRAG_END:i(924),DRAG_ENTER:i(925),DRAG:i(926),DRAG_LEAVE:i(927),DRAG_OVER:i(928),DRAG_START:i(929),DROP:i(930),GAME_OUT:i(931),GAME_OVER:i(932),GAMEOBJECT_DOWN:i(933),GAMEOBJECT_DRAG_END:i(934),GAMEOBJECT_DRAG_ENTER:i(935),GAMEOBJECT_DRAG:i(936),GAMEOBJECT_DRAG_LEAVE:i(937),GAMEOBJECT_DRAG_OVER:i(938),GAMEOBJECT_DRAG_START:i(939),GAMEOBJECT_DROP:i(940),GAMEOBJECT_MOVE:i(941),GAMEOBJECT_OUT:i(942),GAMEOBJECT_OVER:i(943),GAMEOBJECT_POINTER_DOWN:i(944),GAMEOBJECT_POINTER_MOVE:i(945),GAMEOBJECT_POINTER_OUT:i(946),GAMEOBJECT_POINTER_OVER:i(947),GAMEOBJECT_POINTER_UP:i(948),GAMEOBJECT_POINTER_WHEEL:i(949),GAMEOBJECT_UP:i(950),GAMEOBJECT_WHEEL:i(951),MANAGER_BOOT:i(952),MANAGER_PROCESS:i(953),MANAGER_UPDATE:i(954),POINTER_DOWN:i(955),POINTER_DOWN_OUTSIDE:i(956),POINTER_MOVE:i(957),POINTER_OUT:i(958),POINTER_OVER:i(959),POINTER_UP:i(960),POINTER_UP_OUTSIDE:i(961),POINTER_WHEEL:i(962),POINTERLOCK_CHANGE:i(963),PRE_UPDATE:i(964),SHUTDOWN:i(965),START:i(966),UPDATE:i(967)}},function(t,e){t.exports=function(t,e){return t.y=e+t.height*t.originY,t}},function(t,e){t.exports=function(t,e){return t.x=e+t.width*t.originX,t}},function(t,e){t.exports=function(t,e){return t.x=e-t.width+t.width*t.originX,t}},function(t,e){t.exports=function(t,e){return t.y=e-t.height+t.height*t.originY,t}},function(t,e){t.exports={CIRCLE:0,ELLIPSE:1,LINE:2,POINT:3,POLYGON:4,RECTANGLE:5,TRIANGLE:6}},function(t,e){t.exports=function(t,e,i){return!(t.width<=0||t.height<=0)&&t.x<=e&&t.x+t.width>=e&&t.y<=i&&t.y+t.height>=i}},function(t,e,i){var n=i(0),r=i(175),s=i(9),o=i(374),a=i(2),h=i(69),l=i(91),u=i(141),c=i(12),d=i(375),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,this.glReset=!1},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 c=n.width,d=n.height;if("number"==typeof s)for(t=0;t<s;t++)r.push(new u(n,c,d,1,0,!0));else if(Array.isArray(s))for(t=0;t<s.length;t++){var p=a(s[t],"scale",1),f=a(s[t],"minFilter",0),m=a(s[t],"autoClear",1);r.push(new u(n,c,d,p,f,m))}r.length&&(this.currentRenderTarget=r[0]),this.setShadersFromConfig(i);var g=this.shaders,v=0;for(t=0;t<g.length;t++)g[t].vertexSize>v&&(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 w=a(i,"vertices",null);for(w?(this.vertexViewF32.set(w),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;i<e.length;i++)if(e[i].name===t)return e[i]},setShadersFromConfig:function(t){var e,i=this.shaders,n=this.renderer;for(e=0;e<i.length;e++)i[e].destroy();var s=a(t,"vertShader",null),o=c.parseFragmentShaderMaxTextures(a(t,"fragShader",null),n.maxTextures),h=a(t,"attributes",null),l=a(t,"shaders",[]),u=l.length;if(0===u)s&&o&&(this.shaders=[new d(this,"default",s,o,r(h))]);else{var p=[];for(e=0;e<u;e++){var f=l[e],m=a(f,"name","default"),g=a(f,"vertShader",s),v=c.parseFragmentShaderMaxTextures(a(f,"fragShader",o),n.maxTextures),y=a(f,"attributes",h);g&&v&&p.push(new d(this,m,g,v,r(y)))}this.shaders=p}return 0===this.shaders.length||(this.currentShader=this.shaders[0]),this},setGameObject:function(t,e){return void 0===e&&(e=t.frame),this.currentUnit=this.renderer.setTextureSource(e.source),this.currentUnit},shouldFlush:function(t){return void 0===t&&(t=0),this.vertexCount+t>this.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<i.length;n++)i[n].resize(t,e);return this.setProjectionMatrix(t,e),this.emit(o.RESIZE,t,e,this),this.onResize(t,e),this},setProjectionMatrix:function(t,e){var i=this.projectionMatrix;if(!i)return this;this.projectionWidth=t,this.projectionHeight=e,i.ortho(0,t,e,0,-1e3,1e3);for(var n=this.shaders,r="uProjectionMatrix",s=0;s<n.length;s++){var o=n[s];o.hasUniform(r)&&(o.resetUniform(r),o.setMatrix4fv(r,!1,i.val,o))}return this},updateProjectionMatrix:function(){if(this.projectionMatrix){var t=this.renderer.projectionWidth,e=this.renderer.projectionHeight;this.projectionWidth===t&&this.projectionHeight===e||this.setProjectionMatrix(t,e)}},bind:function(t){if(void 0===t&&(t=this.currentShader),this.glReset)return this.rebind(t);var e=this.setVertexBuffer();return t.bind(e),this.currentShader=t,this.emit(o.BIND,this,t),this.onActive(t),this},rebind:function(t){this.setVertexBuffer();for(var e=this.shaders,i=e.length-1;i>=0;i--){var n=e[i].rebind();t&&n!==t||(this.currentShader=n)}return this.emit(o.REBIND,this.currentShader),this.onActive(this.currentShader),this.onRebind(),this.glReset=!1,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,u,c,d,p,f,m,g,v,y,x){void 0===x&&(x=this.currentUnit);var w=!1;return this.shouldFlush(6)&&(this.flush(),w=!0,x=this.setTexture2D(y)),this.batchVert(e,i,l,u,x,v,p),this.batchVert(n,r,l,d,x,v,m),this.batchVert(s,o,c,d,x,v,g),this.batchVert(e,i,l,u,x,v,p),this.batchVert(s,o,c,d,x,v,g),this.batchVert(a,h,c,u,x,v,f),this.onBatch(t),w},batchTri:function(t,e,i,n,r,s,o,a,h,l,u,c,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,c),this.batchVert(n,r,a,u,g,f,d),this.batchVert(s,o,l,u,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),u=this.setTexture2D(o),d=c.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,u)},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<e.length;t++)e[t].destroy();var i=this.renderTargets;for(t=0;t<i.length;t++)i[t].destroy();this.gl.deleteBuffer(this.vertexBuffer);var n=this.renderer;return n.off(l.RESIZE,this.resize,this),n.off(l.PRE_RENDER,this.onPreRender,this),n.off(l.RENDER,this.onRender,this),n.off(l.POST_RENDER,this.onPostRender,this),this.removeAllListeners(),this.game=null,this.renderer=null,this.manager=null,this.gl=null,this.view=null,this.shaders=null,this.renderTargets=null,this.bytes=null,this.vertexViewF32=null,this.vertexViewU32=null,this.vertexData=null,this.vertexBuffer=null,this.currentShader=null,this.currentRenderTarget=null,this}});t.exports=p},function(t,e,i){"use strict";function n(t,e,i){i=i||2;var n,a,h,l,u,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,u,p=[];for(o=0,a=e.length;o<a;o++)h=e[o]*n,l=o<a-1?e[o+1]*n:t.length,(u=r(t,h,l,n,!1))===u.next&&(u.steiner=!0),p.push(m(u));for(p.sort(c),o=0;o<p.length;o++)d(p[o],i),i=s(i,i.next);return i}(t,e,y,i)),t.length>80*i){n=h=t[0],a=l=t[1];for(var w=i;w<v;w+=i)(u=t[w])<n&&(n=u),(p=t[w+1])<a&&(a=p),u>h&&(h=u),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<i;s+=n)o=E(s,t[s],t[s+1],o);else for(s=i-n;s>=e;s-=n)o=E(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,c,d){if(t){!d&&c&&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;e<l&&(a++,n=n.nextZ);e++);for(h=l;a>0||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,c);for(var p,m,g=t;t.prev!==t.next;)if(p=t.prev,m=t.next,c?h(t,n,r,c):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,c,2):2===d&&u(t,e,i,n,r,c):o(s(t),e,i,n,r,c,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.x<s.x?r.x<o.x?r.x:o.x:s.x<o.x?s.x:o.x,h=r.y<s.y?r.y<o.y?r.y:o.y:s.y<o.y?s.y:o.y,l=r.x>s.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,u=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,c=f(a,h,e,i,n),d=f(l,u,e,i,n),p=t.prevZ,m=t.nextZ;p&&p.z>=c&&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>=c;){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)&&w(r,n,n.next,o)&&T(r,o)&&T(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 u(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 u=S(h,l);return h=s(h,h.next),u=s(u,u.next),o(h,e,i,n,r,a),void o(u,e,i,n,r,a)}l=l.next}h=h.next}while(h!==t)}function c(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.next.x?n:n.next}}n=n.next}while(n!==e);if(!i)return null;if(r===o)return i;var h,l=i,u=i.x,c=i.y,d=1/0;n=i;do{r>=n.x&&n.x>=u&&r!==n.x&&g(s<c?r:o,s,u,c,s<c?o:r,s,n.x,n.y)&&(h=Math.abs(s-n.y)/(r-n.x),T(n,t)&&(h<d||h===d&&(n.x>i.x||n.x===i.x&&p(i,n)))&&(i=n,d=h)),n=n.next}while(n!==l);return i}(t,e)){var i=S(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<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function g(t,e,i,n,r,s,o,a){return(r-o)*(e-a)-(t-o)*(s-a)>=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&&w(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(T(t,e)&&T(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 w(t,e,i,n){var r=A(y(t,e,i)),s=A(y(t,e,n)),o=A(y(i,n,t)),a=A(y(i,n,e));return r!==s&&o!==a||!(0!==r||!b(t,i,e))||!(0!==s||!b(t,n,e))||!(0!==o||!b(i,t,n))||!(0!==a||!b(i,e,n))}function b(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 A(t){return t>0?1:t<0?-1:0}function T(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 S(t,e){var i=new _(t.i,t.x,t.y),n=new _(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 E(t,e,i,n){var r=new _(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 _(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;s<i;s+=n)r+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return r}n.deviation=function(t,e,i,n){var r=e&&e.length,s=r?e[0]*i:t.length,o=Math.abs(C(t,0,s,i));if(r)for(var a=0,h=e.length;a<h;a++){var l=e[a]*i,u=a<h-1?e[a+1]*i:t.length;o-=Math.abs(C(t,l,u,i))}var c=0;for(a=0;a<n.length;a+=3){var d=n[a]*i,p=n[a+1]*i,f=n[a+2]*i;c+=Math.abs((t[d]-t[f])*(t[p+1]-t[d+1])-(t[d]-t[p])*(t[f+1]-t[d+1]))}return 0===o&&0===c?0:Math.abs((c-o)/o)},n.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},n=0,r=0;r<t.length;r++){for(var s=0;s<t[r].length;s++)for(var o=0;o<e;o++)i.vertices.push(t[r][s][o]);r>0&&(n+=t[r-1].length,i.holes.push(n))}return i},t.exports=n},function(t,e){t.exports=function(t,e,i,n){var r=i||e.strokeColor,s=n||e.strokeAlpha,o=(16711680&r)>>>16,a=(65280&r)>>>8,h=255&r;t.strokeStyle="rgba("+o+","+a+","+h+","+s+")",t.lineWidth=e.lineWidth}},function(t,e,i){var n=i(0),r=i(21),s=i(23),o=i(8),a=i(2),h=i(6),l=i(7),u=new n({Extends:s,initialize:function(t,e,i,n,o){var u="json";if(l(e)){var c=e;e=a(c,"key"),i=a(c,"url"),n=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"dataKey",o)}var d={type:"json",cache:t.cacheManager.json,extension:u,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;try{var t=JSON.parse(this.xhrLoader.responseText)}catch(t){throw this.onProcessError(),t}var 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<t.length;r++)this.addFile(new u(this,t[r]));else this.addFile(new u(this,t,e,n,i));return this})),t.exports=u},function(t,e){t.exports={DYNAMIC_BODY:0,STATIC_BODY:1,GROUP:2,TILEMAPLAYER:3,FACING_NONE:10,FACING_UP:11,FACING_DOWN:12,FACING_LEFT:13,FACING_RIGHT:14}},function(t,e,i){var n=i(158),r=i(26);t.exports=function(t,e,i,s,o){for(var a=null,h=null,l=null,u=null,c=r(t,e,i,s,null,o),d=0;d<c.length;d++){var p=c[d];p&&(p.collides?(a=n(p.x,p.y-1,!0,o),h=n(p.x,p.y+1,!0,o),l=n(p.x-1,p.y,!0,o),u=n(p.x+1,p.y,!0,o),p.faceTop=!a||!a.collides,p.faceBottom=!h||!h.collides,p.faceLeft=!l||!l.collides,p.faceRight=!u||!u.collides):p.resetFaces())}}},function(t,e,i){var n={};t.exports=n;var r=i(83),s=i(32);n.create=function(t,e){for(var i=[],n=0;n<t.length;n++){var r=t[n],s={x:r.x,y:r.y,index:n,body:e,isInternal:!1,contact:null,offset:null};s.contact={vertex:s,normalImpulse:0,tangentImpulse:0},i.push(s)}return i},n.fromPath=function(t,e){var i=[];return t.replace(/L?\s*([-\d.e]+)[\s,]*([-\d.e]+)*/gi,(function(t,e,n){i.push({x:parseFloat(e),y:parseFloat(n)})})),n.create(i,e)},n.centre=function(t){for(var e,i,s,o=n.area(t,!0),a={x:0,y:0},h=0;h<t.length;h++)s=(h+1)%t.length,e=r.cross(t[h],t[s]),i=r.mult(r.add(t[h],t[s]),e),a=r.add(a,i);return r.div(a,6*o)},n.mean=function(t){for(var e={x:0,y:0},i=0;i<t.length;i++)e.x+=t[i].x,e.y+=t[i].y;return r.div(e,t.length)},n.area=function(t,e){for(var i=0,n=t.length-1,r=0;r<t.length;r++)i+=(t[n].x-t[r].x)*(t[n].y+t[r].y),n=r;return e?i/2:Math.abs(i)/2},n.inertia=function(t,e){for(var i,n,s=0,o=0,a=t,h=0;h<a.length;h++)n=(h+1)%a.length,s+=(i=Math.abs(r.cross(a[n],a[h])))*(r.dot(a[n],a[n])+r.dot(a[n],a[h])+r.dot(a[h],a[h])),o+=i;return e/6*(s/o)},n.translate=function(t,e,i){var n;if(i)for(n=0;n<t.length;n++)t[n].x+=e.x*i,t[n].y+=e.y*i;else for(n=0;n<t.length;n++)t[n].x+=e.x,t[n].y+=e.y;return t},n.rotate=function(t,e,i){if(0!==e){for(var n=Math.cos(e),r=Math.sin(e),s=0;s<t.length;s++){var o=t[s],a=o.x-i.x,h=o.y-i.y;o.x=i.x+(a*n-h*r),o.y=i.y+(a*r+h*n)}return t}},n.contains=function(t,e){for(var i=0;i<t.length;i++){var n=t[i],r=t[(i+1)%t.length];if((e.x-n.x)*(r.y-n.y)+(e.y-n.y)*(n.x-r.x)>0)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<t.length;h++)o=t[h],a=r.sub(o,s),t[h].x=s.x+a.x*e,t[h].y=s.y+a.y*i;return t},n.chamfer=function(t,e,i,n,o){e="number"==typeof e?[e]:e||[8],i=void 0!==i?i:-1,n=n||2,o=o||14;for(var a=[],h=0;h<t.length;h++){var l=t[h-1>=0?h-1:t.length-1],u=t[h],c=t[(h+1)%t.length],d=e[h<e.length?h:e.length-1];if(0!==d){var p=r.normalise({x:u.y-l.y,y:l.x-u.x}),f=r.normalise({x:c.y-u.y,y:u.x-c.x}),m=Math.sqrt(2*Math.pow(d,2)),g=r.mult(s.clone(p),d),v=r.normalise(r.mult(r.add(p,f),.5)),y=r.sub(u,r.mult(v,m)),x=i;-1===i&&(x=1.75*Math.pow(d,.32)),(x=s.clamp(x,n,o))%2==1&&(x+=1);for(var w=Math.acos(r.dot(p,f))/x,b=0;b<x;b++)a.push(r.add(r.rotate(g,w*b),y))}else a.push(u)}return a},n.clockwiseSort=function(t){var e=n.mean(t);return t.sort((function(t,i){return r.angle(e,t)-r.angle(e,i)})),t},n.isConvex=function(t){var e,i,n,r,s=0,o=t.length;if(o<3)return null;for(e=0;e<o;e++)if(n=(e+2)%o,r=(t[i=(e+1)%o].x-t[e].x)*(t[n].y-t[i].y),(r-=(t[i].y-t[e].y)*(t[n].x-t[i].x))<0?s|=1:r>0&&(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<t.length;i+=1){for(e=t[i];s.length>=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){var n=i(0),r=i(66),s=i(300),o=i(301),a=i(56),h=i(170),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=function(t,e,i){var n=i-e;return e+((t-e)%n+n)%n}},function(t,e,i){var n=i(0),r=i(39),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,u,c,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]=u,g[11]=c,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],u=t[9],c=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,w=i*a-n*o,b=i*h-r*o,A=n*h-r*a,T=l*f-u*p,S=l*m-c*p,E=l*g-d*p,M=u*m-c*f,_=u*g-d*f,C=c*g-d*m,P=v*C-y*_+x*M+w*E-b*S+A*T;return P?(P=1/P,this.setValues((o*C-a*_+h*M)*P,(n*_-i*C-r*M)*P,(f*A-m*b+g*w)*P,(c*b-u*A-d*w)*P,(a*E-s*C-h*S)*P,(e*C-n*E+r*S)*P,(m*x-p*A-g*y)*P,(l*A-c*x+d*y)*P,(s*_-o*E+h*T)*P,(i*E-e*_-r*T)*P,(p*b-f*x+g*v)*P,(u*x-l*b-d*v)*P,(o*S-s*M-a*T)*P,(e*M-i*S+n*T)*P,(f*y-p*w-m*v)*P,(l*w-u*y+c*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],u=t[9],c=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15];return this.setValues(o*(c*g-d*m)-u*(a*g-h*m)+f*(a*d-h*c),-(i*(c*g-d*m)-u*(n*g-r*m)+f*(n*d-r*c)),i*(a*g-h*m)-o*(n*g-r*m)+f*(n*h-r*a),-(i*(a*d-h*c)-o*(n*d-r*c)+u*(n*h-r*a)),-(s*(c*g-d*m)-l*(a*g-h*m)+p*(a*d-h*c)),e*(c*g-d*m)-l*(n*g-r*m)+p*(n*d-r*c),-(e*(a*g-h*m)-s*(n*g-r*m)+p*(n*h-r*a)),e*(a*d-h*c)-s*(n*d-r*c)+l*(n*h-r*a),s*(u*g-d*f)-l*(o*g-h*f)+p*(o*d-h*u),-(e*(u*g-d*f)-l*(i*g-r*f)+p*(i*d-r*u)),e*(o*g-h*f)-s*(i*g-r*f)+p*(i*h-r*o),-(e*(o*d-h*u)-s*(i*d-r*u)+l*(i*h-r*o)),-(s*(u*m-c*f)-l*(o*m-a*f)+p*(o*c-a*u)),e*(u*m-c*f)-l*(i*m-n*f)+p*(i*c-n*u),-(e*(o*m-a*f)-s*(i*m-n*f)+p*(i*a-n*o)),e*(o*c-a*u)-s*(i*c-n*u)+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],u=t[9],c=t[10],d=t[11],p=t[12],f=t[13],m=t[14],g=t[15];return(e*o-i*s)*(c*g-d*m)-(e*a-n*s)*(u*g-d*f)+(e*h-r*s)*(u*m-c*f)+(i*a-n*o)*(l*g-d*p)-(i*h-r*o)*(l*m-c*p)+(n*h-r*a)*(l*f-u*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],u=e[8],c=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],w=y[1],b=y[2],A=y[3];return e[0]=x*i+w*o+b*u+A*f,e[1]=x*n+w*a+b*c+A*m,e[2]=x*r+w*h+b*d+A*g,e[3]=x*s+w*l+b*p+A*v,x=y[4],w=y[5],b=y[6],A=y[7],e[4]=x*i+w*o+b*u+A*f,e[5]=x*n+w*a+b*c+A*m,e[6]=x*r+w*h+b*d+A*g,e[7]=x*s+w*l+b*p+A*v,x=y[8],w=y[9],b=y[10],A=y[11],e[8]=x*i+w*o+b*u+A*f,e[9]=x*n+w*a+b*c+A*m,e[10]=x*r+w*h+b*d+A*g,e[11]=x*s+w*l+b*p+A*v,x=y[12],w=y[13],b=y[14],A=y[15],e[12]=x*i+w*o+b*u+A*f,e[13]=x*n+w*a+b*c+A*m,e[14]=x*r+w*h+b*d+A*g,e[15]=x*s+w*l+b*p+A*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],u=i[9],c=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],w=n[0],b=n[4],A=n[8],T=n[12],S=n[1],E=n[5],M=n[9],_=n[13],C=n[2],P=n[6],R=n[10],L=n[14],O=n[3],D=n[7],B=n[11],I=n[15];return this.setValues(r*w+s*S+o*C+a*O,h*w+l*S+u*C+c*O,d*w+p*S+f*C+m*O,g*w+v*S+y*C+x*O,r*b+s*E+o*P+a*D,h*b+l*E+u*P+c*D,d*b+p*E+f*P+m*D,g*b+v*E+y*P+x*D,r*A+s*M+o*R+a*B,h*A+l*M+u*R+c*B,d*A+p*M+f*R+m*B,g*A+v*M+y*R+x*B,r*T+s*_+o*L+a*I,h*T+l*_+u*L+c*I,d*T+p*_+f*L+m*I,g*T+v*_+y*L+x*I)},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,u=i[0],c=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],w=i[10],b=i[11],A=i[12],T=i[13],S=i[14],E=i[15],M=n*n*l+h,_=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,B=s*s*l+h;return this.setValues(u*M+f*_+y*C,c*M+m*_+x*C,d*M+g*_+w*C,p*M+v*_+b*C,u*P+f*R+y*L,c*P+m*R+x*L,d*P+g*R+w*L,p*P+v*R+b*L,u*O+f*D+y*B,c*O+m*D+x*B,d*O+g*D+w*B,p*O+v*D+b*B,A,T,S,E)},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],u=e[10],c=e[11];return e[4]=r*n+h*i,e[5]=s*n+l*i,e[6]=o*n+u*i,e[7]=a*n+c*i,e[8]=h*n-r*i,e[9]=l*n-s*i,e[10]=u*n-o*i,e[11]=c*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],u=e[10],c=e[11];return e[0]=r*n-h*i,e[1]=s*n-l*i,e[2]=o*n-u*i,e[3]=a*n-c*i,e[8]=r*i+h*n,e[9]=s*i+l*n,e[10]=o*i+u*n,e[11]=a*i+c*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],u=e[6],c=e[7];return e[0]=r*n+h*i,e[1]=s*n+l*i,e[2]=o*n+u*i,e[3]=a*n+c*i,e[4]=h*n-r*i,e[5]=l*n-s*i,e[6]=u*n-o*i,e[7]=c*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,u=i*a,c=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),u+v,c-g,0,u-v,1-(l+f),p+m,0,c+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,u=e*a,c=i*o,d=i*a,p=n*a,f=r*s,m=r*o,g=r*a;return this.setValues(1-(c+p),l+g,u-m,0,l-g,1-(h+p),d+f,0,u+m,d-f,1-(h+c),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 u.subVectors(t,e),0===u.getLengthSquared()&&(u.z=1),u.normalize(),h.crossVectors(i,u),0===h.getLengthSquared()&&(1===Math.abs(i.z)?u.x+=1e-4:u.z+=1e-4,u.normalize(),h.crossVectors(i,u)),h.normalize(),l.crossVectors(u,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]=u.x,n[9]=u.y,n[10]=u.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,u=e.y,c=e.z;if(Math.abs(n-l)<1e-6&&Math.abs(r-u)<1e-6&&Math.abs(s-c)<1e-6)return this.identity();var d=n-l,p=r-u,f=s-c,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,w=f*g-d*y,b=d*v-p*g;return(m=Math.sqrt(x*x+w*w+b*b))?(x*=m=1/m,w*=m,b*=m):(x=0,w=0,b=0),this.setValues(g,x,d,0,v,w,p,0,y,b,f,0,-(g*n+v*r+y*s),-(x*n+w*r+b*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],u=i[6],c=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],w=n[0],b=n[1],A=n[2],T=n[3],S=n[4],E=n[5],M=n[6],_=n[7],C=n[8],P=n[9],R=n[10],L=n[11],O=n[12],D=n[13],B=n[14],I=n[15];return e.setValues(w*r+b*h+A*d+T*g,b*s+b*l+A*p+T*v,A*o+b*u+A*f+T*y,T*a+b*c+A*m+T*x,S*r+E*h+M*d+_*g,S*s+E*l+M*p+_*v,S*o+E*u+M*f+_*y,S*a+E*c+M*m+_*x,C*r+P*h+R*d+L*g,C*s+P*l+R*p+L*v,C*o+P*u+R*f+L*y,C*a+P*c+R*m+L*x,O*r+D*h+B*d+I*g,O*s+D*l+B*p+I*v,O*o+D*u+B*f+I*y,O*a+D*c+B*m+I*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),u=n,c=r,d=s,p=-o,f=0-p*h,m=0-a*h,g=p*l,v=a*l;return i||(u=l*n+h*s,c=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,u,c,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,u=new r;t.exports=s},function(t,e,i){t.exports={COMPLETE:i(987),DECODED:i(988),DECODED_ALL:i(989),DESTROY:i(990),DETUNE:i(991),GLOBAL_DETUNE:i(992),GLOBAL_MUTE:i(993),GLOBAL_RATE:i(994),GLOBAL_VOLUME:i(995),LOOP:i(996),LOOPED:i(997),MUTE:i(998),PAN:i(999),PAUSE_ALL:i(1e3),PAUSE:i(1001),PLAY:i(1002),RATE:i(1003),RESUME_ALL:i(1004),RESUME:i(1005),SEEK:i(1006),STOP_ALL:i(1007),STOP:i(1008),UNLOCKED:i(1009),VOLUME:i(1010)}},function(t,e,i){var n=i(0),r=i(21),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,u="png";if(h(i)){var c=i;i=a(c,"key"),n=a(c,"url"),l=a(c,"normalMap"),r=a(c,"xhrSettings"),u=a(c,"extension",u),o=a(c,"frameConfig")}Array.isArray(n)&&(l=n[1],n=n[0]);var d={type:"image",cache:e.textureManager,extension:u,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;n<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,i));return this})),t.exports=l},function(t,e){t.exports=function(t,e){e?t.setCollision(!0,!0,!0,!0,!1):t.resetCollision(!1)}},function(t,e,i){var n=i(164),r=i(0),s=i(11),o=i(15),a=i(1065),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<i;r++)t[r]=t[r+1];return t.length=i,n}}},function(t,e,i){t.exports={ADDED_TO_SCENE:i(643),DESTROY:i(644),REMOVED_FROM_SCENE:i(645),VIDEO_COMPLETE:i(646),VIDEO_CREATED:i(647),VIDEO_ERROR:i(648),VIDEO_LOOP:i(649),VIDEO_PLAY:i(650),VIDEO_SEEKED:i(651),VIDEO_SEEKING:i(652),VIDEO_STOP:i(653),VIDEO_TIMEOUT:i(654),VIDEO_UNLOCKED:i(655)}},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){function i(t,e){return String(t).localeCompare(e)}function n(t,e,i,n){var r,s,o,a,h,l=t.length,u=0,c=2*i;for(r=0;r<l;r+=c)for(o=(s=r+i)+i,s>l&&(s=l),o>l&&(o=l),a=r,h=s;;)if(a<s&&h<o)e(t[a],t[h])<=0?n[u++]=t[a++]:n[u++]=t[h++];else if(a<s)n[u++]=t[a++];else{if(!(h<o))break;n[u++]=t[h++]}}t.exports=function(t,e){void 0===e&&(e=i);var r=function(t,e){var i=t.length;if(i<=1)return t;for(var r=new Array(i),s=1;s<i;s*=2){n(t,e,s,r);var o=t;t=r,r=o}return t}(t,e);return r!==t&&n(r,null,t.length,t),t}},function(t,e,i){var n=i(134),r=i(205);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){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,u=e.lineWidth,c=u/2,d=h[0]-r,p=h[1]-s;e.closePath||(l-=2);for(var f=2;f<l;f+=2){var m=h[f]-r,g=h[f+1]-s;t.batchLine(d,p,m,g,c,c,u,f-2,!!e.closePath&&f===l-1),d=m,p=g}}},function(t,e,i){var n=i(0),r=i(115),s=i(476),o=i(477),a=i(56),h=i(47),l=i(181),u=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=u},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;n<e.length;n++){var r=e[n];r.x>t.max.x&&(t.max.x=r.x),r.x<t.min.x&&(t.min.x=r.x),r.y>t.max.y&&(t.max.y=r.y),r.y<t.min.y&&(t.min.y=r.y)}i&&(i.x>0?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,i){var n=i(29),r=i(0),s=i(11),o=i(502),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!(t<this.pixelX||e<this.pixelY||t>this.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,i){var n={};t.exports=n;var r=i(64),s=i(32),o=i(41),a=i(84),h=i(83),l=i(1393);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,u=i*(a*=.5),c=u+(1-2*a)*i,d=c+u;l=a<.5?"L 0 0 L "+u+" "+-n+" L "+c+" "+-n+" L "+d+" 0":"L 0 0 L "+c+" "+-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,u="",c=.5*l,d=0;d<i;d+=1){var p=c+d*l,f=Math.cos(p)*a,m=Math.sin(p)*a;u+="L "+f.toFixed(3)+" "+m.toFixed(3)+" "}var g={label:"Polygon Body",position:{x:t,y:e},vertices:r.fromPath(u)};if(h.chamfer){var v=h.chamfer;g.vertices=r.chamfer(g.vertices,v.radius,v.quality,v.qualityMin,v.qualityMax),delete h.chamfer}return o.create(s.extend({},g,h))},n.fromVertices=function(t,e,i,a,h,u,c){var d,p,f,m,g,v;for(a=a||{},p=[],h=void 0!==h&&h,u=void 0!==u?u:.01,c=void 0!==c?c:10,l||s.warn("Bodies.fromVertices: poly-decomp.js required. Could not decompose vertices. Fallback to convex hull."),s.isArray(i[0])||(i=[i]),v=0;v<i.length;v+=1)if(m=i[v],(f=r.isConvex(m))||!l)m=f?r.clockwiseSort(m):r.hull(m),p.push({position:{x:t,y:e},vertices:m});else{var y=m.map((function(t){return[t.x,t.y]}));l.makeCCW(y),!1!==u&&l.removeCollinearPoints(y,u);var x=l.quickDecomp(y);for(g=0;g<x.length;g++){var w=x[g].map((function(t){return{x:t[0],y:t[1]}}));c>0&&r.area(w)<c||p.push({position:r.centre(w),vertices:w})}}for(g=0;g<p.length;g++)p[g]=o.create(s.extend(p[g],a));return h&&n.flagCoincidentParts(p,5),p.length>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<t.length;i++)for(var n=t[i],r=i+1;r<t.length;r++){var s=t[r];if(a.overlaps(n.bounds,s.bounds))for(var o=n.vertices,l=s.vertices,u=0;u<n.vertices.length;u++)for(var c=0;c<s.vertices.length;c++){var d=h.magnitudeSquared(h.sub(o[(u+1)%o.length],l[c])),p=h.magnitudeSquared(h.sub(o[u],l[(c+1)%l.length]));d<e&&p<e&&(o[u].isInternal=!0,l[c].isInternal=!0)}}return t}},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){t.exports={POST_RENDER:i(628),PRE_RENDER:i(629),RENDER:i(630),RESIZE:i(631)}},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,i){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){var n=i(0),r=i(199),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 u=r[s];return(s+(n-u)/(r[s+1]-u))/(o-1)},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()}});t.exports=a},function(t,e,i){t.exports={ADD:i(968),COMPLETE:i(969),FILE_COMPLETE:i(970),FILE_KEY_COMPLETE:i(971),FILE_LOAD_ERROR:i(972),FILE_LOAD:i(973),FILE_PROGRESS:i(974),POST_PROCESS:i(975),PROGRESS:i(976),START:i(977)}},function(t,e,i){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,u=e.x2,c=e.y2,d=(c-l)*(o-r)-(u-h)*(a-s);if(0===d)return!1;var p=((u-h)*(s-l)-(c-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=i(18);t.exports=function(t,e,i){return(i-e)*(t=n(t,0,1))+e}},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){var n=i(0),r=i(315),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<t.length;n++)i.push(e[t[n]]);return i}return e[t]},getAll:function(){var t={};for(var e in this.list)this.list.hasOwnProperty(e)&&(t[e]=this.list[e]);return t},query:function(t){var e={};for(var i in this.list)this.list.hasOwnProperty(i)&&i.match(t)&&(e[i]=this.list[i]);return e},set:function(t,e){if(this._frozen)return this;if("string"==typeof t)return this.setValue(t,e);for(var i in t)this.setValue(i,t[i]);return this},inc:function(t,e){if(this._frozen)return this;void 0===e&&(e=1);var i=this.get(t);return void 0===i&&(i=0),this.set(t,i+e),this},toggle:function(t){return this._frozen||this.set(t,!this.get(t)),this},setValue:function(t,e){if(this._frozen)return this;if(this.has(t))this.values[t]=e;else{var i=this,n=this.list,s=this.events,o=this.parent;Object.defineProperty(this.values,t,{enumerable:!0,configurable:!0,get:function(){return n[t]},set:function(e){if(!i._frozen){var a=n[t];n[t]=e,s.emit(r.CHANGE_DATA,o,t,e,a),s.emit(r.CHANGE_DATA_KEY+t,o,e,a)}}}),n[t]=e,s.emit(r.SET_DATA,o,t,e)}return this},each:function(t,e){for(var i=[this.parent,null,void 0],n=1;n<arguments.length;n++)i.push(arguments[n]);for(var r in this.list)i[1]=r,i[2]=this.list[r],t.apply(e,i);return this},merge:function(t,e){for(var i in void 0===e&&(e=!0),t)t.hasOwnProperty(i)&&(e||!e&&!this.has(i))&&this.setValue(i,t[i]);return this},remove:function(t){if(this._frozen)return this;if(!Array.isArray(t))return this.removeValue(t);for(var e=0;e<t.length;e++)this.removeValue(t[e]);return this},removeValue:function(t){if(this.has(t)){var e=this.list[t];delete this.list[t],delete this.values[t],this.events.emit(r.REMOVE_DATA,this.parent,t,e)}return this},pop:function(t){var e=void 0;return!this._frozen&&this.has(t)&&(e=this.list[t],delete this.list[t],delete this.values[t],this.events.emit(r.REMOVE_DATA,this.parent,t,e)),e},has:function(t){return this.list.hasOwnProperty(t)},setFreeze:function(t){return this._frozen=t,this},reset:function(){for(var t in this.list)delete this.list[t],delete this.values[t];return this._frozen=!1,this},destroy:function(){this.reset(),this.events.off(r.CHANGE_DATA),this.events.off(r.SET_DATA),this.events.off(r.REMOVE_DATA),this.parent=null},freeze:{get:function(){return this._frozen},set:function(t){this._frozen=!!t}},count:{get:function(){var t=0;for(var e in this.list)void 0!==this.list[e]&&t++;return t}}});t.exports=s},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries={},this.size=0,Array.isArray(t))for(var e=0;e<t.length;e++)this.set(t[e][0],t[e][1])},set:function(t,e){return this.has(t)||this.size++,this.entries[t]=e,this},get:function(t){if(this.has(t))return this.entries[t]},getArray:function(){var t=[],e=this.entries;for(var i in e)t.push(e[i]);return t},has:function(t){return this.entries.hasOwnProperty(t)},delete:function(t){return this.has(t)&&(delete this.entries[t],this.size--),this},clear:function(){return Object.keys(this.entries).forEach((function(t){delete this.entries[t]}),this),this.size=0,this},keys:function(){return Object.keys(this.entries)},values:function(){var t=[],e=this.entries;for(var i in e)t.push(e[i]);return t},dump:function(){var t=this.entries;for(var e in t);},each:function(t){var e=this.entries;for(var i in e)if(!1===t(i,e[i]))break;return this},contains:function(t){var e=this.entries;for(var i in e)if(e[i]===t)return!0;return!1},merge:function(t,e){void 0===e&&(e=!1);var i=this.entries,n=t.entries;for(var r in n)i.hasOwnProperty(r)&&e?i[r]=n[r]:this.set(r,n[r]);return this}});t.exports=n},function(t,e){t.exports=function(t,e,i){return t<<16|e<<8|i}},function(t,e,i){t.exports={ENTER_FULLSCREEN:i(800),FULLSCREEN_FAILED:i(801),FULLSCREEN_UNSUPPORTED:i(802),LEAVE_FULLSCREEN:i(803),ORIENTATION_CHANGE:i(804),RESIZE:i(805)}},function(t,e,i){(function(e){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(){if("function"==typeof importScripts)return i;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),"function"!=typeof importScripts&&(void 0!==window.cordova&&(i.cordova=!0),void 0!==window.ejecta&&(i.ejecta=!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),/Crosswalk/.test(t)&&(i.crosswalk=!0),i.pixelRatio=window.devicePixelRatio||1,i}()}).call(this,i(807))},function(t,e,i){t.exports={ADD:i(861),ERROR:i(862),LOAD:i(863),READY:i(864),REMOVE:i(865)}},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){var n=i(0),r=i(59),s=i(2),o=i(878),a=i(879),h=i(25),l=i(12),u=i(107),c=i(58),d=new n({Extends:c,initialize:function(t){var e=t.game.renderer,i=s(t,"fragShader",o);t.fragShader=l.parseFragmentShaderMaxTextures(i,e.maxTextures),t.vertShader=s(t,"vertShader",a),t.attributes=s(t,"attributes",[{name:"inPosition",size:2},{name:"inTexCoord",size:2},{name:"inTexId"},{name:"inTintEffect"},{name:"inTint",size:4,type:u.UNSIGNED_BYTE,normalized:!0}]),c.call(this,t),this._tempMatrix1=new h,this._tempMatrix2=new h,this._tempMatrix3=new h,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=[]},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,h=o.u0,u=o.v0,c=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,w=-y+p,b=-x+f;if(t.isCropped){var A=t._crop;A.flipX===t.flipX&&A.flipY===t.flipY||o.updateCropUVs(A,t.flipX,t.flipY),h=A.u0,u=A.v0,c=A.u1,d=A.v1,m=A.width,g=A.height,w=-y+(p=A.x),b=-x+(f=A.y)}var T=1,S=1;t.flipX&&(v||(w+=-o.realWidth+2*y),T=-1),(t.flipY||o.source.isGLTexture&&!a.flipY)&&(v||(b+=-o.realHeight+2*x),S=-1),r.applyITRS(t.x,t.y,t.rotation,t.scaleX*T,t.scaleY*S),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 E=w+m,M=b+g,_=e.roundPixels,C=s.getXRound(w,b,_),P=s.getYRound(w,b,_),R=s.getXRound(w,M,_),L=s.getYRound(w,M,_),O=s.getXRound(E,M,_),D=s.getYRound(E,M,_),B=s.getXRound(E,b,_),I=s.getYRound(E,b,_),F=l.getTintAppendFloatAlpha,k=e.alpha,N=F(t.tintTopLeft,k*t._alphaTL),z=F(t.tintTopRight,k*t._alphaTR),U=F(t.tintBottomLeft,k*t._alphaBL),V=F(t.tintBottomRight,k*t._alphaBR);this.shouldFlush(6)&&this.flush();var H=this.setGameObject(t,o);this.manager.preBatch(t),this.batchQuad(t,C,P,R,L,O,D,B,I,h,u,c,d,N,z,U,V,t.tintFill,a,H),this.manager.postBatch(t)},batchTexture:function(t,e,i,n,r,s,o,a,h,l,u,c,d,p,f,m,g,v,y,x,w,b,A,T,S,E,M,_,C,P,R,L){this.manager.set(this,t);var O=this._tempMatrix1,D=this._tempMatrix2,B=this._tempMatrix3,I=v/i+M,F=y/n+_,k=(v+x)/i+M,N=(y+w)/n+_,z=o,U=a,V=-m,H=-g;if(t.isCropped){var G=t._crop,W=G.width,Y=G.height;z=W,U=Y,o=W,a=Y;var X=v=G.x,j=y=G.y;c&&(X=x-G.x-W),d&&(j=w-G.y-Y),I=X/i+M,F=j/n+_,k=(X+W)/i+M,N=(j+Y)/n+_,V=-m+v,H=-g+y}c&&(z*=-1,V+=o),(d^=!R&&e.isRenderTexture?1:0)&&(U*=-1,H+=a);var q=V+z,Q=H+U;D.applyITRS(r,s,u,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,B);var K=C.roundPixels,J=B.getXRound(V,H,K),Z=B.getYRound(V,H,K),$=B.getXRound(V,Q,K),tt=B.getYRound(V,Q,K),et=B.getXRound(q,Q,K),it=B.getYRound(q,Q,K),nt=B.getXRound(q,H,K),rt=B.getYRound(q,H,K);void 0===L&&(L=this.renderer.setTexture2D(e)),t&&this.manager.preBatch(t),this.batchQuad(t,J,Z,$,tt,et,it,nt,rt,I,F,k,N,b,A,T,S,E,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),h=this._tempMatrix2,u=e+t.width,c=i+t.height;o?a.multiply(o,h):h=a;var d=h.getX(e,i),p=h.getY(e,i),f=h.getX(e,c),m=h.getY(e,c),g=h.getX(u,c),v=h.getY(u,c),y=h.getX(u,i),x=h.getY(u,i),w=this.renderer.setTextureSource(t.source);n=l.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,w)},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),u=o.getY(t,e),c=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(null,l,u,c,d,p,f,m,g,0,0,1,1,v.TL,v.TR,v.BL,v.BR,2)},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),u=h.getY(t,e),c=h.getX(i,n),d=h.getY(i,n),p=h.getX(r,s),f=h.getY(r,s),m=this.fillTint;this.batchTri(null,l,u,c,d,p,f,0,0,1,1,m.TL,m.TR,m.BL,2)},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,u=this.fillTint.TR,c=this.fillTint.BL,d=0;d<a;++d)o=t[d],h.push(o.x,o.y);a=(s=r(h)).length;for(var p=0;p<a;p+=3){var f=2*s[p+0],m=2*s[p+1],g=2*s[p+2],v=h[f+0],y=h[f+1],x=h[m+0],w=h[m+1],b=h[g+0],A=h[g+1],T=n.getX(v,y),S=n.getY(v,y),E=n.getX(x,w),M=n.getY(x,w),_=n.getX(b,A),C=n.getY(b,A);this.batchTri(null,T,S,E,M,_,C,0,0,1,1,l,u,c,2)}h.length=0},batchStrokePath:function(t,e,i,n,r){this.renderer.pipelines.set(this),this.prevQuad[4]=0,this.firstQuad[4]=0;for(var s=t.length-1,o=0;o<s;o++){var a=t[o],h=t[o+1];this.batchLine(a.x,a.y,h.x,h.y,a.width/2,h.width/2,e,o,!i&&o===s-1,n,r)}},batchLine:function(t,e,i,n,r,s,o,a,h,l,u){this.renderer.pipelines.set(this);var c=this.calcMatrix;u&&u.multiply(l,c);var d=i-t,p=n-e,f=Math.sqrt(d*d+p*p),m=r*(n-e)/f,g=r*(t-i)/f,v=s*(n-e)/f,y=s*(t-i)/f,x=i-v,w=n-y,b=t-m,A=e-g,T=i+v,S=n+y,E=t+m,M=e+g,_=c.getX(x,w),C=c.getY(x,w),P=c.getX(b,A),R=c.getY(b,A),L=c.getX(T,S),O=c.getY(T,S),D=c.getX(E,M),B=c.getY(E,M),I=this.strokeTint,F=I.TL,k=I.TR,N=I.BL,z=I.BR;if(this.batchQuad(null,D,B,P,R,_,C,L,O,0,0,1,1,F,k,N,z,2),!(o<=2)){var U=this.prevQuad,V=this.firstQuad;a>0&&U[4]?this.batchQuad(null,D,B,P,R,U[0],U[1],U[2],U[3],0,0,1,1,F,k,N,z,2):(V[0]=D,V[1]=B,V[2]=P,V[3]=R,V[4]=1),h&&V[4]?this.batchQuad(null,_,C,L,O,V[0],V[1],V[2],V[3],0,0,1,1,F,k,N,z,2):(U[0]=_,U[1]=C,U[2]=L,U[3]=O,U[4]=1)}}});t.exports=d},function(t,e,i){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,u=this.cutWidth,c=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,w=e+(n=r(n,0,u-e)),b=i+(s=r(s,0,c-i));if(x.r<e||x.b<i||x.x>w||x.y>b)f=0,m=0,g=0,v=0;else{var A=Math.max(x.x,e),T=Math.max(x.y,i),S=Math.min(x.r,w)-A,E=Math.min(x.b,b)-T;g=S,v=E,f=o?h+(u-(A-x.x)-S):h+(A-x.x),m=a?l+(c-(T-x.y)-E):l+(T-x.y),e=A,i=T,n=S,s=E}}else o&&(f=h+(u-e-n)),a&&(m=l+(c-i-s));var M=this.source.width,_=this.source.height;return t.u0=Math.max(0,f/M),t.v0=Math.max(0,m/_),t.u1=Math.min(1,(f+g)/M),t.v1=Math.min(1,(m+v)/_),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){var n=i(208),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)},moveAbove:function(t,e){return n.MoveAbove(this.list,t,e)},moveBelow:function(t,e){return n.MoveBelow(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;n<arguments.length;n++)i.push(arguments[n]);for(n=0;n<this.list.length;n++)i[0]=this.list[n],t.apply(e,i)},shutdown:function(){this.removeAll(),this.list=[]},destroy:function(){this.removeAll(),this.parent=null,this.addCallback=null,this.removeCallback=null},length:{get:function(){return this.list.length}},first:{get:function(){return this.position=0,this.list.length>0?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.position<this.list.length?(this.position++,this.list[this.position]):null}},previous:{get:function(){return this.position>0?(this.position--,this.list[this.position]):null}}});t.exports=a},function(t,e,i){var n=i(0),r=i(112),s=i(445),o=i(446),a=i(56),h=i(180),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){var n=i(275),r=i(0),s=i(75),o=i(9),a=i(207),h=i(2),l=i(6),u=i(7),c=i(437),d=i(149),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)?u(e[0])&&(i=e,e=null):u(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),this.on(s.ADDED_TO_SCENE,this.addedToScene,this),this.on(s.REMOVED_FROM_SCENE,this.removedFromScene,this)},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 o.addToDisplayList(this.scene.sys.displayList),o.addToUpdateList(),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<t.length;i++){var n=this.createFromConfig(t[i]);e=e.concat(n)}return e},createFromConfig:function(t){if(this.isFull())return[];this.classType=h(t,"classType",this.classType);var e=h(t,"key",void 0),i=h(t,"frame",null),r=h(t,"visible",!0),s=h(t,"active",!0),o=[];if(void 0===e)return o;Array.isArray(e)||(e=[e]),Array.isArray(i)||(i=[i]);var a=h(t,"repeat",0),u=h(t,"randomKey",!1),d=h(t,"randomFrame",!1),p=h(t,"yoyo",!1),f=h(t,"quantity",!1),m=h(t,"frameQuantity",1),g=h(t,"max",0),v=c(e,i,{max:g,qty:f||m,random:u,randomB:d,repeat:a,yoyo:p});t.createCallback&&(this.createCallback=t.createCallback),t.removeCallback&&(this.removeCallback=t.removeCallback);for(var y=0;y<v.length;y++){var x=this.create(0,0,v[y].a,v[y].b,r,s);if(!x)break;o.push(x)}var w=l(t,"setXY.x",0),b=l(t,"setXY.y",0),A=l(t,"setXY.stepX",0),T=l(t,"setXY.stepY",0);n.SetXY(o,w,b,A,T);var S=l(t,"setRotation.value",0),E=l(t,"setRotation.step",0);n.SetRotation(o,S,E);var M=l(t,"setScale.x",1),_=l(t,"setScale.y",M),C=l(t,"setScale.stepX",0),P=l(t,"setScale.stepY",0);n.SetScale(o,M,_,C,P);var R=l(t,"setOrigin.x",.5),L=l(t,"setOrigin.y",R),O=l(t,"setOrigin.stepX",0),D=l(t,"setOrigin.stepY",0);n.SetOrigin(o,R,L,O,D);var B=l(t,"setAlpha.value",1),I=l(t,"setAlpha.step",0);n.SetAlpha(o,B,I);var F=l(t,"setDepth.value",0),k=l(t,"setDepth.step",0);n.SetDepth(o,F,k);var N=l(t,"setScrollFactor.x",1),z=l(t,"setScrollFactor.y",N),U=l(t,"setScrollFactor.stepX",0),V=l(t,"setScrollFactor.stepY",0);n.SetScrollFactor(o,N,z,U,V);var H=h(t,"hitArea",null),G=h(t,"hitAreaCallback",null);H&&n.SetHitArea(o,H,G);var W=h(t,"gridAlign",!1);return W&&n.GridAlign(o,W),this.createMultipleCallback&&this.createMultipleCallback.call(this,o),o},preUpdate:function(t,e){if(this.runChildUpdate&&0!==this.children.size)for(var i=this.children.entries.slice(),n=0;n<i.length;n++){var r=i[n];r.active&&r.update(t,e)}},add:function(t,e){return void 0===e&&(e=!1),this.isFull()||(this.children.set(t),this.internalCreateCallback&&this.internalCreateCallback.call(this,t),this.createCallback&&this.createCallback.call(this,t),e&&(t.addToDisplayList(this.scene.sys.displayList),t.addToUpdateList()),t.on(s.DESTROY,this.remove,this)),this},addMultiple:function(t,e){if(void 0===e&&(e=!1),Array.isArray(t))for(var i=0;i<t.length;i++)this.add(t[i],e);return this},remove:function(t,e,i){return void 0===e&&(e=!1),void 0===i&&(i=!1),this.children.contains(t)?(this.children.delete(t),this.internalRemoveCallback&&this.internalRemoveCallback.call(this,t),this.removeCallback&&this.removeCallback.call(this,t),t.off(s.DESTROY,this.remove,this),i?t.destroy():e&&(t.removeFromDisplayList(),t.removeFromUpdateList()),this):this},clear:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1);for(var i=this.children,n=0;n<i.size;n++){var r=i.entries[n];r.off(s.DESTROY,this.remove,this),e?r.destroy():t&&(r.removeFromDisplayList(),r.removeFromUpdateList())}return this.children.clear(),this},contains:function(t){return this.children.contains(t)},getChildren:function(){return this.children.entries},getLength:function(){return this.children.size},getMatching:function(t,e,i,n){return a(this.children.entries,t,e,i,n)},getFirst:function(t,e,i,n,r,s,o){return this.getHandler(!0,1,t,e,i,n,r,s,o)},getFirstNth:function(t,e,i,n,r,s,o,a){return this.getHandler(!0,t,e,i,n,r,s,o,a)},getLast:function(t,e,i,n,r,s,o){return this.getHandler(!1,1,t,e,i,n,r,s,o)},getLastNth:function(t,e,i,n,r,s,o,a){return this.getHandler(!1,t,e,i,n,r,s,o,a)},getHandler:function(t,e,i,n,r,s,o,a,h){var l,u;void 0===i&&(i=!1),void 0===n&&(n=!1);var c=0,d=this.children.entries;if(t)for(u=0;u<d.length;u++)if((l=d[u]).active===i){if(++c===e)break}else l=null;else for(u=d.length-1;u>=0;u--)if((l=d[u]).active===i){if(++c===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<this.children.size;i++)this.children.entries[i].active===t&&e++;return e},getTotalUsed:function(){return this.countActive()},getTotalFree:function(){var t=this.getTotalUsed();return(-1===this.maxSize?999999999999:this.maxSize)-t},setActive:function(t){return this.active=t,this},setName:function(t){return this.name=t,this},propertyValueSet:function(t,e,i,r,s){return n.PropertyValueSet(this.children.entries,t,e,i,r,s),this},propertyValueInc:function(t,e,i,r,s){return n.PropertyValueInc(this.children.entries,t,e,i,r,s),this},setX:function(t,e){return n.SetX(this.children.entries,t,e),this},setY:function(t,e){return n.SetY(this.children.entries,t,e),this},setXY:function(t,e,i,r){return n.SetXY(this.children.entries,t,e,i,r),this},incX:function(t,e){return n.IncX(this.children.entries,t,e),this},incY:function(t,e){return n.IncY(this.children.entries,t,e),this},incXY:function(t,e,i,r){return n.IncXY(this.children.entries,t,e,i,r),this},shiftPosition:function(t,e,i){return n.ShiftPosition(this.children.entries,t,e,i),this},angle:function(t,e){return n.Angle(this.children.entries,t,e),this},rotate:function(t,e){return n.Rotate(this.children.entries,t,e),this},rotateAround:function(t,e){return n.RotateAround(this.children.entries,t,e),this},rotateAroundDistance:function(t,e,i){return n.RotateAroundDistance(this.children.entries,t,e,i),this},setAlpha:function(t,e){return n.SetAlpha(this.children.entries,t,e),this},setTint:function(t,e,i,r){return n.SetTint(this.children.entries,t,e,i,r),this},setOrigin:function(t,e,i,r){return n.SetOrigin(this.children.entries,t,e,i,r),this},scaleX:function(t,e){return n.ScaleX(this.children.entries,t,e),this},scaleY:function(t,e){return n.ScaleY(this.children.entries,t,e),this},scaleXY:function(t,e,i,r){return n.ScaleXY(this.children.entries,t,e,i,r),this},setDepth:function(t,e){return n.SetDepth(this.children.entries,t,e),this},setBlendMode:function(t){return n.SetBlendMode(this.children.entries,t),this},setHitArea:function(t,e){return n.SetHitArea(this.children.entries,t,e),this},shuffle:function(){return n.Shuffle(this.children.entries),this},kill:function(t){this.children.contains(t)&&t.setActive(!1)},killAndHide:function(t){this.children.contains(t)&&(t.setActive(!1),t.setVisible(!1))},setVisible:function(t,e,i){return n.SetVisible(this.children.entries,t,e,i),this},toggleVisible:function(){return n.ToggleVisible(this.children.entries),this},destroy:function(t,e){void 0===t&&(t=!1),void 0===e&&(e=!1),this.scene&&!this.ignoreDestroy&&(this.emit(s.DESTROY,this),this.removeAllListeners(),this.scene.sys.updateList.remove(this),this.clear(e,t),this.scene=void 0,this.children=void 0)}});t.exports=f},function(t,e,i){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,u=0;u<l.length;u+=3){var c=2*l[u],d=2*l[u+1],p=2*l[u+2],f=h[c+0]-s,m=h[c+1]-o,g=h[d+0]-s,v=h[d+1]-o,y=h[p+0]-s,x=h[p+1]-o,w=e.getX(f,m),b=e.getY(f,m),A=e.getX(g,v),T=e.getY(g,v),S=e.getX(y,x),E=e.getY(y,x);t.batchTri(i,w,b,A,T,S,E,0,0,1,1,a,a,a,2)}}},function(t,e){t.exports=function(t,e,i){var n=t.x3-t.x1,r=t.y3-t.y1,s=t.x2-t.x1,o=t.y2-t.y1,a=e-t.x1,h=i-t.y1,l=n*n+r*r,u=n*s+r*o,c=n*a+r*h,d=s*s+o*o,p=s*a+o*h,f=l*d-u*u,m=0===f?0:1/f,g=(d*c-u*p)*m,v=(l*p-u*c)*m;return g>=0&&v>=0&&g+v<1}},function(t,e,i){var n=i(0),r=i(10),s=i(3);function o(t,e,i,n){var r=t-i,s=e-n,o=r*r+s*s;return Math.sqrt(o)}var a=new n({initialize:function(t,e,i){this.vertex1=t,this.vertex2=e,this.vertex3=i,this.bounds=new r,this._inCenter=new s},getInCenter:function(t){void 0===t&&(t=!0);var e,i,n,r,s,a,h=this.vertex1,l=this.vertex2,u=this.vertex3;t?(e=h.x,i=h.y,n=l.x,r=l.y,s=u.x,a=u.y):(e=h.vx,i=h.vy,n=l.vx,r=l.vy,s=u.vx,a=u.vy);var c=o(s,a,n,r),d=o(e,i,s,a),p=o(n,r,e,i),f=c+d+p;return this._inCenter.set((e*c+n*d+s*p)/f,(i*c+r*d+a*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,u=s.vx,c=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,u=s.vx*d+s.vy*f+g,c=s.vx*p+s.vy*m+v}var y=u-o,x=c-a,w=h-o,b=l-a,A=t-o,T=e-a,S=y*y+x*x,E=y*w+x*b,M=y*A+x*T,_=w*w+b*b,C=w*A+b*T,P=S*_-E*E,R=0===P?0:1/P,L=(_*M-E*C)*R,O=(S*C-E*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,s,o,a,h,l,u){var c=this.vertex1.update(r,s,o,a,h,l,u,n),d=this.vertex2.update(r,s,o,a,h,l,u,n),p=this.vertex3.update(r,s,o,a,h,l,u,n);if(c.ta<=0&&d.ta<=0&&p.ta<=0)return!1;if(e&&!this.isCounterClockwise(i))return!1;var f=this.bounds;f.x=Math.min(c.tx,d.tx,p.tx),f.y=Math.min(c.ty,d.ty,p.ty),f.width=Math.max(c.tx,d.tx,p.tx)-f.x,f.height=Math.max(c.ty,d.ty,p.ty)-f.y;var m=t.x+t.width,g=t.y+t.height;return!(f.width<=0||f.height<=0||t.width<=0||t.height<=0||f.right<t.x||f.bottom<t.y||f.x>m||f.y>g)},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=a},function(t,e,i){var n=i(0),r=i(12),s=i(39),o=new n({Extends:s,initialize:function(t,e,i,n,r,o,a,h,l,u){void 0===o&&(o=16777215),void 0===a&&(a=1),void 0===h&&(h=0),void 0===l&&(l=0),void 0===u&&(u=0),s.call(this,t,e,i),this.vx=0,this.vy=0,this.vz=0,this.nx=h,this.ny=l,this.nz=u,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],u=r*a[2]+s*a[6]+o*a[10]+a[14],c=r*a[3]+s*a[7]+o*a[11]+a[15];this.vx=h/c*e,this.vy=-l/c*i,this.vz=n<=0?u/c:-u/c},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,i){var n={};t.exports=n;var r=i(166),s=i(32),o=i(84),a=i(41);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<t.composites.length;o++){var a=t.composites[o];n.setModified(a,e,i,s)}},n.add=function(t,e){var i=[].concat(e);r.trigger(t,"beforeAdd",{object:e});for(var o=0;o<i.length;o++){var a=i[o];switch(a.type){case"body":if(a.parent!==a){s.warn("Composite.add: skipped adding a compound body part (you must add its parent instead)");break}n.addBody(t,a);break;case"constraint":n.addConstraint(t,a);break;case"composite":n.addComposite(t,a);break;case"mouseConstraint":n.addConstraint(t,a.constraint)}}return r.trigger(t,"afterAdd",{object:e}),t},n.remove=function(t,e,i){var s=[].concat(e);r.trigger(t,"beforeRemove",{object:e});for(var o=0;o<s.length;o++){var a=s[o];switch(a.type){case"body":n.removeBody(t,a,i);break;case"constraint":n.removeConstraint(t,a,i);break;case"composite":n.removeComposite(t,a,i);break;case"mouseConstraint":n.removeConstraint(t,a.constraint)}}return r.trigger(t,"afterRemove",{object:e}),t},n.addComposite=function(t,e){return t.composites.push(e),e.parent=t,n.setModified(t,!0,!0,!1),t},n.removeComposite=function(t,e,i){var r=t.composites.indexOf(e);if(-1!==r&&(n.removeCompositeAt(t,r),n.setModified(t,!0,!0,!1)),i)for(var s=0;s<t.composites.length;s++)n.removeComposite(t.composites[s],e,!0);return t},n.removeCompositeAt=function(t,e){return t.composites.splice(e,1),n.setModified(t,!0,!0,!1),t},n.addBody=function(t,e){return t.bodies.push(e),n.setModified(t,!0,!0,!1),t},n.removeBody=function(t,e,i){var r=t.bodies.indexOf(e);if(-1!==r&&(n.removeBodyAt(t,r),n.setModified(t,!0,!0,!1)),i)for(var s=0;s<t.composites.length;s++)n.removeBody(t.composites[s],e,!0);return t},n.removeBodyAt=function(t,e){return t.bodies.splice(e,1),n.setModified(t,!0,!0,!1),t},n.addConstraint=function(t,e){return t.constraints.push(e),n.setModified(t,!0,!0,!1),t},n.removeConstraint=function(t,e,i){var r=t.constraints.indexOf(e);if(-1!==r&&n.removeConstraintAt(t,r),i)for(var s=0;s<t.composites.length;s++)n.removeConstraint(t.composites[s],e,!0);return t},n.removeConstraintAt=function(t,e){return t.constraints.splice(e,1),n.setModified(t,!0,!0,!1),t},n.clear=function(t,e,i){if(i)for(var r=0;r<t.composites.length;r++)n.clear(t.composites[r],e,!0);return e?t.bodies=t.bodies.filter((function(t){return t.isStatic})):t.bodies.length=0,t.constraints.length=0,t.composites.length=0,n.setModified(t,!0,!0,!1),t},n.allBodies=function(t){for(var e=[].concat(t.bodies),i=0;i<t.composites.length;i++)e=e.concat(n.allBodies(t.composites[i]));return e},n.allConstraints=function(t){for(var e=[].concat(t.constraints),i=0;i<t.composites.length;i++)e=e.concat(n.allConstraints(t.composites[i]));return e},n.allComposites=function(t){for(var e=[].concat(t.composites),i=0;i<t.composites.length;i++)e=e.concat(n.allComposites(t.composites[i]));return e},n.get=function(t,e,i){var r,s;switch(i){case"body":r=n.allBodies(t);break;case"constraint":r=n.allConstraints(t);break;case"composite":r=n.allComposites(t).concat(t)}return r?0===(s=r.filter((function(t){return t.id.toString()===e.toString()}))).length?null:s[0]:null},n.move=function(t,e,i){return n.remove(t,e),n.add(i,e),t},n.rebase=function(t){for(var e=n.allBodies(t).concat(n.allConstraints(t)).concat(n.allComposites(t)),i=0;i<e.length;i++)e[i].id=s.nextId();return n.setModified(t,!0,!0,!1),t},n.translate=function(t,e,i){for(var r=i?n.allBodies(t):t.bodies,s=0;s<r.length;s++)a.translate(r[s],e);return n.setModified(t,!0,!0,!1),t},n.rotate=function(t,e,i,r){for(var s=Math.cos(e),o=Math.sin(e),h=r?n.allBodies(t):t.bodies,l=0;l<h.length;l++){var u=h[l],c=u.position.x-i.x,d=u.position.y-i.y;a.setPosition(u,{x:i.x+(c*s-d*o),y:i.y+(c*o+d*s)}),a.rotate(u,e)}return n.setModified(t,!0,!0,!1),t},n.scale=function(t,e,i,r,s){for(var o=s?n.allBodies(t):t.bodies,h=0;h<o.length;h++){var l=o[h],u=l.position.x-r.x,c=l.position.y-r.y;a.setPosition(l,{x:r.x+u*e,y:r.y+c*i}),a.scale(l,e,i)}return n.setModified(t,!0,!0,!1),t},n.bounds=function(t){for(var e=n.allBodies(t),i=[],r=0;r<e.length;r+=1){var s=e[r];i.push(s.bounds.min,s.bounds.max)}return o.create(i)}},function(t,e){t.exports=function(t,e,i){return t>=0&&t<i.width&&e>=0&&e<i.height}},function(t,e,i){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){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){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<this.firstgid+this.total},getTileTextureCoordinates:function(t){return this.containsTileIndex(t)?this.texCoordinates[t-this.firstgid]:null},setImage:function(t){return this.image=t,this.glTexture=t.get().source.glTexture,this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setTileSize:function(t,e){return void 0!==t&&(this.tileWidth=t),void 0!==e&&(this.tileHeight=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},setSpacing:function(t,e){return void 0!==t&&(this.tileMargin=t),void 0!==e&&(this.tileSpacing=e),this.image&&this.updateTileData(this.image.source[0].width,this.image.source[0].height),this},updateTileData:function(t,e){var i=(e-2*this.tileMargin+this.tileSpacing)/(this.tileHeight+this.tileSpacing),n=(t-2*this.tileMargin+this.tileSpacing)/(this.tileWidth+this.tileSpacing);i=Math.floor(i),n=Math.floor(n),this.rows=i,this.columns=n,this.total=i*n,this.texCoordinates.length=0;for(var r=this.tileMargin,s=this.tileMargin,o=0;o<this.rows;o++){for(var a=0;a<this.columns;a++)this.texCoordinates.push({x:r,y:s}),r+=this.tileWidth+this.tileSpacing;r=this.tileMargin,s+=this.tileHeight+this.tileSpacing}return this}});t.exports=n},function(t,e){t.exports={TOP_LEFT:0,TOP_CENTER:1,TOP_RIGHT:2,LEFT_TOP:3,LEFT_CENTER:4,LEFT_BOTTOM:5,CENTER:6,RIGHT_TOP:7,RIGHT_CENTER:8,RIGHT_BOTTOM:9,BOTTOM_LEFT:10,BOTTOM_CENTER:11,BOTTOM_RIGHT:12}},function(t,e){t.exports=function(t,e,i){return void 0===i&&(i=1e-4),Math.abs(t-e)<i}},function(t,e,i){var n=i(0),r=i(11),s=i(15),o=i(1068),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=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){var n={};t.exports=n;var r=i(64),s=i(83),o=i(165),a=i(84),h=i(271),l=i(32);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;e<t.length;e+=1){var i=t[e],n=i.constraintImpulse;i.isStatic||0===n.x&&0===n.y&&0===n.angle||(i.position.x+=n.x,i.position.y+=n.y,i.angle+=n.angle)}},n.solveAll=function(t,e){for(var i=0;i<t.length;i+=1){var r=t[i],s=!r.bodyA||r.bodyA&&r.bodyA.isStatic,o=!r.bodyB||r.bodyB&&r.bodyB.isStatic;(s||o)&&n.solve(t[i],e)}for(i=0;i<t.length;i+=1)s=!(r=t[i]).bodyA||r.bodyA&&r.bodyA.isStatic,o=!r.bodyB||r.bodyB&&r.bodyB.isStatic,s||o||n.solve(t[i],e)},n.solve=function(t,e){var i=t.bodyA,r=t.bodyB,o=t.pointA,a=t.pointB;if(i||r){i&&!i.isStatic&&(s.rotate(o,i.angle-t.angleA,o),t.angleA=i.angle),r&&!r.isStatic&&(s.rotate(a,r.angle-t.angleB,a),t.angleB=r.angle);var h=o,l=a;if(i&&(h=s.add(i.position,o)),r&&(l=s.add(r.position,a)),h&&l){var u=s.sub(h,l),c=s.magnitude(u);c<n._minLength&&(c=n._minLength);var d,p,f,m,g,v=(c-t.length)/c,y=t.stiffness<1?t.stiffness*e:t.stiffness,x=s.mult(u,v*y),w=(i?i.inverseMass:0)+(r?r.inverseMass:0),b=w+((i?i.inverseInertia:0)+(r?r.inverseInertia:0));if(t.damping){var A=s.create();f=s.div(u,c),g=s.sub(r&&s.sub(r.position,r.positionPrev)||A,i&&s.sub(i.position,i.positionPrev)||A),m=s.dot(f,g)}i&&!i.isStatic&&(p=i.inverseMass/w,i.constraintImpulse.x-=x.x*p,i.constraintImpulse.y-=x.y*p,i.position.x-=x.x*p,i.position.y-=x.y*p,t.damping&&(i.positionPrev.x-=t.damping*f.x*m*p,i.positionPrev.y-=t.damping*f.y*m*p),d=s.cross(o,x)/b*n._torqueDampen*i.inverseInertia*(1-t.angularStiffness),i.constraintImpulse.angle-=d,i.angle-=d),r&&!r.isStatic&&(p=r.inverseMass/w,r.constraintImpulse.x+=x.x*p,r.constraintImpulse.y+=x.y*p,r.position.x+=x.x*p,r.position.y+=x.y*p,t.damping&&(r.positionPrev.x+=t.damping*f.x*m*p,r.positionPrev.y+=t.damping*f.y*m*p),d=s.cross(a,x)/b*n._torqueDampen*r.inverseInertia*(1-t.angularStiffness),r.constraintImpulse.angle+=d,r.angle+=d)}}},n.postSolveAll=function(t){for(var e=0;e<t.length;e++){var i=t[e],l=i.constraintImpulse;if(!(i.isStatic||0===l.x&&0===l.y&&0===l.angle)){o.set(i,!1);for(var u=0;u<i.parts.length;u++){var c=i.parts[u];r.translate(c.vertices,l),u>0&&(c.position.x+=l.x,c.position.y+=l.y),0!==l.angle&&(r.rotate(c.vertices,l.angle,i.position),h.rotate(c.axes,l.angle),u>0&&s.rotateAbout(c.position,l.angle,i.position,c.position)),a.update(c.bounds,c.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){var n=i(35),r=i(65),s=i(66),o=i(0),a=i(11),h=i(15),l=i(10),u=i(57),c=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),u)},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(t,e,i){i.addToRenderList(e)},renderWebGL:function(t,e,i){i.addToRenderList(e)}});t.exports=c},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){t.exports={ADD_ANIMATION:i(724),ANIMATION_COMPLETE:i(725),ANIMATION_COMPLETE_KEY:i(726),ANIMATION_REPEAT:i(727),ANIMATION_RESTART:i(728),ANIMATION_START:i(729),ANIMATION_STOP:i(730),ANIMATION_UPDATE:i(731),PAUSE_ALL:i(732),REMOVE_ANIMATION:i(733),RESUME_ALL:i(734)}},function(t,e,i){var n=i(0),r=i(11),s=i(36),o=i(9),a=i(37),h=i(10),l=i(25),u=i(187),c=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=u("rgba(0,0,0,0)"),this.disableCull=!1,this.culledObjects=[],this.midPoint=new c(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 c);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,u=this.scrollY,c=this.width,d=this.height,p=this.y,f=p+d,m=this.x,g=m+c,v=this.culledObjects,y=t.length;o=1/o,v.length=0;for(var x=0;x<y;++x){var w=t[x];if(w.hasOwnProperty("width")&&!w.parentContainer){var b=w.width,A=w.height,T=w.x-l*w.scrollFactorX-b*w.originX,S=w.y-u*w.scrollFactorY-A*w.originY;(T+b)*i+(S+A)*r+a>m&&T*i+S*r+a<g&&(T+b)*n+(S+A)*s+h>p&&T*n+S*s+h<f&&v.push(w)}else v.push(w)}return v},getWorldPoint:function(t,e,i){void 0===i&&(i=new c);var n=this.matrix.matrix,r=n[0],s=n[1],o=n[2],a=n[3],h=n[4],l=n[5],u=r*a-s*o;if(!u)return i.x=t,i.y=e,i;var d=a*(u=1/u),p=-s*u,f=-o*u,m=r*u,g=(o*l-a*h)*u,v=(s*h-r*l)*u,y=Math.cos(this.rotation),x=Math.sin(this.rotation),w=this.zoomX,b=this.zoomY,A=this.scrollX,T=this.scrollY,S=t+(A*y-T*x)*w,E=e+(A*x+T*y)*b;return i.x=S*d+E*f+g,i.y=S*p+E*m+v,i},ignore:function(t){var e=this.id;Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i];Array.isArray(n)?this.ignore(n):n.isParent?this.ignore(n.getChildren()):n.cameraFilter|=e}return this},preRender:function(){this.renderList.length=0;var t=this.width,e=this.height,i=.5*t,n=.5*e,r=this.zoomX,s=this.zoomY,o=this.matrix,a=t*this.originX,h=e*this.originY,l=this.scrollX,u=this.scrollY;this.useBounds&&(l=this.clampX(l),u=this.clampY(u)),this.roundPixels&&(a=Math.round(a),h=Math.round(h)),this.scrollX=l,this.scrollY=u;var c=l+i,d=u+n;this.midPoint.set(c,d);var p=t/r,f=e/s;this.worldView.setTo(c-p/2,d-f/2,p,f),o.applyITRS(this.x+a,this.y+h,this.rotation,r,s),o.translate(-a,-h)},clampX:function(t){var e=this._bounds,i=this.displayWidth,n=e.x+(i-this.width)/2,r=Math.max(n,n+e.width-i);return t<n?t=n:t>r&&(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 t<n?t=n:t>r&&(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=u(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){var n=i(334),r=i(335),s=i(336),o=i(337),a=i(338),h=i(339),l=i(340),u=i(341),c=i(342),d=i(343),p=i(344),f=i(345);t.exports={Power0:l,Power1:u.Out,Power2:o.Out,Power3:c.Out,Power4:d.Out,Linear:l,Quad:u.Out,Cubic:o.Out,Quart:c.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":u.In,"Cubic.easeIn":o.In,"Quart.easeIn":c.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":u.Out,"Cubic.easeOut":o.Out,"Quart.easeOut":c.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":u.InOut,"Cubic.easeInOut":o.InOut,"Quart.easeInOut":c.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){var n,r=i(105),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){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,u=a*n+r*i-s*e,c=-r*e-s*i-o*n;return this.x=h*a+c*-r+l*-o-u*-s,this.y=l*a+c*-s+u*-r-h*-o,this.z=u*a+c*-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){var n=i(0),r=i(91),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,(t=Math.round(t))<=0&&(t=1),(e=Math.round(e))<=0&&(e=1),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){var n=i(0),r=i(77),s=i(9),o=i(70),a=i(22),h=i(1),l=i(207),u=i(428),c=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 u(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=c},function(t,e,i){var n=i(0),r=i(9),s=i(70),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]||(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))},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!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){var n=i(209),r=i(435);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<t.length;i++)t[i].reverse();t.reverse()}return t}},function(t,e,i){var n=i(0),r=i(18),s=i(11),o=i(15),a=i(1043),h=i(1044),l=i(212),u=i(10),c=i(1045),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,c],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);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.fromAtlas=l.fromAtlas,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),u=this.charColors,c=t;c<l;c++){var d=u[c];if(-1===n)u[c]=null;else{var p=i?1:0;d?(d.tintEffect=p,d.tintTL=n,d.tintTR=s,d.tintBL=o,d.tintBR=a):u[c]={tintEffect:p,tintTL:n,tintTR:s,tintBL:o,tintBR:a}}}return this},setWordTint:function(t,e,i,n,r,s,o){void 0===e&&(e=1);for(var a=this.getTextBounds().words,h="number"==typeof t,l=0,u=0;u<a.length;u++){var c=a[u];if((h&&u===t||!h&&c.word===t)&&(this.setCharacterTint(c.i,c.word.length,i,n,r,s,o),++l===e))return this}return this},getTextBounds:function(t){var e=this._bounds;return(this._dirty||t||this.scaleX!==e.scaleX||this.scaleY!==e.scaleY)&&(a(this,t,!0,e),this._dirty=!1),e},getCharacterAt:function(t,e,i){for(var n=this.getLocalPoint(t,e,null,i),r=this.getTextBounds().characters,s=new u,o=0;o<r.length;o++){var a=r[o];if(s.setTo(a.x,a.t,a.r-a.x,a.b),s.contains(n.x,n.y))return a}return null},updateDisplayOrigin:function(){return this._dirty=!0,this.getTextBounds(!1),this},setFont:function(t,e,i){if(void 0===e&&(e=this._fontSize),void 0===i&&(i=this._align),t!==this.font){var n=this.scene.sys.cache.bitmapFont.get(t);n&&(this.font=t,this.fontData=n.data,this._fontSize=e,this._align=i,this.fromAtlas=!0===n.fromAtlas,this.setTexture(n.texture,n.frame),a(this,!1,!0,this._bounds))}return this},setMaxWidth:function(t,e){return this._maxWidth=t,this._dirty=!0,void 0!==e&&(this.wordWrapCharCode=e),this},align:{set:function(t){this._align=t,this._dirty=!0},get:function(){return this._align}},text:{set:function(t){this.setText(t)},get:function(){return this._text}},fontSize:{set:function(t){this._fontSize=t,this._dirty=!0},get:function(){return this._fontSize}},letterSpacing:{set:function(t){this._letterSpacing=t,this._dirty=!0},get:function(){return this._letterSpacing}},maxWidth:{set:function(t){this._maxWidth=t,this._dirty=!0},get:function(){return this._maxWidth}},width:{get:function(){return this.getTextBounds(!1),this._bounds.global.width}},height:{get:function(){return this.getTextBounds(!1),this._bounds.global.height}},toJSON:function(){var t=s.ToJSON(this),e={font:this.font,text:this.text,fontSize:this.fontSize,letterSpacing:this.letterSpacing,align:this.align};return t.data=e,t},preDestroy:function(){this.charColors.length=0,this._bounds=null,this.fontData=null}});d.ALIGN_LEFT=0,d.ALIGN_CENTER=1,d.ALIGN_RIGHT=2,d.ParseFromAtlas=h,d.ParseXMLBitmapFont=l,t.exports=d},function(t,e,i){var n=new(i(0))({initialize:function(t){if(this.entries=[],Array.isArray(t))for(var e=0;e<t.length;e++)this.set(t[e])},set:function(t){return-1===this.entries.indexOf(t)&&this.entries.push(t),this},get:function(t,e){for(var i=0;i<this.entries.length;i++){var n=this.entries[i];if(n[t]===e)return n}},getArray:function(){return this.entries.slice(0)},delete:function(t){var e=this.entries.indexOf(t);return e>-1&&this.entries.splice(e,1),this},dump:function(){for(var t=0;t<this.entries.length;t++)this.entries[t]},each:function(t,e){var i,n=this.entries.slice(),r=n.length;if(e)for(i=0;i<r&&!1!==t.call(e,n[i],i);i++);else for(i=0;i<r&&!1!==t(n[i],i);i++);return this},iterate:function(t,e){var i,n=this.entries.length;if(e)for(i=0;i<n&&!1!==t.call(e,this.entries[i],i);i++);else for(i=0;i<n&&!1!==t(this.entries[i],i);i++);return this},iterateLocal:function(t){var e,i=[];for(e=1;e<arguments.length;e++)i.push(arguments[e]);var n=this.entries.length;for(e=0;e<n;e++){var r=this.entries[e];r[t].apply(r,i)}return this},clear:function(){return this.entries.length=0,this},contains:function(t){return this.entries.indexOf(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<this.entries.length?this.entries.length=t:this.entries.length}}});t.exports=n},function(t,e,i){var n=i(0),r=i(11),s=i(15),o=i(189),a=i(92),h=i(1182),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){t.exports=function(t,e){return!(t.width<=0||t.height<=0||e.width<=0||e.height<=0||t.right<e.x||t.bottom<e.y||t.x>e.right||t.y>e.bottom)}},function(t,e,i){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,u=r[o].configKey;n(i,l,s[u])&&(t[h]=new a(t))}},remove:function(t){r.hasOwnProperty(t)&&delete r[t]}};t.exports=s},function(t,e,i){t.exports={ANY_KEY_DOWN:i(1323),ANY_KEY_UP:i(1324),COMBO_MATCH:i(1325),DOWN:i(1326),KEY_DOWN:i(1327),KEY_UP:i(1328),UP:i(1329)}},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){var n=i(0),r=i(243),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){var n=i(119);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,u=t.tilemapLayer,c=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<f;s++)for(r=c;a[s]&&r<d;r++)(o=a[s][r])&&-1!==o.index&&o.visible&&0!==o.alpha&&n.push(o);else if(1===i)for(s=p;s<f;s++)for(r=d;a[s]&&r>=c;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=c;a[s]&&r<d;r++)(o=a[s][r])&&-1!==o.index&&o.visible&&0!==o.alpha&&n.push(o);else if(3===i)for(s=f;s>=p;s--)for(r=d;a[s]&&r>=c;r--)(o=a[s][r])&&-1!==o.index&&o.visible&&0!==o.alpha&&n.push(o);return u.tilesDrawn=n.length,u.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){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){var n=i(265),r=i(13),s=i(99),o=i(80),a=i(162),h=i(583),l=i(263),u=i(6),c=i(264),d=i(266),p=i(268);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=u(e,"easeParams",i.easeParams),x=o(u(e,"ease",i.ease),y),w=a(e,"hold",i.hold),b=a(e,"repeat",i.repeat),A=a(e,"repeatDelay",i.repeatDelay),T=s(e,"yoyo",i.yoyo),S=s(e,"flipX",i.flipX),E=s(e,"flipY",i.flipY),M=[],_=0;_<m.length;_++)for(var C=m[_].key,P=m[_].value,R=0;R<f.length;R++){var L=c(C,P),O=p(f[R],R,C,L.getEnd,L.getStart,L.getActive,o(u(P,"ease",x),u(P,"easeParams",y)),a(P,"delay",g),a(P,"duration",v),s(P,"yoyo",T),a(P,"hold",w),a(P,"repeat",b),a(P,"repeatDelay",A),s(P,"flipX",S),s(P,"flipY",E));M.push(O)}var D=new d(t,M,f);D.offset=r(e,"offset",null),D.completeDelay=r(e,"completeDelay",0),D.loop=Math.round(r(e,"loop",0)),D.loopDelay=Math.round(r(e,"loopDelay",0)),D.paused=s(e,"paused",!1),D.useFrames=s(e,"useFrames",!1);for(var B=u(e,"callbackScope",D),I=[D,null],F=d.TYPES,k=0;k<F.length;k++){var N=F[k],z=u(e,N,!1);if(z){var U=u(e,N+"Scope",B),V=u(e,N+"Params",[]);D.setCallback(N,z,I.concat(V),U)}}return D}},function(t,e,i){var n=i(0),r=i(102),s=i(2),o=i(132),a=i(185),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;i<t.length;i++){var n=t[i];null===this.nextAnim?this.nextAnim=n:this.nextAnimsQueue.push(n)}return this.parent},getName:function(){return this.currentAnim?this.currentAnim.key:""},getFrameName:function(){return this.currentFrame?this.currentFrame.textureFrame:""},load:function(t){this.isPlaying&&this.stop();var e=this.animationManager,i="string"==typeof t?t:s(t,"key",null),n=this.exists(i)?this.get(i):e.get(i);if(n){this.currentAnim=n;var r=n.getTotalFrames(),o=s(t,"frameRate",n.frameRate),a=s(t,"duration",n.duration);n.calculateDuration(this,r,a,o),this.delay=s(t,"delay",n.delay),this.repeat=s(t,"repeat",n.repeat),this.repeatDelay=s(t,"repeatDelay",n.repeatDelay),this.yoyo=s(t,"yoyo",n.yoyo),this.showOnStart=s(t,"showOnStart",n.showOnStart),this.hideOnComplete=s(t,"hideOnComplete",n.hideOnComplete),this.skipMissedFrames=s(t,"skipMissedFrames",n.skipMissedFrames),this.timeScale=s(t,"timeScale",this.timeScale);var h=s(t,"startFrame",0);h>n.getTotalFrames()&&(h=0);var l=n.frames[h];0!==h||this.forward||(l=n.getLastFrame()),this.currentFrame=l}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.isPlaying&&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(166);n._motionWakeThreshold=.18,n._motionSleepThreshold=.08,n._minBias=.9,n.update=function(t,e){for(var i=e*e*e,r=0;r<t.length;r++){var s=t[r],o=s.speed*s.speed+s.angularSpeed*s.angularSpeed;if(0===s.force.x&&0===s.force.y){var a=Math.min(s.motion,o),h=Math.max(s.motion,o);s.motion=n._minBias*a+(1-n._minBias)*h,s.sleepThreshold>0&&s.motion<n._motionSleepThreshold*i?(s.sleepCounter+=1,s.sleepCounter>=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;r<t.length;r++){var s=t[r];if(s.isActive){var o=s.collision,a=o.bodyA.parent,h=o.bodyB.parent;if(!(a.isSleeping&&h.isSleeping||a.isStatic||h.isStatic)&&(a.isSleeping||h.isSleeping)){var l=a.isSleeping&&!a.isStatic?a:h,u=l===a?h:a;!l.isStatic&&u.motion>n._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(32);n.on=function(t,e,i){for(var n,r=e.split(" "),s=0;s<r.length;s++)n=r[s],t.events=t.events||{},t.events[n]=t.events[n]||[],t.events[n].push(i);return i},n.off=function(t,e,i){if(e){"function"==typeof e&&(i=e,e=r.keys(t.events).join(" "));for(var n=e.split(" "),s=0;s<n.length;s++){var o=t.events[n[s]],a=[];if(i&&o)for(var h=0;h<o.length;h++)o[h]!==i&&a.push(o[h]);t.events[n[s]]=a}}else t.events={}},n.trigger=function(t,e,i){var n,s,o,a,h=t.events;if(h&&r.keys(h).length>0){i||(i={}),n=e.split(" ");for(var l=0;l<n.length;l++)if(o=h[s=n[l]]){(a=r.clone(i,!1)).name=s,a.source=t;for(var u=0;u<o.length;u++)o[u].apply(t,[a])}}}},function(t,e,i){var n=i(175),r=i(92),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;o<t.length;o++){var a=s.getPostPipeline(t[o],this);a&&this.postPipelines.push(a)}e&&(this.pipelineData=i?n(e):e)}return this.hasPostPipeline=this.postPipelines.length>0,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<e.length;n++){var r=e[n];("string"==typeof t&&r.name===t||r instanceof t)&&i.push(r)}return 1===i.length?i[0]:i},resetPipeline:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),this.pipeline=this.defaultPipeline,t&&(this.postPipelines=[],this.hasPostPipeline=!1),e&&(this.pipelineData={}),null!==this.pipeline},resetPostPipeline:function(t){void 0===t&&(t=!1);for(var e=this.postPipelines,i=0;i<e.length;i++)e[i].destroy();this.postPipelines=[],this.hasPostPipeline=!1,t&&(this.pipelineData={})},removePostPipeline:function(t){for(var e=this.postPipelines,i=e.length-1;i>=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){t.exports={DEFAULT:0,LINEAR:0,NEAREST:1}},function(t,e,i){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){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){var n=i(130),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){var n=i(67),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,u=0;u<e;u++){var c=u/e,d=o+(h-o)*c,p=a+(l-a)*c;s.push(new r(d,p))}return s}},function(t,e,i){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){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){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){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),u=Math.cos(s),c=u*o,d=l*o,p=-l*a,f=u*a,m=1/(c*f+p*-d);return h.x=f*m*t+-p*m*e+(r*p-i*f)*m,h.y=c*m*e+-d*m*t+(-r*c+i*d)*m,h}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n<e;n++)i=t.shift(),t.push(i);return i}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1);for(var i=null,n=0;n<e;n++)i=t.pop(),t.unshift(i);return i}},function(t,e,i){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){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){var n=i(18),r=i(0),s=i(132),o=i(318),a=i(319),h=i(6),l=i(320),u=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&&t<this.frames.length},getFirstTick:function(t){t.accumulator=0,t.nextTick=t.msPerFrame+t.currentFrame.duration},getFrameAt:function(t){return this.frames[t]},getFrames:function(t,e,i,n){void 0===n&&(n=!0);var r,s,o,u,c=[],d=1;if("string"==typeof e){u=e;var p=t.get(u).getFrameNames();n&&l(p),e=[],p.forEach((function(t){e.push({key:u,frame:t})}))}if(!Array.isArray(e)||0===e.length)return c;for(o=0;o<e.length;o++){var f=e[o],m=h(f,"key",i);if(m){var g=h(f,"frame",0),v=t.getFrame(m,g);(s=new a(m,g,d,v)).duration=h(f,"duration",0),s.isFirst=!r,r&&(r.nextFrame=s,s.prevFrame=r),c.push(s),r=s,d++}}if(c.length>0){s.isLast=!0,s.nextFrame=c[0],c[0].prevFrame=s;var y=1/(c.length-1);for(o=0;o<c.length;o++)c[o].progress=o*y}return c},getNextTick:function(t){t.accumulator-=t.nextTick,t.nextTick=t.msPerFrame+t.currentFrame.duration},getFrameByProgress:function(t){return t=n(t,0,1),o(t,this.frames,"progress")},nextFrame:function(t){var e=t.currentFrame;e.isLast?t.yoyo?this.handleYoyoFrame(t,!1):t.repeatCounter>0?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;n<e;n++)(t=this.frames[n]).index=n+1,t.isFirst=!1,t.isLast=!1,t.progress=n*i,0===n?(t.isFirst=!0,1===e?(t.isLast=!0,t.nextFrame=t,t.prevFrame=t):(t.isLast=!1,t.prevFrame=this.frames[e-1],t.nextFrame=this.frames[n+1])):n===e-1&&e>1?(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<this.frames.length;t++)this.frames[t].destroy();this.frames=[],this.manager=null}});t.exports=u},function(t,e){t.exports=function(t,e,i,n){void 0===e&&(e=0),void 0===i&&(i=" "),void 0===n&&(n=3);var r=0;if(e+1>=(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){var n=i(327),r=i(189),s=i(331),o=i(332);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){var n=i(103);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){var n=i(38),r=i(330);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){var n=i(105),r=i(136),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(){if("function"==typeof importScripts)return o;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){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<e.length;i++){var n=e[i]+"mageSmoothingEnabled";if(n in t)return n}return null},isEnabled:function(t){return null!==n?t[n]:null}}},function(t,e,i){var n=i(14),r=i(17),s={Angle:i(812),Distance:i(821),Easing:i(826),Fuzzy:i(827),Interpolation:i(830),Pow2:i(835),Snap:i(837),RandomDataGenerator:i(839),Average:i(840),Bernstein:i(356),Between:i(195),CatmullRom:i(194),CeilTo:i(841),Clamp:i(18),DegToRad:i(36),Difference:i(842),Euler:i(843),Factorial:i(357),FloatBetween:i(137),FloorTo:i(844),FromPercent:i(98),GetSpeed:i(845),IsEven:i(846),IsEvenStrict:i(847),Linear:i(135),MaxAdd:i(848),Median:i(849),MinSub:i(850),Percent:i(851),RadToDeg:i(196),RandomXY:i(852),RandomXYZ:i(853),RandomXYZW:i(854),Rotate:i(362),RotateAround:i(308),RotateAroundDistance:i(182),RotateTo:i(855),RoundAwayFromZero:i(363),RoundTo:i(856),SinCosTableGenerator:i(857),SmootherStep:i(183),SmoothStep:i(184),ToXY:i(858),TransformXY:i(177),Within:i(859),Wrap:i(68),Vector2:i(3),Vector3:i(39),Vector4:i(140),Matrix3:i(364),Matrix4:i(69),Quaternion:i(365),RotateVec3:i(860)};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){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){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){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,u=r.MIN_SAFE_INTEGER,c=0;c<t.length;c++)i=t[c],Array.isArray(i)?(s=i[0],o=i[1]):(s=i.x,o=i.y),a=Math.min(a,s),h=Math.min(h,o),l=Math.max(l,s),u=Math.max(u,o);return e.x=a,e.y=h,e.width=l-a,e.height=u-h,e}},function(t,e,i){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){var n={CENTER:i(403),ORIENTATION:i(404),SCALE_MODE:i(405),ZOOM:i(406)};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){var n=i(0),r=i(144),s=i(197),o=i(20),a=i(419),h=i(420),l=i(33),u=i(1),c=i(421),d=new n({initialize:function(t,e){this.scene=t,this.game,this.renderer,this.config=e,this.settings=c.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=u},init:function(t){this.settings.status=r.INIT,this.sceneUpdate=u,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},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.events.emit(o.PRE_RENDER,t),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<i.length;n++)this[i[n]]=null}});t.exports=d},function(t,e){t.exports=function(t){return t&&t[0].toUpperCase()+t.slice(1)}},function(t,e,i){var n=i(33),r=i(0),s=i(109),o=i(424),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<i.length;s++)this.source.push(new o(this,i[s],n,r))},add:function(t,e,i,n,r,o){if(this.has(t))return null;var a=new s(this,t,e,i,n,r,o);return this.frames[t]=a,"__BASE"===this.firstFrame&&(this.firstFrame=t),this.frameTotal++,a},remove:function(t){return!!this.has(t)&&(this.get(t).destroy(),delete this.frames[t],!0)},has:function(t){return this.frames[t]},get:function(t){t||(t=this.firstFrame);var e=this.frames[t];return e||(e=this.frames[this.firstFrame]),e},getTextureSourceIndex:function(t){for(var e=0;e<this.source.length;e++)if(this.source[e]===t)return e;return-1},getFramesFromTextureSource:function(t,e){void 0===e&&(e=!1);var i=[];for(var n in this.frames)if("__BASE"!==n||e){var r=this.frames[n];r.sourceIndex===t&&i.push(r)}return i},getFrameNames:function(t){void 0===t&&(t=!1);var e=Object.keys(this.frames);if(!t){var i=e.indexOf("__BASE");-1!==i&&e.splice(i,1)}return e},getSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e=this.frames[t];return e?e.source.image:this.frames.__BASE.source.image},getDataSourceImage:function(t){null!=t&&1!==this.frameTotal||(t="__BASE");var e,i=this.frames[t];return e=i?i.sourceIndex:this.frames.__BASE.sourceIndex,this.dataSource[e].image},setDataSource:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=this.source[e];this.dataSource.push(new o(this,t[e],i.width,i.height))}},setFilter:function(t){var e;for(e=0;e<this.source.length;e++)this.source[e].setFilter(t);for(e=0;e<this.dataSource.length;e++)this.dataSource[e].setFilter(t)},destroy:function(){var t;for(t=0;t<this.source.length;t++)this.source[t].destroy();for(t=0;t<this.dataSource.length;t++)this.dataSource[t].destroy();for(var e in this.frames)this.frames[e].destroy();this.source=[],this.dataSource=[],this.frames={},this.manager.removeKey(this.key);var i=this.manager.game.renderer;i&&i.type===n.WEBGL&&i.resetTextures(!0),this.manager=null}});t.exports=a},function(t,e,i){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<s;a++){var h=t[a];(!e||e&&void 0===i&&h.hasOwnProperty(e)||e&&void 0!==i&&h[e]===i)&&o.push(h)}return o}},function(t,e,i){t.exports={Matrix:i(1013),Add:i(1021),AddAt:i(1022),BringToTop:i(1023),CountAllMatching:i(1024),Each:i(1025),EachInRange:i(1026),FindClosestInSorted:i(318),GetAll:i(207),GetFirst:i(428),GetRandom:i(210),MoveDown:i(1027),MoveTo:i(1028),MoveUp:i(1029),MoveAbove:i(1030),MoveBelow:i(1031),NumberArray:i(322),NumberArrayStep:i(1032),QuickSelect:i(436),Range:i(437),Remove:i(93),RemoveAt:i(1033),RemoveBetween:i(1034),RemoveRandomElement:i(1035),Replace:i(1036),RotateLeft:i(178),RotateRight:i(179),SafeRange:i(78),SendToBack:i(1037),SetAll:i(1038),Shuffle:i(131),SortByDigits:i(320),SpliceOne:i(74),StableSort:i(79),Swap:i(1039)}},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<t.length;i++)if(t[i].length!==e)return!1;return!0}},function(t,e){t.exports=function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);var n=e+Math.floor(Math.random()*i);return void 0===t[n]?null:t[n]}},function(t,e,i){var n=i(0),r=i(9),s=i(438),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<i.length;t++){e=i[t];var r=n.indexOf(e);-1!==r&&(n.splice(r,1),this.emit(s.PROCESS_QUEUE_REMOVE,e))}for(i.length=0,i=this._pending,t=0;t<i.length;t++)e=i[t],(!this.checkQueue||this.checkQueue&&-1===n.indexOf(e))&&(n.push(e),this.emit(s.PROCESS_QUEUE_ADD,e));return i.length=0,this._toProcess=0,n},getActive:function(){return this._active},length:{get:function(){return this._active.length}},destroy:function(){this._toProcess=0,this._pending=[],this._active=[],this._destroy=[]}});t.exports=o},function(t,e){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,u=e.sourceIndex,c={},d=t.getElementsByTagName("info")[0],p=t.getElementsByTagName("common")[0];c.font=d.getAttribute("face"),c.size=i(d,"size"),c.lineHeight=i(p,"lineHeight")+r,c.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<f.length;y++){var x=f[y],w=i(x,"id"),b=String.fromCharCode(w),A=i(x,"x"),T=i(x,"y"),S=i(x,"width"),E=i(x,"height");m&&(A<v&&(v=A),T<g&&(g=T)),m&&0!==g&&0!==v&&(A-=e.x,T-=e.y);var M=(o+A)/h,_=(a+T)/l,C=(o+A+S)/h,P=(a+T+E)/l;if(c.chars[w]={x:A,y:T,width:S,height:E,centerX:Math.floor(S/2),centerY:Math.floor(E/2),xOffset:i(x,"xoffset"),yOffset:i(x,"yoffset"),xAdvance:i(x,"xadvance")+n,data:{},kerning:{},u0:M,v0:_,u1:C,v1:P},s&&0!==S&&0!==E){var R=s.add(b,u,A,T,S,E);R&&R.setUVs(S,E,M,_,C,P)}}var L=t.getElementsByTagName("kerning");for(y=0;y<L.length;y++){var O=L[y],D=i(O,"first"),B=i(O,"second"),I=i(O,"amount");c.chars[B].kerning[D]=I}return c}},function(t,e,i){var n=i(1049),r=i(440),s=i(0),o=i(11),a=i(109),h=i(15),l=i(110),u=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;s<r.length;s++){var o=r[s];t.call(this,o,s)}return r},createMultiple:function(t,e,i){void 0===e&&(e=this.frame.name),void 0===i&&(i=!0),Array.isArray(e)||(e=[e]);var n=[],r=this;return e.forEach((function(e){for(var s=0;s<t;s++)n.push(r.create(0,0,e,i))})),n},childCanRender:function(t){return t.visible&&t.alpha>0},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=u},function(t,e,i){var n=i(208),r=i(35),s=i(0),o=i(11),a=i(75),h=i(15),l=i(10),u=i(1052),c=i(441),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,u],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<i.length;s++){var o=i[s];o.getBounds&&(o.getBounds(n),r?c(n,t,t):(t.setTo(n.x,n.y,n.width,n.height),r=!0))}}return t},addHandler:function(t){t.once(a.DESTROY,this.remove,this),this.exclusive&&(t.parentContainer&&t.parentContainer.remove(t),t.removeFromDisplayList(),t.parentContainer=this)},removeHandler:function(t){t.off(a.DESTROY,this.remove),this.exclusive&&(t.parentContainer=null,t.addToDisplayList())},pointToContainer:function(t,e){void 0===e&&(e=new d),this.parentContainer?this.parentContainer.pointToContainer(t,e):e=new d(t.x,t.y);var i=this.tempTransformMatrix;return i.applyITRS(this.x,this.y,this.rotation,this.scaleX,this.scaleY),i.invert(),i.transformPoint(t.x,t.y,e),e},getBoundsTransformMatrix:function(){return this.getWorldTransformMatrix(this.tempTransformMatrix,this.localTransform)},add:function(t){return n.Add(this.list,t,this.maxSize,this.addHandler,this),this},addAt:function(t,e){return n.AddAt(this.list,t,e,this.maxSize,this.addHandler,this),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]}),n.StableSort(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,i,r){return n.CountAllMatching(this.list,t,e,i,r)},swap:function(t,e){return n.Swap(this.list,t,e),this},moveTo:function(t,e){return n.MoveTo(this.list,t,e),this},moveAbove:function(t,e){return n.MoveAbove(this.list,t,e),this},moveBelow:function(t,e){return n.MoveBelow(this.list,t,e),this},remove:function(t,e){var i=n.Remove(this.list,t,this.removeHandler,this);if(e&&i){Array.isArray(i)||(i=[i]);for(var r=0;r<i.length;r++)i[r].destroy()}return this},removeAt:function(t,e){var i=n.RemoveAt(this.list,t,this.removeHandler,this);return e&&i&&i.destroy(),this},removeBetween:function(t,e,i){var r=n.RemoveBetween(this.list,t,e,this.removeHandler,this);if(i)for(var s=0;s<r.length;s++)r[s].destroy();return this},removeAll:function(t){var e=n.RemoveBetween(this.list,0,this.list.length,this.removeHandler,this);if(t)for(var i=0;i<e.length;i++)e[i].destroy();return this},bringToTop:function(t){return n.BringToTop(this.list,t),this},sendToBack:function(t){return n.SendToBack(this.list,t),this},moveUp:function(t){return n.MoveUp(this.list,t),this},moveDown:function(t){return n.MoveDown(this.list,t),this},reverse:function(){return this.list.reverse(),this},shuffle:function(){return n.Shuffle(this.list),this},replace:function(t,e,i){return n.Replace(this.list,t,e)&&(this.addHandler(e),this.removeHandler(t),i&&t.destroy()),this},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){var i,n=[null],r=this.list.slice(),s=r.length;for(i=2;i<arguments.length;i++)n.push(arguments[i]);for(i=0;i<s;i++)n[0]=r[i],t.apply(e,n);return this},iterate:function(t,e){var i,n=[null];for(i=2;i<arguments.length;i++)n.push(arguments[i]);for(i=0;i<this.list.length;i++)n[0]=this.list[i],t.apply(e,n);return this},setScrollFactor:function(t,e,i){return void 0===e&&(e=t),void 0===i&&(i=!1),this.scrollFactorX=t,this.scrollFactorY=e,i&&(n.SetAll(this.list,"scrollFactorX",t),n.SetAll(this.list,"scrollFactorY",e)),this},length:{get:function(){return this.list.length}},first:{get:function(){return this.position=0,this.list.length>0?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.position<this.list.length?(this.position++,this.list[this.position]):null}},previous:{get:function(){return this.position>0?(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){var n=i(148),r=i(0),s=i(1057),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){var n=i(133),r=i(0),s=i(217),o=i(303),a=i(304),h=i(305),l=i(309),u=i(167),c=i(312),d=i(313),p=i(314),f=i(111),m=i(15),g=i(2),v=i(6),y=i(14),x=i(1063),w=new r({Extends:m,Mixins:[o,a,h,l,u,d,p,c,x],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(),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<n;r++)this.lineTo(t[r].x,t[r].y);return e&&this.lineTo(t[0].x,t[0].y),i&&this.closePath(),this.strokePath(),this},fillPoints: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<n;r++)this.lineTo(t[r].x,t[r].y);return e&&this.lineTo(t[0].x,t[0].y),i&&this.closePath(),this.fillPath(),this},strokeEllipseShape:function(t,e){void 0===e&&(e=32);var i=t.getPoints(e);return this.strokePoints(i,!0)},strokeEllipse:function(t,e,i,n,r){void 0===r&&(r=32);var s=new f(t,e,i,n).getPoints(r);return this.strokePoints(s,!0)},fillEllipseShape:function(t,e){void 0===e&&(e=32);var i=t.getPoints(e);return this.fillPoints(i,!0)},fillEllipse:function(t,e,i,n,r){void 0===r&&(r=32);var s=new f(t,e,i,n).getPoints(r);return this.fillPoints(s,!0)},arc:function(t,e,i,n,r,o,a){return void 0===o&&(o=!1),void 0===a&&(a=0),this.commandBuffer.push(s.ARC,t,e,i,n,r,o,a),this},slice:function(t,e,i,n,r,o,a){return void 0===o&&(o=!1),void 0===a&&(a=0),this.commandBuffer.push(s.BEGIN_PATH),this.commandBuffer.push(s.MOVE_TO,t,e),this.commandBuffer.push(s.ARC,t,e,i,n,r,o,a),this.commandBuffer.push(s.CLOSE_PATH),this},save:function(){return this.commandBuffer.push(s.SAVE),this},restore:function(){return this.commandBuffer.push(s.RESTORE),this},translateCanvas:function(t,e){return this.commandBuffer.push(s.TRANSLATE,t,e),this},scaleCanvas:function(t,e){return this.commandBuffer.push(s.SCALE,t,e),this},rotateCanvas:function(t){return this.commandBuffer.push(s.ROTATE,t),this},clear:function(){return this.commandBuffer.length=0,this.defaultFillColor>-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){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){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){var n=i(35),r=i(0),s=i(11),o=i(176),a=i(101),h=i(9),l=i(75),u=i(110),c=i(1071),d=i(20),p=i(79),f=new r({Extends:u,Mixins:[s.AlphaSingle,s.BlendMode,s.Depth,s.Mask,s.Pipeline,s.Visible,h,c],initialize:function(t,e){u.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.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(l.ADDED_TO_SCENE,t,this.scene),this.events.emit(d.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(l.REMOVED_FROM_SCENE,t,this.scene),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.remove(this,!0),this.displayList.queueDepthSort()),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){var n=i(0),r=i(11),s=i(15),o=i(450),a=i(110),h=i(452),l=i(1075),u=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;r<n.length;r++)this.createEmitter(n[r])}},addedToScene:function(){this.scene.sys.updateList.add(this)},removedFromScene:function(){this.scene.sys.updateList.remove(this)},setTexture:function(t,e){return this.texture=this.scene.sys.textures.get(t),this.setFrame(e)},setFrame:function(t){this.frame=this.texture.get(t);var e=this.texture.getFramesFromTextureSource(this.frame.sourceIndex),i=[];return e.forEach((function(t){i.push(t.name)})),this.frameNames=i,this.defaultFrame=this.frame,this},setEmitterFrames:function(t,e){Array.isArray(t)||(t=[t]);var i=e.frames;i.length=0;for(var n=0;n<t.length;n++){var r=t[n];-1!==this.frameNames.indexOf(r)&&i.push(this.texture.get(r))}return i.length>0?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<n.length;r++){var s=n[r];s.active&&s.emitParticle(t,e,i)}return this},emitParticleAt:function(t,e,i){return this.emitParticle(i,t,e)},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},getProcessors:function(){return this.wells.getAll("active",!0)},preUpdate:function(t,e){e*=this.timeScale;for(var i=this.emitters.list,n=0;n<i.length;n++){var r=i[n];r.active&&r.preUpdate(t,e)}},setAlpha:function(){},setScrollFactor:function(){},setBlendMode:function(){}});t.exports=u},function(t,e,i){var n=i(35),r=i(133),s=i(31),o=i(0),a=i(11),h=i(33),l=i(109),u=i(15),c=i(1),d=i(92),p=i(1079),f=i(141),m=i(12),g=i(222),v=new o({Extends:u,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),u.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=c,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,u=(t>>8&255)/255,c=(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(c,u,l,1),e),d.unbind(!0)}else{var x=this.context;h.setContext(x),x.fillStyle="rgba("+l+","+u+","+c+","+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(t){void 0===t&&(t=this._eraseMode);var e=this.renderer,i=this.renderTarget;if(i){var n=e.endCapture();e.pipelines.setUtility().blitFrame(n,i,1,!1,!1,t),e.resetScissor(),e.resetViewport()}else e.setContext();return this.dirty=!0,this},batchList:function(t,e,i,n,r){for(var s=0;s<t.length;s++){var o=t[s];o&&o!==this&&(o.renderWebGL||o.renderCanvas?this.drawGameObject(o,e,i):o.isParent||o.list?this.batchGroup(o.getChildren(),e,i):"string"==typeof o?this.batchTextureFrameKey(o,null,e,i,n,r):o instanceof l?this.batchTextureFrame(o,e,i,n,r):Array.isArray(o)&&this.batchList(o,e,i,n,r))}},batchGroup:function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=0),e+=this.frame.cutX,i+=this.frame.cutY;for(var n=0;n<t.length;n++){var r=t[n];if(r.willRender(this.camera)){var s=r.x+e,o=r.y+i;this.drawGameObject(r,s,o)}}},batchGameObjectWebGL:function(t,e,i){void 0===e&&(e=t.x),void 0===i&&(i=t.y);var n=t.x,r=t.y;t.setPosition(e+this.frame.cutX,i+this.frame.cutY),t.renderDirect?t.renderDirect(this.renderer,t,this.camera):t.renderWebGL(this.renderer,t,this.camera),t.setPosition(n,r)},batchGameObjectCanvas:function(t,e,i){void 0===e&&(e=t.x),void 0===i&&(i=t.y);var r=t.x,s=t.y;if(this._eraseMode){var o=t.blendMode;t.blendMode=n.ERASE}t.setPosition(e+this.frame.cutX,i+this.frame.cutY),t.renderCanvas(this.renderer,t,this.camera,null),t.setPosition(r,s),this._eraseMode&&(t.blendMode=o)},batchTextureFrameKey:function(t,e,i,n,r,s){var o=this.textureManager.getFrame(t,e);o&&this.batchTextureFrame(o,i,n,r,s)},batchTextureFrame:function(t,e,i,n,r){if(void 0===e&&(e=0),void 0===i&&(i=0),e+=this.frame.cutX,i+=this.frame.cutY,this.renderTarget)this.pipeline.batchTextureFrame(t,e,i,r,n,this.camera.matrix,null);else{var s=this.context,o=t.canvasData,a=t.source.image,h=this.camera.matrix;s.save(),s.globalCompositeOperation=this._eraseMode?"destination-out":"source-over",s.globalAlpha=n,h.setToContext(s),s.drawImage(a,o.x,o.y,o.width,o.height,e,i,o.width,o.height),s.restore()}},snapshotArea:function(t,e,i,n,r,s,o){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,r,!1,t,e,i,n,s,o):this.renderer.snapshotCanvas(this.canvas,r,!1,t,e,i,n,s,o),this},snapshot:function(t,e,i){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,t,!1,0,0,this.width,this.height,e,i):this.renderer.snapshotCanvas(this.canvas,t,!1,0,0,this.width,this.height,e,i),this},snapshotPixel:function(t,e,i){return this.renderTarget?this.renderer.snapshotFramebuffer(this.renderTarget.framebuffer,this.width,this.height,i,!0,t,e):this.renderer.snapshotCanvas(this.canvas,i,!0,t,e),this},preDestroy:function(){this._saved||(s.remove(this.canvas),this.renderTarget&&this.renderTarget.destroy(),this.texture.destroy(),this.camera.destroy(),this.canvas=null,this.context=null,this.texture=null)}});t.exports=v},function(t,e){t.exports=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}},function(t,e,i){var n=i(164),r=i(0),s=i(11),o=i(15),a=i(92),h=i(1085),l=i(3),u=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,u,c,d){void 0===r&&(r="__DEFAULT"),void 0===h&&(h=2),void 0===u&&(u=!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=u,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,c,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;n<i;n++)r[s=2*n]=t,r[s+1]=e;else if(t.length===i)for(n=0;n<i;n++)r[s=2*n]=t[n],r[s+1]=t[n];else{var o=t[0];for(n=0;n<i;n++)s=2*n,t.length>s&&(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;i<e;i++)n[r=2*i]=t[i],n[r+1]=t[i];else{var s=t[0];for(i=0;i<e;i++)r=2*i,t.length>r&&(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<o;n++)t.push({x:s+n*r,y:0});else for(s=-this.frame.halfHeight,r=this.frame.height/(o-1),n=0;n<o;n++)t.push({x:0,y:s+n*r})}var a=t.length,h=this.points.length;return a<1||(1===a&&(t.unshift({x:0,y:0}),a++),h!==a&&this.resizeArrays(a),this.points=t,this.updateUVs(),null!=e&&this.setColors(e),null!=i&&this.setAlphas(i)),this},updateUVs:function(){for(var t=this.uv,e=this.points.length,i=this.frame.u0,n=this.frame.v0,r=this.frame.u1,s=this.frame.v1,o=(r-i)/(e-1),a=(s-n)/(e-1),h=0;h<e;h++){var l,u,c,d,p=4*h;this.horizontal?(this._flipX?(l=r-h*o,c=r-h*o):(l=i+h*o,c=i+h*o),this._flipY?(u=s,d=n):(u=n,d=s)):(this._flipX?(l=i,c=r):(l=r,c=i),this._flipY?(u=s-h*a,d=s-h*a):(u=n+h*a,d=n+h*a)),t[p+0]=l,t[p+1]=u,t[p+2]=c,t[p+3]=d}return this},resizeArrays:function(t){var e=this.colors,i=this.alphas;this.vertices=new Float32Array(4*t),this.uv=new Float32Array(4*t),e=new Uint32Array(2*t),i=new Float32Array(2*t);for(var n=0;n<2*t;n++)e[n]=16777215,i[n]=1;return this.colors=e,this.alphas=i,this.dirty=!0,this},updateVertices:function(){var t=this._perp,e=this.points,i=this.vertices,n=e.length;if(this.dirty=!1,!(n<1)){for(var r,s=e[0],o=this.horizontal?this.frame.halfHeight:this.frame.halfWidth,a=0;a<n;a++){var h=e[a],l=4*a;r=a<n-1?e[a+1]:h,t.x=r.y-s.y,t.y=-(r.x-s.x);var u=t.length();t.x/=u,t.y/=u,t.x*=o,t.y*=o,i[l]=h.x+t.x,i[l+1]=h.y+t.y,i[l+2]=h.x-t.x,i[l+3]=h.y-t.y,s=h}return this}},setDebug:function(t,e){return this.debugGraphic=t,this.debugCallback=t||e?e||this.renderDebugVerts:null,this},renderDebugVerts:function(t,e,i){var n=t.debugGraphic,r=i[0],s=i[1],o=i[2],a=i[3];n.lineBetween(r,s,o,a);for(var h=4;h<e;h+=4){var l=i[h+0],u=i[h+1],c=i[h+2],d=i[h+3];n.lineBetween(r,s,l,u),n.lineBetween(o,a,c,d),n.lineBetween(o,a,l,u),n.lineBetween(l,u,c,d),r=l,s=u,o=c,a=d}},preDestroy:function(){this.anims.destroy(),this.anims=void 0,this.points=null,this.vertices=null,this.uv=null,this.colors=null,this.alphas=null,this.debugCallback=null,this.debugGraphic=null},flipX:{get:function(){return this._flipX},set:function(t){return this._flipX=t,this.updateUVs()}},flipY:{get:function(){return this._flipY},set:function(t){return this._flipY=t,this.updateUVs()}}});t.exports=u},function(t,e,i){var n=i(142),r=i(31),s=i(0),o=i(11),a=i(22),h=i(15),l=i(458),u=i(6),c=i(202),d=i(1088),p=i(459),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;o<s;o++){var a=r[o],h="";if(a=a.replace(/^ *|\s*$/gi,""),e.measureText(a).width<i)n+=a+"\n";else{for(var l=i,u=a.split(" "),c=0;c<u.length;c++){var d=u[c],p=d+" ",f=e.measureText(p).width;if(f>l){if(0===c){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);u[c]=g,h+=m}var v=u[c].length?c:c+1,y=u.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(" "),u=l.length-1,c=0;c<=u;c++){var d=l[c],p=e.measureText(d).width,f=p;c<u&&(f+=o),f>h&&c>0&&(n+="\n",h=i),n+=d,c<u?(n+=" ",h-=f):h-=p}a<s&&(n+="\n")}return n},getWrappedText:function(t){return void 0===t&&(t=this._text),this.style.syncFont(this.canvas,this.context),this.runWordWrap(t).split(this.splitRegExp)},setText:function(t){return t||0===t||(t=""),Array.isArray(t)&&(t=t.join("\n")),t!==this._text&&(this._text=t.toString(),this.updateText()),this},setStyle:function(t){return this.style.setStyle(t)},setFont:function(t){return this.style.setFont(t)},setFontFamily:function(t){return this.style.setFontFamily(t)},setFontSize:function(t){return this.style.setFontSize(t)},setFontStyle:function(t){return this.style.setFontStyle(t)},setFixedSize:function(t,e){return this.style.setFixedSize(t,e)},setBackgroundColor:function(t){return this.style.setBackgroundColor(t)},setFill:function(t){return this.style.setFill(t)},setColor:function(t){return this.style.setColor(t)},setStroke:function(t,e){return this.style.setStroke(t,e)},setShadow:function(t,e,i,n,r,s){return this.style.setShadow(t,e,i,n,r,s)},setShadowOffset:function(t,e){return this.style.setShadowOffset(t,e)},setShadowColor:function(t){return this.style.setShadowColor(t)},setShadowBlur:function(t){return this.style.setShadowBlur(t)},setShadowStroke:function(t){return this.style.setShadowStroke(t)},setShadowFill:function(t){return this.style.setShadowFill(t)},setWordWrapWidth:function(t,e){return this.style.setWordWrapWidth(t,e)},setWordWrapCallback:function(t,e){return this.style.setWordWrapCallback(t,e)},setAlign:function(t){return this.style.setAlign(t)},setResolution:function(t){return this.style.setResolution(t)},setLineSpacing:function(t){return this.lineSpacing=t,this.updateText()},setPadding:function(t,e,i,n){if("object"==typeof t){var r=t,s=u(r,"x",null);null!==s?(t=s,i=s):(t=u(r,"left",0),i=u(r,"right",t));var o=u(r,"y",null);null!==o?(e=o,n=o):(e=u(r,"top",0),n=u(r,"bottom",e))}else void 0===t&&(t=0),void 0===e&&(e=t),void 0===i&&(i=t),void 0===n&&(n=e);return this.padding.left=t,this.padding.top=e,this.padding.right=i,this.padding.bottom=n,this.updateText()},setMaxLines:function(t){return this.style.setMaxLines(t)},updateText:function(){var t=this.canvas,e=this.context,i=this.style,n=i.resolution,r=i.metrics;i.syncFont(t,e);var s=this._text;(i.wordWrapWidth||i.wordWrapCallback)&&(s=this.runWordWrap(this._text));var o,a=s.split(this.splitRegExp),h=l(this,r,a),u=this.padding;0===i.fixedWidth?(this.width=h.width+u.left+u.right,o=h.width):(this.width=i.fixedWidth,(o=this.width-u.left-u.right)<h.width&&(o=h.width)),0===i.fixedHeight?this.height=h.height+u.top+u.bottom:this.height=i.fixedHeight;var c,d,p=this.width,f=this.height;this.updateDisplayOrigin(),p*=n,f*=n,p=Math.max(p,1),f=Math.max(f,1),t.width!==p||t.height!==f?(t.width=p,t.height=f,this.frame.setSize(p,f),i.syncFont(t,e)):e.clearRect(0,0,p,f),e.save(),e.scale(n,n),i.backgroundColor&&(e.fillStyle=i.backgroundColor,e.fillRect(0,0,p,f)),i.syncStyle(t,e),e.textBaseline="alphabetic",e.translate(u.left,u.top);for(var m=0;m<h.lines;m++){if(c=i.strokeThickness/2,d=i.strokeThickness/2+m*h.lineHeight+r.ascent,m>0&&(d+=h.lineSpacing*m),i.rtl)c=p-c;else if("right"===i.align)c+=o-h.lineWidths[m];else if("center"===i.align)c+=(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 w=Math.floor(g/v),b=0;w>0;)x[b]+=" ",b=(b+1)%(x.length-1||1),--w;a[m]=x.join(" ")}this.autoRound&&(c=Math.round(c),d=Math.round(d)),i.strokeThickness&&(this.style.syncShadow(e,i.shadowStroke),e.strokeText(a[m],c,d)),i.color&&(this.style.syncShadow(e,i.shadowFill),e.fillText(a[m],c,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 A=this.input;return A&&!A.customHitArea&&(A.hitArea.width=this.width,A.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&&c(this.canvas),r.remove(this.canvas),this.texture.destroy()}});t.exports=f},function(t,e,i){var n=i(31),r=i(0),s=i(11),o=i(22),a=i(15),h=i(361),l=i(192),u=i(1091),c=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,u],initialize:function(t,e,i,r,s,l,u){var d=t.sys.renderer;a.call(this,t,"TileSprite");var p=t.sys.textures.get(l),f=p.get(u);r&&s?(r=Math.floor(r),s=Math.floor(s)):(r=f.width,s=f.height),this._tilePosition=new c,this._tileScale=new c(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(u),this.setOriginFromFrame(),this.initPipeline(),t.sys.game.events.on(o.CONTEXT_RESTORED,(function(t){if(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)this.dirty=!1;else{var e=this.fillContext,i=this.fillCanvas,n=this.potWidth,r=this.potHeight;this.renderer&&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&&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){var n=i(0),r=i(18),s=i(11),o=i(75),a=i(22),h=i(51),l=i(15),u=i(70),c=i(222),d=i(1094),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=c(),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(u.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 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(c(),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._codePaused=!1,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._codePaused=!1,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._lastUpdate&&(this.emit(o.VIDEO_LOOP,this),this._lastUpdate=0)},preUpdate:function(){var t=this.video;if(t){var e=t.currentTime;e!==this._lastUpdate&&(this._lastUpdate=e,this.updateTexture(),e>=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(u.GLOBAL_MUTE,this.globalMute,this),this._retryID&&window.clearTimeout(this._retryID)}});t.exports=f},function(t,e,i){var n=i(0),r=i(228),s=i(470),o=i(56),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<t.length;n++)e={x:0,y:0},"number"==typeof t[n]||"string"==typeof t[n]?(e.x=parseFloat(t[n]),e.y=parseFloat(t[n+1]),n++):Array.isArray(t[n])?(e.x=t[n][0],e.y=t[n][1]):(e.x=t[n].x,e.y=t[n].y),this.points.push(e),e.y<i&&(i=e.y);return this.calculateArea(i),this},calculateArea:function(){if(this.points.length<3)return this.area=0,this.area;for(var t,e,i=0,n=0;n<this.points.length-1;n++)t=this.points[n],i+=((e=this.points[n+1]).x-t.x)*(t.y+e.y);return t=this.points[0],e=this.points[this.points.length-1],i+=(t.x-e.x)*(e.y+t.y),this.area=.5*-i,this.area},getPoints:function(t,e,i){return s(this,t,e,i)}});t.exports=a},function(t,e){t.exports=function(t,e,i){for(var n=!1,r=-1,s=t.points.length-1;++r<t.points.length;s=r){var o=t.points[r].x,a=t.points[r].y,h=t.points[s].x,l=t.points[s].y;(a<=i&&i<l||l<=i&&i<a)&&e<(h-o)*(i-a)/(l-a)+o&&(n=!n)}return n}},function(t,e,i){var n=i(0),r=i(11),s=i(15),o=i(2),a=i(17),h=i(478),l=i(1176),u=i(25),c=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 u,this._tempMatrix2=new u,this._tempMatrix3=new u,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 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 u=0;u<4;u++)e[u]&&this.setSampler2D("iChannel"+u,e[u],u,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),u=o(i,"height",2),c=o(i,"border",0);e.texImage2D(e.TEXTURE_2D,0,h,l,u,c,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,u=l.resolution;u.value.x=i,u.value.y=n,l.time.value=r.game.loop.getDuration();var c=this.pointer;if(c){var d=l.mouse,p=c.x/i,f=1-c.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=c},function(t,e,i){var n=i(0),r=i(11),s=i(36),o=i(116),a=i(15),h=i(479),l=i(480),u=i(19),c=i(69),d=i(1179),p=i(79),f=i(39),m=i(117),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,u,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 c,this.viewPosition=new f,this.viewMatrix=new c,this.projectionMatrix=new c,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,u,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 u=this.scene.sys.cache.obj.get(t);return u&&l(u,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=u(this,i).calc,r=this.faces,s=[],o=0;o<r.length;o++){var a=r[o];a.contains(t,e,n)&&s.push(a)}return p(s,this.sortByDepth)},setDebug:function(t,e){return this.debugGraphic=t,this.debugCallback=t||e?e||this.renderDebug:null,this},isDirty:function(){var t=this.modelPosition,e=this.modelRotation,i=this.modelScale,n=this.dirtyCache,r=t.x,s=t.y,o=t.z,a=e.x,h=e.y,l=e.z,u=i.x,c=i.y,d=i.z,p=this.getFaceCount(),f=n[0],m=n[1],g=n[2],v=n[3],y=n[4],x=n[5],w=n[6],b=n[7],A=n[8],T=n[9];return n[0]=r,n[1]=s,n[2]=o,n[3]=a,n[4]=h,n[5]=l,n[6]=u,n[7]=c,n[8]=d,n[9]=p,f!==r||m!==s||g!==o||v!==a||y!==h||x!==l||w!==u||b!==c||A!==d||T!==p},preUpdate:function(){this.totalRendered=this.totalFrame,this.totalFrame=0;var t=this.dirtyCache;if(this.ignoreDirtyCache||t[10]||this.isDirty()){var e=this.width,i=this.height,n=this.viewMatrix,r=this.viewPosition;t[10]&&(n.identity(),n.translate(r),n.invert(),t[10]=0);var s=this.transformMatrix;s.setWorldMatrix(this.modelRotation,this.modelPosition,this.modelScale,this.viewMatrix,this.projectionMatrix);for(var o=r.z,a=this.faces,h=0;h<a.length;h++)a[h].transformCoordinatesLocal(s,e,i,o);this.depthSort()}},renderDebug:function(t,e){for(var i=t.debugGraphic,n=0;n<e.length;n++){var r=e[n],s=r.vertex1.tx,o=r.vertex1.ty,a=r.vertex2.tx,h=r.vertex2.ty,l=r.vertex3.tx,u=r.vertex3.ty;i.strokeTriangle(s,o,a,h,l,u)}},preDestroy:function(){this.clear(),this.debugCallback=null,this.debugGraphic=null}});t.exports=g},function(t,e,i){var n=i(50);t.exports=function(t,e){return n(t.x,t.y,e.x,e.y)<=t.radius+e.radius}},function(t,e,i){var n=i(4),r=i(233);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,u=t.y2,c=e.x,d=e.y,p=e.radius,f=l-a,m=u-h,g=a-c,v=h-d,y=f*f+m*m,x=2*(f*g+m*v),w=x*x-4*y*(g*g+v*v-p*p);if(0===w){var b=-x/(2*y);s=a+b*f,o=h+b*m,b>=0&&b<=1&&i.push(new n(s,o))}else if(w>0){var A=(-x-Math.sqrt(w))/(2*y);s=a+A*f,o=h+A*m,A>=0&&A<=1&&i.push(new n(s,o));var T=(-x+Math.sqrt(w))/(2*y);s=a+T*f,o=h+T*m,T>=0&&T<=1&&i.push(new n(s,o))}}return i}},function(t,e,i){var n=i(66),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,u=s,c=o;if(l>0){var d=(a*s+h*o)/l;u*=d,c*=d}return i.x=t.x1+u,i.y=t.y1+c,u*u+c*c<=l&&u*s+c*o>=0&&n(e,i.x,i.y)}},function(t,e,i){var n=i(4),r=i(96),s=i(488);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(),u=[new n,new n,new n,new n],c=[r(o,t,u[0]),r(a,t,u[1]),r(h,t,u[2]),r(l,t,u[3])],d=0;d<4;d++)c[d]&&i.push(u[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,u=t.x3-t.x1,c=t.y3-t.y1,d=t.x2-t.x1,p=t.y2-t.y1,f=u*u+c*c,m=u*d+c*p,g=d*d+p*p,v=f*g-m*m,y=0===v?0:1/v,x=t.x1,w=t.y1,b=0;b<e.length&&(s=(f*(l=d*(o=e[b].x-x)+p*(a=e[b].y-w))-m*(h=u*o+c*a))*y,!((r=(g*h-m*l)*y)>=0&&s>=0&&r+s<1&&(n.push({x:e[b].x,y:e[b].y}),i)));b++);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){t.exports={BUTTON_DOWN:i(1310),BUTTON_UP:i(1311),CONNECTED:i(1312),DISCONNECTED:i(1313),GAMEPAD_BUTTON_DOWN:i(1314),GAMEPAD_BUTTON_UP:i(1315)}},function(t,e,i){var n=i(17),r=i(156);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){var n=i(0),r=i(21),s=i(23),o=i(8),a=i(2),h=i(7),l=i(408),u=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():this.onProcessError()}});o.register("xml",(function(t,e,i){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.addFile(new u(this,t[n]));else this.addFile(new u(this,t,e,i));return this})),t.exports=u},function(t,e,i){var n=i(0),r=i(21),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 u=e;e=a(u,"key"),i=a(u,"url"),n=a(u,"xhrSettings"),o=a(u,"extension",o),r=a(u,"type",r),l=a(u,"cache",l)}var c={type:r,cache:l,extension:o,responseType:"text",key:e,url:i,xhrSettings:n};s.call(this,t,c)},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<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,i));return this})),t.exports=l},function(t,e,i){t.exports={Acceleration:i(1368),Angular:i(1369),Bounce:i(1370),Debug:i(1371),Drag:i(1372),Enable:i(1373),Friction:i(1374),Gravity:i(1375),Immovable:i(1376),Mass:i(1377),OverlapCirc:i(523),OverlapRect:i(244),Pushable:i(1378),Size:i(1379),Velocity:i(1380)}},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 u=t.bodies,c={position:{x:e,y:i},left:e,top:i,right:e+n,bottom:i+r,isCircle:!1},d=t.intersects;u.iterate((function(t){d(t,c)&&a.push(t)}))}return h.concat(a)}},function(t,e,i){t.exports={COLLIDE:i(1381),OVERLAP:i(1382),PAUSE:i(1383),RESUME:i(1384),TILE_COLLIDE:i(1385),TILE_OVERLAP:i(1386),WORLD_BOUNDS:i(1387),WORLD_STEP:i(1388)}},function(t,e,i){var n=i(62);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._dx<e._dx&&(-(s=t.x-e.width-e.x)>o&&!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){var n=i(62);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._dy<e._dy&&(-(s=t.y-e.bottom)>o&&!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){t.exports={Bounce:i(1495),Collision:i(1496),Force:i(1497),Friction:i(1498),Gravity:i(1499),Mass:i(1500),Sensor:i(1501),SetBody:i(1502),Sleep:i(1503),Static:i(1520),Transform:i(1521),Velocity:i(1522)}},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<r.length;h++)s[h]=r[h].contact;var l=r.length;l<s.length&&(s.length=l),t.separation=e.depth,i.setActive(t,!0,n)}else!0===t.isActive&&i.setActive(t,!1,n)},i.setActive=function(t,e,i){e?(t.isActive=!0,t.timeUpdated=i):(t.isActive=!1,t.activeContacts.length=0)},i.id=function(t,e){return t.id<e.id?"A"+t.id+"B"+e.id:"A"+e.id+"B"+t.id}},function(t,e,i){t.exports={CalculateFacesAt:i(252),CalculateFacesWithin:i(63),CheckIsoBounds:i(541),Copy:i(1420),CreateFromTiles:i(1421),CullBounds:i(543),CullTiles:i(544),Fill:i(1422),FilterTiles:i(1423),FindByIndex:i(1424),FindTile:i(1425),ForEachTile:i(1426),GetCullTilesFunction:i(1427),GetTileAt:i(158),GetTileAtWorldXY:i(1428),GetTilesWithin:i(26),GetTilesWithinShape:i(1429),GetTilesWithinWorldXY:i(529),GetTileToWorldXFunction:i(1430),GetTileToWorldXYFunction:i(1431),GetTileToWorldYFunction:i(1432),GetWorldToTileXFunction:i(1433),GetWorldToTileXYFunction:i(1434),GetWorldToTileYFunction:i(1435),HasTileAt:i(562),HasTileAtWorldXY:i(1436),HexagonalCullBounds:i(546),HexagonalCullTiles:i(545),HexagonalTileToWorldXY:i(550),HexagonalTileToWorldY:i(554),HexagonalWorldToTileXY:i(556),HexagonalWorldToTileY:i(560),IsInLayerBounds:i(119),IsometricCullTiles:i(547),IsometricTileToWorldXY:i(551),IsometricWorldToTileXY:i(557),PutTileAt:i(257),PutTileAtWorldXY:i(1437),PutTilesAt:i(1438),Randomize:i(1439),RemoveTileAt:i(563),RemoveTileAtWorldXY:i(1440),RenderDebug:i(1441),ReplaceByIndex:i(542),RunCull:i(159),SetCollision:i(1442),SetCollisionBetween:i(1443),SetCollisionByExclusion:i(1444),SetCollisionByProperty:i(1445),SetCollisionFromCollisionGroup:i(1446),SetLayerCollisionIndex:i(160),SetTileCollision:i(72),SetTileIndexCallback:i(1447),SetTileLocationCallback:i(1448),Shuffle:i(1449),StaggeredCullBounds:i(549),StaggeredCullTiles:i(548),StaggeredTileToWorldXY:i(552),StaggeredTileToWorldY:i(555),StaggeredWorldToTileXY:i(558),StaggeredWorldToTileY:i(561),SwapByIndex:i(1450),TileToWorldX:i(253),TileToWorldXY:i(553),TileToWorldY:i(254),WeightedRandomize:i(1451),WorldToTileX:i(255),WorldToTileXY:i(559),WorldToTileY:i(256)}},function(t,e,i){var n=i(158);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){var n=i(85),r=i(119),s=i(252),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],u=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 c=t;null===h.data[i][e]?h.data[i][e]=new n(h,c,e,i,h.tileWidth,h.tileHeight):h.data[i][e].index=c}var d=h.data[i][e],p=-1!==h.collideIndexes.indexOf(d.index);return o(d,p),a&&u!==d.collides&&s(e,i,h),d}},function(t,e,i){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){var n=i(40),r=i(120),s=i(121),o=i(85);t.exports=function(t,e,i,a,h){for(var l=new r({tileWidth:i,tileHeight:a}),u=new s({name:t,tileWidth:i,tileHeight:a,format:n.ARRAY_2D,layers:[l]}),c=[],d=e.length,p=0,f=0;f<e.length;f++){c[f]=[];for(var m=e[f],g=0;g<m.length;g++){var v=parseInt(m[g],10);isNaN(v)||-1===v?c[f][g]=h?null:new o(l,-1,g,f,i,a):c[f][g]=new o(l,v,g,f,i,a)}0===p&&(p=m.length)}return u.width=l.width=p,u.height=l.height=d,u.widthInPixels=l.widthInPixels=p*i,u.heightInPixels=l.heightInPixels=d*a,l.data=c,u}},function(t,e,i){var n=i(571),r=i(261),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){var n=i(40),r=i(121),s=i(564),o=i(580);t.exports=function(t,e,i,a,h,l,u,c){void 0===i&&(i=32),void 0===a&&(a=32),void 0===h&&(h=10),void 0===l&&(l=10),void 0===c&&(c=!1);var d=null;if(Array.isArray(u))d=s(void 0!==e?e:"map",n.ARRAY_2D,u,i,a,c);else if(void 0!==e){var p=t.cache.tilemap.get(e);p&&(d=s(e,p.format,p.data,i,a,c))}return null===d&&(d=new r({tileWidth:i,tileHeight:a,width:h,height:l})),new o(t,d)}},function(t,e,i){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){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},u=null,c=typeof e;if("number"===c)h=function(){return e};else if("string"===c){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"===c)h=e;else if("object"===c)if(n(a=e)||r(a)||i(a))i(e)&&(u=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:u,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){var n=i(0),r=i(9),s=i(267),o=i(16),a=i(5),h=i(100),l=i(14),u=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;n<this.totalData;n++){var r=this.data[n];r.key===t&&(r.end=e,i&&(r.start=r.current))}return this},restart:function(){return this.elapsed=0,this.progress=0,this.totalElapsed=0,this.totalProgress=0,this.state===h.ACTIVE?this.seek(0):this.state===h.REMOVED?(this.seek(0),this.parent.makeActive(this),this):this.state===h.PENDING_ADD?this:this.play()},calcDuration:function(){for(var t=0,e=l.MAX_SAFE_INTEGER,i=this.data,n=0;n<this.totalData;n++){var r=i[n];r.t1=r.duration+r.hold,r.yoyo&&(r.t1+=r.duration),r.t2=r.t1+r.repeatDelay,r.totalDuration=r.delay+r.t1,-1===r.repeat?r.totalDuration+=999999999999*r.t2:r.repeat>0&&(r.totalDuration+=r.t2*r.repeat),r.totalDuration>t&&(t=r.totalDuration),r.delay<e&&(e=r.delay)}this.duration=Math.max(t,.001),this.loopCounter=-1===this.loop?999999999999:this.loop,this.loopCounter>0?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;i<this.totalData;i++){var n=t[i],r=n.target,s=n.gen,o=n.key,a=n.index;n.delay=s.delay(r,o,0,a,e,this),n.duration=Math.max(s.duration(r,o,0,a,e,this),.001),n.hold=s.hold(r,o,0,a,e,this),n.repeat=s.repeat(r,o,0,a,e,this),n.repeatDelay=s.repeatDelay(r,o,0,a,e,this)}return this.calcDuration(),this.progress=0,this.totalProgress=0,this.elapsed=0,this.totalElapsed=0,this.state=h.INIT,!0},makeActive:function(){this.parent.makeActive(this),this.dispatchTweenEvent(s.TWEEN_ACTIVE,this.callbacks.onActive)},nextState:function(){this.loopCounter>0?(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;r<i;r++){var s=e[r],o=s.target,a=s.key,l=s.index;s.progress=0,s.elapsed=0,s.repeatCounter=-1===s.repeat?999999999999:s.repeat,t?(s.start=s.getStartValue(o,a,s.start,l,n,this),s.end=s.getEndValue(o,a,s.end,l,n,this),s.current=s.start,s.state=h.PLAYING_FORWARD):s.state=h.PENDING_RENDER,s.delay>0&&(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;r<this.totalData;r++){var s=i[r],o=s.target,a=s.gen,l=s.key,u=s.index;s.progress=0,s.elapsed=0,s.repeatCounter=-1===s.repeat?999999999999:s.repeat,s.delay=a.delay(o,l,0,u,n,this),s.duration=Math.max(a.duration(o,l,0,u,n,this),.001),s.hold=a.hold(o,l,0,u,n,this),s.repeat=a.repeat(o,l,0,u,n,this),s.repeatDelay=a.repeatDelay(o,l,0,u,n,this),s.current=s.start,s.state=h.PLAYING_FORWARD,this.updateTweenData(this,s,0,u,n),s.delay>0&&(s.elapsed=s.delay,s.state=h.DELAY)}this.calcDuration();var c=!1;this.state===h.PAUSED&&(c=!0,this.state=h.ACTIVE),this.isSeeking=!0;do{this.update(0,e)}while(this.totalProgress<t);return this.isSeeking=!1,c&&(this.state=h.PAUSED),this},setCallback:function(t,e,i,n){return this.callbacks[t]={func:e,scope:n,params:i},this},complete:function(t){return void 0===t&&(t=0),t?(this.state=h.COMPLETE_DELAY,this.countdown=t):(this.state=h.PENDING_REMOVE,this.dispatchTweenEvent(s.TWEEN_COMPLETE,this.callbacks.onComplete)),this},remove:function(){return this.parent.remove(this),this},stop:function(t){return this.state===h.ACTIVE&&void 0!==t&&this.seek(t),this.state!==h.REMOVED&&(this.state!==h.PAUSED&&this.state!==h.PENDING_ADD||(this.parentIsTimeline?(this.parent.manager._destroy.push(this),this.parent.manager._toProcess++):(this.parent._destroy.push(this),this.parent._toProcess++)),this.dispatchTweenEvent(s.TWEEN_STOP,this.callbacks.onStop),this.removeAllListeners(),this.state=h.PENDING_REMOVE),this},update:function(t,e){if(this.state===h.PAUSED)return!1;switch(this.useFrames&&(e=1*this.parent.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 h.ACTIVE:this.hasStarted||this.isSeeking||(this.startDelay-=e,this.startDelay<=0&&(this.hasStarted=!0,this.dispatchTweenEvent(s.TWEEN_START,this.callbacks.onStart)));for(var i=!1,n=0;n<this.totalData;n++){var r=this.data[n];this.updateTweenData(this,r,e)&&(i=!0)}i||this.nextState();break;case h.LOOP_DELAY:this.countdown-=e,this.countdown<=0&&(this.state=h.ACTIVE,this.dispatchTweenEvent(s.TWEEN_LOOP,this.callbacks.onLoop));break;case h.OFFSET_DELAY:this.countdown-=e,this.countdown<=0&&(this.state=h.ACTIVE);break;case h.COMPLETE_DELAY:this.countdown-=e,this.countdown<=0&&(this.state=h.PENDING_REMOVE,this.dispatchTweenEvent(s.TWEEN_COMPLETE,this.callbacks.onComplete))}return this.state===h.PENDING_REMOVE},dispatchTweenDataEvent:function(t,e,i){this.isSeeking||(this.emit(t,this,i.key,i.target,i.current,i.previous),e&&(e.params[1]=i.target,e.func.apply(e.scope,e.params)))},dispatchTweenEvent:function(t,e){this.isSeeking||(this.emit(t,this,this.targets),e&&(e.params[1]=this.targets,e.func.apply(e.scope,e.params)))},setStateFromEnd:function(t,e,i){return e.yoyo?(e.elapsed=i,e.progress=i/e.duration,e.flipX&&e.target.toggleFlipX(),e.flipY&&e.target.toggleFlipY(),this.dispatchTweenDataEvent(s.TWEEN_YOYO,t.callbacks.onYoyo,e),e.start=e.getStartValue(e.target,e.key,e.start,e.index,t.totalTargets,t),h.PLAYING_BACKWARD):e.repeatCounter>0?(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,u=r/o;if(e.elapsed=r,e.progress=u,e.previous=e.current,1===u)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 c=l?e.ease(u):e.ease(1-u);e.current=e.start+(e.end-e.start)*c,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}});u.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=u},function(t,e,i){t.exports={TIMELINE_COMPLETE:i(1466),TIMELINE_LOOP:i(1467),TIMELINE_PAUSE:i(1468),TIMELINE_RESUME:i(1469),TIMELINE_START:i(1470),TIMELINE_UPDATE:i(1471),TWEEN_ACTIVE:i(1472),TWEEN_COMPLETE:i(1473),TWEEN_LOOP:i(1474),TWEEN_REPEAT:i(1475),TWEEN_START:i(1476),TWEEN_STOP:i(1477),TWEEN_UPDATE:i(1478),TWEEN_YOYO:i(1479)}},function(t,e){t.exports=function(t,e,i,n,r,s,o,a,h,l,u,c,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:u,repeat:c,repeatDelay:d},state:0}}},function(t,e,i){var n=i(68);t.exports=function(t){return n(t,-Math.PI,Math.PI)}},function(t,e,i){var n=i(68);t.exports=function(t){return n(t,-180,180)}},function(t,e,i){var n={};t.exports=n;var r=i(83),s=i(32);n.fromVertices=function(t){for(var e={},i=0;i<t.length;i++){var n=(i+1)%t.length,o=r.normalise({x:t[n].y-t[i].y,y:t[i].x-t[n].x}),a=0===o.y?1/0:o.x/o.y;e[a=a.toFixed(3).toString()]=o}return s.values(e)},n.rotate=function(t,e){if(0!==e)for(var i=Math.cos(e),n=Math.sin(e),r=0;r<t.length;r++){var s,o=t[r];s=o.x*i-o.y*n,o.y=o.x*n+o.y*i,o.x=s}}},function(t,e,i){t.exports={AFTER_ADD:i(1504),AFTER_REMOVE:i(1505),AFTER_UPDATE:i(1506),BEFORE_ADD:i(1507),BEFORE_REMOVE:i(1508),BEFORE_UPDATE:i(1509),COLLISION_ACTIVE:i(1510),COLLISION_END:i(1511),COLLISION_START:i(1512),DRAG_END:i(1513),DRAG:i(1514),DRAG_START:i(1515),PAUSE:i(1516),RESUME:i(1517),SLEEP_END:i(1518),SLEEP_START:i(1519)}},function(t,e,i){var n={};t.exports=n;var r=i(274),s=i(250),o=i(84);n.collisions=function(t,e){for(var i=[],a=e.pairs.table,h=e.metrics,l=0;l<t.length;l++){var u=t[l][0],c=t[l][1];if((!u.isStatic&&!u.isSleeping||!c.isStatic&&!c.isSleeping)&&n.canCollide(u.collisionFilter,c.collisionFilter)&&(h.midphaseTests+=1,o.overlaps(u.bounds,c.bounds)))for(var d=u.parts.length>1?1:0;d<u.parts.length;d++)for(var p=u.parts[d],f=c.parts.length>1?1:0;f<c.parts.length;f++){var m=c.parts[f];if(p===u&&m===c||o.overlaps(p.bounds,m.bounds)){var g,v=a[s.id(p,m)];g=v&&v.isActive?v.collision:null;var y=r.collides(p,m,g);h.narrowphaseTests+=1,y.reused&&(h.narrowReuseCount+=1),y.collided&&(i.push(y),h.narrowDetections+=1)}}}return i},n.canCollide=function(t,e){return t.group===e.group&&0!==t.group?t.group>0:0!=(t.mask&e.category)&&0!=(e.mask&t.category)}},function(t,e,i){var n={};t.exports=n;var r=i(64),s=i(83);n.collides=function(t,e,i){var o,a,h,l,u=!1;if(i){var c=t.parent,d=e.parent,p=c.speed*c.speed+c.angularSpeed*c.angularSpeed+d.speed*d.speed+d.angularSpeed*d.angularSpeed;u=i&&i.collided&&p<.2,l=i}else l={collided:!1,bodyA:t,bodyB:e};if(i&&u){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.overlap<a.overlap?(h=o,l.axisBody=t):(h=a,l.axisBody=e),l.axisNumber=h.axisNumber}l.bodyA=t.id<e.id?t:e,l.bodyB=t.id<e.id?e:t,l.collided=!0,l.depth=h.overlap,l.parentA=l.bodyA.parent,l.parentB=l.bodyB.parent,t=l.bodyA,e=l.bodyB,s.dot(h.axis,s.sub(e.position,t.position))<0?l.normal={x:h.axis.x,y:h.axis.y}:l.normal={x:-h.axis.x,y:-h.axis.y},l.tangent=s.perp(l.normal),l.penetration=l.penetration||{},l.penetration.x=l.normal.x*l.depth,l.penetration.y=l.normal.y*l.depth;var v=n._findSupports(t,e,l.normal),y=[];if(r.contains(t.vertices,v[0])&&y.push(v[0]),r.contains(t.vertices,v[1])&&y.push(v[1]),y.length<2){var x=n._findSupports(e,t,s.neg(l.normal));r.contains(e.vertices,x[0])&&y.push(x[0]),y.length<2&&r.contains(e.vertices,x[1])&&y.push(x[1])}return y.length<1&&(y=[v[0]]),l.supports=y,l},n._overlapAxes=function(t,e,i){for(var r,o,a=s._temp[0],h=s._temp[1],l={overlap:Number.MAX_VALUE},u=0;u<i.length;u++){if(o=i[u],n._projectToAxis(a,t,o),n._projectToAxis(h,e,o),(r=Math.min(a.max-h.min,h.max-a.min))<=0)return l.overlap=r,l;r<l.overlap&&(l.overlap=r,l.axis=o,l.axisNumber=u)}return l},n._projectToAxis=function(t,e,i){for(var n=s.dot(e[0],i),r=n,o=1;o<e.length;o+=1){var a=s.dot(e[o],i);a>r?r=a:a<n&&(n=a)}t.min=n,t.max=r},n._findSupports=function(t,e,i){for(var n,r,o,a,h=Number.MAX_VALUE,l=s._temp[0],u=e.vertices,c=t.position,d=0;d<u.length;d++)r=u[d],l.x=r.x-c.x,l.y=r.y-c.y,(n=-s.dot(i,l))<h&&(h=n,o=r);return r=u[o.index-1>=0?o.index-1:u.length-1],l.x=r.x-c.x,l.y=r.y-c.y,h=-s.dot(i,l),a=r,r=u[(o.index+1)%u.length],l.x=r.x-c.x,l.y=r.y-c.y,(n=-s.dot(i,l))<h&&(a=r),[o,a]}},function(t,e,i){t.exports={AlignTo:i(601),Angle:i(602),Call:i(603),GetFirst:i(604),GetLast:i(605),GridAlign:i(606),IncAlpha:i(678),IncX:i(679),IncXY:i(680),IncY:i(681),PlaceOnCircle:i(682),PlaceOnEllipse:i(683),PlaceOnLine:i(684),PlaceOnRectangle:i(685),PlaceOnTriangle:i(686),PlayAnimation:i(687),PropertyValueInc:i(46),PropertyValueSet:i(27),RandomCircle:i(688),RandomEllipse:i(689),RandomLine:i(690),RandomRectangle:i(691),RandomTriangle:i(692),Rotate:i(693),RotateAround:i(694),RotateAroundDistance:i(695),ScaleX:i(696),ScaleXY:i(697),ScaleY:i(698),SetAlpha:i(699),SetBlendMode:i(700),SetDepth:i(701),SetHitArea:i(702),SetOrigin:i(703),SetRotation:i(704),SetScale:i(705),SetScaleX:i(706),SetScaleY:i(707),SetScrollFactor:i(708),SetScrollFactorX:i(709),SetScrollFactorY:i(710),SetTint:i(711),SetVisible:i(712),SetX:i(713),SetXY:i(714),SetY:i(715),ShiftPosition:i(716),Shuffle:i(717),SmootherStep:i(718),SmoothStep:i(719),Spread:i(720),ToggleVisible:i(721),WrapInRectangle:i(722)}},function(t,e,i){var n=i(123),r=[];r[n.BOTTOM_CENTER]=i(277),r[n.BOTTOM_LEFT]=i(278),r[n.BOTTOM_RIGHT]=i(279),r[n.LEFT_BOTTOM]=i(280),r[n.LEFT_CENTER]=i(281),r[n.LEFT_TOP]=i(282),r[n.RIGHT_BOTTOM]=i(283),r[n.RIGHT_CENTER]=i(284),r[n.RIGHT_TOP]=i(285),r[n.TOP_CENTER]=i(286),r[n.TOP_LEFT]=i(287),r[n.TOP_RIGHT]=i(288),t.exports=function(t,e,i,n,s){return r[i](t,e,n,s)}},function(t,e,i){var n=i(42),r=i(87),s=i(88),o=i(52);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){var n=i(42),r=i(43),s=i(53),o=i(52);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){var n=i(42),r=i(44),s=i(54),o=i(52);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){var n=i(42),r=i(43),s=i(55),o=i(54);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){var n=i(89),r=i(43),s=i(90),o=i(54);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){var n=i(43),r=i(45),s=i(54),o=i(52);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){var n=i(42),r=i(44),s=i(55),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){var n=i(89),r=i(44),s=i(90),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){var n=i(44),r=i(45),s=i(53),o=i(52);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){var n=i(87),r=i(45),s=i(55),o=i(88);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){var n=i(43),r=i(45),s=i(55),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){var n=i(44),r=i(45),s=i(55),o=i(54);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){var n=i(123),r=[];r[n.BOTTOM_CENTER]=i(290),r[n.BOTTOM_LEFT]=i(291),r[n.BOTTOM_RIGHT]=i(292),r[n.CENTER]=i(293),r[n.LEFT_CENTER]=i(295),r[n.RIGHT_CENTER]=i(296),r[n.TOP_CENTER]=i(297),r[n.TOP_LEFT]=i(298),r[n.TOP_RIGHT]=i(299),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){var n=i(42),r=i(87),s=i(55),o=i(88);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){var n=i(42),r=i(43),s=i(55),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){var n=i(42),r=i(44),s=i(55),o=i(54);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){var n=i(294),r=i(87),s=i(89);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){var n=i(88),r=i(90);t.exports=function(t,e,i){return n(t,e),r(t,i)}},function(t,e,i){var n=i(89),r=i(43),s=i(90),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){var n=i(89),r=i(44),s=i(90),o=i(54);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){var n=i(87),r=i(45),s=i(88),o=i(52);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){var n=i(43),r=i(45),s=i(53),o=i(52);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){var n=i(44),r=i(45),s=i(54),o=i(52);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){var n=i(169),r=i(98),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){var n=i(302),r=i(169),s=i(98),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<e;h++){var l=s(h/e,0,o.PI2);a.push(r(t,l))}return a}},function(t,e){t.exports=function(t){return Math.PI*t.radius*2}},function(t,e,i){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){var n=i(35),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){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){var n=i(171),r=i(130);t.exports=function(t,e,i,s){void 0===s&&(s=[]),!e&&i>0&&(e=r(t)/i);for(var o=0;o<e;o++){var a=o/e;s.push(n(t,a))}return s}},function(t,e,i){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){var n=i(310),r=i(311),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){var n=i(0),r=i(22),s=i(91),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&&i.on(s.RESIZE,this.createMask,this)},createMask:function(){var t=this.renderer;if(t&&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&&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&&this.renderer.off(s.RESIZE,this.createMask,this),this.bitmapMask=null,this.prevFramebuffer=null,this.renderer=null}});t.exports=o},function(t,e,i){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){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){var n=i(14),r=i(25),s=i(177),o=i(269),a=i(270),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){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){t.exports={CHANGE_DATA:i(638),CHANGE_DATA_KEY:i(639),DESTROY:i(640),REMOVE_DATA:i(641),SET_DATA:i(642)}},function(t,e,i){var n=i(130),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<i;l++)switch(s.push(new r(o,a)),h){case 0:(o+=e)>=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<s?1:-1,u=r<o?1:-1,c=a-h;i.push({x:n,y:r});for(var d=1;n!==s||r!==o;){var p=c<<1;p>-h&&(c-=h,n+=l),p<a&&(c+=a,r+=u),d%e==0&&i.push({x:n,y:r}),d++}return i}},function(t,e){t.exports=function(t,e,i){if(!e.length)return NaN;if(1===e.length)return e[0];var n,r,s=1;if(i){if(t<e[0][i])return e[0];for(;e[s][i]<t;)s++}else for(;e[s]<t;)s++;return s>e.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){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){var n=i(185),r=i(0),s=i(102),o=i(9),a=i(132),h=i(22),l=i(2),u=i(6),c=i(186),d=i(322),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)||(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=u(n,"meta",null),o=u(n,"frames",null);return s&&o&&u(s,"frameTags",[]).forEach((function(n){var s=[],a=l(n,"name",null),h=l(n,"from",0),u=l(n,"to",0),c=l(n,"direction","forward");if(a&&(!e||e&&e.indexOf(a)>-1)){for(var d=[],p=Number.MAX_SAFE_INTEGER,f=h;f<=u;f++){var m=f.toString(),g=o[m];if(g){var v=l(g,"duration",Number.MAX_SAFE_INTEGER);v<p&&(p=v),d.push({frame:m,duration:v})}}d.forEach((function(e){s.push({key:t,frame:e.frame,duration:p-e.duration})}));var y=p*s.length;"reverse"===c&&(s=s.reverse());var x={key:a,frames:s,duration:y,yoyo:"pingpong"===c},w=r.create(x);w&&i.push(w)}})),i},create:function(t){var e=t.key,i=!1;return e&&((i=this.get(e))||(i=new n(this,e,t),this.anims.set(e,i),this.emit(a.ADD_ANIMATION,e,i))),i},fromJSON:function(t,e){void 0===e&&(e=!1),e&&this.anims.clear(),"string"==typeof t&&(t=JSON.parse(t));var i=[];if(t.hasOwnProperty("anims")&&Array.isArray(t.anims)){for(var n=0;n<t.anims.length;n++)i.push(this.create(t.anims[n]));t.hasOwnProperty("globalTimeScale")&&(this.globalTimeScale=t.globalTimeScale)}else t.hasOwnProperty("key")&&"frame"===t.type&&i.push(this.create(t));return i},generateFrameNames:function(t,e){var i,n=u(e,"prefix",""),r=u(e,"start",0),s=u(e,"end",0),o=u(e,"suffix",""),a=u(e,"zeroPad",0),h=u(e,"outputArray",[]),l=u(e,"frames",!1),p=this.textureManager.get(t);if(!p)return h;if(e)for(l||(l=d(r,s)),i=0;i<l.length;i++){var f=n+c(l[i],a,"0",1)+o;p.has(f)&&h.push({key:t,frame:f})}else for(l=p.getFrameNames(),i=0;i<l.length;i++)h.push({key:t,frame:l[i]});return h},generateFrameNumbers:function(t,e){var i=u(e,"start",0),n=u(e,"end",-1),r=u(e,"first",!1),s=u(e,"outputArray",[]),o=u(e,"frames",!1),a=this.textureManager.get(t);if(!a)return s;r&&a.has(r)&&s.push({key:t,frame:r}),o||(-1===n&&(n=a.frameTotal-2),o=d(i,n));for(var h=0;h<o.length;h++)a.has(o[h])&&s.push({key:t,frame:o[h]});return s},get:function(t){return this.anims.get(t)},pauseAll:function(){return this.paused||(this.paused=!0,this.emit(a.PAUSE_ALL)),this},play:function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++)e[i].anims.play(t);return this},staggerPlay:function(t,e,i,n){void 0===i&&(i=0),void 0===n&&(n=!0),Array.isArray(e)||(e=[e]);var r=e.length;n||r--;for(var s=0;s<e.length;s++){var o=i<0?Math.abs(i)*(r-s):i*s;e[s].anims.playAfterDelay(t,o)}return this},remove:function(t){var e=this.get(t);return e&&(this.emit(a.REMOVE_ANIMATION,t,e),this.anims.delete(t),this.removeMix(t)),e},resumeAll:function(){return this.paused&&(this.paused=!1,this.emit(a.RESUME_ALL)),this},toJSON:function(t){var e={anims:[],globalTimeScale:this.globalTimeScale};return void 0!==t&&""!==t?e.anims.push(this.anims.get(t).toJSON()):this.anims.each((function(t,i){e.anims.push(i.toJSON())})),e},destroy:function(){this.anims.clear(),this.mixes.clear(),this.textureManager=null,this.game=null}});t.exports=p},function(t,e){t.exports=function(t,e,i,n){var r,s=[],o=!1;if((i||n)&&(o=!0,i||(i=""),n||(n="")),e<t)for(r=t;r>=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){var n=i(0),r=i(102),s=i(9),o=i(324),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){t.exports={ADD:i(736),REMOVE:i(737)}},function(t,e,i){var n=i(323),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<t.length;e++)this[t[e]].destroy(),this[t[e]]=null;for(var i in this.custom)this.custom[i].destroy();this.custom=null,this.game=null}});t.exports=o},function(t,e,i){var n=i(133),r=i(190),s=i(18),o=i(0),a=i(11),h=i(333),l=i(37),u=i(135),c=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 c(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,c=this._follow,d=this.deadzone,p=this.scrollX,f=this.scrollY;d&&r(d,this.midPoint.x,this.midPoint.y);var m=!1;if(c&&!this.panEffect.isRunning){var g=c.x-this.followOffset.x,v=c.y-this.followOffset.y;d?(g<d.x?p=u(p,p-(d.x-g),this.lerp.x):g>d.right&&(p=u(p,p+(g-d.right),this.lerp.x)),v<d.y?f=u(f,f-(d.y-v),this.lerp.y):v>d.bottom&&(f=u(f,f+(v-d.bottom),this.lerp.y))):(p=u(p,g-a,this.lerp.x),f=u(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 w=t/s,b=e/s,A=y-w/2,T=x-b/2;this.roundPixels&&(A=Math.round(A),T=Math.round(T)),this.worldView.setTo(A,T,w,b),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,c)},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,u=t.y-o;return this.midPoint.set(l,u),this.scrollX=l-a,this.scrollY=u-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){var n=i(38);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+(e<i?6:0):s===e?a=(i-t)/o+2:s===i&&(a=(t-e)/o+4),a/=6),n.hasOwnProperty("_h")?(n._h=a,n._s=h,n._v=l):(n.h=a,n.s=h,n.v=l),n}},function(t,e){t.exports=function(t){return t>16777215?{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){var n=i(38);t.exports=function(t){return new n(t.r,t.g,t.b,t.a)}},function(t,e,i){var n=i(38);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){t.exports={Fade:i(761),Flash:i(762),Pan:i(763),Shake:i(796),RotateTo:i(797),Zoom:i(798)}},function(t,e,i){t.exports={In:i(764),Out:i(765),InOut:i(766)}},function(t,e,i){t.exports={In:i(767),Out:i(768),InOut:i(769)}},function(t,e,i){t.exports={In:i(770),Out:i(771),InOut:i(772)}},function(t,e,i){t.exports={In:i(773),Out:i(774),InOut:i(775)}},function(t,e,i){t.exports={In:i(776),Out:i(777),InOut:i(778)}},function(t,e,i){t.exports={In:i(779),Out:i(780),InOut:i(781)}},function(t,e,i){t.exports=i(782)},function(t,e,i){t.exports={In:i(783),Out:i(784),InOut:i(785)}},function(t,e,i){t.exports={In:i(786),Out:i(787),InOut:i(788)}},function(t,e,i){t.exports={In:i(789),Out:i(790),InOut:i(791)}},function(t,e,i){t.exports={In:i(792),Out:i(793),InOut:i(794)}},function(t,e,i){t.exports=i(795)},function(t,e,i){var n=i(0),r=i(33),s=i(347),o=i(2),a=i(6),h=i(7),l=i(193),u=i(1),c=i(197),d=i(187),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.domPointerEvents=a(t,"dom.pointerEvents","none"),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.preserveDrawingBuffer=a(i,"preserveDrawingBuffer",!1),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",u),this.postBoot=a(t,"callbacks.postBoot",u),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=c.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){t.exports={os:i(105),browser:i(136),features:i(191),input:i(808),audio:i(809),video:i(810),fullscreen:i(811),canvasFeatures:i(348)}},function(t,e,i){var n,r,s,o=i(31),a={supportInverseAlpha:!1,supportNewBlendModes:!1};t.exports=("function"!=typeof importScripts&&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<e+i}},function(t,e,i){var n=i(357);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){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){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){var n=i(184);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<<Math.ceil(e)}},function(t,e){t.exports=function(t,e){var i=t.x,n=t.y;return t.x=i*Math.cos(e)-n*Math.sin(e),t.y=i*Math.sin(e)+n*Math.cos(e),t}},function(t,e){t.exports=function(t){return t>0?Math.ceil(t):Math.floor(t)}},function(t,e,i){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],u=l*s-o*h,c=-l*r+o*a,d=h*r-s*a,p=e*u+i*c+n*d;return p?(p=1/p,t[0]=u*p,t[1]=(-l*i+n*h)*p,t[2]=(o*i-n*s)*p,t[3]=c*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],u=e[8],c=t.val,d=c[0],p=c[1],f=c[2],m=c[3],g=c[4],v=c[5],y=c[6],x=c[7],w=c[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*u,e[3]=m*i+g*s+v*h,e[4]=m*n+g*o+v*l,e[5]=m*r+g*a+v*u,e[6]=y*i+x*s+w*h,e[7]=y*n+x*o+w*l,e[8]=y*r+x*a+w*u,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,u=e*a,c=i*o,d=i*a,p=n*a,f=r*s,m=r*o,g=r*a,v=this.val;return v[0]=1-(c+p),v[3]=l+g,v[6]=u-m,v[1]=l-g,v[4]=1-(h+p),v[7]=d+f,v[2]=u+m,v[5]=d-f,v[8]=1-(h+c),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],u=e[7],c=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,w=n*l-s*a,b=n*u-o*a,A=r*l-s*h,T=r*u-o*h,S=s*u-o*l,E=c*g-d*m,M=c*v-p*m,_=c*y-f*m,C=d*v-p*g,P=d*y-f*g,R=p*y-f*v,L=x*R-w*P+b*C+A*_-T*M+S*E;return L?(L=1/L,i[0]=(h*R-l*P+u*C)*L,i[1]=(l*_-a*R-u*M)*L,i[2]=(a*P-h*_+u*E)*L,i[3]=(s*P-r*R-o*C)*L,i[4]=(n*R-s*_+o*M)*L,i[5]=(r*_-n*P-o*E)*L,i[6]=(g*S-v*T+y*A)*L,i[7]=(v*b-m*S-y*w)*L,i[8]=(m*T-g*b+y*x)*L,this):null}});t.exports=n},function(t,e,i){var n=i(0),r=i(364),s=i(1),o=i(39),a=new Int8Array([1,2,0]),h=new Float32Array([0,0,0]),l=new o(1,0,0),u=new o(0,1,0),c=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?(c.copy(l).cross(t).length()<1e-6&&c.copy(u).cross(t),c.normalize(),this.setAxisAngle(c,Math.PI)):i>.999999?this.set(0,0,0,1):(c.copy(t).cross(e),this._x=c.x,this._y=c.y,this._z=c.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,u=i*o+n*a+r*h+s*l;u<0&&(u=-u,o=-o,a=-a,h=-h,l=-l);var c=1-e,d=e;if(1-u>1e-6){var p=Math.acos(u),f=Math.sin(p);c=Math.sin((1-e)*p)/f,d=Math.sin(e*p)/f}return this.set(c*i+d*o,c*n+d*a,c*r+d*h,c*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),u=Math.sin(r);switch(t.order){case"XYZ":this.set(h*o*a+s*l*u,s*l*a-h*o*u,s*o*u+h*l*a,s*o*a-h*l*u,e);break;case"YXZ":this.set(h*o*a+s*l*u,s*l*a-h*o*u,s*o*u-h*l*a,s*o*a+h*l*u,e);break;case"ZXY":this.set(h*o*a-s*l*u,s*l*a+h*o*u,s*o*u+h*l*a,s*o*a-h*l*u,e);break;case"ZYX":this.set(h*o*a-s*l*u,s*l*a+h*o*u,s*o*u-h*l*a,s*o*a+h*l*u,e);break;case"YZX":this.set(h*o*a+s*l*u,s*l*a+h*o*u,s*o*u-h*l*a,s*o*a-h*l*u,e);break;case"XZY":this.set(h*o*a-s*l*u,s*l*a-h*o*u,s*o*u+h*l*a,s*o*a+h*l*u,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],u=i[6],c=i[10],d=n+a+c;return d>0?(e=.5/Math.sqrt(d+1),this.set((u-h)*e,(s-l)*e,(o-r)*e,.25/e)):n>a&&n>c?(e=2*Math.sqrt(1+n-a-c),this.set(.25*e,(r+o)/e,(s+l)/e,(u-h)/e)):a>c?(e=2*Math.sqrt(1+a-n-c),this.set((r+o)/e,.25*e,(h+u)/e,(s-l)/e)):(e=2*Math.sqrt(1+c-n-a),this.set((s+l)/e,(h+u)/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){var n=i(367),r=i(31),s=i(33),o=i(191);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,u=l.width,c=l.height;e.canvas?(t.canvas=e.canvas,t.canvas.width=u,t.canvas.height=c):t.canvas=r.create(t,u,c,e.renderType),e.canvasStyle&&(t.canvas.style=e.canvasStyle),e.antialias||n.setCrisp(t.canvas),e.renderType!==s.HEADLESS&&(a=i(368),h=i(371),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){var n=i(37),r=i(369),s=i(0),o=i(33),a=i(9),h=i(91),l=i(370),u=i(104),c=i(106),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(c.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(u.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,u=i.renderToTexture?i.context:t.sys.context;u.save(),this.game.scene.customViewports&&(u.beginPath(),u.rect(s,o,a,l),u.clip()),this.currentContext=u;var c=i.mask;c&&c.preRenderCanvas(this,null,i._maskCamera),i.transparent||(u.fillStyle=i.backgroundColor.rgba,u.fillRect(s,o,a,l)),u.globalAlpha=i.alpha,u.globalCompositeOperation="source-over",this.drawCount+=r,i.renderToTexture&&i.emit(n.PRE_RENDER,i),i.matrix.copyToContext(u);for(var d=0;d<r;d++){var p=e[d];p.mask&&p.mask.preRenderCanvas(this,p,i),p.renderCanvas(this,p,i),p.mask&&p.mask.postRenderCanvas(this,p,i)}u.setTransform(1,0,0,1,0,0),u.globalCompositeOperation="source-over",u.globalAlpha=1,i.flashEffect.postRenderCanvas(u),i.fadeEffect.postRenderCanvas(u),i.dirty=!1,c&&c.postRenderCanvas(this),u.restore(),i.renderToTexture&&(i.emit(n.POST_RENDER,i),i.renderToGame&&t.sys.context.drawImage(i.canvas,s,o))},postRender:function(){this.gameContext.restore(),this.emit(h.POST_RENDER);var t=this.snapshotState;t.callback&&(r(this.gameCanvas,t),t.callback=null)},snapshotCanvas:function(t,e,i,n,s,o,a,h,l){void 0===i&&(i=!1),this.snapshotArea(n,s,o,a,e,h,l);var u=this.snapshotState;return u.getPixel=i,r(this.canvas,u),u.callback=null,this},snapshot:function(t,e,i){return this.snapshotArea(0,0,this.gameCanvas.width,this.gameCanvas.height,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.gameCanvas.width),a.height=Math.min(n,this.gameCanvas.height),this},snapshotPixel:function(t,e,i){return this.snapshotArea(t,e,1,1,i),this.snapshotState.getPixel=!0,this},batchSprite:function(t,e,i,n){var r=i.alpha*t.alpha;if(0!==r){var s=this.currentContext,o=this._tempMatrix1,a=this._tempMatrix2,h=e.canvasData,l=h.x,u=h.y,c=e.cutWidth,d=e.cutHeight,p=e.customPivot,f=e.source.resolution,m=t.displayOriginX,g=t.displayOriginY,v=-m+e.x,y=-g+e.y;if(t.isCropped){var x=t._crop;x.flipX===t.flipX&&x.flipY===t.flipY||e.updateCropUVs(x,t.flipX,t.flipY),c=x.cw,d=x.ch,l=x.cx,u=x.cy,v=-m+x.x,y=-g+x.y,t.flipX&&(v>=0?v=-(v+c):v<0&&(v=Math.abs(v)-c)),t.flipY&&(y>=0?y=-(y+d):y<0&&(y=Math.abs(y)-d))}var w=1,b=1;t.flipX&&(p||(v+=-e.realWidth+2*m),w=-1),t.flipY&&(p||(y+=-e.realHeight+2*g),b=-1),a.applyITRS(t.x,t.y,t.rotation,t.scaleX*w,t.scaleY*b),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,u,c,d,v,y,c/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){var n=i(31),r=i(38),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))),u=s(e,"width",t.width),c=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||u!==t.width||c!==t.height){var p=n.createWebGL(this,u,c);p.getContext("2d").drawImage(t,h,l,u,c,0,0,u,c);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){var n=i(35),r=i(348);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){var n=i(93),r=i(37),s=i(0),o=i(33),a=i(9),h=i(91),l=i(22),u=i(138),c=i(69),d=i(1),p=i(372),f=i(141),m=i(104),g=i(106),v=i(12),y=i(383),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,preserveDrawingBuffer:e.preserveDrawingBuffer};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 u="WEBGL_compressed_texture_",d="WEBKIT_"+u;this.compression.ETC1=e.getExtension(u+"etc1")||e.getExtension(d+"etc1"),this.compression.PVRTC=e.getExtension(u+"pvrtc")||e.getExtension(d+"pvrtc"),this.compression.S3TC=e.getExtension(u+"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;a<this.maxTextures;m++)e.deleteTexture(f[m]);else f=new Array(this.maxTextures);for(var y=0;y<this.maxTextures;y++){var x=e.createTexture();e.activeTexture(e.TEXTURE0+y),e.bindTexture(e.TEXTURE_2D,x),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,1,1,0,e.RGBA,e.UNSIGNED_BYTE,new Uint8Array([0,0,255,255])),f[y]=x,this.textureIndexes.push(y)}return this.tempTextures=f,this.currentActiveTexture=1,this.startActiveTexture++,e.activeTexture(e.TEXTURE1),this.pipelines=new p(this),this.setBlendMode(o.BlendModes.NORMAL),this.projectionMatrix=(new c).identity(),i.textures.once(g.READY,this.boot,this),this},boot:function(){var t=this.game,e=this.pipelines,i=t.scale.baseSize;this.width=i.width,this.height=i.height,this.isBooted=!0,this.renderTarget=new f(this,this.width,this.height,1,0,!0,!0),e.boot(t.config.pipeline),this.blankTexture=t.textures.getFrame("__DEFAULT"),this.whiteTexture=t.textures.getFrame("__WHITE");var n=this.gl;n.bindFramebuffer(n.FRAMEBUFFER,null),n.enable(n.SCISSOR_TEST),t.scale.on(m.RESIZE,this.onResize,this),this.resize(i.width,i.height)},onResize:function(t,e){e.width===this.width&&e.height===this.height||this.resize(e.width,e.height)},beginCapture:function(t,e){void 0===t&&(t=this.width),void 0===e&&(e=this.height),this.renderTarget.bind(!0,t,e),this.setProjectionMatrix(t,e),this.resetTextures()},endCapture:function(){return this.renderTarget.unbind(!0),this.resetProjectionMatrix(),this.renderTarget},resize:function(t,e){var i=this.gl;return this.width=t,this.height=e,this.setProjectionMatrix(t,e),i.viewport(0,0,t,e),this.drawingBufferHeight=i.drawingBufferHeight,i.scissor(0,i.drawingBufferHeight-e,t,e),this.defaultScissor[2]=t,this.defaultScissor[3]=e,this.emit(h.RESIZE,t,e),this},getAspectRatio:function(){return this.width/this.height},setProjectionMatrix:function(t,e){return t===this.projectionWidth&&e===this.projectionHeight||(this.projectionWidth=t,this.projectionHeight=e,this.projectionMatrix.ortho(0,t,e,0,-1e3,1e3)),this},resetProjectionMatrix:function(){this.projectionWidth=this.width,this.projectionHeight=this.height,this.projectionMatrix.ortho(0,this.width,this.height,0,-1e3,1e3)},hasExtension:function(t){return!!this.supportedExtensions&&this.supportedExtensions.indexOf(t)},getExtension:function(t){return this.hasExtension(t)?(t in this.extensions||(this.extensions[t]=this.gl.getExtension(t)),this.extensions[t]):null},flush:function(){this.pipelines.flush()},pushScissor:function(t,e,i,n,r){void 0===r&&(r=this.drawingBufferHeight);var s=[t,e,i,n];return this.scissorStack.push(s),this.setScissor(t,e,i,n,r),this.currentScissor=s,s},setScissor:function(t,e,i,n,r){void 0===r&&(r=this.drawingBufferHeight);var s=this.gl,o=this.currentScissor,a=i>0&&n>0;if(o&&a){var h=o[0],l=o[1],u=o[2],c=o[3];a=h!==t||l!==e||u!==i||c!==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.glIndexCounter<this.startActiveTexture&&(t.glIndexCounter=this.startActiveTexture,i<this.maxTextures?(t.glIndex=i,e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,t.glTexture),this.currentActiveTexture++):(this.flush(),this.startActiveTexture++,this.textureFlush++,t.glIndexCounter=this.startActiveTexture,t.glIndex=1,e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,t.glTexture),this.currentActiveTexture=2)),this.isTextureClean=!1,t.glIndex},isNewNormalMap:function(t,e){return this.textureZero!==t||this.normalTexture!==e},setTextureZero:function(t,e){if(this.textureZero!==t){e&&this.flush();var i=this.gl;i.activeTexture(i.TEXTURE0),i.bindTexture(i.TEXTURE_2D,t),this.textureZero=t}},clearTextureZero:function(){this.textureZero=null},setNormalMap:function(t){if(this.normalTexture!==t){var e=this.gl;e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,t),this.normalTexture=t,1===this.currentActiveTexture&&(this.currentActiveTexture=2)}},clearNormalMap:function(){this.normalTexture=null,this.startActiveTexture++,this.currentActiveTexture=1,this.textureFlush++},unbindTextures:function(){for(var t=this.gl,e=this.tempTextures,i=0;i<e.length;i++)t.activeTexture(t.TEXTURE0+i),t.bindTexture(t.TEXTURE_2D,null);this.normalTexture=null,this.textureZero=null,this.currentActiveTexture=1,this.startActiveTexture++,this.textureFlush++},resetTextures:function(t){if(void 0===t&&(t=!1),!this.isTextureClean){this.flush();var e=this.gl,i=this.tempTextures;if(t){for(var n=0;n<i.length;n++)e.activeTexture(e.TEXTURE0+n),e.bindTexture(e.TEXTURE_2D,i[n]);e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,i[1]),this.isTextureClean=!0}else e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,i[0]),e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,i[1]);this.normalTexture=null,this.textureZero=null,this.currentActiveTexture=1,this.startActiveTexture++,this.textureFlush++}},setTexture2D:function(t){if(this.pipelines.forceZero())return this.setTextureZero(t,!0),0;var e=this.gl,i=this.currentActiveTexture;return t.glIndexCounter<this.startActiveTexture&&(t.glIndexCounter=this.startActiveTexture,i<this.maxTextures?(t.glIndex=i,e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,t),this.currentActiveTexture++):(this.flush(),this.startActiveTexture++,this.textureFlush++,t.glIndexCounter=this.startActiveTexture,t.glIndex=1,e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,t),this.currentActiveTexture=2)),this.isTextureClean=!1,t.glIndex},pushFramebuffer:function(t,e,i,n){return t===this.currentFramebuffer?this:(this.fboStack.push(t),this.setFramebuffer(t,e,i,n))},setFramebuffer:function(t,e,i,n){if(void 0===e&&(e=!1),void 0===i&&(i=!1),void 0===n&&(n=!0),t===this.currentFramebuffer)return this;var r=this.gl,s=this.width,o=this.height;return t&&t.renderTexture&&n?(s=t.renderTexture.width,o=t.renderTexture.height):this.flush(),r.bindFramebuffer(r.FRAMEBUFFER,t),n&&r.viewport(0,0,s,o),e&&(t?(this.drawingBufferHeight=o,this.pushScissor(0,0,s,o)):(this.drawingBufferHeight=this.height,this.popScissor())),this.currentFramebuffer=t,i&&this.resetTextures(),this},popFramebuffer:function(t,e,i){void 0===t&&(t=!1),void 0===e&&(e=!1),void 0===i&&(i=!0);var n=this.fboStack;n.pop();var r=n[n.length-1];return r||(r=null),this.setFramebuffer(r,t,e,i),r},setProgram:function(t){return t!==this.currentProgram&&(this.flush(),this.gl.useProgram(t),this.currentProgram=t,!0)},resetProgram:function(){return this.gl.useProgram(this.currentProgram),this},createTextureFromSource:function(t,e,i,n){var r=this.gl,s=r.NEAREST,a=r.NEAREST,h=r.CLAMP_TO_EDGE;e=t?t.width:e,i=t?t.height:i;var l=u(e,i);return l&&(h=r.REPEAT),n===o.ScaleModes.LINEAR&&this.config.antialias&&(s=l?this.mipmapFilter:r.LINEAR,a=r.LINEAR),t||"number"!=typeof e||"number"!=typeof i?this.createTexture2D(0,s,a,h,h,r.RGBA,t):this.createTexture2D(0,s,a,h,h,r.RGBA,null,e,i)},createTexture2D:function(t,e,i,n,r,s,o,a,h,l,c,d){l=null==l||l,void 0===c&&(c=!1),void 0===d&&(d=!1);var p=this.gl,f=p.createTexture();p.activeTexture(p.TEXTURE0);var m=p.getParameter(p.TEXTURE_BINDING_2D);return p.bindTexture(p.TEXTURE_2D,f),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,e),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,i),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,r),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,n),p.pixelStorei(p.UNPACK_PREMULTIPLY_ALPHA_WEBGL,l),p.pixelStorei(p.UNPACK_FLIP_Y_WEBGL,d),null==o?p.texImage2D(p.TEXTURE_2D,t,s,a,h,0,s,p.UNSIGNED_BYTE,null):(c||(a=o.width,h=o.height),p.texImage2D(p.TEXTURE_2D,t,s,s,p.UNSIGNED_BYTE,o)),u(a,h)&&p.generateMipmap(p.TEXTURE_2D),m&&p.bindTexture(p.TEXTURE_2D,m),f.isAlphaPremultiplied=l,f.isRenderTexture=!1,f.width=a,f.height=h,f.glIndex=0,f.glIndexCounter=-1,f},createFramebuffer:function(t,e,i,n){var r,s=this.gl,o=s.createFramebuffer();if(this.setFramebuffer(o),n){var a=s.createRenderbuffer();s.bindRenderbuffer(s.RENDERBUFFER,a),s.renderbufferStorage(s.RENDERBUFFER,s.DEPTH_STENCIL,t,e),s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,a)}if(i.isRenderTexture=!0,i.isAlphaPremultiplied=!1,s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,i,0),(r=s.checkFramebufferStatus(s.FRAMEBUFFER))!==s.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer status: "+{36054:"Incomplete Attachment",36055:"Missing Attachment",36057:"Incomplete Dimensions",36061:"Framebuffer Unsupported"}[r]);return o.renderTexture=i,this.setFramebuffer(null),this.resetTextures(),o},createProgram:function(t,e){var i=this.gl,n=i.createProgram(),r=i.createShader(i.VERTEX_SHADER),s=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(r,t),i.shaderSource(s,e),i.compileShader(r),i.compileShader(s),!i.getShaderParameter(r,i.COMPILE_STATUS))throw new Error("Vertex Shader failed:\n"+i.getShaderInfoLog(r));if(!i.getShaderParameter(s,i.COMPILE_STATUS))throw new Error("Fragment Shader failed:\n"+i.getShaderInfoLog(s));if(i.attachShader(n,r),i.attachShader(n,s),i.linkProgram(n),!i.getProgramParameter(n,i.LINK_STATUS))throw new Error("Link Program failed:\n"+i.getProgramInfoLog(n));return i.useProgram(n),n},createVertexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return i.bindBuffer(i.ARRAY_BUFFER,n),i.bufferData(i.ARRAY_BUFFER,t,e),i.bindBuffer(i.ARRAY_BUFFER,null),n},createIndexBuffer:function(t,e){var i=this.gl,n=i.createBuffer();return i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,n),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t,e),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,null),n},deleteTexture:function(t,e){return e&&this.resetTextures(!0),t&&this.gl.deleteTexture(t),this},deleteFramebuffer:function(t){return t&&(this.gl.deleteFramebuffer(t),n(this.fboStack,t),this.currentFramebuffer===t&&(this.currentFramebuffer=null)),this},deleteProgram:function(t){return t&&this.gl.deleteProgram(t),this},deleteBuffer:function(t){return this.gl.deleteBuffer(t),this},preRenderCamera:function(t){var e=t.x,i=t.y,n=t.width,s=t.height,o=t.backgroundColor;t.emit(r.PRE_RENDER,t),this.pipelines.preBatchCamera(t),this.pushScissor(e,i,n,s),t.mask&&(this.currentCameraMask.mask=t.mask,this.currentCameraMask.camera=t._maskCamera,t.mask.preRenderWebGL(this,t,t._maskCamera)),o.alphaGL>0&&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;s<n;s++){this.finalType=s===n-1;var a=e[s],l=a.mask;(r=this.currentMask).mask&&r.mask!==l&&r.mask.postRenderWebGL(this,r.camera),l&&r.mask!==l&&l.preRenderWebGL(this,a,i),a.blendMode!==this.currentBlendMode&&this.setBlendMode(a.blendMode);var u=a.type;u!==this.currentType&&(this.newType=!0,this.currentType=u),this.finalType?this.nextTypeMatch=!1:this.nextTypeMatch=e[s+1].type===this.currentType,a.renderWebGL(this,a,i),this.newType=!1}(r=this.currentMask).mask&&r.mask.postRenderWebGL(this,r.camera),this.setBlendMode(o.BlendModes.NORMAL),this.postRenderCamera(i)}},postRender:function(){if(!this.contextLost){this.flush(),this.emit(h.POST_RENDER);var t=this.snapshotState;t.callback&&(y(this.canvas,t),t.callback=null),this.textureFlush>0&&(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,u){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 c=this.currentFramebuffer;this.snapshotArea(s,o,a,h,n,l,u);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(c),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=u(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=u(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<e.length;i++)t.deleteTexture(e[i]);this.pipelines.destroy(),this.removeAllListeners(),this.fboStack=[],this.maskStack=[],this.extensions={},this.textureIndexes=[],this.gl=null,this.game=null,this.canvas=null,this.contextLost=!0,this.currentMask=null,this.currentCameraMask=null}});t.exports=x},function(t,e,i){var n=i(0),r=i(92),s=i(102),o=i(373),a=i(376),h=i(377),l=i(108),u=i(378),c=i(379),d=i(380),p=i(381),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,c],[r.LIGHT_PIPELINE,h],[r.POINTLIGHT_PIPELINE,u],[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)||(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}},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<e.length;i++){var n=e[i];n.active&&n.postBatch(t)}}},preBatchCamera: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)}}},postBatchCamera:function(t){if(t.hasPostPipeline){this.flush();for(var e=t.postPipelines,i=0;i<e.length;i++){var n=e[i];n.active&&n.postBatch(t)}}},isCurrent:function(t,e){var i=this.renderer,n=this.current;return n&&!e&&(e=n.currentShader),!(n!==t||e.program!==i.currentProgram)},copyFrame:function(t,e,i,n,r){return this.setUtility(this.UTILITY_PIPELINE.copyShader).copyFrame(t,e,i,n,r),this},copyToGame:function(t){return this.setUtility(this.UTILITY_PIPELINE.copyShader).copyToGame(t),this},drawFrame:function(t,e,i,n){return this.setUtility(this.UTILITY_PIPELINE.colorMatrixShader).drawFrame(t,e,i,n),this},blendFrames:function(t,e,i,n,r){return this.setUtility(this.UTILITY_PIPELINE.linearShader).blendFrames(t,e,i,n,r),this},blendFramesAdditive:function(t,e,i,n,r){return this.setUtility(this.UTILITY_PIPELINE.addShader).blendFramesAdditive(t,e,i,n,r),this},clearFrame:function(t,e){return this.UTILITY_PIPELINE.clearFrame(t,e),this},blitFrame:function(t,e,i,n,r,s){return this.setUtility(this.UTILITY_PIPELINE.copyShader).blitFrame(t,e,i,n,r,s),this},copyFrameRect:function(t,e,i,n,r,s,o,a){return this.UTILITY_PIPELINE.copyFrameRect(t,e,i,n,r,s,o,a),this},forceZero:function(){return this.current&&this.current.forceZero},setMulti:function(){return this.set(this.MULTI_PIPELINE)},setUtility:function(t){return this.UTILITY_PIPELINE.bind(t)},rebind:function(t){void 0===t&&this.previous&&(t=this.previous);var e=this.renderer,i=e.gl;i.disable(i.DEPTH_TEST),i.disable(i.CULL_FACE),e.hasActiveStencilMask()?i.clear(i.DEPTH_BUFFER_BIT):(i.disable(i.STENCIL_TEST),i.clear(i.DEPTH_BUFFER_BIT|i.STENCIL_BUFFER_BIT)),i.viewport(0,0,e.width,e.height),e.currentProgram=null,e.setBlendMode(0,!0);var n=this.pipelines.entries;for(var r in n)n[r].glReset=!0;t&&(this.current=t,t.rebind()),e.resetTextures()},clear:function(){var t=this.renderer;this.flush(),this.current?(this.current.unbind(),this.previous=this.current,this.current=null):this.previous=null,t.currentProgram=null,t.setBlendMode(0,!0)},destroy:function(){this.flush(),this.classes.clear(),this.postPipelineClasses.clear(),this.pipelines.clear(),this.renderer=null,this.game=null,this.classes=null,this.postPipelineClasses=null,this.pipelines=null,this.current=null,this.previous=null}});t.exports=f},function(t,e,i){var n=i(0),r=i(2),s=i(866),o=i(867),a=i(107),h=i(58),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){t.exports={AFTER_FLUSH:i(868),BEFORE_FLUSH:i(869),BIND:i(870),BOOT:i(871),DESTROY:i(872),REBIND:i(873),RESIZE:i(874)}},function(t,e,i){var n=i(0),r=i(2),s=i(107),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<t.length;o++){var a=t[o],h=a.name,l=r(a,"size",1),u=r(a,"type",s.FLOAT),c=u.enum,d=u.size,p=!!a.normalized;n.push({name:h,size:l,type:c,normalized:p,offset:i,enabled:!1,location:-1}),4===d?e+=l:e++,i+=l*d}this.vertexSize=i,this.vertexComponentCount=e,this.attributes=n},bind:function(t,e){return void 0===t&&(t=!1),void 0===e&&(e=!1),e&&this.pipeline.flush(),this.renderer.setProgram(this.program),t&&this.setAttribPointers(),this},rebind:function(){return this.renderer.setProgram(this.program),this.setAttribPointers(!0),this},setAttribPointers:function(t){void 0===t&&(t=!1);for(var e=this.gl,i=this.vertexSize,n=this.attributes,r=this.program,s=0;s<n.length;s++){var o=n[s],a=o.size,h=o.type,l=o.offset,u=o.enabled,c=o.location,d=!!o.normalized;if(t){var p=e.getAttribLocation(r,o.name);p>=0?(e.enableVertexAttribArray(p),e.vertexAttribPointer(p,a,h,d,i,l),o.enabled=!0,o.location=p):-1!==p&&e.disableVertexAttribArray(p)}else u?e.vertexAttribPointer(c,a,h,d,i,l):!u&&c>-1&&(e.disableVertexAttribArray(c),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;t<o;t++){var a=n.getActiveUniform(r,t);if(a){e=a.name,null!==(i=n.getUniformLocation(r,e))&&(s[e]={name:e,location:i,value1:null,value2:null,value3:null,value4:null});var h=e.indexOf("[");h>0&&(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,n){var r=this.uniforms[e];return r?((n||r.value1!==i)&&(r.value1=i,this.renderer.setProgram(this.program),t.call(this.gl,r.location,i),this.pipeline.currentShader=this),this):this},setUniform2:function(t,e,i,n,r){var s=this.uniforms[e];return s?((r||s.value1!==i||s.value2!==n)&&(s.value1=i,s.value2=n,this.renderer.setProgram(this.program),t.call(this.gl,s.location,i,n),this.pipeline.currentShader=this),this):this},setUniform3:function(t,e,i,n,r,s){var o=this.uniforms[e];return o?((s||o.value1!==i||o.value2!==n||o.value3!==r)&&(o.value1=i,o.value2=n,o.value3=r,this.renderer.setProgram(this.program),t.call(this.gl,o.location,i,n,r),this.pipeline.currentShader=this),this):this},setUniform4:function(t,e,i,n,r,s,o){var a=this.uniforms[e];return a?((o||a.value1!==i||a.value2!==n||a.value3!==r||a.value4!==s)&&(a.value1=i,a.value2=n,a.value3=r,a.value4=s,this.renderer.setProgram(this.program),t.call(this.gl,a.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,!0)},set2fv:function(t,e){return this.setUniform1(this.gl.uniform2fv,t,e,!0)},set3fv:function(t,e){return this.setUniform1(this.gl.uniform3fv,t,e,!0)},set4fv:function(t,e){return this.setUniform1(this.gl.uniform4fv,t,e,!0)},set1iv:function(t,e){return this.setUniform1(this.gl.uniform1iv,t,e,!0)},set2iv:function(t,e){return this.setUniform1(this.gl.uniform2iv,t,e,!0)},set3iv:function(t,e){return this.setUniform1(this.gl.uniform3iv,t,e,!0)},set4iv:function(t,e){return this.setUniform1(this.gl.uniform4iv,t,e,!0)},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,!0)},setMatrix3fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix3fv,t,e,i,!0)},setMatrix4fv:function(t,e,i){return this.setUniform2(this.gl.uniformMatrix4fv,t,e,i,!0)},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){var n=i(0),r=i(59),s=i(2),o=i(875),a=i(876),h=i(25),l=i(107),u=i(58),c=new n({Extends:u,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}]),u.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),u=o.getY(t,e),c=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,u,c,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),u=h.getY(t,e),c=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,u,c,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,u=this.fillTint.TR,c=this.fillTint.BL,d=0;d<a;++d)o=t[d],h.push(o.x,o.y);a=(s=r(h)).length;for(var p=0;p<a;p+=3){var f=2*s[p+0],m=2*s[p+1],g=2*s[p+2],v=h[f+0],y=h[f+1],x=h[m+0],w=h[m+1],b=h[g+0],A=h[g+1],T=n.getX(v,y),S=n.getY(v,y),E=n.getX(x,w),M=n.getY(x,w),_=n.getX(b,A),C=n.getY(b,A);this.batchTri(T,S,E,M,_,C,l,u,c)}h.length=0},batchStrokePath:function(t,e,i,n,r){this.renderer.pipelines.set(this),this.prevQuad[4]=0,this.firstQuad[4]=0;for(var s=t.length-1,o=0;o<s;o++){var a=t[o],h=t[o+1];this.batchLine(a.x,a.y,h.x,h.y,a.width/2,h.width/2,e,o,!i&&o===s-1,n,r)}},batchLine:function(t,e,i,n,r,s,o,a,h,l,u){this.renderer.pipelines.set(this);var c=this.calcMatrix;u&&u.multiply(l,c);var d=i-t,p=n-e,f=Math.sqrt(d*d+p*p),m=r*(n-e)/f,g=r*(t-i)/f,v=s*(n-e)/f,y=s*(t-i)/f,x=i-v,w=n-y,b=t-m,A=e-g,T=i+v,S=n+y,E=t+m,M=e+g,_=c.getX(x,w),C=c.getY(x,w),P=c.getX(b,A),R=c.getY(b,A),L=c.getX(T,S),O=c.getY(T,S),D=c.getX(E,M),B=c.getY(E,M),I=this.strokeTint,F=I.TL,k=I.TR,N=I.BL,z=I.BR;if(this.batchQuad(D,B,P,R,_,C,L,O,F,k,N,z),!(o<=2)){var U=this.prevQuad,V=this.firstQuad;a>0&&U[4]?this.batchQuad(D,B,P,R,U[0],U[1],U[2],U[3],F,k,N,z):(V[0]=D,V[1]=B,V[2]=P,V[3]=R,V[4]=1),h&&V[4]?this.batchQuad(_,C,L,O,V[0],V[1],V[2],V[3],F,k,N,z):(U[0]=_,U[1]=C,U[2]=L,U[3]=O,U[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,u,c){var d=!1;return this.shouldFlush(6)&&(this.flush(),d=!0),this.batchVert(t,e,h),this.batchVert(i,n,u),this.batchVert(r,s,c),this.batchVert(t,e,h),this.batchVert(r,s,c),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 u.prototype.destroy.call(this),this.polygonCache=null,this}});t.exports=c},function(t,e,i){var n=i(0),r=i(2),s=i(877),o=i(108),a=i(3),h=i(58),l=10,u=new a,c=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,this.lightsActive=!0},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;i<this.shaders.length;i++)this["lightShader"+(i+1)]=this.shaders[i]},onRender:function(t,e){var i=t.sys.lights;if(this.lightsActive=!1,i&&i.active){var n=i.getLights(e),r=n.length;if(0!==r){var s;this.lightsActive=!0,this.setShader(this["lightShader"+r],!0);var o=this.renderer.height,a=e.matrix;for(this.set1i("uMainSampler",0),this.set1i("uNormSampler",1),this.set2f("uResolution",this.width/2,this.height/2),this.set4f("uCamera",e.x,e.y,e.rotation,e.zoom),this.set3f("uAmbientLightColor",i.ambientColor.r,i.ambientColor.g,i.ambientColor.b),s=0;s<r;s++){var h=n[s].light,l=h.color,c="uLights["+s+"].";a.transformPoint(h.x,h.y,u),this.set2f(c+"position",u.x-e.scrollX*h.scrollFactorX*e.zoom,o-(u.y-e.scrollY*h.scrollFactorY*e.zoom)),this.set3f(c+"color",l.r,l.g,l.b),this.set1f(c+"intensity",h.intensity),this.set1f(c+"radius",h.radius)}this.currentNormalMapRotation=null}}},setNormalMapRotation:function(t){if(t!==this.currentNormalMapRotation||0===this.vertexCount){this.vertexCount>0&&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},batchSprite:function(t,e,i){this.lightsActive&&o.prototype.batchSprite.call(this,t,e,i)},batchTexture:function(t,e,i,n,r,s,a,h,l,u,c,d,p,f,m,g,v,y,x,w,b,A,T,S,E,M,_,C,P,R,L,O){this.lightsActive&&o.prototype.batchTexture.call(this,t,e,i,n,r,s,a,h,l,u,c,d,p,f,m,g,v,y,x,w,b,A,T,S,E,M,_,C,P,R,L,O)},batchTextureFrame:function(t,e,i,n,r,s,a){this.lightsActive&&o.prototype.batchTextureFrame.call(this,t,e,i,n,r,s,a)}});c.LIGHT_COUNT=l,t.exports=c},function(t,e,i){var n=i(0),r=i(2),s=i(880),o=i(881),a=i(58),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,u,c){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,u,c,f,m,g,v,y,x),this.batchLightVert(r,s,u,c,f,m,g,v,y,x),this.batchLightVert(o,a,u,c,f,m,g,v,y,x),this.batchLightVert(i,n,u,c,f,m,g,v,y,x),this.batchLightVert(o,a,u,c,f,m,g,v,y,x),this.batchLightVert(h,l,u,c,f,m,g,v,y,x)},batchLightVert:function(t,e,i,n,r,s,o,a,h,l){var u=this.vertexViewF32,c=this.vertexCount*this.currentShader.vertexComponentCount-1;u[++c]=t,u[++c]=e,u[++c]=i,u[++c]=n,u[++c]=r,u[++c]=s,u[++c]=o,u[++c]=a,u[++c]=h,u[++c]=l,this.vertexCount++}});t.exports=h},function(t,e,i){var n=i(0),r=i(2),s=i(108),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){var n=i(0),r=i(2),s=i(108),o=i(882),a=i(883),h=i(58),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){var n=i(884),r=i(35),s=i(0),o=i(198),a=i(885),h=i(886),l=i(2),u=i(887),c=i(382),d=i(58),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",c),t.shaders=l(t,"shaders",[{name:"Copy",fragShader:h},{name:"AddBlend",fragShader:n},{name:"LinearBlend",fragShader:u},{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){var n=i(31),r=i(38),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),u=s(e,"y",0),c=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(c){var m=new Uint8Array(4),g=d?u:f-u;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-u-y,v,y,i.RGBA,i.UNSIGNED_BYTE,x);for(var w=n.createWebGL(this,v,y),b=w.getContext("2d"),A=b.getImageData(0,0,v,y),T=A.data,S=0;S<y;S++)for(var E=0;E<v;E++){var M=4*((y-S-1)*v+E),_=4*(S*v+E);T[_+0]=x[M+0],T[_+1]=x[M+1],T[_+2]=x[M+2],T[_+3]=x[M+3]}b.putImageData(A,0,0);var C=new Image;C.onerror=function(){o.call(null),n.remove(w)},C.onload=function(){o.call(null,C),n.remove(w)},C.src=w.toDataURL(a,h)}}},function(t,e,i){var n=i(33);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;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}}}},function(t,e,i){var n=i(0),r=i(6),s=i(1),o=i(386),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;e<this.deltaSmoothingMax;e++)this.deltaHistory[e]=Math.min(this._target,this.deltaHistory[e]);this.delta=0,this.deltaIndex=0,this._coolDown=this.panicMax},start:function(t){if(this.started)return this;this.started=!0,this.running=!0;for(var e=0;e<this.deltaSmoothingMax;e++)this.deltaHistory[e]=this._target;this.resetDelta(),this.startTime=window.performance.now(),this.callback=t,this.raf.start(this.step.bind(this),this.forceSetTimeOut,this._target)},step:function(){var t=window.performance.now();this.now=t;var e=t-this.lastTime;e<0&&(e=0),this.rawDelta=e;var i=this.deltaIndex,n=this.deltaHistory,r=this.deltaSmoothingMax,s=e,o=e;if(this.smoothStep){(this._coolDown>0||!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;a<r;a++)o+=n[a];o/=r}this.delta=o,this.time+=this.rawDelta,t>this.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){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){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){var n=i(389),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),u=s(t,"clearCanvas",!0),c=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,u=!1),l&&(i.width=p,i.height=f);var m=i.getContext("2d");u&&m.clearRect(0,0,p,f),c&&c(i,m);for(var g=0;g<e.length;g++)for(var v=e[g],y=0;y<v.length;y++){var x=v[y];"."!==x&&" "!==x&&(m.fillStyle=o[x],m.fillRect(y*a,g*h,a,h))}return d&&d(i,m),i}},function(t,e){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){var n=i(0),r=i(358),s=i(94),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<i.length;n++)t.lineTo(i[n].x,i[n].y);return t.strokePath(),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y,this.p2.x,this.p2.y,this.p3.x,this.p3.y]}}});a.fromJSON=function(t){var e=t.points,i=new o(e[0],e[1]),n=new o(e[2],e[3]),r=new o(e[4],e[5]),s=new o(e[6],e[7]);return new a(i,n,r,s)},t.exports=a},function(t,e,i){var n=i(0),r=i(94),s=i(36),o=i(6),a=i(196),h=i(3),l=new n({Extends:r,initialize:function(t,e,i,n,a,l,u,c){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),u=o(d,"clockwise",!1),c=o(d,"rotation",0)}else void 0===n&&(n=i),void 0===a&&(a=0),void 0===l&&(l=360),void 0===u&&(u=!1),void 0===c&&(c=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=u,this._rotation=s(c)},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)<Number.EPSILON;n<0;)n+=i;for(;n>i;)n-=i;n<Number.EPSILON&&(n=r?0:i),this._clockwise&&!r&&(n===i?n=-i:n-=i);var s=this._startAngle+t*n,o=this.p0.x+this._xRadius*Math.cos(s),a=this.p0.y+this._yRadius*Math.sin(s);if(0!==this._rotation){var l=Math.cos(this._rotation),u=Math.sin(this._rotation),c=o-this.p0.x,d=a-this.p0.y;o=c*l-d*u+this.p0.x,a=c*u+d*l+this.p0.y}return e.set(o,a)},setXRadius:function(t){return this.xRadius=t,this},setYRadius:function(t){return this.yRadius=t,this},setWidth:function(t){return this.xRadius=t/2,this},setHeight:function(t){return this.yRadius=t/2,this},setStartAngle:function(t){return this.startAngle=t,this},setEndAngle:function(t){return this.endAngle=t,this},setClockwise:function(t){return this.clockwise=t,this},setRotation:function(t){return this.rotation=t,this},x:{get:function(){return this.p0.x},set:function(t){this.p0.x=t}},y:{get:function(){return this.p0.y},set:function(t){this.p0.y=t}},xRadius:{get:function(){return this._xRadius},set:function(t){this._xRadius=t}},yRadius:{get:function(){return this._yRadius},set:function(t){this._yRadius=t}},startAngle:{get:function(){return a(this._startAngle)},set:function(t){this._startAngle=s(t)}},endAngle:{get:function(){return a(this._endAngle)},set:function(t){this._endAngle=s(t)}},clockwise:{get:function(){return this._clockwise},set:function(t){this._clockwise=t}},angle:{get:function(){return a(this._rotation)},set:function(t){this._rotation=s(t)}},rotation:{get:function(){return this._rotation},set:function(t){this._rotation=t}},toJSON:function(){return{type:this.type,x:this.p0.x,y:this.p0.y,xRadius:this._xRadius,yRadius:this._yRadius,startAngle:a(this._startAngle),endAngle:a(this._endAngle),clockwise:this._clockwise,rotation:a(this._rotation)}}});l.fromJSON=function(t){return new l(t)},t.exports=l},function(t,e,i){var n=i(0),r=i(94),s=i(199),o=i(10),a=i(3),h=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(t,e){return void 0===e&&(e=new a),e.copy(this.p1).subtract(this.p0).normalize(),e},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]}}});h.fromJSON=function(t){var e=t.points,i=new a(e[0],e[1]),n=new a(e[2],e[3]);return new h(i,n)},t.exports=h},function(t,e,i){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){var n=i(0),r=i(94),s=i(359),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<i.length;n++)t.lineTo(i[n].x,i[n].y);return t.strokePath(),t},toJSON:function(){return{type:this.type,points:[this.p0.x,this.p0.y,this.p1.x,this.p1.y,this.p2.x,this.p2.y]}}});a.fromJSON=function(t){var e=t.points,i=new o(e[0],e[1]),n=new o(e[2],e[3]),r=new o(e[4],e[5]);return new a(i,n,r)},t.exports=a},function(t,e,i){var n=i(194),r=i(0),s=i(94),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;e<t.length;e++){var i=new o;"number"==typeof t[e]?(i.x=t[e],i.y=t[e+1],e++):Array.isArray(t[e])?(i.x=t[e][0],i.y=t[e][1]):(i.x=t[e].x,i.y=t[e].y),this.points.push(i)}return this},addPoint:function(t,e){var i=new o(t,e);return this.points.push(i),i},getStartPoint:function(t){return void 0===t&&(t=new o),t.copy(this.points[0])},getResolution:function(t){return t*this.points.length},getPoint:function(t,e){void 0===e&&(e=new o);var i=this.points,r=(i.length-1)*t,s=Math.floor(r),a=r-s,h=i[0===s?s:s-1],l=i[s],u=i[s>i.length-2?i.length-1:s+1],c=i[s>i.length-3?i.length-1:s+2];return e.set(n(a,h.x,l.x,u.x,c.x),n(a,h.y,l.y,u.y,c.y))},toJSON:function(){for(var t=[],e=0;e<this.points.length;e++)t.push(this.points[e].x),t.push(this.points[e].y);return{type:this.type,points:t}}});a.fromJSON=function(t){return new a(t.points)},t.exports=a},function(t,e,i){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){var n=i(38);n.ColorSpectrum=i(909),n.ColorToRGBA=i(910),n.ComponentToHex=i(398),n.GetColor=i(103),n.GetColor32=i(328),n.HexStringToColor=i(327),n.HSLToColor=i(911),n.HSVColorWheel=i(912),n.HSVToRGB=i(188),n.HueToComponent=i(399),n.IntegerToColor=i(189),n.IntegerToRGB=i(330),n.Interpolate=i(913),n.ObjectToColor=i(331),n.RandomRGB=i(914),n.RGBStringToColor=i(332),n.RGBToHSV=i(329),n.RGBToString=i(915),n.ValueToColor=i(187),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){var n=i(105);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){var n=i(201);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){t.exports={NO_CENTER:0,CENTER_BOTH:1,CENTER_HORIZONTALLY:2,CENTER_VERTICALLY:3}},function(t,e){t.exports={LANDSCAPE:"landscape-primary",PORTRAIT:"portrait-primary"}},function(t,e){t.exports={NONE:0,WIDTH_CONTROLS_HEIGHT:1,HEIGHT_CONTROLS_WIDTH:2,FIT:3,ENVELOP:4,RESIZE:5}},function(t,e){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){var n=i(0),r=i(203),s=i(9),o=i(51),a=i(22),h=i(410),l=i(411),u=i(412),c=i(413),d=i(25),p=i(177),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 c(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 u(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;n<i.length;n++){var r=i[n];if(r.sys.input&&r.sys.input.updatePoll(t,e)&&this.globalTopOnly)return}},setDefaultCursor:function(t){this.defaultCursor=t,this.canvas.style.cursor!==t&&(this.canvas.style.cursor=t)},setCursor:function(t){t.cursor&&(this.canvas.style.cursor=t.cursor)},resetCursor:function(t){t.cursor&&this.canvas&&(this.canvas.style.cursor=this.defaultCursor)},addPointer:function(t){void 0===t&&(t=1);var e=[];this.pointersTotal+t>10&&(t=10-this.pointersTotal);for(var i=0;i<t;i++){var n=this.pointers.length,r=new u(this,n);r.smoothFactor=this.config.inputSmoothFactor,this.pointers.push(r),this.pointersTotal++,e.push(r)}return e},updateInputPlugins:function(t,e){var i=this.game.scene.getScenes(!0,!0);this._tempSkip=!1;for(var n=0;n<i.length;n++){var r=i[n];if(r.sys.input&&(r.sys.input.update(t,e)&&this.globalTopOnly||this._tempSkip))return}},onTouchStart:function(t){for(var e=this.pointers,i=[],n=0;n<t.changedTouches.length;n++)for(var s=t.changedTouches[n],o=1;o<this.pointersTotal;o++){var a=e[o];if(!a.active){a.touchstart(s,t),this.activePointer=a,i.push(a);break}}this.updateInputPlugins(r.TOUCH_START,i)},onTouchMove:function(t){for(var e=this.pointers,i=[],n=0;n<t.changedTouches.length;n++)for(var s=t.changedTouches[n],o=1;o<this.pointersTotal;o++){var a=e[o];if(a.active&&a.identifier===s.identifier){a.touchmove(s,t),this.activePointer=a,i.push(a);break}}this.updateInputPlugins(r.TOUCH_MOVE,i)},onTouchEnd:function(t){for(var e=this.pointers,i=[],n=0;n<t.changedTouches.length;n++)for(var s=t.changedTouches[n],o=1;o<this.pointersTotal;o++){var a=e[o];if(a.active&&a.identifier===s.identifier){a.touchend(s,t),i.push(a);break}}this.updateInputPlugins(r.TOUCH_END,i)},onTouchCancel:function(t){for(var e=this.pointers,i=[],n=0;n<t.changedTouches.length;n++)for(var s=t.changedTouches[n],o=1;o<this.pointersTotal;o++){var a=e[o];if(a.active&&a.identifier===s.identifier){a.touchcancel(s,t),i.push(a);break}}this.updateInputPlugins(r.TOUCH_CANCEL,i)},onMouseDown:function(t){var e=this.mousePointer;e.down(t),e.updateMotion(),this.activePointer=e,this.updateInputPlugins(r.MOUSE_DOWN,this.mousePointerContainer)},onMouseMove:function(t){var e=this.mousePointer;e.move(t),e.updateMotion(),this.activePointer=e,this.updateInputPlugins(r.MOUSE_MOVE,this.mousePointerContainer)},onMouseUp:function(t){var e=this.mousePointer;e.up(t),e.updateMotion(),this.activePointer=e,this.updateInputPlugins(r.MOUSE_UP,this.mousePointerContainer)},onMouseWheel:function(t){var e=this.mousePointer;e.wheel(t),this.activePointer=e,this.updateInputPlugins(r.MOUSE_WHEEL,this.mousePointerContainer)},onPointerLockChange:function(t){var e=this.mouse.locked;this.mousePointer.locked=e,this.events.emit(o.POINTERLOCK_CHANGE,t,e)},inputCandidate:function(t,e){var i=t.input;if(!i||!i.enabled||!i.alwaysEnabled&&!t.willRender(e))return!1;var n=!0,r=t.parentContainer;if(r)do{if(!r.willRender(e)){n=!1;break}r=r.parentContainer}while(r);return n},hitTest:function(t,e,i,n){void 0===n&&(n=this._tempHitTest);var r=this._tempPoint,s=i.scrollX,o=i.scrollY;n.length=0;var a=t.x,h=t.y;i.getWorldPoint(a,h,r),t.worldX=r.x,t.worldY=r.y;for(var l={x:0,y:0},u=this._tempMatrix,c=this._tempMatrix2,d=0;d<e.length;d++){var f=e[d];if(this.inputCandidate(f,i)){var m=r.x+s*f.scrollFactorX-s,g=r.y+o*f.scrollFactorY-o;f.parentContainer?(f.getWorldTransformMatrix(u,c),u.applyInverse(m,g,l)):p(m,g,f.x,f.y,f.rotation,f.scaleX,f.scaleY,l),this.pointWithinHitArea(f,l.x,l.y)&&n.push(f)}}return n},pointWithinHitArea:function(t,e,i){e+=t.displayOriginX,i+=t.displayOriginY;var n=t.input;return!(!n||!n.hitAreaCallback(n.hitArea,e,i,t)||(n.localX=e,n.localY=i,0))},pointWithinInteractiveObject:function(t,e,i){return!!t.hitArea&&(e+=t.gameObject.displayOriginX,i+=t.gameObject.displayOriginY,t.localX=e,t.localY=i,t.hitAreaCallback(t.hitArea,e,i,t))},transformPointer:function(t,e,i,n){var r=t.position,s=t.prevPosition;s.x=r.x,s.y=r.y;var o=this.scaleManager.transformX(e),a=this.scaleManager.transformY(i),h=t.smoothFactor;n&&0!==h?(r.x=o*h+s.x*(1-h),r.y=a*h+s.y*(1-h)):(r.x=o,r.y=a)},destroy:function(){this.events.removeAllListeners(),this.game.events.off(a.PRE_RENDER),this.keyboard&&this.keyboard.destroy(),this.mouse&&this.mouse.destroy(),this.touch&&this.touch.destroy();for(var t=0;t<this.pointers.length;t++)this.pointers[t].destroy();this.pointers=[],this._tempHitTest=[],this._tempMatrix.destroy(),this.canvas=null,this.game=null}});t.exports=f},function(t,e,i){var n=i(93),r=i(0),s=i(22),o=i(51),a=i(143),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;i<t.length;i++){var n=t[i];"string"==typeof n&&(n=a[n.trim().toUpperCase()]),-1===e.indexOf(n)&&e.push(n)}this.preventDefault=e.length>0},removeCapture:function(t){"string"==typeof t&&(t=t.split(",")),Array.isArray(t)||(t=[t]);for(var e=this.captures,i=0;i<t.length;i++){var r=t[i];"string"==typeof r&&(r=a[r.toUpperCase()]),n(e,r)}this.preventDefault=e.length>0},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){var n=i(0),r=i(191),s=i(51),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){var n=i(349),r=i(0),s=i(50),o=i(124),a=i(360),h=i(3),l=i(105),u=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,u=e-h;this.velocity.set(l,u),this.angle=n(s,h,t,e),this.distance=Math.sqrt(l*l+u*u)}},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<t;o++){var h=1/t*o;e[o]={x:a(h,i,r),y:a(h,n,s)}}return e},destroy:function(){this.camera=null,this.manager=null,this.position=null},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}},time:{get:function(){return this.event?this.event.timeStamp:0}}});t.exports=u},function(t,e,i){var n=i(0),r=i(51),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){var n=i(0),r=i(22),s=i(9),o=i(8),a=i(16),h=i(5),l=i(2),u=i(24),c=i(93),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,u=h.installGlobalPlugins;for(u=u.concat(this._pendingGlobal),t=0;t<u.length;t++)e=u[t],i=l(e,"key",null),n=l(e,"plugin",null),s=l(e,"start",!1),o=l(e,"mapping",null),a=l(e,"data",null),i&&n&&this.install(i,n,s,o,a);for(u=(u=h.installScenePlugins).concat(this._pendingScene),t=0;t<u.length;t++)e=u[t],i=l(e,"key",null),n=l(e,"plugin",null),o=l(e,"mapping",null),i&&n&&this.installScenePlugin(i,n,o);this._pendingGlobal=[],this._pendingScene=[],this.game.events.once(r.DESTROY,this.destroy,this)},addToScene:function(t,e,i){var n,r,s,o=this.game,a=t.scene,h=t.settings.map,l=t.settings.isBooted;for(n=0;n<e.length;n++)o[r=e[n]]?(t[r]=o[r],h.hasOwnProperty(r)&&(a[h[r]]=t[r])):"game"===r&&h.hasOwnProperty(r)&&(a[h[r]]=o);for(var c=0;c<i.length;c++)for(s=i[c],n=0;n<s.length;n++)if(r=s[n],u.hasCore(r)){var d=u.getCore(r),p=d.mapping,f=new d.plugin(a,this,p);t[p]=f,d.custom?a[p]=f:h.hasOwnProperty(p)&&(a[h[p]]=f),l&&f.boot()}for(s=this.plugins,n=0;n<s.length;n++){var m=s[n];m.mapping&&(a[m.mapping]=m.plugin)}},getDefaultScenePlugins:function(){var t=this.game.config.defaultPlugins;return t=t.concat(this.scenePlugins)},installScenePlugin:function(t,e,i,n,r){if(void 0===r&&(r=!1),"function"==typeof e){if(u.hasCore(t)){if(!r&&u.hasCore(t))return}else u.register(t,e,i,!0),this.scenePlugins.push(t);if(n){var s=new e(n,this,t);n.sys[t]=s,i&&""!==i&&(n[i]=s),s.boot()}}},install:function(t,e,i,n,r){if(void 0===i&&(i=!1),void 0===n&&(n=null),void 0===r&&(r=null),"function"!=typeof e)return null;if(u.hasCustom(t))return null;if(null!==n&&(i=!0),this.game.isBooted){if(u.registerCustom(t,e,n,r),i)return this.start(t)}else this._pendingGlobal.push({key:t,plugin:e,start:i,mapping:n,data:r});return null},getIndex:function(t){for(var e=this.plugins,i=0;i<e.length;i++)if(e[i].key===t)return i;return-1},getEntry:function(t){var e=this.getIndex(t);if(-1!==e)return this.plugins[e]},isActive:function(t){var e=this.getEntry(t);return e&&e.active},start:function(t,e){void 0===e&&(e=t);var i=this.getEntry(e);return i&&!i.active?(i.active=!0,i.plugin.start()):i||(i=this.createEntry(t,e)),i?i.plugin:null},createEntry:function(t,e){var i=u.getCustom(t);if(i){var n=new i.plugin(this);i={key:e,plugin:n,active:!0,mapping:i.mapping,data:i.data},this.plugins.push(i),n.init(i.data),n.start()}return i},stop:function(t){var e=this.getEntry(t);return e&&e.active&&(e.active=!1,e.plugin.stop()),this},get:function(t,e){void 0===e&&(e=!0);var i=this.getEntry(t);if(i)return i.plugin;var n=this.getClass(t);return n&&e?(i=this.createEntry(t,t))?i.plugin:null:n||null},getClass:function(t){return u.getCustomClass(t)},removeGlobalPlugin:function(t){var e=this.getEntry(t);e&&c(this.plugins,e),u.removeCustom(t)},removeScenePlugin:function(t){c(this.scenePlugins,t),u.remove(t)},registerGameObject:function(t,e,i){return e&&h.register(t,e),i&&a.register(t,i),this},removeGameObject:function(t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),e&&h.remove(t),i&&a.remove(t),this},registerFileType:function(t,e,i){o.register(t,e),i&&i.sys.load&&(i.sys.load[t]=e)},destroy:function(){for(var t=0;t<this.plugins.length;t++)this.plugins[t].plugin.destroy();u.destroyCustomPlugins(),this.game.noReturn&&u.destroyCorePlugins(),this.game=null,this.plugins=[],this.scenePlugins=[]}});t.exports=d},function(t,e,i){var n=i(201),r=i(0),s=i(9),o=i(104),a=i(22),h=i(401),l=i(407),u=i(402),c=i(1),d=i(10),p=i(416),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:c,windowResize:c,fullScreenChange:c,fullScreenError:c}},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 c=parseInt(i,10)/100;i=Math.floor(l*c)}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=u(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=u(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){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.aspectRatio<r?(e=(t=s(t,n.x))/this.aspectRatio,n.y>0&&(t=(e=s(e,n.y))*this.aspectRatio)):(i&&this.aspectRatio<r||!i&&this.aspectRatio>r)&&(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){var n=i(0),r=i(144),s=i(20),o=i(22),a=i(6),h=i(95),l=i(1),u=i(418),c=i(204),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<e.length;i++)this._pending.push({key:"default",scene:e[i],autoStart:0===i,data:{}})}t.events.once(o.READY,this.bootQueue,this)},bootQueue:function(){if(!this.isBooted){var t,e,i,n;for(t=0;t<this._pending.length;t++){var r;i=(e=this._pending[t]).key,(n=e.scene)instanceof u?r=this.createSceneFromInstance(i,n):"object"==typeof n?r=this.createSceneFromObject(i,n):"function"==typeof n&&(r=this.createSceneFromFunction(i,n)),i=r.sys.settings.key,this.keys[i]=r,this.scenes.push(r),this._data[i]&&(r.sys.settings.data=this._data[i].data,this._data[i].autoStart&&(e.autoStart=!0)),(e.autoStart||r.sys.settings.active)&&this._start.push(i)}for(this._pending.length=0,this._data={},this.isBooted=!0,t=0;t<this._start.length;t++)e=this._start[t],this.start(e);this._start.length=0}},processQueue:function(){var t=this._pending.length,e=this._queue.length;if(0!==t||0!==e){var i,n;if(t){for(i=0;i<t;i++)n=this._pending[i],this.add(n.key,n.scene,n.autoStart,n.data);for(i=0;i<this._start.length;i++)n=this._start[i],this.start(n);return this._start.length=0,void(this._pending.length=0)}for(i=0;i<this._queue.length;i++)this[(n=this._queue[i]).op](n.keyA,n.keyB);this._queue.length=0}},add:function(t,e,i,n){return void 0===i&&(i=!1),void 0===n&&(n={}),this.isProcessing||!this.isBooted?(this._pending.push({key:t,scene:e,autoStart:i,data:n}),this.isBooted||(this._data[t]={data:n}),null):(t=this.getKey(t,e),e instanceof u?r=this.createSceneFromInstance(t,e):"object"==typeof e?(e.key=t,r=this.createSceneFromObject(t,e)):"function"==typeof e&&(r=this.createSceneFromFunction(t,e)),r.sys.settings.data=n,t=r.sys.settings.key,this.keys[t]=r,this.scenes.push(r),(i||r.sys.settings.active)&&(this._pending.length?this._start.push(t):this.start(t)),r);var r},remove:function(t){if(this.isProcessing)this._queue.push({op:"remove",keyA:t,keyB:null});else{var e=this.getScene(t);if(!e||e.sys.isTransitioning())return this;var i=this.scenes.indexOf(e),n=e.sys.settings.key;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){this.create(t.scene)},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<this.scenes.length;e++){var i=this.scenes[e].sys;i.settings.visible&&i.settings.status>=r.LOADING&&i.settings.status<r.SLEEPING&&i.render(t)}this.isProcessing=!1},create:function(t){var e=t.sys,i=e.settings;t.create&&(i.status=r.CREATING,t.create.call(t,i.data),i.status===r.DESTROYED)||(i.isTransition&&e.events.emit(s.TRANSITION_START,i.transitionFrom,i.transitionDuration),t.update&&(e.sceneUpdate=t.update),i.status=r.RUNNING,e.events.emit(s.CREATE,t))},createSceneFromFunction:function(t,e){var i=new e;if(i instanceof u){var n=i.sys.settings.key;if(""!==n&&(t=n),this.keys.hasOwnProperty(t))throw new Error("Cannot add a Scene with duplicate key: "+t);return this.createSceneFromInstance(t,i)}return i.sys=new c(i),i.sys.settings.key=t,i.sys.init(this.game),i},createSceneFromInstance:function(t,e){return""===e.sys.settings.key&&(e.sys.settings.key=t),e.sys.init(this.game),e},createSceneFromObject:function(t,e){var i=new u(e),n=i.sys.settings.key;""!==n?t=n:i.sys.settings.key=t,i.sys.init(this.game);for(var r=["init","preload","create","update","render"],s=0;s<r.length;s++){var o=a(e,r[s],null);o&&(i[r[s]]=o)}if(e.hasOwnProperty("extend"))for(var h in e.extend)if(e.extend.hasOwnProperty(h)){var l=e.extend[h];"data"===h&&i.hasOwnProperty("data")&&"object"==typeof l?i.data.merge(l):"sys"!==h&&(i[h]=l)}return i},getKey:function(t,e){if(t||(t="default"),"function"==typeof e)return t;if(e instanceof u?t=e.sys.settings.key:"object"==typeof e&&e.hasOwnProperty("key")&&(t=e.key),this.keys.hasOwnProperty(t))throw new Error("Cannot add a Scene with duplicate key: "+t);return t},getScenes:function(t,e){void 0===t&&(t=!0),void 0===e&&(e=!1);for(var i=[],n=this.scenes,r=0;r<n.length;r++){var s=n[r];s&&(!t||t&&s.sys.isActive())&&i.push(s)}return e?i.reverse():i},getScene:function(t){if("string"==typeof t){if(this.keys[t])return this.keys[t]}else for(var e=0;e<this.scenes.length;e++)if(t===this.scenes[e])return t;return null},isActive:function(t){var e=this.getScene(t);return e?e.sys.isActive():null},isPaused:function(t){var e=this.getScene(t);return e?e.sys.isPaused():null},isVisible:function(t){var e=this.getScene(t);return e?e.sys.isVisible():null},isSleeping:function(t){var e=this.getScene(t);return e?e.sys.isSleeping():null},pause:function(t,e){var i=this.getScene(t);return i&&i.sys.pause(e),this},resume:function(t,e){var i=this.getScene(t);return i&&i.sys.resume(e),this},sleep:function(t,e){var i=this.getScene(t);return i&&!i.sys.isTransitioning()&&i.sys.sleep(e),this},wake:function(t,e){var i=this.getScene(t);return i&&i.sys.wake(e),this},run:function(t,e){var i=this.getScene(t);if(!i){for(var n=0;n<this._pending.length;n++)if(this._pending[n].key===t){this.queueOp("start",t,e);break}return this}i.sys.isSleeping()?i.sys.wake(e):i.sys.isPaused()?i.sys.resume(e):this.start(t,e)},start:function(t,e){if(!this.isBooted)return this._data[t]={autoStart:!0,data:e},this;var i=this.getScene(t);if(i){var n,s=i.sys;if(s.isActive()||s.isPaused())s.shutdown(),s.sceneUpdate=l,s.start(e);else if(s.sceneUpdate=l,s.start(e),s.load&&(n=s.load),n&&s.settings.hasOwnProperty("pack")&&(n.reset(),n.addPack({payload:s.settings.pack})))return s.settings.status=r.LOADING,n.once(h.COMPLETE,this.payloadComplete,this),n.start(),this;this.bootScene(i)}return this},stop:function(t,e){var i=this.getScene(t);return i&&!i.sys.isTransitioning()&&i.sys.shutdown(e),this},switch:function(t,e){var i=this.getScene(t),n=this.getScene(e);return i&&n&&i!==n&&(this.sleep(t),this.isSleeping(e)?this.wake(e):this.start(e)),this},getAt:function(t){return this.scenes[t]},getIndex:function(t){var e=this.getScene(t);return this.scenes.indexOf(e)},bringToTop:function(t){if(this.isProcessing)this._queue.push({op:"bringToTop",keyA:t,keyB:null});else{var e=this.getIndex(t);if(-1!==e&&e<this.scenes.length){var i=this.getScene(t);this.scenes.splice(e,1),this.scenes.push(i)}}return this},sendToBack:function(t){if(this.isProcessing)this._queue.push({op:"sendToBack",keyA:t,keyB:null});else{var e=this.getIndex(t);if(-1!==e&&e>0){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<this.scenes.length-1){var i=e+1,n=this.getScene(t),r=this.getAt(i);this.scenes[e]=r,this.scenes[i]=n}}return this},moveAbove:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"moveAbove",keyA:t,keyB:e});else{var i=this.getIndex(t),n=this.getIndex(e);if(-1!==i&&-1!==n){var r=this.getAt(n);this.scenes.splice(n,1),this.scenes.splice(i+1,0,r)}}return this},moveBelow:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"moveBelow",keyA:t,keyB:e});else{var i=this.getIndex(t),n=this.getIndex(e);if(-1!==i&&-1!==n){var r=this.getAt(n);this.scenes.splice(n,1),0===i?this.scenes.unshift(r):this.scenes.splice(i,0,r)}}return this},queueOp:function(t,e,i){return this._queue.push({op:t,keyA:e,keyB:i}),this},swapPosition:function(t,e){if(t===e)return this;if(this.isProcessing)this._queue.push({op:"swapPosition",keyA:t,keyB:e});else{var i=this.getIndex(t),n=this.getIndex(e);if(i!==n&&-1!==i&&-1!==n){var r=this.getAt(i);this.scenes[i]=this.scenes[n],this.scenes[n]=r}}return this},dump:function(){for(var t=[],e=["pending","init","start","loading","creating","running","paused","sleeping","shutdown","destroyed"],i=0;i<this.scenes.length;i++){var n=this.scenes[i].sys,s=!n.settings.visible||n.settings.status!==r.RUNNING&&n.settings.status!==r.PAUSED?"[-] ":"[*] ";s+=n.settings.key+" ("+e[n.settings.status]+")",t.push(s)}},destroy:function(){for(var t=0;t<this.scenes.length;t++)this.scenes[t].sys.destroy();this.update=l,this.scenes=[],this._pending=[],this._start=[],this._queue=[],this.game=null}});t.exports=d},function(t,e,i){var n=i(0),r=i(204),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){var n=i(2),r=i(205);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){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){var n=i(144),r=i(6),s=i(127),o=i(978),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){var n=i(31),r=i(423),s=i(0),o=i(38),a=i(33),h=i(9),l=i(106),u=i(22),c=i(388),d=i(6),p=i(425),f=i(206),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(u.BOOT,this.boot,this)},boot:function(){this._pending=3,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.game.events.once(u.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)},remove:function(t){if("string"==typeof t){if(!this.exists(t))return 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));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,c(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<r.source.length;o++){var a=s?i[0]:i[o];p.JSONArray(r,o,a)}else p.JSONArray(r,0,i);n&&r.setDataSource(n),this.emit(l.ADD,t,r)}return r},addAtlasJSONHash:function(t,e,i,n){var r=null;if(this.checkKey(t)){if(r=this.create(t,e),Array.isArray(i))for(var s=0;s<i.length;s++)p.JSONHash(r,s,i[s]);else p.JSONHash(r,0,i);n&&r.setDataSource(n),this.emit(l.ADD,t,r)}return r},addAtlasXML:function(t,e,i,n){var r=null;return this.checkKey(t)&&(r=this.create(t,e),p.AtlasXML(r,0,i),n&&r.setDataSource(n),this.emit(l.ADD,t,r)),r},addUnityAtlas:function(t,e,i,n){var r=null;return this.checkKey(t)&&(r=this.create(t,e),p.UnityYAML(r,0,i),n&&r.setDataSource(n),this.emit(l.ADD,t,r)),r},addSpriteSheet:function(t,e,i){var n=null;if(this.checkKey(t)){var r=(n=this.create(t,e)).source[0].width,s=n.source[0].height;p.SpriteSheet(n,0,0,0,r,s,i),this.emit(l.ADD,t,n)}return n},addSpriteSheetFromAtlas:function(t,e){if(!this.checkKey(t))return null;var i=d(e,"atlas",null),n=d(e,"frame",null);if(i&&n){var r=this.get(i).get(n);if(r){var s=this.create(t,r.source.image);return r.trimmed?p.SpriteSheetFromAtlas(s,r,e):p.SpriteSheet(s,0,r.cutX,r.cutY,r.cutWidth,r.cutHeight,e),this.emit(l.ADD,t,s),s}}},create:function(t,e,i,n){var r=null;return this.checkKey(t)&&(r=new f(this,t,e,i,n),this.list[t]=r),r},exists:function(t){return this.list.hasOwnProperty(t)},get:function(t){return void 0===t&&(t="__DEFAULT"),this.list[t]?this.list[t]:t instanceof f?t:this.list.__MISSING},cloneFrame:function(t,e){if(this.list[t])return this.list[t].get(e).clone()},getFrame:function(t,e){if(this.list[t])return this.list[t].get(e)},getTextureKeys:function(){var t=[];for(var e in this.list)"__DEFAULT"!==e&&"__MISSING"!==e&&t.push(e);return t},getPixel:function(t,e,i,n){var r=this.getFrame(i,n);if(r){t-=r.x,e-=r.y;var s=r.data.cut;if(t+=s.x,e+=s.y,t>=s.x&&t<s.r&&e>=s.y&&e<s.b){var a=this._tempContext;a.clearRect(0,0,1,1),a.drawImage(r.source.image,t,e,1,1,0,0,1,1);var h=a.getImageData(0,0,1,1);return new o(h.data[0],h.data[1],h.data[2],h.data[3])}}return null},getPixelAlpha:function(t,e,i,n){var r=this.getFrame(i,n);if(r){t-=r.x,e-=r.y;var s=r.data.cut;if(t+=s.x,e+=s.y,t>=s.x&&t<s.r&&e>=s.y&&e<s.b){var o=this._tempContext;return o.clearRect(0,0,1,1),o.drawImage(r.source.image,t,e,1,1,0,0,1,1),o.getImageData(0,0,1,1).data[3]}}return null},setTexture:function(t,e,i){return this.list[e]&&(t.texture=this.list[e],t.frame=t.texture.get(i)),t},renameTexture:function(t,e){var i=this.get(t);return!(!i||t===e||(i.key=e,this.list[e]=i,delete this.list[t],0))},each:function(t,e){for(var i=[null],n=1;n<arguments.length;n++)i.push(arguments[n]);for(var r in this.list)i[0]=this.list[r],t.apply(e,i)},destroy:function(){for(var t in this.list)this.list[t].destroy();this.list={},this.game=null,n.remove(this._tempCanvas)}});t.exports=m},function(t,e,i){var n=i(0),r=i(18),s=i(38),o=i(33),a=i(138),h=i(206),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),u=new s,c=[],d=h;d<l;d++){for(var p=[],f=o;f<a;f++)u=this.getPixel(f,d,u),p.push({x:f,y:d,color:u.color,alpha:u.alphaGL});c.push(p)}return c},getIndex:function(t,e){return t=Math.abs(Math.round(t)),e=Math.abs(Math.round(e)),t<this.width&&e<this.height?4*(t+e*this.width):-1},refresh:function(){return this._source.update(),this},getCanvas:function(){return this.canvas},getContext:function(){return this.context},clear:function(t,e,i,n){return void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=this.width),void 0===n&&(n=this.height),this.context.clearRect(t,e,i,n),this.update()},setSize:function(t,e){return void 0===e&&(e=t),t===this.width&&e===this.height||(this.canvas.width=t,this.canvas.height=e,this._source.width=t,this._source.height=e,this._source.isPowerOf2=a(t,e),this.frames.__BASE.setSize(t,e,0,0),this.width=t,this.height=e,this.refresh()),this},destroy:function(){h.prototype.destroy.call(this),this._source=null,this.canvas=null,this.context=null,this.imageData=null,this.data=null,this.pixels=null,this.buffer=null}});t.exports=l},function(t,e,i){var n=i(31),r=i(0),s=i(138),o=i(168),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,!0),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){t.exports={AtlasXML:i(979),Canvas:i(980),Image:i(981),JSONArray:i(982),JSONHash:i(983),SpriteSheet:i(984),SpriteSheetFromAtlas:i(985),UnityYAML:i(986)}},function(t,e,i){var n=i(427),r=i(430),s=i(432),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){var n=i(145),r=i(0),s=i(70),o=i(429),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<i.length;n++)if("true"===i[n].dataset.locked)return t.locked=!0,!1;return!0})),this.locked){var e=!1,i=function(){e=!0},n=function(){if(e)e=!1;else{document.body.removeEventListener("touchmove",i),document.body.removeEventListener("touchend",n);var r=[];if(t.game.cache.audio.entries.each((function(t,e){for(var i=0;i<e.length;i++){var n=e[i];"true"===n.dataset.locked&&r.push(n)}return!0})),0!==r.length){var s=r[r.length-1];s.oncanplaythrough=function(){s.oncanplaythrough=null,r.forEach((function(t){t.dataset.locked="false"})),t.unlocked=!0},r.forEach((function(t){t.load()}))}}};this.once(s.UNLOCKED,(function(){for(this.forEachActiveSound((function(t){null===t.currentMarker&&0===t.duration&&(t.duration=t.tags[0].duration),t.totalDuration=t.tags[0].duration}));this.lockedActionsQueue.length;){var t=this.lockedActionsQueue.shift();t.sound[t.prop].apply?t.sound[t.prop].apply(t.sound,t.value||[]):t.sound[t.prop]=t.value}}),this),document.body.addEventListener("touchmove",i,!1),document.body.addEventListener("touchend",n,!1)}},onBlur:function(){this.forEachActiveSound((function(t){t.isPlaying&&(this.onBlurPausedSounds.push(t),t.onBlur())}))},onFocus:function(){this.onBlurPausedSounds.forEach((function(t){t.onFocus()})),this.onBlurPausedSounds.length=0},destroy:function(){n.prototype.destroy.call(this),this.onBlurPausedSounds.length=0,this.onBlurPausedSounds=null},isLocked:function(t,e,i){return"true"===t.tags[0].dataset.locked&&(this.lockedActionsQueue.push({sound:t,prop:e,value:i}),!0)},setMute:function(t){return this.mute=t,this},mute:{get:function(){return this._mute},set:function(t){this._mute=t,this.forEachActiveSound((function(t){t.updateMute()})),this.emit(s.GLOBAL_MUTE,this,t)}},setVolume:function(t){return this.volume=t,this},volume:{get:function(){return this._volume},set:function(t){this._volume=t,this.forEachActiveSound((function(t){t.updateVolume()})),this.emit(s.GLOBAL_VOLUME,this,t)}}});t.exports=a},function(t,e,i){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<s;o++){var a=t[o];if(!e||e&&void 0===i&&a.hasOwnProperty(e)||e&&void 0!==i&&a[e]===i)return a}return null}},function(t,e,i){var n=i(146),r=i(0),s=i(70),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;t<this.tags.length;t++){var e=this.tags[t];if("false"===e.dataset.used)return e.dataset.used="true",this.audio=e,!0}if(!this.manager.override)return!1;var i=[];this.manager.forEachActiveSound((function(t){t.key===this.key&&t.audio&&i.push(t)}),this),i.sort((function(t,e){return t.loop===e.loop?e.seek/e.duration-t.seek/t.duration:t.loop?1:-1}));var n=i[0];return this.audio=n.audio,n.reset(),n.audio=null,n.startTime=0,n.previousTime=0,!0},playCatchPromise:function(){var t=this.audio.play();t&&t.catch((function(t){}))},stopAndReleaseAudioTag:function(){this.startTime=0,this.previousTime=0,this.audio&&(this.audio.pause(),this.audio.dataset.used="false",this.audio=null)},reset:function(){n.prototype.stop.call(this)},onBlur:function(){this.isPlaying=!1,this.isPaused=!0,this.currentConfig.seek=this.audio.currentTime-(this.currentMarker?this.currentMarker.start:0),this.currentConfig.delay=Math.max(0,(this.startTime-window.performance.now())/1e3),this.stopAndReleaseAudioTag()},onFocus:function(){this.isPlaying=!0,this.isPaused=!1,this.pickAndPlayAudioTag()},update:function(t){if(this.isPlaying)if(this.startTime>0)this.startTime<t-this.manager.audioPlayDelay&&(this.audio.currentTime+=Math.max(0,t-this.startTime)/1e3,this.startTime=0,this.previousTime=this.audio.currentTime,this.playCatchPromise());else{var e=this.currentMarker?this.currentMarker.start:0,i=e+this.duration,n=this.audio.currentTime;if(this.currentConfig.loop)n>=i-this.manager.loopEndOffset?(this.audio.currentTime=e+Math.max(0,n-i),n=this.audio.currentTime):n<e&&(this.audio.currentTime+=e,n=this.audio.currentTime),n<this.previousTime&&this.emit(s.LOOPED,this);else if(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){var n=i(145),r=i(0),s=i(9),o=i(431),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){var n=i(146),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){var n=i(433),r=i(145),s=i(0),o=i(70),a=i(22),h=i(434),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):window.hasOwnProperty("AudioContext")?new AudioContext:window.hasOwnProperty("webkitAudioContext")?new window.webkitAudioContext:void 0},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<i.length;a++){var h=i[a],l=h.key,u=h.data;"string"==typeof u&&(u=n(u));var c=function(t,e){r.add(t,e),this.emit(o.DECODED,t),0==--s&&this.emit(o.DECODED_ALL)}.bind(this,l),d=function(t,e){0==--s&&this.emit(o.DECODED_ALL)}.bind(this,l);this.context.decodeAudioData(u,c,d)}},unlock:function(){var t=this,e=document.body,i=function i(){if(t.context&&e){var n=e.removeEventListener;t.context.resume().then((function(){n("touchstart",i),n("touchend",i),n("click",i),n("keydown",i),t.unlocked=!0}),(function(){n("touchstart",i),n("touchend",i),n("click",i),n("keydown",i)}))}};e&&(e.addEventListener("touchstart",i,!1),e.addEventListener("touchend",i,!1),e.addEventListener("click",i,!1),e.addEventListener("keydown",i,!1))},onBlur:function(){this.locked||this.context.suspend()},onFocus:function(){var t=this.context;"suspended"!==t.state&&"interrupted"!==t.state||this.locked||t.resume()},update:function(t,e){r.prototype.update.call(this,t,e);var i=this.context;i&&"interrupted"===i.state&&i.resume()},destroy:function(){if(this.destination=null,this.masterVolumeNode.disconnect(),this.masterVolumeNode=null,this.masterMuteNode.disconnect(),this.masterMuteNode=null,this.game.config.audio.context)this.context.suspend();else{var t=this;this.context.close().then((function(){t.context=null}))}r.prototype.destroy.call(this)},setMute:function(t){return this.mute=t,this},mute:{get:function(){return 0===this.masterMuteNode.gain.value},set:function(t){this.masterMuteNode.gain.setValueAtTime(t?0:1,0),this.emit(o.GLOBAL_MUTE,this,t)}},setVolume:function(t){return this.volume=t,this},volume:{get:function(){return this.masterVolumeNode.gain.value},set:function(t){this.masterVolumeNode.gain.setValueAtTime(t,0),this.emit(o.GLOBAL_VOLUME,this,t)}}});t.exports=l},function(t,e){for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(256),r=0;r<i.length;r++)n[i.charCodeAt(r)]=r;t.exports=function(t){var e,i,r,s,o=(t=t.substr(t.indexOf(",")+1)).length,a=.75*o,h=0;"="===t[o-1]&&(a--,"="===t[o-2]&&a--);for(var l=new ArrayBuffer(a),u=new Uint8Array(l),c=0;c<o;c+=4)e=n[t.charCodeAt(c)],i=n[t.charCodeAt(c+1)],r=n[t.charCodeAt(c+2)],s=n[t.charCodeAt(c+3)],u[h++]=e<<2|i>>4,u[h++]=(15&i)<<4|r>>2,u[h++]=(3&r)<<6|63&s;return l}},function(t,e,i){var n=i(146),r=i(0),s=i(70),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<this.startTime||!n.prototype.pause.call(this)||(this.currentConfig.seek=this.getCurrentTime(),this.stopAndRemoveBufferSource(),this.emit(s.PAUSE,this),0))},resume:function(){return!(this.manager.context.currentTime<this.startTime||!n.prototype.resume.call(this)||(this.createAndStartBufferSource(),this.emit(s.RESUME,this),0))},stop:function(){return!!n.prototype.stop.call(this)&&(this.stopAndRemoveBufferSource(),this.emit(s.STOP,this),!0)},createAndStartBufferSource:function(){var t=this.currentConfig.seek,e=this.currentConfig.delay,i=this.manager.context.currentTime+e,n=(this.currentMarker?this.currentMarker.start:0)+t,r=this.duration-t;this.playTime=i-t,this.startTime=i,this.source=this.createBufferSource(),this.applyConfig(),this.source.start(Math.max(0,i),Math.max(0,n),Math.max(0,r)),this.resetConfig()},createAndStartLoopBufferSource:function(){var t=this.getLoopTime(),e=this.currentMarker?this.currentMarker.start:0,i=this.duration;this.loopTime=t,this.loopSource=this.createBufferSource(),this.loopSource.playbackRate.setValueAtTime(this.totalRate,0),this.loopSource.start(Math.max(0,t),Math.max(0,e),Math.max(0,i))},createBufferSource:function(){var t=this,e=this.manager.context.createBufferSource();return e.buffer=this.audioBuffer,e.connect(this.muteNode),e.onended=function(e){e.target===t.source&&(t.currentConfig.loop?t.hasLooped=!0:t.hasEnded=!0)},e},stopAndRemoveBufferSource:function(){this.source&&(this.source.stop(),this.source.disconnect(),this.source=null),this.playTime=0,this.startTime=0,this.stopAndRemoveLoopBufferSource()},stopAndRemoveLoopBufferSource:function(){this.loopSource&&(this.loopSource.stop(),this.loopSource.disconnect(),this.loopSource=null),this.loopTime=0},applyConfig:function(){this.rateUpdates.length=0,this.rateUpdates.push({time:0,rate:1}),n.prototype.applyConfig.call(this)},update:function(){this.hasEnded?(this.hasEnded=!1,n.prototype.stop.call(this),this.stopAndRemoveBufferSource(),this.emit(s.COMPLETE,this)):this.hasLooped&&(this.hasLooped=!1,this.source=this.loopSource,this.loopSource=null,this.playTime=this.startTime=this.loopTime,this.rateUpdates.length=0,this.rateUpdates.push({time:0,rate:this.totalRate}),this.createAndStartLoopBufferSource(),this.emit(s.LOOPED,this))},destroy:function(){n.prototype.destroy.call(this),this.audioBuffer=null,this.stopAndRemoveBufferSource(),this.muteNode.disconnect(),this.muteNode=null,this.volumeNode.disconnect(),this.volumeNode=null,this.pannerNode&&(this.pannerNode.disconnect(),this.pannerNode=null),this.rateUpdates.length=0,this.rateUpdates=null},calculateRate:function(){n.prototype.calculateRate.call(this);var t=this.manager.context.currentTime;this.source&&"number"==typeof this.totalRate&&this.source.playbackRate.setValueAtTime(this.totalRate,t),this.isPlaying&&(this.rateUpdates.push({time:Math.max(this.startTime,t)-this.playTime,rate:this.totalRate}),this.loopSource&&(this.stopAndRemoveLoopBufferSource(),this.createAndStartLoopBufferSource()))},getCurrentTime:function(){for(var t=0,e=0;e<this.rateUpdates.length;e++)t+=((e<this.rateUpdates.length-1?this.rateUpdates[e+1].time:this.manager.context.currentTime-this.playTime)-this.rateUpdates[e].time)*this.rateUpdates[e].rate;return t},getLoopTime:function(){for(var t=0,e=0;e<this.rateUpdates.length-1;e++)t+=(this.rateUpdates[e+1].time-this.rateUpdates[e].time)*this.rateUpdates[e].rate;var i=this.rateUpdates[this.rateUpdates.length-1];return this.playTime+i.time+(this.duration-t)/i.rate},rate:{get:function(){return this.currentConfig.rate},set:function(t){this.currentConfig.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.calculateRate(),this.emit(s.DETUNE,this,t)}},setDetune:function(t){return this.detune=t,this},mute:{get:function(){return 0===this.muteNode.gain.value},set:function(t){this.currentConfig.mute=t,this.muteNode.gain.setValueAtTime(t?0:1,0),this.emit(s.MUTE,this,t)}},setMute:function(t){return this.mute=t,this},volume:{get:function(){return this.volumeNode.gain.value},set:function(t){this.currentConfig.volume=t,this.volumeNode.gain.setValueAtTime(t,0),this.emit(s.VOLUME,this,t)}},setVolume:function(t){return this.volume=t,this},seek:{get:function(){return this.isPlaying?this.manager.context.currentTime<this.startTime?this.startTime-this.playTime:this.getCurrentTime():this.isPaused?this.currentConfig.seek:0},set:function(t){this.manager.context.currentTime<this.startTime||(this.isPlaying||this.isPaused)&&(t=Math.min(Math.max(0,t),this.duration),this.currentConfig.seek=t,this.isPlaying&&(this.stopAndRemoveBufferSource(),this.createAndStartBufferSource()),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.isPlaying&&(this.stopAndRemoveLoopBufferSource(),t&&this.createAndStartLoopBufferSource()),this.emit(s.LOOP,this,t)}},setLoop:function(t){return this.loop=t,this},pan:{get:function(){return this.pannerNode?this.pannerNode.pan.value:0},set:function(t){this.currentConfig.pan=t,this.pannerNode&&this.pannerNode.pan.setValueAtTime(t,this.manager.context.currentTime),this.emit(s.PAN,this,t)}},setPan:function(t){return this.pan=t,this}});t.exports=o},function(t,e){t.exports=function(t){for(var e=t.length,i=t[0].length,n=new Array(i),r=0;r<i;r++){n[r]=new Array(e);for(var s=e-1;s>-1;s--)n[r][s]=t[s][r]}return n}},function(t,e){function i(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function n(t,e){return t<e?-1:t>e?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,u=Math.log(h),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(h-c)/h)*(l-h/2<0?-1:1),p=Math.max(s,Math.floor(e-l*c/h+d)),f=Math.min(o,Math.floor(e+(h-l)*c/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);g<v;){for(i(t,g,v),g++,v--;a(t[g],m)<0;)g++;for(;a(t[v],m)>0;)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){var n=i(6),r=i(131),s=function(t,e,i){for(var n=[],r=0;r<t.length;r++)for(var s=0;s<e.length;s++)for(var o=0;o<i;o++)n.push({a:t[r],b:e[s]});return n};t.exports=function(t,e,i){var o=n(i,"max",0),a=n(i,"qty",1),h=n(i,"random",!1),l=n(i,"randomB",!1),u=n(i,"repeat",0),c=n(i,"yoyo",!1),d=[];if(l&&r(e),-1===u)if(0===o)u=0;else{var p=t.length*e.length*a;c&&(p*=2),u=Math.ceil(o/p)}for(var f=0;f<=u;f++){var m=s(t,e,a);h&&r(m),d=d.concat(m),c&&(m.reverse(),d=d.concat(m))}return o&&d.splice(o),d}},function(t,e,i){t.exports={PROCESS_QUEUE_ADD:i(1041),PROCESS_QUEUE_REMOVE:i(1042)}},function(t,e,i){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),u=n(i,"yoyo",!1),c=n(i,"play",!1),d=n(i,"delayedPlay",0),p={key:s,delay:a,repeat:h,repeatDelay:l,yoyo:u,startFrame:o};c?r.play(p):d>0?r.playAfterDelay(p,d):r.load(p)}}return t}},function(t,e,i){var n=i(0),r=i(109),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){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){var n=i(0),r=i(11),s=i(1055),o=i(15),a=i(7),h=i(202),l=i(20),u=i(140),c=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 u,this.rotate3dAngle="deg",this.pointerEvents="auto",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<t.length;e++)this.node.addEventListener(t[e],this.handler,!1)}return this},removeListener:function(t){if(this.node){t=t.split(" ");for(var e=0;e<t.length;e++)this.node.removeEventListener(t[e],this.handler)}return this},dispatchNativeEvent:function(t){this.emit(t.type,t)},createElement:function(t,e,i){return this.setElement(document.createElement(t),e,i)},setElement:function(t,e,i){var n;if(this.removeElement(),"string"==typeof t?("#"===t[0]&&(t=t.substr(1)),n=document.getElementById(t)):"object"==typeof t&&1===t.nodeType&&(n=t),!n)return this;if(this.node=n,e&&a(e))for(var r in e)n.style[r]=e[r];else"string"==typeof e&&(n.style=e);return n.style.zIndex="0",n.style.display="inline",n.style.position="absolute",n.phaser=this,this.parent&&this.parent.appendChild(n),i&&(n.innerText=i),this.updateSize()},createFromCache:function(t,e){var i=this.cache.get(t);return i&&this.createFromHTML(i,e),this},createFromHTML:function(t,e){void 0===e&&(e="div"),this.removeElement();var i=document.createElement(e);return this.node=i,i.style.zIndex="0",i.style.display="inline",i.style.position="absolute",i.phaser=this,this.parent&&this.parent.appendChild(i),i.innerHTML=t,this.updateSize()},removeElement:function(){return this.node&&(h(this.node),this.node=null),this},updateSize:function(){var t=this.node,e=t.getBoundingClientRect();return this.width=t.clientWidth,this.height=t.clientHeight,this.displayWidth=e.width||0,this.displayHeight=e.height||0,this},getChildByProperty:function(t,e){if(this.node)for(var i=this.node.querySelectorAll("*"),n=0;n<i.length;n++)if(i[n][t]===e)return i[n];return null},getChildByID:function(t){return this.getChildByProperty("id",t)},getChildByName:function(t){return this.getChildByProperty("name",t)},setClassName:function(t){return this.node&&(this.node.className=t,this.updateSize()),this},setText:function(t){return this.node&&(this.node.innerText=t,this.updateSize()),this},setHTML:function(t){return this.node&&(this.node.innerHTML=t,this.updateSize()),this},preUpdate:function(){var t=this.parentContainer,e=this.node;e&&t&&!t.willRender()&&(e.style.display="none")},willRender:function(){return!0},preDestroy:function(){this.removeElement(),this.scene.sys.events.off(l.SLEEP,this.handleSceneEvent,this),this.scene.sys.events.off(l.WAKE,this.handleSceneEvent,this)}});t.exports=c},function(t,e,i){var n=i(1056),r=i(15),s=i(25),o=new s,a=new s,h=new s;t.exports=function(t,e,i,s){if(e.node){var l=e.node.style,u=e.scene.sys.settings;if(!l||!u.visible||r.RENDER_MASK!==e.renderFlags||0!==e.cameraFilter&&e.cameraFilter&i.id||e.parentContainer&&!e.parentContainer.willRender())l.display="none";else{var c=e.parentContainer,d=i.alpha*e.alpha;c&&(d*=c.alpha);var p=o,f=a,m=h,g=0,v=0,y="0%",x="0%";s?(g=e.width*e.scaleX*e.originX,v=e.height*e.scaleY*e.originY,f.applyITRS(e.x-g,e.y-v,e.rotation,e.scaleX,e.scaleY),p.copyFrom(i.matrix),p.multiplyWithOffset(s,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),f.e=e.x-g,f.f=e.y-v,p.multiply(f,m)):(g=e.width*e.originX,v=e.height*e.originY,f.applyITRS(e.x-g,e.y-v,e.rotation,e.scaleX,e.scaleY),p.copyFrom(i.matrix),y=100*e.originX+"%",x=100*e.originY+"%",f.e-=i.scrollX*e.scrollFactorX,f.f-=i.scrollY*e.scrollFactorY,p.multiply(f,m)),e.transformOnly||(l.display="block",l.opacity=d,l.zIndex=e._depth,l.pointerEvents=e.pointerEvents,l.mixBlendMode=n[e._blendMode]),l.transform=m.getCSSMatrix()+" skew("+e.skewX+"rad, "+e.skewY+"rad) rotate3d("+e.rotate3d.x+","+e.rotate3d.y+","+e.rotate3d.z+","+e.rotate3d.w+e.rotate3dAngle+")",l.transformOrigin=y+" "+x}}}},function(t,e,i){var n=i(0),r=i(11),s=i(15),o=i(1060),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){var n=i(218),r=i(98),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){var n=i(447),r=i(218),s=i(98),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<e;h++){var l=s(h/e,0,o.PI2);a.push(r(t,l))}return a}},function(t,e){t.exports=function(t){var e=t.width/2,i=t.height/2,n=Math.pow(e-i,2)/Math.pow(e+i,2);return Math.PI*(e+i)*(1+3*n/(10+Math.sqrt(4-3*n)))}},function(t,e,i){var n=i(217),r=i(30);t.exports=function(t,e,i,s,o,a){var h=e.commandBuffer,l=h.length,u=o||t.currentContext;if(0!==l&&r(t,u,e,i,s)){i.addToRenderList(e);var c=1,d=1,p=0,f=0,m=1,g=0,v=0,y=0;u.beginPath();for(var x=0;x<l;++x)switch(h[x]){case n.ARC:u.arc(h[x+1],h[x+2],h[x+3],h[x+4],h[x+5],h[x+6]),x+=7;break;case n.LINE_STYLE:m=h[x+1],p=h[x+2],c=h[x+3],g=(16711680&p)>>>16,v=(65280&p)>>>8,y=255&p,u.strokeStyle="rgba("+g+","+v+","+y+","+c+")",u.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,u.fillStyle="rgba("+g+","+v+","+y+","+d+")",x+=2;break;case n.BEGIN_PATH:u.beginPath();break;case n.CLOSE_PATH:u.closePath();break;case n.FILL_PATH:a||u.fill();break;case n.STROKE_PATH:a||u.stroke();break;case n.FILL_RECT:a?u.rect(h[x+1],h[x+2],h[x+3],h[x+4]):u.fillRect(h[x+1],h[x+2],h[x+3],h[x+4]),x+=4;break;case n.FILL_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),a||u.fill(),x+=6;break;case n.STROKE_TRIANGLE:u.beginPath(),u.moveTo(h[x+1],h[x+2]),u.lineTo(h[x+3],h[x+4]),u.lineTo(h[x+5],h[x+6]),u.closePath(),a||u.stroke(),x+=6;break;case n.LINE_TO:u.lineTo(h[x+1],h[x+2]),x+=2;break;case n.MOVE_TO:u.moveTo(h[x+1],h[x+2]),x+=2;break;case n.LINE_FX_TO:u.lineTo(h[x+1],h[x+2]),x+=5;break;case n.MOVE_FX_TO:u.moveTo(h[x+1],h[x+2]),x+=5;break;case n.SAVE:u.save();break;case n.RESTORE:u.restore();break;case n.TRANSLATE:u.translate(h[x+1],h[x+2]),x+=2;break;case n.SCALE:u.scale(h[x+1],h[x+2]),x+=2;break;case n.ROTATE:u.rotate(h[x+1]),x+=1;break;case n.GRADIENT_FILL_STYLE:x+=5;break;case n.GRADIENT_LINE_STYLE:x+=6}u.restore()}}},function(t,e,i){var n=i(0),r=i(137),s=i(80),o=i(2),a=i(68),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){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<this._epsilon&&(r=this._epsilon);var o=this._power*e/(r*s)*100;t.velocityX+=i*o,t.velocityY+=n*o}},epsilon:{get:function(){return Math.sqrt(this._epsilon)},set:function(t){this._epsilon=t*t}},power:{get:function(){return this._power/this._gravity},set:function(t){this._power=t*this._gravity}},gravity:{get:function(){return this._gravity},set:function(t){var e=this.power;this._gravity=t,this.power=e}}});t.exports=s},function(t,e,i){var n=i(0),r=i(36),s=i(50),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,u=Math.atan2(l-this.y,h-this.x),c=s(this.x,this.y,h,l)/(this.life/1e3);this.velocityX=Math.cos(u)*c,this.velocityY=Math.sin(u)*c}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 u=0;u<n.length;u++)n[u].update(this,e,i)},checkBounds:function(t){var e=t.bounds,i=-this.bounce;this.x<e.x&&t.collideLeft?(this.x=e.x,this.velocityX*=i):this.x>e.right&&t.collideRight&&(this.x=e.right,this.velocityX*=i),this.y<e.y&&t.collideTop?(this.y=e.y,this.velocityY*=i):this.y>e.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){var n=i(35),r=i(0),s=i(11),o=i(453),a=i(454),h=i(449),l=i(2),u=i(210),c=i(455),d=i(126),p=i(451),f=i(456),m=i(10),g=i(79),v=i(3),y=i(68),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;e<this.configFastMap.length;e++)i=this.configFastMap[e],d(t,i)&&(this[i]=l(t,i));for(e=0;e<this.configOpMap.length;e++)i=this.configOpMap[e],d(t,i)&&this[i].loadConfig(t);if(this.acceleration=0!==this.accelerationX.propertyValue||0!==this.accelerationY.propertyValue,this.moveTo=0!==this.moveToX.propertyValue||0!==this.moveToY.propertyValue,d(t,"speed")&&(this.speedX.loadConfig(t,"speed"),this.speedY=null),(c(t,["speedX","speedY"])||this.moveTo)&&(this.radial=!1),d(t,"scale")&&(this.scaleX.loadConfig(t,"scale"),this.scaleY=null),d(t,"callbackScope")){var n=l(t,"callbackScope",null);this.emitCallbackScope=n,this.deathCallbackScope=n}return d(t,"emitZone")&&this.setEmitZone(t.emitZone),d(t,"deathZone")&&this.setDeathZone(t.deathZone),d(t,"bounds")&&this.setBounds(t.bounds),d(t,"followOffset")&&this.followOffset.setFromObject(l(t,"followOffset",0)),d(t,"frame")&&this.setFrame(t.frame),d(t,"reserve")&&this.reserve(t.reserve),this},toJSON:function(t){void 0===t&&(t={});var e=0,i="";for(e=0;e<this.configFastMap.length;e++)t[i=this.configFastMap[e]]=this[i];for(e=0;e<this.configOpMap.length;e++)this[i=this.configOpMap[e]]&&(t[i]=this[i].toJSON());return this.speedY||(delete t.speedX,t.speed=this.speedX.toJSON()),this.scaleY||(delete t.scaleX,t.scale=this.scaleX.toJSON()),t},startFollow:function(t,e,i,n){return void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=!1),this.follow=t,this.followOffset.set(e,i),this.trackVisible=n,this},stopFollow:function(){return this.follow=null,this.followOffset.set(0,0),this.trackVisible=!1,this},getFrame:function(){if(1===this.frames.length)return this.defaultFrame;if(this.randomFrame)return u(this.frames);var t=this.frames[this.currentFrame];return this._frameCounter++,this._frameCounter===this.frameQuantity&&(this._frameCounter=0,this.currentFrame=y(this.currentFrame+1,0,this._frameLength)),t},setFrame:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=1),this.randomFrame=e,this.frameQuantity=i,this.currentFrame=0,this._frameCounter=0;var n=typeof t;if(Array.isArray(t)||"string"===n||"number"===n)this.manager.setEmitterFrames(t,this);else if("object"===n){var r=t;(t=l(r,"frames",null))&&this.manager.setEmitterFrames(t,this);var s=l(r,"cycle",!1);this.randomFrame=!s,this.frameQuantity=l(r,"quantity",i)}return this._frameLength=this.frames.length,1===this._frameLength&&(this.frameQuantity=1,this.randomFrame=!1),this},setRadial:function(t){return void 0===t&&(t=!0),this.radial=t,this},setPosition:function(t,e){return this.x.onChange(t),this.y.onChange(e),this},setBounds:function(t,e,i,n){if("object"==typeof t){var r=t;t=r.x,e=r.y,i=d(r,"w")?r.w:r.width,n=d(r,"h")?r.h:r.height}return this.bounds?this.bounds.setTo(t,e,i,n):this.bounds=new m(t,e,i,n),this},setSpeedX:function(t){return this.speedX.onChange(t),this.radial=!1,this},setSpeedY:function(t){return this.speedY&&(this.speedY.onChange(t),this.radial=!1),this},setSpeed:function(t){return this.speedX.onChange(t),this.speedY=null,this.radial=!0,this},setScaleX:function(t){return this.scaleX.onChange(t),this},setScaleY:function(t){return this.scaleY.onChange(t),this},setScale:function(t){return this.scaleX.onChange(t),this.scaleY=null,this},setGravityX:function(t){return this.gravityX=t,this},setGravityY:function(t){return this.gravityY=t,this},setGravity:function(t,e){return this.gravityX=t,this.gravityY=e,this},setAlpha:function(t){return this.alpha.onChange(t),this},setTint:function(t){return this.tint.onChange(t),this},setEmitterAngle:function(t){return this.angle.onChange(t),this},setAngle:function(t){return this.angle.onChange(t),this},setLifespan:function(t){return this.lifespan.onChange(t),this},setQuantity:function(t){return this.quantity.onChange(t),this},setFrequency:function(t,e){return this.frequency=t,this._counter=0,e&&this.quantity.onChange(e),this},setEmitZone:function(t){if(void 0===t)this.emitZone=null;else{var e=l(t,"type","random"),i=l(t,"source",null);switch(e){case"random":this.emitZone=new f(i);break;case"edge":var n=l(t,"quantity",1),r=l(t,"stepRate",0),s=l(t,"yoyo",!1),o=l(t,"seamless",!0);this.emitZone=new a(i,n,r,s,o)}}return this},setDeathZone:function(t){if(void 0===t)this.deathZone=null;else{var e=l(t,"type","onEnter"),i=l(t,"source",null);if(i&&"function"==typeof i.contains){var n="onEnter"===e;this.deathZone=new o(i,n)}}return this},reserve:function(t){for(var e=this.dead,i=0;i<t;i++)e.push(new this.particleClass(this));return this},getAliveParticleCount:function(){return this.alive.length},getDeadParticleCount:function(){return this.dead.length},getParticleCount:function(){return this.getAliveParticleCount()+this.getDeadParticleCount()},atLimit:function(){return this.maxParticles>0&&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;r<n;++r)t.call(e,i[r],this);return this},forEachDead:function(t,e){for(var i=this.dead,n=i.length,r=0;r<n;++r)t.call(e,i[r],this);return this},start:function(){return this.on=!0,this._counter=0,this},stop:function(){return this.on=!1,this},pause:function(){return this.active=!1,this},resume:function(){return this.active=!0,this},remove:function(){return this.manager.removeEmitter(this),this},depthSort:function(){return g(this.alive,this.depthSortCallback),this},flow:function(t,e){return void 0===e&&(e=1),this.frequency=t,this.quantity.onChange(e),this.start()},explode:function(t,e,i){return this.frequency=-1,this.emitParticle(t,e,i)},emitParticleAt:function(t,e,i){return this.emitParticle(i,t,e)},emitParticle:function(t,e,i){if(!this.atLimit()){void 0===t&&(t=this.quantity.onEmit());for(var n=this.dead,r=this.follow?this.follow.x+this.followOffset.x:e,s=this.follow?this.follow.y+this.followOffset.y:i,o=0;o<t;o++){var a=n.pop();if(a||(a=new this.particleClass(this)),a.fire(r,s),this.particleBringToTop?this.alive.push(a):this.alive.unshift(a),this.emitCallback&&this.emitCallback.call(this.emitCallbackScope,a,this),this.atLimit())break}return a}},preUpdate:function(t,e){var i=(e*=this.timeScale)/1e3;this.trackVisible&&(this.visible=this.follow.visible);var n=this.manager.getProcessors(),r=this.alive,s=this.dead,o=0,a=[],h=r.length;for(o=0;o<h;o++){var l=r[o];l.update(e,i,n)&&a.push({index:o,particle:l})}if((h=a.length)>0){var u=this.deathCallback,c=this.deathCallbackScope;for(o=h-1;o>=0;o--){var d=a[o];r.splice(d.index,1),s.push(d.particle),u&&u.call(c,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){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){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._length<i&&this.counter>this._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<e.length;i++)if(t.hasOwnProperty(e[i]))return!0;return!1}},function(t,e,i){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){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.maxLines<i.length&&(h=s.maxLines),s.syncFont(n,r);for(var l=0;l<h;l++){var u=s.strokeThickness;u+=r.measureText(i[l]).width,s.wordWrap&&(u-=r.measureText(" ").width),o[l]=Math.ceil(u),a=Math.max(a,o[l])}var c=e.fontSize+s.strokeThickness,d=c*h,p=t.lineSpacing;return h>1&&(d+=p*(h-1)),{width:a,height:d,lines:h,lineWidths:o,lineSpacing:p,lineHeight:c}}},function(t,e,i){var n=i(0),r=i(13),s=i(6),o=i(460),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){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("actualBoundingBoxAscent"in r){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 u={ascent:0,descent:0,fontSize:0},c=i.getImageData(0,0,a,l);if(!c)return u.ascent=h,u.descent=h+6,u.fontSize=u.ascent+u.descent,n.remove(e),u;var d,p,f=c.data,m=f.length,g=4*a,v=0,y=!1;for(d=0;d<h;d++){for(p=0;p<g;p+=4)if(255!==f[v+p]){y=!0;break}if(y)break;v+=g}for(u.ascent=h-d,v=m-g,y=!1,d=l;d>h;d--){for(p=0;p<g;p+=4)if(255!==f[v+p]){y=!0;break}if(y)break;v-=g}return u.descent=d-h,u.fontSize=u.ascent+u.descent,n.remove(e),u}},function(t,e,i){var n=i(1097),r=i(0),s=i(36),o=i(59),a=i(65),h=i(14),l=i(34),u=new r({Extends:l,Mixins:[n],initialize:function(t,e,i,n,r,s,o,h,u){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 c=2*this.geom.radius;this.setSize(c,c),void 0!==h&&this.setFillStyle(h,u),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 u,c=[a+Math.cos(n)*i,l+Math.sin(n)*i];e<1;)u=r*e+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),e+=t;return u=r+n,c.push(a+Math.cos(u)*i,l+Math.sin(u)*i),c.push(a+Math.cos(n)*i,l+Math.sin(n)*i),this.pathIndexes=o(c),this.pathData=c,this}});t.exports=u},function(t,e,i){var n=i(0),r=i(1100),s=i(59),o=i(10),a=i(34),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<n.length;r++)i.push(n[r].x,n[r].y);return i.push(n[0].x,n[0].y),this.pathIndexes=s(i),this.pathData=i,this}});t.exports=h},function(t,e,i){var n=i(0),r=i(59),s=i(1103),o=i(111),a=i(34),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<e.length;i++)t.push(e[i].x,e[i].y);return t.push(e[0].x,e[0].y),this.pathIndexes=r(t),this.pathData=t,this}});t.exports=h},function(t,e,i){var n=i(0),r=i(34),s=i(1106),o=new n({Extends:r,Mixins:[s],initialize:function(t,e,i,n,s,o,a,h,l,u,c){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!==u&&this.setOutlineStyle(u,c),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){var n=i(1109),r=i(0),s=i(34),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){var n=i(0),r=i(1112),s=i(34),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){var n=i(0),r=i(34),s=i(47),o=i(1115),a=new n({Extends:r,Mixins:[o],initialize:function(t,e,i,n,o,a,h,l,u){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 c=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(c,d),void 0!==l&&this.setStrokeStyle(1,l,u),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){var n=i(1118),r=i(0),s=i(59),o=i(469),a=i(227),h=i(34),l=i(472),u=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<t;e++)l(this.geom);return this.updateData()},updateData:function(){for(var t=[],e=this.geom.points,i=0;i<e.length;i++)t.push(e[i].x,e[i].y);return t.push(e[0].x,e[0].y),this.pathIndexes=s(t),this.pathData=t,this}});t.exports=u},function(t,e,i){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<t.points.length;h++)i=t.points[h],r=Math.min(r,i.x),s=Math.min(s,i.y),o=Math.max(o,i.x),a=Math.max(a,i.y);return e.x=r,e.y=s,e.width=o-r,e.height=a-s,e}},function(t,e,i){var n=i(67),r=i(47),s=i(471);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;l<e;l++)for(var u=h*(l/e),c=0,d=0;d<a.length;d++){var p=a[d],f=a[(d+1)%a.length],m=new r(p.x,p.y,f.x,f.y),g=n(m);if(!(u<c||u>c+g)){var v=m.getPoint((u-c)/g);o.push(v);break}c+=g}return o}},function(t,e,i){var n=i(67),r=i(47);t.exports=function(t){for(var e=t.points,i=0,s=0;s<e.length;s++){var o=e[s],a=e[(s+1)%e.length],h=new r(o.x,o.y,a.x,a.y);i+=n(h)}return i}},function(t,e){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;e<r.length;e++)n.push([r[e].x,r[e].y]);var s=[];for(n.length>0&&s.push(i([0,0],n[0])),e=0;e<n.length-1;e++){var o=n[e],a=n[e+1],h=o[0],l=o[1],u=a[0],c=a[1];s.push([.85*h+.15*u,.85*l+.15*c]),s.push([.15*h+.85*u,.15*l+.85*c])}return n.length>1&&s.push(i([0,0],n[n.length-1])),t.setTo(s)}},function(t,e,i){var n=i(0),r=i(10),s=i(34),o=i(1121),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){var n=i(1124),r=i(0),s=i(59),o=i(34),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<e;l++)t.push(a+Math.cos(r)*n,h+Math.sin(r)*n),r+=o,t.push(a+Math.cos(r)*i,h+Math.sin(r)*i),r+=o;return t.push(a,h+-n),this.pathIndexes=s(t),this.pathData=t,this}});t.exports=a},function(t,e,i){var n=i(0),r=i(34),s=i(82),o=i(1127),a=new n({Extends:r,Mixins:[o],initialize:function(t,e,i,n,o,a,h,l,u,c,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===u&&(u=128),r.call(this,t,"Triangle",new s(n,o,a,h,l,u));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!==c&&this.setFillStyle(c,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){var n=i(4),r=i(67);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),u=r(a),c=(h+l+u)*e,d=0;return c<h?(d=c/h,i.x=s.x1+(s.x2-s.x1)*d,i.y=s.y1+(s.y2-s.y1)*d):c>h+l?(d=(c-=h+l)/u,i.x=a.x1+(a.x2-a.x1)*d,i.y=a.y1+(a.y2-a.y1)*d):(d=(c-=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){var n=i(67),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),u=n(a),c=n(h),d=l+u+c;!e&&i>0&&(e=d/i);for(var p=0;p<e;p++){var f=d*(p/e),m=0,g=new r;f<l?(m=f/l,g.x=o.x1+(o.x2-o.x1)*m,g.y=o.y1+(o.y2-o.y1)*m):f>l+u?(m=(f-=l+u)/c,g.x=h.x1+(h.x2-h.x1)*m,g.y=h.y1+(h.y2-h.y1)*m):(m=(f-=l)/u,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<n.length;o++){if(!r.hasOwnProperty(n[o]))return!1;s=r,r=r[n[o]]}return s[n[n.length-1]]=i,!0}return!1}},function(t,e,i){var n=i(116),r=i(117);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,u,c,d,p,f,m,g,v,y,x,w={faces:[],vertices:[]},b=s?3:2,A=Array.isArray(a),T=Array.isArray(h);if(Array.isArray(i)&&i.length>0)for(l=0;l<i.length;l++){var S=i[l],E=2*i[l],M=i[l]*b;u=t[M],c=t[M+1],d=s?t[M+2]:0,p=e[E],f=e[E+1],m=A?a[S]:a,g=T?h[S]:h,v=0,y=0,x=0,o&&(v=o[M],y=o[M+1],x=s?o[M+2]:0),w.vertices.push(new r(u,c,d,p,f,m,g,v,y,x))}else{var _=0,C=0;for(l=0;l<t.length;l+=b)u=t[l],c=t[l+1],d=s?t[l+2]:0,p=e[_],f=e[_+1],m=A?a[C]:a,g=T?h[C]:h,v=0,y=0,x=0,o&&(v=o[l],y=o[l+1],x=s?o[l+2]:0),w.vertices.push(new r(u,c,d,p,f,m,g,v,y,x)),_+=2,C++}for(l=0;l<w.vertices.length;l+=3){var P=w.vertices[l],R=w.vertices[l+1],L=w.vertices[l+2];w.faces.push(new n(P,R,L))}return w}}},function(t,e,i){var n=i(116),r=i(69),s=i(39),o=i(117),a=new s,h=new s,l=new r;t.exports=function(t,e,i,r,s,u,c,d,p,f){void 0===i&&(i=1),void 0===r&&(r=0),void 0===s&&(s=0),void 0===u&&(u=0),void 0===c&&(c=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,u),h.set(c,d,p),l.fromRotationXYTranslation(h,a,f);for(var v=0;v<t.models.length;v++)for(var y=t.models[v],x=y.vertices,w=y.textureCoords,b=y.faces,A=0;A<b.length;A++){var T=b[A],S=T.vertices[0],E=T.vertices[1],M=T.vertices[2],_=x[S.vertexIndex],C=x[E.vertexIndex],P=x[M.vertexIndex],R=S.textureCoordsIndex,L=E.textureCoordsIndex,O=M.textureCoordsIndex,D=-1===R?{u:0,v:1}:w[R],B=-1===L?{u:0,v:0}:w[L],I=-1===O?{u:1,v:1}:w[O],F=16777215;""!==T.material&&g[T.material]&&(F=g[T.material]);var k=new o(_.x*i,_.y*i,_.z*i,D.u,D.v,F).transformMat4(l),N=new o(C.x*i,C.y*i,C.z*i,B.u,B.v,F).transformMat4(l),z=new o(P.x*i,P.y*i,P.z*i,I.u,I.v,F).transformMat4(l);m.verts.push(k,N,z),m.faces.push(new n(k,N,z))}return e&&(e.faces=e.faces.concat(m.faces),e.vertices=e.vertices.concat(m.verts)),m}},function(t,e,i){var n=i(65),r=i(0),s=i(11),o=i(200),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){var n=i(151),r=i(0),s=i(50),o=i(481),a=i(150),h=i(200),l=i(74),u=i(79),c=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,s){return this.systems.displayList.add(new a(this.scene,t,e,i,n,r,s))},enable:function(){return-1===this.maxLights&&(this.maxLights=this.systems.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;o<e.length;o++){var a=e[o];a.willRender(t)&&n(a,i)&&r.push({light:a,distance:s(a.x,a.y,i.centerX,i.centerY)})}return r.length>this.maxLights&&(u(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=c.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=c.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){var n=i(56),r=i(17),s={Circle:i(1191),Ellipse:i(1201),Intersects:i(484),Line:i(1221),Mesh:i(1243),Point:i(1246),Polygon:i(1260),Rectangle:i(502),Triangle:i(1293)};s=r(!1,s,n),t.exports=s},function(t,e,i){t.exports={CircleToCircle:i(231),CircleToRectangle:i(151),GetCircleToCircle:i(1211),GetCircleToRectangle:i(1212),GetLineToCircle:i(232),GetLineToLine:i(485),GetLineToPoints:i(486),GetLineToPolygon:i(487),GetLineToRectangle:i(234),GetRaysFromPointToPolygon:i(1213),GetRectangleIntersection:i(1214),GetRectangleToRectangle:i(1215),GetRectangleToTriangle:i(1216),GetTriangleToCircle:i(1217),GetTriangleToLine:i(492),GetTriangleToTriangle:i(1218),LineToCircle:i(233),LineToLine:i(96),LineToRectangle:i(488),PointToLine:i(496),PointToLineSegment:i(1219),RectangleToRectangle:i(152),RectangleToTriangle:i(489),RectangleToValues:i(1220),TriangleToCircle:i(491),TriangleToLine:i(493),TriangleToTriangle:i(494)}},function(t,e,i){var n=i(39);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,u=o-r,c=a-s,d=e.x2-h,p=e.y2-l;if(0===u||0==p*u-d*c)return!1;var f=(u*(l-s)+c*(r-h))/(d*c-p*u),m=(h+d*f-r)/u;return m<0||f<0||f>1?null:(void 0===i&&(i=new n),i.set(r+u*m,s+c*m,m))}},function(t,e,i){var n=i(39),r=i(485),s=new(i(47)),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<e.length;l++){var u=e[l];s.setTo(h.x,h.y,u.x,u.y),h=u,r(t,s,o)&&(!a||o.z<i.z)&&(i.copy(o),a=!0)}return a?i:null}},function(t,e,i){var n=i(39),r=i(140),s=i(486),o=new n;t.exports=function(t,e,i){void 0===i&&(i=new r),Array.isArray(e)||(e=[e]);var n=!1;i.set(),o.set();for(var a=0;a<e.length;a++)s(t,e[a].points,o)&&(!n||o.z<i.z)&&(i.set(o.x,o.y,o.z,a),n=!0);return n?i:null}},function(t,e){t.exports=function(t,e){var i=t.x1,n=t.y1,r=t.x2,s=t.y2,o=e.x,a=e.y,h=e.right,l=e.bottom,u=0;if(i>=o&&i<=h&&n>=a&&n<=l||r>=o&&r<=h&&s>=a&&s<=l)return!0;if(i<o&&r>=o){if((u=n+(s-n)*(o-i)/(r-i))>a&&u<=l)return!0}else if(i>h&&r<=h&&(u=n+(s-n)*(h-i)/(r-i))>=a&&u<=l)return!0;if(n<a&&s>=a){if((u=i+(r-i)*(a-n)/(s-n))>=o&&u<=h)return!0}else if(n>l&&s<=l&&(u=i+(r-i)*(l-n)/(s-n))>=o&&u<=h)return!0;return!1}},function(t,e,i){var n=i(96),r=i(57),s=i(235),o=i(490);t.exports=function(t,e){if(e.left>t.right||e.right<t.left||e.top>t.bottom||e.bottom<t.top)return!1;var i=e.getLineA(),a=e.getLineB(),h=e.getLineC();if(r(t,i.x1,i.y1)||r(t,i.x2,i.y2))return!0;if(r(t,a.x1,a.y1)||r(t,a.x2,a.y2))return!0;if(r(t,h.x1,h.y1)||r(t,h.x2,h.y2))return!0;var l=t.getLineA(),u=t.getLineB(),c=t.getLineC(),d=t.getLineD();if(n(i,l)||n(i,u)||n(i,c)||n(i,d))return!0;if(n(a,l)||n(a,u)||n(a,c)||n(a,d))return!0;if(n(h,l)||n(h,u)||n(h,c)||n(h,d))return!0;var p=o(t);return s(e,p,!0).length>0}},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){var n=i(233),r=i(115);t.exports=function(t,e){return!(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top||!r(t,e.x,e.y)&&!n(t.getLineA(),e)&&!n(t.getLineB(),e)&&!n(t.getLineC(),e))}},function(t,e,i){var n=i(4),r=i(493),s=i(96);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e))for(var o=t.getLineA(),a=t.getLineB(),h=t.getLineC(),l=[new n,new n,new n],u=[s(o,e,l[0]),s(a,e,l[1]),s(h,e,l[2])],c=0;c<3;c++)u[c]&&i.push(l[c]);return i}},function(t,e,i){var n=i(96);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){var n=i(235),r=i(495),s=i(96);t.exports=function(t,e){if(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top)return!1;var i=t.getLineA(),o=t.getLineB(),a=t.getLineC(),h=e.getLineA(),l=e.getLineB(),u=e.getLineC();if(s(i,h)||s(i,l)||s(i,u))return!0;if(s(o,h)||s(o,l)||s(o,u))return!0;if(s(a,h)||s(a,l)||s(a,u))return!0;var c=r(t),d=n(e,c,!0);return d.length>0||(c=r(e),(d=n(t,c,!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 u=((a-n)*(s-n)+(h-r)*(o-r))/l;if(u<0)return Math.sqrt((n-a)*(n-a)+(r-h)*(r-h))<=i;if(u>=0&&u<=1){var c=((r-h)*(s-n)-(n-a)*(o-r))/l;return Math.abs(c)*Math.sqrt(l)<=i}return Math.sqrt((s-a)*(s-a)+(o-h)*(o-h))<=i}},function(t,e,i){var n=i(14),r=i(68),s=i(97);t.exports=function(t){var e=s(t)-n.TAU;return r(e,-Math.PI,Math.PI)}},function(t,e){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 u(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 c(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;a<i;a++){var h=t[a+1].split("/"),l=h.length;if(!(l<1||l>3)){var u=0,c=0,d=0;u=parseInt(h[0],10),l>1&&""!==h[1]&&(c=parseInt(h[1],10)),l>2&&(d=parseInt(h[2],10)),0!==u&&(u<0&&(u=o(e).vertices.length+1+u),c-=1,u-=1,d-=1,s.vertices.push({textureCoordsIndex:c,vertexIndex:u,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<m.length;g++){var v=s(m[g]).replace(/\s\s+/g," ").trim().split(" ");switch(v[0].toLowerCase()){case"o":a(v,o);break;case"g":h(v);break;case"v":l(v,o);break;case"vt":u(v,o);break;case"vn":c(v,o);break;case"f":d(v,o);break;case"mtllib":p(v,o);break;case"usemtl":f(v)}}return o}},function(t,e,i){var n=i(103);t.exports=function(t){for(var e={},i=t.split("\n"),r="",s=0;s<i.length;s++){var o=i[s].trim();if(0!==o.indexOf("#")&&""!==o){var a=o.replace(/\s\s+/g," ").trim().split(" ");switch(a[0].toLowerCase()){case"newmtl":r=a[1];break;case"kd":var h=Math.floor(255*a[1]),l=a.length>=2?Math.floor(255*a[2]):h,u=a.length>=3?Math.floor(255*a[3]):h;e[r]=n(h,l,u)}}}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){var n=i(10);n.Area=i(1267),n.Ceil=i(1268),n.CeilAll=i(1269),n.CenterOn=i(190),n.Clone=i(1270),n.Contains=i(57),n.ContainsPoint=i(1271),n.ContainsRect=i(503),n.CopyFrom=i(1272),n.Decompose=i(490),n.Equals=i(1273),n.FitInside=i(1274),n.FitOutside=i(1275),n.Floor=i(1276),n.FloorAll=i(1277),n.FromPoints=i(199),n.FromXY=i(1278),n.GetAspectRatio=i(237),n.GetCenter=i(1279),n.GetPoint=i(171),n.GetPoints=i(306),n.GetSize=i(1280),n.Inflate=i(1281),n.Intersection=i(1282),n.MarchingAnts=i(316),n.MergePoints=i(1283),n.MergeRect=i(1284),n.MergeXY=i(1285),n.Offset=i(1286),n.OffsetPoint=i(1287),n.Overlaps=i(1288),n.Perimeter=i(130),n.PerimeterPoint=i(1289),n.Random=i(174),n.RandomOutside=i(1290),n.SameDimensions=i(1291),n.Scale=i(1292),n.Union=i(441),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.x<t.right&&e.right>t.x&&e.right<t.right&&e.y>t.y&&e.y<t.bottom&&e.bottom>t.y&&e.bottom<t.bottom}},function(t,e,i){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){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,u=r(h,l,o,a),c=r(i,s,h,l),d=r(o,a,i,s),p=u+c+d;return e.x=(i*u+o*c+h*d)/p,e.y=(s*u+a*c+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){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)<this.threshold?0:this.value},destroy:function(){this.pad=null,this.events=null}});t.exports=n},function(t,e,i){var n=i(0),r=i(239),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){var n=i(509),r=i(510),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<e.buttons.length;s++)i.push(new r(this,s));this.buttons=i;var h=[];for(s=0;s<e.axes.length;s++)h.push(new n(this,s));this.axes=h,this.vibration=e.vibrationActuator;var l={value:0,pressed:!1};this._LCLeft=i[14]?i[14]:l,this._LCRight=i[15]?i[15]:l,this._LCTop=i[12]?i[12]:l,this._LCBottom=i[13]?i[13]:l,this._RCLeft=i[2]?i[2]:l,this._RCRight=i[1]?i[1]:l,this._RCTop=i[3]?i[3]:l,this._RCBottom=i[0]?i[0]:l,this._FBLeftTop=i[4]?i[4]:l,this._FBLeftBottom=i[6]?i[6]:l,this._FBRightTop=i[5]?i[5]:l,this._FBRightBottom=i[7]?i[7]:l;var u={value:0};this._HAxisLeft=h[0]?h[0]:u,this._VAxisLeft=h[1]?h[1]:u,this._HAxisRight=h[2]?h[2]:u,this._VAxisRight=h[3]?h[3]:u,this.leftStick=new a,this.rightStick=new a,this._created=performance.now()},getAxisTotal:function(){return this.axes.length},getAxisValue:function(t){return this.axes[t].getValue()},setAxisThreshold:function(t){for(var e=0;e<this.axes.length;e++)this.axes[e].threshold=t},getButtonTotal:function(){return this.buttons.length},getButtonValue:function(t){return this.buttons[t].value},isButtonDown:function(t){return this.buttons[t].pressed},update:function(t){if(!(t.timestamp<this._created)){var e,i=this.buttons,n=t.buttons,r=i.length;for(e=0;e<r;e++)i[e].update(n[e].value);var s=this.axes,o=t.axes;for(r=s.length,e=0;e<r;e++)s[e].update(o[e]);r>=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<this.buttons.length;t++)this.buttons[t].destroy();for(t=0;t<this.axes.length;t++)this.axes[t].destroy();this.buttons=[],this.axes=[]},connected:{get:function(){return this.pad.connected}},timestamp:{get:function(){return this.pad.timestamp}},left:{get:function(){return this._LCLeft.pressed}},right:{get:function(){return this._LCRight.pressed}},up:{get:function(){return this._LCTop.pressed}},down:{get:function(){return this._LCBottom.pressed}},A:{get:function(){return this._RCBottom.pressed}},Y:{get:function(){return this._RCTop.pressed}},X:{get:function(){return this._RCLeft.pressed}},B:{get:function(){return this._RCRight.pressed}},L1:{get:function(){return this._FBLeftTop.value}},L2:{get:function(){return this._FBLeftBottom.value}},R1:{get:function(){return this._FBRightTop.value}},R2:{get:function(){return this._FBRightBottom.value}}});t.exports=h},function(t,e,i){var n=i(0),r=i(9),s=i(154),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){var n=i(0),r=i(154),s=i(2),o=i(514),a=i(516),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<e.length;n++){var h=e[n];"string"==typeof h?this.keyCodes.push(h.toUpperCase().charCodeAt(0)):"number"==typeof h?this.keyCodes.push(h):h.hasOwnProperty("keyCode")&&this.keyCodes.push(h.keyCode)}this.current=this.keyCodes[0],this.index=0,this.size=this.keyCodes.length,this.timeLastMatched=0,this.matched=!1,this.timeMatched=0,this.resetOnWrongKey=s(i,"resetOnWrongKey",!0),this.maxKeyDelay=s(i,"maxKeyDelay",0),this.resetOnMatch=s(i,"resetOnMatch",!1),this.deleteOnMatch=s(i,"deleteOnMatch",!1);var l=this;this.onKeyDown=function(t){!l.matched&&l.enabled&&o(t,l)&&(l.manager.emit(r.COMBO_MATCH,l,t),l.resetOnMatch?a(l):l.deleteOnMatch&&l.destroy())},this.manager.on(r.ANY_KEY_DOWN,this.onKeyDown)},progress:{get:function(){return this.index/this.size}},destroy:function(){this.enabled=!1,this.keyCodes=[],this.manager.off(r.ANY_KEY_DOWN,this.onKeyDown),this.manager=null}});t.exports=h},function(t,e,i){var n=i(515);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){var n=i(240);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){var n=i(0),r=i(21),s=i(23),o=i(8),a=i(2),h=i(519),l=i(7),u=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){t.onProcessError()})),this.config.context=null}});u.create=function(t,e,i,n,r){var s=t.systems.game,o=s.config.audio,c=s.device.audio;l(e)&&(i=a(e,"url",[]),n=a(e,"config",{}));var d=u.getAudioURL(s,i);return d?c.webAudio&&!o.disableWebAudio?new u(t,e,d,r,s.sound.context):new h(t,e,d,n):null},u.getAudioURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++){var n=a(e[i],"url",e[i]);if(0===n.indexOf("blob:")||0===n.indexOf("data:"))return{url:n,type:""};var r=n.match(/\.([a-zA-Z0-9]+)($|\?)/);if(r=a(e[i],"type",r?r[1]:"").toLowerCase(),t.device.audio[r])return{url:n,type:r}}return null},o.register("audio",(function(t,e,i,n){var r,s=this.systems.game,o=s.config.audio,a=s.device.audio;if(o.noAudio||!a.webAudio&&!a.audioData)return this;if(Array.isArray(t))for(var h=0;h<t.length;h++)(r=u.create(this,t[h]))&&this.addFile(r);else(r=u.create(this,t,e,i,n))&&this.addFile(r);return this})),t.exports=u},function(t,e,i){var n=i(0),r=i(95),s=i(23),o=i(2),a=i(155),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<this.data.length;t++){var e=this.data[t];e.oncanplaythrough=null,e.onerror=null}this.loader.nextFile(this,!1)},onProgress:function(t){var e=t.target;e.oncanplaythrough=null,e.onerror=null,this.filesLoaded++,this.percentComplete=Math.min(this.filesLoaded/this.filesTotal,1),this.loader.emit(r.FILE_PROGRESS,this,this.percentComplete),this.filesLoaded===this.filesTotal&&this.onLoad()},load:function(){this.data=[];var t=this.config&&this.config.instances||1;this.filesTotal=t,this.filesLoaded=0,this.percentComplete=0;for(var e=0;e<t;e++){var i=new Audio;i.dataset||(i.dataset={}),i.dataset.name=this.key+("0"+e).slice(-2),i.dataset.used="false",this.locked?i.dataset.locked="true":(i.dataset.locked="false",i.preload="auto",i.oncanplaythrough=this.onProgress.bind(this),i.onerror=this.onError.bind(this)),this.data.push(i)}for(e=0;e<this.data.length;e++)(i=this.data[e]).src=a(this,this.loader.baseURL),this.locked||i.load();this.locked&&setTimeout(this.onLoad.bind(this))}});t.exports=l},function(t,e,i){var n=i(0),r=i(21),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<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,i));return this})),t.exports=l},function(t,e,i){var n=i(522),r=i(157),s=i(0),o=i(62),a=i(524),h=i(525),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){var n=i(0),r=i(243),s=i(125),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(244),r=i(65),s=i(231),o=i(151);t.exports=function(t,e,i,a,h,l){var u=n(t,e-a,i-a,2*a,2*a,h,l);if(0===u.length)return u;for(var c=new r(e,i,a),d=new r,p=[],f=0;f<u.length;f++){var m=u[f];m.isCircle?(d.setTo(m.center.x,m.center.y,m.halfWidth),s(c,d)&&p.push(m)):o(c,m)&&p.push(m)}return p}},function(t,e,i){var n=i(157),r=i(0),s=i(62),o=i(2),a=i(113),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<n.length;r++)n[r].body.velocity.set(t+r*i,e+r*i);return this},setVelocityX:function(t,e){void 0===e&&(e=0);for(var i=this.getChildren(),n=0;n<i.length;n++)i[n].body.velocity.x=t+n*e;return this},setVelocityY:function(t,e){void 0===e&&(e=0);for(var i=this.getChildren(),n=0;n<i.length;n++)i[n].body.velocity.y=t+n*e;return this}});t.exports=l},function(t,e,i){var n=i(157),r=i(0),s=i(62),o=i(2),a=i(113),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<t.length;e++)t[e].body.reset();return this}});t.exports=l},function(t,e,i){var n=i(350),r=i(527),s=i(18),o=i(0),a=i(528),h=i(62),l=i(50),u=i(9),c=i(245),d=i(124),p=i(354),f=i(355),m=i(246),g=i(247),v=i(529),y=i(6),x=i(14),w=i(211),b=i(530),A=i(10),T=i(531),S=i(532),E=i(537),M=i(538),_=i(149),C=i(539),P=i(248),R=i(25),L=i(3),O=i(68),D=new o({Extends:u,initialize:function(t,e){u.call(this),this.scene=t,this.bodies=new _,this.staticBodies=new _,this.pendingDestroy=new _,this.colliders=new w,this.gravity=new L(y(e,"gravity.x",0),y(e,"gravity.y",0)),this.bounds=new A(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 T(this.maxEntries),this.staticTree=new T(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<t.length;i++){var n=t[i];if(n.isParent)for(var r=n.getChildren(),s=0;s<r.length;s++){var o=r[s];o.isParent?this.enable(o,e):this.enableBody(o,e)}else this.enableBody(n,e)}},enableBody:function(t,e){return void 0===e&&(e=h.DYNAMIC_BODY),t.body||(e===h.DYNAMIC_BODY?t.body=new r(this,t):e===h.STATIC_BODY&&(t.body=new C(this,t))),this.add(t.body),t},add:function(t){return t.physicsType===h.DYNAMIC_BODY?this.bodies.set(t):t.physicsType===h.STATIC_BODY&&(this.staticBodies.set(t),this.staticTree.insert(t)),t.enable=!0,t},disable:function(t){Array.isArray(t)||(t=[t]);for(var e=0;e<t.length;e++){var i=t[e];if(i.isParent)for(var n=i.getChildren(),r=0;r<n.length;r++){var s=n[r];s.isParent?this.disable(s):this.disableBody(s.body)}else this.disableBody(i.body)}},disableBody:function(t){this.remove(t),t.enable=!1},remove:function(t){t.physicsType===h.DYNAMIC_BODY?(this.tree.remove(t),this.bodies.delete(t)):t.physicsType===h.STATIC_BODY&&(this.staticBodies.delete(t),this.staticTree.remove(t))},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},setBounds:function(t,e,i,n,r,s,o,a){return this.bounds.setTo(t,e,i,n),void 0!==r&&this.setBoundsCollision(r,s,o,a),this},setBoundsCollision: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.checkCollision.left=t,this.checkCollision.right=e,this.checkCollision.up=i,this.checkCollision.down=n,this},pause:function(){return this.isPaused=!0,this.emit(c.PAUSE),this},resume:function(){return this.isPaused=!1,this.emit(c.RESUME),this},addCollider:function(t,e,i,n,r){void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=i);var s=new a(this,!1,t,e,i,n,r);return this.colliders.add(s),s},addOverlap:function(t,e,i,n,r){void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=i);var s=new a(this,!0,t,e,i,n,r);return this.colliders.add(s),s},removeCollider:function(t){return this.colliders.remove(t),this},setFPS:function(t){return this.fps=t,this._frameTime=1/this.fps,this._frameTimeMS=1e3*this._frameTime,this},update:function(t,e){if(!this.isPaused&&0!==this.bodies.size){var i,n,r=this._frameTime,s=this._frameTimeMS*this.timeScale;this._elapsed+=e;var o=this.bodies.entries,a=this._elapsed>=s;for(this.fixedStep||(r=.001*e,a=!0,this._elapsed=0),i=0;i<o.length;i++)(n=o[i]).enable&&n.preUpdate(a,r);if(a){this._elapsed-=s,this.stepsLastFrame=1,this.useTree&&(this.tree.clear(),this.tree.load(o));var h=this.colliders.update();for(i=0;i<h.length;i++){var l=h[i];l.active&&l.update()}this.emit(c.WORLD_STEP,r)}for(;this._elapsed>=s;)this._elapsed-=s,this.step(r)}},step:function(t){var e,i,n=this.bodies.entries,r=n.length;for(e=0;e<r;e++)(i=n[e]).enable&&i.update(t);this.useTree&&(this.tree.clear(),this.tree.load(n));var s=this.colliders.update();for(e=0;e<s.length;e++){var o=s[e];o.active&&o.update()}this.emit(c.WORLD_STEP,t),this.stepsLastFrame++},postUpdate:function(){var t,e,i=this.bodies.entries,n=i.length,r=this.bodies,s=this.staticBodies;if(this.stepsLastFrame)for(this.stepsLastFrame=0,t=0;t<n;t++)(e=i[t]).enable&&e.postUpdate();if(this.drawDebug){var o=this.debugGraphic;for(o.clear(),t=0;t<n;t++)(e=i[t]).willDrawDebug()&&e.drawDebug(o);for(n=(i=s.entries).length,t=0;t<n;t++)(e=i[t]).willDrawDebug()&&e.drawDebug(o)}var a=this.pendingDestroy;if(a.size>0){var l=this.tree,u=this.staticTree;for(n=(i=a.entries).length,t=0;t<n;t++)(e=i[t]).physicsType===h.DYNAMIC_BODY?(l.remove(e),r.delete(e)):e.physicsType===h.STATIC_BODY&&(u.remove(e),s.delete(e)),e.world=void 0,e.gameObject=void 0;a.clear()}},updateMotion:function(t,e){t.allowRotation&&this.computeAngularVelocity(t,e),this.computeVelocity(t,e)},computeAngularVelocity:function(t,e){var i=t.angularVelocity,n=t.angularAcceleration,r=t.angularDrag,o=t.maxAngular;n?i+=n*e:t.allowDrag&&r&&(p(i-(r*=e),0,.1)?i-=r:f(i+r,0,.1)?i+=r:i=0);var a=(i=s(i,-o,o))-t.angularVelocity;t.angularVelocity+=a,t.rotation+=t.angularVelocity*e},computeVelocity:function(t,e){var i=t.velocity.x,n=t.acceleration.x,r=t.drag.x,o=t.maxVelocity.x,a=t.velocity.y,h=t.acceleration.y,l=t.drag.y,u=t.maxVelocity.y,c=t.speed,m=t.maxSpeed,g=t.allowDrag,v=t.useDamping;t.allowGravity&&(i+=(this.gravity.x+t.gravity.x)*e,a+=(this.gravity.y+t.gravity.y)*e),n?i+=n*e:g&&r&&(v?(i*=r=Math.pow(r,e),c=Math.sqrt(i*i+a*a),d(c,0,.001)&&(i=0)):p(i-(r*=e),0,.01)?i-=r:f(i+r,0,.01)?i+=r:i=0),h?a+=h*e:g&&l&&(v?(a*=l=Math.pow(l,e),c=Math.sqrt(i*i+a*a),d(c,0,.001)&&(a=0)):p(a-(l*=e),0,.01)?a-=l:f(a+l,0,.01)?a+=l:a=0),i=s(i,-o,o),a=s(a,-u,u),t.velocity.set(i,a),m>-1&&c>m&&(t.velocity.normalize().scale(m),c=m),t.speed=c},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.y<h.y||l.y>h.bottom)&&(l.x<h.x||l.x>h.right))return this.separateCircle(t,e,r)}var u=!1,d=!1;r?(u=E(t,e,r,this.OVERLAP_BIAS),d=M(t,e,r,this.OVERLAP_BIAS)):this.forceX||Math.abs(this.gravity.y+t.gravity.y)<Math.abs(this.gravity.x+t.gravity.x)?(u=E(t,e,r,this.OVERLAP_BIAS),this.intersects(t,e)&&(d=M(t,e,r,this.OVERLAP_BIAS))):(d=M(t,e,r,this.OVERLAP_BIAS),this.intersects(t,e)&&(u=E(t,e,r,this.OVERLAP_BIAS)));var p=u||d;return p&&(r?(t.onOverlap||e.onOverlap)&&this.emit(c.OVERLAP,t.gameObject,e.gameObject,t,e):(t.onCollide||e.onCollide)&&this.emit(c.COLLIDE,t.gameObject,e.gameObject,t,e)),p},separateCircle:function(t,e,i,r){m(t,e,!1,r),g(t,e,!1,r);var s=0;if(t.isCircle!==e.isCircle){var o={x:e.isCircle?t.position.x:e.position.x,y:e.isCircle?t.position.y:e.position.y,right:e.isCircle?t.right:e.right,bottom:e.isCircle?t.bottom:e.bottom},a={x:t.isCircle?t.center.x:e.center.x,y:t.isCircle?t.center.y:e.center.y,radius:t.isCircle?t.halfWidth:e.halfWidth};a.y<o.y?a.x<o.x?s=l(a.x,a.y,o.x,o.y)-a.radius:a.x>o.right&&(s=l(a.x,a.y,o.right,o.y)-a.radius):a.y>o.bottom&&(a.x<o.x?s=l(a.x,a.y,o.x,o.bottom)-a.radius:a.x>o.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(c.OVERLAP,t.gameObject,e.gameObject,t,e),0!==s;var h=t.center.x-e.center.x,u=t.center.y-e.center.y,d=Math.sqrt(Math.pow(h,2)+Math.pow(u,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),w=(s+x.EPSILON)*Math.cos(y),b=(s+x.EPSILON)*Math.sin(y);return t.immovable||(t.x-=w,t.y-=b,t.updateCenter()),e.immovable||(e.x+=w,e.y+=b,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(c.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;o<e.length;o++)this.collideHandler(t,e[o],i,n,r,s);else if(h&&!l)if(e)for(o=0;o<t.length;o++)this.collideHandler(t[o],e,i,n,r,s);else for(o=0;o<t.length;o++){var u=t[o];for(a=o+1;a<t.length;a++)o!==a&&this.collideHandler(u,t[a],i,n,r,s)}else for(o=0;o<t.length;o++)for(a=0;a<e.length;a++)this.collideHandler(t[o],e[a],i,n,r,s);else this.collideHandler(t,e,i,n,r,s);return this._total>0},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,u=t.body;if(0!==e.length&&u&&u.enable&&!u.checkCollision.none)if(this.useTree||e.physicsType===h.STATIC_BODY){var c=this.treeMinMax;c.minX=u.left,c.minY=u.top,c.maxX=u.right,c.maxY=u.bottom;var d=e.physicsType===h.DYNAMIC_BODY?this.tree.search(c):this.staticTree.search(c);for(a=d.length,o=0;o<a;o++)u!==(l=d[o])&&l.enable&&!l.checkCollision.none&&e.contains(l.gameObject)&&this.separate(u,l,n,r,s,!0)&&(i&&i.call(r,u.gameObject,l.gameObject),this._total++)}else{var p=e.getChildren(),f=e.children.entries.indexOf(t);for(a=p.length,o=0;o<a;o++)(l=p[o].body)&&o!==f&&l.enable&&this.separate(u,l,n,r,s)&&(i&&i.call(r,u.gameObject,l.gameObject),this._total++)}},collideGroupVsTilemapLayer:function(t,e,i,n,r,s){var o=t.getChildren();if(0===o.length)return!1;for(var a=!1,h=0;h<o.length;h++)o[h].body&&this.collideSpriteVsTilemapLayer(o[h],e,i,n,r,s)&&(a=!0);return a},collideTiles:function(t,e,i,n,r){return!(!t.body.enable||0===e.length)&&this.collideSpriteVsTilesHandler(t,e,i,n,r,!1,!1)},overlapTiles:function(t,e,i,n,r){return!(!t.body.enable||0===e.length)&&this.collideSpriteVsTilesHandler(t,e,i,n,r,!0,!1)},collideSpriteVsTilemapLayer:function(t,e,i,n,r,s){var o=t.body;if(!o.enable||o.checkCollision.none)return!1;var a=o.position.x,h=o.position.y,l=o.width,u=o.height,c=e.layer;if(c.tileWidth>c.baseTileWidth){var d=(c.tileWidth-c.baseTileWidth)*e.scaleX;a-=d,l+=d}c.tileHeight>c.baseTileHeight&&(u+=(c.tileHeight-c.baseTileHeight)*e.scaleY);var p=v(a,h,l,u,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,u={left:0,right:0,top:0,bottom:0},d=!1,p=0;p<e.length;p++){var f=(h=(a=e[p]).tilemapLayer).tileToWorldXY(a.x,a.y);u.left=f.x,u.top=f.y,a.baseHeight!==a.height&&(u.top-=(a.height-a.baseHeight)*h.scaleY),u.right=u.left+a.width*h.scaleX,u.bottom=u.top+a.height*h.scaleY,P(u,l)&&(!n||n.call(r,t,a))&&b(a,t)&&(s||S(p,l,a,u,h,this.TILE_BIAS,o))&&(this._total++,d=!0,i&&i.call(r,t,a),s&&l.onOverlap?this.emit(c.TILE_OVERLAP,t,a,l):l.onCollide&&this.emit(c.TILE_COLLIDE,t,a,l))}return d},collideGroupVsGroup:function(t,e,i,n,r,s){if(0!==t.length&&0!==e.length)for(var o=t.getChildren(),a=0;a<o.length;a++)this.collideSpriteVsGroup(o[a],e,i,n,r,s)},wrap:function(t,e){t.body?this.wrapObject(t,e):t.getChildren?this.wrapArray(t.getChildren(),e):Array.isArray(t)?this.wrapArray(t,e):this.wrapObject(t,e)},wrapArray:function(t,e){for(var i=0;i<t.length;i++)this.wrapObject(t[i],e)},wrapObject:function(t,e){void 0===e&&(e=0),t.x=O(t.x,this.bounds.left-e,this.bounds.right+e),t.y=O(t.y,this.bounds.top-e,this.bounds.bottom+e)},shutdown:function(){this.tree.clear(),this.staticTree.clear(),this.bodies.clear(),this.staticBodies.clear(),this.colliders.destroy(),this.removeAllListeners()},destroy:function(){this.shutdown(),this.scene=null}});t.exports=D},function(t,e,i){var n=i(0),r=i(62),s=i(245),o=i(196),a=i(10),h=i(57),l=i(3),u=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.x<e.x&&i.left?(t.x=e.x,this.velocity.x*=n,this.blocked.left=!0,s=!0):this.right>e.right&&i.right&&(t.x=e.right-this.width,this.velocity.x*=n,this.blocked.right=!0,s=!0),t.y<e.y&&i.up?(t.y=e.y,this.velocity.y*=r,this.blocked.up=!0,s=!0):this.bottom>e.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=u},function(t,e,i){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){var n=i(26),r=i(3),s=new r,o=new r;t.exports=function(t,e,i,r,a,h,l){var u=l.tilemapLayer.tilemap._convert.WorldToTileXY;u(t,e,!0,s,h,l);var c=s.x,d=s.y;u(t+i,e+r,!1,o,h,l);var p=Math.ceil(o.x),f=Math.ceil(o.y);return n(c,d,p-c,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){var n=i(436);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<e.length;n++)if(i(t,e[n]))return n;return-1}function o(t,e){a(t,0,t.children.length,e,t)}function a(t,e,i,n,r){r||(r=m(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(var s,o=e;o<i;o++)s=t.children[o],h(r,t.leaf?n(s):s);return r}function h(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function c(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function d(t){return t.maxX-t.minX+(t.maxY-t.minY)}function p(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function f(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=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<s;r++)o=e.children[r],f(t,a=e.leaf?n(o):o)&&(e.leaf?i.push(o):p(t,a)?this._all(o,i):h.push(o));e=h.pop()}return i},collides:function(t){var e=this.data,i=this.toBBox;if(!f(t,e))return!1;for(var n,r,s,o,a=[];e;){for(n=0,r=e.children.length;n<r;n++)if(s=e.children[n],f(t,o=e.leaf?i(s):s)){if(e.leaf||p(t,o))return!0;a.push(s)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,i=t.length;e<i;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=m([]),this},remove:function(t,e){if(!t)return this;for(var i,n,r,o,a=this.data,h=this.toBBox(t),l=[],u=[];a||l.length;){if(a||(a=l.pop(),n=l[l.length-1],i=u.pop(),o=!0),a.leaf&&-1!==(r=s(t,a.children,e)))return a.children.splice(r,1),l.push(a),this._condense(l),this;o||a.leaf||!p(a,h)?n?(i++,a=n.children[i],o=!1):a=null:(l.push(a),u.push(i),i=0,n=a,a=a.children[0])}return this},toBBox:function(t){return t},compareMinX:l,compareMinY:u,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var i=[];t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},_build:function(t,e,i,n){var r,s=i-e+1,a=this._maxEntries;if(s<=a)return o(r=m(t.slice(e,i+1)),this.toBBox),r;n||(n=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,n-1))),(r=m([])).leaf=!1,r.height=n;var h,l,u,c,d=Math.ceil(s/a),p=d*Math.ceil(Math.sqrt(a));for(g(t,e,i,p,this.compareMinX),h=e;h<=i;h+=p)for(g(t,h,u=Math.min(h+p-1,i),d,this.compareMinY),l=h;l<=u;l+=d)c=Math.min(l+d-1,u),r.children.push(this._build(t,l,c,n-1));return o(r,this.toBBox),r},_chooseSubtree:function(t,e,i,n){for(var r,s,o,a,h,l,u,d,p,f;n.push(e),!e.leaf&&n.length-1!==i;){for(u=d=1/0,r=0,s=e.children.length;r<s;r++)h=c(o=e.children[r]),p=t,f=o,(l=(Math.max(f.maxX,p.maxX)-Math.min(f.minX,p.minX))*(Math.max(f.maxY,p.maxY)-Math.min(f.minY,p.minY))-h)<d?(d=l,u=h<u?h:u,a=o):l===d&&h<u&&(u=h,a=o);e=a||e.children[0]}return e},_insert:function(t,e,i){var n=this.toBBox,r=i?t:n(t),s=[],o=this._chooseSubtree(r,this.data,e,s);for(o.children.push(t),h(o,r);e>=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,u,d,p,f,m,g,v,y;for(l=u=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=c(r)+c(s),o<l?(l=o,d=n,u=h<u?h:u):o===l&&h<u&&(u=h,d=n);return d},_chooseSplitAxis:function(t,e,i){var n=t.leaf?this.compareMinX:l,r=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,i,n)<this._allDistMargin(t,e,i,r)&&t.children.sort(n)},_allDistMargin:function(t,e,i,n){t.children.sort(n);var r,s,o=this.toBBox,l=a(t,0,e,o),u=a(t,i-e,i,o),c=d(l)+d(u);for(r=e;r<i-e;r++)s=t.children[r],h(l,t.leaf?o(s):s),c+=d(l);for(r=i-e-1;r>=e;r--)s=t.children[r],h(u,t.leaf?o(s):s),c+=d(u);return c},_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){var n=i(533),r=i(535),s=i(248);t.exports=function(t,e,i,o,a,h,l){var u=o.left,c=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()<e.deltaAbsY()&&(x=-1),0!==e.deltaX()&&0!==e.deltaY()&&f&&m&&(y=Math.min(Math.abs(e.position.x-d),Math.abs(e.right-u)),x=Math.min(Math.abs(e.position.y-p),Math.abs(e.bottom-c))),y<x){if(f&&0!==(g=n(e,i,u,d,h,l))&&!s(o,e))return!0;m&&(v=r(e,i,c,p,h,l))}else{if(m&&0!==(v=r(e,i,c,p,h,l))&&!s(o,e))return!0;f&&(g=n(e,i,u,d,h,l))}return 0!==g||0!==v}},function(t,e,i){var n=i(534);t.exports=function(t,e,i,r,s,o){var a=0,h=e.faceLeft,l=e.faceRight,u=e.collideLeft,c=e.collideRight;return o||(h=!0,l=!0,u=!0,c=!0),t.deltaX()<0&&c&&t.checkCollision.left?l&&t.x<r&&(a=t.x-r)<-s&&(a=0):t.deltaX()>0&&u&&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){var n=i(536);t.exports=function(t,e,i,r,s,o){var a=0,h=e.faceTop,l=e.faceBottom,u=e.collideUp,c=e.collideDown;return o||(h=!0,l=!0,u=!0,c=!0),t.deltaY()<0&&c&&t.checkCollision.up?l&&t.y<r&&(a=t.y-r)<-s&&(a=0):t.deltaY()>0&&u&&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){var n=i(246),r=i(1389);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){var n=i(247),r=i(1390);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){var n=i(66),r=i(0),s=i(62),o=i(57),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){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){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.x<r.worldView.right+s.scaleX*i.tileWidth*(o-.5)&&h.y>r.worldView.y+s.scaleY*i.tileHeight*(-a-1)&&h.y<r.worldView.bottom+s.scaleY*i.tileHeight*(a-.5)}},function(t,e,i){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<h.length;l++)h[l]&&h[l].index===t&&(h[l].index=e)}},function(t,e,i){var n=i(10),r=i(139),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,u=r(e.worldView.right-n.x,a,0,!0)+n.cullPaddingX,c=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,c,u-l,d-c)}},function(t,e,i){var n=i(543),r=i(159);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){var n=i(546),r=i(159);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){var n=i(139),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){var n=i(541);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,u=t.width,c=t.height,d=u,p=c;if(!h.skipCull)if(0===r){for(o=0;o<p;o++)for(s=0;l[o]&&s<d;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(1===r){for(o=0;o<p;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)}}else if(2===r){for(o=p;o>=0;o--)for(s=0;l[o]&&s<d;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(3===r)for(o=p;o>=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=u*c,i}},function(t,e,i){var n=i(549),r=i(159);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){var n=i(139),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){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,u=0;h&&(r||(r=h.scene.cameras.main),l=h.x+r.scrollX*(1-h.scrollFactorX),o*=h.scaleX,u=h.y+r.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var c=s.hexSideLength,d=l+t*o+e%2*(o/2),p=u+e*((a-c)/2+c);return i.set(d,p)}},function(t,e,i){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,u=0;h&&(r||(r=h.scene.cameras.main),l=h.x+r.scrollX*(1-h.scrollFactorX),o*=h.scaleX,u=h.y+r.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var c=l+o/2*(t-e),d=u+(t+e)*(a/2);return i.set(c,d)}},function(t,e,i){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,u=0;h&&(r||(r=h.scene.cameras.main),l=h.x+r.scrollX*(1-h.scrollFactorX),o*=h.scaleX,u=h.y+r.scrollY*(1-h.scrollFactorY),a*=h.scaleY);var c=l+t*o+e%2*(o/2),d=u+e*(a/2);return i.set(c,d)}},function(t,e,i){var n=i(253),r=i(254),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){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 u=o.hexSideLength,c=(h-u)/2+u,d=i?Math.floor(e/c):e/c,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){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 u=i?Math.floor((t/(a/2)+e/(h/2))/2):(t/(a/2)+e/(h/2))/2,c=i?Math.floor((e/(h/2)-t/(a/2))/2):(e/(h/2)-t/(a/2))/2;return r.set(u,c)}},function(t,e,i){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 u=i?Math.floor(e/(h/2)):e/(h/2),c=i?Math.floor((t+u%2*.5*a)/a):(t+u%2*.5*a)/a;return r.set(c,u)}},function(t,e,i){var n=i(255),r=i(256),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){var n=i(119);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){var n=i(85),r=i(119),s=i(252);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){var n=i(40),r=i(259),s=i(565),o=i(566),a=i(577);t.exports=function(t,e,i,h,l,u){var c;switch(e){case n.ARRAY_2D:c=r(t,i,h,l,u);break;case n.CSV:c=s(t,i,h,l,u);break;case n.TILED_JSON:c=o(t,i,u);break;case n.WELTMEISTER:c=a(t,i,u);break;default:c=null}return c}},function(t,e,i){var n=i(40),r=i(259);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){var n=i(567),r=i(568),s=i(29),o=i(40),a=i(258),h=i(121),l=i(569),u=i(570),c=i(573),d=i(575);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=c(e,i),p.images=l(e);var f=d(e);return p.tilesets=f.tilesets,p.imageCollections=f.imageCollections,p.objects=u(e),p.tiles=r(p),n(p),p}},function(t,e,i){var n=i(17);t.exports=function(t){for(var e,i,r,s,o,a=0;a<t.layers.length;a++){e=t.layers[a],s=null;for(var h=0;h<e.data.length;h++){o=e.data[h];for(var l=0;l<o.length;l++)null===(i=o[l])||i.index<0||(r=t.tiles[i.index][2],s=t.tilesets[r],i.width=s.tileWidth,i.height=s.tileHeight,s.tileProperties&&s.tileProperties[i.index-s.firstgid]&&(i.properties=n(i.properties,s.tileProperties[i.index-s.firstgid])))}}}},function(t,e,i){var n=i(122);t.exports=function(t){var e,i,r=[];for(e=0;e<t.imageCollections.length;e++)for(var s=t.imageCollections[e],o=s.images,a=0;a<o.length;a++){var h=o[a];(i=new n(h.image,h.gid,s.imageWidth,s.imageHeight,0,0)).updateTileData(s.imageWidth,s.imageHeight),t.tilesets.push(i)}for(e=0;e<t.tilesets.length;e++)for(var l=(i=t.tilesets[e]).tileMargin,u=i.tileMargin,c=0,d=0,p=0,f=i.firstgid;f<i.firstgid+i.total&&(r[f]=[l,u,e],l+=i.tileWidth+i.tileSpacing,++c!==i.total)&&(++d!==i.columns||(l=i.tileMargin,u+=i.tileHeight+i.tileSpacing,d=0,++p!==i.rows));f++);return r}},function(t,e,i){var n=i(2),r=i(161);t.exports=function(t){for(var e=[],i=[],s=r(t);s.i<s.layers.length||i.length>0;)if(s.i>=s.layers.length){if(i.length<1)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){var n=i(2),r=i(260),s=i(572),o=i(161);t.exports=function(t){for(var e=[],i=[],a=o(t);a.i<a.layers.length||i.length>0;)if(a.i>=a.layers.length){if(i.length<1)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),u=a.y+n(h,"starty",0)+n(h,"offsety",0),c=[],d=0;d<h.objects.length;d++){var p=r(h.objects[d],l,u);c.push(p)}var f=new s(h);f.objects=c,e.push(f)}else if("group"===h.type){var m=o(t,h,a);i.push(a),a=m}}return e}},function(t,e,i){var n=i(126);t.exports=function(t,e){for(var i={},r=0;r<e.length;r++){var s=e[r];n(t,s)&&(i[s]=t[s])}return i}},function(t,e,i){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){var n=i(574),r=i(29),s=i(161),o=i(258),a=i(2),h=i(120),l=i(261),u=i(85);t.exports=function(t,e){for(var i=a(t,"infinite",!1),c=[],d=[],p=s(t);p.i<p.layers.length||d.length>0;)if(p.i>=p.layers.length){if(d.length<1)break;p=d.pop()}else{var f=p.layers[p.i];if(p.i++,"tilelayer"===f.type){if(!f.compression){if(f.encoding&&"base64"===f.encoding){if(f.chunks)for(var m=0;m<f.chunks.length;m++)f.chunks[m].data=n(f.chunks[m].data);f.data&&(f.data=n(f.data)),delete f.encoding}var g,v,y,x,w=[],b=0;if(i){var A=a(f,"startx",0)+f.x,T=a(f,"starty",0)+f.y;(g=new h({name:p.name+f.name,x:p.x+a(f,"offsetx",0)+A*t.tilewidth,y:p.y+a(f,"offsety",0)+T*t.tileheight,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 S=0;S<f.height;S++){w.push([null]);for(var E=0;E<f.width;E++)w[S][E]=null}for(S=0,F=f.chunks.length;S<F;S++)for(var M=f.chunks[S],_=M.x-A,C=M.y-T,P=0,R=0,L=M.data.length;R<L;R++){var O=b+_,D=P+C;(v=l(M.data[R])).gid>0?((y=new u(g,v.gid,O,D,t.tilewidth,t.tileheight)).rotation=v.rotation,y.flipX=v.flipped,w[D][O]=y):(x=e?null:new u(g,-1,O,D,t.tilewidth,t.tileheight),w[D][O]=x),++b===M.width&&(P++,b=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 B=[],I=0,F=f.data.length;I<F;I++)(v=l(f.data[I])).gid>0?((y=new u(g,v.gid,b,w.length,t.tilewidth,t.tileheight)).rotation=v.rotation,y.flipX=v.flipped,B.push(y)):(x=e?null:new u(g,-1,b,w.length,t.tilewidth,t.tileheight),B.push(x)),++b===f.width&&(w.push(B),b=0,B=[])}g.data=w,c.push(g)}}else if("group"===f.type){var k=s(t,f,p);d.push(p),p=k}}return c}},function(t,e){t.exports=function(t){for(var e=window.atob(t),i=e.length,n=new Array(i/4),r=0;r<i;r+=4)n[r/4]=(e.charCodeAt(r)|e.charCodeAt(r+1)<<8|e.charCodeAt(r+2)<<16|e.charCodeAt(r+3)<<24)>>>0;return n}},function(t,e,i){var n=i(122),r=i(576),s=i(260),o=i(1453);t.exports=function(t){for(var e,i=[],a=[],h=null,l=0;l<t.tilesets.length;l++){var u=t.tilesets[l];if(u.source);else if(u.image){var c=new n(u.name,u.firstgid,u.tilewidth,u.tileheight,u.margin,u.spacing);if(t.version>1){var d=void 0,p=void 0;if(Array.isArray(u.tiles)){d=d||{},p=p||{};for(var f=0;f<u.tiles.length;f++){var m=u.tiles[f];if(m.properties){var g={};m.properties.forEach((function(t){g[t.name]=t.value})),p[m.id]=g}if(m.objectgroup&&((d[m.id]||(d[m.id]={})).objectgroup=m.objectgroup,m.objectgroup.objects)){var v=m.objectgroup.objects.map((function(t){return s(t)}));d[m.id].objectgroup.objects=v}m.animation&&((d[m.id]||(d[m.id]={})).animation=m.animation),m.type&&((d[m.id]||(d[m.id]={})).type=m.type)}}Array.isArray(u.wangsets)&&(d=d||{},p=p||{},o(u.wangsets,d)),d&&(c.tileData=d,c.tileProperties=p)}else if(u.tileproperties&&(c.tileProperties=u.tileproperties),u.tiles)for(e in c.tileData=u.tiles,c.tileData){var y=c.tileData[e].objectgroup;if(y&&y.objects){var x=y.objects.map((function(t){return s(t)}));c.tileData[e].objectgroup.objects=x}}c.updateTileData(u.imagewidth,u.imageheight),i.push(c)}else{var w=new r(u.name,u.firstgid,u.tilewidth,u.tileheight,u.margin,u.spacing,u.properties),b=0;for(f=0;f<u.tiles.length;f++){var A=(m=u.tiles[f]).image,T=parseInt(m.id,10),S=u.firstgid+T;w.addImage(S,A),b=Math.max(T,b)}w.maxId=b,a.push(w)}h&&(h.lastgid=u.firstgid-1),h=u}return{tilesets:i,imageCollections:a}}},function(t,e,i){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<this.firstgid+this.total},addImage:function(t,e){return this.images.push({gid:t,image:e}),this.total++,this}});t.exports=n},function(t,e,i){var n=i(40),r=i(121),s=i(578),o=i(579);t.exports=function(t,e,i){if(0===e.layer.length)return null;for(var a=0,h=0,l=0;l<e.layer.length;l++)e.layer[l].width>a&&(a=e.layer[l].width),e.layer[l].height>h&&(h=e.layer[l].height);var u=new r({width:a,height:h,name:t,tileWidth:e.layer[0].tilesize,tileHeight:e.layer[0].tilesize,format:n.WELTMEISTER});return u.layers=s(e,i),u.tilesets=o(e),u}},function(t,e,i){var n=i(120),r=i(85);t.exports=function(t,e){for(var i=[],s=0;s<t.layer.length;s++){for(var o=t.layer[s],a=new n({name:o.name,width:o.width,height:o.height,tileWidth:o.tilesize,tileHeight:o.tilesize,visible:1===o.visible}),h=[],l=[],u=0;u<o.data.length;u++){for(var c=0;c<o.data[u].length;c++){var d,p=o.data[u][c]-1;d=p>-1?new r(a,p,c,u,o.tilesize,o.tilesize):e?null:new r(a,-1,c,u,o.tilesize,o.tilesize),h.push(d)}l.push(h),h=[]}a.data=l,i.push(a)}return i}},function(t,e,i){var n=i(122);t.exports=function(t){for(var e=[],i=[],r=0;r<t.layer.length;r++){var s=t.layer[r],o=s.tilesetName;""!==o&&-1===i.indexOf(o)&&(i.push(o),e.push(new n(o,0,s.tilesize,s.tilesize,0,0)))}return e}},function(t,e,i){var n=i(0),r=i(36),s=i(40),o=i(2),a=i(120),h=i(29),l=i(362),u=i(74),c=i(73),d=i(85),p=i(251),f=i(581),m=i(122),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 this.createBlankLayer(t,e,i,n,r,s,o,a)},createDynamicLayer:function(t,e,i,n){return this.createLayer(t,e,i,n)},createStaticLayer:function(t,e,i,n){return 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 null;var h=this.scene.sys.textures.get(e),l=this.getTilesetIndex(t);if(null===l&&this.format===s.TILED_JSON)return null;var u=this.tilesets[l];return u?(u.setTileSize(i,n),u.setSpacing(r,o),u.setImage(h),u):(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),(u=new m(t,a,i,n,r,o)).setImage(h),this.tilesets.push(u),u)},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 null;for(var l,u=new a({name:t,tileWidth:o,tileHeight:h,width:r,height:s,orientation:this.orientation}),c=0;c<s;c++){l=[];for(var p=0;p<r;p++)l.push(new d(u,-1,p,c,o,h,this.tileWidth,this.tileHeight));u.data.push(l)}this.layers.push(u),this.currentLayerIndex=this.layers.length-1;var m=new f(this.scene,this,this.currentLayerIndex,e,i,n);return m.setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(m),m},createLayer:function(t,e,i,n){var r=this.getLayerIndex(t);if(null===r)return null;var s=this.layers[r];if(s.tilemapLayer)return null;this.currentLayerIndex=r,void 0===i&&(i=s.x),void 0===n&&(n=s.y);var o=new f(this.scene,this,r,e,i,n);return o.setRenderOrder(this.renderOrder),this.scene.sys.displayList.add(o),o},createFromObjects:function(t,e){var i=[],n=this.getObjectLayer(t);if(!n)return i;Array.isArray(e)||(e=[e]);for(var s=n.objects,a=0;a<e.length;a++){for(var h,u=e[a],d=o(u,"id",null),p=o(u,"gid",null),f=o(u,"name",null),m=[],g=0;g<s.length;g++)h=s[g],(null===d&&null===p&&null===f||null!==d&&h.id===d||null!==p&&h.gid===p||null!==f&&h.name===f)&&m.push(h);for(var v=o(u,"classType",c),y=o(u,"scene",this.scene),x=o(u,"container",null),w=o(u,"key",null),b=o(u,"frame",null),A=0;A<m.length;A++){h=m[A];var T=new v(y);T.setName(h.name),T.setPosition(h.x,h.y),T.setTexture(w,b),h.width&&(T.displayWidth=h.width),h.height&&(T.displayHeight=h.height);var S={x:T.originX*h.width,y:(T.originY-1)*h.height};if(h.rotation){var E=r(h.rotation);l(S,E),T.rotation=E}if(T.x+=S.x,T.y+=S.y,void 0===h.flippedHorizontal&&void 0===h.flippedVertical||T.setFlip(h.flippedHorizontal,h.flippedVertical),h.visible||(T.visible=!1),Array.isArray(h.properties))h.properties.forEach((function(t){var e=t.name;void 0!==T[e]?T[e]=t.value:T.setData(e,t.value)}));else for(var M in h.properties)void 0!==T[M]?T[M]=h.properties[M]:T.setData(M,h.properties[M]);x?x.add(T):y.add.existing(T),i.push(T)}}return i},createFromTiles:function(t,e,i,n,r,s){return null===(s=this.getLayer(s))?null:p.CreateFromTiles(t,e,i,n,r,s)},fill:function(t,e,i,n,r,s,o){return void 0===s&&(s=!0),null===(o=this.getLayer(o))?null:(p.Fill(t,e,i,n,r,s,o),this)},filterObjects:function(t,e,i){return"string"!=typeof t||(t=this.getObjectLayer(t))?t.objects.filter(e,i):null},filterTiles:function(t,e,i,n,r,s,o,a){return null===(a=this.getLayer(a))?null:p.FilterTiles(t,e,i,n,r,s,o,a)},findByIndex:function(t,e,i,n){return null===(n=this.getLayer(n))?null:p.FindByIndex(t,e,i,n)},findObject:function(t,e,i){return("string"!=typeof t||(t=this.getObjectLayer(t)))&&t.objects.find(e,i)||null},findTile:function(t,e,i,n,r,s,o,a){return null===(a=this.getLayer(a))?null:p.FindTile(t,e,i,n,r,s,o,a)},forEachTile:function(t,e,i,n,r,s,o,a){return null===(a=this.getLayer(a))?null:(p.ForEachTile(t,e,i,n,r,s,o,a),this)},getImageIndex:function(t){return this.getIndex(this.images,t)},getImageLayerNames:function(){return this.images&&Array.isArray(this.images)?this.images.map((function(t){return t.name})):[]},getIndex:function(t,e){for(var i=0;i<t.length;i++)if(t[i].name===e)return i;return null},getLayer:function(t){var e=this.getLayerIndex(t);return null!==e?this.layers[e]:null},getObjectLayer:function(t){var e=this.getIndex(this.objects,t);return null!==e?this.objects[e]:null},getObjectLayerNames:function(){return this.objects&&Array.isArray(this.objects)?this.objects.map((function(t){return t.name})):[]},getLayerIndex:function(t){return void 0===t?this.currentLayerIndex:"string"==typeof t?this.getLayerIndexByName(t):"number"==typeof t&&t<this.layers.length?t:t instanceof f?t.layerIndex:null},getLayerIndexByName:function(t){return this.getIndex(this.layers,t)},getTileAt:function(t,e,i,n){return null===(n=this.getLayer(n))?null:p.GetTileAt(t,e,i,n)},getTileAtWorldXY:function(t,e,i,n,r){return null===(r=this.getLayer(r))?null:p.GetTileAtWorldXY(t,e,i,n,r)},getTileLayerNames:function(){return this.layers&&Array.isArray(this.layers)?this.layers.map((function(t){return t.name})):[]},getTilesWithin:function(t,e,i,n,r,s){return null===(s=this.getLayer(s))?null:p.GetTilesWithin(t,e,i,n,r,s)},getTilesWithinShape:function(t,e,i,n){return null===(n=this.getLayer(n))?null:p.GetTilesWithinShape(t,e,i,n)},getTilesWithinWorldXY:function(t,e,i,n,r,s,o){return null===(o=this.getLayer(o))?null:p.GetTilesWithinWorldXY(t,e,i,n,r,s,o)},getTileset:function(t){var e=this.getIndex(this.tilesets,t);return null!==e?this.tilesets[e]:null},getTilesetIndex:function(t){return this.getIndex(this.tilesets,t)},hasTileAt:function(t,e,i){return null===(i=this.getLayer(i))?null:p.HasTileAt(t,e,i)},hasTileAtWorldXY:function(t,e,i,n){return null===(n=this.getLayer(n))?null:p.HasTileAtWorldXY(t,e,i,n)},layer:{get:function(){return this.layers[this.currentLayerIndex]},set:function(t){this.setLayer(t)}},putTileAt:function(t,e,i,n,r){return void 0===n&&(n=!0),null===(r=this.getLayer(r))?null:p.PutTileAt(t,e,i,n,r)},putTileAtWorldXY:function(t,e,i,n,r,s){return void 0===n&&(n=!0),null===(s=this.getLayer(s))?null:p.PutTileAtWorldXY(t,e,i,n,r,s)},putTilesAt:function(t,e,i,n,r){return void 0===n&&(n=!0),null===(r=this.getLayer(r))?null:(p.PutTilesAt(t,e,i,n,r),this)},randomize:function(t,e,i,n,r,s){return null===(s=this.getLayer(s))?null:(p.Randomize(t,e,i,n,r,s),this)},calculateFacesAt:function(t,e,i){return null===(i=this.getLayer(i))?null:(p.CalculateFacesAt(t,e,i),this)},calculateFacesWithin:function(t,e,i,n,r){return null===(r=this.getLayer(r))?null:(p.CalculateFacesWithin(t,e,i,n,r),this)},removeLayer:function(t){var e=this.getLayerIndex(t);if(null!==e){u(this.layers,e);for(var i=e;i<this.layers.length;i++)this.layers[i].tilemapLayer&&this.layers[i].tilemapLayer.layerIndex--;return this.currentLayerIndex===e&&(this.currentLayerIndex=0),this}return null},destroyLayer:function(t){var e=this.getLayerIndex(t);return null!==e?((t=this.layers[e]).destroy(),u(this.layers,e),this.currentLayerIndex===e&&(this.currentLayerIndex=0),this):null},removeAllLayers:function(){for(var t=this.layers,e=0;e<t.length;e++)t[e].tilemapLayer&&t[e].tilemapLayer.destroy(!1);return t.length=0,this.currentLayerIndex=0,this},removeTile:function(t,e,i){void 0===e&&(e=-1),void 0===i&&(i=!0);var n=[];Array.isArray(t)||(t=[t]);for(var r=0;r<t.length;r++){var s=t[r];n.push(this.removeTileAt(s.x,s.y,!0,i,s.tilemapLayer)),e>-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<i.length;n++)p.RenderDebug(t,e,i[n]);return this},replaceByIndex:function(t,e,i,n,r,s,o){return null===(o=this.getLayer(o))?null:(p.ReplaceByIndex(t,e,i,n,r,s,o),this)},setCollision:function(t,e,i,n,r){return void 0===e&&(e=!0),void 0===i&&(i=!0),void 0===r&&(r=!0),null===(n=this.getLayer(n))?null:(p.SetCollision(t,e,i,n,r),this)},setCollisionBetween:function(t,e,i,n,r){return void 0===i&&(i=!0),void 0===n&&(n=!0),null===(r=this.getLayer(r))?null:(p.SetCollisionBetween(t,e,i,n,r),this)},setCollisionByProperty:function(t,e,i,n){return void 0===e&&(e=!0),void 0===i&&(i=!0),null===(n=this.getLayer(n))?null:(p.SetCollisionByProperty(t,e,i,n),this)},setCollisionByExclusion:function(t,e,i,n){return void 0===e&&(e=!0),void 0===i&&(i=!0),null===(n=this.getLayer(n))?null:(p.SetCollisionByExclusion(t,e,i,n),this)},setCollisionFromCollisionGroup:function(t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),null===(i=this.getLayer(i))?null:(p.SetCollisionFromCollisionGroup(t,e,i),this)},setTileIndexCallback:function(t,e,i,n){return null===(n=this.getLayer(n))?null:(p.SetTileIndexCallback(t,e,i,n),this)},setTileLocationCallback:function(t,e,i,n,r,s,o){return null===(o=this.getLayer(o))?null:(p.SetTileLocationCallback(t,e,i,n,r,s,o),this)},setLayer:function(t){var e=this.getLayerIndex(t);return null!==e&&(this.currentLayerIndex=e),this},setBaseTileSize:function(t,e){this.tileWidth=t,this.tileHeight=e,this.widthInPixels=this.width*t,this.heightInPixels=this.height*e;for(var i=0;i<this.layers.length;i++){this.layers[i].baseTileWidth=t,this.layers[i].baseTileHeight=e;for(var n=this.layers[i].data,r=this.layers[i].width,s=this.layers[i].height,o=0;o<s;o++)for(var a=0;a<r;a++){var h=n[o][a];null!==h&&h.setSize(void 0,void 0,t,e)}}return this},setLayerTileSize:function(t,e,i){if(null===(i=this.getLayer(i)))return this;i.tileWidth=t,i.tileHeight=e;for(var n=i.data,r=i.width,s=i.height,o=0;o<s;o++)for(var a=0;a<r;a++){var h=n[o][a];null!==h&&h.setSize(t,e)}return this},shuffle:function(t,e,i,n,r){return null===(r=this.getLayer(r))?null:(p.Shuffle(t,e,i,n,r),this)},swapByIndex:function(t,e,i,n,r,s,o){return null===(o=this.getLayer(o))?null:(p.SwapByIndex(t,e,i,n,r,s,o),this)},tileToWorldX:function(t,e,i){return null===(i=this.getLayer(i))?null:this._convert.TileToWorldX(t,e,i)},tileToWorldY:function(t,e,i){return null===(i=this.getLayer(i))?null:this._convert.TileToWorldY(t,e,i)},tileToWorldXY:function(t,e,i,n,r){return null===(r=this.getLayer(r))?null:this._convert.TileToWorldXY(t,e,i,n,r)},weightedRandomize:function(t,e,i,n,r,s){return null===(s=this.getLayer(s))?null:(p.WeightedRandomize(e,i,n,r,t,s),this)},worldToTileX:function(t,e,i,n){return null===(n=this.getLayer(n))?null:this._convert.WorldToTileX(t,e,i,n)},worldToTileY:function(t,e,i,n){return null===(n=this.getLayer(n))?null:this._convert.WorldToTileY(t,e,i,n)},worldToTileXY:function(t,e,i,n,r,s){return null===(s=this.getLayer(s))?null:this._convert.WorldToTileXY(t,e,i,n,r,s)},destroy:function(){this.removeAllLayers(),this.tilesets.length=0,this.objects.length=0,this.scene=null}});t.exports=g},function(t,e,i){var n=i(0),r=i(11),s=i(15),o=i(251),a=i(1456),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<t.length;r++){var s=t[r];if("string"==typeof s&&(s=n.getTileset(s)),s){i.push(s);for(var o=s.firstgid,a=0;a<s.total;a++)e[o+a]=s}}this.gidMap=e,this.tileset=i},setRenderOrder:function(t){return"string"==typeof t&&(t=["right-down","left-down","right-up","left-up"].indexOf(t)),t>=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){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){var n=i(1465);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){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){var n=i(265),r=i(13),s=i(99),o=i(80),a=i(162),h=i(6),l=i(264),u=i(266),c=i(268);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),w=a(e,"repeat",i.repeat),b=a(e,"repeatDelay",i.repeatDelay),A=s(e,"yoyo",i.yoyo),T=[],S=l("value",p),E=c(f[0],0,"value",S.getEnd,S.getStart,S.getActive,y,m,g,A,x,w,b,!1,!1);E.start=d,E.current=d,E.to=p,T.push(E);var M=new u(t,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 _=h(e,"callbackScope",M),C=[M,null],P=u.TYPES,R=0;R<P.length;R++){var L=P[R],O=h(e,L,!1);if(O){var D=h(e,L+"Scope",_),B=h(e,L+"Params",[]);M.setCallback(L,O,C.concat(B),D)}}return M}},function(t,e,i){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,u="center"===h,c="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,w=0,b=0,A=0,T=[];c?(x=v-1,w=y-1):d?(x=h%v,w=Math.floor(h/v)):u&&(x=(v-1)/2,w=(y-1)/2);for(var S=s.MIN_SAFE_INTEGER,E=0;E<y;E++){T[E]=[];for(var M=0;M<v;M++){b=x-M,A=w-E;var _=Math.sqrt(b*b+A*A);_>S&&(S=_),T[E][M]=_}}}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<v&&h>=0&&h<y&&(o=T[h][a]),p){var l=m-f;s=C?o/S*l*C(o/S):o/S*l}else s=C?o*f*C(o/S):o*f;return s+i}:function(t,e,n,r,s){var o,a,v;return s--,l?o=r:u?o=Math.abs(s/2-r):c?o=s-r:d&&(o=Math.abs(h-r)),p?(v=u?(m-f)/s*(2*o):(m-f)/s*o,a=C?v*C(o/s):v):a=C?s*g*C(o/s):o*f,a+i}}},function(t,e,i){var n=i(77),r=i(265),s=i(13),o=i(99),a=i(80),h=i(162),l=i(263),u=i(584),c=i(6),d=i(588),p=i(163);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=c(e,"callbackScope",i),m=[i],g=c(e,"onStart",!1);if(g){var v=c(e,"onStartScope",f),y=c(e,"onStartParams",[]);i.setCallback("onStart",g,m.concat(y),v)}var x=c(e,"onUpdate",!1);if(x){var w=c(e,"onUpdateScope",f),b=c(e,"onUpdateParams",[]);i.setCallback("onUpdate",x,m.concat(b),w)}var A=c(e,"onLoop",!1);if(A){var T=c(e,"onLoopScope",f),S=c(e,"onLoopParams",[]);i.setCallback("onLoop",A,m.concat(S),T)}var E=c(e,"onYoyo",!1);if(E){var M=c(e,"onYoyoScope",f),_=c(e,"onYoyoParams",[]);i.setCallback("onYoyo",E,m.concat(null,_),M)}var C=c(e,"onComplete",!1);if(C){var P=c(e,"onCompleteScope",f),R=c(e,"onCompleteParams",[]);i.setCallback("onComplete",C,m.concat(R),P)}var L=u(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=c(e,"easeParams",O.easeParams),O.ease=a(c(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 B=0;B<L.length;B++)i.queue(p(i,L[B],O));return i}},function(t,e,i){var n=i(0),r=i(9),s=i(267),o=i(163),a=i(100),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;n<this.totalData;n++){var r=this.data[n];r.init(),this.hasOffset(r)?this.isOffsetAbsolute(r.offset)?(r.calculatedOffset=r.offset,0===r.offset&&(i=0)):this.isOffsetRelative(r.offset)&&(r.calculatedOffset=this.getRelativeOffset(r.offset,t)):r.calculatedOffset=i,t=r.totalDuration+r.calculatedOffset,e+=r.totalDuration,i+=r.totalDuration}this.duration=e,this.loopCounter=-1===this.loop?999999999999:this.loop,this.loopCounter>0?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;e<this.totalData;e++)this.data[e].play(t)},setCallback:function(t,e,i,n){return-1!==h.TYPES.indexOf(t)&&(this.callbacks[t]={func:e,scope:n,params:i}),this},makeActive:function(t){return this.manager.makeActive(t)},play:function(){if(this.state!==a.ACTIVE){if(this.paused)return this.paused=!1,void this.manager.makeActive(this);this.resetTweens(!1),this.state=a.ACTIVE,this.dispatchTimelineEvent(s.TIMELINE_START,this.callbacks.onStart)}},nextState:function(){this.loopCounter>0?(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<this.totalData;n++)this.data[n].update(t,e)&&i--;this.dispatchTimelineEvent(s.TIMELINE_UPDATE,this.callbacks.onUpdate),0===i&&this.nextState();break;case a.LOOP_DELAY:this.countdown-=e,this.countdown<=0&&(this.state=a.ACTIVE,this.dispatchTimelineEvent(s.TIMELINE_LOOP,this.callbacks.onLoop));break;case a.COMPLETE_DELAY:this.countdown-=e,this.countdown<=0&&(this.state=a.PENDING_REMOVE,this.dispatchTimelineEvent(s.TIMELINE_COMPLETE,this.callbacks.onComplete))}return this.state===a.PENDING_REMOVE}},stop:function(){this.state=a.PENDING_REMOVE},pause:function(){if(this.state!==a.PAUSED)return this.paused=!0,this._pausedState=this.state,this.state=a.PAUSED,this.emit(s.TIMELINE_PAUSE,this),this},resume:function(){return this.state===a.PAUSED&&(this.paused=!1,this.state=this._pausedState,this.emit(s.TIMELINE_RESUME,this)),this},hasTarget:function(t){for(var e=0;e<this.data.length;e++)if(this.data[e].hasTarget(t))return!0;return!1},destroy:function(){for(var t=0;t<this.data.length;t++)this.data[t].stop()}});h.TYPES=["onStart","onUpdate","onLoop","onComplete","onYoyo"],t.exports=h},function(t,e,i){var n=i(86),r=i(41),s=i(32),o=i(2),a=i(64),h={parseBody:function(t,e,i,n){void 0===n&&(n={});for(var a=o(i,"fixtures",[]),h=[],l=0;l<a.length;l++)for(var u=this.parseFixture(a[l]),c=0;c<u.length;c++)h.push(u[c]);var d=s.clone(i,!0);s.extend(d,n,!0),delete d.fixtures,delete d.type;var p=r.create(d);return r.setParts(p,h),r.setPosition(p,{x:t,y:e}),p},parseFixture:function(t){var e,i=s.extend({},!1,t);if(delete i.circle,delete i.vertices,t.circle){var r=o(t.circle,"x"),a=o(t.circle,"y"),h=o(t.circle,"radius");e=[n.circle(r,a,h,i)]}else t.vertices&&(e=this.parseVertices(t.vertices,i));return e},parseVertices:function(t,e){void 0===e&&(e={});for(var i=[],o=0;o<t.length;o++)a.clockwiseSort(t[o]),i.push(r.create(s.extend({position:a.centre(t[o]),vertices:t[o]},e)));return n.flagCoincidentParts(i)}};t.exports=h},function(t,e,i){var n=i(86),r=i(41),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;l<a.length;l++){var u=r.create({vertices:a[l]});h.push(u)}n.flagCoincidentParts(h),s.parts=h,o=r.create(s)}return o.label=i.label,r.setPosition(o,{x:t,y:e}),o}};t.exports=s},function(t,e,i){var n={};t.exports=n;var r=i(118),s=i(128),o=i(32),a=i(41),h=i(86);n.stack=function(t,e,i,n,s,o,h){for(var l,u=r.create({label:"Stack"}),c=t,d=e,p=0,f=0;f<n;f++){for(var m=0,g=0;g<i;g++){var v=h(c,d,g,f,l,p);if(v){var y=v.bounds.max.y-v.bounds.min.y,x=v.bounds.max.x-v.bounds.min.x;y>m&&(m=y),a.translate(v,{x:.5*x,y:.5*y}),c=v.bounds.max.x+s,r.addBody(u,v),l=v,p+=1}else c+=s}d+=m+o,c=t}return u},n.chain=function(t,e,i,n,a,h){for(var l=t.bodies,u=1;u<l.length;u++){var c=l[u-1],d=l[u],p=c.bounds.max.y-c.bounds.min.y,f=c.bounds.max.x-c.bounds.min.x,m=d.bounds.max.y-d.bounds.min.y,g={bodyA:c,pointA:{x:f*e,y:p*i},bodyB:d,pointB:{x:(d.bounds.max.x-d.bounds.min.x)*n,y:m*a}},v=o.extend(g,h);r.addConstraint(t,s.create(v))}return t.label+=" Chain",t},n.mesh=function(t,e,i,n,a){var h,l,u,c,d,p=t.bodies;for(h=0;h<i;h++){for(l=1;l<e;l++)u=p[l-1+h*e],c=p[l+h*e],r.addConstraint(t,s.create(o.extend({bodyA:u,bodyB:c},a)));if(h>0)for(l=0;l<e;l++)u=p[l+(h-1)*e],c=p[l+h*e],r.addConstraint(t,s.create(o.extend({bodyA:u,bodyB:c},a))),n&&l>0&&(d=p[l-1+(h-1)*e],r.addConstraint(t,s.create(o.extend({bodyA:d,bodyB:c},a)))),n&&l<e-1&&(d=p[l+1+(h-1)*e],r.addConstraint(t,s.create(o.extend({bodyA:d,bodyB:c},a))))}return t.label+=" Mesh",t},n.pyramid=function(t,e,i,r,s,o,h){return n.stack(t,e,i,r,s,o,(function(e,n,o,l,u,c){var d=Math.min(r,Math.ceil(i/2)),p=u?u.bounds.max.x-u.bounds.min.x:0;if(!(l>d||o<(l=d-l)||o>i-1-l))return 1===c&&a.translate(u,{x:(o+(i%2==1?1:-1))*p,y:0}),h(t+(u?o*p:0)+o*s,n,o,l,u,c)}))},n.newtonsCradle=function(t,e,i,n,o){for(var a=r.create({label:"Newtons Cradle"}),l=0;l<i;l++){var u=h.circle(t+l*(1.9*n),e+o,n,{inertia:1/0,restitution:1,friction:0,frictionAir:1e-4,slop:1}),c=s.create({pointA:{x:t+l*(1.9*n),y:e},bodyB:u});r.addBody(a,u),r.addConstraint(a,c)}return a},n.car=function(t,e,i,n,o){var l=a.nextGroup(!0),u=.5*-i+20,c=.5*i-20,d=r.create({label:"Car"}),p=h.rectangle(t,e,i,n,{collisionFilter:{group:l},chamfer:{radius:.5*n},density:2e-4}),f=h.circle(t+u,e+0,o,{collisionFilter:{group:l},friction:.8}),m=h.circle(t+c,e+0,o,{collisionFilter:{group:l},friction:.8}),g=s.create({bodyB:p,pointB:{x:u,y:0},bodyA:f,stiffness:1,length:0}),v=s.create({bodyB:p,pointB:{x:c,y:0},bodyA:m,stiffness:1,length:0});return r.addBody(d,p),r.addBody(d,f),r.addBody(d,m),r.addConstraint(d,g),r.addConstraint(d,v),d},n.softBody=function(t,e,i,r,s,a,l,u,c,d){c=o.extend({inertia:1/0},c),d=o.extend({stiffness:.2,render:{type:"line",anchors:!1}},d);var p=n.stack(t,e,i,r,s,a,(function(t,e){return h.circle(t,e,u,c)}));return n.mesh(p,i,r,l,d),p.label="Soft Body",p}},function(t,e,i){var n={};t.exports=n,i(84);var r=i(32);n.pathToVertices=function(t,e){"undefined"==typeof window||"SVGPathSeg"in window||r.warn("Svg.pathToVertices: SVGPathSeg not defined, a polyfill is required.");var i,s,o,a,h,l,u,c,d,p,f,m=[],g=0,v=0,y=0;e=e||15;var x=function(t,e,i){var n=i%2==1&&i>1;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}},w=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<t.pathSegList.numberOfItems;i+=1)l.push(t.pathSegList.getItem(i));for(u=l.concat();g<o;){if((h=l[t.getPathSegAtLength(g)])!=c){for(;u.length&&u[0]!=h;)w(u.shift());c=h}switch(h.pathSegTypeAsLetter.toUpperCase()){case"C":case"T":case"S":case"Q":case"A":a=t.getPointAtLength(g),x(a.x,a.y,0)}g+=e}for(i=0,s=u.length;i<s;++i)w(u[i]);return m},n._svgPathToAbsolute=function(t){for(var e,i,n,r,s,o,a=t.pathSegList,h=0,l=0,u=a.numberOfItems,c=0;c<u;++c){var d=a.getItem(c),p=d.pathSegTypeAsLetter;if(/[MLHVCSQTA]/.test(p))"x"in d&&(h=d.x),"y"in d&&(l=d.y);else switch("x1"in d&&(n=h+d.x1),"x2"in d&&(s=h+d.x2),"y1"in d&&(r=l+d.y1),"y2"in d&&(o=l+d.y2),"x"in d&&(h+=d.x),"y"in d&&(l+=d.y),p){case"m":a.replaceItem(t.createSVGPathSegMovetoAbs(h,l),c);break;case"l":a.replaceItem(t.createSVGPathSegLinetoAbs(h,l),c);break;case"h":a.replaceItem(t.createSVGPathSegLinetoHorizontalAbs(h),c);break;case"v":a.replaceItem(t.createSVGPathSegLinetoVerticalAbs(l),c);break;case"c":a.replaceItem(t.createSVGPathSegCurvetoCubicAbs(h,l,n,r,s,o),c);break;case"s":a.replaceItem(t.createSVGPathSegCurvetoCubicSmoothAbs(h,l,s,o),c);break;case"q":a.replaceItem(t.createSVGPathSegCurvetoQuadraticAbs(h,l,n,r),c);break;case"t":a.replaceItem(t.createSVGPathSegCurvetoQuadraticSmoothAbs(h,l),c);break;case"a":a.replaceItem(t.createSVGPathSegArcAbs(h,l,d.r1,d.r2,d.angle,d.largeArcFlag,d.sweepFlag),c);break;case"z":case"Z":h=e,l=i}"M"!=p&&"m"!=p||(e=h,i=l)}}},function(t,e,i){var n=i(86),r=i(41),s=i(0),o=i(249),a=i(9),h=i(2),l=i(126),u=i(64),c=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(),c=h(a,"objects",[]),d=[],p=0;p<c.length;p++){var f=c[p],m=s+f.x*e,g=o+f.y*i,v=f.width*e,y=f.height*i,x=null;if(f.rectangle)x=n.rectangle(m+v/2,g+y/2,v,y,t);else if(f.ellipse)x=n.circle(m+v/2,g+y/2,v/2,t);else if(f.polygon||f.polyline){var w=(f.polygon?f.polygon:f.polyline).map((function(t){return{x:t.x*e,y:t.y*i}})),b=u.create(w),A=u.centre(b);m+=A.x,g+=A.y,x=n.fromVertices(m,g,b,t)}x&&d.push(x)}return 1===d.length?this.setBody(d[0],t.addToWorld):d.length>1&&(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=c},function(t,e,i){var n=i(1399);n.Body=i(41),n.Composite=i(118),n.World=i(596),n.Detector=i(273),n.Grid=i(597),n.Pairs=i(598),n.Pair=i(250),n.Query=i(1400),n.Resolver=i(599),n.SAT=i(274),n.Constraint=i(128),n.Common=i(32),n.Engine=i(1401),n.Events=i(166),n.Sleeping=i(165),n.Plugin=i(595),n.Bodies=i(86),n.Composites=i(591),n.Axes=i(271),n.Bounds=i(84),n.Svg=i(592),n.Vector=i(83),n.Vertices=i(64),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(32);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<s?r.warn("Plugin.register:",n.toString(e),"can not be downgraded to",n.toString(t)):t!==e&&r.warn("Plugin.register:",n.toString(t),"is already registered to different plugin object")}else n._registry[t.name]=t;return t},n.resolve=function(t){return n._registry[n.dependencyParse(t).name]},n.toString=function(t){return"string"==typeof t?t:(t.name||"anonymous")+"@"+(t.version||t.range||"0.0.0")},n.isPlugin=function(t){return t&&t.name&&t.version&&t.install},n.isUsed=function(t,e){return t.used.indexOf(e)>-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;a<s.length;a+=1)if(s[a]!==t.name){var h=n.resolve(s[a]);h?n.isUsed(t,h.name)||(n.isFor(h,t)||(r.warn("Plugin.use:",n.toString(h),"is for",h.for,"but installed on",n.toString(t)+"."),h._warned=!0),h.install?h.install(t):(r.warn("Plugin.use:",n.toString(h),"does not specify an install function."),h._warned=!0),h._warned?(o.push("🔶 "+n.toString(h)),delete h._warned):o.push("✅ "+n.toString(h)),t.used.push(h.name)):o.push("❌ "+s[a])}o.length>0&&!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<e[s].length;o+=1)n.dependencies(e[s][o],e);return e}},n.dependencyParse=function(t){return r.isString(t)?(/^[\w-]+(@(\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?))?$/.test(t)||r.warn("Plugin.dependencyParse:",t,"is not a valid dependency string."),{name:t.split("@")[0],range:t.split("@")[1]||"*"}):{name:t.name,range:t.range||t.version}},n.versionParse=function(t){/^\*|[\^~]?\d+\.\d+\.\d+(-[0-9A-Za-z-]+)?$/.test(t)||r.warn("Plugin.versionParse:",t,"is not a valid version or range.");var e=t.split("-");t=e[0];var i=isNaN(Number(t[0])),n=i?t.substr(1):t,s=r.map(n.split("."),(function(t){return Number(t)}));return{isRange:i,version:n,range:t,operator:i?t[0]:"",parts:s,prerelease:e[1],number:1e8*s[0]+1e4*s[1]+s[2]}},n.versionSatisfies=function(t,e){e=e||"*";var i=n.versionParse(e),r=i.parts,s=n.versionParse(t),o=s.parts;if(i.isRange){if("*"===i.operator||"*"===t)return!0;if("~"===i.operator)return o[0]===r[0]&&o[1]===r[1]&&o[2]>=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(118),s=(i(128),i(32));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(250),s=i(273),o=i(32);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,u=i.world,c=t.buckets,d=!1,p=i.metrics;for(p.broadphaseTests=0,s=0;s<e.length;s++){var f=e[s];if((!f.isSleeping||r)&&!(f.bounds.max.x<u.bounds.min.x||f.bounds.min.x>u.bounds.max.x||f.bounds.max.y<u.bounds.min.y||f.bounds.min.y>u.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=c[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(c,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;n<e.length;n++){var s=e[n];if(!(i.id===s.id||i.isStatic&&s.isStatic)){var o=r.id(i,s),a=t.pairs[o];a?a[2]+=1:t.pairs[o]=[i,s,1]}}e.push(i)},n._bucketRemoveBody=function(t,e,i){e.splice(e.indexOf(i),1);for(var n=0;n<e.length;n++){var s=e[n],o=r.id(i,s),a=t.pairs[o];a&&(a[2]-=1)}},n._createActivePairsList=function(t){var e,i,n=[];e=o.keys(t.pairs);for(var r=0;r<e.length;r++)(i=t.pairs[e[r]])[2]>0?n.push(i):delete t.pairs[e[r]];return n}},function(t,e,i){var n={};t.exports=n;var r=i(250),s=i(32);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,u=t.collisionStart,c=t.collisionEnd,d=t.collisionActive;for(u.length=0,c.length=0,d.length=0,a=0;a<h.length;a++)h[a].confirmedActive=!1;for(a=0;a<e.length;a++)(n=e[a]).collided&&((o=l[s=r.id(n.bodyA,n.bodyB)])?(o.isActive?d.push(o):u.push(o),r.update(o,n,i),o.confirmedActive=!0):(o=r.create(n,i),l[s]=o,u.push(o),h.push(o)));for(a=0;a<h.length;a++)(o=h[a]).isActive&&!o.confirmedActive&&(r.setActive(o,!1,i),c.push(o))},n.removeOld=function(t,e){var i,r,s,o,a=t.list,h=t.table,l=[];for(o=0;o<a.length;o++)(r=(i=a[o]).collision).bodyA.isSleeping||r.bodyB.isSleeping?i.timeUpdated=e:e-i.timeUpdated>n._pairMaxIdleLife&&l.push(o);for(o=0;o<l.length;o++)delete h[(i=a[s=l[o]-o]).id],a.splice(s,1)},n.clear=function(t){return t.table={},t.list.length=0,t.collisionStart.length=0,t.collisionActive.length=0,t.collisionEnd.length=0,t}},function(t,e,i){var n={};t.exports=n;var r=i(64),s=i(83),o=i(32),a=i(84);n._restingThresh=4,n._restingThreshTangent=6,n._positionDampen=.9,n._positionWarming=.8,n._frictionNormalMultiplier=5,n.preSolvePosition=function(t){var e,i,n;for(e=0;e<t.length;e++)(i=t[e]).isActive&&(n=i.activeContacts.length,i.collision.parentA.totalContacts+=n,i.collision.parentB.totalContacts+=n)},n.solvePosition=function(t,e,i){var r,s,o,a,h,l,u,c,d,p,f,m,g,v,y,x,w=i*n._positionDampen;for(r=0;r<e.length;r++){var b=e[r];b.previousPositionImpulse.x=b.positionImpulse.x,b.previousPositionImpulse.y=b.positionImpulse.y}for(r=0;r<t.length;r++)(a=t[r]).isActive&&!a.isSensor&&(l=(h=a.collision).parentA,u=h.parentB,c=h.normal,f=l.previousPositionImpulse,m=u.previousPositionImpulse,p=h.penetration,v=m.x-f.x+p.x,y=m.y-f.y+p.y,d=(s=c.x)*v+(o=c.y)*y,a.separation=d,x=(d-a.slop)*w,(l.isStatic||u.isStatic)&&(x*=2),l.isStatic||l.isSleeping||(g=x/l.totalContacts,l.positionImpulse.x+=s*g,l.positionImpulse.y+=o*g),u.isStatic||u.isSleeping||(g=x/u.totalContacts,u.positionImpulse.x-=s*g,u.positionImpulse.y-=o*g))},n.postSolvePosition=function(t){for(var e=0;e<t.length;e++){var i=t[e];if(i.totalContacts=0,0!==i.positionImpulse.x||0!==i.positionImpulse.y){for(var o=0;o<i.parts.length;o++){var h=i.parts[o];r.translate(h.vertices,i.positionImpulse),a.update(h.bounds,h.vertices,i.velocity),h.position.x+=i.positionImpulse.x,h.position.y+=i.positionImpulse.y}i.positionPrev.x+=i.positionImpulse.x,i.positionPrev.y+=i.positionImpulse.y,s.dot(i.positionImpulse,i.velocity)<0?(i.positionImpulse.x=0,i.positionImpulse.y=0):(i.positionImpulse.x*=n._positionWarming,i.positionImpulse.y*=n._positionWarming)}}},n.preSolveVelocity=function(t){var e,i,n,r,o,a,h,l,u,c,d,p,f,m,g=s._temp[0],v=s._temp[1];for(e=0;e<t.length;e++)if((n=t[e]).isActive&&!n.isSensor)for(r=n.activeContacts,a=(o=n.collision).parentA,h=o.parentB,l=o.normal,u=o.tangent,i=0;i<r.length;i++)d=(c=r[i]).vertex,p=c.normalImpulse,f=c.tangentImpulse,0===p&&0===f||(g.x=l.x*p+u.x*f,g.y=l.y*p+u.y*f,a.isStatic||a.isSleeping||(m=s.sub(d,a.position,v),a.positionPrev.x+=g.x*a.inverseMass,a.positionPrev.y+=g.y*a.inverseMass,a.anglePrev+=s.cross(m,g)*a.inverseInertia),h.isStatic||h.isSleeping||(m=s.sub(d,h.position,v),h.positionPrev.x-=g.x*h.inverseMass,h.positionPrev.y-=g.y*h.inverseMass,h.anglePrev-=s.cross(m,g)*h.inverseInertia))},n.solveVelocity=function(t,e){for(var i=e*e,r=s._temp[0],a=s._temp[1],h=s._temp[2],l=s._temp[3],u=s._temp[4],c=s._temp[5],d=0;d<t.length;d++){var p=t[d];if(p.isActive&&!p.isSensor){var f=p.collision,m=f.parentA,g=f.parentB,v=f.normal,y=f.tangent,x=p.activeContacts,w=1/x.length;m.velocity.x=m.position.x-m.positionPrev.x,m.velocity.y=m.position.y-m.positionPrev.y,g.velocity.x=g.position.x-g.positionPrev.x,g.velocity.y=g.position.y-g.positionPrev.y,m.angularVelocity=m.angle-m.anglePrev,g.angularVelocity=g.angle-g.anglePrev;for(var b=0;b<x.length;b++){var A=x[b],T=A.vertex,S=s.sub(T,m.position,a),E=s.sub(T,g.position,h),M=s.add(m.velocity,s.mult(s.perp(S),m.angularVelocity),l),_=s.add(g.velocity,s.mult(s.perp(E),g.angularVelocity),u),C=s.sub(M,_,c),P=s.dot(v,C),R=s.dot(y,C),L=Math.abs(R),O=o.sign(R),D=(1+p.restitution)*P,B=o.clamp(p.separation+P,0,1)*n._frictionNormalMultiplier,I=R,F=1/0;L>p.friction*p.frictionStatic*B*i&&(F=L,I=o.clamp(p.friction*O*i,-F,F));var k=s.cross(S,v),N=s.cross(E,v),z=w/(m.inverseMass+g.inverseMass+m.inverseInertia*k*k+g.inverseInertia*N*N);if(D*=z,I*=z,P<0&&P*P>n._restingThresh*i)A.normalImpulse=0;else{var U=A.normalImpulse;A.normalImpulse=Math.min(A.normalImpulse+D,0),D=A.normalImpulse-U}if(R*R>n._restingThreshTangent*i)A.tangentImpulse=0;else{var V=A.tangentImpulse;A.tangentImpulse=o.clamp(A.tangentImpulse+I,-F,F),I=A.tangentImpulse-V}r.x=v.x*D+y.x*I,r.y=v.y*D+y.y*I,m.isStatic||m.isSleeping||(m.positionPrev.x+=r.x*m.inverseMass,m.positionPrev.y+=r.y*m.inverseMass,m.anglePrev+=s.cross(S,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(E,r)*g.inverseInertia)}}}}},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){var n=i(276);t.exports=function(t,e,i,r){for(var s=t[0],o=1;o<t.length;o++){var a=t[o];n(a,s,e,i,r),s=a}return t}},function(t,e,i){var n=i(46);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<t.length;n++){var r=t[n];e.call(i,r)}return t}},function(t,e){t.exports=function(t,e,i){void 0===i&&(i=0);for(var n=i;n<t.length;n++){var r=t[n],s=!0;for(var o in e)r[o]!==e[o]&&(s=!1);if(s)return r}return null}},function(t,e){t.exports=function(t,e,i){void 0===i&&(i=0);for(var n=i;n<t.length;n++){var r=t[n],s=!0;for(var o in e)r[o]!==e[o]&&(s=!1);if(s)return r}return null}},function(t,e,i){var n=i(289),r=i(123),s=i(2),o=i(1),a=new(i(129))({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),u=s(e,"cellWidth",1),c=s(e,"cellHeight",u),d=s(e,"position",r.TOP_LEFT),p=s(e,"x",0),f=s(e,"y",0),m=0,g=0,v=h*u,y=l*c;a.setPosition(p,f),a.setSize(u,c);for(var x=0;x<t.length;x++)if(n(t[x],a,d),i&&-1===h)a.x+=u;else if(o&&-1===l)a.y+=c;else if(o&&!i){if(g+=c,a.y+=c,g===y&&(g=0,m+=u,a.y=f,a.x+=u,m===v))break}else if(m+=u,a.x+=u,m===v&&(m=0,g+=c,a.x=p,a.y+=c,g===y))break;return t}},function(t,e,i){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){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){var n=i(10),r=i(308),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 u=this.parentContainer.getBoundsTransformMatrix();this.getTopLeft(t),u.transformPoint(t.x,t.y,t),e=t.x,i=t.y,this.getTopRight(t),u.transformPoint(t.x,t.y,t),r=t.x,s=t.y,this.getBottomLeft(t),u.transformPoint(t.x,t.y,t),o=t.x,a=t.y,this.getBottomRight(t),u.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){t.exports="blur"},function(t,e){t.exports="boot"},function(t,e){t.exports="contextlost"},function(t,e){t.exports="contextrestored"},function(t,e){t.exports="destroy"},function(t,e){t.exports="focus"},function(t,e){t.exports="hidden"},function(t,e){t.exports="pause"},function(t,e){t.exports="postrender"},function(t,e){t.exports="poststep"},function(t,e){t.exports="prerender"},function(t,e){t.exports="prestep"},function(t,e){t.exports="ready"},function(t,e){t.exports="resume"},function(t,e){t.exports="step"},function(t,e){t.exports="visible"},function(t,e){t.exports="postrender"},function(t,e){t.exports="prerender"},function(t,e){t.exports="render"},function(t,e){t.exports="resize"},function(t,e){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){var n=i(36),r=i(99),s=i(6),o=i(100),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 u=this.path.getPoint(.1);this.rotation=Math.atan2(u.y-this.y,u.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){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){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){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){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){t.exports="changedata"},function(t,e){t.exports="changedata-"},function(t,e){t.exports="destroy"},function(t,e){t.exports="removedata"},function(t,e){t.exports="setdata"},function(t,e){t.exports="addedtoscene"},function(t,e){t.exports="destroy"},function(t,e){t.exports="removedfromscene"},function(t,e){t.exports="complete"},function(t,e){t.exports="created"},function(t,e){t.exports="error"},function(t,e){t.exports="loop"},function(t,e){t.exports="play"},function(t,e){t.exports="seeked"},function(t,e){t.exports="seeking"},function(t,e){t.exports="stop"},function(t,e){t.exports="timeout"},function(t,e){t.exports="unlocked"},function(t,e){t.exports="addedtoscene"},function(t,e){t.exports="boot"},function(t,e){t.exports="create"},function(t,e){t.exports="destroy"},function(t,e){t.exports="pause"},function(t,e){t.exports="postupdate"},function(t,e){t.exports="prerender"},function(t,e){t.exports="preupdate"},function(t,e){t.exports="ready"},function(t,e){t.exports="removedfromscene"},function(t,e){t.exports="render"},function(t,e){t.exports="resume"},function(t,e){t.exports="shutdown"},function(t,e){t.exports="sleep"},function(t,e){t.exports="start"},function(t,e){t.exports="transitioncomplete"},function(t,e){t.exports="transitioninit"},function(t,e){t.exports="transitionout"},function(t,e){t.exports="transitionstart"},function(t,e){t.exports="transitionwake"},function(t,e){t.exports="update"},function(t,e){t.exports="wake"},function(t,e,i){var n=i(46);t.exports=function(t,e,i,r,s){return n(t,"alpha",e,i,r,s)}},function(t,e,i){var n=i(46);t.exports=function(t,e,i,r,s){return n(t,"x",e,i,r,s)}},function(t,e,i){var n=i(46);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){var n=i(46);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<t.length;o++)t[o].x=e.x+e.radius*Math.cos(r),t[o].y=e.y+e.radius*Math.sin(r),r+=s;return t}},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=e.width/2,a=e.height/2,h=0;h<t.length;h++)t[h].x=e.x+o*Math.cos(r),t[h].y=e.y+a*Math.sin(r),r+=s;return t}},function(t,e,i){var n=i(172);t.exports=function(t,e){for(var i=n(e,t.length),r=0;r<t.length;r++){var s=t[r],o=i[r];s.x=o.x,s.y=o.y}return t}},function(t,e,i){var n=i(316),r=i(178),s=i(179);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<t.length;a++)t[a].x=o[a].x,t[a].y=o[a].y;return t}},function(t,e,i){var n=i(317);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<t.length;l++){var u=t[l],c=r[Math.floor(h)];u.x=c.x,u.y=c.y,h+=a}return t}},function(t,e){t.exports=function(t,e,i){for(var n=0;n<t.length;n++){var r=t[n];r.anims&&r.anims.play(e,i)}return t}},function(t,e,i){var n=i(170);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e,i){var n=i(180);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e,i){var n=i(173);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e,i){var n=i(174);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e,i){var n=i(181);t.exports=function(t,e){for(var i=0;i<t.length;i++)n(e,t[i]);return t}},function(t,e,i){var n=i(46);t.exports=function(t,e,i,r,s){return n(t,"rotation",e,i,r,s)}},function(t,e,i){var n=i(182),r=i(50);t.exports=function(t,e,i){for(var s=e.x,o=e.y,a=0;a<t.length;a++){var h=t[a];n(h,s,o,i,Math.max(1,r(h.x,h.y,s,o)))}return t}},function(t,e,i){var n=i(182);t.exports=function(t,e,i,r){var s=e.x,o=e.y;if(0===r)return t;for(var a=0;a<t.length;a++)n(t[a],s,o,i,r);return t}},function(t,e,i){var n=i(46);t.exports=function(t,e,i,r,s){return n(t,"scaleX",e,i,r,s)}},function(t,e,i){var n=i(46);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){var n=i(46);t.exports=function(t,e,i,r,s){return n(t,"scaleY",e,i,r,s)}},function(t,e,i){var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"alpha",e,i,r,s)}},function(t,e,i){var n=i(27);t.exports=function(t,e,i,r){return n(t,"blendMode",e,0,i,r)}},function(t,e,i){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<t.length;n++)t[n].setInteractive(e,i);return t}},function(t,e,i){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){var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"rotation",e,i,r,s)}},function(t,e,i){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){var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"scaleX",e,i,r,s)}},function(t,e,i){var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"scaleY",e,i,r,s)}},function(t,e,i){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){var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"scrollFactorX",e,i,r,s)}},function(t,e,i){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<t.length;s++)t[s].setTint(e,i,n,r);return t}},function(t,e,i){var n=i(27);t.exports=function(t,e,i,r){return n(t,"visible",e,0,i,r)}},function(t,e,i){var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"x",e,i,r,s)}},function(t,e,i){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){var n=i(27);t.exports=function(t,e,i,r,s){return n(t,"y",e,i,r,s)}},function(t,e,i){var n=i(3);t.exports=function(t,e,i,r,s){var o,a,h,l,u,c;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=(c=t[h]).x,u=c.y,c.x=o,c.y=a,o=l,a=u;t[d].x=e,t[d].y=i}else{for(o=t[0].x,a=t[0].y,h=1;h<t.length;h++)l=(c=t[h]).x,u=c.y,c.x=o,c.y=a,o=l,a=u;t[0].x=e,t[0].y=i}else o=t[0].x,a=t[0].y,t[0].x=e,t[0].y=i;return s.x=o,s.y=a,s}},function(t,e,i){var n=i(131);t.exports=function(t){return n(t)}},function(t,e,i){var n=i(183);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<t.length;o++)t[o][e]+=n(o*a,i,r);else for(o=0;o<t.length;o++)t[o][e]=n(o*a,i,r);return t}},function(t,e,i){var n=i(184);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<t.length;o++)t[o][e]+=n(o*a,i,r);else for(o=0;o<t.length;o++)t[o][e]=n(o*a,i,r);return t}},function(t,e){t.exports=function(t,e,i,n,r){void 0===r&&(r=!1);var s,o=Math.abs(n-i)/t.length;if(r)for(s=0;s<t.length;s++)t[s][e]+=s*o+i;else for(s=0;s<t.length;s++)t[s][e]=s*o+i;return t}},function(t,e){t.exports=function(t){for(var e=0;e<t.length;e++)t[e].visible=!t[e].visible;return t}},function(t,e,i){var n=i(68);t.exports=function(t,e,i){void 0===i&&(i=0);for(var r=0;r<t.length;r++){var s=t[r];s.x=n(s.x,e.left-i,e.right+i),s.y=n(s.y,e.top-i,e.bottom+i)}return t}},function(t,e,i){t.exports={Animation:i(185),AnimationFrame:i(319),AnimationManager:i(321),AnimationState:i(164),Events:i(132)}},function(t,e){t.exports="add"},function(t,e){t.exports="animationcomplete"},function(t,e){t.exports="animationcomplete-"},function(t,e){t.exports="animationrepeat"},function(t,e){t.exports="animationrestart"},function(t,e){t.exports="animationstart"},function(t,e){t.exports="animationstop"},function(t,e){t.exports="animationupdate"},function(t,e){t.exports="pauseall"},function(t,e){t.exports="remove"},function(t,e){t.exports="resumeall"},function(t,e,i){t.exports={BaseCache:i(323),CacheManager:i(325),Events:i(324)}},function(t,e){t.exports="add"},function(t,e){t.exports="remove"},function(t,e,i){t.exports={Controls:i(739),Scene2D:i(742)}},function(t,e,i){t.exports={FixedKeyControl:i(740),SmoothedKeyControl:i(741)}},function(t,e,i){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.minZoom=r(t,"minZoom",.001),this.maxZoom=r(t,"maxZoom",1e3),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<this.minZoom&&(e.zoom=this.minZoom)):this.zoomOut&&this.zoomOut.isDown&&(e.zoom+=this.zoomSpeed,e.zoom>this.maxZoom&&(e.zoom=this.maxZoom))}},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){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.minZoom=r(t,"minZoom",.001),this.maxZoom=r(t,"maxZoom",1e3),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<this.minZoom?e.zoom=this.minZoom:e.zoom>this.maxZoom&&(e.zoom=this.maxZoom))}},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){t.exports={Camera:i(326),BaseCamera:i(133),CameraManager:i(799),Effects:i(333),Events:i(37)}},function(t,e){t.exports="cameradestroy"},function(t,e){t.exports="camerafadeincomplete"},function(t,e){t.exports="camerafadeinstart"},function(t,e){t.exports="camerafadeoutcomplete"},function(t,e){t.exports="camerafadeoutstart"},function(t,e){t.exports="cameraflashcomplete"},function(t,e){t.exports="cameraflashstart"},function(t,e){t.exports="followupdate"},function(t,e){t.exports="camerapancomplete"},function(t,e){t.exports="camerapanstart"},function(t,e){t.exports="postrender"},function(t,e){t.exports="prerender"},function(t,e){t.exports="camerarotatecomplete"},function(t,e){t.exports="camerarotatestart"},function(t,e){t.exports="camerashakecomplete"},function(t,e){t.exports="camerashakestart"},function(t,e){t.exports="camerazoomcomplete"},function(t,e){t.exports="camerazoomstart"},function(t,e,i){var n=i(18),r=i(0),s=i(37),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<this.duration?this.alpha=this.direction?this.progress:1-this.progress:(this.alpha=this.direction?1:0,this.effectComplete()))},postRenderCanvas:function(t){if(!this.isRunning&&!this.isComplete)return!1;var e=this.camera;return t.fillStyle="rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")",t.fillRect(e.x,e.y,e.width,e.height),!0},postRenderWebGL:function(t,e){if(!this.isRunning&&!this.isComplete)return!1;var i=this.camera,n=this.red/255,r=this.green/255,s=this.blue/255;return t.drawFillRect(i.x,i.y,i.width,i.height,e(s,r,n,1),this.alpha),!0},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.isComplete=!0;var t=this.direction?s.FADE_OUT_COMPLETE:s.FADE_IN_COMPLETE;this.camera.emit(t,this.camera,this)},reset:function(){this.isRunning=!1,this.isComplete=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=o},function(t,e,i){var n=i(18),r=i(0),s=i(37),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<this.duration?this.alpha=1-this.progress:this.effectComplete())},postRenderCanvas:function(t){if(!this.isRunning)return!1;var e=this.camera;return t.fillStyle="rgba("+this.red+","+this.green+","+this.blue+","+this.alpha+")",t.fillRect(e.x,e.y,e.width,e.height),!0},postRenderWebGL:function(t,e){if(!this.isRunning)return!1;var i=this.camera,n=this.red/255,r=this.green/255,s=this.blue/255;return t.drawFillRect(i.x,i.y,i.width,i.height,e(s,r,n,1),this.alpha),!0},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(s.FLASH_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=o},function(t,e,i){var n=i(18),r=i(0),s=i(134),o=i(37),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<this.duration){var s=this.ease(i);r.getScroll(this.destination.x,this.destination.y,this.current);var o=this.source.x+(this.current.x-this.source.x)*s,a=this.source.y+(this.current.y-this.source.y)*s;r.setScroll(o,a),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,r,i,o,a)}else r.centerOn(this.destination.x,this.destination.y),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,r,i,r.scrollX,r.scrollY),this.effectComplete()}},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(o.PAN_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=h},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),t*t*((e+1)*t-e)}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1.70158),--t*t*((e+1)*t+e)+1}},function(t,e){t.exports=function(t,e){void 0===e&&(e=1.70158);var i=1.525*e;return(t*=2)<1?t*t*((i+1)*t-i)*.5:.5*((t-=2)*t*((i+1)*t+i)+2)}},function(t,e){t.exports=function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}},function(t,e){t.exports=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}},function(t,e){t.exports=function(t){var e=!1;return t<.5?(t=1-2*t,e=!0):t=2*t-1,t<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5}},function(t,e){t.exports=function(t){return 1-Math.sqrt(1-t*t)}},function(t,e){t.exports=function(t){return Math.sqrt(1- --t*t)}},function(t,e){t.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},function(t,e){t.exports=function(t){return t*t*t}},function(t,e){t.exports=function(t){return--t*t*t+1}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),-e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),e*Math.pow(2,-10*t)*Math.sin((t-n)*(2*Math.PI)/i)+1}},function(t,e){t.exports=function(t,e,i){if(void 0===e&&(e=.1),void 0===i&&(i=.1),0===t)return 0;if(1===t)return 1;var n=i/4;return e<1?e=1:n=i*Math.asin(1/e)/(2*Math.PI),(t*=2)<1?e*Math.pow(2,10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*-.5:e*Math.pow(2,-10*(t-=1))*Math.sin((t-n)*(2*Math.PI)/i)*.5+1}},function(t,e){t.exports=function(t){return Math.pow(2,10*(t-1))-.001}},function(t,e){t.exports=function(t){return 1-Math.pow(2,-10*t)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))}},function(t,e){t.exports=function(t){return t}},function(t,e){t.exports=function(t){return t*t}},function(t,e){t.exports=function(t){return t*(2-t)}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},function(t,e){t.exports=function(t){return t*t*t*t}},function(t,e){t.exports=function(t){return 1- --t*t*t*t}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},function(t,e){t.exports=function(t){return t*t*t*t*t}},function(t,e){t.exports=function(t){return--t*t*t*t*t+1}},function(t,e){t.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:1-Math.cos(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:Math.sin(t*Math.PI/2)}},function(t,e){t.exports=function(t){return 0===t?0:1===t?1:.5*(1-Math.cos(Math.PI*t))}},function(t,e){t.exports=function(t,e){return void 0===e&&(e=1),t<=0?0:t>=1?1:1/e*(1+(e*t|0))}},function(t,e,i){var n=i(18),r=i(0),s=i(37),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<this.duration){var i=this.intensity,r=this.camera.width,s=this.camera.height,o=this.camera.zoom;this._offsetX=(Math.random()*i.x*r*2-i.x*r)*o,this._offsetY=(Math.random()*i.y*s*2-i.y*s)*o,this.camera.roundPixels&&(this._offsetX=Math.round(this._offsetX),this._offsetY=Math.round(this._offsetY))}else this.effectComplete()},effectComplete:function(){this._offsetX=0,this._offsetY=0,this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(s.SHAKE_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._offsetX=0,this._offsetY=0,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null,this.intensity=null}});t.exports=a},function(t,e,i){var n=i(18),r=i(0),s=i(37),o=i(134),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 u=360*Math.PI/180;l-=Math.floor(l/u)*u;var c=this.camera;if(!r&&this.isRunning)return c;if(this.isRunning=!0,this.duration=i,this.progress=0,this.source=c.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+u)-this.source)<(p=this.source>this.destination?Math.abs(this.source-this.destination):Math.abs(this.source+u)-this.destination)?this.clockwise=!0:d>p&&(this.clockwise=!1)}return this.camera.emit(s.ROTATE_START,this.camera,this,i,l),c},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<this.duration){var s=this.ease(i);this.current=r.rotation;var o=0,a=360*Math.PI/180,h=this.destination,l=this.current;!1===this.clockwise&&(h=this.current,l=this.destination),o=h>=l?Math.abs(h-l):Math.abs(h+a)-l;var u=0;u=this.clockwise?r.rotation+o*s:r.rotation-o*s,r.rotation=u,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,r,i,u)}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){var n=i(18),r=i(0),s=i(134),o=i(37),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<this.duration?(this.camera.zoom=this.source+(this.destination-this.source)*this.ease(this.progress),this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress,this.camera.zoom)):(this.camera.zoom=this.destination,this._onUpdate&&this._onUpdate.call(this._onUpdateScope,this.camera,this.progress,this.destination),this.effectComplete()))},effectComplete:function(){this._onUpdate=null,this._onUpdateScope=null,this.isRunning=!1,this.camera.emit(o.ZOOM_COMPLETE,this.camera,this)},reset:function(){this.isRunning=!1,this._onUpdate=null,this._onUpdateScope=null},destroy:function(){this.reset(),this.camera=null}});t.exports=a},function(t,e,i){var n=i(326),r=i(0),s=i(2),o=i(24),a=i(57),h=i(104),l=i(20),u=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;r<t.length;r++){var s=t[r];s&&s.id===e&&(n=!0)}if(!n)return e;e<<=1}return 0},getTotal:function(t){void 0===t&&(t=!1);for(var e=0,i=this.cameras,n=0;n<i.length;n++){var r=i[n];(!t||t&&r.visible)&&e++}return e},fromJSON:function(t){Array.isArray(t)||(t=[t]);for(var e=this.scene.sys.scale.width,i=this.scene.sys.scale.height,n=0;n<t.length;n++){var r=t[n],o=s(r,"x",0),a=s(r,"y",0),h=s(r,"width",e),l=s(r,"height",i),u=this.add(o,a,h,l);u.name=s(r,"name",""),u.zoom=s(r,"zoom",1),u.rotation=s(r,"rotation",0),u.scrollX=s(r,"scrollX",0),u.scrollY=s(r,"scrollY",0),u.roundPixels=s(r,"roundPixels",!1),u.visible=s(r,"visible",!0);var c=s(r,"backgroundColor",!1);c&&u.setBackgroundColor(c);var d=s(r,"bounds",null);if(d){var p=s(d,"x",0),f=s(d,"y",0),m=s(d,"width",e),g=s(d,"height",i);u.setBounds(p,f,m,g)}}return this},getCamera:function(t){for(var e=this.cameras,i=0;i<e.length;i++)if(e[i].name===t)return e[i];return null},getCamerasBelowPointer:function(t){for(var e=this.cameras,i=t.x,n=t.y,r=[],s=0;s<e.length;s++){var o=e[s];o.visible&&o.inputEnabled&&a(o,i,n)&&r.unshift(o)}return r},remove:function(t,e){void 0===e&&(e=!0),Array.isArray(t)||(t=[t]);for(var i=0,n=this.cameras,r=0;r<t.length;r++){var s=n.indexOf(t[r]);-1!==s&&(e?n[s].destroy():n[s].renderList=[],n.splice(s,1),i++)}return!this.main&&n[0]&&(this.main=n[0]),i},render:function(t,e){for(var i=this.scene,n=this.cameras,r=0;r<this.cameras.length;r++){var s=n[r];if(s.visible&&s.alpha>0){s.preRender();var o=this.getVisibleChildren(e.getChildren(),s);t.render(i,o,s)}}},getVisibleChildren:function(t,e){for(var i=[],n=0;n<t.length;n++){var r=t[n];r.willRender(e)&&i.push(r)}return i},resetAll:function(){for(var t=0;t<this.cameras.length;t++)this.cameras[t].destroy();return this.cameras=[],this.main=this.add(),this.main},update:function(t,e){for(var i=0;i<this.cameras.length;i++)this.cameras[i].update(t,e)},onResize:function(t,e,i,n,r){for(var s=0;s<this.cameras.length;s++){var o=this.cameras[s];0===o._x&&0===o._y&&o._width===n&&o._height===r&&o.setSize(e.width,e.height)}},resize:function(t,e){for(var i=0;i<this.cameras.length;i++)this.cameras[i].setSize(t,e)},shutdown:function(){this.main=void 0;for(var t=0;t<this.cameras.length;t++)this.cameras[t].destroy();this.cameras=[];var e=this.systems.events;e.off(l.UPDATE,this.update,this),e.off(l.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.default.destroy(),this.scene.sys.events.off(l.START,this.start,this),this.scene=null,this.systems=null}});o.register("CameraManager",u,"cameras"),t.exports=u},function(t,e){t.exports="enterfullscreen"},function(t,e){t.exports="fullscreenfailed"},function(t,e){t.exports="fullscreenunsupported"},function(t,e){t.exports="leavefullscreen"},function(t,e){t.exports="orientationchange"},function(t,e){t.exports="resize"},function(t,e,i){t.exports={Config:i(346),CreateRenderer:i(366),DebugHeader:i(384),Events:i(22),TimeStep:i(385),VisibilityHandler:i(387)}},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=[],u=!1,c=-1;function d(){u&&h&&(u=!1,h.length?l=h.concat(l):c=-1,l.length&&p())}function p(){if(!u){var t=a(d);u=!0;for(var e=l.length;e;){for(h=l,l=[];++c<e;)h&&h[c].run();c=-1,e=l.length}h=null,u=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(t);try{n(t)}catch(e){try{return n.call(null,t)}catch(e){return n.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function m(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];l.push(new f(t,e)),1!==l.length||u||a(p)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=m,r.addListener=m,r.once=m,r.off=m,r.removeListener=m,r.removeAllListeners=m,r.emit=m,r.prependListener=m,r.prependOnceListener=m,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(t,e,i){var n=i(136),r={gamepads:!1,mspointer:!1,touch:!1,wheelEvent:null};t.exports=("function"==typeof importScripts||(("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){var n=i(136),r={audioData:!1,dolby:!1,m4a:!1,mp3:!1,ogg:!1,opus:!1,wav:!1,webAudio:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return r;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){var i={h264:!1,hls:!1,mp4:!1,ogg:!1,vp9:!1,webm:!1};t.exports=function(){if("function"==typeof importScripts)return i;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){var i={available:!1,cancel:"",keyboard:!1,request:""};t.exports=function(){if("function"==typeof importScripts)return i;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<r.length;t++)if(document.documentElement[r[t]]){i.available=!0,i.request=r[t];break}var s=["cancel"+n,"exit"+e,"webkitCancel"+n,"webkitExit"+e,"msCancel"+n,"msExit"+e,"mozCancel"+n,"mozExit"+e];if(i.available)for(t=0;t<s.length;t++)if(document[s[t]]){i.cancel=s[t];break}return window.Element&&Element.ALLOW_KEYBOARD_INPUT&&!/ Version\/5\.1(?:\.\d+)? Safari\//.test(navigator.userAgent)&&(i.keyboard=!0),Object.defineProperty(i,"active",{get:function(){return!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)}}),i}()},function(t,e,i){t.exports={Between:i(349),BetweenPoints:i(350),BetweenPointsY:i(813),BetweenY:i(814),CounterClockwise:i(815),Normalize:i(351),Random:i(816),RandomDegrees:i(817),Reverse:i(818),RotateTo:i(819),ShortestBetween:i(820),Wrap:i(269),WrapDegrees:i(270)}},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){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){var n=i(137);t.exports=function(){return n(-Math.PI,Math.PI)}},function(t,e,i){var n=i(137);t.exports=function(){return n(-180,180)}},function(t,e,i){var n=i(351);t.exports=function(t){return n(t+Math.PI)}},function(t,e,i){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&&(e<t?e+=n.PI2:e-=n.PI2),e>t?t+=i:e<t&&(t-=i))),t}},function(t,e){t.exports=function(t,e){var i=e-t;return 0===i?0:i-360*Math.floor((i- -180)/360)}},function(t,e,i){t.exports={Between:i(50),BetweenPoints:i(352),BetweenPointsSquared:i(822),Chebyshev:i(823),Power:i(824),Snake:i(825),Squared:i(353)}},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){t.exports={Back:i(334),Bounce:i(335),Circular:i(336),Cubic:i(337),Elastic:i(338),Expo:i(339),Linear:i(340),Quadratic:i(341),Quartic:i(342),Quintic:i(343),Sine:i(344),Stepped:i(345)}},function(t,e,i){t.exports={Ceil:i(828),Equal:i(124),Floor:i(829),GreaterThan:i(354),LessThan:i(355)}},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){t.exports={Bezier:i(831),CatmullRom:i(832),CubicBezier:i(358),Linear:i(833),QuadraticBezier:i(359),SmoothStep:i(360),SmootherStep:i(834)}},function(t,e,i){var n=i(356);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){var n=i(194);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<s+1?i:s+1],t[i<s+2?i:s+2])}},function(t,e,i){var n=i(135);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){var n=i(183);t.exports=function(t,e,i){return e+(i-e)*n(t,0,1)}},function(t,e,i){t.exports={GetNext:i(361),IsSize:i(138),IsValue:i(836)}},function(t,e){t.exports=function(t){return t>0&&0==(t&t-1)}},function(t,e,i){t.exports={Ceil:i(139),Floor:i(76),To:i(838)}},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){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<t.length;n++)e=.02519603282416938*(i+=t.charCodeAt(n)),e-=i=e>>>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;e<t.length&&null!=t[e];e++){var i=t[e];this.s0-=this.hash(i),this.s0+=~~(this.s0<0),this.s1-=this.hash(i),this.s1+=~~(this.s1<0),this.s2-=this.hash(i),this.s2+=~~(this.s2<0)}},integer:function(){return 4294967296*this.rnd()},frac:function(){return this.rnd()+11102230246251565e-32*(2097152*this.rnd()|0)},real:function(){return this.integer()+this.frac()},integerInRange:function(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},between:function(t,e){return Math.floor(this.realInRange(0,e-t+1)+t)},realInRange:function(t,e){return this.frac()*(e-t)+t},normal:function(){return 1-2*this.frac()},uuid:function(){var t="",e="";for(e=t="";t++<36;e+=~t%5|3*t&4?(15^t?8^this.frac()*(20^t?16:4):4).toString(16):"-");return e},pick:function(t){return t[this.integerInRange(0,t.length-1)]},sign:function(){return this.pick(this.signs)},weightedPick:function(t){return t[~~(Math.pow(this.frac(),2)*(t.length-1)+.5)]},timestamp:function(t,e){return this.realInRange(t||9466848e5,e||1577862e6)},angle:function(){return this.integerInRange(-180,180)},rotation:function(){return this.realInRange(-3.1415926,3.1415926)},state:function(t){return"string"==typeof t&&t.match(/^!rnd/)&&(t=t.split(","),this.c=parseFloat(t[1]),this.s0=parseFloat(t[2]),this.s1=parseFloat(t[3]),this.s2=parseFloat(t[4])),["!rnd",this.c,this.s0,this.s1,this.s2].join(",")},shuffle:function(t){for(var e=t.length-1;e>0;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<t.length;i++)e+=+t[i];return e/t.length}},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.ceil(t*n)/n}},function(t,e){t.exports=function(t,e){return Math.abs(t-e)}},function(t,e,i){var n=i(18),r=i(0),s=i(69),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],u=r[9],c=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(-u,p),g=Math.atan2(-o,s)):f=Math.atan2(d,l);break;case"YXZ":f=Math.asin(-n(u,-1,1)),Math.abs(u)<.99999?(m=Math.atan2(a,p),g=Math.atan2(h,l)):m=Math.atan2(-c,s);break;case"ZXY":f=Math.asin(n(d,-1,1)),Math.abs(d)<.99999?(m=Math.atan2(-c,p),g=Math.atan2(-o,l)):g=Math.atan2(h,s);break;case"ZYX":m=Math.asin(-n(c,-1,1)),Math.abs(c)<.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(-u,l),m=Math.atan2(-c,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(-u,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){var e=t.length;if(0===e)return 0;t.sort((function(t,e){return t-e}));var i=Math.floor(e/2);return e%2==0?(t[i]+t[i-1])/2:t[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<t;o++)e+=(i-=e*n)*n,r[o]=i,s[o]=e;return{sin:s,cos:r,length:t}}},function(t,e,i){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)}},function(t,e){t.exports=function(t,e,i){return Math.abs(t-e)<=i}},function(t,e,i){var n=i(39),r=i(69),s=i(365),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){t.exports="addtexture"},function(t,e){t.exports="onerror"},function(t,e){t.exports="onload"},function(t,e){t.exports="ready"},function(t,e){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){t.exports="pipelineafterflush"},function(t,e){t.exports="pipelinebeforeflush"},function(t,e){t.exports="pipelinebind"},function(t,e){t.exports="pipelineboot"},function(t,e){t.exports="pipelinedestroy"},function(t,e){t.exports="pipelinerebind"},function(t,e){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){t.exports={GenerateTexture:i(388),Palettes:i(889)}},function(t,e,i){t.exports={ARNE16:i(389),C64:i(890),CGA:i(891),JMP:i(892),MSX:i(893)}},function(t,e){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){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){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){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){t.exports={Path:i(895),MoveTo:i(393),CubicBezier:i(390),Curve:i(94),Ellipse:i(391),Line:i(392),QuadraticBezier:i(394),Spline:i(395)}},function(t,e,i){var n=i(0),r=i(390),s=i(391),o=i(5),a=i(392),h=i(393),l=i(394),u=i(10),c=i(395),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,u=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(u,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;i<this.curves.length;i++){var n=this.curves[i];n.active&&n.draw(t,e)}return t},ellipseTo:function(t,e,i,n,r,o){var a=new s(0,0,t,e,i,n,r,o),h=this.getEndPoint(this._tmpVec2A),l=a.getStartPoint(this._tmpVec2B);return h.subtract(l),a.x=h.x,a.y=h.y,this.add(a)},fromJSON:function(t){this.curves=[],this.cacheLengths=[],this.startPoint.set(t.x,t.y),this.autoClose=t.autoClose;for(var e=0;e<t.curves.length;e++){var i=t.curves[e];switch(i.type){case"LineCurve":this.add(a.fromJSON(i));break;case"EllipseCurve":this.add(s.fromJSON(i));break;case"SplineCurve":this.add(c.fromJSON(i));break;case"CubicBezierCurve":this.add(r.fromJSON(i));break;case"QuadraticBezierCurve":this.add(l.fromJSON(i))}}return this},getBounds:function(t,e){void 0===t&&(t=new u),void 0===e&&(e=16),t.x=Number.MAX_VALUE,t.y=Number.MAX_VALUE;for(var i=new u,n=p.MIN_SAFE_INTEGER,r=p.MIN_SAFE_INTEGER,s=0;s<this.curves.length;s++){var o=this.curves[s];o.active&&(o.getBounds(i,e),t.x=Math.min(t.x,i.x),t.y=Math.min(t.y,i.y),n=Math.max(n,i.right),r=Math.max(r,i.bottom))}return t.right=n,t.bottom=r,t},getCurveLengths:function(){if(this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,i=0;i<this.curves.length;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,t},getEndPoint:function(t){return void 0===t&&(t=new d),this.curves.length>0?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<n.length;){if(n[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;n<this.curves.length;n++){var r=this.curves[n];if(r.active)for(var s=r.getResolution(t),o=r.getPoints(s),a=0;a<o.length;a++){var h=o[a];e&&e.equals(h)||(i.push(h),e=h)}}return this.autoClose&&i.length>1&&!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<n.length;){if(n[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 c(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<this.curves.length;e++)t.push(this.curves[e].toJSON());return{type:"Path",x:this.startPoint.x,y:this.startPoint.y,autoClose:this.autoClose,curves:t}},updateArcLengths:function(){this.cacheLengths=[],this.getCurveLengths()},destroy:function(){this.curves.length=0,this.cacheLengths.length=0,this.startPoint=void 0}});o.register("path",(function(t,e){return new f(t,e)})),t.exports=f},function(t,e,i){t.exports={DataManager:i(101),DataManagerPlugin:i(897),Events:i(315)}},function(t,e,i){var n=i(0),r=i(101),s=i(24),o=i(20),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){t.exports={Align:i(899),BaseShader:i(396),Bounds:i(902),Canvas:i(906),Color:i(397),ColorMatrix:i(198),Masks:i(916),RGB:i(200)}},function(t,e,i){var n=i(123),r=i(17),s={In:i(900),To:i(901)};s=r(!1,s,n),t.exports=s},function(t,e,i){t.exports={BottomCenter:i(290),BottomLeft:i(291),BottomRight:i(292),Center:i(293),LeftCenter:i(295),QuickSet:i(289),RightCenter:i(296),TopCenter:i(297),TopLeft:i(298),TopRight:i(299)}},function(t,e,i){t.exports={BottomCenter:i(277),BottomLeft:i(278),BottomRight:i(279),LeftBottom:i(280),LeftCenter:i(281),LeftTop:i(282),QuickSet:i(276),RightBottom:i(283),RightCenter:i(284),RightTop:i(285),TopCenter:i(286),TopLeft:i(287),TopRight:i(288)}},function(t,e,i){t.exports={CenterOn:i(294),GetBottom:i(42),GetBounds:i(903),GetCenterX:i(87),GetCenterY:i(89),GetLeft:i(43),GetOffsetX:i(904),GetOffsetY:i(905),GetRight:i(44),GetTop:i(45),SetBottom:i(55),SetCenterX:i(88),SetCenterY:i(90),SetLeft:i(53),SetRight:i(54),SetTop:i(52)}},function(t,e,i){var n=i(42),r=i(43),s=i(44),o=i(45);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){t.exports={CanvasInterpolation:i(367),CanvasPool:i(31),Smoothing:i(192),TouchAction:i(907),UserSelect:i(908)}},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){var n=i(103);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<t;e++)a.push(i[Math.floor(h)]),h+=l;return a}},function(t,e){t.exports=function(t){var e={r:t>>16&255,g:t>>8&255,b:255&t,a:255};return t>16777215&&(e.a=t>>>24),e}},function(t,e,i){var n=i(38),r=i(399);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){var n=i(188);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){var n=i(135),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){var n=i(195),r=i(38);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){var n=i(398);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,7):"0x"+n(r)+n(t)+n(e)+n(i)}},function(t,e,i){t.exports={BitmapMask:i(310),GeometryMask:i(311)}},function(t,e,i){var n={AddToDOM:i(142),DOMContentLoaded:i(400),GetInnerHeight:i(401),GetScreenOrientation:i(402),GetTarget:i(407),ParseXML:i(408),RemoveFromDOM:i(202),RequestAnimationFrame:i(386)};t.exports=n},function(t,e,i){t.exports={EventEmitter:i(919)}},function(t,e,i){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){var n=i(142),r=i(321),s=i(325),o=i(31),a=i(0),h=i(346),l=i(921),u=i(366),c=i(101),d=i(384),p=i(347),f=i(400),m=i(9),g=i(22),v=i(409),y=i(24),x=i(414),w=i(415),b=i(417),A=i(106),T=i(422),S=i(385),E=i(387),M=i(426),_=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 T(this),this.cache=new s(this),this.registry=new c(this),this.input=new v(this,this.config),this.scene=new b(this,this.config.sceneConfig),this.device=p,this.scale=new w(this,this.config),this.sound=null,this.sound=M.create(this),this.loop=new S(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(),u(this),l(this),d(this),n(this.canvas,this.config.parent),this.textures.once(A.READY,this.texturesReady,this),this.events.emit(g.BOOT))},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)),E(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=_},function(t,e,i){var n=i(142);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: "+e.domPointerEvents+";","transform: scale(1);","transform-origin: left top;"].join(" "),t.domContainer=i,n(i,e.parent)}}},function(t,e){t.exports="boot"},function(t,e){t.exports="destroy"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameout"},function(t,e){t.exports="gameover"},function(t,e){t.exports="gameobjectdown"},function(t,e){t.exports="dragend"},function(t,e){t.exports="dragenter"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragleave"},function(t,e){t.exports="dragover"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="drop"},function(t,e){t.exports="gameobjectmove"},function(t,e){t.exports="gameobjectout"},function(t,e){t.exports="gameobjectover"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="wheel"},function(t,e){t.exports="gameobjectup"},function(t,e){t.exports="gameobjectwheel"},function(t,e){t.exports="boot"},function(t,e){t.exports="process"},function(t,e){t.exports="update"},function(t,e){t.exports="pointerdown"},function(t,e){t.exports="pointerdownoutside"},function(t,e){t.exports="pointermove"},function(t,e){t.exports="pointerout"},function(t,e){t.exports="pointerover"},function(t,e){t.exports="pointerup"},function(t,e){t.exports="pointerupoutside"},function(t,e){t.exports="wheel"},function(t,e){t.exports="pointerlockchange"},function(t,e){t.exports="preupdate"},function(t,e){t.exports="shutdown"},function(t,e){t.exports="start"},function(t,e){t.exports="update"},function(t,e){t.exports="addfile"},function(t,e){t.exports="complete"},function(t,e){t.exports="filecomplete"},function(t,e){t.exports="filecomplete-"},function(t,e){t.exports="loaderror"},function(t,e){t.exports="load"},function(t,e){t.exports="fileprogress"},function(t,e){t.exports="postprocess"},function(t,e){t.exports="progress"},function(t,e){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<s.length;o++){var a=s[o].attributes,h=a.name.value,l=parseInt(a.x.value,10),u=parseInt(a.y.value,10),c=parseInt(a.width.value,10),d=parseInt(a.height.value,10);if(r=t.add(h,e,l,u,c,d),a.frameX){var p=Math.abs(parseInt(a.frameX.value,10)),f=Math.abs(parseInt(a.frameY.value,10)),m=parseInt(a.frameWidth.value,10),g=parseInt(a.frameHeight.value,10);r.setTrim(c,d,p,f,m,g)}}return t}}},function(t,e){t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},function(t,e){t.exports=function(t,e){var i=t.source[e];return t.add("__BASE",e,0,0,i.width,i.height),t}},function(t,e,i){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<o.length;a++){var h=o[a];s=t.add(h.filename,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 u in i)"frames"!==u&&(Array.isArray(i[u])?t.customData[u]=i[u].slice(0):t.customData[u]=i[u]);return t}}},function(t,e,i){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 u in i)"frames"!==u&&(Array.isArray(i[u])?t.customData[u]=i[u].slice(0):t.customData[u]=i[u]);return t}}},function(t,e,i){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 u=t.source[e];t.add("__BASE",e,0,0,u.width,u.height);var c=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));(c>m||c<-m)&&(c=0),c<0&&(c=m+c),-1!==d&&(m=c+(d+1));for(var g=p,v=p,y=0,x=0,w=0;w<m;w++){y=0,x=0;var b=g+h,A=v+l;b>s&&(y=b-s),A>o&&(x=A-o),t.add(w,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){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),u=n(i,"margin",0),c=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-u+c)/(r+c)),x=Math.floor((v-u+c)/(s+c)),w=y*x,b=e.x,A=r-b,T=r-(g-f-b),S=e.y,E=s-S,M=s-(v-m-S);(h>w||h<-w)&&(h=0),h<0&&(h=w+h),-1!==l&&(w=h+(l+1));for(var _=u,C=u,P=0,R=e.sourceIndex,L=0;L<x;L++){for(var O=0===L,D=L===x-1,B=0;B<y;B++){var I=0===B,F=B===y-1;if(a=t.add(P,R,d+_,p+C,r,s),I||O||F||D){var k=I?b:0,N=O?S:0,z=0,U=0;I&&(z+=r-A),F&&(z+=r-T),O&&(U+=s-E),D&&(U+=s-M);var V=r-z,H=s-U;a.cutWidth=V,a.cutHeight=H,a.setTrim(r,s,k,N,V,H)}_+=c,_+=I?A:F?T:r,P++}_=u,C+=c,C+=O?E:D?M:s}return t}},function(t,e){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="",u={x:0,y:0,width:0,height:0},c=0;c<o.length;c++){var d=o[c].match(a);if(d){var p="- "===d[1],f=d[2],m=d[3];if(p&&(l!==h&&(n(t,e,l,u),h=l),u={x:0,y:0,width:0,height:0}),"name"!==f)switch(f){case"x":case"y":case"width":case"height":u[f]=parseInt(m,10)}else l=m}}return l!==h&&n(t,e,l,u),t}},function(t,e){t.exports="complete"},function(t,e){t.exports="decoded"},function(t,e){t.exports="decodedall"},function(t,e){t.exports="destroy"},function(t,e){t.exports="detune"},function(t,e){t.exports="detune"},function(t,e){t.exports="mute"},function(t,e){t.exports="rate"},function(t,e){t.exports="volume"},function(t,e){t.exports="loop"},function(t,e){t.exports="looped"},function(t,e){t.exports="mute"},function(t,e){t.exports="pan"},function(t,e){t.exports="pauseall"},function(t,e){t.exports="pause"},function(t,e){t.exports="play"},function(t,e){t.exports="rate"},function(t,e){t.exports="resumeall"},function(t,e){t.exports="resume"},function(t,e){t.exports="seek"},function(t,e){t.exports="stopall"},function(t,e){t.exports="stop"},function(t,e){t.exports="unlocked"},function(t,e){t.exports="volume"},function(t,e,i){var n={Events:i(75),DisplayList:i(1012),GameObjectCreator:i(16),GameObjectFactory:i(5),UpdateList:i(1040),Components:i(11),GetCalcMatrix:i(19),BuildGameObject:i(28),BuildGameObjectAnimation:i(439),GameObject:i(15),BitmapText:i(148),Blitter:i(213),Bob:i(440),Container:i(214),DOMElement:i(442),DynamicBitmapText:i(215),Extern:i(444),Graphics:i(216),Group:i(113),Image:i(125),Layer:i(219),Particles:i(1074),PathFollower:i(457),RenderTexture:i(221),RetroFont:i(1082),Rope:i(223),Sprite:i(73),Text:i(224),GetTextSize:i(458),MeasureText:i(460),TextStyle:i(459),TileSprite:i(225),Zone:i(129),Video:i(226),Shape:i(34),Arc:i(461),Curve:i(462),Ellipse:i(463),Grid:i(464),IsoBox:i(465),IsoTriangle:i(466),Line:i(467),Polygon:i(468),Rectangle:i(473),Star:i(474),Triangle:i(475),Factories:{Blitter:i(1130),Container:i(1131),DOMElement:i(1132),DynamicBitmapText:i(1133),Extern:i(1134),Graphics:i(1135),Group:i(1136),Image:i(1137),Layer:i(1138),Particles:i(1139),PathFollower:i(1140),RenderTexture:i(1141),Rope:i(1142),Sprite:i(1143),StaticBitmapText:i(1144),Text:i(1145),TileSprite:i(1146),Zone:i(1147),Video:i(1148),Arc:i(1149),Curve:i(1150),Ellipse:i(1151),Grid:i(1152),IsoBox:i(1153),IsoTriangle:i(1154),Line:i(1155),Polygon:i(1156),Rectangle:i(1157),Star:i(1158),Triangle:i(1159)},Creators:{Blitter:i(1160),Container:i(1161),DynamicBitmapText:i(1162),Graphics:i(1163),Group:i(1164),Image:i(1165),Layer:i(1166),Particles:i(1167),RenderTexture:i(1168),Rope:i(1169),Sprite:i(1170),StaticBitmapText:i(1171),Text:i(1172),TileSprite:i(1173),Zone:i(1174),Video:i(1175)}};n.Shader=i(229),n.Mesh=i(230),n.PointLight=i(150),n.Factories.Shader=i(1184),n.Factories.Mesh=i(1185),n.Factories.PointLight=i(1186),n.Creators.Shader=i(1187),n.Creators.Mesh=i(1188),n.Creators.PointLight=i(1189),n.Light=i(481),n.LightsManager=i(482),n.LightsPlugin=i(1190),t.exports=n},function(t,e,i){var n=i(0),r=i(110),s=i(24),o=i(75),a=i(20),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.displayList&&t.displayList!==this&&t.removeFromDisplayList(),t.displayList||(this.queueDepthSort(),t.displayList=this,t.emit(o.ADDED_TO_SCENE,t,this.scene),this.events.emit(a.ADDED_TO_SCENE,t,this.scene))},removeChildCallback:function(t){this.queueDepthSort(),t.displayList=null,t.emit(o.REMOVED_FROM_SCENE,t,this.scene),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){t.exports={CheckMatrix:i(209),MatrixToString:i(1014),ReverseColumns:i(1015),ReverseRows:i(1016),Rotate180:i(1017),RotateLeft:i(1018),RotateMatrix:i(147),RotateRight:i(1019),Translate:i(1020),TransposeMatrix:i(435)}},function(t,e,i){var n=i(186),r=i(209);t.exports=function(t){var e="";if(!r(t))return e;for(var i=0;i<t.length;i++){for(var s=0;s<t[i].length;s++){var o=t[i][s].toString();e+="undefined"!==o?n(o,2):"?",s<t[i].length-1&&(e+=" |")}if(i<t.length-1){e+="\n";for(var a=0;a<t[i].length;a++)e+="---",a<t[i].length-1&&(e+="+");e+="\n"}}return e}},function(t,e){t.exports=function(t){return t.reverse()}},function(t,e){t.exports=function(t){for(var e=0;e<t.length;e++)t[e].reverse();return t}},function(t,e,i){var n=i(147);t.exports=function(t){return n(t,180)}},function(t,e,i){var n=i(147);t.exports=function(t){return n(t,90)}},function(t,e,i){var n=i(147);t.exports=function(t){return n(t,-90)}},function(t,e,i){var n=i(178),r=i(179);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;s<t.length;s++){var o=t[s];e<0?n(o,Math.abs(e)):r(o,e)}return t}},function(t,e){t.exports=function(t,e,i,n,r){if(void 0===r&&(r=t),i>0){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;a<o;a++){var h=e[a];t.push(h),n&&n.call(r,h)}return e}},function(t,e){t.exports=function(t,e,i,n,r,s){if(void 0===i&&(i=0),void 0===s&&(s=t),n>0){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<t.length&&(t.splice(i,1),t.push(e)),e}},function(t,e,i){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<s;a++)t[a][e]===i&&o++;return o}},function(t,e){t.exports=function(t,e,i){var n,r=[null];for(n=3;n<arguments.length;n++)r.push(arguments[n]);for(n=0;n<t.length;n++)r[0]=t[n],e.apply(i,r);return t}},function(t,e,i){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;o<arguments.length;o++)a.push(arguments[o]);for(o=r;o<s;o++)a[0]=t[o],e.apply(i,a)}return t}},function(t,e){t.exports=function(t,e){var i=t.indexOf(e);if(i>0){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<t.length-1){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){if(e===i)return t;var n=t.indexOf(e),r=t.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return n>r||(t.splice(n,1),r===t.length-1?t.push(e):t.splice(r,0,e)),t}},function(t,e){t.exports=function(t,e,i){if(e===i)return t;var n=t.indexOf(e),r=t.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return n<r||(t.splice(n,1),0===r?t.unshift(e):t.splice(r,0,e)),t}},function(t,e,i){var n=i(363);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<s;o++)r.push(t),t+=i;return r}},function(t,e,i){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){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<a.length;h++){var l=a[h];r.call(s,l)}return a}return[]}},function(t,e,i){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){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<s;o++){var a=t[o];a.hasOwnProperty(e)&&(a[e]=i)}return t}},function(t,e){t.exports=function(t,e,i){if(e===i)return t;var n=t.indexOf(e),r=t.indexOf(i);if(n<0||r<0)throw new Error("Supplied items must be elements of the same array");return t[n]=i,t[r]=e,t}},function(t,e,i){var n=i(0),r=i(211),s=i(24),o=i(20),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<n;r++){var s=i[r];s.active&&s.preUpdate.call(s,t,e)}},shutdown:function(){for(var t=this._active.length;t--;)this._active[t].destroy(!0);for(t=this._pending.length;t--;)this._pending[t].destroy(!0);for(t=this._destroy.length;t--;)this._destroy[t].destroy(!0);this._toProcess=0,this._pending=[],this._active=[],this._destroy=[],this.removeAllListeners();var e=this.systems.events;e.off(o.PRE_UPDATE,this.update,this),e.off(o.UPDATE,this.sceneUpdate,this),e.off(o.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.systems.events.off(o.START,this.start,this),this.scene=null,this.systems=null}});s.register("UpdateList",a,"updateList"),t.exports=a},function(t,e){t.exports="add"},function(t,e){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,u=t.maxWidth,c=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,w=0,b=0,A=null,T=t._align,S=0,E=0,M=t.fontSize/t.fontData.size,_=M*t.scaleX,C=M*t.scaleY,P=null,R=0,L=[],O=Number.MAX_VALUE,D=0,B=0,I=0,F=[],k=[],N=null;if(u>0){for(r=0;r<l;r++)if(10!==(b=h.charCodeAt(r))){if(A=g[b]){if(null!==P)var z=A.kerning[R];b===c?null!==N&&(F.push({word:N.word,i:N.i,x:N.x*_,y:N.y*C,w:N.w*_,h:N.h*C,cr:!1}),N=null):(null===N&&(N={word:"",i:r,x:x,y:w,w:0,h:v,cr:!1}),N.word=N.word.concat(h[r]),N.w+=A.xOffset+A.xAdvance+(void 0!==z?z:0)),x+=A.xAdvance+y,P=A,R=b}}else null!==N&&(F.push({word:N.word,i:N.i,x:N.x*_,y:N.y*C,w:N.w*_,h:N.h*C,cr:!0}),N=null),x=0,w+=v,P=null;var U;null!==N&&F.push({word:N.word,i:N.i,x:N.x*_,y:N.y*C,w:N.w*_,h:N.h*C,cr:!1}),x=0,w=0,P=null,R=0;var V=0,H=[];for(r=0;r<F.length;r++){var G=F[r],W=G.x,Y=G.x+G.w;U&&(V=W-(W-(U.x+U.w)+U.w),U=null),W-V>u||Y-V>u?(H.push(G.i-1),G.cr?(H.push(G.i+G.word.length),V=0,U=null):U=G):G.cr&&(H.push(G.i+G.word.length),V=0,U=null)}for(r=H.length-1;r>=0;r--)s=h,o=H[r],a="\n",h=s.substr(0,o)+a+s.substr(o+1);n.wrappedText=h,l=h.length,F=[],N=null}var X=0;for(r=0;r<l;r++)if(10!==(b=h.charCodeAt(r))){if(A=g[b]){if(S=x,E=w,null!==P){var j=A.kerning[R];S+=void 0!==j?j:0}d>S&&(d=S),p>E&&(p=E);var q=S+A.xAdvance,Q=E+v;f<q&&(f=q),m<Q&&(m=Q);var K=A.xOffset+A.xAdvance+(void 0!==j?j:0);b===c?null!==N&&(F.push({word:N.word,i:N.i,x:N.x*_,y:N.y*C,w:N.w*_,h:N.h*C}),N=null):(null===N&&(N={word:"",i:X,x:x,y:w,w:0,h:v}),N.word=N.word.concat(h[r]),N.w+=K),k.push({i:X,char:h[r],code:b,x:(A.xOffset+x)*M,y:(A.yOffset+w)*M,w:A.width*M,h:A.height*M,t:w*M,r:q*M,b:v*M,line:B,glyph:A}),x+=A.xAdvance+y,P=A,R=b,I=q*M,X++}}else null!==N&&(F.push({word:N.word,i:N.i,x:N.x*_,y:N.y*C,w:N.w*_,h:N.h*C}),N=null),x=0,w+=v,P=null,L[B]=I,I>D&&(D=I),I<O&&(O=I),B++,I=0;if(null!==N&&F.push({word:N.word,i:N.i,x:N.x*_,y:N.y*C,w:N.w*_,h:N.h*C}),L[B]=I,I>D&&(D=I),I<O&&(O=I),T>0)for(var J=0;J<k.length;J++){var Z=k[J];if(1===T){var $=(D-L[Z.line])/2;Z.x+=$,Z.r+=$}else if(2===T){var tt=D-L[Z.line];Z.x+=tt,Z.r+=tt}}var et=n.local,it=n.global,nt=n.lines;return et.x=d*M,et.y=p*M,et.width=f*M,et.height=m*M,it.x=t.x-t._displayOriginX+d*_,it.y=t.y-t._displayOriginY+p*C,it.width=f*_,it.height=m*C,nt.shortest=O,nt.longest=D,nt.lengths=L,e&&(et.x=Math.ceil(et.x),et.y=Math.ceil(et.y),et.width=Math.ceil(et.width),et.height=Math.ceil(et.height),it.x=Math.ceil(it.x),it.y=Math.ceil(it.y),it.width=Math.ceil(it.width),it.height=Math.ceil(it.height),nt.shortest=Math.ceil(O),nt.longest=Math.ceil(D)),i&&(t._displayOriginX=t.originX*et.width,t._displayOriginY=t.originY*et.height,it.x=t.x-t._displayOriginX*t.scaleX,it.y=t.y-t._displayOriginY*t.scaleY,e&&(it.x=Math.ceil(it.x),it.y=Math.ceil(it.y))),n.words=F,n.characters=k,n.lines.height=v,n.scale=M,n.scaleX=t.scaleX,n.scaleY=t.scaleY,n}},function(t,e,i){var n=i(212);t.exports=function(t,e,i,r,s,o,a){var h=t.sys.textures.get(i),l=h.get(r),u=t.sys.cache.xml.get(s);if(l&&u){var c=n(u,l,o,a,h);return t.sys.cache.bitmapFont.add(e,{data:c,texture:i,frame:r,fromAtlas:!0}),!0}return!1}},function(t,e,i){var n=i(1),r=i(1);n=i(1046),r=i(1048),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){var n=i(1047),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,u=t.pipelines.set(e.pipeline,e),c=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),w=g(e.tintBottomRight,p*e._alphaBR),b=e.frame.glTexture,A=u.setGameObject(e),T=e.getTextBounds(!1).characters,S=e.dropShadowX,E=e.dropShadowY,M=0!==S||0!==E;if(t.pipelines.preBatch(e),M){var _=e.dropShadowColor,C=e.dropShadowAlpha,P=g(_,p*C*e._alphaTL),R=g(_,p*C*e._alphaTR),L=g(_,p*C*e._alphaBL),O=g(_,p*C*e._alphaBR);for(a=0;a<T.length;a++)l=(h=T[a]).glyph,32!==h.code&&0!==l.width&&0!==l.height&&n(u,e,h,l,S,E,c,d,P,R,L,O,1,b,A)}for(a=0;a<T.length;a++)if(l=(h=T[a]).glyph,32!==h.code&&0!==l.width&&0!==l.height)if(f[h.i]){var D=f[h.i],B=D.tintEffect,I=g(D.tintTL,p*e._alphaTL),F=g(D.tintTR,p*e._alphaTR),k=g(D.tintBL,p*e._alphaBL),N=g(D.tintBR,p*e._alphaBR);n(u,e,h,l,0,0,c,d,I,F,k,N,B,b,A)}else n(u,e,h,l,0,0,c,d,v,y,x,w,m,b,A);t.pipelines.postBatch(e)}}},function(t,e){t.exports=function(t,e,i,n,r,s,o,a,h,l,u,c,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),w=o.getYRound(m,g,a),b=o.getXRound(m,y,a),A=o.getYRound(m,y,a),T=o.getXRound(v,y,a),S=o.getYRound(v,y,a),E=o.getXRound(v,g,a),M=o.getYRound(v,g,a);t.batchQuad(e,x,w,b,A,T,S,E,M,n.u0,n.v0,n.u1,n.v1,h,l,u,c,d,p,f)}},function(t,e,i){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.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.fontData.chars,u=e.fontData.lineHeight,c=e._letterSpacing,d=0,p=0,f=0,m=null,g=0,v=0,y=0,x=0,w=0,b=0,A=null,T=0,S=h.source.image,E=h.cutX,M=h.cutY,_=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,B=0;B<o;B++)if(10!==(f=s.charCodeAt(B))){if(m=l[f]){if(g=E+m.x,v=M+m.y,y=m.width,x=m.height,w=m.xOffset+d,b=m.yOffset+p,null!==A){var I=m.kerning[T];w+=void 0!==I?I:0}w*=_,b*=_,w+=R,d+=m.xAdvance+c,A=m,T=f,0!==y&&0!==x&&32!==f&&(D&&(w=Math.round(w),b=Math.round(b)),a.save(),a.translate(w,b),a.scale(_,_),a.drawImage(S,g,v,y,x,0,0,y,x),a.restore())}}else P++,1===C?R=(O.longest-O.lengths[P])/2:2===C&&(R=O.longest-O.lengths[P]),d=0,p+=u,A=null;a.restore()}}},function(t,e,i){var n=i(1),r=i(1);n=i(1050),r=i(1051),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){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){var a=i.alpha*e.alpha;if(0!==a){i.addToRenderList(e);var h=t.pipelines.set(this.pipeline,e),l=i.scrollX*e.scrollFactorX,u=i.scrollY*e.scrollFactorY,c=s.copyFrom(i.matrix);n&&(c.multiplyWithOffset(n,-l,-u),l=0,u=0);var d=e.x-l,p=e.y-u,f=-1,m=i.roundPixels;t.pipelines.preBatch(e);for(var g=0;g<o.length;g++){var v=o[g],y=v.frame,x=v.alpha*a;if(0!==x){var w=y.width,b=y.height,A=d+v.x+y.x,T=p+v.y+y.y;v.flipX&&(w*=-1,A+=y.width),v.flipY&&(b*=-1,T+=y.height);var S=A+w,E=T+b,M=c.getX(A,T),_=c.getY(A,T),C=c.getX(S,E),P=c.getY(S,E),R=r.getTintAppendFloatAlpha(v.tint,x);if(y.sourceIndex!==f){var L=h.setGameObject(e,y);f=y.sourceIndex}m&&(M=Math.round(M),_=Math.round(_),C=Math.round(C),P=Math.round(P)),h.batchQuad(e,M,_,M,P,C,P,C,_,y.u0,y.v0,y.u1,y.v1,R,R,R,R,!1,y.glTexture,L)&&(f=-1)}}t.pipelines.postBatch(e)}}}},function(t,e){t.exports=function(t,e,i,n){var r=e.getRenderList();if(0!==r.length){var s=t.currentContext,o=i.alpha*e.alpha;if(0!==o){i.addToRenderList(e),s.globalCompositeOperation=t.blendModes[e.blendMode],s.imageSmoothingEnabled=!(!t.antialias||e.frame.source.scaleMode);var a=e.x-i.scrollX*e.scrollFactorX,h=e.y-i.scrollY*e.scrollFactorY;s.save(),n&&n.copyToContext(s);for(var l=i.roundPixels,u=0;u<r.length;u++){var c=r[u],d=c.flipX||c.flipY,p=c.frame,f=p.canvasData,m=p.x,g=p.y,v=1,y=1,x=c.alpha*o;0!==x&&(s.globalAlpha=x,d?(c.flipX&&(v=-1,m-=f.width),c.flipY&&(y=-1,g-=f.height),s.save(),s.translate(c.x+a,c.y+h),s.scale(v,y),s.drawImage(p.source.image,f.x,f.y,f.width,f.height,m,g,f.width,f.height),s.restore()):(l&&(m=Math.round(m),g=Math.round(g)),s.drawImage(p.source.image,f.x,f.y,f.width,f.height,m+c.x+a,g+c.y+h,f.width,f.height)))}s.restore()}}}},function(t,e,i){var n=i(1),r=i(1);n=i(1053),r=i(1054),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e){t.exports=function(t,e,i,n){i.addToRenderList(e);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,u=e.scrollFactorY,c=0;c<s;c++){var d=r[c];if(d.willRender(i)){var p,f,m,g;if(void 0!==d.alphaTopLeft)p=d.alphaTopLeft,f=d.alphaTopRight,m=d.alphaBottomLeft,g=d.alphaBottomRight;else{var v=d.alpha;p=v,f=v,m=v,g=v}var y=d.scrollFactorX,x=d.scrollFactorY;a||d.blendMode===t.currentBlendMode||t.setBlendMode(d.blendMode);var w=d.mask;w&&w.preRenderWebGL(t,d,i);var b=d.type;b!==t.currentType&&(t.newType=!0,t.currentType=b),t.nextTypeMatch=c<s-1&&r[c+1].type===t.currentType,d.setScrollFactor(y*l,x*u),d.setAlpha(p*h,f*h,m*h,g*h),d.renderWebGL(t,d,i,o),d.setAlpha(p,f,m,g),d.setScrollFactor(y,x),w&&w.postRenderWebGL(t,i),t.newType=!1}}t.pipelines.postBatch(e)}}},function(t,e){t.exports=function(t,e,i,n){i.addToRenderList(e);var r=e.list;if(0!==r.length){var s=e.localTransform;n?(s.loadIdentity(),s.multiply(n),s.translate(e.x,e.y),s.rotate(e.rotation),s.scale(e.scaleX,e.scaleY)):s.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY);var o=-1!==e.blendMode;o||t.setBlendMode(0);var a=e._alpha,h=e.scrollFactorX,l=e.scrollFactorY;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var u=0;u<r.length;u++){var c=r[u];if(c.willRender(i)){var d=c.alpha,p=c.scrollFactorX,f=c.scrollFactorY;o||c.blendMode===t.currentBlendMode||t.setBlendMode(c.blendMode),c.setScrollFactor(p*h,f*l),c.setAlpha(d*a),c.renderCanvas(t,c,i,s),c.setAlpha(d),c.setScrollFactor(p,f)}}e.mask&&e.mask.postRenderCanvas(t)}}},function(t,e,i){var n=i(1),r=i(1);n=i(443),r=i(443),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e){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){var n=i(1),r=i(1);n=i(1058),r=i(1059),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){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),u=n(e,i,r),c=u.sprite,d=u.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),w=s.getTintAppendFloatAlpha(e.tintTopRight,i.alpha*e._alphaTR),b=s.getTintAppendFloatAlpha(e.tintBottomLeft,i.alpha*e._alphaBL),A=s.getTintAppendFloatAlpha(e.tintBottomRight,i.alpha*e._alphaBR),T=l.setGameObject(e),S=0,E=0,M=0,_=0,C=e.letterSpacing,P=0,R=0,L=e.scrollX,O=e.scrollY,D=e.fontData,B=D.chars,I=D.lineHeight,F=e.fontSize/D.size,k=0,N=e._align,z=0,U=0,V=e.getTextBounds(!1);e.maxWidth>0&&(h=(a=V.wrappedText).length);var H=e._bounds.lines;1===N?U=(H.longest-H.lengths[0])/2:2===N&&(U=H.longest-H.lengths[0]);var G=i.roundPixels,W=e.displayCallback,Y=e.callbackData;t.pipelines.preBatch(e);for(var X=0;X<h;X++)if(10!==(M=a.charCodeAt(X))){if(m=B[M]){P=m.width,R=m.height;var j=m.xOffset+S-L,q=m.yOffset+E-O;if(null!==g){var Q=m.kerning[_];j+=void 0!==Q?Q:0}if(S+=m.xAdvance+C,g=m,_=M,0!==P&&0!==R&&32!==M){if(F=e.fontSize/e.fontData.size,k=0,W){Y.color=0,Y.tint.topLeft=x,Y.tint.topRight=w,Y.tint.bottomLeft=b,Y.tint.bottomRight=A,Y.index=X,Y.charCode=M,Y.x=j,Y.y=q,Y.scale=F,Y.rotation=k,Y.data=m.data;var K=W(Y);j=K.x,q=K.y,F=K.scale,k=K.rotation,K.color?(x=K.color,w=K.color,b=K.color,A=K.color):(x=K.tint.topLeft,w=K.tint.topRight,b=K.tint.bottomLeft,A=K.tint.bottomRight),x=s.getTintAppendFloatAlpha(x,i.alpha*e._alphaTL),w=s.getTintAppendFloatAlpha(w,i.alpha*e._alphaTR),b=s.getTintAppendFloatAlpha(b,i.alpha*e._alphaBL),A=s.getTintAppendFloatAlpha(A,i.alpha*e._alphaBR)}j*=F,q*=F,j-=e.displayOriginX,q-=e.displayOriginY,j+=U,p.applyITRS(j,q,k,F,F),d.multiply(p,c);var J=m.u0,Z=m.v0,$=m.u1,tt=m.v1,et=P,it=R,nt=c.e,rt=c.f,st=it*c.c+c.e,ot=it*c.d+c.f,at=et*c.a+it*c.c+c.e,ht=et*c.b+it*c.d+c.f,lt=et*c.a+c.e,ut=et*c.b+c.f;G&&(nt=Math.round(nt),rt=Math.round(rt),st=Math.round(st),ot=Math.round(ot),at=Math.round(at),ht=Math.round(ht),lt=Math.round(lt),ut=Math.round(ut)),l.batchQuad(e,nt,rt,st,ot,at,ht,lt,ut,J,Z,$,tt,x,w,b,A,y,v,T)}}}else z++,1===N?U=(H.longest-H.lengths[z])/2:2===N&&(U=H.longest-H.lengths[z]),S=0,E+=I,g=null;f&&(l.flush(),t.popScissor()),t.pipelines.postBatch(e)}}},function(t,e,i){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.fromAtlas?e.frame:e.texture.frames.__BASE,l=e.displayCallback,u=e.callbackData,c=e.fontData.chars,d=e.fontData.lineHeight,p=e._letterSpacing,f=0,m=0,g=0,v=null,y=0,x=0,w=0,b=0,A=0,T=0,S=null,E=0,M=e.frame.source.image,_=h.cutX,C=h.cutY,P=0,R=0,L=e._fontSize/e.fontData.size,O=e._align,D=0,B=0;e.getTextBounds(!1);var I=e._bounds.lines;1===O?B=(I.longest-I.lengths[0])/2:2===O&&(B=I.longest-I.lengths[0]),a.translate(-e.displayOriginX,-e.displayOriginY);var F=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<o;k++)if(R=L,P=0,10!==(g=s.charCodeAt(k))){if(v=c[g]){if(y=_+v.x,x=C+v.y,w=v.width,b=v.height,A=v.xOffset+f-e.scrollX,T=v.yOffset+m-e.scrollY,null!==S){var N=v.kerning[E];A+=void 0!==N?N:0}if(l){u.index=k,u.charCode=g,u.x=A,u.y=T,u.scale=R,u.rotation=P,u.data=v.data;var z=l(u);A=z.x,T=z.y,R=z.scale,P=z.rotation}A*=R,T*=R,A+=B,f+=v.xAdvance+p,S=v,E=g,0!==w&&0!==b&&32!==g&&(F&&(A=Math.round(A),T=Math.round(T)),a.save(),a.translate(A,T),a.rotate(P),a.scale(R,R),a.drawImage(M,y,x,w,b,0,0,w,b),a.restore())}}else D++,1===O?B=(I.longest-I.lengths[D])/2:2===O&&(B=I.longest-I.lengths[D]),f=0,m+=d,S=null;a.restore()}}},function(t,e,i){var n=i(1),r=i(1);n=i(1061),r=i(1062),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){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){var n=i(1),r=i(1);n=i(1064),r=i(448),r=i(448),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){var n=i(217),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=[],u=new s;t.exports=function(t,e,i,s){if(0!==e.commandBuffer.length){i.addToRenderList(e);var c=t.pipelines.set(e.pipeline,e);t.pipelines.preBatch(e);for(var d=r(e,i,s).calc,p=u.loadIdentity(),f=e.commandBuffer,m=i.alpha*e.alpha,g=1,v=c.fillTint,y=c.strokeTint,x=0,w=0,b=0,A=2*Math.PI,T=[],S=0,E=!0,M=null,_=o.getTintAppendFloatAlpha,C=0;C<f.length;C++)switch(f[C]){case n.BEGIN_PATH:T.length=0,M=null,E=!0;break;case n.CLOSE_PATH:E=!1,M&&M.points.length&&M.points.push(M.points[0]);break;case n.FILL_PATH:for(S=0;S<T.length;S++)c.batchFillPath(T[S].points,p,d);break;case n.STROKE_PATH:for(S=0;S<T.length;S++)c.batchStrokePath(T[S].points,g,E,p,d);break;case n.LINE_STYLE:g=f[++C];var P=_(f[++C],f[++C]*m);y.TL=P,y.TR=P,y.BL=P,y.BR=P;break;case n.FILL_STYLE:var R=_(f[++C],f[++C]*m);v.TL=R,v.TR=R,v.BL=R,v.BR=R;break;case n.GRADIENT_FILL_STYLE:var L=f[++C]*m,O=f[++C]*m,D=f[++C]*m,B=f[++C]*m;v.TL=_(f[++C],L),v.TR=_(f[++C],O),v.BL=_(f[++C],D),v.BR=_(f[++C],B);break;case n.GRADIENT_LINE_STYLE:g=f[++C];var I=f[++C]*m;y.TL=_(f[++C],I),y.TR=_(f[++C],I),y.BL=_(f[++C],I),y.BR=_(f[++C],I);break;case n.ARC:var F=0,k=f[++C],N=f[++C],z=f[++C],U=f[++C],V=f[++C],H=f[++C],G=f[++C];for(V-=U,H?V<-A?V=-A:V>0&&(V=V%A-A):V>A?V=A:V<0&&(V=A+V%A),null===M&&(M=new h(k+Math.cos(U)*z,N+Math.sin(U)*z,g),T.push(M),F+=.01);F<1+G;)b=V*F+U,x=k+Math.cos(b)*z,w=N+Math.sin(b)*z,M.points.push(new a(x,w,g)),F+=.01;b=V+U,x=k+Math.cos(b)*z,w=N+Math.sin(b)*z,M.points.push(new a(x,w,g));break;case n.FILL_RECT:c.batchFillRect(f[++C],f[++C],f[++C],f[++C],p,d);break;case n.FILL_TRIANGLE:c.batchFillTriangle(f[++C],f[++C],f[++C],f[++C],f[++C],f[++C],p,d);break;case n.STROKE_TRIANGLE:c.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),T.push(M));break;case n.MOVE_TO:M=new h(f[++C],f[++C],g),T.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){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,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){var n=i(1),r=i(1);n=i(1069),r=i(1070),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){var n=i(1),r=i(1);n=i(1072),r=i(1073),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<r;a++){var h=n[a];if(h.willRender(i)){var l,u,c,d;if(void 0!==h.alphaTopLeft)l=h.alphaTopLeft,u=h.alphaTopRight,c=h.alphaBottomLeft,d=h.alphaBottomRight;else{var p=h.alpha;l=p,u=p,c=p,d=p}s||h.blendMode===t.currentBlendMode||t.setBlendMode(h.blendMode);var f=h.mask;f&&f.preRenderWebGL(t,h,i);var m=h.type;m!==t.currentType&&(t.newType=!0,t.currentType=m),t.nextTypeMatch=a<r-1&&n[a+1].type===t.currentType,h.setAlpha(l*o,u*o,c*o,d*o),h.renderWebGL(t,h,i),h.setAlpha(l,u,c,d),f&&f.postRenderWebGL(t,i),t.newType=!1}}t.pipelines.postBatch(e)}}},function(t,e){t.exports=function(t,e,i){var n=e.list;if(0!==n.length){e.depthSort();var r=-1!==e.blendMode;r||t.setBlendMode(0);var s=e._alpha;e.mask&&e.mask.preRenderCanvas(t,null,i);for(var o=0;o<n.length;o++){var a=n[o];if(a.willRender(i)){var h=a.alpha;r||a.blendMode===t.currentBlendMode||t.setBlendMode(a.blendMode),a.setAlpha(h*s),a.renderCanvas(t,a,i),a.setAlpha(h)}}e.mask&&e.mask.postRenderCanvas(t)}}},function(t,e,i){t.exports={EmitterOp:i(449),GravityWell:i(450),Particle:i(451),ParticleEmitter:i(452),ParticleEmitterManager:i(220),Zones:i(1078)}},function(t,e,i){var n=i(1),r=i(1);n=i(1076),r=i(1077),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){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,u=l.length;if(0!==u){var c=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=c.setGameObject(e,e.defaultFrame);t.pipelines.preBatch(e);for(var w=0;w<u;w++){var b=l[w],A=b.alive,T=A.length;if(b.visible&&0!==T){i.addToRenderList(b);var S=b.scrollFactorX,E=b.scrollFactorY;t.setBlendMode(b.blendMode),b.mask&&(b.mask.preRenderWebGL(t,b,i),t.pipelines.set(e.pipeline));for(var M=0;M<T;M++){var _=A[M],C=_.alpha*i.alpha;if(!(C<=0)){f.applyITRS(_.x,_.y,_.rotation,_.scaleX,_.scaleY),d.copyFrom(i.matrix),d.multiplyWithOffset(m,-i.scrollX*S,-i.scrollY*E),f.e=_.x,f.f=_.y,d.multiply(f,p);var P=_.frame,R=-P.halfWidth,L=-P.halfHeight,O=R+P.width,D=L+P.height,B=p.getXRound(R,L,g),I=p.getYRound(R,L,g),F=p.getXRound(R,D,g),k=p.getYRound(R,D,g),N=p.getXRound(O,D,g),z=p.getYRound(O,D,g),U=p.getXRound(O,L,g),V=p.getYRound(O,L,g),H=y(_.tint,C);c.batchQuad(b,B,I,F,k,N,z,U,V,P.u0,P.v0,P.u1,P.v1,H,H,H,H,0,v,x)}}b.mask&&b.mask.postRenderWebGL(t,i)}}t.pipelines.postBatch(e)}}},function(t,e,i){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 u=r.copyFrom(i.matrix),c=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<l;g++){var v=h[g],y=v.alive,x=y.length;if(v.visible&&0!==x){i.addToRenderList(v);var w=v.scrollFactorX,b=v.scrollFactorY;f.save(),f.globalCompositeOperation=t.blendModes[v.blendMode];for(var A=0;A<x;A++){var T=y[A],S=T.alpha*i.alpha;if(!(S<=0)){d.applyITRS(T.x,T.y,T.rotation,T.scaleX,T.scaleY),u.copyFrom(i.matrix),u.multiplyWithOffset(p,-i.scrollX*w,-i.scrollY*b),d.e=T.x,d.f=T.y,u.multiply(d,c);var E=T.frame,M=E.canvasData,_=-E.halfWidth,C=-E.halfHeight;f.globalAlpha=S,f.save(),c.setToContext(f),m&&(_=Math.round(_),C=Math.round(C)),f.imageSmoothingEnabled=!(!t.antialias||E.source.scaleMode),f.drawImage(E.source.image,M.x,M.y,M.width,M.height,_,C,M.width,M.height),f.restore()}}f.restore()}}}}},function(t,e,i){t.exports={DeathZone:i(453),EdgeZone:i(454),RandomZone:i(456)}},function(t,e,i){var n=i(1),r=i(1);n=i(1080),r=i(1081),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){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,u=t.pipelines.set(e.pipeline),c=u.setTexture2D(o.texture);t.pipelines.preBatch(e),u.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,c),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){var n=i(1083),r=i(17),s={Parse:i(1084)};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){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),u=l.cutX,c=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 w=f,b=m,A={retroFont:!0,font:h,size:i,lineHeight:r+y,chars:{}},T=0,S=0;S<a.length;S++){var E=a.charCodeAt(S),M=(u+w)/d,_=(c+b)/p,C=(u+w+i)/d,P=(c+b+r)/p;A.chars[E]={x:w,y:b,width:i,height:r,centerX:s,centerY:o,xOffset:0,yOffset:0,xAdvance:i,data:{},kerning:{},u0:M,v0:_,u1:C,v1:P},++T===x?(T=0,w=f,b+=r+v):w+=i+g}return{data:A,frame:null,texture:h}}}},function(t,e,i){var n=i(1),r=i(1);n=i(1086),r=i(1087),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){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,u=e.colors,c=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,w=o.vertexCount*o.currentShader.vertexComponentCount-1,b=0,A=e.tintFill;e.dirty&&e.updateVertices();for(var T=e.debugCallback,S=[],E=0;E<m;E+=2){var M=h[E+0],_=h[E+1],C=M*a.a+_*a.c+a.e,P=M*a.b+_*a.d+a.f;f&&(C=Math.round(C),P=Math.round(P)),y[++w]=C,y[++w]=P,y[++w]=l[E+0],y[++w]=l[E+1],y[++w]=v,y[++w]=A,x[++w]=p(u[b],i.alpha*(c[b]*d)),b++,T&&(S[E+0]=C,S[E+1]=P)}T&&T.call(e,e,m,S),o.vertexCount+=g,t.pipelines.postBatch(e)}},function(t,e){t.exports=function(){}},function(t,e,i){var n=i(1),r=i(1);n=i(1089),r=i(1090),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){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),u=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,u),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){var n=i(1),r=i(1);n=i(1092),r=i(1093),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){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){var n=i(1),r=i(1);n=i(1095),r=i(1096),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){var n=i(1),r=i(1);n=i(1098),r=i(1099),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){var n=i(19),r=i(114),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),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&r(a,l,e,d,u,c),e.isStroked&&s(a,e,d,u,c),t.pipelines.postBatch(e)}},function(t,e,i){var n=i(36),r=i(48),s=i(60),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){var n=i(1),r=i(1);n=i(1101),r=i(1102),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){var n=i(114),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),u=e._displayOriginX+e._curveBounds.x,c=e._displayOriginY+e._curveBounds.y,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&n(a,l,e,d,u,c),e.isStroked&&s(a,e,d,u,c),t.pipelines.postBatch(e)}},function(t,e,i){var n=i(48),r=i(60),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,u=e.pathData,c=u.length-1,d=u[0]-h,p=u[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(c-=2);for(var f=2;f<c;f+=2){var m=u[f]-h,g=u[f+1]-l;a.lineTo(m,g)}e.closePath&&a.closePath(),e.isFilled&&(n(a,e),a.fill()),e.isStroked&&(r(a,e),a.stroke()),a.restore()}}},function(t,e,i){var n=i(1),r=i(1);n=i(1104),r=i(1105),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){var n=i(114),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),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&n(a,l,e,d,u,c),e.isStroked&&s(a,e,d,u,c),t.pipelines.postBatch(e)}},function(t,e,i){var n=i(48),r=i(60),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,u=e.pathData,c=u.length-1,d=u[0]-h,p=u[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(c-=2);for(var f=2;f<c;f+=2){var m=u[f]-h,g=u[f+1]-l;a.lineTo(m,g)}a.closePath(),e.isFilled&&(n(a,e),a.fill()),e.isStroked&&(r(a,e),a.stroke()),a.restore()}}},function(t,e,i){var n=i(1),r=i(1);n=i(1107),r=i(1108),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){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,u=i.alpha*e.alpha,c=e.width,d=e.height,p=e.cellWidth,f=e.cellHeight,m=Math.ceil(c/p),g=Math.ceil(d/f),v=p,y=f,x=p-(m*p-c),w=f-(g*f-d),b=e.showCells,A=e.showAltCells,T=e.showOutline,S=0,E=0,M=0,_=0,C=0;if(T&&(v--,y--,x===p&&x--,w===f&&w--),t.pipelines.preBatch(e),b&&e.fillAlpha>0)for(h=o.fillTint,l=r.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*u),h.TL=l,h.TR=l,h.BL=l,h.BR=l,E=0;E<g;E++)for(A&&(M=E%2),S=0;S<m;S++)A&&M?M=0:(M++,_=S<m-1?v:x,C=E<g-1?y:w,o.batchFillRect(S*p,E*f,_,C));if(A&&e.altFillAlpha>0)for(h=o.fillTint,l=r.getTintAppendFloatAlpha(e.altFillColor,e.altFillAlpha*u),h.TL=l,h.TR=l,h.BL=l,h.BR=l,E=0;E<g;E++)for(A&&(M=E%2),S=0;S<m;S++)!A||M?(M=0,_=S<m-1?v:x,C=E<g-1?y:w,o.batchFillRect(S*p,E*f,_,C)):M=1;if(T&&e.outlineFillAlpha>0){var P=o.strokeTint,R=r.getTintAppendFloatAlpha(e.outlineFillColor,e.outlineFillAlpha*u);for(P.TL=R,P.TR=R,P.BL=R,P.BR=R,S=1;S<m;S++){var L=S*p;o.batchLine(L,0,L,d,1,1,1,0,!1)}for(E=1;E<g;E++){var O=E*f;o.batchLine(0,O,c,O,1,1,1,0,!1)}}t.pipelines.postBatch(e)}},function(t,e,i){var n=i(48),r=i(60),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,u=i.alpha*e.alpha,c=e.width,d=e.height,p=e.cellWidth,f=e.cellHeight,m=Math.ceil(c/p),g=Math.ceil(d/f),v=p,y=f,x=p-(m*p-c),w=f-(g*f-d),b=e.showCells,A=e.showAltCells,T=e.showOutline,S=0,E=0,M=0,_=0,C=0;if(T&&(v--,y--,x===p&&x--,w===f&&w--),b&&e.fillAlpha>0)for(n(a,e),E=0;E<g;E++)for(A&&(M=E%2),S=0;S<m;S++)A&&M?M=0:(M++,_=S<m-1?v:x,C=E<g-1?y:w,a.fillRect(h+S*p,l+E*f,_,C));if(A&&e.altFillAlpha>0)for(n(a,e,e.altFillColor,e.altFillAlpha*u),E=0;E<g;E++)for(A&&(M=E%2),S=0;S<m;S++)!A||M?(M=0,_=S<m-1?v:x,C=E<g-1?y:w,a.fillRect(h+S*p,l+E*f,_,C)):M=1;if(T&&e.outlineFillAlpha>0){for(r(a,e,e.outlineFillColor,e.outlineFillAlpha*u),S=1;S<m;S++){var P=S*p;a.beginPath(),a.moveTo(P+h,l),a.lineTo(P+h,d+l),a.stroke()}for(E=1;E<g;E++){var R=E*f;a.beginPath(),a.moveTo(h,R+l),a.lineTo(h+c,R+l),a.stroke()}}a.restore()}}},function(t,e,i){var n=i(1),r=i(1);n=i(1110),r=i(1111),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){var n=i(19),r=i(12);t.exports=function(t,e,i,s){i.addToRenderList(e);var o,a,h,l,u,c,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,w=y/2,b=y/e.projection,A=i.alpha*e.alpha;e.isFilled&&(t.pipelines.preBatch(e),e.showTop&&(o=r.getTintAppendFloatAlpha(e.fillTop,A),a=v.getX(-w,-x),h=v.getY(-w,-x),l=v.getX(0,-b-x),u=v.getY(0,-b-x),c=v.getX(w,-x),d=v.getY(w,-x),p=v.getX(0,b-x),f=v.getY(0,b-x),m.batchQuad(e,a,h,l,u,c,d,p,f,0,0,1,1,o,o,o,o,2)),e.showLeft&&(o=r.getTintAppendFloatAlpha(e.fillLeft,A),a=v.getX(-w,0),h=v.getY(-w,0),l=v.getX(0,b),u=v.getY(0,b),c=v.getX(0,b-x),d=v.getY(0,b-x),p=v.getX(-w,-x),f=v.getY(-w,-x),m.batchQuad(e,a,h,l,u,c,d,p,f,0,0,1,1,o,o,o,o,2)),e.showRight&&(o=r.getTintAppendFloatAlpha(e.fillRight,A),a=v.getX(w,0),h=v.getY(w,0),l=v.getX(0,b),u=v.getY(0,b),c=v.getX(0,b-x),d=v.getY(0,b-x),p=v.getX(w,-x),f=v.getY(w,-x),m.batchQuad(e,a,h,l,u,c,d,p,f,0,0,1,1,o,o,o,o,2)),t.pipelines.postBatch(e))}},function(t,e,i){var n=i(48),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,u=a/e.projection;e.showTop&&(n(o,e,e.fillTop),o.beginPath(),o.moveTo(-l,-h),o.lineTo(0,-u-h),o.lineTo(l,-h),o.lineTo(l,-1),o.lineTo(0,u-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,u),o.lineTo(0,u-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,u),o.lineTo(0,u-h),o.lineTo(l,-h),o.lineTo(l,0),o.fill()),o.restore()}}},function(t,e,i){var n=i(1),r=i(1);n=i(1113),r=i(1114),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){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,u=e.height,c=l/2,d=l/e.projection,p=e.isReversed,f=i.alpha*e.alpha;if(e.isFilled){var m,g,v,y,x,w,b;if(t.pipelines.preBatch(e),e.showTop&&p){m=r.getTintAppendFloatAlpha(e.fillTop,f),g=h.getX(-c,-u),v=h.getY(-c,-u),y=h.getX(0,-d-u),x=h.getY(0,-d-u),w=h.getX(c,-u),b=h.getY(c,-u);var A=h.getX(0,d-u),T=h.getY(0,d-u);o.batchQuad(e,g,v,y,x,w,b,A,T,0,0,1,1,m,m,m,m,2)}e.showLeft&&(m=r.getTintAppendFloatAlpha(e.fillLeft,f),p?(g=h.getX(-c,-u),v=h.getY(-c,-u),y=h.getX(0,d),x=h.getY(0,d),w=h.getX(0,d-u),b=h.getY(0,d-u)):(g=h.getX(-c,0),v=h.getY(-c,0),y=h.getX(0,d),x=h.getY(0,d),w=h.getX(0,d-u),b=h.getY(0,d-u)),o.batchTri(e,g,v,y,x,w,b,0,0,1,1,m,m,m,2)),e.showRight&&(m=r.getTintAppendFloatAlpha(e.fillRight,f),p?(g=h.getX(c,-u),v=h.getY(c,-u),y=h.getX(0,d),x=h.getY(0,d),w=h.getX(0,d-u),b=h.getY(0,d-u)):(g=h.getX(c,0),v=h.getY(c,0),y=h.getX(0,d),x=h.getY(0,d),w=h.getX(0,d-u),b=h.getY(0,d-u)),o.batchTri(e,g,v,y,x,w,b,0,0,1,1,m,m,m,2)),t.pipelines.postBatch(e)}}},function(t,e,i){var n=i(48),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,u=a/e.projection,c=e.isReversed;e.showTop&&c&&(n(o,e,e.fillTop),o.beginPath(),o.moveTo(-l,-h),o.lineTo(0,-u-h),o.lineTo(l,-h),o.lineTo(0,u-h),o.fill()),e.showLeft&&(n(o,e,e.fillLeft),o.beginPath(),c?(o.moveTo(-l,-h),o.lineTo(0,u),o.lineTo(0,u-h)):(o.moveTo(-l,0),o.lineTo(0,u),o.lineTo(0,u-h)),o.fill()),e.showRight&&(n(o,e,e.fillRight),o.beginPath(),c?(o.moveTo(l,-h),o.lineTo(0,u),o.lineTo(0,u-h)):(o.moveTo(l,0),o.lineTo(0,u),o.lineTo(0,u-h)),o.fill()),o.restore()}}},function(t,e,i){var n=i(1),r=i(1);n=i(1116),r=i(1117),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){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,u=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isStroked){var c=o.strokeTint,d=r.getTintAppendFloatAlpha(e.strokeColor,e.strokeAlpha*u);c.TL=d,c.TR=d,c.BL=d,c.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){var n=i(60),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){var n=i(1),r=i(1);n=i(1119),r=i(1120),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){var n=i(114),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),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&n(a,l,e,d,u,c),e.isStroked&&s(a,e,d,u,c),t.pipelines.postBatch(e)}},function(t,e,i){var n=i(48),r=i(60),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,u=e.pathData,c=u.length-1,d=u[0]-h,p=u[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(c-=2);for(var f=2;f<c;f+=2){var m=u[f]-h,g=u[f+1]-l;a.lineTo(m,g)}a.closePath(),e.isFilled&&(n(a,e),a.fill()),e.isStroked&&(r(a,e),a.stroke()),a.restore()}}},function(t,e,i){var n=i(1),r=i(1);n=i(1122),r=i(1123),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){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,u=e._displayOriginY,c=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=a.fillTint,p=s.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);d.TL=p,d.TR=p,d.BL=p,d.BR=p,a.batchFillRect(-l,-u,e.width,e.height)}e.isStroked&&r(a,e,c,l,u),t.pipelines.postBatch(e)}},function(t,e,i){var n=i(48),r=i(60),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){var n=i(1),r=i(1);n=i(1125),r=i(1126),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){var n=i(114),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),u=e._displayOriginX,c=e._displayOriginY,d=i.alpha*e.alpha;t.pipelines.preBatch(e),e.isFilled&&n(a,l,e,d,u,c),e.isStroked&&s(a,e,d,u,c),t.pipelines.postBatch(e)}},function(t,e,i){var n=i(48),r=i(60),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,u=e.pathData,c=u.length-1,d=u[0]-h,p=u[1]-l;a.beginPath(),a.moveTo(d,p),e.closePath||(c-=2);for(var f=2;f<c;f+=2){var m=u[f]-h,g=u[f+1]-l;a.lineTo(m,g)}a.closePath(),e.isFilled&&(n(a,e),a.fill()),e.isStroked&&(r(a,e),a.stroke()),a.restore()}}},function(t,e,i){var n=i(1),r=i(1);n=i(1128),r=i(1129),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){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,u=e._displayOriginY,c=i.alpha*e.alpha;if(t.pipelines.preBatch(e),e.isFilled){var d=a.fillTint,p=s.getTintAppendFloatAlpha(e.fillColor,e.fillAlpha*c);d.TL=p,d.TR=p,d.BL=p,d.BR=p;var f=e.geom.x1-l,m=e.geom.y1-u,g=e.geom.x2-l,v=e.geom.y2-u,y=e.geom.x3-l,x=e.geom.y3-u;a.batchFillTriangle(f,m,g,v,y,x,h.sprite,h.camera)}e.isStroked&&r(a,e,c,l,u),t.pipelines.postBatch(e)}},function(t,e,i){var n=i(48),r=i(60),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,u=e.geom.x1-h,c=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(u,c),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){var n=i(213);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){var n=i(214);i(5).register("container",(function(t,e,i){return this.displayList.add(new n(this.scene,t,e,i))}))},function(t,e,i){var n=i(442);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){var n=i(215);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){var n=i(444);i(5).register("extern",(function(){var t=new n(this.scene);return this.displayList.add(t),t}))},function(t,e,i){var n=i(216);i(5).register("graphics",(function(t){return this.displayList.add(new n(this.scene,t))}))},function(t,e,i){var n=i(113);i(5).register("group",(function(t,e){return this.updateList.add(new n(this.scene,t,e))}))},function(t,e,i){var n=i(125);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){var n=i(219);i(5).register("layer",(function(t){return this.displayList.add(new n(this.scene,t))}))},function(t,e,i){var n=i(5),r=i(220);n.register("particles",(function(t,e,i){return this.displayList.add(new r(this.scene,t,e,i))}))},function(t,e,i){var n=i(5),r=i(457);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){var n=i(5),r=i(221);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){var n=i(223);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){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){var n=i(148);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){var n=i(224);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){var n=i(225);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){var n=i(129);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){var n=i(226);i(5).register("video",(function(t,e,i){return this.displayList.add(new n(this.scene,t,e,i))}))},function(t,e,i){var n=i(461),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){var n=i(5),r=i(462);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){var n=i(463);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){var n=i(5),r=i(464);n.register("grid",(function(t,e,i,n,s,o,a,h,l,u){return this.displayList.add(new r(this.scene,t,e,i,n,s,o,a,h,l,u))}))},function(t,e,i){var n=i(5),r=i(465);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){var n=i(5),r=i(466);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){var n=i(5),r=i(467);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){var n=i(5),r=i(468);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){var n=i(5),r=i(473);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){var n=i(474);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){var n=i(5),r=i(475);n.register("triangle",(function(t,e,i,n,s,o,a,h,l,u){return this.displayList.add(new r(this.scene,t,e,i,n,s,o,a,h,l,u))}))},function(t,e,i){var n=i(213),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){var n=i(28),r=i(214),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){var n=i(215),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){var n=i(16),r=i(216);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){var n=i(16),r=i(113);n.register("group",(function(t){return new r(this.scene,null,t)}))},function(t,e,i){var n=i(28),r=i(16),s=i(13),o=i(125);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){var n=i(28),r=i(219),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){var n=i(16),r=i(13),s=i(2),o=i(220);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){var n=i(28),r=i(16),s=i(13),o=i(221);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),u=s(t,"frame",void 0),c=new o(this.scene,i,r,a,h,l,u);return void 0!==e&&(t.add=e),n(this.scene,c,t),c}))},function(t,e,i){var n=i(28),r=i(16),s=i(13),o=i(6),a=i(223);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),u=o(t,"colors",void 0),c=o(t,"alphas",void 0),d=new a(this.scene,0,0,i,r,l,h,u,c);return void 0!==e&&(t.add=e),n(this.scene,d,t),t.add||this.updateList.add(d),d}))},function(t,e,i){var n=i(28),r=i(439),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){var n=i(148),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),u=new n(this.scene,0,0,i,s,h,l);return void 0!==e&&(t.add=e),r(this.scene,u,t),u}))},function(t,e,i){var n=i(28),r=i(16),s=i(13),o=i(224);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){var n=i(28),r=i(16),s=i(13),o=i(225);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",""),u=s(t,"frame",""),c=new o(this.scene,i,r,a,h,l,u);return void 0!==e&&(t.add=e),n(this.scene,c,t),c}))},function(t,e,i){var n=i(16),r=i(13),s=i(129);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){var n=i(28),r=i(16),s=i(13),o=i(226);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){var n=i(1),r=i(1);n=i(1177),r=i(1178),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){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){var n=i(1),r=i(1);n=i(1180),r=i(1181),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){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),u=a.vertexViewF32,c=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,w=h.e,b=h.f,A=e.viewPosition.z,T=e.hideCCW,S=i.roundPixels,E=i.alpha*e.alpha,M=0;t.pipelines.preBatch(e);for(var _=0;_<o;_++){var C=s[_];C.isInView(i,T,A,E,g,v,y,x,w,b,S)&&(a.shouldFlush(3)&&(a.flush(),d=0),d=C.load(u,c,d,l,p),M++,a.vertexCount+=3,m&&f.push(C))}e.totalFrame+=M,m&&m.call(e,e,f),t.pipelines.postBatch(e)}}},function(t,e){t.exports=function(){}},function(t,e,i){var n=i(1),r=i(1);n=i(1183),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){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,u=-e._radius,c=l+a,d=u+h,p=o.getX(0,0),f=o.getY(0,0),m=o.getX(l,u),g=o.getY(l,u),v=o.getX(l,d),y=o.getY(l,d),x=o.getX(c,d),w=o.getY(c,d),b=o.getX(c,u),A=o.getY(c,u);t.pipelines.preBatch(e),s.batchPointLight(e,i,m,g,v,y,x,w,b,A,p,f),t.pipelines.postBatch(e)}},function(t,e,i){var n=i(229);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){var n=i(230);i(5).register("mesh",(function(t,e,i,r,s,o,a,h,l,u,c){return this.displayList.add(new n(this.scene,t,e,i,r,s,o,a,h,l,u,c))}))},function(t,e,i){var n=i(5),r=i(150);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){var n=i(28),r=i(16),s=i(13),o=i(229);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),u=new o(this.scene,i,r,a,h,l);return void 0!==e&&(t.add=e),n(this.scene,u,t),u}))},function(t,e,i){var n=i(28),r=i(16),s=i(13),o=i(6),a=i(230);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",[]),u=o(t,"indicies",[]),c=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,u,c,d,p,f);return void 0!==e&&(t.add=e),n(this.scene,m,t),m}))},function(t,e,i){var n=i(28),r=i(16),s=i(13),o=i(150);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){var n=i(0),r=i(482),s=i(24),o=i(20),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){var n=i(65);n.Area=i(1192),n.Circumference=i(302),n.CircumferencePoint=i(169),n.Clone=i(1193),n.Contains=i(66),n.ContainsPoint=i(1194),n.ContainsRect=i(1195),n.CopyFrom=i(1196),n.Equals=i(1197),n.GetBounds=i(1198),n.GetPoint=i(300),n.GetPoints=i(301),n.Offset=i(1199),n.OffsetPoint=i(1200),n.Random=i(170),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){var n=i(65);t.exports=function(t){return new n(t.x,t.y,t.radius)}},function(t,e,i){var n=i(66);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(66);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){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){var n=i(111);n.Area=i(1202),n.Circumference=i(447),n.CircumferencePoint=i(218),n.Clone=i(1203),n.Contains=i(112),n.ContainsPoint=i(1204),n.ContainsRect=i(1205),n.CopyFrom=i(1206),n.Equals=i(1207),n.GetBounds=i(1208),n.GetPoint=i(445),n.GetPoints=i(446),n.Offset=i(1209),n.OffsetPoint=i(1210),n.Random=i(180),t.exports=n},function(t,e){t.exports=function(t){return t.isEmpty()?0:t.getMajorRadius()*t.getMinorRadius()*Math.PI}},function(t,e,i){var n=i(111);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e,i){var n=i(112);t.exports=function(t,e){return n(t,e.x,e.y)}},function(t,e,i){var n=i(112);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){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){var n=i(4),r=i(231);t.exports=function(t,e,i){if(void 0===i&&(i=[]),r(t,e)){var s,o,a,h,l=t.x,u=t.y,c=t.radius,d=e.x,p=e.y,f=e.radius;if(u===p)0==(a=(o=-2*p)*o-4*(s=1)*(d*d+(h=(f*f-c*c-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)/(u-p),g=(f*f-c*c-d*d+l*l-p*p+u*u)/(2*(u-p));0==(a=(o=2*u*m-2*g*m-2*l)*o-4*(s=m*m+1)*(l*l+u*u+g*g-c*c-2*u*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){var n=i(232),r=i(151);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){var n=i(140),r=i(487),s=new(i(47));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 u=r(s,o);u&&a.push(new n(u.x,u.y,t,u.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<i.length;s++)for(var h=i[s].points,l=0;l<h.length;l++){var u=Math.atan2(h[l].y-e,h[l].x-t);-1===r.indexOf(u)&&(o(u,t,e,i,n),o(u-1e-5,t,e,i,n),o(u+1e-5,t,e,i,n),r.push(u))}return n.sort(a)}},function(t,e,i){var n=i(10),r=i(152);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){var n=i(234),r=i(152);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){var n=i(489),r=i(234);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){var n=i(232),r=i(491);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){var n=i(494),r=i(492);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){var n=i(496);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||i<t.left-s||n>t.bottom+s||r<t.top-s)}},function(t,e,i){var n=i(47);n.Angle=i(97),n.BresenhamPoints=i(317),n.CenterOn=i(1222),n.Clone=i(1223),n.CopyFrom=i(1224),n.Equals=i(1225),n.Extend=i(1226),n.GetEasedPoints=i(1227),n.GetMidPoint=i(1228),n.GetNearestPoint=i(1229),n.GetNormal=i(1230),n.GetPoint=i(307),n.GetPoints=i(172),n.GetShortestDistance=i(1231),n.Height=i(1232),n.Length=i(67),n.NormalAngle=i(497),n.NormalX=i(1233),n.NormalY=i(1234),n.Offset=i(1235),n.PerpSlope=i(1236),n.Random=i(173),n.ReflectAngle=i(1237),n.Rotate=i(1238),n.RotateAroundPoint=i(1239),n.RotateAroundXY=i(236),n.SetToAngle=i(1240),n.Slope=i(1241),n.Width=i(1242),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){var n=i(47);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){var n=i(67);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){var n=i(352),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,u=[],c=t.x1,d=t.y1,p=t.x2-c,f=t.y2-d,m=r(e,a),g=i-1;for(h=0;h<g;h++)l=m(h/g),u.push(new s(c+p*l,d+f*l));if(l=m(1),u.push(new s(c+p*l,d+f*l)),o>0){var v=u[0],y=[v];for(h=1;h<u.length-1;h++){var x=u[h];n(v,x)>=o&&(y.push(x),v=x)}var w=u[u.length-1];return n(v,w)<o&&y.pop(),y.push(w),y}return u}},function(t,e,i){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){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){var n=i(14),r=i(97),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){var n=i(14),r=i(97);t.exports=function(t){return Math.cos(r(t)-n.TAU)}},function(t,e,i){var n=i(14),r=i(97);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){var n=i(97),r=i(497);t.exports=function(t,e){return 2*r(e)-Math.PI-n(t)}},function(t,e,i){var n=i(236);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){var n=i(236);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){var n={Face:i(116),GenerateGridVerts:i(1244),GenerateObjVerts:i(480),GenerateVerts:i(479),ParseObj:i(498),ParseObjMaterial:i(499),RotateFace:i(1245),Vertex:i(117)};t.exports=n},function(t,e,i){var n=i(116),r=i(2),s=i(69),o=i(39),a=i(117),h=new o,l=new o,u=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),c=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),w=r(t,"zIsUp",!0),b=r(t,"isOrtho",!!e&&e.dirtyCache[11]),A=r(t,"colors",[16777215]),T=r(t,"alphas",[1]),S=r(t,"tile",!1),E=r(t,"flipY",!1),M=r(t,"width",null),_={faces:[],verts:[]};if(h.set(f,m,g),l.set(v,y,x),u.fromRotationXYTranslation(l,h,w),!i&&e)i=e.texture;else{if(!e||"string"!=typeof i)return _;i=e.scene.sys.textures.get(i)}var C=i.get(s);!M&&b&&i&&e&&(o=C.width/e.height,c=C.height/e.height);var P,R,L=o/2,O=c/2,D=Math.floor(d),B=Math.floor(p),I=D+1,F=B+1,k=o/D,N=c/B,z=[],U=[],V=0,H=1,G=0,W=1;C&&(V=C.u0,H=C.u1,E?(G=C.v1,W=C.v0):(G=C.v0,W=C.v1));var Y=H-V,X=W-G;for(R=0;R<F;R++){var j=R*N-O;for(P=0;P<I;P++){var q=P*k-L;U.push(q,-j);var Q=V+Y*(P/D),K=G+X*(R/B);z.push(Q,K)}}Array.isArray(A)||(A=[A]),Array.isArray(T)||(T=[T]);var J=0,Z=0;for(R=0;R<B;R++)for(P=0;P<D;P++){var $=2*(P+I*R),tt=2*(P+I*(R+1)),et=2*(P+1+I*(R+1)),it=2*(P+1+I*R),nt=A[Z],rt=T[J],st=new a(U[$],U[$+1],0,z[$],z[$+1],nt,rt).transformMat4(u),ot=new a(U[tt],U[tt+1],0,z[tt],z[tt+1],nt,rt).transformMat4(u),at=new a(U[it],U[it+1],0,z[it],z[it+1],nt,rt).transformMat4(u),ht=new a(U[tt],U[tt+1],0,z[tt],z[tt+1],nt,rt).transformMat4(u),lt=new a(U[et],U[et+1],0,z[et],z[et+1],nt,rt).transformMat4(u),ut=new a(U[it],U[it+1],0,z[it],z[it+1],nt,rt).transformMat4(u);S&&(st.setUVs(V,W),ot.setUVs(V,G),at.setUVs(H,W),ht.setUVs(V,G),lt.setUVs(H,G),ut.setUVs(H,W)),++Z===A.length&&(Z=0),++J===T.length&&(J=0),_.verts.push(st,ot,at,ht,lt,ut),_.faces.push(new n(st,ot,at),new n(ht,lt,ut))}return e&&(e.faces=e.faces.concat(_.faces),e.vertices=e.vertices.concat(_.verts)),_}},function(t,e){t.exports=function(t,e,i,n){var r,s;if(void 0===i&&void 0===n){var o=t.getInCenter();r=o.x,s=o.y}var a=Math.cos(e),h=Math.sin(e),l=t.vertex1,u=t.vertex2,c=t.vertex3,d=l.x-r,p=l.y-s;l.set(d*a-p*h+r,d*h+p*a+s),d=u.x-r,p=u.y-s,u.set(d*a-p*h+r,d*h+p*a+s),d=c.x-r,p=c.y-s,c.set(d*a-p*h+r,d*h+p*a+s)}},function(t,e,i){var n=i(4);n.Ceil=i(1247),n.Clone=i(1248),n.CopyFrom=i(1249),n.Equals=i(1250),n.Floor=i(1251),n.GetCentroid=i(1252),n.GetMagnitude=i(500),n.GetMagnitudeSq=i(501),n.GetRectangleFromPoints=i(1253),n.Interpolate=i(1254),n.Invert=i(1255),n.Negative=i(1256),n.Project=i(1257),n.ProjectUnit=i(1258),n.SetMagnitude=i(1259),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){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){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<i;r++)e.x+=t[r].x,e.y+=t[r].y;e.x/=i,e.y/=i}return e}},function(t,e,i){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;a<t.length;a++){var h=t[a];h.x>i&&(i=h.x),h.x<r&&(r=h.x),h.y>s&&(s=h.y),h.y<o&&(o=h.y)}return e.x=r,e.y=o,e.width=i-r,e.height=s-o,e}},function(t,e,i){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){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){var n=i(4),r=i(501);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){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){var n=i(500);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){var n=i(227);n.Clone=i(1261),n.Contains=i(228),n.ContainsPoint=i(1262),n.Earcut=i(59),n.GetAABB=i(469),n.GetNumberArray=i(1263),n.GetPoints=i(470),n.Perimeter=i(471),n.Reverse=i(1264),n.Simplify=i(1265),n.Smooth=i(472),n.Translate=i(1266),t.exports=n},function(t,e,i){var n=i(227);t.exports=function(t){return new n(t.points)}},function(t,e,i){var n=i(228);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;i<t.points.length;i++)e.push(t.points[i].x),e.push(t.points[i].y);return e}},function(t,e){t.exports=function(t){return t.points.reverse(),t}},function(t,e){function i(t,e,i){var n=e.x,r=e.y,s=i.x-n,o=i.y-r;if(0!==s||0!==o){var a=((t.x-n)*s+(t.y-r)*o)/(s*s+o*o);a>1?(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;l<r;l++){var u=i(e[l],e[n],e[r]);u>h&&(a=l,h=u)}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,u=t.length;l<u;l++)i=t[l],r=a,s=void 0,o=void 0,s=(n=i).x-r.x,o=n.y-r.y,s*s+o*o>e&&(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<n.length;r++)n[r].x+=e,n[r].y+=i;return t}},function(t,e){t.exports=function(t){return t.width*t.height}},function(t,e){t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t}},function(t,e){t.exports=function(t){return t.x=Math.ceil(t.x),t.y=Math.ceil(t.y),t.width=Math.ceil(t.width),t.height=Math.ceil(t.height),t}},function(t,e,i){var n=i(10);t.exports=function(t){return new n(t.x,t.y,t.width,t.height)}},function(t,e,i){var n=i(57);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){var n=i(237);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,i){var n=i(237);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){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){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){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){var n=i(190);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){var n=i(10),r=i(152);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;o<e.length;o++)i=Math.min(i,e[o].x),n=Math.max(n,e[o].x),r=Math.min(r,e[o].y),s=Math.max(s,e[o].y);return t.x=i,t.y=r,t.width=n-i,t.height=s-r,t}},function(t,e){t.exports=function(t,e){var i=Math.min(t.x,e.x),n=Math.max(t.right,e.right);t.x=i,t.width=n-i;var r=Math.min(t.y,e.y),s=Math.max(t.bottom,e.bottom);return t.y=r,t.height=s-r,t}},function(t,e){t.exports=function(t,e,i){var n=Math.min(t.x,e),r=Math.max(t.right,e);t.x=n,t.width=r-n;var s=Math.min(t.y,i),o=Math.max(t.bottom,i);return t.y=s,t.height=o-s,t}},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){t.exports=function(t,e){return t.x<e.right&&t.right>e.x&&t.y<e.bottom&&t.bottom>e.y}},function(t,e,i){var n=i(4),r=i(36);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)<Math.abs(h*o)?h=a*s/o:a=h*o/s,i.x=a+t.centerX,i.y=h+t.centerY,i}},function(t,e,i){var n=i(195),r=i(503),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){var n=i(82);n.Area=i(1294),n.BuildEquilateral=i(1295),n.BuildFromPolygon=i(1296),n.BuildRight=i(1297),n.CenterOn=i(1298),n.Centroid=i(504),n.CircumCenter=i(1299),n.CircumCircle=i(1300),n.Clone=i(1301),n.Contains=i(115),n.ContainsArray=i(235),n.ContainsPoint=i(1302),n.CopyFrom=i(1303),n.Decompose=i(495),n.Equals=i(1304),n.GetPoint=i(476),n.GetPoints=i(477),n.InCenter=i(506),n.Perimeter=i(1305),n.Offset=i(505),n.Random=i(181),n.Rotate=i(1306),n.RotateAroundPoint=i(1307),n.RotateAroundXY=i(238),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){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){var n=i(59),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,u,c,d,p,f,m,g=n(t,e),v=0;v<g.length;v+=3)a=g[v],h=g[v+1],l=g[v+2],u=t[2*a]*i,c=t[2*a+1]*s,d=t[2*h]*i,p=t[2*h+1]*s,f=t[2*l]*i,m=t[2*l+1]*s,o.push(new r(u,c,d,p,f,m));return o}},function(t,e,i){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){var n=i(504),r=i(505);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){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,u=2*r(o,a,h,l),c=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-c/u,e.y=s+d/u,e}},function(t,e,i){var n=i(65);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,u=t.y3,c=a-s,d=h-o,p=l-s,f=u-o,m=c*(s+a)+d*(o+h),g=p*(s+l)+f*(o+u),v=2*(c*(u-h)-d*(l-a));if(Math.abs(v)<1e-6){var y=Math.min(s,a,l),x=Math.min(o,h,u);i=.5*(Math.max(s,a,l)-y),r=.5*(Math.max(o,h,u)-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=(c*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){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){var n=i(115);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){var n=i(67);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){var n=i(238),r=i(506);t.exports=function(t,e){var i=r(t);return n(t,i.x,i.y,e)}},function(t,e,i){var n=i(238);t.exports=function(t,e,i){return n(t,e.x,e.y,i)}},function(t,e,i){var n=i(203),r=i(17),s={CreatePixelPerfectHandler:i(507),CreateInteractiveObject:i(508),Events:i(51),Gamepad:i(1309),InputManager:i(409),InputPlugin:i(1321),InputPluginCache:i(153),Keyboard:i(1322),Mouse:i(1336),Pointer:i(412),Touch:i(1337)};s=r(!1,s,n),t.exports=s},function(t,e,i){t.exports={Axis:i(509),Button:i(510),Events:i(239),Gamepad:i(511),GamepadPlugin:i(1316),Configs:i(1317)}},function(t,e){t.exports="down"},function(t,e){t.exports="up"},function(t,e){t.exports="connected"},function(t,e){t.exports="disconnected"},function(t,e){t.exports="down"},function(t,e){t.exports="up"},function(t,e,i){var n=i(0),r=i(9),s=i(239),o=i(511),a=i(6),h=i(153),l=i(51),u=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<this.gamepads.length;t++)this.gamepads[t].removeAllListeners()},disconnectAll:function(){for(var t=0;t<this.gamepads.length;t++)this.gamepads[t].pad.connected=!1},refreshPads:function(){var t=navigator.getGamepads();if(t)for(var e=this.gamepads,i=0;i<t.length;i++){var n=t[i];if(n){var r=n.id,s=n.index,a=e[s];if(a)a.id!==r?(a.destroy(),e[s]=new o(this,n)):a.update(n);else{var h=new o(this,n);e[s]=h,this._pad1?this._pad2?this._pad3?this._pad4||(this._pad4=h):this._pad3=h:this._pad2=h:this._pad1=h}}}else this.disconnectAll()},getAll:function(){for(var t=[],e=this.gamepads,i=0;i<e.length;i++)e[i]&&t.push(e[i]);return t},getPad:function(t){for(var e=this.gamepads,i=0;i<e.length;i++)if(e[i]&&e[i].index===t)return e[i]},update:function(){if(this.enabled){this.refreshPads();var t=this.queue.length;if(0!==t)for(var e=this.queue.splice(0,t),i=0;i<t;i++){var n=e[i],r=this.getPad(n.gamepad.index);"gamepadconnected"===n.type?this.emit(s.CONNECTED,r,n):"gamepaddisconnected"===n.type&&this.emit(s.DISCONNECTED,r,n)}}},shutdown:function(){this.stopListeners(),this.removeAllListeners()},destroy:function(){this.shutdown();for(var t=0;t<this.gamepads.length;t++)this.gamepads[t]&&this.gamepads[t].destroy();this.gamepads=[],this.scene=null,this.settings=null,this.sceneInputPlugin=null,this.target=null},total:{get:function(){return this.gamepads.length}},pad1:{get:function(){return this._pad1}},pad2:{get:function(){return this._pad2}},pad3:{get:function(){return this._pad3}},pad4:{get:function(){return this._pad4}}});h.register("GamepadPlugin",u,"gamepad","gamepad","inputGamepad"),t.exports=u},function(t,e,i){t.exports={DUALSHOCK_4:i(1318),SNES_USB:i(1319),XBOX_360:i(1320)}},function(t,e){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){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){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){var n=i(65),r=i(66),s=i(0),o=i(203),a=i(508),h=i(507),l=i(50),u=i(111),c=i(112),d=i(51),p=i(9),f=i(2),m=i(56),g=i(153),v=i(7),y=i(24),x=i(10),w=i(57),b=i(20),A=i(82),T=i(115),S=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(b.BOOT,this.boot,this),t.sys.events.on(b.START,this.start,this)},boot:function(){this.cameras=this.systems.cameras,this.displayList=this.systems.displayList,this.systems.events.once(b.DESTROY,this.destroy,this),this.pluginEvents.emit(d.BOOT)},start:function(){var t=this.systems.events;t.on(b.TRANSITION_START,this.transitionIn,this),t.on(b.TRANSITION_OUT,this.transitionOut,this),t.on(b.TRANSITION_COMPLETE,this.transitionComplete,this),t.on(b.PRE_UPDATE,this.preUpdate,this),t.once(b.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<i;s++){var o=t[s],a=r.indexOf(o);a>-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;i<s;i++)r[i].updateMotion();if(0===this._list.length)return!1;var o=this.pollRate;if(-1===o)return!1;if(o>0){if(this._pollTimer-=e,!(this._pollTimer<0))return!1;this._pollTimer=this.pollRate}var a=!1;for(i=0;i<s;i++){var h=0,l=r[i];this._tempZones=[],this._temp=this.hitTestPointer(l),this.sortGameObjects(this._temp,l),this.sortDropZones(this._tempZones),this.topOnly&&(this._temp.length&&this._temp.splice(1),this._tempZones.length&&this._tempZones.splice(1)),h+=this.processOverOutEvents(l),2===this.getDragState(l)&&this.processDragThresholdEvent(l,t),h>0&&(a=!0)}return a},update:function(t,e){if(!this.isActive())return!1;for(var i=e.length,n=!1,r=0;r<i;r++){var s=0,a=e[r];switch(this._tempZones=[],this._temp=this.hitTestPointer(a),this.sortGameObjects(this._temp,a),this.sortDropZones(this._tempZones),this.topOnly&&(this._temp.length&&this._temp.splice(1),this._tempZones.length&&this._tempZones.splice(1)),t){case o.MOUSE_DOWN:s+=this.processDragDownEvent(a),s+=this.processDownEvents(a),s+=this.processOverOutEvents(a);break;case o.MOUSE_UP:s+=this.processDragUpEvent(a),s+=this.processUpEvents(a),s+=this.processOverOutEvents(a);break;case o.TOUCH_START:s+=this.processDragDownEvent(a),s+=this.processDownEvents(a),s+=this.processOverEvents(a);break;case o.TOUCH_END:case o.TOUCH_CANCEL:s+=this.processDragUpEvent(a),s+=this.processUpEvents(a),s+=this.processOutEvents(a);break;case o.MOUSE_MOVE:case o.TOUCH_MOVE:s+=this.processDragMoveEvent(a),s+=this.processMoveEvents(a),s+=this.processOverOutEvents(a);break;case o.MOUSE_WHEEL:s+=this.processWheelEvent(a)}s>0&&(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;i<e.length;i++){for(var n=e[i],r=this.manager.hitTest(t,this._list,n),s=0;s<r.length;s++){var o=r[s];o.input.dropZone&&this._tempZones.push(o)}if(r.length>0)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;o<i.length;o++){var a=i[o];if(a.input){if(e++,a.emit(d.GAMEOBJECT_POINTER_DOWN,t,a.input.localX,a.input.localY,r),n.cancelled||!a.input){s=!0;break}if(this.emit(d.GAMEOBJECT_DOWN,t,a,r),n.cancelled||!a.input){s=!0;break}}}return!s&&this.manager&&(t.downElement===this.manager.game.canvas?this.emit(d.POINTER_DOWN,t,i):this.emit(d.POINTER_DOWN_OUTSIDE,t)),e},getDragState:function(t){return this._dragState[t.id]},setDragState:function(t,e){this._dragState[t.id]=e},processDragThresholdEvent:function(t,e){var i=!1,n=this.dragTimeThreshold,r=this.dragDistanceThreshold;if((r>0&&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;i<e.length;i++){var n=e[i],r=n.input;r.dragState=2,r.dragStartX=n.x,r.dragStartY=n.y,r.dragStartXGlobal=t.worldX,r.dragStartYGlobal=t.worldY,r.dragX=r.dragStartXGlobal-r.dragStartX,r.dragY=r.dragStartYGlobal-r.dragStartY,n.emit(d.GAMEOBJECT_DRAG_START,t,r.dragX,r.dragY),this.emit(d.DRAG_START,t,n)}return this.setDragState(t,4),e.length},processDragDownEvent:function(t){var e=this._temp;if(0===this._draggable.length||0===e.length||!t.primaryDown||0!==this.getDragState(t))return 0;this.setDragState(t,1);for(var i=[],n=0;n<e.length;n++){var r=e[n];r.input.draggable&&0===r.input.dragState&&i.push(r)}return 0===i.length?(this.setDragState(t,0),0):(i.length>1&&(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;n<i.length;n++){var r,s,o=i[n],a=o.input,h=a.target;if(h){var l=e.indexOf(h);0===l?(o.emit(d.GAMEOBJECT_DRAG_OVER,t,h),this.emit(d.DRAG_OVER,t,o,h)):l>0?(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 u=t.worldX-a.dragStartXGlobal,c=t.worldY-a.dragStartYGlobal,p=o.getParentRotation(),f=u*Math.cos(p)+c*Math.sin(p),m=c*Math.cos(p)-u*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;i<e.length;i++){var n=e[i],r=n.input;if(r&&2===r.dragState){r.dragState=0,r.dragX=r.localX-n.displayOriginX,r.dragY=r.localY-n.displayOriginY;var s=!1,o=r.target;o&&(n.emit(d.GAMEOBJECT_DROP,t,o),this.emit(d.DROP,t,n,o),r.target=null,s=!0),n.input&&(n.emit(d.GAMEOBJECT_DRAG_END,t,r.dragX,r.dragY,s),this.emit(d.DRAG_END,t,n,s))}}return this.setDragState(t,0),e.splice(0),0},processMoveEvents:function(t){var e=0,i=this._temp,n=this._eventData,r=this._eventContainer;n.cancelled=!1;for(var s=!1,o=0;o<i.length;o++){var a=i[o];if(a.input){if(e++,a.emit(d.GAMEOBJECT_POINTER_MOVE,t,a.input.localX,a.input.localY,r),n.cancelled||!a.input){s=!0;break}if(this.emit(d.GAMEOBJECT_MOVE,t,a,r),n.cancelled||!a.input){s=!0;break}if(this.topOnly)break}}return s||this.emit(d.POINTER_MOVE,t,i),e},processWheelEvent:function(t){var e=0,i=this._temp,n=this._eventData,r=this._eventContainer;n.cancelled=!1;for(var s=!1,o=t.deltaX,a=t.deltaY,h=t.deltaZ,l=0;l<i.length;l++){var u=i[l];if(u.input){if(e++,u.emit(d.GAMEOBJECT_POINTER_WHEEL,t,o,a,h,r),n.cancelled||!u.input){s=!0;break}if(this.emit(d.GAMEOBJECT_WHEEL,t,u,o,a,h,r),n.cancelled||!u.input){s=!0;break}}}return s||this.emit(d.POINTER_WHEEL,t,i,o,a,h),e},processOverEvents:function(t){var e=this._temp,i=0,n=e.length,r=[];if(n>0){var s=this.manager,o=this._eventData,a=this._eventContainer;o.cancelled=!1;for(var h=!1,l=0;l<n;l++){var u=e[l];if(u.input){if(r.push(u),s.setCursor(u.input),u.emit(d.GAMEOBJECT_POINTER_OVER,t,u.input.localX,u.input.localY,a),i++,o.cancelled||!u.input){h=!0;break}if(this.emit(d.GAMEOBJECT_OVER,t,u,a),o.cancelled||!u.input){h=!0;break}}}h||this.emit(d.POINTER_OVER,t,r)}return this._over[t.id]=r,i},processOutEvents:function(t){var e=this._over[t.id],i=0,n=e.length;if(n>0){var r=this.manager,s=this._eventData,o=this._eventContainer;s.cancelled=!1;var a=!1;this.sortGameObjects(e,t);for(var h=0;h<n;h++){var l=e[h];if((l=e[h]).input){if(r.resetCursor(l.input),l.emit(d.GAMEOBJECT_POINTER_OUT,t,o),i++,s.cancelled||!l.input){a=!0;break}if(this.emit(d.GAMEOBJECT_OUT,t,l,o),s.cancelled||!l.input){a=!0;break}a||this.emit(d.POINTER_OUT,t,e)}}this._over[t.id]=[]}return i},processOverOutEvents:function(t){var e,i,n=this._temp,r=[],s=[],o=[],a=this._over[t.id],h=this._drag[t.id],l=this.manager;for(e=0;e<a.length;e++)i=a[e],-1===n.indexOf(i)&&-1===h.indexOf(i)?r.push(i):o.push(i);for(e=0;e<n.length;e++)i=n[e],-1===a.indexOf(i)&&s.push(i);var u=r.length,c=0,p=this._eventData,f=this._eventContainer;p.cancelled=!1;var m=!1;if(u>0){for(this.sortGameObjects(r,t),e=0;e<u;e++)if((i=r[e]).input){if(l.resetCursor(i.input),i.emit(d.GAMEOBJECT_POINTER_OUT,t,f),c++,p.cancelled||!i.input){m=!0;break}if(this.emit(d.GAMEOBJECT_OUT,t,i,f),p.cancelled||!i.input){m=!0;break}}m||this.emit(d.POINTER_OUT,t,r)}if(u=s.length,p.cancelled=!1,m=!1,u>0){for(this.sortGameObjects(s,t),e=0;e<u;e++)if((i=s[e]).input){if(l.setCursor(i.input),i.emit(d.GAMEOBJECT_POINTER_OVER,t,i.input.localX,i.input.localY,f),c++,p.cancelled||!i.input){m=!0;break}if(this.emit(d.GAMEOBJECT_OVER,t,i,f),p.cancelled||!i.input){m=!0;break}}m||this.emit(d.POINTER_OVER,t,s)}return a=o.concat(s),this._over[t.id]=this.sortGameObjects(a,t),c},processUpEvents:function(t){var e=this._temp,i=this._eventData,n=this._eventContainer;i.cancelled=!1;for(var r=!1,s=0;s<e.length;s++){var o=e[s];if(o.input){if(o.emit(d.GAMEOBJECT_POINTER_UP,t,o.input.localX,o.input.localY,n),i.cancelled||!o.input){r=!0;break}if(this.emit(d.GAMEOBJECT_UP,t,o,n),i.cancelled||!o.input){r=!0;break}}}return!r&&this.manager&&(t.upElement===this.manager.game.canvas?this.emit(d.POINTER_UP,t,e):this.emit(d.POINTER_UP_OUTSIDE,t)),e.length},queueForInsertion:function(t){return-1===this._pendingInsertion.indexOf(t)&&-1===this._list.indexOf(t)&&this._pendingInsertion.push(t),this},queueForRemoval:function(t){return this._pendingRemoval.push(t),this},setDraggable:function(t,e){void 0===e&&(e=!0),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i];n.input.draggable=e;var r=this._draggable.indexOf(n);e&&-1===r?this._draggable.push(n):!e&&r>-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 u=e;e=f(u,"hitArea",null),i=f(u,"hitAreaCallback",null),n=f(u,"draggable",!1),r=f(u,"dropZone",!1),s=f(u,"cursor",!1),o=f(u,"useHandCursor",!1),h=f(u,"pixelPerfect",!1);var c=f(u,"alphaTolerance",1);h&&(e={},i=this.makePixelPerfect(c)),e&&i||(this.setHitAreaFromTexture(t),l=!1)}else"function"!=typeof e||i||(i=e,e={});for(var d=0;d<t.length;d++){var p=t[d];if(!h||"Container"!==p.type){var m=p.input?p.input:a(p,e,i);m.customHitArea=l,m.dropZone=r,m.cursor=o?"pointer":s,p.input=m,n&&this.setDraggable(p),this.queueForInsertion(p)}}return this},setHitAreaCircle:function(t,e,i,s,o){void 0===o&&(o=r);var a=new n(e,i,s);return this.setHitArea(t,a,o)},setHitAreaEllipse:function(t,e,i,n,r,s){void 0===s&&(s=c);var o=new u(e,i,n,r);return this.setHitArea(t,o,s)},setHitAreaFromTexture:function(t,e){void 0===e&&(e=w),Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i],r=n.frame,s=0,o=0;n.width?(s=n.width,o=n.height):r&&(s=r.realWidth,o=r.realHeight),("Container"!==n.type||0!==s&&0!==o)&&0!==s&&0!==o&&(n.input=a(n,new x(0,0,s,o),e),this.queueForInsertion(n))}return this},setHitAreaRectangle:function(t,e,i,n,r,s){void 0===s&&(s=w);var o=new x(e,i,n,r);return this.setHitArea(t,o,s)},setHitAreaTriangle:function(t,e,i,n,r,s,o,a){void 0===a&&(a=T);var h=new A(e,i,n,r,s,o);return this.setHitArea(t,h,a)},enableDebug:function(t,e){void 0===e&&(e=65280);var i=t.input;if(!i||!i.hitArea)return this;var n=i.hitArea,r=n.type,s=i.hitAreaDebug,o=this.systems.add,a=this.systems.updateList;s&&(a.remove(s),s.destroy(),s=null);var h=0,l=0;switch(r){case m.CIRCLE:s=o.arc(0,0,n.radius),h=n.x-n.radius,l=n.y-n.radius;break;case m.ELLIPSE:s=o.ellipse(0,0,n.width,n.height),h=n.x-n.width/2,l=n.y-n.height/2;break;case m.LINE:s=o.line(0,0,n.x1,n.y1,n.x2,n.y2);break;case m.POLYGON:s=o.polygon(0,0,n.points);break;case m.RECTANGLE:s=o.rectangle(0,0,n.width,n.height),h=n.x,l=n.y;break;case m.TRIANGLE:s=o.triangle(0,0,n.x1,n.y1,n.x2,n.y2,n.x3,n.y3)}return s&&(s.isFilled=!1,s.preUpdate=function(){s.setStrokeStyle(1/t.scale,e),s.setDisplayOrigin(t.displayOriginX,t.displayOriginY);var i=t.x,n=t.y,r=t.rotation,o=t.scaleX,a=t.scaleY;if(t.parentContainer){var u=t.getWorldTransformMatrix();i=u.tx,n=u.ty,r=u.rotation,o=u.scaleX,a=u.scaleY}s.setRotation(r),s.setScale(o,a),s.setPosition(i+h,n+l),s.setScrollFactor(t.scrollFactorX,t.scrollFactorY),s.setDepth(t.depth)},a.add(s),i.hitAreaDebug=s),this},removeDebug:function(t){var e=t.input;if(e&&e.hitAreaDebug){var i=e.hitAreaDebug;this.systems.updateList.remove(i),i.destroy(),e.hitAreaDebug=null}return this},setPollAlways:function(){return this.setPollRate(0)},setPollOnMove:function(){return this.setPollRate(-1)},setPollRate:function(t){return this.pollRate=t,this._pollTimer=0,this},setGlobalTopOnly:function(t){return this.manager.globalTopOnly=t,this},setTopOnly:function(t){return this.topOnly=t,this},sortGameObjects:function(t,e){if(t.length<2)return t;var i=e.camera.renderList;return t.sort((function(t,e){return i.indexOf(e)-i.indexOf(t)}))},sortDropZones:function(t){return t.length<2?t:(this.scene.sys.depthSort(),t.sort(this.sortDropZoneHandler.bind(this)))},sortDropZoneHandler:function(t,e){if(t.parentContainer||e.parentContainer){if(t.parentContainer===e.parentContainer)return e.parentContainer.getIndex(e)-t.parentContainer.getIndex(t);if(t.parentContainer===e)return-1;if(e.parentContainer===t)return 1;for(var i=t.getIndexList(),n=e.getIndexList(),r=Math.min(i.length,n.length),s=0;s<r;s++){var o=i[s],a=n[s];if(o!==a)return a-o}return n.length-i.length}return this.displayList.getIndex(e)-this.displayList.getIndex(t)},stopPropagation:function(){return this.manager._tempSkip=!0,this},addPointer:function(t){return this.manager.addPointer(t)},setDefaultCursor:function(t){return this.manager.setDefaultCursor(t),this},transitionIn:function(){this.enabled=this.settings.transitionAllowInput},transitionComplete:function(){this.settings.transitionAllowInput||(this.enabled=!0)},transitionOut:function(){this.enabled=this.settings.transitionAllowInput},shutdown:function(){this.pluginEvents.emit(d.SHUTDOWN),this._temp.length=0,this._list.length=0,this._draggable.length=0,this._pendingRemoval.length=0,this._pendingInsertion.length=0,this._dragState.length=0;for(var t=0;t<10;t++)this._drag[t]=[],this._over[t]=[];this.removeAllListeners();var e=this.manager;e.canvas.style.cursor=e.defaultCursor;var i=this.systems.events;i.off(b.TRANSITION_START,this.transitionIn,this),i.off(b.TRANSITION_OUT,this.transitionOut,this),i.off(b.TRANSITION_COMPLETE,this.transitionComplete,this),i.off(b.PRE_UPDATE,this.preUpdate,this),e.events.off(d.GAME_OUT,this.onGameOut,this),e.events.off(d.GAME_OVER,this.onGameOver,this),i.off(b.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.pluginEvents.emit(d.DESTROY),this.pluginEvents.removeAllListeners(),this.scene.sys.events.off(b.START,this.start,this),this.scene=null,this.cameras=null,this.manager=null,this.events=null,this.mouse=null},x:{get:function(){return this.manager.activePointer.x}},y:{get:function(){return this.manager.activePointer.y}},isOver:{get:function(){return this.manager.isOver}},mousePointer:{get:function(){return this.manager.mousePointer}},activePointer:{get:function(){return this.manager.activePointer}},pointer1:{get:function(){return this.manager.pointers[1]}},pointer2:{get:function(){return this.manager.pointers[2]}},pointer3:{get:function(){return this.manager.pointers[3]}},pointer4:{get:function(){return this.manager.pointers[4]}},pointer5:{get:function(){return this.manager.pointers[5]}},pointer6:{get:function(){return this.manager.pointers[6]}},pointer7:{get:function(){return this.manager.pointers[7]}},pointer8:{get:function(){return this.manager.pointers[8]}},pointer9:{get:function(){return this.manager.pointers[9]}},pointer10:{get:function(){return this.manager.pointers[10]}}});y.register("InputPlugin",S,"input"),t.exports=S},function(t,e,i){t.exports={Events:i(154),KeyboardManager:i(410),KeyboardPlugin:i(1330),Key:i(512),KeyCodes:i(143),KeyCombo:i(513),AdvanceKeyCombo:i(515),ProcessKeyCombo:i(514),ResetKeyCombo:i(516),JustDown:i(1332),JustUp:i(1333),DownDuration:i(1334),UpDuration:i(1335)}},function(t,e){t.exports="keydown"},function(t,e){t.exports="keyup"},function(t,e){t.exports="keycombomatch"},function(t,e){t.exports="down"},function(t,e){t.exports="keydown-"},function(t,e){t.exports="keyup-"},function(t,e){t.exports="up"},function(t,e,i){var n=i(0),r=i(9),s=i(154),o=i(22),a=i(6),h=i(51),l=i(153),u=i(512),c=i(143),d=i(513),p=i(1331),f=i(20),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:c.UP,down:c.DOWN,left:c.LEFT,right:c.RIGHT,space:c.SPACE,shift:c.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<t.length;r++){var s=t[r].trim();s&&(n[s]=this.addKey(s,e,i))}}else for(var o in t)n[o]=this.addKey(t[o],e,i);return n},addKey:function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var n=this.keys;if(t instanceof u){var r=n.indexOf(t);return r>-1?n[r]=t:n[t.keyCode]=t,e&&this.addCapture(t.keyCode),t.setEmitOnRepeat(i),t}return"string"==typeof t&&(t=c[t.toUpperCase()]),n[t]||(n[t]=new u(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 u){var r=n.indexOf(t);r>-1&&(i=this.keys[r],this.keys[r]=void 0)}else"string"==typeof t&&(t=c[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;i<e.length;i++){var n=e[i];n&&(e[i]=void 0,t&&n.destroy())}return this},createCombo:function(t,e){return new d(this,t,e)},checkDown:function(t,e){if(void 0===e&&(e=0),this.enabled&&t.isDown){var i=m(this.time-t.timeDown,e);if(i>t._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<e;n++){var r=t[n],o=r.keyCode,a=i[o],h=!1;void 0===r.cancelled&&(r.cancelled=0,r.stopImmediatePropagation=function(){r.cancelled=1},r.stopPropagation=function(){r.cancelled=-1}),-1!==r.cancelled&&(o===this.prevCode&&r.timeStamp===this.prevTime&&r.type===this.prevType||(this.prevCode=o,this.prevTime=r.timeStamp,this.prevType=r.type,"keydown"===r.type?(a&&(h=a.isDown,a.onDown(r)),r.cancelled||a&&h||(p[o]&&this.emit(s.KEY_DOWN+p[o],r),r.cancelled||this.emit(s.ANY_KEY_DOWN,r))):(a&&a.onUp(r),r.cancelled||(p[o]&&this.emit(s.KEY_UP+p[o],r),r.cancelled||this.emit(s.ANY_KEY_UP,r))),1===r.cancelled&&(r.cancelled=0)))}},resetKeys:function(){for(var t=this.keys,e=0;e<t.length;e++)t[e]&&t[e].reset();return this},shutdown:function(){this.removeAllKeys(!0),this.removeAllListeners(),this.sceneInputPlugin.manager.events.off(h.MANAGER_PROCESS,this.update,this),this.game.events.off(o.BLUR,this.resetKeys),this.scene.sys.events.off(f.PAUSE,this.resetKeys,this),this.scene.sys.events.off(f.SLEEP,this.resetKeys,this),this.queue=[]},destroy:function(){this.shutdown();for(var t=this.keys,e=0;e<t.length;e++)t[e]&&t[e].destroy();this.keys=[],this.combos=[],this.queue=[],this.scene=null,this.settings=null,this.sceneInputPlugin=null,this.manager=null},time:{get:function(){return this.sceneInputPlugin.manager.time}}});l.register("KeyboardPlugin",g,"keyboard","keyboard","inputKeyboard"),t.exports=g},function(t,e,i){var n=i(143),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<e}},function(t,e){t.exports=function(t,e){void 0===e&&(e=50);var i=t.plugin.game.loop.time-t.timeUp;return t.isUp&&i<e}},function(t,e,i){t.exports={MouseManager:i(411)}},function(t,e,i){t.exports={TouchManager:i(413)}},function(t,e,i){var n=i(21),r=i(17),s={Events:i(95),FileTypes:i(1339),File:i(23),FileTypesManager:i(8),GetURL:i(155),LoaderPlugin:i(1365),MergeXHRSettings:i(240),MultiFile:i(49),XHRLoader:i(517),XHRSettings:i(156)};s=r(!1,s,n),t.exports=s},function(t,e,i){t.exports={AnimationJSONFile:i(1340),AsepriteFile:i(1341),AtlasJSONFile:i(1342),AtlasXMLFile:i(1343),AudioFile:i(518),AudioSpriteFile:i(1344),BinaryFile:i(1345),BitmapFontFile:i(1346),CSSFile:i(1347),GLSLFile:i(1348),HTML5AudioFile:i(519),HTMLFile:i(1349),HTMLTextureFile:i(1350),ImageFile:i(71),JSONFile:i(61),MultiAtlasFile:i(1351),MultiScriptFile:i(1352),OBJFile:i(1353),PackFile:i(1354),PluginFile:i(1355),SceneFile:i(1356),ScenePluginFile:i(1357),ScriptFile:i(520),SpriteSheetFile:i(1358),SVGFile:i(1359),TextFile:i(242),TilemapCSVFile:i(1360),TilemapImpactFile:i(1361),TilemapJSONFile:i(1362),UnityAtlasFile:i(1363),VideoFile:i(1364),XMLFile:i(241)}},function(t,e,i){var n=i(0),r=i(8),s=i(61),o=i(95),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<t.length;r++)this.addFile(new a(this,t[r]));else this.addFile(new a(this,t,e,n,i));return this})),t.exports=a},function(t,e,i){var n=i(0),r=i(8),s=i(2),o=i(71),a=i(7),h=i(61),l=i(49),u=new n({Extends:l,initialize:function(t,e,i,n,r,u){var c,d;if(a(e)){var p=e;e=s(p,"key"),c=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 c=new o(t,e,i,r),d=new h(t,e,n,u);c.linkFile?l.call(this,t,"atlasjson",e,[c,d,c.linkFile]):l.call(this,t,"atlasjson",e,[c,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<t.length;o++)s=new u(this,t[o]),this.addFile(s.files);else s=new u(this,t,e,i,n,r),this.addFile(s.files);return this})),t.exports=u},function(t,e,i){var n=i(0),r=i(8),s=i(2),o=i(71),a=i(7),h=i(61),l=i(49),u=new n({Extends:l,initialize:function(t,e,i,n,r,u){var c,d;if(a(e)){var p=e;e=s(p,"key"),c=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 c=new o(t,e,i,r),d=new h(t,e,n,u);c.linkFile?l.call(this,t,"atlasjson",e,[c,d,c.linkFile]):l.call(this,t,"atlasjson",e,[c,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<t.length;o++)s=new u(this,t[o]),this.addFile(s.files);else s=new u(this,t,e,i,n,r),this.addFile(s.files);return this})),t.exports=u},function(t,e,i){var n=i(0),r=i(8),s=i(2),o=i(71),a=i(7),h=i(49),l=i(241),u=new n({Extends:h,initialize:function(t,e,i,n,r,u){var c,d;if(a(e)){var p=e;e=s(p,"key"),c=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 c=new o(t,e,i,r),d=new l(t,e,n,u);c.linkFile?h.call(this,t,"atlasxml",e,[c,d,c.linkFile]):h.call(this,t,"atlasxml",e,[c,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<t.length;o++)s=new u(this,t[o]),this.addFile(s.files);else s=new u(this,t,e,i,n,r),this.addFile(s.files);return this})),t.exports=u},function(t,e,i){var n=i(518),r=i(0),s=i(8),o=i(2),a=i(7),h=i(61),l=i(49),u=new r({Extends:l,initialize:function(t,e,i,r,s,u,c){if(a(e)){var d=e;e=o(d,"key"),i=o(d,"jsonURL"),r=o(d,"audioURL"),s=o(d,"audioConfig"),u=o(d,"audioXhrSettings"),c=o(d,"jsonXhrSettings")}var p;if(r){var f=n.create(t,e,r,s,u);f&&(p=new h(t,e,i,c),l.call(this,t,"audiosprite",e,[f,p]),this.config.resourceLoad=!1)}else p=new h(t,e,i,c),l.call(this,t,"audiosprite",e,[p]),this.config.resourceLoad=!0,this.config.audioConfig=s,this.config.audioXhrSettings=u},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 c=0;c<t.length;c++)(o=new u(this,t[c])).files&&this.addFile(o.files);else(o=new u(this,t,e,i,n,r,s)).files&&this.addFile(o.files);return this}))},function(t,e,i){var n=i(0),r=i(21),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 u={type:"binary",cache:t.cacheManager.binary,extension:o,responseType:"arraybuffer",key:e,url:i,xhrSettings:n,config:{dataType:r}};s.call(this,t,u)},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<t.length;r++)this.addFile(new l(this,t[r]));else this.addFile(new l(this,t,e,n,i));return this})),t.exports=l},function(t,e,i){var n=i(0),r=i(8),s=i(2),o=i(71),a=i(7),h=i(49),l=i(212),u=i(241),c=new n({Extends:h,initialize:function(t,e,i,n,r,l){var c,d;if(a(e)){var p=e;e=s(p,"key"),c=new o(t,{key:e,url:s(p,"textureURL"),extension:s(p,"textureExtension","png"),normalMap:s(p,"normalMap"),xhrSettings:s(p,"textureXhrSettings")}),d=new u(t,{key:e,url:s(p,"fontDataURL"),extension:s(p,"fontDataExtension","xml"),xhrSettings:s(p,"fontDataXhrSettings")})}else c=new o(t,e,i,r),d=new u(t,e,n,l);c.linkFile?h.call(this,t,"bitmapfont",e,[c,d,c.linkFile]):h.call(this,t,"bitmapfont",e,[c,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<t.length;o++)s=new c(this,t[o]),this.addFile(s.files);else s=new c(this,t,e,i,n,r),this.addFile(s.files);return this})),t.exports=c},function(t,e,i){var n=i(0),r=i(21),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<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,i));return this})),t.exports=l},function(t,e,i){var n=i(0),r=i(21),s=i(23),o=i(8),a=i(2),h=i(7),l=i(396),u=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 u={type:"glsl",cache:t.cacheManager.shader,extension:o,responseType:"text",key:e,url:i,config:{shaderType:n},xhrSettings:r};s.call(this,t,u)},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<t.length;e++){var i=t[e].trim();if("name:"===i.substring(0,5))return i.substring(5).trim()}return this.key},getShaderType:function(t){for(var e=0;e<t.length;e++){var i=t[e].trim();if("type:"===i.substring(0,5))return i.substring(5).trim()}return this.config.shaderType},getShaderUniforms:function(t){for(var e={},i=0;i<t.length;i++){var n=t[i].trim();if("uniform."===n.substring(0,8)){var r=n.indexOf(":");if(r){var s=n.substring(8,r);try{e[s]=JSON.parse(n.substring(r+1))}catch(t){}}}}return e},extractBlock:function(t,e){for(var i=-1,n=-1,r=-1,s=!1,o=!1,a=[],h=[],l=e;l<t.length;l++){var u=t[l].trim();if("---"===u)if(-1===i)i=l,s=!0;else{if(!s){o=!1;break}n=l,s=!1,o=!0}else s?a.push(u):o&&(h.push(u),r=l)}return s||-1===n?null:{header:a,shader:h.join("\n"),offset:r}}});o.register("glsl",(function(t,e,i,n){if(Array.isArray(t))for(var r=0;r<t.length;r++)this.addFile(new u(this,t[r]));else this.addFile(new u(this,t,e,i,n));return this})),t.exports=u},function(t,e,i){var n=i(0),r=i(21),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<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,i));return this})),t.exports=l},function(t,e,i){var n=i(0),r=i(21),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 u=e;e=a(u,"key"),i=a(u,"url"),o=a(u,"xhrSettings"),l=a(u,"extension",l),n=a(u,"width",n),r=a(u,"height",r)}var c={type:"html",cache:t.textureManager,extension:l,responseType:"text",key:e,url:i,xhrSettings:o,config:{width:n,height:r}};s.call(this,t,c)},onProcess:function(){this.state=r.FILE_PROCESSING;var t=this.config.width,e=this.config.height,i=[];i.push('<svg width="'+t+'px" height="'+e+'px" viewBox="0 0 '+t+" "+e+'" xmlns="http://www.w3.org/2000/svg">'),i.push('<foreignObject width="100%" height="100%">'),i.push('<body xmlns="http://www.w3.org/1999/xhtml">'),i.push(this.xhrLoader.responseText),i.push("</body>"),i.push("</foreignObject>"),i.push("</svg>");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<t.length;s++)this.addFile(new l(this,t[s]));else this.addFile(new l(this,t,e,i,n,r));return this})),t.exports=l},function(t,e,i){var n=i(0),r=i(8),s=i(2),o=i(71),a=i(7),h=i(61),l=i(49),u=new n({Extends:l,initialize:function(t,e,i,n,r,o,u){if(a(e)){var c=e;e=s(c,"key"),i=s(c,"url",!1)?s(c,"url"):s(c,"atlasURL"),o=s(c,"xhrSettings"),n=s(c,"path"),r=s(c,"baseURL"),u=s(c,"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=u},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),u=s(i,"path",this.path),c=s(i,"prefix",this.prefix),d=s(i,"textureXhrSettings");n.setBaseURL(l),n.setPath(u),n.setPrefix(c);for(var p=0;p<e.length;p++){var f=e[p].image,m="MA"+this.multiKeyIndex+"_"+f,g=new o(n,m,f,d);if(this.addToMultiFile(g),n.addFile(g),e[p].normalMap){var v=new o(n,m,e[p].normalMap,d);v.type="normalMap",g.setLink(v),this.addToMultiFile(v),n.addFile(v)}}n.setBaseURL(r),n.setPath(a),n.setPrefix(h)}},addToCache:function(){if(this.isReadyToProcess()){for(var t=this.files[0],e=[],i=[],n=[],r=1;r<this.files.length;r++){var s=this.files[r];if("normalMap"!==s.type)for(var o=s.key.indexOf("_"),a=s.key.substr(o+1),h=s.data,l=0;l<t.data.textures.length;l++){var u=t.data.textures[l];if(u.image===a){i.push(h),e.push(u),s.linkFile&&n.push(s.linkFile.data);break}}}for(0===n.length&&(n=void 0),this.loader.textureManager.addAtlasJSONArray(this.key,i,e,n),this.complete=!0,r=0;r<this.files.length;r++)this.files[r].pendingDestroy()}}});r.register("multiatlas",(function(t,e,i,n,r){var s;if(Array.isArray(t))for(var o=0;o<t.length;o++)s=new u(this,t[o]),this.addFile(s.files);else s=new u(this,t,e,i,n,r),this.addFile(s.files);return this})),t.exports=u},function(t,e,i){var n=i(0),r=i(8),s=i(2),o=i(7),a=i(49),h=i(520),l=new n({Extends:a,initialize:function(t,e,i,n){var r="js",l=[];if(o(e)){var u=e;e=s(u,"key"),i=s(u,"url"),n=s(u,"xhrSettings"),r=s(u,"extension",r)}Array.isArray(i)||(i=[i]);for(var c=0;c<i.length;c++){var d=new h(t,{key:e+"_"+c.toString(),url:i[c],extension:r,xhrSettings:n});d.onProcess=function(){this.onProcessComplete()},l.push(d)}a.call(this,t,"scripts",e,l)},addToCache:function(){if(this.isReadyToProcess()){for(var t=0;t<this.files.length;t++){var e=this.files[t];e.data=document.createElement("script"),e.data.language="javascript",e.data.type="text/javascript",e.data.defer=!1,e.data.text=e.xhrLoader.responseText,document.head.appendChild(e.data)}this.complete=!0}}});r.register("scripts",(function(t,e,i){var n;if(Array.isArray(t))for(var r=0;r<t.length;r++)n=new l(this,t[r]),this.addFile(n.files);else n=new l(this,t,e,i),this.addFile(n.files);return this})),t.exports=l},function(t,e,i){var n=i(0),r=i(8),s=i(2),o=i(7),a=i(49),h=i(498),l=i(499),u=i(242),c=new n({Extends:a,initialize:function(t,e,i,n,r,h){var l,c,d=t.cacheManager.obj;if(o(e)){var p=e;e=s(p,"key"),l=new u(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"))&&(c=new u(t,{key:e,type:"mat",cache:d,url:n,extension:s(p,"matExtension","mat"),xhrSettings:s(p,"xhrSettings")}))}else l=new u(t,{key:e,url:i,type:"obj",cache:d,extension:"obj",xhrSettings:h,config:{flipUV:r}}),n&&(c=new u(t,{key:e,url:n,type:"mat",cache:d,extension:"mat",xhrSettings:h}));a.call(this,t,"obj",e,[l,c])},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<t.length;o++)s=new c(this,t[o]),this.addFile(s.files);else s=new c(this,t,e,i,n,r),this.addFile(s.files);return this})),t.exports=c},function(t,e,i){var n=i(0),r=i(21),s=i(8),o=i(61),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<t.length;r++)this.addFile(new a(this,t[r]));else this.addFile(new a(this,t,e,n,i));return this})),t.exports=a},function(t,e,i){var n=i(0),r=i(21),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 u="js";if(h(e)){var c=e;e=a(c,"key"),i=a(c,"url"),l=a(c,"xhrSettings"),u=a(c,"extension",u),n=a(c,"start"),o=a(c,"mapping")}var d={type:"plugin",cache:!1,extension:u,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<t.length;s++)this.addFile(new l(this,t[s]));else this.addFile(new l(this,t,e,i,n,r));return this})),t.exports=l},function(t,e,i){var n=i(0),r=i(21),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<t.length;n++)this.addFile(new l(this,t[n]));else this.addFile(new l(this,t,e,i));return this})),t.exports=l},function(t,e,i){var n=i(0),r=i(21),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 u="js";if(h(e)){var c=e;e=a(c,"key"),i=a(c,"url"),l=a(c,"xhrSettings"),u=a(c,"extension",u),n=a(c,"systemKey"),o=a(c,"sceneKey")}var d={type:"scenePlugin",cache:!1,extension:u,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<t.length;s++)this.addFile(new l(this,t[s]));else this.addFile(new l(this,t,e,i,n,r));return this})),t.exports=l},function(t,e,i){var n=i(0),r=i(8),s=i(71),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<t.length;r++)this.addFile(new o(this,t[r]));else this.addFile(new o(this,t,e,i,n));return this})),t.exports=o},function(t,e,i){var n=i(0),r=i(21),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 u={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,u)},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")),u=parseFloat(a.getAttribute("height"));if(!h&&l&&u)a.setAttribute("viewBox","0 0 "+l+" "+u);else if(h&&!l&&!u){var c=a.getAttribute("viewBox").split(/\s+|,/);l=c[2],u=c[3]}if(o){if(!l||!u)break t;i=l*o,n=u*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<t.length;r++)this.addFile(new l(this,t[r]));else this.addFile(new l(this,t,e,i,n));return this})),t.exports=l},function(t,e,i){var n=i(0),r=i(21),s=i(23),o=i(8),a=i(2),h=i(7),l=i(40),u=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 u={type:"tilemapCSV",cache:t.cacheManager.tilemap,extension:r,responseType:"text",key:e,url:i,xhrSettings:n};s.call(this,t,u),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<t.length;n++)this.addFile(new u(this,t[n]));else this.addFile(new u(this,t,e,i));return this})),t.exports=u},function(t,e,i){var n=i(0),r=i(8),s=i(61),o=i(40),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<t.length;n++)this.addFile(new a(this,t[n]));else this.addFile(new a(this,t,e,i));return this})),t.exports=a},function(t,e,i){var n=i(0),r=i(8),s=i(61),o=i(40),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<t.length;n++)this.addFile(new a(this,t[n]));else this.addFile(new a(this,t,e,i));return this})),t.exports=a},function(t,e,i){var n=i(0),r=i(8),s=i(2),o=i(71),a=i(7),h=i(49),l=i(242),u=new n({Extends:h,initialize:function(t,e,i,n,r,u){var c,d;if(a(e)){var p=e;e=s(p,"key"),c=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 c=new o(t,e,i,r),d=new l(t,e,n,u);c.linkFile?h.call(this,t,"unityatlas",e,[c,d,c.linkFile]):h.call(this,t,"unityatlas",e,[c,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<t.length;o++)s=new u(this,t[o]),this.addFile(s.files);else s=new u(this,t,e,i,n,r),this.addFile(s.files);return this})),t.exports=u},function(t,e,i){var n=i(0),r=i(21),s=i(23),o=i(8),a=i(155),h=i(2),l=i(7),u=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()}}});u.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"),e=h(e,"key"));var c=u.getVideoURL(a,i);if(c)return new u(t,e,c,n,r,s,o)},u.getVideoURL=function(t,e){Array.isArray(e)||(e=[e]);for(var i=0;i<e.length;i++){var n,r=h(e[i],"url",e[i]);if(0===r.indexOf("blob:"))return{url:r,type:""};if(n=0===r.indexOf("data:")?r.split(",")[0].match(/\/(.*?);/):r.match(/\.([a-zA-Z0-9]+)($|\?)/),n=h(e[i],"type",n?n[1]:"").toLowerCase(),t.device.video[n])return{url:r,type:n}}return null},o.register("video",(function(t,e,i,n,r,s){var o;if(Array.isArray(t))for(var a=0;a<t.length;a++)(o=u.create(this,t[a]))&&this.addFile(o);else(o=u.create(this,t,e,i,n,r,s))&&this.addFile(o);return this})),t.exports=u},function(t,e,i){var n=i(0),r=i(21),s=i(149),o=i(9),a=i(95),h=i(8),l=i(2),u=i(24),c=i(20),d=i(156),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(c.BOOT,this.boot,this),t.sys.events.on(c.START,this.pluginStart,this)},boot:function(){this.systems.events.once(c.DESTROY,this.destroy,this)},pluginStart:function(){this.systems.events.once(c.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;e<t.length;e++){var i=t[e];this.keyExists(i)||(this.list.set(i),this.emit(a.ADD,i.key,i.type,this,i),this.isLoading()&&(this.totalToLoad++,this.updateProgress()))}},keyExists:function(t){var e=t.hasCacheConflict();return e||this.list.iterate((function(i){if(i.type===t.type&&i.key===t.key)return e=!0,!1})),!e&&this.isLoading()&&(this.inflight.iterate((function(i){if(i.type===t.type&&i.key===t.key)return e=!0,!1})),this.queue.iterate((function(i){if(i.type===t.type&&i.key===t.key)return e=!0,!1}))),e},addPack:function(t,e){e&&t.hasOwnProperty(e)&&(t={packKey:t[e]});var i=0,n=this.baseURL,r=this.path,s=this.prefix;for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var a=t[o],h=l(a,"baseURL",n),u=l(a,"path",r),c=l(a,"prefix",s),d=l(a,"files",null),p=l(a,"defaultType","void");if(Array.isArray(d)){this.setBaseURL(h),this.setPath(u),this.setPrefix(c);for(var f=0;f<d.length;f++){var m=d[f],g=m.hasOwnProperty("type")?m.type:p;this[g]&&(this[g](m),i++)}}}return this.setBaseURL(n),this.setPath(r),this.setPrefix(s),i>0},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(c.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<this.maxParallelDownloads&&this.checkLoadQueue()},checkLoadQueue:function(){this.list.each((function(t){if((t.state===r.FILE_POPULATED||t.state===r.FILE_PENDING&&this.inflight.size<this.maxParallelDownloads)&&(this.inflight.set(t),this.list.delete(t),t.crossOrigin||(t.crossOrigin=this.crossOrigin),t.load()),this.inflight.size===this.maxParallelDownloads)return!1}),this)},nextFile:function(t,e){this.inflight&&(this.inflight.delete(t),this.updateProgress(),e?(this.totalComplete++,this.queue.set(t),this.emit(a.FILE_LOAD,t),t.onProcess()):(this.totalFailed++,this._deleteQueue.set(t),this.emit(a.FILE_LOAD_ERROR,t),this.fileProcessComplete(t)))},fileProcessComplete:function(t){this.scene&&this.systems&&this.systems.game&&!this.systems.game.pendingDestroy&&(t.state===r.FILE_ERRORED?t.multiFile&&t.multiFile.onFileFailed(t):t.state===r.FILE_COMPLETE&&(t.multiFile?t.multiFile.isReadyToProcess()&&t.multiFile.addToCache():t.addToCache()),this.queue.delete(t),0===this.list.size&&0===this.inflight.size&&0===this.queue.size&&this.loadComplete())},loadComplete:function(){this.emit(a.POST_PROCESS,this),this.list.clear(),this.inflight.clear(),this.queue.clear(),this.progress=1,this.state=r.LOADER_COMPLETE,this.systems.events.off(c.UPDATE,this.update,this),this._deleteQueue.iterateLocal("destroy"),this._deleteQueue.clear(),this.emit(a.COMPLETE,this,this.totalComplete,this.totalFailed)},flagForRemoval:function(t){this._deleteQueue.set(t)},saveJSON:function(t,e){return this.save(JSON.stringify(t),e)},save:function(t,e,i){void 0===e&&(e="file.json"),void 0===i&&(i="application/json");var n=new Blob([t],{type:i}),r=URL.createObjectURL(n),s=document.createElement("a");return s.download=e,s.textContent="Download "+e,s.href=r,s.click(),this},reset:function(){this.list.clear(),this.inflight.clear(),this.queue.clear();var t=this.systems.game.config,e=this.systems.settings.loader;this.setBaseURL(l(e,"baseURL",t.loaderBaseURL)),this.setPath(l(e,"path",t.loaderPath)),this.setPrefix(l(e,"prefix",t.loaderPrefix)),this.state=r.LOADER_IDLE},shutdown:function(){this.reset(),this.state=r.LOADER_SHUTDOWN,this.systems.events.off(c.UPDATE,this.update,this),this.systems.events.off(c.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.state=r.LOADER_DESTROYED,this.systems.events.off(c.UPDATE,this.update,this),this.systems.events.off(c.START,this.pluginStart,this),this.list=null,this.inflight=null,this.queue=null,this.scene=null,this.systems=null,this.textureManager=null,this.cacheManager=null,this.sceneManager=null}});u.register("Loader",p,"load"),t.exports=p},function(t,e,i){var n=i(62),r=i(17),s={ArcadePhysics:i(1367),Body:i(527),Collider:i(528),Components:i(243),Events:i(245),Factory:i(521),GetOverlapX:i(246),GetOverlapY:i(247),SeparateX:i(537),SeparateY:i(538),Group:i(524),Image:i(522),Sprite:i(157),StaticBody:i(539),StaticGroup:i(525),Tilemap:i(1391),World:i(526)};s=r(!1,s,n),t.exports=s},function(t,e,i){var n=i(0),r=i(36),s=i(50),o=i(353),a=i(521),h=i(2),l=i(127),u=i(523),c=i(244),d=i(24),p=i(20),f=i(3),m=i(526),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;h<a;h++){var l=e[h],u=l.body||l;if(t!==l&&t!==u&&t!==u.gameObject&&t!==u.center){var c=o(r,s,u.center.x,u.center.y);c<i&&(n=l,i=c)}}return n},furthest:function(t,e){e||(e=this.world.bodies.entries);for(var i=-1,n=null,r=t.x,s=t.y,a=e.length,h=0;h<a;h++){var l=e[h],u=l.body||l;if(t!==l&&t!==u&&t!==u.gameObject&&t!==u.center){var c=o(r,s,u.center.x,u.center.y);c>i&&(n=l,i=c)}}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 c(this.world,t,e,i,n,r,s)},overlapCirc:function(t,e,i,n,r){return u(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){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){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){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){t.exports="collide"},function(t,e){t.exports="overlap"},function(t,e){t.exports="pause"},function(t,e){t.exports="resume"},function(t,e){t.exports="tilecollide"},function(t,e){t.exports="tileoverlap"},function(t,e){t.exports="worldbounds"},function(t,e){t.exports="worldstep"},function(t,e){var i,n,r,s,o,a,h,l,u,c,d,p,f,m,g,v,y,x=function(){return c&&g&&n.blocked.right?(i.processX(-y,h,!1,!0),1):u&&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},w=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)):c?(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)):u?(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,u&&v?w(0):p&&g?w(1):c&&g?w(2):!(!f||!v)&&w(3)},Set:function(t,e,o){n=e;var a=(i=t).velocity.x,w=n.velocity.x;return r=i.pushable,u=i._dx<0,c=i._dx>0,d=0===i._dx,g=Math.abs(i.right-n.x)<=Math.abs(n.right-i.x),h=w-a*i.bounce.x,s=n.pushable,p=n._dx<0,f=n._dx>0,m=0===n._dx,v=!g,l=a-w*n.bounce.x,y=Math.abs(o),x()},Run:w,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){var i,n,r,s,o,a,h,l,u,c,d,p,f,m,g,v,y,x=function(){return c&&g&&n.blocked.down?(i.processY(-y,h,!1,!0),1):u&&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},w=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)):c?(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)):u?(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,u&&v?w(0):p&&g?w(1):c&&g?w(2):!(!f||!v)&&w(3)},Set:function(t,e,o){n=e;var a=(i=t).velocity.y,w=n.velocity.y;return r=i.pushable,u=i._dy<0,c=i._dy>0,d=0===i._dy,g=Math.abs(i.bottom-n.y)<=Math.abs(n.bottom-i.y),h=w-a*i.bounce.y,s=n.pushable,p=n._dy<0,f=n._dy>0,m=0===n._dy,v=!g,l=a-w*n.bounce.y,y=Math.abs(o),x()},Run:w,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){var n={ProcessTileCallbacks:i(530),ProcessTileSeparationX:i(534),ProcessTileSeparationY:i(536),SeparateTile:i(532),TileCheckX:i(533),TileCheckY:i(535),TileIntersectsBody:i(248)};t.exports=n},function(t,e,i){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,u=[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],A(l=n*a-o*r,0,i)||(u[0]=(a*s-r*h)/l,u[1]=(n*h-o*s)/l),u}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}t.exports={decomp:function(t){var e=function t(e){for(var i=[],n=[],r=[],s=[],o=Number.MAX_VALUE,a=0;a<e.length;++a)if(m(e,a))for(var h=0;h<e.length;++h)if(y(e,a,h)){n=t(w(e,a,h,s)),r=t(w(e,h,a,s));for(var l=0;l<r.length;l++)n.push(r[l]);n.length<o&&(i=n,o=n.length,i.push([p(e,a),p(e,h)]))}return i}(t);return e.length>0?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;r<i.length;r++)for(var s=i[r],o=0;o<n.length;o++){var a=n[o],h=t(a,s);if(h){n.splice(o,1),n.push(h[0],h[1]);break}}return n}return s=i,r=e.indexOf(s[0]),o=e.indexOf(s[1]),-1!==r&&-1!==o&&[w(e,r,o),w(e,o,r)]}(t,e):[t]},quickDecomp:function t(e,i,n,r,l,u,c){u=u||100,c=c||0,l=l||25,i=void 0!==i?i:[],n=n||[],r=r||[];var g=[0,0],v=[0,0],y=[0,0],w=0,A=0,T=0,S=0,E=0,M=0,_=0,C=[],P=[],R=e,L=e;if(L.length<3)return i;if(++c>u)return i;for(var O=0;O<e.length;++O)if(m(R,O)){n.push(R[O]),w=A=Number.MAX_VALUE;for(var D=0;D<e.length;++D)s(p(R,O-1),p(R,O),p(R,D))&&h(p(R,O-1),p(R,O),p(R,D-1))&&(y=b(p(R,O-1),p(R,O),p(R,D),p(R,D-1)),a(p(R,O+1),p(R,O),y)&&(T=d(R[O],y))<A&&(A=T,v=y,M=D)),s(p(R,O+1),p(R,O),p(R,D+1))&&h(p(R,O+1),p(R,O),p(R,D))&&(y=b(p(R,O+1),p(R,O),p(R,D),p(R,D+1)),s(p(R,O-1),p(R,O),y)&&(T=d(R[O],y))<w&&(w=T,g=y,E=D));if(M===(E+1)%e.length)y[0]=(v[0]+g[0])/2,y[1]=(v[1]+g[1])/2,r.push(y),O<E?(f(C,R,O,E+1),C.push(y),P.push(y),0!==M&&f(P,R,M,R.length),f(P,R,0,O+1)):(0!==O&&f(C,R,O,R.length),f(C,R,0,E+1),C.push(y),P.push(y),f(P,R,M,O+1));else{if(M>E&&(E+=e.length),S=Number.MAX_VALUE,E<M)return i;for(D=M;D<=E;++D)o(p(R,O-1),p(R,O),p(R,D))&&h(p(R,O+1),p(R,O),p(R,D))&&(T=d(p(R,O),p(R,D)))<S&&x(R,O,D)&&(S=T,_=D%e.length);O<_?(f(C,R,O,_+1),0!==_&&f(P,R,_,L.length),f(P,R,0,O+1)):(0!==O&&f(C,R,O,L.length),f(C,R,0,_+1),f(P,R,_,O+1))}return C.length<P.length?(t(C,i,n,r,l,u,c),t(P,i,n,r,l,u,c)):(t(P,i,n,r,l,u,c),t(C,i,n,r,l,u,c)),i}return i.push(e),i},isSimple:function(t){var e,i=t;for(e=0;e<i.length-1;e++)for(var r=0;r<e-1;r++)if(n(i[e],i[e+1],i[r],i[r+1]))return!1;for(e=1;e<i.length-2;e++)if(n(i[0],i[i.length-1],i[e],i[e+1]))return!1;return!0},removeCollinearPoints:function(t,e){for(var i=0,n=t.length-1;t.length>3&&n>=0;--n)c(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)T(n,t[r],e)&&t.splice(i,1)},makeCCW:function(t){for(var e=0,i=t,n=1;n<t.length;++n)(i[n][1]<i[e][1]||i[n][1]===i[e][1]&&i[n][0]>i[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=[],u=[];function c(t,e,i,n){if(n){var s=l,o=u;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]),c=Math.sqrt(o[0]*o[0]+o[1]*o[1]);return Math.acos(a/(h*c))<n}return 0===r(t,e,i)}function d(t,e){var i=e[0]-t[0],n=e[1]-t[1];return i*i+n*n}function p(t,e){var i=t.length;return t[e<0?e%i+i:e%i]}function f(t,e,i,n){for(var r=i;r<n;r++)t.push(e[r])}function m(t,e){return a(p(t,e-1),p(t,e),p(t,e+1))}var g=[],v=[];function y(t,e,n){var r,s,a=g,l=v;if(o(p(t,e+1),p(t,e),p(t,n))&&h(p(t,e-1),p(t,e),p(t,n)))return!1;s=d(p(t,e),p(t,n));for(var u=0;u!==t.length;++u)if((u+1)%t.length!==e&&u!==e&&o(p(t,e),p(t,n),p(t,u+1))&&h(p(t,e),p(t,n),p(t,u))&&(a[0]=p(t,e),a[1]=p(t,n),l[0]=p(t,u),l[1]=p(t,u+1),r=i(a,l),d(p(t,e),r)<s))return!1;return!0}function x(t,e,i){for(var r=0;r!==t.length;++r)if(r!==e&&r!==i&&(r+1)%t.length!==e&&(r+1)%t.length!==i&&n(p(t,e),p(t,i),p(t,r),p(t,r+1)))return!1;return!0}function w(t,e,i,n){var r=n||[];if(function(t){t.length=0}(r),e<i)for(var s=e;s<=i;s++)r.push(t[s]);else{for(s=0;s<=i;s++)r.push(t[s]);for(s=e;s<t.length;s++)r.push(t[s])}return r}function b(t,e,i,n,r){r=r||0;var s=e[1]-t[1],o=t[0]-e[0],a=s*t[0]+o*t[1],h=n[1]-i[1],l=i[0]-n[0],u=h*i[0]+l*i[1],c=s*l-h*o;return A(c,0,r)?[0,0]:[(l*a-o*u)/c,(s*u-h*a)/c]}function A(t,e,i){return i=i||0,Math.abs(t-e)<=i}function T(t,e,i){return A(t[0],e[0],i)&&A(t[1],e[1],i)}},function(t,e,i){var n=i(86),r=i(0),s=i(591),o=i(128),a=i(592),h=i(1395),l=i(1396),u=i(1397),c=i(593),d=i(589),p=i(590),f=i(1398),m=i(64),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=[],u=0;u<h.length;u++){var c=a.pathToVertices(h[u],30);1!==r&&m.scale(c,r,r),l.push(c)}var d=n.fromVertices(t,e,l,s);return o&&this.world.add(d),d},fromJSON:function(t,e,i,n,r){void 0===n&&(n={}),void 0===r&&(r=!0);var s=p.parseBody(t,e,i,n);return s&&r&&this.world.add(s),s},imageStack:function(t,e,i,n,r,o,a,h,u){void 0===a&&(a=0),void 0===h&&(h=0),void 0===u&&(u={});var c=this.world,d=this.sys.displayList;u.addToWorld=!1;var p=s.stack(i,n,r,o,a,h,(function(i,n){var r=new l(c,i,n,t,e,u);return d.add(r),r.body}));return c.add(p),p},stack:function(t,e,i,n,r,o,a){var h=s.stack(t,e,i,n,r,o,a);return this.world.add(h),h},pyramid:function(t,e,i,n,r,o,a){var h=s.pyramid(t,e,i,n,r,o,a);return this.world.add(h),h},chain:function(t,e,i,n,r,o){return s.chain(t,e,i,n,r,o)},mesh:function(t,e,i,n,r){return s.mesh(t,e,i,n,r)},newtonsCradle:function(t,e,i,n,r){var o=s.newtonsCradle(t,e,i,n,r);return this.world.add(o),o},car:function(t,e,i,n,r){var o=s.car(t,e,i,n,r);return this.world.add(o),o},softBody:function(t,e,i,n,r,o,a,h,l,u){var c=s.softBody(t,e,i,n,r,o,a,h,l,u);return this.world.add(c),c},joint:function(t,e,i,n,r){return this.constraint(t,e,i,n,r)},spring:function(t,e,i,n,r){return this.constraint(t,e,i,n,r)},constraint:function(t,e,i,n,r){void 0===n&&(n=1),void 0===r&&(r={}),r.bodyA="body"===t.type?t:t.body,r.bodyB="body"===e.type?e:e.body,isNaN(i)||(r.length=i),r.stiffness=n;var s=o.create(r);return this.world.add(s),s},worldConstraint:function(t,e,i,n){void 0===i&&(i=1),void 0===n&&(n={}),n.bodyB="body"===t.type?t:t.body,isNaN(e)||(n.length=e),n.stiffness=i;var r=o.create(n);return this.world.add(r),r},mouseSpring:function(t){return this.pointerConstraint(t)},pointerConstraint:function(t){void 0===t&&(t={}),t.hasOwnProperty("render")||(t.render={visible:!1});var e=new f(this.scene,this.world,t);return this.world.add(e.constraint),e},image:function(t,e,i,n,r){var s=new l(this.world,t,e,i,n,r);return this.sys.displayList.add(s),s},tileBody:function(t,e){return new c(this.world,t,e)},sprite:function(t,e,i,n,r){var s=new u(this.world,t,e,i,n,r);return this.sys.displayList.add(s),this.sys.updateList.add(s),s},gameObject:function(t,e,i){return h(this.world,t,e,i)},destroy:function(){this.world=null,this.scene=null,this.sys=null}});t.exports=g},function(t,e,i){var n=i(249),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){var n=i(0),r=i(249),s=i(15),o=i(2),a=i(125),h=i(167),l=i(3),u=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=u},function(t,e,i){var n=i(164),r=i(0),s=i(249),o=i(15),a=i(2),h=i(167),l=i(73),u=i(3),c=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 u(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=c},function(t,e,i){var n=i(84),r=i(0),s=i(118),o=i(128),a=i(273),h=i(272),l=i(51),u=i(127),c=i(165),d=i(3),p=i(64),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(u(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;o<r.length;o++){var l=r[o];if(!l.ignorePointer&&n.contains(l.bounds,e)&&a.canCollide(l.collisionFilter,i.collisionFilter)&&this.hitTestBody(l,e))return this.world.emit(h.DRAG_START,l,this.part,this),!0}return!1},hitTestBody:function(t,e){for(var i=this.constraint,n=t.parts.length,r=n>1?1:0;r<n;r++){var s=t.parts[r];if(p.contains(s.vertices,e))return i.pointA=e,i.pointB={x:e.x-t.position.x,y:e.y-t.position.y},i.bodyB=t,i.angleB=t.angle,c.set(t,!1),this.part=s,this.body=t,!0}return!1},update:function(){var t=this.pointer,e=this.body;if(this.active&&t)if(t.isDown||!e){if(t.isDown){if(!e&&!this.getBody(t))return;e=this.body;var i=this.position,n=this.constraint;this.camera.getWorldPoint(t.x,t.y,i),n.pointA.x=i.x,n.pointA.y=i.y,c.set(e,!1),this.world.emit(h.DRAG,e,this)}}else this.stopDrag();else e&&this.stopDrag()},stopDrag:function(){var t=this.body,e=this.constraint;e.bodyB=null,e.pointB=null,this.pointer=null,this.body=null,this.part=null,t&&this.world.emit(h.DRAG_END,t,this)},destroy:function(){this.world.removeConstraint(this.constraint),this.pointer=null,this.constraint=null,this.body=null,this.part=null,this.world.off(h.BEFORE_UPDATE,this.update),this.scene.sys.input.off(l.POINTER_DOWN,this.onDown,this),this.scene.sys.input.off(l.POINTER_UP,this.onUp,this)}});t.exports=f},function(t,e,i){var n={};t.exports=n;var r=i(595),s=i(32);n.name="matter-js",n.version="0.14.2",n.uses=[],n.used=[],n.use=function(){r.use(n,Array.prototype.slice.call(arguments))},n.before=function(t,e){return t=t.replace(/^Matter./,""),s.chainPathBefore(n,t,e)},n.after=function(t,e){return t=t.replace(/^Matter./,""),s.chainPathAfter(n,t,e)}},function(t,e,i){var n={};t.exports=n;var r=i(83),s=i(274),o=i(84),a=i(86),h=i(64);n.collides=function(t,e){for(var i=[],n=0;n<e.length;n++){var r=e[n];if(t!==r&&o.overlaps(r.bounds,t.bounds))for(var a=1===r.parts.length?0:1;a<r.parts.length;a++){var h=r.parts[a];if(o.overlaps(h.bounds,t.bounds)){var l=s.collides(h,t);if(l.collided){i.push(l);break}}}}return i},n.ray=function(t,e,i,s){s=s||1e-100;for(var o=r.angle(e,i),h=r.magnitude(r.sub(e,i)),l=.5*(i.x+e.x),u=.5*(i.y+e.y),c=a.rectangle(l,u,h,s,{angle:o}),d=n.collides(c,t),p=0;p<d.length;p+=1){var f=d[p];f.body=f.bodyB=f.bodyA}return d},n.region=function(t,e,i){for(var n=[],r=0;r<t.length;r++){var s=t[r],a=o.overlaps(s.bounds,e);(a&&!i||!a&&i)&&n.push(s)}return n},n.point=function(t,e){for(var i=[],n=0;n<t.length;n++){var r=t[n];if(o.contains(r.bounds,e))for(var s=1===r.parts.length?0:1;s<r.parts.length;s++){var a=r.parts[s];if(o.contains(a.bounds,e)&&h.contains(a.vertices,e)){i.push(r);break}}}return i}},function(t,e,i){var n={};t.exports=n;var r=i(596),s=i(165),o=i(599),a=i(598),h=i(1523),l=i(597),u=i(166),c=i(118),d=i(128),p=i(32),f=i(41);n.create=function(t,e){e=(e=p.isElement(t)?e:t)||{},((t=p.isElement(t)?t:null)||e.render)&&p.warn("Engine.create: engine.render is deprecated (see docs)");var i={positionIterations:6,velocityIterations:4,constraintIterations:2,enableSleeping:!1,events:[],plugin:{},timing:{timestamp:0,timeScale:1},broadphase:{controller:l}},n=p.extend(i,e);return n.world=e.world||r.create(n.world),n.pairs=a.create(),n.broadphase=n.broadphase.controller.create(n.broadphase),n.metrics=n.metrics||{extended:!1},n.metrics=h.create(n.metrics),n},n.update=function(t,e,i){e=e||1e3/60,i=i||1;var r,l=t.world,p=t.timing,f=t.broadphase,m=[];p.timestamp+=e*p.timeScale;var g={timestamp:p.timestamp};u.trigger(t,"beforeUpdate",g);var v=c.allBodies(l),y=c.allConstraints(l);for(h.reset(t.metrics),t.enableSleeping&&s.update(v,p.timeScale),n._bodiesApplyGravity(v,l.gravity),n._bodiesUpdate(v,e,p.timeScale,i,l.bounds),d.preSolveAll(v),r=0;r<t.constraintIterations;r++)d.solveAll(y,p.timeScale);d.postSolveAll(v),f.controller?(l.isModified&&f.controller.clear(f),f.controller.update(f,v,t,l.isModified),m=f.pairsList):m=v,l.isModified&&c.setModified(l,!1,!1,!0);var x=f.detector(m,t),w=t.pairs,b=p.timestamp;for(a.update(w,x,b),a.removeOld(w,b),t.enableSleeping&&s.afterCollisions(w.list,p.timeScale),w.collisionStart.length>0&&u.trigger(t,"collisionStart",{pairs:w.collisionStart}),o.preSolvePosition(w.list),r=0;r<t.positionIterations;r++)o.solvePosition(w.list,v,p.timeScale);for(o.postSolvePosition(v),d.preSolveAll(v),r=0;r<t.constraintIterations;r++)d.solveAll(y,p.timeScale);for(d.postSolveAll(v),o.preSolveVelocity(w.list),r=0;r<t.velocityIterations;r++)o.solveVelocity(w.list,p.timeScale);return w.collisionActive.length>0&&u.trigger(t,"collisionActive",{pairs:w.collisionActive}),w.collisionEnd.length>0&&u.trigger(t,"collisionEnd",{pairs:w.collisionEnd}),h.update(t.metrics,t),n._bodiesClearForces(v),u.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=c.allBodies(t.world),r=0;r<i.length;r++){var o=i[r];s.set(o,!1),o.id=p.nextId()}}},n.clear=function(t){var e=t.world;a.clear(t.pairs);var i=t.broadphase;if(i.controller){var n=c.allBodies(e);i.controller.clear(i),i.controller.update(i,n,t,!0)}},n._bodiesClearForces=function(t){for(var e=0;e<t.length;e++){var i=t[e];i.force.x=0,i.force.y=0,i.torque=0}},n._bodiesApplyGravity=function(t,e){var i=void 0!==e.scale?e.scale:.001;if((0!==e.x||0!==e.y)&&0!==i)for(var n=0;n<t.length;n++){var r=t[n];r.ignoreGravity||r.isStatic||r.isSleeping||(r.force.x+=r.mass*e.x*i*r.gravityScale.x,r.force.y+=r.mass*e.y*i*r.gravityScale.y)}},n._bodiesUpdate=function(t,e,i,n,r){for(var s=0;s<t.length;s++){var o=t[s];o.isStatic||o.isSleeping||f.update(o,e,i,n)}}},function(t,e,i){var n=i(86),r=i(41),s=i(0),o=i(32),a=i(118),h=i(1401),l=i(9),u=i(272),c=i(2),d=i(6),p=i(41),f=i(166),m=i(593),g=i(596),v=i(83),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=c(e,"runner",{}),r=c(n,"fps",!1),s=c(n,"fps",60),o=c(n,"delta",1e3/s),a=c(n,"deltaMin",1e3/s),u=c(n,"deltaMax",1e3/(.5*s));r||(s=1e3/o),this.runner={fps:s,correction:c(n,"correction",1),deltaSampleSize:c(n,"deltaSampleSize",60),counterTimestamp:0,frameCounter:0,deltaHistory:[],timePrev:null,timeScalePrev:1,frameRequestId:null,isFixed:c(n,"isFixed",!1),delta:o,deltaMin:a,deltaMax:u},this.autoUpdate=d(e,"autoUpdate",!0);var p=d(e,"debug",!1);if(this.drawDebug="object"==typeof p||p,this.debugGraphic,this.debugConfig={showAxes:c(p,"showAxes",!1),showAngleIndicator:c(p,"showAngleIndicator",!1),angleColor:c(p,"angleColor",15208787),showBroadphase:c(p,"showBroadphase",!1),broadphaseColor:c(p,"broadphaseColor",16757760),showBounds:c(p,"showBounds",!1),boundsColor:c(p,"boundsColor",16777215),showVelocity:c(p,"showVelocity",!1),velocityColor:c(p,"velocityColor",44783),showCollisions:c(p,"showCollisions",!1),collisionColor:c(p,"collisionColor",16094476),showSeparations:c(p,"showSeparations",!1),separationColor:c(p,"separationColor",16753920),showBody:c(p,"showBody",!0),showStaticBody:c(p,"showStaticBody",!0),showInternalEdges:c(p,"showInternalEdges",!1),renderFill:c(p,"renderFill",!1),renderLine:c(p,"renderLine",!0),fillColor:c(p,"fillColor",1075465),fillOpacity:c(p,"fillOpacity",1),lineColor:c(p,"lineColor",2678297),lineOpacity:c(p,"lineOpacity",1),lineThickness:c(p,"lineThickness",1),staticFillColor:c(p,"staticFillColor",857979),staticLineColor:c(p,"staticLineColor",1255396),showSleeping:c(p,"showSleeping",!1),staticBodySleepOpacity:c(p,"staticBodySleepOpacity",.7),sleepFillColor:c(p,"sleepFillColor",4605510),sleepLineColor:c(p,"sleepLineColor",10066585),showSensors:c(p,"showSensors",!0),sensorFillColor:c(p,"sensorFillColor",857979),sensorLineColor:c(p,"sensorLineColor",1255396),showPositions:c(p,"showPositions",!0),positionSize:c(p,"positionSize",4),positionColor:c(p,"positionColor",14697178),showJoint:c(p,"showJoint",!0),jointColor:c(p,"jointColor",14737474),jointLineOpacity:c(p,"jointLineOpacity",1),jointLineThickness:c(p,"jointLineThickness",2),pinSize:c(p,"pinSize",4),pinColor:c(p,"pinColor",4382944),springColor:c(p,"springColor",14697184),anchorColor:c(p,"anchorColor",15724527),anchorSize:c(p,"anchorSize",4),showConvexHulls:c(p,"showConvexHulls",!1),hullColor:c(p,"hullColor",14091216)},this.drawDebug&&this.createDebugGraphic(),this.setEventsProxy(),c(e,"setBounds",!1)){var f=e.setBounds;if("boolean"==typeof f)this.setBounds();else{var m=c(f,"x",0),g=c(f,"y",0),v=c(f,"width",t.sys.scale.width),y=c(f,"height",t.sys.scale.height),x=c(f,"thickness",64),w=c(f,"left",!0),b=c(f,"right",!0),A=c(f,"top",!0),T=c(f,"bottom",!0);this.setBounds(m,g,v,y,x,w,b,A,T)}}},setCompositeRenderStyle:function(t){var e,i,n,r=t.bodies,s=t.constraints,o=t.composites;for(e=0;e<r.length;e++)n=(i=r[e]).render,this.setBodyRenderStyle(i,n.lineColor,n.lineOpacity,n.lineThickness,n.fillColor,n.fillOpacity);for(e=0;e<s.length;e++)n=(i=s[e]).render,this.setConstraintRenderStyle(i,n.lineColor,n.lineOpacity,n.lineThickness,n.pinSize,n.anchorColor,n.anchorSize);for(e=0;e<o.length;e++)i=o[e],this.setCompositeRenderStyle(i);return this},setBodyRenderStyle:function(t,e,i,n,r,s){var o=t.render,a=this.debugConfig;return o?(null==e&&(e=t.isStatic?a.staticLineColor:a.lineColor),null==i&&(i=a.lineOpacity),null==n&&(n=a.lineThickness),null==r&&(r=t.isStatic?a.staticFillColor:a.fillColor),null==s&&(s=a.fillOpacity),!1!==e&&(o.lineColor=e),!1!==i&&(o.lineOpacity=i),!1!==n&&(o.lineThickness=n),!1!==r&&(o.fillColor=r),!1!==s&&(o.fillOpacity=s),this):this},setConstraintRenderStyle:function(t,e,i,n,r,s,o){var a=t.render,h=this.debugConfig;if(!a)return this;if(null==e){var l=a.type;"line"===l?e=h.jointColor:"pin"===l?e=h.pinColor:"spring"===l&&(e=h.springColor)}return null==i&&(i=h.jointLineOpacity),null==n&&(n=h.jointLineThickness),null==r&&(r=h.pinSize),null==s&&(s=h.anchorColor),null==o&&(o=h.anchorSize),!1!==e&&(a.lineColor=e),!1!==i&&(a.lineOpacity=i),!1!==n&&(a.lineThickness=n),!1!==r&&(a.pinSize=r),!1!==s&&(a.anchorColor=s),!1!==o&&(a.anchorSize=o),this},setEventsProxy:function(){var t=this,e=this.engine,i=this.localWorld;this.drawDebug&&(f.on(i,"compositeModified",(function(e){t.setCompositeRenderStyle(e)})),f.on(i,"beforeAdd",(function(e){for(var i=[].concat(e.object),n=0;n<i.length;n++){var r=i[n],s=r.render;"body"===r.type?t.setBodyRenderStyle(r,s.lineColor,s.lineOpacity,s.lineThickness,s.fillColor,s.fillOpacity):"composite"===r.type?t.setCompositeRenderStyle(r):"constraint"===r.type&&t.setConstraintRenderStyle(r,s.lineColor,s.lineOpacity,s.lineThickness,s.pinSize,s.anchorColor,s.anchorSize)}}))),f.on(i,"beforeAdd",(function(e){t.emit(u.BEFORE_ADD,e)})),f.on(i,"afterAdd",(function(e){t.emit(u.AFTER_ADD,e)})),f.on(i,"beforeRemove",(function(e){t.emit(u.BEFORE_REMOVE,e)})),f.on(i,"afterRemove",(function(e){t.emit(u.AFTER_REMOVE,e)})),f.on(e,"beforeUpdate",(function(e){t.emit(u.BEFORE_UPDATE,e)})),f.on(e,"afterUpdate",(function(e){t.emit(u.AFTER_UPDATE,e)})),f.on(e,"collisionStart",(function(e){var i,n,r=e.pairs;r.length>0&&(i=r[0].bodyA,n=r[0].bodyB),t.emit(u.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(u.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(u.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;i<t.length;i++){var n=t[i],r=n.body?n.body:n;a.remove(this.localWorld,r,e)}return this},removeConstraint:function(t,e){return a.remove(this.localWorld,t,e),this},convertTilemapLayer:function(t,e){var i=t.layer,n=t.getTilesWithin(0,0,i.width,i.height,{isColliding:!0});return this.convertTiles(n,e),this},convertTiles:function(t,e){if(0===t.length)return this;for(var i=0;i<t.length;i++)new m(this,t[i],e);return this},nextGroup:function(t){return p.nextGroup(t)},nextCategory:function(){return p.nextCategory()},pause:function(){return this.enabled=!1,this.emit(u.PAUSE),this},resume:function(){return this.enabled=!0,this.emit(u.RESUME),this},update:function(t,e){if(this.enabled&&this.autoUpdate){var i=this.engine,n=this.runner,r=i.timing,s=this.correction;n.isFixed?e=this.getDelta(t,e):(e=t-n.timePrev||n.delta,n.timePrev=t,n.deltaHistory.push(e),n.deltaHistory=n.deltaHistory.slice(-n.deltaSampleSize),s=(e=(e=(e=Math.min.apply(null,n.deltaHistory))<n.deltaMin?n.deltaMin:e)>n.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;s<r.length;s++){var a=r[s];if(!(t.buckets[a].length<2)){var h=a.split(/C|R/);e.strokeRect(parseInt(h[1],10)*t.bucketWidth,parseInt(h[2],10)*t.bucketHeight,t.bucketWidth,t.bucketHeight)}}return this},renderSeparations:function(t,e,i){e.lineStyle(1,i,1);for(var n=0;n<t.length;n++){var r=t[n];if(r.isActive){var s=r.collision,o=s.bodyA,a=s.bodyB,h=o.position,l=a.position,u=s.penetration,c=o.isStatic||a.isStatic?1:4;a.isStatic&&(c=0),e.lineBetween(l.x,l.y,l.x-u.x*c,l.y-u.y*c),c=o.isStatic||a.isStatic?1:4,o.isStatic&&(c=0),e.lineBetween(h.x,h.y,h.x-u.x*c,h.y-u.y*c)}}return this},renderCollisions:function(t,e,i){var n,r;for(e.lineStyle(1,i,.5),e.fillStyle(i,1),n=0;n<t.length;n++)if((r=t[n]).isActive)for(var s=0;s<r.activeContacts.length;s++){var o=r.activeContacts[s].vertex;e.fillRect(o.x-2,o.y-2,5,5)}for(n=0;n<t.length;n++)if((r=t[n]).isActive){var a=r.collision,h=r.activeContacts;if(h.length>0){var l=h[0].vertex.x,u=h[0].vertex.y;2===h.length&&(l=(h[0].vertex.x+h[1].vertex.x)/2,u=(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,u-8*a.normal.y,l,u):e.lineBetween(l+8*a.normal.x,u+8*a.normal.y,l,u)}}return this},renderBodyBounds:function(t,e,i,n){e.lineStyle(1,i,n);for(var r=0;r<t.length;r++){var s=t[r];if(s.render.visible){var o=s.bounds;if(o)e.strokeRect(o.min.x,o.min.y,o.max.x-o.min.x,o.max.y-o.min.y);else for(var a=s.parts,h=a.length>1?1:0;h<a.length;h++){var l=a[h];e.strokeRect(l.bounds.min.x,l.bounds.min.y,l.bounds.max.x-l.bounds.min.x,l.bounds.max.y-l.bounds.min.y)}}}return this},renderBodyAxes:function(t,e,i,n,r){e.lineStyle(1,n,r);for(var s=0;s<t.length;s++){var o,a,h,l=t[s],u=l.parts;if(l.render.visible)if(i)for(a=u.length>1?1:0;a<u.length;a++)for(o=u[a],h=0;h<o.axes.length;h++){var c=o.axes[h];e.lineBetween(o.position.x,o.position.y,o.position.x+20*c.x,o.position.y+20*c.y)}else for(a=u.length>1?1:0;a<u.length;a++)for(o=u[a],h=0;h<o.axes.length;h++)e.lineBetween(o.position.x,o.position.y,(o.vertices[0].x+o.vertices[o.vertices.length-1].x)/2,(o.vertices[0].y+o.vertices[o.vertices.length-1].y)/2)}return this},renderBodyVelocity:function(t,e,i,n,r){e.lineStyle(r,i,n);for(var s=0;s<t.length;s++){var o=t[s];o.render.visible&&e.lineBetween(o.position.x,o.position.y,o.position.x+2*(o.position.x-o.positionPrev.x),o.position.y+2*(o.position.y-o.positionPrev.y))}return this},renderBodies:function(t){for(var e=this.debugGraphic,i=this.debugConfig,n=i.showBody,r=i.showStaticBody,s=i.showSleeping,o=i.showInternalEdges,a=i.showConvexHulls,h=i.renderFill,l=i.renderLine,u=i.staticBodySleepOpacity,c=i.sleepFillColor,d=i.sleepLineColor,p=i.hullColor,f=0;f<t.length;f++){var m=t[f];if(m.render.visible&&(r||!m.isStatic)&&(n||m.isStatic)){var g=m.render.lineColor,v=m.render.lineOpacity,y=m.render.lineThickness,x=m.render.fillColor,w=m.render.fillOpacity;s&&m.isSleeping&&(m.isStatic?(v*=u,w*=u):(g=d,x=c)),h||(x=null),l||(g=null),this.renderBody(m,e,o,g,v,y,x,w);var b=m.parts.length;a&&b>1&&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,u=h.sensorLineColor,c=t.parts,d=c.length,p=d>1?1:0;p<d;p++){var f=c[p],m=f.render,g=m.opacity;if(m.visible&&0!==g&&(!f.isSensor||h.showSensors)){var v=f.circleRadius;if(e.beginPath(),f.isSensor?(null!==o&&e.fillStyle(l,a*g),null!==n&&e.lineStyle(s,u,r*g)):(null!==o&&e.fillStyle(o,a*g),null!==n&&e.lineStyle(s,n,r*g)),v)e.arc(f.position.x,f.position.y,v,0,2*Math.PI);else{var y=f.vertices,x=y.length;e.moveTo(y[0].x,y[0].y);for(var w=1;w<x;w++){var b=y[w];if(!y[w-1].isInternal||i?e.lineTo(b.x,b.y):e.moveTo(b.x,b.y),w<x&&b.isInternal&&!i){var A=(w+1)%x;e.moveTo(y[A].x,y[A].y)}}e.closePath()}null!==o&&e.fillPath(),null!==n&&e.strokePath()}}if(h.showPositions&&!t.isStatic){var T=t.position.x,S=t.position.y,E=Math.ceil(h.positionSize/2);e.fillStyle(h.positionColor,1),e.fillRect(T-E,S-E,h.positionSize,h.positionSize)}return this},renderConvexHull:function(t,e,i,n){if(void 0===n&&(n=1),t.parts.length>1){var r=t.vertices;e.lineStyle(n,i),e.beginPath(),e.moveTo(r[0].x,r[0].y);for(var s=1;s<r.length;s++)e.lineTo(r[s].x,r[s].y);e.lineTo(r[0].x,r[0].y),e.strokePath()}return this},renderJoints:function(){for(var t=this.debugGraphic,e=a.allConstraints(this.localWorld),i=0;i<e.length;i++){var n=e[i].render,r=n.lineColor,s=n.lineOpacity,o=n.lineThickness,h=n.pinSize,l=n.anchorColor,u=n.anchorSize;this.renderConstraint(e[i],t,r,s,o,h,l,u)}},renderConstraint:function(t,e,i,n,r,s,a,h){var l=t.render;if(!l.visible||!t.pointA||!t.pointB)return this;e.lineStyle(r,i,n);var u,c,d=t.bodyA,p=t.bodyB;if(u=d?v.add(d.position,t.pointA):t.pointA,"pin"===l.type)e.strokeCircle(u.x,u.y,s);else{if(c=p?v.add(p.position,t.pointB):t.pointB,e.beginPath(),e.moveTo(u.x,u.y),"spring"===l.type)for(var f,m=v.sub(c,u),g=v.perp(v.normalise(m)),y=Math.ceil(o.clamp(t.length/5,12,20)),x=1;x<y;x+=1)f=x%2==0?1:-1,e.lineTo(u.x+m.x*(x/y)+g.x*f*4,u.y+m.y*(x/y)+g.y*f*4);e.lineTo(c.x,c.y)}return e.strokePath(),l.anchors&&h>0&&(e.fillStyle(a),e.fillCircle(u.x,u.y,h),e.fillCircle(c.x,c.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){t.exports={BasePlugin:i(540),DefaultPlugins:i(197),PluginCache:i(24),PluginManager:i(414),ScenePlugin:i(1404)}},function(t,e,i){var n=i(540),r=i(0),s=i(20),o=new r({Extends:n,initialize:function(t,e,i){n.call(this,e),this.scene=t,this.systems=t.sys,this.pluginKey=i,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){t.exports={Canvas:i(1406),Events:i(91),Snapshot:i(1407),WebGL:i(1408)}},function(t,e,i){t.exports={CanvasRenderer:i(368),GetBlendModes:i(370),SetTransform:i(30)}},function(t,e,i){t.exports={Canvas:i(369),WebGL:i(383)}},function(t,e,i){var n=i(107),r=i(17),s={PipelineManager:i(372),Pipelines:i(1409),RenderTarget:i(141),Utils:i(12),WebGLPipeline:i(58),WebGLRenderer:i(371),WebGLShader:i(375)};s=r(!1,s,n),t.exports=s},function(t,e,i){var n=i(92),r=i(17),s={BitmapMaskPipeline:i(373),Events:i(374),GraphicsPipeline:i(376),LightPipeline:i(377),MultiPipeline:i(108),PointLightPipeline:i(378),PostFXPipeline:i(1410),RopePipeline:i(379),SinglePipeline:i(380),UtilityPipeline:i(381)};s=r(!1,s,n),t.exports=s},function(t,e,i){var n=i(0),r=i(198),s=i(2),o=i(1411),a=i(382),h=i(58),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){var n=i(17),r=i(201),s={Center:i(403),Events:i(104),Orientation:i(404),ScaleManager:i(415),ScaleModes:i(405),Zoom:i(406)};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){var n=i(144),r=i(17),s={Events:i(20),GetPhysicsPlugins:i(419),GetScenePlugins:i(420),SceneManager:i(417),ScenePlugin:i(1414),Settings:i(421),Systems:i(204)};s=r(!1,s,n),t.exports=s},function(t,e,i){var n=i(18),r=i(0),s=i(20),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){t.exports={Events:i(438),List:i(110),Map:i(102),ProcessQueue:i(211),RTree:i(531),Set:i(149),Size:i(416)}},function(t,e,i){var n=i(17),r=i(1417),s={CanvasTexture:i(423),Events:i(106),FilterMode:r,Frame:i(109),Parsers:i(425),Texture:i(206),TextureManager:i(422),TextureSource:i(424)};s=n(!1,s,r),t.exports=s},function(t,e){t.exports={LINEAR:0,NEAREST:1}},function(t,e,i){var n=i(17),r=i(1419),s={Components:i(251),Parsers:i(1452),Formats:i(40),ImageCollection:i(576),ParseToTilemap:i(262),Tile:i(85),Tilemap:i(580),TilemapCreator:i(1459),TilemapFactory:i(1460),Tileset:i(122),TilemapLayer:i(581),Orientation:i(29),LayerData:i(120),MapData:i(121),ObjectLayer:i(572)};s=n(!1,s,r.ORIENTATION),t.exports=s},function(t,e,i){var n={ORIENTATION:i(29)};t.exports=n},function(t,e,i){var n=i(26),r=i(63);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 u=n(t,e,i,s,null,l),c=o-t,d=a-e,p=0;p<u.length;p++){var f=u[p].x+c,m=u[p].y+d;f>=0&&f<l.width&&m>=0&&m<l.height&&l.data[m][f]&&l.data[m][f].copy(u[p])}h&&r(o-1,a-1,i+2,s+2,l)}},function(t,e,i){var n=i(26),r=i(542);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,u=n(0,0,a.width,a.height,null,a),c=[];for(l=0;l<u.length;l++){var d=u[l];if(-1!==t.indexOf(d.index)){var p=h.tileToWorldXY(d.x,d.y,void 0,o,a);i.x=p.x,i.y=p.y,c.push(s.make.sprite(i))}}if("number"==typeof e)for(l=0;l<t.length;l++)r(t[l],e,0,0,a.width,a.height,a);else if(Array.isArray(e))for(l=0;l<t.length;l++)r(t[l],e[l],0,0,a.width,a.height,a);return c}},function(t,e,i){var n=i(26),r=i(63),s=i(72);t.exports=function(t,e,i,o,a,h,l){for(var u=-1!==l.collideIndexes.indexOf(t),c=n(e,i,o,a,null,l),d=0;d<c.length;d++)c[d].index=t,s(c[d],u);h&&r(e-1,i-1,o+2,a+2,l)}},function(t,e,i){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<n.height;s++)for(r=0;r<n.width;r++)if((o=n.data[s][r])&&o.index===t){if(a===e)return o;a+=1}return null}},function(t,e,i){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){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){var n=i(29),r=i(544),s=i(545),o=i(547),a=i(1),h=i(548);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){var n=i(158),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){var n=i(483),r=i(26),s=i(484),o=i(1),a=i(3),h=function(t,e){return s.RectangleToTriangle(e,t)},l=new a,u=new a,c=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,u,i);var p=u.x,f=u.y;a.tilemapLayer.worldToTileXY(t.right,t.bottom,!0,c,i);var m=Math.ceil(c.x),g=Math.ceil(c.y),v=Math.max(m-p,1),y=Math.max(g-f,1),x=r(p,f,v,y,e,a),w=a.tileWidth,b=a.tileHeight;a.tilemapLayer&&(w*=a.tilemapLayer.scaleX,b*=a.tilemapLayer.scaleY);for(var A=[],T=new n.Rectangle(0,0,w,b),S=0;S<x.length;S++){var E=x[S];a.tilemapLayer.tileToWorldXY(E.x,E.y,l,i),T.x=l.x,T.y=l.y,d(t,T)&&A.push(E)}return A}},function(t,e,i){var n=i(29),r=i(1),s=i(253);t.exports=function(t){return t===n.ORTHOGONAL?s:r}},function(t,e,i){var n=i(29),r=i(550),s=i(551),o=i(1),a=i(552),h=i(553);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){var n=i(29),r=i(554),s=i(1),o=i(555),a=i(254);t.exports=function(t){return t===n.ORTHOGONAL?a:t===n.HEXAGONAL?r:t===n.STAGGERED?o:s}},function(t,e,i){var n=i(29),r=i(1),s=i(255);t.exports=function(t){return t===n.ORTHOGONAL?s:r}},function(t,e,i){var n=i(29),r=i(556),s=i(557),o=i(1),a=i(558),h=i(559);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){var n=i(29),r=i(560),s=i(1),o=i(561),a=i(256);t.exports=function(t){return t===n.ORTHOGONAL?a:t===n.HEXAGONAL?r:t===n.STAGGERED?o:s}},function(t,e,i){var n=i(562),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){var n=i(257),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){var n=i(63),r=i(257);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<a;l++)for(var u=0;u<h;u++){var c=t[l][u];r(c,e+u,i+l,!1,o)}s&&n(e-1,i-1,h+2,a+2,o)}},function(t,e,i){var n=i(26),r=i(210);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<l.length;h++)-1===o.indexOf(l[h].index)&&o.push(l[h].index);for(h=0;h<l.length;h++)l[h].index=r(o)}},function(t,e,i){var n=i(563),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){var n=i(26),r=i(397),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,u=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 c=0;c<u.length;c++){var d=u[c],p=d.width,f=d.height,m=d.pixelX,g=d.pixelY,v=d.collides?h:r;null!==v&&(t.fillStyle(v.color,v.alpha/255),t.fillRect(m,g,p,f)),m+=1,g+=1,p-=2,f-=2,null!==l&&(t.lineStyle(1,l.color,l.alpha/255),d.faceTop&&t.lineBetween(m,g,m+p,g),d.faceRight&&t.lineBetween(m+p,g,m+p,g+f),d.faceBottom&&t.lineBetween(m,g+f,m+p,g+f),d.faceLeft&&t.lineBetween(m,g,m,g+f))}}},function(t,e,i){var n=i(72),r=i(63),s=i(160);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<t.length;h++)s(t[h],e,o);if(a)for(var l=0;l<o.height;l++)for(var u=0;u<o.width;u++){var c=o.data[l][u];c&&-1!==t.indexOf(c.index)&&n(c,e)}i&&r(0,0,o.width,o.height,o)}},function(t,e,i){var n=i(72),r=i(63),s=i(160);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 u=0;u<a.height;u++)for(var c=0;c<a.width;c++){var d=a.data[u][c];d&&d.index>=t&&d.index<=e&&n(d,i)}o&&r(0,0,a.width,a.height,a)}}},function(t,e,i){var n=i(72),r=i(63),s=i(160);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<o.height;a++)for(var h=0;h<o.width;h++){var l=o.data[a][h];l&&-1===t.indexOf(l.index)&&(n(l,e),s(l.index,e,o))}i&&r(0,0,o.width,o.height,o)}},function(t,e,i){var n=i(72),r=i(63),s=i(126);t.exports=function(t,e,i,o){void 0===e&&(e=!0),void 0===i&&(i=!0);for(var a=0;a<o.height;a++)for(var h=0;h<o.width;h++){var l=o.data[a][h];if(l)for(var u in t)if(s(l.properties,u)){var c=t[u];Array.isArray(c)||(c=[c]);for(var d=0;d<c.length;d++)l.properties[u]===c[d]&&n(l,e)}}i&&r(0,0,o.width,o.height,o)}},function(t,e,i){var n=i(72),r=i(63);t.exports=function(t,e,i){void 0===t&&(t=!0),void 0===e&&(e=!0);for(var s=0;s<i.height;s++)for(var o=0;o<i.width;o++){var a=i.data[s][o];if(a){var h=a.getCollisionGroup();h&&h.objects&&h.objects.length>0&&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<s;r++)n.callbacks[t[r]]=null!==e?{callback:e,callbackContext:i}:void 0}},function(t,e,i){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<h.length;l++)h[l].setCollisionCallback(s,o)}},function(t,e,i){var n=i(26),r=i(131);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<a.length;l++)a[l].index=h[l]}},function(t,e,i){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<h.length;l++)h[l]&&(h[l].index===t?h[l].index=e:h[l].index===e&&(h[l].index=t))}},function(t,e,i){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<s.length;a++)l+=s[a].weight;if(!(l<=0))for(a=0;a<h.length;a++){for(var u=Math.random()*l,c=0,d=-1,p=0;p<s.length;p++)if(u<=(c+=s[p].weight)){var f=s[p].index;d=Array.isArray(f)?f[Math.floor(Math.random()*f.length)]:f;break}h[a].index=d}}}},function(t,e,i){t.exports={FromOrientationString:i(258),Parse:i(564),Parse2DArray:i(259),ParseCSV:i(565),Impact:i(1454),Tiled:i(1455)}},function(t,e){t.exports=function(t,e){for(var i=0;i<t.length;i++){var n=t[i],r=i;if(n.name&&""!==n.name&&(r=n.name),Array.isArray(n.wangtiles)&&n.wangtiles.length>0){var s,o,a,h={},l={};if(Array.isArray(n.edgecolors))for(s=0;s<n.edgecolors.length;s++)a=1+s,""!==(o=n.edgecolors[s]).name&&(h[a]=o.name);if(Array.isArray(n.cornercolors))for(s=0;s<n.cornercolors.length;s++)a=1+s,""!==(o=n.cornercolors[s]).name&&(l[a]=o.name);if(Array.isArray(n.colors))for(s=0;s<n.colors.length;s++)a=1+s,""!==(o=n.colors[s]).name&&(h[a]=l[a]=o.name);for(var u=[h,l,h,l,h,l,h,l],c=0;c<n.wangtiles.length;c++){var d=n.wangtiles[c],p=e[d.tileid]||(e[d.tileid]={});p=p.wangid||(p.wangid={});for(var f=[],m=0;m<Math.min(u.length,d.wangid.length);m++)if(0!==(o=d.wangid[m])){var g=u[m][o];void 0===g?f.push(o):f.push(g)}else f.push(void 0);p[r]=f}}}}},function(t,e,i){t.exports={ParseTileLayers:i(578),ParseTilesets:i(579),ParseWeltmeister:i(577)}},function(t,e,i){t.exports={AssignTileProperties:i(567),Base64Decode:i(574),BuildTilesetIndex:i(568),CreateGroupLayer:i(161),ParseGID:i(261),ParseImageLayers:i(569),ParseJSONTiled:i(566),ParseObject:i(260),ParseObjectLayers:i(570),ParseTileLayers:i(573),ParseTilesets:i(575)}},function(t,e,i){var n=i(1),r=i(1);n=i(1457),r=i(1458),t.exports={renderWebGL:n,renderCanvas:r}},function(t,e,i){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,u=e.scrollFactorX,c=e.scrollFactorY,d=e.x,p=e.y,f=e.scaleX,m=e.scaleY;t.pipelines.preBatch(e);for(var g=0;g<s;g++){var v=r[g],y=a[v.index];if(y){var x=y.getTileTextureCoordinates(v.index);if(null!==x){var w=y.glTexture,b=h.setTexture2D(w,e),A=y.tileWidth,T=y.tileHeight,S=x.x,E=x.y,M=.5*y.tileWidth,_=.5*y.tileHeight,C=l(v.tint,o*v.alpha);h.batchTexture(e,w,w.width,w.height,d+(M+v.pixelX)*f,p+(_+v.pixelY)*m,v.width,v.height,f,m,v.rotation,v.flipX,v.flipY,u,c,M,_,S,E,A,T,C,C,C,C,!1,0,0,i,null,!0,b)}}}t.pipelines.postBatch(e)}}},function(t,e,i){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 u=r,c=s,d=o;c.applyITRS(e.x,e.y,e.rotation,e.scaleX,e.scaleY),u.copyFrom(i.matrix);var p=t.currentContext,f=e.gidMap;p.save(),n?(u.multiplyWithOffset(n,-i.scrollX*e.scrollFactorX,-i.scrollY*e.scrollFactorY),c.e=e.x,c.f=e.y,u.multiply(c,d),d.copyToContext(p)):(c.e-=i.scrollX*e.scrollFactorX,c.f-=i.scrollY*e.scrollFactorY,c.copyToContext(p)),(!t.antialias||e.scaleX>1||e.scaleY>1)&&(p.imageSmoothingEnabled=!1);for(var m=0;m<h;m++){var g=a[m],v=f[g.index];if(v){var y=v.image.getSourceImage(),x=v.getTileTextureCoordinates(g.index);if(null!==x){var w=v.tileWidth,b=v.tileHeight,A=.5*w,T=.5*b;p.save(),p.translate(g.pixelX+A,g.pixelY+T),0!==g.rotation&&p.rotate(g.rotation),(g.flipX||g.flipY)&&p.scale(g.flipX?-1:1,g.flipY?-1:1),p.globalAlpha=l*g.alpha,p.drawImage(y,x.x,x.y,w,b,-A,-T,w,b),p.restore()}}}p.restore()}}},function(t,e,i){var n=i(16),r=i(262);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){var n=i(5),r=i(262);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){t.exports={Clock:i(1462),TimerEvent:i(582)}},function(t,e,i){var n=i(0),r=i(24),s=i(20),o=i(582),a=i(93),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<t.length;e++){var i=t[e];a(this._pendingRemoval,i),a(this._pendingInsertion,i),a(this._active,i)}return this},removeAllEvents:function(){return this._pendingRemoval=this._pendingRemoval.concat(this._active),this},preUpdate:function(){var t=this._pendingRemoval.length,e=this._pendingInsertion.length;if(0!==t||0!==e){var i,n;for(i=0;i<t;i++){n=this._pendingRemoval[i];var r=this._active.indexOf(n);r>-1&&this._active.splice(r,1),n.destroy()}for(i=0;i<e;i++)n=this._pendingInsertion[i],this._active.push(n);this._pendingRemoval.length=0,this._pendingInsertion.length=0}},update:function(t,e){if(this.now=t,!this.paused){e*=this.timeScale;for(var i=0;i<this._active.length;i++){var n=this._active[i];if(!n.paused&&(n.elapsed+=e*n.timeScale,n.elapsed>=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<this._pendingInsertion.length;t++)this._pendingInsertion[t].destroy();for(t=0;t<this._active.length;t++)this._active[t].destroy();for(t=0;t<this._pendingRemoval.length;t++)this._pendingRemoval[t].destroy();this._active.length=0,this._pendingRemoval.length=0,this._pendingInsertion.length=0;var e=this.systems.events;e.off(s.PRE_UPDATE,this.preUpdate,this),e.off(s.UPDATE,this.update,this),e.off(s.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off(s.START,this.start,this),this.scene=null,this.systems=null}});r.register("Clock",h,"time"),t.exports=h},function(t,e,i){var n=i(100),r=i(17),s={Builders:i(1464),Events:i(267),TweenManager:i(1480),Tween:i(266),TweenData:i(268),Timeline:i(588)};s=r(!1,s,n),t.exports=s},function(t,e,i){t.exports={GetBoolean:i(99),GetEaseFunction:i(80),GetNewValue:i(162),GetProps:i(583),GetTargets:i(263),GetTweens:i(584),GetValueOp:i(264),NumberTweenBuilder:i(585),StaggerBuilder:i(586),TimelineBuilder:i(587),TweenBuilder:i(163)}},function(t,e){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){t.exports="complete"},function(t,e){t.exports="loop"},function(t,e){t.exports="pause"},function(t,e){t.exports="resume"},function(t,e){t.exports="start"},function(t,e){t.exports="update"},function(t,e){t.exports="active"},function(t,e){t.exports="complete"},function(t,e){t.exports="loop"},function(t,e){t.exports="repeat"},function(t,e){t.exports="start"},function(t,e){t.exports="stop"},function(t,e){t.exports="update"},function(t,e){t.exports="yoyo"},function(t,e,i){var n=i(93),r=i(0),s=i(585),o=i(24),a=i(20),h=i(586),l=i(587),u=i(100),c=i(163),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 c(this,t)},add:function(t){var e=c(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<i.length;t++){e=i[t];var s=n.indexOf(e);-1===s?(s=r.indexOf(e))>-1&&(e.state=u.REMOVED,r.splice(s,1)):(e.state=u.REMOVED,n.splice(s,1))}for(i.length=0,i=this._add,t=0;t<i.length;t++)(e=i[t]).state===u.PENDING_ADD&&(e.init()?(e.play(),this._active.push(e)):this._pending.push(e));i.length=0,this._toProcess=0}},update:function(t,e){var i,n=this._active;e*=this.timeScale;for(var r=0;r<n.length;r++)(i=n[r]).update(t,e)&&(this._destroy.push(i),this._toProcess++)},remove:function(t){return n(this._add,t),n(this._pending,t),n(this._active,t),n(this._destroy,t),t.state=u.REMOVED,this},makeActive:function(t){if(-1!==this._add.indexOf(t)||-1!==this._active.indexOf(t))return this;var e=this._pending.indexOf(t);return-1!==e&&this._pending.splice(e,1),this._add.push(t),t.state=u.PENDING_ADD,this._toProcess++,this},each:function(t,e){for(var i=[null],n=1;n<arguments.length;n++)i.push(arguments[n]);for(var r in this.list)i[0]=this.list[r],t.apply(e,i)},getAllTweens:function(){for(var t=this._active,e=[],i=0;i<t.length;i++)e.push(t[i]);return e},getGlobalTimeScale:function(){return this.timeScale},getTweensOf:function(t,e){void 0===e&&(e=!1);var i,n,r,s=this._active,o=[];for(Array.isArray(t)||(t=[t]),n=0;n<s.length;n++)for(i=s[n],r=0;r<t.length;r++)i.hasTarget(t[r])&&o.push(i);if(e)for(s=this._pending,n=0;n<s.length;n++)for(i=s[n],r=0;r<t.length;r++)i.hasTarget(t[r])&&o.push(i);return o},isTweening:function(t){for(var e,i=this._active,n=0;n<i.length;n++)if((e=i[n]).hasTarget(t)&&e.isPlaying())return!0;return!1},killAll:function(){for(var t=this.getAllTweens(),e=0;e<t.length;e++)t[e].stop();return this},killTweensOf:function(t){for(var e=this.getTweensOf(t),i=0;i<e.length;i++)e[i].stop();return this},pauseAll:function(){for(var t=this._active,e=0;e<t.length;e++)t[e].pause();return this},resumeAll:function(){for(var t=this._active,e=0;e<t.length;e++)t[e].resume();return this},setGlobalTimeScale:function(t){return this.timeScale=t,this},shutdown:function(){this.killAll(),this._add=[],this._pending=[],this._active=[],this._destroy=[],this._toProcess=0;var t=this.systems.events;t.off(a.PRE_UPDATE,this.preUpdate,this),t.off(a.UPDATE,this.update,this),t.off(a.SHUTDOWN,this.shutdown,this)},destroy:function(){this.shutdown(),this.scene.sys.events.off(a.START,this.start,this),this.scene=null,this.systems=null}});o.register("TweenManager",d,"tweens"),t.exports=d},function(t,e,i){t.exports={Array:i(208),Base64:i(1482),Objects:i(1484),String:i(1488),NOOP:i(1)}},function(t,e,i){t.exports={ArrayBufferToBase64:i(1483),Base64ToArrayBuffer:i(433)}},function(t,e){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<r;o+=3)s+=i[n[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){t.exports={Clone:i(77),DeepCopy:i(175),Extend:i(17),GetAdvancedValue:i(13),GetFastValue:i(2),GetMinMaxValue:i(1485),GetValue:i(6),HasAll:i(1486),HasAny:i(455),HasValue:i(126),IsPlainObject:i(7),Merge:i(127),MergeRight:i(1487),Pick:i(571),SetValue:i(478)}},function(t,e,i){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<e.length;i++)if(!t.hasOwnProperty(e[i]))return!1;return!0}},function(t,e,i){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){t.exports={Format:i(1489),Pad:i(186),RemoveAt:i(1490),Reverse:i(1491),UppercaseFirst:i(205),UUID:i(222)}},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){t.exports={SoundManagerCreator:i(426),Events:i(70),BaseSound:i(146),BaseSoundManager:i(145),WebAudioSound:i(434),WebAudioSoundManager:i(432),HTML5AudioSound:i(429),HTML5AudioSoundManager:i(427),NoAudioSound:i(431),NoAudioSoundManager:i(430)}},function(t,e,i){t.exports={Arcade:i(1366),Matter:i(1494)}},function(t,e,i){t.exports={BodyBounds:i(1392),Components:i(249),Events:i(272),Factory:i(1394),MatterGameObject:i(1395),Image:i(1396),Matter:i(594),MatterPhysics:i(1524),PolyDecomp:i(1393),Sprite:i(1397),TileBody:i(593),PhysicsEditorParser:i(589),PhysicsJSONParser:i(590),PointerConstraint:i(1398),World:i(1402)}},function(t,e){t.exports={setBounce:function(t){return this.body.restitution=t,this}}},function(t,e){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<t.length;i++)e|=t[i];else e=t;return this.body.collisionFilter.mask=e,this},setOnCollide:function(t){return this.body.onCollideCallback=t,this},setOnCollideEnd:function(t){return this.body.onCollideEndCallback=t,this},setOnCollideActive:function(t){return this.body.onCollideActiveCallback=t,this},setOnCollideWith:function(t,e){Array.isArray(t)||(t=[t]);for(var i=0;i<t.length;i++){var n=t[i].hasOwnProperty("body")?t[i].body:t[i];this.body.setOnCollideWith(n,e)}return this}};t.exports=i},function(t,e,i){var n=i(41),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){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){var n=i(41),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){var n=i(86),r=i(41),s=i(124),o=i(2),a=i(589),h=i(590),l=i(64),u={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<t.parts.length;i++)t.parts[i].gameObject=this;var n=this;if(t.destroy=function(){n.world.remove(n.body,!0),n.body.gameObject=null},e&&(this.world.has(t)&&this.world.remove(t,!0),this.world.add(t)),this._originComponent){var r=t.render.sprite.xOffset,o=t.render.sprite.yOffset,a=t.centerOfMass.x,h=t.centerOfMass.y;if(s(a,.5)&&s(h,.5))this.setOrigin(r+.5,o+.5);else{var l=t.centerOffset.x,u=t.centerOffset.y;this.setOrigin(r+l/this.displayWidth,o+u/this.displayHeight)}}return this},setBody:function(t,e){if(!t)return this;var i;"string"==typeof t&&(t={type:t});var s=o(t,"type","rectangle"),u=o(t,"x",this._tempVec2.x),c=o(t,"y",this._tempVec2.y),d=o(t,"width",this.width),p=o(t,"height",this.height);switch(s){case"rectangle":i=n.rectangle(u,c,d,p,e);break;case"circle":var f=o(t,"radius",Math.max(d,p)/2),m=o(t,"maxSides",25);i=n.circle(u,c,f,e,m);break;case"trapezoid":var g=o(t,"slope",.5);i=n.trapezoid(u,c,d,p,g,e);break;case"polygon":var v=o(t,"sides",5),y=o(t,"radius",Math.max(d,p)/2);i=n.polygon(u,c,v,y,e);break;case"fromVertices":case"fromVerts":var x=o(t,"verts",null);if(x)if("string"==typeof x&&(x=l.fromPath(x)),this.body&&!this.body.hasOwnProperty("temp"))r.setVertices(this.body,x),i=this.body;else{var w=o(t,"flagInternal",!1),b=o(t,"removeCollinear",.01),A=o(t,"minimumArea",10);i=n.fromVertices(u,c,x,e,w,b,A)}break;case"fromPhysicsEditor":i=a.parseBody(u,c,t,e);break;case"fromPhysicsTracer":i=h.parseBody(u,c,t,e)}return i&&this.setExistingBody(i,t.addToWorld),this}};t.exports=u},function(t,e,i){var n=i(272),r=i(165),s=i(166),o={setToSleep:function(){return r.set(this.body,!0),this},setAwake:function(){return r.set(this.body,!1),this},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){t.exports="afteradd"},function(t,e){t.exports="afterremove"},function(t,e){t.exports="afterupdate"},function(t,e){t.exports="beforeadd"},function(t,e){t.exports="beforeremove"},function(t,e){t.exports="beforeupdate"},function(t,e){t.exports="collisionactive"},function(t,e){t.exports="collisionend"},function(t,e){t.exports="collisionstart"},function(t,e){t.exports="dragend"},function(t,e){t.exports="drag"},function(t,e){t.exports="dragstart"},function(t,e){t.exports="pause"},function(t,e){t.exports="resume"},function(t,e){t.exports="sleepend"},function(t,e){t.exports="sleepstart"},function(t,e,i){var n=i(41),r={setStatic:function(t){return n.setStatic(this.body,t),this},isStatic:function(){return this.body.isStatic}};t.exports=r},function(t,e,i){var n=i(41),r=i(14),s=i(269),o=i(270),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){var n=i(41),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(118),s=i(32);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){var n=i(123),r=i(271),s=i(86),o=i(41),a=i(1392),h=i(84),l=i(0),u=i(118),c=i(591),d=i(128),p=i(273),f=i(50),m=i(1394),g=i(2),v=i(6),y=i(597),x=i(1525),w=i(1526),b=i(1399),A=i(1527),T=i(127),S=i(250),E=i(598),M=i(595),_=i(24),C=i(1400),P=i(599),R=i(274),L=i(20),O=i(592),D=i(83),B=i(64),I=i(1402),F=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=u,this.detector=p,this.grid=y,this.pair=S,this.pairs=E,this.query=C,this.resolver=P,this.sat=R,this.constraint=d,this.bodies=s,this.composites=c,this.axes=r,this.bounds=h,this.svg=O,this.vector=D,this.vertices=B,this.verts=B,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 I(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 I(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 T(g(e,"matter",{}),g(t,"matter",{}))},enableAttractorPlugin:function(){return M.register(x),M.use(b,x),this},enableWrapPlugin:function(){return M.register(A),M.use(b,A),this},enableCollisionEventsPlugin:function(){return M.register(w),M.use(b,w),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;h<a.length;h++)o.push(a[h].body);return o},intersectBody:function(t,e){e=this.getMatterBodies(e);for(var i=[],n=C.collides(t,e),r=0;r<n.length;r++){var s=n[r];s.bodyA===t?i.push(s.bodyB):i.push(s.bodyA)}return i},overlap:function(t,e,i,n,r){void 0===i&&(i=null),void 0===n&&(n=null),void 0===r&&(r=i),Array.isArray(t)||(t=[t]),t=this.getMatterBodies(t),e=this.getMatterBodies(e);for(var s=!1,o=0;o<t.length;o++)for(var a=t[o],h=C.collides(a,e),l=0;l<h.length;l++){var u=h[l],c=u.bodyA.id===a.id?u.bodyB:u.bodyA;if(!n||n.call(r,a,c,u))if(s=!0,i)i.call(r,a,c,u);else if(!n)return!0}return s},setCollisionCategory:function(t,e){return(t=this.getMatterBodies(t)).forEach((function(t){t.collisionFilter.category=e})),this},setCollisionGroup:function(t,e){return(t=this.getMatterBodies(t)).forEach((function(t){t.collisionFilter.group=e})),this},setCollidesWith:function(t,e){t=this.getMatterBodies(t);var i=0;if(Array.isArray(e))for(var n=0;n<e.length;n++)i|=e[n];else i=e;return t.forEach((function(t){t.collisionFilter.mask=i})),this},getMatterBodies:function(t){if(!t)return this.world.getAllBodies();Array.isArray(t)||(t=[t]);for(var e=[],i=0;i<t.length;i++){var n=t[i].hasOwnProperty("body")?t[i].body:t[i];e.push(n)}return e},setVelocity:function(t,e,i){t=this.getMatterBodies(t);var n=this._tempVec2;return n.x=e,n.y=i,t.forEach((function(t){o.setVelocity(t,n)})),this},setVelocityX:function(t,e){t=this.getMatterBodies(t);var i=this._tempVec2;return i.x=e,t.forEach((function(t){i.y=t.velocity.y,o.setVelocity(t,i)})),this},setVelocityY:function(t,e){t=this.getMatterBodies(t);var i=this._tempVec2;return i.y=e,t.forEach((function(t){i.x=t.velocity.x,o.setVelocity(t,i)})),this},setAngularVelocity:function(t,e){return(t=this.getMatterBodies(t)).forEach((function(t){o.setAngularVelocity(t,e)})),this},applyForce:function(t,e){t=this.getMatterBodies(t);var i=this._tempVec2;return t.forEach((function(t){i.x=t.position.x,i.y=t.position.y,o.applyForce(t,i,e)})),this},applyForceFromPosition:function(t,e,i,n){t=this.getMatterBodies(t);var r=this._tempVec2;return t.forEach((function(t){void 0===n&&(n=t.angle),r.x=i*Math.cos(n),r.y=i*Math.sin(n),o.applyForce(t,e,r)})),this},applyForceFromAngle:function(t,e,i){t=this.getMatterBodies(t);var n=this._tempVec2;return t.forEach((function(t){void 0===i&&(i=t.angle),n.x=e*Math.cos(i),n.y=e*Math.sin(i),o.applyForce(t,{x:t.position.x,y:t.position.y},n)})),this},getConstraintLength:function(t){var e=t.pointA.x,i=t.pointA.y,n=t.pointB.x,r=t.pointB.y;return t.bodyA&&(e+=t.bodyA.position.x,i+=t.bodyA.position.y),t.bodyB&&(n+=t.bodyB.position.x,r+=t.bodyB.position.y),f(e,i,n,r)},alignBody:function(t,e,i,r){var s;switch(t=t.hasOwnProperty("body")?t.body:t,r){case n.TOP_LEFT:case n.LEFT_TOP:s=this.bodyBounds.getTopLeft(t,e,i);break;case n.TOP_CENTER:s=this.bodyBounds.getTopCenter(t,e,i);break;case n.TOP_RIGHT:case n.RIGHT_TOP:s=this.bodyBounds.getTopRight(t,e,i);break;case n.LEFT_CENTER:s=this.bodyBounds.getLeftCenter(t,e,i);break;case n.CENTER:s=this.bodyBounds.getCenter(t,e,i);break;case n.RIGHT_CENTER:s=this.bodyBounds.getRightCenter(t,e,i);break;case n.LEFT_BOTTOM:case n.BOTTOM_LEFT:s=this.bodyBounds.getBottomLeft(t,e,i);break;case n.BOTTOM_CENTER:s=this.bodyBounds.getBottomCenter(t,e,i);break;case n.BOTTOM_RIGHT:case n.RIGHT_BOTTOM:s=this.bodyBounds.getBottomRight(t,e,i)}return s&&o.setPosition(t,s),this},shutdown:function(){var t=this.systems.events;this.world&&(t.off(L.UPDATE,this.world.update,this.world),t.off(L.POST_UPDATE,this.world.postUpdate,this.world)),t.off(L.SHUTDOWN,this.shutdown,this),this.add&&this.add.destroy(),this.world&&this.world.destroy(),this.add=null,this.world=null},destroy:function(){this.shutdown(),this.scene.sys.events.off(L.START,this.start,this),this.scene=null,this.systems=null}});_.register("MatterPhysics",F,"matterPhysics"),t.exports=F},function(t,e,i){var n=i(594),r={name:"matter-attractors",version:"0.1.7",for:"matter-js@^0.14.2",silent:!0,install:function(t){t.after("Body.create",(function(){r.Body.init(this)})),t.before("Engine.update",(function(t){r.Engine.update(t)}))},Body:{init:function(t){t.plugin.attractors=t.plugin.attractors||[]}},Engine:{update:function(t){for(var e=n.Composite.allBodies(t.world),i=0;i<e.length;i++){var r=e[i],s=r.plugin.attractors;if(s&&s.length>0)for(var o=0;o<e.length;o++){var a=e[o];if(i!==o)for(var h=0;h<s.length;h++){var l=s[h],u=l;n.Common.isFunction(l)&&(u=l(r,a)),u&&n.Body.applyForce(a,a.position,u)}}}}},Attractors:{gravityConstant:.001,gravity:function(t,e){var i=n.Vector.sub(e.position,t.position),s=n.Vector.magnitudeSquared(i)||1e-4,o=n.Vector.normalise(i),a=-r.Attractors.gravityConstant*(t.mass*e.mass/s),h=n.Vector.mult(o,a);n.Body.applyForce(t,t.position,n.Vector.neg(h)),n.Body.applyForce(e,e.position,h)}}};t.exports=r},function(t,e){t.exports={name:"matter-collision-events",version:"0.1.6",for:"matter-js@^0.14.2",silent:!0,install:function(t){t.after("Engine.create",(function(){t.Events.on(this,"collisionStart",(function(e){e.pairs.map((function(e){var i=e.bodyA,n=e.bodyB;i.gameObject&&i.gameObject.emit("collide",i,n,e),n.gameObject&&n.gameObject.emit("collide",n,i,e),t.Events.trigger(i,"onCollide",{pair:e}),t.Events.trigger(n,"onCollide",{pair:e}),i.onCollideCallback&&i.onCollideCallback(e),n.onCollideCallback&&n.onCollideCallback(e),i.onCollideWith[n.id]&&i.onCollideWith[n.id](n,e),n.onCollideWith[i.id]&&n.onCollideWith[i.id](i,e)}))})),t.Events.on(this,"collisionActive",(function(e){e.pairs.map((function(e){var i=e.bodyA,n=e.bodyB;i.gameObject&&i.gameObject.emit("collideActive",i,n,e),n.gameObject&&n.gameObject.emit("collideActive",n,i,e),t.Events.trigger(i,"onCollideActive",{pair:e}),t.Events.trigger(n,"onCollideActive",{pair:e}),i.onCollideActiveCallback&&i.onCollideActiveCallback(e),n.onCollideActiveCallback&&n.onCollideActiveCallback(e)}))})),t.Events.on(this,"collisionEnd",(function(e){e.pairs.map((function(e){var i=e.bodyA,n=e.bodyB;i.gameObject&&i.gameObject.emit("collideEnd",i,n,e),n.gameObject&&n.gameObject.emit("collideEnd",n,i,e),t.Events.trigger(i,"onCollideEnd",{pair:e}),t.Events.trigger(n,"onCollideEnd",{pair:e}),i.onCollideEndCallback&&i.onCollideEndCallback(e),n.onCollideEndCallback&&n.onCollideEndCallback(e)}))}))}))}}},function(t,e,i){var n=i(594),r={name:"matter-wrap",version:"0.1.4",for:"matter-js@^0.14.2",silent:!0,install:function(t){t.after("Engine.update",(function(){r.Engine.update(this)}))},Engine:{update:function(t){for(var e=t.world,i=n.Composite.allBodies(e),s=n.Composite.allComposites(e),o=0;o<i.length;o+=1){var a=i[o];a.plugin.wrap&&r.Body.wrap(a,a.plugin.wrap)}for(o=0;o<s.length;o+=1){var h=s[o];h.plugin.wrap&&r.Composite.wrap(h,h.plugin.wrap)}}},Bounds:{wrap:function(t,e){var i=null,n=null;if(void 0!==e.min.x&&void 0!==e.max.x&&(t.min.x>e.max.x?i=e.min.x-t.max.x:t.max.x<e.min.x&&(i=e.max.x-t.min.x)),void 0!==e.min.y&&void 0!==e.max.y&&(t.min.y>e.max.y?n=e.min.y-t.max.y:t.max.y<e.min.y&&(n=e.max.y-t.min.y)),null!==i||null!==n)return{x:i||0,y:n||0}}},Body:{wrap:function(t,e){var i=r.Bounds.wrap(t.bounds,e);return i&&n.Body.translate(t,i),i}},Composite:{bounds:function(t){for(var e=n.Composite.allBodies(t),i=[],r=0;r<e.length;r+=1){var s=e[r];i.push(s.bounds.min,s.bounds.max)}return n.Bounds.create(i)},wrap:function(t,e){var i=r.Bounds.wrap(r.Composite.bounds(t),e);return i&&n.Composite.translate(t,i),i}}};t.exports=r},function(t,e,i){(function(e){var n=i(33),r=i(17),s={Actions:i(275),Animations:i(723),BlendModes:i(35),Cache:i(735),Cameras:i(738),Core:i(806),Class:i(0),Create:i(888),Curves:i(894),Data:i(896),Display:i(898),DOM:i(917),Events:i(918),Game:i(920),GameObjects:i(1011),Geom:i(483),Input:i(1308),Loader:i(1338),Math:i(193),Physics:i(1493),Plugins:i(1403),Renderer:i(1405),Scale:i(1412),ScaleModes:i(168),Scene:i(418),Scenes:i(1413),Structs:i(1415),Textures:i(1416),Tilemaps:i(1418),Time:i(1461),Tweens:i(1463),Utils:i(1481)};s.Sound=i(1492),s=r(!1,s,n),t.exports=s,e.Phaser=s}).call(this,i(600))}])},t.exports=n()},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";function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function s(t,e){return(s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function o(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=h(t);if(e){var r=h(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return a(this,i)}}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function h(t){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}i.r(e);var l,u,c=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s(t,e)}(h,t);var e,i,n,a=o(h);function h(t,e){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,h),(i=a.call(this)).active=!1,i.orientToMovement=!1,e&&(i.orientToMovement=!0),i.scene=t,i.geometry=null,i.mesh=null,i.nodeCenters=null,i.lastNodeCenter=null,i.currentNodeCenter=null,i.lastOrientationDir=null,i.nodeIDs=null,i.currentLength=0,i.currentEnd=0,i.currentNodeID=0,i}return e=h,i&&r(e.prototype,i),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(i(0).Object3D);THREE.TrailRenderer=c,THREE.TrailRenderer.prototype.constructor=THREE.TrailRenderer,THREE.TrailRenderer.MaxHeadVertices=128,THREE.TrailRenderer.LocalOrientationTangent=new THREE.Vector3(1,0,0),THREE.TrailRenderer.LocalOrientationDirection=new THREE.Vector3(0,0,-1),THREE.TrailRenderer.LocalHeadOrigin=new THREE.Vector3(0,0,0),THREE.TrailRenderer.PositionComponentCount=3,THREE.TrailRenderer.UVComponentCount=2,THREE.TrailRenderer.IndicesPerFace=3,THREE.TrailRenderer.FacesPerQuad=2,THREE.TrailRenderer.Shader={},THREE.TrailRenderer.Shader.BaseVertexVars=["attribute float nodeID;","attribute float nodeVertexID;","attribute vec3 nodeCenter;","uniform float minID;","uniform float maxID;","uniform float trailLength;","uniform float maxTrailLength;","uniform float verticesPerNode;","uniform vec2 textureTileFactor;","uniform vec4 headColor;","uniform vec4 tailColor;","uniform vec4 midColor;","varying vec4 vColor;"].join("\n"),THREE.TrailRenderer.Shader.TexturedVertexVars=[THREE.TrailRenderer.Shader.BaseVertexVars,"varying vec2 vUV;","uniform float dragTexture;"].join("\n"),THREE.TrailRenderer.Shader.BaseFragmentVars=["varying vec4 vColor;","uniform sampler2D tex;"].join("\n"),THREE.TrailRenderer.Shader.TexturedFragmentVars=[THREE.TrailRenderer.Shader.BaseFragmentVars,"varying vec2 vUV;"].join("\n"),THREE.TrailRenderer.Shader.VertexShaderCore=["float fraction = ( maxID - nodeID ) / ( maxID - minID );","\n\tif(fraction < 0.2){\n\t\tvColor = ( 1.0 - fraction * 5.0 ) * headColor + fraction * 5.0 * midColor;\n\t}\n\telse{\n\t\tvColor = ( 2.0 - fraction * 5.0 ) * midColor + (fraction-0.2) * 5.0 * tailColor;\n\t}\n\t","vColor = ( 1.0 - fraction ) * headColor + fraction * tailColor;","vec4 realPosition = vec4( ( 1.0 - fraction ) * position.xyz + fraction * nodeCenter.xyz, 1.0 ); "].join("\n"),THREE.TrailRenderer.Shader.BaseVertexShader=[THREE.TrailRenderer.Shader.BaseVertexVars,"void main() { ",THREE.TrailRenderer.Shader.VertexShaderCore,"gl_Position = projectionMatrix * viewMatrix * realPosition;","}"].join("\n"),THREE.TrailRenderer.Shader.BaseFragmentShader=[THREE.TrailRenderer.Shader.BaseFragmentVars,"void main() { ","gl_FragColor = vColor;","}"].join("\n"),THREE.TrailRenderer.Shader.TexturedVertexShader=[THREE.TrailRenderer.Shader.TexturedVertexVars,"void main() { ",THREE.TrailRenderer.Shader.VertexShaderCore,"float s = 0.0;","float t = 0.0;","if ( dragTexture == 1.0 ) { "," s = fraction * textureTileFactor.s; "," \tt = ( nodeVertexID / verticesPerNode ) * textureTileFactor.t;","} else { ","\ts = nodeID / maxTrailLength * textureTileFactor.s;"," \tt = ( nodeVertexID / verticesPerNode ) * textureTileFactor.t;","}","vUV = vec2( s, t ); ","gl_Position = projectionMatrix * viewMatrix * realPosition;","}"].join("\n"),THREE.TrailRenderer.Shader.TexturedFragmentShader=[THREE.TrailRenderer.Shader.TexturedFragmentVars,"void main() { ","vec4 textureColor = texture2D( tex, vUV );","gl_FragColor = vColor * textureColor;","}"].join("\n"),THREE.TrailRenderer.createMaterial=function(t,e,i){return(i=i||{}).trailLength={type:"f",value:null},i.verticesPerNode={type:"f",value:null},i.minID={type:"f",value:null},i.maxID={type:"f",value:null},i.dragTexture={type:"f",value:null},i.maxTrailLength={type:"f",value:null},i.textureTileFactor={type:"v2",value:null},i.headColor={type:"v4",value:new THREE.Vector4},i.midColor={type:"v4",value:new THREE.Vector4},i.tailColor={type:"v4",value:new THREE.Vector4},t=t||THREE.TrailRenderer.Shader.BaseVertexShader,e=e||THREE.TrailRenderer.Shader.BaseFragmentShader,new THREE.ShaderMaterial({uniforms:i,vertexShader:t,fragmentShader:e,transparent:!0,alphaTest:.5,blending:THREE.CustomBlending,blendSrc:THREE.SrcAlphaFactor,blendDst:THREE.OneMinusSrcAlphaFactor,blendEquation:THREE.AddEquation,depthTest:!0,depthWrite:!1,side:THREE.DoubleSide})},THREE.TrailRenderer.createBaseMaterial=function(t){return this.createMaterial(THREE.TrailRenderer.Shader.BaseVertexShader,THREE.TrailRenderer.Shader.BaseFragmentShader,t)},THREE.TrailRenderer.createTexturedMaterial=function(t){return(t={}).tex={type:"t",value:null},this.createMaterial(THREE.TrailRenderer.Shader.TexturedVertexShader,THREE.TrailRenderer.Shader.TexturedFragmentShader,t)},THREE.TrailRenderer.prototype.initialize=function(t,e,i,n,r,s){this.deactivate(),this.destroyMesh(),this.length=e>0?e+1:0,this.dragTexture=i?1:0,this.targetObject=s,this.initializeLocalHeadGeometry(n,r),this.nodeIDs=[],this.nodeCenters=[];for(var o=0;o<this.length;o++)this.nodeIDs[o]=-1,this.nodeCenters[o]=new THREE.Vector3;this.material=t,this.initializeGeometry(),this.initializeMesh(),this.material.uniforms.trailLength.value=0,this.material.uniforms.minID.value=0,this.material.uniforms.maxID.value=0,this.material.uniforms.dragTexture.value=this.dragTexture,this.material.uniforms.maxTrailLength.value=this.length,this.material.uniforms.verticesPerNode.value=this.VerticesPerNode,this.material.uniforms.textureTileFactor.value=new THREE.Vector2(1,1),this.reset()},THREE.TrailRenderer.prototype.initializeLocalHeadGeometry=function(t,e){if(this.localHeadGeometry=[],e){this.VerticesPerNode=0;for(var i=0;i<e.length&&i<THREE.TrailRenderer.MaxHeadVertices;i++){var n=e[i];if(n&&n instanceof THREE.Vector3){var r=new THREE.Vector3;r.copy(n),this.localHeadGeometry.push(r),this.VerticesPerNode++}}}else{var s=t||1;s/=2,this.localHeadGeometry.push(new THREE.Vector3(-s,0,0)),this.localHeadGeometry.push(new THREE.Vector3(s,0,0)),this.VerticesPerNode=2}this.FacesPerNode=2*(this.VerticesPerNode-1),this.FaceIndicesPerNode=3*this.FacesPerNode},THREE.TrailRenderer.prototype.initializeGeometry=function(){this.vertexCount=this.length*this.VerticesPerNode,this.faceCount=this.length*this.FacesPerNode;var t=new THREE.BufferGeometry,e=new Float32Array(this.vertexCount),i=new Float32Array(this.vertexCount*this.VerticesPerNode),n=new Float32Array(this.vertexCount*THREE.TrailRenderer.PositionComponentCount),r=new Float32Array(this.vertexCount*THREE.TrailRenderer.PositionComponentCount),s=new Float32Array(this.vertexCount*THREE.TrailRenderer.UVComponentCount),o=new Uint32Array(this.faceCount*THREE.TrailRenderer.IndicesPerFace),a=new THREE.BufferAttribute(e,1);a.setUsage(35048),t.setAttribute("nodeID",a);var h=new THREE.BufferAttribute(i,1);h.setUsage(35048),t.setAttribute("nodeVertexID",h);var l=new THREE.BufferAttribute(r,THREE.TrailRenderer.PositionComponentCount);l.setUsage(35048),t.setAttribute("nodeCenter",l);var u=new THREE.BufferAttribute(n,THREE.TrailRenderer.PositionComponentCount);u.setUsage(35048),t.setAttribute("position",u);var c=new THREE.BufferAttribute(s,THREE.TrailRenderer.UVComponentCount);c.setUsage(35048),t.setAttribute("uv",c);var d=new THREE.BufferAttribute(o,1);d.setUsage(35048),t.setIndex(d),this.geometry=t},THREE.TrailRenderer.prototype.zeroVertices=function(){for(var t=this.geometry.getAttribute("position"),e=0;e<this.vertexCount;e++){var i=3*e;t.array[i]=0,t.array[i+1]=0,t.array[i+2]=0}t.needsUpdate=!0,t.updateRange.count=-1},THREE.TrailRenderer.prototype.zeroIndices=function(){for(var t=this.geometry.getIndex(),e=0;e<this.faceCount;e++){var i=3*e;t.array[i]=0,t.array[i+1]=0,t.array[i+2]=0}t.needsUpdate=!0,t.updateRange.count=-1},THREE.TrailRenderer.prototype.formInitialFaces=function(){this.zeroIndices();for(var t=this.geometry.getIndex(),e=0;e<this.length-1;e++)this.connectNodes(e,e+1);t.needsUpdate=!0,t.updateRange.count=-1},THREE.TrailRenderer.prototype.initializeMesh=function(){this.mesh=new THREE.Mesh(this.geometry,this.material),this.mesh.dynamic=!0,this.mesh.matrixAutoUpdate=!1,this.mesh.frustumCulled=!1},THREE.TrailRenderer.prototype.destroyMesh=function(){this.mesh&&(this.scene.remove(this.mesh),this.mesh=null)},THREE.TrailRenderer.prototype.reset=function(){this.currentLength=0,this.currentEnd=-1,this.lastNodeCenter=null,this.currentNodeCenter=null,this.lastOrientationDir=null,this.currentNodeID=0,this.formInitialFaces(),this.zeroVertices(),this.geometry.setDrawRange(0,0)},THREE.TrailRenderer.prototype.updateUniforms=function(){this.currentLength<this.length?this.material.uniforms.minID.value=0:this.material.uniforms.minID.value=this.currentNodeID-this.length,this.material.uniforms.maxID.value=this.currentNodeID,this.material.uniforms.trailLength.value=this.currentLength,this.material.uniforms.maxTrailLength.value=this.length,this.material.uniforms.verticesPerNode.value=this.VerticesPerNode},THREE.TrailRenderer.prototype.advance=function(){new THREE.Vector3,new THREE.Vector3,new THREE.Vector3;var t=new THREE.Matrix4;return function(){this.targetObject.updateMatrixWorld(),t.copy(this.targetObject.matrixWorld),this.advanceWithTransform(t),this.updateUniforms()}}(),THREE.TrailRenderer.prototype.advanceWithPositionAndOrientation=function(t,e){this.advanceGeometry({position:t,tangent:e},null)},THREE.TrailRenderer.prototype.advanceWithTransform=function(t){this.advanceGeometry(null,t)},THREE.TrailRenderer.prototype.advanceGeometry=function(){new THREE.Vector3,new THREE.Vector3;return function(t,e){var i=this.currentEnd+1>=this.length?0:this.currentEnd+1;if(e?this.updateNodePositionsFromTransformMatrix(i,e):this.updateNodePositionsFromOrientationTangent(i,t.position,t.tangent),this.currentLength>=1){this.connectNodes(this.currentEnd,i);if(this.currentLength>=this.length){var n=this.currentEnd+1>=this.length?0:this.currentEnd+1;this.disconnectNodes(n)}}this.currentLength<this.length&&this.currentLength++,this.currentEnd++,this.currentEnd>=this.length&&(this.currentEnd=0),this.currentLength>=1&&(this.currentLength<this.length?this.geometry.setDrawRange(0,(this.currentLength-1)*this.FaceIndicesPerNode):this.geometry.setDrawRange(0,this.currentLength*this.FaceIndicesPerNode)),this.updateNodeID(this.currentEnd,this.currentNodeID),this.currentNodeID++}}(),THREE.TrailRenderer.prototype.updateHead=(l=new THREE.Matrix4,function(){this.currentEnd<0||(this.targetObject.updateMatrixWorld(),l.copy(this.targetObject.matrixWorld),this.updateNodePositionsFromTransformMatrix(this.currentEnd,l))}),THREE.TrailRenderer.prototype.updateNodeID=function(t,e){this.nodeIDs[t]=e;for(var i=this.geometry.getAttribute("nodeID"),n=this.geometry.getAttribute("nodeVertexID"),r=0;r<this.VerticesPerNode;r++){var s=t*this.VerticesPerNode+r;i.array[s]=e,n.array[s]=r}i.needsUpdate=!0,n.needsUpdate=!0,i.updateRange.offset=t*this.VerticesPerNode,i.updateRange.count=this.VerticesPerNode,n.updateRange.offset=t*this.VerticesPerNode,n.updateRange.count=this.VerticesPerNode},THREE.TrailRenderer.prototype.updateNodeCenter=function(t,e){this.lastNodeCenter=this.currentNodeCenter,this.currentNodeCenter=this.nodeCenters[t],this.currentNodeCenter.copy(e);for(var i=this.geometry.getAttribute("nodeCenter"),n=0;n<this.VerticesPerNode;n++){var r=3*(t*this.VerticesPerNode+n);i.array[r]=e.x,i.array[r+1]=e.y,i.array[r+2]=e.z}i.needsUpdate=!0,i.updateRange.offset=t*this.VerticesPerNode*THREE.TrailRenderer.PositionComponentCount,i.updateRange.count=this.VerticesPerNode*THREE.TrailRenderer.PositionComponentCount},THREE.TrailRenderer.prototype.updateNodePositionsFromOrientationTangent=function(){new THREE.Matrix4;for(var t=new THREE.Quaternion,e=new THREE.Vector3,i=[],n=0;n<THREE.TrailRenderer.MaxHeadVertices;n++){var r=new THREE.Vector3;i.push(r)}return function(n,r,s){var o=this.geometry.getAttribute("position");this.updateNodeCenter(n,r),e.copy(r),e.sub(THREE.TrailRenderer.LocalHeadOrigin),t.setFromUnitVectors(THREE.TrailRenderer.LocalOrientationTangent,s);for(var a=0;a<this.localHeadGeometry.length;a++){var h=i[a];h.copy(this.localHeadGeometry[a]),h.applyQuaternion(t),h.add(e)}for(a=0;a<this.localHeadGeometry.length;a++){var l=(this.VerticesPerNode*n+a)*THREE.TrailRenderer.PositionComponentCount,u=i[a];o.array[l]=u.x,o.array[l+1]=u.y,o.array[l+2]=u.z}o.needsUpdate=!0}}(),THREE.TrailRenderer.prototype.updateNodePositionsFromTransformMatrix=function(){new THREE.Matrix4;for(var t=new THREE.Matrix3,e=new THREE.Quaternion,i=new THREE.Vector3,n=new THREE.Vector3,r=new THREE.Vector3,s=new THREE.Vector3,o=[],a=0;a<THREE.TrailRenderer.MaxHeadVertices;a++){var h=new THREE.Vector3;o.push(h)}return function(a,h){var l,u,c=this.geometry.getAttribute("position");i.set(0,0,0),i.applyMatrix4(h),this.updateNodeCenter(a,i);for(var d=0;d<this.localHeadGeometry.length;d++){(p=o[d]).copy(this.localHeadGeometry[d])}for(d=0;d<this.localHeadGeometry.length;d++){(p=o[d]).applyMatrix4(h)}if(this.lastNodeCenter&&this.orientToMovement&&(l=t,u=h.elements,l.set(u[0],u[1],u[2],u[4],u[5],u[6],u[8],u[9],u[10]),r.set(0,0,-1),r.applyMatrix3(t),s.copy(this.currentNodeCenter),s.sub(this.lastNodeCenter),s.normalize(),s.lengthSq()<=1e-4&&this.lastOrientationDir&&s.copy(this.lastOrientationDir),s.lengthSq()>1e-4)){this.lastOrientationDir||(this.lastOrientationDir=new THREE.Vector3),e.setFromUnitVectors(r,s),n.copy(this.currentNodeCenter);for(d=0;d<this.localHeadGeometry.length;d++){var p;(p=o[d]).sub(n),p.applyQuaternion(e),p.add(n)}}for(d=0;d<this.localHeadGeometry.length;d++){var f=(this.VerticesPerNode*a+d)*THREE.TrailRenderer.PositionComponentCount,m=o[d];c.array[f]=m.x,c.array[f+1]=m.y,c.array[f+2]=m.z}c.needsUpdate=!0,c.updateRange.offset=a*this.VerticesPerNode*THREE.TrailRenderer.PositionComponentCount,c.updateRange.count=this.VerticesPerNode*THREE.TrailRenderer.PositionComponentCount}}(),THREE.TrailRenderer.prototype.connectNodes=(u={attribute:null,offset:0,count:-1},function(t,e){for(var i=this.geometry.getIndex(),n=0;n<this.localHeadGeometry.length-1;n++){var r=this.VerticesPerNode*t+n,s=this.VerticesPerNode*e+n,o=(t*this.FacesPerNode+n*THREE.TrailRenderer.FacesPerQuad)*THREE.TrailRenderer.IndicesPerFace;i.array[o]=r,i.array[o+1]=s,i.array[o+2]=r+1,i.array[o+3]=s,i.array[o+4]=s+1,i.array[o+5]=r+1}return i.needsUpdate=!0,i.updateRange.count=-1,u.attribute=i,u.offset=t*this.FacesPerNode*THREE.TrailRenderer.IndicesPerFace,u.count=this.FacesPerNode*THREE.TrailRenderer.IndicesPerFace,u}),THREE.TrailRenderer.prototype.disconnectNodes=function(t){var e={attribute:null,offset:0,count:-1};return function(t){for(var i=this.geometry.getIndex(),n=0;n<this.localHeadGeometry.length-1;n++){this.VerticesPerNode;var r=(t*this.FacesPerNode+n*THREE.TrailRenderer.FacesPerQuad)*THREE.TrailRenderer.IndicesPerFace;i.array[r]=0,i.array[r+1]=0,i.array[r+2]=0,i.array[r+3]=0,i.array[r+4]=0,i.array[r+5]=0}return i.needsUpdate=!0,i.updateRange.count=-1,e.attribute=i,e.offset=t*this.FacesPerNode*THREE.TrailRenderer.IndicesPerFace,e.count=this.FacesPerNode*THREE.TrailRenderer.IndicesPerFace,e}}(),THREE.TrailRenderer.prototype.deactivate=function(){this.isActive&&(this.scene.remove(this.mesh),this.isActive=!1)},THREE.TrailRenderer.prototype.activate=function(){this.isActive||(this.scene.add(this.mesh),this.isActive=!0)}},function(t,e){t.exports="data:image/png;base64,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"},function(t,e){t.exports="data:font/woff2;base64,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"},function(t,e,i){"use strict";i.r(e);i(58);var n=i(34),r=(i(61),i(1));function s(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var o,a,h=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,n;return e=t,n=[{key:"upgradePhaser",value:function(){this.game=r.a.phaserGame,this.upgradeTweens()}},{key:"upgradeTweens",value:function(){var t=this.game.scene.getScenes(!1),e=t[0].tweens.__proto__.add,i=this._disectTweenConfig;t[0].tweens.__proto__.add=function(t){var n=i(t),r=n.config,s=n.functions,o=e.call(this,r);return n.hasDynamic&&o.on("update",(function(t,e,i){if("dynamic__"===e.substr(0,9)){var n=e.substr(9);i[n]=s[n].lerp(s[n].getStart(i,n,i[e],t.targets.indexOf(i),t.targets.length,t),s[n].getEnd(i,n,i[e],t.targets.indexOf(i),t.targets.length,t),i[e])}})),o}}},{key:"_disectTweenConfig",value:function(t){var e={config:{},functions:{}};for(var i in t)e.config[i]=t[i];var n=[];for(var r in t.props)if(t.props[r].dynamic){for(var s in e.config.props["dynamic__"+r]={value:{getStart:function(){return 0},getEnd:function(){return 1}}},e.functions[r]={},t.props[r])"value"===s?(e.functions[r].getStart=t.props[r].value.getStart,e.functions[r].getEnd=t.props[r].value.getEnd,t.props[r].lerp?e.functions[r].lerp=t.props[r].lerp:e.functions[r].lerp=function(t,e,i){return(1-i)*t+i*e}):e.config.props["dynamic__"+r][s]=t.props[r][s];n.push(r)}return n.forEach((function(t){delete e.config[t]})),e.hasDynamic=n.length>0,e}}],(i=null)&&s(e.prototype,i),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function l(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var u=0,c=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var i={width:800,height:800,type:Phaser.CANVAS,render:{antialias:!0,transparent:!0},scene:{preload:function(){u>0||(u++,o=this,r.a.phaserScene=this,this.load.atlas("atlas","assets/ui/atlas.png","assets/ui/atlas.json"),this.load.atlas("uiatlas","assets/uiatlas/uiatlas.png","assets/uiatlas/uiatlas.json"),this.load.image("drawArea","assets/ui/draw_kanvas.png"),h.upgradePhaser())},create:function(){a.canvas.style.zIndex=2,e&&e(),r.a.eventEmitter.emit("phaserReady")},update:function(){}}};a=new Phaser.Game(i),r.a.phaserGame=a}var e,i,n;return e=t,(i=[{key:"resize",value:function(t,e){var i=a.config.width,n=a.config.height,r=Math.min(t/i,e/n)+.0015,s=t/r,h=e/r;a.canvas.style["-ms-transform"]="scale("+r+")",a.canvas.style["-webkit-transform"]="scale3d("+r+", 1)",a.canvas.style["-moz-transform"]="scale("+r+")",a.canvas.style["-o-transform"]="scale("+r+")",a.canvas.style.transform="scale("+r+")",a.canvas.style.transformOrigin="top left",o.lastWidth=s,o.lastHeight=h,a.scale.resize(s,h),a.scene.scenes.forEach((function(t){t.cameras.resize(s,h),t.children.list.forEach((function(t){t.onResizeCallback&&t.onResizeCallback(s,h)}))}))}}])&&l(e.prototype,i),n&&l(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),d={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 <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">$1</a>',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}},p=i(0);const f={type:"change"},m={type:"start"},g={type:"end"};class v extends p.EventDispatcher{constructor(t,e){super(),document,this.object=t,this.domElement=e,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new p.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:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:p.MOUSE.ROTATE,MIDDLE:p.MOUSE.DOLLY,RIGHT:p.MOUSE.PAN},this.touches={ONE:p.TOUCH.ROTATE,TWO:p.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 o.phi},this.getAzimuthalAngle=function(){return o.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(t){t.addEventListener("keydown",j),this._domElementKeyEvents=t},this.saveState=function(){i.target0.copy(i.target),i.position0.copy(i.object.position),i.zoom0=i.object.zoom},this.reset=function(){i.target.copy(i.target0),i.object.position.copy(i.position0),i.object.zoom=i.zoom0,i.object.updateProjectionMatrix(),i.dispatchEvent(f),i.update(),r=n.NONE},this.update=function(){const e=new p.Vector3,c=(new p.Quaternion).setFromUnitVectors(t.up,new p.Vector3(0,1,0)),d=c.clone().invert(),m=new p.Vector3,g=new p.Quaternion,v=2*Math.PI;return function(){const t=i.object.position;e.copy(t).sub(i.target),e.applyQuaternion(c),o.setFromVector3(e),i.autoRotate&&r===n.NONE&&_(2*Math.PI/60/60*i.autoRotateSpeed),i.enableDamping?(o.theta+=a.theta*i.dampingFactor,o.phi+=a.phi*i.dampingFactor):(o.theta+=a.theta,o.phi+=a.phi);let p=i.minAzimuthAngle,y=i.maxAzimuthAngle;return isFinite(p)&&isFinite(y)&&(p<-Math.PI?p+=v:p>Math.PI&&(p-=v),y<-Math.PI?y+=v:y>Math.PI&&(y-=v),o.theta=p<=y?Math.max(p,Math.min(y,o.theta)):o.theta>(p+y)/2?Math.max(p,o.theta):Math.min(y,o.theta)),o.phi=Math.max(i.minPolarAngle,Math.min(i.maxPolarAngle,o.phi)),o.makeSafe(),o.radius*=h,o.radius=Math.max(i.minDistance,Math.min(i.maxDistance,o.radius)),!0===i.enableDamping?i.target.addScaledVector(l,i.dampingFactor):i.target.add(l),e.setFromSpherical(o),e.applyQuaternion(d),t.copy(i.target).add(e),i.object.lookAt(i.target),!0===i.enableDamping?(a.theta*=1-i.dampingFactor,a.phi*=1-i.dampingFactor,l.multiplyScalar(1-i.dampingFactor)):(a.set(0,0,0),l.set(0,0,0)),h=1,!!(u||m.distanceToSquared(i.object.position)>s||8*(1-g.dot(i.object.quaternion))>s)&&(i.dispatchEvent(f),m.copy(i.object.position),g.copy(i.object.quaternion),u=!1,!0)}}(),this.dispose=function(){i.domElement.removeEventListener("contextmenu",q),i.domElement.removeEventListener("pointerdown",H),i.domElement.removeEventListener("pointercancel",Y),i.domElement.removeEventListener("wheel",X),i.domElement.removeEventListener("pointermove",G),i.domElement.removeEventListener("pointerup",W),null!==i._domElementKeyEvents&&i._domElementKeyEvents.removeEventListener("keydown",j)};const i=this,n={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let r=n.NONE;const s=1e-6,o=new p.Spherical,a=new p.Spherical;let h=1;const l=new p.Vector3;let u=!1;const c=new p.Vector2,d=new p.Vector2,v=new p.Vector2,y=new p.Vector2,x=new p.Vector2,w=new p.Vector2,b=new p.Vector2,A=new p.Vector2,T=new p.Vector2,S=[],E={};function M(){return Math.pow(.95,i.zoomSpeed)}function _(t){a.theta-=t}function C(t){a.phi-=t}const P=function(){const t=new p.Vector3;return function(e,i){t.setFromMatrixColumn(i,0),t.multiplyScalar(-e),l.add(t)}}(),R=function(){const t=new p.Vector3;return function(e,n){!0===i.screenSpacePanning?t.setFromMatrixColumn(n,1):(t.setFromMatrixColumn(n,0),t.crossVectors(i.object.up,t)),t.multiplyScalar(e),l.add(t)}}(),L=function(){const t=new p.Vector3;return function(e,n){const r=i.domElement;if(i.object.isPerspectiveCamera){const s=i.object.position;t.copy(s).sub(i.target);let o=t.length();o*=Math.tan(i.object.fov/2*Math.PI/180),P(2*e*o/r.clientHeight,i.object.matrix),R(2*n*o/r.clientHeight,i.object.matrix)}else i.object.isOrthographicCamera?(P(e*(i.object.right-i.object.left)/i.object.zoom/r.clientWidth,i.object.matrix),R(n*(i.object.top-i.object.bottom)/i.object.zoom/r.clientHeight,i.object.matrix)):i.enablePan=!1}}();function O(t){i.object.isPerspectiveCamera?h/=t:i.object.isOrthographicCamera?(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom*t)),i.object.updateProjectionMatrix(),u=!0):i.enableZoom=!1}function D(t){i.object.isPerspectiveCamera?h*=t:i.object.isOrthographicCamera?(i.object.zoom=Math.max(i.minZoom,Math.min(i.maxZoom,i.object.zoom/t)),i.object.updateProjectionMatrix(),u=!0):i.enableZoom=!1}function B(t){c.set(t.clientX,t.clientY)}function I(t){y.set(t.clientX,t.clientY)}function F(){if(1===S.length)c.set(S[0].pageX,S[0].pageY);else{const t=.5*(S[0].pageX+S[1].pageX),e=.5*(S[0].pageY+S[1].pageY);c.set(t,e)}}function k(){if(1===S.length)y.set(S[0].pageX,S[0].pageY);else{const t=.5*(S[0].pageX+S[1].pageX),e=.5*(S[0].pageY+S[1].pageY);y.set(t,e)}}function N(){const t=S[0].pageX-S[1].pageX,e=S[0].pageY-S[1].pageY,i=Math.sqrt(t*t+e*e);b.set(0,i)}function z(t){if(1==S.length)d.set(t.pageX,t.pageY);else{const e=J(t),i=.5*(t.pageX+e.x),n=.5*(t.pageY+e.y);d.set(i,n)}v.subVectors(d,c).multiplyScalar(i.rotateSpeed);const e=i.domElement;_(2*Math.PI*v.x/e.clientHeight),C(2*Math.PI*v.y/e.clientHeight),c.copy(d)}function U(t){if(1===S.length)x.set(t.pageX,t.pageY);else{const e=J(t),i=.5*(t.pageX+e.x),n=.5*(t.pageY+e.y);x.set(i,n)}w.subVectors(x,y).multiplyScalar(i.panSpeed),L(w.x,w.y),y.copy(x)}function V(t){const e=J(t),n=t.pageX-e.x,r=t.pageY-e.y,s=Math.sqrt(n*n+r*r);A.set(0,s),T.set(0,Math.pow(A.y/b.y,i.zoomSpeed)),O(T.y),b.copy(A)}function H(t){!1!==i.enabled&&(0===S.length&&(i.domElement.setPointerCapture(t.pointerId),i.domElement.addEventListener("pointermove",G),i.domElement.addEventListener("pointerup",W)),function(t){S.push(t)}(t),"touch"===t.pointerType?function(t){switch(K(t),S.length){case 1:switch(i.touches.ONE){case p.TOUCH.ROTATE:if(!1===i.enableRotate)return;F(),r=n.TOUCH_ROTATE;break;case p.TOUCH.PAN:if(!1===i.enablePan)return;k(),r=n.TOUCH_PAN;break;default:r=n.NONE}break;case 2:switch(i.touches.TWO){case p.TOUCH.DOLLY_PAN:if(!1===i.enableZoom&&!1===i.enablePan)return;i.enableZoom&&N(),i.enablePan&&k(),r=n.TOUCH_DOLLY_PAN;break;case p.TOUCH.DOLLY_ROTATE:if(!1===i.enableZoom&&!1===i.enableRotate)return;i.enableZoom&&N(),i.enableRotate&&F(),r=n.TOUCH_DOLLY_ROTATE;break;default:r=n.NONE}break;default:r=n.NONE}r!==n.NONE&&i.dispatchEvent(m)}(t):function(t){let e;switch(t.button){case 0:e=i.mouseButtons.LEFT;break;case 1:e=i.mouseButtons.MIDDLE;break;case 2:e=i.mouseButtons.RIGHT;break;default:e=-1}switch(e){case p.MOUSE.DOLLY:if(!1===i.enableZoom)return;!function(t){b.set(t.clientX,t.clientY)}(t),r=n.DOLLY;break;case p.MOUSE.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===i.enablePan)return;I(t),r=n.PAN}else{if(!1===i.enableRotate)return;B(t),r=n.ROTATE}break;case p.MOUSE.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===i.enableRotate)return;B(t),r=n.ROTATE}else{if(!1===i.enablePan)return;I(t),r=n.PAN}break;default:r=n.NONE}r!==n.NONE&&i.dispatchEvent(m)}(t))}function G(t){!1!==i.enabled&&("touch"===t.pointerType?function(t){switch(K(t),r){case n.TOUCH_ROTATE:if(!1===i.enableRotate)return;z(t),i.update();break;case n.TOUCH_PAN:if(!1===i.enablePan)return;U(t),i.update();break;case n.TOUCH_DOLLY_PAN:if(!1===i.enableZoom&&!1===i.enablePan)return;!function(t){i.enableZoom&&V(t),i.enablePan&&U(t)}(t),i.update();break;case n.TOUCH_DOLLY_ROTATE:if(!1===i.enableZoom&&!1===i.enableRotate)return;!function(t){i.enableZoom&&V(t),i.enableRotate&&z(t)}(t),i.update();break;default:r=n.NONE}}(t):function(t){if(!1===i.enabled)return;switch(r){case n.ROTATE:if(!1===i.enableRotate)return;!function(t){d.set(t.clientX,t.clientY),v.subVectors(d,c).multiplyScalar(i.rotateSpeed);const e=i.domElement;_(2*Math.PI*v.x/e.clientHeight),C(2*Math.PI*v.y/e.clientHeight),c.copy(d),i.update()}(t);break;case n.DOLLY:if(!1===i.enableZoom)return;!function(t){A.set(t.clientX,t.clientY),T.subVectors(A,b),T.y>0?O(M()):T.y<0&&D(M()),b.copy(A),i.update()}(t);break;case n.PAN:if(!1===i.enablePan)return;!function(t){x.set(t.clientX,t.clientY),w.subVectors(x,y).multiplyScalar(i.panSpeed),L(w.x,w.y),y.copy(x),i.update()}(t)}}(t))}function W(t){Q(t),0===S.length&&(i.domElement.releasePointerCapture(t.pointerId),i.domElement.removeEventListener("pointermove",G),i.domElement.removeEventListener("pointerup",W)),i.dispatchEvent(g),r=n.NONE}function Y(t){Q(t)}function X(t){!1!==i.enabled&&!1!==i.enableZoom&&r===n.NONE&&(t.preventDefault(),i.dispatchEvent(m),function(t){t.deltaY<0?D(M()):t.deltaY>0&&O(M()),i.update()}(t),i.dispatchEvent(g))}function j(t){!1!==i.enabled&&!1!==i.enablePan&&function(t){let e=!1;switch(t.code){case i.keys.UP:L(0,i.keyPanSpeed),e=!0;break;case i.keys.BOTTOM:L(0,-i.keyPanSpeed),e=!0;break;case i.keys.LEFT:L(i.keyPanSpeed,0),e=!0;break;case i.keys.RIGHT:L(-i.keyPanSpeed,0),e=!0}e&&(t.preventDefault(),i.update())}(t)}function q(t){!1!==i.enabled&&t.preventDefault()}function Q(t){delete E[t.pointerId];for(let e=0;e<S.length;e++)if(S[e].pointerId==t.pointerId)return void S.splice(e,1)}function K(t){let e=E[t.pointerId];void 0===e&&(e=new p.Vector2,E[t.pointerId]=e),e.set(t.pageX,t.pageY)}function J(t){const e=t.pointerId===S[0].pointerId?S[1]:S[0];return E[e.pointerId]}i.domElement.addEventListener("contextmenu",q),i.domElement.addEventListener("pointerdown",H),i.domElement.addEventListener("pointercancel",Y),i.domElement.addEventListener("wheel",X,{passive:!1}),this.update()}}var y=i(13);function x(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var w=i(0);window.THREE=w;var b,A=function(){function t(e){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.config={width:800,height:800,FOV:75,cameraNear:1,cameraFar:1500,resolution:r.a.resolution,maxDimension:1e3},this.readyCallback=e,this.initRenderer((function(){i.readyCallback&&i.readyCallback()}))}var e,i,n;return e=t,(i=[{key:"initRenderer",value:function(t){var e=this,i=this.config,n=function n(){d.isWebGLAvailable()?function(){var n={antialias:r.a.antialiasDefault,alpha:!0,powerPreference:"high-performance",stencil:!1,depth:!0};r.a.postprocessEnabled&&(n.depth=!1,n.antialias=!1),r.a.gpuTier&&(r.a.gpuTier.tier>=3||!r.a.gpuTier.isMobile)?(n.antialias=!0,r.a.enableShadows=!0,i.resolution=1.4):(r.a.lowEndDevice=!0,r.a.enableShadows=!1,i.resolution=r.a.minResolution);var s=new w.WebGLRenderer(n);n.canvas||document.body.appendChild(s.domElement),s.setClearColor("#ff00ff",0);var o=new w.PerspectiveCamera(i.FOV||75,i.width/i.height,i.cameraNear||1,i.cameraFar||1500),a=new w.Scene,h=r.a.main;h.scene=a,h.camera=o,h.renderer=s,r.a.threeScene=a,r.a.threeRenderer=s,r.a.threeCamera=o,e.renderer=s,e.camera=o,e.scene=a,s.setSize(i.width,i.height),s.getContext().canvas.addEventListener("webglcontextlost",(function(t){t.preventDefault(),e.contextLost=!0}),!1),s.getContext().canvas.addEventListener("webglcontextrestored",(function(t){e.contextLost=!1}),!1);var l=e.initControls();r.a.controls=l,e.inited=!0,t()}():setTimeout((function(){n()}),250)};setTimeout((function(){n()}),50)}},{key:"resize",value:function(t,e){var i,n,s=r.a.threeCamera,o=r.a.threeRenderer,a=r.a.threeRenderer.domElement,h=this.config,l=h.resolution||1,u=1/l;if(h.maxDimension&&t*l>h.maxDimension&&e*l>h.maxDimension){var c=h.maxDimension;u=Math.min(t/c,e/c)+.0015,l=1,i=Math.ceil(t/u),n=Math.ceil(e/u)}else i=t*l,n=e*l;r.a.threeScene.lastWidth=i,r.a.threeScene.lastHeight=n,a.style["-ms-transform"]="scale("+u+")",a.style["-webkit-transform"]="scale3d("+u+", 1)",a.style["-moz-transform"]="scale("+u+")",a.style["-o-transform"]="scale("+u+")",a.style.transform="scale("+u+")",a.style.transformOrigin="top left";var d=i/n;s.aspect=d,s.updateProjectionMatrix(),y.a.inited?y.a.resize(i,n):o.setSize(i,n)}},{key:"update",value:function(t,e){this.inited&&!this.contextLost&&(r.a.lowEndDevice?(this.renderer.render(this.scene,this.camera),r.a.uiScene&&r.a.uiScene.update(e)):(r.a.uiScene&&r.a.uiScene.update(e),this.renderer.render(this.scene,this.camera)))}},{key:"initTestControls",value:function(){var t,e=this;this.isTest=!1,window.onkeydown=function(i){if("a"==i.key&&!e.isTest){e.isTest=!0;var n=r.a.main.camera.position.clone(),s=new w.Vector3(0,0,-100);s.applyQuaternion(r.a.main.camera.quaternion),n.add(s),(t=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2?arguments[2]:void 0,r=new v(e.camera,document.body);return r.enableDamping=!0,r.dampingFactor=.25,r.screenSpacePanning=!1,void 0!==n&&(r.maxPolarAngle=n),r.minDistance=t,r.maxDistance=i,r}(0,1500)).minDistance=0,t.maxDistance=1e3,t.target=new w.Vector3(n.x,n.y,n.z),t.update(),r.a.camera.enabled=!1}"s"==i.key&&e.isTest&&(e.isTest=!1,t.dispose&&t.dispose()),"c"==i.key&&e.isTest&&(r.a.camera.enabled=!r.a.camera.enabled),r.a.main.isTest=e.isTest}}},{key:"initControls",value:function(){var t={isDown:!1},e=document.body;function i(e){t.prevX=t.mouseX,t.prevY=t.mouseY,t.mouseX=e.pageX,t.mouseY=e.pageY}function n(r){t.isDown=!1,e.removeEventListener("mouseup",n),e.removeEventListener("mousemove",i)}function r(e){t.prevX=t.mouseX,t.prevY=t.mouseY,t.mouseX=e.touches[0].pageX,t.mouseY=e.touches[0].pageY}function s(i){t.isDown=!1,e.removeEventListener("touchend",s),e.removeEventListener("touchmove",r)}return e.addEventListener("mousedown",(function(r){t.downX=r.pageX,t.downY=r.pageY,t.mouseX=r.pageX,t.mouseY=r.pageY,t.prevX=r.pageX,t.prevY=r.pageY,t.isDown=!0,e.addEventListener("mouseup",n),e.addEventListener("mousemove",i)})),e.addEventListener("touchstart",(function(i){t.downX=i.touches[0].pageX,t.downY=i.touches[0].pageY,t.mouseX=i.touches[0].pageX,t.mouseY=i.touches[0].pageY,t.prevX=i.touches[0].pageX,t.prevY=i.touches[0].pageY,t.isDown=!0,e.addEventListener("touchend",s),e.addEventListener("touchmove",r)})),t}}])&&x(e.prototype,i),n&&x(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),T=i(8),S=i(12),E=i(4),M=i(7),_=i(37);function C(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var P=0,R=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),M.a.initWorld({x:0,y:-30,z:0}),b=r.a.main,app.main=b,b.renderer.outputEncoding=THREE.sRGBEncoding,b.renderer.physicallyCorrectLights=!0,b.renderer.shadowMap.enabled=r.a.enableShadows,b.renderer.shadowMapSoft=!0,b.renderer.shadowMap.type=THREE.PCFSoftShadowMap,r.a.postprocessEnabled&&y.a.init(b),this.init()}var e,i,n;return e=t,(i=[{key:"init",value:function(){b.scene.add(b.camera),this.initLights(),this.uiScene=new _.a({ambientLight:b.ambientLight,dirLight:b.directionalLight,camera:b.camera,scene:b.scene,renderer:b.renderer}),r.a.uiScene=this.uiScene,E.a.init(),T.a.init(),E.a.startState()}},{key:"initLights",value:function(){var t=new THREE.AmbientLight("#ffffff",.7);b.scene.add(t);var e=new THREE.DirectionalLight(16777215,4.2);e.position.set(90,361,90),b.scene.add(e),b.ambientLight=t,b.directionalLight=e,e.castShadow=!0,app.ambientLight=t,app.dirLight=e,e.shadow.camera.top=2,e.shadow.camera.bottom=-2,e.shadow.camera.left=-2,e.shadow.camera.right=2,e.shadow.mapSize.width=512,e.shadow.mapSize.height=512,e.shadow.bias=-2e-4}},{key:"resize",value:function(t,e){this.uiScene.resize(t,e)}},{key:"update",value:function(t,e){if(!app.pausegame){P+=e;for(var i=1/60*r.a.deltaMultiplier;P>=1/60;)M.a.world.step(i),E.a.update(i),P-=1/60}}},{key:"addDebugTeam",value:function(){!0,S.a.init(b),S.a.initStats(),S.a.addLights(),setTimeout((function(){S.a.gui.hide(),S.a.stats.dom.style.bottom=0,S.a.stats.dom.style.top="unset",S.a.stats.dom.childNodes.forEach((function(t){t.style.position="relative"}))}),10),setTimeout((function(){}),10)}}])&&C(e.prototype,i),n&&C(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),L=i(29);function O(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!i){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"==typeof t)return D(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return D(t,e)}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return o=t.done,t},e:function(t){a=!0,s=t},f:function(){try{o||null==i.return||i.return()}finally{if(a)throw s}}}}function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function B(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var I=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,n;return e=t,n=[{key:"load",value:function(t,e){var i=0,n=0;function r(){++i>=n&&(e&&e(),e=null)}var s,o=O(t);try{for(o.s();!(s=o.n()).done;){var a=s.value;n++,"font"==a.type&&this.loadFont(a.key,a.src,r)}}catch(t){o.e(t)}finally{o.f()}0==t.length&&setTimeout((function(){e&&e(),e=null}),100)}},{key:"loadFont",value:function(t,e,i){new FontFace(t,"url(".concat(e,")")).load().then((function(t){document.fonts.add(t),i()})).catch((function(t){return t}))}}],(i=null)&&B(e.prototype,i),n&&B(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}(),F=i(39),k=i(57);function N(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var z=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,i,n;return e=t,n=[{key:"checkBgMusicEnabled",value:function(){return r.a.data.soundEnabled&&r.a.data.bgMusicEnabled}},{key:"checkSoundEnabled",value:function(){return r.a.data.soundEnabled}},{key:"initDefault",value:function(){var t=this;if(app.playSfx=function(){},app.stopSfx=function(){},app.sfxFade=function(){},app.stopLastPlayed=function(){},app.playBgMusic=function(){},app.stopBgMusic=function(){},app.fadeBgMusic=function(){},app.fadeInBgMusic=function(){},this.checkBgMusicEnabled()){var e=new F.Howl({src:["assets/sounds/bg.m4a"],loop:r.a.data.bgMusicLoop,volume:r.a.data.bgMusicVolume});app.playBgMusic=function(){t.checkBgMusicEnabled()&&(e.playing()||e.play())},app.stopBgMusic=function(){t.checkBgMusicEnabled()&&e.stop()},app.fadeBgMusic=function(){t.checkBgMusicEnabled()&&e.fade(r.a.data.bgMusicVolume,0,2e3)},app.fadeInBgMusic=function(i){t.checkBgMusicEnabled()&&e.fade(0,r.a.data.bgMusicVolume,1e3)}}if(this.checkSoundEnabled()){var i={},n=k.spritemap;for(var s in n){var o=n[s],a=1e3*o.start,h=Math.ceil(1e3*o.end-a),l=o.loop;i[s]=[a,h,l]}var u=new F.Howl({src:["assets/sounds/output.mp3"],sprite:i,volume:r.a.data.sfxVolume});app.mainSfxSound=u,app.playSfx=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(r.a.data.soundEnabled&&(!i||t!==app.lastPlayedName)){var s=u.play(t);return u.rate(e,s),app.lastPlayed=s,app.lastPlayedName=t,n&&(app.lastPlayed=null,app.lastPlayedName=null),s}},app.setSoundRate=function(t,e){r.a.data.soundEnabled&&u.rate(e,t)},app.getSound=function(){if(r.a.data.soundEnabled)return u},app.checkSoundPlaying=function(t){if(r.a.data.soundEnabled)return u.playing(t)},app.seekSound=function(t){if(r.a.data.soundEnabled)return u.seek(t)},app.getSoundDuration=function(t){if(r.a.data.soundEnabled)return u.duration(t)},app.stopSfx=function(t){r.a.data.soundEnabled&&t&&u.stop(t)},app.stopLastPlayed=function(){r.a.data.soundEnabled&&app.lastPlayed&&(u.stop(app.lastPlayed),app.lastPlayed=null,app.lastPlayedName=null)},app.setVolume=function(t,e){r.a.data.soundEnabled&&u.volume(e,t)},app.sfxFade=function(t,e,i,n){r.a.data.soundEnabled&&u.fade(e,i,n,t)}}}}],(i=null)&&N(e.prototype,i),n&&N(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function U(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var V=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.init()}var e,i,n;return e=t,(i=[{key:"init",value:function(){this.wrapper=document.createElement("div"),this.wrapper.id="loading-wrapper";var t=document.createElement("img");t.id="loading-logo-img",t.src="assets/gameLogo.png";var e=document.createElement("div");e.id="loading-game-name",e.innerText=r.a.locales.GAME_NAME;var i=document.createElement("div");i.id="loading-progress-text",i.innerText="0%",this.wrapper.append(t),this.wrapper.append(e),this.wrapper.append(i),this.progressElem=i,document.body.append(this.wrapper)}},{key:"setLoadingPerc",value:function(t){this.progressElem.innerText=t+"%"}},{key:"hide",value:function(){this.wrapper.remove()}}])&&U(e.prototype,i),n&&U(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function H(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==i)return;var n,r,s=[],o=!0,a=!1;try{for(i=i.call(t);!(o=(n=i.next()).done)&&(s.push(n.value),!e||s.length!==e);o=!0);}catch(t){a=!0,r=t}finally{try{o||null==i.return||i.return()}finally{if(a)throw r}}return s}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return G(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return G(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function G(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function W(t,e,i,n,r,s,o){try{var a=t[s](o),h=a.value}catch(t){return void i(t)}a.done?e(h):Promise.resolve(h).then(n,r)}function Y(t){return function(){var e=this,i=arguments;return new Promise((function(n,r){var s=t.apply(e,i);function o(t){W(s,n,r,o,a,"next",t)}function a(t){W(s,n,r,o,a,"throw",t)}o(void 0)}))}}var X={globals:r.a,pausegame:!1};window.app=X,setTimeout((function(){}),1e3),i(63),r.a.main={},r.a.gameLogoImg=i(64);var j,q,Q,K=0,J=!1,Z=new p.Clock(!0),$=new V,tt=function(){var t=window.innerWidth,e=window.innerHeight;q.resize(t,e),Q.resize(t,e);var i=r.a.threeScene.lastWidth,n=r.a.threeScene.lastHeight;j&&j.resize(i,n)},et=function t(){requestAnimationFrame(t);var e=Z.getDelta();e&&!isNaN(e)||(e=.01),e>.03&&(e=.03);var i=60*e;j.update(i,e),q.update(i,e)},it=function(){X.gamePaused=!0,ht()},nt=function(){document.hidden||r.a.adShowing||(X.gamePaused=!1,lt())},rt=window.H5SDK;function st(){return ot.apply(this,arguments)}function ot(){return(ot=Y(regeneratorRuntime.mark((function t(){var e,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,rt.getStoreModule().get(["saveData"]);case 2:if((e=t.sent)&&e.saveData){for(i in r.a.saveData=e.saveData,r.a.saveData)void 0!==r.a.playerData[i]&&(r.a.playerData[i]=r.a.saveData[i]);r.a.data.selectedLevel1=r.a.saveData.level%10}case 5:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function at(){return(at=Y(regeneratorRuntime.mark((function t(e){var i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e)for(i in r.a.saveData)void 0!==r.a.saveData[i]&&(r.a.saveData[i]=r.a.playerData[i]);return t.next=3,rt.getStoreModule().save("saveData",r.a.saveData);case 3:case"end":return t.stop()}}),t)})))).apply(this,arguments)}r.a.saveGame=function(){!function(t){at.apply(this,arguments)}()},r.a.showFacebookTournament=function(t){rt.getPlatform().isFacebook()?rt.getPlatform().showTournamentCreatorPopup().then((function(){t(!0)})):t(!1)};var ht=function(){window.Howler&&window.Howler.mute(!0)},lt=function(){document.hidden||r.a.adShowing||window.Howler&&window.Howler.mute(!r.a.soundOn)};X.pauseGameHandler=it,X.resumeGameHandler=nt,X.muteGameHandler=ht,X.unmuteGameHandler=lt,X.beforeAdShown=function(){r.a.adShowing=!0,X.muteGameHandler&&X.muteGameHandler()},X.afterAdShown=function(){r.a.adShowing=!1,X.unmuteGameHandler&&X.unmuteGameHandler()},X.beforeAdShown(),X.afterAdShown(),z.initDefault();var ut=function(){var t=function(t){K++;var e=Math.round(K/6*100);rt.getPlatform().notifyLoadingProgress(e),$.setLoadingPerc(e),K>=6&&!J&&(window.addEventListener("resize",tt),rt.getPlatform().notifyLoadingComplete(),$.hide(),j=new R,J=!0,tt(),requestAnimationFrame(et))};L.a.loadTextures([{name:"logo",path:"assets/textures/Logo.png"},{name:"star",path:"assets/textures/star2.png"},{name:"endstar",path:"assets/textures/endstar.png"},{name:"flags",path:"assets/textures/spritesheet.png"},{name:"namebg",path:"assets/textures/name_bar.png"},{name:"textures/texture1.png",path:"assets/textures/texture1.png"}],(function(){t()}));var e=[{name:"coin4",path:"assets/modelsglb/coin/scene.glb"},{name:"coinSolo",path:"assets/modelsglb/coinSolo/scene.glb"},{name:"char",path:"assets/modelsglb/char/scene.glb"},{name:"crown",path:"assets/modelsglb/crown/scene.glb"},{name:"finalPlatform",path:"assets/modelsglb/finalplatform/scene.glb"},{name:"dashFx",path:"assets/modelsglb/blowfx/scene.glb"},{name:"flagplane",path:"assets/modelsglb/flagplane/scene.glb"},{name:"ballsV",path:"assets/modelsglb/ballsV/scene.glb"}],s=r.a.data.selectedLevel1+1;e.push({name:"level"+s,path:"assets/modelsglb/level"+s+"/scene.glb"}),L.a.loadModels(e,(function(){t()})),I.load([{type:"font",src:i(65),key:"ui-font"}],(function(){t()})),Object(n.a)().then((function(e){if(r.a.gpuTier=e,r.a.showGpuInfo){var i=document.createElement("div");Object.entries(e).forEach((function(t){var e=H(t,2),n=e[0],r=e[1];i.innerHTML+="<div>".concat(n,": ").concat(r,"</div>")})),i.innerHTML+="<div>Pixel Ratio: "+window.devicePixelRatio+"</div>",document.body.append(i),i.style.display="block",i.style.position="absolute",i.style.bottom=0,i.style.zIndex=1e4,i.style.fontSize="7vmin",i.style.touchAction="none",i.style.pointerEvents="none"}t(),q=new A((function(){t()}))})),Q=new c((function(){(function(){return ct.apply(this,arguments)})().then((function(){t()}))}))};function ct(){return(ct=Y(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:t.t0=regeneratorRuntime.keys(r.a.locales);case 1:if((t.t1=t.t0()).done){t.next=8;break}return e=t.t1.value,t.next=5,rt.getI18nModule().getTranslation(e);case 5:r.a.locales[e]=t.sent,t.next=1;break;case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function dt(){return(dt=Y(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return rt.addEventListener("pause",it),rt.addEventListener("resume",nt),rt.addEventListener("mute",ht),rt.addEventListener("unmute",lt),rt.getPlatform().isYoutube()||(window.addEventListener("blur",it),window.addEventListener("focus",nt)),window.replayEvent=function(){return LevelManager.resetLevel()},window.nextLevelEvent=function(){return LevelManager.goNextLevel(!0)},window.gotoHomeEvent=function(){return LevelManager.resetLevel()},t.next=10,rt.getPlatform().init();case 10:return t.next=12,st();case 12:ut();case 13:case"end":return t.stop()}}),t)})))).apply(this,arguments)}window.addEventListener("load",(function(){return dt.apply(this,arguments)}))}]);