HOUSEPLAY.bak.liu.js 1.9 MB

123
  1. /*! For license information please see HOUSEPLAY.js.LICENSE.txt */
  2. !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.HOUSEPLAY=e():t.HOUSEPLAY=e()}(window,(function(){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,i),r.l=!0,r.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)i.d(n,r,function(e){return t[e]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=77)}([function(t,e,i){"use strict";function n(){}i.r(e),i.d(e,"WebGLRenderTargetCube",(function(){return hi})),i.d(e,"WebGLRenderTarget",(function(){return ui})),i.d(e,"WebGLRenderer",(function(){return wo})),i.d(e,"ShaderLib",(function(){return Pi})),i.d(e,"UniformsLib",(function(){return Ai})),i.d(e,"UniformsUtils",(function(){return Mi})),i.d(e,"ShaderChunk",(function(){return gi})),i.d(e,"FogExp2",(function(){return xo})),i.d(e,"Fog",(function(){return Mo})),i.d(e,"Scene",(function(){return To})),i.d(e,"Sprite",(function(){return Po})),i.d(e,"LOD",(function(){return Co})),i.d(e,"SkinnedMesh",(function(){return Eo})),i.d(e,"Skeleton",(function(){return Do})),i.d(e,"Bone",(function(){return Lo})),i.d(e,"Mesh",(function(){return An})),i.d(e,"LineSegments",(function(){return Ro})),i.d(e,"LineLoop",(function(){return No})),i.d(e,"Line",(function(){return Io})),i.d(e,"Points",(function(){return Fo})),i.d(e,"Group",(function(){return ro})),i.d(e,"VideoTexture",(function(){return Bo})),i.d(e,"DataTexture",(function(){return ci})),i.d(e,"DataTexture3D",(function(){return zn})),i.d(e,"CompressedTexture",(function(){return zo})),i.d(e,"CubeTexture",(function(){return Bn})),i.d(e,"CanvasTexture",(function(){return Uo})),i.d(e,"DepthTexture",(function(){return Vo})),i.d(e,"Texture",(function(){return si})),i.d(e,"AnimationLoader",(function(){return Os})),i.d(e,"CompressedTextureLoader",(function(){return Is})),i.d(e,"DataTextureLoader",(function(){return Rs})),i.d(e,"CubeTextureLoader",(function(){return ks})),i.d(e,"TextureLoader",(function(){return Fs})),i.d(e,"ObjectLoader",(function(){return Ml})),i.d(e,"MaterialLoader",(function(){return yl})),i.d(e,"BufferGeometryLoader",(function(){return wl})),i.d(e,"DefaultLoadingManager",(function(){return Es})),i.d(e,"LoadingManager",(function(){return Cs})),i.d(e,"ImageLoader",(function(){return Ns})),i.d(e,"ImageBitmapLoader",(function(){return Ll})),i.d(e,"FontLoader",(function(){return Nl})),i.d(e,"FileLoader",(function(){return Ls})),i.d(e,"Loader",(function(){return kl})),i.d(e,"LoaderUtils",(function(){return bl})),i.d(e,"Cache",(function(){return Ps})),i.d(e,"AudioLoader",(function(){return Xl})),i.d(e,"SpotLightShadow",(function(){return hl})),i.d(e,"SpotLight",(function(){return cl})),i.d(e,"PointLight",(function(){return dl})),i.d(e,"RectAreaLight",(function(){return vl})),i.d(e,"HemisphereLight",(function(){return ll})),i.d(e,"DirectionalLightShadow",(function(){return fl})),i.d(e,"DirectionalLight",(function(){return ml})),i.d(e,"AmbientLight",(function(){return gl})),i.d(e,"LightShadow",(function(){return ul})),i.d(e,"Light",(function(){return sl})),i.d(e,"StereoCamera",(function(){return Zl})),i.d(e,"PerspectiveCamera",(function(){return ao})),i.d(e,"OrthographicCamera",(function(){return pl})),i.d(e,"CubeCamera",(function(){return Kl})),i.d(e,"ArrayCamera",(function(){return so})),i.d(e,"Camera",(function(){return oo})),i.d(e,"AudioListener",(function(){return Jl})),i.d(e,"PositionalAudio",(function(){return tu})),i.d(e,"AudioContext",(function(){return Yl})),i.d(e,"AudioAnalyser",(function(){return eu})),i.d(e,"Audio",(function(){return $l})),i.d(e,"VectorKeyframeTrack",(function(){return Ss})),i.d(e,"StringKeyframeTrack",(function(){return Ts})),i.d(e,"QuaternionKeyframeTrack",(function(){return Ms})),i.d(e,"NumberKeyframeTrack",(function(){return ws})),i.d(e,"ColorKeyframeTrack",(function(){return bs})),i.d(e,"BooleanKeyframeTrack",(function(){return ys})),i.d(e,"PropertyMixer",(function(){return iu})),i.d(e,"PropertyBinding",(function(){return yu})),i.d(e,"KeyframeTrack",(function(){return vs})),i.d(e,"AnimationUtils",(function(){return ds})),i.d(e,"AnimationObjectGroup",(function(){return bu})),i.d(e,"AnimationMixer",(function(){return xu})),i.d(e,"AnimationClip",(function(){return _s})),i.d(e,"Uniform",(function(){return Mu})),i.d(e,"InstancedBufferGeometry",(function(){return Tu})),i.d(e,"BufferGeometry",(function(){return nn})),i.d(e,"Geometry",(function(){return ji})),i.d(e,"InterleavedBufferAttribute",(function(){return _o})),i.d(e,"InstancedInterleavedBuffer",(function(){return Su})),i.d(e,"InterleavedBuffer",(function(){return So})),i.d(e,"InstancedBufferAttribute",(function(){return _u})),i.d(e,"Face3",(function(){return Di})),i.d(e,"Object3D",(function(){return Bi})),i.d(e,"Raycaster",(function(){return Au})),i.d(e,"Layers",(function(){return Oi})),i.d(e,"EventDispatcher",(function(){return n})),i.d(e,"Clock",(function(){return Ql})),i.d(e,"QuaternionLinearInterpolant",(function(){return xs})),i.d(e,"LinearInterpolant",(function(){return ms})),i.d(e,"DiscreteInterpolant",(function(){return gs})),i.d(e,"CubicInterpolant",(function(){return fs})),i.d(e,"Interpolant",(function(){return ps})),i.d(e,"Triangle",(function(){return Sn})),i.d(e,"Math",(function(){return Xe})),i.d(e,"Spherical",(function(){return Eu})),i.d(e,"Cylindrical",(function(){return Du})),i.d(e,"Plane",(function(){return fi})),i.d(e,"Frustum",(function(){return mi})),i.d(e,"Sphere",(function(){return pi})),i.d(e,"Ray",(function(){return Tn})),i.d(e,"Matrix4",(function(){return Ke})),i.d(e,"Matrix3",(function(){return $e})),i.d(e,"Box3",(function(){return di})),i.d(e,"Box2",(function(){return Lu})),i.d(e,"Line3",(function(){return Ou})),i.d(e,"Euler",(function(){return Li})),i.d(e,"Vector4",(function(){return li})),i.d(e,"Vector3",(function(){return Je})),i.d(e,"Vector2",(function(){return Ze})),i.d(e,"Quaternion",(function(){return Qe})),i.d(e,"Color",(function(){return Si})),i.d(e,"ImmediateRenderObject",(function(){return Iu})),i.d(e,"VertexNormalsHelper",(function(){return Ru})),i.d(e,"SpotLightHelper",(function(){return Nu})),i.d(e,"SkeletonHelper",(function(){return ku})),i.d(e,"PointLightHelper",(function(){return Fu})),i.d(e,"RectAreaLightHelper",(function(){return Bu})),i.d(e,"HemisphereLightHelper",(function(){return zu})),i.d(e,"GridHelper",(function(){return Uu})),i.d(e,"PolarGridHelper",(function(){return Vu})),i.d(e,"FaceNormalsHelper",(function(){return ju})),i.d(e,"DirectionalLightHelper",(function(){return Hu})),i.d(e,"CameraHelper",(function(){return Gu})),i.d(e,"BoxHelper",(function(){return Wu})),i.d(e,"Box3Helper",(function(){return qu})),i.d(e,"PlaneHelper",(function(){return Yu})),i.d(e,"ArrowHelper",(function(){return Xu})),i.d(e,"AxesHelper",(function(){return Zu})),i.d(e,"Shape",(function(){return al})),i.d(e,"Path",(function(){return ol})),i.d(e,"ShapePath",(function(){return Ol})),i.d(e,"Font",(function(){return Il})),i.d(e,"CurvePath",(function(){return rl})),i.d(e,"Curve",(function(){return Bs})),i.d(e,"ImageUtils",(function(){return oi})),i.d(e,"ShapeUtils",(function(){return Ea})),i.d(e,"WebGLUtils",(function(){return no})),i.d(e,"WireframeGeometry",(function(){return jo})),i.d(e,"ParametricGeometry",(function(){return Ho})),i.d(e,"ParametricBufferGeometry",(function(){return Go})),i.d(e,"TetrahedronGeometry",(function(){return Yo})),i.d(e,"TetrahedronBufferGeometry",(function(){return Xo})),i.d(e,"OctahedronGeometry",(function(){return Zo})),i.d(e,"OctahedronBufferGeometry",(function(){return Ko})),i.d(e,"IcosahedronGeometry",(function(){return Qo})),i.d(e,"IcosahedronBufferGeometry",(function(){return Jo})),i.d(e,"DodecahedronGeometry",(function(){return $o})),i.d(e,"DodecahedronBufferGeometry",(function(){return ta})),i.d(e,"PolyhedronGeometry",(function(){return Wo})),i.d(e,"PolyhedronBufferGeometry",(function(){return qo})),i.d(e,"TubeGeometry",(function(){return ea})),i.d(e,"TubeBufferGeometry",(function(){return ia})),i.d(e,"TorusKnotGeometry",(function(){return na})),i.d(e,"TorusKnotBufferGeometry",(function(){return ra})),i.d(e,"TorusGeometry",(function(){return oa})),i.d(e,"TorusBufferGeometry",(function(){return aa})),i.d(e,"TextGeometry",(function(){return ka})),i.d(e,"TextBufferGeometry",(function(){return Fa})),i.d(e,"SphereGeometry",(function(){return Ba})),i.d(e,"SphereBufferGeometry",(function(){return za})),i.d(e,"RingGeometry",(function(){return Ua})),i.d(e,"RingBufferGeometry",(function(){return Va})),i.d(e,"PlaneGeometry",(function(){return an})),i.d(e,"PlaneBufferGeometry",(function(){return sn})),i.d(e,"LatheGeometry",(function(){return ja})),i.d(e,"LatheBufferGeometry",(function(){return Ha})),i.d(e,"ShapeGeometry",(function(){return Ga})),i.d(e,"ShapeBufferGeometry",(function(){return Wa})),i.d(e,"ExtrudeGeometry",(function(){return Oa})),i.d(e,"ExtrudeBufferGeometry",(function(){return Ia})),i.d(e,"EdgesGeometry",(function(){return Ya})),i.d(e,"ConeGeometry",(function(){return Ka})),i.d(e,"ConeBufferGeometry",(function(){return Qa})),i.d(e,"CylinderGeometry",(function(){return Xa})),i.d(e,"CylinderBufferGeometry",(function(){return Za})),i.d(e,"CircleGeometry",(function(){return Ja})),i.d(e,"CircleBufferGeometry",(function(){return $a})),i.d(e,"BoxGeometry",(function(){return rn})),i.d(e,"BoxBufferGeometry",(function(){return on})),i.d(e,"ShadowMaterial",(function(){return es})),i.d(e,"SpriteMaterial",(function(){return Ao})),i.d(e,"RawShaderMaterial",(function(){return is})),i.d(e,"ShaderMaterial",(function(){return Mn})),i.d(e,"PointsMaterial",(function(){return ko})),i.d(e,"MeshPhysicalMaterial",(function(){return rs})),i.d(e,"MeshStandardMaterial",(function(){return ns})),i.d(e,"MeshPhongMaterial",(function(){return os})),i.d(e,"MeshToonMaterial",(function(){return as})),i.d(e,"MeshNormalMaterial",(function(){return ss})),i.d(e,"MeshLambertMaterial",(function(){return ls})),i.d(e,"MeshDepthMaterial",(function(){return Jr})),i.d(e,"MeshDistanceMaterial",(function(){return $r})),i.d(e,"MeshBasicMaterial",(function(){return _n})),i.d(e,"MeshMatcapMaterial",(function(){return us})),i.d(e,"LineDashedMaterial",(function(){return hs})),i.d(e,"LineBasicMaterial",(function(){return Oo})),i.d(e,"Material",(function(){return xn})),i.d(e,"Float64BufferAttribute",(function(){return Ji})),i.d(e,"Float32BufferAttribute",(function(){return Qi})),i.d(e,"Uint32BufferAttribute",(function(){return Ki})),i.d(e,"Int32BufferAttribute",(function(){return Zi})),i.d(e,"Uint16BufferAttribute",(function(){return Xi})),i.d(e,"Int16BufferAttribute",(function(){return Yi})),i.d(e,"Uint8ClampedBufferAttribute",(function(){return qi})),i.d(e,"Uint8BufferAttribute",(function(){return Wi})),i.d(e,"Int8BufferAttribute",(function(){return Gi})),i.d(e,"BufferAttribute",(function(){return Hi})),i.d(e,"ArcCurve",(function(){return Us})),i.d(e,"CatmullRomCurve3",(function(){return qs})),i.d(e,"CubicBezierCurve",(function(){return Ks})),i.d(e,"CubicBezierCurve3",(function(){return Qs})),i.d(e,"EllipseCurve",(function(){return zs})),i.d(e,"LineCurve",(function(){return Js})),i.d(e,"LineCurve3",(function(){return $s})),i.d(e,"QuadraticBezierCurve",(function(){return tl})),i.d(e,"QuadraticBezierCurve3",(function(){return el})),i.d(e,"SplineCurve",(function(){return il})),i.d(e,"REVISION",(function(){return p})),i.d(e,"MOUSE",(function(){return f})),i.d(e,"CullFaceNone",(function(){return m})),i.d(e,"CullFaceBack",(function(){return g})),i.d(e,"CullFaceFront",(function(){return v})),i.d(e,"CullFaceFrontBack",(function(){return y})),i.d(e,"FrontFaceDirectionCW",(function(){return b})),i.d(e,"FrontFaceDirectionCCW",(function(){return w})),i.d(e,"BasicShadowMap",(function(){return x})),i.d(e,"PCFShadowMap",(function(){return M})),i.d(e,"PCFSoftShadowMap",(function(){return T})),i.d(e,"FrontSide",(function(){return S})),i.d(e,"BackSide",(function(){return _})),i.d(e,"DoubleSide",(function(){return A})),i.d(e,"FlatShading",(function(){return P})),i.d(e,"SmoothShading",(function(){return C})),i.d(e,"NoColors",(function(){return E})),i.d(e,"FaceColors",(function(){return D})),i.d(e,"VertexColors",(function(){return L})),i.d(e,"NoBlending",(function(){return O})),i.d(e,"NormalBlending",(function(){return I})),i.d(e,"AdditiveBlending",(function(){return R})),i.d(e,"SubtractiveBlending",(function(){return N})),i.d(e,"MultiplyBlending",(function(){return k})),i.d(e,"CustomBlending",(function(){return F})),i.d(e,"AddEquation",(function(){return B})),i.d(e,"SubtractEquation",(function(){return z})),i.d(e,"ReverseSubtractEquation",(function(){return U})),i.d(e,"MinEquation",(function(){return V})),i.d(e,"MaxEquation",(function(){return j})),i.d(e,"ZeroFactor",(function(){return H})),i.d(e,"OneFactor",(function(){return G})),i.d(e,"SrcColorFactor",(function(){return W})),i.d(e,"OneMinusSrcColorFactor",(function(){return q})),i.d(e,"SrcAlphaFactor",(function(){return Y})),i.d(e,"OneMinusSrcAlphaFactor",(function(){return X})),i.d(e,"DstAlphaFactor",(function(){return Z})),i.d(e,"OneMinusDstAlphaFactor",(function(){return K})),i.d(e,"DstColorFactor",(function(){return Q})),i.d(e,"OneMinusDstColorFactor",(function(){return J})),i.d(e,"SrcAlphaSaturateFactor",(function(){return $})),i.d(e,"NeverDepth",(function(){return tt})),i.d(e,"AlwaysDepth",(function(){return et})),i.d(e,"LessDepth",(function(){return it})),i.d(e,"LessEqualDepth",(function(){return nt})),i.d(e,"EqualDepth",(function(){return rt})),i.d(e,"GreaterEqualDepth",(function(){return ot})),i.d(e,"GreaterDepth",(function(){return at})),i.d(e,"NotEqualDepth",(function(){return st})),i.d(e,"MultiplyOperation",(function(){return lt})),i.d(e,"MixOperation",(function(){return ut})),i.d(e,"AddOperation",(function(){return ht})),i.d(e,"NoToneMapping",(function(){return ct})),i.d(e,"LinearToneMapping",(function(){return dt})),i.d(e,"ReinhardToneMapping",(function(){return pt})),i.d(e,"Uncharted2ToneMapping",(function(){return ft})),i.d(e,"CineonToneMapping",(function(){return mt})),i.d(e,"ACESFilmicToneMapping",(function(){return gt})),i.d(e,"UVMapping",(function(){return vt})),i.d(e,"CubeReflectionMapping",(function(){return yt})),i.d(e,"CubeRefractionMapping",(function(){return bt})),i.d(e,"EquirectangularReflectionMapping",(function(){return wt})),i.d(e,"EquirectangularRefractionMapping",(function(){return xt})),i.d(e,"SphericalReflectionMapping",(function(){return Mt})),i.d(e,"CubeUVReflectionMapping",(function(){return Tt})),i.d(e,"CubeUVRefractionMapping",(function(){return St})),i.d(e,"RepeatWrapping",(function(){return _t})),i.d(e,"ClampToEdgeWrapping",(function(){return At})),i.d(e,"MirroredRepeatWrapping",(function(){return Pt})),i.d(e,"NearestFilter",(function(){return Ct})),i.d(e,"NearestMipMapNearestFilter",(function(){return Et})),i.d(e,"NearestMipMapLinearFilter",(function(){return Dt})),i.d(e,"LinearFilter",(function(){return Lt})),i.d(e,"LinearMipMapNearestFilter",(function(){return Ot})),i.d(e,"LinearMipMapLinearFilter",(function(){return It})),i.d(e,"UnsignedByteType",(function(){return Rt})),i.d(e,"ByteType",(function(){return Nt})),i.d(e,"ShortType",(function(){return kt})),i.d(e,"UnsignedShortType",(function(){return Ft})),i.d(e,"IntType",(function(){return Bt})),i.d(e,"UnsignedIntType",(function(){return zt})),i.d(e,"FloatType",(function(){return Ut})),i.d(e,"HalfFloatType",(function(){return Vt})),i.d(e,"UnsignedShort4444Type",(function(){return jt})),i.d(e,"UnsignedShort5551Type",(function(){return Ht})),i.d(e,"UnsignedShort565Type",(function(){return Gt})),i.d(e,"UnsignedInt248Type",(function(){return Wt})),i.d(e,"AlphaFormat",(function(){return qt})),i.d(e,"RGBFormat",(function(){return Yt})),i.d(e,"RGBAFormat",(function(){return Xt})),i.d(e,"LuminanceFormat",(function(){return Zt})),i.d(e,"LuminanceAlphaFormat",(function(){return Kt})),i.d(e,"RGBEFormat",(function(){return Qt})),i.d(e,"DepthFormat",(function(){return Jt})),i.d(e,"DepthStencilFormat",(function(){return $t})),i.d(e,"RedFormat",(function(){return te})),i.d(e,"RGB_S3TC_DXT1_Format",(function(){return ee})),i.d(e,"RGBA_S3TC_DXT1_Format",(function(){return ie})),i.d(e,"RGBA_S3TC_DXT3_Format",(function(){return ne})),i.d(e,"RGBA_S3TC_DXT5_Format",(function(){return re})),i.d(e,"RGB_PVRTC_4BPPV1_Format",(function(){return oe})),i.d(e,"RGB_PVRTC_2BPPV1_Format",(function(){return ae})),i.d(e,"RGBA_PVRTC_4BPPV1_Format",(function(){return se})),i.d(e,"RGBA_PVRTC_2BPPV1_Format",(function(){return le})),i.d(e,"RGB_ETC1_Format",(function(){return ue})),i.d(e,"RGBA_ASTC_4x4_Format",(function(){return he})),i.d(e,"RGBA_ASTC_5x4_Format",(function(){return ce})),i.d(e,"RGBA_ASTC_5x5_Format",(function(){return de})),i.d(e,"RGBA_ASTC_6x5_Format",(function(){return pe})),i.d(e,"RGBA_ASTC_6x6_Format",(function(){return fe})),i.d(e,"RGBA_ASTC_8x5_Format",(function(){return me})),i.d(e,"RGBA_ASTC_8x6_Format",(function(){return ge})),i.d(e,"RGBA_ASTC_8x8_Format",(function(){return ve})),i.d(e,"RGBA_ASTC_10x5_Format",(function(){return ye})),i.d(e,"RGBA_ASTC_10x6_Format",(function(){return be})),i.d(e,"RGBA_ASTC_10x8_Format",(function(){return we})),i.d(e,"RGBA_ASTC_10x10_Format",(function(){return xe})),i.d(e,"RGBA_ASTC_12x10_Format",(function(){return Me})),i.d(e,"RGBA_ASTC_12x12_Format",(function(){return Te})),i.d(e,"LoopOnce",(function(){return Se})),i.d(e,"LoopRepeat",(function(){return _e})),i.d(e,"LoopPingPong",(function(){return Ae})),i.d(e,"InterpolateDiscrete",(function(){return Pe})),i.d(e,"InterpolateLinear",(function(){return Ce})),i.d(e,"InterpolateSmooth",(function(){return Ee})),i.d(e,"ZeroCurvatureEnding",(function(){return De})),i.d(e,"ZeroSlopeEnding",(function(){return Le})),i.d(e,"WrapAroundEnding",(function(){return Oe})),i.d(e,"TrianglesDrawMode",(function(){return Ie})),i.d(e,"TriangleStripDrawMode",(function(){return Re})),i.d(e,"TriangleFanDrawMode",(function(){return Ne})),i.d(e,"LinearEncoding",(function(){return ke})),i.d(e,"sRGBEncoding",(function(){return Fe})),i.d(e,"GammaEncoding",(function(){return Be})),i.d(e,"RGBEEncoding",(function(){return ze})),i.d(e,"LogLuvEncoding",(function(){return Ue})),i.d(e,"RGBM7Encoding",(function(){return Ve})),i.d(e,"RGBM16Encoding",(function(){return je})),i.d(e,"RGBDEncoding",(function(){return He})),i.d(e,"BasicDepthPacking",(function(){return Ge})),i.d(e,"RGBADepthPacking",(function(){return We})),i.d(e,"TangentSpaceNormalMap",(function(){return qe})),i.d(e,"ObjectSpaceNormalMap",(function(){return Ye})),i.d(e,"CubeGeometry",(function(){return rn})),i.d(e,"Face4",(function(){return Ku})),i.d(e,"LineStrip",(function(){return Qu})),i.d(e,"LinePieces",(function(){return Ju})),i.d(e,"MeshFaceMaterial",(function(){return $u})),i.d(e,"MultiMaterial",(function(){return th})),i.d(e,"PointCloud",(function(){return eh})),i.d(e,"Particle",(function(){return ih})),i.d(e,"ParticleSystem",(function(){return nh})),i.d(e,"PointCloudMaterial",(function(){return rh})),i.d(e,"ParticleBasicMaterial",(function(){return oh})),i.d(e,"ParticleSystemMaterial",(function(){return ah})),i.d(e,"Vertex",(function(){return sh})),i.d(e,"DynamicBufferAttribute",(function(){return lh})),i.d(e,"Int8Attribute",(function(){return uh})),i.d(e,"Uint8Attribute",(function(){return hh})),i.d(e,"Uint8ClampedAttribute",(function(){return ch})),i.d(e,"Int16Attribute",(function(){return dh})),i.d(e,"Uint16Attribute",(function(){return ph})),i.d(e,"Int32Attribute",(function(){return fh})),i.d(e,"Uint32Attribute",(function(){return mh})),i.d(e,"Float32Attribute",(function(){return gh})),i.d(e,"Float64Attribute",(function(){return vh})),i.d(e,"ClosedSplineCurve3",(function(){return yh})),i.d(e,"SplineCurve3",(function(){return bh})),i.d(e,"Spline",(function(){return wh})),i.d(e,"AxisHelper",(function(){return xh})),i.d(e,"BoundingBoxHelper",(function(){return Mh})),i.d(e,"EdgesHelper",(function(){return Th})),i.d(e,"WireframeHelper",(function(){return Sh})),i.d(e,"XHRLoader",(function(){return _h})),i.d(e,"BinaryTextureLoader",(function(){return Ah})),i.d(e,"GeometryUtils",(function(){return Ph})),i.d(e,"Projector",(function(){return Ch})),i.d(e,"CanvasRenderer",(function(){return Eh})),i.d(e,"JSONLoader",(function(){return Dh})),i.d(e,"SceneUtils",(function(){return Lh})),i.d(e,"LensFlare",(function(){return Oh})),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:t>0?1:+t}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}),Object.assign(n.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[t]&&-1!==i[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var i=this._listeners[t];if(void 0!==i){var n=i.indexOf(e);-1!==n&&i.splice(n,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var i=e.slice(0),n=0,r=i.length;n<r;n++)i[n].call(this,t)}}}});var r,o,a,s,l,u,h,c,d,p="100",f={LEFT:0,MIDDLE:1,RIGHT:2},m=0,g=1,v=2,y=3,b=0,w=1,x=0,M=1,T=2,S=0,_=1,A=2,P=1,C=2,E=0,D=1,L=2,O=0,I=1,R=2,N=3,k=4,F=5,B=100,z=101,U=102,V=103,j=104,H=200,G=201,W=202,q=203,Y=204,X=205,Z=206,K=207,Q=208,J=209,$=210,tt=0,et=1,it=2,nt=3,rt=4,ot=5,at=6,st=7,lt=0,ut=1,ht=2,ct=0,dt=1,pt=2,ft=3,mt=4,gt=5,vt=300,yt=301,bt=302,wt=303,xt=304,Mt=305,Tt=306,St=307,_t=1e3,At=1001,Pt=1002,Ct=1003,Et=1004,Dt=1005,Lt=1006,Ot=1007,It=1008,Rt=1009,Nt=1010,kt=1011,Ft=1012,Bt=1013,zt=1014,Ut=1015,Vt=1016,jt=1017,Ht=1018,Gt=1019,Wt=1020,qt=1021,Yt=1022,Xt=1023,Zt=1024,Kt=1025,Qt=Xt,Jt=1026,$t=1027,te=1028,ee=33776,ie=33777,ne=33778,re=33779,oe=35840,ae=35841,se=35842,le=35843,ue=36196,he=37808,ce=37809,de=37810,pe=37811,fe=37812,me=37813,ge=37814,ve=37815,ye=37816,be=37817,we=37818,xe=37819,Me=37820,Te=37821,Se=2200,_e=2201,Ae=2202,Pe=2300,Ce=2301,Ee=2302,De=2400,Le=2401,Oe=2402,Ie=0,Re=1,Ne=2,ke=3e3,Fe=3001,Be=3007,ze=3002,Ue=3003,Ve=3004,je=3005,He=3006,Ge=3200,We=3201,qe=0,Ye=1,Xe={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){for(var t=[],e=0;e<256;e++)t[e]=(e<16?"0":"")+e.toString(16);return function(){var e=4294967295*Math.random()|0,i=4294967295*Math.random()|0,n=4294967295*Math.random()|0,r=4294967295*Math.random()|0;return(t[255&e]+t[e>>8&255]+t[e>>16&255]+t[e>>24&255]+"-"+t[255&i]+t[i>>8&255]+"-"+t[i>>16&15|64]+t[i>>24&255]+"-"+t[63&n|128]+t[n>>8&255]+"-"+t[n>>16&255]+t[n>>24&255]+t[255&r]+t[r>>8&255]+t[r>>16&255]+t[r>>24&255]).toUpperCase()}}(),clamp:function(t,e,i){return Math.max(e,Math.min(i,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,i,n,r){return n+(t-e)*(r-n)/(i-e)},lerp:function(t,e,i){return(1-i)*t+i*e},smoothstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*(3-2*t)},smootherstep:function(t,e,i){return t<=e?0:t>=i?1:(t=(t-e)/(i-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(t){return t*Xe.DEG2RAD},radToDeg:function(t){return t*Xe.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}};function Ze(t,e){this.x=t||0,this.y=e||0}function Ke(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Qe(t,e,i,n){this._x=t||0,this._y=e||0,this._z=i||0,this._w=void 0!==n?n:1}function Je(t,e,i){this.x=t||0,this.y=e||0,this.z=i||0}function $e(){this.elements=[1,0,0,0,1,0,0,0,1]}Object.defineProperties(Ze.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(Ze.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?this.addVectors(t,e):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?this.subVectors(t,e):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){var e=this.x,i=this.y,n=t.elements;return this.x=n[0]*e+n[3]*i+n[6],this.y=n[1]*e+n[4]*i+n[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:(r=new Ze,o=new Ze,function(t,e){return r.set(t,t),o.set(e,e),this.clamp(r,o)}),clampLength:function(t,e){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,i){return this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){var i=Math.cos(e),n=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*i-o*n+t.x,this.y=r*n+o*i+t.y,this}}),Object.assign(Ke.prototype,{isMatrix4:!0,set:function(t,e,i,n,r,o,a,s,l,u,h,c,d,p,f,m){var g=this.elements;return g[0]=t,g[4]=e,g[8]=i,g[12]=n,g[1]=r,g[5]=o,g[9]=a,g[13]=s,g[2]=l,g[6]=u,g[10]=h,g[14]=c,g[3]=d,g[7]=p,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new Ke).fromArray(this.elements)},copy:function(t){var e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],e[9]=i[9],e[10]=i[10],e[11]=i[11],e[12]=i[12],e[13]=i[13],e[14]=i[14],e[15]=i[15],this},copyPosition:function(t){var e=this.elements,i=t.elements;return e[12]=i[12],e[13]=i[13],e[14]=i[14],this},extractBasis:function(t,e,i){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this},extractRotation:(h=new Je,function(t){var e=this.elements,i=t.elements,n=1/h.setFromMatrixColumn(t,0).length(),r=1/h.setFromMatrixColumn(t,1).length(),o=1/h.setFromMatrixColumn(t,2).length();return e[0]=i[0]*n,e[1]=i[1]*n,e[2]=i[2]*n,e[3]=0,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[7]=0,e[8]=i[8]*o,e[9]=i[9]*o,e[10]=i[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}),makeRotationFromEuler:function(t){!t||t.isEuler;var e=this.elements,i=t.x,n=t.y,r=t.z,o=Math.cos(i),a=Math.sin(i),s=Math.cos(n),l=Math.sin(n),u=Math.cos(r),h=Math.sin(r);if("XYZ"===t.order){var c=o*u,d=o*h,p=a*u,f=a*h;e[0]=s*u,e[4]=-s*h,e[8]=l,e[1]=d+p*l,e[5]=c-f*l,e[9]=-a*s,e[2]=f-c*l,e[6]=p+d*l,e[10]=o*s}else if("YXZ"===t.order){var m=s*u,g=s*h,v=l*u,y=l*h;e[0]=m+y*a,e[4]=v*a-g,e[8]=o*l,e[1]=o*h,e[5]=o*u,e[9]=-a,e[2]=g*a-v,e[6]=y+m*a,e[10]=o*s}else if("ZXY"===t.order){m=s*u,g=s*h,v=l*u,y=l*h;e[0]=m-y*a,e[4]=-o*h,e[8]=v+g*a,e[1]=g+v*a,e[5]=o*u,e[9]=y-m*a,e[2]=-o*l,e[6]=a,e[10]=o*s}else if("ZYX"===t.order){c=o*u,d=o*h,p=a*u,f=a*h;e[0]=s*u,e[4]=p*l-d,e[8]=c*l+f,e[1]=s*h,e[5]=f*l+c,e[9]=d*l-p,e[2]=-l,e[6]=a*s,e[10]=o*s}else if("YZX"===t.order){var b=o*s,w=o*l,x=a*s,M=a*l;e[0]=s*u,e[4]=M-b*h,e[8]=x*h+w,e[1]=h,e[5]=o*u,e[9]=-a*u,e[2]=-l*u,e[6]=w*h+x,e[10]=b-M*h}else if("XZY"===t.order){b=o*s,w=o*l,x=a*s,M=a*l;e[0]=s*u,e[4]=-h,e[8]=l*u,e[1]=b*h+M,e[5]=o*u,e[9]=w*h-x,e[2]=x*h-w,e[6]=a*u,e[10]=M*h+b}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:(l=new Je(0,0,0),u=new Je(1,1,1),function(t){return this.compose(l,t,u)}),lookAt:function(){var t=new Je,e=new Je,i=new Je;return function(n,r,o){var a=this.elements;return i.subVectors(n,r),0===i.lengthSq()&&(i.z=1),i.normalize(),t.crossVectors(o,i),0===t.lengthSq()&&(1===Math.abs(o.z)?i.x+=1e-4:i.z+=1e-4,i.normalize(),t.crossVectors(o,i)),t.normalize(),e.crossVectors(i,t),a[0]=t.x,a[4]=e.x,a[8]=i.x,a[1]=t.y,a[5]=e.y,a[9]=i.y,a[2]=t.z,a[6]=e.z,a[10]=i.z,this}}(),multiply:function(t,e){return void 0!==e?this.multiplyMatrices(t,e):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.elements,n=e.elements,r=this.elements,o=i[0],a=i[4],s=i[8],l=i[12],u=i[1],h=i[5],c=i[9],d=i[13],p=i[2],f=i[6],m=i[10],g=i[14],v=i[3],y=i[7],b=i[11],w=i[15],x=n[0],M=n[4],T=n[8],S=n[12],_=n[1],A=n[5],P=n[9],C=n[13],E=n[2],D=n[6],L=n[10],O=n[14],I=n[3],R=n[7],N=n[11],k=n[15];return r[0]=o*x+a*_+s*E+l*I,r[4]=o*M+a*A+s*D+l*R,r[8]=o*T+a*P+s*L+l*N,r[12]=o*S+a*C+s*O+l*k,r[1]=u*x+h*_+c*E+d*I,r[5]=u*M+h*A+c*D+d*R,r[9]=u*T+h*P+c*L+d*N,r[13]=u*S+h*C+c*O+d*k,r[2]=p*x+f*_+m*E+g*I,r[6]=p*M+f*A+m*D+g*R,r[10]=p*T+f*P+m*L+g*N,r[14]=p*S+f*C+m*O+g*k,r[3]=v*x+y*_+b*E+w*I,r[7]=v*M+y*A+b*D+w*R,r[11]=v*T+y*P+b*L+w*N,r[15]=v*S+y*C+b*O+w*k,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},applyToBufferAttribute:function(){var t=new Je;return function(e){for(var i=0,n=e.count;i<n;i++)t.x=e.getX(i),t.y=e.getY(i),t.z=e.getZ(i),t.applyMatrix4(this),e.setXYZ(i,t.x,t.y,t.z);return e}}(),determinant:function(){var t=this.elements,e=t[0],i=t[4],n=t[8],r=t[12],o=t[1],a=t[5],s=t[9],l=t[13],u=t[2],h=t[6],c=t[10],d=t[14];return t[3]*(+r*s*h-n*l*h-r*a*c+i*l*c+n*a*d-i*s*d)+t[7]*(+e*s*d-e*l*c+r*o*c-n*o*d+n*l*u-r*s*u)+t[11]*(+e*l*h-e*a*d-r*o*h+i*o*d+r*a*u-i*l*u)+t[15]*(-n*a*u-e*s*h+e*a*c+n*o*h-i*o*c+i*s*u)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},setPosition:function(t){var e=this.elements;return e[12]=t.x,e[13]=t.y,e[14]=t.z,this},getInverse:function(t,e){var i=this.elements,n=t.elements,r=n[0],o=n[1],a=n[2],s=n[3],l=n[4],u=n[5],h=n[6],c=n[7],d=n[8],p=n[9],f=n[10],m=n[11],g=n[12],v=n[13],y=n[14],b=n[15],w=p*y*c-v*f*c+v*h*m-u*y*m-p*h*b+u*f*b,x=g*f*c-d*y*c-g*h*m+l*y*m+d*h*b-l*f*b,M=d*v*c-g*p*c+g*u*m-l*v*m-d*u*b+l*p*b,T=g*p*h-d*v*h-g*u*f+l*v*f+d*u*y-l*p*y,S=r*w+o*x+a*M+s*T;if(0===S){if(!0===e)throw new Error("THREE.Matrix4: .getInverse() can't invert matrix, determinant is 0");return this.identity()}var _=1/S;return i[0]=w*_,i[1]=(v*f*s-p*y*s-v*a*m+o*y*m+p*a*b-o*f*b)*_,i[2]=(u*y*s-v*h*s+v*a*c-o*y*c-u*a*b+o*h*b)*_,i[3]=(p*h*s-u*f*s-p*a*c+o*f*c+u*a*m-o*h*m)*_,i[4]=x*_,i[5]=(d*y*s-g*f*s+g*a*m-r*y*m-d*a*b+r*f*b)*_,i[6]=(g*h*s-l*y*s-g*a*c+r*y*c+l*a*b-r*h*b)*_,i[7]=(l*f*s-d*h*s+d*a*c-r*f*c-l*a*m+r*h*m)*_,i[8]=M*_,i[9]=(g*p*s-d*v*s-g*o*m+r*v*m+d*o*b-r*p*b)*_,i[10]=(l*v*s-g*u*s+g*o*c-r*v*c-l*o*b+r*u*b)*_,i[11]=(d*u*s-l*p*s-d*o*c+r*p*c+l*o*m-r*u*m)*_,i[12]=T*_,i[13]=(d*v*a-g*p*a+g*o*f-r*v*f-d*o*y+r*p*y)*_,i[14]=(g*u*a-l*v*a-g*o*h+r*v*h+l*o*y-r*u*y)*_,i[15]=(l*p*a-d*u*a+d*o*h-r*p*h-l*o*f+r*u*f)*_,this},scale:function(t){var 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:function(){var 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:function(t,e,i){return this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this},makeRotationX:function(t){var 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:function(t){var 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:function(t){var 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:function(t,e){var i=Math.cos(e),n=Math.sin(e),r=1-i,o=t.x,a=t.y,s=t.z,l=r*o,u=r*a;return this.set(l*o+i,l*a-n*s,l*s+n*a,0,l*a+n*s,u*a+i,u*s-n*o,0,l*s-n*a,u*s+n*o,r*s*s+i,0,0,0,0,1),this},makeScale:function(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this},makeShear:function(t,e,i){return this.set(1,e,i,0,t,1,i,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,i){var n=this.elements,r=e._x,o=e._y,a=e._z,s=e._w,l=r+r,u=o+o,h=a+a,c=r*l,d=r*u,p=r*h,f=o*u,m=o*h,g=a*h,v=s*l,y=s*u,b=s*h,w=i.x,x=i.y,M=i.z;return n[0]=(1-(f+g))*w,n[1]=(d+b)*w,n[2]=(p-y)*w,n[3]=0,n[4]=(d-b)*x,n[5]=(1-(c+g))*x,n[6]=(m+v)*x,n[7]=0,n[8]=(p+y)*M,n[9]=(m-v)*M,n[10]=(1-(c+f))*M,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this},decompose:(a=new Je,s=new Ke,function(t,e,i){var n=this.elements,r=a.set(n[0],n[1],n[2]).length(),o=a.set(n[4],n[5],n[6]).length(),l=a.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],s.copy(this);var u=1/r,h=1/o,c=1/l;return s.elements[0]*=u,s.elements[1]*=u,s.elements[2]*=u,s.elements[4]*=h,s.elements[5]*=h,s.elements[6]*=h,s.elements[8]*=c,s.elements[9]*=c,s.elements[10]*=c,e.setFromRotationMatrix(s),i.x=r,i.y=o,i.z=l,this}),makePerspective:function(t,e,i,n,r,o){var a=this.elements,s=2*r/(e-t),l=2*r/(i-n),u=(e+t)/(e-t),h=(i+n)/(i-n),c=-(o+r)/(o-r),d=-2*o*r/(o-r);return a[0]=s,a[4]=0,a[8]=u,a[12]=0,a[1]=0,a[5]=l,a[9]=h,a[13]=0,a[2]=0,a[6]=0,a[10]=c,a[14]=d,a[3]=0,a[7]=0,a[11]=-1,a[15]=0,this},makeOrthographic:function(t,e,i,n,r,o){var a=this.elements,s=1/(e-t),l=1/(i-n),u=1/(o-r),h=(e+t)*s,c=(i+n)*l,d=(o+r)*u;return a[0]=2*s,a[4]=0,a[8]=0,a[12]=-h,a[1]=0,a[5]=2*l,a[9]=0,a[13]=-c,a[2]=0,a[6]=0,a[10]=-2*u,a[14]=-d,a[3]=0,a[7]=0,a[11]=0,a[15]=1,this},equals:function(t){for(var e=this.elements,i=t.elements,n=0;n<16;n++)if(e[n]!==i[n])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var i=0;i<16;i++)this.elements[i]=t[i+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var 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}}),Object.assign(Qe,{slerp:function(t,e,i,n){return i.copy(t).slerp(e,n)},slerpFlat:function(t,e,i,n,r,o,a){var s=i[n+0],l=i[n+1],u=i[n+2],h=i[n+3],c=r[o+0],d=r[o+1],p=r[o+2],f=r[o+3];if(h!==f||s!==c||l!==d||u!==p){var m=1-a,g=s*c+l*d+u*p+h*f,v=g>=0?1:-1,y=1-g*g;if(y>Number.EPSILON){var b=Math.sqrt(y),w=Math.atan2(b,g*v);m=Math.sin(m*w)/b,a=Math.sin(a*w)/b}var x=a*v;if(s=s*m+c*x,l=l*m+d*x,u=u*m+p*x,h=h*m+f*x,m===1-a){var M=1/Math.sqrt(s*s+l*l+u*u+h*h);s*=M,l*=M,u*=M,h*=M}}t[e]=s,t[e+1]=l,t[e+2]=u,t[e+3]=h}}),Object.defineProperties(Qe.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this.onChangeCallback()}}}),Object.assign(Qe.prototype,{isQuaternion:!0,set:function(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._w=n,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this.onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var i=t._x,n=t._y,r=t._z,o=t.order,a=Math.cos,s=Math.sin,l=a(i/2),u=a(n/2),h=a(r/2),c=s(i/2),d=s(n/2),p=s(r/2);return"XYZ"===o?(this._x=c*u*h+l*d*p,this._y=l*d*h-c*u*p,this._z=l*u*p+c*d*h,this._w=l*u*h-c*d*p):"YXZ"===o?(this._x=c*u*h+l*d*p,this._y=l*d*h-c*u*p,this._z=l*u*p-c*d*h,this._w=l*u*h+c*d*p):"ZXY"===o?(this._x=c*u*h-l*d*p,this._y=l*d*h+c*u*p,this._z=l*u*p+c*d*h,this._w=l*u*h-c*d*p):"ZYX"===o?(this._x=c*u*h-l*d*p,this._y=l*d*h+c*u*p,this._z=l*u*p-c*d*h,this._w=l*u*h+c*d*p):"YZX"===o?(this._x=c*u*h+l*d*p,this._y=l*d*h+c*u*p,this._z=l*u*p-c*d*h,this._w=l*u*h-c*d*p):"XZY"===o&&(this._x=c*u*h-l*d*p,this._y=l*d*h-c*u*p,this._z=l*u*p+c*d*h,this._w=l*u*h+c*d*p),!1!==e&&this.onChangeCallback(),this},setFromAxisAngle:function(t,e){var i=e/2,n=Math.sin(i);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(i),this.onChangeCallback(),this},setFromRotationMatrix:function(t){var e,i=t.elements,n=i[0],r=i[4],o=i[8],a=i[1],s=i[5],l=i[9],u=i[2],h=i[6],c=i[10],d=n+s+c;return d>0?(e=.5/Math.sqrt(d+1),this._w=.25/e,this._x=(h-l)*e,this._y=(o-u)*e,this._z=(a-r)*e):n>s&&n>c?(e=2*Math.sqrt(1+n-s-c),this._w=(h-l)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(o+u)/e):s>c?(e=2*Math.sqrt(1+s-n-c),this._w=(o-u)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(l+h)/e):(e=2*Math.sqrt(1+c-n-s),this._w=(a-r)/e,this._x=(o+u)/e,this._y=(l+h)/e,this._z=.25*e),this.onChangeCallback(),this},setFromUnitVectors:function(){var t,e=new Je;return function(i,n){return void 0===e&&(e=new Je),(t=i.dot(n)+1)<1e-6?(t=0,Math.abs(i.x)>Math.abs(i.z)?e.set(-i.y,i.x,0):e.set(0,-i.z,i.y)):e.crossVectors(i,n),this._x=e.x,this._y=e.y,this._z=e.z,this._w=t,this.normalize()}}(),angleTo:function(t){return 2*Math.acos(Math.abs(Xe.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){var i=this.angleTo(t);if(0===i)return this;var n=Math.min(1,e/i);return this.slerp(t,n),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this.onChangeCallback(),this},multiply:function(t,e){return void 0!==e?this.multiplyQuaternions(t,e):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var i=t._x,n=t._y,r=t._z,o=t._w,a=e._x,s=e._y,l=e._z,u=e._w;return this._x=i*u+o*a+n*l-r*s,this._y=n*u+o*s+r*a-i*l,this._z=r*u+o*l+i*s-n*a,this._w=o*u-i*a-n*s-r*l,this.onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var i=this._x,n=this._y,r=this._z,o=this._w,a=o*t._w+i*t._x+n*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),a>=1)return this._w=o,this._x=i,this._y=n,this._z=r,this;var s=1-a*a;if(s<=Number.EPSILON){var l=1-e;return this._w=l*o+e*this._w,this._x=l*i+e*this._x,this._y=l*n+e*this._y,this._z=l*r+e*this._z,this.normalize()}var u=Math.sqrt(s),h=Math.atan2(u,a),c=Math.sin((1-e)*h)/u,d=Math.sin(e*h)/u;return this._w=o*c+this._w*d,this._x=i*c+this._x*d,this._y=n*c+this._y*d,this._z=r*c+this._z*d,this.onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(Je.prototype,{isVector3:!0,set:function(t,e,i){return this.x=t,this.y=e,this.z=i,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?this.addVectors(t,e):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?this.subVectors(t,e):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?this.multiplyVectors(t,e):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:(c=new Qe,function(t){return!t||t.isEuler,this.applyQuaternion(c.setFromEuler(t))}),applyAxisAngle:function(){var t=new Qe;return function(e,i){return this.applyQuaternion(t.setFromAxisAngle(e,i))}}(),applyMatrix3:function(t){var e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[3]*i+r[6]*n,this.y=r[1]*e+r[4]*i+r[7]*n,this.z=r[2]*e+r[5]*i+r[8]*n,this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,r=t.elements,o=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*o,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*o,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*o,this},applyQuaternion:function(t){var e=this.x,i=this.y,n=this.z,r=t.x,o=t.y,a=t.z,s=t.w,l=s*e+o*n-a*i,u=s*i+a*e-r*n,h=s*n+r*i-o*e,c=-r*e-o*i-a*n;return this.x=l*s+c*-r+u*-a-h*-o,this.y=u*s+c*-o+h*-r-l*-a,this.z=h*s+c*-a+l*-o-u*-r,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(){var t=new Ke;return function(e){return this.applyMatrix4(t.getInverse(e.projectionMatrix)).applyMatrix4(e.matrixWorld)}}(),transformDirection:function(t){var e=this.x,i=this.y,n=this.z,r=t.elements;return this.x=r[0]*e+r[4]*i+r[8]*n,this.y=r[1]*e+r[5]*i+r[9]*n,this.z=r[2]*e+r[6]*i+r[10]*n,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(){var t=new Je,e=new Je;return function(i,n){return t.set(i,i,i),e.set(n,n,n),this.clamp(t,e)}}(),clampLength:function(t,e){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)},cross:function(t,e){return void 0!==e?this.crossVectors(t,e):this.crossVectors(this,t)},crossVectors:function(t,e){var i=t.x,n=t.y,r=t.z,o=e.x,a=e.y,s=e.z;return this.x=n*s-r*a,this.y=r*o-i*s,this.z=i*a-n*o,this},projectOnVector:function(t){var e=t.dot(this)/t.lengthSq();return this.copy(t).multiplyScalar(e)},projectOnPlane:function(){var t=new Je;return function(e){return t.copy(this).projectOnVector(e),this.sub(t)}}(),reflect:function(){var t=new Je;return function(e){return this.sub(t.copy(e).multiplyScalar(2*this.dot(e)))}}(),angleTo:function(t){var e=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq());return Math.acos(Xe.clamp(e,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,i=this.y-t.y,n=this.z-t.z;return e*e+i*i+n*n},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,e,i){var n=Math.sin(e)*t;return this.x=n*Math.sin(i),this.y=Math.cos(e)*t,this.z=n*Math.cos(i),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,i){return this.x=t*Math.sin(e),this.y=i,this.z=t*Math.cos(e),this},setFromMatrixPosition:function(t){var e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),n=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=n,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,i){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this}}),Object.assign($e.prototype,{isMatrix3:!0,set:function(t,e,i,n,r,o,a,s,l){var u=this.elements;return u[0]=t,u[1]=n,u[2]=a,u[3]=e,u[4]=r,u[5]=s,u[6]=i,u[7]=o,u[8]=l,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(t){var e=this.elements,i=t.elements;return e[0]=i[0],e[1]=i[1],e[2]=i[2],e[3]=i[3],e[4]=i[4],e[5]=i[5],e[6]=i[6],e[7]=i[7],e[8]=i[8],this},setFromMatrix4:function(t){var e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},applyToBufferAttribute:function(){var t=new Je;return function(e){for(var i=0,n=e.count;i<n;i++)t.x=e.getX(i),t.y=e.getY(i),t.z=e.getZ(i),t.applyMatrix3(this),e.setXYZ(i,t.x,t.y,t.z);return e}}(),multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.elements,n=e.elements,r=this.elements,o=i[0],a=i[3],s=i[6],l=i[1],u=i[4],h=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],b=n[7],w=n[2],x=n[5],M=n[8];return r[0]=o*f+a*v+s*w,r[3]=o*m+a*y+s*x,r[6]=o*g+a*b+s*M,r[1]=l*f+u*v+h*w,r[4]=l*m+u*y+h*x,r[7]=l*g+u*b+h*M,r[2]=c*f+d*v+p*w,r[5]=c*m+d*y+p*x,r[8]=c*g+d*b+p*M,this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.elements,e=t[0],i=t[1],n=t[2],r=t[3],o=t[4],a=t[5],s=t[6],l=t[7],u=t[8];return e*o*u-e*a*l-i*r*u+i*a*s+n*r*l-n*o*s},getInverse:function(t,e){t&&t.isMatrix4;var i=t.elements,n=this.elements,r=i[0],o=i[1],a=i[2],s=i[3],l=i[4],u=i[5],h=i[6],c=i[7],d=i[8],p=d*l-u*c,f=u*h-d*s,m=c*s-l*h,g=r*p+o*f+a*m;if(0===g){if(!0===e)throw new Error("THREE.Matrix3: .getInverse() can't invert matrix, determinant is 0");return this.identity()}var v=1/g;return n[0]=p*v,n[1]=(a*c-d*o)*v,n[2]=(u*o-a*l)*v,n[3]=f*v,n[4]=(d*r-a*h)*v,n[5]=(a*s-u*r)*v,n[6]=m*v,n[7]=(o*h-c*r)*v,n[8]=(l*r-o*s)*v,this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,i,n,r,o,a){var s=Math.cos(r),l=Math.sin(r);this.set(i*s,i*l,-i*(s*o+l*a)+o+t,-n*l,n*s,-n*(-l*o+s*a)+a+e,0,0,1)},scale:function(t,e){var i=this.elements;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=e,i[4]*=e,i[7]*=e,this},rotate:function(t){var e=Math.cos(t),i=Math.sin(t),n=this.elements,r=n[0],o=n[3],a=n[6],s=n[1],l=n[4],u=n[7];return n[0]=e*r+i*s,n[3]=e*o+i*l,n[6]=e*a+i*u,n[1]=-i*r+e*s,n[4]=-i*o+e*l,n[7]=-i*a+e*u,this},translate:function(t,e){var 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:function(t){for(var e=this.elements,i=t.elements,n=0;n<9;n++)if(e[n]!==i[n])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(var i=0;i<9;i++)this.elements[i]=t[i+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);var 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}});var ti,ei,ii,ni,ri,oi={getDataURL:function(t){var e;if("undefined"==typeof HTMLCanvasElement)return t.src;if(t instanceof HTMLCanvasElement)e=t;else{void 0===d&&(d=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),d.width=t.width,d.height=t.height;var i=d.getContext("2d");t instanceof ImageData?i.putImageData(t,0,0):i.drawImage(t,0,0,t.width,t.height),e=d}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}},ai=0;function si(t,e,i,n,r,o,a,s,l,u){Object.defineProperty(this,"id",{value:ai++}),this.uuid=Xe.generateUUID(),this.name="",this.image=void 0!==t?t:si.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:si.DEFAULT_MAPPING,this.wrapS=void 0!==i?i:At,this.wrapT=void 0!==n?n:At,this.magFilter=void 0!==r?r:Lt,this.minFilter=void 0!==o?o:It,this.anisotropy=void 0!==l?l:1,this.format=void 0!==a?a:Xt,this.type=void 0!==s?s:Rt,this.offset=new Ze(0,0),this.repeat=new Ze(1,1),this.center=new Ze(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new $e,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==u?u:ke,this.version=0,this.onUpdate=null}function li(t,e,i,n){this.x=t||0,this.y=e||0,this.z=i||0,this.w=void 0!==n?n:1}function ui(t,e,i){this.width=t,this.height=e,this.scissor=new li(0,0,t,e),this.scissorTest=!1,this.viewport=new li(0,0,t,e),i=i||{},this.texture=new si(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy,i.encoding),this.texture.generateMipmaps=void 0!==i.generateMipmaps&&i.generateMipmaps,this.texture.minFilter=void 0!==i.minFilter?i.minFilter:Lt,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0===i.stencilBuffer||i.stencilBuffer,this.depthTexture=void 0!==i.depthTexture?i.depthTexture:null}function hi(t,e,i){ui.call(this,t,e,i),this.activeCubeFace=0,this.activeMipMapLevel=0}function ci(t,e,i,n,r,o,a,s,l,u,h,c){si.call(this,null,o,a,s,l,u,n,r,h,c),this.image={data:t,width:e,height:i},this.magFilter=void 0!==l?l:Ct,this.minFilter=void 0!==u?u:Ct,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function di(t,e){this.min=void 0!==t?t:new Je(1/0,1/0,1/0),this.max=void 0!==e?e:new Je(-1/0,-1/0,-1/0)}function pi(t,e){this.center=void 0!==t?t:new Je,this.radius=void 0!==e?e:0}function fi(t,e){this.normal=void 0!==t?t:new Je(1,0,0),this.constant=void 0!==e?e:0}function mi(t,e,i,n,r,o){this.planes=[void 0!==t?t:new fi,void 0!==e?e:new fi,void 0!==i?i:new fi,void 0!==n?n:new fi,void 0!==r?r:new fi,void 0!==o?o:new fi]}si.DEFAULT_IMAGE=void 0,si.DEFAULT_MAPPING=vt,si.prototype=Object.assign(Object.create(n.prototype),{constructor:si,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){var e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];var i={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){var n=this.image;if(void 0===n.uuid&&(n.uuid=Xe.generateUUID()),!e&&void 0===t.images[n.uuid]){var r;if(Array.isArray(n)){r=[];for(var o=0,a=n.length;o<a;o++)r.push(oi.getDataURL(n[o]))}else r=oi.getDataURL(n);t.images[n.uuid]={uuid:n.uuid,url:r}}i.image=n.uuid}return e||(t.textures[this.uuid]=i),i},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(this.mapping!==vt)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case _t:t.x=t.x-Math.floor(t.x);break;case At:t.x=t.x<0?0:1;break;case Pt:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case _t:t.y=t.y-Math.floor(t.y);break;case At:t.y=t.y<0?0:1;break;case Pt:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(si.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(li.prototype,{isVector4:!0,set:function(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?this.addVectors(t,e):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?this.subVectors(t,e):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,o=t.elements;return this.x=o[0]*e+o[4]*i+o[8]*n+o[12]*r,this.y=o[1]*e+o[5]*i+o[9]*n+o[13]*r,this.z=o[2]*e+o[6]*i+o[10]*n+o[14]*r,this.w=o[3]*e+o[7]*i+o[11]*n+o[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,i,n,r,o=t.elements,a=o[0],s=o[4],l=o[8],u=o[1],h=o[5],c=o[9],d=o[2],p=o[6],f=o[10];if(Math.abs(s-u)<.01&&Math.abs(l-d)<.01&&Math.abs(c-p)<.01){if(Math.abs(s+u)<.1&&Math.abs(l+d)<.1&&Math.abs(c+p)<.1&&Math.abs(a+h+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;var m=(a+1)/2,g=(h+1)/2,v=(f+1)/2,y=(s+u)/4,b=(l+d)/4,w=(c+p)/4;return m>g&&m>v?m<.01?(i=0,n=.707106781,r=.707106781):(n=y/(i=Math.sqrt(m)),r=b/i):g>v?g<.01?(i=.707106781,n=0,r=.707106781):(i=y/(n=Math.sqrt(g)),r=w/n):v<.01?(i=.707106781,n=.707106781,r=0):(i=b/(r=Math.sqrt(v)),n=w/r),this.set(i,n,r,e),this}var x=Math.sqrt((p-c)*(p-c)+(l-d)*(l-d)+(u-s)*(u-s));return Math.abs(x)<.001&&(x=1),this.x=(p-c)/x,this.y=(l-d)/x,this.z=(u-s)/x,this.w=Math.acos((a+h+f-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(){var t,e;return function(i,n){return void 0===t&&(t=new li,e=new li),t.set(i,i,i,i),e.set(n,n,n,n),this.clamp(t,e)}}(),clampLength:function(t,e){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,i){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}}),ui.prototype=Object.assign(Object.create(n.prototype),{constructor:ui,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),hi.prototype=Object.create(ui.prototype),hi.prototype.constructor=hi,hi.prototype.isWebGLRenderTargetCube=!0,ci.prototype=Object.create(si.prototype),ci.prototype.constructor=ci,ci.prototype.isDataTexture=!0,Object.assign(di.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,i=1/0,n=1/0,r=-1/0,o=-1/0,a=-1/0,s=0,l=t.length;s<l;s+=3){var u=t[s],h=t[s+1],c=t[s+2];u<e&&(e=u),h<i&&(i=h),c<n&&(n=c),u>r&&(r=u),h>o&&(o=h),c>a&&(a=c)}return this.min.set(e,i,n),this.max.set(r,o,a),this},setFromBufferAttribute:function(t){for(var e=1/0,i=1/0,n=1/0,r=-1/0,o=-1/0,a=-1/0,s=0,l=t.count;s<l;s++){var u=t.getX(s),h=t.getY(s),c=t.getZ(s);u<e&&(e=u),h<i&&(i=h),c<n&&(n=c),u>r&&(r=u),h>o&&(o=h),c>a&&(a=c)}return this.min.set(e,i,n),this.max.set(r,o,a),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new Je;return function(e,i){var n=t.copy(i).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}}(),setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(t){return void 0===t&&(t=new Je),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(t=new Je),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:function(){var t,e,i,n=new Je;function r(r){var o=r.geometry;if(void 0!==o)if(o.isGeometry){var a=o.vertices;for(e=0,i=a.length;e<i;e++)n.copy(a[e]),n.applyMatrix4(r.matrixWorld),t.expandByPoint(n)}else if(o.isBufferGeometry){var s=o.attributes.position;if(void 0!==s)for(e=0,i=s.count;e<i;e++)n.fromBufferAttribute(s,e).applyMatrix4(r.matrixWorld),t.expandByPoint(n)}}return function(e){return t=this,e.updateMatrixWorld(!0),e.traverse(r),this}}(),containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return void 0===e&&(e=new Je),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.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:(ei=new Je,function(t){return this.clampPoint(t.center,ei),ei.distanceToSquared(t.center)<=t.radius*t.radius}),intersectsPlane:function(t){var e,i;return t.normal.x>0?(e=t.normal.x*this.min.x,i=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,i=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,i+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,i+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,i+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,i+=t.normal.z*this.min.z),e<=-t.constant&&i>=-t.constant},intersectsTriangle:function(){var t=new Je,e=new Je,i=new Je,n=new Je,r=new Je,o=new Je,a=new Je,s=new Je,l=new Je,u=new Je;function h(n){var r,o;for(r=0,o=n.length-3;r<=o;r+=3){a.fromArray(n,r);var s=l.x*Math.abs(a.x)+l.y*Math.abs(a.y)+l.z*Math.abs(a.z),u=t.dot(a),h=e.dot(a),c=i.dot(a);if(Math.max(-Math.max(u,h,c),Math.min(u,h,c))>s)return!1}return!0}return function(a){if(this.isEmpty())return!1;this.getCenter(s),l.subVectors(this.max,s),t.subVectors(a.a,s),e.subVectors(a.b,s),i.subVectors(a.c,s),n.subVectors(e,t),r.subVectors(i,e),o.subVectors(t,i);var c=[0,-n.z,n.y,0,-r.z,r.y,0,-o.z,o.y,n.z,0,-n.x,r.z,0,-r.x,o.z,0,-o.x,-n.y,n.x,0,-r.y,r.x,0,-o.y,o.x,0];return!!h(c)&&(!!h(c=[1,0,0,0,1,0,0,0,1])&&(u.crossVectors(n,r),h(c=[u.x,u.y,u.z])))}}(),clampPoint:function(t,e){return void 0===e&&(e=new Je),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new Je;return function(e){return t.copy(e).clamp(this.min,this.max).sub(e).length()}}(),getBoundingSphere:function(){var t=new Je;return function(e){return void 0===e&&(e=new pi),this.getCenter(e.center),e.radius=.5*this.getSize(t).length(),e}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:(ti=[new Je,new Je,new Je,new Je,new Je,new Je,new Je,new Je],function(t){return this.isEmpty()||(ti[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),ti[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),ti[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),ti[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),ti[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),ti[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),ti[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),ti[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(ti)),this}),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Object.assign(pi.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:(ii=new di,function(t,e){var i=this.center;void 0!==e?i.copy(e):ii.setFromPoints(t).getCenter(i);for(var n=0,r=0,o=t.length;r<o;r++)n=Math.max(n,i.distanceToSquared(t[r]));return this.radius=Math.sqrt(n),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,e){var i=this.center.distanceToSquared(t);return void 0===e&&(e=new Je),e.copy(t),i>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(t=new di),t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}}),Object.assign(fi.prototype,{set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(){var t=new Je,e=new Je;return function(i,n,r){var o=t.subVectors(r,n).cross(e.subVectors(i,n)).normalize();return this.setFromNormalAndCoplanarPoint(o,i),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return void 0===e&&(e=new Je),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(){var t=new Je;return function(e,i){void 0===i&&(i=new Je);var n=e.delta(t),r=this.normal.dot(n);if(0===r)return 0===this.distanceToPoint(e.start)?i.copy(e.start):void 0;var o=-(e.start.dot(this.normal)+this.constant)/r;return o<0||o>1?void 0:i.copy(n).multiplyScalar(o).add(e.start)}}(),intersectsLine:function(t){var e=this.distanceToPoint(t.start),i=this.distanceToPoint(t.end);return e<0&&i>0||i<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(t=new Je),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var t=new Je,e=new $e;return function(i,n){var r=n||e.getNormalMatrix(i),o=this.coplanarPoint(t).applyMatrix4(i),a=this.normal.applyMatrix3(r).normalize();return this.constant=-o.dot(a),this}}(),translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}}),Object.assign(mi.prototype,{set:function(t,e,i,n,r,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(i),a[3].copy(n),a[4].copy(r),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,i=0;i<6;i++)e[i].copy(t.planes[i]);return this},setFromMatrix:function(t){var e=this.planes,i=t.elements,n=i[0],r=i[1],o=i[2],a=i[3],s=i[4],l=i[5],u=i[6],h=i[7],c=i[8],d=i[9],p=i[10],f=i[11],m=i[12],g=i[13],v=i[14],y=i[15];return e[0].setComponents(a-n,h-s,f-c,y-m).normalize(),e[1].setComponents(a+n,h+s,f+c,y+m).normalize(),e[2].setComponents(a+r,h+l,f+d,y+g).normalize(),e[3].setComponents(a-r,h-l,f-d,y-g).normalize(),e[4].setComponents(a-o,h-u,f-p,y-v).normalize(),e[5].setComponents(a+o,h+u,f+p,y+v).normalize(),this},intersectsObject:(ri=new pi,function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),ri.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(ri)}),intersectsSprite:function(){var t=new pi;return function(e){return t.center.set(0,0,0),t.radius=.7071067811865476,t.applyMatrix4(e.matrixWorld),this.intersectsSphere(t)}}(),intersectsSphere:function(t){for(var e=this.planes,i=t.center,n=-t.radius,r=0;r<6;r++){if(e[r].distanceToPoint(i)<n)return!1}return!0},intersectsBox:(ni=new Je,function(t){for(var e=this.planes,i=0;i<6;i++){var n=e[i];if(ni.x=n.normal.x>0?t.max.x:t.min.x,ni.y=n.normal.y>0?t.max.y:t.min.y,ni.z=n.normal.z>0?t.max.z:t.min.z,n.distanceToPoint(ni)<0)return!1}return!0}),containsPoint:function(t){for(var e=this.planes,i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}});var gi={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",aomap_fragment:"#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"vec3 transformed = vec3( position );",beginnormal_vertex:"vec3 objectNormal = vec3( normal );",bsdfs:"float punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}",bumpmap_pars_fragment:"#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tfDet *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif",clipping_planes_fragment:"#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vViewPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vViewPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",clipping_planes_pars_fragment:"#if NUM_CLIPPING_PLANES > 0\n\t#if ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\t\tvarying vec3 vViewPosition;\n\t#endif\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_pars_vertex:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",color_vertex:"#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",common:"#define PI 3.14159265359\n#define PI2 6.28318530718\n#define PI_HALF 1.5707963267949\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}",cube_uv_reflection_fragment:"#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_textureSize (1024.0)\nint getFaceFromDirection(vec3 direction) {\n\tvec3 absDirection = abs(direction);\n\tint face = -1;\n\tif( absDirection.x > absDirection.z ) {\n\t\tif(absDirection.x > absDirection.y )\n\t\t\tface = direction.x > 0.0 ? 0 : 3;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\telse {\n\t\tif(absDirection.z > absDirection.y )\n\t\t\tface = direction.z > 0.0 ? 2 : 5;\n\t\telse\n\t\t\tface = direction.y > 0.0 ? 1 : 4;\n\t}\n\treturn face;\n}\n#define cubeUV_maxLods1 (log2(cubeUV_textureSize*0.25) - 1.0)\n#define cubeUV_rangeClamp (exp2((6.0 - 1.0) * 2.0))\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n\tfloat scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n\tfloat dxRoughness = dFdx(roughness);\n\tfloat dyRoughness = dFdy(roughness);\n\tvec3 dx = dFdx( vec * scale * dxRoughness );\n\tvec3 dy = dFdy( vec * scale * dyRoughness );\n\tfloat d = max( dot( dx, dx ), dot( dy, dy ) );\n\td = clamp(d, 1.0, cubeUV_rangeClamp);\n\tfloat mipLevel = 0.5 * log2(d);\n\treturn vec2(floor(mipLevel), fract(mipLevel));\n}\n#define cubeUV_maxLods2 (log2(cubeUV_textureSize*0.25) - 2.0)\n#define cubeUV_rcpTextureSize (1.0 / cubeUV_textureSize)\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n\tmipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n\tfloat a = 16.0 * cubeUV_rcpTextureSize;\n\tvec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n\tvec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n\tfloat powScale = exp2_packed.x * exp2_packed.y;\n\tfloat scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n\tfloat mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n\tbool bRes = mipLevel == 0.0;\n\tscale = bRes && (scale < a) ? a : scale;\n\tvec3 r;\n\tvec2 offset;\n\tint face = getFaceFromDirection(direction);\n\tfloat rcpPowScale = 1.0 / powScale;\n\tif( face == 0) {\n\t\tr = vec3(direction.x, -direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 1) {\n\t\tr = vec3(direction.y, direction.x, direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 2) {\n\t\tr = vec3(direction.z, direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n\t}\n\telse if( face == 3) {\n\t\tr = vec3(direction.x, direction.z, direction.y);\n\t\toffset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse if( face == 4) {\n\t\tr = vec3(direction.y, direction.x, -direction.z);\n\t\toffset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\telse {\n\t\tr = vec3(direction.z, -direction.x, direction.y);\n\t\toffset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n\t\toffset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n\t}\n\tr = normalize(r);\n\tfloat texelOffset = 0.5 * cubeUV_rcpTextureSize;\n\tvec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n\tvec2 base = offset + vec2( texelOffset );\n\treturn base + s * ( scale - 2.0 * texelOffset );\n}\n#define cubeUV_maxLods3 (log2(cubeUV_textureSize*0.25) - 3.0)\nvec4 textureCubeUV( sampler2D envMap, vec3 reflectedDirection, float roughness ) {\n\tfloat roughnessVal = roughness* cubeUV_maxLods3;\n\tfloat r1 = floor(roughnessVal);\n\tfloat r2 = r1 + 1.0;\n\tfloat t = fract(roughnessVal);\n\tvec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n\tfloat s = mipInfo.y;\n\tfloat level0 = mipInfo.x;\n\tfloat level1 = level0 + 1.0;\n\tlevel1 = level1 > 5.0 ? 5.0 : level1;\n\tlevel0 += min( floor( s + 0.5 ), 5.0 );\n\tvec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n\tvec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n\tvec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n\tvec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n\tvec4 result = mix(color10, color20, t);\n\treturn vec4(result.rgb, 1.0);\n}\n#endif",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",encodings_fragment:"gl_FragColor = linearToOutputTexel( gl_FragColor );",encodings_pars_fragment:"\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = min( floor( D ) / 255.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",envmap_fragment:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\treflectVec = normalize( reflectVec );\n\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0, 0.0, 1.0 ) );\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",envmap_pars_fragment:"#if defined( USE_ENVMAP ) || defined( PHYSICAL )\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n#endif\n#ifdef USE_ENVMAP\n\t#if ! defined( PHYSICAL ) && ( defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) )\n\t\tvarying vec3 vWorldPosition;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( PHYSICAL )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",envmap_pars_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",envmap_physical_pars_fragment:"#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent ));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = asin( clamp( reflectVec.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\t\t\tsampleUV.x = atan( reflectVec.z, reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = normalize( ( viewMatrix * vec4( reflectVec, 0.0 ) ).xyz + vec3( 0.0,0.0,1.0 ) );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",envmap_vertex:"#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fog_fragment:"#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",fog_pars_fragment:"#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\tvarying float fogDepth;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",gradientmap_pars_fragment:"#ifdef TOON\n\tuniform sampler2D gradientMap;\n\tvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\t\tfloat dotNL = dot( normal, lightDirection );\n\t\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t\t#ifdef USE_GRADIENTMAP\n\t\t\treturn texture2D( gradientMap, coord ).rgb;\n\t\t#else\n\t\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t\t#endif\n\t}\n#endif",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif",lightmap_pars_fragment:"#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",lights_lambert_vertex:"vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif",lights_pars_begin:"uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t\tfloat shadowCameraNear;\n\t\tfloat shadowCameraFar;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",lights_phong_pars_fragment:"varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifdef TOON\n\t\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#else\n\t\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\t\tvec3 irradiance = dotNL * directLight.color;\n\t#endif\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",lights_physical_fragment:"PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\n#ifdef STANDARD\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.clearCoat = saturate( clearCoat );\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n#endif",lights_physical_pars_fragment:"struct PhysicalMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n\t#ifndef STANDARD\n\t\tfloat clearCoat;\n\t\tfloat clearCoatRoughness;\n\t#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearCoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifndef STANDARD\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.directSpecular += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n\treflectedLight.directDiffuse += ( 1.0 - clearCoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\t#ifndef STANDARD\n\t\treflectedLight.directSpecular += irradiance * material.clearCoat * BRDF_Specular_GGX( directLight, geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t#ifndef STANDARD\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#ifndef STANDARD\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * material.clearCoat * BRDF_Specular_GGX_Environment( geometry, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearCoatRoughness );\n\t#endif\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\n#define Material_ClearCoat_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.clearCoatRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",lights_fragment_begin:"\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearCoatRadiance = vec3( 0.0 );\n#endif",lights_fragment_maps:"#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tirradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), maxMipLevel );\n\t#ifndef STANDARD\n\t\tclearCoatRadiance += getLightProbeIndirectRadiance( geometry, Material_ClearCoat_BlinnShininessExponent( material ), maxMipLevel );\n\t#endif\n#endif",lights_fragment_end:"#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight );\n#endif",logdepthbuf_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",logdepthbuf_pars_fragment:"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n#endif",logdepthbuf_pars_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",logdepthbuf_vertex:"#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\tgl_Position.z *= gl_Position.w;\n\t#endif\n#endif",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",map_particle_fragment:"#ifdef USE_MAP\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\n#endif",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",metalnessmap_pars_fragment:"#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",morphnormal_vertex:"#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif",morphtarget_pars_vertex:"#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",morphtarget_vertex:"#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",normal_fragment_begin:"#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n#endif",normal_fragment_maps:"#ifdef USE_NORMALMAP\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t#ifdef FLIP_SIDED\n\t\t\tnormal = - normal;\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\tnormal = normalize( normalMatrix * normal );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",normalmap_pars_fragment:"#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\t#ifdef OBJECTSPACE_NORMALMAP\n\t\tuniform mat3 normalMatrix;\n\t#else\n\t\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\t\tvec2 st0 = dFdx( vUv.st );\n\t\t\tvec2 st1 = dFdy( vUv.st );\n\t\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\t\tvec3 N = normalize( surf_norm );\n\t\t\tmat3 tsn = mat3( S, T, N );\n\t\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\t\tmapN.xy *= normalScale;\n\t\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\treturn normalize( tsn * mapN );\n\t\t}\n\t#endif\n#endif",packing:"vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;",dithering_fragment:"#if defined( DITHERING )\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",dithering_pars_fragment:"#if defined( DITHERING )\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",roughnessmap_pars_fragment:"#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",shadowmap_pars_fragment:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tshadow = (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",shadowmap_pars_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif",shadowmap_vertex:"#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif",shadowmask_pars_fragment:"float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\t#pragma unroll_loop\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}",skinbase_vertex:"#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",skinning_pars_vertex:"#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",skinning_vertex:"#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\ttransformed = ( bindMatrixInverse * skinned ).xyz;\n#endif",skinnormal_vertex:"#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif",specularmap_fragment:"float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",specularmap_pars_fragment:"#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",tonemapping_fragment:"#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",tonemapping_pars_fragment:"#ifndef saturate\n\t#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( ( color * ( 2.51 * color + 0.03 ) ) / ( color * ( 2.43 * color + 0.59 ) + 0.14 ) );\n}",uv_pars_fragment:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",uv_pars_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif",uv_vertex:"#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",uv2_pars_fragment:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",uv2_pars_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",uv2_vertex:"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",worldpos_vertex:"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n#endif",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",background_vert:"varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",cube_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}",depth_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n}",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV;\n\tsampleUV.y = asin( clamp( direction.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",equirect_vert:"varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",meshbasic_vert:"#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",meshphysical_frag:"#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",points_vert:"uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <fog_fragment>\n}",shadow_vert:"#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}"};function vi(t){var e={};for(var i in t)for(var n in e[i]={},t[i]){var r=t[i][n];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?e[i][n]=r.clone():Array.isArray(r)?e[i][n]=r.slice():e[i][n]=r}return e}function yi(t){for(var e={},i=0;i<t.length;i++){var n=vi(t[i]);for(var r in n)e[r]=n[r]}return e}var bi,wi,xi,Mi={clone:vi,merge:yi},Ti={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Si(t,e,i){return void 0===e&&void 0===i?this.set(t):this.setRGB(t,e,i)}Object.assign(Si.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,i){return this.r=t,this.g=e,this.b=i,this},setHSL:function(){function t(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t}return function(e,i,n){if(e=Xe.euclideanModulo(e,1),i=Xe.clamp(i,0,1),n=Xe.clamp(n,0,1),0===i)this.r=this.g=this.b=n;else{var r=n<=.5?n*(1+i):n+i-n*i,o=2*n-r;this.r=t(o,r,e+1/3),this.g=t(o,r,e),this.b=t(o,r,e-1/3)}return this}}(),setStyle:function(t){function e(t){void 0!==t&&parseFloat(t)}var i;if(i=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){var n,r=i[1],o=i[2];switch(r){case"rgb":case"rgba":if(n=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(255,parseInt(n[1],10))/255,this.g=Math.min(255,parseInt(n[2],10))/255,this.b=Math.min(255,parseInt(n[3],10))/255,e(n[5]),this;if(n=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o))return this.r=Math.min(100,parseInt(n[1],10))/100,this.g=Math.min(100,parseInt(n[2],10))/100,this.b=Math.min(100,parseInt(n[3],10))/100,e(n[5]),this;break;case"hsl":case"hsla":if(n=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(o)){var a=parseFloat(n[1])/360,s=parseInt(n[2],10)/100,l=parseInt(n[3],10)/100;return e(n[5]),this.setHSL(a,s,l)}}}else if(i=/^\#([A-Fa-f0-9]+)$/.exec(t)){var u,h=(u=i[1]).length;if(3===h)return this.r=parseInt(u.charAt(0)+u.charAt(0),16)/255,this.g=parseInt(u.charAt(1)+u.charAt(1),16)/255,this.b=parseInt(u.charAt(2)+u.charAt(2),16)/255,this;if(6===h)return this.r=parseInt(u.charAt(0)+u.charAt(1),16)/255,this.g=parseInt(u.charAt(2)+u.charAt(3),16)/255,this.b=parseInt(u.charAt(4)+u.charAt(5),16)/255,this}t&&t.length>0&&(void 0!==(u=Ti[t])&&this.setHex(u));return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var i=e>0?1/e:1;return this.r=Math.pow(t.r,i),this.g=Math.pow(t.g,i),this.b=Math.pow(t.b,i),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(){function t(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}return function(e){return this.r=t(e.r),this.g=t(e.g),this.b=t(e.b),this}}(),copyLinearToSRGB:function(){function t(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}return function(e){return this.r=t(e.r),this.g=t(e.g),this.b=t(e.b),this}}(),convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){void 0===t&&(t={h:0,s:0,l:0});var e,i,n=this.r,r=this.g,o=this.b,a=Math.max(n,r,o),s=Math.min(n,r,o),l=(s+a)/2;if(s===a)e=0,i=0;else{var u=a-s;switch(i=l<=.5?u/(a+s):u/(2-a-s),a){case n:e=(r-o)/u+(r<o?6:0);break;case r:e=(o-n)/u+2;break;case o:e=(n-r)/u+4}e/=6}return t.h=e,t.s=i,t.l=l,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:(xi={},function(t,e,i){return this.getHSL(xi),xi.h+=t,xi.s+=e,xi.l+=i,this.setHSL(xi.h,xi.s,xi.l),this}),add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},lerpHSL:(bi={h:0,s:0,l:0},wi={h:0,s:0,l:0},function(t,e){this.getHSL(bi),t.getHSL(wi);var i=Xe.lerp(bi.h,wi.h,e),n=Xe.lerp(bi.s,wi.s,e),r=Xe.lerp(bi.l,wi.l,e);return this.setHSL(i,n,r),this}),equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},toJSON:function(){return this.getHex()}});var _i,Ai={common:{diffuse:{value:new Si(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new $e},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Ze(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 Si(16777215)}},lights:{ambientLightColor:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{},shadow:{},shadowBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new Si(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},uvTransform:{value:new $e}},sprite:{diffuse:{value:new Si(15658734)},opacity:{value:1},center:{value:new Ze(.5,.5)},rotation:{value:0},map:{value:null},uvTransform:{value:new $e}}},Pi={basic:{uniforms:yi([Ai.common,Ai.specularmap,Ai.envmap,Ai.aomap,Ai.lightmap,Ai.fog]),vertexShader:gi.meshbasic_vert,fragmentShader:gi.meshbasic_frag},lambert:{uniforms:yi([Ai.common,Ai.specularmap,Ai.envmap,Ai.aomap,Ai.lightmap,Ai.emissivemap,Ai.fog,Ai.lights,{emissive:{value:new Si(0)}}]),vertexShader:gi.meshlambert_vert,fragmentShader:gi.meshlambert_frag},phong:{uniforms:yi([Ai.common,Ai.specularmap,Ai.envmap,Ai.aomap,Ai.lightmap,Ai.emissivemap,Ai.bumpmap,Ai.normalmap,Ai.displacementmap,Ai.gradientmap,Ai.fog,Ai.lights,{emissive:{value:new Si(0)},specular:{value:new Si(1118481)},shininess:{value:30}}]),vertexShader:gi.meshphong_vert,fragmentShader:gi.meshphong_frag},standard:{uniforms:yi([Ai.common,Ai.envmap,Ai.aomap,Ai.lightmap,Ai.emissivemap,Ai.bumpmap,Ai.normalmap,Ai.displacementmap,Ai.roughnessmap,Ai.metalnessmap,Ai.fog,Ai.lights,{emissive:{value:new Si(0)},roughness:{value:.5},metalness:{value:.5},envMapIntensity:{value:1}}]),vertexShader:gi.meshphysical_vert,fragmentShader:gi.meshphysical_frag},matcap:{uniforms:yi([Ai.common,Ai.bumpmap,Ai.normalmap,Ai.displacementmap,Ai.fog,{matcap:{value:null}}]),vertexShader:gi.meshmatcap_vert,fragmentShader:gi.meshmatcap_frag},points:{uniforms:yi([Ai.points,Ai.fog]),vertexShader:gi.points_vert,fragmentShader:gi.points_frag},dashed:{uniforms:yi([Ai.common,Ai.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:gi.linedashed_vert,fragmentShader:gi.linedashed_frag},depth:{uniforms:yi([Ai.common,Ai.displacementmap]),vertexShader:gi.depth_vert,fragmentShader:gi.depth_frag},normal:{uniforms:yi([Ai.common,Ai.bumpmap,Ai.normalmap,Ai.displacementmap,{opacity:{value:1}}]),vertexShader:gi.normal_vert,fragmentShader:gi.normal_frag},sprite:{uniforms:yi([Ai.sprite,Ai.fog]),vertexShader:gi.sprite_vert,fragmentShader:gi.sprite_frag},background:{uniforms:{uvTransform:{value:new $e},t2D:{value:null}},vertexShader:gi.background_vert,fragmentShader:gi.background_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:gi.cube_vert,fragmentShader:gi.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:gi.equirect_vert,fragmentShader:gi.equirect_frag},distanceRGBA:{uniforms:yi([Ai.common,Ai.displacementmap,{referencePosition:{value:new Je},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:gi.distanceRGBA_vert,fragmentShader:gi.distanceRGBA_frag},shadow:{uniforms:yi([Ai.lights,Ai.fog,{color:{value:new Si(0)},opacity:{value:1}}]),vertexShader:gi.shadow_vert,fragmentShader:gi.shadow_frag}};function Ci(){var t=null,e=!1,i=null;function n(r,o){!1!==e&&(i(r,o),t.requestAnimationFrame(n))}return{start:function(){!0!==e&&null!==i&&(t.requestAnimationFrame(n),e=!0)},stop:function(){e=!1},setAnimationLoop:function(t){i=t},setContext:function(e){t=e}}}function Ei(t){var e=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),e.get(t)},remove:function(i){i.isInterleavedBufferAttribute&&(i=i.data);var n=e.get(i);n&&(t.deleteBuffer(n.buffer),e.delete(i))},update:function(i,n){i.isInterleavedBufferAttribute&&(i=i.data);var r=e.get(i);void 0===r?e.set(i,function(e,i){var n=e.array,r=e.dynamic?35048:35044,o=t.createBuffer();t.bindBuffer(i,o),t.bufferData(i,n,r),e.onUploadCallback();var a=5126;return n instanceof Float32Array?a=5126:n instanceof Float64Array||(n instanceof Uint16Array?a=5123:n instanceof Int16Array?a=5122:n instanceof Uint32Array?a=5125:n instanceof Int32Array?a=5124:n instanceof Int8Array?a=5120:n instanceof Uint8Array&&(a=5121)),{buffer:o,type:a,bytesPerElement:n.BYTES_PER_ELEMENT,version:e.version}}(i,n)):r.version<i.version&&(!function(e,i,n){var r=i.array,o=i.updateRange;t.bindBuffer(n,e),!1===i.dynamic?t.bufferData(n,r,35044):-1===o.count?t.bufferSubData(n,0,r):0===o.count||(t.bufferSubData(n,o.offset*r.BYTES_PER_ELEMENT,r.subarray(o.offset,o.offset+o.count)),o.count=-1)}(r.buffer,i,n),r.version=i.version)}}}function Di(t,e,i,n,r,o){this.a=t,this.b=e,this.c=i,this.normal=n&&n.isVector3?n:new Je,this.vertexNormals=Array.isArray(n)?n:[],this.color=r&&r.isColor?r:new Si,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==o?o:0}function Li(t,e,i,n){this._x=t||0,this._y=e||0,this._z=i||0,this._order=n||Li.DefaultOrder}function Oi(){this.mask=1}Pi.physical={uniforms:yi([Pi.standard.uniforms,{clearCoat:{value:0},clearCoatRoughness:{value:0}}]),vertexShader:gi.meshphysical_vert,fragmentShader:gi.meshphysical_frag},Object.assign(Di.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(var e=0,i=t.vertexNormals.length;e<i;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(e=0,i=t.vertexColors.length;e<i;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}}),Li.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],Li.DefaultOrder="XYZ",Object.defineProperties(Li.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback()}}}),Object.assign(Li.prototype,{isEuler:!0,set:function(t,e,i,n){return this._x=t,this._y=e,this._z=i,this._order=n||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this.onChangeCallback(),this},setFromRotationMatrix:function(t,e,i){var n=Xe.clamp,r=t.elements,o=r[0],a=r[4],s=r[8],l=r[1],u=r[5],h=r[9],c=r[2],d=r[6],p=r[10];return"XYZ"===(e=e||this._order)?(this._y=Math.asin(n(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-h,p),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(d,u),this._z=0)):"YXZ"===e?(this._x=Math.asin(-n(h,-1,1)),Math.abs(h)<.99999?(this._y=Math.atan2(s,p),this._z=Math.atan2(l,u)):(this._y=Math.atan2(-c,o),this._z=0)):"ZXY"===e?(this._x=Math.asin(n(d,-1,1)),Math.abs(d)<.99999?(this._y=Math.atan2(-c,p),this._z=Math.atan2(-a,u)):(this._y=0,this._z=Math.atan2(l,o))):"ZYX"===e?(this._y=Math.asin(-n(c,-1,1)),Math.abs(c)<.99999?(this._x=Math.atan2(d,p),this._z=Math.atan2(l,o)):(this._x=0,this._z=Math.atan2(-a,u))):"YZX"===e?(this._z=Math.asin(n(l,-1,1)),Math.abs(l)<.99999?(this._x=Math.atan2(-h,u),this._y=Math.atan2(-c,o)):(this._x=0,this._y=Math.atan2(s,p))):"XZY"===e&&(this._z=Math.asin(-n(a,-1,1)),Math.abs(a)<.99999?(this._x=Math.atan2(d,u),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-h,p),this._y=0)),this._order=e,!1!==i&&this.onChangeCallback(),this},setFromQuaternion:function(){var t=new Ke;return function(e,i,n){return t.makeRotationFromQuaternion(e),this.setFromRotationMatrix(t,i,n)}}(),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:(_i=new Qe,function(t){return _i.setFromEuler(this),this.setFromQuaternion(_i,t)}),equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new Je(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),Object.assign(Oi.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},test:function(t){return 0!=(this.mask&t.mask)}});var Ii,Ri,Ni,ki,Fi=0;function Bi(){Object.defineProperty(this,"id",{value:Fi++}),this.uuid=Xe.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Bi.DefaultUp.clone();var t=new Je,e=new Li,i=new Qe,n=new Je(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 Ke},normalMatrix:{value:new $e}}),this.matrix=new Ke,this.matrixWorld=new Ke,this.matrixAutoUpdate=Bi.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new Oi,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}Bi.DefaultUp=new Je(0,1,0),Bi.DefaultMatrixAutoUpdate=!0,Bi.prototype=Object.assign(Object.create(n.prototype),{constructor:Bi,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix:function(t){this.matrix.multiplyMatrices(t,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:(ki=new Qe,function(t,e){return ki.setFromAxisAngle(t,e),this.quaternion.multiply(ki),this}),rotateOnWorldAxis:function(){var t=new Qe;return function(e,i){return t.setFromAxisAngle(e,i),this.quaternion.premultiply(t),this}}(),rotateX:function(){var t=new Je(1,0,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateY:function(){var t=new Je(0,1,0);return function(e){return this.rotateOnAxis(t,e)}}(),rotateZ:function(){var t=new Je(0,0,1);return function(e){return this.rotateOnAxis(t,e)}}(),translateOnAxis:function(){var t=new Je;return function(e,i){return t.copy(e).applyQuaternion(this.quaternion),this.position.add(t.multiplyScalar(i)),this}}(),translateX:function(){var t=new Je(1,0,0);return function(e){return this.translateOnAxis(t,e)}}(),translateY:function(){var t=new Je(0,1,0);return function(e){return this.translateOnAxis(t,e)}}(),translateZ:function(){var t=new Je(0,0,1);return function(e){return this.translateOnAxis(t,e)}}(),localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:(Ni=new Ke,function(t){return t.applyMatrix4(Ni.getInverse(this.matrixWorld))}),lookAt:function(){var t=new Qe,e=new Ke,i=new Je,n=new Je;return function(r,o,a){r.isVector3?i.copy(r):i.set(r,o,a);var s=this.parent;this.updateWorldMatrix(!0,!1),n.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?e.lookAt(n,i,this.up):e.lookAt(i,n,this.up),this.quaternion.setFromRotationMatrix(e),s&&(e.extractRotation(s.matrixWorld),t.setFromRotationMatrix(e),this.quaternion.premultiply(t.inverse()))}}(),add:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this||t&&t.isObject3D&&(null!==t.parent&&t.parent.remove(t),t.parent=this,t.dispatchEvent({type:"added"}),this.children.push(t)),this},remove:function(t){if(arguments.length>1){for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);return this}var i=this.children.indexOf(t);return-1!==i&&(t.parent=null,t.dispatchEvent({type:"removed"}),this.children.splice(i,1)),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var i=0,n=this.children.length;i<n;i++){var r=this.children[i].getObjectByProperty(t,e);if(void 0!==r)return r}},getWorldPosition:function(t){return void 0===t&&(t=new Je),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:(Ii=new Je,Ri=new Je,function(t){return void 0===t&&(t=new Qe),this.updateMatrixWorld(!0),this.matrixWorld.decompose(Ii,t,Ri),t}),getWorldScale:function(){var t=new Je,e=new Qe;return function(i){return void 0===i&&(i=new Je),this.updateMatrixWorld(!0),this.matrixWorld.decompose(t,e,i),i}}(),getWorldDirection:function(t){void 0===t&&(t=new Je),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},raycast:function(){},traverse:function(t){t(this);for(var e=this.children,i=0,n=e.length;i<n;i++)e[i].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=this.children,i=0,n=e.length;i<n;i++)e[i].traverseVisible(t)}},traverseAncestors:function(t){var e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);for(var e=this.children,i=0,n=e.length;i<n;i++)e[i].updateMatrixWorld(t)},updateWorldMatrix:function(t,e){var 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)for(var n=this.children,r=0,o=n.length;r<o;r++)n[r].updateWorldMatrix(!1,!0)},toJSON: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={};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.isMesh||this.isLine||this.isPoints){n.geometry=r(t.geometries,this.geometry);var o=this.geometry.parameters;if(void 0!==o&&void 0!==o.shapes){var a=o.shapes;if(Array.isArray(a))for(var s=0,l=a.length;s<l;s++){var u=a[s];r(t.shapes,u)}else r(t.shapes,a)}}if(void 0!==this.material)if(Array.isArray(this.material)){var h=[];for(s=0,l=this.material.length;s<l;s++)h.push(r(t.materials,this.material[s]));n.material=h}else n.material=r(t.materials,this.material);if(this.children.length>0){n.children=[];for(s=0;s<this.children.length;s++)n.children.push(this.children[s].toJSON(t).object)}if(e){var c=m(t.geometries),d=m(t.materials),p=m(t.textures),f=m(t.images);a=m(t.shapes);c.length>0&&(i.geometries=c),d.length>0&&(i.materials=d),p.length>0&&(i.textures=p),f.length>0&&(i.images=f),a.length>0&&(i.shapes=a)}return i.object=n,i;function m(t){var e=[];for(var i in t){var n=t[i];delete n.metadata,e.push(n)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(var i=0;i<t.children.length;i++){var n=t.children[i];this.add(n.clone())}return this}});var zi,Ui,Vi=0;function ji(){Object.defineProperty(this,"id",{value:Vi+=2}),this.uuid=Xe.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}function Hi(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.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function Gi(t,e,i){Hi.call(this,new Int8Array(t),e,i)}function Wi(t,e,i){Hi.call(this,new Uint8Array(t),e,i)}function qi(t,e,i){Hi.call(this,new Uint8ClampedArray(t),e,i)}function Yi(t,e,i){Hi.call(this,new Int16Array(t),e,i)}function Xi(t,e,i){Hi.call(this,new Uint16Array(t),e,i)}function Zi(t,e,i){Hi.call(this,new Int32Array(t),e,i)}function Ki(t,e,i){Hi.call(this,new Uint32Array(t),e,i)}function Qi(t,e,i){Hi.call(this,new Float32Array(t),e,i)}function Ji(t,e,i){Hi.call(this,new Float64Array(t),e,i)}function $i(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function tn(t){if(0===t.length)return-1/0;for(var e=t[0],i=1,n=t.length;i<n;++i)t[i]>e&&(e=t[i]);return e}ji.prototype=Object.assign(Object.create(n.prototype),{constructor:ji,isGeometry:!0,applyMatrix:function(t){for(var e=(new $e).getNormalMatrix(t),i=0,n=this.vertices.length;i<n;i++){this.vertices[i].applyMatrix4(t)}for(i=0,n=this.faces.length;i<n;i++){var r=this.faces[i];r.normal.applyMatrix3(e).normalize();for(var o=0,a=r.vertexNormals.length;o<a;o++)r.vertexNormals[o].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(){var t=new Ke;return function(e){return t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t=new Ke;return function(e){return t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t=new Ke;return function(e){return t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t=new Ke;return function(e,i,n){return t.makeTranslation(e,i,n),this.applyMatrix(t),this}}(),scale:function(){var t=new Ke;return function(e,i,n){return t.makeScale(e,i,n),this.applyMatrix(t),this}}(),lookAt:(Ui=new Bi,function(t){Ui.lookAt(t),Ui.updateMatrix(),this.applyMatrix(Ui.matrix)}),fromBufferGeometry:function(t){var e=this,i=null!==t.index?t.index.array:void 0,n=t.attributes,r=n.position.array,o=void 0!==n.normal?n.normal.array:void 0,a=void 0!==n.color?n.color.array:void 0,s=void 0!==n.uv?n.uv.array:void 0,l=void 0!==n.uv2?n.uv2.array:void 0;void 0!==l&&(this.faceVertexUvs[1]=[]);for(var u=0,h=0;u<r.length;u+=3,h+=2)e.vertices.push((new Je).fromArray(r,u)),void 0!==a&&e.colors.push((new Si).fromArray(a,u));function c(t,i,n,r){var u=void 0===a?[]:[e.colors[t].clone(),e.colors[i].clone(),e.colors[n].clone()],h=new Di(t,i,n,void 0===o?[]:[(new Je).fromArray(o,3*t),(new Je).fromArray(o,3*i),(new Je).fromArray(o,3*n)],u,r);e.faces.push(h),void 0!==s&&e.faceVertexUvs[0].push([(new Ze).fromArray(s,2*t),(new Ze).fromArray(s,2*i),(new Ze).fromArray(s,2*n)]),void 0!==l&&e.faceVertexUvs[1].push([(new Ze).fromArray(l,2*t),(new Ze).fromArray(l,2*i),(new Ze).fromArray(l,2*n)])}var d=t.groups;if(d.length>0)for(u=0;u<d.length;u++)for(var p=d[u],f=p.start,m=(h=f,f+p.count);h<m;h+=3)void 0!==i?c(i[h],i[h+1],i[h+2],p.materialIndex):c(h,h+1,h+2,p.materialIndex);else if(void 0!==i)for(u=0;u<i.length;u+=3)c(i[u],i[u+1],i[u+2]);else for(u=0;u<r.length/3;u+=3)c(u,u+1,u+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:(zi=new Je,function(){return this.computeBoundingBox(),this.boundingBox.getCenter(zi).negate(),this.translate(zi.x,zi.y,zi.z),this}),normalize:function(){this.computeBoundingSphere();var t=this.boundingSphere.center,e=this.boundingSphere.radius,i=0===e?1:1/e,n=new Ke;return n.set(i,0,0,-i*t.x,0,i,0,-i*t.y,0,0,i,-i*t.z,0,0,0,1),this.applyMatrix(n),this},computeFaceNormals:function(){for(var t=new Je,e=new Je,i=0,n=this.faces.length;i<n;i++){var r=this.faces[i],o=this.vertices[r.a],a=this.vertices[r.b],s=this.vertices[r.c];t.subVectors(s,a),e.subVectors(o,a),t.cross(e),t.normalize(),r.normal.copy(t)}},computeVertexNormals:function(t){var e,i,n,r,o,a;for(void 0===t&&(t=!0),a=new Array(this.vertices.length),e=0,i=this.vertices.length;e<i;e++)a[e]=new Je;if(t){var s,l,u,h=new Je,c=new Je;for(n=0,r=this.faces.length;n<r;n++)o=this.faces[n],s=this.vertices[o.a],l=this.vertices[o.b],u=this.vertices[o.c],h.subVectors(u,l),c.subVectors(s,l),h.cross(c),a[o.a].add(h),a[o.b].add(h),a[o.c].add(h)}else for(this.computeFaceNormals(),n=0,r=this.faces.length;n<r;n++)a[(o=this.faces[n]).a].add(o.normal),a[o.b].add(o.normal),a[o.c].add(o.normal);for(e=0,i=this.vertices.length;e<i;e++)a[e].normalize();for(n=0,r=this.faces.length;n<r;n++){var d=(o=this.faces[n]).vertexNormals;3===d.length?(d[0].copy(a[o.a]),d[1].copy(a[o.b]),d[2].copy(a[o.c])):(d[0]=a[o.a].clone(),d[1]=a[o.b].clone(),d[2]=a[o.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var t,e,i;for(this.computeFaceNormals(),t=0,e=this.faces.length;t<e;t++){var n=(i=this.faces[t]).vertexNormals;3===n.length?(n[0].copy(i.normal),n[1].copy(i.normal),n[2].copy(i.normal)):(n[0]=i.normal.clone(),n[1]=i.normal.clone(),n[2]=i.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var t,e,i,n,r;for(i=0,n=this.faces.length;i<n;i++)for((r=this.faces[i]).__originalFaceNormal?r.__originalFaceNormal.copy(r.normal):r.__originalFaceNormal=r.normal.clone(),r.__originalVertexNormals||(r.__originalVertexNormals=[]),t=0,e=r.vertexNormals.length;t<e;t++)r.__originalVertexNormals[t]?r.__originalVertexNormals[t].copy(r.vertexNormals[t]):r.__originalVertexNormals[t]=r.vertexNormals[t].clone();var o=new ji;for(o.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[];var a=this.morphNormals[t].faceNormals,s=this.morphNormals[t].vertexNormals;for(i=0,n=this.faces.length;i<n;i++)l=new Je,u={a:new Je,b:new Je,c:new Je},a.push(l),s.push(u)}var l,u,h=this.morphNormals[t];for(o.vertices=this.morphTargets[t].vertices,o.computeFaceNormals(),o.computeVertexNormals(),i=0,n=this.faces.length;i<n;i++)r=this.faces[i],l=h.faceNormals[i],u=h.vertexNormals[i],l.copy(r.normal),u.a.copy(r.vertexNormals[0]),u.b.copy(r.vertexNormals[1]),u.c.copy(r.vertexNormals[2])}for(i=0,n=this.faces.length;i<n;i++)(r=this.faces[i]).normal=r.__originalFaceNormal,r.vertexNormals=r.__originalVertexNormals},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new di),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new pi),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,i){if(t&&t.isGeometry){var n,r=this.vertices.length,o=this.vertices,a=t.vertices,s=this.faces,l=t.faces,u=this.faceVertexUvs[0],h=t.faceVertexUvs[0],c=this.colors,d=t.colors;void 0===i&&(i=0),void 0!==e&&(n=(new $e).getNormalMatrix(e));for(var p=0,f=a.length;p<f;p++){var m=a[p].clone();void 0!==e&&m.applyMatrix4(e),o.push(m)}for(p=0,f=d.length;p<f;p++)c.push(d[p].clone());for(p=0,f=l.length;p<f;p++){var g,v,y,b=l[p],w=b.vertexNormals,x=b.vertexColors;(g=new Di(b.a+r,b.b+r,b.c+r)).normal.copy(b.normal),void 0!==n&&g.normal.applyMatrix3(n).normalize();for(var M=0,T=w.length;M<T;M++)v=w[M].clone(),void 0!==n&&v.applyMatrix3(n).normalize(),g.vertexNormals.push(v);g.color.copy(b.color);for(M=0,T=x.length;M<T;M++)y=x[M],g.vertexColors.push(y.clone());g.materialIndex=b.materialIndex+i,s.push(g)}for(p=0,f=h.length;p<f;p++){var S=h[p],_=[];if(void 0!==S){for(M=0,T=S.length;M<T;M++)_.push(S[M].clone());u.push(_)}}}},mergeMesh:function(t){t&&t.isMesh&&(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix))},mergeVertices:function(){var t,e,i,n,r,o,a,s,l={},u=[],h=[],c=Math.pow(10,4);for(i=0,n=this.vertices.length;i<n;i++)t=this.vertices[i],void 0===l[e=Math.round(t.x*c)+"_"+Math.round(t.y*c)+"_"+Math.round(t.z*c)]?(l[e]=i,u.push(this.vertices[i]),h[i]=u.length-1):h[i]=h[l[e]];var d=[];for(i=0,n=this.faces.length;i<n;i++){(r=this.faces[i]).a=h[r.a],r.b=h[r.b],r.c=h[r.c],o=[r.a,r.b,r.c];for(var p=0;p<3;p++)if(o[p]===o[(p+1)%3]){d.push(i);break}}for(i=d.length-1;i>=0;i--){var f=d[i];for(this.faces.splice(f,1),a=0,s=this.faceVertexUvs.length;a<s;a++)this.faceVertexUvs[a].splice(f,1)}var m=this.vertices.length-u.length;return this.vertices=u,m},setFromPoints:function(t){this.vertices=[];for(var e=0,i=t.length;e<i;e++){var n=t[e];this.vertices.push(new Je(n.x,n.y,n.z||0))}return this},sortFacesByMaterialIndex:function(){for(var t=this.faces,e=t.length,i=0;i<e;i++)t[i]._id=i;t.sort((function(t,e){return t.materialIndex-e.materialIndex}));var n,r,o=this.faceVertexUvs[0],a=this.faceVertexUvs[1];o&&o.length===e&&(n=[]),a&&a.length===e&&(r=[]);for(i=0;i<e;i++){var s=t[i]._id;n&&n.push(o[s]),r&&r.push(a[s])}n&&(this.faceVertexUvs[0]=n),r&&(this.faceVertexUvs[1]=r)},toJSON:function(){var t={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){var e=this.parameters;for(var i in e)void 0!==e[i]&&(t[i]=e[i]);return t}for(var n=[],r=0;r<this.vertices.length;r++){var o=this.vertices[r];n.push(o.x,o.y,o.z)}var a=[],s=[],l={},u=[],h={},c=[],d={};for(r=0;r<this.faces.length;r++){var p=this.faces[r],f=void 0!==this.faceVertexUvs[0][r],m=p.normal.length()>0,g=p.vertexNormals.length>0,v=1!==p.color.r||1!==p.color.g||1!==p.color.b,y=p.vertexColors.length>0,b=0;if(b=T(b,0,0),b=T(b,1,!0),b=T(b,2,!1),b=T(b,3,f),b=T(b,4,m),b=T(b,5,g),b=T(b,6,v),b=T(b,7,y),a.push(b),a.push(p.a,p.b,p.c),a.push(p.materialIndex),f){var w=this.faceVertexUvs[0][r];a.push(A(w[0]),A(w[1]),A(w[2]))}if(m&&a.push(S(p.normal)),g){var x=p.vertexNormals;a.push(S(x[0]),S(x[1]),S(x[2]))}if(v&&a.push(_(p.color)),y){var M=p.vertexColors;a.push(_(M[0]),_(M[1]),_(M[2]))}}function T(t,e,i){return i?t|1<<e:t&~(1<<e)}function S(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==l[e]||(l[e]=s.length/3,s.push(t.x,t.y,t.z)),l[e]}function _(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==h[e]||(h[e]=u.length,u.push(t.getHex())),h[e]}function A(t){var e=t.x.toString()+t.y.toString();return void 0!==d[e]||(d[e]=c.length/2,c.push(t.x,t.y)),d[e]}return t.data={},t.data.vertices=n,t.data.normals=s,u.length>0&&(t.data.colors=u),c.length>0&&(t.data.uvs=[c]),t.data.faces=a,t},clone:function(){return(new ji).copy(this)},copy:function(t){var e,i,n,r,o,a;this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var s=t.vertices;for(e=0,i=s.length;e<i;e++)this.vertices.push(s[e].clone());var l=t.colors;for(e=0,i=l.length;e<i;e++)this.colors.push(l[e].clone());var u=t.faces;for(e=0,i=u.length;e<i;e++)this.faces.push(u[e].clone());for(e=0,i=t.faceVertexUvs.length;e<i;e++){var h=t.faceVertexUvs[e];for(void 0===this.faceVertexUvs[e]&&(this.faceVertexUvs[e]=[]),n=0,r=h.length;n<r;n++){var c=h[n],d=[];for(o=0,a=c.length;o<a;o++){var p=c[o];d.push(p.clone())}this.faceVertexUvs[e].push(d)}}var f=t.morphTargets;for(e=0,i=f.length;e<i;e++){var m={};if(m.name=f[e].name,void 0!==f[e].vertices)for(m.vertices=[],n=0,r=f[e].vertices.length;n<r;n++)m.vertices.push(f[e].vertices[n].clone());if(void 0!==f[e].normals)for(m.normals=[],n=0,r=f[e].normals.length;n<r;n++)m.normals.push(f[e].normals[n].clone());this.morphTargets.push(m)}var g=t.morphNormals;for(e=0,i=g.length;e<i;e++){var v={};if(void 0!==g[e].vertexNormals)for(v.vertexNormals=[],n=0,r=g[e].vertexNormals.length;n<r;n++){var y=g[e].vertexNormals[n],b={};b.a=y.a.clone(),b.b=y.b.clone(),b.c=y.c.clone(),v.vertexNormals.push(b)}if(void 0!==g[e].faceNormals)for(v.faceNormals=[],n=0,r=g[e].faceNormals.length;n<r;n++)v.faceNormals.push(g[e].faceNormals[n].clone());this.morphNormals.push(v)}var w=t.skinWeights;for(e=0,i=w.length;e<i;e++)this.skinWeights.push(w[e].clone());var x=t.skinIndices;for(e=0,i=x.length;e<i;e++)this.skinIndices.push(x[e].clone());var M=t.lineDistances;for(e=0,i=M.length;e<i;e++)this.lineDistances.push(M[e]);var T=t.boundingBox;null!==T&&(this.boundingBox=T.clone());var S=t.boundingSphere;return null!==S&&(this.boundingSphere=S.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(Hi.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(Hi.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==t?t.length/this.itemSize:0,this.array=t,this},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.dynamic=t.dynamic,this},copyAt:function(t,e,i){t*=this.itemSize,i*=e.itemSize;for(var n=0,r=this.itemSize;n<r;n++)this.array[t+n]=e.array[i+n];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){for(var e=this.array,i=0,n=0,r=t.length;n<r;n++){var o=t[n];void 0===o&&(o=new Si),e[i++]=o.r,e[i++]=o.g,e[i++]=o.b}return this},copyVector2sArray:function(t){for(var e=this.array,i=0,n=0,r=t.length;n<r;n++){var o=t[n];void 0===o&&(o=new Ze),e[i++]=o.x,e[i++]=o.y}return this},copyVector3sArray:function(t){for(var e=this.array,i=0,n=0,r=t.length;n<r;n++){var o=t[n];void 0===o&&(o=new Je),e[i++]=o.x,e[i++]=o.y,e[i++]=o.z}return this},copyVector4sArray:function(t){for(var e=this.array,i=0,n=0,r=t.length;n<r;n++){var o=t[n];void 0===o&&(o=new li),e[i++]=o.x,e[i++]=o.y,e[i++]=o.z,e[i++]=o.w}return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=i,this},setXYZ:function(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:function(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:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)}}),Gi.prototype=Object.create(Hi.prototype),Gi.prototype.constructor=Gi,Wi.prototype=Object.create(Hi.prototype),Wi.prototype.constructor=Wi,qi.prototype=Object.create(Hi.prototype),qi.prototype.constructor=qi,Yi.prototype=Object.create(Hi.prototype),Yi.prototype.constructor=Yi,Xi.prototype=Object.create(Hi.prototype),Xi.prototype.constructor=Xi,Zi.prototype=Object.create(Hi.prototype),Zi.prototype.constructor=Zi,Ki.prototype=Object.create(Hi.prototype),Ki.prototype.constructor=Ki,Qi.prototype=Object.create(Hi.prototype),Qi.prototype.constructor=Qi,Ji.prototype=Object.create(Hi.prototype),Ji.prototype.constructor=Ji,Object.assign($i.prototype,{computeGroups:function(t){for(var e,i=[],n=void 0,r=t.faces,o=0;o<r.length;o++){var a=r[o];a.materialIndex!==n&&(n=a.materialIndex,void 0!==e&&(e.count=3*o-e.start,i.push(e)),e={start:3*o,materialIndex:n})}void 0!==e&&(e.count=3*o-e.start,i.push(e)),this.groups=i},fromGeometry:function(t){var e,i=t.faces,n=t.vertices,r=t.faceVertexUvs,o=r[0]&&r[0].length>0,a=r[1]&&r[1].length>0,s=t.morphTargets,l=s.length;if(l>0){e=[];for(var u=0;u<l;u++)e[u]={name:s[u].name,data:[]};this.morphTargets.position=e}var h,c=t.morphNormals,d=c.length;if(d>0){h=[];for(u=0;u<d;u++)h[u]={name:c[u].name,data:[]};this.morphTargets.normal=h}var p=t.skinIndices,f=t.skinWeights,m=p.length===n.length,g=f.length===n.length;n.length>0&&i.length;for(u=0;u<i.length;u++){var v=i[u];this.vertices.push(n[v.a],n[v.b],n[v.c]);var y=v.vertexNormals;if(3===y.length)this.normals.push(y[0],y[1],y[2]);else{var b=v.normal;this.normals.push(b,b,b)}var w,x=v.vertexColors;if(3===x.length)this.colors.push(x[0],x[1],x[2]);else{var M=v.color;this.colors.push(M,M,M)}if(!0===o)void 0!==(w=r[0][u])?this.uvs.push(w[0],w[1],w[2]):this.uvs.push(new Ze,new Ze,new Ze);if(!0===a)void 0!==(w=r[1][u])?this.uvs2.push(w[0],w[1],w[2]):this.uvs2.push(new Ze,new Ze,new Ze);for(var T=0;T<l;T++){var S=s[T].vertices;e[T].data.push(S[v.a],S[v.b],S[v.c])}for(T=0;T<d;T++){var _=c[T].vertexNormals[u];h[T].data.push(_.a,_.b,_.c)}m&&this.skinIndices.push(p[v.a],p[v.b],p[v.c]),g&&this.skinWeights.push(f[v.a],f[v.b],f[v.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this}});var en=1;function nn(){Object.defineProperty(this,"id",{value:en+=2}),this.uuid=Xe.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}function rn(t,e,i,n,r,o){ji.call(this),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:n,heightSegments:r,depthSegments:o},this.fromBufferGeometry(new on(t,e,i,n,r,o)),this.mergeVertices()}function on(t,e,i,n,r,o){nn.call(this),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:n,heightSegments:r,depthSegments:o};var a=this;t=t||1,e=e||1,i=i||1,n=Math.floor(n)||1,r=Math.floor(r)||1,o=Math.floor(o)||1;var s=[],l=[],u=[],h=[],c=0,d=0;function p(t,e,i,n,r,o,p,f,m,g,v){var y,b,w=o/m,x=p/g,M=o/2,T=p/2,S=f/2,_=m+1,A=g+1,P=0,C=0,E=new Je;for(b=0;b<A;b++){var D=b*x-T;for(y=0;y<_;y++){var L=y*w-M;E[t]=L*n,E[e]=D*r,E[i]=S,l.push(E.x,E.y,E.z),E[t]=0,E[e]=0,E[i]=f>0?1:-1,u.push(E.x,E.y,E.z),h.push(y/m),h.push(1-b/g),P+=1}}for(b=0;b<g;b++)for(y=0;y<m;y++){var O=c+y+_*b,I=c+y+_*(b+1),R=c+(y+1)+_*(b+1),N=c+(y+1)+_*b;s.push(O,I,N),s.push(I,R,N),C+=6}a.addGroup(d,C,v),d+=C,c+=P}p("z","y","x",-1,-1,i,e,t,o,r,0),p("z","y","x",1,-1,i,e,-t,o,r,1),p("x","z","y",1,1,t,i,e,n,o,2),p("x","z","y",1,-1,t,i,-e,n,o,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(s),this.addAttribute("position",new Qi(l,3)),this.addAttribute("normal",new Qi(u,3)),this.addAttribute("uv",new Qi(h,2))}function an(t,e,i,n){ji.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:n},this.fromBufferGeometry(new sn(t,e,i,n)),this.mergeVertices()}function sn(t,e,i,n){nn.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:n};var r,o,a=(t=t||1)/2,s=(e=e||1)/2,l=Math.floor(i)||1,u=Math.floor(n)||1,h=l+1,c=u+1,d=t/l,p=e/u,f=[],m=[],g=[],v=[];for(o=0;o<c;o++){var y=o*p-s;for(r=0;r<h;r++){var b=r*d-a;m.push(b,-y,0),g.push(0,0,1),v.push(r/l),v.push(1-o/u)}}for(o=0;o<u;o++)for(r=0;r<l;r++){var w=r+h*o,x=r+h*(o+1),M=r+1+h*(o+1),T=r+1+h*o;f.push(w,x,T),f.push(x,M,T)}this.setIndex(f),this.addAttribute("position",new Qi(m,3)),this.addAttribute("normal",new Qi(g,3)),this.addAttribute("uv",new Qi(v,2))}nn.prototype=Object.assign(Object.create(n.prototype),{constructor:nn,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(tn(t)>65535?Ki:Xi)(t,1):this.index=t},addAttribute:function(t,e){return e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(this.setIndex(e),this):(this.attributes[t]=e,this):this.addAttribute(t,new Hi(arguments[1],arguments[2]))},getAttribute:function(t){return this.attributes[t]},removeAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,i){this.groups.push({start:t,count:e,materialIndex:void 0!==i?i:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix:function(t){var e=this.attributes.position;void 0!==e&&(t.applyToBufferAttribute(e),e.needsUpdate=!0);var i=this.attributes.normal;void 0!==i&&((new $e).getNormalMatrix(t).applyToBufferAttribute(i),i.needsUpdate=!0);return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var t=new Ke;return function(e){return t.makeRotationX(e),this.applyMatrix(t),this}}(),rotateY:function(){var t=new Ke;return function(e){return t.makeRotationY(e),this.applyMatrix(t),this}}(),rotateZ:function(){var t=new Ke;return function(e){return t.makeRotationZ(e),this.applyMatrix(t),this}}(),translate:function(){var t=new Ke;return function(e,i,n){return t.makeTranslation(e,i,n),this.applyMatrix(t),this}}(),scale:function(){var t=new Ke;return function(e,i,n){return t.makeScale(e,i,n),this.applyMatrix(t),this}}(),lookAt:function(){var t=new Bi;return function(e){t.lookAt(e),t.updateMatrix(),this.applyMatrix(t.matrix)}}(),center:function(){var t=new Je;return function(){return this.computeBoundingBox(),this.boundingBox.getCenter(t).negate(),this.translate(t.x,t.y,t.z),this}}(),setFromObject:function(t){var e=t.geometry;if(t.isPoints||t.isLine){var i=new Qi(3*e.vertices.length,3),n=new Qi(3*e.colors.length,3);if(this.addAttribute("position",i.copyVector3sArray(e.vertices)),this.addAttribute("color",n.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){var r=new Qi(e.lineDistances.length,1);this.addAttribute("lineDistance",r.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},setFromPoints:function(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i];e.push(r.x,r.y,r.z||0)}return this.addAttribute("position",new Qi(e,3)),this},updateFromObject:function(t){var e,i=t.geometry;if(t.isMesh){var n=i.__directGeometry;if(!0===i.elementsNeedUpdate&&(n=void 0,i.elementsNeedUpdate=!1),void 0===n)return this.fromGeometry(i);n.verticesNeedUpdate=i.verticesNeedUpdate,n.normalsNeedUpdate=i.normalsNeedUpdate,n.colorsNeedUpdate=i.colorsNeedUpdate,n.uvsNeedUpdate=i.uvsNeedUpdate,n.groupsNeedUpdate=i.groupsNeedUpdate,i.verticesNeedUpdate=!1,i.normalsNeedUpdate=!1,i.colorsNeedUpdate=!1,i.uvsNeedUpdate=!1,i.groupsNeedUpdate=!1,i=n}return!0===i.verticesNeedUpdate&&(void 0!==(e=this.attributes.position)&&(e.copyVector3sArray(i.vertices),e.needsUpdate=!0),i.verticesNeedUpdate=!1),!0===i.normalsNeedUpdate&&(void 0!==(e=this.attributes.normal)&&(e.copyVector3sArray(i.normals),e.needsUpdate=!0),i.normalsNeedUpdate=!1),!0===i.colorsNeedUpdate&&(void 0!==(e=this.attributes.color)&&(e.copyColorsArray(i.colors),e.needsUpdate=!0),i.colorsNeedUpdate=!1),i.uvsNeedUpdate&&(void 0!==(e=this.attributes.uv)&&(e.copyVector2sArray(i.uvs),e.needsUpdate=!0),i.uvsNeedUpdate=!1),i.lineDistancesNeedUpdate&&(void 0!==(e=this.attributes.lineDistance)&&(e.copyArray(i.lineDistances),e.needsUpdate=!0),i.lineDistancesNeedUpdate=!1),i.groupsNeedUpdate&&(i.computeGroups(t.geometry),this.groups=i.groups,i.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new $i).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){var e=new Float32Array(3*t.vertices.length);if(this.addAttribute("position",new Hi(e,3).copyVector3sArray(t.vertices)),t.normals.length>0){var i=new Float32Array(3*t.normals.length);this.addAttribute("normal",new Hi(i,3).copyVector3sArray(t.normals))}if(t.colors.length>0){var n=new Float32Array(3*t.colors.length);this.addAttribute("color",new Hi(n,3).copyColorsArray(t.colors))}if(t.uvs.length>0){var r=new Float32Array(2*t.uvs.length);this.addAttribute("uv",new Hi(r,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){var o=new Float32Array(2*t.uvs2.length);this.addAttribute("uv2",new Hi(o,2).copyVector2sArray(t.uvs2))}for(var a in this.groups=t.groups,t.morphTargets){for(var s=[],l=t.morphTargets[a],u=0,h=l.length;u<h;u++){var c=l[u],d=new Qi(3*c.data.length,3);d.name=c.name,s.push(d.copyVector3sArray(c.data))}this.morphAttributes[a]=s}if(t.skinIndices.length>0){var p=new Qi(4*t.skinIndices.length,4);this.addAttribute("skinIndex",p.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){var f=new Qi(4*t.skinWeights.length,4);this.addAttribute("skinWeight",f.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new di);var t=this.attributes.position;void 0!==t?this.boundingBox.setFromBufferAttribute(t):this.boundingBox.makeEmpty(),isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z)},computeBoundingSphere:function(){var t=new di,e=new Je;return function(){null===this.boundingSphere&&(this.boundingSphere=new pi);var i=this.attributes.position;if(i){var n=this.boundingSphere.center;t.setFromBufferAttribute(i),t.getCenter(n);for(var r=0,o=0,a=i.count;o<a;o++)e.x=i.getX(o),e.y=i.getY(o),e.z=i.getZ(o),r=Math.max(r,n.distanceToSquared(e));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.index,e=this.attributes;if(e.position){var i=e.position.array;if(void 0===e.normal)this.addAttribute("normal",new Hi(new Float32Array(i.length),3));else for(var n=e.normal.array,r=0,o=n.length;r<o;r++)n[r]=0;var a,s,l,u=e.normal.array,h=new Je,c=new Je,d=new Je,p=new Je,f=new Je;if(t){var m=t.array;for(r=0,o=t.count;r<o;r+=3)a=3*m[r+0],s=3*m[r+1],l=3*m[r+2],h.fromArray(i,a),c.fromArray(i,s),d.fromArray(i,l),p.subVectors(d,c),f.subVectors(h,c),p.cross(f),u[a]+=p.x,u[a+1]+=p.y,u[a+2]+=p.z,u[s]+=p.x,u[s+1]+=p.y,u[s+2]+=p.z,u[l]+=p.x,u[l+1]+=p.y,u[l+2]+=p.z}else for(r=0,o=i.length;r<o;r+=9)h.fromArray(i,r),c.fromArray(i,r+3),d.fromArray(i,r+6),p.subVectors(d,c),f.subVectors(h,c),p.cross(f),u[r]=p.x,u[r+1]=p.y,u[r+2]=p.z,u[r+3]=p.x,u[r+4]=p.y,u[r+5]=p.z,u[r+6]=p.x,u[r+7]=p.y,u[r+8]=p.z;this.normalizeNormals(),e.normal.needsUpdate=!0}},merge:function(t,e){if(t&&t.isBufferGeometry){void 0===e&&(e=0);var i=this.attributes;for(var n in i)if(void 0!==t.attributes[n])for(var r=i[n].array,o=t.attributes[n],a=o.array,s=0,l=o.itemSize*e;s<a.length;s++,l++)r[l]=a[s];return this}},normalizeNormals:function(){var t=new Je;return function(){for(var e=this.attributes.normal,i=0,n=e.count;i<n;i++)t.x=e.getX(i),t.y=e.getY(i),t.z=e.getZ(i),t.normalize(),e.setXYZ(i,t.x,t.y,t.z)}}(),toNonIndexed:function(){if(null===this.index)return this;var t=new nn,e=this.index.array,i=this.attributes;for(var n in i){for(var r=i[n],o=r.array,a=r.itemSize,s=new o.constructor(e.length*a),l=0,u=0,h=0,c=e.length;h<c;h++){l=e[h]*a;for(var d=0;d<a;d++)s[u++]=o[l++]}t.addAttribute(n,new Hi(s,a))}var p=this.groups;for(h=0,c=p.length;h<c;h++){var f=p[h];t.addGroup(f.start,f.count,f.materialIndex)}return t},toJSON:function(){var t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){var e=this.parameters;for(var i in e)void 0!==e[i]&&(t[i]=e[i]);return t}t.data={attributes:{}};var n=this.index;if(null!==n){var r=Array.prototype.slice.call(n.array);t.data.index={type:n.array.constructor.name,array:r}}var o=this.attributes;for(var i in o){var a=o[i];r=Array.prototype.slice.call(a.array);t.data.attributes[i]={itemSize:a.itemSize,type:a.array.constructor.name,array:r,normalized:a.normalized}}var s=this.groups;s.length>0&&(t.data.groups=JSON.parse(JSON.stringify(s)));var l=this.boundingSphere;return null!==l&&(t.data.boundingSphere={center:l.center.toArray(),radius:l.radius}),t},clone:function(){return(new nn).copy(this)},copy:function(t){var e,i,n;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;var r=t.index;null!==r&&this.setIndex(r.clone());var o=t.attributes;for(e in o){var a=o[e];this.addAttribute(e,a.clone())}var s=t.morphAttributes;for(e in s){var l=[],u=s[e];for(i=0,n=u.length;i<n;i++)l.push(u[i].clone());this.morphAttributes[e]=l}var h=t.groups;for(i=0,n=h.length;i<n;i++){var c=h[i];this.addGroup(c.start,c.count,c.materialIndex)}var d=t.boundingBox;null!==d&&(this.boundingBox=d.clone());var p=t.boundingSphere;return null!==p&&(this.boundingSphere=p.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),rn.prototype=Object.create(ji.prototype),rn.prototype.constructor=rn,on.prototype=Object.create(nn.prototype),on.prototype.constructor=on,an.prototype=Object.create(ji.prototype),an.prototype.constructor=an,sn.prototype=Object.create(nn.prototype),sn.prototype.constructor=sn;var ln,un,hn,cn,dn,pn,fn,mn,gn,vn,yn,bn,wn=0;function xn(){Object.defineProperty(this,"id",{value:wn++}),this.uuid=Xe.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.lights=!0,this.blending=I,this.side=S,this.flatShading=!1,this.vertexColors=E,this.opacity=1,this.transparent=!1,this.blendSrc=Y,this.blendDst=X,this.blendEquation=B,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=nt,this.depthTest=!0,this.depthWrite=!0,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.userData={},this.needsUpdate=!0}function Mn(t){xn.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==t&&(t.attributes,this.setValues(t))}function Tn(t,e){this.origin=void 0!==t?t:new Je,this.direction=void 0!==e?e:new Je}function Sn(t,e,i){this.a=void 0!==t?t:new Je,this.b=void 0!==e?e:new Je,this.c=void 0!==i?i:new Je}function _n(t){xn.call(this),this.type="MeshBasicMaterial",this.color=new Si(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=lt,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.lights=!1,this.setValues(t)}function An(t,e){Bi.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new nn,this.material=void 0!==e?e:new _n({color:16777215*Math.random()}),this.drawMode=Ie,this.updateMorphTargets()}function Pn(t,e,i,n){var r,o,a=new Si(0),s=0,l=null,u=0;function h(t,i){e.buffers.color.setClear(t.r,t.g,t.b,i,n)}return{getClearColor:function(){return a},setClearColor:function(t,e){a.set(t),h(a,s=void 0!==e?e:1)},getClearAlpha:function(){return s},setClearAlpha:function(t){h(a,s=t)},render:function(e,n,c,d){var p=n.background;if(null===p?(h(a,s),l=null,u=0):p&&p.isColor&&(h(p,1),d=!0,l=null,u=0),(t.autoClear||d)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),p&&(p.isCubeTexture||p.isWebGLRenderTargetCube)){void 0===o&&((o=new An(new on(1,1,1),new Mn({type:"BackgroundCubeMaterial",uniforms:vi(Pi.cube.uniforms),vertexShader:Pi.cube.vertexShader,fragmentShader:Pi.cube.fragmentShader,side:_,depthTest:!0,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),o.geometry.removeAttribute("uv"),o.onBeforeRender=function(t,e,i){this.matrixWorld.copyPosition(i.matrixWorld)},Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.tCube.value}}),i.update(o));var f=p.isWebGLRenderTargetCube?p.texture:p;o.material.uniforms.tCube.value=f,o.material.uniforms.tFlip.value=p.isWebGLRenderTargetCube?1:-1,l===p&&u===f.version||(o.material.needsUpdate=!0,l=p,u=f.version),e.unshift(o,o.geometry,o.material,0,null)}else p&&p.isTexture&&(void 0===r&&((r=new An(new sn(2,2),new Mn({type:"BackgroundMaterial",uniforms:vi(Pi.background.uniforms),vertexShader:Pi.background.vertexShader,fragmentShader:Pi.background.fragmentShader,side:S,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.removeAttribute("normal"),Object.defineProperty(r.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(r)),r.material.uniforms.t2D.value=p,!0===p.matrixAutoUpdate&&p.updateMatrix(),r.material.uniforms.uvTransform.value.copy(p.matrix),l===p&&u===p.version||(r.material.needsUpdate=!0,l=p,u=p.version),e.unshift(r,r.geometry,r.material,0,null))}}}function Cn(t,e,i,n){var r;this.setMode=function(t){r=t},this.render=function(e,n){t.drawArrays(r,e,n),i.update(n,r)},this.renderInstances=function(o,a,s){var l;if(n.isWebGL2)l=t;else if(null===(l=e.get("ANGLE_instanced_arrays")))return;l[n.isWebGL2?"drawArraysInstanced":"drawArraysInstancedANGLE"](r,a,s,o.maxInstancedCount),i.update(s,r,o.maxInstancedCount)}}function En(t,e,i){var 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"}var o="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext,a=void 0!==i.precision?i.precision:"highp",s=r(a);s!==a&&(a=s);var l=!0===i.logarithmicDepthBuffer,u=t.getParameter(34930),h=t.getParameter(35660),c=t.getParameter(3379),d=t.getParameter(34076),p=t.getParameter(34921),f=t.getParameter(36347),m=t.getParameter(36348),g=t.getParameter(36349),v=h>0,y=o||!!e.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==n)return n;var i=e.get("EXT_texture_filter_anisotropic");return n=null!==i?t.getParameter(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:r,precision:a,logarithmicDepthBuffer:l,maxTextures:u,maxVertexTextures:h,maxTextureSize:c,maxCubemapSize:d,maxAttributes:p,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y}}function Dn(){var t=this,e=null,i=0,n=!1,r=!1,o=new fi,a=new $e,s={value:null,needsUpdate:!1};function l(){s.value!==e&&(s.value=e,s.needsUpdate=i>0),t.numPlanes=i,t.numIntersection=0}function u(e,i,n,r){var l=null!==e?e.length:0,u=null;if(0!==l){if(u=s.value,!0!==r||null===u){var h=n+4*l,c=i.matrixWorldInverse;a.getNormalMatrix(c),(null===u||u.length<h)&&(u=new Float32Array(h));for(var d=0,p=n;d!==l;++d,p+=4)o.copy(e[d]).applyMatrix4(c,a),o.normal.toArray(u,p),u[p+3]=o.constant}s.value=u,s.needsUpdate=!0}return t.numPlanes=l,u}this.uniform=s,this.numPlanes=0,this.numIntersection=0,this.init=function(t,r,o){var a=0!==t.length||r||0!==i||n;return n=r,e=u(t,o,0),i=t.length,a},this.beginShadows=function(){r=!0,u(null)},this.endShadows=function(){r=!1,l()},this.setState=function(t,o,a,h,c,d){if(!n||null===t||0===t.length||r&&!a)r?u(null):l();else{var p=r?0:i,f=4*p,m=c.clippingState||null;s.value=m,m=u(t,h,f,d);for(var g=0;g!==f;++g)m[g]=e[g];c.clippingState=m,this.numIntersection=o?this.numPlanes:0,this.numPlanes+=p}}}function Ln(t){var e={};return{get:function(i){if(void 0!==e[i])return e[i];var 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}}}function On(t,e,i){var n={},r={};function o(t){var a=t.target,s=n[a.id];for(var l in null!==s.index&&e.remove(s.index),s.attributes)e.remove(s.attributes[l]);a.removeEventListener("dispose",o),delete n[a.id];var u=r[s.id];u&&(e.remove(u),delete r[s.id]),i.memory.geometries--}return{get:function(t,e){var r=n[e.id];return r||(e.addEventListener("dispose",o),e.isBufferGeometry?r=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new nn).setFromObject(t)),r=e._bufferGeometry),n[e.id]=r,i.memory.geometries++,r)},update:function(t){var i=t.index,n=t.attributes;for(var r in null!==i&&e.update(i,34963),n)e.update(n[r],34962);var o=t.morphAttributes;for(var r in o)for(var a=o[r],s=0,l=a.length;s<l;s++)e.update(a[s],34962)},getWireframeAttribute:function(t){var i=r[t.id];if(i)return i;var n,o=[],a=t.index,s=t.attributes;if(null!==a)for(var l=0,u=(n=a.array).length;l<u;l+=3){var h=n[l+0],c=n[l+1],d=n[l+2];o.push(h,c,c,d,d,h)}else for(l=0,u=(n=s.position.array).length/3-1;l<u;l+=3){h=l+0,c=l+1,d=l+2;o.push(h,c,c,d,d,h)}return i=new(tn(o)>65535?Ki:Xi)(o,1),e.update(i,34963),r[t.id]=i,i}}}function In(t,e,i,n){var r,o,a;this.setMode=function(t){r=t},this.setIndex=function(t){o=t.type,a=t.bytesPerElement},this.render=function(e,n){t.drawElements(r,n,o,e*a),i.update(n,r)},this.renderInstances=function(s,l,u){var h;if(n.isWebGL2)h=t;else if(null===(h=e.get("ANGLE_instanced_arrays")))return;h[n.isWebGL2?"drawElementsInstanced":"drawElementsInstancedANGLE"](r,u,o,l*a,s.maxInstancedCount),i.update(u,r,s.maxInstancedCount)}}function Rn(t){var e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(t,i,n){switch(n=n||1,e.calls++,i){case 4:e.triangles+=n*(t/3);break;case 5:case 6:e.triangles+=n*(t-2);break;case 1:e.lines+=n*(t/2);break;case 3:e.lines+=n*(t-1);break;case 2:e.lines+=n*t;break;case 0:e.points+=n*t}}}}function Nn(t,e){return Math.abs(e[1])-Math.abs(t[1])}function kn(t){var e={},i=new Float32Array(8);return{update:function(n,r,o,a){var s=n.morphTargetInfluences,l=s.length,u=e[r.id];if(void 0===u){u=[];for(var h=0;h<l;h++)u[h]=[h,0];e[r.id]=u}var c=o.morphTargets&&r.morphAttributes.position,d=o.morphNormals&&r.morphAttributes.normal;for(h=0;h<l;h++){0!==(p=u[h])[1]&&(c&&r.removeAttribute("morphTarget"+h),d&&r.removeAttribute("morphNormal"+h))}for(h=0;h<l;h++){(p=u[h])[0]=h,p[1]=s[h]}for(u.sort(Nn),h=0;h<8;h++){var p;if(p=u[h]){var f=p[0],m=p[1];if(m){c&&r.addAttribute("morphTarget"+h,c[f]),d&&r.addAttribute("morphNormal"+h,d[f]),i[h]=m;continue}}i[h]=0}a.getUniforms().setValue(t,"morphTargetInfluences",i)}}}function Fn(t,e){var i={};return{update:function(n){var r=e.render.frame,o=n.geometry,a=t.get(n,o);return i[a.id]!==r&&(o.isGeometry&&a.updateFromObject(n),t.update(a),i[a.id]=r),a},dispose:function(){i={}}}}function Bn(t,e,i,n,r,o,a,s,l,u){t=void 0!==t?t:[],e=void 0!==e?e:yt,si.call(this,t,e,i,n,r,o,a,s,l,u),this.flipY=!1}function zn(t,e,i,n){si.call(this,null),this.image={data:t,width:e,height:i,depth:n},this.magFilter=Ct,this.minFilter=Ct,this.generateMipmaps=!1,this.flipY=!1}xn.prototype=Object.assign(Object.create(n.prototype),{constructor:xn,isMaterial:!0,onBeforeCompile:function(){},setValues:function(t){if(void 0!==t)for(var e in t){var i=t[e];if(void 0!==i)if("shading"!==e){var n=this[e];void 0!==n&&(n&&n.isColor?n.set(i):n&&n.isVector3&&i&&i.isVector3?n.copy(i):this[e]=i)}else this.flatShading=i===P}},toJSON:function(t){var e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});var i={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function n(t){var e=[];for(var i in t){var 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),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),1!==this.emissiveIntensity&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.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.map&&this.map.isTexture&&(i.map=this.map.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),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.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(t).uuid,i.reflectivity=this.reflectivity,void 0!==this.combine&&(i.combine=this.combine),void 0!==this.envMapIntensity&&(i.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(i.size=this.size),void 0!==this.sizeAttenuation&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==I&&(i.blending=this.blending),!0===this.flatShading&&(i.flatShading=this.flatShading),this.side!==S&&(i.side=this.side),this.vertexColors!==E&&(i.vertexColors=this.vertexColors),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,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),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.premultipliedAlpha&&(i.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(i.wireframe=this.wireframe),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(i.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(i.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(i.morphTargets=!0),!0===this.skinning&&(i.skinning=!0),!1===this.visible&&(i.visible=!1),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),e){var r=n(t.textures),o=n(t.images);r.length>0&&(i.textures=r),o.length>0&&(i.images=o)}return i},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.lights=t.lights,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.userData=JSON.parse(JSON.stringify(t.userData)),this.clipShadows=t.clipShadows,this.clipIntersection=t.clipIntersection;var e=t.clippingPlanes,i=null;if(null!==e){var n=e.length;i=new Array(n);for(var r=0;r!==n;++r)i[r]=e[r].clone()}return this.clippingPlanes=i,this.shadowSide=t.shadowSide,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Mn.prototype=Object.create(xn.prototype),Mn.prototype.constructor=Mn,Mn.prototype.isShaderMaterial=!0,Mn.prototype.copy=function(t){return xn.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=vi(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=t.extensions,this},Mn.prototype.toJSON=function(t){var e=xn.prototype.toJSON.call(this,t);for(var i in e.uniforms={},this.uniforms){var n=this.uniforms[i].value;n&&n.isTexture?e.uniforms[i]={type:"t",value:n.toJSON(t).uuid}:n&&n.isColor?e.uniforms[i]={type:"c",value:n.getHex()}:n&&n.isVector2?e.uniforms[i]={type:"v2",value:n.toArray()}:n&&n.isVector3?e.uniforms[i]={type:"v3",value:n.toArray()}:n&&n.isVector4?e.uniforms[i]={type:"v4",value:n.toArray()}:n&&n.isMatrix4?e.uniforms[i]={type:"m4",value:n.toArray()}:e.uniforms[i]={value:n}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;var r={};for(var o in this.extensions)!0===this.extensions[o]&&(r[o]=!0);return Object.keys(r).length>0&&(e.extensions=r),e},Object.assign(Tn.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return void 0===e&&(e=new Je),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(){var t=new Je;return function(e){return this.origin.copy(this.at(e,t)),this}}(),closestPointToPoint:function(t,e){void 0===e&&(e=new Je),e.subVectors(t,this.origin);var i=e.dot(this.direction);return i<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(i).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(){var t=new Je;return function(e){var i=t.subVectors(e,this.origin).dot(this.direction);return i<0?this.origin.distanceToSquared(e):(t.copy(this.direction).multiplyScalar(i).add(this.origin),t.distanceToSquared(e))}}(),distanceSqToSegment:(un=new Je,hn=new Je,cn=new Je,function(t,e,i,n){un.copy(t).add(e).multiplyScalar(.5),hn.copy(e).sub(t).normalize(),cn.copy(this.origin).sub(un);var r,o,a,s,l=.5*t.distanceTo(e),u=-this.direction.dot(hn),h=cn.dot(this.direction),c=-cn.dot(hn),d=cn.lengthSq(),p=Math.abs(1-u*u);if(p>0)if(o=u*h-c,s=l*p,(r=u*c-h)>=0)if(o>=-s)if(o<=s){var f=1/p;a=(r*=f)*(r+u*(o*=f)+2*h)+o*(u*r+o+2*c)+d}else o=l,a=-(r=Math.max(0,-(u*o+h)))*r+o*(o+2*c)+d;else o=-l,a=-(r=Math.max(0,-(u*o+h)))*r+o*(o+2*c)+d;else o<=-s?a=-(r=Math.max(0,-(-u*l+h)))*r+(o=r>0?-l:Math.min(Math.max(-l,-c),l))*(o+2*c)+d:o<=s?(r=0,a=(o=Math.min(Math.max(-l,-c),l))*(o+2*c)+d):a=-(r=Math.max(0,-(u*l+h)))*r+(o=r>0?l:Math.min(Math.max(-l,-c),l))*(o+2*c)+d;else o=u>0?-l:l,a=-(r=Math.max(0,-(u*o+h)))*r+o*(o+2*c)+d;return i&&i.copy(this.direction).multiplyScalar(r).add(this.origin),n&&n.copy(hn).multiplyScalar(o).add(un),a}),intersectSphere:function(){var t=new Je;return function(e,i){t.subVectors(e.center,this.origin);var n=t.dot(this.direction),r=t.dot(t)-n*n,o=e.radius*e.radius;if(r>o)return null;var a=Math.sqrt(o-r),s=n-a,l=n+a;return s<0&&l<0?null:s<0?this.at(l,i):this.at(s,i)}}(),intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){var e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;var i=-(this.origin.dot(t.normal)+t.constant)/e;return i>=0?i:null},intersectPlane:function(t,e){var i=this.distanceToPlane(t);return null===i?null:this.at(i,e)},intersectsPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){var i,n,r,o,a,s,l=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,c=this.origin;return l>=0?(i=(t.min.x-c.x)*l,n=(t.max.x-c.x)*l):(i=(t.max.x-c.x)*l,n=(t.min.x-c.x)*l),u>=0?(r=(t.min.y-c.y)*u,o=(t.max.y-c.y)*u):(r=(t.max.y-c.y)*u,o=(t.min.y-c.y)*u),i>o||r>n?null:((r>i||i!=i)&&(i=r),(o<n||n!=n)&&(n=o),h>=0?(a=(t.min.z-c.z)*h,s=(t.max.z-c.z)*h):(a=(t.max.z-c.z)*h,s=(t.min.z-c.z)*h),i>s||a>n?null:((a>i||i!=i)&&(i=a),(s<n||n!=n)&&(n=s),n<0?null:this.at(i>=0?i:n,e)))},intersectsBox:(ln=new Je,function(t){return null!==this.intersectBox(t,ln)}),intersectTriangle:function(){var t=new Je,e=new Je,i=new Je,n=new Je;return function(r,o,a,s,l){e.subVectors(o,r),i.subVectors(a,r),n.crossVectors(e,i);var u,h=this.direction.dot(n);if(h>0){if(s)return null;u=1}else{if(!(h<0))return null;u=-1,h=-h}t.subVectors(this.origin,r);var c=u*this.direction.dot(i.crossVectors(t,i));if(c<0)return null;var d=u*this.direction.dot(e.cross(t));if(d<0)return null;if(c+d>h)return null;var p=-u*t.dot(n);return p<0?null:this.at(p/h,l)}}(),applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}}),Object.assign(Sn,{getNormal:(pn=new Je,function(t,e,i,n){void 0===n&&(n=new Je),n.subVectors(i,e),pn.subVectors(t,e),n.cross(pn);var r=n.lengthSq();return r>0?n.multiplyScalar(1/Math.sqrt(r)):n.set(0,0,0)}),getBarycoord:function(){var t=new Je,e=new Je,i=new Je;return function(n,r,o,a,s){t.subVectors(a,r),e.subVectors(o,r),i.subVectors(n,r);var l=t.dot(t),u=t.dot(e),h=t.dot(i),c=e.dot(e),d=e.dot(i),p=l*c-u*u;if(void 0===s&&(s=new Je),0===p)return s.set(-2,-1,-1);var f=1/p,m=(c*h-u*d)*f,g=(l*d-u*h)*f;return s.set(1-m-g,g,m)}}(),containsPoint:function(){var t=new Je;return function(e,i,n,r){return Sn.getBarycoord(e,i,n,r,t),t.x>=0&&t.y>=0&&t.x+t.y<=1}}(),getUV:(dn=new Je,function(t,e,i,n,r,o,a,s){return this.getBarycoord(t,e,i,n,dn),s.set(0,0),s.addScaledVector(r,dn.x),s.addScaledVector(o,dn.y),s.addScaledVector(a,dn.z),s})}),Object.assign(Sn.prototype,{set:function(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this},setFromPointsAndIndices:function(t,e,i,n){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[n]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:function(){var t=new Je,e=new Je;return function(){return t.subVectors(this.c,this.b),e.subVectors(this.a,this.b),.5*t.cross(e).length()}}(),getMidpoint:function(t){return void 0===t&&(t=new Je),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return Sn.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(t=new Je),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return Sn.getBarycoord(t,this.a,this.b,this.c,e)},containsPoint:function(t){return Sn.containsPoint(t,this.a,this.b,this.c)},getUV:function(t,e,i,n,r){return Sn.getUV(t,this.a,this.b,this.c,e,i,n,r)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:(fn=new Je,mn=new Je,gn=new Je,vn=new Je,yn=new Je,bn=new Je,function(t,e){void 0===e&&(e=new Je);var i,n,r=this.a,o=this.b,a=this.c;fn.subVectors(o,r),mn.subVectors(a,r),vn.subVectors(t,r);var s=fn.dot(vn),l=mn.dot(vn);if(s<=0&&l<=0)return e.copy(r);yn.subVectors(t,o);var u=fn.dot(yn),h=mn.dot(yn);if(u>=0&&h<=u)return e.copy(o);var c=s*h-u*l;if(c<=0&&s>=0&&u<=0)return i=s/(s-u),e.copy(r).addScaledVector(fn,i);bn.subVectors(t,a);var d=fn.dot(bn),p=mn.dot(bn);if(p>=0&&d<=p)return e.copy(a);var f=d*l-s*p;if(f<=0&&l>=0&&p<=0)return n=l/(l-p),e.copy(r).addScaledVector(mn,n);var m=u*p-d*h;if(m<=0&&h-u>=0&&d-p>=0)return gn.subVectors(a,o),n=(h-u)/(h-u+(d-p)),e.copy(o).addScaledVector(gn,n);var g=1/(m+f+c);return i=f*g,n=c*g,e.copy(r).addScaledVector(fn,i).addScaledVector(mn,n)}),equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}}),_n.prototype=Object.create(xn.prototype),_n.prototype.constructor=_n,_n.prototype.isMeshBasicMaterial=!0,_n.prototype.copy=function(t){return xn.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this},An.prototype=Object.assign(Object.create(Bi.prototype),{constructor:An,isMesh:!0,setDrawMode:function(t){this.drawMode=t},copy:function(t){return Bi.prototype.copy.call(this,t),this.drawMode=t.drawMode,void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this},updateMorphTargets:function(){var t,e,i,n=this.geometry;if(n.isBufferGeometry){var r=n.morphAttributes,o=Object.keys(r);if(o.length>0){var a=r[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},t=0,e=a.length;t<e;t++)i=a[t].name||String(t),this.morphTargetInfluences.push(0),this.morphTargetDictionary[i]=t}}else{var s=n.morphTargets;void 0!==s&&s.length}},raycast:function(){var t=new Ke,e=new Tn,i=new pi,n=new Je,r=new Je,o=new Je,a=new Je,s=new Je,l=new Je,u=new Ze,h=new Ze,c=new Ze,d=new Je,p=new Je;function f(t,e,i,n,r,o,a,s){if(null===(e.side===_?n.intersectTriangle(a,o,r,!0,s):n.intersectTriangle(r,o,a,e.side!==A,s)))return null;p.copy(s),p.applyMatrix4(t.matrixWorld);var l=i.ray.origin.distanceTo(p);return l<i.near||l>i.far?null:{distance:l,point:p.clone(),object:t}}function m(t,e,i,a,s,l,p,m,g){n.fromBufferAttribute(s,p),r.fromBufferAttribute(s,m),o.fromBufferAttribute(s,g);var v=f(t,e,i,a,n,r,o,d);if(v){l&&(u.fromBufferAttribute(l,p),h.fromBufferAttribute(l,m),c.fromBufferAttribute(l,g),v.uv=Sn.getUV(d,n,r,o,u,h,c,new Ze));var y=new Di(p,m,g);Sn.getNormal(n,r,o,y.normal),v.face=y}return v}return function(p,g){var v,y=this.geometry,b=this.material,w=this.matrixWorld;if(void 0!==b&&(null===y.boundingSphere&&y.computeBoundingSphere(),i.copy(y.boundingSphere),i.applyMatrix4(w),!1!==p.ray.intersectsSphere(i)&&(t.getInverse(w),e.copy(p.ray).applyMatrix4(t),null===y.boundingBox||!1!==e.intersectsBox(y.boundingBox))))if(y.isBufferGeometry){var x,M,T,S,_,A,P,C,E,D=y.index,L=y.attributes.position,O=y.attributes.uv,I=y.groups,R=y.drawRange;if(null!==D)if(Array.isArray(b))for(S=0,A=I.length;S<A;S++)for(E=b[(C=I[S]).materialIndex],_=Math.max(C.start,R.start),P=Math.min(C.start+C.count,R.start+R.count);_<P;_+=3)x=D.getX(_),M=D.getX(_+1),T=D.getX(_+2),(v=m(this,E,p,e,L,O,x,M,T))&&(v.faceIndex=Math.floor(_/3),g.push(v));else for(S=Math.max(0,R.start),A=Math.min(D.count,R.start+R.count);S<A;S+=3)x=D.getX(S),M=D.getX(S+1),T=D.getX(S+2),(v=m(this,b,p,e,L,O,x,M,T))&&(v.faceIndex=Math.floor(S/3),g.push(v));else if(void 0!==L)if(Array.isArray(b))for(S=0,A=I.length;S<A;S++)for(E=b[(C=I[S]).materialIndex],_=Math.max(C.start,R.start),P=Math.min(C.start+C.count,R.start+R.count);_<P;_+=3)(v=m(this,E,p,e,L,O,x=_,M=_+1,T=_+2))&&(v.faceIndex=Math.floor(_/3),g.push(v));else for(S=Math.max(0,R.start),A=Math.min(L.count,R.start+R.count);S<A;S+=3)(v=m(this,b,p,e,L,O,x=S,M=S+1,T=S+2))&&(v.faceIndex=Math.floor(S/3),g.push(v))}else if(y.isGeometry){var N,k,F,B,z=Array.isArray(b),U=y.vertices,V=y.faces,j=y.faceVertexUvs[0];j.length>0&&(B=j);for(var H=0,G=V.length;H<G;H++){var W=V[H],q=z?b[W.materialIndex]:b;if(void 0!==q){if(N=U[W.a],k=U[W.b],F=U[W.c],!0===q.morphTargets){var Y=y.morphTargets,X=this.morphTargetInfluences;n.set(0,0,0),r.set(0,0,0),o.set(0,0,0);for(var Z=0,K=Y.length;Z<K;Z++){var Q=X[Z];if(0!==Q){var J=Y[Z].vertices;n.addScaledVector(a.subVectors(J[W.a],N),Q),r.addScaledVector(s.subVectors(J[W.b],k),Q),o.addScaledVector(l.subVectors(J[W.c],F),Q)}}n.add(N),r.add(k),o.add(F),N=n,k=r,F=o}if(v=f(this,q,p,e,N,k,F,d)){if(B&&B[H]){var $=B[H];u.copy($[0]),h.copy($[1]),c.copy($[2]),v.uv=Sn.getUV(d,N,k,F,u,h,c,new Ze)}v.face=W,v.faceIndex=H,g.push(v)}}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Bn.prototype=Object.create(si.prototype),Bn.prototype.constructor=Bn,Bn.prototype.isCubeTexture=!0,Object.defineProperty(Bn.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),zn.prototype=Object.create(si.prototype),zn.prototype.constructor=zn,zn.prototype.isDataTexture3D=!0;var Un=new si,Vn=new zn,jn=new Bn;function Hn(){this.seq=[],this.map={}}var Gn=[],Wn=[],qn=new Float32Array(16),Yn=new Float32Array(9),Xn=new Float32Array(4);function Zn(t,e,i){var n=t[0];if(n<=0||n>0)return t;var r=e*i,o=Gn[r];if(void 0===o&&(o=new Float32Array(r),Gn[r]=o),0!==e){n.toArray(o,0);for(var a=1,s=0;a!==e;++a)s+=i,t[a].toArray(o,s)}return o}function Kn(t,e){if(t.length!==e.length)return!1;for(var i=0,n=t.length;i<n;i++)if(t[i]!==e[i])return!1;return!0}function Qn(t,e){for(var i=0,n=e.length;i<n;i++)t[i]=e[i]}function Jn(t,e){var i=Wn[e];void 0===i&&(i=new Int32Array(e),Wn[e]=i);for(var n=0;n!==e;++n)i[n]=t.allocTextureUnit();return i}function $n(t,e){var i=this.cache;i[0]!==e&&(t.uniform1f(this.addr,e),i[0]=e)}function tr(t,e){var i=this.cache;i[0]!==e&&(t.uniform1i(this.addr,e),i[0]=e)}function er(t,e){var 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(Kn(i,e))return;t.uniform2fv(this.addr,e),Qn(i,e)}}function ir(t,e){var 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(Kn(i,e))return;t.uniform3fv(this.addr,e),Qn(i,e)}}function nr(t,e){var 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(Kn(i,e))return;t.uniform4fv(this.addr,e),Qn(i,e)}}function rr(t,e){var i=this.cache,n=e.elements;if(void 0===n){if(Kn(i,e))return;t.uniformMatrix2fv(this.addr,!1,e),Qn(i,e)}else{if(Kn(i,n))return;Xn.set(n),t.uniformMatrix2fv(this.addr,!1,Xn),Qn(i,n)}}function or(t,e){var i=this.cache,n=e.elements;if(void 0===n){if(Kn(i,e))return;t.uniformMatrix3fv(this.addr,!1,e),Qn(i,e)}else{if(Kn(i,n))return;Yn.set(n),t.uniformMatrix3fv(this.addr,!1,Yn),Qn(i,n)}}function ar(t,e){var i=this.cache,n=e.elements;if(void 0===n){if(Kn(i,e))return;t.uniformMatrix4fv(this.addr,!1,e),Qn(i,e)}else{if(Kn(i,n))return;qn.set(n),t.uniformMatrix4fv(this.addr,!1,qn),Qn(i,n)}}function sr(t,e,i){var n=this.cache,r=i.allocTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTexture2D(e||Un,r)}function lr(t,e,i){var n=this.cache,r=i.allocTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTexture3D(e||Vn,r)}function ur(t,e,i){var n=this.cache,r=i.allocTextureUnit();n[0]!==r&&(t.uniform1i(this.addr,r),n[0]=r),i.setTextureCube(e||jn,r)}function hr(t,e){var i=this.cache;Kn(i,e)||(t.uniform2iv(this.addr,e),Qn(i,e))}function cr(t,e){var i=this.cache;Kn(i,e)||(t.uniform3iv(this.addr,e),Qn(i,e))}function dr(t,e){var i=this.cache;Kn(i,e)||(t.uniform4iv(this.addr,e),Qn(i,e))}function pr(t,e){var i=this.cache;Kn(i,e)||(t.uniform1fv(this.addr,e),Qn(i,e))}function fr(t,e){var i=this.cache;Kn(i,e)||(t.uniform1iv(this.addr,e),Qn(i,e))}function mr(t,e){var i=this.cache,n=Zn(e,this.size,2);Kn(i,n)||(t.uniform2fv(this.addr,n),this.updateCache(n))}function gr(t,e){var i=this.cache,n=Zn(e,this.size,3);Kn(i,n)||(t.uniform3fv(this.addr,n),this.updateCache(n))}function vr(t,e){var i=this.cache,n=Zn(e,this.size,4);Kn(i,n)||(t.uniform4fv(this.addr,n),this.updateCache(n))}function yr(t,e){var i=this.cache,n=Zn(e,this.size,4);Kn(i,n)||(t.uniformMatrix2fv(this.addr,!1,n),this.updateCache(n))}function br(t,e){var i=this.cache,n=Zn(e,this.size,9);Kn(i,n)||(t.uniformMatrix3fv(this.addr,!1,n),this.updateCache(n))}function wr(t,e){var i=this.cache,n=Zn(e,this.size,16);Kn(i,n)||(t.uniformMatrix4fv(this.addr,!1,n),this.updateCache(n))}function xr(t,e,i){var n=this.cache,r=e.length,o=Jn(i,r);!1===Kn(n,o)&&(t.uniform1iv(this.addr,o),Qn(n,o));for(var a=0;a!==r;++a)i.setTexture2D(e[a]||Un,o[a])}function Mr(t,e,i){var n=this.cache,r=e.length,o=Jn(i,r);!1===Kn(n,o)&&(t.uniform1iv(this.addr,o),Qn(n,o));for(var a=0;a!==r;++a)i.setTextureCube(e[a]||jn,o[a])}function Tr(t,e,i){this.id=t,this.addr=i,this.cache=[],this.setValue=function(t){switch(t){case 5126:return $n;case 35664:return er;case 35665:return ir;case 35666:return nr;case 35674:return rr;case 35675:return or;case 35676:return ar;case 35678:case 36198:return sr;case 35679:return lr;case 35680:return ur;case 5124:case 35670:return tr;case 35667:case 35671:return hr;case 35668:case 35672:return cr;case 35669:case 35673:return dr}}(e.type)}function Sr(t,e,i){this.id=t,this.addr=i,this.cache=[],this.size=e.size,this.setValue=function(t){switch(t){case 5126:return pr;case 35664:return mr;case 35665:return gr;case 35666:return vr;case 35674:return yr;case 35675:return br;case 35676:return wr;case 35678:return xr;case 35680:return Mr;case 5124:case 35670:return fr;case 35667:case 35671:return hr;case 35668:case 35672:return cr;case 35669:case 35673:return dr}}(e.type)}function _r(t){this.id=t,Hn.call(this)}Sr.prototype.updateCache=function(t){var e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),Qn(e,t)},_r.prototype.setValue=function(t,e,i){for(var n=this.seq,r=0,o=n.length;r!==o;++r){var a=n[r];a.setValue(t,e[a.id],i)}};var Ar=/([\w\d_]+)(\])?(\[|\.)?/g;function Pr(t,e){t.seq.push(e),t.map[e.id]=e}function Cr(t,e,i){var n=t.name,r=n.length;for(Ar.lastIndex=0;;){var o=Ar.exec(n),a=Ar.lastIndex,s=o[1],l="]"===o[2],u=o[3];if(l&&(s|=0),void 0===u||"["===u&&a+2===r){Pr(i,void 0===u?new Tr(s,t,e):new Sr(s,t,e));break}var h=i.map[s];void 0===h&&Pr(i,h=new _r(s)),i=h}}function Er(t,e,i){Hn.call(this),this.renderer=i;for(var n=t.getProgramParameter(e,35718),r=0;r<n;++r){var o=t.getActiveUniform(e,r);Cr(o,t.getUniformLocation(e,o.name),this)}}function Dr(t,e,i){var n=t.createShader(e);return t.shaderSource(n,i),t.compileShader(n),t.getShaderParameter(n,35713),t.getShaderInfoLog(n),n}Er.prototype.setValue=function(t,e,i){var n=this.map[e];void 0!==n&&n.setValue(t,i,this.renderer)},Er.prototype.setOptional=function(t,e,i){var n=e[i];void 0!==n&&this.setValue(t,i,n)},Er.upload=function(t,e,i,n){for(var r=0,o=e.length;r!==o;++r){var a=e[r],s=i[a.id];!1!==s.needsUpdate&&a.setValue(t,s.value,n)}},Er.seqWithValue=function(t,e){for(var i=[],n=0,r=t.length;n!==r;++n){var o=t[n];o.id in e&&i.push(o)}return i};var Lr=0;function Or(t){switch(t){case ke:return["Linear","( value )"];case Fe:return["sRGB","( value )"];case ze:return["RGBE","( value )"];case Ve:return["RGBM","( value, 7.0 )"];case je:return["RGBM","( value, 16.0 )"];case He:return["RGBD","( value, 256.0 )"];case Be:return["Gamma","( value, float( GAMMA_FACTOR ) )"];default:throw new Error("unsupported encoding: "+t)}}function Ir(t,e){var i=Or(e);return"vec4 "+t+"( vec4 value ) { return "+i[0]+"ToLinear"+i[1]+"; }"}function Rr(t,e){var i;switch(e){case dt:i="Linear";break;case pt:i="Reinhard";break;case ft:i="Uncharted2";break;case mt:i="OptimizedCineon";break;case gt:i="ACESFilmic";break;default:throw new Error("unsupported toneMapping: "+e)}return"vec3 "+t+"( vec3 color ) { return "+i+"ToneMapping( color ); }"}function Nr(t){return""!==t}function kr(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights)}function Fr(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}function Br(t){return t.replace(/^[ \t]*#include +<([\w\d./]+)>/gm,(function(t,e){var i=gi[e];if(void 0===i)throw new Error("Can not resolve #include <"+e+">");return Br(i)}))}function zr(t){return t.replace(/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,(function(t,e,i,n){for(var r="",o=parseInt(e);o<parseInt(i);o++)r+=n.replace(/\[ i \]/g,"[ "+o+" ]");return r}))}function Ur(t,e,i,n,r,o,a){var s=t.context,l=n.defines,u=r.vertexShader,h=r.fragmentShader,c="SHADOWMAP_TYPE_BASIC";o.shadowMapType===M?c="SHADOWMAP_TYPE_PCF":o.shadowMapType===T&&(c="SHADOWMAP_TYPE_PCF_SOFT");var d="ENVMAP_TYPE_CUBE",p="ENVMAP_MODE_REFLECTION",f="ENVMAP_BLENDING_MULTIPLY";if(o.envMap){switch(n.envMap.mapping){case yt:case bt:d="ENVMAP_TYPE_CUBE";break;case Tt:case St:d="ENVMAP_TYPE_CUBE_UV";break;case wt:case xt:d="ENVMAP_TYPE_EQUIREC";break;case Mt:d="ENVMAP_TYPE_SPHERE"}switch(n.envMap.mapping){case bt:case xt:p="ENVMAP_MODE_REFRACTION"}switch(n.combine){case lt:f="ENVMAP_BLENDING_MULTIPLY";break;case ut:f="ENVMAP_BLENDING_MIX";break;case ht:f="ENVMAP_BLENDING_ADD"}}var m,g,v,y,b,w=t.gammaFactor>0?t.gammaFactor:1,x=a.isWebGL2?"":function(t,e,i){return[(t=t||{}).derivatives||e.envMapCubeUV||e.bumpMap||e.normalMap&&!e.objectSpaceNormalMap||e.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(t.fragDepth||e.logarithmicDepthBuffer)&&i.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",t.drawBuffers&&i.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(t.shaderTextureLOD||e.envMap)&&i.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Nr).join("\n")}(n.extensions,o,e),S=function(t){var e=[];for(var i in t){var n=t[i];!1!==n&&e.push("#define "+i+" "+n)}return e.join("\n")}(l),_=s.createProgram();if(n.isRawShaderMaterial?((m=[S].filter(Nr).join("\n")).length>0&&(m+="\n"),(g=[x,S].filter(Nr).join("\n")).length>0&&(g+="\n")):(m=["precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+r.name,S,o.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+w,"#define MAX_BONES "+o.maxBones,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+p:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.normalMap&&o.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",o.displacementMap&&o.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexColors?"#define USE_COLOR":"",o.flatShading?"#define FLAT_SHADED":"",o.skinning?"#define USE_SKINNING":"",o.useVertexTexture?"#define BONE_TEXTURE":"",o.morphTargets?"#define USE_MORPHTARGETS":"",o.morphNormals&&!1===o.flatShading?"#define USE_MORPHNORMALS":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+c:"",o.sizeAttenuation?"#define USE_SIZEATTENUATION":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&(a.isWebGL2||e.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Nr).join("\n"),g=[x,"precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+r.name,S,o.alphaTest?"#define ALPHATEST "+o.alphaTest+(o.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+w,o.useFog&&o.fog?"#define USE_FOG":"",o.useFog&&o.fogExp?"#define FOG_EXP2":"",o.map?"#define USE_MAP":"",o.matcap?"#define USE_MATCAP":"",o.envMap?"#define USE_ENVMAP":"",o.envMap?"#define "+d:"",o.envMap?"#define "+p:"",o.envMap?"#define "+f:"",o.lightMap?"#define USE_LIGHTMAP":"",o.aoMap?"#define USE_AOMAP":"",o.emissiveMap?"#define USE_EMISSIVEMAP":"",o.bumpMap?"#define USE_BUMPMAP":"",o.normalMap?"#define USE_NORMALMAP":"",o.normalMap&&o.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",o.specularMap?"#define USE_SPECULARMAP":"",o.roughnessMap?"#define USE_ROUGHNESSMAP":"",o.metalnessMap?"#define USE_METALNESSMAP":"",o.alphaMap?"#define USE_ALPHAMAP":"",o.vertexColors?"#define USE_COLOR":"",o.gradientMap?"#define USE_GRADIENTMAP":"",o.flatShading?"#define FLAT_SHADED":"",o.doubleSided?"#define DOUBLE_SIDED":"",o.flipSided?"#define FLIP_SIDED":"",o.shadowMapEnabled?"#define USE_SHADOWMAP":"",o.shadowMapEnabled?"#define "+c:"",o.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",o.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&(a.isWebGL2||e.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",o.envMap&&(a.isWebGL2||e.get("EXT_shader_texture_lod"))?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",o.toneMapping!==ct?"#define TONE_MAPPING":"",o.toneMapping!==ct?gi.tonemapping_pars_fragment:"",o.toneMapping!==ct?Rr("toneMapping",o.toneMapping):"",o.dithering?"#define DITHERING":"",o.outputEncoding||o.mapEncoding||o.matcapEncoding||o.envMapEncoding||o.emissiveMapEncoding?gi.encodings_pars_fragment:"",o.mapEncoding?Ir("mapTexelToLinear",o.mapEncoding):"",o.matcapEncoding?Ir("matcapTexelToLinear",o.matcapEncoding):"",o.envMapEncoding?Ir("envMapTexelToLinear",o.envMapEncoding):"",o.emissiveMapEncoding?Ir("emissiveMapTexelToLinear",o.emissiveMapEncoding):"",o.outputEncoding?(v="linearToOutputTexel",y=o.outputEncoding,b=Or(y),"vec4 "+v+"( vec4 value ) { return LinearTo"+b[0]+b[1]+"; }"):"",o.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Nr).join("\n")),u=Fr(u=kr(u=Br(u),o),o),h=Fr(h=kr(h=Br(h),o),o),u=zr(u),h=zr(h),a.isWebGL2&&!n.isRawShaderMaterial){var A=!1,P=/^\s*#version\s+300\s+es\s*\n/;n.isShaderMaterial&&null!==u.match(P)&&null!==h.match(P)&&(A=!0,u=u.replace(P,""),h=h.replace(P,"")),m=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+m,g=["#version 300 es\n","#define varying in",A?"":"out highp vec4 pc_fragColor;",A?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join("\n")+"\n"+g}var C=g+h,E=Dr(s,35633,m+u),D=Dr(s,35632,C);s.attachShader(_,E),s.attachShader(_,D),void 0!==n.index0AttributeName?s.bindAttribLocation(_,0,n.index0AttributeName):!0===o.morphTargets&&s.bindAttribLocation(_,0,"position"),s.linkProgram(_);var L,O,I=s.getProgramInfoLog(_).trim(),R=s.getShaderInfoLog(E).trim(),N=s.getShaderInfoLog(D).trim(),k=!0,F=!0;return!1===s.getProgramParameter(_,35714)?k=!1:""!==I||""!==R&&""!==N||(F=!1),F&&(this.diagnostics={runnable:k,material:n,programLog:I,vertexShader:{log:R,prefix:m},fragmentShader:{log:N,prefix:g}}),s.deleteShader(E),s.deleteShader(D),this.getUniforms=function(){return void 0===L&&(L=new Er(s,_,t)),L},this.getAttributes=function(){return void 0===O&&(O=function(t,e){for(var i={},n=t.getProgramParameter(e,35721),r=0;r<n;r++){var o=t.getActiveAttrib(e,r).name;i[o]=t.getAttribLocation(e,o)}return i}(s,_)),O},this.destroy=function(){s.deleteProgram(_),this.program=void 0},Object.defineProperties(this,{uniforms:{get:function(){return this.getUniforms()}},attributes:{get:function(){return this.getAttributes()}}}),this.name=r.name,this.id=Lr++,this.code=i,this.usedTimes=1,this.program=_,this.vertexShader=E,this.fragmentShader=D,this}function Vr(t,e,i){var n=[],r={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"phong",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},o=["precision","supportsVertexTextures","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","lightMap","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","fog","useFog","fogExp","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering"];function a(t,e){var i;return t?t.isTexture?i=t.encoding:t.isWebGLRenderTarget&&(i=t.texture.encoding):i=ke,i===ke&&e&&(i=Be),i}this.getParameters=function(e,n,o,s,l,u,h){var c=r[e.type],d=h.isSkinnedMesh?function(t){var e=t.skeleton.bones;if(i.floatVertexTextures)return 1024;var n=i.maxVertexUniforms,r=Math.floor((n-20)/4),o=Math.min(r,e.length);return o<e.length?0:o}(h):0,p=i.precision;null!==e.precision&&(p=i.getMaxPrecision(e.precision),e.precision);var f=t.getRenderTarget();return{shaderID:c,precision:p,supportsVertexTextures:i.vertexTextures,outputEncoding:a(f?f.texture:null,t.gammaOutput),map:!!e.map,mapEncoding:a(e.map,t.gammaInput),matcap:!!e.matcap,matcapEncoding:a(e.matcap,t.gammaInput),envMap:!!e.envMap,envMapMode:e.envMap&&e.envMap.mapping,envMapEncoding:a(e.envMap,t.gammaInput),envMapCubeUV:!!e.envMap&&(e.envMap.mapping===Tt||e.envMap.mapping===St),lightMap:!!e.lightMap,aoMap:!!e.aoMap,emissiveMap:!!e.emissiveMap,emissiveMapEncoding:a(e.emissiveMap,t.gammaInput),bumpMap:!!e.bumpMap,normalMap:!!e.normalMap,objectSpaceNormalMap:e.normalMapType===Ye,displacementMap:!!e.displacementMap,roughnessMap:!!e.roughnessMap,metalnessMap:!!e.metalnessMap,specularMap:!!e.specularMap,alphaMap:!!e.alphaMap,gradientMap:!!e.gradientMap,combine:e.combine,vertexColors:e.vertexColors,fog:!!s,useFog:e.fog,fogExp:s&&s.isFogExp2,flatShading:e.flatShading,sizeAttenuation:e.sizeAttenuation,logarithmicDepthBuffer:i.logarithmicDepthBuffer,skinning:e.skinning&&d>0,maxBones:d,useVertexTexture:i.floatVertexTextures,morphTargets:e.morphTargets,morphNormals:e.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:n.directional.length,numPointLights:n.point.length,numSpotLights:n.spot.length,numRectAreaLights:n.rectArea.length,numHemiLights:n.hemi.length,numClippingPlanes:l,numClipIntersection:u,dithering:e.dithering,shadowMapEnabled:t.shadowMap.enabled&&h.receiveShadow&&o.length>0,shadowMapType:t.shadowMap.type,toneMapping:t.toneMapping,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:e.premultipliedAlpha,alphaTest:e.alphaTest,doubleSided:e.side===A,flipSided:e.side===_,depthPacking:void 0!==e.depthPacking&&e.depthPacking}},this.getProgramCode=function(e,i){var n=[];if(i.shaderID?n.push(i.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(var r in e.defines)n.push(r),n.push(e.defines[r]);for(var a=0;a<o.length;a++)n.push(i[o[a]]);return n.push(e.onBeforeCompile.toString()),n.push(t.gammaOutput),n.push(t.gammaFactor),n.join()},this.acquireProgram=function(r,o,a,s){for(var l,u=0,h=n.length;u<h;u++){var c=n[u];if(c.code===s){++(l=c).usedTimes;break}}return void 0===l&&(l=new Ur(t,e,s,r,o,a,i),n.push(l)),l},this.releaseProgram=function(t){if(0==--t.usedTimes){var e=n.indexOf(t);n[e]=n[n.length-1],n.pop(),t.destroy()}},this.programs=n}function jr(){var t=new WeakMap;return{get:function(e){var 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 Hr(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program&&e.program&&t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function Gr(t,e){return t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Wr(){var t=[],e=0,i=[],n=[];function r(i,n,r,o,a){var s=t[e];return void 0===s?(s={id:i.id,object:i,geometry:n,material:r,program:r.program,renderOrder:i.renderOrder,z:o,group:a},t[e]=s):(s.id=i.id,s.object=i,s.geometry=n,s.material=r,s.program=r.program,s.renderOrder=i.renderOrder,s.z=o,s.group=a),e++,s}return{opaque:i,transparent:n,init:function(){e=0,i.length=0,n.length=0},push:function(t,e,o,a,s){var l=r(t,e,o,a,s);(!0===o.transparent?n:i).push(l)},unshift:function(t,e,o,a,s){var l=r(t,e,o,a,s);(!0===o.transparent?n:i).unshift(l)},sort:function(){i.length>1&&i.sort(Hr),n.length>1&&n.sort(Gr)}}}function qr(){var t={};return{get:function(e,i){var n,r=t[e.id];return void 0===r?(n=new Wr,t[e.id]={},t[e.id][i.id]=n):void 0===(n=r[i.id])&&(n=new Wr,r[i.id]=n),n},dispose:function(){t={}}}}function Yr(){var t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];var i;switch(e.type){case"DirectionalLight":i={direction:new Je,color:new Si,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Ze};break;case"SpotLight":i={position:new Je,direction:new Je,color:new Si,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Ze};break;case"PointLight":i={position:new Je,color:new Si,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Ze,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":i={direction:new Je,skyColor:new Si,groundColor:new Si};break;case"RectAreaLight":i={color:new Si,position:new Je,halfWidth:new Je,halfHeight:new Je}}return t[e.id]=i,i}}}var Xr=0;function Zr(){var t=new Yr,e={id:Xr++,hash:{stateID:-1,directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,shadowsLength:-1},ambient:[0,0,0],directional:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]},i=new Je,n=new Ke,r=new Ke;return{setup:function(o,a,s){for(var l=0,u=0,h=0,c=0,d=0,p=0,f=0,m=0,g=s.matrixWorldInverse,v=0,y=o.length;v<y;v++){var b=o[v],w=b.color,x=b.intensity,M=b.distance,T=b.shadow&&b.shadow.map?b.shadow.map.texture:null;if(b.isAmbientLight)l+=w.r*x,u+=w.g*x,h+=w.b*x;else if(b.isDirectionalLight){if((_=t.get(b)).color.copy(b.color).multiplyScalar(b.intensity),_.direction.setFromMatrixPosition(b.matrixWorld),i.setFromMatrixPosition(b.target.matrixWorld),_.direction.sub(i),_.direction.transformDirection(g),_.shadow=b.castShadow,b.castShadow){var S=b.shadow;_.shadowBias=S.bias,_.shadowRadius=S.radius,_.shadowMapSize=S.mapSize}e.directionalShadowMap[c]=T,e.directionalShadowMatrix[c]=b.shadow.matrix,e.directional[c]=_,c++}else if(b.isSpotLight){if((_=t.get(b)).position.setFromMatrixPosition(b.matrixWorld),_.position.applyMatrix4(g),_.color.copy(w).multiplyScalar(x),_.distance=M,_.direction.setFromMatrixPosition(b.matrixWorld),i.setFromMatrixPosition(b.target.matrixWorld),_.direction.sub(i),_.direction.transformDirection(g),_.coneCos=Math.cos(b.angle),_.penumbraCos=Math.cos(b.angle*(1-b.penumbra)),_.decay=b.decay,_.shadow=b.castShadow,b.castShadow){S=b.shadow;_.shadowBias=S.bias,_.shadowRadius=S.radius,_.shadowMapSize=S.mapSize}e.spotShadowMap[p]=T,e.spotShadowMatrix[p]=b.shadow.matrix,e.spot[p]=_,p++}else if(b.isRectAreaLight){(_=t.get(b)).color.copy(w).multiplyScalar(x),_.position.setFromMatrixPosition(b.matrixWorld),_.position.applyMatrix4(g),r.identity(),n.copy(b.matrixWorld),n.premultiply(g),r.extractRotation(n),_.halfWidth.set(.5*b.width,0,0),_.halfHeight.set(0,.5*b.height,0),_.halfWidth.applyMatrix4(r),_.halfHeight.applyMatrix4(r),e.rectArea[f]=_,f++}else if(b.isPointLight){if((_=t.get(b)).position.setFromMatrixPosition(b.matrixWorld),_.position.applyMatrix4(g),_.color.copy(b.color).multiplyScalar(b.intensity),_.distance=b.distance,_.decay=b.decay,_.shadow=b.castShadow,b.castShadow){S=b.shadow;_.shadowBias=S.bias,_.shadowRadius=S.radius,_.shadowMapSize=S.mapSize,_.shadowCameraNear=S.camera.near,_.shadowCameraFar=S.camera.far}e.pointShadowMap[d]=T,e.pointShadowMatrix[d]=b.shadow.matrix,e.point[d]=_,d++}else if(b.isHemisphereLight){var _;(_=t.get(b)).direction.setFromMatrixPosition(b.matrixWorld),_.direction.transformDirection(g),_.direction.normalize(),_.skyColor.copy(b.color).multiplyScalar(x),_.groundColor.copy(b.groundColor).multiplyScalar(x),e.hemi[m]=_,m++}}e.ambient[0]=l,e.ambient[1]=u,e.ambient[2]=h,e.directional.length=c,e.spot.length=p,e.rectArea.length=f,e.point.length=d,e.hemi.length=m,e.hash.stateID=e.id,e.hash.directionalLength=c,e.hash.pointLength=d,e.hash.spotLength=p,e.hash.rectAreaLength=f,e.hash.hemiLength=m,e.hash.shadowsLength=a.length},state:e}}function Kr(){var t=new Zr,e=[],i=[];return{init:function(){e.length=0,i.length=0},state:{lightsArray:e,shadowsArray:i,lights:t},setupLights:function(n){t.setup(e,i,n)},pushLight:function(t){e.push(t)},pushShadow:function(t){i.push(t)}}}function Qr(){var t={};return{get:function(e,i){var n;return void 0===t[e.id]?(n=new Kr,t[e.id]={},t[e.id][i.id]=n):void 0===t[e.id][i.id]?(n=new Kr,t[e.id][i.id]=n):n=t[e.id][i.id],n},dispose:function(){t={}}}}function Jr(t){xn.call(this),this.type="MeshDepthMaterial",this.depthPacking=Ge,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.setValues(t)}function $r(t){xn.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Je,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.lights=!1,this.setValues(t)}function to(t,e,i){for(var n=new mi,r=new Ke,o=new Ze,a=new Ze(i,i),s=new Je,l=new Je,u=new Array(4),h=new Array(4),c={},d={0:_,1:S,2:A},p=[new Je(1,0,0),new Je(-1,0,0),new Je(0,0,1),new Je(0,0,-1),new Je(0,1,0),new Je(0,-1,0)],f=[new Je(0,1,0),new Je(0,1,0),new Je(0,1,0),new Je(0,1,0),new Je(0,0,1),new Je(0,0,-1)],m=[new li,new li,new li,new li,new li,new li],g=0;4!==g;++g){var v=0!=(1&g),y=0!=(2&g),b=new Jr({depthPacking:We,morphTargets:v,skinning:y});u[g]=b;var w=new $r({morphTargets:v,skinning:y});h[g]=w}var x=this;function T(e,i,n,r,o,a){var s=e.geometry,l=null,p=u,f=e.customDepthMaterial;if(n&&(p=h,f=e.customDistanceMaterial),f)l=f;else{var m=!1;i.morphTargets&&(s&&s.isBufferGeometry?m=s.morphAttributes&&s.morphAttributes.position&&s.morphAttributes.position.length>0:s&&s.isGeometry&&(m=s.morphTargets&&s.morphTargets.length>0)),e.isSkinnedMesh&&i.skinning;var g=0;m&&(g|=1),e.isSkinnedMesh&&i.skinning&&(g|=2),l=p[g]}if(t.localClippingEnabled&&!0===i.clipShadows&&0!==i.clippingPlanes.length){var v=l.uuid,y=i.uuid,b=c[v];void 0===b&&(b={},c[v]=b);var w=b[y];void 0===w&&(w=l.clone(),b[y]=w),l=w}return l.visible=i.visible,l.wireframe=i.wireframe,l.side=null!=i.shadowSide?i.shadowSide:d[i.side],l.clipShadows=i.clipShadows,l.clippingPlanes=i.clippingPlanes,l.clipIntersection=i.clipIntersection,l.wireframeLinewidth=i.wireframeLinewidth,l.linewidth=i.linewidth,n&&l.isMeshDistanceMaterial&&(l.referencePosition.copy(r),l.nearDistance=o,l.farDistance=a),l}function P(i,r,o,a){if(!1!==i.visible){if(i.layers.test(r.layers)&&(i.isMesh||i.isLine||i.isPoints)&&i.castShadow&&(!i.frustumCulled||n.intersectsObject(i))){i.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,i.matrixWorld);var s=e.update(i),u=i.material;if(Array.isArray(u))for(var h=s.groups,c=0,d=h.length;c<d;c++){var p=h[c],f=u[p.materialIndex];if(f&&f.visible){var m=T(i,f,a,l,o.near,o.far);t.renderBufferDirect(o,null,s,m,i,p)}}else if(u.visible){m=T(i,u,a,l,o.near,o.far);t.renderBufferDirect(o,null,s,m,i,null)}}for(var g=i.children,v=0,y=g.length;v<y;v++)P(g[v],r,o,a)}}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=M,this.render=function(e,i,u){if(!1!==x.enabled&&(!1!==x.autoUpdate||!1!==x.needsUpdate)&&0!==e.length){t.context;var h,c=t.state;c.disable(3042),c.buffers.color.setClear(1,1,1,1),c.buffers.depth.setTest(!0),c.setScissorTest(!1);for(var d=0,g=e.length;d<g;d++){var v=e[d],y=v.shadow,b=v&&v.isPointLight;if(void 0!==y){var w=y.camera;if(o.copy(y.mapSize),o.min(a),b){var M=o.x,T=o.y;m[0].set(2*M,T,M,T),m[1].set(0,T,M,T),m[2].set(3*M,T,M,T),m[3].set(M,T,M,T),m[4].set(3*M,0,M,T),m[5].set(M,0,M,T),o.x*=4,o.y*=2}if(null===y.map){var S={minFilter:Ct,magFilter:Ct,format:Xt};y.map=new ui(o.x,o.y,S),y.map.texture.name=v.name+".shadowMap",w.updateProjectionMatrix()}y.isSpotLightShadow&&y.update(v);var _=y.map,A=y.matrix;l.setFromMatrixPosition(v.matrixWorld),w.position.copy(l),b?(h=6,A.makeTranslation(-l.x,-l.y,-l.z)):(h=1,s.setFromMatrixPosition(v.target.matrixWorld),w.lookAt(s),w.updateMatrixWorld(),A.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),A.multiply(w.projectionMatrix),A.multiply(w.matrixWorldInverse)),t.setRenderTarget(_),t.clear();for(var C=0;C<h;C++){if(b){s.copy(w.position),s.add(p[C]),w.up.copy(f[C]),w.lookAt(s),w.updateMatrixWorld();var E=m[C];c.viewport(E)}r.multiplyMatrices(w.projectionMatrix,w.matrixWorldInverse),n.setFromMatrix(r),P(i,u,w,b)}}}x.needsUpdate=!1}}}function eo(t,e,i,n){var r=new function(){var e=!1,i=new li,n=null,r=new li(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,o,a,s){!0===s&&(e*=a,n*=a,o*=a),i.set(e,n,o,a),!1===r.equals(i)&&(t.clearColor(e,n,o,a),r.copy(i))},reset:function(){e=!1,n=null,r.set(-1,0,0,0)}}},o=new function(){var e=!1,i=null,n=null,r=null;return{setTest:function(t){t?Q(2929):J(2929)},setMask:function(n){i===n||e||(t.depthMask(n),i=n)},setFunc:function(e){if(n!==e){if(e)switch(e){case tt:t.depthFunc(512);break;case et:t.depthFunc(519);break;case it:t.depthFunc(513);break;case nt:t.depthFunc(515);break;case rt:t.depthFunc(514);break;case ot:t.depthFunc(518);break;case at:t.depthFunc(516);break;case st: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}}},a=new function(){var e=!1,i=null,n=null,r=null,o=null,a=null,s=null,l=null,u=null;return{setTest:function(t){t?Q(2960):J(2960)},setMask:function(n){i===n||e||(t.stencilMask(n),i=n)},setFunc:function(e,i,a){n===e&&r===i&&o===a||(t.stencilFunc(e,i,a),n=e,r=i,o=a)},setOp:function(e,i,n){a===e&&s===i&&l===n||(t.stencilOp(e,i,n),a=e,s=i,l=n)},setLocked:function(t){e=t},setClear:function(e){u!==e&&(t.clearStencil(e),u=e)},reset:function(){e=!1,i=null,n=null,r=null,o=null,a=null,s=null,l=null,u=null}}},s=t.getParameter(34921),l=new Uint8Array(s),u=new Uint8Array(s),h=new Uint8Array(s),c={},d=null,p=null,f=null,y=null,b=null,w=null,x=null,M=null,T=null,S=null,P=!1,C=null,E=null,D=null,L=null,z=null,U=t.getParameter(35661),V=!1,j=0,H=t.getParameter(7938);-1!==H.indexOf("WebGL")?(j=parseFloat(/^WebGL\ ([0-9])/.exec(H)[1]),V=j>=1):-1!==H.indexOf("OpenGL ES")&&(j=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(H)[1]),V=j>=2);var G=null,W={},q=new li,Y=new li;function X(e,i,n){var r=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(var a=0;a<n;a++)t.texImage2D(i+a,0,6408,1,1,0,6408,5121,r);return o}var Z={};function K(i,r){(l[i]=1,0===u[i]&&(t.enableVertexAttribArray(i),u[i]=1),h[i]!==r)&&((n.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[n.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](i,r),h[i]=r)}function Q(e){!0!==c[e]&&(t.enable(e),c[e]=!0)}function J(e){!1!==c[e]&&(t.disable(e),c[e]=!1)}function $(e,n,r,o,a,s,l,u){if(e!==O){if(f||(Q(3042),f=!0),e===F)a=a||n,s=s||r,l=l||o,n===b&&a===M||(t.blendEquationSeparate(i.convert(n),i.convert(a)),b=n,M=a),r===w&&o===x&&s===T&&l===S||(t.blendFuncSeparate(i.convert(r),i.convert(o),i.convert(s),i.convert(l)),w=r,x=o,T=s,S=l),y=e,P=null;else if(e!==y||u!==P){if(b===B&&M===B||(t.blendEquation(32774),b=B,M=B),u)switch(e){case I:t.blendFuncSeparate(1,771,1,771);break;case R:t.blendFunc(1,1);break;case N:t.blendFuncSeparate(0,0,769,771);break;case k:t.blendFuncSeparate(0,768,0,770)}else switch(e){case I:t.blendFuncSeparate(770,771,1,771);break;case R:t.blendFunc(770,1);break;case N:t.blendFunc(0,769);break;case k:t.blendFunc(0,768)}w=null,x=null,T=null,S=null,y=e,P=u}}else f&&(J(3042),f=!1)}function lt(e){C!==e&&(e?t.frontFace(2304):t.frontFace(2305),C=e)}function ut(e){e!==m?(Q(2884),e!==E&&(e===g?t.cullFace(1029):e===v?t.cullFace(1028):t.cullFace(1032))):J(2884),E=e}function ht(e,i,n){e?(Q(32823),L===i&&z===n||(t.polygonOffset(i,n),L=i,z=n)):J(32823)}function ct(e){void 0===e&&(e=33984+U-1),G!==e&&(t.activeTexture(e),G=e)}return Z[3553]=X(3553,3553,1),Z[34067]=X(34067,34069,6),r.setClear(0,0,0,1),o.setClear(1),a.setClear(0),Q(2929),o.setFunc(nt),lt(!1),ut(g),Q(2884),$(O),{buffers:{color:r,depth:o,stencil:a},initAttributes:function(){for(var t=0,e=l.length;t<e;t++)l[t]=0},enableAttribute:function(t){K(t,0)},enableAttributeAndDivisor:K,disableUnusedAttributes:function(){for(var e=0,i=u.length;e!==i;++e)u[e]!==l[e]&&(t.disableVertexAttribArray(e),u[e]=0)},enable:Q,disable:J,getCompressedTextureFormats:function(){if(null===d&&(d=[],e.get("WEBGL_compressed_texture_pvrtc")||e.get("WEBGL_compressed_texture_s3tc")||e.get("WEBGL_compressed_texture_etc1")||e.get("WEBGL_compressed_texture_astc")))for(var i=t.getParameter(34467),n=0;n<i.length;n++)d.push(i[n]);return d},useProgram:function(e){return p!==e&&(t.useProgram(e),p=e,!0)},setBlending:$,setMaterial:function(t,e){t.side===A?J(2884):Q(2884);var i=t.side===_;e&&(i=!i),lt(i),t.blending===I&&!1===t.transparent?$(O):$(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),o.setFunc(t.depthFunc),o.setTest(t.depthTest),o.setMask(t.depthWrite),r.setMask(t.colorWrite),ht(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:lt,setCullFace:ut,setLineWidth:function(e){e!==D&&(V&&t.lineWidth(e),D=e)},setPolygonOffset:ht,setScissorTest:function(t){t?Q(3089):J(3089)},activeTexture:ct,bindTexture:function(e,i){null===G&&ct();var n=W[G];void 0===n&&(n={type:void 0,texture:void 0},W[G]=n),n.type===e&&n.texture===i||(t.bindTexture(e,i||Z[e]),n.type=e,n.texture=i)},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){}},scissor:function(e){!1===q.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),q.copy(e))},viewport:function(e){!1===Y.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),Y.copy(e))},reset:function(){for(var e=0;e<u.length;e++)1===u[e]&&(t.disableVertexAttribArray(e),u[e]=0);c={},d=null,G=null,W={},p=null,y=null,C=null,E=null,r.reset(),o.reset(),a.reset()}}}function io(t,e,i,n,r,o,a){var s,l={};function u(t,e){if(t.width>e||t.height>e){if("data"in t)return;var i=e/Math.max(t.width,t.height),n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return n.width=Math.floor(t.width*i),n.height=Math.floor(t.height*i),n.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,n.width,n.height),n}return t}function h(t){return Xe.isPowerOfTwo(t.width)&&Xe.isPowerOfTwo(t.height)}function c(t,e){return t.generateMipmaps&&e&&t.minFilter!==Ct&&t.minFilter!==Lt}function d(e,i,r,o){t.generateMipmap(e),n.get(i).__maxMipLevel=Math.log(Math.max(r,o))*Math.LOG2E}function p(t,e){if(!r.isWebGL2)return t;if(6403===t){if(5126===e)return 33326;if(5131===e)return 33325;if(5121===e)return 33321}if(6407===t){if(5126===e)return 34837;if(5131===e)return 34843;if(5121===e)return 32849}if(6408===t){if(5126===e)return 34836;if(5131===e)return 34842;if(5121===e)return 32856}return t}function f(t){return t===Ct||t===Et||t===Dt?9728:9729}function m(e){var i=e.target;i.removeEventListener("dispose",m),function(e){var i=n.get(e);if(e.image&&i.__image__webglTextureCube)t.deleteTexture(i.__image__webglTextureCube);else{if(void 0===i.__webglInit)return;t.deleteTexture(i.__webglTexture)}n.remove(e)}(i),i.isVideoTexture&&delete l[i.id],a.memory.textures--}function g(e){var i=e.target;i.removeEventListener("dispose",g),function(e){var i=n.get(e),r=n.get(e.texture);if(!e)return;void 0!==r.__webglTexture&&t.deleteTexture(r.__webglTexture);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLRenderTargetCube)for(var o=0;o<6;o++)t.deleteFramebuffer(i.__webglFramebuffer[o]),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer[o]);else t.deleteFramebuffer(i.__webglFramebuffer),i.__webglDepthbuffer&&t.deleteRenderbuffer(i.__webglDepthbuffer);n.remove(e.texture),n.remove(e)}(i),a.memory.textures--}function v(t,e){var r=n.get(t);if(t.isVideoTexture&&function(t){var e=t.id,i=a.render.frame;l[e]!==i&&(l[e]=i,t.update())}(t),t.version>0&&r.__version!==t.version){var o=t.image;if(void 0===o);else if(!1!==o.complete)return void b(r,t,e)}i.activeTexture(33984+e),i.bindTexture(3553,r.__webglTexture)}function y(i,a,s){var l;if(s?(t.texParameteri(i,10242,o.convert(a.wrapS)),t.texParameteri(i,10243,o.convert(a.wrapT)),t.texParameteri(i,10240,o.convert(a.magFilter)),t.texParameteri(i,10241,o.convert(a.minFilter))):(t.texParameteri(i,10242,33071),t.texParameteri(i,10243,33071),a.wrapS!==At||a.wrapT,t.texParameteri(i,10240,f(a.magFilter)),t.texParameteri(i,10241,f(a.minFilter)),a.minFilter!==Ct&&a.minFilter),l=e.get("EXT_texture_filter_anisotropic")){if(a.type===Ut&&null===e.get("OES_texture_float_linear"))return;if(a.type===Vt&&null===(r.isWebGL2||e.get("OES_texture_half_float_linear")))return;(a.anisotropy>1||n.get(a).__currentAnisotropy)&&(t.texParameterf(i,l.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,r.getMaxAnisotropy())),n.get(a).__currentAnisotropy=a.anisotropy)}}function b(e,n,l){var f;f=n.isDataTexture3D?32879:3553,void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",m),e.__webglTexture=t.createTexture(),a.memory.textures++),i.activeTexture(33984+l),i.bindTexture(f,e.__webglTexture),t.pixelStorei(37440,n.flipY),t.pixelStorei(37441,n.premultiplyAlpha),t.pixelStorei(3317,n.unpackAlignment);var g=u(n.image,r.maxTextureSize);(function(t){return!r.isWebGL2&&(t.wrapS!==At||t.wrapT!==At||t.minFilter!==Ct&&t.minFilter!==Lt)})(n)&&!1===h(g)&&(g=function(t){return t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof ImageBitmap?(void 0===s&&(s=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),s.width=Xe.floorPowerOfTwo(t.width),s.height=Xe.floorPowerOfTwo(t.height),s.getContext("2d").drawImage(t,0,0,s.width,s.height),s):t}(g));var v=h(g),b=o.convert(n.format),w=o.convert(n.type),x=p(b,w);y(f,n,v);var M,T=n.mipmaps;if(n.isDepthTexture){if(x=6402,n.type===Ut){if(!r.isWebGL2)throw new Error("Float Depth Texture only supported in WebGL2.0");x=36012}else r.isWebGL2&&(x=33189);n.format===Jt&&6402===x&&n.type!==Ft&&n.type!==zt&&(n.type=Ft,w=o.convert(n.type)),n.format===$t&&(x=34041,n.type!==Wt&&(n.type=Wt,w=o.convert(n.type))),i.texImage2D(3553,0,x,g.width,g.height,0,b,w,null)}else if(n.isDataTexture)if(T.length>0&&v){for(var S=0,_=T.length;S<_;S++)M=T[S],i.texImage2D(3553,S,x,M.width,M.height,0,b,w,M.data);n.generateMipmaps=!1,e.__maxMipLevel=T.length-1}else i.texImage2D(3553,0,x,g.width,g.height,0,b,w,g.data),e.__maxMipLevel=0;else if(n.isCompressedTexture){for(S=0,_=T.length;S<_;S++)M=T[S],n.format!==Xt&&n.format!==Yt?i.getCompressedTextureFormats().indexOf(b)>-1&&i.compressedTexImage2D(3553,S,x,M.width,M.height,0,M.data):i.texImage2D(3553,S,x,M.width,M.height,0,b,w,M.data);e.__maxMipLevel=T.length-1}else if(n.isDataTexture3D)i.texImage3D(32879,0,x,g.width,g.height,g.depth,0,b,w,g.data),e.__maxMipLevel=0;else if(T.length>0&&v){for(S=0,_=T.length;S<_;S++)M=T[S],i.texImage2D(3553,S,x,b,w,M);n.generateMipmaps=!1,e.__maxMipLevel=T.length-1}else i.texImage2D(3553,0,x,b,w,g),e.__maxMipLevel=0;c(n,v)&&d(3553,n,g.width,g.height),e.__version=n.version,n.onUpdate&&n.onUpdate(n)}function w(e,r,a,s){var l=o.convert(r.texture.format),u=o.convert(r.texture.type),h=p(l,u);i.texImage2D(s,0,h,r.width,r.height,0,l,u,null),t.bindFramebuffer(36160,e),t.framebufferTexture2D(36160,a,s,n.get(r.texture).__webglTexture,0),t.bindFramebuffer(36160,null)}function x(e,i){t.bindRenderbuffer(36161,e),i.depthBuffer&&!i.stencilBuffer?(t.renderbufferStorage(36161,33189,i.width,i.height),t.framebufferRenderbuffer(36160,36096,36161,e)):i.depthBuffer&&i.stencilBuffer?(t.renderbufferStorage(36161,34041,i.width,i.height),t.framebufferRenderbuffer(36160,33306,36161,e)):t.renderbufferStorage(36161,32854,i.width,i.height),t.bindRenderbuffer(36161,null)}function M(e){var i=n.get(e),r=!0===e.isWebGLRenderTargetCube;if(e.depthTexture){if(r)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,i){if(i&&i.isWebGLRenderTargetCube)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,e),!i.depthTexture||!i.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");n.get(i.depthTexture).__webglTexture&&i.depthTexture.image.width===i.width&&i.depthTexture.image.height===i.height||(i.depthTexture.image.width=i.width,i.depthTexture.image.height=i.height,i.depthTexture.needsUpdate=!0),v(i.depthTexture,0);var r=n.get(i.depthTexture).__webglTexture;if(i.depthTexture.format===Jt)t.framebufferTexture2D(36160,36096,3553,r,0);else{if(i.depthTexture.format!==$t)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(36160,33306,3553,r,0)}}(i.__webglFramebuffer,e)}else if(r){i.__webglDepthbuffer=[];for(var o=0;o<6;o++)t.bindFramebuffer(36160,i.__webglFramebuffer[o]),i.__webglDepthbuffer[o]=t.createRenderbuffer(),x(i.__webglDepthbuffer[o],e)}else t.bindFramebuffer(36160,i.__webglFramebuffer),i.__webglDepthbuffer=t.createRenderbuffer(),x(i.__webglDepthbuffer,e);t.bindFramebuffer(36160,null)}this.setTexture2D=v,this.setTexture3D=function(t,e){var r=n.get(t);t.version>0&&r.__version!==t.version?b(r,t,e):(i.activeTexture(33984+e),i.bindTexture(32879,r.__webglTexture))},this.setTextureCube=function(e,s){var l=n.get(e);if(6===e.image.length)if(e.version>0&&l.__version!==e.version){l.__image__webglTextureCube||(e.addEventListener("dispose",m),l.__image__webglTextureCube=t.createTexture(),a.memory.textures++),i.activeTexture(33984+s),i.bindTexture(34067,l.__image__webglTextureCube),t.pixelStorei(37440,e.flipY);for(var f=e&&e.isCompressedTexture,g=e.image[0]&&e.image[0].isDataTexture,v=[],b=0;b<6;b++)v[b]=f||g?g?e.image[b].image:e.image[b]:u(e.image[b],r.maxCubemapSize);var w=v[0],x=h(w),M=o.convert(e.format),T=o.convert(e.type),S=p(M,T);y(34067,e,x);for(b=0;b<6;b++)if(f)for(var _,A=v[b].mipmaps,P=0,C=A.length;P<C;P++)_=A[P],e.format!==Xt&&e.format!==Yt?i.getCompressedTextureFormats().indexOf(M)>-1&&i.compressedTexImage2D(34069+b,P,S,_.width,_.height,0,_.data):i.texImage2D(34069+b,P,S,_.width,_.height,0,M,T,_.data);else g?i.texImage2D(34069+b,0,S,v[b].width,v[b].height,0,M,T,v[b].data):i.texImage2D(34069+b,0,S,M,T,v[b]);l.__maxMipLevel=f?A.length-1:0,c(e,x)&&d(34067,e,w.width,w.height),l.__version=e.version,e.onUpdate&&e.onUpdate(e)}else i.activeTexture(33984+s),i.bindTexture(34067,l.__image__webglTextureCube)},this.setTextureCubeDynamic=function(t,e){i.activeTexture(33984+e),i.bindTexture(34067,n.get(t).__webglTexture)},this.setupRenderTarget=function(e){var r=n.get(e),o=n.get(e.texture);e.addEventListener("dispose",g),o.__webglTexture=t.createTexture(),a.memory.textures++;var s=!0===e.isWebGLRenderTargetCube,l=h(e);if(s){r.__webglFramebuffer=[];for(var u=0;u<6;u++)r.__webglFramebuffer[u]=t.createFramebuffer()}else r.__webglFramebuffer=t.createFramebuffer();if(s){i.bindTexture(34067,o.__webglTexture),y(34067,e.texture,l);for(u=0;u<6;u++)w(r.__webglFramebuffer[u],e,36064,34069+u);c(e.texture,l)&&d(34067,e.texture,e.width,e.height),i.bindTexture(34067,null)}else i.bindTexture(3553,o.__webglTexture),y(3553,e.texture,l),w(r.__webglFramebuffer,e,36064,3553),c(e.texture,l)&&d(3553,e.texture,e.width,e.height),i.bindTexture(3553,null);e.depthBuffer&&M(e)},this.updateRenderTargetMipmap=function(t){var e=t.texture;if(c(e,h(t))){var r=t.isWebGLRenderTargetCube?34067:3553,o=n.get(e).__webglTexture;i.bindTexture(r,o),d(r,e,t.width,t.height),i.bindTexture(r,null)}}}function no(t,e,i){return{convert:function(t){var n;if(t===_t)return 10497;if(t===At)return 33071;if(t===Pt)return 33648;if(t===Ct)return 9728;if(t===Et)return 9984;if(t===Dt)return 9986;if(t===Lt)return 9729;if(t===Ot)return 9985;if(t===It)return 9987;if(t===Rt)return 5121;if(t===jt)return 32819;if(t===Ht)return 32820;if(t===Gt)return 33635;if(t===Nt)return 5120;if(t===kt)return 5122;if(t===Ft)return 5123;if(t===Bt)return 5124;if(t===zt)return 5125;if(t===Ut)return 5126;if(t===Vt){if(i.isWebGL2)return 5131;if(null!==(n=e.get("OES_texture_half_float")))return n.HALF_FLOAT_OES}if(t===qt)return 6406;if(t===Yt)return 6407;if(t===Xt)return 6408;if(t===Zt)return 6409;if(t===Kt)return 6410;if(t===Jt)return 6402;if(t===$t)return 34041;if(t===te)return 6403;if(t===B)return 32774;if(t===z)return 32778;if(t===U)return 32779;if(t===H)return 0;if(t===G)return 1;if(t===W)return 768;if(t===q)return 769;if(t===Y)return 770;if(t===X)return 771;if(t===Z)return 772;if(t===K)return 773;if(t===Q)return 774;if(t===J)return 775;if(t===$)return 776;if((t===ee||t===ie||t===ne||t===re)&&null!==(n=e.get("WEBGL_compressed_texture_s3tc"))){if(t===ee)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===ie)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===ne)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===re)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((t===oe||t===ae||t===se||t===le)&&null!==(n=e.get("WEBGL_compressed_texture_pvrtc"))){if(t===oe)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===ae)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===se)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===le)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===ue&&null!==(n=e.get("WEBGL_compressed_texture_etc1")))return n.COMPRESSED_RGB_ETC1_WEBGL;if((t===he||t===ce||t===de||t===pe||t===fe||t===me||t===ge||t===ve||t===ye||t===be||t===we||t===xe||t===Me||t===Te)&&null!==(n=e.get("WEBGL_compressed_texture_astc")))return t;if(t===V||t===j){if(i.isWebGL2){if(t===V)return 32775;if(t===j)return 32776}if(null!==(n=e.get("EXT_blend_minmax"))){if(t===V)return n.MIN_EXT;if(t===j)return n.MAX_EXT}}if(t===Wt){if(i.isWebGL2)return 34042;if(null!==(n=e.get("WEBGL_depth_texture")))return n.UNSIGNED_INT_24_8_WEBGL}return 0}}}function ro(){Bi.call(this),this.type="Group"}function oo(){Bi.call(this),this.type="Camera",this.matrixWorldInverse=new Ke,this.projectionMatrix=new Ke,this.projectionMatrixInverse=new Ke}function ao(t,e,i,n){oo.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==i?i:.1,this.far=void 0!==n?n:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function so(t){ao.call(this),this.cameras=t||[]}Jr.prototype=Object.create(xn.prototype),Jr.prototype.constructor=Jr,Jr.prototype.isMeshDepthMaterial=!0,Jr.prototype.copy=function(t){return xn.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},$r.prototype=Object.create(xn.prototype),$r.prototype.constructor=$r,$r.prototype.isMeshDistanceMaterial=!0,$r.prototype.copy=function(t){return xn.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this},ro.prototype=Object.assign(Object.create(Bi.prototype),{constructor:ro,isGroup:!0}),oo.prototype=Object.assign(Object.create(Bi.prototype),{constructor:oo,isCamera:!0,copy:function(t,e){return Bi.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(t=new Je),this.updateMatrixWorld(!0);var e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){Bi.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),ao.prototype=Object.assign(Object.create(oo.prototype),{constructor:ao,isPerspectiveCamera:!0,copy:function(t,e){return oo.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){var e=.5*this.getFilmHeight()/t;this.fov=2*Xe.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){var t=Math.tan(.5*Xe.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*Xe.RAD2DEG*Math.atan(Math.tan(.5*Xe.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,i,n,r,o){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=this.near,e=t*Math.tan(.5*Xe.DEG2RAD*this.fov)/this.zoom,i=2*e,n=this.aspect*i,r=-.5*n,o=this.view;if(null!==this.view&&this.view.enabled){var a=o.fullWidth,s=o.fullHeight;r+=o.offsetX*n/a,e-=o.offsetY*i/s,n*=o.width/a,i*=o.height/s}var l=this.filmOffset;0!==l&&(r+=t*l/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+n,e,e-i,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=Bi.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}}),so.prototype=Object.assign(Object.create(ao.prototype),{constructor:so,isArrayCamera:!0});var lo,uo,ho,co,po,fo,mo=new Je,go=new Je;function vo(t,e,i){mo.setFromMatrixPosition(e.matrixWorld),go.setFromMatrixPosition(i.matrixWorld);var n=mo.distanceTo(go),r=e.projectionMatrix.elements,o=i.projectionMatrix.elements,a=r[14]/(r[10]-1),s=r[14]/(r[10]+1),l=(r[9]+1)/r[5],u=(r[9]-1)/r[5],h=(r[8]-1)/r[0],c=(o[8]+1)/o[0],d=a*h,p=a*c,f=n/(-h+c),m=f*-h;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);var g=a+f,v=s+f,y=d-m,b=p+(n-m),w=l*s/v*g,x=u*s/v*g;t.projectionMatrix.makePerspective(y,b,w,x,g,v)}function yo(t){var e=this,i=null,n=null,r=null,o=[],a=new Ke,s=new Ke,l=1,u="stage";"undefined"!=typeof window&&"VRFrameData"in window&&(n=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",b,!1));var h=new Ke,c=new Qe,d=new Je,p=new ao;p.bounds=new li(0,0,.5,1),p.layers.enable(1);var f=new ao;f.bounds=new li(.5,0,.5,1),f.layers.enable(2);var m,g,v=new so([p,f]);function y(){return null!==i&&!0===i.isPresenting}function b(){if(y()){var n=i.getEyeParameters("left"),r=n.renderWidth*l,o=n.renderHeight*l;g=t.getPixelRatio(),m=t.getSize(),t.setDrawingBufferSize(2*r,o,1),M.start()}else e.enabled&&t.setDrawingBufferSize(m.width,m.height,g),M.stop()}v.layers.enable(1),v.layers.enable(2);var w=[];function x(t){for(var e=navigator.getGamepads&&navigator.getGamepads(),i=0,n=0,r=e.length;i<r;i++){var o=e[i];if(o&&("Daydream Controller"===o.id||"Gear VR Controller"===o.id||"Oculus Go Controller"===o.id||"OpenVR Gamepad"===o.id||o.id.startsWith("Oculus Touch")||o.id.startsWith("Spatial Controller"))){if(n===t)return o;n++}}}this.enabled=!1,this.getController=function(t){var e=o[t];return void 0===e&&((e=new ro).matrixAutoUpdate=!1,e.visible=!1,o[t]=e),e},this.getDevice=function(){return i},this.setDevice=function(t){void 0!==t&&(i=t),M.setContext(t)},this.setFramebufferScaleFactor=function(t){l=t},this.setFrameOfReferenceType=function(t){u=t},this.setPoseTarget=function(t){void 0!==t&&(r=t)},this.getCamera=function(t){var e="stage"===u?1.6:0;if(null===i)return t.position.set(0,e,0),t;if(i.depthNear=t.near,i.depthFar=t.far,i.getFrameData(n),"stage"===u){var l=i.stageParameters;l?a.fromArray(l.sittingToStandingTransform):a.makeTranslation(0,e,0)}var m=n.pose,g=null!==r?r:t;if(g.matrix.copy(a),g.matrix.decompose(g.position,g.quaternion,g.scale),null!==m.orientation&&(c.fromArray(m.orientation),g.quaternion.multiply(c)),null!==m.position&&(c.setFromRotationMatrix(a),d.fromArray(m.position),d.applyQuaternion(c),g.position.add(d)),g.updateMatrixWorld(),!1===i.isPresenting)return t;p.near=t.near,f.near=t.near,p.far=t.far,f.far=t.far,p.matrixWorldInverse.fromArray(n.leftViewMatrix),f.matrixWorldInverse.fromArray(n.rightViewMatrix),s.getInverse(a),"stage"===u&&(p.matrixWorldInverse.multiply(s),f.matrixWorldInverse.multiply(s));var y=g.parent;null!==y&&(h.getInverse(y.matrixWorld),p.matrixWorldInverse.multiply(h),f.matrixWorldInverse.multiply(h)),p.matrixWorld.getInverse(p.matrixWorldInverse),f.matrixWorld.getInverse(f.matrixWorldInverse),p.projectionMatrix.fromArray(n.leftProjectionMatrix),f.projectionMatrix.fromArray(n.rightProjectionMatrix),vo(v,p,f);var b=i.getLayers();if(b.length){var M=b[0];null!==M.leftBounds&&4===M.leftBounds.length&&p.bounds.fromArray(M.leftBounds),null!==M.rightBounds&&4===M.rightBounds.length&&f.bounds.fromArray(M.rightBounds)}return function(){for(var t=0;t<o.length;t++){var e=o[t],i=x(t);if(void 0!==i&&void 0!==i.pose){if(null===i.pose)return;var n=i.pose;!1===n.hasPosition&&e.position.set(.2,-.6,-.05),null!==n.position&&e.position.fromArray(n.position),null!==n.orientation&&e.quaternion.fromArray(n.orientation),e.matrix.compose(e.position,e.quaternion,e.scale),e.matrix.premultiply(a),e.matrix.decompose(e.position,e.quaternion,e.scale),e.matrixWorldNeedsUpdate=!0,e.visible=!0;var r="Daydream Controller"===i.id?0:1;w[t]!==i.buttons[r].pressed&&(w[t]=i.buttons[r].pressed,!0===w[t]?e.dispatchEvent({type:"selectstart"}):(e.dispatchEvent({type:"selectend"}),e.dispatchEvent({type:"select"})))}else e.visible=!1}}(),v},this.getStandingMatrix=function(){return a},this.isPresenting=y;var M=new Ci;this.setAnimationLoop=function(t){M.setAnimationLoop(t)},this.submitFrame=function(){y()&&i.submitFrame()},this.dispose=function(){"undefined"!=typeof window&&window.removeEventListener("vrdisplaypresentchange",b)}}function bo(t){var e=t.context,i=null,n=null,r=1,o=null,a="stage",s=null,l=[],u=[];function h(){return null!==n&&null!==o}var c=new ao;c.layers.enable(1),c.viewport=new li;var d=new ao;d.layers.enable(2),d.viewport=new li;var p=new so([c,d]);function f(t){var e=l[u.indexOf(t.inputSource)];e&&e.dispatchEvent({type:t.type})}function m(){t.setFramebuffer(null),y.stop()}function g(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}p.layers.enable(1),p.layers.enable(2),this.enabled=!1,this.getController=function(t){var e=l[t];return void 0===e&&((e=new ro).matrixAutoUpdate=!1,e.visible=!1,l[t]=e),e},this.getDevice=function(){return i},this.setDevice=function(t){void 0!==t&&(i=t),t instanceof XRDevice&&e.setCompatibleXRDevice(t)},this.setFramebufferScaleFactor=function(t){r=t},this.setFrameOfReferenceType=function(t){a=t},this.setSession=function(i){null!==(n=i)&&(n.addEventListener("select",f),n.addEventListener("selectstart",f),n.addEventListener("selectend",f),n.addEventListener("end",m),n.baseLayer=new XRWebGLLayer(n,e,{framebufferScaleFactor:r}),n.requestFrameOfReference(a).then((function(e){o=e,t.setFramebuffer(n.baseLayer.framebuffer),y.setContext(n),y.start()})),u=n.getInputSources(),n.addEventListener("inputsourceschange",(function(){u=n.getInputSources();for(var t=0;t<l.length;t++){l[t].userData.inputSource=u[t]}})))},this.getCamera=function(t){if(h()){var e=t.parent,i=p.cameras;g(p,e);for(var n=0;n<i.length;n++)g(i[n],e);t.matrixWorld.copy(p.matrixWorld);for(var r=t.children,o=(n=0,r.length);n<o;n++)r[n].updateMatrixWorld(!0);return vo(p,c,d),p}return t},this.isPresenting=h;var v=null;var y=new Ci;y.setAnimationLoop((function(t,e){if(null!==(s=e.getDevicePose(o)))for(var i=n.baseLayer,r=e.views,a=0;a<r.length;a++){var h=r[a],c=i.getViewport(h),d=s.getViewMatrix(h),f=p.cameras[a];f.matrix.fromArray(d).getInverse(f.matrix),f.projectionMatrix.fromArray(h.projectionMatrix),f.viewport.set(c.x,c.y,c.width,c.height),0===a&&p.matrix.copy(f.matrix)}for(a=0;a<l.length;a++){var m=l[a],g=u[a];if(g){var y=e.getInputPose(g,o);if(null!==y){"targetRay"in y?m.matrix.elements=y.targetRay.transformMatrix:"pointerMatrix"in y&&(m.matrix.elements=y.pointerMatrix),m.matrix.decompose(m.position,m.rotation,m.scale),m.visible=!0;continue}}m.visible=!1}v&&v(t)})),this.setAnimationLoop=function(t){v=t},this.dispose=function(){},this.getStandingMatrix=function(){return new THREE.Matrix4},this.submitFrame=function(){}}function wo(t){var e=void 0!==(t=t||{}).canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),i=void 0!==t.context?t.context:null,n=void 0!==t.alpha&&t.alpha,r=void 0===t.depth||t.depth,o=void 0===t.stencil||t.stencil,a=void 0!==t.antialias&&t.antialias,s=void 0===t.premultipliedAlpha||t.premultipliedAlpha,l=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,u=void 0!==t.powerPreference?t.powerPreference:"default",h=null,c=null;this.domElement=e,this.context=null,this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.gammaInput=!1,this.gammaOutput=!1,this.physicallyCorrectLights=!1,this.toneMapping=dt,this.toneMappingExposure=1,this.toneMappingWhitePoint=1,this.maxMorphTargets=8,this.maxMorphNormals=4;var d,p,f,m,g,v,y,b,w,x,M,T,S,A,P,C,E,D,L=this,O=!1,I=null,R=null,N=null,k=-1,F={geometry:null,program:null,wireframe:!1},B=null,z=null,U=new li,V=new li,j=null,H=0,G=e.width,W=e.height,q=1,Y=new li(0,0,G,W),X=new li(0,0,G,W),Z=!1,K=new mi,Q=new Dn,J=!1,$=!1,tt=new Ke,et=new Je;function it(){return null===R?q:1}try{var nt={alpha:n,depth:r,stencil:o,antialias:a,premultipliedAlpha:s,preserveDrawingBuffer:l,powerPreference:u};if(e.addEventListener("webglcontextlost",st,!1),e.addEventListener("webglcontextrestored",lt,!1),null===(d=i||e.getContext("webgl",nt)||e.getContext("experimental-webgl",nt)))throw null!==e.getContext("webgl")?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.");void 0===d.getShaderPrecisionFormat&&(d.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(t){}function rt(){p=new Ln(d),(f=new En(d,p,t)).isWebGL2||(p.get("WEBGL_depth_texture"),p.get("OES_texture_float"),p.get("OES_texture_half_float"),p.get("OES_texture_half_float_linear"),p.get("OES_standard_derivatives"),p.get("OES_element_index_uint"),p.get("ANGLE_instanced_arrays")),p.get("OES_texture_float_linear"),D=new no(d,p,f),(m=new eo(d,p,D,f)).scissor(V.copy(X).multiplyScalar(q)),m.viewport(U.copy(Y).multiplyScalar(q)),g=new Rn(d),v=new jr,y=new io(d,p,m,v,f,D,g),b=new Ei(d),w=new On(d,b,g),x=new Fn(w,g),P=new kn(d),M=new Vr(L,p,f),T=new qr,S=new Qr,A=new Pn(L,m,x,s),C=new Cn(d,p,g,f),E=new In(d,p,g,f),g.programs=M.programs,L.context=d,L.capabilities=f,L.extensions=p,L.properties=v,L.renderLists=T,L.state=m,L.info=g}rt();var ot=null;"undefined"!=typeof navigator&&(ot="xr"in navigator?new bo(L):new yo(L)),this.vr=ot;var at=new to(L,x,f.maxTextureSize);function st(t){t.preventDefault(),O=!0}function lt(){O=!1,rt()}function ut(t){var e=t.target;e.removeEventListener("dispose",ut),function(t){ht(t),v.remove(t)}(e)}function ht(t){var e=v.get(t).program;t.program=void 0,void 0!==e&&M.releaseProgram(e)}this.shadowMap=at,this.getContext=function(){return d},this.getContextAttributes=function(){return d.getContextAttributes()},this.forceContextLoss=function(){var t=p.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){var t=p.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return q},this.setPixelRatio=function(t){void 0!==t&&(q=t,this.setSize(G,W,!1))},this.getSize=function(){return{width:G,height:W}},this.setSize=function(t,i,n){ot.isPresenting()||(G=t,W=i,e.width=t*q,e.height=i*q,!1!==n&&(e.style.width=t+"px",e.style.height=i+"px"),this.setViewport(0,0,t,i))},this.getDrawingBufferSize=function(){return{width:G*q,height:W*q}},this.setDrawingBufferSize=function(t,i,n){G=t,W=i,q=n,e.width=t*n,e.height=i*n,this.setViewport(0,0,t,i)},this.getCurrentViewport=function(){return U},this.setViewport=function(t,e,i,n){Y.set(t,W-e-n,i,n),m.viewport(U.copy(Y).multiplyScalar(q))},this.setScissor=function(t,e,i,n){X.set(t,W-e-n,i,n),m.scissor(V.copy(X).multiplyScalar(q))},this.setScissorTest=function(t){m.setScissorTest(Z=t)},this.getClearColor=function(){return A.getClearColor()},this.setClearColor=function(){A.setClearColor.apply(A,arguments)},this.getClearAlpha=function(){return A.getClearAlpha()},this.setClearAlpha=function(){A.setClearAlpha.apply(A,arguments)},this.clear=function(t,e,i){var n=0;(void 0===t||t)&&(n|=16384),(void 0===e||e)&&(n|=256),(void 0===i||i)&&(n|=1024),d.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",st,!1),e.removeEventListener("webglcontextrestored",lt,!1),T.dispose(),S.dispose(),v.dispose(),x.dispose(),ot.dispose(),ft.stop()},this.renderBufferImmediate=function(t,e){m.initAttributes();var i=v.get(t);t.hasPositions&&!i.position&&(i.position=d.createBuffer()),t.hasNormals&&!i.normal&&(i.normal=d.createBuffer()),t.hasUvs&&!i.uv&&(i.uv=d.createBuffer()),t.hasColors&&!i.color&&(i.color=d.createBuffer());var n=e.getAttributes();t.hasPositions&&(d.bindBuffer(34962,i.position),d.bufferData(34962,t.positionArray,35048),m.enableAttribute(n.position),d.vertexAttribPointer(n.position,3,5126,!1,0,0)),t.hasNormals&&(d.bindBuffer(34962,i.normal),d.bufferData(34962,t.normalArray,35048),m.enableAttribute(n.normal),d.vertexAttribPointer(n.normal,3,5126,!1,0,0)),t.hasUvs&&(d.bindBuffer(34962,i.uv),d.bufferData(34962,t.uvArray,35048),m.enableAttribute(n.uv),d.vertexAttribPointer(n.uv,2,5126,!1,0,0)),t.hasColors&&(d.bindBuffer(34962,i.color),d.bufferData(34962,t.colorArray,35048),m.enableAttribute(n.color),d.vertexAttribPointer(n.color,3,5126,!1,0,0)),m.disableUnusedAttributes(),d.drawArrays(4,0,t.count),t.count=0},this.renderBufferDirect=function(t,e,i,n,r,o){var a=r.isMesh&&r.normalMatrix.determinant()<0;m.setMaterial(n,a);var s=yt(t,e,n,r),l=!1;F.geometry===i.id&&F.program===s.id&&F.wireframe===(!0===n.wireframe)||(F.geometry=i.id,F.program=s.id,F.wireframe=!0===n.wireframe,l=!0),r.morphTargetInfluences&&(P.update(r,i,n,s),l=!0);var u,h=i.index,c=i.attributes.position,g=1;!0===n.wireframe&&(h=w.getWireframeAttribute(i),g=2);var v=C;null!==h&&(u=b.get(h),(v=E).setIndex(u)),l&&(!function(t,e,i){if(i&&i.isInstancedBufferGeometry&!f.isWebGL2&&null===p.get("ANGLE_instanced_arrays"))return;m.initAttributes();var n=i.attributes,r=e.getAttributes(),o=t.defaultAttributeValues;for(var a in r){var s=r[a];if(s>=0){var l=n[a];if(void 0!==l){var u=l.normalized,h=l.itemSize,c=b.get(l);if(void 0===c)continue;var g=c.buffer,v=c.type,y=c.bytesPerElement;if(l.isInterleavedBufferAttribute){var w=l.data,x=w.stride,M=l.offset;w&&w.isInstancedInterleavedBuffer?(m.enableAttributeAndDivisor(s,w.meshPerAttribute),void 0===i.maxInstancedCount&&(i.maxInstancedCount=w.meshPerAttribute*w.count)):m.enableAttribute(s),d.bindBuffer(34962,g),d.vertexAttribPointer(s,h,v,u,x*y,M*y)}else l.isInstancedBufferAttribute?(m.enableAttributeAndDivisor(s,l.meshPerAttribute),void 0===i.maxInstancedCount&&(i.maxInstancedCount=l.meshPerAttribute*l.count)):m.enableAttribute(s),d.bindBuffer(34962,g),d.vertexAttribPointer(s,h,v,u,0,0)}else if(void 0!==o){var T=o[a];if(void 0!==T)switch(T.length){case 2:d.vertexAttrib2fv(s,T);break;case 3:d.vertexAttrib3fv(s,T);break;case 4:d.vertexAttrib4fv(s,T);break;default:d.vertexAttrib1fv(s,T)}}}}m.disableUnusedAttributes()}(n,s,i),null!==h&&d.bindBuffer(34963,u.buffer));var y=1/0;null!==h?y=h.count:void 0!==c&&(y=c.count);var x=i.drawRange.start*g,M=i.drawRange.count*g,T=null!==o?o.start*g:0,S=null!==o?o.count*g:1/0,_=Math.max(x,T),A=Math.min(y,x+M,T+S)-1,D=Math.max(0,A-_+1);if(0!==D){if(r.isMesh)if(!0===n.wireframe)m.setLineWidth(n.wireframeLinewidth*it()),v.setMode(1);else switch(r.drawMode){case Ie:v.setMode(4);break;case Re:v.setMode(5);break;case Ne:v.setMode(6)}else if(r.isLine){var L=n.linewidth;void 0===L&&(L=1),m.setLineWidth(L*it()),r.isLineSegments?v.setMode(1):r.isLineLoop?v.setMode(2):v.setMode(3)}else r.isPoints?v.setMode(0):r.isSprite&&v.setMode(4);i&&i.isInstancedBufferGeometry?i.maxInstancedCount>0&&v.renderInstances(i,_,D):v.render(_,D)}},this.compile=function(t,e){(c=S.get(t,e)).init(),t.traverse((function(t){t.isLight&&(c.pushLight(t),t.castShadow&&c.pushShadow(t))})),c.setupLights(e),t.traverse((function(e){if(e.material)if(Array.isArray(e.material))for(var i=0;i<e.material.length;i++)vt(e.material[i],t.fog,e);else vt(e.material,t.fog,e)}))};var ct=null;var pt,ft=new Ci;function mt(t,e,i,n){for(var r=0,o=t.length;r<o;r++){var a=t[r],s=a.object,l=a.geometry,u=void 0===n?a.material:n,h=a.group;if(i.isArrayCamera){z=i;for(var d=i.cameras,p=0,f=d.length;p<f;p++){var g=d[p];if(s.layers.test(g.layers)){if("viewport"in g)m.viewport(U.copy(g.viewport));else{var v=g.bounds,y=v.x*G,b=v.y*W,w=v.z*G,x=v.w*W;m.viewport(U.set(y,b,w,x).multiplyScalar(q))}c.setupLights(g),gt(s,e,g,l,u,h)}}}else z=null,gt(s,e,i,l,u,h)}}function gt(t,e,i,n,r,o){if(t.onBeforeRender(L,e,i,n,r,o),c=S.get(e,z||i),t.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){m.setMaterial(r);var a=yt(i,e.fog,r,t);F.geometry=null,F.program=null,F.wireframe=!1,function(t,e){t.render((function(t){L.renderBufferImmediate(t,e)}))}(t,a)}else L.renderBufferDirect(i,e.fog,n,r,t,o);t.onAfterRender(L,e,i,n,r,o),c=S.get(e,z||i)}function vt(t,e,i){var n=v.get(t),r=c.state.lights,o=c.state.shadowsArray,a=n.lightsHash,s=r.state.hash,l=M.getParameters(t,r.state,o,e,Q.numPlanes,Q.numIntersection,i),u=M.getProgramCode(t,l),h=n.program,d=!0;if(void 0===h)t.addEventListener("dispose",ut);else if(h.code!==u)ht(t);else if(a.stateID!==s.stateID||a.directionalLength!==s.directionalLength||a.pointLength!==s.pointLength||a.spotLength!==s.spotLength||a.rectAreaLength!==s.rectAreaLength||a.hemiLength!==s.hemiLength||a.shadowsLength!==s.shadowsLength)a.stateID=s.stateID,a.directionalLength=s.directionalLength,a.pointLength=s.pointLength,a.spotLength=s.spotLength,a.rectAreaLength=s.rectAreaLength,a.hemiLength=s.hemiLength,a.shadowsLength=s.shadowsLength,d=!1;else{if(void 0!==l.shaderID)return;d=!1}if(d){if(l.shaderID){var p=Pi[l.shaderID];n.shader={name:t.type,uniforms:vi(p.uniforms),vertexShader:p.vertexShader,fragmentShader:p.fragmentShader}}else n.shader={name:t.type,uniforms:t.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader};t.onBeforeCompile(n.shader,L),u=M.getProgramCode(t,l),h=M.acquireProgram(t,n.shader,l,u),n.program=h,t.program=h}var f=h.getAttributes();if(t.morphTargets){t.numSupportedMorphTargets=0;for(var m=0;m<L.maxMorphTargets;m++)f["morphTarget"+m]>=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(m=0;m<L.maxMorphNormals;m++)f["morphNormal"+m]>=0&&t.numSupportedMorphNormals++}var g=n.shader.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(n.numClippingPlanes=Q.numPlanes,n.numIntersection=Q.numIntersection,g.clippingPlanes=Q.uniform),n.fog=e,void 0===a&&(n.lightsHash=a={}),a.stateID=s.stateID,a.directionalLength=s.directionalLength,a.pointLength=s.pointLength,a.spotLength=s.spotLength,a.rectAreaLength=s.rectAreaLength,a.hemiLength=s.hemiLength,a.shadowsLength=s.shadowsLength,t.lights&&(g.ambientLightColor.value=r.state.ambient,g.directionalLights.value=r.state.directional,g.spotLights.value=r.state.spot,g.rectAreaLights.value=r.state.rectArea,g.pointLights.value=r.state.point,g.hemisphereLights.value=r.state.hemi,g.directionalShadowMap.value=r.state.directionalShadowMap,g.directionalShadowMatrix.value=r.state.directionalShadowMatrix,g.spotShadowMap.value=r.state.spotShadowMap,g.spotShadowMatrix.value=r.state.spotShadowMatrix,g.pointShadowMap.value=r.state.pointShadowMap,g.pointShadowMatrix.value=r.state.pointShadowMatrix);var y=n.program.getUniforms(),b=Er.seqWithValue(y.seq,g);n.uniformsList=b}function yt(t,e,i,n){H=0;var r=v.get(i),o=c.state.lights,a=r.lightsHash,s=o.state.hash;if(J&&($||t!==B)){var l=t===B&&i.id===k;Q.setState(i.clippingPlanes,i.clipIntersection,i.clipShadows,t,r,l)}!1===i.needsUpdate&&(void 0===r.program||i.fog&&r.fog!==e?i.needsUpdate=!0:(!i.lights||a.stateID===s.stateID&&a.directionalLength===s.directionalLength&&a.pointLength===s.pointLength&&a.spotLength===s.spotLength&&a.rectAreaLength===s.rectAreaLength&&a.hemiLength===s.hemiLength&&a.shadowsLength===s.shadowsLength)&&(void 0===r.numClippingPlanes||r.numClippingPlanes===Q.numPlanes&&r.numIntersection===Q.numIntersection)||(i.needsUpdate=!0)),i.needsUpdate&&(vt(i,e,n),i.needsUpdate=!1);var u,h,p=!1,g=!1,y=!1,b=r.program,w=b.getUniforms(),x=r.shader.uniforms;if(m.useProgram(b.program)&&(p=!0,g=!0,y=!0),i.id!==k&&(k=i.id,g=!0),p||B!==t){if(w.setValue(d,"projectionMatrix",t.projectionMatrix),f.logarithmicDepthBuffer&&w.setValue(d,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),B!==t&&(B=t,g=!0,y=!0),i.isShaderMaterial||i.isMeshPhongMaterial||i.isMeshStandardMaterial||i.envMap){var M=w.map.cameraPosition;void 0!==M&&M.setValue(d,et.setFromMatrixPosition(t.matrixWorld))}(i.isMeshPhongMaterial||i.isMeshLambertMaterial||i.isMeshBasicMaterial||i.isMeshStandardMaterial||i.isShaderMaterial||i.skinning)&&w.setValue(d,"viewMatrix",t.matrixWorldInverse)}if(i.skinning){w.setOptional(d,n,"bindMatrix"),w.setOptional(d,n,"bindMatrixInverse");var T=n.skeleton;if(T){var S=T.bones;if(f.floatVertexTextures){if(void 0===T.boneTexture){var A=Math.sqrt(4*S.length);A=Xe.ceilPowerOfTwo(A),A=Math.max(A,4);var P=new Float32Array(A*A*4);P.set(T.boneMatrices);var C=new ci(P,A,A,Xt,Ut);C.needsUpdate=!0,T.boneMatrices=P,T.boneTexture=C,T.boneTextureSize=A}w.setValue(d,"boneTexture",T.boneTexture),w.setValue(d,"boneTextureSize",T.boneTextureSize)}else w.setOptional(d,T,"boneMatrices")}}return g&&(w.setValue(d,"toneMappingExposure",L.toneMappingExposure),w.setValue(d,"toneMappingWhitePoint",L.toneMappingWhitePoint),i.lights&&(h=y,(u=x).ambientLightColor.needsUpdate=h,u.directionalLights.needsUpdate=h,u.pointLights.needsUpdate=h,u.spotLights.needsUpdate=h,u.rectAreaLights.needsUpdate=h,u.hemisphereLights.needsUpdate=h),e&&i.fog&&function(t,e){t.fogColor.value=e.color,e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)}(x,e),i.isMeshBasicMaterial?bt(x,i):i.isMeshLambertMaterial?(bt(x,i),function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(x,i)):i.isMeshPhongMaterial?(bt(x,i),i.isMeshToonMaterial?function(t,e){wt(t,e),e.gradientMap&&(t.gradientMap.value=e.gradientMap)}(x,i):wt(x,i)):i.isMeshStandardMaterial?(bt(x,i),i.isMeshPhysicalMaterial?function(t,e){xt(t,e),t.reflectivity.value=e.reflectivity,t.clearCoat.value=e.clearCoat,t.clearCoatRoughness.value=e.clearCoatRoughness}(x,i):xt(x,i)):i.isMeshMatcapMaterial?(bt(x,i),function(t,e){e.matcap&&(t.matcap.value=e.matcap);e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===_&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===_&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(x,i)):i.isMeshDepthMaterial?(bt(x,i),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(x,i)):i.isMeshDistanceMaterial?(bt(x,i),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias);t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(x,i)):i.isMeshNormalMaterial?(bt(x,i),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===_&&(t.bumpScale.value*=-1));e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===_&&t.normalScale.value.negate());e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(x,i)):i.isLineBasicMaterial?(function(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity}(x,i),i.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(x,i)):i.isPointsMaterial?function(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity,t.size.value=e.size*q,t.scale.value=.5*W,t.map.value=e.map,null!==e.map&&(!0===e.map.matrixAutoUpdate&&e.map.updateMatrix(),t.uvTransform.value.copy(e.map.matrix))}(x,i):i.isSpriteMaterial?function(t,e){t.diffuse.value=e.color,t.opacity.value=e.opacity,t.rotation.value=e.rotation,t.map.value=e.map,null!==e.map&&(!0===e.map.matrixAutoUpdate&&e.map.updateMatrix(),t.uvTransform.value.copy(e.map.matrix))}(x,i):i.isShadowMaterial&&(x.color.value=i.color,x.opacity.value=i.opacity),void 0!==x.ltc_1&&(x.ltc_1.value=Ai.LTC_1),void 0!==x.ltc_2&&(x.ltc_2.value=Ai.LTC_2),Er.upload(d,r.uniformsList,x,L)),i.isShaderMaterial&&!0===i.uniformsNeedUpdate&&(Er.upload(d,r.uniformsList,x,L),i.uniformsNeedUpdate=!1),i.isSpriteMaterial&&w.setValue(d,"center",n.center),w.setValue(d,"modelViewMatrix",n.modelViewMatrix),w.setValue(d,"normalMatrix",n.normalMatrix),w.setValue(d,"modelMatrix",n.matrixWorld),b}function bt(t,e){var i;t.opacity.value=e.opacity,e.color&&(t.diffuse.value=e.color),e.emissive&&t.emissive.value.copy(e.emissive).multiplyScalar(e.emissiveIntensity),e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.specularMap&&(t.specularMap.value=e.specularMap),e.envMap&&(t.envMap.value=e.envMap,t.flipEnvMap.value=e.envMap.isCubeTexture?-1:1,t.reflectivity.value=e.reflectivity,t.refractionRatio.value=e.refractionRatio,t.maxMipLevel.value=v.get(e.envMap).__maxMipLevel),e.lightMap&&(t.lightMap.value=e.lightMap,t.lightMapIntensity.value=e.lightMapIntensity),e.aoMap&&(t.aoMap.value=e.aoMap,t.aoMapIntensity.value=e.aoMapIntensity),e.map?i=e.map:e.specularMap?i=e.specularMap:e.displacementMap?i=e.displacementMap:e.normalMap?i=e.normalMap:e.bumpMap?i=e.bumpMap:e.roughnessMap?i=e.roughnessMap:e.metalnessMap?i=e.metalnessMap:e.alphaMap?i=e.alphaMap:e.emissiveMap&&(i=e.emissiveMap),void 0!==i&&(i.isWebGLRenderTarget&&(i=i.texture),!0===i.matrixAutoUpdate&&i.updateMatrix(),t.uvTransform.value.copy(i.matrix))}function wt(t,e){t.specular.value=e.specular,t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===_&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===_&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}function xt(t,e){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===_&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===_&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),e.envMap&&(t.envMapIntensity.value=e.envMapIntensity)}ft.setAnimationLoop((function(t){ot.isPresenting()||ct&&ct(t)})),"undefined"!=typeof window&&ft.setContext(window),this.setAnimationLoop=function(t){ct=t,ot.setAnimationLoop(t),ft.start()},this.render=function(t,e,i,n){if(e&&e.isCamera&&!O){F.geometry=null,F.program=null,F.wireframe=!1,k=-1,B=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),ot.enabled&&(e=ot.getCamera(e)),(c=S.get(t,e)).init(),t.onBeforeRender(L,t,e,i),tt.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),K.setFromMatrix(tt),$=this.localClippingEnabled,J=Q.init(this.clippingPlanes,$,e),(h=T.get(t,e)).init(),function t(e,i,n){if(!1===e.visible)return;if(e.layers.test(i.layers))if(e.isLight)c.pushLight(e),e.castShadow&&c.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||K.intersectsSprite(e)){n&&et.setFromMatrixPosition(e.matrixWorld).applyMatrix4(tt);var r=x.update(e),o=e.material;h.push(e,r,o,et.z,null)}}else if(e.isImmediateRenderObject)n&&et.setFromMatrixPosition(e.matrixWorld).applyMatrix4(tt),h.push(e,null,e.material,et.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.update(),!e.frustumCulled||K.intersectsObject(e))){n&&et.setFromMatrixPosition(e.matrixWorld).applyMatrix4(tt);r=x.update(e),o=e.material;if(Array.isArray(o))for(var a=r.groups,s=0,l=a.length;s<l;s++){var u=a[s],d=o[u.materialIndex];d&&d.visible&&h.push(e,r,d,et.z,u)}else o.visible&&h.push(e,r,o,et.z,null)}var p=e.children;for(s=0,l=p.length;s<l;s++)t(p[s],i,n)}(t,e,L.sortObjects),!0===L.sortObjects&&h.sort(),J&&Q.beginShadows();var r=c.state.shadowsArray;at.render(r,t,e),c.setupLights(e),J&&Q.endShadows(),this.info.autoReset&&this.info.reset(),void 0===i&&(i=null),this.setRenderTarget(i),A.render(h,t,e,n);var o=h.opaque,a=h.transparent;if(t.overrideMaterial){var s=t.overrideMaterial;o.length&&mt(o,t,e,s),a.length&&mt(a,t,e,s)}else o.length&&mt(o,t,e),a.length&&mt(a,t,e);i&&y.updateRenderTargetMipmap(i),m.buffers.depth.setTest(!0),m.buffers.depth.setMask(!0),m.buffers.color.setMask(!0),m.setPolygonOffset(!1),t.onAfterRender(L,t,e),ot.enabled&&ot.submitFrame(),h=null,c=null}},this.allocTextureUnit=function(){var t=H;return f.maxTextures,H+=1,t},this.setTexture2D=(pt=!1,function(t,e){t&&t.isWebGLRenderTarget&&(pt||(pt=!0),t=t.texture),y.setTexture2D(t,e)}),this.setTexture3D=function(t,e){y.setTexture3D(t,e)},this.setTexture=function(){var t=!1;return function(e,i){t||(t=!0),y.setTexture2D(e,i)}}(),this.setTextureCube=function(){var t=!1;return function(e,i){e&&e.isWebGLRenderTargetCube&&(t||(t=!0),e=e.texture),e&&e.isCubeTexture||Array.isArray(e.image)&&6===e.image.length?y.setTextureCube(e,i):y.setTextureCubeDynamic(e,i)}}(),this.setFramebuffer=function(t){I=t},this.getRenderTarget=function(){return R},this.setRenderTarget=function(t){R=t,t&&void 0===v.get(t).__webglFramebuffer&&y.setupRenderTarget(t);var e=I,i=!1;if(t){var n=v.get(t).__webglFramebuffer;t.isWebGLRenderTargetCube?(e=n[t.activeCubeFace],i=!0):e=n,U.copy(t.viewport),V.copy(t.scissor),j=t.scissorTest}else U.copy(Y).multiplyScalar(q),V.copy(X).multiplyScalar(q),j=Z;if(N!==e&&(d.bindFramebuffer(36160,e),N=e),m.viewport(U),m.scissor(V),m.setScissorTest(j),i){var r=v.get(t.texture);d.framebufferTexture2D(36160,36064,34069+t.activeCubeFace,r.__webglTexture,t.activeMipMapLevel)}},this.readRenderTargetPixels=function(t,e,i,n,r,o){if(t&&t.isWebGLRenderTarget){var a=v.get(t).__webglFramebuffer;if(a){var s=!1;a!==N&&(d.bindFramebuffer(36160,a),s=!0);try{var l=t.texture,u=l.format,h=l.type;if(u!==Xt&&D.convert(u)!==d.getParameter(35739))return;if(!(h===Rt||D.convert(h)===d.getParameter(35738)||h===Ut&&(f.isWebGL2||p.get("OES_texture_float")||p.get("WEBGL_color_buffer_float"))||h===Vt&&(f.isWebGL2?p.get("EXT_color_buffer_float"):p.get("EXT_color_buffer_half_float"))))return;36053===d.checkFramebufferStatus(36160)&&e>=0&&e<=t.width-n&&i>=0&&i<=t.height-r&&d.readPixels(e,i,n,r,D.convert(u),D.convert(h),o)}finally{s&&d.bindFramebuffer(36160,N)}}}},this.copyFramebufferToTexture=function(t,e,i){var n=e.image.width,r=e.image.height,o=D.convert(e.format);this.setTexture2D(e,0),d.copyTexImage2D(3553,i||0,o,t.x,t.y,n,r,0)},this.copyTextureToTexture=function(t,e,i,n){var r=e.image.width,o=e.image.height,a=D.convert(i.format),s=D.convert(i.type);this.setTexture2D(i,0),e.isDataTexture?d.texSubImage2D(3553,n||0,t.x,t.y,r,o,a,s,e.image.data):d.texSubImage2D(3553,n||0,t.x,t.y,a,s,e.image)}}function xo(t,e){this.name="",this.color=new Si(t),this.density=void 0!==e?e:25e-5}function Mo(t,e,i){this.name="",this.color=new Si(t),this.near=void 0!==e?e:1,this.far=void 0!==i?i:1e3}function To(){Bi.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function So(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function _o(t,e,i,n){this.data=t,this.itemSize=e,this.offset=i,this.normalized=!0===n}function Ao(t){xn.call(this),this.type="SpriteMaterial",this.color=new Si(16777215),this.map=null,this.rotation=0,this.sizeAttenuation=!0,this.lights=!1,this.transparent=!0,this.setValues(t)}function Po(t){if(Bi.call(this),this.type="Sprite",void 0===lo){lo=new nn;var e=new So(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);lo.setIndex([0,1,2,0,2,3]),lo.addAttribute("position",new _o(e,3,0,!1)),lo.addAttribute("uv",new _o(e,2,3,!1))}this.geometry=lo,this.material=void 0!==t?t:new Ao,this.center=new Ze(.5,.5)}function Co(){Bi.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function Eo(t,e){t&&t.isGeometry,An.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new Ke,this.bindMatrixInverse=new Ke}function Do(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{this.boneInverses=[];for(var i=0,n=this.bones.length;i<n;i++)this.boneInverses.push(new Ke)}}function Lo(){Bi.call(this),this.type="Bone"}function Oo(t){xn.call(this),this.type="LineBasicMaterial",this.color=new Si(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.lights=!1,this.setValues(t)}function Io(t,e,i){Bi.call(this),this.type="Line",this.geometry=void 0!==t?t:new nn,this.material=void 0!==e?e:new Oo({color:16777215*Math.random()})}function Ro(t,e){Io.call(this,t,e),this.type="LineSegments"}function No(t,e){Io.call(this,t,e),this.type="LineLoop"}function ko(t){xn.call(this),this.type="PointsMaterial",this.color=new Si(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.lights=!1,this.setValues(t)}function Fo(t,e){Bi.call(this),this.type="Points",this.geometry=void 0!==t?t:new nn,this.material=void 0!==e?e:new ko({color:16777215*Math.random()})}function Bo(t,e,i,n,r,o,a,s,l){si.call(this,t,e,i,n,r,o,a,s,l),this.format=void 0!==a?a:Yt,this.minFilter=void 0!==o?o:Lt,this.magFilter=void 0!==r?r:Lt,this.generateMipmaps=!1}function zo(t,e,i,n,r,o,a,s,l,u,h,c){si.call(this,null,o,a,s,l,u,n,r,h,c),this.image={width:e,height:i},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function Uo(t,e,i,n,r,o,a,s,l){si.call(this,t,e,i,n,r,o,a,s,l),this.needsUpdate=!0}function Vo(t,e,i,n,r,o,a,s,l,u){if((u=void 0!==u?u:Jt)!==Jt&&u!==$t)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===i&&u===Jt&&(i=Ft),void 0===i&&u===$t&&(i=Wt),si.call(this,null,n,r,o,a,s,u,i,l),this.image={width:t,height:e},this.magFilter=void 0!==a?a:Ct,this.minFilter=void 0!==s?s:Ct,this.flipY=!1,this.generateMipmaps=!1}function jo(t){nn.call(this),this.type="WireframeGeometry";var e,i,n,r,o,a,s,l,u,h,c=[],d=[0,0],p={},f=["a","b","c"];if(t&&t.isGeometry){var m=t.faces;for(e=0,n=m.length;e<n;e++){var g=m[e];for(i=0;i<3;i++)s=g[f[i]],l=g[f[(i+1)%3]],d[0]=Math.min(s,l),d[1]=Math.max(s,l),void 0===p[u=d[0]+","+d[1]]&&(p[u]={index1:d[0],index2:d[1]})}for(u in p)a=p[u],h=t.vertices[a.index1],c.push(h.x,h.y,h.z),h=t.vertices[a.index2],c.push(h.x,h.y,h.z)}else if(t&&t.isBufferGeometry){var v,y,b,w,x,M,T;if(h=new Je,null!==t.index){for(v=t.attributes.position,y=t.index,0===(b=t.groups).length&&(b=[{start:0,count:y.count,materialIndex:0}]),r=0,o=b.length;r<o;++r)for(e=x=(w=b[r]).start,n=x+w.count;e<n;e+=3)for(i=0;i<3;i++)s=y.getX(e+i),l=y.getX(e+(i+1)%3),d[0]=Math.min(s,l),d[1]=Math.max(s,l),void 0===p[u=d[0]+","+d[1]]&&(p[u]={index1:d[0],index2:d[1]});for(u in p)a=p[u],h.fromBufferAttribute(v,a.index1),c.push(h.x,h.y,h.z),h.fromBufferAttribute(v,a.index2),c.push(h.x,h.y,h.z)}else for(e=0,n=(v=t.attributes.position).count/3;e<n;e++)for(i=0;i<3;i++)M=3*e+i,h.fromBufferAttribute(v,M),c.push(h.x,h.y,h.z),T=3*e+(i+1)%3,h.fromBufferAttribute(v,T),c.push(h.x,h.y,h.z)}this.addAttribute("position",new Qi(c,3))}function Ho(t,e,i){ji.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:i},this.fromBufferGeometry(new Go(t,e,i)),this.mergeVertices()}function Go(t,e,i){nn.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:i};var n,r,o=[],a=[],s=[],l=[],u=1e-5,h=new Je,c=new Je,d=new Je,p=new Je,f=new Je;t.length;var m=e+1;for(n=0;n<=i;n++){var g=n/i;for(r=0;r<=e;r++){var v=r/e;t(v,g,c),a.push(c.x,c.y,c.z),v-u>=0?(t(v-u,g,d),p.subVectors(c,d)):(t(v+u,g,d),p.subVectors(d,c)),g-u>=0?(t(v,g-u,d),f.subVectors(c,d)):(t(v,g+u,d),f.subVectors(d,c)),h.crossVectors(p,f).normalize(),s.push(h.x,h.y,h.z),l.push(v,g)}}for(n=0;n<i;n++)for(r=0;r<e;r++){var y=n*m+r,b=n*m+r+1,w=(n+1)*m+r+1,x=(n+1)*m+r;o.push(y,b,x),o.push(b,w,x)}this.setIndex(o),this.addAttribute("position",new Qi(a,3)),this.addAttribute("normal",new Qi(s,3)),this.addAttribute("uv",new Qi(l,2))}function Wo(t,e,i,n){ji.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:i,detail:n},this.fromBufferGeometry(new qo(t,e,i,n)),this.mergeVertices()}function qo(t,e,i,n){nn.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:t,indices:e,radius:i,detail:n},i=i||1;var r=[],o=[];function a(t,e,i,n){var r,o,a=Math.pow(2,n),l=[];for(r=0;r<=a;r++){l[r]=[];var u=t.clone().lerp(i,r/a),h=e.clone().lerp(i,r/a),c=a-r;for(o=0;o<=c;o++)l[r][o]=0===o&&r===a?u:u.clone().lerp(h,o/c)}for(r=0;r<a;r++)for(o=0;o<2*(a-r)-1;o++){var d=Math.floor(o/2);o%2==0?(s(l[r][d+1]),s(l[r+1][d]),s(l[r][d])):(s(l[r][d+1]),s(l[r+1][d+1]),s(l[r+1][d]))}}function s(t){r.push(t.x,t.y,t.z)}function l(e,i){var n=3*e;i.x=t[n+0],i.y=t[n+1],i.z=t[n+2]}function u(t,e,i,n){n<0&&1===t.x&&(o[e]=t.x-1),0===i.x&&0===i.z&&(o[e]=n/2/Math.PI+.5)}function h(t){return Math.atan2(t.z,-t.x)}function c(t){return Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))}!function(t){for(var i=new Je,n=new Je,r=new Je,o=0;o<e.length;o+=3)l(e[o+0],i),l(e[o+1],n),l(e[o+2],r),a(i,n,r,t)}(n=n||0),function(t){for(var e=new Je,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(){for(var t=new Je,e=0;e<r.length;e+=3){t.x=r[e+0],t.y=r[e+1],t.z=r[e+2];var i=h(t)/2/Math.PI+.5,n=c(t)/Math.PI+.5;o.push(i,1-n)}(function(){for(var t=new Je,e=new Je,i=new Je,n=new Je,a=new Ze,s=new Ze,l=new Ze,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]),a.set(o[d+0],o[d+1]),s.set(o[d+2],o[d+3]),l.set(o[d+4],o[d+5]),n.copy(t).add(e).add(i).divideScalar(3);var p=h(n);u(a,d+0,t,p),u(s,d+2,e,p),u(l,d+4,i,p)}})(),function(){for(var t=0;t<o.length;t+=6){var e=o[t+0],i=o[t+2],n=o[t+4],r=Math.max(e,i,n),a=Math.min(e,i,n);r>.9&&a<.1&&(e<.2&&(o[t+0]+=1),i<.2&&(o[t+2]+=1),n<.2&&(o[t+4]+=1))}}()}(),this.addAttribute("position",new Qi(r,3)),this.addAttribute("normal",new Qi(r.slice(),3)),this.addAttribute("uv",new Qi(o,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}function Yo(t,e){ji.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Xo(t,e)),this.mergeVertices()}function Xo(t,e){qo.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Zo(t,e){ji.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Ko(t,e)),this.mergeVertices()}function Ko(t,e){qo.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Qo(t,e){ji.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Jo(t,e)),this.mergeVertices()}function Jo(t,e){var i=(1+Math.sqrt(5))/2,n=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1];qo.call(this,n,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function $o(t,e){ji.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new ta(t,e)),this.mergeVertices()}function ta(t,e){var i=(1+Math.sqrt(5))/2,n=1/i,r=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-n,-i,0,-n,i,0,n,-i,0,n,i,-n,-i,0,-n,i,0,n,-i,0,n,i,0,-i,0,-n,i,0,-n,-i,0,n,i,0,n];qo.call(this,r,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function ea(t,e,i,n,r,o){ji.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:i,radialSegments:n,closed:r};var a=new ia(t,e,i,n,r);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,this.fromBufferGeometry(a),this.mergeVertices()}function ia(t,e,i,n,r){nn.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:i,radialSegments:n,closed:r},e=e||64,i=i||1,n=n||8,r=r||!1;var o=t.computeFrenetFrames(e,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;var a,s,l=new Je,u=new Je,h=new Ze,c=new Je,d=[],p=[],f=[],m=[];function g(r){c=t.getPointAt(r/e,c);var a=o.normals[r],h=o.binormals[r];for(s=0;s<=n;s++){var f=s/n*Math.PI*2,m=Math.sin(f),g=-Math.cos(f);u.x=g*a.x+m*h.x,u.y=g*a.y+m*h.y,u.z=g*a.z+m*h.z,u.normalize(),p.push(u.x,u.y,u.z),l.x=c.x+i*u.x,l.y=c.y+i*u.y,l.z=c.z+i*u.z,d.push(l.x,l.y,l.z)}}!function(){for(a=0;a<e;a++)g(a);g(!1===r?e:0),function(){for(a=0;a<=e;a++)for(s=0;s<=n;s++)h.x=a/e,h.y=s/n,f.push(h.x,h.y)}(),function(){for(s=1;s<=e;s++)for(a=1;a<=n;a++){var t=(n+1)*(s-1)+(a-1),i=(n+1)*s+(a-1),r=(n+1)*s+a,o=(n+1)*(s-1)+a;m.push(t,i,o),m.push(i,r,o)}}()}(),this.setIndex(m),this.addAttribute("position",new Qi(d,3)),this.addAttribute("normal",new Qi(p,3)),this.addAttribute("uv",new Qi(f,2))}function na(t,e,i,n,r,o,a){ji.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:i,radialSegments:n,p:r,q:o},this.fromBufferGeometry(new ra(t,e,i,n,r,o)),this.mergeVertices()}function ra(t,e,i,n,r,o){nn.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:i,radialSegments:n,p:r,q:o},t=t||1,e=e||.4,i=Math.floor(i)||64,n=Math.floor(n)||8,r=r||2,o=o||3;var a,s,l=[],u=[],h=[],c=[],d=new Je,p=new Je,f=new Je,m=new Je,g=new Je,v=new Je,y=new Je;for(a=0;a<=i;++a){var b=a/i*r*Math.PI*2;for(P(b,r,o,t,f),P(b+.01,r,o,t,m),v.subVectors(m,f),y.addVectors(m,f),g.crossVectors(v,y),y.crossVectors(g,v),g.normalize(),y.normalize(),s=0;s<=n;++s){var w=s/n*Math.PI*2,x=-e*Math.cos(w),M=e*Math.sin(w);d.x=f.x+(x*y.x+M*g.x),d.y=f.y+(x*y.y+M*g.y),d.z=f.z+(x*y.z+M*g.z),u.push(d.x,d.y,d.z),p.subVectors(d,f).normalize(),h.push(p.x,p.y,p.z),c.push(a/i),c.push(s/n)}}for(s=1;s<=i;s++)for(a=1;a<=n;a++){var T=(n+1)*(s-1)+(a-1),S=(n+1)*s+(a-1),_=(n+1)*s+a,A=(n+1)*(s-1)+a;l.push(T,S,A),l.push(S,_,A)}function P(t,e,i,n,r){var o=Math.cos(t),a=Math.sin(t),s=i/e*t,l=Math.cos(s);r.x=n*(2+l)*.5*o,r.y=n*(2+l)*a*.5,r.z=n*Math.sin(s)*.5}this.setIndex(l),this.addAttribute("position",new Qi(u,3)),this.addAttribute("normal",new Qi(h,3)),this.addAttribute("uv",new Qi(c,2))}function oa(t,e,i,n,r){ji.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:n,arc:r},this.fromBufferGeometry(new aa(t,e,i,n,r)),this.mergeVertices()}function aa(t,e,i,n,r){nn.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:n,arc:r},t=t||1,e=e||.4,i=Math.floor(i)||8,n=Math.floor(n)||6,r=r||2*Math.PI;var o,a,s=[],l=[],u=[],h=[],c=new Je,d=new Je,p=new Je;for(o=0;o<=i;o++)for(a=0;a<=n;a++){var f=a/n*r,m=o/i*Math.PI*2;d.x=(t+e*Math.cos(m))*Math.cos(f),d.y=(t+e*Math.cos(m))*Math.sin(f),d.z=e*Math.sin(m),l.push(d.x,d.y,d.z),c.x=t*Math.cos(f),c.y=t*Math.sin(f),p.subVectors(d,c).normalize(),u.push(p.x,p.y,p.z),h.push(a/n),h.push(o/i)}for(o=1;o<=i;o++)for(a=1;a<=n;a++){var g=(n+1)*o+a-1,v=(n+1)*(o-1)+a-1,y=(n+1)*(o-1)+a,b=(n+1)*o+a;s.push(g,v,b),s.push(v,y,b)}this.setIndex(s),this.addAttribute("position",new Qi(l,3)),this.addAttribute("normal",new Qi(u,3)),this.addAttribute("uv",new Qi(h,2))}xo.prototype.isFogExp2=!0,xo.prototype.clone=function(){return new xo(this.color,this.density)},xo.prototype.toJSON=function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}},Mo.prototype.isFog=!0,Mo.prototype.clone=function(){return new Mo(this.color,this.near,this.far)},Mo.prototype.toJSON=function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}},To.prototype=Object.assign(Object.create(Bi.prototype),{constructor:To,copy:function(t,e){return Bi.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},toJSON:function(t){var e=Bi.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e}}),Object.defineProperty(So.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(So.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setArray:function(t){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");return this.count=void 0!==t?t.length/this.stride:0,this.array=t,this},setDynamic:function(t){return this.dynamic=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.dynamic=t.dynamic,this},copyAt:function(t,e,i){t*=this.stride,i*=e.stride;for(var n=0,r=this.stride;n<r;n++)this.array[t+n]=e.array[i+n];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(){return(new this.constructor).copy(this)},onUpload:function(t){return this.onUploadCallback=t,this}}),Object.defineProperties(_o.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}}}),Object.assign(_o.prototype,{isInterleavedBufferAttribute:!0,setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=i,this},setXYZ:function(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:function(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}}),Ao.prototype=Object.create(xn.prototype),Ao.prototype.constructor=Ao,Ao.prototype.isSpriteMaterial=!0,Ao.prototype.copy=function(t){return xn.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this},Po.prototype=Object.assign(Object.create(Bi.prototype),{constructor:Po,isSprite:!0,raycast:function(){var t=new Je,e=new Je,i=new Je,n=new Ze,r=new Ze,o=new Ke,a=new Je,s=new Je,l=new Je,u=new Ze,h=new Ze,c=new Ze;function d(t,e,i,a,s,l){n.subVectors(t,i).addScalar(.5).multiply(a),void 0!==s?(r.x=l*n.x-s*n.y,r.y=s*n.x+l*n.y):r.copy(n),t.copy(e),t.x+=r.x,t.y+=r.y,t.applyMatrix4(o)}return function(n,r){e.setFromMatrixScale(this.matrixWorld),o.getInverse(this.modelViewMatrix).premultiply(this.matrixWorld),i.setFromMatrixPosition(this.modelViewMatrix);var p,f,m=this.material.rotation;0!==m&&(f=Math.cos(m),p=Math.sin(m));var g=this.center;d(a.set(-.5,-.5,0),i,g,e,p,f),d(s.set(.5,-.5,0),i,g,e,p,f),d(l.set(.5,.5,0),i,g,e,p,f),u.set(0,0),h.set(1,0),c.set(1,1);var v=n.ray.intersectTriangle(a,s,l,!1,t);if(null!==v||(d(s.set(-.5,.5,0),i,g,e,p,f),h.set(0,1),null!==(v=n.ray.intersectTriangle(a,l,s,!1,t)))){var y=n.ray.origin.distanceTo(t);y<n.near||y>n.far||r.push({distance:y,point:t.clone(),uv:Sn.getUV(t,a,s,l,u,h,c,new Ze),face:null,object:this})}}}(),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(t){return Bi.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this}}),Co.prototype=Object.assign(Object.create(Bi.prototype),{constructor:Co,copy:function(t){Bi.prototype.copy.call(this,t,!1);for(var e=t.levels,i=0,n=e.length;i<n;i++){var r=e[i];this.addLevel(r.object.clone(),r.distance)}return this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var i=this.levels,n=0;n<i.length&&!(e<i[n].distance);n++);i.splice(n,0,{distance:e,object:t}),this.add(t)},getObjectForDistance:function(t){for(var e=this.levels,i=1,n=e.length;i<n&&!(t<e[i].distance);i++);return e[i-1].object},raycast:(uo=new Je,function(t,e){uo.setFromMatrixPosition(this.matrixWorld);var i=t.ray.origin.distanceTo(uo);this.getObjectForDistance(i).raycast(t,e)}),update:function(){var t=new Je,e=new Je;return function(i){var n=this.levels;if(n.length>1){t.setFromMatrixPosition(i.matrixWorld),e.setFromMatrixPosition(this.matrixWorld);var r=t.distanceTo(e);n[0].object.visible=!0;for(var o=1,a=n.length;o<a&&r>=n[o].distance;o++)n[o-1].object.visible=!1,n[o].object.visible=!0;for(;o<a;o++)n[o].object.visible=!1}}}(),toJSON:function(t){var e=Bi.prototype.toJSON.call(this,t);e.object.levels=[];for(var i=this.levels,n=0,r=i.length;n<r;n++){var o=i[n];e.object.levels.push({object:o.object.uuid,distance:o.distance})}return e}}),Eo.prototype=Object.assign(Object.create(An.prototype),{constructor:Eo,isSkinnedMesh:!0,bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){for(var t=new li,e=this.geometry.attributes.skinWeight,i=0,n=e.count;i<n;i++){t.x=e.getX(i),t.y=e.getY(i),t.z=e.getZ(i),t.w=e.getW(i);var r=1/t.manhattanLength();r!==1/0?t.multiplyScalar(r):t.set(1,0,0,0),e.setXYZW(i,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){An.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode&&this.bindMatrixInverse.getInverse(this.bindMatrix)},clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Object.assign(Do.prototype,{calculateInverses:function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var i=new Ke;this.bones[t]&&i.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(i)}},pose:function(){var t,e,i;for(e=0,i=this.bones.length;e<i;e++)(t=this.bones[e])&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,i=this.bones.length;e<i;e++)(t=this.bones[e])&&(t.parent&&t.parent.isBone?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},update:(ho=new Ke,co=new Ke,function(){for(var t=this.bones,e=this.boneInverses,i=this.boneMatrices,n=this.boneTexture,r=0,o=t.length;r<o;r++){var a=t[r]?t[r].matrixWorld:co;ho.multiplyMatrices(a,e[r]),ho.toArray(i,16*r)}void 0!==n&&(n.needsUpdate=!0)}),clone:function(){return new Do(this.bones,this.boneInverses)},getBoneByName:function(t){for(var e=0,i=this.bones.length;e<i;e++){var n=this.bones[e];if(n.name===t)return n}}}),Lo.prototype=Object.assign(Object.create(Bi.prototype),{constructor:Lo,isBone:!0}),Oo.prototype=Object.create(xn.prototype),Oo.prototype.constructor=Oo,Oo.prototype.isLineBasicMaterial=!0,Oo.prototype.copy=function(t){return xn.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this},Io.prototype=Object.assign(Object.create(Bi.prototype),{constructor:Io,isLine:!0,computeLineDistances:(po=new Je,fo=new Je,function(){var t=this.geometry;if(t.isBufferGeometry){if(null===t.index){for(var e=t.attributes.position,i=[0],n=1,r=e.count;n<r;n++)po.fromBufferAttribute(e,n-1),fo.fromBufferAttribute(e,n),i[n]=i[n-1],i[n]+=po.distanceTo(fo);t.addAttribute("lineDistance",new Qi(i,1))}}else if(t.isGeometry){var o=t.vertices;for((i=t.lineDistances)[0]=0,n=1,r=o.length;n<r;n++)i[n]=i[n-1],i[n]+=o[n-1].distanceTo(o[n])}return this}),raycast:function(){var t=new Ke,e=new Tn,i=new pi;return function(n,r){var o=n.linePrecision,a=this.geometry,s=this.matrixWorld;if(null===a.boundingSphere&&a.computeBoundingSphere(),i.copy(a.boundingSphere),i.applyMatrix4(s),i.radius+=o,!1!==n.ray.intersectsSphere(i)){t.getInverse(s),e.copy(n.ray).applyMatrix4(t);var l=o/((this.scale.x+this.scale.y+this.scale.z)/3),u=l*l,h=new Je,c=new Je,d=new Je,p=new Je,f=this&&this.isLineSegments?2:1;if(a.isBufferGeometry){var m=a.index,g=a.attributes.position.array;if(null!==m)for(var v=m.array,y=0,b=v.length-1;y<b;y+=f){var w=v[y],x=v[y+1];if(h.fromArray(g,3*w),c.fromArray(g,3*x),!(e.distanceSqToSegment(h,c,p,d)>u))p.applyMatrix4(this.matrixWorld),(S=n.ray.origin.distanceTo(p))<n.near||S>n.far||r.push({distance:S,point:d.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}else for(y=0,b=g.length/3-1;y<b;y+=f){if(h.fromArray(g,3*y),c.fromArray(g,3*y+3),!(e.distanceSqToSegment(h,c,p,d)>u))p.applyMatrix4(this.matrixWorld),(S=n.ray.origin.distanceTo(p))<n.near||S>n.far||r.push({distance:S,point:d.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}else if(a.isGeometry){var M=a.vertices,T=M.length;for(y=0;y<T-1;y+=f){var S;if(!(e.distanceSqToSegment(M[y],M[y+1],p,d)>u))p.applyMatrix4(this.matrixWorld),(S=n.ray.origin.distanceTo(p))<n.near||S>n.far||r.push({distance:S,point:d.clone().applyMatrix4(this.matrixWorld),index:y,face:null,faceIndex:null,object:this})}}}}}(),copy:function(t){return Bi.prototype.copy.call(this,t),this.geometry.copy(t.geometry),this.material.copy(t.material),this},clone:function(){return(new this.constructor).copy(this)}}),Ro.prototype=Object.assign(Object.create(Io.prototype),{constructor:Ro,isLineSegments:!0,computeLineDistances:function(){var t=new Je,e=new Je;return function(){var i=this.geometry;if(i.isBufferGeometry){if(null===i.index){for(var n=i.attributes.position,r=[],o=0,a=n.count;o<a;o+=2)t.fromBufferAttribute(n,o),e.fromBufferAttribute(n,o+1),r[o]=0===o?0:r[o-1],r[o+1]=r[o]+t.distanceTo(e);i.addAttribute("lineDistance",new Qi(r,1))}}else if(i.isGeometry){var s=i.vertices;for(r=i.lineDistances,o=0,a=s.length;o<a;o+=2)t.copy(s[o]),e.copy(s[o+1]),r[o]=0===o?0:r[o-1],r[o+1]=r[o]+t.distanceTo(e)}return this}}()}),No.prototype=Object.assign(Object.create(Io.prototype),{constructor:No,isLineLoop:!0}),ko.prototype=Object.create(xn.prototype),ko.prototype.constructor=ko,ko.prototype.isPointsMaterial=!0,ko.prototype.copy=function(t){return xn.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this},Fo.prototype=Object.assign(Object.create(Bi.prototype),{constructor:Fo,isPoints:!0,raycast:function(){var t=new Ke,e=new Tn,i=new pi;return function(n,r){var o=this,a=this.geometry,s=this.matrixWorld,l=n.params.Points.threshold;if(null===a.boundingSphere&&a.computeBoundingSphere(),i.copy(a.boundingSphere),i.applyMatrix4(s),i.radius+=l,!1!==n.ray.intersectsSphere(i)){t.getInverse(s),e.copy(n.ray).applyMatrix4(t);var u=l/((this.scale.x+this.scale.y+this.scale.z)/3),h=u*u,c=new Je,d=new Je;if(a.isBufferGeometry){var p=a.index,f=a.attributes.position.array;if(null!==p)for(var m=p.array,g=0,v=m.length;g<v;g++){var y=m[g];c.fromArray(f,3*y),x(c,y)}else{g=0;for(var b=f.length/3;g<b;g++)c.fromArray(f,3*g),x(c,g)}}else{var w=a.vertices;for(g=0,b=w.length;g<b;g++)x(w[g],g)}}function x(t,i){var a=e.distanceSqToPoint(t);if(a<h){e.closestPointToPoint(t,d),d.applyMatrix4(s);var l=n.ray.origin.distanceTo(d);if(l<n.near||l>n.far)return;r.push({distance:l,distanceToRay:Math.sqrt(a),point:d.clone(),index:i,face:null,object:o})}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Bo.prototype=Object.assign(Object.create(si.prototype),{constructor:Bo,isVideoTexture:!0,update:function(){var t=this.image;t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),zo.prototype=Object.create(si.prototype),zo.prototype.constructor=zo,zo.prototype.isCompressedTexture=!0,Uo.prototype=Object.create(si.prototype),Uo.prototype.constructor=Uo,Uo.prototype.isCanvasTexture=!0,Vo.prototype=Object.create(si.prototype),Vo.prototype.constructor=Vo,Vo.prototype.isDepthTexture=!0,jo.prototype=Object.create(nn.prototype),jo.prototype.constructor=jo,Ho.prototype=Object.create(ji.prototype),Ho.prototype.constructor=Ho,Go.prototype=Object.create(nn.prototype),Go.prototype.constructor=Go,Wo.prototype=Object.create(ji.prototype),Wo.prototype.constructor=Wo,qo.prototype=Object.create(nn.prototype),qo.prototype.constructor=qo,Yo.prototype=Object.create(ji.prototype),Yo.prototype.constructor=Yo,Xo.prototype=Object.create(qo.prototype),Xo.prototype.constructor=Xo,Zo.prototype=Object.create(ji.prototype),Zo.prototype.constructor=Zo,Ko.prototype=Object.create(qo.prototype),Ko.prototype.constructor=Ko,Qo.prototype=Object.create(ji.prototype),Qo.prototype.constructor=Qo,Jo.prototype=Object.create(qo.prototype),Jo.prototype.constructor=Jo,$o.prototype=Object.create(ji.prototype),$o.prototype.constructor=$o,ta.prototype=Object.create(qo.prototype),ta.prototype.constructor=ta,ea.prototype=Object.create(ji.prototype),ea.prototype.constructor=ea,ia.prototype=Object.create(nn.prototype),ia.prototype.constructor=ia,na.prototype=Object.create(ji.prototype),na.prototype.constructor=na,ra.prototype=Object.create(nn.prototype),ra.prototype.constructor=ra,oa.prototype=Object.create(ji.prototype),oa.prototype.constructor=oa,aa.prototype=Object.create(nn.prototype),aa.prototype.constructor=aa;var sa=function(t,e,i){i=i||2;var n,r,o,a,s,l,u,h=e&&e.length,c=h?e[0]*i:t.length,d=la(t,0,c,i,!0),p=[];if(!d)return p;if(h&&(d=function(t,e,i,n){var r,o,a,s,l,u=[];for(r=0,o=e.length;r<o;r++)a=e[r]*n,s=r<o-1?e[r+1]*n:t.length,(l=la(t,a,s,n,!1))===l.next&&(l.steiner=!0),u.push(ya(l));for(u.sort(ma),r=0;r<u.length;r++)ga(u[r],i),i=ua(i,i.next);return i}(t,e,d,i)),t.length>80*i){n=o=t[0],r=a=t[1];for(var f=i;f<c;f+=i)(s=t[f])<n&&(n=s),(l=t[f+1])<r&&(r=l),s>o&&(o=s),l>a&&(a=l);u=0!==(u=Math.max(o-n,a-r))?1/u:0}return ha(d,p,i,n,r,u),p};function la(t,e,i,n,r){var o,a;if(r===function(t,e,i,n){for(var r=0,o=e,a=i-n;o<i;o+=n)r+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return r}(t,e,i,n)>0)for(o=e;o<i;o+=n)a=Aa(o,t[o],t[o+1],a);else for(o=i-n;o>=e;o-=n)a=Aa(o,t[o],t[o+1],a);return a&&Ma(a,a.next)&&(Pa(a),a=a.next),a}function ua(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!Ma(n,n.next)&&0!==xa(n.prev,n,n.next))n=n.next;else{if(Pa(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function ha(t,e,i,n,r,o,a){if(t){!a&&o&&function(t,e,i,n){var r=t;do{null===r.z&&(r.z=va(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,n,r,o,a,s,l,u=1;do{for(i=t,t=null,o=null,a=0;i;){for(a++,n=i,s=0,e=0;e<u&&(s++,n=n.nextZ);e++);for(l=u;s>0||l>0&&n;)0!==s&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,s--):(r=n,n=n.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;i=n}o.nextZ=null,u*=2}while(a>1)}(r)}(t,n,r,o);for(var s,l,u=t;t.prev!==t.next;)if(s=t.prev,l=t.next,o?da(t,n,r,o):ca(t))e.push(s.i/i),e.push(t.i/i),e.push(l.i/i),Pa(t),t=l.next,u=l.next;else if((t=l)===u){a?1===a?ha(t=pa(t,e,i),e,i,n,r,o,2):2===a&&fa(t,e,i,n,r,o):ha(ua(t),e,i,n,r,o,1);break}}}function ca(t){var e=t.prev,i=t,n=t.next;if(xa(e,i,n)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(ba(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&xa(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function da(t,e,i,n){var r=t.prev,o=t,a=t.next;if(xa(r,o,a)>=0)return!1;for(var s=r.x<o.x?r.x<a.x?r.x:a.x:o.x<a.x?o.x:a.x,l=r.y<o.y?r.y<a.y?r.y:a.y:o.y<a.y?o.y:a.y,u=r.x>o.x?r.x>a.x?r.x:a.x:o.x>a.x?o.x:a.x,h=r.y>o.y?r.y>a.y?r.y:a.y:o.y>a.y?o.y:a.y,c=va(s,l,e,i,n),d=va(u,h,e,i,n),p=t.nextZ;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&ba(r.x,r.y,o.x,o.y,a.x,a.y,p.x,p.y)&&xa(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=c;){if(p!==t.prev&&p!==t.next&&ba(r.x,r.y,o.x,o.y,a.x,a.y,p.x,p.y)&&xa(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function pa(t,e,i){var n=t;do{var r=n.prev,o=n.next.next;!Ma(r,o)&&Ta(r,n,n.next,o)&&Sa(r,o)&&Sa(o,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(o.i/i),Pa(n),Pa(n.next),n=t=o),n=n.next}while(n!==t);return n}function fa(t,e,i,n,r,o){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&wa(a,s)){var l=_a(a,s);return a=ua(a,a.next),l=ua(l,l.next),ha(a,e,i,n,r,o),void ha(l,e,i,n,r,o)}s=s.next}a=a.next}while(a!==t)}function ma(t,e){return t.x-e.x}function ga(t,e){if(e=function(t,e){var i,n=e,r=t.x,o=t.y,a=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var s=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>a){if(a=s,s===r){if(o===n.y)return n;if(o===n.next.y)return n.next}i=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!i)return null;if(r===a)return i.prev;var l,u=i,h=i.x,c=i.y,d=1/0;n=i.next;for(;n!==u;)r>=n.x&&n.x>=h&&r!==n.x&&ba(o<c?r:a,o,h,c,o<c?a:r,o,n.x,n.y)&&((l=Math.abs(o-n.y)/(r-n.x))<d||l===d&&n.x>i.x)&&Sa(n,t)&&(i=n,d=l),n=n.next;return i}(t,e)){var i=_a(e,t);ua(i,i.next)}}function va(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function ya(t){var e=t,i=t;do{e.x<i.x&&(i=e),e=e.next}while(e!==t);return i}function ba(t,e,i,n,r,o,a,s){return(r-a)*(e-s)-(t-a)*(o-s)>=0&&(t-a)*(n-s)-(i-a)*(e-s)>=0&&(i-a)*(o-s)-(r-a)*(n-s)>=0}function wa(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&Ta(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&Sa(t,e)&&Sa(e,t)&&function(t,e){var i=t,n=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&r<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)}function xa(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Ma(t,e){return t.x===e.x&&t.y===e.y}function Ta(t,e,i,n){return!!(Ma(t,e)&&Ma(i,n)||Ma(t,n)&&Ma(i,e))||xa(t,e,i)>0!=xa(t,e,n)>0&&xa(i,n,t)>0!=xa(i,n,e)>0}function Sa(t,e){return xa(t.prev,t,t.next)<0?xa(t,e,t.next)>=0&&xa(t,t.prev,e)>=0:xa(t,e,t.prev)<0||xa(t,t.next,e)<0}function _a(t,e){var i=new Ca(t.i,t.x,t.y),n=new Ca(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,o.next=n,n.prev=o,n}function Aa(t,e,i,n){var r=new Ca(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function Pa(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ca(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var Ea={area:function(t){for(var e=t.length,i=0,n=e-1,r=0;r<e;n=r++)i+=t[n].x*t[r].y-t[r].x*t[n].y;return.5*i},isClockWise:function(t){return Ea.area(t)<0},triangulateShape:function(t,e){var i=[],n=[],r=[];Da(t),La(i,t);var o=t.length;e.forEach(Da);for(var a=0;a<e.length;a++)n.push(o),o+=e[a].length,La(i,e[a]);var s=sa(i,n);for(a=0;a<s.length;a+=3)r.push(s.slice(a,a+3));return r}};function Da(t){var e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function La(t,e){for(var i=0;i<e.length;i++)t.push(e[i].x),t.push(e[i].y)}function Oa(t,e){ji.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new Ia(t,e)),this.mergeVertices()}function Ia(t,e){nn.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];for(var i=this,n=[],r=[],o=0,a=t.length;o<a;o++){s(t[o])}function s(t){var o=[],a=void 0!==e.curveSegments?e.curveSegments:12,s=void 0!==e.steps?e.steps:1,l=void 0!==e.depth?e.depth:100,u=void 0===e.bevelEnabled||e.bevelEnabled,h=void 0!==e.bevelThickness?e.bevelThickness:6,c=void 0!==e.bevelSize?e.bevelSize:h-2,d=void 0!==e.bevelSegments?e.bevelSegments:3,p=e.extrudePath,f=void 0!==e.UVGenerator?e.UVGenerator:Ra;void 0!==e.amount&&(l=e.amount);var m,g,v,y,b,w,x,M,T=!1;p&&(m=p.getSpacedPoints(s),T=!0,u=!1,g=p.computeFrenetFrames(s,!1),v=new Je,y=new Je,b=new Je),u||(d=0,h=0,c=0);var S=t.extractPoints(a),_=S.shape,A=S.holes;if(!Ea.isClockWise(_))for(_=_.reverse(),x=0,M=A.length;x<M;x++)w=A[x],Ea.isClockWise(w)&&(A[x]=w.reverse());var P=Ea.triangulateShape(_,A),C=_;for(x=0,M=A.length;x<M;x++)w=A[x],_=_.concat(w);function E(t,e,i){return e.clone().multiplyScalar(i).add(t)}var D,L,O,I,R,N,k=_.length,F=P.length;function B(t,e,i){var n,r,o,a=t.x-e.x,s=t.y-e.y,l=i.x-t.x,u=i.y-t.y,h=a*a+s*s,c=a*u-s*l;if(Math.abs(c)>Number.EPSILON){var d=Math.sqrt(h),p=Math.sqrt(l*l+u*u),f=e.x-s/d,m=e.y+a/d,g=((i.x-u/p-f)*u-(i.y+l/p-m)*l)/(a*u-s*l),v=(n=f+a*g-t.x)*n+(r=m+s*g-t.y)*r;if(v<=2)return new Ze(n,r);o=Math.sqrt(v/2)}else{var y=!1;a>Number.EPSILON?l>Number.EPSILON&&(y=!0):a<-Number.EPSILON?l<-Number.EPSILON&&(y=!0):Math.sign(s)===Math.sign(u)&&(y=!0),y?(n=-s,r=a,o=Math.sqrt(h)):(n=a,r=s,o=Math.sqrt(h/2))}return new Ze(n/o,r/o)}for(var z=[],U=0,V=C.length,j=V-1,H=U+1;U<V;U++,j++,H++)j===V&&(j=0),H===V&&(H=0),z[U]=B(C[U],C[j],C[H]);var G,W,q=[],Y=z.concat();for(x=0,M=A.length;x<M;x++){for(w=A[x],G=[],U=0,j=(V=w.length)-1,H=U+1;U<V;U++,j++,H++)j===V&&(j=0),H===V&&(H=0),G[U]=B(w[U],w[j],w[H]);q.push(G),Y=Y.concat(G)}for(D=0;D<d;D++){for(O=D/d,I=h*Math.cos(O*Math.PI/2),L=c*Math.sin(O*Math.PI/2),U=0,V=C.length;U<V;U++)Z((R=E(C[U],z[U],L)).x,R.y,-I);for(x=0,M=A.length;x<M;x++)for(w=A[x],G=q[x],U=0,V=w.length;U<V;U++)Z((R=E(w[U],G[U],L)).x,R.y,-I)}for(L=c,U=0;U<k;U++)R=u?E(_[U],Y[U],L):_[U],T?(y.copy(g.normals[0]).multiplyScalar(R.x),v.copy(g.binormals[0]).multiplyScalar(R.y),b.copy(m[0]).add(y).add(v),Z(b.x,b.y,b.z)):Z(R.x,R.y,0);for(W=1;W<=s;W++)for(U=0;U<k;U++)R=u?E(_[U],Y[U],L):_[U],T?(y.copy(g.normals[W]).multiplyScalar(R.x),v.copy(g.binormals[W]).multiplyScalar(R.y),b.copy(m[W]).add(y).add(v),Z(b.x,b.y,b.z)):Z(R.x,R.y,l/s*W);for(D=d-1;D>=0;D--){for(O=D/d,I=h*Math.cos(O*Math.PI/2),L=c*Math.sin(O*Math.PI/2),U=0,V=C.length;U<V;U++)Z((R=E(C[U],z[U],L)).x,R.y,l+I);for(x=0,M=A.length;x<M;x++)for(w=A[x],G=q[x],U=0,V=w.length;U<V;U++)R=E(w[U],G[U],L),T?Z(R.x,R.y+m[s-1].y,m[s-1].x+I):Z(R.x,R.y,l+I)}function X(t,e){var i,n;for(U=t.length;--U>=0;){i=U,(n=U-1)<0&&(n=t.length-1);var r=0,o=s+2*d;for(r=0;r<o;r++){var a=k*r,l=k*(r+1);Q(e+i+a,e+n+a,e+n+l,e+i+l)}}}function Z(t,e,i){o.push(t),o.push(e),o.push(i)}function K(t,e,r){J(t),J(e),J(r);var o=n.length/3,a=f.generateTopUV(i,n,o-3,o-2,o-1);$(a[0]),$(a[1]),$(a[2])}function Q(t,e,r,o){J(t),J(e),J(o),J(e),J(r),J(o);var a=n.length/3,s=f.generateSideWallUV(i,n,a-6,a-3,a-2,a-1);$(s[0]),$(s[1]),$(s[3]),$(s[1]),$(s[2]),$(s[3])}function J(t){n.push(o[3*t+0]),n.push(o[3*t+1]),n.push(o[3*t+2])}function $(t){r.push(t.x),r.push(t.y)}!function(){var t=n.length/3;if(u){var e=0,r=k*e;for(U=0;U<F;U++)K((N=P[U])[2]+r,N[1]+r,N[0]+r);for(r=k*(e=s+2*d),U=0;U<F;U++)K((N=P[U])[0]+r,N[1]+r,N[2]+r)}else{for(U=0;U<F;U++)K((N=P[U])[2],N[1],N[0]);for(U=0;U<F;U++)K((N=P[U])[0]+k*s,N[1]+k*s,N[2]+k*s)}i.addGroup(t,n.length/3-t,0)}(),function(){var t=n.length/3,e=0;for(X(C,e),e+=C.length,x=0,M=A.length;x<M;x++)X(w=A[x],e),e+=w.length;i.addGroup(t,n.length/3-t,1)}()}this.addAttribute("position",new Qi(n,3)),this.addAttribute("uv",new Qi(r,2)),this.computeVertexNormals()}Oa.prototype=Object.create(ji.prototype),Oa.prototype.constructor=Oa,Oa.prototype.toJSON=function(){var t=ji.prototype.toJSON.call(this);return Na(this.parameters.shapes,this.parameters.options,t)},Ia.prototype=Object.create(nn.prototype),Ia.prototype.constructor=Ia,Ia.prototype.toJSON=function(){var t=nn.prototype.toJSON.call(this);return Na(this.parameters.shapes,this.parameters.options,t)};var Ra={generateTopUV:function(t,e,i,n,r){var o=e[3*i],a=e[3*i+1],s=e[3*n],l=e[3*n+1],u=e[3*r],h=e[3*r+1];return[new Ze(o,a),new Ze(s,l),new Ze(u,h)]},generateSideWallUV:function(t,e,i,n,r,o){var a=e[3*i],s=e[3*i+1],l=e[3*i+2],u=e[3*n],h=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*o],g=e[3*o+1],v=e[3*o+2];return Math.abs(s-h)<.01?[new Ze(a,1-l),new Ze(u,1-c),new Ze(d,1-f),new Ze(m,1-v)]:[new Ze(s,1-l),new Ze(h,1-c),new Ze(p,1-f),new Ze(g,1-v)]}};function Na(t,e,i){if(i.shapes=[],Array.isArray(t))for(var n=0,r=t.length;n<r;n++){var o=t[n];i.shapes.push(o.uuid)}else i.shapes.push(t.uuid);return void 0!==e.extrudePath&&(i.options.extrudePath=e.extrudePath.toJSON()),i}function ka(t,e){ji.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new Fa(t,e)),this.mergeVertices()}function Fa(t,e){var i=(e=e||{}).font;if(!i||!i.isFont)return new ji;var n=i.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),Ia.call(this,n,e),this.type="TextBufferGeometry"}function Ba(t,e,i,n,r,o,a){ji.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:n,phiLength:r,thetaStart:o,thetaLength:a},this.fromBufferGeometry(new za(t,e,i,n,r,o,a)),this.mergeVertices()}function za(t,e,i,n,r,o,a){nn.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:n,phiLength:r,thetaStart:o,thetaLength:a},t=t||1,e=Math.max(3,Math.floor(e)||8),i=Math.max(2,Math.floor(i)||6),n=void 0!==n?n:0,r=void 0!==r?r:2*Math.PI;var s,l,u=(o=void 0!==o?o:0)+(a=void 0!==a?a:Math.PI),h=0,c=[],d=new Je,p=new Je,f=[],m=[],g=[],v=[];for(l=0;l<=i;l++){var y=[],b=l/i;for(s=0;s<=e;s++){var w=s/e;d.x=-t*Math.cos(n+w*r)*Math.sin(o+b*a),d.y=t*Math.cos(o+b*a),d.z=t*Math.sin(n+w*r)*Math.sin(o+b*a),m.push(d.x,d.y,d.z),p.set(d.x,d.y,d.z).normalize(),g.push(p.x,p.y,p.z),v.push(w,1-b),y.push(h++)}c.push(y)}for(l=0;l<i;l++)for(s=0;s<e;s++){var x=c[l][s+1],M=c[l][s],T=c[l+1][s],S=c[l+1][s+1];(0!==l||o>0)&&f.push(x,M,S),(l!==i-1||u<Math.PI)&&f.push(M,T,S)}this.setIndex(f),this.addAttribute("position",new Qi(m,3)),this.addAttribute("normal",new Qi(g,3)),this.addAttribute("uv",new Qi(v,2))}function Ua(t,e,i,n,r,o){ji.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:o},this.fromBufferGeometry(new Va(t,e,i,n,r,o)),this.mergeVertices()}function Va(t,e,i,n,r,o){nn.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:i,phiSegments:n,thetaStart:r,thetaLength:o},t=t||.5,e=e||1,r=void 0!==r?r:0,o=void 0!==o?o:2*Math.PI,i=void 0!==i?Math.max(3,i):8;var a,s,l,u=[],h=[],c=[],d=[],p=t,f=(e-t)/(n=void 0!==n?Math.max(1,n):1),m=new Je,g=new Ze;for(s=0;s<=n;s++){for(l=0;l<=i;l++)a=r+l/i*o,m.x=p*Math.cos(a),m.y=p*Math.sin(a),h.push(m.x,m.y,m.z),c.push(0,0,1),g.x=(m.x/e+1)/2,g.y=(m.y/e+1)/2,d.push(g.x,g.y);p+=f}for(s=0;s<n;s++){var v=s*(i+1);for(l=0;l<i;l++){var y=a=l+v,b=a+i+1,w=a+i+2,x=a+1;u.push(y,b,x),u.push(b,w,x)}}this.setIndex(u),this.addAttribute("position",new Qi(h,3)),this.addAttribute("normal",new Qi(c,3)),this.addAttribute("uv",new Qi(d,2))}function ja(t,e,i,n){ji.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:n},this.fromBufferGeometry(new Ha(t,e,i,n)),this.mergeVertices()}function Ha(t,e,i,n){nn.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:n},e=Math.floor(e)||12,i=i||0,n=n||2*Math.PI,n=Xe.clamp(n,0,2*Math.PI);var r,o,a,s=[],l=[],u=[],h=1/e,c=new Je,d=new Ze;for(o=0;o<=e;o++){var p=i+o*h*n,f=Math.sin(p),m=Math.cos(p);for(a=0;a<=t.length-1;a++)c.x=t[a].x*f,c.y=t[a].y,c.z=t[a].x*m,l.push(c.x,c.y,c.z),d.x=o/e,d.y=a/(t.length-1),u.push(d.x,d.y)}for(o=0;o<e;o++)for(a=0;a<t.length-1;a++){var g=r=a+o*t.length,v=r+t.length,y=r+t.length+1,b=r+1;s.push(g,v,b),s.push(v,y,b)}if(this.setIndex(s),this.addAttribute("position",new Qi(l,3)),this.addAttribute("uv",new Qi(u,2)),this.computeVertexNormals(),n===2*Math.PI){var w=this.attributes.normal.array,x=new Je,M=new Je,T=new Je;for(r=e*t.length*3,o=0,a=0;o<t.length;o++,a+=3)x.x=w[a+0],x.y=w[a+1],x.z=w[a+2],M.x=w[r+a+0],M.y=w[r+a+1],M.z=w[r+a+2],T.addVectors(x,M).normalize(),w[a+0]=w[r+a+0]=T.x,w[a+1]=w[r+a+1]=T.y,w[a+2]=w[r+a+2]=T.z}}function Ga(t,e){ji.call(this),this.type="ShapeGeometry","object"==typeof e&&(e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new Wa(t,e)),this.mergeVertices()}function Wa(t,e){nn.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:e},e=e||12;var i=[],n=[],r=[],o=[],a=0,s=0;if(!1===Array.isArray(t))u(t);else for(var l=0;l<t.length;l++)u(t[l]),this.addGroup(a,s,l),a+=s,s=0;function u(t){var a,l,u,h=n.length/3,c=t.extractPoints(e),d=c.shape,p=c.holes;for(!1===Ea.isClockWise(d)&&(d=d.reverse()),a=0,l=p.length;a<l;a++)u=p[a],!0===Ea.isClockWise(u)&&(p[a]=u.reverse());var f=Ea.triangulateShape(d,p);for(a=0,l=p.length;a<l;a++)u=p[a],d=d.concat(u);for(a=0,l=d.length;a<l;a++){var m=d[a];n.push(m.x,m.y,0),r.push(0,0,1),o.push(m.x,m.y)}for(a=0,l=f.length;a<l;a++){var g=f[a],v=g[0]+h,y=g[1]+h,b=g[2]+h;i.push(v,y,b),s+=3}}this.setIndex(i),this.addAttribute("position",new Qi(n,3)),this.addAttribute("normal",new Qi(r,3)),this.addAttribute("uv",new Qi(o,2))}function qa(t,e){if(e.shapes=[],Array.isArray(t))for(var i=0,n=t.length;i<n;i++){var r=t[i];e.shapes.push(r.uuid)}else e.shapes.push(t.uuid);return e}function Ya(t,e){nn.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;var i,n,r,o,a=[],s=Math.cos(Xe.DEG2RAD*e),l=[0,0],u={},h=["a","b","c"];t.isBufferGeometry?(o=new ji).fromBufferGeometry(t):o=t.clone(),o.mergeVertices(),o.computeFaceNormals();for(var c=o.vertices,d=o.faces,p=0,f=d.length;p<f;p++)for(var m=d[p],g=0;g<3;g++)i=m[h[g]],n=m[h[(g+1)%3]],l[0]=Math.min(i,n),l[1]=Math.max(i,n),void 0===u[r=l[0]+","+l[1]]?u[r]={index1:l[0],index2:l[1],face1:p,face2:void 0}:u[r].face2=p;for(r in u){var v=u[r];if(void 0===v.face2||d[v.face1].normal.dot(d[v.face2].normal)<=s){var y=c[v.index1];a.push(y.x,y.y,y.z),y=c[v.index2],a.push(y.x,y.y,y.z)}}this.addAttribute("position",new Qi(a,3))}function Xa(t,e,i,n,r,o,a,s){ji.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:n,heightSegments:r,openEnded:o,thetaStart:a,thetaLength:s},this.fromBufferGeometry(new Za(t,e,i,n,r,o,a,s)),this.mergeVertices()}function Za(t,e,i,n,r,o,a,s){nn.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:n,heightSegments:r,openEnded:o,thetaStart:a,thetaLength:s};var l=this;t=void 0!==t?t:1,e=void 0!==e?e:1,i=i||1,n=Math.floor(n)||8,r=Math.floor(r)||1,o=void 0!==o&&o,a=void 0!==a?a:0,s=void 0!==s?s:2*Math.PI;var u=[],h=[],c=[],d=[],p=0,f=[],m=i/2,g=0;function v(i){var r,o,f,v=new Ze,y=new Je,b=0,w=!0===i?t:e,x=!0===i?1:-1;for(o=p,r=1;r<=n;r++)h.push(0,m*x,0),c.push(0,x,0),d.push(.5,.5),p++;for(f=p,r=0;r<=n;r++){var M=r/n*s+a,T=Math.cos(M),S=Math.sin(M);y.x=w*S,y.y=m*x,y.z=w*T,h.push(y.x,y.y,y.z),c.push(0,x,0),v.x=.5*T+.5,v.y=.5*S*x+.5,d.push(v.x,v.y),p++}for(r=0;r<n;r++){var _=o+r,A=f+r;!0===i?u.push(A,A+1,_):u.push(A+1,A,_),b+=3}l.addGroup(g,b,!0===i?1:2),g+=b}!function(){var o,v,y=new Je,b=new Je,w=0,x=(e-t)/i;for(v=0;v<=r;v++){var M=[],T=v/r,S=T*(e-t)+t;for(o=0;o<=n;o++){var _=o/n,A=_*s+a,P=Math.sin(A),C=Math.cos(A);b.x=S*P,b.y=-T*i+m,b.z=S*C,h.push(b.x,b.y,b.z),y.set(P,x,C).normalize(),c.push(y.x,y.y,y.z),d.push(_,1-T),M.push(p++)}f.push(M)}for(o=0;o<n;o++)for(v=0;v<r;v++){var E=f[v][o],D=f[v+1][o],L=f[v+1][o+1],O=f[v][o+1];u.push(E,D,O),u.push(D,L,O),w+=6}l.addGroup(g,w,0),g+=w}(),!1===o&&(t>0&&v(!0),e>0&&v(!1)),this.setIndex(u),this.addAttribute("position",new Qi(h,3)),this.addAttribute("normal",new Qi(c,3)),this.addAttribute("uv",new Qi(d,2))}function Ka(t,e,i,n,r,o,a){Xa.call(this,0,t,e,i,n,r,o,a),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:o,thetaLength:a}}function Qa(t,e,i,n,r,o,a){Za.call(this,0,t,e,i,n,r,o,a),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:i,heightSegments:n,openEnded:r,thetaStart:o,thetaLength:a}}function Ja(t,e,i,n){ji.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:n},this.fromBufferGeometry(new $a(t,e,i,n)),this.mergeVertices()}function $a(t,e,i,n){nn.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:n},t=t||1,e=void 0!==e?Math.max(3,e):8,i=void 0!==i?i:0,n=void 0!==n?n:2*Math.PI;var r,o,a=[],s=[],l=[],u=[],h=new Je,c=new Ze;for(s.push(0,0,0),l.push(0,0,1),u.push(.5,.5),o=0,r=3;o<=e;o++,r+=3){var d=i+o/e*n;h.x=t*Math.cos(d),h.y=t*Math.sin(d),s.push(h.x,h.y,h.z),l.push(0,0,1),c.x=(s[r]/t+1)/2,c.y=(s[r+1]/t+1)/2,u.push(c.x,c.y)}for(r=1;r<=e;r++)a.push(r,r+1,0);this.setIndex(a),this.addAttribute("position",new Qi(s,3)),this.addAttribute("normal",new Qi(l,3)),this.addAttribute("uv",new Qi(u,2))}ka.prototype=Object.create(ji.prototype),ka.prototype.constructor=ka,Fa.prototype=Object.create(Ia.prototype),Fa.prototype.constructor=Fa,Ba.prototype=Object.create(ji.prototype),Ba.prototype.constructor=Ba,za.prototype=Object.create(nn.prototype),za.prototype.constructor=za,Ua.prototype=Object.create(ji.prototype),Ua.prototype.constructor=Ua,Va.prototype=Object.create(nn.prototype),Va.prototype.constructor=Va,ja.prototype=Object.create(ji.prototype),ja.prototype.constructor=ja,Ha.prototype=Object.create(nn.prototype),Ha.prototype.constructor=Ha,Ga.prototype=Object.create(ji.prototype),Ga.prototype.constructor=Ga,Ga.prototype.toJSON=function(){var t=ji.prototype.toJSON.call(this);return qa(this.parameters.shapes,t)},Wa.prototype=Object.create(nn.prototype),Wa.prototype.constructor=Wa,Wa.prototype.toJSON=function(){var t=nn.prototype.toJSON.call(this);return qa(this.parameters.shapes,t)},Ya.prototype=Object.create(nn.prototype),Ya.prototype.constructor=Ya,Xa.prototype=Object.create(ji.prototype),Xa.prototype.constructor=Xa,Za.prototype=Object.create(nn.prototype),Za.prototype.constructor=Za,Ka.prototype=Object.create(Xa.prototype),Ka.prototype.constructor=Ka,Qa.prototype=Object.create(Za.prototype),Qa.prototype.constructor=Qa,Ja.prototype=Object.create(ji.prototype),Ja.prototype.constructor=Ja,$a.prototype=Object.create(nn.prototype),$a.prototype.constructor=$a;var ts=Object.freeze({WireframeGeometry:jo,ParametricGeometry:Ho,ParametricBufferGeometry:Go,TetrahedronGeometry:Yo,TetrahedronBufferGeometry:Xo,OctahedronGeometry:Zo,OctahedronBufferGeometry:Ko,IcosahedronGeometry:Qo,IcosahedronBufferGeometry:Jo,DodecahedronGeometry:$o,DodecahedronBufferGeometry:ta,PolyhedronGeometry:Wo,PolyhedronBufferGeometry:qo,TubeGeometry:ea,TubeBufferGeometry:ia,TorusKnotGeometry:na,TorusKnotBufferGeometry:ra,TorusGeometry:oa,TorusBufferGeometry:aa,TextGeometry:ka,TextBufferGeometry:Fa,SphereGeometry:Ba,SphereBufferGeometry:za,RingGeometry:Ua,RingBufferGeometry:Va,PlaneGeometry:an,PlaneBufferGeometry:sn,LatheGeometry:ja,LatheBufferGeometry:Ha,ShapeGeometry:Ga,ShapeBufferGeometry:Wa,ExtrudeGeometry:Oa,ExtrudeBufferGeometry:Ia,EdgesGeometry:Ya,ConeGeometry:Ka,ConeBufferGeometry:Qa,CylinderGeometry:Xa,CylinderBufferGeometry:Za,CircleGeometry:Ja,CircleBufferGeometry:$a,BoxGeometry:rn,BoxBufferGeometry:on});function es(t){xn.call(this),this.type="ShadowMaterial",this.color=new Si(0),this.transparent=!0,this.setValues(t)}function is(t){Mn.call(this,t),this.type="RawShaderMaterial"}function ns(t){xn.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new Si(16777215),this.roughness=.5,this.metalness=.5,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Si(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qe,this.normalScale=new Ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapIntensity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function rs(t){ns.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(t)}function os(t){xn.call(this),this.type="MeshPhongMaterial",this.color=new Si(16777215),this.specular=new Si(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Si(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qe,this.normalScale=new Ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=lt,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function as(t){os.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(t)}function ss(t){xn.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qe,this.normalScale=new Ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function ls(t){xn.call(this),this.type="MeshLambertMaterial",this.color=new Si(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Si(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=lt,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function us(t){xn.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Si(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=qe,this.normalScale=new Ze(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.lights=!1,this.setValues(t)}function hs(t){Oo.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}es.prototype=Object.create(xn.prototype),es.prototype.constructor=es,es.prototype.isShadowMaterial=!0,es.prototype.copy=function(t){return xn.prototype.copy.call(this,t),this.color.copy(t.color),this},is.prototype=Object.create(Mn.prototype),is.prototype.constructor=is,is.prototype.isRawShaderMaterial=!0,ns.prototype=Object.create(xn.prototype),ns.prototype.constructor=ns,ns.prototype.isMeshStandardMaterial=!0,ns.prototype.copy=function(t){return xn.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},rs.prototype=Object.create(ns.prototype),rs.prototype.constructor=rs,rs.prototype.isMeshPhysicalMaterial=!0,rs.prototype.copy=function(t){return ns.prototype.copy.call(this,t),this.defines={PHYSICAL:""},this.reflectivity=t.reflectivity,this.clearCoat=t.clearCoat,this.clearCoatRoughness=t.clearCoatRoughness,this},os.prototype=Object.create(xn.prototype),os.prototype.constructor=os,os.prototype.isMeshPhongMaterial=!0,os.prototype.copy=function(t){return xn.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},as.prototype=Object.create(os.prototype),as.prototype.constructor=as,as.prototype.isMeshToonMaterial=!0,as.prototype.copy=function(t){return os.prototype.copy.call(this,t),this.gradientMap=t.gradientMap,this},ss.prototype=Object.create(xn.prototype),ss.prototype.constructor=ss,ss.prototype.isMeshNormalMaterial=!0,ss.prototype.copy=function(t){return xn.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},ls.prototype=Object.create(xn.prototype),ls.prototype.constructor=ls,ls.prototype.isMeshLambertMaterial=!0,ls.prototype.copy=function(t){return xn.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},us.prototype=Object.create(xn.prototype),us.prototype.constructor=us,us.prototype.isMeshMatcapMaterial=!0,us.prototype.copy=function(t){return xn.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},hs.prototype=Object.create(Oo.prototype),hs.prototype.constructor=hs,hs.prototype.isLineDashedMaterial=!0,hs.prototype.copy=function(t){return Oo.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var cs=Object.freeze({ShadowMaterial:es,SpriteMaterial:Ao,RawShaderMaterial:is,ShaderMaterial:Mn,PointsMaterial:ko,MeshPhysicalMaterial:rs,MeshStandardMaterial:ns,MeshPhongMaterial:os,MeshToonMaterial:as,MeshNormalMaterial:ss,MeshLambertMaterial:ls,MeshDepthMaterial:Jr,MeshDistanceMaterial:$r,MeshBasicMaterial:_n,MeshMatcapMaterial:us,LineDashedMaterial:hs,LineBasicMaterial:Oo,Material:xn}),ds={arraySlice:function(t,e,i){return ds.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==i?i:t.length)):t.slice(e,i)},convertArray:function(t,e,i){return!t||!i&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){for(var e=t.length,i=new Array(e),n=0;n!==e;++n)i[n]=n;return i.sort((function(e,i){return t[e]-t[i]})),i},sortedArray:function(t,e,i){for(var n=t.length,r=new t.constructor(n),o=0,a=0;a!==n;++o)for(var s=i[o]*e,l=0;l!==e;++l)r[a++]=t[s+l];return r},flattenJSON:function(t,e,i,n){for(var r=1,o=t[0];void 0!==o&&void 0===o[n];)o=t[r++];if(void 0!==o){var a=o[n];if(void 0!==a)if(Array.isArray(a))do{void 0!==(a=o[n])&&(e.push(o.time),i.push.apply(i,a)),o=t[r++]}while(void 0!==o);else if(void 0!==a.toArray)do{void 0!==(a=o[n])&&(e.push(o.time),a.toArray(i,i.length)),o=t[r++]}while(void 0!==o);else do{void 0!==(a=o[n])&&(e.push(o.time),i.push(a)),o=t[r++]}while(void 0!==o)}}};function ps(t,e,i,n){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==n?n:new e.constructor(i),this.sampleValues=e,this.valueSize=i}function fs(t,e,i,n){ps.call(this,t,e,i,n),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function ms(t,e,i,n){ps.call(this,t,e,i,n)}function gs(t,e,i,n){ps.call(this,t,e,i,n)}function vs(t,e,i,n){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=ds.convertArray(e,this.TimeBufferType),this.values=ds.convertArray(i,this.ValueBufferType),this.setInterpolation(n||this.DefaultInterpolation)}function ys(t,e,i){vs.call(this,t,e,i)}function bs(t,e,i,n){vs.call(this,t,e,i,n)}function ws(t,e,i,n){vs.call(this,t,e,i,n)}function xs(t,e,i,n){ps.call(this,t,e,i,n)}function Ms(t,e,i,n){vs.call(this,t,e,i,n)}function Ts(t,e,i,n){vs.call(this,t,e,i,n)}function Ss(t,e,i,n){vs.call(this,t,e,i,n)}function _s(t,e,i){this.name=t,this.tracks=i,this.duration=void 0!==e?e:-1,this.uuid=Xe.generateUUID(),this.duration<0&&this.resetDuration()}function As(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");var e=function(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ws;case"vector":case"vector2":case"vector3":case"vector4":return Ss;case"color":return bs;case"quaternion":return Ms;case"bool":case"boolean":return ys;case"string":return Ts}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}(t.type);if(void 0===t.times){var i=[],n=[];ds.flattenJSON(t.keys,i,n,"value"),t.times=i,t.values=n}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}Object.assign(ps.prototype,{evaluate:function(t){var e=this.parameterPositions,i=this._cachedIndex,n=e[i],r=e[i-1];t:{e:{var o;i:{n:if(!(t<n)){for(var a=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===a)break;if(r=n,t<(n=e[++i]))break e}o=e.length;break i}if(t>=r)break t;var s=e[1];t<s&&(i=2,r=s);for(a=i-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,n);if(i===a)break;if(n=r,t>=(r=e[--i-1]))break e}o=i,i=0}for(;i<o;){var l=i+o>>>1;t<e[l]?o=l:i=l+1}if(n=e[i],void 0===(r=e[i-1]))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)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){for(var e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=t*n,o=0;o!==n;++o)e[o]=i[r+o];return e},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(ps.prototype,{beforeStart_:ps.prototype.copySampleValue_,afterEnd_:ps.prototype.copySampleValue_}),fs.prototype=Object.assign(Object.create(ps.prototype),{constructor:fs,DefaultSettings_:{endingStart:De,endingEnd:De},intervalChanged_:function(t,e,i){var n=this.parameterPositions,r=t-2,o=t+1,a=n[r],s=n[o];if(void 0===a)switch(this.getSettings_().endingStart){case Le:r=t,a=2*e-i;break;case Oe:a=e+n[r=n.length-2]-n[r+1];break;default:r=t,a=i}if(void 0===s)switch(this.getSettings_().endingEnd){case Le:o=t,s=2*i-e;break;case Oe:o=1,s=i+n[1]-n[0];break;default:o=t-1,s=e}var l=.5*(i-e),u=this.valueSize;this._weightPrev=l/(e-a),this._weightNext=l/(s-i),this._offsetPrev=r*u,this._offsetNext=o*u},interpolate_:function(t,e,i,n){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,l=s-a,u=this._offsetPrev,h=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,b=d*m-d*f,w=0;w!==a;++w)r[w]=g*o[u+w]+v*o[l+w]+y*o[s+w]+b*o[h+w];return r}}),ms.prototype=Object.assign(Object.create(ps.prototype),{constructor:ms,interpolate_:function(t,e,i,n){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,l=s-a,u=(i-e)/(n-e),h=1-u,c=0;c!==a;++c)r[c]=o[l+c]*h+o[s+c]*u;return r}}),gs.prototype=Object.assign(Object.create(ps.prototype),{constructor:gs,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(vs,{toJSON:function(t){var e,i=t.constructor;if(void 0!==i.toJSON)e=i.toJSON(t);else{e={name:t.name,times:ds.convertArray(t.times,Array),values:ds.convertArray(t.values,Array)};var n=t.getInterpolation();n!==t.DefaultInterpolation&&(e.interpolation=n)}return e.type=t.ValueTypeName,e}}),Object.assign(vs.prototype,{constructor:vs,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:Ce,InterpolantFactoryMethodDiscrete:function(t){return new gs(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new ms(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new fs(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){var e;switch(t){case Pe:e=this.InterpolantFactoryMethodDiscrete;break;case Ce:e=this.InterpolantFactoryMethodLinear;break;case Ee:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){var i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(i);this.setInterpolation(this.DefaultInterpolation)}return this}return this.createInterpolant=e,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Pe;case this.InterpolantFactoryMethodLinear:return Ce;case this.InterpolantFactoryMethodSmooth:return Ee}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t)for(var e=this.times,i=0,n=e.length;i!==n;++i)e[i]+=t;return this},scale:function(t){if(1!==t)for(var e=this.times,i=0,n=e.length;i!==n;++i)e[i]*=t;return this},trim:function(t,e){for(var i=this.times,n=i.length,r=0,o=n-1;r!==n&&i[r]<t;)++r;for(;-1!==o&&i[o]>e;)--o;if(++o,0!==r||o!==n){r>=o&&(r=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=ds.arraySlice(i,r,o),this.values=ds.arraySlice(this.values,r*a,o*a)}return this},validate:function(){var t=!0,e=this.getValueSize();e-Math.floor(e)!=0&&(t=!1);var i=this.times,n=this.values,r=i.length;0===r&&(t=!1);for(var o=null,a=0;a!==r;a++){var s=i[a];if("number"==typeof s&&isNaN(s)){t=!1;break}if(null!==o&&o>s){t=!1;break}o=s}if(void 0!==n&&ds.isTypedArray(n)){a=0;for(var l=n.length;a!==l;++a){var u=n[a];if(isNaN(u)){t=!1;break}}}return t},optimize:function(){for(var t=this.times,e=this.values,i=this.getValueSize(),n=this.getInterpolation()===Ee,r=1,o=t.length-1,a=1;a<o;++a){var s=!1,l=t[a];if(l!==t[a+1]&&(1!==a||l!==l[0]))if(n)s=!0;else for(var u=a*i,h=u-i,c=u+i,d=0;d!==i;++d){var p=e[u+d];if(p!==e[h+d]||p!==e[c+d]){s=!0;break}}if(s){if(a!==r){t[r]=t[a];var f=a*i,m=r*i;for(d=0;d!==i;++d)e[m+d]=e[f+d]}++r}}if(o>0){t[r]=t[o];for(f=o*i,m=r*i,d=0;d!==i;++d)e[m+d]=e[f+d];++r}return r!==t.length&&(this.times=ds.arraySlice(t,0,r),this.values=ds.arraySlice(e,0,r*i)),this}}),ys.prototype=Object.assign(Object.create(vs.prototype),{constructor:ys,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:Pe,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),bs.prototype=Object.assign(Object.create(vs.prototype),{constructor:bs,ValueTypeName:"color"}),ws.prototype=Object.assign(Object.create(vs.prototype),{constructor:ws,ValueTypeName:"number"}),xs.prototype=Object.assign(Object.create(ps.prototype),{constructor:xs,interpolate_:function(t,e,i,n){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=t*a,l=(i-e)/(n-e),u=s+a;s!==u;s+=4)Qe.slerpFlat(r,0,o,s-a,o,s,l);return r}}),Ms.prototype=Object.assign(Object.create(vs.prototype),{constructor:Ms,ValueTypeName:"quaternion",DefaultInterpolation:Ce,InterpolantFactoryMethodLinear:function(t){return new xs(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),Ts.prototype=Object.assign(Object.create(vs.prototype),{constructor:Ts,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:Pe,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),Ss.prototype=Object.assign(Object.create(vs.prototype),{constructor:Ss,ValueTypeName:"vector"}),Object.assign(_s,{parse:function(t){for(var e=[],i=t.tracks,n=1/(t.fps||1),r=0,o=i.length;r!==o;++r)e.push(As(i[r]).scale(n));return new _s(t.name,t.duration,e)},toJSON:function(t){for(var e=[],i=t.tracks,n={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid},r=0,o=i.length;r!==o;++r)e.push(vs.toJSON(i[r]));return n},CreateFromMorphTargetSequence:function(t,e,i,n){for(var r=e.length,o=[],a=0;a<r;a++){var s=[],l=[];s.push((a+r-1)%r,a,(a+1)%r),l.push(0,1,0);var u=ds.getKeyframeOrder(s);s=ds.sortedArray(s,1,u),l=ds.sortedArray(l,1,u),n||0!==s[0]||(s.push(r),l.push(l[0])),o.push(new ws(".morphTargetInfluences["+e[a].name+"]",s,l).scale(1/i))}return new _s(t,-1,o)},findByName:function(t,e){var i=t;if(!Array.isArray(t)){var n=t;i=n.geometry&&n.geometry.animations||n.animations}for(var r=0;r<i.length;r++)if(i[r].name===e)return i[r];return null},CreateClipsFromMorphTargetSequences:function(t,e,i){for(var n={},r=/^([\w-]*?)([\d]+)$/,o=0,a=t.length;o<a;o++){var s=t[o],l=s.name.match(r);if(l&&l.length>1){var u=n[c=l[1]];u||(n[c]=u=[]),u.push(s)}}var h=[];for(var c in n)h.push(_s.CreateFromMorphTargetSequence(c,n[c],e,i));return h},parseAnimation:function(t,e){if(!t)return null;for(var i=function(t,e,i,n,r){if(0!==i.length){var o=[],a=[];ds.flattenJSON(i,o,a,n),0!==o.length&&r.push(new t(e,o,a))}},n=[],r=t.name||"default",o=t.length||-1,a=t.fps||30,s=t.hierarchy||[],l=0;l<s.length;l++){var u=s[l].keys;if(u&&0!==u.length)if(u[0].morphTargets){for(var h={},c=0;c<u.length;c++)if(u[c].morphTargets)for(var d=0;d<u[c].morphTargets.length;d++)h[u[c].morphTargets[d]]=-1;for(var p in h){var f=[],m=[];for(d=0;d!==u[c].morphTargets.length;++d){var g=u[c];f.push(g.time),m.push(g.morphTarget===p?1:0)}n.push(new ws(".morphTargetInfluence["+p+"]",f,m))}o=h.length*(a||1)}else{var v=".bones["+e[l].name+"]";i(Ss,v+".position",u,"pos",n),i(Ms,v+".quaternion",u,"rot",n),i(Ss,v+".scale",u,"scl",n)}}return 0===n.length?null:new _s(r,o,n)}}),Object.assign(_s.prototype,{resetDuration:function(){for(var t=0,e=0,i=this.tracks.length;e!==i;++e){var n=this.tracks[e];t=Math.max(t,n.times[n.times.length-1])}return this.duration=t,this},trim:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},validate:function(){for(var t=!0,e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t},optimize:function(){for(var t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this}});var Ps={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function Cs(t,e,i){var n=this,r=!1,o=0,a=0,s=void 0;this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(t){a++,!1===r&&void 0!==n.onStart&&n.onStart(t,o,a),r=!0},this.itemEnd=function(t){o++,void 0!==n.onProgress&&n.onProgress(t,o,a),o===a&&(r=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(t){void 0!==n.onError&&n.onError(t)},this.resolveURL=function(t){return s?s(t):t},this.setURLModifier=function(t){return s=t,this}}var Es=new Cs,Ds={};function Ls(t){this.manager=void 0!==t?t:Es}function Os(t){this.manager=void 0!==t?t:Es}function Is(t){this.manager=void 0!==t?t:Es,this._parser=null}function Rs(t){this.manager=void 0!==t?t:Es,this._parser=null}function Ns(t){this.manager=void 0!==t?t:Es}function ks(t){this.manager=void 0!==t?t:Es}function Fs(t){this.manager=void 0!==t?t:Es}function Bs(){this.type="Curve",this.arcLengthDivisions=200}function zs(t,e,i,n,r,o,a,s){Bs.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=i||1,this.yRadius=n||1,this.aStartAngle=r||0,this.aEndAngle=o||2*Math.PI,this.aClockwise=a||!1,this.aRotation=s||0}function Us(t,e,i,n,r,o){zs.call(this,t,e,i,i,n,r,o),this.type="ArcCurve"}function Vs(){var t=0,e=0,i=0,n=0;function r(r,o,a,s){t=r,e=a,i=-3*r+3*o-2*a-s,n=2*r-2*o+a+s}return{initCatmullRom:function(t,e,i,n,o){r(e,i,o*(i-t),o*(n-e))},initNonuniformCatmullRom:function(t,e,i,n,o,a,s){var l=(e-t)/o-(i-t)/(o+a)+(i-e)/a,u=(i-e)/a-(n-e)/(a+s)+(n-i)/s;r(e,i,l*=a,u*=a)},calc:function(r){var o=r*r;return t+e*r+i*o+n*(o*r)}}}Object.assign(Ls.prototype,{load:function(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,o=Ps.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout((function(){e&&e(o),r.manager.itemEnd(t)}),0),o;if(void 0===Ds[t]){var a=t.match(/^data:(.*?)(;base64)?,(.*)$/);if(a){var s=a[1],l=!!a[2],u=a[3];u=decodeURIComponent(u),l&&(u=atob(u));try{var h,c=(this.responseType||"").toLowerCase();switch(c){case"arraybuffer":case"blob":for(var d=new Uint8Array(u.length),p=0;p<u.length;p++)d[p]=u.charCodeAt(p);h="blob"===c?new Blob([d.buffer],{type:s}):d.buffer;break;case"document":var f=new DOMParser;h=f.parseFromString(u,s);break;case"json":h=JSON.parse(u);break;default:h=u}setTimeout((function(){e&&e(h),r.manager.itemEnd(t)}),0)}catch(e){setTimeout((function(){n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)}),0)}}else{Ds[t]=[],Ds[t].push({onLoad:e,onProgress:i,onError:n});var m=new XMLHttpRequest;for(var g in m.open("GET",t,!0),m.addEventListener("load",(function(e){var i=this.response;Ps.add(t,i);var n=Ds[t];if(delete Ds[t],200===this.status||0===this.status){this.status;for(var o=0,a=n.length;o<a;o++){(s=n[o]).onLoad&&s.onLoad(i)}r.manager.itemEnd(t)}else{for(o=0,a=n.length;o<a;o++){var s;(s=n[o]).onError&&s.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}}),!1),m.addEventListener("progress",(function(e){for(var i=Ds[t],n=0,r=i.length;n<r;n++){var o=i[n];o.onProgress&&o.onProgress(e)}}),!1),m.addEventListener("error",(function(e){var i=Ds[t];delete Ds[t];for(var n=0,o=i.length;n<o;n++){var a=i[n];a.onError&&a.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}),!1),m.addEventListener("abort",(function(e){var i=Ds[t];delete Ds[t];for(var n=0,o=i.length;n<o;n++){var a=i[n];a.onError&&a.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}),!1),void 0!==this.responseType&&(m.responseType=this.responseType),void 0!==this.withCredentials&&(m.withCredentials=this.withCredentials),m.overrideMimeType&&m.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain"),this.requestHeader)m.setRequestHeader(g,this.requestHeader[g]);m.send(null)}return r.manager.itemStart(t),m}Ds[t].push({onLoad:e,onProgress:i,onError:n})},setPath:function(t){return this.path=t,this},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}}),Object.assign(Os.prototype,{load:function(t,e,i,n){var r=this,o=new Ls(r.manager);o.setPath(r.path),o.load(t,(function(t){e(r.parse(JSON.parse(t)))}),i,n)},parse:function(t,e){for(var i=[],n=0;n<t.length;n++){var r=_s.parse(t[n]);i.push(r)}e(i)},setPath:function(t){return this.path=t,this}}),Object.assign(Is.prototype,{load:function(t,e,i,n){var r=this,o=[],a=new zo;a.image=o;var s=new Ls(this.manager);function l(l){s.load(t[l],(function(t){var i=r._parser(t,!0);o[l]={width:i.width,height:i.height,format:i.format,mipmaps:i.mipmaps},6===(u+=1)&&(1===i.mipmapCount&&(a.minFilter=Lt),a.format=i.format,a.needsUpdate=!0,e&&e(a))}),i,n)}if(s.setPath(this.path),s.setResponseType("arraybuffer"),Array.isArray(t))for(var u=0,h=0,c=t.length;h<c;++h)l(h);else s.load(t,(function(t){var i=r._parser(t,!0);if(i.isCubemap)for(var n=i.mipmaps.length/i.mipmapCount,s=0;s<n;s++){o[s]={mipmaps:[]};for(var l=0;l<i.mipmapCount;l++)o[s].mipmaps.push(i.mipmaps[s*i.mipmapCount+l]),o[s].format=i.format,o[s].width=i.width,o[s].height=i.height}else a.image.width=i.width,a.image.height=i.height,a.mipmaps=i.mipmaps;1===i.mipmapCount&&(a.minFilter=Lt),a.format=i.format,a.needsUpdate=!0,e&&e(a)}),i,n);return a},setPath:function(t){return this.path=t,this}}),Object.assign(Rs.prototype,{load:function(t,e,i,n){var r=this,o=new ci,a=new Ls(this.manager);return a.setResponseType("arraybuffer"),a.setPath(this.path),a.load(t,(function(t){var i=r._parser(t);i&&(void 0!==i.image?o.image=i.image:void 0!==i.data&&(o.image.width=i.width,o.image.height=i.height,o.image.data=i.data),o.wrapS=void 0!==i.wrapS?i.wrapS:At,o.wrapT=void 0!==i.wrapT?i.wrapT:At,o.magFilter=void 0!==i.magFilter?i.magFilter:Lt,o.minFilter=void 0!==i.minFilter?i.minFilter:It,o.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,void 0!==i.format&&(o.format=i.format),void 0!==i.type&&(o.type=i.type),void 0!==i.mipmaps&&(o.mipmaps=i.mipmaps),1===i.mipmapCount&&(o.minFilter=Lt),o.needsUpdate=!0,e&&e(o,i))}),i,n),o},setPath:function(t){return this.path=t,this}}),Object.assign(Ns.prototype,{crossOrigin:"anonymous",load:function(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,o=Ps.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout((function(){e&&e(o),r.manager.itemEnd(t)}),0),o;var a=document.createElementNS("http://www.w3.org/1999/xhtml","img");function s(){a.removeEventListener("load",s,!1),a.removeEventListener("error",l,!1),Ps.add(t,this),e&&e(this),r.manager.itemEnd(t)}function l(e){a.removeEventListener("load",s,!1),a.removeEventListener("error",l,!1),n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)}return a.addEventListener("load",s,!1),a.addEventListener("error",l,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(a.crossOrigin=this.crossOrigin),r.manager.itemStart(t),a.src=t,a},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(ks.prototype,{crossOrigin:"anonymous",load:function(t,e,i,n){var r=new Bn,o=new Ns(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);var a=0;function s(i){o.load(t[i],(function(t){r.images[i]=t,6===++a&&(r.needsUpdate=!0,e&&e(r))}),void 0,n)}for(var l=0;l<t.length;++l)s(l);return r},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Fs.prototype,{crossOrigin:"anonymous",load:function(t,e,i,n){var r=new si,o=new Ns(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,(function(i){r.image=i;var n=t.search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/);r.format=n?Yt:Xt,r.needsUpdate=!0,void 0!==e&&e(r)}),i,n),r},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this}}),Object.assign(Bs.prototype,{getPoint:function(){return null},getPointAt:function(t,e){var i=this.getUtoTmapping(t);return this.getPoint(i,e)},getPoints:function(t){void 0===t&&(t=5);for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);for(var e=[],i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e},getLength:function(){var t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i,n=[],r=this.getPoint(0),o=0;for(n.push(0),i=1;i<=t;i++)o+=(e=this.getPoint(i/t)).distanceTo(r),n.push(o),r=e;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){var i,n=this.getLengths(),r=0,o=n.length;i=e||t*n[o-1];for(var a,s=0,l=o-1;s<=l;)if((a=n[r=Math.floor(s+(l-s)/2)]-i)<0)s=r+1;else{if(!(a>0)){l=r;break}l=r-1}if(n[r=l]===i)return r/(o-1);var u=n[r];return(r+(i-u)/(n[r+1]-u))/(o-1)},getTangent:function(t){var e=t-1e-4,i=t+1e-4;e<0&&(e=0),i>1&&(i=1);var n=this.getPoint(e);return this.getPoint(i).clone().sub(n).normalize()},getTangentAt:function(t){var e=this.getUtoTmapping(t);return this.getTangent(e)},computeFrenetFrames:function(t,e){var i,n,r,o=new Je,a=[],s=[],l=[],u=new Je,h=new Ke;for(i=0;i<=t;i++)n=i/t,a[i]=this.getTangentAt(n),a[i].normalize();s[0]=new Je,l[0]=new Je;var c=Number.MAX_VALUE,d=Math.abs(a[0].x),p=Math.abs(a[0].y),f=Math.abs(a[0].z);for(d<=c&&(c=d,o.set(1,0,0)),p<=c&&(c=p,o.set(0,1,0)),f<=c&&o.set(0,0,1),u.crossVectors(a[0],o).normalize(),s[0].crossVectors(a[0],u),l[0].crossVectors(a[0],s[0]),i=1;i<=t;i++)s[i]=s[i-1].clone(),l[i]=l[i-1].clone(),u.crossVectors(a[i-1],a[i]),u.length()>Number.EPSILON&&(u.normalize(),r=Math.acos(Xe.clamp(a[i-1].dot(a[i]),-1,1)),s[i].applyMatrix4(h.makeRotationAxis(u,r))),l[i].crossVectors(a[i],s[i]);if(!0===e)for(r=Math.acos(Xe.clamp(s[0].dot(s[t]),-1,1)),r/=t,a[0].dot(u.crossVectors(s[0],s[t]))>0&&(r=-r),i=1;i<=t;i++)s[i].applyMatrix4(h.makeRotationAxis(a[i],r*i)),l[i].crossVectors(a[i],s[i]);return{tangents:a,normals:s,binormals:l}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){var t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),zs.prototype=Object.create(Bs.prototype),zs.prototype.constructor=zs,zs.prototype.isEllipseCurve=!0,zs.prototype.getPoint=function(t,e){for(var i=e||new Ze,n=2*Math.PI,r=this.aEndAngle-this.aStartAngle,o=Math.abs(r)<Number.EPSILON;r<0;)r+=n;for(;r>n;)r-=n;r<Number.EPSILON&&(r=o?0:n),!0!==this.aClockwise||o||(r===n?r=-n:r-=n);var a=this.aStartAngle+t*r,s=this.aX+this.xRadius*Math.cos(a),l=this.aY+this.yRadius*Math.sin(a);if(0!==this.aRotation){var u=Math.cos(this.aRotation),h=Math.sin(this.aRotation),c=s-this.aX,d=l-this.aY;s=c*u-d*h+this.aX,l=c*h+d*u+this.aY}return i.set(s,l)},zs.prototype.copy=function(t){return Bs.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},zs.prototype.toJSON=function(){var t=Bs.prototype.toJSON.call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t},zs.prototype.fromJSON=function(t){return Bs.prototype.fromJSON.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},Us.prototype=Object.create(zs.prototype),Us.prototype.constructor=Us,Us.prototype.isArcCurve=!0;var js=new Je,Hs=new Vs,Gs=new Vs,Ws=new Vs;function qs(t,e,i,n){Bs.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||!1,this.curveType=i||"centripetal",this.tension=n||.5}function Ys(t,e,i,n,r){var o=.5*(n-e),a=.5*(r-i),s=t*t;return(2*i-2*n+o+a)*(t*s)+(-3*i+3*n-2*o-a)*s+o*t+i}function Xs(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 Zs(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 Ks(t,e,i,n){Bs.call(this),this.type="CubicBezierCurve",this.v0=t||new Ze,this.v1=e||new Ze,this.v2=i||new Ze,this.v3=n||new Ze}function Qs(t,e,i,n){Bs.call(this),this.type="CubicBezierCurve3",this.v0=t||new Je,this.v1=e||new Je,this.v2=i||new Je,this.v3=n||new Je}function Js(t,e){Bs.call(this),this.type="LineCurve",this.v1=t||new Ze,this.v2=e||new Ze}function $s(t,e){Bs.call(this),this.type="LineCurve3",this.v1=t||new Je,this.v2=e||new Je}function tl(t,e,i){Bs.call(this),this.type="QuadraticBezierCurve",this.v0=t||new Ze,this.v1=e||new Ze,this.v2=i||new Ze}function el(t,e,i){Bs.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new Je,this.v1=e||new Je,this.v2=i||new Je}function il(t){Bs.call(this),this.type="SplineCurve",this.points=t||[]}qs.prototype=Object.create(Bs.prototype),qs.prototype.constructor=qs,qs.prototype.isCatmullRomCurve3=!0,qs.prototype.getPoint=function(t,e){var i,n,r,o,a=e||new Je,s=this.points,l=s.length,u=(l-(this.closed?0:1))*t,h=Math.floor(u),c=u-h;if(this.closed?h+=h>0?0:(Math.floor(Math.abs(h)/l)+1)*l:0===c&&h===l-1&&(h=l-2,c=1),this.closed||h>0?i=s[(h-1)%l]:(js.subVectors(s[0],s[1]).add(s[0]),i=js),n=s[h%l],r=s[(h+1)%l],this.closed||h+2<l?o=s[(h+2)%l]:(js.subVectors(s[l-1],s[l-2]).add(s[l-1]),o=js),"centripetal"===this.curveType||"chordal"===this.curveType){var d="chordal"===this.curveType?.5:.25,p=Math.pow(i.distanceToSquared(n),d),f=Math.pow(n.distanceToSquared(r),d),m=Math.pow(r.distanceToSquared(o),d);f<1e-4&&(f=1),p<1e-4&&(p=f),m<1e-4&&(m=f),Hs.initNonuniformCatmullRom(i.x,n.x,r.x,o.x,p,f,m),Gs.initNonuniformCatmullRom(i.y,n.y,r.y,o.y,p,f,m),Ws.initNonuniformCatmullRom(i.z,n.z,r.z,o.z,p,f,m)}else"catmullrom"===this.curveType&&(Hs.initCatmullRom(i.x,n.x,r.x,o.x,this.tension),Gs.initCatmullRom(i.y,n.y,r.y,o.y,this.tension),Ws.initCatmullRom(i.z,n.z,r.z,o.z,this.tension));return a.set(Hs.calc(c),Gs.calc(c),Ws.calc(c)),a},qs.prototype.copy=function(t){Bs.prototype.copy.call(this,t),this.points=[];for(var e=0,i=t.points.length;e<i;e++){var n=t.points[e];this.points.push(n.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},qs.prototype.toJSON=function(){var t=Bs.prototype.toJSON.call(this);t.points=[];for(var e=0,i=this.points.length;e<i;e++){var n=this.points[e];t.points.push(n.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},qs.prototype.fromJSON=function(t){Bs.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,i=t.points.length;e<i;e++){var n=t.points[e];this.points.push((new Je).fromArray(n))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},Ks.prototype=Object.create(Bs.prototype),Ks.prototype.constructor=Ks,Ks.prototype.isCubicBezierCurve=!0,Ks.prototype.getPoint=function(t,e){var i=e||new Ze,n=this.v0,r=this.v1,o=this.v2,a=this.v3;return i.set(Zs(t,n.x,r.x,o.x,a.x),Zs(t,n.y,r.y,o.y,a.y)),i},Ks.prototype.copy=function(t){return Bs.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},Ks.prototype.toJSON=function(){var t=Bs.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Ks.prototype.fromJSON=function(t){return Bs.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},Qs.prototype=Object.create(Bs.prototype),Qs.prototype.constructor=Qs,Qs.prototype.isCubicBezierCurve3=!0,Qs.prototype.getPoint=function(t,e){var i=e||new Je,n=this.v0,r=this.v1,o=this.v2,a=this.v3;return i.set(Zs(t,n.x,r.x,o.x,a.x),Zs(t,n.y,r.y,o.y,a.y),Zs(t,n.z,r.z,o.z,a.z)),i},Qs.prototype.copy=function(t){return Bs.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},Qs.prototype.toJSON=function(){var t=Bs.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Qs.prototype.fromJSON=function(t){return Bs.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},Js.prototype=Object.create(Bs.prototype),Js.prototype.constructor=Js,Js.prototype.isLineCurve=!0,Js.prototype.getPoint=function(t,e){var i=e||new Ze;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i},Js.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Js.prototype.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},Js.prototype.copy=function(t){return Bs.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Js.prototype.toJSON=function(){var t=Bs.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Js.prototype.fromJSON=function(t){return Bs.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},$s.prototype=Object.create(Bs.prototype),$s.prototype.constructor=$s,$s.prototype.isLineCurve3=!0,$s.prototype.getPoint=function(t,e){var i=e||new Je;return 1===t?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(t).add(this.v1)),i},$s.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},$s.prototype.copy=function(t){return Bs.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},$s.prototype.toJSON=function(){var t=Bs.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},$s.prototype.fromJSON=function(t){return Bs.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},tl.prototype=Object.create(Bs.prototype),tl.prototype.constructor=tl,tl.prototype.isQuadraticBezierCurve=!0,tl.prototype.getPoint=function(t,e){var i=e||new Ze,n=this.v0,r=this.v1,o=this.v2;return i.set(Xs(t,n.x,r.x,o.x),Xs(t,n.y,r.y,o.y)),i},tl.prototype.copy=function(t){return Bs.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},tl.prototype.toJSON=function(){var t=Bs.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},tl.prototype.fromJSON=function(t){return Bs.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},el.prototype=Object.create(Bs.prototype),el.prototype.constructor=el,el.prototype.isQuadraticBezierCurve3=!0,el.prototype.getPoint=function(t,e){var i=e||new Je,n=this.v0,r=this.v1,o=this.v2;return i.set(Xs(t,n.x,r.x,o.x),Xs(t,n.y,r.y,o.y),Xs(t,n.z,r.z,o.z)),i},el.prototype.copy=function(t){return Bs.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},el.prototype.toJSON=function(){var t=Bs.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},el.prototype.fromJSON=function(t){return Bs.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},il.prototype=Object.create(Bs.prototype),il.prototype.constructor=il,il.prototype.isSplineCurve=!0,il.prototype.getPoint=function(t,e){var i=e||new Ze,n=this.points,r=(n.length-1)*t,o=Math.floor(r),a=r-o,s=n[0===o?o:o-1],l=n[o],u=n[o>n.length-2?n.length-1:o+1],h=n[o>n.length-3?n.length-1:o+2];return i.set(Ys(a,s.x,l.x,u.x,h.x),Ys(a,s.y,l.y,u.y,h.y)),i},il.prototype.copy=function(t){Bs.prototype.copy.call(this,t),this.points=[];for(var e=0,i=t.points.length;e<i;e++){var n=t.points[e];this.points.push(n.clone())}return this},il.prototype.toJSON=function(){var t=Bs.prototype.toJSON.call(this);t.points=[];for(var e=0,i=this.points.length;e<i;e++){var n=this.points[e];t.points.push(n.toArray())}return t},il.prototype.fromJSON=function(t){Bs.prototype.fromJSON.call(this,t),this.points=[];for(var e=0,i=t.points.length;e<i;e++){var n=t.points[e];this.points.push((new Ze).fromArray(n))}return this};var nl=Object.freeze({ArcCurve:Us,CatmullRomCurve3:qs,CubicBezierCurve:Ks,CubicBezierCurve3:Qs,EllipseCurve:zs,LineCurve:Js,LineCurve3:$s,QuadraticBezierCurve:tl,QuadraticBezierCurve3:el,SplineCurve:il});function rl(){Bs.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function ol(t){rl.call(this),this.type="Path",this.currentPoint=new Ze,t&&this.setFromPoints(t)}function al(t){ol.call(this,t),this.uuid=Xe.generateUUID(),this.type="Shape",this.holes=[]}function sl(t,e){Bi.call(this),this.type="Light",this.color=new Si(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function ll(t,e,i){sl.call(this,t,i),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(Bi.DefaultUp),this.updateMatrix(),this.groundColor=new Si(e)}function ul(t){this.camera=t,this.bias=0,this.radius=1,this.mapSize=new Ze(512,512),this.map=null,this.matrix=new Ke}function hl(){ul.call(this,new ao(50,1,.5,500))}function cl(t,e,i,n,r,o){sl.call(this,t,e),this.type="SpotLight",this.position.copy(Bi.DefaultUp),this.updateMatrix(),this.target=new Bi,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==i?i:0,this.angle=void 0!==n?n:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==o?o:1,this.shadow=new hl}function dl(t,e,i,n){sl.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==i?i:0,this.decay=void 0!==n?n:1,this.shadow=new ul(new ao(90,1,.5,500))}function pl(t,e,i,n,r,o){oo.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==t?t:-1,this.right=void 0!==e?e:1,this.top=void 0!==i?i:1,this.bottom=void 0!==n?n:-1,this.near=void 0!==r?r:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}function fl(){ul.call(this,new pl(-5,5,5,-5,.5,500))}function ml(t,e){sl.call(this,t,e),this.type="DirectionalLight",this.position.copy(Bi.DefaultUp),this.updateMatrix(),this.target=new Bi,this.shadow=new fl}function gl(t,e){sl.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function vl(t,e,i,n){sl.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==i?i:10,this.height=void 0!==n?n:10}function yl(t){this.manager=void 0!==t?t:Es,this.textures={}}rl.prototype=Object.assign(Object.create(Bs.prototype),{constructor:rl,add:function(t){this.curves.push(t)},closePath:function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new Js(e,t))},getPoint:function(t){for(var e=t*this.getLength(),i=this.getCurveLengths(),n=0;n<i.length;){if(i[n]>=e){var r=i[n]-e,o=this.curves[n],a=o.getLength(),s=0===a?0:1-r/a;return o.getPointAt(s)}n++}return null},getLength:function(){var t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;for(var t=[],e=0,i=0,n=this.curves.length;i<n;i++)e+=this.curves[i].getLength(),t.push(e);return this.cacheLengths=t,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},getPoints:function(t){t=t||12;for(var e,i=[],n=0,r=this.curves;n<r.length;n++)for(var o=r[n],a=o&&o.isEllipseCurve?2*t:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?t*o.points.length:t,s=o.getPoints(a),l=0;l<s.length;l++){var u=s[l];e&&e.equals(u)||(i.push(u),e=u)}return this.autoClose&&i.length>1&&!i[i.length-1].equals(i[0])&&i.push(i[0]),i},copy:function(t){Bs.prototype.copy.call(this,t),this.curves=[];for(var e=0,i=t.curves.length;e<i;e++){var n=t.curves[e];this.curves.push(n.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){var t=Bs.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(var e=0,i=this.curves.length;e<i;e++){var n=this.curves[e];t.curves.push(n.toJSON())}return t},fromJSON:function(t){Bs.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(var e=0,i=t.curves.length;e<i;e++){var n=t.curves[e];this.curves.push((new nl[n.type]).fromJSON(n))}return this}}),ol.prototype=Object.assign(Object.create(rl.prototype),{constructor:ol,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y)},moveTo:function(t,e){this.currentPoint.set(t,e)},lineTo:function(t,e){var i=new Js(this.currentPoint.clone(),new Ze(t,e));this.curves.push(i),this.currentPoint.set(t,e)},quadraticCurveTo:function(t,e,i,n){var r=new tl(this.currentPoint.clone(),new Ze(t,e),new Ze(i,n));this.curves.push(r),this.currentPoint.set(i,n)},bezierCurveTo:function(t,e,i,n,r,o){var a=new Ks(this.currentPoint.clone(),new Ze(t,e),new Ze(i,n),new Ze(r,o));this.curves.push(a),this.currentPoint.set(r,o)},splineThru:function(t){var e=new il([this.currentPoint.clone()].concat(t));this.curves.push(e),this.currentPoint.copy(t[t.length-1])},arc:function(t,e,i,n,r,o){var a=this.currentPoint.x,s=this.currentPoint.y;this.absarc(t+a,e+s,i,n,r,o)},absarc:function(t,e,i,n,r,o){this.absellipse(t,e,i,i,n,r,o)},ellipse:function(t,e,i,n,r,o,a,s){var l=this.currentPoint.x,u=this.currentPoint.y;this.absellipse(t+l,e+u,i,n,r,o,a,s)},absellipse:function(t,e,i,n,r,o,a,s){var l=new zs(t,e,i,n,r,o,a,s);if(this.curves.length>0){var u=l.getPoint(0);u.equals(this.currentPoint)||this.lineTo(u.x,u.y)}this.curves.push(l);var h=l.getPoint(1);this.currentPoint.copy(h)},copy:function(t){return rl.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){var t=rl.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return rl.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),al.prototype=Object.assign(Object.create(ol.prototype),{constructor:al,getPointsHoles:function(t){for(var e=[],i=0,n=this.holes.length;i<n;i++)e[i]=this.holes[i].getPoints(t);return e},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){ol.prototype.copy.call(this,t),this.holes=[];for(var e=0,i=t.holes.length;e<i;e++){var n=t.holes[e];this.holes.push(n.clone())}return this},toJSON:function(){var t=ol.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(var e=0,i=this.holes.length;e<i;e++){var n=this.holes[e];t.holes.push(n.toJSON())}return t},fromJSON:function(t){ol.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(var e=0,i=t.holes.length;e<i;e++){var n=t.holes[e];this.holes.push((new ol).fromJSON(n))}return this}}),sl.prototype=Object.assign(Object.create(Bi.prototype),{constructor:sl,isLight:!0,copy:function(t){return Bi.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){var e=Bi.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),ll.prototype=Object.assign(Object.create(sl.prototype),{constructor:ll,isHemisphereLight:!0,copy:function(t){return sl.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(ul.prototype,{copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){var t={};return 0!==this.bias&&(t.bias=this.bias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),hl.prototype=Object.assign(Object.create(ul.prototype),{constructor:hl,isSpotLightShadow:!0,update:function(t){var e=this.camera,i=2*Xe.RAD2DEG*t.angle,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())}}),cl.prototype=Object.assign(Object.create(sl.prototype),{constructor:cl,isSpotLight:!0,copy:function(t){return sl.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),dl.prototype=Object.assign(Object.create(sl.prototype),{constructor:dl,isPointLight:!0,copy:function(t){return sl.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),pl.prototype=Object.assign(Object.create(oo.prototype),{constructor:pl,isOrthographicCamera:!0,copy:function(t,e){return oo.prototype.copy.call(this,t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,i,n,r,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=i,this.view.offsetY=n,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){var t=(this.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,r=i-t,o=i+t,a=n+e,s=n-e;if(null!==this.view&&this.view.enabled){var l=this.zoom/(this.view.width/this.view.fullWidth),u=this.zoom/(this.view.height/this.view.fullHeight),h=(this.right-this.left)/this.view.width,c=(this.top-this.bottom)/this.view.height;o=(r+=h*(this.view.offsetX/l))+h*(this.view.width/l),s=(a-=c*(this.view.offsetY/u))-c*(this.view.height/u)}this.projectionMatrix.makeOrthographic(r,o,a,s,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){var e=Bi.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),fl.prototype=Object.assign(Object.create(ul.prototype),{constructor:fl}),ml.prototype=Object.assign(Object.create(sl.prototype),{constructor:ml,isDirectionalLight:!0,copy:function(t){return sl.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),gl.prototype=Object.assign(Object.create(sl.prototype),{constructor:gl,isAmbientLight:!0}),vl.prototype=Object.assign(Object.create(sl.prototype),{constructor:vl,isRectAreaLight:!0,copy:function(t){return sl.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){var e=sl.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}}),Object.assign(yl.prototype,{load:function(t,e,i,n){var r=this,o=new Ls(r.manager);o.setPath(r.path),o.load(t,(function(t){e(r.parse(JSON.parse(t)))}),i,n)},parse:function(t){var e=this.textures;function i(t){return e[t],e[t]}var n=new cs[t.type];if(void 0!==t.uuid&&(n.uuid=t.uuid),void 0!==t.name&&(n.name=t.name),void 0!==t.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.emissive&&n.emissive.setHex(t.emissive),void 0!==t.specular&&n.specular.setHex(t.specular),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.vertexColors&&(n.vertexColors=t.vertexColors),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.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.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.skinning&&(n.skinning=t.skinning),void 0!==t.morphTargets&&(n.morphTargets=t.morphTargets),void 0!==t.dithering&&(n.dithering=t.dithering),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.uniforms)for(var r in t.uniforms){var o=t.uniforms[r];switch(n.uniforms[r]={},o.type){case"t":n.uniforms[r].value=i(o.value);break;case"c":n.uniforms[r].value=(new Si).setHex(o.value);break;case"v2":n.uniforms[r].value=(new Ze).fromArray(o.value);break;case"v3":n.uniforms[r].value=(new Je).fromArray(o.value);break;case"v4":n.uniforms[r].value=(new li).fromArray(o.value);break;case"m4":n.uniforms[r].value=(new Ke).fromArray(o.value);break;default:n.uniforms[r].value=o.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(var a in t.extensions)n.extensions[a]=t.extensions[a];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.alphaMap&&(n.alphaMap=i(t.alphaMap),n.transparent=!0),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){var s=t.normalScale;!1===Array.isArray(s)&&(s=[s,s]),n.normalScale=(new Ze).fromArray(s)}return void 0!==t.displacementMap&&(n.displacementMap=i(t.displacementMap)),void 0!==t.displacementScale&&(n.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(n.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(n.roughnessMap=i(t.roughnessMap)),void 0!==t.metalnessMap&&(n.metalnessMap=i(t.metalnessMap)),void 0!==t.emissiveMap&&(n.emissiveMap=i(t.emissiveMap)),void 0!==t.emissiveIntensity&&(n.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(n.specularMap=i(t.specularMap)),void 0!==t.envMap&&(n.envMap=i(t.envMap)),void 0!==t.envMapIntensity&&(n.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(n.reflectivity=t.reflectivity),void 0!==t.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)),n},setPath:function(t){return this.path=t,this},setTextures:function(t){return this.textures=t,this}});var bl={decodeText:function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);for(var e="",i=0,n=t.length;i<n;i++)e+=String.fromCharCode(t[i]);return decodeURIComponent(escape(e))},extractUrlBase:function(t){var e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)}};function wl(t){this.manager=void 0!==t?t:Es}Object.assign(wl.prototype,{load:function(t,e,i,n){var r=this,o=new Ls(r.manager);o.setPath(r.path),o.load(t,(function(t){e(r.parse(JSON.parse(t)))}),i,n)},parse:function(t){var e=new nn,i=t.data.index;if(void 0!==i){var n=new xl[i.type](i.array);e.setIndex(new Hi(n,1))}var r=t.data.attributes;for(var o in r){var a=r[o];n=new xl[a.type](a.array);e.addAttribute(o,new Hi(n,a.itemSize,a.normalized))}var s=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==s)for(var l=0,u=s.length;l!==u;++l){var h=s[l];e.addGroup(h.start,h.count,h.materialIndex)}var c=t.data.boundingSphere;if(void 0!==c){var d=new Je;void 0!==c.center&&d.fromArray(c.center),e.boundingSphere=new pi(d,c.radius)}return t.name&&(e.name=t.name),t.userData&&(e.userData=t.userData),e},setPath:function(t){return this.path=t,this}});var xl={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function Ml(t){this.manager=void 0!==t?t:Es,this.resourcePath=""}Object.assign(Ml.prototype,{crossOrigin:"anonymous",load:function(t,e,i,n){var r=this,o=void 0===this.path?bl.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||o;var a=new Ls(r.manager);a.setPath(this.path),a.load(t,(function(t){var i=null;try{i=JSON.parse(t)}catch(t){return void(void 0!==n&&n(t))}var o=i.metadata;void 0!==o&&void 0!==o.type&&"geometry"!==o.type.toLowerCase()&&r.parse(i,e)}),i,n)},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setCrossOrigin:function(t){return this.crossOrigin=t,this},parse:function(t,e){var i=this.parseShape(t.shapes),n=this.parseGeometries(t.geometries,i),r=this.parseImages(t.images,(function(){void 0!==e&&e(s)})),o=this.parseTextures(t.textures,r),a=this.parseMaterials(t.materials,o),s=this.parseObject(t.object,n,a);return t.animations&&(s.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(s),s},parseShape:function(t){var e={};if(void 0!==t)for(var i=0,n=t.length;i<n;i++){var r=(new al).fromJSON(t[i]);e[r.uuid]=r}return e},parseGeometries:function(t,e){var i={};if(void 0!==t)for(var n=new wl,r=0,o=t.length;r<o;r++){var a,s=t[r];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":a=new ts[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":a=new ts[s.type](s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":a=new ts[s.type](s.radius,s.segments,s.thetaStart,s.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":a=new ts[s.type](s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":a=new ts[s.type](s.radius,s.height,s.radialSegments,s.heightSegments,s.openEnded,s.thetaStart,s.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":a=new ts[s.type](s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":a=new ts[s.type](s.radius,s.detail);break;case"RingGeometry":case"RingBufferGeometry":a=new ts[s.type](s.innerRadius,s.outerRadius,s.thetaSegments,s.phiSegments,s.thetaStart,s.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":a=new ts[s.type](s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":a=new ts[s.type](s.radius,s.tube,s.tubularSegments,s.radialSegments,s.p,s.q);break;case"LatheGeometry":case"LatheBufferGeometry":a=new ts[s.type](s.points,s.segments,s.phiStart,s.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":a=new ts[s.type](s.vertices,s.indices,s.radius,s.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":for(var l=[],u=0,h=s.shapes.length;u<h;u++){var c=e[s.shapes[u]];l.push(c)}a=new ts[s.type](l,s.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":for(l=[],u=0,h=s.shapes.length;u<h;u++){c=e[s.shapes[u]];l.push(c)}var d=s.options.extrudePath;void 0!==d&&(s.options.extrudePath=(new nl[d.type]).fromJSON(d)),a=new ts[s.type](l,s.options);break;case"BufferGeometry":a=n.parse(s);break;case"Geometry":if("THREE"in window&&"LegacyJSONLoader"in THREE)a=(new THREE.LegacyJSONLoader).parse(s,this.resourcePath).geometry;break;default:continue}a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),!0===a.isBufferGeometry&&void 0!==s.userData&&(a.userData=s.userData),i[s.uuid]=a}return i},parseMaterials:function(t,e){var i={},n={};if(void 0!==t){var r=new yl;r.setTextures(e);for(var o=0,a=t.length;o<a;o++){var s=t[o];if("MultiMaterial"===s.type){for(var l=[],u=0;u<s.materials.length;u++){var h=s.materials[u];void 0===i[h.uuid]&&(i[h.uuid]=r.parse(h)),l.push(i[h.uuid])}n[s.uuid]=l}else n[s.uuid]=r.parse(s),i[s.uuid]=n[s.uuid]}}return n},parseAnimations:function(t){for(var e=[],i=0;i<t.length;i++){var n=t[i],r=_s.parse(n);void 0!==n.uuid&&(r.uuid=n.uuid),e.push(r)}return e},parseImages:function(t,e){var i=this,n={};function r(t){return i.manager.itemStart(t),o.load(t,(function(){i.manager.itemEnd(t)}),void 0,(function(){i.manager.itemError(t),i.manager.itemEnd(t)}))}if(void 0!==t&&t.length>0){var o=new Ns(new Cs(e));o.setCrossOrigin(this.crossOrigin);for(var a=0,s=t.length;a<s;a++){var l=t[a],u=l.url;if(Array.isArray(u)){n[l.uuid]=[];for(var h=0,c=u.length;h<c;h++){var d=u[h],p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(d)?d:i.resourcePath+d;n[l.uuid].push(r(p))}}else{p=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(l.url)?l.url:i.resourcePath+l.url;n[l.uuid]=r(p)}}}return n},parseTextures:function(t,e){function i(t,e){return"number"==typeof t?t:e[t]}var n={};if(void 0!==t)for(var r=0,o=t.length;r<o;r++){var a,s=t[r];s.image,e[s.image],(a=Array.isArray(e[s.image])?new Bn(e[s.image]):new si(e[s.image])).needsUpdate=!0,a.uuid=s.uuid,void 0!==s.name&&(a.name=s.name),void 0!==s.mapping&&(a.mapping=i(s.mapping,Cl)),void 0!==s.offset&&a.offset.fromArray(s.offset),void 0!==s.repeat&&a.repeat.fromArray(s.repeat),void 0!==s.center&&a.center.fromArray(s.center),void 0!==s.rotation&&(a.rotation=s.rotation),void 0!==s.wrap&&(a.wrapS=i(s.wrap[0],El),a.wrapT=i(s.wrap[1],El)),void 0!==s.format&&(a.format=s.format),void 0!==s.type&&(a.type=s.type),void 0!==s.encoding&&(a.encoding=s.encoding),void 0!==s.minFilter&&(a.minFilter=i(s.minFilter,Dl)),void 0!==s.magFilter&&(a.magFilter=i(s.magFilter,Dl)),void 0!==s.anisotropy&&(a.anisotropy=s.anisotropy),void 0!==s.flipY&&(a.flipY=s.flipY),void 0!==s.premultiplyAlpha&&(a.premultiplyAlpha=s.premultiplyAlpha),void 0!==s.unpackAlignment&&(a.unpackAlignment=s.unpackAlignment),n[s.uuid]=a}return n},parseObject:function(t,e,i){var n;function r(t){return e[t],e[t]}function o(t){if(void 0!==t){if(Array.isArray(t)){for(var e=[],n=0,r=t.length;n<r;n++){var o=t[n];i[o],e.push(i[o])}return e}return i[t],i[t]}}switch(t.type){case"Scene":n=new To,void 0!==t.background&&Number.isInteger(t.background)&&(n.background=new Si(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?n.fog=new Mo(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(n.fog=new xo(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":n=new ao(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(n.focus=t.focus),void 0!==t.zoom&&(n.zoom=t.zoom),void 0!==t.filmGauge&&(n.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(n.filmOffset=t.filmOffset),void 0!==t.view&&(n.view=Object.assign({},t.view));break;case"OrthographicCamera":n=new pl(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(n.zoom=t.zoom),void 0!==t.view&&(n.view=Object.assign({},t.view));break;case"AmbientLight":n=new gl(t.color,t.intensity);break;case"DirectionalLight":n=new ml(t.color,t.intensity);break;case"PointLight":n=new dl(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":n=new vl(t.color,t.intensity,t.width,t.height);break;case"SpotLight":n=new cl(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":n=new ll(t.color,t.groundColor,t.intensity);break;case"SkinnedMesh":case"Mesh":var a=r(t.geometry),s=o(t.material);n=a.bones&&a.bones.length>0?new Eo(a,s):new An(a,s);break;case"LOD":n=new Co;break;case"Line":n=new Io(r(t.geometry),o(t.material),t.mode);break;case"LineLoop":n=new No(r(t.geometry),o(t.material));break;case"LineSegments":n=new Ro(r(t.geometry),o(t.material));break;case"PointCloud":case"Points":n=new Fo(r(t.geometry),o(t.material));break;case"Sprite":n=new Po(o(t.material));break;case"Group":n=new ro;break;default:n=new Bi}if(n.uuid=t.uuid,void 0!==t.name&&(n.name=t.name),void 0!==t.matrix?(n.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(n.matrixAutoUpdate=t.matrixAutoUpdate),n.matrixAutoUpdate&&n.matrix.decompose(n.position,n.quaternion,n.scale)):(void 0!==t.position&&n.position.fromArray(t.position),void 0!==t.rotation&&n.rotation.fromArray(t.rotation),void 0!==t.quaternion&&n.quaternion.fromArray(t.quaternion),void 0!==t.scale&&n.scale.fromArray(t.scale)),void 0!==t.castShadow&&(n.castShadow=t.castShadow),void 0!==t.receiveShadow&&(n.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(n.shadow.bias=t.shadow.bias),void 0!==t.shadow.radius&&(n.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&n.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(n.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.frustumCulled&&(n.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(n.renderOrder=t.renderOrder),void 0!==t.userData&&(n.userData=t.userData),void 0!==t.layers&&(n.layers.mask=t.layers),void 0!==t.children)for(var l=t.children,u=0;u<l.length;u++)n.add(this.parseObject(l[u],e,i));if("LOD"===t.type)for(var h=t.levels,c=0;c<h.length;c++){var d=h[c],p=n.getObjectByProperty("uuid",d.object);void 0!==p&&n.addLevel(p,d.distance)}return n}});var Tl,Sl,_l,Al,Pl,Cl={UVMapping:vt,CubeReflectionMapping:yt,CubeRefractionMapping:bt,EquirectangularReflectionMapping:wt,EquirectangularRefractionMapping:xt,SphericalReflectionMapping:Mt,CubeUVReflectionMapping:Tt,CubeUVRefractionMapping:St},El={RepeatWrapping:_t,ClampToEdgeWrapping:At,MirroredRepeatWrapping:Pt},Dl={NearestFilter:Ct,NearestMipMapNearestFilter:Et,NearestMipMapLinearFilter:Dt,LinearFilter:Lt,LinearMipMapNearestFilter:Ot,LinearMipMapLinearFilter:It};function Ll(t){this.manager=void 0!==t?t:Es,this.options=void 0}function Ol(){this.type="ShapePath",this.color=new Si,this.subPaths=[],this.currentPath=null}function Il(t){this.type="Font",this.data=t}function Rl(t,e,i,n,r){var o=r.glyphs[t]||r.glyphs["?"];if(o){var a,s,l,u,h,c,d,p,f=new Ol;if(o.o)for(var m=o._cachedOutline||(o._cachedOutline=o.o.split(" ")),g=0,v=m.length;g<v;){switch(m[g++]){case"m":a=m[g++]*e+i,s=m[g++]*e+n,f.moveTo(a,s);break;case"l":a=m[g++]*e+i,s=m[g++]*e+n,f.lineTo(a,s);break;case"q":l=m[g++]*e+i,u=m[g++]*e+n,h=m[g++]*e+i,c=m[g++]*e+n,f.quadraticCurveTo(h,c,l,u);break;case"b":l=m[g++]*e+i,u=m[g++]*e+n,h=m[g++]*e+i,c=m[g++]*e+n,d=m[g++]*e+i,p=m[g++]*e+n,f.bezierCurveTo(h,c,d,p,l,u)}}return{offsetX:o.ha*e,path:f}}}function Nl(t){this.manager=void 0!==t?t:Es}function kl(){}Ll.prototype={constructor:Ll,setOptions:function(t){return this.options=t,this},load:function(t,e,i,n){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);var r=this,o=Ps.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout((function(){e&&e(o),r.manager.itemEnd(t)}),0),o;fetch(t).then((function(t){return t.blob()})).then((function(t){return createImageBitmap(t,r.options)})).then((function(i){Ps.add(t,i),e&&e(i),r.manager.itemEnd(t)})).catch((function(e){n&&n(e),r.manager.itemError(t),r.manager.itemEnd(t)}))},setCrossOrigin:function(){return this},setPath:function(t){return this.path=t,this}},Object.assign(Ol.prototype,{moveTo:function(t,e){this.currentPath=new ol,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e)},lineTo:function(t,e){this.currentPath.lineTo(t,e)},quadraticCurveTo:function(t,e,i,n){this.currentPath.quadraticCurveTo(t,e,i,n)},bezierCurveTo:function(t,e,i,n,r,o){this.currentPath.bezierCurveTo(t,e,i,n,r,o)},splineThru:function(t){this.currentPath.splineThru(t)},toShapes:function(t,e){function i(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i],o=new al;o.curves=r.curves,e.push(o)}return e}function n(t,e){for(var i=e.length,n=!1,r=i-1,o=0;o<i;r=o++){var a=e[r],s=e[o],l=s.x-a.x,u=s.y-a.y;if(Math.abs(u)>Number.EPSILON){if(u<0&&(a=e[o],l=-l,s=e[r],u=-u),t.y<a.y||t.y>s.y)continue;if(t.y===a.y){if(t.x===a.x)return!0}else{var h=u*(t.x-a.x)-l*(t.y-a.y);if(0===h)return!0;if(h<0)continue;n=!n}}else{if(t.y!==a.y)continue;if(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x)return!0}}return n}var r=Ea.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===e)return i(o);var a,s,l,u=[];if(1===o.length)return s=o[0],(l=new al).curves=s.curves,u.push(l),u;var h=!r(o[0].getPoints());h=t?!h:h;var c,d,p=[],f=[],m=[],g=0;f[g]=void 0,m[g]=[];for(var v=0,y=o.length;v<y;v++)a=r(c=(s=o[v]).getPoints()),(a=t?!a:a)?(!h&&f[g]&&g++,f[g]={s:new al,p:c},f[g].s.curves=s.curves,h&&g++,m[g]=[]):m[g].push({h:s,p:c[0]});if(!f[0])return i(o);if(f.length>1){for(var b=!1,w=[],x=0,M=f.length;x<M;x++)p[x]=[];for(x=0,M=f.length;x<M;x++)for(var T=m[x],S=0;S<T.length;S++){for(var _=T[S],A=!0,P=0;P<f.length;P++)n(_.p,f[P].p)&&(x!==P&&w.push({froms:x,tos:P,hole:S}),A?(A=!1,p[P].push(_)):b=!0);A&&p[x].push(_)}w.length>0&&(b||(m=p))}v=0;for(var C=f.length;v<C;v++){l=f[v].s,u.push(l);for(var E=0,D=(d=m[v]).length;E<D;E++)l.holes.push(d[E].h)}return u}}),Object.assign(Il.prototype,{isFont:!0,generateShapes:function(t,e){void 0===e&&(e=100);for(var i=[],n=function(t,e,i){for(var n=Array.from?Array.from(t):String(t).split(""),r=e/i.resolution,o=(i.boundingBox.yMax-i.boundingBox.yMin+i.underlineThickness)*r,a=[],s=0,l=0,u=0;u<n.length;u++){var h=n[u];if("\n"===h)s=0,l-=o;else{var c=Rl(h,r,s,l,i);s+=c.offsetX,a.push(c.path)}}return a}(t,e,this.data),r=0,o=n.length;r<o;r++)Array.prototype.push.apply(i,n[r].toShapes());return i}}),Object.assign(Nl.prototype,{load:function(t,e,i,n){var r=this,o=new Ls(this.manager);o.setPath(this.path),o.load(t,(function(t){var i;try{i=JSON.parse(t)}catch(e){i=JSON.parse(t.substring(65,t.length-2))}var n=r.parse(i);e&&e(n)}),i,n)},parse:function(t){return new Il(t)},setPath:function(t){return this.path=t,this}}),kl.Handlers={handlers:[],add:function(t,e){this.handlers.push(t,e)},get:function(t){for(var e=this.handlers,i=0,n=e.length;i<n;i+=2){var r=e[i],o=e[i+1];if(r.test(t))return o}return null}},Object.assign(kl.prototype,{crossOrigin:"anonymous",onLoadStart:function(){},onLoadProgress:function(){},onLoadComplete:function(){},initMaterials:function(t,e,i){for(var n=[],r=0;r<t.length;++r)n[r]=this.createMaterial(t[r],e,i);return n},createMaterial:(Tl={NoBlending:O,NormalBlending:I,AdditiveBlending:R,SubtractiveBlending:N,MultiplyBlending:k,CustomBlending:F},Sl=new Si,_l=new Fs,Al=new yl,function(t,e,i){var n={};function r(t,r,o,a,s){var l,u=e+t,h=kl.Handlers.get(u);null!==h?l=h.load(u):(_l.setCrossOrigin(i),l=_l.load(u)),void 0!==r&&(l.repeat.fromArray(r),1!==r[0]&&(l.wrapS=_t),1!==r[1]&&(l.wrapT=_t)),void 0!==o&&l.offset.fromArray(o),void 0!==a&&("repeat"===a[0]&&(l.wrapS=_t),"mirror"===a[0]&&(l.wrapS=Pt),"repeat"===a[1]&&(l.wrapT=_t),"mirror"===a[1]&&(l.wrapT=Pt)),void 0!==s&&(l.anisotropy=s);var c=Xe.generateUUID();return n[c]=l,c}var o={uuid:Xe.generateUUID(),type:"MeshLambertMaterial"};for(var a in t){var s=t[a];switch(a){case"DbgColor":case"DbgIndex":case"opticalDensity":case"illumination":break;case"DbgName":o.name=s;break;case"blending":o.blending=Tl[s];break;case"colorAmbient":case"mapAmbient":break;case"colorDiffuse":o.color=Sl.fromArray(s).getHex();break;case"colorSpecular":o.specular=Sl.fromArray(s).getHex();break;case"colorEmissive":o.emissive=Sl.fromArray(s).getHex();break;case"specularCoef":o.shininess=s;break;case"shading":"basic"===s.toLowerCase()&&(o.type="MeshBasicMaterial"),"phong"===s.toLowerCase()&&(o.type="MeshPhongMaterial"),"standard"===s.toLowerCase()&&(o.type="MeshStandardMaterial");break;case"mapDiffuse":o.map=r(s,t.mapDiffuseRepeat,t.mapDiffuseOffset,t.mapDiffuseWrap,t.mapDiffuseAnisotropy);break;case"mapDiffuseRepeat":case"mapDiffuseOffset":case"mapDiffuseWrap":case"mapDiffuseAnisotropy":break;case"mapEmissive":o.emissiveMap=r(s,t.mapEmissiveRepeat,t.mapEmissiveOffset,t.mapEmissiveWrap,t.mapEmissiveAnisotropy);break;case"mapEmissiveRepeat":case"mapEmissiveOffset":case"mapEmissiveWrap":case"mapEmissiveAnisotropy":break;case"mapLight":o.lightMap=r(s,t.mapLightRepeat,t.mapLightOffset,t.mapLightWrap,t.mapLightAnisotropy);break;case"mapLightRepeat":case"mapLightOffset":case"mapLightWrap":case"mapLightAnisotropy":break;case"mapAO":o.aoMap=r(s,t.mapAORepeat,t.mapAOOffset,t.mapAOWrap,t.mapAOAnisotropy);break;case"mapAORepeat":case"mapAOOffset":case"mapAOWrap":case"mapAOAnisotropy":break;case"mapBump":o.bumpMap=r(s,t.mapBumpRepeat,t.mapBumpOffset,t.mapBumpWrap,t.mapBumpAnisotropy);break;case"mapBumpScale":o.bumpScale=s;break;case"mapBumpRepeat":case"mapBumpOffset":case"mapBumpWrap":case"mapBumpAnisotropy":break;case"mapNormal":o.normalMap=r(s,t.mapNormalRepeat,t.mapNormalOffset,t.mapNormalWrap,t.mapNormalAnisotropy);break;case"mapNormalFactor":o.normalScale=s;break;case"mapNormalRepeat":case"mapNormalOffset":case"mapNormalWrap":case"mapNormalAnisotropy":break;case"mapSpecular":o.specularMap=r(s,t.mapSpecularRepeat,t.mapSpecularOffset,t.mapSpecularWrap,t.mapSpecularAnisotropy);break;case"mapSpecularRepeat":case"mapSpecularOffset":case"mapSpecularWrap":case"mapSpecularAnisotropy":break;case"mapMetalness":o.metalnessMap=r(s,t.mapMetalnessRepeat,t.mapMetalnessOffset,t.mapMetalnessWrap,t.mapMetalnessAnisotropy);break;case"mapMetalnessRepeat":case"mapMetalnessOffset":case"mapMetalnessWrap":case"mapMetalnessAnisotropy":break;case"mapRoughness":o.roughnessMap=r(s,t.mapRoughnessRepeat,t.mapRoughnessOffset,t.mapRoughnessWrap,t.mapRoughnessAnisotropy);break;case"mapRoughnessRepeat":case"mapRoughnessOffset":case"mapRoughnessWrap":case"mapRoughnessAnisotropy":break;case"mapAlpha":o.alphaMap=r(s,t.mapAlphaRepeat,t.mapAlphaOffset,t.mapAlphaWrap,t.mapAlphaAnisotropy);break;case"mapAlphaRepeat":case"mapAlphaOffset":case"mapAlphaWrap":case"mapAlphaAnisotropy":break;case"flipSided":o.side=_;break;case"doubleSided":o.side=A;break;case"transparency":o.opacity=s;break;case"depthTest":case"depthWrite":case"colorWrite":case"opacity":case"reflectivity":case"transparent":case"visible":case"wireframe":o[a]=s;break;case"vertexColors":!0===s&&(o.vertexColors=L),"face"===s&&(o.vertexColors=D)}}return"MeshBasicMaterial"===o.type&&delete o.emissive,"MeshPhongMaterial"!==o.type&&delete o.specular,o.opacity<1&&(o.transparent=!0),Al.setTextures(n),Al.parse(o)})});var Fl,Bl,zl,Ul,Vl,jl,Hl,Gl,Wl,ql,Yl={getContext:function(){return void 0===Pl&&(Pl=new(window.AudioContext||window.webkitAudioContext)),Pl},setContext:function(t){Pl=t}};function Xl(t){this.manager=void 0!==t?t:Es}function Zl(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new ao,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new ao,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1}function Kl(t,e,i,n){Bi.call(this),this.type="CubeCamera";var r=new ao(90,1,t,e);r.up.set(0,-1,0),r.lookAt(new Je(1,0,0)),this.add(r);var o=new ao(90,1,t,e);o.up.set(0,-1,0),o.lookAt(new Je(-1,0,0)),this.add(o);var a=new ao(90,1,t,e);a.up.set(0,0,1),a.lookAt(new Je(0,1,0)),this.add(a);var s=new ao(90,1,t,e);s.up.set(0,0,-1),s.lookAt(new Je(0,-1,0)),this.add(s);var l=new ao(90,1,t,e);l.up.set(0,-1,0),l.lookAt(new Je(0,0,1)),this.add(l);var u=new ao(90,1,t,e);u.up.set(0,-1,0),u.lookAt(new Je(0,0,-1)),this.add(u),n=n||{format:Yt,magFilter:Lt,minFilter:Lt},this.renderTarget=new hi(i,i,n),this.renderTarget.texture.name="CubeCamera",this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();var i=this.renderTarget,n=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,i.activeCubeFace=0,t.render(e,r,i),i.activeCubeFace=1,t.render(e,o,i),i.activeCubeFace=2,t.render(e,a,i),i.activeCubeFace=3,t.render(e,s,i),i.activeCubeFace=4,t.render(e,l,i),i.texture.generateMipmaps=n,i.activeCubeFace=5,t.render(e,u,i),t.setRenderTarget(null)},this.clear=function(t,e,i,n){for(var r=this.renderTarget,o=0;o<6;o++)r.activeCubeFace=o,t.setRenderTarget(r),t.clear(e,i,n);t.setRenderTarget(null)}}function Ql(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}function Jl(){Bi.call(this),this.type="AudioListener",this.context=Yl.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0}function $l(t){Bi.call(this),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.startTime=0,this.offset=0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this.filters=[]}function tu(t){$l.call(this,t),this.panner=this.context.createPanner(),this.panner.connect(this.gain)}function eu(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function iu(t,e,i){this.binding=t,this.valueSize=i;var n,r=Float64Array;switch(e){case"quaternion":n=this._slerp;break;case"string":case"bool":r=Array,n=this._select;break;default:n=this._lerp}this.buffer=new r(4*i),this._mixBufferRegion=n,this.cumulativeWeight=0,this.useCount=0,this.referenceCount=0}Object.assign(Xl.prototype,{load:function(t,e,i,n){var r=new Ls(this.manager);r.setResponseType("arraybuffer"),r.setPath(this.path),r.load(t,(function(t){var i=t.slice(0);Yl.getContext().decodeAudioData(i,(function(t){e(t)}))}),i,n)},setPath:function(t){return this.path=t,this}}),Object.assign(Zl.prototype,{update:(Wl=new Ke,ql=new Ke,function(t){if(Fl!==this||Bl!==t.focus||zl!==t.fov||Ul!==t.aspect*this.aspect||Vl!==t.near||jl!==t.far||Hl!==t.zoom||Gl!==this.eyeSep){Fl=this,Bl=t.focus,zl=t.fov,Ul=t.aspect*this.aspect,Vl=t.near,jl=t.far,Hl=t.zoom;var e,i,n=t.projectionMatrix.clone(),r=(Gl=this.eyeSep/2)*Vl/Bl,o=Vl*Math.tan(Xe.DEG2RAD*zl*.5)/Hl;ql.elements[12]=-Gl,Wl.elements[12]=Gl,e=-o*Ul+r,i=o*Ul+r,n.elements[0]=2*Vl/(i-e),n.elements[8]=(i+e)/(i-e),this.cameraL.projectionMatrix.copy(n),e=-o*Ul-r,i=o*Ul-r,n.elements[0]=2*Vl/(i-e),n.elements[8]=(i+e)/(i-e),this.cameraR.projectionMatrix.copy(n)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(ql),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(Wl)})}),Kl.prototype=Object.create(Bi.prototype),Kl.prototype.constructor=Kl,Object.assign(Ql.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){var e=("undefined"==typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}}),Jl.prototype=Object.assign(Object.create(Bi.prototype),{constructor:Jl,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this},updateMatrixWorld:function(){var t=new Je,e=new Qe,i=new Je,n=new Je,r=new Ql;return function(o){Bi.prototype.updateMatrixWorld.call(this,o);var a=this.context.listener,s=this.up;if(this.timeDelta=r.getDelta(),this.matrixWorld.decompose(t,e,i),n.set(0,0,-1).applyQuaternion(e),a.positionX){var l=this.context.currentTime+this.timeDelta;a.positionX.linearRampToValueAtTime(t.x,l),a.positionY.linearRampToValueAtTime(t.y,l),a.positionZ.linearRampToValueAtTime(t.z,l),a.forwardX.linearRampToValueAtTime(n.x,l),a.forwardY.linearRampToValueAtTime(n.y,l),a.forwardZ.linearRampToValueAtTime(n.z,l),a.upX.linearRampToValueAtTime(s.x,l),a.upY.linearRampToValueAtTime(s.y,l),a.upZ.linearRampToValueAtTime(s.z,l)}else a.setPosition(t.x,t.y,t.z),a.setOrientation(n.x,n.y,n.z,s.x,s.y,s.z)}}()}),$l.prototype=Object.assign(Object.create(Bi.prototype),{constructor:$l,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setMediaElementSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(){if(!0!==this.isPlaying&&!1!==this.hasPlaybackControl){var t=this.context.createBufferSource();return t.buffer=this.buffer,t.detune.value=this.detune,t.loop=this.loop,t.onended=this.onEnded.bind(this),t.playbackRate.setValueAtTime(this.playbackRate,this.startTime),this.startTime=this.context.currentTime,t.start(this.startTime,this.offset),this.isPlaying=!0,this.source=t,this.connect()}},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this.source.stop(),this.source.onended=null,this.offset+=(this.context.currentTime-this.startTime)*this.playbackRate,this.isPlaying=!1),this},stop:function(){if(!1!==this.hasPlaybackControl)return this.source.stop(),this.source.onended=null,this.offset=0,this.isPlaying=!1,this},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(var t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t||(t=[]),!0===this.isPlaying?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},setDetune:function(t){return this.detune=t,!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1!==this.hasPlaybackControl&&this.loop},setLoop:function(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}}),tu.prototype=Object.assign(Object.create($l.prototype),{constructor:tu,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){return this.panner.refDistance=t,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){return this.panner.rolloffFactor=t,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){return this.panner.distanceModel=t,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){return this.panner.maxDistance=t,this},setDirectionalCone:function(t,e,i){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=i,this},updateMatrixWorld:function(){var t=new Je,e=new Qe,i=new Je,n=new Je;return function(r){if(Bi.prototype.updateMatrixWorld.call(this,r),!1!==this.isPlaying){this.matrixWorld.decompose(t,e,i),n.set(0,0,1).applyQuaternion(e);var o=this.panner;if(o.positionX){var a=this.context.currentTime+this.listener.timeDelta;o.positionX.linearRampToValueAtTime(t.x,a),o.positionY.linearRampToValueAtTime(t.y,a),o.positionZ.linearRampToValueAtTime(t.z,a),o.orientationX.linearRampToValueAtTime(n.x,a),o.orientationY.linearRampToValueAtTime(n.y,a),o.orientationZ.linearRampToValueAtTime(n.z,a)}else o.setPosition(t.x,t.y,t.z),o.setOrientation(n.x,n.y,n.z)}}}()}),Object.assign(eu.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){for(var t=0,e=this.getFrequencyData(),i=0;i<e.length;i++)t+=e[i];return t/e.length}}),Object.assign(iu.prototype,{accumulate:function(t,e){var i=this.buffer,n=this.valueSize,r=t*n+n,o=this.cumulativeWeight;if(0===o){for(var a=0;a!==n;++a)i[r+a]=i[a];o=e}else{var s=e/(o+=e);this._mixBufferRegion(i,r,0,s,n)}this.cumulativeWeight=o},apply:function(t){var e=this.valueSize,i=this.buffer,n=t*e+e,r=this.cumulativeWeight,o=this.binding;if(this.cumulativeWeight=0,r<1){var a=3*e;this._mixBufferRegion(i,n,a,1-r,e)}for(var s=e,l=e+e;s!==l;++s)if(i[s]!==i[s+e]){o.setValue(i,n);break}},saveOriginalState:function(){var t=this.binding,e=this.buffer,i=this.valueSize,n=3*i;t.getValue(e,n);for(var r=i,o=n;r!==o;++r)e[r]=e[n+r%i];this.cumulativeWeight=0},restoreOriginalState:function(){var t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_select:function(t,e,i,n,r){if(n>=.5)for(var o=0;o!==r;++o)t[e+o]=t[i+o]},_slerp:function(t,e,i,n){Qe.slerpFlat(t,e,t,e,t,i,n)},_lerp:function(t,e,i,n,r){for(var o=1-n,a=0;a!==r;++a){var s=e+a;t[s]=t[s]*o+t[i+a]*n}}});var nu,ru,ou,au,su,lu,uu,hu,cu,du,pu,fu,mu,gu;function vu(t,e,i){var n=i||yu.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,n)}function yu(t,e,i){this.path=e,this.parsedPath=i||yu.parseTrackName(e),this.node=yu.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function bu(){this.uuid=Xe.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var t={};this._indicesByUUID=t;for(var e=0,i=arguments.length;e!==i;++e)t[arguments[e].uuid]=e;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};var n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}}function wu(t,e,i){this._mixer=t,this._clip=e,this._localRoot=i||null;for(var n=e.tracks,r=n.length,o=new Array(r),a={endingStart:De,endingEnd:De},s=0;s!==r;++s){var l=n[s].createInterpolant(null);o[s]=l,l.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=_e,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}function xu(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Mu(t){"string"==typeof t&&(t=arguments[1]),this.value=t}function Tu(){nn.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function Su(t,e,i){So.call(this,t,e),this.meshPerAttribute=i||1}function _u(t,e,i,n){"number"==typeof i&&(n=i,i=!1),Hi.call(this,t,e,i),this.meshPerAttribute=n||1}function Au(t,e,i,n){this.ray=new Tn(t,e),this.near=i||0,this.far=n||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return this.Points}}})}function Pu(t,e){return t.distance-e.distance}function Cu(t,e,i,n){if(!1!==t.visible&&(t.raycast(e,i),!0===n))for(var r=t.children,o=0,a=r.length;o<a;o++)Cu(r[o],e,i,!0)}function Eu(t,e,i){return this.radius=void 0!==t?t:1,this.phi=void 0!==e?e:0,this.theta=void 0!==i?i:0,this}function Du(t,e,i){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==i?i:0,this}function Lu(t,e){this.min=void 0!==t?t:new Ze(1/0,1/0),this.max=void 0!==e?e:new Ze(-1/0,-1/0)}function Ou(t,e){this.start=void 0!==t?t:new Je,this.end=void 0!==e?e:new Je}function Iu(t){Bi.call(this),this.material=t,this.render=function(){}}function Ru(t,e,i,n){this.object=t,this.size=void 0!==e?e:1;var r=void 0!==i?i:16711680,o=void 0!==n?n:1,a=0,s=this.object.geometry;s&&s.isGeometry?a=3*s.faces.length:s&&s.isBufferGeometry&&(a=s.attributes.normal.count);var l=new nn,u=new Qi(2*a*3,3);l.addAttribute("position",u),Ro.call(this,l,new Oo({color:r,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function Nu(t,e){Bi.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;for(var i=new nn,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],r=0,o=1;r<32;r++,o++){var a=r/32*Math.PI*2,s=o/32*Math.PI*2;n.push(Math.cos(a),Math.sin(a),1,Math.cos(s),Math.sin(s),1)}i.addAttribute("position",new Qi(n,3));var l=new Oo({fog:!1});this.cone=new Ro(i,l),this.add(this.cone),this.update()}function ku(t){for(var e=function t(e){var i=[];e&&e.isBone&&i.push(e);for(var n=0;n<e.children.length;n++)i.push.apply(i,t(e.children[n]));return i}(t),i=new nn,n=[],r=[],o=new Si(0,0,1),a=new Si(0,1,0),s=0;s<e.length;s++){var l=e[s];l.parent&&l.parent.isBone&&(n.push(0,0,0),n.push(0,0,0),r.push(o.r,o.g,o.b),r.push(a.r,a.g,a.b))}i.addAttribute("position",new Qi(n,3)),i.addAttribute("color",new Qi(r,3));var u=new Oo({vertexColors:L,depthTest:!1,depthWrite:!1,transparent:!0});Ro.call(this,i,u),this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}function Fu(t,e,i){this.light=t,this.light.updateMatrixWorld(),this.color=i;var n=new za(e,4,2),r=new _n({wireframe:!0,fog:!1});An.call(this,n,r),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}function Bu(t,e){this.type="RectAreaLightHelper",this.light=t,this.color=e;var i=new nn;i.addAttribute("position",new Qi([1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),i.computeBoundingSphere();var n=new Oo({fog:!1});Io.call(this,i,n);var r=new nn;r.addAttribute("position",new Qi([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),r.computeBoundingSphere(),this.add(new An(r,new _n({side:THREE.BackSide,fog:!1}))),this.update()}function zu(t,e,i){Bi.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i;var n=new Ko(e);n.rotateY(.5*Math.PI),this.material=new _n({wireframe:!0,fog:!1}),void 0===this.color&&(this.material.vertexColors=L);var r=n.getAttribute("position"),o=new Float32Array(3*r.count);n.addAttribute("color",new Hi(o,3)),this.add(new An(n,this.material)),this.update()}function Uu(t,e,i,n){t=t||10,e=e||10,i=new Si(void 0!==i?i:4473924),n=new Si(void 0!==n?n:8947848);for(var r=e/2,o=t/e,a=t/2,s=[],l=[],u=0,h=0,c=-a;u<=e;u++,c+=o){s.push(-a,0,c,a,0,c),s.push(c,0,-a,c,0,a);var d=u===r?i:n;d.toArray(l,h),h+=3,d.toArray(l,h),h+=3,d.toArray(l,h),h+=3,d.toArray(l,h),h+=3}var p=new nn;p.addAttribute("position",new Qi(s,3)),p.addAttribute("color",new Qi(l,3));var f=new Oo({vertexColors:L});Ro.call(this,p,f)}function Vu(t,e,i,n,r,o){t=t||10,e=e||16,i=i||8,n=n||64,r=new Si(void 0!==r?r:4473924),o=new Si(void 0!==o?o:8947848);var a,s,l,u,h,c,d,p=[],f=[];for(u=0;u<=e;u++)l=u/e*(2*Math.PI),a=Math.sin(l)*t,s=Math.cos(l)*t,p.push(0,0,0),p.push(a,0,s),d=1&u?r:o,f.push(d.r,d.g,d.b),f.push(d.r,d.g,d.b);for(u=0;u<=i;u++)for(d=1&u?r:o,c=t-t/i*u,h=0;h<n;h++)l=h/n*(2*Math.PI),a=Math.sin(l)*c,s=Math.cos(l)*c,p.push(a,0,s),f.push(d.r,d.g,d.b),l=(h+1)/n*(2*Math.PI),a=Math.sin(l)*c,s=Math.cos(l)*c,p.push(a,0,s),f.push(d.r,d.g,d.b);var m=new nn;m.addAttribute("position",new Qi(p,3)),m.addAttribute("color",new Qi(f,3));var g=new Oo({vertexColors:L});Ro.call(this,m,g)}function ju(t,e,i,n){this.object=t,this.size=void 0!==e?e:1;var r=void 0!==i?i:16776960,o=void 0!==n?n:1,a=0,s=this.object.geometry;s&&s.isGeometry&&(a=s.faces.length);var l=new nn,u=new Qi(2*a*3,3);l.addAttribute("position",u),Ro.call(this,l,new Oo({color:r,linewidth:o})),this.matrixAutoUpdate=!1,this.update()}function Hu(t,e,i){Bi.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,void 0===e&&(e=1);var n=new nn;n.addAttribute("position",new Qi([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));var r=new Oo({fog:!1});this.lightPlane=new Io(n,r),this.add(this.lightPlane),(n=new nn).addAttribute("position",new Qi([0,0,0,0,0,1],3)),this.targetLine=new Io(n,r),this.add(this.targetLine),this.update()}function Gu(t){var e=new nn,i=new Oo({color:16777215,vertexColors:D}),n=[],r=[],o={},a=new Si(16755200),s=new Si(16711680),l=new Si(43775),u=new Si(16777215),h=new Si(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===o[t]&&(o[t]=[]),o[t].push(n.length/3-1)}c("n1","n2",a),c("n2","n4",a),c("n4","n3",a),c("n3","n1",a),c("f1","f2",a),c("f2","f4",a),c("f4","f3",a),c("f3","f1",a),c("n1","f1",a),c("n2","f2",a),c("n3","f3",a),c("n4","f4",a),c("p","n1",s),c("p","n2",s),c("p","n3",s),c("p","n4",s),c("u1","u2",l),c("u2","u3",l),c("u3","u1",l),c("c","t",u),c("p","c",h),c("cn1","cn2",h),c("cn3","cn4",h),c("cf1","cf2",h),c("cf3","cf4",h),e.addAttribute("position",new Qi(n,3)),e.addAttribute("color",new Qi(r,3)),Ro.call(this,e,i),this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}function Wu(t,e){this.object=t,void 0===e&&(e=16776960);var 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 nn;r.setIndex(new Hi(i,1)),r.addAttribute("position",new Hi(n,3)),Ro.call(this,r,new Oo({color:e})),this.matrixAutoUpdate=!1,this.update()}function qu(t,e){this.type="Box3Helper",this.box=t;var i=void 0!==e?e:16776960,n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),r=new nn;r.setIndex(new Hi(n,1)),r.addAttribute("position",new Qi([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)),Ro.call(this,r,new Oo({color:i})),this.geometry.computeBoundingSphere()}function Yu(t,e,i){this.type="PlaneHelper",this.plane=t,this.size=void 0===e?1:e;var n=void 0!==i?i:16776960,r=new nn;r.addAttribute("position",new Qi([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(),Io.call(this,r,new Oo({color:n}));var o=new nn;o.addAttribute("position",new Qi([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),o.computeBoundingSphere(),this.add(new An(o,new _n({color:n,opacity:.2,transparent:!0,depthWrite:!1})))}function Xu(t,e,i,n,r,o){Bi.call(this),void 0===t&&(t=new THREE.Vector3(0,0,1)),void 0===e&&(e=new THREE.Vector3(0,0,0)),void 0===i&&(i=1),void 0===n&&(n=16776960),void 0===r&&(r=.2*i),void 0===o&&(o=.2*r),void 0===pu&&((pu=new nn).addAttribute("position",new Qi([0,0,0,0,1,0],3)),(fu=new Za(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(e),this.line=new Io(pu,new Oo({color:n})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new An(fu,new _n({color:n})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(i,r,o)}function Zu(t){var e=[0,0,0,t=t||1,0,0,0,0,0,0,t,0,0,0,0,0,0,t],i=new nn;i.addAttribute("position",new Qi(e,3)),i.addAttribute("color",new Qi([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));var n=new Oo({vertexColors:L});Ro.call(this,i,n)}function Ku(t,e,i,n,r,o,a){return new Di(t,e,i,r,o,a)}Object.assign(vu.prototype,{getValue:function(t,e){this.bind();var i=this._targetGroup.nCachedObjects_,n=this._bindings[i];void 0!==n&&n.getValue(t,e)},setValue:function(t,e){for(var i=this._bindings,n=this._targetGroup.nCachedObjects_,r=i.length;n!==r;++n)i[n].setValue(t,e)},bind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].bind()},unbind:function(){for(var t=this._bindings,e=this._targetGroup.nCachedObjects_,i=t.length;e!==i;++e)t[e].unbind()}}),Object.assign(yu,{Composite:vu,create:function(t,e,i){return t&&t.isAnimationObjectGroup?new yu.Composite(t,e,i):new yu(t,e,i)},sanitizeNodeName:(hu=new RegExp("[\\[\\]\\.:\\/]","g"),function(t){return t.replace(/\s/g,"_").replace(hu,"")}),parseTrackName:(nu="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",ru=/((?:WC+[\/:])*)/.source.replace("WC","[^\\[\\]\\.:\\/]"),ou=/(WCOD+)?/.source.replace("WCOD",nu),au=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC","[^\\[\\]\\.:\\/]"),su=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC","[^\\[\\]\\.:\\/]"),lu=new RegExp("^"+ru+ou+au+su+"$"),uu=["material","materials","bones"],function(t){var e=lu.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);var 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){var r=i.nodeName.substring(n+1);-1!==uu.indexOf(r)&&(i.nodeName=i.nodeName.substring(0,n),i.objectName=r)}if(null===i.propertyName||0===i.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return i}),findNode:function(t,e){if(!e||""===e||"root"===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){var i=t.skeleton.getBoneByName(e);if(void 0!==i)return i}if(t.children){var n=function(t){for(var i=0;i<t.length;i++){var r=t[i];if(r.name===e||r.uuid===e)return r;var o=n(r.children);if(o)return o}return null},r=n(t.children);if(r)return r}return null}}),Object.assign(yu.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)t[e++]=i[n]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)i[n]=t[e++]},function(t,e){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)i[n]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){for(var i=this.resolvedProperty,n=0,r=i.length;n!==r;++n)i[n]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){var t=this.node,e=this.parsedPath,i=e.objectName,n=e.propertyName,r=e.propertyIndex;if(t||(t=yu.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,t){if(i){var o=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(var a=0;a<t.length;a++)if(t[a].name===o){o=a;break}break;default:if(void 0===t[i])return;t=t[i]}if(void 0!==o){if(void 0===t[o])return;t=t[o]}}var s=t[n];if(void 0!==s){var l=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?l=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(l=this.Versioning.MatrixWorldNeedsUpdate);var u=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===n){if(!t.geometry)return;if(t.geometry.isBufferGeometry){if(!t.geometry.morphAttributes)return;for(a=0;a<this.node.geometry.morphAttributes.position.length;a++)if(t.geometry.morphAttributes.position[a].name===r){r=a;break}}else{if(!t.geometry.morphTargets)return;for(a=0;a<this.node.geometry.morphTargets.length;a++)if(t.geometry.morphTargets[a].name===r){r=a;break}}}u=this.BindingType.ArrayElement,this.resolvedProperty=s,this.propertyIndex=r}else void 0!==s.fromArray&&void 0!==s.toArray?(u=this.BindingType.HasFromToArray,this.resolvedProperty=s):Array.isArray(s)?(u=this.BindingType.EntireArray,this.resolvedProperty=s):this.propertyName=n;this.getValue=this.GetterByBindingType[u],this.setValue=this.SetterByBindingTypeAndVersioning[u][l]}else e.nodeName}},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(yu.prototype,{_getValue_unbound:yu.prototype.getValue,_setValue_unbound:yu.prototype.setValue}),Object.assign(bu.prototype,{isAnimationObjectGroup:!0,add:function(){for(var t=this._objects,e=t.length,i=this.nCachedObjects_,n=this._indicesByUUID,r=this._paths,o=this._parsedPaths,a=this._bindings,s=a.length,l=0,u=arguments.length;l!==u;++l){var h=arguments[l],c=h.uuid,d=n[c];if(void 0===d){d=e++,n[c]=d,t.push(h);for(var p=0,f=s;p!==f;++p)a[p].push(new yu(h,r[p],o[p]))}else if(d<i){t[d];var m=--i,g=t[m];n[g.uuid]=d,t[d]=g,n[c]=m,t[m]=h;for(p=0,f=s;p!==f;++p){var v=a[p],y=v[m],b=v[d];v[d]=y,void 0===b&&(b=new yu(h,r[p],o[p])),v[m]=b}}else t[d]}this.nCachedObjects_=i},remove:function(){for(var t=this._objects,e=this.nCachedObjects_,i=this._indicesByUUID,n=this._bindings,r=n.length,o=0,a=arguments.length;o!==a;++o){var s=arguments[o],l=s.uuid,u=i[l];if(void 0!==u&&u>=e){var h=e++,c=t[h];i[c.uuid]=u,t[u]=c,i[l]=h,t[h]=s;for(var d=0,p=r;d!==p;++d){var f=n[d],m=f[h],g=f[u];f[u]=m,f[h]=g}}}this.nCachedObjects_=e},uncache:function(){for(var t=this._objects,e=t.length,i=this.nCachedObjects_,n=this._indicesByUUID,r=this._bindings,o=r.length,a=0,s=arguments.length;a!==s;++a){var l=arguments[a],u=l.uuid,h=n[u];if(void 0!==h)if(delete n[u],h<i){var c=--i,d=t[c],p=t[y=--e];n[d.uuid]=h,t[h]=d,n[p.uuid]=c,t[c]=p,t.pop();for(var f=0,m=o;f!==m;++f){var g=(b=r[f])[c],v=b[y];b[h]=g,b[c]=v,b.pop()}}else{var y;n[(p=t[y=--e]).uuid]=h,t[h]=p,t.pop();for(f=0,m=o;f!==m;++f){var b;(b=r[f])[h]=b[y],b.pop()}}}this.nCachedObjects_=i},subscribe_:function(t,e){var i=this._bindingsIndicesByPath,n=i[t],r=this._bindings;if(void 0!==n)return r[n];var o=this._paths,a=this._parsedPaths,s=this._objects,l=s.length,u=this.nCachedObjects_,h=new Array(l);n=r.length,i[t]=n,o.push(t),a.push(e),r.push(h);for(var c=u,d=s.length;c!==d;++c){var p=s[c];h[c]=new yu(p,t,e)}return h},unsubscribe_:function(t){var e=this._bindingsIndicesByPath,i=e[t];if(void 0!==i){var n=this._paths,r=this._parsedPaths,o=this._bindings,a=o.length-1,s=o[a];e[t[a]]=i,o[i]=s,o.pop(),r[i]=r[a],r.pop(),n[i]=n[a],n.pop()}}}),Object.assign(wu.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,i){if(t.fadeOut(e),this.fadeIn(e),i){var n=this._clip.duration,r=t._clip.duration,o=r/n,a=n/r;t.warp(1,o,e),this.warp(a,1,e)}return this},crossFadeTo:function(t,e,i){return t.crossFadeFrom(this,e,i)},stopFading:function(){var t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._effectiveTimeScale,0,t)},warp:function(t,e,i){var n=this._mixer,r=n.time,o=this._timeScaleInterpolant,a=this.timeScale;null===o&&(o=n._lendControlInterpolant(),this._timeScaleInterpolant=o);var s=o.parameterPositions,l=o.sampleValues;return s[0]=r,s[1]=r+i,l[0]=t/a,l[1]=e/a,this},stopWarping:function(){var t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,i,n){if(this.enabled){var r=this._startTime;if(null!==r){var o=(t-r)*i;if(o<0||0===i)return;this._startTime=null,e=i*o}e*=this._updateTimeScale(t);var a=this._updateTime(e),s=this._updateWeight(t);if(s>0)for(var l=this._interpolants,u=this._propertyBindings,h=0,c=l.length;h!==c;++h)l[h].evaluate(a),u[h].accumulate(n,s)}else this._updateWeight(t)},_updateWeight:function(t){var e=0;if(this.enabled){e=this.weight;var i=this._weightInterpolant;if(null!==i){var n=i.evaluate(t)[0];e*=n,t>i.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){var e=0;if(!this.paused){e=this.timeScale;var i=this._timeScaleInterpolant;if(null!==i)e*=i.evaluate(t)[0],t>i.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}return this._effectiveTimeScale=e,e},_updateTime:function(t){var e=this.time+t,i=this._clip.duration,n=this.loop,r=this._loopCount,o=n===Ae;if(0===t)return-1===r?e:o&&1==(1&r)?i-e:e;if(n===Se){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(e>=i)e=i;else{if(!(e<0))break t;e=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),e>=i||e<0){var a=Math.floor(e/i);e-=i*a,r+=Math.abs(a);var s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,e=t>0?i:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){var l=t<0;this._setEndings(l,!l,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}if(o&&1==(1&r))return this.time=e,i-e}return this.time=e,e},_setEndings:function(t,e,i){var n=this._interpolantSettings;i?(n.endingStart=Le,n.endingEnd=Le):(n.endingStart=t?this.zeroSlopeAtStart?Le:De:Oe,n.endingEnd=e?this.zeroSlopeAtEnd?Le:De:Oe)},_scheduleFading:function(t,e,i){var n=this._mixer,r=n.time,o=this._weightInterpolant;null===o&&(o=n._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=r,s[0]=e,a[1]=r+t,s[1]=i,this}}),xu.prototype=Object.assign(Object.create(n.prototype),{constructor:xu,_bindAction:function(t,e){var i=t._localRoot||this._root,n=t._clip.tracks,r=n.length,o=t._propertyBindings,a=t._interpolants,s=i.uuid,l=this._bindingsByRootAndName,u=l[s];void 0===u&&(u={},l[s]=u);for(var h=0;h!==r;++h){var c=n[h],d=c.name,p=u[d];if(void 0!==p)o[h]=p;else{if(void 0!==(p=o[h])){null===p._cacheIndex&&(++p.referenceCount,this._addInactiveBinding(p,s,d));continue}var f=e&&e._propertyBindings[h].binding.parsedPath;++(p=new iu(yu.create(i,d,f),c.ValueTypeName,c.getValueSize())).referenceCount,this._addInactiveBinding(p,s,d),o[h]=p}a[h].resultBuffer=p.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){var e=(t._localRoot||this._root).uuid,i=t._clip.uuid,n=this._actionsByClip[i];this._bindAction(t,n&&n.knownActions[0]),this._addInactiveAction(t,i,e)}for(var r=t._propertyBindings,o=0,a=r.length;o!==a;++o){var s=r[o];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){for(var e=t._propertyBindings,i=0,n=e.length;i!==n;++i){var r=e[i];0==--r.useCount&&(r.restoreOriginalState(),this._takeBackBinding(r))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){var e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,i){var n=this._actions,r=this._actionsByClip,o=r[e];if(void 0===o)o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=o;else{var a=o.knownActions;t._byClipCacheIndex=a.length,a.push(t)}t._cacheIndex=n.length,n.push(t),o.actionByRoot[i]=t},_removeInactiveAction:function(t){var e=this._actions,i=e[e.length-1],n=t._cacheIndex;i._cacheIndex=n,e[n]=i,e.pop(),t._cacheIndex=null;var r=t._clip.uuid,o=this._actionsByClip,a=o[r],s=a.knownActions,l=s[s.length-1],u=t._byClipCacheIndex;l._byClipCacheIndex=u,s[u]=l,s.pop(),t._byClipCacheIndex=null,delete a.actionByRoot[(t._localRoot||this._root).uuid],0===s.length&&delete o[r],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){for(var e=t._propertyBindings,i=0,n=e.length;i!==n;++i){var r=e[i];0==--r.referenceCount&&this._removeInactiveBinding(r)}},_lendAction:function(t){var 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:function(t){var 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:function(t,e,i){var n=this._bindingsByRootAndName,r=n[e],o=this._bindings;void 0===r&&(r={},n[e]=r),r[i]=t,t._cacheIndex=o.length,o.push(t)},_removeInactiveBinding:function(t){var e=this._bindings,i=t.binding,n=i.rootNode.uuid,r=i.path,o=this._bindingsByRootAndName,a=o[n],s=e[e.length-1],l=t._cacheIndex;s._cacheIndex=l,e[l]=s,e.pop(),delete a[r];t:{for(var u in a)break t;delete o[n]}},_lendBinding:function(t){var 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:function(t){var 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:function(){var t=this._controlInterpolants,e=this._nActiveControlInterpolants++,i=t[e];return void 0===i&&((i=new ms(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=e,t[e]=i),i},_takeBackControlInterpolant:function(t){var e=this._controlInterpolants,i=t.__cacheIndex,n=--this._nActiveControlInterpolants,r=e[n];t.__cacheIndex=n,e[n]=t,r.__cacheIndex=i,e[i]=r},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e){var i=e||this._root,n=i.uuid,r="string"==typeof t?_s.findByName(i,t):t,o=null!==r?r.uuid:t,a=this._actionsByClip[o],s=null;if(void 0!==a){var l=a.actionByRoot[n];if(void 0!==l)return l;s=a.knownActions[0],null===r&&(r=s._clip)}if(null===r)return null;var u=new wu(this,r,e);return this._bindAction(u,s),this._addInactiveAction(u,o,n),u},existingAction:function(t,e){var i=e||this._root,n=i.uuid,r="string"==typeof t?_s.findByName(i,t):t,o=r?r.uuid:t,a=this._actionsByClip[o];return void 0!==a&&a.actionByRoot[n]||null},stopAllAction:function(){var t=this._actions,e=this._nActiveActions,i=this._bindings,n=this._nActiveBindings;this._nActiveActions=0,this._nActiveBindings=0;for(var r=0;r!==e;++r)t[r].reset();for(r=0;r!==n;++r)i[r].useCount=0;return this},update:function(t){t*=this.timeScale;for(var e=this._actions,i=this._nActiveActions,n=this.time+=t,r=Math.sign(t),o=this._accuIndex^=1,a=0;a!==i;++a){e[a]._update(n,t,r,o)}var s=this._bindings,l=this._nActiveBindings;for(a=0;a!==l;++a)s[a].apply(o);return this},getRoot:function(){return this._root},uncacheClip:function(t){var e=this._actions,i=t.uuid,n=this._actionsByClip,r=n[i];if(void 0!==r){for(var o=r.knownActions,a=0,s=o.length;a!==s;++a){var l=o[a];this._deactivateAction(l);var u=l._cacheIndex,h=e[e.length-1];l._cacheIndex=null,l._byClipCacheIndex=null,h._cacheIndex=u,e[u]=h,e.pop(),this._removeInactiveBindingsForAction(l)}delete n[i]}},uncacheRoot:function(t){var e=t.uuid,i=this._actionsByClip;for(var n in i){var r=i[n].actionByRoot[e];void 0!==r&&(this._deactivateAction(r),this._removeInactiveAction(r))}var o=this._bindingsByRootAndName[e];if(void 0!==o)for(var a in o){var s=o[a];s.restoreOriginalState(),this._removeInactiveBinding(s)}},uncacheAction:function(t,e){var i=this.existingAction(t,e);null!==i&&(this._deactivateAction(i),this._removeInactiveAction(i))}}),Mu.prototype.clone=function(){return new Mu(void 0===this.value.clone?this.value:this.value.clone())},Tu.prototype=Object.assign(Object.create(nn.prototype),{constructor:Tu,isInstancedBufferGeometry:!0,copy:function(t){return nn.prototype.copy.call(this,t),this.maxInstancedCount=t.maxInstancedCount,this},clone:function(){return(new this.constructor).copy(this)}}),Su.prototype=Object.assign(Object.create(So.prototype),{constructor:Su,isInstancedInterleavedBuffer:!0,copy:function(t){return So.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),_u.prototype=Object.assign(Object.create(Hi.prototype),{constructor:_u,isInstancedBufferAttribute:!0,copy:function(t){return Hi.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this}}),Object.assign(Au.prototype,{linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize()):e&&e.isOrthographicCamera&&(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld))},intersectObject:function(t,e,i){var n=i||[];return Cu(t,this,n,e),n.sort(Pu),n},intersectObjects:function(t,e,i){var n=i||[];if(!1===Array.isArray(t))return n;for(var r=0,o=t.length;r<o;r++)Cu(t[r],this,n,e);return n.sort(Pu),n}}),Object.assign(Eu.prototype,{set:function(t,e,i){return this.radius=t,this.phi=e,this.theta=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this},makeSafe:function(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,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(Xe.clamp(e/this.radius,-1,1))),this}}),Object.assign(Du.prototype,{set:function(t,e,i){return this.radius=t,this.theta=e,this.y=i,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,i){return this.radius=Math.sqrt(t*t+i*i),this.theta=Math.atan2(t,i),this.y=e,this}}),Object.assign(Lu.prototype,{set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var t=new Ze;return function(e,i){var n=t.copy(i).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(t){return void 0===t&&(t=new Ze),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(t=new Ze),this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return void 0===e&&(e=new Ze),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,e){return void 0===e&&(e=new Ze),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var t=new Ze;return function(e){return t.copy(e).clamp(this.min,this.max).sub(e).length()}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}}),Object.assign(Ou.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(t=new Je),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(t=new Je),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(e=new Je),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:(cu=new Je,du=new Je,function(t,e){cu.subVectors(t,this.start),du.subVectors(this.end,this.start);var i=du.dot(du),n=du.dot(cu)/i;return e&&(n=Xe.clamp(n,0,1)),n}),closestPointToPoint:function(t,e,i){var n=this.closestPointToPointParameter(t,e);return void 0===i&&(i=new Je),this.delta(i).multiplyScalar(n).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),Iu.prototype=Object.create(Bi.prototype),Iu.prototype.constructor=Iu,Iu.prototype.isImmediateRenderObject=!0,Ru.prototype=Object.create(Ro.prototype),Ru.prototype.constructor=Ru,Ru.prototype.update=function(){var t=new Je,e=new Je,i=new $e;return function(){var n=["a","b","c"];this.object.updateMatrixWorld(!0),i.getNormalMatrix(this.object.matrixWorld);var r=this.object.matrixWorld,o=this.geometry.attributes.position,a=this.object.geometry;if(a&&a.isGeometry)for(var s=a.vertices,l=a.faces,u=0,h=0,c=l.length;h<c;h++)for(var d=l[h],p=0,f=d.vertexNormals.length;p<f;p++){var m=s[d[n[p]]],g=d.vertexNormals[p];t.copy(m).applyMatrix4(r),e.copy(g).applyMatrix3(i).normalize().multiplyScalar(this.size).add(t),o.setXYZ(u,t.x,t.y,t.z),u+=1,o.setXYZ(u,e.x,e.y,e.z),u+=1}else if(a&&a.isBufferGeometry){var v=a.attributes.position,y=a.attributes.normal;for(u=0,p=0,f=v.count;p<f;p++)t.set(v.getX(p),v.getY(p),v.getZ(p)).applyMatrix4(r),e.set(y.getX(p),y.getY(p),y.getZ(p)),e.applyMatrix3(i).normalize().multiplyScalar(this.size).add(t),o.setXYZ(u,t.x,t.y,t.z),u+=1,o.setXYZ(u,e.x,e.y,e.z),u+=1}o.needsUpdate=!0}}(),Nu.prototype=Object.create(Bi.prototype),Nu.prototype.constructor=Nu,Nu.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},Nu.prototype.update=function(){var t=new Je;return function(){this.light.updateMatrixWorld();var e=this.light.distance?this.light.distance:1e3,i=e*Math.tan(this.light.angle);this.cone.scale.set(i,i,e),t.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(t),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}(),ku.prototype=Object.create(Ro.prototype),ku.prototype.constructor=ku,ku.prototype.updateMatrixWorld=function(){var t=new Je,e=new Ke,i=new Ke;return function(n){var r=this.bones,o=this.geometry,a=o.getAttribute("position");i.getInverse(this.root.matrixWorld);for(var s=0,l=0;s<r.length;s++){var u=r[s];u.parent&&u.parent.isBone&&(e.multiplyMatrices(i,u.matrixWorld),t.setFromMatrixPosition(e),a.setXYZ(l,t.x,t.y,t.z),e.multiplyMatrices(i,u.parent.matrixWorld),t.setFromMatrixPosition(e),a.setXYZ(l+1,t.x,t.y,t.z),l+=2)}o.getAttribute("position").needsUpdate=!0,Bi.prototype.updateMatrixWorld.call(this,n)}}(),Fu.prototype=Object.create(An.prototype),Fu.prototype.constructor=Fu,Fu.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},Fu.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)},Bu.prototype=Object.create(Io.prototype),Bu.prototype.constructor=Bu,Bu.prototype.update=function(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),void 0!==this.color)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);var t=this.material.color,e=Math.max(t.r,t.g,t.b);e>1&&t.multiplyScalar(1/e),this.children[0].material.color.copy(this.material.color)}},Bu.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()},zu.prototype=Object.create(Bi.prototype),zu.prototype.constructor=zu,zu.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},zu.prototype.update=function(){var t=new Je,e=new Si,i=new Si;return function(){var n=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{var r=n.geometry.getAttribute("color");e.copy(this.light.color),i.copy(this.light.groundColor);for(var o=0,a=r.count;o<a;o++){var s=o<a/2?e:i;r.setXYZ(o,s.r,s.g,s.b)}r.needsUpdate=!0}n.lookAt(t.setFromMatrixPosition(this.light.matrixWorld).negate())}}(),Uu.prototype=Object.create(Ro.prototype),Uu.prototype.constructor=Uu,Vu.prototype=Object.create(Ro.prototype),Vu.prototype.constructor=Vu,ju.prototype=Object.create(Ro.prototype),ju.prototype.constructor=ju,ju.prototype.update=function(){var t=new Je,e=new Je,i=new $e;return function(){this.object.updateMatrixWorld(!0),i.getNormalMatrix(this.object.matrixWorld);for(var n=this.object.matrixWorld,r=this.geometry.attributes.position,o=this.object.geometry,a=o.vertices,s=o.faces,l=0,u=0,h=s.length;u<h;u++){var c=s[u],d=c.normal;t.copy(a[c.a]).add(a[c.b]).add(a[c.c]).divideScalar(3).applyMatrix4(n),e.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(t),r.setXYZ(l,t.x,t.y,t.z),l+=1,r.setXYZ(l,e.x,e.y,e.z),l+=1}r.needsUpdate=!0}}(),Hu.prototype=Object.create(Bi.prototype),Hu.prototype.constructor=Hu,Hu.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},Hu.prototype.update=function(){var t=new Je,e=new Je,i=new Je;return function(){t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),i.subVectors(e,t),this.lightPlane.lookAt(e),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(e),this.targetLine.scale.z=i.length()}}(),Gu.prototype=Object.create(Ro.prototype),Gu.prototype.constructor=Gu,Gu.prototype.update=function(){var t,e,i=new Je,n=new oo;function r(r,o,a,s){i.set(o,a,s).unproject(n);var l=e[r];if(void 0!==l)for(var u=t.getAttribute("position"),h=0,c=l.length;h<c;h++)u.setXYZ(l[h],i.x,i.y,i.z)}return function(){t=this.geometry,e=this.pointMap;n.projectionMatrix.copy(this.camera.projectionMatrix),r("c",0,0,-1),r("t",0,0,1),r("n1",-1,-1,-1),r("n2",1,-1,-1),r("n3",-1,1,-1),r("n4",1,1,-1),r("f1",-1,-1,1),r("f2",1,-1,1),r("f3",-1,1,1),r("f4",1,1,1),r("u1",.7,1.1,-1),r("u2",-.7,1.1,-1),r("u3",0,2,-1),r("cf1",-1,0,1),r("cf2",1,0,1),r("cf3",0,-1,1),r("cf4",0,1,1),r("cn1",-1,0,-1),r("cn2",1,0,-1),r("cn3",0,-1,-1),r("cn4",0,1,-1),t.getAttribute("position").needsUpdate=!0}}(),Wu.prototype=Object.create(Ro.prototype),Wu.prototype.constructor=Wu,Wu.prototype.update=function(){var t=new di;return function(e){if(void 0!==this.object&&t.setFromObject(this.object),!t.isEmpty()){var i=t.min,n=t.max,r=this.geometry.attributes.position,o=r.array;o[0]=n.x,o[1]=n.y,o[2]=n.z,o[3]=i.x,o[4]=n.y,o[5]=n.z,o[6]=i.x,o[7]=i.y,o[8]=n.z,o[9]=n.x,o[10]=i.y,o[11]=n.z,o[12]=n.x,o[13]=n.y,o[14]=i.z,o[15]=i.x,o[16]=n.y,o[17]=i.z,o[18]=i.x,o[19]=i.y,o[20]=i.z,o[21]=n.x,o[22]=i.y,o[23]=i.z,r.needsUpdate=!0,this.geometry.computeBoundingSphere()}}}(),Wu.prototype.setFromObject=function(t){return this.object=t,this.update(),this},Wu.prototype.copy=function(t){return Ro.prototype.copy.call(this,t),this.object=t.object,this},Wu.prototype.clone=function(){return(new this.constructor).copy(this)},qu.prototype=Object.create(Ro.prototype),qu.prototype.constructor=qu,qu.prototype.updateMatrixWorld=function(t){var e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),Bi.prototype.updateMatrixWorld.call(this,t))},Yu.prototype=Object.create(Io.prototype),Yu.prototype.constructor=Yu,Yu.prototype.updateMatrixWorld=function(t){var e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?_:S,this.lookAt(this.plane.normal),Bi.prototype.updateMatrixWorld.call(this,t)},Xu.prototype=Object.create(Bi.prototype),Xu.prototype.constructor=Xu,Xu.prototype.setDirection=(gu=new Je,function(t){t.y>.99999?this.quaternion.set(0,0,0,1):t.y<-.99999?this.quaternion.set(1,0,0,0):(gu.set(t.z,0,-t.x).normalize(),mu=Math.acos(t.y),this.quaternion.setFromAxisAngle(gu,mu))}),Xu.prototype.setLength=function(t,e,i){void 0===e&&(e=.2*t),void 0===i&&(i=.2*e),this.line.scale.set(1,Math.max(0,t-e),1),this.line.updateMatrix(),this.cone.scale.set(i,e,i),this.cone.position.y=t,this.cone.updateMatrix()},Xu.prototype.setColor=function(t){this.line.material.color.copy(t),this.cone.material.color.copy(t)},Xu.prototype.copy=function(t){return Bi.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},Xu.prototype.clone=function(){return(new this.constructor).copy(this)},Zu.prototype=Object.create(Ro.prototype),Zu.prototype.constructor=Zu;var Qu=0,Ju=1;function $u(t){return t}function th(t){return void 0===t&&(t=[]),t.isMultiMaterial=!0,t.materials=t,t.clone=function(){return t.slice()},t}function eh(t,e){return new Fo(t,e)}function ih(t){return new Po(t)}function nh(t,e){return new Fo(t,e)}function rh(t){return new ko(t)}function oh(t){return new ko(t)}function ah(t){return new ko(t)}function sh(t,e,i){return new Je(t,e,i)}function lh(t,e){return new Hi(t,e).setDynamic(!0)}function uh(t,e){return new Gi(t,e)}function hh(t,e){return new Wi(t,e)}function ch(t,e){return new qi(t,e)}function dh(t,e){return new Yi(t,e)}function ph(t,e){return new Xi(t,e)}function fh(t,e){return new Zi(t,e)}function mh(t,e){return new Ki(t,e)}function gh(t,e){return new Qi(t,e)}function vh(t,e){return new Ji(t,e)}function yh(t){qs.call(this,t),this.type="catmullrom",this.closed=!0}function bh(t){qs.call(this,t),this.type="catmullrom"}function wh(t){qs.call(this,t),this.type="catmullrom"}function xh(t){return new Zu(t)}function Mh(t,e){return new Wu(t,e)}function Th(t,e){return new Ro(new Ya(t.geometry),new Oo({color:void 0!==e?e:16777215}))}function Sh(t,e){return new Ro(new jo(t.geometry),new Oo({color:void 0!==e?e:16777215}))}function _h(t){return new Ls(t)}function Ah(t){return new Rs(t)}Bs.create=function(t,e){return t.prototype=Object.create(Bs.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(rl.prototype,{createPointsGeometry:function(t){var e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){var e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){for(var e=new ji,i=0,n=t.length;i<n;i++){var r=t[i];e.vertices.push(new Je(r.x,r.y,r.z||0))}return e}}),Object.assign(ol.prototype,{fromPoints:function(t){this.setFromPoints(t)}}),yh.prototype=Object.create(qs.prototype),bh.prototype=Object.create(qs.prototype),wh.prototype=Object.create(qs.prototype),Object.assign(wh.prototype,{initFromArray:function(){},getControlPointsArray:function(){},reparametrizeByArcLength:function(){}}),Uu.prototype.setColors=function(){},ku.prototype.update=function(){},Object.assign(kl.prototype,{extractUrlBase:function(t){return bl.extractUrlBase(t)}}),Object.assign(Ml.prototype,{setTexturePath:function(t){return this.setResourcePath(t)}}),Object.assign(Lu.prototype,{center:function(t){return this.getCenter(t)},empty:function(){return this.isEmpty()},isIntersectionBox:function(t){return this.intersectsBox(t)},size:function(t){return this.getSize(t)}}),Object.assign(di.prototype,{center:function(t){return this.getCenter(t)},empty:function(){return this.isEmpty()},isIntersectionBox:function(t){return this.intersectsBox(t)},isIntersectionSphere:function(t){return this.intersectsSphere(t)},size:function(t){return this.getSize(t)}}),Ou.prototype.center=function(t){return this.getCenter(t)},Object.assign(Xe,{random16:function(){return Math.random()},nearestPowerOfTwo:function(t){return Xe.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return Xe.ceilPowerOfTwo(t)}}),Object.assign($e.prototype,{flattenToArrayOffset:function(t,e){return this.toArray(t,e)},multiplyVector3:function(t){return t.applyMatrix3(this)},multiplyVector3Array:function(){},applyToBuffer:function(t){return this.applyToBufferAttribute(t)},applyToVector3Array:function(){}}),Object.assign(Ke.prototype,{extractPosition:function(t){return this.copyPosition(t)},flattenToArrayOffset:function(t,e){return this.toArray(t,e)},getPosition:function(){var t;return function(){return void 0===t&&(t=new Je),t.setFromMatrixColumn(this,3)}}(),setRotationFromQuaternion:function(t){return this.makeRotationFromQuaternion(t)},multiplyToArray:function(){},multiplyVector3:function(t){return t.applyMatrix4(this)},multiplyVector4:function(t){return t.applyMatrix4(this)},multiplyVector3Array:function(){},rotateAxis:function(t){t.transformDirection(this)},crossVector:function(t){return t.applyMatrix4(this)},translate:function(){},rotateX:function(){},rotateY:function(){},rotateZ:function(){},rotateByAxis:function(){},applyToBuffer:function(t){return this.applyToBufferAttribute(t)},applyToVector3Array:function(){},makeFrustum:function(t,e,i,n,r,o){return this.makePerspective(t,e,n,i,r,o)}}),fi.prototype.isIntersectionLine=function(t){return this.intersectsLine(t)},Qe.prototype.multiplyVector3=function(t){return t.applyQuaternion(this)},Object.assign(Tn.prototype,{isIntersectionBox:function(t){return this.intersectsBox(t)},isIntersectionPlane:function(t){return this.intersectsPlane(t)},isIntersectionSphere:function(t){return this.intersectsSphere(t)}}),Object.assign(Sn.prototype,{area:function(){return this.getArea()},barycoordFromPoint:function(t,e){return this.getBarycoord(t,e)},midpoint:function(t){return this.getMidpoint(t)},normal:function(t){return this.getNormal(t)},plane:function(t){return this.getPlane(t)}}),Object.assign(Sn,{barycoordFromPoint:function(t,e,i,n,r){return Sn.getBarycoord(t,e,i,n,r)},normal:function(t,e,i,n){return Sn.getNormal(t,e,i,n)}}),Object.assign(al.prototype,{extractAllPoints:function(t){return this.extractPoints(t)},extrude:function(t){return new Oa(this,t)},makeGeometry:function(t){return new Ga(this,t)}}),Object.assign(Ze.prototype,{fromAttribute:function(t,e,i){return this.fromBufferAttribute(t,e,i)},distanceToManhattan:function(t){return this.manhattanDistanceTo(t)},lengthManhattan:function(){return this.manhattanLength()}}),Object.assign(Je.prototype,{setEulerFromRotationMatrix:function(){},setEulerFromQuaternion:function(){},getPositionFromMatrix:function(t){return this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return this.setFromMatrixColumn(e,t)},applyProjection:function(t){return this.applyMatrix4(t)},fromAttribute:function(t,e,i){return this.fromBufferAttribute(t,e,i)},distanceToManhattan:function(t){return this.manhattanDistanceTo(t)},lengthManhattan:function(){return this.manhattanLength()}}),Object.assign(li.prototype,{fromAttribute:function(t,e,i){return this.fromBufferAttribute(t,e,i)},lengthManhattan:function(){return this.manhattanLength()}}),Object.assign(ji.prototype,{computeTangents:function(){},computeLineDistances:function(){}}),Object.assign(Bi.prototype,{getChildByName:function(t){return this.getObjectByName(t)},renderDepth:function(){},translate:function(t,e){return this.translateOnAxis(e,t)},getWorldRotation:function(){}}),Object.defineProperties(Bi.prototype,{eulerOrder:{get:function(){return this.rotation.order},set:function(t){this.rotation.order=t}},useQuaternion:{get:function(){},set:function(){}}}),Object.defineProperties(Co.prototype,{objects:{get:function(){return this.levels}}}),Object.defineProperty(Do.prototype,"useVertexTexture",{get:function(){},set:function(){}}),Eo.prototype.initBones=function(){},Object.defineProperty(Bs.prototype,"__arcLengthDivisions",{get:function(){return this.arcLengthDivisions},set:function(t){this.arcLengthDivisions=t}}),ao.prototype.setLens=function(t,e){void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(sl.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(Hi.prototype,{length:{get:function(){return this.array.length}},copyIndicesArray:function(){}}),Object.assign(nn.prototype,{addIndex:function(t){this.setIndex(t)},addDrawCall:function(t,e,i){this.addGroup(t,e)},clearDrawCalls:function(){this.clearGroups()},computeTangents:function(){},computeOffsets:function(){}}),Object.defineProperties(nn.prototype,{drawcalls:{get:function(){return this.groups}},offsets:{get:function(){return this.groups}}}),Object.assign(Ia.prototype,{getArrays:function(){},addShapeList:function(){},addShape:function(){}}),Object.defineProperties(Mu.prototype,{dynamic:{set:function(){}},onUpdate:{value:function(){return this}}}),Object.defineProperties(xn.prototype,{wrapAround:{get:function(){},set:function(){}},overdraw:{get:function(){},set:function(){}},wrapRGB:{get:function(){return new Si}},shading:{get:function(){},set:function(t){this.flatShading=t===P}}}),Object.defineProperties(os.prototype,{metal:{get:function(){return!1},set:function(){}}}),Object.defineProperties(Mn.prototype,{derivatives:{get:function(){return this.extensions.derivatives},set:function(t){this.extensions.derivatives=t}}}),Object.assign(wo.prototype,{clearTarget:function(t,e,i,n){this.setRenderTarget(t),this.clear(e,i,n)},animate:function(t){this.setAnimationLoop(t)},getCurrentRenderTarget:function(){return this.getRenderTarget()},getMaxAnisotropy:function(){return this.capabilities.getMaxAnisotropy()},getPrecision:function(){return this.capabilities.precision},resetGLState:function(){return this.state.reset()},supportsFloatTextures:function(){return this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return this.capabilities.vertexTextures},supportsInstancedArrays:function(){return this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){this.setScissorTest(t)},initMaterial:function(){},addPrePlugin:function(){},addPostPlugin:function(){},updateShadowMap:function(){},setFaceCulling:function(){}}),Object.defineProperties(wo.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(){}}}),Object.defineProperties(to.prototype,{cullFace:{get:function(){},set:function(){}},renderReverseSided:{get:function(){},set:function(){}},renderSingleSided:{get:function(){},set:function(){}}}),Object.defineProperties(ui.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}}}),Object.defineProperties(yo.prototype,{standing:{set:function(){}},userHeight:{set:function(){}}}),$l.prototype.load=function(t){var e=this;return(new Xl).load(t,(function(t){e.setBuffer(t)})),this},eu.prototype.getData=function(){return this.getFrequencyData()},Kl.prototype.updateCubeMap=function(t,e){return this.update(t,e)};var Ph={merge:function(t,e,i){var n;e.isMesh&&(e.matrixAutoUpdate&&e.updateMatrix(),n=e.matrix,e=e.geometry),t.merge(e,n,i)},center:function(t){return t.center()}};function Ch(){this.projectVector=function(t,e){t.project(e)},this.unprojectVector=function(t,e){t.unproject(e)},this.pickingRay=function(){}}function Eh(){}function Dh(){}oi.crossOrigin=void 0,oi.loadTexture=function(t,e,i,n){var r=new Fs;r.setCrossOrigin(this.crossOrigin);var o=r.load(t,i,void 0,n);return e&&(o.mapping=e),o},oi.loadTextureCube=function(t,e,i,n){var r=new ks;r.setCrossOrigin(this.crossOrigin);var o=r.load(t,i,void 0,n);return e&&(o.mapping=e),o},oi.loadCompressedTexture=function(){},oi.loadCompressedTextureCube=function(){};var Lh={createMultiMaterialObject:function(){},detach:function(){},attach:function(){}};function Oh(){}},function(t,e,i){var n=i(0),r=i(3),o=i(5),a=i(101),s=i(102),l=i(24),u=i(15),h=i(7),c=i(25),d=i(26),p={delBK:!0,delBKEdit:!1,isNewServerPreviewVersion:!1,isNewEditVersion:!1,isCleanUI:0,jfedit:!1,screenshot:!1,unit_type:0,unit_conversion_value:1,unit_name:"m",unit_sq_name:"m²",debug:!1,isLocalVersion:!1,vrDebug:!1,fpsOn:!1,adjustCompass:!1,adjustColor:!1,newbarrage:!0,wscdn:!0,thirdCustomer:-1,version:"2.11.9-0-ga9537d5",pageTitle:"众趣科技",authorizationHeader:c.getAuthorizationHeader(),autoplay:r.valueFromHash("play",!0),logLevel:r.valueFromHash("log",2),showLog:r.valueFromHash("db",0),skyboxRadius:250,modelBoundsPadding:5,showNeighbors:!1,brand:r.valueFromHash("brand",!0),mls:r.valueFromHash("mls",0),showHighlights:r.valueFromHash("hhl",!0),startHighlights:r.valueFromHash("hl",!1),specialEdition:r.valueFromHash("bn",0),showTitleContainer:r.valueFromHash("title",!0),useWheel:r.valueFromHash("wh",!0),crossOrigin:"anonymous",fancierTransition:!0,wireframe:!0,skyboxWireframe:!0,modelAlpha:1,highlightPanoSelection:!1,showSweeps:!0,showSkyboxes:!0,showMesh:!0,showFloors:!0,showFloorDuration:300,showFloorDelay:300,hideFloorDuration:300,hideFloorDelay:0,reticuleOpacityTransitionTime:250,reticuleColor:s.yellow,markerOpacityTransitionTime:500,guiAnimationSpeed:250,highlightAnimationDuration:500,barfadeAnimationDuration:300,modelComponentLoadSpinnerDelay:150,captureErrors:!1,maxMobileTextures:10,startupFlyinDelay:3e3,dollhouseDefault:{minDistance:5,maxDistance:50,minPolarAngle:n.Math.degToRad(10),maxPolarAngle:n.Math.degToRad(65)},hideReticuleTimeout:1e3,titletagMaxdistance:5,analytics:{inactivityThreshold:30,sessionTrackingRate:.15,maxTrackedErrors:20,sessionDurationPingFrequency:10,sessionDurationTimeout:15},flydown:{movementEasing:"easeInOutQuad",movementDelay:.001,rotationEasing:"easeInOutQuad",rotationDelay:.5,modelTextureDelay:.75,skyboxDelay:.75},transition:{flySpeed:.01,flyTime:800,flytimeMaxDistanceThreshold:5,flytimeDistanceMultiplier:150,aimTime:1150,aimSlowFactor:1.5,blur:.2,movementEasing:"easeInOutQuad",blendEasing:"easeInOutQuad",fastForwardFactor:1},show360Views:{enabled:!0,transitionTime:1e3},quickstart:{enabled:1===r.valueFromHash("qs",0),animation:1e3,showTextDelay:500,fadeOutDelay:1e3,fovChange:10},vr:{enabled:!1,option:r.valueFromHash("vr",a.CONTEXTUAL)},mattertags:{enabled:!0,enableLinking:!0,enablePanoSize:!0,startup:{hideUntilStart:!1,fadeInDuration:500,fadeInDelay:100},visibility:{anyDistance:!0,visibleDistance:8,cameraClearance:.1,alphaTestLevel:.05,hideViaFloor:!0,hideOffScreenDisc:!1,hideOffScreenObject:!1},disc:{opacity:.9,disabledOpacity:.5,scale:{nearBound:1.5,farBound:4.8,linkFarBound:!1,linkPercent:40,maxSize:80,minSize:40,baseViewportSize:800,buildingViewportSize:300,responsiveness:100}},pole:{enabled:!0,height:.5,width:2,opacity:.5,color:"white"},animation:{hoverOnClosing:!1,animInDelay:100,animOutDelay:50,animInTime:200,animOutTime:100},boardScale:{billboardScale:1,scaleToDisc:!0,boardToDiscRatio:1.2},navigate:{nearestPano:!0,lineOfSight:!0,reactivate:!0,aimAt:"disc",tiltTolerance:25,rotateSpeedFactor:.6}},path:{color:s.white,colorUp:s._desat(s.white,.5),colorDown:s._darken(s.white,.35),opacity:.5,style:"ribbon",height:.025,ribbonWidth:.24,outsideHeight:.5,waypointRadius:.5,waypointIndoorRadius:.24,waypointPulse:1e3,typ:l.BLACK,meshFree:r.valueFromHash("mf",0),mapGuides:r.valueFromHash("guides",!0),fadeInTime:400,fadeOutTime:300},warp:{nearPanoDist:.1,matchCam:!1,blur:.33,fastTime:1500,teleportTime:1500,outsideTime:2e3,lookAheadMax:.3,lookAheadDist:2.5,softPushDist:.37,softPushEnd:.3,softBendAngle:8,softBendTilt:4,softBendEnd:.3,doBurns:r.valueFromHash("kb",!0),burnsAngle:15,minBurnsAngle:6,minDownAngle:-35,maxTurnPerSec:280,maxAimPerSec:45,minRotation:12,maxAimRotation:33.2,turnFriction:.2,flySpeed:.01,minWarpTime:1200,warpInterruptionRedirectTime:500,tourStepDelay:r.valueFromHash("st",5e3),walkDelay:0,walkMaxDist:50,walkSlideShowThreshhold:3e3,walkExtraPanosDistance:.4,timePerMeter:800,motionLeadTime:500,movementEasing:"easeInOutQuad",blendEasing:"easeInOutQuad",showBunny:!1,loop:r.valueFromHash("lp",!0),auto:r.valueFromHash("ts",-1),eOrder:"YXZ",stepFactor:.25,brakeStrength:2,minBrakeAngle:.1,maxBrakeAngle:1.8,climbEffort:4,waitMultiplier1:4,waitMultiplier2:4},rotationFriction:.06,rotationAccelerationInside:4.5,rotationAccelerationOutside:.15,rotationAfterMoveMultiplier:60,rotationAfterMoveHistoryCount:5,panFriction:.09,panAccelerationOutside:60,onload:r.valueFromHash("onload",o.PANORAMA),zoomNearLimit:.1,zoomFarLimit:10,navigation:{panoScores:!1,mouseDirection:!0,filterStrictness:.75,angleFactor:-30,directionFactor:10,distanceFactor:-1,optionalityFactor:3},secretPanelWord:[38,38,40,40,37,39,37,39,66,65],console:r.valueFromHash("console",!1),noMeshFloorPositionOffset:new n.Vector3(0,-1.2,0),panoramaNeighbourMaxDistance:5,panoFloorClickRadius:.7,showScreenshotLocations:!1,showAxis:!0,showNeighbourRaycasts:!1,colorMarkerOnLoad:!1,colorMarkerByFloor:!1,tiling:{panoPreRenderRepeatDelay:2500,panoPreRenderDelay:500,preRenderTourPanos:r.valueFromHash("tileprerender",0),tilingFlagNames:["usetiles","tiles"],maxNavPanoQuality:r.valueFromHash("maxtileq",null),maxZoomPanoQuality:r.valueFromHash("maxztileq",null),overlayStyle:r.valueFromHash("tileoverlay",0),uploadIntervalDelay:r.valueFromHash("tileupdelay",10),initialIntervalDelay:r.valueFromHash("itiledelay",0),maxNonBaseUploadsPerFrame:r.valueFromHash("maxnbtpf",2),maxBaseUploadsPerFrame:r.valueFromHash("maxbtpf",6),customCompression:r.valueFromHash("tilecustcomp",0),mobileHighQualityOverride:!1,allowUltraHighResolution:!1},zoom:{enabled:!0,max:r.valueFromHash("maxzoom",8),min:r.valueFromHash("minzoom",1),transitionStyle:r.valueFromHash("zoomtrans",1),restoreTime:500,activationThreshold:1.1},panoramaSettings:{loading_2k:!1,screenshot_2k:!1,loading_fov82:!1,screenshot_fov82:!1}};(p=h.deepExtend(p,d,{panorama:{transitionTime:1300,modelAlpha:0,modelAlphaDelay:p.flydown.modelTextureDelay,modelAlphaLength:1,skyboxOpacity:1,skyboxOpacityDelay:p.flydown.skyboxDelay,skyboxOpacityLength:.9,fovLength:1,fovDelay:0,cameraMatrixDuration:.8,cameraMatrixDelay:0,cameraMatrixEase:u.easeInCubic,reticuleOpacity:1,markerOpacity:.6,markerOpacityOnHover:1},dollhouse:{transitionTime:1200,modelAlpha:1,modelAlphaDelay:0,modelAlphaLength:1-p.flydown.modelTextureDelay,skyboxOpacity:0,skyboxOpacityDelay:0,skyboxOpacityLength:1-p.flydown.skyboxDelay,fovLength:1,fovDelay:0,cameraMatrixDuration:.8,cameraMatrixDelay:.3,cameraMatrixEase:u.easeInCubic,reticuleOpacity:1,markerOpacity:0,markerOpacityOnHover:0},floorplan:{transitionTime:1e3,modelAlpha:1,modelAlphaDelay:0,modelAlphaLength:1-p.flydown.modelTextureDelay,skyboxOpacity:0,skyboxOpacityDelay:0,skyboxOpacityLength:1-p.flydown.skyboxDelay,fovLength:1,fovDelay:0,cameraMatrixDuration:.5,cameraMatrixDelay:0,cameraMatrixEase:u.easeOutCubic,reticuleOpacity:1,markerOpacity:0,markerOpacityOnHover:0},transitioning:{reticuleOpacity:0},"floorplan-dollhouse":{rotationDelay:0,rotationDuration:1},"floorplan-panorama":{rotationDelay:.5,rotationDuration:1},"dollhouse-panorama":{rotationDelay:.6,rotationDuration:1},"dollhouse-floorplan":{rotationDelay:0,rotationDuration:1,cameraMatrixDuration:1.05,cameraMatrixDelay:.5},"panorama-dollhouse":{rotationDelay:0,rotationDuration:.4},"panorama-floorplan":{transitionTime:1500,rotationDelay:0,rotationDuration:.5}})).path.meshFree&&(p.path.typ=l.WALK),t.exports=p},function(t,e,i){(function(e){var i=window.Raven;function n(t){var r,o,a,s,l=t.split("/"),u="["+l[l.length-1].replace(".js","")+"]",h={};if(n.consoleEnabled){var c=function(t){e("#debug-console").append("<p>"+t+"</p>"),e("#debug-console")[0].scrollTop=e("#debug-console")[0].scrollHeight};r=function(t){c(Array.prototype.slice.call(arguments).join(" "))},o=function(t){c(Array.prototype.slice.call(arguments).join(" "))},a=function(t){c("WARN: "+Array.prototype.slice.call(arguments).join(" "))},s=function(t){c("ERROR: "+Array.prototype.slice.call(arguments).join(" "))}}else console.debug?(r=console.debug,o=console.info?console.info:console.debug,a=console.warn?console.warn:console.debug,s=console.error?console.error:console.debug):r=o=a=s=function(){};var d=function(t){return[u,n.timestamp()].concat(Array.prototype.slice.call(t))},p=function(e,r){if(i){var o=Array.prototype.slice.call(e).join(" ");i.captureMessage(o,{level:r,path:t,timestamp:n.timestamp()})}},f=function(e,r){if(i){var o=Array.prototype.slice.call(e).join(" ");i.captureException(new Error(o),{level:r,path:t,timestamp:n.timestamp()})}};return{debug:function(){n.level>=n.levels.debug&&r.appply(console,d(arguments))},info:function(){n.level>=n.levels.info&&o.apply(console,d(arguments))},warn:function(){p(arguments,"warn"),n.level>=n.levels.warn&&a.apply(console,d(arguments))},error:function(){f(arguments,"error"),n.level>=n.levels.error&&s.apply(console,d(arguments))},v3str:function(t,e){var i=void 0===e?2:e;return"("+t.x.toPrecision(i)+", "+t.y.toPrecision(i)+", "+t.z.toPrecision(i)+")"},eulstr:function(t,e){var i=void 0===e?2:e;return"("+THREE.Math.radToDeg(t.x).toPrecision(i)+", "+THREE.Math.radToDeg(t.y).toPrecision(i)+", "+THREE.Math.radToDeg(t.z).toPrecision(i)+' "'+t.order+'")'},time:function(t){n.level>=n.levels.debug&&(h[t]=Date.now())},timeEnd:function(t){if(n.level>=n.levels.debug){var e=h[t];if(!e)return;var i=(Date.now()-e)/1e3;this.debug(t,i+"s")}}}}n.timestamp=function(){return(Date.now()-window.navigationStart)/1e3+"s"},n.levels={debug:3,info:2,warn:1,error:0},n.level=n.levels.info,t.exports=n}).call(this,i(6))},function(t,e,i){(function(e){function n(t,e){var i=window.navigator.userAgent.match(t);return i=i?i[1].split(e):[],{major:parseInt(i[0])||0,minor:parseInt(i[1])||0,patch:parseInt(i[2])||0}}var r=i(99);t.exports={isFullscreen:function(){return document.fullscreenElement||document.mozFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement},supportsFullscreen:function(){return document.fullscreenEnabled||document.mozFullscreenEnabled||document.mozFullScreenEnabled||document.webkitFullscreenEnabled||document.msFullscreenEnabled},isPointerLocked:function(){return document.pointerLockElement||document.mozPointerLockElement||document.webkitPointerLockElement},requestFullscreen:function(t,i){t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT):t.msRequestFullscreen&&t.msRequestFullscreen(),i&&e(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange",browser.requestPointerLock)},requestPointerLock:function(){var t;if(document.fullscreenElement)t=document.fullscreenElement();else if(document.mozFullscreenElement)t=document.mozFullscreenElement();else if(document.mozFullScreenElement)t=document.mozFullScreenElement();else{if(!document.webkitFullscreenElement)return;t=document.webkitFullscreenElement()}t.requestPointerLock=t.requestPointerLock||t.mozRequestPointerLock||t.webkitRequestPointerLock,t.requestPointerLock(),e(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange",this)},exitPointerLock:function(){document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,document.exitPointerLock()},exitFullscreen:function(){document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()},details:function(){var t=navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");return t?{name:t[1],version:parseInt(t[2]),platform:navigator.platform}:{}},is:function(t){return this.details()&&this.details().name===t},inIframe:function(){return window.parent!==window},aspectRatio:function(){var t=(window.renderWidth || window.innerWidth)/(window.renderHeight || window.innerHeight);return isFinite(t)?t:0},userAgent:function(){return window.navigator.userAgent},isMobile:function(){var t=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4))},isWeixin:function(){return"micromessenger"==navigator.userAgent.toLowerCase().match(/MicroMessenger/i)},isSmallScreen:function(){return screen.width/window.devicePixelRatio<240},detectIE:function(){return-1!==window.navigator.userAgent.indexOf("MSIE ")||!!navigator.userAgent.match(/Trident.*rv\:11\./)},detectSafari:function(){return-1!==window.navigator.userAgent.indexOf("Safari")&&!this.detectChrome()},detectFirefox:function(){return-1!==window.navigator.userAgent.indexOf("Firefox")},detectChrome:function(){return-1!==window.navigator.userAgent.indexOf("Chrome")&&!this.detectOpera()},detectOpera:function(){return-1!==window.navigator.userAgent.indexOf("OPR")},detectIOS:function(){var t=window.navigator.userAgent;return/iPad|iPhone|iPod/.test(t)},detectAndroid:function(){return-1!==window.navigator.userAgent.indexOf("Android")},detectAndroidMobile:function(){var t=window.navigator.userAgent;return this.detectAndroid()&&-1!==t.indexOf("Mobile")},detectSamsungNative:function(){var t=window.navigator.userAgent;return-1!==t.indexOf("SM-G900H")||-1!==t.indexOf("GT-I9500")||-1!==t.indexOf("SM-N900")},detectSamsungS6:function(){return-1!==window.navigator.userAgent.indexOf("SM-G92")},detectHUAWEI5X:function(){return-1!==window.navigator.userAgent.indexOf("KIW-TL00H")},iosVersion:function(){if(!this.detectIOS())throw new r("Did not detect an iDevice");return n(/((?:\d+\_?){1,3}) like Mac OS/,"_")},androidVersion:function(){if(!this.detectAndroid())throw new r("Did not detect an Android based device");return n(/Android ((?:\d+\.?){1,3})/,".")},valueFromCookie:function(t,e){var i=new RegExp(t+"=([0-9a-f]+)(; ?|$)").exec(document.cookie);if(!i)return e;var n=i[1];return"boolean"==typeof e?"true"===n||"1"===n:"number"==typeof e?parseFloat(n):n},valueFromHash:function(t,e){var i=new RegExp("[#&?]"+t+"=([^#&?]*)").exec(window.location.href);if(!i)return e;var n=i[1];return"boolean"==typeof e?"true"===n||"1"===n:"number"==typeof e?parseFloat(n):window.decodeURIComponent(n)},getAllValueFromSearch:function(){var t=window.location.search,e={};if(-1!==t.indexOf("?"))for(var i=t.substr(1).split("&"),n="",r=0;r<i.length;r++)e[(n=i[r].split("="))[0]]=unescape(n[1]);return e},getQueryString:function(t){var e=new RegExp("(^|&)"+t+"=([^&]*)(&|$)","i"),i=window.location.search.substr(1).match(e);return null!=i?decodeURI(i[2]):null},is_weixin:function(){return!!(-1!=navigator.userAgent.toLowerCase().indexOf("micromessenger"))},getUuid:function(){function t(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()},changeURLArg:function(t,e,i){var n=e+"=([^&]*)",r=e+"="+i;if(t.match(n)){var o="("+e+"=)([^&]*)",a=new RegExp(o,"gi");return o=t.replace(a,r)}return t.match("[?]")?t+"&"+r:t+"?"+r}}}).call(this,i(6))},function(t,e,i){"use strict";var n,r="object"==typeof Reflect?Reflect:null,o=r&&"function"==typeof r.apply?r.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise((function(i,n){function r(i){t.removeListener(e,o),n(i)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",r),i([].slice.call(arguments))}v(t,e,o,{once:!0}),"error"!==e&&function(t,e,i){"function"==typeof t.on&&v(t,"error",e,i)}(t,r,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var l=10;function u(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function h(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function c(t,e,i,n){var r,o,a;if(u(i),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),o=t._events),a=o[e]),void 0===a)a=o[e]=i,++t._eventsCount;else if("function"==typeof a?a=o[e]=n?[i,a]:[a,i]:n?a.unshift(i):a.push(i),(r=h(t))>0&&a.length>r&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=a.length,console&&console.warn}return t}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(t,e,i){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},r=d.bind(n);return r.listener=i,n.wrapFn=r,r}function f(t,e,i){var n=t._events;if(void 0===n)return[];var r=n[e];return void 0===r?[]:"function"==typeof r?i?[r.listener||r]:[r]:i?function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(r):g(r,r.length)}function m(t){var e=this._events;if(void 0!==e){var i=e[t];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function g(t,e){for(var i=new Array(e),n=0;n<e;++n)i[n]=t[n];return i}function v(t,e,i,n){if("function"==typeof t.on)n.once?t.once(e,i):t.on(e,i);else{if("function"!=typeof t.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t);t.addEventListener(e,(function r(o){n.once&&t.removeEventListener(e,r),i(o)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");l=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return h(this)},s.prototype.emit=function(t){for(var e=[],i=1;i<arguments.length;i++)e.push(arguments[i]);var n="error"===t,r=this._events;if(void 0!==r)n=n&&void 0===r.error;else if(!n)return!1;if(n){var a;if(e.length>0&&(a=e[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=r[t];if(void 0===l)return!1;if("function"==typeof l)o(l,this,e);else{var u=l.length,h=g(l,u);for(i=0;i<u;++i)o(h[i],this,e)}return!0},s.prototype.addListener=function(t,e){return c(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return c(this,t,e,!0)},s.prototype.once=function(t,e){return u(e),this.on(t,p(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){return u(e),this.prependListener(t,p(this,t,e)),this},s.prototype.removeListener=function(t,e){var i,n,r,o,a;if(u(e),void 0===(n=this._events))return this;if(void 0===(i=n[t]))return this;if(i===e||i.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){for(r=-1,o=i.length-1;o>=0;o--)if(i[o]===e||i[o].listener===e){a=i[o].listener,r=o;break}if(r<0)return this;0===r?i.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(i,r),1===i.length&&(n[t]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",t,a||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[t]),this;if(0===arguments.length){var r,o=Object.keys(i);for(n=0;n<o.length;++n)"removeListener"!==(r=o[n])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=i[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},s.prototype.listeners=function(t){return f(this,t,!0)},s.prototype.rawListeners=function(t){return f(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,i){var n=i(100);t.exports={PANORAMA:"panorama",DOLLHOUSE:"dollhouse",FLOORPLAN:"floorplan",MESH:"mesh",OUTDOOR:"outdoor",TRANSITIONING:"transitioning",toInt:function(t){switch(t){case this.PANORAMA:return 1;case this.DOLLHOUSE:return 2;case this.FLOORPLAN:return 3;case this.OUTDOOR:return 4;case this.TRANSITIONING:return-1}throw new n("No known conversion for Viewmode to int for mode: "+t)},fromInt:function(t){switch(t){case"1":case 1:return this.PANORAMA;case"2":case 2:return this.DOLLHOUSE;case"3":case 3:return this.FLOORPLAN;case"4":case 4:return this.OUTDOOR}throw new n("No known conversion for int to viewmode for int: "+t)},convertWorkshopModeInt:function(t){switch(t){case"0":case 0:return this.PANORAMA;case"1":case 1:return this.FLOORPLAN;case"2":case 2:return this.DOLLHOUSE;case"3":case 3:return this.MESH}throw new n("No known conversion for Workshop int to viewmode for int: "+t)}}},function(t,e,i){var n;!function(e,i){"use strict";"object"==typeof t.exports?t.exports=e.document?i(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return i(t)}:i(e)}("undefined"!=typeof window?window:this,(function(i,r){"use strict";var o=[],a=Object.getPrototypeOf,s=o.slice,l=o.flat?function(t){return o.flat.call(t)}:function(t){return o.concat.apply([],t)},u=o.push,h=o.indexOf,c={},d=c.toString,p=c.hasOwnProperty,f=p.toString,m=f.call(Object),g={},v=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},y=function(t){return null!=t&&t===t.window},b=i.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function x(t,e,i){var n,r,o=(i=i||b).createElement("script");if(o.text=t,e)for(n in w)(r=e[n]||e.getAttribute&&e.getAttribute(n))&&o.setAttribute(n,r);i.head.appendChild(o).parentNode.removeChild(o)}function M(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?c[d.call(t)]||"object":typeof t}var T=/HTML$/i,S=function(t,e){return new S.fn.init(t,e)};function _(t){var e=!!t&&"length"in t&&t.length,i=M(t);return!v(t)&&!y(t)&&("array"===i||0===e||"number"==typeof e&&e>0&&e-1 in t)}function A(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}S.fn=S.prototype={jquery:"3.7.0",constructor:S,length:0,toArray:function(){return s.call(this)},get:function(t){return null==t?s.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=S.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return S.each(this,t)},map:function(t){return this.pushStack(S.map(this,(function(e,i){return t.call(e,i,e)})))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(S.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,i=+t+(t<0?e:0);return this.pushStack(i>=0&&i<e?[this[i]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:o.sort,splice:o.splice},S.extend=S.fn.extend=function(){var t,e,i,n,r,o,a=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[s]||{},s++),"object"==typeof a||v(a)||(a={}),s===l&&(a=this,s--);s<l;s++)if(null!=(t=arguments[s]))for(e in t)n=t[e],"__proto__"!==e&&a!==n&&(u&&n&&(S.isPlainObject(n)||(r=Array.isArray(n)))?(i=a[e],o=r&&!Array.isArray(i)?[]:r||S.isPlainObject(i)?i:{},r=!1,a[e]=S.extend(u,o,n)):void 0!==n&&(a[e]=n));return a},S.extend({expando:"jQuery"+("3.7.0"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,i;return!(!t||"[object Object]"!==d.call(t))&&(!(e=a(t))||"function"==typeof(i=p.call(e,"constructor")&&e.constructor)&&f.call(i)===m)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,i){x(t,{nonce:e&&e.nonce},i)},each:function(t,e){var i,n=0;if(_(t))for(i=t.length;n<i&&!1!==e.call(t[n],n,t[n]);n++);else for(n in t)if(!1===e.call(t[n],n,t[n]))break;return t},text:function(t){var e,i="",n=0,r=t.nodeType;if(r){if(1===r||9===r||11===r)return t.textContent;if(3===r||4===r)return t.nodeValue}else for(;e=t[n++];)i+=S.text(e);return i},makeArray:function(t,e){var i=e||[];return null!=t&&(_(Object(t))?S.merge(i,"string"==typeof t?[t]:t):u.call(i,t)),i},inArray:function(t,e,i){return null==e?-1:h.call(e,t,i)},isXMLDoc:function(t){var e=t&&t.namespaceURI,i=t&&(t.ownerDocument||t).documentElement;return!T.test(e||i&&i.nodeName||"HTML")},merge:function(t,e){for(var i=+e.length,n=0,r=t.length;n<i;n++)t[r++]=e[n];return t.length=r,t},grep:function(t,e,i){for(var n=[],r=0,o=t.length,a=!i;r<o;r++)!e(t[r],r)!==a&&n.push(t[r]);return n},map:function(t,e,i){var n,r,o=0,a=[];if(_(t))for(n=t.length;o<n;o++)null!=(r=e(t[o],o,i))&&a.push(r);else for(o in t)null!=(r=e(t[o],o,i))&&a.push(r);return l(a)},guid:1,support:g}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=o[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){c["[object "+e+"]"]=e.toLowerCase()}));var P=o.pop,C=o.sort,E=o.splice,D="[\\x20\\t\\r\\n\\f]",L=new RegExp("^"+D+"+|((?:^|[^\\\\])(?:\\\\.)*)"+D+"+$","g");S.contains=function(t,e){var i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(t.contains?t.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))};var O=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function I(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t}S.escapeSelector=function(t){return(t+"").replace(O,I)};var R=b,N=u;!function(){var t,e,n,r,a,l,u,c,d,f,m=N,v=S.expando,y=0,b=0,w=tt(),x=tt(),M=tt(),T=tt(),_=function(t,e){return t===e&&(a=!0),0},O="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",I="(?:\\\\[\\da-fA-F]{1,6}"+D+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",k="\\["+D+"*("+I+")(?:"+D+"*([*^$|!~]?=)"+D+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+D+"*\\]",F=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+k+")*)|.*)\\)|)",B=new RegExp(D+"+","g"),z=new RegExp("^"+D+"*,"+D+"*"),U=new RegExp("^"+D+"*([>+~]|"+D+")"+D+"*"),V=new RegExp(D+"|>"),j=new RegExp(F),H=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+k),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+D+"*(even|odd|(([+-]|)(\\d*)n|)"+D+"*(?:([+-]|)"+D+"*(\\d+)|))"+D+"*\\)|)","i"),bool:new RegExp("^(?:"+O+")$","i"),needsContext:new RegExp("^"+D+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+D+"*((?:-\\d)?\\d*)"+D+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,Y=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,X=/[+~]/,Z=new RegExp("\\\\[\\da-fA-F]{1,6}"+D+"?|\\\\([^\\r\\n\\f])","g"),K=function(t,e){var i="0x"+t.slice(1)-65536;return e||(i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320))},Q=function(){lt()},J=dt((function(t){return!0===t.disabled&&A(t,"fieldset")}),{dir:"parentNode",next:"legend"});try{m.apply(o=s.call(R.childNodes),R.childNodes),o[R.childNodes.length].nodeType}catch(t){m={apply:function(t,e){N.apply(t,s.call(e))},call:function(t){N.apply(t,s.call(arguments,1))}}}function $(t,e,i,n){var r,o,a,s,u,h,p,f=e&&e.ownerDocument,y=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==y&&9!==y&&11!==y)return i;if(!n&&(lt(e),e=e||l,c)){if(11!==y&&(u=Y.exec(t)))if(r=u[1]){if(9===y){if(!(a=e.getElementById(r)))return i;if(a.id===r)return m.call(i,a),i}else if(f&&(a=f.getElementById(r))&&$.contains(e,a)&&a.id===r)return m.call(i,a),i}else{if(u[2])return m.apply(i,e.getElementsByTagName(t)),i;if((r=u[3])&&e.getElementsByClassName)return m.apply(i,e.getElementsByClassName(r)),i}if(!(T[t+" "]||d&&d.test(t))){if(p=t,f=e,1===y&&(V.test(t)||U.test(t))){for((f=X.test(t)&&st(e.parentNode)||e)==e&&g.scope||((s=e.getAttribute("id"))?s=S.escapeSelector(s):e.setAttribute("id",s=v)),o=(h=ht(t)).length;o--;)h[o]=(s?"#"+s:":scope")+" "+ct(h[o]);p=h.join(",")}try{return m.apply(i,f.querySelectorAll(p)),i}catch(e){T(t,!0)}finally{s===v&&e.removeAttribute("id")}}}return yt(t.replace(L,"$1"),e,i,n)}function tt(){var t=[];return function i(n,r){return t.push(n+" ")>e.cacheLength&&delete i[t.shift()],i[n+" "]=r}}function et(t){return t[v]=!0,t}function it(t){var e=l.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function nt(t){return function(e){return A(e,"input")&&e.type===t}}function rt(t){return function(e){return(A(e,"input")||A(e,"button"))&&e.type===t}}function ot(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&J(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function at(t){return et((function(e){return e=+e,et((function(i,n){for(var r,o=t([],i.length,e),a=o.length;a--;)i[r=o[a]]&&(i[r]=!(n[r]=i[r]))}))}))}function st(t){return t&&void 0!==t.getElementsByTagName&&t}function lt(t){var i,n=t?t.ownerDocument||t:R;return n!=l&&9===n.nodeType&&n.documentElement?(u=(l=n).documentElement,c=!S.isXMLDoc(l),f=u.matches||u.webkitMatchesSelector||u.msMatchesSelector,R!=l&&(i=l.defaultView)&&i.top!==i&&i.addEventListener("unload",Q),g.getById=it((function(t){return u.appendChild(t).id=S.expando,!l.getElementsByName||!l.getElementsByName(S.expando).length})),g.disconnectedMatch=it((function(t){return f.call(t,"*")})),g.scope=it((function(){return l.querySelectorAll(":scope")})),g.cssHas=it((function(){try{return l.querySelector(":has(*,:jqfake)"),!1}catch(t){return!0}})),g.getById?(e.filter.ID=function(t){var e=t.replace(Z,K);return function(t){return t.getAttribute("id")===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&c){var i=e.getElementById(t);return i?[i]:[]}}):(e.filter.ID=function(t){var e=t.replace(Z,K);return function(t){var i=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return i&&i.value===e}},e.find.ID=function(t,e){if(void 0!==e.getElementById&&c){var i,n,r,o=e.getElementById(t);if(o){if((i=o.getAttributeNode("id"))&&i.value===t)return[o];for(r=e.getElementsByName(t),n=0;o=r[n++];)if((i=o.getAttributeNode("id"))&&i.value===t)return[o]}return[]}}),e.find.TAG=function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):e.querySelectorAll(t)},e.find.CLASS=function(t,e){if(void 0!==e.getElementsByClassName&&c)return e.getElementsByClassName(t)},d=[],it((function(t){var e;u.appendChild(t).innerHTML="<a id='"+v+"' href='' disabled='disabled'></a><select id='"+v+"-\r\\' disabled='disabled'><option selected=''></option></select>",t.querySelectorAll("[selected]").length||d.push("\\["+D+"*(?:value|"+O+")"),t.querySelectorAll("[id~="+v+"-]").length||d.push("~="),t.querySelectorAll("a#"+v+"+*").length||d.push(".#.+[+~]"),t.querySelectorAll(":checked").length||d.push(":checked"),(e=l.createElement("input")).setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),u.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(e=l.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||d.push("\\["+D+"*name"+D+"*="+D+"*(?:''|\"\")")})),g.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),_=function(t,e){if(t===e)return a=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!g.sortDetached&&e.compareDocumentPosition(t)===i?t===l||t.ownerDocument==R&&$.contains(R,t)?-1:e===l||e.ownerDocument==R&&$.contains(R,e)?1:r?h.call(r,t)-h.call(r,e):0:4&i?-1:1)},l):l}for(t in $.matches=function(t,e){return $(t,null,null,e)},$.matchesSelector=function(t,e){if(lt(t),c&&!T[e+" "]&&(!d||!d.test(e)))try{var i=f.call(t,e);if(i||g.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){T(e,!0)}return $(e,l,null,[t]).length>0},$.contains=function(t,e){return(t.ownerDocument||t)!=l&&lt(t),S.contains(t,e)},$.attr=function(t,i){(t.ownerDocument||t)!=l&&lt(t);var n=e.attrHandle[i.toLowerCase()],r=n&&p.call(e.attrHandle,i.toLowerCase())?n(t,i,!c):void 0;return void 0!==r?r:t.getAttribute(i)},$.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},S.uniqueSort=function(t){var e,i=[],n=0,o=0;if(a=!g.sortStable,r=!g.sortStable&&s.call(t,0),C.call(t,_),a){for(;e=t[o++];)e===t[o]&&(n=i.push(o));for(;n--;)E.call(t,i[n],1)}return r=null,t},S.fn.uniqueSort=function(){return this.pushStack(S.uniqueSort(s.apply(this)))},(e=S.expr={cacheLength:50,createPseudo:et,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(Z,K),t[3]=(t[3]||t[4]||t[5]||"").replace(Z,K),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||$.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&$.error(t[0]),t},PSEUDO:function(t){var e,i=!t[6]&&t[2];return G.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":i&&j.test(i)&&(e=ht(i,!0))&&(e=i.indexOf(")",i.length-e)-i.length)&&(t[0]=t[0].slice(0,e),t[2]=i.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(Z,K).toLowerCase();return"*"===t?function(){return!0}:function(t){return A(t,e)}},CLASS:function(t){var e=w[t+" "];return e||(e=new RegExp("(^|"+D+")"+t+"("+D+"|$)"))&&w(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,i){return function(n){var r=$.attr(n,t);return null==r?"!="===e:!e||(r+="","="===e?r===i:"!="===e?r!==i:"^="===e?i&&0===r.indexOf(i):"*="===e?i&&r.indexOf(i)>-1:"$="===e?i&&r.slice(-i.length)===i:"~="===e?(" "+r.replace(B," ")+" ").indexOf(i)>-1:"|="===e&&(r===i||r.slice(0,i.length+1)===i+"-"))}},CHILD:function(t,e,i,n,r){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===n&&0===r?function(t){return!!t.parentNode}:function(e,i,l){var u,h,c,d,p,f=o!==a?"nextSibling":"previousSibling",m=e.parentNode,g=s&&e.nodeName.toLowerCase(),b=!l&&!s,w=!1;if(m){if(o){for(;f;){for(c=e;c=c[f];)if(s?A(c,g):1===c.nodeType)return!1;p=f="only"===t&&!p&&"nextSibling"}return!0}if(p=[a?m.firstChild:m.lastChild],a&&b){for(w=(d=(u=(h=m[v]||(m[v]={}))[t]||[])[0]===y&&u[1])&&u[2],c=d&&m.childNodes[d];c=++d&&c&&c[f]||(w=d=0)||p.pop();)if(1===c.nodeType&&++w&&c===e){h[t]=[y,d,w];break}}else if(b&&(w=d=(u=(h=e[v]||(e[v]={}))[t]||[])[0]===y&&u[1]),!1===w)for(;(c=++d&&c&&c[f]||(w=d=0)||p.pop())&&(!(s?A(c,g):1===c.nodeType)||!++w||(b&&((h=c[v]||(c[v]={}))[t]=[y,w]),c!==e)););return(w-=r)===n||w%n==0&&w/n>=0}}},PSEUDO:function(t,i){var n,r=e.pseudos[t]||e.setFilters[t.toLowerCase()]||$.error("unsupported pseudo: "+t);return r[v]?r(i):r.length>1?(n=[t,t,"",i],e.setFilters.hasOwnProperty(t.toLowerCase())?et((function(t,e){for(var n,o=r(t,i),a=o.length;a--;)t[n=h.call(t,o[a])]=!(e[n]=o[a])})):function(t){return r(t,0,n)}):r}},pseudos:{not:et((function(t){var e=[],i=[],n=vt(t.replace(L,"$1"));return n[v]?et((function(t,e,i,r){for(var o,a=n(t,null,r,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))})):function(t,r,o){return e[0]=t,n(e,null,o,i),e[0]=null,!i.pop()}})),has:et((function(t){return function(e){return $(t,e).length>0}})),contains:et((function(t){return t=t.replace(Z,K),function(e){return(e.textContent||S.text(e)).indexOf(t)>-1}})),lang:et((function(t){return H.test(t||"")||$.error("unsupported lang: "+t),t=t.replace(Z,K).toLowerCase(),function(e){var i;do{if(i=c?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(i=i.toLowerCase())===t||0===i.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(t){var e=i.location&&i.location.hash;return e&&e.slice(1)===t.id},root:function(t){return t===u},focus:function(t){return t===function(){try{return l.activeElement}catch(t){}}()&&l.hasFocus()&&!!(t.type||t.href||~t.tabIndex)},enabled:ot(!1),disabled:ot(!0),checked:function(t){return A(t,"input")&&!!t.checked||A(t,"option")&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!e.pseudos.empty(t)},header:function(t){return q.test(t.nodeName)},input:function(t){return W.test(t.nodeName)},button:function(t){return A(t,"input")&&"button"===t.type||A(t,"button")},text:function(t){var e;return A(t,"input")&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:at((function(){return[0]})),last:at((function(t,e){return[e-1]})),eq:at((function(t,e,i){return[i<0?i+e:i]})),even:at((function(t,e){for(var i=0;i<e;i+=2)t.push(i);return t})),odd:at((function(t,e){for(var i=1;i<e;i+=2)t.push(i);return t})),lt:at((function(t,e,i){var n;for(n=i<0?i+e:i>e?e:i;--n>=0;)t.push(n);return t})),gt:at((function(t,e,i){for(var n=i<0?i+e:i;++n<e;)t.push(n);return t}))}}).pseudos.nth=e.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})e.pseudos[t]=nt(t);for(t in{submit:!0,reset:!0})e.pseudos[t]=rt(t);function ut(){}function ht(t,i){var n,r,o,a,s,l,u,h=x[t+" "];if(h)return i?0:h.slice(0);for(s=t,l=[],u=e.preFilter;s;){for(a in n&&!(r=z.exec(s))||(r&&(s=s.slice(r[0].length)||s),l.push(o=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(L," ")}),s=s.slice(n.length)),e.filter)!(r=G[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return i?s.length:s?$.error(t):x(t,l).slice(0)}function ct(t){for(var e=0,i=t.length,n="";e<i;e++)n+=t[e].value;return n}function dt(t,e,i){var n=e.dir,r=e.next,o=r||n,a=i&&"parentNode"===o,s=b++;return e.first?function(e,i,r){for(;e=e[n];)if(1===e.nodeType||a)return t(e,i,r);return!1}:function(e,i,l){var u,h,c=[y,s];if(l){for(;e=e[n];)if((1===e.nodeType||a)&&t(e,i,l))return!0}else for(;e=e[n];)if(1===e.nodeType||a)if(h=e[v]||(e[v]={}),r&&A(e,r))e=e[n]||e;else{if((u=h[o])&&u[0]===y&&u[1]===s)return c[2]=u[2];if(h[o]=c,c[2]=t(e,i,l))return!0}return!1}}function pt(t){return t.length>1?function(e,i,n){for(var r=t.length;r--;)if(!t[r](e,i,n))return!1;return!0}:t[0]}function ft(t,e,i,n,r){for(var o,a=[],s=0,l=t.length,u=null!=e;s<l;s++)(o=t[s])&&(i&&!i(o,n,r)||(a.push(o),u&&e.push(s)));return a}function mt(t,e,i,n,r,o){return n&&!n[v]&&(n=mt(n)),r&&!r[v]&&(r=mt(r,o)),et((function(o,a,s,l){var u,c,d,p,f=[],g=[],v=a.length,y=o||function(t,e,i){for(var n=0,r=e.length;n<r;n++)$(t,e[n],i);return i}(e||"*",s.nodeType?[s]:s,[]),b=!t||!o&&e?y:ft(y,f,t,s,l);if(i?i(b,p=r||(o?t:v||n)?[]:a,s,l):p=b,n)for(u=ft(p,g),n(u,[],s,l),c=u.length;c--;)(d=u[c])&&(p[g[c]]=!(b[g[c]]=d));if(o){if(r||t){if(r){for(u=[],c=p.length;c--;)(d=p[c])&&u.push(b[c]=d);r(null,p=[],u,l)}for(c=p.length;c--;)(d=p[c])&&(u=r?h.call(o,d):f[c])>-1&&(o[u]=!(a[u]=d))}}else p=ft(p===a?p.splice(v,p.length):p),r?r(null,a,p,l):m.apply(a,p)}))}function gt(t){for(var i,r,o,a=t.length,s=e.relative[t[0].type],l=s||e.relative[" "],u=s?1:0,c=dt((function(t){return t===i}),l,!0),d=dt((function(t){return h.call(i,t)>-1}),l,!0),p=[function(t,e,r){var o=!s&&(r||e!=n)||((i=e).nodeType?c(t,e,r):d(t,e,r));return i=null,o}];u<a;u++)if(r=e.relative[t[u].type])p=[dt(pt(p),r)];else{if((r=e.filter[t[u].type].apply(null,t[u].matches))[v]){for(o=++u;o<a&&!e.relative[t[o].type];o++);return mt(u>1&&pt(p),u>1&&ct(t.slice(0,u-1).concat({value:" "===t[u-2].type?"*":""})).replace(L,"$1"),r,u<o&&gt(t.slice(u,o)),o<a&&gt(t=t.slice(o)),o<a&&ct(t))}p.push(r)}return pt(p)}function vt(t,i){var r,o=[],a=[],s=M[t+" "];if(!s){for(i||(i=ht(t)),r=i.length;r--;)(s=gt(i[r]))[v]?o.push(s):a.push(s);(s=M(t,function(t,i){var r=i.length>0,o=t.length>0,a=function(a,s,u,h,d){var p,f,g,v=0,b="0",w=a&&[],x=[],M=n,T=a||o&&e.find.TAG("*",d),_=y+=null==M?1:Math.random()||.1,A=T.length;for(d&&(n=s==l||s||d);b!==A&&null!=(p=T[b]);b++){if(o&&p){for(f=0,s||p.ownerDocument==l||(lt(p),u=!c);g=t[f++];)if(g(p,s||l,u)){m.call(h,p);break}d&&(y=_)}r&&((p=!g&&p)&&v--,a&&w.push(p))}if(v+=b,r&&b!==v){for(f=0;g=i[f++];)g(w,x,s,u);if(a){if(v>0)for(;b--;)w[b]||x[b]||(x[b]=P.call(h));x=ft(x)}m.apply(h,x),d&&!a&&x.length>0&&v+i.length>1&&S.uniqueSort(h)}return d&&(y=_,n=M),w};return r?et(a):a}(a,o))).selector=t}return s}function yt(t,i,n,r){var o,a,s,l,u,h="function"==typeof t&&t,d=!r&&ht(t=h.selector||t);if(n=n||[],1===d.length){if((a=d[0]=d[0].slice(0)).length>2&&"ID"===(s=a[0]).type&&9===i.nodeType&&c&&e.relative[a[1].type]){if(!(i=(e.find.ID(s.matches[0].replace(Z,K),i)||[])[0]))return n;h&&(i=i.parentNode),t=t.slice(a.shift().value.length)}for(o=G.needsContext.test(t)?0:a.length;o--&&(s=a[o],!e.relative[l=s.type]);)if((u=e.find[l])&&(r=u(s.matches[0].replace(Z,K),X.test(a[0].type)&&st(i.parentNode)||i))){if(a.splice(o,1),!(t=r.length&&ct(a)))return m.apply(n,r),n;break}}return(h||vt(t,d))(r,i,!c,n,!i||X.test(t)&&st(i.parentNode)||i),n}ut.prototype=e.filters=e.pseudos,e.setFilters=new ut,g.sortStable=v.split("").sort(_).join("")===v,lt(),g.sortDetached=it((function(t){return 1&t.compareDocumentPosition(l.createElement("fieldset"))})),S.find=$,S.expr[":"]=S.expr.pseudos,S.unique=S.uniqueSort,$.compile=vt,$.select=yt,$.setDocument=lt,$.escape=S.escapeSelector,$.getText=S.text,$.isXML=S.isXMLDoc,$.selectors=S.expr,$.support=S.support,$.uniqueSort=S.uniqueSort}();var k=function(t,e,i){for(var n=[],r=void 0!==i;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&S(t).is(i))break;n.push(t)}return n},F=function(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i},B=S.expr.match.needsContext,z=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function U(t,e,i){return v(e)?S.grep(t,(function(t,n){return!!e.call(t,n,t)!==i})):e.nodeType?S.grep(t,(function(t){return t===e!==i})):"string"!=typeof e?S.grep(t,(function(t){return h.call(e,t)>-1!==i})):S.filter(e,t,i)}S.filter=function(t,e,i){var n=e[0];return i&&(t=":not("+t+")"),1===e.length&&1===n.nodeType?S.find.matchesSelector(n,t)?[n]:[]:S.find.matches(t,S.grep(e,(function(t){return 1===t.nodeType})))},S.fn.extend({find:function(t){var e,i,n=this.length,r=this;if("string"!=typeof t)return this.pushStack(S(t).filter((function(){for(e=0;e<n;e++)if(S.contains(r[e],this))return!0})));for(i=this.pushStack([]),e=0;e<n;e++)S.find(t,r[e],i);return n>1?S.uniqueSort(i):i},filter:function(t){return this.pushStack(U(this,t||[],!1))},not:function(t){return this.pushStack(U(this,t||[],!0))},is:function(t){return!!U(this,"string"==typeof t&&B.test(t)?S(t):t||[],!1).length}});var V,j=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(t,e,i){var n,r;if(!t)return this;if(i=i||V,"string"==typeof t){if(!(n="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:j.exec(t))||!n[1]&&e)return!e||e.jquery?(e||i).find(t):this.constructor(e).find(t);if(n[1]){if(e=e instanceof S?e[0]:e,S.merge(this,S.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:b,!0)),z.test(n[1])&&S.isPlainObject(e))for(n in e)v(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}return(r=b.getElementById(n[2]))&&(this[0]=r,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):v(t)?void 0!==i.ready?i.ready(t):t(S):S.makeArray(t,this)}).prototype=S.fn,V=S(b);var H=/^(?:parents|prev(?:Until|All))/,G={children:!0,contents:!0,next:!0,prev:!0};function W(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}S.fn.extend({has:function(t){var e=S(t,this),i=e.length;return this.filter((function(){for(var t=0;t<i;t++)if(S.contains(this,e[t]))return!0}))},closest:function(t,e){var i,n=0,r=this.length,o=[],a="string"!=typeof t&&S(t);if(!B.test(t))for(;n<r;n++)for(i=this[n];i&&i!==e;i=i.parentNode)if(i.nodeType<11&&(a?a.index(i)>-1:1===i.nodeType&&S.find.matchesSelector(i,t))){o.push(i);break}return this.pushStack(o.length>1?S.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?h.call(S(t),this[0]):h.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),S.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return k(t,"parentNode")},parentsUntil:function(t,e,i){return k(t,"parentNode",i)},next:function(t){return W(t,"nextSibling")},prev:function(t){return W(t,"previousSibling")},nextAll:function(t){return k(t,"nextSibling")},prevAll:function(t){return k(t,"previousSibling")},nextUntil:function(t,e,i){return k(t,"nextSibling",i)},prevUntil:function(t,e,i){return k(t,"previousSibling",i)},siblings:function(t){return F((t.parentNode||{}).firstChild,t)},children:function(t){return F(t.firstChild)},contents:function(t){return null!=t.contentDocument&&a(t.contentDocument)?t.contentDocument:(A(t,"template")&&(t=t.content||t),S.merge([],t.childNodes))}},(function(t,e){S.fn[t]=function(i,n){var r=S.map(this,e,i);return"Until"!==t.slice(-5)&&(n=i),n&&"string"==typeof n&&(r=S.filter(n,r)),this.length>1&&(G[t]||S.uniqueSort(r),H.test(t)&&r.reverse()),this.pushStack(r)}}));var q=/[^\x20\t\r\n\f]+/g;function Y(t){return t}function X(t){throw t}function Z(t,e,i,n){var r;try{t&&v(r=t.promise)?r.call(t).done(e).fail(i):t&&v(r=t.then)?r.call(t,e,i):e.apply(void 0,[t].slice(n))}catch(t){i.apply(void 0,[t])}}S.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return S.each(t.match(q)||[],(function(t,i){e[i]=!0})),e}(t):S.extend({},t);var e,i,n,r,o=[],a=[],s=-1,l=function(){for(r=r||t.once,n=e=!0;a.length;s=-1)for(i=a.shift();++s<o.length;)!1===o[s].apply(i[0],i[1])&&t.stopOnFalse&&(s=o.length,i=!1);t.memory||(i=!1),e=!1,r&&(o=i?[]:"")},u={add:function(){return o&&(i&&!e&&(s=o.length-1,a.push(i)),function e(i){S.each(i,(function(i,n){v(n)?t.unique&&u.has(n)||o.push(n):n&&n.length&&"string"!==M(n)&&e(n)}))}(arguments),i&&!e&&l()),this},remove:function(){return S.each(arguments,(function(t,e){for(var i;(i=S.inArray(e,o,i))>-1;)o.splice(i,1),i<=s&&s--})),this},has:function(t){return t?S.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return r=a=[],o=i="",this},disabled:function(){return!o},lock:function(){return r=a=[],i||e||(o=i=""),this},locked:function(){return!!r},fireWith:function(t,i){return r||(i=[t,(i=i||[]).slice?i.slice():i],a.push(i),e||l()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!n}};return u},S.extend({Deferred:function(t){var e=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],n="pending",r={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return r.then(null,t)},pipe:function(){var t=arguments;return S.Deferred((function(i){S.each(e,(function(e,n){var r=v(t[n[4]])&&t[n[4]];o[n[1]]((function(){var t=r&&r.apply(this,arguments);t&&v(t.promise)?t.promise().progress(i.notify).done(i.resolve).fail(i.reject):i[n[0]+"With"](this,r?[t]:arguments)}))})),t=null})).promise()},then:function(t,n,r){var o=0;function a(t,e,n,r){return function(){var s=this,l=arguments,u=function(){var i,u;if(!(t<o)){if((i=n.apply(s,l))===e.promise())throw new TypeError("Thenable self-resolution");u=i&&("object"==typeof i||"function"==typeof i)&&i.then,v(u)?r?u.call(i,a(o,e,Y,r),a(o,e,X,r)):(o++,u.call(i,a(o,e,Y,r),a(o,e,X,r),a(o,e,Y,e.notifyWith))):(n!==Y&&(s=void 0,l=[i]),(r||e.resolveWith)(s,l))}},h=r?u:function(){try{u()}catch(i){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(i,h.error),t+1>=o&&(n!==X&&(s=void 0,l=[i]),e.rejectWith(s,l))}};t?h():(S.Deferred.getErrorHook?h.error=S.Deferred.getErrorHook():S.Deferred.getStackHook&&(h.error=S.Deferred.getStackHook()),i.setTimeout(h))}}return S.Deferred((function(i){e[0][3].add(a(0,i,v(r)?r:Y,i.notifyWith)),e[1][3].add(a(0,i,v(t)?t:Y)),e[2][3].add(a(0,i,v(n)?n:X))})).promise()},promise:function(t){return null!=t?S.extend(t,r):r}},o={};return S.each(e,(function(t,i){var a=i[2],s=i[5];r[i[1]]=a.add,s&&a.add((function(){n=s}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),a.add(i[3].fire),o[i[0]]=function(){return o[i[0]+"With"](this===o?void 0:this,arguments),this},o[i[0]+"With"]=a.fireWith})),r.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,i=e,n=Array(i),r=s.call(arguments),o=S.Deferred(),a=function(t){return function(i){n[t]=this,r[t]=arguments.length>1?s.call(arguments):i,--e||o.resolveWith(n,r)}};if(e<=1&&(Z(t,o.done(a(i)).resolve,o.reject,!e),"pending"===o.state()||v(r[i]&&r[i].then)))return o.then();for(;i--;)Z(r[i],a(i),o.reject);return o.promise()}});var K=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(t,e){i.console&&i.console.warn&&t&&K.test(t.name)&&i.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},S.readyException=function(t){i.setTimeout((function(){throw t}))};var Q=S.Deferred();function J(){b.removeEventListener("DOMContentLoaded",J),i.removeEventListener("load",J),S.ready()}S.fn.ready=function(t){return Q.then(t).catch((function(t){S.readyException(t)})),this},S.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==t&&--S.readyWait>0||Q.resolveWith(b,[S]))}}),S.ready.then=Q.then,"complete"===b.readyState||"loading"!==b.readyState&&!b.documentElement.doScroll?i.setTimeout(S.ready):(b.addEventListener("DOMContentLoaded",J),i.addEventListener("load",J));var $=function(t,e,i,n,r,o,a){var s=0,l=t.length,u=null==i;if("object"===M(i))for(s in r=!0,i)$(t,e,s,i[s],!0,o,a);else if(void 0!==n&&(r=!0,v(n)||(a=!0),u&&(a?(e.call(t,n),e=null):(u=e,e=function(t,e,i){return u.call(S(t),i)})),e))for(;s<l;s++)e(t[s],i,a?n:n.call(t[s],s,e(t[s],i)));return r?t:u?e.call(t):l?e(t[0],i):o},tt=/^-ms-/,et=/-([a-z])/g;function it(t,e){return e.toUpperCase()}function nt(t){return t.replace(tt,"ms-").replace(et,it)}var rt=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function ot(){this.expando=S.expando+ot.uid++}ot.uid=1,ot.prototype={cache:function(t){var e=t[this.expando];return e||(e={},rt(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,i){var n,r=this.cache(t);if("string"==typeof e)r[nt(e)]=i;else for(n in e)r[nt(n)]=e[n];return r},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][nt(e)]},access:function(t,e,i){return void 0===e||e&&"string"==typeof e&&void 0===i?this.get(t,e):(this.set(t,e,i),void 0!==i?i:e)},remove:function(t,e){var i,n=t[this.expando];if(void 0!==n){if(void 0!==e){i=(e=Array.isArray(e)?e.map(nt):(e=nt(e))in n?[e]:e.match(q)||[]).length;for(;i--;)delete n[e[i]]}(void 0===e||S.isEmptyObject(n))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!S.isEmptyObject(e)}};var at=new ot,st=new ot,lt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ut=/[A-Z]/g;function ht(t,e,i){var n;if(void 0===i&&1===t.nodeType)if(n="data-"+e.replace(ut,"-$&").toLowerCase(),"string"==typeof(i=t.getAttribute(n))){try{i=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:lt.test(t)?JSON.parse(t):t)}(i)}catch(t){}st.set(t,e,i)}else i=void 0;return i}S.extend({hasData:function(t){return st.hasData(t)||at.hasData(t)},data:function(t,e,i){return st.access(t,e,i)},removeData:function(t,e){st.remove(t,e)},_data:function(t,e,i){return at.access(t,e,i)},_removeData:function(t,e){at.remove(t,e)}}),S.fn.extend({data:function(t,e){var i,n,r,o=this[0],a=o&&o.attributes;if(void 0===t){if(this.length&&(r=st.get(o),1===o.nodeType&&!at.get(o,"hasDataAttrs"))){for(i=a.length;i--;)a[i]&&0===(n=a[i].name).indexOf("data-")&&(n=nt(n.slice(5)),ht(o,n,r[n]));at.set(o,"hasDataAttrs",!0)}return r}return"object"==typeof t?this.each((function(){st.set(this,t)})):$(this,(function(e){var i;if(o&&void 0===e)return void 0!==(i=st.get(o,t))||void 0!==(i=ht(o,t))?i:void 0;this.each((function(){st.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){st.remove(this,t)}))}}),S.extend({queue:function(t,e,i){var n;if(t)return e=(e||"fx")+"queue",n=at.get(t,e),i&&(!n||Array.isArray(i)?n=at.access(t,e,S.makeArray(i)):n.push(i)),n||[]},dequeue:function(t,e){e=e||"fx";var i=S.queue(t,e),n=i.length,r=i.shift(),o=S._queueHooks(t,e);"inprogress"===r&&(r=i.shift(),n--),r&&("fx"===e&&i.unshift("inprogress"),delete o.stop,r.call(t,(function(){S.dequeue(t,e)}),o)),!n&&o&&o.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return at.get(t,i)||at.access(t,i,{empty:S.Callbacks("once memory").add((function(){at.remove(t,[e+"queue",i])}))})}}),S.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.length<i?S.queue(this[0],t):void 0===e?this:this.each((function(){var i=S.queue(this,t,e);S._queueHooks(this,t),"fx"===t&&"inprogress"!==i[0]&&S.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){S.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var i,n=1,r=S.Deferred(),o=this,a=this.length,s=function(){--n||r.resolveWith(o,[o])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";a--;)(i=at.get(o[a],t+"queueHooks"))&&i.empty&&(n++,i.empty.add(s));return s(),r.promise(e)}});var ct=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,dt=new RegExp("^(?:([+-])=|)("+ct+")([a-z%]*)$","i"),pt=["Top","Right","Bottom","Left"],ft=b.documentElement,mt=function(t){return S.contains(t.ownerDocument,t)},gt={composed:!0};ft.getRootNode&&(mt=function(t){return S.contains(t.ownerDocument,t)||t.getRootNode(gt)===t.ownerDocument});var vt=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&mt(t)&&"none"===S.css(t,"display")};function yt(t,e,i,n){var r,o,a=20,s=n?function(){return n.cur()}:function(){return S.css(t,e,"")},l=s(),u=i&&i[3]||(S.cssNumber[e]?"":"px"),h=t.nodeType&&(S.cssNumber[e]||"px"!==u&&+l)&&dt.exec(S.css(t,e));if(h&&h[3]!==u){for(l/=2,u=u||h[3],h=+l||1;a--;)S.style(t,e,h+u),(1-o)*(1-(o=s()/l||.5))<=0&&(a=0),h/=o;h*=2,S.style(t,e,h+u),i=i||[]}return i&&(h=+h||+l||0,r=i[1]?h+(i[1]+1)*i[2]:+i[2],n&&(n.unit=u,n.start=h,n.end=r)),r}var bt={};function wt(t){var e,i=t.ownerDocument,n=t.nodeName,r=bt[n];return r||(e=i.body.appendChild(i.createElement(n)),r=S.css(e,"display"),e.parentNode.removeChild(e),"none"===r&&(r="block"),bt[n]=r,r)}function xt(t,e){for(var i,n,r=[],o=0,a=t.length;o<a;o++)(n=t[o]).style&&(i=n.style.display,e?("none"===i&&(r[o]=at.get(n,"display")||null,r[o]||(n.style.display="")),""===n.style.display&&vt(n)&&(r[o]=wt(n))):"none"!==i&&(r[o]="none",at.set(n,"display",i)));for(o=0;o<a;o++)null!=r[o]&&(t[o].style.display=r[o]);return t}S.fn.extend({show:function(){return xt(this,!0)},hide:function(){return xt(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each((function(){vt(this)?S(this).show():S(this).hide()}))}});var Mt,Tt,St=/^(?:checkbox|radio)$/i,_t=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,At=/^$|^module$|\/(?:java|ecma)script/i;Mt=b.createDocumentFragment().appendChild(b.createElement("div")),(Tt=b.createElement("input")).setAttribute("type","radio"),Tt.setAttribute("checked","checked"),Tt.setAttribute("name","t"),Mt.appendChild(Tt),g.checkClone=Mt.cloneNode(!0).cloneNode(!0).lastChild.checked,Mt.innerHTML="<textarea>x</textarea>",g.noCloneChecked=!!Mt.cloneNode(!0).lastChild.defaultValue,Mt.innerHTML="<option></option>",g.option=!!Mt.lastChild;var Pt={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function Ct(t,e){var i;return i=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&A(t,e)?S.merge([t],i):i}function Et(t,e){for(var i=0,n=t.length;i<n;i++)at.set(t[i],"globalEval",!e||at.get(e[i],"globalEval"))}Pt.tbody=Pt.tfoot=Pt.colgroup=Pt.caption=Pt.thead,Pt.th=Pt.td,g.option||(Pt.optgroup=Pt.option=[1,"<select multiple='multiple'>","</select>"]);var Dt=/<|&#?\w+;/;function Lt(t,e,i,n,r){for(var o,a,s,l,u,h,c=e.createDocumentFragment(),d=[],p=0,f=t.length;p<f;p++)if((o=t[p])||0===o)if("object"===M(o))S.merge(d,o.nodeType?[o]:o);else if(Dt.test(o)){for(a=a||c.appendChild(e.createElement("div")),s=(_t.exec(o)||["",""])[1].toLowerCase(),l=Pt[s]||Pt._default,a.innerHTML=l[1]+S.htmlPrefilter(o)+l[2],h=l[0];h--;)a=a.lastChild;S.merge(d,a.childNodes),(a=c.firstChild).textContent=""}else d.push(e.createTextNode(o));for(c.textContent="",p=0;o=d[p++];)if(n&&S.inArray(o,n)>-1)r&&r.push(o);else if(u=mt(o),a=Ct(c.appendChild(o),"script"),u&&Et(a),i)for(h=0;o=a[h++];)At.test(o.type||"")&&i.push(o);return c}var Ot=/^([^.]*)(?:\.(.+)|)/;function It(){return!0}function Rt(){return!1}function Nt(t,e,i,n,r,o){var a,s;if("object"==typeof e){for(s in"string"!=typeof i&&(n=n||i,i=void 0),e)Nt(t,s,i,n,e[s],o);return t}if(null==n&&null==r?(r=i,n=i=void 0):null==r&&("string"==typeof i?(r=n,n=void 0):(r=n,n=i,i=void 0)),!1===r)r=Rt;else if(!r)return t;return 1===o&&(a=r,(r=function(t){return S().off(t),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),t.each((function(){S.event.add(this,e,r,n,i)}))}function kt(t,e,i){i?(at.set(t,e,!1),S.event.add(t,e,{namespace:!1,handler:function(t){var i,n=at.get(this,e);if(1&t.isTrigger&&this[e]){if(n)(S.event.special[e]||{}).delegateType&&t.stopPropagation();else if(n=s.call(arguments),at.set(this,e,n),this[e](),i=at.get(this,e),at.set(this,e,!1),n!==i)return t.stopImmediatePropagation(),t.preventDefault(),i}else n&&(at.set(this,e,S.event.trigger(n[0],n.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=It)}})):void 0===at.get(t,e)&&S.event.add(t,e,It)}S.event={global:{},add:function(t,e,i,n,r){var o,a,s,l,u,h,c,d,p,f,m,g=at.get(t);if(rt(t))for(i.handler&&(i=(o=i).handler,r=o.selector),r&&S.find.matchesSelector(ft,r),i.guid||(i.guid=S.guid++),(l=g.events)||(l=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(e){return void 0!==S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(q)||[""]).length;u--;)p=m=(s=Ot.exec(e[u])||[])[1],f=(s[2]||"").split(".").sort(),p&&(c=S.event.special[p]||{},p=(r?c.delegateType:c.bindType)||p,c=S.event.special[p]||{},h=S.extend({type:p,origType:m,data:n,handler:i,guid:i.guid,selector:r,needsContext:r&&S.expr.match.needsContext.test(r),namespace:f.join(".")},o),(d=l[p])||((d=l[p]=[]).delegateCount=0,c.setup&&!1!==c.setup.call(t,n,f,a)||t.addEventListener&&t.addEventListener(p,a)),c.add&&(c.add.call(t,h),h.handler.guid||(h.handler.guid=i.guid)),r?d.splice(d.delegateCount++,0,h):d.push(h),S.event.global[p]=!0)},remove:function(t,e,i,n,r){var o,a,s,l,u,h,c,d,p,f,m,g=at.hasData(t)&&at.get(t);if(g&&(l=g.events)){for(u=(e=(e||"").match(q)||[""]).length;u--;)if(p=m=(s=Ot.exec(e[u])||[])[1],f=(s[2]||"").split(".").sort(),p){for(c=S.event.special[p]||{},d=l[p=(n?c.delegateType:c.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)h=d[o],!r&&m!==h.origType||i&&i.guid!==h.guid||s&&!s.test(h.namespace)||n&&n!==h.selector&&("**"!==n||!h.selector)||(d.splice(o,1),h.selector&&d.delegateCount--,c.remove&&c.remove.call(t,h));a&&!d.length&&(c.teardown&&!1!==c.teardown.call(t,f,g.handle)||S.removeEvent(t,p,g.handle),delete l[p])}else for(p in l)S.event.remove(t,p+e[u],i,n,!0);S.isEmptyObject(l)&&at.remove(t,"handle events")}},dispatch:function(t){var e,i,n,r,o,a,s=new Array(arguments.length),l=S.event.fix(t),u=(at.get(this,"events")||Object.create(null))[l.type]||[],h=S.event.special[l.type]||{};for(s[0]=l,e=1;e<arguments.length;e++)s[e]=arguments[e];if(l.delegateTarget=this,!h.preDispatch||!1!==h.preDispatch.call(this,l)){for(a=S.event.handlers.call(this,l,u),e=0;(r=a[e++])&&!l.isPropagationStopped();)for(l.currentTarget=r.elem,i=0;(o=r.handlers[i++])&&!l.isImmediatePropagationStopped();)l.rnamespace&&!1!==o.namespace&&!l.rnamespace.test(o.namespace)||(l.handleObj=o,l.data=o.data,void 0!==(n=((S.event.special[o.origType]||{}).handle||o.handler).apply(r.elem,s))&&!1===(l.result=n)&&(l.preventDefault(),l.stopPropagation()));return h.postDispatch&&h.postDispatch.call(this,l),l.result}},handlers:function(t,e){var i,n,r,o,a,s=[],l=e.delegateCount,u=t.target;if(l&&u.nodeType&&!("click"===t.type&&t.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==t.type||!0!==u.disabled)){for(o=[],a={},i=0;i<l;i++)void 0===a[r=(n=e[i]).selector+" "]&&(a[r]=n.needsContext?S(r,this).index(u)>-1:S.find(r,this,null,[u]).length),a[r]&&o.push(n);o.length&&s.push({elem:u,handlers:o})}return u=this,l<e.length&&s.push({elem:u,handlers:e.slice(l)}),s},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:v(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[S.expando]?t:new S.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return St.test(e.type)&&e.click&&A(e,"input")&&kt(e,"click",!0),!1},trigger:function(t){var e=this||t;return St.test(e.type)&&e.click&&A(e,"input")&&kt(e,"click"),!0},_default:function(t){var e=t.target;return St.test(e.type)&&e.click&&A(e,"input")&&at.get(e,"click")||A(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},S.removeEvent=function(t,e,i){t.removeEventListener&&t.removeEventListener(e,i)},S.Event=function(t,e){if(!(this instanceof S.Event))return new S.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?It:Rt,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&S.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[S.expando]=!0},S.Event.prototype={constructor:S.Event,isDefaultPrevented:Rt,isPropagationStopped:Rt,isImmediatePropagationStopped:Rt,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=It,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=It,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=It,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},(function(t,e){function i(t){if(b.documentMode){var i=at.get(this,"handle"),n=S.event.fix(t);n.type="focusin"===t.type?"focus":"blur",n.isSimulated=!0,i(t),n.target===n.currentTarget&&i(n)}else S.event.simulate(e,t.target,S.event.fix(t))}S.event.special[t]={setup:function(){var n;if(kt(this,t,!0),!b.documentMode)return!1;(n=at.get(this,e))||this.addEventListener(e,i),at.set(this,e,(n||0)+1)},trigger:function(){return kt(this,t),!0},teardown:function(){var t;if(!b.documentMode)return!1;(t=at.get(this,e)-1)?at.set(this,e,t):(this.removeEventListener(e,i),at.remove(this,e))},_default:function(e){return at.get(e.target,t)},delegateType:e},S.event.special[e]={setup:function(){var n=this.ownerDocument||this.document||this,r=b.documentMode?this:n,o=at.get(r,e);o||(b.documentMode?this.addEventListener(e,i):n.addEventListener(t,i,!0)),at.set(r,e,(o||0)+1)},teardown:function(){var n=this.ownerDocument||this.document||this,r=b.documentMode?this:n,o=at.get(r,e)-1;o?at.set(r,e,o):(b.documentMode?this.removeEventListener(e,i):n.removeEventListener(t,i,!0),at.remove(r,e))}}})),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){S.event.special[t]={delegateType:e,bindType:e,handle:function(t){var i,n=this,r=t.relatedTarget,o=t.handleObj;return r&&(r===n||S.contains(n,r))||(t.type=o.origType,i=o.handler.apply(this,arguments),t.type=e),i}}})),S.fn.extend({on:function(t,e,i,n){return Nt(this,t,e,i,n)},one:function(t,e,i,n){return Nt(this,t,e,i,n,1)},off:function(t,e,i){var n,r;if(t&&t.preventDefault&&t.handleObj)return n=t.handleObj,S(t.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler),this;if("object"==typeof t){for(r in t)this.off(r,e,t[r]);return this}return!1!==e&&"function"!=typeof e||(i=e,e=void 0),!1===i&&(i=Rt),this.each((function(){S.event.remove(this,t,i,e)}))}});var Ft=/<script|<style|<link/i,Bt=/checked\s*(?:[^=]|=\s*.checked.)/i,zt=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Ut(t,e){return A(t,"table")&&A(11!==e.nodeType?e:e.firstChild,"tr")&&S(t).children("tbody")[0]||t}function Vt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function jt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Ht(t,e){var i,n,r,o,a,s;if(1===e.nodeType){if(at.hasData(t)&&(s=at.get(t).events))for(r in at.remove(e,"handle events"),s)for(i=0,n=s[r].length;i<n;i++)S.event.add(e,r,s[r][i]);st.hasData(t)&&(o=st.access(t),a=S.extend({},o),st.set(e,a))}}function Gt(t,e){var i=e.nodeName.toLowerCase();"input"===i&&St.test(t.type)?e.checked=t.checked:"input"!==i&&"textarea"!==i||(e.defaultValue=t.defaultValue)}function Wt(t,e,i,n){e=l(e);var r,o,a,s,u,h,c=0,d=t.length,p=d-1,f=e[0],m=v(f);if(m||d>1&&"string"==typeof f&&!g.checkClone&&Bt.test(f))return t.each((function(r){var o=t.eq(r);m&&(e[0]=f.call(this,r,o.html())),Wt(o,e,i,n)}));if(d&&(o=(r=Lt(e,t[0].ownerDocument,!1,t,n)).firstChild,1===r.childNodes.length&&(r=o),o||n)){for(s=(a=S.map(Ct(r,"script"),Vt)).length;c<d;c++)u=r,c!==p&&(u=S.clone(u,!0,!0),s&&S.merge(a,Ct(u,"script"))),i.call(t[c],u,c);if(s)for(h=a[a.length-1].ownerDocument,S.map(a,jt),c=0;c<s;c++)u=a[c],At.test(u.type||"")&&!at.access(u,"globalEval")&&S.contains(h,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?S._evalUrl&&!u.noModule&&S._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},h):x(u.textContent.replace(zt,""),u,h))}return t}function qt(t,e,i){for(var n,r=e?S.filter(e,t):t,o=0;null!=(n=r[o]);o++)i||1!==n.nodeType||S.cleanData(Ct(n)),n.parentNode&&(i&&mt(n)&&Et(Ct(n,"script")),n.parentNode.removeChild(n));return t}S.extend({htmlPrefilter:function(t){return t},clone:function(t,e,i){var n,r,o,a,s=t.cloneNode(!0),l=mt(t);if(!(g.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||S.isXMLDoc(t)))for(a=Ct(s),n=0,r=(o=Ct(t)).length;n<r;n++)Gt(o[n],a[n]);if(e)if(i)for(o=o||Ct(t),a=a||Ct(s),n=0,r=o.length;n<r;n++)Ht(o[n],a[n]);else Ht(t,s);return(a=Ct(s,"script")).length>0&&Et(a,!l&&Ct(t,"script")),s},cleanData:function(t){for(var e,i,n,r=S.event.special,o=0;void 0!==(i=t[o]);o++)if(rt(i)){if(e=i[at.expando]){if(e.events)for(n in e.events)r[n]?S.event.remove(i,n):S.removeEvent(i,n,e.handle);i[at.expando]=void 0}i[st.expando]&&(i[st.expando]=void 0)}}}),S.fn.extend({detach:function(t){return qt(this,t,!0)},remove:function(t){return qt(this,t)},text:function(t){return $(this,(function(t){return void 0===t?S.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Wt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Ut(this,t).appendChild(t)}))},prepend:function(){return Wt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Ut(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Wt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Wt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(S.cleanData(Ct(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return S.clone(this,t,e)}))},html:function(t){return $(this,(function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Ft.test(t)&&!Pt[(_t.exec(t)||["",""])[1].toLowerCase()]){t=S.htmlPrefilter(t);try{for(;i<n;i++)1===(e=this[i]||{}).nodeType&&(S.cleanData(Ct(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=[];return Wt(this,arguments,(function(e){var i=this.parentNode;S.inArray(this,t)<0&&(S.cleanData(Ct(this)),i&&i.replaceChild(e,this))}),t)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){S.fn[t]=function(t){for(var i,n=[],r=S(t),o=r.length-1,a=0;a<=o;a++)i=a===o?this:this.clone(!0),S(r[a])[e](i),u.apply(n,i.get());return this.pushStack(n)}}));var Yt=new RegExp("^("+ct+")(?!px)[a-z%]+$","i"),Xt=/^--/,Zt=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=i),e.getComputedStyle(t)},Kt=function(t,e,i){var n,r,o={};for(r in e)o[r]=t.style[r],t.style[r]=e[r];for(r in n=i.call(t),e)t.style[r]=o[r];return n},Qt=new RegExp(pt.join("|"),"i");function Jt(t,e,i){var n,r,o,a,s=Xt.test(e),l=t.style;return(i=i||Zt(t))&&(a=i.getPropertyValue(e)||i[e],s&&a&&(a=a.replace(L,"$1")||void 0),""!==a||mt(t)||(a=S.style(t,e)),!g.pixelBoxStyles()&&Yt.test(a)&&Qt.test(e)&&(n=l.width,r=l.minWidth,o=l.maxWidth,l.minWidth=l.maxWidth=l.width=a,a=i.width,l.width=n,l.minWidth=r,l.maxWidth=o)),void 0!==a?a+"":a}function $t(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function t(){if(h){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",h.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ft.appendChild(u).appendChild(h);var t=i.getComputedStyle(h);n="1%"!==t.top,l=12===e(t.marginLeft),h.style.right="60%",a=36===e(t.right),r=36===e(t.width),h.style.position="absolute",o=12===e(h.offsetWidth/3),ft.removeChild(u),h=null}}function e(t){return Math.round(parseFloat(t))}var n,r,o,a,s,l,u=b.createElement("div"),h=b.createElement("div");h.style&&(h.style.backgroundClip="content-box",h.cloneNode(!0).style.backgroundClip="",g.clearCloneStyle="content-box"===h.style.backgroundClip,S.extend(g,{boxSizingReliable:function(){return t(),r},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),n},reliableMarginLeft:function(){return t(),l},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,e,n,r;return null==s&&(t=b.createElement("table"),e=b.createElement("tr"),n=b.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",e.style.cssText="border:1px solid",e.style.height="1px",n.style.height="9px",n.style.display="block",ft.appendChild(t).appendChild(e).appendChild(n),r=i.getComputedStyle(e),s=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===e.offsetHeight,ft.removeChild(t)),s}}))}();var te=["Webkit","Moz","ms"],ee=b.createElement("div").style,ie={};function ne(t){var e=S.cssProps[t]||ie[t];return e||(t in ee?t:ie[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),i=te.length;i--;)if((t=te[i]+e)in ee)return t}(t)||t)}var re=/^(none|table(?!-c[ea]).+)/,oe={position:"absolute",visibility:"hidden",display:"block"},ae={letterSpacing:"0",fontWeight:"400"};function se(t,e,i){var n=dt.exec(e);return n?Math.max(0,n[2]-(i||0))+(n[3]||"px"):e}function le(t,e,i,n,r,o){var a="width"===e?1:0,s=0,l=0,u=0;if(i===(n?"border":"content"))return 0;for(;a<4;a+=2)"margin"===i&&(u+=S.css(t,i+pt[a],!0,r)),n?("content"===i&&(l-=S.css(t,"padding"+pt[a],!0,r)),"margin"!==i&&(l-=S.css(t,"border"+pt[a]+"Width",!0,r))):(l+=S.css(t,"padding"+pt[a],!0,r),"padding"!==i?l+=S.css(t,"border"+pt[a]+"Width",!0,r):s+=S.css(t,"border"+pt[a]+"Width",!0,r));return!n&&o>=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-l-s-.5))||0),l+u}function ue(t,e,i){var n=Zt(t),r=(!g.boxSizingReliable()||i)&&"border-box"===S.css(t,"boxSizing",!1,n),o=r,a=Jt(t,e,n),s="offset"+e[0].toUpperCase()+e.slice(1);if(Yt.test(a)){if(!i)return a;a="auto"}return(!g.boxSizingReliable()&&r||!g.reliableTrDimensions()&&A(t,"tr")||"auto"===a||!parseFloat(a)&&"inline"===S.css(t,"display",!1,n))&&t.getClientRects().length&&(r="border-box"===S.css(t,"boxSizing",!1,n),(o=s in t)&&(a=t[s])),(a=parseFloat(a)||0)+le(t,e,i||(r?"border":"content"),o,n,a)+"px"}function he(t,e,i,n,r){return new he.prototype.init(t,e,i,n,r)}S.extend({cssHooks:{opacity:{get:function(t,e){if(e){var i=Jt(t,"opacity");return""===i?"1":i}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(t,e,i,n){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,o,a,s=nt(e),l=Xt.test(e),u=t.style;if(l||(e=ne(s)),a=S.cssHooks[e]||S.cssHooks[s],void 0===i)return a&&"get"in a&&void 0!==(r=a.get(t,!1,n))?r:u[e];"string"===(o=typeof i)&&(r=dt.exec(i))&&r[1]&&(i=yt(t,e,r),o="number"),null!=i&&i==i&&("number"!==o||l||(i+=r&&r[3]||(S.cssNumber[s]?"":"px")),g.clearCloneStyle||""!==i||0!==e.indexOf("background")||(u[e]="inherit"),a&&"set"in a&&void 0===(i=a.set(t,i,n))||(l?u.setProperty(e,i):u[e]=i))}},css:function(t,e,i,n){var r,o,a,s=nt(e);return Xt.test(e)||(e=ne(s)),(a=S.cssHooks[e]||S.cssHooks[s])&&"get"in a&&(r=a.get(t,!0,i)),void 0===r&&(r=Jt(t,e,n)),"normal"===r&&e in ae&&(r=ae[e]),""===i||i?(o=parseFloat(r),!0===i||isFinite(o)?o||0:r):r}}),S.each(["height","width"],(function(t,e){S.cssHooks[e]={get:function(t,i,n){if(i)return!re.test(S.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?ue(t,e,n):Kt(t,oe,(function(){return ue(t,e,n)}))},set:function(t,i,n){var r,o=Zt(t),a=!g.scrollboxSize()&&"absolute"===o.position,s=(a||n)&&"border-box"===S.css(t,"boxSizing",!1,o),l=n?le(t,e,n,s,o):0;return s&&a&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-le(t,e,"border",!1,o)-.5)),l&&(r=dt.exec(i))&&"px"!==(r[3]||"px")&&(t.style[e]=i,i=S.css(t,e)),se(0,i,l)}}})),S.cssHooks.marginLeft=$t(g.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Jt(t,"marginLeft"))||t.getBoundingClientRect().left-Kt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),S.each({margin:"",padding:"",border:"Width"},(function(t,e){S.cssHooks[t+e]={expand:function(i){for(var n=0,r={},o="string"==typeof i?i.split(" "):[i];n<4;n++)r[t+pt[n]+e]=o[n]||o[n-2]||o[0];return r}},"margin"!==t&&(S.cssHooks[t+e].set=se)})),S.fn.extend({css:function(t,e){return $(this,(function(t,e,i){var n,r,o={},a=0;if(Array.isArray(e)){for(n=Zt(t),r=e.length;a<r;a++)o[e[a]]=S.css(t,e[a],!1,n);return o}return void 0!==i?S.style(t,e,i):S.css(t,e)}),t,e,arguments.length>1)}}),S.Tween=he,he.prototype={constructor:he,init:function(t,e,i,n,r,o){this.elem=t,this.prop=i,this.easing=r||S.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=n,this.unit=o||(S.cssNumber[i]?"":"px")},cur:function(){var t=he.propHooks[this.prop];return t&&t.get?t.get(this):he.propHooks._default.get(this)},run:function(t){var e,i=he.propHooks[this.prop];return this.options.duration?this.pos=e=S.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):he.propHooks._default.set(this),this}},he.prototype.init.prototype=he.prototype,he.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=S.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){S.fx.step[t.prop]?S.fx.step[t.prop](t):1!==t.elem.nodeType||!S.cssHooks[t.prop]&&null==t.elem.style[ne(t.prop)]?t.elem[t.prop]=t.now:S.style(t.elem,t.prop,t.now+t.unit)}}},he.propHooks.scrollTop=he.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},S.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},S.fx=he.prototype.init,S.fx.step={};var ce,de,pe=/^(?:toggle|show|hide)$/,fe=/queueHooks$/;function me(){de&&(!1===b.hidden&&i.requestAnimationFrame?i.requestAnimationFrame(me):i.setTimeout(me,S.fx.interval),S.fx.tick())}function ge(){return i.setTimeout((function(){ce=void 0})),ce=Date.now()}function ve(t,e){var i,n=0,r={height:t};for(e=e?1:0;n<4;n+=2-e)r["margin"+(i=pt[n])]=r["padding"+i]=t;return e&&(r.opacity=r.width=t),r}function ye(t,e,i){for(var n,r=(be.tweeners[e]||[]).concat(be.tweeners["*"]),o=0,a=r.length;o<a;o++)if(n=r[o].call(i,e,t))return n}function be(t,e,i){var n,r,o=0,a=be.prefilters.length,s=S.Deferred().always((function(){delete l.elem})),l=function(){if(r)return!1;for(var e=ce||ge(),i=Math.max(0,u.startTime+u.duration-e),n=1-(i/u.duration||0),o=0,a=u.tweens.length;o<a;o++)u.tweens[o].run(n);return s.notifyWith(t,[u,n,i]),n<1&&a?i:(a||s.notifyWith(t,[u,1,0]),s.resolveWith(t,[u]),!1)},u=s.promise({elem:t,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},i),originalProperties:e,originalOptions:i,startTime:ce||ge(),duration:i.duration,tweens:[],createTween:function(e,i){var n=S.Tween(t,u.opts,e,i,u.opts.specialEasing[e]||u.opts.easing);return u.tweens.push(n),n},stop:function(e){var i=0,n=e?u.tweens.length:0;if(r)return this;for(r=!0;i<n;i++)u.tweens[i].run(1);return e?(s.notifyWith(t,[u,1,0]),s.resolveWith(t,[u,e])):s.rejectWith(t,[u,e]),this}}),h=u.props;for(!function(t,e){var i,n,r,o,a;for(i in t)if(r=e[n=nt(i)],o=t[i],Array.isArray(o)&&(r=o[1],o=t[i]=o[0]),i!==n&&(t[n]=o,delete t[i]),(a=S.cssHooks[n])&&"expand"in a)for(i in o=a.expand(o),delete t[n],o)i in t||(t[i]=o[i],e[i]=r);else e[n]=r}(h,u.opts.specialEasing);o<a;o++)if(n=be.prefilters[o].call(u,t,h,u.opts))return v(n.stop)&&(S._queueHooks(u.elem,u.opts.queue).stop=n.stop.bind(n)),n;return S.map(h,ye,u),v(u.opts.start)&&u.opts.start.call(t,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),S.fx.timer(S.extend(l,{elem:t,anim:u,queue:u.opts.queue})),u}S.Animation=S.extend(be,{tweeners:{"*":[function(t,e){var i=this.createTween(t,e);return yt(i.elem,t,dt.exec(e),i),i}]},tweener:function(t,e){v(t)?(e=t,t=["*"]):t=t.match(q);for(var i,n=0,r=t.length;n<r;n++)i=t[n],be.tweeners[i]=be.tweeners[i]||[],be.tweeners[i].unshift(e)},prefilters:[function(t,e,i){var n,r,o,a,s,l,u,h,c="width"in e||"height"in e,d=this,p={},f=t.style,m=t.nodeType&&vt(t),g=at.get(t,"fxshow");for(n in i.queue||(null==(a=S._queueHooks(t,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,d.always((function(){d.always((function(){a.unqueued--,S.queue(t,"fx").length||a.empty.fire()}))}))),e)if(r=e[n],pe.test(r)){if(delete e[n],o=o||"toggle"===r,r===(m?"hide":"show")){if("show"!==r||!g||void 0===g[n])continue;m=!0}p[n]=g&&g[n]||S.style(t,n)}if((l=!S.isEmptyObject(e))||!S.isEmptyObject(p))for(n in c&&1===t.nodeType&&(i.overflow=[f.overflow,f.overflowX,f.overflowY],null==(u=g&&g.display)&&(u=at.get(t,"display")),"none"===(h=S.css(t,"display"))&&(u?h=u:(xt([t],!0),u=t.style.display||u,h=S.css(t,"display"),xt([t]))),("inline"===h||"inline-block"===h&&null!=u)&&"none"===S.css(t,"float")&&(l||(d.done((function(){f.display=u})),null==u&&(h=f.display,u="none"===h?"":h)),f.display="inline-block")),i.overflow&&(f.overflow="hidden",d.always((function(){f.overflow=i.overflow[0],f.overflowX=i.overflow[1],f.overflowY=i.overflow[2]}))),l=!1,p)l||(g?"hidden"in g&&(m=g.hidden):g=at.access(t,"fxshow",{display:u}),o&&(g.hidden=!m),m&&xt([t],!0),d.done((function(){for(n in m||xt([t]),at.remove(t,"fxshow"),p)S.style(t,n,p[n])}))),l=ye(m?g[n]:0,n,d),n in g||(g[n]=l.start,m&&(l.end=l.start,l.start=0))}],prefilter:function(t,e){e?be.prefilters.unshift(t):be.prefilters.push(t)}}),S.speed=function(t,e,i){var n=t&&"object"==typeof t?S.extend({},t):{complete:i||!i&&e||v(t)&&t,duration:t,easing:i&&e||e&&!v(e)&&e};return S.fx.off?n.duration=0:"number"!=typeof n.duration&&(n.duration in S.fx.speeds?n.duration=S.fx.speeds[n.duration]:n.duration=S.fx.speeds._default),null!=n.queue&&!0!==n.queue||(n.queue="fx"),n.old=n.complete,n.complete=function(){v(n.old)&&n.old.call(this),n.queue&&S.dequeue(this,n.queue)},n},S.fn.extend({fadeTo:function(t,e,i,n){return this.filter(vt).css("opacity",0).show().end().animate({opacity:e},t,i,n)},animate:function(t,e,i,n){var r=S.isEmptyObject(t),o=S.speed(e,i,n),a=function(){var e=be(this,S.extend({},t),o);(r||at.get(this,"finish"))&&e.stop(!0)};return a.finish=a,r||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(t,e,i){var n=function(t){var e=t.stop;delete t.stop,e(i)};return"string"!=typeof t&&(i=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each((function(){var e=!0,r=null!=t&&t+"queueHooks",o=S.timers,a=at.get(this);if(r)a[r]&&a[r].stop&&n(a[r]);else for(r in a)a[r]&&a[r].stop&&fe.test(r)&&n(a[r]);for(r=o.length;r--;)o[r].elem!==this||null!=t&&o[r].queue!==t||(o[r].anim.stop(i),e=!1,o.splice(r,1));!e&&i||S.dequeue(this,t)}))},finish:function(t){return!1!==t&&(t=t||"fx"),this.each((function(){var e,i=at.get(this),n=i[t+"queue"],r=i[t+"queueHooks"],o=S.timers,a=n?n.length:0;for(i.finish=!0,S.queue(this,t,[]),r&&r.stop&&r.stop.call(this,!0),e=o.length;e--;)o[e].elem===this&&o[e].queue===t&&(o[e].anim.stop(!0),o.splice(e,1));for(e=0;e<a;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete i.finish}))}}),S.each(["toggle","show","hide"],(function(t,e){var i=S.fn[e];S.fn[e]=function(t,n,r){return null==t||"boolean"==typeof t?i.apply(this,arguments):this.animate(ve(e,!0),t,n,r)}})),S.each({slideDown:ve("show"),slideUp:ve("hide"),slideToggle:ve("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){S.fn[t]=function(t,i,n){return this.animate(e,t,i,n)}})),S.timers=[],S.fx.tick=function(){var t,e=0,i=S.timers;for(ce=Date.now();e<i.length;e++)(t=i[e])()||i[e]!==t||i.splice(e--,1);i.length||S.fx.stop(),ce=void 0},S.fx.timer=function(t){S.timers.push(t),S.fx.start()},S.fx.interval=13,S.fx.start=function(){de||(de=!0,me())},S.fx.stop=function(){de=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(t,e){return t=S.fx&&S.fx.speeds[t]||t,e=e||"fx",this.queue(e,(function(e,n){var r=i.setTimeout(e,t);n.stop=function(){i.clearTimeout(r)}}))},function(){var t=b.createElement("input"),e=b.createElement("select").appendChild(b.createElement("option"));t.type="checkbox",g.checkOn=""!==t.value,g.optSelected=e.selected,(t=b.createElement("input")).value="t",t.type="radio",g.radioValue="t"===t.value}();var we,xe=S.expr.attrHandle;S.fn.extend({attr:function(t,e){return $(this,S.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){S.removeAttr(this,t)}))}}),S.extend({attr:function(t,e,i){var n,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?S.prop(t,e,i):(1===o&&S.isXMLDoc(t)||(r=S.attrHooks[e.toLowerCase()]||(S.expr.match.bool.test(e)?we:void 0)),void 0!==i?null===i?void S.removeAttr(t,e):r&&"set"in r&&void 0!==(n=r.set(t,i,e))?n:(t.setAttribute(e,i+""),i):r&&"get"in r&&null!==(n=r.get(t,e))?n:null==(n=S.find.attr(t,e))?void 0:n)},attrHooks:{type:{set:function(t,e){if(!g.radioValue&&"radio"===e&&A(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}}},removeAttr:function(t,e){var i,n=0,r=e&&e.match(q);if(r&&1===t.nodeType)for(;i=r[n++];)t.removeAttribute(i)}}),we={set:function(t,e,i){return!1===e?S.removeAttr(t,i):t.setAttribute(i,i),i}},S.each(S.expr.match.bool.source.match(/\w+/g),(function(t,e){var i=xe[e]||S.find.attr;xe[e]=function(t,e,n){var r,o,a=e.toLowerCase();return n||(o=xe[a],xe[a]=r,r=null!=i(t,e,n)?a:null,xe[a]=o),r}}));var Me=/^(?:input|select|textarea|button)$/i,Te=/^(?:a|area)$/i;function Se(t){return(t.match(q)||[]).join(" ")}function _e(t){return t.getAttribute&&t.getAttribute("class")||""}function Ae(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(q)||[]}S.fn.extend({prop:function(t,e){return $(this,S.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[S.propFix[t]||t]}))}}),S.extend({prop:function(t,e,i){var n,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(t)||(e=S.propFix[e]||e,r=S.propHooks[e]),void 0!==i?r&&"set"in r&&void 0!==(n=r.set(t,i,e))?n:t[e]=i:r&&"get"in r&&null!==(n=r.get(t,e))?n:t[e]},propHooks:{tabIndex:{get:function(t){var e=S.find.attr(t,"tabindex");return e?parseInt(e,10):Me.test(t.nodeName)||Te.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(S.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){S.propFix[this.toLowerCase()]=this})),S.fn.extend({addClass:function(t){var e,i,n,r,o,a;return v(t)?this.each((function(e){S(this).addClass(t.call(this,e,_e(this)))})):(e=Ae(t)).length?this.each((function(){if(n=_e(this),i=1===this.nodeType&&" "+Se(n)+" "){for(o=0;o<e.length;o++)r=e[o],i.indexOf(" "+r+" ")<0&&(i+=r+" ");a=Se(i),n!==a&&this.setAttribute("class",a)}})):this},removeClass:function(t){var e,i,n,r,o,a;return v(t)?this.each((function(e){S(this).removeClass(t.call(this,e,_e(this)))})):arguments.length?(e=Ae(t)).length?this.each((function(){if(n=_e(this),i=1===this.nodeType&&" "+Se(n)+" "){for(o=0;o<e.length;o++)for(r=e[o];i.indexOf(" "+r+" ")>-1;)i=i.replace(" "+r+" "," ");a=Se(i),n!==a&&this.setAttribute("class",a)}})):this:this.attr("class","")},toggleClass:function(t,e){var i,n,r,o,a=typeof t,s="string"===a||Array.isArray(t);return v(t)?this.each((function(i){S(this).toggleClass(t.call(this,i,_e(this),e),e)})):"boolean"==typeof e&&s?e?this.addClass(t):this.removeClass(t):(i=Ae(t),this.each((function(){if(s)for(o=S(this),r=0;r<i.length;r++)n=i[r],o.hasClass(n)?o.removeClass(n):o.addClass(n);else void 0!==t&&"boolean"!==a||((n=_e(this))&&at.set(this,"__className__",n),this.setAttribute&&this.setAttribute("class",n||!1===t?"":at.get(this,"__className__")||""))})))},hasClass:function(t){var e,i,n=0;for(e=" "+t+" ";i=this[n++];)if(1===i.nodeType&&(" "+Se(_e(i))+" ").indexOf(e)>-1)return!0;return!1}});var Pe=/\r/g;S.fn.extend({val:function(t){var e,i,n,r=this[0];return arguments.length?(n=v(t),this.each((function(i){var r;1===this.nodeType&&(null==(r=n?t.call(this,i,S(this).val()):t)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=S.map(r,(function(t){return null==t?"":t+""}))),(e=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))}))):r?(e=S.valHooks[r.type]||S.valHooks[r.nodeName.toLowerCase()])&&"get"in e&&void 0!==(i=e.get(r,"value"))?i:"string"==typeof(i=r.value)?i.replace(Pe,""):null==i?"":i:void 0}}),S.extend({valHooks:{option:{get:function(t){var e=S.find.attr(t,"value");return null!=e?e:Se(S.text(t))}},select:{get:function(t){var e,i,n,r=t.options,o=t.selectedIndex,a="select-one"===t.type,s=a?null:[],l=a?o+1:r.length;for(n=o<0?l:a?o:0;n<l;n++)if(((i=r[n]).selected||n===o)&&!i.disabled&&(!i.parentNode.disabled||!A(i.parentNode,"optgroup"))){if(e=S(i).val(),a)return e;s.push(e)}return s},set:function(t,e){for(var i,n,r=t.options,o=S.makeArray(e),a=r.length;a--;)((n=r[a]).selected=S.inArray(S.valHooks.option.get(n),o)>-1)&&(i=!0);return i||(t.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],(function(){S.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=S.inArray(S(t).val(),e)>-1}},g.checkOn||(S.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}));var Ce=i.location,Ee={guid:Date.now()},De=/\?/;S.parseXML=function(t){var e,n;if(!t||"string"!=typeof t)return null;try{e=(new i.DOMParser).parseFromString(t,"text/xml")}catch(t){}return n=e&&e.getElementsByTagName("parsererror")[0],e&&!n||S.error("Invalid XML: "+(n?S.map(n.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var Le=/^(?:focusinfocus|focusoutblur)$/,Oe=function(t){t.stopPropagation()};S.extend(S.event,{trigger:function(t,e,n,r){var o,a,s,l,u,h,c,d,f=[n||b],m=p.call(t,"type")?t.type:t,g=p.call(t,"namespace")?t.namespace.split("."):[];if(a=d=s=n=n||b,3!==n.nodeType&&8!==n.nodeType&&!Le.test(m+S.event.triggered)&&(m.indexOf(".")>-1&&(g=m.split("."),m=g.shift(),g.sort()),u=m.indexOf(":")<0&&"on"+m,(t=t[S.expando]?t:new S.Event(m,"object"==typeof t&&t)).isTrigger=r?2:3,t.namespace=g.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),e=null==e?[t]:S.makeArray(e,[t]),c=S.event.special[m]||{},r||!c.trigger||!1!==c.trigger.apply(n,e))){if(!r&&!c.noBubble&&!y(n)){for(l=c.delegateType||m,Le.test(l+m)||(a=a.parentNode);a;a=a.parentNode)f.push(a),s=a;s===(n.ownerDocument||b)&&f.push(s.defaultView||s.parentWindow||i)}for(o=0;(a=f[o++])&&!t.isPropagationStopped();)d=a,t.type=o>1?l:c.bindType||m,(h=(at.get(a,"events")||Object.create(null))[t.type]&&at.get(a,"handle"))&&h.apply(a,e),(h=u&&a[u])&&h.apply&&rt(a)&&(t.result=h.apply(a,e),!1===t.result&&t.preventDefault());return t.type=m,r||t.isDefaultPrevented()||c._default&&!1!==c._default.apply(f.pop(),e)||!rt(n)||u&&v(n[m])&&!y(n)&&((s=n[u])&&(n[u]=null),S.event.triggered=m,t.isPropagationStopped()&&d.addEventListener(m,Oe),n[m](),t.isPropagationStopped()&&d.removeEventListener(m,Oe),S.event.triggered=void 0,s&&(n[u]=s)),t.result}},simulate:function(t,e,i){var n=S.extend(new S.Event,i,{type:t,isSimulated:!0});S.event.trigger(n,null,e)}}),S.fn.extend({trigger:function(t,e){return this.each((function(){S.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var i=this[0];if(i)return S.event.trigger(t,e,i,!0)}});var Ie=/\[\]$/,Re=/\r?\n/g,Ne=/^(?:submit|button|image|reset|file)$/i,ke=/^(?:input|select|textarea|keygen)/i;function Fe(t,e,i,n){var r;if(Array.isArray(e))S.each(e,(function(e,r){i||Ie.test(t)?n(t,r):Fe(t+"["+("object"==typeof r&&null!=r?e:"")+"]",r,i,n)}));else if(i||"object"!==M(e))n(t,e);else for(r in e)Fe(t+"["+r+"]",e[r],i,n)}S.param=function(t,e){var i,n=[],r=function(t,e){var i=v(e)?e():e;n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==i?"":i)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!S.isPlainObject(t))S.each(t,(function(){r(this.name,this.value)}));else for(i in t)Fe(i,t[i],e,r);return n.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=S.prop(this,"elements");return t?S.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!S(this).is(":disabled")&&ke.test(this.nodeName)&&!Ne.test(t)&&(this.checked||!St.test(t))})).map((function(t,e){var i=S(this).val();return null==i?null:Array.isArray(i)?S.map(i,(function(t){return{name:e.name,value:t.replace(Re,"\r\n")}})):{name:e.name,value:i.replace(Re,"\r\n")}})).get()}});var Be=/%20/g,ze=/#.*$/,Ue=/([?&])_=[^&]*/,Ve=/^(.*?):[ \t]*([^\r\n]*)$/gm,je=/^(?:GET|HEAD)$/,He=/^\/\//,Ge={},We={},qe="*/".concat("*"),Ye=b.createElement("a");function Xe(t){return function(e,i){"string"!=typeof e&&(i=e,e="*");var n,r=0,o=e.toLowerCase().match(q)||[];if(v(i))for(;n=o[r++];)"+"===n[0]?(n=n.slice(1)||"*",(t[n]=t[n]||[]).unshift(i)):(t[n]=t[n]||[]).push(i)}}function Ze(t,e,i,n){var r={},o=t===We;function a(s){var l;return r[s]=!0,S.each(t[s]||[],(function(t,s){var u=s(e,i,n);return"string"!=typeof u||o||r[u]?o?!(l=u):void 0:(e.dataTypes.unshift(u),a(u),!1)})),l}return a(e.dataTypes[0])||!r["*"]&&a("*")}function Ke(t,e){var i,n,r=S.ajaxSettings.flatOptions||{};for(i in e)void 0!==e[i]&&((r[i]?t:n||(n={}))[i]=e[i]);return n&&S.extend(!0,t,n),t}Ye.href=Ce.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ce.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Ce.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":qe,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Ke(Ke(t,S.ajaxSettings),e):Ke(S.ajaxSettings,t)},ajaxPrefilter:Xe(Ge),ajaxTransport:Xe(We),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var n,r,o,a,s,l,u,h,c,d,p=S.ajaxSetup({},e),f=p.context||p,m=p.context&&(f.nodeType||f.jquery)?S(f):S.event,g=S.Deferred(),v=S.Callbacks("once memory"),y=p.statusCode||{},w={},x={},M="canceled",T={readyState:0,getResponseHeader:function(t){var e;if(u){if(!a)for(a={};e=Ve.exec(o);)a[e[1].toLowerCase()+" "]=(a[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=a[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return u?o:null},setRequestHeader:function(t,e){return null==u&&(t=x[t.toLowerCase()]=x[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==u&&(p.mimeType=t),this},statusCode:function(t){var e;if(t)if(u)T.always(t[T.status]);else for(e in t)y[e]=[y[e],t[e]];return this},abort:function(t){var e=t||M;return n&&n.abort(e),_(0,e),this}};if(g.promise(T),p.url=((t||p.url||Ce.href)+"").replace(He,Ce.protocol+"//"),p.type=e.method||e.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(q)||[""],null==p.crossDomain){l=b.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=Ye.protocol+"//"+Ye.host!=l.protocol+"//"+l.host}catch(t){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=S.param(p.data,p.traditional)),Ze(Ge,p,e,T),u)return T;for(c in(h=S.event&&p.global)&&0==S.active++&&S.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!je.test(p.type),r=p.url.replace(ze,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Be,"+")):(d=p.url.slice(r.length),p.data&&(p.processData||"string"==typeof p.data)&&(r+=(De.test(r)?"&":"?")+p.data,delete p.data),!1===p.cache&&(r=r.replace(Ue,"$1"),d=(De.test(r)?"&":"?")+"_="+Ee.guid+++d),p.url=r+d),p.ifModified&&(S.lastModified[r]&&T.setRequestHeader("If-Modified-Since",S.lastModified[r]),S.etag[r]&&T.setRequestHeader("If-None-Match",S.etag[r])),(p.data&&p.hasContent&&!1!==p.contentType||e.contentType)&&T.setRequestHeader("Content-Type",p.contentType),T.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+qe+"; q=0.01":""):p.accepts["*"]),p.headers)T.setRequestHeader(c,p.headers[c]);if(p.beforeSend&&(!1===p.beforeSend.call(f,T,p)||u))return T.abort();if(M="abort",v.add(p.complete),T.done(p.success),T.fail(p.error),n=Ze(We,p,e,T)){if(T.readyState=1,h&&m.trigger("ajaxSend",[T,p]),u)return T;p.async&&p.timeout>0&&(s=i.setTimeout((function(){T.abort("timeout")}),p.timeout));try{u=!1,n.send(w,_)}catch(t){if(u)throw t;_(-1,t)}}else _(-1,"No Transport");function _(t,e,a,l){var c,d,b,w,x,M=e;u||(u=!0,s&&i.clearTimeout(s),n=void 0,o=l||"",T.readyState=t>0?4:0,c=t>=200&&t<300||304===t,a&&(w=function(t,e,i){for(var n,r,o,a,s=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=t.mimeType||e.getResponseHeader("Content-Type"));if(n)for(r in s)if(s[r]&&s[r].test(n)){l.unshift(r);break}if(l[0]in i)o=l[0];else{for(r in i){if(!l[0]||t.converters[r+" "+l[0]]){o=r;break}a||(a=r)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),i[o]}(p,T,a)),!c&&S.inArray("script",p.dataTypes)>-1&&S.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),w=function(t,e,i,n){var r,o,a,s,l,u={},h=t.dataTypes.slice();if(h[1])for(a in t.converters)u[a.toLowerCase()]=t.converters[a];for(o=h.shift();o;)if(t.responseFields[o]&&(i[t.responseFields[o]]=e),!l&&n&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=o,o=h.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(r in u)if((s=r.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[r]:!0!==u[r]&&(o=s[0],h.unshift(s[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+l+" to "+o}}}return{state:"success",data:e}}(p,w,T,c),c?(p.ifModified&&((x=T.getResponseHeader("Last-Modified"))&&(S.lastModified[r]=x),(x=T.getResponseHeader("etag"))&&(S.etag[r]=x)),204===t||"HEAD"===p.type?M="nocontent":304===t?M="notmodified":(M=w.state,d=w.data,c=!(b=w.error))):(b=M,!t&&M||(M="error",t<0&&(t=0))),T.status=t,T.statusText=(e||M)+"",c?g.resolveWith(f,[d,M,T]):g.rejectWith(f,[T,M,b]),T.statusCode(y),y=void 0,h&&m.trigger(c?"ajaxSuccess":"ajaxError",[T,p,c?d:b]),v.fireWith(f,[T,M]),h&&(m.trigger("ajaxComplete",[T,p]),--S.active||S.event.trigger("ajaxStop")))}return T},getJSON:function(t,e,i){return S.get(t,e,i,"json")},getScript:function(t,e){return S.get(t,void 0,e,"script")}}),S.each(["get","post"],(function(t,e){S[e]=function(t,i,n,r){return v(i)&&(r=r||n,n=i,i=void 0),S.ajax(S.extend({url:t,type:e,dataType:r,data:i,success:n},S.isPlainObject(t)&&t))}})),S.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),S._evalUrl=function(t,e,i){return S.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){S.globalEval(t,e,i)}})},S.fn.extend({wrapAll:function(t){var e;return this[0]&&(v(t)&&(t=t.call(this[0])),e=S(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return v(t)?this.each((function(e){S(this).wrapInner(t.call(this,e))})):this.each((function(){var e=S(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)}))},wrap:function(t){var e=v(t);return this.each((function(i){S(this).wrapAll(e?t.call(this,i):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){S(this).replaceWith(this.childNodes)})),this}}),S.expr.pseudos.hidden=function(t){return!S.expr.pseudos.visible(t)},S.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new i.XMLHttpRequest}catch(t){}};var Qe={0:200,1223:204},Je=S.ajaxSettings.xhr();g.cors=!!Je&&"withCredentials"in Je,g.ajax=Je=!!Je,S.ajaxTransport((function(t){var e,n;if(g.cors||Je&&!t.crossDomain)return{send:function(r,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];for(a in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)s.setRequestHeader(a,r[a]);e=function(t){return function(){e&&(e=n=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===t?s.abort():"error"===t?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Qe[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=e(),n=s.onerror=s.ontimeout=e("error"),void 0!==s.onabort?s.onabort=n:s.onreadystatechange=function(){4===s.readyState&&i.setTimeout((function(){e&&n()}))},e=e("abort");try{s.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),S.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return S.globalEval(t),t}}}),S.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),S.ajaxTransport("script",(function(t){var e,i;if(t.crossDomain||t.scriptAttrs)return{send:function(n,r){e=S("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",i=function(t){e.remove(),i=null,t&&r("error"===t.type?404:200,t.type)}),b.head.appendChild(e[0])},abort:function(){i&&i()}}}));var $e,ti=[],ei=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=ti.pop()||S.expando+"_"+Ee.guid++;return this[t]=!0,t}}),S.ajaxPrefilter("json jsonp",(function(t,e,n){var r,o,a,s=!1!==t.jsonp&&(ei.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&ei.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return r=t.jsonpCallback=v(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(ei,"$1"+r):!1!==t.jsonp&&(t.url+=(De.test(t.url)?"&":"?")+t.jsonp+"="+r),t.converters["script json"]=function(){return a||S.error(r+" was not called"),a[0]},t.dataTypes[0]="json",o=i[r],i[r]=function(){a=arguments},n.always((function(){void 0===o?S(i).removeProp(r):i[r]=o,t[r]&&(t.jsonpCallback=e.jsonpCallback,ti.push(r)),a&&v(o)&&o(a[0]),a=o=void 0})),"script"})),g.createHTMLDocument=(($e=b.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===$e.childNodes.length),S.parseHTML=function(t,e,i){return"string"!=typeof t?[]:("boolean"==typeof e&&(i=e,e=!1),e||(g.createHTMLDocument?((n=(e=b.implementation.createHTMLDocument("")).createElement("base")).href=b.location.href,e.head.appendChild(n)):e=b),o=!i&&[],(r=z.exec(t))?[e.createElement(r[1])]:(r=Lt([t],e,o),o&&o.length&&S(o).remove(),S.merge([],r.childNodes)));var n,r,o},S.fn.load=function(t,e,i){var n,r,o,a=this,s=t.indexOf(" ");return s>-1&&(n=Se(t.slice(s)),t=t.slice(0,s)),v(e)?(i=e,e=void 0):e&&"object"==typeof e&&(r="POST"),a.length>0&&S.ajax({url:t,type:r||"GET",dataType:"html",data:e}).done((function(t){o=arguments,a.html(n?S("<div>").append(S.parseHTML(t)).find(n):t)})).always(i&&function(t,e){a.each((function(){i.apply(this,o||[t.responseText,e,t])}))}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,(function(e){return t===e.elem})).length},S.offset={setOffset:function(t,e,i){var n,r,o,a,s,l,u=S.css(t,"position"),h=S(t),c={};"static"===u&&(t.style.position="relative"),s=h.offset(),o=S.css(t,"top"),l=S.css(t,"left"),("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1?(a=(n=h.position()).top,r=n.left):(a=parseFloat(o)||0,r=parseFloat(l)||0),v(e)&&(e=e.call(t,i,S.extend({},s))),null!=e.top&&(c.top=e.top-s.top+a),null!=e.left&&(c.left=e.left-s.left+r),"using"in e?e.using.call(t,c):h.css(c)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){S.offset.setOffset(this,t,e)}));var e,i,n=this[0];return n?n.getClientRects().length?(e=n.getBoundingClientRect(),i=n.ownerDocument.defaultView,{top:e.top+i.pageYOffset,left:e.left+i.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,i,n=this[0],r={top:0,left:0};if("fixed"===S.css(n,"position"))e=n.getBoundingClientRect();else{for(e=this.offset(),i=n.ownerDocument,t=n.offsetParent||i.documentElement;t&&(t===i.body||t===i.documentElement)&&"static"===S.css(t,"position");)t=t.parentNode;t&&t!==n&&1===t.nodeType&&((r=S(t).offset()).top+=S.css(t,"borderTopWidth",!0),r.left+=S.css(t,"borderLeftWidth",!0))}return{top:e.top-r.top-S.css(n,"marginTop",!0),left:e.left-r.left-S.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent;t&&"static"===S.css(t,"position");)t=t.offsetParent;return t||ft}))}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var i="pageYOffset"===e;S.fn[t]=function(n){return $(this,(function(t,n,r){var o;if(y(t)?o=t:9===t.nodeType&&(o=t.defaultView),void 0===r)return o?o[e]:t[n];o?o.scrollTo(i?o.pageXOffset:r,i?r:o.pageYOffset):t[n]=r}),t,n,arguments.length)}})),S.each(["top","left"],(function(t,e){S.cssHooks[e]=$t(g.pixelPosition,(function(t,i){if(i)return i=Jt(t,e),Yt.test(i)?S(t).position()[e]+"px":i}))})),S.each({Height:"height",Width:"width"},(function(t,e){S.each({padding:"inner"+t,content:e,"":"outer"+t},(function(i,n){S.fn[n]=function(r,o){var a=arguments.length&&(i||"boolean"!=typeof r),s=i||(!0===r||!0===o?"margin":"border");return $(this,(function(e,i,r){var o;return y(e)?0===n.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(o=e.documentElement,Math.max(e.body["scroll"+t],o["scroll"+t],e.body["offset"+t],o["offset"+t],o["client"+t])):void 0===r?S.css(e,i,s):S.style(e,i,r,s)}),e,a?r:void 0,a)}}))})),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){S.fn[e]=function(t){return this.on(e,t)}})),S.fn.extend({bind:function(t,e,i){return this.on(t,null,e,i)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,i,n){return this.on(e,t,i,n)},undelegate:function(t,e,i){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",i)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(t,e){S.fn[e]=function(t,i){return arguments.length>0?this.on(e,null,t,i):this.trigger(e)}}));var ii=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;S.proxy=function(t,e){var i,n,r;if("string"==typeof e&&(i=t[e],e=t,t=i),v(t))return n=s.call(arguments,2),(r=function(){return t.apply(e||this,n.concat(s.call(arguments)))}).guid=t.guid=t.guid||S.guid++,r},S.holdReady=function(t){t?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=A,S.isFunction=v,S.isWindow=y,S.camelCase=nt,S.type=M,S.now=Date.now,S.isNumeric=function(t){var e=S.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},S.trim=function(t){return null==t?"":(t+"").replace(ii,"$1")},void 0===(n=function(){return S}.apply(e,[]))||(t.exports=n);var ni=i.jQuery,ri=i.$;return S.noConflict=function(t){return i.$===S&&(i.$=ri),t&&i.jQuery===S&&(i.jQuery=ni),S},void 0===r&&(i.jQuery=i.$=S),S}))},function(t,e,i){var n=i(0);t.exports={normalizeUrl:function(t){return t.replace("https://","http://")},domainFromUrl:function(t){var e=/^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(t);return e?e[3]:t},average:function(t,e){if(0===t.length)return null;for(var i=0,n=0,r=0;r<t.length;r++){i+=e?t[r][e]:t[r],n++}return i/n},countUnique:function(t){for(var e={},i=0;i<t.length;i++)e[t[i]]=1+(e[t[i]]||0);return Object.keys(e).length},averageVectors:function(t,e){var i=new n.Vector3;if(0===t.length)return i;for(var r=0,o=0;o<t.length;o++){var a=e?t[o][e]:t[o];i.add(a),r++}return i.divideScalar(r)},equalLists:function(t,e){if(t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(t[i]!==e[i])return!1;return!0},lowerMedian:function(t,e){return 0===t.length?null:(e=e||2,t.sort((function(t,e){return t-e})),t[Math.floor(t.length/e)])},stableSort:function(t,e){return t.map((function(t,e){return{value:t,index:e}})).sort((function(t,i){var n=e(t.value,i.value);return 0!==n?n:t.index-i.index})).map((function(t){return t.value}))},filterAll:function(t,e){return t.filter((function(t){return e.every((function(e){return e(t)}))}))},formatDate:function(t){return[t.getFullYear(),t.getMonth()+1,t.getDate()].join("-")},formatDatetime:function(t){return[t.getFullYear(),t.getMonth()+1,t.getDate(),t.getHours(),t.getMinutes()].join("-")},randomString:function(t){for(var e="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<t;n++)e+=i.charAt(Math.floor(Math.random()*i.length));return e},nth:function(t){return 1==(t%=10)?t+"st":2==t?t+"nd":3==t?t+"rd":t+"th"},extendObject:function(t,e){return Object.keys(e).forEach((function(i){t[i]=e[i]})),t},deepExtend:function t(e){e=e||{};for(var i=1;i<arguments.length;i++){var n=arguments[i];if(n)for(var r in n)n.hasOwnProperty(r)&&("object"==typeof n[r]?e[r]=t(e[r],n[r]):e[r]=n[r])}return e},inherit:function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},extend:function(t,e){for(var i in e.prototype)t.prototype[i]=e.prototype[i]}},Math.sign=function(t){return t<0?-1:1}},function(t,e,i){var n=i(15);t.exports={globalDone:null,funcs:[],counter:0,uniqueID:0,start:function(t,e,i,r,o,a,s){return r=r||0,this.funcs.push({func:t,current:-r*Math.abs(e),duration:(1-Math.max(r,0))*Math.abs(e),done:i,easing:o||n.linearTween,cycling:e<0,running:!0,debug:r<0,name:a||"T"+this.counter,id:void 0===s?this.counter:s,paused:!1}),t(0,16),this.counter+=1,t},trigger:function(t){var e=void 0===t.delayRatio?0:t.delayRatio,i=t.func||function(){},r=void 0===t.duration?0:t.duration;void 0!==t.cycling&&t.cycling&&(r=-Math.abs(r));var o=t.done||null,a=t.easing||n.linearTween,s=t.name||"R"+this.counter,l=void 0===t.id?this.counter:t.id;return this.start(i,r,o,e,a,s,l)},setTimeout:function(t,e,i){var n=void 0===i?this.counter:i;return this.trigger({done:t,duration:void 0===e?0:e,name:"O"+this.counter,id:n})},pause:function(){this.paused=!0},resume:function(){this.paused=!1},update:function(t){this.funcs.forEach((function(e){if(!(e.paused||(e.current+=1e3*t,e.current<0)))if(e.current>=e.duration&&!e.cycling){var i=e.easing(1,0,1,1);e.func(i,1e3*t),e.done&&e.done(),e.running=!1}else{var n=e.easing(e.current%e.duration/e.duration,0,1,1);(e.func(n,1e3*t)||!1)&&(e.done&&e.done(),e.running=!1)}}));var e=this.funcs.length;this.funcs=this.funcs.filter((function(t){return t.running}));var i=this.funcs.length;if(e>0&&0===i&&this.globalDone){var n=this.globalDone;this.globalDone=null,n()}},adjustSpeed:function(t,e){var i=this.get(t);i&&(i.duration/=e,i.current/=e)},getById:function(t){return this.funcs.filter((function(e){return t===e.id}))},get:function(t){for(var e=0;e<this.funcs.length;e+=1)if(this.funcs[e].func==t)return this.funcs[e];return null},isRunning:function(t){var e=this.get(t);return null!==e&&e.running},countActive:function(){for(var t=0,e=0;e<this.funcs.length;e+=1)t+=this.funcs[e].running;return t},listActive:function(){for(var t=[],e=0;e<this.funcs.length;e+=1)this.funcs[e].running&&t.push(this.funcs[e].name);return t},done:function(t){this.globalDone=t},cancelById:function(t){var e=void 0===t?0:t;this.funcs=this.funcs.filter((function(t){return t.id!==e}))},cancel:function(t){this.funcs=this.funcs.filter((function(e){return e.func!==t}))},getUniqueId:function(){return this.uniqueID-=1,this.uniqueID}}},function(t,e,i){var n=i(0);t.exports={convertVisionVector:function(t){return new n.Vector3(t.x,t.z,-t.y)},convertVisionQuaternion:function(t){return new n.Quaternion(t.x,t.z,-t.y,t.w).multiply((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0),n.Math.degToRad(90)))},convertVisionQuaternionAutoScene:function(t){return new n.Quaternion(t.x,t.y,t.z,t.w).multiply((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0),n.Math.degToRad(-90)))},convertWorkshopVector:function(t){return new n.Vector3(-t.x,t.y,t.z)},convertWorkshopQuaternion:function(t){return new n.Quaternion(-t.x,t.y,t.z,-t.w).multiply(new n.Quaternion(Math.sqrt(2)/2,Math.sqrt(2)/2,0,0))},convertWorkshopPanoramaQuaternion:function(t){return new n.Quaternion(t.x,-t.y,-t.z,t.w).normalize().multiply((new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0),n.Math.degToRad(270)))},convertWorkshopOrthoZoom:function(t){return-1===t?-1:t/4},toPrecision:function(t,e){var i=Math.pow(10,e);return Math.round(t*i)/i},projectPositionToCanvas:function(t,e,i){(i=i||new n.Vector3).copy(t);var r=.5*(window.renderWidth || window.innerWidth),o=.5*(window.renderHeight || window.innerHeight);return i.project(e),i.x=i.x*r+r,i.y=-i.y*o+o,i},convertScreenPositionToNDC:function(t,e,i){return(i=i||new n.Vector2).x=t/(window.renderWidth || window.innerWidth)*2-1,i.y=-e/(window.renderHeight || window.innerWidth)*2+1,i},constrainedTurn:function(t){var e=t%(2*Math.PI);return e>Math.PI?e-=2*Math.PI:e<-Math.PI?e+=2*Math.PI:e},getFOVDotThreshold:function(t){return Math.cos(n.Math.degToRad(t/2))},compareFloats:function(t,e){return Math.abs(t-e)<Number.EPSILON*Math.pow(2,45)},convertWorldPositionToScreen:function(t,e){var i=t.clone().project(e),n=(window.renderWidth || window.innerWidth)/2,r=(window.renderHeight || (window.renderHeight || window.innerHeight))/2;return{x:~~(i.x*n+n),y:~~(-i.y*r+r)}},getVerticesOfItemSize:function(t){for(var e=t.attributes.position,i=e.itemSize,r=[],o={},a=0,s=e.array.length;a<s;a+=i){var l=e.array[a],u=e.array[a+1],h=e.array[a+2],c="k_"+l+"_"+u+"_"+h;void 0===o[c]&&(r.push(new n.Vector3(l,u,h)),o[c]=1)}return r},computeWorldPositionOutCamera:function(t,e){var i=(t=t.clone()).applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix),n=Math.abs(i.x)>1,r=Math.abs(i.y)>1,o=Math.abs(i.z)>1;return!!(n||r||o)},hexToRGB:function(t){return"rgb("+((t=t.replace("#","0x"))>>16)+","+(t>>8&255)+","+(255&t)+")"},RGBToHex:function(t){var e=t.split(/[^\d]+/);return"#"+(e[1]<<16|e[2]<<8|e[3]).toString(16)},toFixed:function(t,e){var i=(t+="").indexOf(".");return t=-1!==i?t.substring(0,e+i+1):t.substring(0),parseFloat(t).toFixed(e)}}},function(t,e){t.exports={vector:function(t,e){var i=t.clone();return e=e.clone(),function(n){t.set(i.x*(1-n)+e.x*n,i.y*(1-n)+e.y*n,i.z*(1-n)+e.z*n)}},quaternion:function(t,e){var i=t.clone();return function(n){t.copy(i).slerp(e,n)}},property:function(t,e,i,n){var r=t[e];return function(o){t[e]=r*(1-o)+i*o,n&&n(t[e])}},uniform:function(t,e,i){var n=t.material.uniforms[e].value;return function(r){t.material.uniforms[e]&&(t.material.uniforms[e].value=n*(1-r)+i*r)}},matrix4:function(t,e){var i=t.clone();return function(n){for(var r=t.elements,o=i.elements,a=e.elements,s=0;s<16;s++)r[s]=o[s]*(1-n)+a[s]*n}},allUniforms:function(t,e,i){var n=t.map(function(t){return this.uniform(t,e,i)}.bind(this));return function(t){n.forEach((function(e){e(t)}))}}}},function(t,e,i){(function(e){(function(n){function r(t,i,n){function a(){o.warn("Retrying ",i),r(t,i,n).done(l.resolve.bind(l)).progress(l.notify.bind(l)).fail(l.reject.bind(l))}var s=function(t,e,i){var n=new XMLHttpRequest;if(i&&"withCredentials"in n)n.open(t,e,i);else if("undefined"!=typeof XDomainRequest)(n=new XDomainRequest).open(t,e);else{if(i)throw"Browser does not support CORS!";n.open(t,e)}return n}(t,i,!1);if((n=n||{}).retries=void 0!==n.retries?n.retries:0,n.retry=void 0!==n.retry?n.retry:"get"===t.toLowerCase(),n.responseType)if(["arraybuffer","text","json"].indexOf(n.responseType)>-1)s.responseType=n.responseType;else{if("image/jpeg"!==n.responseType)throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');s.responseType="arraybuffer"}"json"===n.responseType&&s.setRequestHeader("Accept","application/json"),n.auth&&s.setRequestHeader("Authorization",n.auth),"object"==typeof n.data&&(n.data=JSON.stringify(n.data),s.setRequestHeader("Content-Type","application/json"));var l=e.Deferred();return s.onreadystatechange=function(t){if(4==this.readyState)if(this.status>=500&&this.status<=600&&n.retry&&n.retries<3)n.retries++,setTimeout(a,1e3);else if(200==this.status){var e=function(t,e){var i=t.response;if("json"===e&&"object"!=typeof i)try{i=JSON.parse(t.responseText)}catch(t){return void l.reject({error:"Failed parsing JSON"})}else if("image/jpeg"===e){var n=new Uint8Array(t.response),r=new Blob([n],{type:"image/jpeg"}),o=URL.createObjectURL(r);(i=new Image).src=o,i.crossOrigin="Anonymous",i.onload=function(){URL.revokeObjectURL(o)}}return i}(this,n.responseType);l.resolve(e)}else l.reject(this)},s.onprogress=function(t){l.notify(t)},s.send(n.data),l.promise()}var o=new(i(2))(n);window.URL=window.URL||window.webkitURL,window.REQUEST_CACHE=window.REQUEST_CACHE||{},G.basic=window.PREFETCHED_MODELDATA,window.PREFETCHED_MODELDATA=window.PREFETCHED_MODELDATA||{},setTimeout((function(){window.REQUEST_CACHE=null,window.PREFETCHED_MODELDATA={}}),6e4),window.onpageshow=function(t){t.persisted&&(window.REQUEST_CACHE=null,window.PREFETCHED_MODELDATA={})},t.exports={get:function(t,i){var n,o;if(s=void 0===(i=i||{}).cache||i.cache){var a=(n=t,window.REQUEST_CACHE?window.REQUEST_CACHE[n]:null);if(a)return a}var s=i.fetchNum;return o=1===i.fetchNum&&i.prefetchFrom&&window.PREFETCHED_MODELDATA[i.prefetchFrom]?e.when(window.PREFETCHED_MODELDATA[i.prefetchFrom]):2===i.fetchNum&&i.prefetchFrom&&window.PREFETCHED_MODELDATA[i.prefetchFrom][i.prefetchFrom2]?e.when(window.PREFETCHED_MODELDATA[i.prefetchFrom][i.prefetchFrom2]):3===i.fetchNum&&i.prefetchFrom&&window.PREFETCHED_MODELDATA[i.prefetchFrom][i.prefetchFrom2][i.prefetchFrom3]?e.when(window.PREFETCHED_MODELDATA[i.prefetchFrom][i.prefetchFrom2][i.prefetchFrom3]):r("GET",t,i),s&&function(t,e){window.REQUEST_CACHE&&(window.REQUEST_CACHE[t]=e)}(t,o),o},post:function(t,e){return r("POST",t,e)},patch:function(t,e){return r("PATCH",t,e)},getImage:function(t,i){function n(){o.warn("Retrying ",t),s.getImage(t,i-1).done(r.resolve.bind(r)).progress(r.notify.bind(r)).fail(r.reject.bind(r))}var r=e.Deferred(),a=new Image,s=this;return null!=i||(i=3),a.onerror=function(){i>0?setTimeout(n,1e3):r.reject()},a.onload=function(){r.resolve(a)},a.crossOrigin="anonymous",a.src=t,r}}}).call(this,"/js/util/ajax.js")}).call(this,i(6))},function(t,e,i){"use strict";var n=i(0),r=i(1),o="precision highp float;\nprecision highp int;\n\nuniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n",a="precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";t.exports={basicTextured:{uniforms:{tDiffuse:{type:"t",value:null},alpha:{type:"f",value:1}},vertexShader:"varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",fragmentShader:"varying vec2 vUv;\nuniform float alpha;\nuniform sampler2D tDiffuse;\nvoid main() {\n vec4 texColor = texture2D(tDiffuse, vUv);\n gl_FragColor = vec4(texColor.rgb, texColor.a * alpha);\n}"},copyCubeMap:{uniforms:{tDiffuse:{type:"t",value:null},alpha:{type:"f",value:1}},vertexShader:"varying vec3 vWorldPos;\nvoid main() {\n vWorldPos = vec3(-position.x, -position.y, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",fragmentShader:"varying vec3 vWorldPos;\nuniform float alpha;\nuniform samplerCube tDiffuse;\nvoid main() {\n vec4 texColor = textureCube(tDiffuse, vWorldPos);\n gl_FragColor = vec4(texColor.rgb, texColor.a * alpha);\n}"},cube:{uniforms:{map:{type:"t",value:null},opacity:{type:"f",value:1}},vertexShader:o+"varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",fragmentShader:a+"uniform samplerCube map;\nuniform float opacity;\n\nvarying vec3 vWorldPosition;\n\nvoid main() {\n vec4 color = textureCube( map, vec3( -vWorldPosition.x, vWorldPosition.yz ) );\n gl_FragColor = vec4(color.rgb, opacity);\n}\n"},model:{uniforms:{map:{type:"t",value:null},modelAlpha:{type:"f",value:r.modelAlpha},opacity:{type:"f",value:1},progress:{type:"f",value:0},blackout:{type:"i",value:0},pano0Map:{type:"t",value:null},pano0Position:{type:"v3",value:new n.Vector3},pano0Matrix:{type:"m4",value:new n.Matrix4},pano1Map:{type:"t",value:null},pano1Position:{type:"v3",value:new n.Vector3},pano1Matrix:{type:"m4",value:new n.Matrix4},measureMode:{type:"i",value:0},mouseAPosition:{type:"v2",value:new n.Vector2},centerT:{type:"v3",value:new n.Vector3},centerB:{type:"v3",value:new n.Vector3},virtualCameraAngle:{type:"f",value:0}},vertexShader:o+["uniform vec3 pano0Position;","uniform mat4 pano0Matrix;","uniform vec3 pano1Position;","uniform mat4 pano1Matrix;","varying vec2 vUv;","varying vec3 vWorldPosition;","varying vec3 vWorldPosition0;","varying vec3 vWorldPosition1;","void main() {","vUv = uv;","vec4 worldPosition = modelMatrix * vec4(position, 1.0);","vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;","vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;","vWorldPosition = position.xyz;","vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;","vWorldPosition0.x *= -1.0;","vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;","vWorldPosition1.x *= -1.0;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:a+["uniform sampler2D map;","uniform float modelAlpha;","uniform float opacity;","uniform float progress;","uniform int blackout;","uniform vec3 pano0Position;","uniform samplerCube pano0Map;","uniform vec3 pano1Position;","uniform samplerCube pano1Map;","uniform vec2 mouseAPosition;","uniform vec2 mousePosition;\nuniform bool measureMode;\nuniform vec3 centerT;","uniform vec3 centerB;","uniform float virtualCameraAngle;","varying vec2 vUv;","varying vec3 vWorldPosition;","varying vec3 vWorldPosition0;","varying vec3 vWorldPosition1;","void main() {","const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);","const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);","const vec4 GREEN = vec4(0.0, 1.0, 0.0, 1.0);","vec4 colorFromPanos;","vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);","vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);","vec4 colorFromTexture = texture2D( map, vUv );","if (blackout == 0) {","colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);","} else if (blackout == 1) {","colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));","colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));","} else if (blackout == 2) {","colorFromPanos = mix(colorFromPano0, BLACK, progress);","} else if (blackout == 3) {","colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));","}","if (measureMode && distance(mouseAPosition, gl_FragCoord.xy) < 80.0) {","colorFromPanos = mix(colorFromPanos, colorFromTexture, 1.0);","} else {","colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);","}","vec3 centerT_vW = normalize(vec3(vWorldPosition.x - centerT.x, vWorldPosition.y - centerT.y, vWorldPosition.z - centerT.z));","vec3 centerT_B = normalize(vec3(centerB.x - centerT.x, centerB.y - centerT.y, centerB.z - centerT.z ));","float angle = acos(dot(centerT_vW, centerT_B));","float cosine = cos(virtualCameraAngle);","float cosineV = distance(centerT, centerB) / distance(centerT, vWorldPosition);","bool condition1 = (angle < virtualCameraAngle);","bool condition2 = (cosineV >= cosine && cosineV <= 1.0);","if ( condition1 ) {","colorFromPanos = mix(GREEN, colorFromPanos, 0.8);","}","float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);","colorFromPanos = mix(colorFromPanos, GREY, whiteness);","gl_FragColor = vec4(colorFromPanos.rgb, opacity);","}"].join("\n")},model2:{uniforms:{map:{type:"t",value:null},modelAlpha:{type:"f",value:r.modelAlpha},opacity:{type:"f",value:1},progress:{type:"f",value:0},blackout:{type:"i",value:0},pano0Map:{type:"t",value:null},pano0Position:{type:"v3",value:new n.Vector3},pano0Matrix:{type:"m4",value:new n.Matrix4},pano1Map:{type:"t",value:null},pano1Position:{type:"v3",value:new n.Vector3},pano1Matrix:{type:"m4",value:new n.Matrix4},hue0:{type:"f",value:0},saturation0:{type:"f",value:0},brightness0:{type:"f",value:0},contrast0:{type:"f",value:0},gamma0:{type:"f",value:1},vibrance0:{type:"f",value:0},balance0:{type:"v3",value:new n.Vector3},hue1:{type:"f",value:0},saturation1:{type:"f",value:0},brightness1:{type:"f",value:0},contrast1:{type:"f",value:0},gamma1:{type:"f",value:1},vibrance1:{type:"f",value:0},balance1:{type:"v3",value:new n.Vector3},base:{type:"f",value:2},measureMode:{type:"i",value:0},mouseAPosition:{type:"v2",value:new n.Vector2}},vertexShader:o+"uniform vec3 pano0Position;\nuniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\nuniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\nvoid main() {\n\n vUv = uv;\n vec4 worldPosition = modelMatrix * vec4(position, 1.0);\n\n vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;\n vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;\n vWorldPosition0.x *= -1.0;\n\n vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;\n vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;\n vWorldPosition1.x *= -1.0;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",fragmentShader:a+"uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\nuniform float progress;\nuniform int blackout;\n\nuniform vec3 pano0Position;\nuniform samplerCube pano0Map;\n\nuniform vec3 pano1Position;\nuniform samplerCube pano1Map;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\nuniform vec2 mousePosition;\nuniform int isEditVersion;\nuniform float hue0;\nuniform float saturation0;\nuniform float brightness0;\nuniform float contrast0;\nuniform float gamma0;\nuniform float vibrance0;\nuniform float hue1;\nuniform vec3 balance0;\nuniform float saturation1;\nuniform float brightness1;\nuniform float contrast1;\nuniform float gamma1;\nuniform float vibrance1;\nuniform vec3 balance1;\nuniform float base;\n\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\n\nfloat bcolor( in float value, in float b ) {\n\treturn max(min(value * pow(base, b), 1.0), 0.0);\n}\n\nvoid main() {\n\tconst vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);\n\tconst vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);\n\n\tvec4 colorFromPanos;\n\tvec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);\n\tvec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);\n\n\tif (blackout == 0) {\n\t\tcolorFromPanos = mix(colorFromPano0, colorFromPano1, progress);\n\t} else if (blackout == 1) {\n\t\tcolorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));\n\t\tcolorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));\n\t} else if (blackout == 2) {\n\t\tcolorFromPanos = mix(colorFromPano0, BLACK, progress);\n\t} else if (blackout == 3) {\n\t\tcolorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));\n\t}\n\n\tvec4 colorFromTexture = texture2D( map, vUv );\n\tcolorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);\n\n\tfloat whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);\n\tcolorFromPanos = mix(colorFromPanos, GREY, whiteness);\n\tgl_FragColor = vec4(colorFromPanos.rgb, opacity);\n\tfloat hue = mix(hue0, hue1, progress);\n\tfloat gamma = mix(gamma0, gamma1, progress);\n\tfloat brightness = mix(brightness0, brightness1, progress);\n\tfloat contrast = mix(contrast0, contrast1, progress);\n\tfloat saturation = mix(saturation0, saturation1, progress);\n\tfloat vibrance = mix(vibrance0, vibrance1, progress);\n\tvec3 balance = mix(balance0, balance1, progress);\n\tgl_FragColor.r = bcolor(gl_FragColor.r, balance.x);\n\tgl_FragColor.g = bcolor(gl_FragColor.g, balance.y);\n\tgl_FragColor.b = bcolor(gl_FragColor.b, balance.z);\n\tif (hue!=0.0){\n float angle = hue * 3.14159265;\n float s = sin(angle), c = cos(angle);\n vec3 weights = (vec3(2.0 * c, -sqrt(3.0) * s - c, sqrt(3.0) * s - c) + 1.0) / 3.0;\n float len = length(gl_FragColor.rgb);\n gl_FragColor.rgb = vec3(\n dot(gl_FragColor.rgb, weights.xyz),\n dot(gl_FragColor.rgb, weights.zxy),\n dot(gl_FragColor.rgb, weights.yzx)\n );\n }\n if (saturation!=0.0){\n float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;\n if (saturation > 0.0) {\n gl_FragColor.rgb += (average - gl_FragColor.rgb) * (1.0 - 1.0 / (1.001 - saturation));\n } else {\n gl_FragColor.rgb += (average - gl_FragColor.rgb) * (-saturation);\n }\n\t}\n gl_FragColor.rgb += brightness;\n if (contrast!=0.0){\n if (contrast > 0.0) {\n gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) / (1.0 - contrast) + 0.5;\n } else {\n gl_FragColor.rgb = (gl_FragColor.rgb - 0.5) * (1.0 + contrast) + 0.5;\n }\n\t}\n if (vibrance!=0.0){\n float average = (gl_FragColor.r + gl_FragColor.g + gl_FragColor.b) / 3.0;\n float mx = max(gl_FragColor.r, max(gl_FragColor.g, gl_FragColor.b));\n float amt = (mx - average) * (-vibrance * 3.0);\n gl_FragColor.rgb = mix(gl_FragColor.rgb, vec3(mx), amt);\n }\n if (gamma!=1.0){\n gl_FragColor = LinearToGamma( gl_FragColor, float( gamma ) );\n }\n}\n"},modelOutside:{uniforms:{map:{type:"t",value:null},opacity:{type:"f",value:1},brightness:{type:"f",value:0}},vertexShader:o+"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",fragmentShader:a+"uniform sampler2D map;\nuniform float opacity;\nuniform float brightness;\nvarying vec2 vUv;\n\nvec4 white = vec4(0.5, 0.5, 0.5, 1.0);\n\nvoid main() {\n\n vec4 colorFromTexture = texture2D( map, vUv );\n float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);\n colorFromTexture = mix(colorFromTexture, white, whiteness);\n gl_FragColor = vec4(colorFromTexture.rgb, opacity);\n\n}\n"},ribbon:{uniforms:{map:{type:"t",value:null},opacity:{type:"f",value:1},color:{type:"c",value:new n.Color(r.path.color)}},vertexShader:o+"varying vec2 vUv;\nvarying vec3 vN;\nvarying vec4 vP;\n\nvoid main() {\n\n vUv = uv;\n vN= normalMatrix * normal;\n vP = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * vP;\n}\n",fragmentShader:a+"uniform sampler2D map;\nuniform float opacity;\nvarying vec2 vUv;\nuniform vec3 color;\nvarying vec3 vN; // show-1182\nvarying vec4 vP; // show-1182\n\nvoid main() {\n\t// TODO add scroll-in and pulsing behaviors\n\tvec3 vNn = normalize(vN);\n\tvec3 vPn = normalize(vP.xyz);\n\tfloat f = pow(1.0-abs(dot(vNn,vPn)),0.2);\n vec4 colorFromTexture = texture2D( map, vUv );\n colorFromTexture.a *= f;\n gl_FragColor = vec4((color.rgb*colorFromTexture.rgb),\n \t\t\t\t\t\t(opacity*colorFromTexture.a));\n}\n"},waypoint:{uniforms:{map:{type:"t",value:null},opacity:{type:"f",value:1},pulse:{type:"f",value:1},nearFade:{type:"v2",value:new n.Vector2(2*r.insideNear,2*r.path.waypointIndoorRadius)},color:{type:"c",value:new n.Color(r.reticuleColor)}},vertexShader:o+"varying vec2 vUv;\nvarying vec4 vPointView;\n\nvoid main() {\n\n vUv = uv;\n vPointView = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * vPointView;\n\n}\n",fragmentShader:a+"uniform sampler2D map;\nuniform float opacity;\nuniform float pulse; // another opacity, with a different clock\nuniform vec2 nearFade;\nvarying vec2 vUv;\nvarying vec4 vPointView;\nuniform vec3 color;\n\nvoid main() {\n\t// TODO add scroll-in and pulsing behaviors\n\tfloat depthFade = min(1.0, (abs(vPointView.z)-nearFade.x)/(nearFade.y-nearFade.x));\n vec4 colorFromTexture = texture2D( map, vUv );\t\t// we only use the alpha!\n gl_FragColor = vec4(color.rgb,\n \t\t\t\t\t\t(pulse*opacity*colorFromTexture.a * depthFade));\n}\n"},modelDebug:{uniforms:{map:{type:"t",value:null},modelAlpha:{type:"f",value:r.modelAlpha},depthmapRatio:{type:"f",value:0},opacity:{type:"f",value:1},progress:{type:"f",value:0},considerOcclusion:{type:"i",value:r.fancierTransition},highlightPanoSelection:{type:"i",value:0},useThirdPano:{type:"i",value:r.useThirdPano},pano0Map:{type:"t",value:null},pano0Depth:{type:"t",value:null},pano0Position:{type:"v3",value:new n.Vector3},pano0Matrix:{type:"m4",value:new n.Matrix4},pano0Weight:{type:"f",value:r.transition.pano0Weight},pano1Map:{type:"t",value:null},pano1Depth:{type:"t",value:null},pano1Position:{type:"v3",value:new n.Vector3},pano1Matrix:{type:"m4",value:new n.Matrix4},pano1Weight:{type:"f",value:r.transition.pano1Weight},pano2Map:{type:"t",value:null},pano2Depth:{type:"t",value:null},pano2Position:{type:"v3",value:new n.Vector3},pano2Matrix:{type:"m4",value:new n.Matrix4},pano2Weight:{type:"f",value:r.transition.pano2Weight}},vertexShader:o+"uniform vec3 pano0Position;\nuniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\nuniform mat4 pano1Matrix;\n\nuniform vec3 pano2Position;\nuniform mat4 pano2Matrix;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\nvarying vec3 vWorldPosition2;\n\nvarying vec4 worldPosition;\n\nvoid main() {\n\n vUv = uv;\n worldPosition = modelMatrix * vec4(position, 1.0);\n\n vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;\n vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;\n vWorldPosition0.x *= -1.0;\n\n vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;\n vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;\n vWorldPosition1.x *= -1.0;\n\n vec3 positionLocalToPanoCenter2 = worldPosition.xyz - pano2Position;\n vWorldPosition2 = (vec4(positionLocalToPanoCenter2, 2.0) * pano2Matrix).xyz;\n vWorldPosition2.x *= -1.0;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",fragmentShader:a+"uniform sampler2D map;\nuniform float depthmapRatio;\nuniform float modelAlpha;\nuniform float opacity;\nuniform float progress;\nuniform int considerOcclusion;\nuniform int highlightPanoSelection;\nuniform int useThirdPano;\n\nuniform vec3 pano0Position;\nuniform samplerCube pano0Map;\nuniform samplerCube pano0Depth;\nuniform float pano0Weight;\n\nuniform vec3 pano1Position;\nuniform samplerCube pano1Map;\nuniform samplerCube pano1Depth;\nuniform float pano1Weight;\n\nuniform vec3 pano2Position;\nuniform samplerCube pano2Map;\nuniform samplerCube pano2Depth;\nuniform float pano2Weight;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\nvarying vec3 vWorldPosition2;\n\nvarying vec4 worldPosition;\n\nvoid main() {\n\n vec4 depthFromPano0 = textureCube( pano0Depth, vWorldPosition0.xyz );\n vec4 depthFromPano1 = textureCube( pano1Depth, vWorldPosition1.xyz );\n vec4 depthFromPano2 = textureCube( pano2Depth, vWorldPosition2.xyz );\n\n vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz );\n vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz );\n vec4 colorFromPano2 = textureCube( pano2Map, vWorldPosition2.xyz );\n\n float distanceToPano0 = distance(worldPosition.xyz, pano0Position);\n float distanceToPano1 = distance(worldPosition.xyz, pano1Position);\n float distanceToPano2 = distance(worldPosition.xyz, pano2Position);\n\n float cameraToPano0 = distance(cameraPosition.xyz, pano0Position);\n float cameraToPano1 = distance(cameraPosition.xyz, pano1Position);\n float cameraToPano2 = distance(cameraPosition.xyz, pano2Position);\n\n float contributionFromPano0 = cameraToPano0 == 0.0 ? 1000.0 : pano0Weight / cameraToPano0;\n float contributionFromPano1 = cameraToPano1 == 0.0 ? 1000.0 : pano1Weight / cameraToPano1;\n float contributionFromPano2 = cameraToPano2 == 0.0 ? 1000.0 : pano2Weight / cameraToPano2;\n\n contributionFromPano0 *= 1.0 / distanceToPano0;\n contributionFromPano1 *= 1.0 / distanceToPano1;\n contributionFromPano2 *= 1.0 / distanceToPano2;\n\n if(considerOcclusion == 1) {\n bool occludedFromPano0 = distanceToPano0 / 10.0 > 1.01 - depthFromPano0.x;\n bool occludedFromPano1 = distanceToPano1 / 10.0 > 1.01 - depthFromPano1.x;\n bool occludedFromPano2 = distanceToPano2 / 10.0 > 1.01 - depthFromPano2.x;\n\n if(occludedFromPano0){contributionFromPano0 *= 0.1;}\n if(occludedFromPano1){contributionFromPano1 *= 0.1;}\n if(occludedFromPano2){contributionFromPano2 *= 0.1;}\n //if(occludedFromPano0 && occludedFromPano1 && !occludedFromPano2) { contributionFromPano2 += 0.5; }\n }\n\n float contributionSum = contributionFromPano0 + contributionFromPano1 + contributionFromPano2;\n contributionFromPano0 /= contributionSum;\n contributionFromPano1 /= contributionSum;\n contributionFromPano2 /= contributionSum;\n\n vec4 colorFromPanos = colorFromPano0 * contributionFromPano0;\n colorFromPanos += colorFromPano1 * contributionFromPano1;\n colorFromPanos += colorFromPano2 * contributionFromPano2;\n\n vec4 depthFromPanos = depthFromPano0 * contributionFromPano0;\n depthFromPanos += depthFromPano1 * contributionFromPano1;\n depthFromPanos += depthFromPano2 * contributionFromPano2;\n\n vec4 colorFromTexture = texture2D( map, vUv );\n colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);\n\n if(highlightPanoSelection == 1) {\n colorFromPanos.r = contributionFromPano0;\n colorFromPanos.g = contributionFromPano1;\n colorFromPanos.b = contributionFromPano2;\n }\n\n gl_FragColor = vec4(mix(colorFromPanos, depthFromPanos, depthmapRatio).rgb, opacity);\n\n}\n"},customDepth:{uniforms:{panoPosition:{type:"v3",value:new n.Vector3}},vertexShader:o+"varying vec4 worldPosition;\n\nvoid main() {\n\n worldPosition = modelMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",fragmentShader:a+"uniform vec3 panoPosition;\nvarying vec4 worldPosition;\n\nvoid main() {\n\n float depth = distance(worldPosition.xyz, panoPosition);\n float color = 1.0 - depth / 10.0;\n gl_FragColor = vec4(color, color, color, 1.0);\n\n}\n"},skysphere:{uniforms:{radius:{type:"f",value:0}},vertexShader:o+"varying vec4 worldPosition;\n\nvoid main() {\n\n worldPosition = modelMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",fragmentShader:a+"varying vec4 worldPosition;\nuniform float radius;\n\nvoid main() {\n\n vec4 topColor = vec4(0.094, 0.102, 0.11, 1.0);\n vec4 bottomColor = vec4(0.2, 0.216, 0.235, 1.0);\n float normalizedHeight = (worldPosition.y + radius) / (radius * 2.0);\n float ratio = smoothstep(0.0, 0.5, normalizedHeight);\n gl_FragColor = mix(bottomColor, topColor, ratio);\n\n}\n"},tagDisc:{uniforms:{opacity:{type:"f",value:0},color:{type:"c",value:new n.Color},bg:{type:"t",value:null},mask:{type:"t",value:null}},vertexShader:o+"varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",fragmentShader:a+"uniform float opacity;\nuniform vec3 color;\nuniform sampler2D bg;\nuniform sampler2D mask;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 maskColor = texture2D(mask, vUv);\n vec4 bgColor = texture2D(bg, vUv);\n vec3 mappedColor = mix(bgColor.rgb, color, maskColor.a);\n gl_FragColor = vec4(mappedColor, bgColor.a * opacity);\n}\n"}}},function(t,e,i){"use strict";var n=i(0),r=i(9),o=[];t.exports={drawLine:function(t,e,i){var r=new n.Geometry;r.vertices.push(t.clone()),r.vertices.push(e.clone());var o=new n.LineBasicMaterial({color:i});return new n.Line(r,o,n.LineSegments)},initCanvasLabel:function(t,e,i){var r=document.createElement("canvas"),o=r.getContext("2d");o.font=t.fontSize+"px "+t.fontFace;var a=o.measureText(t.text).width+t.fontSize,s=t.fontSize+t.fontSize,l=s/10;r.width=a,r.height=s,o.lineWidth=2,o.strokeStyle=e,o.fillStyle=e,function(t,e,i,n,r,o){t.beginPath(),t.moveTo(e,i+o),t.lineTo(e,i+r-o),t.quadraticCurveTo(e,i+r,e+o,i+r),t.lineTo(e+n-o,i+r),t.quadraticCurveTo(e+n,i+r,e+n,i+r-o),t.lineTo(e+n,i+o),t.quadraticCurveTo(e+n,i,e+n-o,i),t.lineTo(e+o,i),t.quadraticCurveTo(e,i,e,i+o),t.stroke(),t.fill(),t.closePath()}(o,2,2,a-4,s-4,l),function(t,e){t.fillStyle=i,t.font=e.fontSize+"px "+e.fontFace,t.textAlign="center",t.textBaseline="middle",t.fillText(e.text,a/2,s/2+2),t.fillText(e.text,a/2,s/2+2)}(o,t);var u=new n.CanvasTexture(r);return u.minFilter=n.LinearFilter,u.magFilter=n.LinearFilter,u.needsUpdate=!0,{texture:u,canvas:r}},drawBoxHelperOfLine2:function(t,e,i){for(var o=r.getVerticesOfItemSize(t.geometry),a={},s=0;s<o.length;++s){var l=o[s];a["v"+s]=[l.x,l.y,l.z]}var u=new n.LineMaterial({color:e,linewidth:2,resolution:new n.Vector2(i.width,i.height)}),h=[a.v0.concat(a.v1).concat(a.v5).concat(a.v4).concat(a.v0),a.v2.concat(a.v3).concat(a.v7).concat(a.v6).concat(a.v2),a.v0.concat(a.v3),a.v1.concat(a.v2),a.v5.concat(a.v6),a.v4.concat(a.v7)],c=new n.Group;for(s=0;s<h.length;++s){var d=new n.LineGeometry;d.setPositions(h[s]);var p=new n.Line2(d,u);c.add(p)}return c},drawFatLine:function(t,e,i,r){var o=new n.LineGeometry;o.setPositions([t.x,t.y,t.z,e.x,e.y,e.z]);var a=new n.LineMaterial({color:i,linewidth:r,resolution:new n.Vector2((window.renderWidth || window.innerWidth),(window.renderHeight || window.innerHeight))}),s=new n.Line2(o,a);return s.computeLineDistances(),s.renderOrder=99,s.scale.set(1,1,1),s},triggerLimit:function(t){o.push(Date.now()||(new Date).getTime());return 2===o.length&&(o[1]-o[0]<t?(o.pop(),!0):(o.shift(),!1))}}},function(t,e){t.exports=function(t){this.message=t}},function(t,e){var i={linearTween:function(t,e,i,n){return i*t/n+e},easeInQuad:function(t,e,i,n){return i*(t/=n)*t+e},easeOutQuad:function(t,e,i,n){return-i*(t/=n)*(t-2)+e},easeInOutQuad:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e},easeInCubic:function(t,e,i,n){return i*(t/=n)*t*t+e},easeOutCubic:function(t,e,i,n){return t/=n,i*(--t*t*t+1)+e},easeInOutCubic:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t*t+e:i/2*((t-=2)*t*t+2)+e},easeInQuart:function(t,e,i,n){return i*(t/=n)*t*t*t+e},easeOutQuart:function(t,e,i,n){return t/=n,-i*(--t*t*t*t-1)+e},easeInOutQuart:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t*t*t+e:-i/2*((t-=2)*t*t*t-2)+e},easeInQuint:function(t,e,i,n){return i*(t/=n)*t*t*t*t+e},easeOutQuint:function(t,e,i,n){return t/=n,i*(--t*t*t*t*t+1)+e},easeInOutQuint:function(t,e,i,n){return(t/=n/2)<1?i/2*t*t*t*t*t+e:i/2*((t-=2)*t*t*t*t+2)+e},easeInSine:function(t,e,i,n){return-i*Math.cos(t/n*(Math.PI/2))+i+e},easeOutSine:function(t,e,i,n){return i*Math.sin(t/n*(Math.PI/2))+e},easeInOutSine:function(t,e,i,n){return-i/2*(Math.cos(Math.PI*t/n)-1)+e},easeInExpo:function(t,e,i,n){return i*Math.pow(2,10*(t/n-1))+e},easeOutExpo:function(t,e,i,n){return i*(1-Math.pow(2,-10*t/n))+e},easeInOutExpo:function(t,e,i,n){return(t/=n/2)<1?i/2*Math.pow(2,10*(t-1))+e:(t--,i/2*(2-Math.pow(2,-10*t))+e)},easeInCirc:function(t,e,i,n){return t/=n,-i*(Math.sqrt(1-t*t)-1)+e},easeOutCirc:function(t,e,i,n){return t/=n,t--,i*Math.sqrt(1-t*t)+e},easeInOutCirc:function(t,e,i,n){return(t/=n/2)<1?-i/2*(Math.sqrt(1-t*t)-1)+e:(t-=2,i/2*(Math.sqrt(1-t*t)+1)+e)},easeInElastic:function(t,e,i,n){var r=1.70158,o=0,a=i;return 0===t?e:1==(t/=n)?e+i:(o||(o=.3*n),a<Math.abs(i)?(a=i,r=o/4):r=o/(2*Math.PI)*Math.asin(i/a),-a*Math.pow(2,10*(t-=1))*Math.sin((t*n-r)*(2*Math.PI)/o)+e)},easeOutElastic:function(t,e,i,n){var r=1.70158,o=0,a=i;return 0===t?e:1==(t/=n)?e+i:(o||(o=.3*n),a<Math.abs(i)?(a=i,r=o/4):r=o/(2*Math.PI)*Math.asin(i/a),a*Math.pow(2,-10*t)*Math.sin((t*n-r)*(2*Math.PI)/o)+i+e)},easeInOutElastic:function(t,e,i,n){var r=1.70158,o=0,a=i;return 0===t?e:2==(t/=n/2)?e+i:(o||(o=n*(.3*1.5)),a<Math.abs(i)?(a=i,r=o/4):r=o/(2*Math.PI)*Math.asin(i/a),t<1?a*Math.pow(2,10*(t-=1))*Math.sin((t*n-r)*(2*Math.PI)/o)*-.5+e:a*Math.pow(2,-10*(t-=1))*Math.sin((t*n-r)*(2*Math.PI)/o)*.5+i+e)},easeInBack:function(t,e,i,n,r){return void 0===r&&(r=1.70158),i*(t/=n)*t*((r+1)*t-r)+e},easeOutBack:function(t,e,i,n,r){return void 0===r&&(r=1.70158),i*((t=t/n-1)*t*((r+1)*t+r)+1)+e},easeInOutBack:function(t,e,i,n,r){return void 0===r&&(r=1.70158),(t/=n/2)<1?i/2*(t*t*((1+(r*=1.525))*t-r))+e:i/2*((t-=2)*t*((1+(r*=1.525))*t+r)+2)+e},easeOutBounce:function(t,e,i,n){return(t/=n)<1/2.75?i*(7.5625*t*t)+e:t<2/2.75?i*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?i*(7.5625*(t-=2.25/2.75)*t+.9375)+e:i*(7.5625*(t-=2.625/2.75)*t+.984375)+e},easeInBounce:function(t,e,i,r){return i-n.easeOutBounce(r-t,0,i,r)+e},easeInOutBounce:function(t,e,i,r){return t<r/2?.5*n.easeInBounce(2*t,0,i,r)+e:.5*n.easeOutBounce(x,2*t-r,0,i,r)+.5*i+e}};t.exports=i},function(t,e,i){var n=i(11),r=i(0),o={};t.exports={load:function(t,e,i){var a=o[t];return a?(e&&setTimeout((function(){e(a)}),1),a):((a=new r.Texture).sourceFile=t,o[t]=a,n.getImage(t).then((function(t){a.image=t,a.needsUpdate=!0,e&&e(a)})).fail(i),a)},loadBase64:function(t,e){e=e||"png";var i=new r.Texture;return i.image=document.createElement("img"),i.image.setAttribute("src","data:image/"+e+";base64,"+t),i.needsUpdate=!0,i},loadurl:function(t){var e=new r.TextureLoader;return e.setCrossOrigin(!0),e.load(t)},loadCanvas:function(t){var e=t.replace(/\s*/g,""),i=new RegExp("^[a-zA-Z]+$"),n="rgba(0,0,0,.4)",o="rgba(0,0,0,.4)";(l=(s=document.createElement("canvas")).getContext("2d")).font="100px Arial";var a,s,l,u=l.measureText(t),h=(a=i.test(e)?1.05*u.width+120:u.width+60)+4;(l=(s=document.createElement("canvas")).getContext("2d")).canvas.width=h,l.canvas.height=144,l.font="Bold 100px Arial",function(t,e,i,r,a,s){t.beginPath(),t.moveTo(e+s,i),t.lineWidth=1,t.strokeStyle=o,t.fillStyle=n,t.arcTo(e+r,i,e+r,i+a,s),t.arcTo(e+r,i+a,e,i+a,s),t.arcTo(e,i+a,e,i,s),t.arcTo(e,i,e+r,i,s),t.stroke(),t.fill(),t.closePath()}(l,1,1,a+2,142,30),l.fillStyle="rgba(255,255,255, .85)",i.test(e)?l.fillText(t,62,102):l.fillText(t,32,102);var c=new r.Texture(s);return c.minFilter=r.LinearFilter,c.magFilter=r.LinearFilter,c.needsUpdate=!0,c},loadCanvasRe:function(t,e){t.replace(/\s*/g,""),new RegExp("^[a-zA-Z]+$");t=t||"",e=e||"Center";var i=document.createElement("canvas"),n=i.getContext("2d");i.width=256,i.height=256;n.font="bold 54px Arial";var o=n.measureText(t).width;!function(t,e,i,r,o,a,s,l){n.beginPath(),n.moveTo(t+o,e),n.lineWidth=a,n.strokeStyle=s,n.fillStyle=l,n.arcTo(t+i,e,t+i,e+r,o),n.arcTo(t+i,e+r,t,e+r,o),n.arcTo(t,e+r,t,e,o),n.arcTo(t,e,t+i,e,o),n.stroke(),n.fill(),n.closePath()}(5,87,246,100,30,0,"rgba(0,0,0,.4)","rgba(0,0,0,.4)"),n.fillStyle="rgba(255,255,255,.85)",n.fillText(t,(i.width-o)/2,(i.height+54)/2);var a=new r.Texture(i);return a.needsUpdate=!0,a},loadCanvasIn:function(t){var e=255,i=255,n=255,o=.85,a="rgba(0,0,0,.4)",s="rgba(0,0,0,.4)";(u=(l=document.createElement("canvas")).getContext("2d")).font="100px Arial";var l,u,h=u.measureText(t).width+60,c=h+4;(u=(l=document.createElement("canvas")).getContext("2d")).canvas.width=c,u.canvas.height=144,u.font="Bold 100px Arial",function(t,e,i,n,r,o){t.beginPath(),t.moveTo(e+o,i),t.lineWidth=1,t.strokeStyle=s,t.fillStyle=a,t.arcTo(e+n,i,e+n,i+r,o),t.arcTo(e+n,i+r,e,i+r,o),t.arcTo(e,i+r,e,i,o),t.arcTo(e,i,e+n,i,o),t.stroke(),t.fill(),t.closePath()}(u,1,1,h+2,142,30),u.fillStyle="rgba("+e+","+i+","+n+","+o+")",u.fillText(t,32,102);var d=new r.Texture(l);return d.minFilter=r.LinearFilter,d.magFilter=r.LinearFilter,d.needsUpdate=!0,d},isLoaded:function(t){return!!o[t]}}},function(t,e){t.exports={visibleFloor:1,ghostFloor:3,boundingSkybox:1,panoMarker:2,reticule:3,mattertagDisc:1,mattertagCutout:2,mattertagStem:3,ribbon:100}},function(t,e,i){var n=i(0);t.exports={UP:new n.Vector3(0,1,0),DOWN:new n.Vector3(0,-1,0),LEFT:new n.Vector3(-1,0,0),RIGHT:new n.Vector3(1,0,0),FORWARD:new n.Vector3(0,0,-1),BACK:new n.Vector3(0,0,1)}},function(t,e,i){"use strict";(function(e){var n,r=i(22),o=i(3),a=i(0),s=i(2),l=i(1),u=i(17),h=i(106),c=i(8),d=i(10),p=i(11),f=i(16),m=i(36),g=i(107),v=i(55),y=i(23),b=i(14),w=i(30),x=i(4).EventEmitter,M=new s("/js/objects/Panorama.js"),T=new a.SphereBufferGeometry(.1),S=new a.PlaneBufferGeometry(.2,.2,1,1),_=f.loadurl(r.splitUrl("./images/texture/location/location_512x512.png")),A=f.loadurl(r.splitUrl("./images/texture/location/disable_512x512.png")),P=parseInt(o.getQueryString("reticule"));function C(t,e,i,n){if(this.model=t,this.enable=i.enable,this.id=e,this.alignmentType=i.alignmentType||h.ALIGNED,this.u=i.u||0,this.v=i.v||0,this.roomid=i.roomid,this.neighbourUUIDs=i.neighbours||null,this.neighbourPanos=null,this.floor=null,this.floorIndex=i.floor,this.failedLoadingAt=0,this.maxLoadRetries=4,this.adjustAngleEnable=i.angle_enable,this.adjustTAngleX=0,this.adjustTAngleY=0,this.adjustTAngleZ=0,this.adjustAngleX=i.angle_x,this.adjustAngleY=i.angle_y,this.adjustAngleZ=i.angle_z,this.color={brightness:i.color.brightness,contrast:i.color.contrast,gamma:i.color.gamma,hue:i.color.hue,saturation:i.color.saturation,vibrance:i.color.vibrance,balance:i.color.balance},this.origin=i.position.clone(),this.originPosition=i.position.clone(),this.position=this.alignmentType===h.UNALIGNED?new a.Vector3(0,-5,0):i.position.clone(),this.quaternion=i.quaternion.clone(),this.quaternionAutoScene=i.quaternionAutoScene.clone(),this.skyboxMesh=new a.Mesh(T),this.skyboxMesh.position.copy(this.position),this.skyboxMesh.quaternion.copy(this.quaternion),this.skyboxMesh.name="skybox",this.skyboxMesh.visible=!1,this.skyboxMesh.updateMatrix(),this.marker=null,this.isAligned()){var o=this.enable?_:A;this.marker=new a.Mesh(S,new a.MeshBasicMaterial({map:o,side:a.DoubleSide,opacity:1,transparent:!0,depthWrite:!1})),this.marker.renderOrder=u.panoMarker,this.marker.name="marker",this.marker.pano=this,this.marker.userData.postils={},this.marker.userData.default_texture=o,l.colorMarkerOnLoad&&this.on("load",(function(){this.marker.material.color.set(65280)}))}this.debugColor=(new a.Color).setHSL(.06+.53*Math.random(),.8+.2*Math.random(),.5+.2*Math.random()),this.floorPosition=i.puck?i.puck.clone():null,this.tiled=n,this.tiled?this.solidSkybox=null:(this.solidSkybox=new a.Texture([null,null,null,null,null,null]),this.solidSkybox.flipY=!1,l.minimalMemoryMode&&(this.solidSkybox.minFilter=a.LinearFilter,this.solidSkybox.magFilter=a.LinearFilter,this.solidSkybox.generateMipmaps=!1)),this.zoomed=!1,this.panoRenderer=null,this.qualityManager=null,this.tileDownloader=null,this.tiledPanoRenderTarget=null,this.minimumTiledPanoLoaded=!1,this.highestPartialTileRenderOpCompleted=0,this.highestFullTileRenderOpCompleted=0,this.shouldRedrawOnBaseLoaded=!1,this.lockUntilRenderingComplete=!1,l.colorMarkerOnLoad&&this.on("load",(function(){this.marker.material.color.set(65280)})),1===P&&this.marker&&this.marker.visible&&(this.marker.visible=!1);var s=new a.TextureLoader;s.setCrossOrigin(!0);var c=s.load(r.splitUrl("./images/texture.jpg"));if(this.vrMarker=new a.Mesh(new a.OctahedronGeometry(.1,0),new a.MeshLambertMaterial({color:16777215,transparent:!0,opacity:.75,map:c})),this.vrMarker.boluoType="vr",this.vrMarker.position.z=1,this.vrMarker.enabled=!0,this.vrMarker.visible=!1,window.vrMarkers=window.vrMarkers||[],window.vrMarkers.push(this.vrMarker),this.marker&&this.marker.add(this.vrMarker),l.showAxis&&(this.skyboxMesh.add(new a.ArrowHelper(new a.Vector3(0,1,0),new a.Vector3(0,0,0),1,255)),this.skyboxMesh.add(new a.ArrowHelper(new a.Vector3(0,0,1),new a.Vector3(0,0,0),1,16711680)),this.skyboxMesh.add(new a.ArrowHelper(new a.Vector3(1,0,0),new a.Vector3(0,0,0),1,65280))),this.adjustAngleEnable){var d=new a.Quaternion;d.setFromAxisAngle(new a.Vector3(1,0,0),this.adjustAngleX),this.skyboxMesh.quaternion.multiply(d);var p=new a.Quaternion;p.setFromAxisAngle(new a.Vector3(0,1,0),this.adjustAngleY),this.skyboxMesh.quaternion.multiply(p);var f=new a.Quaternion;f.setFromAxisAngle(new a.Vector3(0,0,1),this.adjustAngleZ),this.skyboxMesh.quaternion.multiply(f),this.skyboxMesh.updateMatrix(),this.skyboxMesh.updateMatrixWorld(),this.model.updateProjectedPanos()}if(t.rooms_real){var m=t.rooms_real.findIndex((function(t){return i.roomid==t.roomidx}));-1!==m&&(m=t.rooms_real[m],this.areaName=m.roomname,this.areasPoints=JSON.parse(m.kpoints),this.areaSize=m.area)}}C.prototype=Object.create(x.prototype),C.prototype.enter=function(){this.emit("enter")},C.prototype.exit=function(){this.tiled?(this.clearWaitDeferreds(),this.minimumTiledPanoLoaded=!1,this.tiledPanoRenderTarget=null,this.setZoomed(!1),this.panoRenderer.deactivateTiledPano(this),this.highestPartialTileRenderOpCompleted=0,this.highestFullTileRenderOpCompleted=0):(this.solidSkybox.dispose(),this.solidSkybox.loaded=!1,this.solidSkybox.version=0),this.emit("exit")},C.prototype.hoverOn=function(t){this.marker&&(c.start(d.property(this.marker.material,"opacity",l[t].markerOpacityOnHover),250),l.navigation.panoScores&l.navigation.mouseDirection&&this.addTextSprite("HIT",12525854))},C.prototype.hoverOff=function(t){this.marker&&c.start(d.property(this.marker.material,"opacity",l[t].markerOpacity),250)},C.prototype.build1=function(){this.floor=this.floor||this.model.floors.get(this.floorIndex)||this.raycastToFindFloor()||this.model.getFloorAtPoint(this.position),this.floor.addPano(this),this.floorPosition=this.floorPosition||this.raycastFloorPosition(),this.neighbourPanos=this.neighbourPanos||this.findNeighourPanos(),l.colorMarkerByFloor&&this.marker&&this.marker.material.color.set(this.floor.debugColor)},C.prototype.build2=function(){this.floorPosition=this.floorPosition||this.interpolateFloorPosition(),this.height=this.position.distanceTo(this.floorPosition),this.placeMarker()},C.prototype.updateAngleDisplay=function(){},C.prototype.updateColorDisplay=function(){},C.prototype.changeColor=function(t,e,i){"balance_R"===e?this.color.balance.x=i/100:"balance_G"===e?this.color.balance.y=i/100:"balance_B"===e?this.color.balance.z=i/100:this.color[e]=i/100,t.setProjectedPanos(this,this,!1)},C.prototype.resetColor=function(t){this.color.brightness=0,this.color.contrast=0,this.color.gamma=1,this.color.hue=0,this.color.saturation=0,this.color.vibrance=0,this.color.balance=new a.Vector3,this.updateColorDisplay(),t.setProjectedPanos(this,this,!1)},C.prototype.applyAllColor=function(t){for(var e=0;e<t.panos.list.length;e++)t.panos.list[e].color.brightness=this.color.brightness,t.panos.list[e].color.contrast=this.color.contrast,t.panos.list[e].color.gamma=this.color.gamma,t.panos.list[e].color.hue=this.color.hue,t.panos.list[e].color.saturation=this.color.saturation,t.panos.list[e].color.vibrance=this.color.vibrance,t.panos.list[e].color.balance.copy(this.color.balance)},C.prototype.updateTAngleDisplay=function(){},C.prototype.updateAngle=function(t,e){function i(t){var e=parseFloat(t);if(!isNaN(e))return e=Math.round(1e3*t)/1e3}if("x"==t){var n=new a.Vector3(1,0,0);if(0==e)(r=new a.Quaternion).setFromAxisAngle(n,-this.adjustAngleX),this.skyboxMesh.quaternion.multiply(r),this.adjustAngleX=0;else if(1==e){var r=new a.Quaternion;null==this.adjustAngleX&&(this.adjustAngleX=0),this.adjustAngleX+=.005,this.adjustAngleX=i(this.adjustAngleX),r.setFromAxisAngle(n,.005),this.skyboxMesh.quaternion.multiply(r)}else if(2==e){r=new a.Quaternion;null==this.adjustAngleX&&(this.adjustAngleX=0),this.adjustAngleX-=.005,this.adjustAngleX=i(this.adjustAngleX),r.setFromAxisAngle(n,-.005),this.skyboxMesh.quaternion.multiply(r)}}else if("y"==t){n=new a.Vector3(0,1,0);if(0==e)(r=new a.Quaternion).setFromAxisAngle(n,-this.adjustAngleY),this.skyboxMesh.quaternion.multiply(r),this.adjustAngleY=0;else if(1==e){r=new a.Quaternion;null==this.adjustAngleY&&(this.adjustAngleY=0),this.adjustAngleY+=.005,this.adjustAngleY=i(this.adjustAngleY),r.setFromAxisAngle(n,.005),this.skyboxMesh.quaternion.multiply(r)}else if(2==e){r=new a.Quaternion;null==this.adjustAngleY&&(this.adjustAngleY=0),this.adjustAngleY-=.005,this.adjustAngleY=i(this.adjustAngleY),r.setFromAxisAngle(n,-.005),this.skyboxMesh.quaternion.multiply(r)}}else if("z"==t){n=new a.Vector3(0,0,1);if(0==e)(r=new a.Quaternion).setFromAxisAngle(n,-this.adjustAngleZ),this.skyboxMesh.quaternion.multiply(r),this.adjustAngleZ=0;else if(1==e){r=new a.Quaternion;null==this.adjustAngleZ&&(this.adjustAngleZ=0),this.adjustAngleZ+=.005,this.adjustAngleZ=i(this.adjustAngleZ),r.setFromAxisAngle(n,.005),this.skyboxMesh.quaternion.multiply(r)}else if(2==e){r=new a.Quaternion;null==this.adjustAngleZ&&(this.adjustAngleZ=0),this.adjustAngleZ-=.005,this.adjustAngleZ=i(this.adjustAngleZ),r.setFromAxisAngle(n,-.005),this.skyboxMesh.quaternion.multiply(r)}}this.skyboxMesh.updateMatrix(),this.skyboxMesh.updateMatrixWorld(),this.model.updateProjectedPanos()},C.prototype.updateTAngle=function(t,e){function i(t){var e=parseFloat(t);if(!isNaN(e))return e=Math.round(1e3*t)/1e3}if(""!==e){if("y"==t){var n=new a.Vector4(0,i(e),0,0);n.applyMatrix4(this.skyboxMesh.matrix),this.adjustTAngleY=i(e),this.position.setX(this.originPosition.x+n.x),this.position.setY(this.originPosition.y+n.y),this.position.setZ(this.originPosition.z+n.z),this.skyboxMesh.position.copy(this.position)}this.skyboxMesh.updateMatrix(),this.skyboxMesh.updateMatrixWorld(),this.model.updateProjectedPanos(),this.position.setFromMatrixPosition(this.skyboxMesh.matrixWorld)}},C.prototype.update=function(t){this.skyboxMesh.updateMatrixWorld()},C.prototype.interpolateFloorPosition=function(){var t=this.model.panos.filter(C.filters.isNeighbourPanoTo(this)).filter((function(t){return!!t.floorPosition})).sort(function(t,e){return t.position.distanceTo(this.position)-e.position.distanceTo(this.position)}.bind(this)),e=this.position.clone();return t.length>=2?e.y=(t[0].floorPosition.y+t[1].floorPosition.y)/2:e.add(l.noMeshFloorPositionOffset),e},C.prototype.raycastFloorPosition=function(){M.warn("Performance warning: Raycasting to find floor position");var t=new a.Raycaster(this.position,new a.Vector3(0,-1,0)).intersectObjects(this.model.colliders);return t.length?t[0].point:null},C.prototype.raycastToFindFloor=(n=[new a.Vector3(0,-1,0),new a.Vector3(1,-1,0),new a.Vector3(0,-1,1),new a.Vector3(-1,-1,0),new a.Vector3(0,-1,-1),new a.Vector3(1,0,0),new a.Vector3(0,0,1),new a.Vector3(-1,0,0),new a.Vector3(0,0,-1)],function(){for(var t=0;t<n.length;t++){var e=new a.Raycaster(this.position.clone(),n[t].clone()).intersectObjects(this.model.colliders);if(e.length)return e[0].object.parent.parent}return null}),C.prototype.placeMarker=function(){this.marker&&(this.marker.position.copy(this.floorPosition),this.marker.position.y+=.05,this.marker.lookAt(new a.Vector3(0,1,0).add(this.marker.position)))},C.prototype.findClosestMidtpointPanoTo=function(t){return(new a.Vector3).addVectors(this.position,t.position).divideScalar(2),this.model.panos.find([C.filters.notIn([this,t])],[C.sortFunctions.distanceToPoint(point)])},C.prototype.attachToPanoRenderer=function(t){this.panoRenderer=t,this.panoRenderer.on(v.TileRenderSuccess,this.onTileRendered.bind(this)),this.panoRenderer.on(v.PanoRenderComplete,this.onPanoRendered.bind(this)),this.panoRenderer.on(v.TileRenderFailure,this.onTileRenderFail.bind(this)),this.panoRenderer.on(v.UploadAttemptedForAllTiles,this.onUploadAttemptedForAllTiles.bind(this))};var E={};C.prototype.getWaitDeferred=function(t){var i=E[this.id];i||(i={},E[this.id]=i);var n=i[t];return n||(n={deferred:e.Deferred(),active:!1},i[t]=n),n},C.prototype.resetWaitDeferred=function(t){var i=this.getWaitDeferred(t);i.active=!1,i.deferred=e.Deferred()},C.prototype.clearWaitDeferreds=function(){var t=E[this.id];for(var i in t||(t={},E[this.id]=t),t)if(t.hasOwnProperty(i)){var n=t[i];n.active=!1,n.deferred=e.Deferred()}},C.prototype.loadTiledPano=function(){var t=[],e=[];return function(i,n,r,o,a,s){null!=o||(o=!0),null!=a||(a=!0);var l=this.getWaitDeferred(i),u=l.deferred,h=null,c=null;if(r&&("number"==typeof r?h=r:(h=r.hFov,c=r.vFov)),!this.isLoaded(i)){if(!l.active){if(l.active=!0,r){var d=w.matchingTilesInDirection(this,i,n,h,c);t[this.id+":"+i]={tileCount:0,targetTileCount:d},M.info("Loading partial pano: "+this.id+" with "+d+" tiles")}e[this.id]||(e[this.id]=!0,this.on(g.LoadComplete,function(t,e){var i=this.getWaitDeferred(t).deferred;i&&"pending"===i.state()&&this.highestPartialTileRenderOpCompleted>=t&&(i.resolve(t,e),this.resetWaitDeferred(t))}.bind(this)),this.on(g.LoadFailed,function(t){var e=this.getWaitDeferred(t).deferred;e&&"pending"===e.state()&&this.highestPartialTileRenderOpCompleted>=t&&(e.reject(t),this.resetWaitDeferred(t))}.bind(this)),this.on(g.TileLoaded,function(e,i,n){this.id==window.firstPanoId&&512==e&&window.loadingCount++;var r=this.getWaitDeferred(e).deferred;if(r&&"pending"===r.state()){r.notify(e,i,n);var o=t[this.id+":"+e];o&&(o.tileCount++,o.tileCount===o.targetTileCount&&(this.onPanoRendered(this.id,e,n,!0),r.resolve(e,n),this.resetWaitDeferred(e)))}}.bind(this)))}this.tileDownloader.forceQueueTilesForPano(this,i,n,h,c,s),this.tiledPanoRenderTarget=this.panoRenderer.activateTiledPano(this,this.qualityManager.getMaxPanoSize(),o,a),this.panoRenderer.renderPanoTiles(this.id,n,a)}return u.promise()}}(),C.prototype.onUploadAttemptedForAllTiles=function(t,e,i){o.isMobile()||t===this.id&&e===this.qualityManager.getPanoSize(y.BASE)&&this.shouldRedrawOnBaseLoaded&&(this.shouldRedrawOnBaseLoaded=!1,this.panoRenderer.resetRenderStatus(t),this.panoRenderer.renderPanoTiles(this.id,null,!0,!0))},C.prototype.onTileRendered=function(t,e,i,n){t===this.id&&this.emit(g.TileLoaded,e,i,n)},C.prototype.onPanoRendered=function(t,e,i,n){t===this.id&&(this.minimumTiledPanoLoaded=!0,this.skybox=this.tiledPanoRenderTarget.texture,e>this.highestPartialTileRenderOpCompleted&&(this.highestPartialTileRenderOpCompleted=e),!n&&e>this.highestFullTileRenderOpCompleted&&(this.highestFullTileRenderOpCompleted=e),this.emit("load",e),this.model.emit("load",this),this.emit(g.LoadComplete,e,i))},C.prototype.onTileRenderFail=function(t,e,i){t===this.id&&this.emit(g.LoadFailed,e)},C.prototype.getSkyboxTexture=function(){return this.tiled?this.minimumTiledPanoLoaded?this.zoomed?this.panoRenderer.zoomRenderTarget.texture:this.tiledPanoRenderTarget.texture:null:this.solidSkybox},C.prototype.isLoaded=function(t){if(this.tiled){if(t&&"string"==typeof t)throw new b("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");return!!this.minimumTiledPanoLoaded&&(!t||this.highestPartialTileRenderOpCompleted>=t)}if(t&&"number"==typeof t)throw new b("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");return!!this.solidSkybox.high||t in this.solidSkybox},C.prototype.getAjustedColors=function(){return this.color},C.prototype.loadCube=function(t){if(this.isLoaded(t))return M.info("Skipping load of pano, already loaded"),e.when();this.emit("loading",t),this.model.emit("loading",this);var i=m.getCubemapUrls(this.model.urls,this.id,t),n=i.filter((function(t){return!t}));"low"===t&&n.length>0&&(M.info("Pano",this.id,"not available in low res, loading high res right away"),t="high",i=m.getCubemapUrls(this.model.urls,this.id,t));var r=0,o=[0,1,2,3,4,5].map(function(t,e,n){return p.getImage(i[e])}.bind(this)),a=t;return e.when(o[0],o[1],o[2],o[3],o[4],o[5]).then(function(t,e,i,n,r,o){return this.solidSkybox[a]=[t,e,i,n,r,o],"high"!==a&&this.solidSkybox.high||(this.solidSkybox.image=this.solidSkybox[a],this.solidSkybox.low=null),this.solidSkybox.needsUpdate=!0,this.emit("load",a),this.model.emit("load",this),this}.bind(this),function(){I.error("Downloading cubemap for pano",this.id,"failed"),this.failedLoadingAt=Date.now()}.bind(this),(function(){return e.when(++r,6)}))},C.raycastsSkipped=0,C.raycastsDone=0,C.prototype.findNeighourPanos=function(){return this.model.panos.setNeighbour(this.id,this.id,!1),this.model.panos.forEach(function(t){if(t!==this&&(!this.model.panos.neighbourMap[this.id]||void 0===this.model.panos.neighbourMap[this.id][t.id])){var e=this.position.distanceTo(t.position);if(e>l.panoramaNeighbourMaxDistance)return this.model.panos.setNeighbour(this,t,!1),void C.raycastsSkipped++;var i=t.position.clone().sub(this.position).normalize(),n=new a.Raycaster(this.position,i.clone(),0,e).intersectObjects(this.model.colliders);C.raycastsDone++,this.model.panos.setNeighbour(this,t,0===n.length),l.showNeighbourRaycasts&&(n.length?this.floor.model.add(new a.ArrowHelper(i,this.position,n[0].distance,16711680)):this.floor.model.add(new a.ArrowHelper(i,this.position,e,16777215,0,0)))}}.bind(this)),this.model.panos.neighbourMap[this.id]},C.prototype.worldPosition=function(){return this.position},C.prototype.addTextSprite=function(t,e){this.removeTextSprite();var i=document.createElement("canvas"),n=i.getContext("2d");i.width=256,i.height=256;n.font="bold 60px Arial",n.fillStyle="white";var r=n.measureText(t).width;n.fillText(t,(i.width-r)/2,(i.height+60)/2);var o=new a.Texture(i);o.needsUpdate=!0;var s=new a.SpriteMaterial({map:o,color:e||16428055});this.text3d=new a.Sprite(s),this.text3d.position.copy(this.skyboxMesh.position),this.floor.add(this.text3d)},C.prototype.removeTextSprite=function(){this.text3d&&(this.floor.remove(this.text3d),this.text3d=null)},C.prototype.removeLocationTextSprite=function(){this.locationText&&(this.floor.remove(this.locationText),this.locationText=null)},C.prototype.isAligned=function(){return this.alignmentType===h.ALIGNED},C.filters={inDirection:function(t,e,i){return function(n){return n.position.clone().sub(t).normalize().dot(e)>i}},inFloorDirection:function(t,e,i){return function(n){return n.floorPosition.clone().sub(t).normalize().dot(e)>i}},inPanoDirection:function(t,e,i){return i=l.navigation.panoScores?l.navigation.filterStrictness:i,function(n){var r=n.floorPosition.clone().sub(t).normalize(),o=n.position.clone().sub(t).normalize();return r.dot(e)>i||o.dot(e)>i}},atFloor:function(t){return function(e){return!t||e.floor===t}},not:function(t){return function(e){return e!=t}},notIn:function(t){return function(e){return-1===t.indexOf(e)}},isLoaded:function(){return function(t){return t.isLoaded()}},isNotLoaded:function(){return function(t){return!t.isLoaded()}},isCloseEnoughTo:function(t,e){return function(i){return t.distanceTo(i.floorPosition)<e}},hasMinimumHeightDifferenceTo:function(t,e){return function(i){return Math.abs(i.position.y-t.y)>e}},isNotBehindNormal:function(t,e){var i=new a.Vector3;return e=e.clone(),function(n){return i.copy(n.position).sub(t).normalize().dot(e)>0}},isNeighbourPanoTo:function(t){return function(e){return!t||!t.neighbourPanos||!!t.neighbourPanos[e.id]}},isNeighbourOfNeighbourTo:function(t){return function(e){return!!t.neighbourPanos[e.id]||t.neighbourUUIDs.some((function(i){var n=t.model.panos.get(i);return!!n&&n.neighbourPanos[e.id]}))}},isNotRecentlyFailed:function(t){return function(e){return Date.now()-e.failedLoadingAt>t}},isOnVisibleFloor:function(){return function(t){return!t.floor.hidden}},isPanoAligned:function(){return function(t){return t.isAligned()}}},C.sortFunctions={distanceToPoint:function(t){return function(e,i){return e.position.distanceTo(t)-i.position.distanceTo(t)}},floorDistanceToPoint:function(t){return function(e,i){return e.floorPosition.distanceTo(t)-i.floorPosition.distanceTo(t)}},choose:function(t){return function(e,i){return t.id===e.id?-1:t.id===i.id?1:0}}},C.scoreFunctions={distance:function(t,e){return e=e||l.navigation.distanceFactor,function(i){return t?t.position.distanceTo(i.position)*e:0}},distanceSquared:function(t,e){return e=e||l.navigation.distanceFactor,function(i){return t?t.position.distanceToSquared(i.position)*e:0}},direction:function(t,e){return function(i){return i.position.clone().sub(t).normalize().dot(e)*l.navigation.directionFactor}},angle:function(t,e){return function(i){return i.position.clone().sub(t).normalize().angleTo(e)*l.navigation.angleFactor}},inFieldOfView:function(t,e){return function(i){return i.position.clone().sub(t).normalize().dot(e)>.75?10:-1}},optionality:function(t){return function(e){return e.neighbourUUIDs.filter((function(e){return!(e in t.neighbourUUIDs)&&e!==t.id})).length*l.navigation.optionalityFactor}},penalizeHeightDifferenceUnder:function(t,e){return function(i){return t.y-i.position.y<e?-20:0}}},C.prototype.setZoomed=function(t){this.zoomed=t,this.updateSkyboxForZoomLevel()},C.prototype.updateSkyboxForZoomLevel=function(){this.minimumTiledPanoLoaded&&this.model.updateProjectedPanos()},C.prototype.ensureSkyboxReadyForRender=function(){this.tiled||(this.solidSkybox.loaded||(this.solidSkybox.needsUpdate=!0),this.solidSkybox.loaded=!0)},t.exports=C}).call(this,i(6))},function(t,e){t.exports={Move:"move",MoveComplete:"move.complete",ModeChanged:"mode.changed",ModeChanging:"mode.changing",RulersMove:"rulers.move",PanoChosen:"pano.chosen",warpTravelBlack:"warp.travel.black",ClosestPanoChanging:"closest.pano.changing",WarpStarted:"warp.started",WarpInterrupted:"warp.interrupted",WarpEnded:"warp.ended",FlyingStarted:"flying.started",FlyingInterrupted:"flying.interrupted",FlyingEnded:"flying.ended",Ready:"ready",StartInside:"start.inside",StartOutside:"start.outside",ViewChanged:"view.changed",WarpInterruptedWithFlyTo:"warp.interrupted.flyto",InputStart:"input.start",EditAddTagHighlight:"edit.add.taghighlight",ClickTag:"clickTag"}},function(t,e){t.exports={ModelAdded:"model-added",ActiveModelChanged:"active-model-changed"}},function(t,e,i){var n=i(1);t.exports.splitUrl=function(t){if(n.isLocalVersion){return t.split("/common/")[1]?window.location.origin+window.location.pathname.split("index.html")[0]+"/"+t.split("/common/")[1]:window.location.origin+window.location.pathname.split("index.html")[0]+"/"+t.split("/common/")[0]}return t},t.exports.splitComUrl=function(t){return n.isLocalVersion?t.split("/common/")[1]:t}},function(t,e){t.exports={BASE:1,STANDARD:2,HIGH:3,ULTRAHIGH:4}},function(t,e,i){"use strict";t.exports={BLACK:"black",STD:"std",WALK:"walk"}},function(t,e,i){var n,o=i(3),a=new(i(2))("js/utils/showcase");t.exports={getAuthorizationHeader:function(){var t=o.valueFromHash("auth");if(t)return t.replace(","," ");var e=o.valueFromCookie("token");return e?"Token "+e:null},parseModelid:function(t){var e,i;return t=t||"",i=(e=window.location.protocol+"//"+window.location.host)+"/api/player/models/"+t,{baseurl:window.location.protocol+"//"+window.location.host,playdir:"play",dataroot:"data",modelid:t,versiondir:"",locationpics:"",urlBase:e,urlModel:i,urlFiles:i+(i.match(/\/$/)?"files":"/files"),urlThumb:i+(i.match(/\/$/)?"thumb":"/thumb")}},getModelIDFromQueryString:function(){return o.valueFromHash("model")||o.valueFromHash("m")},normalizeModeldata:function(t,e){return(t=JSON.parse(JSON.stringify(t))).scenes.forEach((function(t){if(t._camera&&"string"==typeof t._camera)try{t._camera=JSON.parse(t._camera)}catch(e){a.warn("Unable to parse scene camera"),t._camera=null}else"object"==typeof t._camera&&a.debug("scene.camera already a JSON object");t._camera&&(t._camera._rotation&&(t._camera._rotation=e.convertWorkshopQuaternion(t._camera._rotation)),t._camera._viewpoint&&(t._camera._viewpoint=e.convertWorkshopVector(t._camera._viewpoint)),t._camera._zoom=e.convertWorkshopOrthoZoom(t._camera._zoom))})),t},visionVersionToInt:(n=new RegExp(["(?:[0-9.]+\\.){1,4}","([0-9]+)","[^\\.]*$"].join("")),function(t){if(!t)throw new Error("Vision version is required");var e=n.exec(t);if(null===e)throw new Error("String is not a vision version: "+t);return parseInt(e[1])}),modelDataPromisesTiles:function(t){if(t.vision_version)try{return l.visionVersionToInt(t.vision_version)>=l.visionVersionToInt(r.visionTilingStartVersion)}catch(e){s.warn("Invalid vision version: "+t.vision_version)}var e=t.created?new Date(t.created):null;return e&&e>=r.visionTilingStartDate}}},function(t,e){t.exports={signedUrlDefaultExpireTime:24e4,signedUrlCheckInterval:1e4,signedUrlRefreshBuffer:15e3,dollhouseFOV:70,dollhouseNear:1,dollhouseFar:5e3,insideFOV:70,insideNear:.1,insideFar:5e3,insideLookSpeed:.12,insideLookLimitUp:50,insideLookLimitDown:-50,orthoNear:1,orthoFar:5e3,orthoBase:10,narrowLandscapeHeight:290,reallyNarrowLandscapeHeight:250,visionTilingStartDate:new Date("8/26/2016"),visionTilingStartVersion:"1.1.407.13667",windowHeightHighQualityThreshold:1200,tourStepDelayDefault:3500,tourStepDelaySlideShow:5e3,workshopApsect:9/16,highQualityMaxZoom:2,ultraHighQualityMaxZoom:1.5}},function(t,e){t.exports={Move:"move",InteractionDirect:"interaction.direct",InteractionKey:"interaction.key",InteractionGui:"interaction.gui",FlyInDirection:"fly.direction",InputStart:"input.start",Pinch:"input.pinch",Scroll:"input.scroll",HideEvent:"panorama.move",RulersMove:"rulers.move",RulersWalk:"rulers.walk",TtagsMove:"titletag.move",PanoramaMove:"camera.move",PanoramaMoveStop:"camera.move.stop"}},function(t,e,i){(function(e){var n,r,o,a=i(4).EventEmitter,s=i(104);function l(){this.uuid="",this.sendOperationFalg=!1,this.initState=!1,this.signalState=!1,this.busyState=!1,this.busySended=!1,this.voiceFlag=!1,this.sync=!1;var t=!1;this.remoteControl=!1,this.syncInitState=!1,this.handelCallTimeOut=null,this.hangupType="timeout",this.lookInstance=null;var e=this;Object.defineProperty(this,"busy",{get:function(){return t},set:function(i){if(i){if(e.remoteControl)return void e.emit("remote_busy");t=!0,this.sync=!1,this.sendBusy()}else t=!1,this.cancelBusy()}}),this.showTip=function(){},this.getCurrentState=function(){},this._handleMessage=this._handleMessage.bind(this),this._handleCall=this._handleCall.bind(this),this.callTimeHandle=null,this.userInfo={identity:"4",customer:{state:!1,nickName:"客户",phoneNum:"15311496327",identity:"4",headImg:"",accid:""},bussiness:{state:!1,nickName:"经纪人",phoneNum:"18911926367",identity:"1",headImg:"",accid:""}}}l.prototype=Object.create(a.prototype),l.prototype.constructor=l,l.prototype.init=function(){var t=this,e="";if(e="4"===this.userInfo.identity?this.userInfo.bussiness.accid:this.userInfo.customer.accid,this.lookInstance=new s({remoteAccid:e}),"platform-error"===this.lookInstance.init())throw new Error("platform-error");return this.lookInstance.on("onData",this._handleMessage),this.lookInstance.on("onCall",this._handleCall),this.lookInstance.on("refuse",(function(){t.emit("bussiness_busy")})),this.lookInstance.on("hangup",(function(){"timeout"!==t.hangupType&&("4"===t.userInfo.identity?t.userInfo.bussiness.state=!1:t.userInfo.customer.state=!1,t.emit("close_connect",t.userInfo),t.destory())})),this.lookInstance.on("busy",(function(){this.lookInstance.hangup()})),this.signalState=!0,this.emit("init_done"),this.initState=!0,this.sendState({type:"connectState",state:"initdone"}),"4"===this.userInfo.identity?t.userInfo.customer.state=!0:t.userInfo.bussiness.state=!0,!0},l.prototype._getUserinfoType=function(t,e){var i=t[e];return{nickName:i[e+"Nickname"],headImg:i[e+"HeadImage"],identity:i[e+"Identity"],accid:i[e+"Accid"]}},l.prototype.joinChannel=function(t,e,i){if(this.emit("init"),this.getCurrentState=e,t){var n=this._getUserinfoType(t,"bussiness"),r=this._getUserinfoType(t,"customer");this.userInfo.identity=t.currentIdentity,this.userInfo.bussiness=n,this.userInfo.customer=r}this.init()},l.prototype._handleCall=function(){"4"===this.userInfo.identity?this.userInfo.bussiness.state=!0:this.userInfo.customer.state=!0,this.emit("identity",this.userInfo),this.emit("callsuccess"),this.emit("user_connected"),this.hangupType="hangup",this.voiceFlag=!0},l.prototype._handleMessage=function(t){var e=JSON.parse(t);switch(e.type){case"state":this._handleState(e);break;case"operation":this._handleOpertation(e);break;case"busy":this._handleBusy(e)}},l.prototype.setBusy=(n=null,function(){var t=this;null!==n?(clearTimeout(n),n=null):(this.sync=!1,this.sendState({type:"busyState",state:"busy"}),this.busySended=!0),n=setTimeout((function(){t.sendState({type:"busyState",state:"nobusy"}),n=null,t.busySended=!1}),400)}),l.prototype.sendBusy=function(){this.busySended||(this.sync=!1,this.sendState({type:"busyState",state:"busy"}),this.busySended=!0)},l.prototype.cancelBusy=(r=null,function(){var t=this;null!==r&&clearTimeout(r),r=setTimeout((function(){t.sendState({type:"busyState",state:"nobusy"}),t.busySended=!1}),2500)}),l.prototype.getSyncState=function(){return this.remoteControl?(this.emit("remote_busy"),!1):(this.sync=!1,!0)},l.prototype._handleBusy=function(t){"busy"===t.state?(this.remoteControl=!0,this.sync=!0):this.remoteControl=!1},l.prototype._handleState=function(t){var e=t.data;switch(e.type){case"connectState":this._handleConnectState(e);break;case"busyState":this._handleBusy(e)}},l.prototype.startVoiceLink=function(){"4"===this.userInfo.identity&&this.lookInstance.call()},l.prototype.setStateDone=function(){this.syncInitState&&(this.sendState({type:"connectState",state:"initstatedone"}),"4"!==this.userInfo.identity&&(this.userInfo.customer.state=!0,this.lookInstance.accept()),this.emit("identity",this.userInfo),this.sendOperationFalg=!0)},l.prototype._handleConnectState=function(t){switch(t.state){case"initdone":var e=this.getCurrentState();this.sendState({type:"connectState",state:"initstate",data:e});break;case"initstate":this.handelCallTimeOut&&clearTimeout(this.handelCallTimeOut),this.syncInitState=!0,this.emit("changestate",t.data);break;case"initstatedone":this.sendOperationFalg=!0,"4"===this.userInfo.identity?this.userInfo.bussiness.state=!0:this.userInfo.customer.state=!0,this.emit("identity",this.userInfo)}},l.prototype.setMute=function(t){this.sendOperationFalg&&(t?this.lookInstance.mute():this.lookInstance.unmute())},l.prototype._handleOpertation=function(t){if(this.voiceFlag){this.sync=!0;var e=t.data;this.emit("operation",e)}},l.prototype.sendMessage=function(t){this.signalState&&this.lookInstance.sendData(JSON.stringify(t))},l.prototype.sendState=function(t){var e={type:"state",data:t};this.sendMessage(e)},l.prototype.sendOperationasdf=(o=null,function(t){var e=this;null!==o&&clearTimeout(o),o=setTimeout((function(){e.sendOperation2remote(t)}),15)}),l.prototype.sendOperation=function(t){if((this.sendOperationFalg||this.voiceFlag)&&"uichange"!==t.type){var e={type:"operation",data:t};this.sendMessage(e)}},l.prototype.destory=function(){this.lookInstance&&this.lookInstance.hangup(),this.sendOperationFalg=!1,this.busyState=!1,this.sync=!1,this.remoteControl=!1,e("#customer-info").find(".voice-button").removeClass("mute").addClass("unmute"),e("#proxy-info").find(".voice-button").removeClass("mute").addClass("unmute")};var u,h=(u=null,function(t){return null===u&&(u=new l(t)),u});t.exports=h}).call(this,i(6))},function(t,e){t.exports={GL_TEXTURE_CUBE_MAP_POSITIVE_X:0,GL_TEXTURE_CUBE_MAP_NEGATIVE_X:1,GL_TEXTURE_CUBE_MAP_POSITIVE_Y:2,GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:3,GL_TEXTURE_CUBE_MAP_POSITIVE_Z:4,GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:5}},function(t,e,i){var n,r,o=i(29),a=i(56),s={};s.TILE_SIZE=512,s.FACES_PER_PANO=6,s.LocationOnTile={Center:0,UpperLeft:1,UpperRight:2,LowerRight:3,LowerLeft:4},s.getTileVector=function(t,e,i,n,r,l,u,h){var c=t/e,d=e/t*2,p=d/2,f=n/c*2-1+p,m=(r=c-1-r)/c*2-1+p;switch(l=l||s.LocationOnTile.Center){case s.LocationOnTile.UpperLeft:f-=p,m+=p,f+=u*d;break;case s.LocationOnTile.UpperRight:f+=p,m+=p,m-=u*d;break;case s.LocationOnTile.LowerRight:f+=p,m-=p,f-=u*d;break;case s.LocationOnTile.LowerLeft:f-=p,m-=p,m+=u*d;break;case s.LocationOnTile.Center:}switch(i){case o.GL_TEXTURE_CUBE_MAP_POSITIVE_X:a.setVector(h,-1,m,-f);break;case o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:a.setVector(h,1,m,f);break;case o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:a.setVector(h,-f,1,-m);break;case o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:a.setVector(h,-f,-1,m);break;case o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:a.setVector(h,-f,m,1);break;case o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:a.setVector(h,f,m,-1)}a.normalize(h)},s.getFaceForTile=function(t,e){var i=s.TILE_SIZE;t<s.TILE_SIZE&&(i=t);var n=Math.floor(t/i),r=n*n;return Math.floor(e/r)},s.getTileLocation=function(t,e,i){var n=s.TILE_SIZE;t<s.TILE_SIZE&&(n=t);var r=s.getFaceForTile(t,e),o=Math.floor(t/n),a=e-r*(o*o);i.tileX=a%o,i.tileY=Math.floor(a/o),i.face=r,i.faceTileIndex=a},s.getTileCountForSize=function(t){if(t<=s.TILE_SIZE)return s.FACES_PER_PANO;var e=Math.floor(t/s.TILE_SIZE);return e*e*s.FACES_PER_PANO},s.getRelativeDirection=(n=new a.Matrix4,r=new a.Quaternion,function(t,e){r.copy(t),r.inverse(),n.makeRotationFromQuaternion(r),n.applyToVector3(e),a.normalize(e)}),s.matchingTilesInDirection=function(){var t=new a.Vector3,e=new a.Vector3(0,0,-1),i=new a.Quaternion,n=function(t,e){t.push({face:e.face,faceTileIndex:e.faceTileIndex,tileX:e.tileX,tileY:e.tileY})},r=function(){var t={face:-1,faceTileIndex:-1,tileX:-1,tileY:-1};return function(e,i,r){for(var o=s.getTileCountForSize(e),a=0,l=0;l<o;l++)s.getTileLocation(e,l,t),i&&!i(t)||(a++,r&&n(r,t));return a}}();return function(n,o,l,u,h,c){var d=o<s.TILE_SIZE?o:s.TILE_SIZE;if(s.getTileCountForSize(o),!u&&!h)return r(o,null,c);var p=!!h;if(h=h||u,h=Math.max(0,Math.min(h,360)),u=Math.max(0,Math.min(u,360)),a.copyVector(l,t),s.getRelativeDirection(n.quaternion,t),p){i.setFromUnitVectors(t,e);return r(o,(function(t){return s.isTileWithinFrustum(o,d,t.face,t.tileX,t.tileY,i,u,h)}),c)}return r(o,(function(e){return s.isTileWithinFOV(o,d,e.face,e.tileX,e.tileY,t,u)}),c)}}(),s.isTileWithinFrustum=function(){var t=new a.Vector3;return function(e,i,n,r,o,l,u,h){for(var c=Math.tan(.5*h*a.RADIANS_PER_DEGREE),d=-c,p=Math.tan(.5*u*a.RADIANS_PER_DEGREE),f=-p,m=s.mapFaceToCubemapFace(n),g=0,v=0,y=0,b=0,w=0,x=s.LocationOnTile.Center;x<=s.LocationOnTile.LowerLeft;x++)if(s.getTileVector(e,i,m,r,o,x,0,t),a.applyQuaternionToVector(l,t),t.z>=-1e-5)0;else{var M=-1/t.z,T=t.x*M,S=t.y*M;S>c?g++:S<d&&v++,T>p?y++:T<f&&b++,w++}return v!==w&&g!==w&&y!==w&&b!==w}}(),s.isTileWithinFOV=function(){var t=new a.Vector3,e=new a.Vector3(0,1,0),i=new a.Vector3(1,0,0);return function(n,r,o,l,u,h,c){var d=s.mapFaceToCubemapFace(o);if(a.cross(h,e,i),s.getTileVector(n,r,d,l,u,s.LocationOnTile.Center,0,t),s.isWithinFOV(t,h,c,null))return!0;for(var p=c/360,f=Math.floor(1/p),m=0,g=0;g<f;g++){for(var v=s.LocationOnTile.UpperLeft;v<=s.LocationOnTile.LowerLeft;v++)if(s.getTileVector(n,r,d,l,u,v,m,t),s.isWithinFOV(t,h,c,null))return!0;m+=p}return!1}}(),s.isWithinFOV=function(){var t=new a.Vector3,e=new a.Vector3;return function(i,n,r,o){if(a.copyVector(i,e),o){a.copyVector(o,t),a.normalize(t);var s=a.dot(t,i);t.x*=s,t.y*=s,t.z*=s,a.subVector(e,t)}var l=r/2*a.RADIANS_PER_DEGREE,u=Math.cos(l);return a.dot(e,n)>=u}}(),s.mapFaceToCubemapFace=function(){var t={0:o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,1:o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,2:o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,3:o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,4:o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,5:o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y};return function(e){return t[e]}}(),s.getDirectionalFov=function(){var t=document.documentElement.clientWidth;return t>0&&t<512?60:t>=512&&t<1024?80:t>=1024&&t<2048?100:t>=2048&&t<4096?120:t>=4096?180:60},t.exports=s},function(t,e){t.exports={NONE:0,MIDDLE:1,END:2,BEGINNING:3,FADEIN:4}},function(t,e){t.exports={ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,LEFTARROW:37,UPARROW:38,RIGHTARROW:39,DOWNARROW:40,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,SPACE:32,RETURN:13,PLUSEQUALS:187,DASHUNDERSCORE:189,OPENBRACKET:219,ESC:27,DELETE:46}},function(t,e,i){function n(){this.list=[],this.index={},Object.defineProperty(this,"length",{get:function(){return this.list.length}})}new(i(2))("/js/util/IndexedCollection.js"),n.prototype.forEach=function(t){this.list.forEach(t)},n.prototype.add=function(t){this.list.push(t),this.index[this.getIndex(t)]=t},n.prototype.getIndex=function(t){throw new Error("IndexedCollection.getIndex not implemented in subclass.")},n.prototype.extend=function(t){for(var e=0;e<t.length;e++)this.add(t[e])},n.prototype.get=function(t){return this.index[t]},n.prototype.first=function(){return this.list[0]},n.prototype.last=function(){return this.list[this.list.length-1]},n.prototype.reIndex=function(){this.index={};var t=this;this.forEach((function(e){t.index[t.getIndex(e)]=e}))},n.prototype.filter=function(t){var e=this.list.filter(t);return this.reIndex(),e},n.prototype.reduce=function(t,e){return this.list.reduce(t,e)},n.prototype.sort=function(t){return this.list.sort(t)},n.prototype.indexOf=function(t){for(var e=0;e<this.list.length;++e)if(this.list[e]===t)return e;return-1},n.prototype.getLength=function(){return this.list.length},t.exports=n},function(t,e){},function(t,e,i){"use strict";(function(e){var n,r,o,a,s,l,u=i(0),h=(i(2),i(1)),c=i(7),d=i(9),p=i(18),f=i(32),m=i(27),g=i(4).EventEmitter,v=i(28),y=i(3),b=!1,w=!0;function x(t){this.camera=t,this.camera.controls=this,this.target=new u.Vector3(0,0,0),this.lookVector=new u.Vector3,this.lookSpeed=.05,this.rotationAcc=new u.Vector2,this.rotationSpeed=new u.Vector2,this.lat=0,this.lon=0,this.phi=0,this.theta=0,this.enabled=!1,this.locked=!1,this.pointer=new u.Vector2(0,0),this.rotationHistory=[],this.rotationDifference=new u.Vector2,this.pointerDragStart=new u.Vector2(0,0),this.pinchDistance=0,this.moveStart=new u.Vector2,this.moveTolerance=.01,this.pointersLimit=2,this.pointers=[],this.euler=new u.Euler,this.el=new u.Euler,this.q0=new u.Quaternion,this.q1=new u.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),this.up=new u.Vector3(0,1,0),this.right=new u.Vector3(0,0,1),this.v=new u.Vector3,this.offsetLon=0,this.offsetLat=0,this.q3=new u.Quaternion,G.panoStill=!0,this.s_rotationSpeed=new u.Vector2,this.s_rotationDifference=new u.Vector3,this.s_lat=0,this.s_lon=0,this.handleOperation=this.handleOperation.bind(this),this.connect=v(),this.connect.on("operation",this.handleOperation),this.lockedRotationFrom=!1,this.lockedMouseWheel=!1,this.disableKeyMove=!1,this.disableKeyRotate=!1;var e=this,i=!1;Object.defineProperty(this,"pointerDragOn",{get:function(){return i},set:function(t){i=t,e.connect.busy=t}})}function M(){G.conf.isCleanUI||(G.d.tourIsPlaying&&G.d.stopTour(),clearTimeout(n),n=null,b||(b=!0))}function T(){G.conf.isCleanUI}function S(t){t&&function(t){t&&(t.preventDefault(),t.stopPropagation())}(t)}x.prototype=Object.create(g.prototype),x.prototype.bindEvents=function(t){t.addEventListener("mousemove",this.onMouseMove.bind(this)),t.addEventListener("mousedown",this.onMouseDown.bind(this)),t.addEventListener("mouseup",this.onMouseUp.bind(this)),t.addEventListener("mouseover",function(t){!this.pointerDragOn||0!==t.which&&0!==t.buttons||this.onMouseUp(t)}.bind(this)),t.addEventListener("touchstart",this.onTouchStart.bind(this)),t.addEventListener("touchmove",this.onTouchMove.bind(this)),t.addEventListener("touchend",this.onTouchEnd.bind(this)),t.addEventListener("contextmenu",(function(t){t.preventDefault()})),t.addEventListener("pointerdown",this.onPointerDown.bind(this)),t.addEventListener("pointerup",this.onPointerUp.bind(this)),t.addEventListener("pointerout",this.onPointerUp.bind(this)),t.addEventListener("pointercancel",this.onPointerUp.bind(this)),t.addEventListener("pointermove",this.onPointerMove.bind(this)),t.addEventListener("keydown",this.onKeyDown.bind(this)),t.addEventListener("keyup",this.onKeyUp.bind(this)),h.useWheel&&(t.addEventListener("mousewheel",this.onMouseWheel.bind(this)),t.addEventListener("DOMMouseScroll",this.onMouseWheel.bind(this)))},x.prototype.usable=function(){return!G.ori.flag&&(h.quickstart.enabled?this.enabled:this.enabled&&!this.locked)},x.prototype.lookAt=function(t){0==t.x&&-5==t.y&&0==t.z&&(t.z=-1);var e=this.camera.position.clone().sub(t),i=0;0==e.x&&0==e.y&&0==e.z&&(e.z=1),i=Math.atan(e.z/e.x),i+=e.x<0?Math.PI:0,i+=e.x>0&&e.z<0?2*Math.PI:0,this.lon=u.Math.radToDeg(i)+180;var n=Math.sqrt(e.x*e.x+e.z*e.z);i=0,i=Math.atan(e.y/n),this.lat=-u.Math.radToDeg(i)},x.prototype.play=function(t){w&&(this.lon=t.lon,this.lat=t.lat)},x.prototype.record=function(){!G.R.rtime||G.R.time.getElapsedTime()-G.R.rtime>.15?G.R.rtime=G.R.save({tap:"panorama",panoid:G.player.currentPano.id,action:"rotate",lon:parseFloat(this.lon.toFixed(5)),lat:parseFloat(this.lat.toFixed(5))}):G.R.last={tap:"panorama",panoid:G.player.currentPano.id,action:"rotate",lon:this.lon,lat:this.lat,time:G.R.time.getElapsedTime()}},x.prototype.startRotationFrom=function(t,e){this.lockedRotationFrom||(d.convertScreenPositionToNDC(t,e,this.pointer),this.pointerDragOn=!0,this.pointerDragStart.copy(this.pointer),this.moveStart.copy(this.pointer),this.rotationHistory=[],this.rotationSpeed.set(0,0),this.disableOri())},x.prototype.disableOri=function(){G.ori.timeoutID&&clearTimeout(G.ori.timeoutID),G.ori.enable=!1},x.prototype.onTouchStart=function(t){if(this.usable()){switch(w=!1,M(),S(t),t.preventDefault(),t.stopPropagation(),t.touches.length){case 1:this.startRotationFrom(t.touches[0].clientX,t.touches[0].clientY);break;case 2:var e=(t.touches[0].clientX-t.touches[1].clientX)/(window.renderWidth || window.innerWidth),i=(t.touches[0].clientY-t.touches[1].clientY)/(window.renderHeight || window.innerHeight);this.pinchDistance=Math.sqrt(e*e+i*i)}this.emit(m.InputStart,"touch")}},x.prototype.onPointerDown=function(t){this.usable()&&"touch"===t.pointerType&&(this.pointers.length<this.pointersLimit&&this.pointers.push({id:t.pointerId,clientX:t.clientX,clientY:t.clientY}),t.touches=this.pointers,this.onTouchStart(t),this.emit(m.InputStart,"pointer"))},x.prototype.onMouseDown=function(t){this.usable()&&(w=!1,S(),M(),0===t.button&&this.startRotationFrom(t.clientX,t.clientY),this.emit(m.InputStart,"mouse"))},x.prototype.updateRotation=function(){if(this.usable()&&this.pointerDragOn){this.camera.matrix.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this.camera.matrixWorld.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);var t=new u.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera),e=new u.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera),i=Math.sqrt(t.x*t.x+t.z*t.z),n=Math.sqrt(e.x*e.x+e.z*e.z),r=Math.atan2(t.y,i),o=Math.atan2(e.y,n);this.rotationDifference.y=u.Math.radToDeg(r-o),t.y=0,e.y=0;var a=Math.acos(t.dot(e)/t.length()/e.length());isNaN(a)||(this.rotationDifference.x=u.Math.radToDeg(a),this.pointerDragStart.x<this.pointer.x&&(this.rotationDifference.x*=-1)),this.pointerDragStart.copy(this.pointer)}},x.prototype.onMouseMove=function(t){this.usable()&&(d.convertScreenPositionToNDC(t.clientX,t.clientY,this.pointer),this.pointerDragOn&&(Math.abs(this.pointer.x-this.moveStart.x)>this.moveTolerance||Math.abs(this.pointer.y-this.moveStart.y)>this.moveTolerance)&&this.emit(m.Move,"mouse"))},x.prototype.onTouchMove=function(t){if(this.usable()){switch(t.touches.length){case 1:d.convertScreenPositionToNDC(t.touches[0].clientX,t.touches[0].clientY,this.pointer),this.disableOri();break;case 2:var e=(t.touches[0].clientX-t.touches[1].clientX)/(window.renderWidth || window.innerWidth),i=(t.touches[0].clientY-t.touches[1].clientY)/(window.renderHeight || window.innerHeight),n=this.pinchDistance-Math.sqrt(e*e+i*i);Math.abs(n)>.01&&(this.emit(m.InteractionDirect),this.emit(m.Pinch,n),this.pinchDistance-=n)}this.emit(m.Move,"touch")}},x.prototype.onPointerMove=function(t){this.usable()&&"touch"===t.pointerType&&(this.pointers.forEach((function(e){t.pointerId===e.id&&(e.clientX=t.clientX,e.clientY=t.clientY)})),t.touches=this.pointers,this.onTouchMove(t))},x.prototype.endRotation=function(){this.pointerDragOn=!1;var t=c.averageVectors(this.rotationHistory);this.rotationSpeed.set(t.x*h.rotationAfterMoveMultiplier,t.y*h.rotationAfterMoveMultiplier)},x.prototype.onTouchEnd=function(t){this.usable()&&(T(),w=!0,t.preventDefault(),t.stopPropagation(),this.endRotation())},x.prototype.onMouseUp=function(t){this.usable()&&(T(),w=!0,t.preventDefault(),t.stopPropagation(),this.endRotation())},x.prototype.onPointerUp=function(t){this.usable()&&"touch"===t.pointerType&&(this.pointers.forEach(function(e,i){t.pointerId===e.id&&this.pointers.splice(i,1)}.bind(this)),t.touches=this.pointers,this.onTouchEnd(t))},x.prototype.update=function(t){if(null!=G.frameRate&&(G.frameRate<12?h.rotationFriction=.6:h.rotationFriction=.06),y.isMobile()&&(t=.016,0!=this.rotationSpeed.x&&Math.abs(this.rotationSpeed.x)<6&&(this.rotationSpeed.x=0),0!=this.rotationSpeed.y&&Math.abs(this.rotationSpeed.y)<6&&(this.rotationSpeed.y=0),0==this.rotationSpeed.x&&0==this.rotationSpeed.y?G.panoStill=!0:G.panoStill=!1),!G.R.playing)for(this.updateRotation(),this.rotationHistory.push(this.rotationDifference.clone());this.rotationHistory.length>h.rotationAfterMoveHistoryCount;)this.rotationHistory.shift();var i=this.lon,n=this.lat;if(G.ori.flag?(this.offsetLon+=this.rotationDifference.x,this.offsetLat+=this.rotationDifference.y,this.rotationSpeed.x=this.rotationSpeed.x*(1-h.rotationFriction)+this.rotationAcc.x*h.rotationAccelerationInside,this.rotationSpeed.y=this.rotationSpeed.y*(1-h.rotationFriction)+this.rotationAcc.y*h.rotationAccelerationInside,this.offsetLon+=this.rotationSpeed.x*t,this.offsetLat+=this.rotationSpeed.y*t,this.offsetLat=Math.max(h.insideLookLimitDown,Math.min(h.insideLookLimitUp,this.offsetLat)),G.ori.enable&&!G.playing&&(this.euler.set(G.ori.beta,G.ori.alpha,-G.ori.gamma,"YXZ"),this.q3=this.camera.quaternion.clone(),this.q3.setFromEuler(this.euler).multiply(this.q1),this.q3.multiply(this.q0.setFromAxisAngle(this.right,-G.ori.orient)),this.v.set(0,0,1).applyQuaternion(this.q3),this.lat=u.Math.radToDeg(this.v.angleTo(this.up)-Math.PI/2),this.v.set(1,0,0).applyQuaternion(this.q3),this.v.clone().cross(this.right).y>0?this.lon=360+u.Math.radToDeg(this.v.angleTo(this.right)):this.lon=360-u.Math.radToDeg(this.v.angleTo(this.right))),this.phi=u.Math.degToRad(90-(this.lat+this.offsetLat)),this.theta=u.Math.degToRad(this.lon+this.offsetLon),this.lookVector.x=Math.sin(this.phi)*Math.cos(this.theta),this.lookVector.y=Math.cos(this.phi),this.lookVector.z=Math.sin(this.phi)*Math.sin(this.theta),this.target.copy(this.lookVector).add(this.camera.position),this.camera.lookAt(this.target),G.ori.enable=!0):(t||(t=1/60),this.rotationSpeed.x=this.rotationSpeed.x*(1-h.rotationFriction)+this.rotationAcc.x*h.rotationAccelerationInside,this.rotationSpeed.y=this.rotationSpeed.y*(1-h.rotationFriction)+this.rotationAcc.y*h.rotationAccelerationInside,this.connect.remoteControl||this.connect.sync||(this.lon+=this.rotationDifference.x,this.lat+=this.rotationDifference.y,this.lon+=this.rotationSpeed.x*t,this.lat+=this.rotationSpeed.y*t,this.sendFrameData(t),this.rotationDifference.set(0,0)),this.lat=Math.max(h.insideLookLimitDown,Math.min(h.insideLookLimitUp,this.lat)),this.updateCamera(this.lon,this.lat)),this.rotationDifference.set(0,0),G.R.recording&&this.record(),d.compareFloats(i,this.lon)&&d.compareFloats(n,this.lat)?this.emit(m.PanoramaMoveStop):(this.emit(m.RulersMove),this.emit(m.PanoramaMove)),"open"===e("#size-button").attr("openflag"))var r=this.lon,o=this.lat;if(G.player.mattertagManager&&G.player.mattertagManager.showtitletags){r=this.lon,o=this.lat;G.player.mattertagManager&&(!G.player.mattertagManager.ttflying&&d.compareFloats(i,r)&&d.compareFloats(n,o)||this.emit(m.TtagsMove))}},x.prototype.sendFrameData=(a=0,s=new u.Vector2,l=new u.Vector2,function(t){(a+=t)<h.connectDelay||(a=0,Math.abs(r-this.lon)<.001&&Math.abs(o-this.lat)<.001||(this.connect.sendOperation({type:"pano",lon:this.lon,lat:this.lat,time:Date.now(),rotationDifference:this.rotationDifference.toArray(),rotationSpeed:this.rotationSpeed.toArray()}),r=this.lon,o=this.lat,s.copy(this.rotationSpeed),l.copy(this.rotationDifference)))});var _=0;x.prototype.updateCamera=function(t,e){_++,this.phi=u.Math.degToRad(90-e),this.theta=u.Math.degToRad(t),this.lookVector.x=Math.sin(this.phi)*Math.cos(this.theta),this.lookVector.y=Math.cos(this.phi),this.lookVector.z=Math.sin(this.phi)*Math.sin(this.theta),this.target.copy(this.lookVector).add(this.camera.position),this.camera.lookAt(this.target),0==_%6&&(_=0)},x.prototype._progressNumber=function(t,e,i){return t+(e-t)*i},x.prototype._progressRad=function(t,e,i){var n=2*Math.PI,r=Math.PI,o=function(t){return(t%n+n)%n};return t=o(t),(e=o(e))-t>r?this._progressNumber(t+n,e,i):t-e>r?this._progressNumber(t-n,e,i):this._progressNumber(t,e,i)},x.prototype.handleOperation=function(t){var e=this;if("pano"===t.type){var i=t.lon,n=t.lat;Date.now(),t.time;this.s_lon=i,this.s_lat=n,this.lonTweenProcess=null,this.latTweenProcess=null,this.tweenProgress&&(this.tweenProgress.stop(),this.tweenProgress=null);var r=this.lon,o=this.lat;h.connectDelay;this.tweenProgress=new TWEEN.Tween({progress:0}).to({progress:1},h.animationDelay).easing(TWEEN.Easing.Linear.None).start(),this.tweenProgress.onUpdate((function(t){null===i&&0===i||(e.lon=e._progressNumber(r,i,this.progress)),null===n&&0===i||(e.lat=e._progressNumber(o,n,this.progress))})),this.tweenProgress.onComplete((function(){this.tweenProgress=null})),this.s_time=t.time,this.s_rotationDifference.fromArray(t.rotationDifference),this.s_rotationSpeed.fromArray(t.rotationSpeed),this.rotationSpeed.copy(this.s_rotationSpeed)}},x.prototype.onMouseWheel=function(t){if(!this.lockedMouseWheel&&this.usable()&&!G.R.playing){var e=t.wheelDelta||-t.detail;this.emit(m.InteractionDirect),this.emit(m.Scroll,e)}},x.prototype.onKeyDown=function(t){this.usable()&&(t.metaKey||t.ctrlKey||(t.preventDefault(),this.handleKeyDown(t.which)))},x.prototype.handleKeyDown=function(t){var e=function(t){this.disableKeyMove||this.flyDirection(t)}.bind(this),i=function(t,e){this.disableKeyRotate||(this.rotationAcc[t]=e)}.bind(this);this.emit(m.InteractionKey);var n=!0;switch(t){case f.UPARROW:case f.W:e(p.FORWARD);break;case f.DOWNARROW:case f.S:e(p.BACK);break;case f.A:e(p.LEFT);break;case f.D:e(p.RIGHT);break;case f.LEFTARROW:case f.J:i("x",-1);break;case f.RIGHTARROW:case f.L:i("x",1);break;case f.I:i("y",1);break;case f.K:i("y",-1);break;default:n=!1}n&&this.emit(m.Move,"key")},x.prototype.onKeyUp=function(t){this.usable()&&(t.preventDefault(),t.stopPropagation(),this.handleKeyUp(t.which))},x.prototype.handleKeyUp=function(t){switch(t){case f.LEFTARROW:case f.J:case f.RIGHTARROW:case f.L:this.rotationAcc.x=0;break;case f.I:case f.K:this.rotationAcc.y=0;break;case f.ESC:}},x.prototype.reset=function(){this.pointerDragOn=!1,this.rotationAcc.set(0,0),this.rotationSpeed.set(0,0),this.pointers=[]},x.prototype.flyDirection=function(t){this.emit(m.FlyInDirection,t.clone())},x.prototype.copy=function(t){this.target.copy(t.target),this.lookVector.copy(t.lookVector),this.lookSpeed=t.lookSpeed,this.rotationAcc.copy(t.rotationAcc),this.rotationSpeed.copy(t.rotationSpeed),this.lat=t.lat,this.lon=t.lon,this.phi=t.phi,this.theta=t.theta,this.enabled=t.enabled,this.locked=t.locked,this.pointer.copy(t.pointer),this.rotationHistory=t.rotationHistory.slice(),this.rotationDifference.copy(t.rotationDifference),this.pointerDragOn=t.pointerDragOn,this.pointerDragStart.copy(t.pointerDragStart),this.pinchDistance=t.pinchDistance,this.moveStart.copy(t.moveStart),this.moveTolerance=t.moveTolerance,this.pointersLimit=t.pointersLimit,this.pointers=t.pointers.slice()},x.prototype.toJSON=function(){return{_viewpoint:{x:d.toPrecision(this.camera.position.x,4),y:d.toPrecision(this.camera.position.y,4),z:d.toPrecision(this.camera.position.z,4)},_rotation:{x:d.toPrecision(this.camera.quaternion.x,4),y:d.toPrecision(this.camera.quaternion.y,4),z:d.toPrecision(this.camera.quaternion.z,4),w:d.toPrecision(this.camera.quaternion.w,4)}}},x.prototype.setStateFromJSON=function(t){this.camera.position.copy(t._viewpoint),this.camera.quaternion.copy(t._rotation)},t.exports=x}).call(this,i(6))},function(t,e,i){var n=i(3);function r(t){return s[t]}var o=i(29),a=[0,1,2,3,4,5],s={0:o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,1:o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,2:o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,3:o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,4:o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,5:o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y};t.exports={mapFaceToCubemapFace:r,getCubemapUrls:function(t,e,i){return a.map(function(t,o){var a=n.isMobile()?"mobile":"pc";return G.url.model+"/locations/"+a+"/"+i+"/"+e+"_"+r(t)+".jpg"}.bind(this))}}},function(t,e,i){var n=i(0),r=i(1);function o(){n.PerspectiveCamera.call(this,r.insideFOV,(window.renderWidth || window.innerWidth)/(window.renderHeight || window.innerHeight),r.insideNear,r.insideFar),this.controls=null}o.prototype=Object.create(n.PerspectiveCamera.prototype),o.prototype.updateAspect=function(t){this.aspect=t,this.updateProjectionMatrix()},t.exports=o},function(t,e,i){(function(e){i(3);function n(t,e,i,r,o){this.qualityManager=t,this.maxNavQuality=this.qualityManager.getMaxNavPanoSize(),this.maxZoomQuality=this.qualityManager.getMaxZoomPanoSize(),this.baseSize=e,this.standardSize=i,this.highSize=r,this.ultraHighSize=o,this.priorityCriteria=new n.PriorityCriteria(null,new l.Vector3(0,0,0),new l.Vector3(0,0,-1),new l.Vector3(0,0,-1)),this.directional_fov=this.getDirectionalFov()}var r,o,a,s,l=i(0),u=(i(5),i(1),i(19)),h=i(2),c=(i(18),i(23),i(21),i(29),i(65)),d=(i(3),i(30)),p=i(9),f=(i(4).EventEmitter,new h(e),Object.freeze({None:0,DirectionalFOV:1}));n.PriorityCriteria=function(t,e,i,n,r){this.pano=t,this.cameraPosition=(new l.Vector3).copy(e),this.cameraDir=(new l.Vector3).copy(i),this.panoSpaceDir=(new l.Vector3).copy(n),this.upcomingPanos=r,this.copy=function(t){this.pano=t.pano,this.cameraPosition.copy(t.cameraPosition),this.cameraDir.copy(t.cameraDir),this.panoSpaceDir.copy(t.panoSpaceDir),this.upcomingPanos=r},this.zoomingActive=!1},n.DIRECTIONAL_FOV_NARROW=10,n.MAX_SCORED_PANOS_TOCONSIDER=6,n.MAX_SCORED_PANOS_TOADD=2,n.MAX_UPCOMING_PANOS_TOADD=3,n.DIRECTION_SCORE_STRICTNESS=.75,n.appendQueue=function(t,e){if(t&&e)for(var i=0;i<e.length;i++)t.push(e[i])},n.prototype.getDirectionalFov=function(){var t=document.documentElement.clientWidth;return t>0&&t<512?60:t>=512&&t<1024?80:t>=1024&&t<2048?100:t>=2048&&t<4096?120:t>=4096?180:60},n.prototype.updateCriteria=function(t,e,i,n){this.priorityCriteria.pano=t,this.priorityCriteria.cameraPosition.copy(e),this.priorityCriteria.cameraDir.copy(i),this.priorityCriteria.upcomingPanos=n,this.maxNavQuality=this.qualityManager.getMaxNavPanoSize(),this.maxZoomQuality=this.qualityManager.getMaxZoomPanoSize()},n.prototype.filterAndPrioritize=(o=[],a=[],s=[],function(t,e,i){this.populateNeighborPanos(this.priorityCriteria.pano,e,o),this.populateScoredPanos(this.priorityCriteria.pano,e,a,this.priorityCriteria.cameraDir,n.MAX_SCORED_PANOS_TOCONSIDER);var r=this.baseSize,l=this.standardSize,u=this.highSize,h=this.ultraHighSize;this.queueTilesForPano(t,i,this.priorityCriteria.pano,r),this.priorityCriteria.upcomingPanos&&this.queueTilesForPanos(t,this.priorityCriteria.upcomingPanos,i,r,n.MAX_UPCOMING_PANOS_TOADD),s.length=0,this.canDownloadSize(l)&&this.queueTilesInDirectionForPano(s,i,this.priorityCriteria.pano,l,this.priorityCriteria.cameraPosition,this.priorityCriteria.cameraDir,n.DIRECTIONAL_FOV_NARROW),n.sortPanoTiles(s,this.priorityCriteria.pano,this.priorityCriteria.cameraDir),n.appendQueue(t,s),this.queueTilesForPanos(t,a,i,r,n.MAX_SCORED_PANOS_TOADD),s.length=0,this.canDownloadSize(u)&&this.queueTilesInDirectionForPano(s,i,this.priorityCriteria.pano,u,this.priorityCriteria.cameraPosition,this.priorityCriteria.cameraDir,n.DIRECTIONAL_FOV_NARROW),this.canDownloadSize(h)&&this.queueTilesInDirectionForPano(s,i,this.priorityCriteria.pano,h,this.priorityCriteria.cameraPosition,this.priorityCriteria.cameraDir,n.DIRECTIONAL_FOV_NARROW),n.sortPanoTiles(s,this.priorityCriteria.pano,this.priorityCriteria.cameraDir),n.appendQueue(t,s),s.length=0,this.canDownloadSize(l)&&this.queueTilesInDirectionForPano(s,i,this.priorityCriteria.pano,l,this.priorityCriteria.cameraPosition,this.priorityCriteria.cameraDir,this.directional_fov),this.canDownloadSize(u)&&this.queueTilesInDirectionForPano(s,i,this.priorityCriteria.pano,u,this.priorityCriteria.cameraPosition,this.priorityCriteria.cameraDir,this.directional_fov),this.canDownloadSize(h)&&this.queueTilesInDirectionForPano(s,i,this.priorityCriteria.pano,h,this.priorityCriteria.cameraPosition,this.priorityCriteria.cameraDir,this.directional_fov),n.sortPanoTiles(s,this.priorityCriteria.pano,this.priorityCriteria.cameraDir),n.appendQueue(t,s),this.queueTilesForPanos(t,o,i,r)}),n.prototype.canDownloadSize=function(t){return this.maxNavQuality>=t||this.maxZoomQuality>=t&&this.zoomingActive},n.prototype.populateNeighborPanos=function(t,e,i){(i=i||[]).length=0;var n=e.getNeighbours(t),r=0;for(var o in n)if(n.hasOwnProperty(o)){var a=e.get(o);if(t.id!==a.id&&(i.push(a),1==++r))break}return i},n.prototype.populateScoredPanos=function(t,e,i,r,o){(i=i||[]).length=0;var a=[u.filters.inPanoDirection(t.position,r,n.DIRECTION_SCORE_STRICTNESS),u.filters.not(t)],s=[u.scoreFunctions.distanceSquared(t),u.scoreFunctions.direction(t.position,r)],l=e.sortByScore(a,s);if(l)for(var h=0;h<l.length&&h<o;h++){var c=l[h].pano;i.push(c)}return i},n.prototype.queueTilesForPanos=function(t,e,i,n,r){for(var o=0,a=0;a<e.length;a++){var s=e[a];if(o+=this.queueTilesForPano(t,i,s,n)>0?1:0,r&&o>=r)break}return o},n.prototype.queueTilesForPano=(r={filter:f.None},function(t,e,i,n){return this.filterAndQueueTileDownloadDescriptors(t,e,i,n,r)}),n.prototype.queueTilesForPanosInDirection=function(){var t=new l.Vector3;return function(e,i,n,r,o,a,s,l){for(var u=0,h=0;h<n.length;h++){var c=n[h];if(t.copy(c.position),t.sub(o),t.normalize(),Math.max(Math.min(a.dot(t),1),-1)>=p.getFOVDotThreshold(s))if(u+=this.queueTilesInDirectionForPano(e,i,c,r,o,a,s)>0?1:0,l&&u>=l)break}return u}}(),n.prototype.queueTilesInDirectionForPanos=function(t,e,i,n,r,o,a,s){for(var l=0,u=0;u<i.length;u++){var h=i[u];if(l+=this.queueTilesInDirectionForPano(t,e,h,n,o,a)>0?1:0,s&&l>=s)break}return l},n.prototype.queueTilesInDirectionForPano=function(){var t={filter:f.DirectionalFOV,direction:new l.Vector3,fov:60},e=new l.Vector3;return function(i,n,r,o,a,s,l){return e.copy(s),d.getRelativeDirection(r.quaternion,e),t.direction.copy(e),t.fov=l,this.filterAndQueueTileDownloadDescriptors(i,n,r,o,t)}}(),n.prototype.filterAndQueueTileDownloadDescriptors=function(){var t=[];return function(e,i,n,r,o){var a=i.getTileDownloadDescriptors(n,r);t.length=0,this.filterTileDownloadDescriptors(n,a,t,o);for(var s=0,l=0;l<t.length;l++){var u=t[l];u&&(e.push(u),s++)}return s}}(),n.prototype.filterTileDownloadDescriptors=(new l.Vector3,function(t,e,i,n){var r,o;switch(n.filter){case f.DirectionalFOV:for(r=0;r<e.length;r++)o=e[r],d.isTileWithinFOV(o.panoSize,o.tileSize,o.face,o.tileX,o.tileY,n.direction,n.fov)&&i.push(o);break;default:for(r=0;r<e.length;r++)o=e[r],i.push(o)}for(r=0;r<i.length;r++)o=i[r],this.canIncludeDescriptor(o)||(i[r]=null)}),n.prototype.canIncludeDescriptor=function(t){return t.status!==c.Downloading&&t.status!==c.Downloaded},n.prototype.canIncludePano=function(t,e){return!t.isLoaded(e)},n.getFOVDotThreshold=function(t){return Math.cos(l.Math.degToRad(t/2))};var m=function(){var t=function t(e,i){var n=t._panoSpaceDir,r=t._fovThreshold,o=t._fovThresholdNarrow,a=Math.max(Math.min(n.dot(e.direction),1),-1),s=Math.max(Math.min(n.dot(i.direction),1),-1);return e._dot=a,i._dot=s,a>=r&&s<r?-1:a<r&&s>=r?1:a>=o&&s<o?-1:a<o&&s>=o||e.panoSize>i.panoSize?1:i.panoSize>e.panoSize?-1:-(a-s)};return t._panoSpaceDir=new l.Vector3,t._fovThreshold=-1,t._fovThresholdNarrow=-1,t}();n.sortPanoTiles=function(t,e,i){m._panoSpaceDir.copy(i),d.getRelativeDirection(e.quaternion,m._panoSpaceDir),m._fovThresholdNarrow=p.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),m._fovThreshold=p.getFOVDotThreshold(d.getDirectionalFov()),t.sort(m)},n.insertSortedPanoTile=function(t,e,i,r){m._panoSpaceDir.copy(r),d.getRelativeDirection(i.quaternion,m._panoSpaceDir),m._fovThresholdNarrow=p.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),m._fovThreshold=p.getFOVDotThreshold(d.getDirectionalFov());for(var o=-1,a=0;a<t.length;a++){if(m(e,t[a])<=0){o=a;break}}if(-1===o)t[t.length]=e;else{for(var s=t.length;s>o;s--)t[s]=t[s-1];t[o]=e}},n.prototype.setZoomingActive=function(t){t!==this.zoomingActive&&(this.zoomingActive=t)},t.exports=n}).call(this,"/js/tile/TilePrioritizer.js")},function(t,e){t.exports={BuildingType:0,TextOnly:1,ImageText:2,Audio:4,OtherModel:5,TextAudio:6,ImageTextAudio:7,IFrame:8,Tag360T1:9,TagTo360:10,Video:11,Title:12,RegionalJump:13,Custome:104,ClassifyType:{Indoor:1,Building:2},EW:101,IKEA:102,Pano:9e3}},function(t,e){t.exports=function(t){var e=function(e){t.MeshBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.transparent=!0,this.opacity=.8,this.color.setHex(e.color),this.highlight=function(t){this.opacity=t?1:.8}};(e.prototype=Object.create(t.MeshBasicMaterial.prototype)).constructor=e;var i=function(e){t.LineBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.transparent=!0,this.linewidth=1,this.color.setHex(e.color),this.highlight=function(t){}};(i.prototype=Object.create(t.LineBasicMaterial.prototype)).constructor=i;var n=(new t.TextureLoader).load("images/torus_2x.png"),r=(new t.TextureLoader).load("images/arc_surface_2x.png");n.minFilter=r.minFilter=t.LinearFilter,n.magFilter=r.magFilter=t.LinearFilter;var o=function(){for(var e=[{x:26,y:16},{x:26,y:6},{x:-54,y:6},{x:-54,y:-6},{x:26,y:-6},{x:26.1,y:-16.1},{x:54,y:0}],i=new t.Shape,n=0,r=e.length;n<r;++n)0===n?i.moveTo(e[n].x,e[n].y):i.lineTo(e[n].x,e[n].y);return new t.ExtrudeBufferGeometry(i,{depth:8,bevelEnabled:!1,bevelSegments:1,steps:1,bevelSize:1,bevelThickness:1})},a=function(e){var i=[{x:-84.5,y:21.5},{x:-82.8,y:-11.5},{x:-72,y:-2.7},{x:-60.3,y:-7.8},{x:-50.2,y:-11.9},{x:-36.3,y:-16.2},{x:-24.8,y:-18.8},{x:-10.57,y:-21.01},{x:6.4,y:-21.74},{x:20.67,y:-21.09},{x:35.02,y:-18.28},{x:45.3,y:-15.7},{x:56.5,y:-11.5},{x:72.6,y:-4.5},{x:83.5,y:-13.5},{x:84.5,y:20.5},{x:52.5,y:13.1},{x:60.7,y:5},{x:48.38,y:.6},{x:35.6,y:-3.1},{x:24.7,y:-5.2},{x:12.9,y:-6.7},{x:-1.6,y:-7},{x:-14.9,y:-5.7},{x:-27.8,y:-3.2},{x:-41.2,y:.5},{x:-50.7,y:3.9},{x:-59.7,y:7.6},{x:-51.8,y:14.4}],n=new t.Shape;n.moveTo(i[0].x,i[0].y);for(var r=1;r<i.length;++r)n.lineTo(i[r].x,i[r].y);return new t.ExtrudeGeometry(n,{depth:e,bevelEnabled:!1,bevelSegments:1,steps:1,bevelSize:1,bevelThickness:1})},s=function(){var e=new t.PlaneBufferGeometry(4,4),i=new t.MeshBasicMaterial({map:n,side:t.DoubleSide,transparent:!0,depthTest:!1,depthWrite:!1});return new t.Mesh(e,i)},l=function(){var e=new t.PlaneBufferGeometry(2.84,.74),i=new t.MeshBasicMaterial({map:r,side:t.DoubleSide,transparent:!0,depthTest:!1,depthWrite:!1});return new t.Mesh(e,i)},u=function(i){var n=new t.Group,r=new t.Mesh(new a(8),new e({color:i.color}));r.name=i.name,r.scale.set(.01,.01,.01),r.position.set(0,-1.84,0),r.userData.isPicker=!0,n.add(r);var o=new s;o.name="Torus",o.visible=!1,n.add(o);var u=new l;return u.name="ArcSurface",u.visible=!1,u.position.y-=1.84-.37+.18,u.position.z+=.01,n.add(u),n};function h(e,i){t.Object3D.call(this),i=void 0!==i?i:document,this.object=void 0,this.visible=!1,this.translationSnap=null,this.rotationSnap=null,this.space="world",this.size=1,this.axis=null,this.currentWorldPosition=new t.Vector3,this.clock=new t.Clock,this.delta=0,this.MOVELOCK={X:{state:!1,crash_point:null},Y:{state:!1,crash_point:null},Z:{state:!1,crash_point:null}};var n=this,r="translate",o=!1,a={translate:new t.TransformGizmoDIYTranslate,rotate:new t.TransformGizmoDIYRotate};for(var s in this._gizmo=a,a){var l=a[s];l.visible=s===r,this.add(l)}var u={type:"change"},h={type:"mouseDown"},c={type:"mouseUp",mode:r},d={type:"objectChange"},p=new t.Raycaster,f=new t.Vector2,m=new t.Vector3,g=new t.Vector3,v=new t.Vector3,y=new t.Vector3,b=1,w=(new t.Matrix4,new t.Vector3),x=new t.Matrix4,M=new t.Vector3,T=new t.Quaternion,S=new t.Vector3(1,0,0),_=new t.Vector3(0,1,0),A=new t.Vector3(0,0,1),P=new t.Quaternion,C=new t.Quaternion,E=new t.Quaternion,D=new t.Quaternion,L=(new t.Quaternion,new t.Vector3),O=new t.Vector3,I=new t.Matrix4,R=new t.Matrix4,N=new t.Vector3,k=new t.Vector3,F=new t.Euler,B=new t.Matrix4,z=new t.Vector3,U=new t.Euler;function V(t){if(void 0!==n.object&&!0!==o&&(void 0===t.button||0===t.button)){var e=W(t.changedTouches?t.changedTouches[0]:t,a[r].pickers.children),i=null;e&&(i=e.object.name,t.preventDefault()),n.axis!==i&&(n.axis=i,n.update(),n.dispatchEvent(u))}}function j(t){if(void 0!==n.object&&!0!==o&&(void 0===t.button||0===t.button)){var e=t.changedTouches?t.changedTouches[0]:t;if(0===e.button||void 0===e.button){var i=W(e,a[r].pickers.children);if(i){t.preventDefault(),t.stopPropagation(),n.dispatchEvent(h),n.axis=i.object.name,n.update(),w.copy(z).sub(k).normalize(),a[r].setActivePlane(n.axis,w);var s=W(e,[a[r].activePlane]);s&&(L.copy(n.object.position),O.copy(n.object.scale),I.extractRotation(n.object.matrix),B.extractRotation(n.object.matrixWorld),R.extractRotation(n.object.parent.matrixWorld),N.setFromMatrixScale(x.getInverse(n.object.parent.matrixWorld)),g.copy(s.point));var l=i.object,u=n.getMode(),c=n._gizmo[u].pickerGizmos;if("rotate"===u&&l.userData.isPicker){for(var d in c){(p=c[d][0][0].children[0]).visible=!1}l.parent.getObjectByName("Torus").visible=!0,l.parent.getObjectByName("ArcSurface").visible=!0}if("translate"===u&&l.userData.isPicker)for(var d in c){var p=c[d][0][0];n.axis!==d&&(p.visible=!1)}}}o=!0}}function H(e){if(void 0!==n.object&&null!==n.axis&&!1!==o&&(void 0===e.button||0===e.button)){var i=W(e.changedTouches?e.changedTouches[0]:e,[a[r].activePlane]);if(!1!==i){if(e.preventDefault(),e.stopPropagation(),m.copy(i.point),"translate"===r){if(n.MOVELOCK[n.axis].state)return;m.sub(g),m.multiply(N),"world"!==n.space&&-1===n.axis.search("XYZ")||(-1===n.axis.search("X")&&(m.x=0),-1===n.axis.search("Y")&&(m.y=0),-1===n.axis.search("Z")&&(m.z=0),m.applyMatrix4(x.getInverse(R)),n.object.position.copy(L),n.object.position.add(m))}if("rotate"===r){if(n.MOVELOCK[n.axis].state)return;if(m.sub(k),m.multiply(N),M.copy(g).sub(k),M.multiply(N),"world"===n.space){if(v.set(Math.atan2(m.z,m.y),Math.atan2(m.x,m.z),Math.atan2(m.y,m.x)),y.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),T.setFromRotationMatrix(x.getInverse(R)),null!==n.rotationSnap?(C.setFromAxisAngle(S,Math.round((v.x-y.x)/n.rotationSnap)*n.rotationSnap),E.setFromAxisAngle(_,Math.round((v.y-y.y)/n.rotationSnap)*n.rotationSnap),D.setFromAxisAngle(A,Math.round((v.z-y.z)/n.rotationSnap)*n.rotationSnap)):(C.setFromAxisAngle(S,v.x-y.x),E.setFromAxisAngle(_,v.y-y.y),D.setFromAxisAngle(A,v.z-y.z)),P.setFromRotationMatrix(B),"X"===n.axis){T.multiplyQuaternions(T,C);var s=n._gizmo[r].pickerGizmos.X[0][0].getObjectByName("ArcSurface");(l=new t.Quaternion).setFromAxisAngle(A,v.x),s.quaternion.copy(l)}if("Y"===n.axis){T.multiplyQuaternions(T,E);s=n._gizmo[r].pickerGizmos.Y[0][0].getObjectByName("ArcSurface");(l=new t.Quaternion).setFromAxisAngle(A,v.y),s.quaternion.copy(l)}if("Z"===n.axis){T.multiplyQuaternions(T,D);var l;s=n._gizmo[r].pickerGizmos.Z[0][0].getObjectByName("ArcSurface");(l=new t.Quaternion).setFromAxisAngle(A,v.z),s.quaternion.copy(l)}if(n.MOVELOCK[n.axis].state)return;T.multiplyQuaternions(T,P),n.object.quaternion.copy(T)}}n.update(),n.dispatchEvent(u),n.dispatchEvent(d)}}}function G(t){if(t.preventDefault(),void 0===t.button||0===t.button){if(o&&null!==n.axis){c.mode=r,n.dispatchEvent(c);var e=n.getMode(),i=n.axis,a=n._gizmo[e].pickerGizmos;if("rotate"===e){for(var s in a){(l=a[s][0][0].children[0]).visible=!0}a[i][0][0].getObjectByName("Torus").visible=!1,a[i][0][0].getObjectByName("ArcSurface").visible=!1}if("translate"===e)for(var s in a){var l=a[s][0][0];n.axis!==s&&(l.visible=!0)}}o=!1,"TouchEvent"in window&&t instanceof TouchEvent?(n.axis=null,n.update(),n.dispatchEvent(u)):V(t)}}function W(t,n){var r=i.getBoundingClientRect(),o=(t.clientX-r.left)/r.width,a=(t.clientY-r.top)/r.height;f.set(2*o-1,-2*a+1),p.setFromCamera(f,e);var s=p.intersectObjects(n,!0);return!!s[0]&&s[0]}i.addEventListener("mousedown",j,!1),i.addEventListener("mousemove",V,!1),i.addEventListener("mousemove",H,!1),i.addEventListener("mouseup",G,!1),i.addEventListener("mouseout",G,!1),this.dispose=function(){i.removeEventListener("mousedown",j),i.removeEventListener("mousemove",V),i.removeEventListener("mousemove",H),i.removeEventListener("mouseup",G),i.removeEventListener("mouseout",G)},this.attach=function(t){this.object=t,this.visible=!0,this.update()},this.detach=function(){this.object=void 0,this.visible=!1,this.axis=null},this.getMode=function(){return r},this.setMode=function(t){for(var e in"scale"===(r=t||r)&&(n.space="local"),a)a[e].visible=e===r;this.update(),n.dispatchEvent(u)},this.setTranslationSnap=function(t){n.translationSnap=t},this.setRotationSnap=function(t){n.rotationSnap=t},this.setSize=function(t){n.size=t,this.update(),n.dispatchEvent(u)},this.setSpace=function(t){n.space=t,this.update(),n.dispatchEvent(u)},this.update=function(){void 0!==n.object&&(n.object.updateMatrixWorld(),k.setFromMatrixPosition(n.object.matrixWorld),F.setFromRotationMatrix(x.extractRotation(n.object.matrixWorld)),e.updateMatrixWorld(),z.setFromMatrixPosition(e.matrixWorld),U.setFromRotationMatrix(x.extractRotation(e.matrixWorld)),b=k.distanceTo(z)/6*n.size,"Group"===n.object.type?this.position.copy(n.currentWorldPosition):this.position.copy(k),this.scale.set(b,b,b),e instanceof t.PerspectiveCamera?w.copy(z).sub(k).normalize():e instanceof t.OrthographicCamera&&w.copy(z).normalize(),"local"===n.space?a[r].update(F,w):"world"===n.space&&a[r].update(new t.Euler,w),a[r].highlight(n.axis))}}return t.TransformGizmoDIY=function(){this.init=function(){t.Object3D.call(this),this.handles=new t.Object3D,this.pickers=new t.Object3D,this.planes=new t.Object3D,this.add(this.handles),this.add(this.pickers),this.add(this.planes);var e=new t.PlaneBufferGeometry(50,50,2,2),i=new t.MeshBasicMaterial({visible:!1,side:t.DoubleSide}),n={XY:new t.Mesh(e,i),YZ:new t.Mesh(e,i),XZ:new t.Mesh(e,i)};for(var r in n.YZ.rotation.set(0,Math.PI/2,0),n.XZ.rotation.set(-Math.PI/2,0,0),n)n[r].name=r,this.planes.add(n[r]),this.planes[r]=n[r];var o=function(t,e){for(var i in t)for(r=t[i].length;r--;){var n=t[i][r][0],o=t[i][r][1],a=t[i][r][2];n.name=i,o&&n.position.set(o[0],o[1],o[2]),a&&n.rotation.set(a[0],a[1],a[2]),e.add(n)}};o(this.handleGizmos,this.handles),o(this.pickerGizmos,this.pickers),this.traverse((function(e){if(e instanceof t.Mesh){e.updateMatrix();var i=e.geometry.clone();i.applyMatrix(e.matrix),e.geometry=i,e.position.set(0,0,0),e.rotation.set(0,0,0),e.scale.set(1,1,1)}}))};this.highlight=function(t){this.traverse((function(e){e.material&&e.material.highlight&&(e.name===t?e.material.highlight(!0):e.material.highlight(!1))}))}},t.TransformGizmoDIY.prototype=Object.create(t.Object3D.prototype),t.TransformGizmoDIY.prototype.constructor=t.TransformGizmoDIY,t.TransformGizmoDIY.prototype.update=function(t,e){},t.TransformGizmoDIYTranslate=function(){t.TransformGizmoDIY.call(this);var n=new t.BufferGeometry;n.addAttribute("position",new t.Float32BufferAttribute([0,0,0,.3,0,0],3));var r=new t.Line(n,new i({color:65280}));r.userData.isLine=!0;var a=new t.BufferGeometry;a.addAttribute("position",new t.Float32BufferAttribute([0,0,0,0,.3,0],3));var s=new t.Line(a,new i({color:16711680}));s.userData.isLine=!0;var l=new t.BufferGeometry;l.addAttribute("position",new t.Float32BufferAttribute([0,0,0,0,0,.3],3));var u=new t.Line(l,new i({color:16776960}));r.userData.isLine=!0,this.handleGizmos={X:[[r]],Y:[[s]],Z:[[u]]};var h=new t.Mesh(new o,new e({visible:!0,transparent:!0,color:65280}));h.scale.set(.01,.01,.01),h.userData.isPicker=!0;var c=new t.Mesh(new o,new e({visible:!0,transparent:!0,color:16711680}));c.scale.set(.01,.01,.01),c.userData.isPicker=!0;var d=new t.Mesh(new o,new e({visible:!0,transparent:!0,color:16776960}));d.scale.set(.01,.01,.01),d.userData.isPicker=!0,this.pickerGizmos={X:[[h,[1.2,0,0],[Math.PI/2,0,0]]],Y:[[c,[0,1.2,0],[0,0,Math.PI/2]]],Z:[[d,[0,0,1.2],[Math.PI/2,0,Math.PI/2]]]},this.setActivePlane=function(e,i){var n=new t.Matrix4;i.applyMatrix4(n.getInverse(n.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(i.y)>Math.abs(i.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(i.x)>Math.abs(i.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(i.x)>Math.abs(i.y)&&(this.activePlane=this.planes.YZ)),"XYZ"===e&&(this.activePlane=this.planes.XYZE),"XY"===e&&(this.activePlane=this.planes.XY),"YZ"===e&&(this.activePlane=this.planes.YZ),"XZ"===e&&(this.activePlane=this.planes.XZ)};var p=new t.Vector3(1,0,0),f=new t.Vector3(0,1,0),m=new t.Vector3(0,0,1),g=new t.Quaternion,v=new t.Quaternion,y=new t.Vector3(0,1,0);this.update=function(e,i){t.TransformGizmoDIY.prototype.update.apply(this,arguments),this.traverse((function(e){var n;"X"===e.name&&((n=y.copy(p).applyQuaternion(g).dot(i))<0&&(e.scale.x=-1),n>0&&(e.scale.x=1));if("Y"===e.name){var r=new t.Quaternion,o=new t.Quaternion;r.setFromAxisAngle(f,Math.atan2(i.x,i.z)),o.multiplyQuaternions(o,r),e.quaternion.copy(o)}"Z"===e.name&&((n=y.copy(m).applyQuaternion(v).dot(i))<0&&(e.scale.z=-1),n>0&&(e.scale.z=1))}))},this.init()},t.TransformGizmoDIYTranslate.prototype=Object.create(t.TransformGizmoDIY.prototype),t.TransformGizmoDIYTranslate.prototype.constructor=t.TransformGizmoDIYTranslate,t.TransformGizmoDIYRotate=function(){t.TransformGizmoDIY.call(this);var e=new t.BufferGeometry;e.addAttribute("position",new t.Float32BufferAttribute([0,0,0,.3,0,0],3));var n=new t.Line(e,new i({color:65280}));n.userData.isLine=!0;var r=new t.BufferGeometry;r.addAttribute("position",new t.Float32BufferAttribute([0,0,0,0,.3,0],3));var o=new t.Line(r,new i({color:16711680}));o.userData.isLine=!0;var a=new t.BufferGeometry;a.addAttribute("position",new t.Float32BufferAttribute([0,0,0,0,0,.3],3));var s=new t.Line(a,new i({color:16776960}));s.userData.isLine=!0,this.handleGizmos={X:[[n]],Y:[[o]],Z:[[s]]};var l=new u({color:8446604,name:"X"}),h=new u({color:15897485,name:"Y"}),c=new u({color:16701062,name:"Z"});this.pickerGizmos={X:[[l,[0,0,0],[0,Math.PI/2,-3*Math.PI/4]]],Y:[[h,[0,0,0],[-Math.PI/2,0,0]]],Z:[[c,[0,0,0],[0,0,3*Math.PI/4]]]},this.setActivePlane=function(t){"X"===t&&(this.activePlane=this.planes.YZ),"Y"===t&&(this.activePlane=this.planes.XZ),"Z"===t&&(this.activePlane=this.planes.XY)},this.update=function(e,i){t.TransformGizmoDIY.prototype.update.apply(this,arguments);this.handles,this.pickers,new t.Matrix4,new t.Euler(0,0,1);var n=new t.Quaternion,r=new t.Vector3(1,0,0),o=new t.Vector3(0,1,0),a=new t.Vector3(0,0,1),s=new t.Quaternion,l=(new t.Quaternion,new t.Quaternion),u=i.clone(),h=new t.Vector3(0,1,0),c=h.copy(r).applyQuaternion(s).dot(u),d=h.copy(a).applyQuaternion(l).dot(u);c<0&&1===this.handleGizmos.X[0][0].scale.x&&(this.handleGizmos.X[0][0].scale.x=-1,this.pickerGizmos.Z[0][0].rotateZ(Math.PI/2)),c>0&&-1===this.handleGizmos.X[0][0].scale.x&&(this.handleGizmos.X[0][0].scale.x=1,this.pickerGizmos.Z[0][0].rotateZ(-Math.PI/2)),d<0&&1===this.handleGizmos.Z[0][0].scale.z&&(this.handleGizmos.Z[0][0].scale.z=-1,this.pickerGizmos.X[0][0].rotateZ(-Math.PI/2)),d>0&&-1===this.handleGizmos.Z[0][0].scale.z&&(this.handleGizmos.Z[0][0].scale.z=1,this.pickerGizmos.X[0][0].rotateZ(Math.PI/2));var p=new t.Quaternion;n=new t.Quaternion;p.setFromAxisAngle(o,Math.atan2(u.x,u.z)),n.multiplyQuaternions(n,p),this.pickerGizmos.Y[0][0].quaternion.copy(n),this.pickerGizmos.Y[0][0].rotateX(-Math.PI/2)},this.init()},t.TransformGizmoDIYRotate.prototype=Object.create(t.TransformGizmoDIY.prototype),t.TransformGizmoDIYRotate.prototype.constructor=t.TransformGizmoDIYRotate,h.prototype=Object.create(t.Object3D.prototype),h.prototype.constructor=h,h}},function(t,e){t.exports={canbeChoosedOfMode3D:!0}},function(t,e){t.exports={TagActivated:"tag.activated",TagDismissed:"tag.dismissed",TagNavigation:"tag.navigation"}},function(t,e,i){var n=i(0),r=i(12),o=i(7);function a(t){t=t||{},G.model.enablefilter?n.RawShaderMaterial.call(this,o.extendObject({fragmentShader:r.model2.fragmentShader,vertexShader:r.model2.vertexShader,uniforms:n.UniformsUtils.clone(r.model2.uniforms),name:"ModelTextureMaterial",depthTest:!0,depthWrite:!0},t)):n.RawShaderMaterial.call(this,o.extendObject({fragmentShader:r.model.fragmentShader,vertexShader:r.model.vertexShader,uniforms:n.UniformsUtils.clone(r.model.uniforms),name:"ModelTextureMaterial",depthTest:!0,depthWrite:!0},t))}a.prototype=Object.create(n.RawShaderMaterial.prototype),a.prototype.constructor=a,a.prototype.setProjectedPanos=function(t,e,i){if(G.model.enablefilter){var n=t.getAjustedColors(),r=e.getAjustedColors();i&&(this.uniforms.progress.value=0),t.ensureSkyboxReadyForRender(),this.uniforms.pano0Map.value=t.getSkyboxTexture(),this.uniforms.brightness0.value=n.brightness,this.uniforms.contrast0.value=n.contrast,this.uniforms.gamma0.value=n.gamma,this.uniforms.hue0.value=n.hue,this.uniforms.saturation0.value=n.saturation,this.uniforms.vibrance0.value=n.vibrance,this.uniforms.balance0.value.copy(n.balance),this.uniforms.pano0Position.value.copy(t.position),this.uniforms.pano0Matrix.value.copy(t.skyboxMesh.matrixWorld),e.ensureSkyboxReadyForRender(),this.uniforms.pano1Map.value=e.getSkyboxTexture(),this.uniforms.brightness1.value=r.brightness,this.uniforms.contrast1.value=r.contrast,this.uniforms.gamma1.value=r.gamma,this.uniforms.hue1.value=r.hue,this.uniforms.saturation1.value=r.saturation,this.uniforms.vibrance1.value=r.vibrance,this.uniforms.balance1.value.copy(r.balance),this.uniforms.pano1Position.value.copy(e.position),this.uniforms.pano1Matrix.value.copy(e.skyboxMesh.matrixWorld)}else i&&(this.uniforms.progress.value=0),t.ensureSkyboxReadyForRender(),this.uniforms.pano0Map.value=t.getSkyboxTexture(),this.uniforms.pano0Position.value.copy(t.position),this.uniforms.pano0Matrix.value.copy(t.skyboxMesh.matrixWorld),e.ensureSkyboxReadyForRender(),this.uniforms.pano1Map.value=e.getSkyboxTexture(),this.uniforms.pano1Position.value.copy(e.position),this.uniforms.pano1Matrix.value.copy(e.skyboxMesh.matrixWorld)},t.exports=a},function(t,e,i){var n=i(0),r=i(1),o=i(7),a=i(10),s=i(153),l=i(8),u=i(15),h=i(17);function c(t,e,i){n.Object3D.call(this),this.model=t,this.floorIndex=e,this.name=i||e+1,this.panos=[],this.chunks=[],this.colliderBuilder=new s(3),this.collider=null,this.center=null,this.boundingBox=new n.Box3,this.size=null,this.hidden=!1,this.conservativeBoundingBox=new n.Box3,this.debugColor=16777215*Math.random(),this.transition=null,this.pano360Position=null}c.prototype=Object.create(n.Object3D.prototype),c.prototype.enter=function(t){this.model.setFloor(this,t)},c.prototype.hide=function(t){if(!this.hidden||this.transition){this.chunks.forEach((function(t){t.material.transparent=!0})),l.cancel(this.transition);var e=t?0:r.hideFloorDuration+r.hideFloorDelay,i=t?0:r.hideFloorDelay/e;this.transition=l.start(a.allUniforms(this.chunks,"opacity",.08),e,function(){this.hidden=!0}.bind(this),i,u.easeInOutQuad)}},c.prototype.show=function(t){if(this.hidden||this.transition){this.hidden=!1,l.cancel(this.transition);var e=t?r.showFloorDuration:r.showFloorDuration+r.showFloorDelay,i=t?0:r.showFloorDelay/e;this.transition=l.start(a.allUniforms(this.chunks,"opacity",1),e,function(){this.hidden||this.chunks.forEach((function(t){t.material.transparent=!1}))}.bind(this),i,u.easeInOutQuad)}},c.prototype.toggle=function(t,e){(t=void 0===t?this.hidden:t)?this.show(e):this.hide(e)},c.prototype.containsPoint=function(t){return this.collider.children.some((function(e){return e.geometry.boundingBox||e.geometry.computeBoundingBox(),e.geometry.boundingBox.containsPoint(t)}))},c.prototype.distanceToPoint=function(t){var e=null,i=1/0;return this.collider.children.forEach((function(n){n.geometry.boundingBox||n.geometry.computeBoundingBox();var r=n.geometry.boundingBox.distanceToPoint(t);(!e||i>r)&&(i=r,e=n)})),i},c.prototype.addChunk=function(t){t.renderOrder=h.ghostFloor,this.add(t),this.chunks.push(t),this.boundingBox.union(t.geometry.boundingBox),this.size=this.boundingBox.getSize(new n.Vector3),this.colliderBuilder.add(t.geometry)},c.prototype.addPano=function(t){this.panos.push(t),this.add(t.skyboxMesh),t.marker&&this.add(t.marker);var e=new n.Vector3(1,1,1);2==t.alignmentType&&(null==this.pano360Position&&(this.pano360Position=new n.Vector3((this.boundingBox.min.x+this.boundingBox.max.x)/2,this.boundingBox.min.y-2.1,(this.boundingBox.min.z+this.boundingBox.max.z)/2)),t.position=this.pano360Position,t.skyboxMesh.position.copy(t.position),e=new n.Vector3(4,4,4));var i=(new n.Box3).setFromCenterAndSize(t.position,e);this.boundingBox.union(i)},c.prototype.build=function(){this.collider=this.colliderBuilder.build(!0),this.add(this.collider),this.center=this.boundingBox.getCenter(new n.Vector3),this.conservativeBoundingBox.copy(this.boundingBox),this.conservativeBoundingBox.min.y=o.lowerMedian(this.collider.children.map((function(t){return t.geometry.boundingBox.min.y})),5),this.conservativeBoundingBox.max.y=o.lowerMedian(this.collider.children.map((function(t){return t.geometry.boundingBox.max.y})),5),this.colliderBuilder=null},c.prototype.toShortString=function(){return o.nth(this.floorIndex+1)},c.prototype.toString=function(){return this.name},t.exports=c},function(t,e,i){var n=i(0),r=i(12),o=i(5),a=i(43);function s(t){this.materialInside=new a({side:n.DoubleSide}),this.materialOutside=new n.RawShaderMaterial({fragmentShader:r.modelOutside.fragmentShader,vertexShader:r.modelOutside.vertexShader,uniforms:n.UniformsUtils.clone(r.modelOutside.uniforms),side:n.FrontSide,name:"chunkOut",depthWrite:!0}),n.Mesh.call(this,t.geometry,this.materialInside),this.name=t.name||"",this.textureName=t.textureName,this.meshUrl=t.meshUrl}s.prototype=Object.create(n.Mesh.prototype),s.prototype.setTextureMap=function(t){this.materialInside.uniforms.map.value=t,this.materialOutside.uniforms.map.value=t},s.prototype.setMode=function(t){var e=t===o.DOLLHOUSE||t===o.FLOORPLAN?this.materialOutside:this.materialInside;e.side=t===o.PANORAMA?n.DoubleSide:n.FrontSide,e.transparent=this.material.transparent,e.uniforms.opacity.value=this.material.uniforms.opacity.value,this.material=e},t.exports=s},function(t,e,i){(function(n){var r,o,a;o=[i(168)],void 0===(a="function"==typeof(r=function(t,e){"use strict";var r,o={};return o.ByteBuffer=t,o.Long=t.Long||null,o.VERSION="5.0.3",o.WIRE_TYPES={},o.WIRE_TYPES.VARINT=0,o.WIRE_TYPES.BITS64=1,o.WIRE_TYPES.LDELIM=2,o.WIRE_TYPES.STARTGROUP=3,o.WIRE_TYPES.ENDGROUP=4,o.WIRE_TYPES.BITS32=5,o.PACKABLE_WIRE_TYPES=[o.WIRE_TYPES.VARINT,o.WIRE_TYPES.BITS64,o.WIRE_TYPES.BITS32],o.TYPES={int32:{name:"int32",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:o.WIRE_TYPES.VARINT,defaultValue:o.Long?o.Long.ZERO:void 0},uint64:{name:"uint64",wireType:o.WIRE_TYPES.VARINT,defaultValue:o.Long?o.Long.UZERO:void 0},sint64:{name:"sint64",wireType:o.WIRE_TYPES.VARINT,defaultValue:o.Long?o.Long.ZERO:void 0},bool:{name:"bool",wireType:o.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:o.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:o.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:o.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:o.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:o.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:o.WIRE_TYPES.BITS64,defaultValue:o.Long?o.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:o.WIRE_TYPES.BITS64,defaultValue:o.Long?o.Long.ZERO:void 0},float:{name:"float",wireType:o.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:o.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:o.WIRE_TYPES.STARTGROUP,defaultValue:null}},o.MAP_KEY_TYPES=[o.TYPES.int32,o.TYPES.sint32,o.TYPES.sfixed32,o.TYPES.uint32,o.TYPES.fixed32,o.TYPES.int64,o.TYPES.sint64,o.TYPES.sfixed64,o.TYPES.uint64,o.TYPES.fixed64,o.TYPES.bool,o.TYPES.string,o.TYPES.bytes],o.ID_MIN=1,o.ID_MAX=536870911,o.convertFieldsToCamelCase=!1,o.populateAccessors=!0,o.populateDefaults=!0,o.Util=((r={}).IS_NODE=!("object"!=typeof n||n+""!="[object process]"||n.browser),r.XHR=function(){for(var t=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],e=null,i=0;i<t.length;i++){try{e=t[i]()}catch(t){continue}break}if(!e)throw Error("XMLHttpRequest is not supported");return e},r.fetch=function(t,e){if(e&&"function"!=typeof e&&(e=null),r.IS_NODE){var n=i(170);if(e)n.readFile(t,(function(t,i){e(t?null:""+i)}));else try{return n.readFileSync(t)}catch(t){return null}}else{var o=r.XHR();if(o.open("GET",t,!!e),o.setRequestHeader("Accept","text/plain"),"function"==typeof o.overrideMimeType&&o.overrideMimeType("text/plain"),!e)return o.send(null),200==o.status||0==o.status&&"string"==typeof o.responseText?o.responseText:null;if(o.onreadystatechange=function(){4==o.readyState&&(200==o.status||0==o.status&&"string"==typeof o.responseText?e(o.responseText):e(null))},4==o.readyState)return;o.send(null)}},r.toCamelCase=function(t){return t.replace(/_([a-zA-Z])/g,(function(t,e){return e.toUpperCase()}))},r),o.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,FQTYPEREF:/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g},o.DotProto=function(t,e){var i={},n=function(t){this.source=t+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},r=n.prototype;r._readString=function(){var t='"'===this._stringOpen?e.STRING_DQ:e.STRING_SQ;t.lastIndex=this.index-1;var i=t.exec(this.source);if(!i)throw Error("unterminated string");return this.index=t.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,i[1]},r.next=function(){if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();var t,i,n;do{for(t=!1;e.WHITESPACE.test(n=this.source.charAt(this.index));)if("\n"===n&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,t=!0}else{if("*"!==(n=this.source.charAt(this.index)))return"/";do{if("\n"===n&&++this.line,++this.index===this.source.length)return null;i=n,n=this.source.charAt(this.index)}while("*"!==i||"/"!==n);++this.index,t=!0}}while(t);if(this.index===this.source.length)return null;var r=this.index;if(e.DELIM.lastIndex=0,!e.DELIM.test(this.source.charAt(r++)))for(;r<this.source.length&&!e.DELIM.test(this.source.charAt(r));)++r;var o=this.source.substring(this.index,this.index=r);return'"'!==o&&"'"!==o||(this._stringOpen=o),o},r.peek=function(){if(0===this.stack.length){var t=this.next();if(null===t)return null;this.stack.push(t)}return this.stack[0]},r.skip=function(t){var e=this.next();if(e!==t)throw Error("illegal '"+e+"', '"+t+"' expected")},r.omit=function(t){return this.peek()===t&&(this.next(),!0)},r.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},i.Tokenizer=n;var o=function(t){this.tn=new n(t),this.proto3=!1},a=o.prototype;function s(t,i){var n=-1,r=1;if("-"==t.charAt(0)&&(r=-1,t=t.substring(1)),e.NUMBER_DEC.test(t))n=parseInt(t);else if(e.NUMBER_HEX.test(t))n=parseInt(t.substring(2),16);else{if(!e.NUMBER_OCT.test(t))throw Error("illegal id value: "+(r<0?"-":"")+t);n=parseInt(t.substring(1),8)}if(n=r*n|0,!i&&n<0)throw Error("illegal id value: "+(r<0?"-":"")+t);return n}function l(t){var i=1;if("-"==t.charAt(0)&&(i=-1,t=t.substring(1)),e.NUMBER_DEC.test(t))return i*parseInt(t,10);if(e.NUMBER_HEX.test(t))return i*parseInt(t.substring(2),16);if(e.NUMBER_OCT.test(t))return i*parseInt(t.substring(1),8);if("inf"===t)return i*(1/0);if("nan"===t)return NaN;if(e.NUMBER_FLT.test(t))return i*parseFloat(t);throw Error("illegal number value: "+(i<0?"-":"")+t)}function u(t,e,i){void 0===t[e]?t[e]=i:(Array.isArray(t[e])||(t[e]=[t[e]]),t[e].push(i))}return a.parse=function(){var t,i,n={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},r=!0;try{for(;t=this.tn.next();)switch(t){case"package":if(!r||null!==n.package)throw Error("unexpected 'package'");if(t=this.tn.next(),!e.TYPEREF.test(t))throw Error("illegal package name: "+t);this.tn.skip(";"),n.package=t;break;case"import":if(!r)throw Error("unexpected 'import'");("public"===(t=this.tn.peek())||(i="weak"===t))&&this.tn.next(),t=this._readString(),this.tn.skip(";"),i||n.imports.push(t);break;case"syntax":if(!r)throw Error("unexpected 'syntax'");this.tn.skip("="),"proto3"===(n.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(n,null),r=!1;break;case"enum":this._parseEnum(n),r=!1;break;case"option":this._parseOption(n);break;case"service":this._parseService(n);break;case"extend":this._parseExtend(n);break;default:throw Error("unexpected '"+t+"'")}}catch(t){throw t.message="Parse error at line "+this.tn.line+": "+t.message,t}return delete n.name,n},o.parse=function(t){return new o(t).parse()},a._readString=function(){var t,e,i="";do{if("'"!==(e=this.tn.next())&&'"'!==e)throw Error("illegal string delimiter: "+e);i+=this.tn.next(),this.tn.skip(e),t=this.tn.peek()}while('"'===t||'"'===t);return i},a._readValue=function(t){var i=this.tn.peek();if('"'===i||"'"===i)return this._readString();if(this.tn.next(),e.NUMBER.test(i))return l(i);if(e.BOOL.test(i))return"true"===i.toLowerCase();if(t&&e.TYPEREF.test(i))return i;throw Error("illegal value: "+i)},a._parseOption=function(t,i){var n=this.tn.next(),r=!1;if("("===n&&(r=!0,n=this.tn.next()),!e.TYPEREF.test(n))throw Error("illegal option name: "+n);var o=n;r&&(this.tn.skip(")"),o="("+o+")",n=this.tn.peek(),e.FQTYPEREF.test(n)&&(o+=n,this.tn.next())),this.tn.skip("="),this._parseOptionValue(t,o),i||this.tn.skip(";")},a._parseOptionValue=function(t,i){var n=this.tn.peek();if("{"!==n)u(t.options,i,this._readValue(!0));else for(this.tn.skip("{");"}"!==(n=this.tn.next());){if(!e.NAME.test(n))throw Error("illegal option name: "+i+"."+n);this.tn.omit(":")?u(t.options,i+"."+n,this._readValue(!0)):this._parseOptionValue(t,i+"."+n)}},a._parseService=function(t){var i=this.tn.next();if(!e.NAME.test(i))throw Error("illegal service name at line "+this.tn.line+": "+i);var n={name:i,rpc:{},options:{}};for(this.tn.skip("{");"}"!==(i=this.tn.next());)if("option"===i)this._parseOption(n);else{if("rpc"!==i)throw Error("illegal service token: "+i);this._parseServiceRPC(n)}this.tn.omit(";"),t.services.push(n)},a._parseServiceRPC=function(t){var i=this.tn.next();if(!e.NAME.test(i))throw Error("illegal rpc service method name: "+i);var n=i,r={request:null,response:null,request_stream:!1,response_stream:!1,options:{}};if(this.tn.skip("("),"stream"===(i=this.tn.next()).toLowerCase()&&(r.request_stream=!0,i=this.tn.next()),!e.TYPEREF.test(i))throw Error("illegal rpc service request type: "+i);if(r.request=i,this.tn.skip(")"),"returns"!==(i=this.tn.next()).toLowerCase())throw Error("illegal rpc service request type delimiter: "+i);if(this.tn.skip("("),"stream"===(i=this.tn.next()).toLowerCase()&&(r.response_stream=!0,i=this.tn.next()),r.response=i,this.tn.skip(")"),"{"===(i=this.tn.peek())){for(this.tn.next();"}"!==(i=this.tn.next());){if("option"!==i)throw Error("illegal rpc service token: "+i);this._parseOption(r)}this.tn.omit(";")}else this.tn.skip(";");void 0===t.rpc&&(t.rpc={}),t.rpc[n]=r},a._parseMessage=function(t,i){var n=!!i,r=this.tn.next(),o={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!e.NAME.test(r))throw Error("illegal "+(n?"group":"message")+" name: "+r);for(o.name=r,n&&(this.tn.skip("="),i.id=s(this.tn.next()),o.isGroup=!0),"["===(r=this.tn.peek())&&i&&this._parseFieldOptions(i),this.tn.skip("{");"}"!==(r=this.tn.next());)if(e.RULE.test(r))this._parseMessageField(o,r);else if("oneof"===r)this._parseMessageOneOf(o);else if("enum"===r)this._parseEnum(o);else if("message"===r)this._parseMessage(o);else if("option"===r)this._parseOption(o);else if("service"===r)this._parseService(o);else if("extensions"===r)o.hasOwnProperty("extensions")?o.extensions=o.extensions.concat(this._parseExtensionRanges()):o.extensions=this._parseExtensionRanges();else if("reserved"===r)this._parseIgnored();else if("extend"===r)this._parseExtend(o);else{if(!e.TYPEREF.test(r))throw Error("illegal message token: "+r);if(!this.proto3)throw Error("illegal field rule: "+r);this._parseMessageField(o,"optional",r)}return this.tn.omit(";"),t.messages.push(o),o},a._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},a._parseMessageField=function(t,i,n){if(!e.RULE.test(i))throw Error("illegal message field rule: "+i);var r,o={rule:i,type:"",name:"",options:{},id:0};if("map"===i){if(n)throw Error("illegal type: "+n);if(this.tn.skip("<"),r=this.tn.next(),!e.TYPE.test(r)&&!e.TYPEREF.test(r))throw Error("illegal message field type: "+r);if(o.keytype=r,this.tn.skip(","),r=this.tn.next(),!e.TYPE.test(r)&&!e.TYPEREF.test(r))throw Error("illegal message field: "+r);if(o.type=r,this.tn.skip(">"),r=this.tn.next(),!e.NAME.test(r))throw Error("illegal message field name: "+r);o.name=r,this.tn.skip("="),o.id=s(this.tn.next()),"["===(r=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}else if("group"===(n=void 0!==n?n:this.tn.next())){var a=this._parseMessage(t,o);if(!/^[A-Z]/.test(a.name))throw Error("illegal group name: "+a.name);o.type=a.name,o.name=a.name.toLowerCase(),this.tn.omit(";")}else{if(!e.TYPE.test(n)&&!e.TYPEREF.test(n))throw Error("illegal message field type: "+n);if(o.type=n,r=this.tn.next(),!e.NAME.test(r))throw Error("illegal message field name: "+r);o.name=r,this.tn.skip("="),o.id=s(this.tn.next()),"["===(r=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}return t.fields.push(o),o},a._parseMessageOneOf=function(t){var i=this.tn.next();if(!e.NAME.test(i))throw Error("illegal oneof name: "+i);var n,r=i,o=[];for(this.tn.skip("{");"}"!==(i=this.tn.next());)(n=this._parseMessageField(t,"optional",i)).oneof=r,o.push(n.id);this.tn.omit(";"),t.oneofs[r]=o},a._parseFieldOptions=function(t){this.tn.skip("[");for(var e=!0;"]"!==this.tn.peek();)e||this.tn.skip(","),this._parseOption(t,!0),e=!1;this.tn.next()},a._parseEnum=function(t){var i={name:"",values:[],options:{}},n=this.tn.next();if(!e.NAME.test(n))throw Error("illegal name: "+n);for(i.name=n,this.tn.skip("{");"}"!==(n=this.tn.next());)if("option"===n)this._parseOption(i);else{if(!e.NAME.test(n))throw Error("illegal name: "+n);this.tn.skip("=");var r={name:n,id:s(this.tn.next(),!0)};"["===(n=this.tn.peek())&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),i.values.push(r)}this.tn.omit(";"),t.enums.push(i)},a._parseExtensionRanges=function(){var e,i,n,r=[];do{for(i=[];;){switch(e=this.tn.next()){case"min":n=t.ID_MIN;break;case"max":n=t.ID_MAX;break;default:n=l(e)}if(i.push(n),2===i.length)break;if("to"!==this.tn.peek()){i.push(n);break}this.tn.next()}r.push(i)}while(this.tn.omit(","));return this.tn.skip(";"),r},a._parseExtend=function(t){var i=this.tn.next();if(!e.TYPEREF.test(i))throw Error("illegal extend reference: "+i);var n={ref:i,fields:[]};for(this.tn.skip("{");"}"!==(i=this.tn.next());)if(e.RULE.test(i))this._parseMessageField(n,i);else{if(!e.TYPEREF.test(i))throw Error("illegal extend token: "+i);if(!this.proto3)throw Error("illegal field rule: "+i);this._parseMessageField(n,"optional",i)}return this.tn.omit(";"),t.messages.push(n),n},a.toString=function(){return"Parser at line "+this.tn.line},i.Parser=o,i}(o,o.Lang),o.Reflect=function(e){var i={},n=function(t,e,i){this.builder=t,this.parent=e,this.name=i,this.className},r=n.prototype;r.fqn=function(){for(var t=this.name,e=this;null!=(e=e.parent);)t=e.name+"."+t;return t},r.toString=function(t){return(t?this.className+" ":"")+this.fqn()},r.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},i.T=n;var o=function(t,e,i,r,o){n.call(this,t,e,i),this.className="Namespace",this.children=[],this.options=r||{},this.syntax=o||"proto2"},a=o.prototype=Object.create(n.prototype);a.getChildren=function(t){if(null==(t=t||null))return this.children.slice();for(var e=[],i=0,n=this.children.length;i<n;++i)this.children[i]instanceof t&&e.push(this.children[i]);return e},a.addChild=function(t){var e;if(e=this.getChild(t.name))if(e instanceof h.Field&&e.name!==e.originalName&&null===this.getChild(e.originalName))e.name=e.originalName;else{if(!(t instanceof h.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName)))throw Error("Duplicate name in namespace "+this.toString(!0)+": "+t.name);t.name=t.originalName}this.children.push(t)},a.getChild=function(t){for(var e="number"==typeof t?"id":"name",i=0,n=this.children.length;i<n;++i)if(this.children[i][e]===t)return this.children[i];return null},a.resolve=function(t,e){var n,r="string"==typeof t?t.split("."):t,o=this,a=0;if(""===r[a]){for(;null!==o.parent;)o=o.parent;a++}do{do{if(!(o instanceof i.Namespace)){o=null;break}if(!(n=o.getChild(r[a]))||!(n instanceof i.T)||e&&!(n instanceof i.Namespace)){o=null;break}o=n,a++}while(a<r.length);if(null!=o)break;if(null!==this.parent)return this.parent.resolve(t,e)}while(null!=o);return o},a.qn=function(t){var e=[],n=t;do{e.unshift(n.name),n=n.parent}while(null!==n);for(var r=1;r<=e.length;r++){var o=e.slice(e.length-r);if(t===this.resolve(o,t instanceof i.Namespace))return o.join(".")}return t.fqn()},a.build=function(){for(var t,e={},i=this.children,n=0,r=i.length;n<r;++n)(t=i[n])instanceof o&&(e[t.name]=t.build());return Object.defineProperty&&Object.defineProperty(e,"$options",{value:this.buildOpt()}),e},a.buildOpt=function(){for(var t={},e=Object.keys(this.options),i=0,n=e.length;i<n;++i){var r=e[i],o=this.options[e[i]];t[r]=o}return t},a.getOption=function(t){return void 0===t?this.options:void 0!==this.options[t]?this.options[t]:null},i.Namespace=o;var s=function(t,i,n,r,o){if(this.type=t,this.resolvedType=i,this.isMapKey=n,this.syntax=r,this.name=o,n&&e.MAP_KEY_TYPES.indexOf(t)<0)throw Error("Invalid map key type: "+t.name)},l=s.prototype;function u(t,i){if(t&&"number"==typeof t.low&&"number"==typeof t.high&&"boolean"==typeof t.unsigned&&t.low==t.low&&t.high==t.high)return new e.Long(t.low,t.high,void 0===i?t.unsigned:i);if("string"==typeof t)return e.Long.fromString(t,i||!1,10);if("number"==typeof t)return e.Long.fromNumber(t,i||!1);throw Error("not convertible to Long")}s.defaultFieldValue=function(i){if("string"==typeof i&&(i=e.TYPES[i]),void 0===i.defaultValue)throw Error("default value for type "+i.name+" is not supported");return i==e.TYPES.bytes?new t(0):i.defaultValue},l.toString=function(){return(this.name||"")+(this.isMapKey?"map":"value")+" element"},l.verifyValue=function(i){var n=this;function r(t,e){throw Error("Illegal value for "+n.toString(!0)+" of type "+n.type.name+": "+t+" ("+e+")")}switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:return("number"!=typeof i||i==i&&i%1!=0)&&r(typeof i,"not an integer"),i>4294967295?0|i:i;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof i||i==i&&i%1!=0)&&r(typeof i,"not an integer"),i<0?i>>>0:i;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return u(i,!1)}catch(t){r(typeof i,t.message)}else r(typeof i,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return u(i,!0)}catch(t){r(typeof i,t.message)}else r(typeof i,"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof i&&r(typeof i,"not a boolean"),i;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof i&&r(typeof i,"not a number"),i;case e.TYPES.string:return"string"==typeof i||i&&i instanceof String||r(typeof i,"not a string"),""+i;case e.TYPES.bytes:return t.isByteBuffer(i)?i:t.wrap(i,"base64");case e.TYPES.enum:var o=this.resolvedType.getChildren(e.Reflect.Enum.Value);for(s=0;s<o.length;s++){if(o[s].name==i)return o[s].id;if(o[s].id==i)return o[s].id}if("proto3"===this.syntax)return("number"!=typeof i||i==i&&i%1!=0)&&r(typeof i,"not an integer"),(i>4294967295||i<0)&&r(typeof i,"not in range for uint32"),i;r(i,"not a valid enum value");case e.TYPES.group:case e.TYPES.message:if(i&&"object"==typeof i||r(typeof i,"object expected"),i instanceof this.resolvedType.clazz)return i;if(i instanceof e.Builder.Message){var a={};for(var s in i)i.hasOwnProperty(s)&&(a[s]=i[s]);i=a}return new this.resolvedType.clazz(i)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+i+" (undefined type "+this.type+")")},l.calculateLength=function(i,n){if(null===n)return 0;var r;switch(this.type){case e.TYPES.int32:return n<0?t.calculateVarint64(n):t.calculateVarint32(n);case e.TYPES.uint32:return t.calculateVarint32(n);case e.TYPES.sint32:return t.calculateVarint32(t.zigZagEncode32(n));case e.TYPES.fixed32:case e.TYPES.sfixed32:case e.TYPES.float:return 4;case e.TYPES.int64:case e.TYPES.uint64:return t.calculateVarint64(n);case e.TYPES.sint64:return t.calculateVarint64(t.zigZagEncode64(n));case e.TYPES.fixed64:case e.TYPES.sfixed64:return 8;case e.TYPES.bool:return 1;case e.TYPES.enum:return t.calculateVarint32(n);case e.TYPES.double:return 8;case e.TYPES.string:return r=t.calculateUTF8Bytes(n),t.calculateVarint32(r)+r;case e.TYPES.bytes:if(n.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+n.remaining()+" bytes remaining");return t.calculateVarint32(n.remaining())+n.remaining();case e.TYPES.message:return r=this.resolvedType.calculate(n),t.calculateVarint32(r)+r;case e.TYPES.group:return(r=this.resolvedType.calculate(n))+t.calculateVarint32(i<<3|e.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+n+" (unknown type)")},l.encodeValue=function(i,n,r){if(null===n)return r;switch(this.type){case e.TYPES.int32:n<0?r.writeVarint64(n):r.writeVarint32(n);break;case e.TYPES.uint32:r.writeVarint32(n);break;case e.TYPES.sint32:r.writeVarint32ZigZag(n);break;case e.TYPES.fixed32:r.writeUint32(n);break;case e.TYPES.sfixed32:r.writeInt32(n);break;case e.TYPES.int64:case e.TYPES.uint64:r.writeVarint64(n);break;case e.TYPES.sint64:r.writeVarint64ZigZag(n);break;case e.TYPES.fixed64:r.writeUint64(n);break;case e.TYPES.sfixed64:r.writeInt64(n);break;case e.TYPES.bool:"string"==typeof n?r.writeVarint32("false"===n.toLowerCase()?0:!!n):r.writeVarint32(n?1:0);break;case e.TYPES.enum:r.writeVarint32(n);break;case e.TYPES.float:r.writeFloat32(n);break;case e.TYPES.double:r.writeFloat64(n);break;case e.TYPES.string:r.writeVString(n);break;case e.TYPES.bytes:if(n.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+n.remaining()+" bytes remaining");var o=n.offset;r.writeVarint32(n.remaining()),r.append(n),n.offset=o;break;case e.TYPES.message:var a=(new t).LE();this.resolvedType.encode(n,a),r.writeVarint32(a.offset),r.append(a.flip());break;case e.TYPES.group:this.resolvedType.encode(n,r),r.writeVarint32(i<<3|e.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+n+" (unknown type)")}return r},l.decode=function(t,i,n){if(i!=this.type.wireType)throw Error("Unexpected wire type for element");var r,o;switch(this.type){case e.TYPES.int32:return 0|t.readVarint32();case e.TYPES.uint32:return t.readVarint32()>>>0;case e.TYPES.sint32:return 0|t.readVarint32ZigZag();case e.TYPES.fixed32:return t.readUint32()>>>0;case e.TYPES.sfixed32:return 0|t.readInt32();case e.TYPES.int64:return t.readVarint64();case e.TYPES.uint64:return t.readVarint64().toUnsigned();case e.TYPES.sint64:return t.readVarint64ZigZag();case e.TYPES.fixed64:return t.readUint64();case e.TYPES.sfixed64:return t.readInt64();case e.TYPES.bool:return!!t.readVarint32();case e.TYPES.enum:return t.readVarint32();case e.TYPES.float:return t.readFloat();case e.TYPES.double:return t.readDouble();case e.TYPES.string:return t.readVString();case e.TYPES.bytes:if(o=t.readVarint32(),t.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+t.remaining());return(r=t.clone()).limit=r.offset+o,t.offset+=o,r;case e.TYPES.message:return o=t.readVarint32(),this.resolvedType.decode(t,o);case e.TYPES.group:return this.resolvedType.decode(t,-1,n)}throw Error("[INTERNAL] Illegal decode type")},l.valueFromString=function(i){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return this.verifyValue(parseInt(i));case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return this.verifyValue(i);case e.TYPES.bool:return"true"===i;case e.TYPES.string:return this.verifyValue(i);case e.TYPES.bytes:return t.fromBinary(i)}},l.valueToString=function(t){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===e.TYPES.bytes?t.toString("binary"):t.toString()},i.Element=s;var h=function(t,e,i,n,r,a){o.call(this,t,e,i,n,a),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!r,this._fields=null,this._fieldsById=null,this._fieldsByName=null},c=h.prototype=Object.create(o.prototype);function d(t,i){var n=i.readVarint32(),r=7&n,o=n>>>3;switch(r){case e.WIRE_TYPES.VARINT:do{n=i.readUint8()}while(128==(128&n));break;case e.WIRE_TYPES.BITS64:i.offset+=8;break;case e.WIRE_TYPES.LDELIM:n=i.readVarint32(),i.offset+=n;break;case e.WIRE_TYPES.STARTGROUP:d(o,i);break;case e.WIRE_TYPES.ENDGROUP:if(o===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+o+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:i.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+r)}return!0}c.build=function(i){if(this.clazz&&!i)return this.clazz;var n=function(e,i){var n=i.getChildren(e.Reflect.Message.Field),r=i.getChildren(e.Reflect.Message.OneOf),o=function(a,s){e.Builder.Message.call(this);for(var l=0,u=r.length;l<u;++l)this[r[l].name]=null;for(l=0,u=n.length;l<u;++l){var h=n[l];this[h.name]=h.repeated?[]:h.map?new e.Map(h):null,!h.required&&"proto3"!==i.syntax||null===h.defaultValue||(this[h.name]=h.defaultValue)}var c;if(arguments.length>0)if(1!==arguments.length||null===a||"object"!=typeof a||!("function"!=typeof a.encode||a instanceof o)||Array.isArray(a)||a instanceof e.Map||t.isByteBuffer(a)||a instanceof ArrayBuffer||e.Long&&a instanceof e.Long)for(l=0,u=arguments.length;l<u;++l)void 0!==(c=arguments[l])&&this.$set(n[l].name,c);else this.$set(a)},a=o.prototype=Object.create(e.Builder.Message.prototype);a.add=function(t,n,r){var o=i._fieldsByName[t];if(!r){if(!o)throw Error(this+"#"+t+" is undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+o.toString(!0));if(!o.repeated)throw Error(this+"#"+t+" is not a repeated field");n=o.verifyValue(n,!0)}return null===this[t]&&(this[t]=[]),this[t].push(n),this},a.$add=a.add,a.set=function(t,n,r){if(t&&"object"==typeof t){for(var o in r=n,t)t.hasOwnProperty(o)&&void 0!==(n=t[o])&&void 0===i._oneofsByName[o]&&this.$set(o,n,r);return this}var a=i._fieldsByName[t];if(r)this[t]=n;else{if(!a)throw Error(this+"#"+t+" is not a field: undefined");if(!(a instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+a.toString(!0));this[a.name]=n=a.verifyValue(n)}if(a&&a.oneof){var s=this[a.oneof.name];null!==n?(null!==s&&s!==a.name&&(this[s]=null),this[a.oneof.name]=a.name):s===t&&(this[a.oneof.name]=null)}return this},a.$set=a.set,a.get=function(t,n){if(n)return this[t];var r=i._fieldsByName[t];if(!(r&&r instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: undefined");if(!(r instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+r.toString(!0));return this[r.name]},a.$get=a.get;for(var s=0;s<n.length;s++){var l=n[s];l instanceof e.Reflect.Message.ExtensionField||i.builder.options.populateAccessors&&function(t){var e=t.originalName.replace(/(_[a-zA-Z])/g,(function(t){return t.toUpperCase().replace("_","")}));e=e.substring(0,1).toUpperCase()+e.substring(1);var n=t.originalName.replace(/([A-Z])/g,(function(t){return"_"+t})),r=function(e,i){return this[t.name]=i?e:t.verifyValue(e),this},o=function(){return this[t.name]};null===i.getChild("set"+e)&&(a["set"+e]=r),null===i.getChild("set_"+n)&&(a["set_"+n]=r),null===i.getChild("get"+e)&&(a["get"+e]=o),null===i.getChild("get_"+n)&&(a["get_"+n]=o)}(l)}function u(i,n,r,o){if(null===i||"object"!=typeof i){if(o&&o instanceof e.Reflect.Enum){var a=e.Reflect.Enum.getName(o.object,i);if(null!==a)return a}return i}if(t.isByteBuffer(i))return n?i.toBase64():i.toBuffer();if(e.Long.isLong(i))return r?i.toString():e.Long.fromValue(i);var s;if(Array.isArray(i))return s=[],i.forEach((function(t,e){s[e]=u(t,n,r,o)})),s;if(s={},i instanceof e.Map){for(var l=i.entries(),h=l.next();!h.done;h=l.next())s[i.keyElem.valueToString(h.value[0])]=u(h.value[1],n,r,i.valueElem.resolvedType);return s}var c=i.$type,d=void 0;for(var p in i)i.hasOwnProperty(p)&&(c&&(d=c.getChild(p))?s[p]=u(i[p],n,r,d.resolvedType):s[p]=u(i[p],n,r));return s}return a.encode=function(e,n){"boolean"==typeof e&&(n=e,e=void 0);var r=!1;e||(e=new t,r=!0);var o=e.littleEndian;try{return i.encode(this,e.LE(),n),(r?e.flip():e).LE(o)}catch(t){throw e.LE(o),t}},o.encode=function(t,e,i){return new o(t).encode(e,i)},a.calculate=function(){return i.calculate(this)},a.encodeDelimited=function(e,n){var r=!1;e||(e=new t,r=!0);var o=(new t).LE();return i.encode(this,o,n).flip(),e.writeVarint32(o.remaining()),e.append(o),r?e.flip():e},a.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(t){throw t.encoded&&(t.encoded=t.encoded.toArrayBuffer()),t}},a.toArrayBuffer=a.encodeAB,a.encodeNB=function(){try{return this.encode().toBuffer()}catch(t){throw t.encoded&&(t.encoded=t.encoded.toBuffer()),t}},a.toBuffer=a.encodeNB,a.encode64=function(){try{return this.encode().toBase64()}catch(t){throw t.encoded&&(t.encoded=t.encoded.toBase64()),t}},a.toBase64=a.encode64,a.encodeHex=function(){try{return this.encode().toHex()}catch(t){throw t.encoded&&(t.encoded=t.encoded.toHex()),t}},a.toHex=a.encodeHex,a.toRaw=function(t,e){return u(this,!!t,!!e,this.$type)},a.encodeJSON=function(){return JSON.stringify(u(this,!0,!0,this.$type))},o.decode=function(e,n,r){"string"==typeof n&&(r=n,n=-1),"string"==typeof e?e=t.wrap(e,r||"base64"):t.isByteBuffer(e)||(e=t.wrap(e));var o=e.littleEndian;try{var a=i.decode(e.LE(),n);return e.LE(o),a}catch(t){throw e.LE(o),t}},o.decodeDelimited=function(e,n){if("string"==typeof e?e=t.wrap(e,n||"base64"):t.isByteBuffer(e)||(e=t.wrap(e)),e.remaining()<1)return null;var r=e.offset,o=e.readVarint32();if(e.remaining()<o)return e.offset=r,null;try{var a=i.decode(e.slice(e.offset,e.offset+o).LE());return e.offset+=o,a}catch(t){throw e.offset+=o,t}},o.decode64=function(t){return o.decode(t,"base64")},o.decodeHex=function(t){return o.decode(t,"hex")},o.decodeJSON=function(t){return new o(JSON.parse(t))},a.toString=function(){return i.toString()},Object.defineProperty&&(Object.defineProperty(o,"$options",{value:i.buildOpt()}),Object.defineProperty(a,"$options",{value:o.$options}),Object.defineProperty(o,"$type",{value:i}),Object.defineProperty(a,"$type",{value:i})),o}(e,this);this._fields=[],this._fieldsById={},this._fieldsByName={},this._oneofsByName={};for(var r,o=0,a=this.children.length;o<a;o++)if((r=this.children[o])instanceof g||r instanceof h||r instanceof b){if(n.hasOwnProperty(r.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+r.toString(!0)+" cannot override static property '"+r.name+"'");n[r.name]=r.build()}else if(r instanceof h.Field)r.build(),this._fields.push(r),this._fieldsById[r.id]=r,this._fieldsByName[r.name]=r;else if(r instanceof h.OneOf)this._oneofsByName[r.name]=r;else if(!(r instanceof h.OneOf||r instanceof y))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[o].toString(!0));return this.clazz=n},c.encode=function(t,e,i){for(var n,r,o=null,a=0,s=this._fields.length;a<s;++a)r=t[(n=this._fields[a]).name],n.required&&null===r?null===o&&(o=n):n.encode(i?r:n.verifyValue(r),e,t);if(null!==o){var l=Error("Missing at least one required field for "+this.toString(!0)+": "+o);throw l.encoded=e,l}return e},c.calculate=function(t){for(var e,i,n=0,r=0,o=this._fields.length;r<o;++r){if(i=t[(e=this._fields[r]).name],e.required&&null===i)throw Error("Missing at least one required field for "+this.toString(!0)+": "+e);n+=e.calculate(i,t)}return n},c.decode=function(t,i,n){"number"!=typeof i&&(i=-1);for(var r,o,a,s,l=t.offset,u=new this.clazz;t.offset<l+i||-1===i&&t.remaining()>0;){if(a=(r=t.readVarint32())>>>3,(o=7&r)===e.WIRE_TYPES.ENDGROUP){if(a!==n)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+a+" ("+(n?n+" expected":"not a group")+")");break}if(s=this._fieldsById[a]){if(s.repeated&&!s.options.packed)u[s.name].push(s.decode(o,t));else if(s.map){var h=s.decode(o,t);u[s.name].set(h[0],h[1])}else if(u[s.name]=s.decode(o,t),s.oneof){var c=u[s.oneof.name];null!==c&&c!==s.name&&(u[c]=null),u[s.oneof.name]=s.name}}else switch(o){case e.WIRE_TYPES.VARINT:t.readVarint32();break;case e.WIRE_TYPES.BITS32:t.offset+=4;break;case e.WIRE_TYPES.BITS64:t.offset+=8;break;case e.WIRE_TYPES.LDELIM:var p=t.readVarint32();t.offset+=p;break;case e.WIRE_TYPES.STARTGROUP:for(;d(a,t););break;default:throw Error("Illegal wire type for unknown field "+a+" in "+this.toString(!0)+"#decode: "+o)}}for(var f=0,m=this._fields.length;f<m;++f)if(null===u[(s=this._fields[f]).name])if("proto3"===this.syntax)u[s.name]=s.defaultValue;else{if(s.required){var g=Error("Missing at least one required field for "+this.toString(!0)+": "+s.name);throw g.decoded=u,g}e.populateDefaults&&null!==s.defaultValue&&(u[s.name]=s.defaultValue)}return u},i.Message=h;var p=function(t,i,r,o,a,s,l,u,c,d){n.call(this,t,i,s),this.className="Message.Field",this.required="required"===r,this.repeated="repeated"===r,this.map="map"===r,this.keyType=o||null,this.type=a,this.resolvedType=null,this.id=l,this.options=u||{},this.defaultValue=null,this.oneof=c||null,this.syntax=d||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof h.ExtensionField||(this.name=e.Util.toCamelCase(this.name))},f=p.prototype=Object.create(n.prototype);f.build=function(){this.element=new s(this.type,this.resolvedType,!1,this.syntax,this.name),this.map&&(this.keyElement=new s(this.keyType,void 0,!0,this.syntax,this.name)),"proto3"!==this.syntax||this.repeated||this.map?void 0!==this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=s.defaultFieldValue(this.type)},f.verifyValue=function(t,i){i=i||!1;var n,r=this;function o(t,e){throw Error("Illegal value for "+r.toString(!0)+" of type "+r.type.name+": "+t+" ("+e+")")}if(null===t)return this.required&&o(typeof t,"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&o(typeof t,"proto3 field without field presence cannot be null"),null;if(this.repeated&&!i){Array.isArray(t)||(t=[t]);var a=[];for(n=0;n<t.length;n++)a.push(this.element.verifyValue(t[n]));return a}return this.map&&!i?t instanceof e.Map?t:(t instanceof Object||o(typeof t,"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&o(typeof t,"no array expected"),this.element.verifyValue(t))},f.hasWirePresence=function(t,i){if("proto3"!==this.syntax)return null!==t;if(this.oneof&&i[this.oneof.name]===this.name)return!0;switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return 0!==t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return 0!==t.low||0!==t.high;case e.TYPES.bool:return t;case e.TYPES.float:case e.TYPES.double:return 0!==t;case e.TYPES.string:return t.length>0;case e.TYPES.bytes:return t.remaining()>0;case e.TYPES.enum:return 0!==t;case e.TYPES.message:return null!==t;default:return!0}},f.encode=function(i,n,r){if(null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===i||this.repeated&&0==i.length)return n;try{var o;if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){n.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),n.ensureCapacity(n.offset+=1);var a=n.offset;for(o=0;o<i.length;o++)this.element.encodeValue(this.id,i[o],n);var s=n.offset-a,l=t.calculateVarint32(s);if(l>1){var u=n.slice(a,n.offset);a+=l-1,n.offset=a,n.append(u)}n.writeVarint32(s,a-l)}else for(o=0;o<i.length;o++)n.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,i[o],n);else this.map?i.forEach((function(i,r,o){var a=t.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,r)+t.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,i);n.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),n.writeVarint32(a),n.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,r,n),n.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,i,n)}),this):this.hasWirePresence(i,r)&&(n.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,i,n))}catch(t){throw Error("Illegal value for "+this.toString(!0)+": "+i+" ("+t+")")}return n},f.calculate=function(i,n){if(i=this.verifyValue(i),null===this.type||"object"!=typeof this.type)throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===i||this.repeated&&0==i.length)return 0;var r=0;try{var o,a;if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(r+=t.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),a=0,o=0;o<i.length;o++)a+=this.element.calculateLength(this.id,i[o]);r+=t.calculateVarint32(a),r+=a}else for(o=0;o<i.length;o++)r+=t.calculateVarint32(this.id<<3|this.type.wireType),r+=this.element.calculateLength(this.id,i[o]);else this.map?i.forEach((function(i,n,o){var a=t.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,n)+t.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,i);r+=t.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),r+=t.calculateVarint32(a),r+=a}),this):this.hasWirePresence(i,n)&&(r+=t.calculateVarint32(this.id<<3|this.type.wireType),r+=this.element.calculateLength(this.id,i))}catch(t){throw Error("Illegal value for "+this.toString(!0)+": "+i+" ("+t+")")}return r},f.decode=function(t,i,n){var r,o;if(!(!this.map&&t==this.type.wireType||!n&&this.repeated&&this.options.packed&&t==e.WIRE_TYPES.LDELIM||this.map&&t==e.WIRE_TYPES.LDELIM))throw Error("Illegal wire type for field "+this.toString(!0)+": "+t+" ("+this.type.wireType+" expected)");if(t==e.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!n){o=i.readVarint32(),o=i.offset+o;for(var a=[];i.offset<o;)a.push(this.decode(this.type.wireType,i,!0));return a}if(this.map){var l=s.defaultFieldValue(this.keyType);if(r=s.defaultFieldValue(this.type),o=i.readVarint32(),i.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+i.remaining());var u=i.clone();for(u.limit=u.offset+o,i.offset+=o;u.remaining()>0;){var h=u.readVarint32();t=7&h;var c=h>>>3;if(1===c)l=this.keyElement.decode(u,t,c);else{if(2!==c)throw Error("Unexpected tag in map field key/value submessage");r=this.element.decode(u,t,c)}}return[l,r]}return this.element.decode(i,t,this.id)},i.Message.Field=p;var m=function(t,e,i,n,r,o,a){p.call(this,t,e,i,null,n,r,o,a),this.extension};m.prototype=Object.create(p.prototype),i.Message.ExtensionField=m,i.Message.OneOf=function(t,e,i){n.call(this,t,e,i),this.fields=[]};var g=function(t,e,i,n,r){o.call(this,t,e,i,n,r),this.className="Enum",this.object=null};g.getName=function(t,e){for(var i,n=Object.keys(t),r=0;r<n.length;++r)if(t[i=n[r]]===e)return i;return null},(g.prototype=Object.create(o.prototype)).build=function(t){if(this.object&&!t)return this.object;for(var i=new e.Builder.Enum,n=this.getChildren(g.Value),r=0,o=n.length;r<o;++r)i[n[r].name]=n[r].id;return Object.defineProperty&&Object.defineProperty(i,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=i},i.Enum=g;var v=function(t,e,i,r){n.call(this,t,e,i),this.className="Enum.Value",this.id=r};v.prototype=Object.create(n.prototype),i.Enum.Value=v;var y=function(t,e,i,r){n.call(this,t,e,i),this.field=r};y.prototype=Object.create(n.prototype),i.Extension=y;var b=function(t,e,i,n){o.call(this,t,e,i,n),this.className="Service",this.clazz=null};(b.prototype=Object.create(o.prototype)).build=function(i){return this.clazz&&!i?this.clazz:this.clazz=function(e,i){for(var n=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(t,e,i){setTimeout(i.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},r=n.prototype=Object.create(e.Builder.Service.prototype),o=i.getChildren(e.Reflect.Service.RPCMethod),a=0;a<o.length;a++)!function(e){r[e.name]=function(n,r){try{try{n=e.resolvedRequestType.clazz.decode(t.wrap(n))}catch(t){if(!(t instanceof TypeError))throw t}if(null===n||"object"!=typeof n)throw Error("Illegal arguments");n instanceof e.resolvedRequestType.clazz||(n=new e.resolvedRequestType.clazz(n)),this.rpcImpl(e.fqn(),n,(function(t,n){if(t)r(t);else{null===n&&(n="");try{n=e.resolvedResponseType.clazz.decode(n)}catch(t){}n&&n instanceof e.resolvedResponseType.clazz?r(null,n):r(Error("Illegal response type received in service method "+i.name+"#"+e.name))}}))}catch(t){setTimeout(r.bind(this,t),0)}},n[e.name]=function(t,i,r){new n(t)[e.name](i,r)},Object.defineProperty&&(Object.defineProperty(n[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(r[e.name],"$options",{value:n[e.name].$options}))}(o[a]);return Object.defineProperty&&(Object.defineProperty(n,"$options",{value:i.buildOpt()}),Object.defineProperty(r,"$options",{value:n.$options}),Object.defineProperty(n,"$type",{value:i}),Object.defineProperty(r,"$type",{value:i})),n}(e,this)},i.Service=b;var w=function(t,e,i,r){n.call(this,t,e,i),this.className="Service.Method",this.options=r||{}};(w.prototype=Object.create(n.prototype)).buildOpt=a.buildOpt,i.Service.Method=w;var x=function(t,e,i,n,r,o,a,s){w.call(this,t,e,i,s),this.className="Service.RPCMethod",this.requestName=n,this.responseName=r,this.requestStream=o,this.responseStream=a,this.resolvedRequestType=null,this.resolvedResponseType=null};return x.prototype=Object.create(w.prototype),i.Service.RPCMethod=x,i}(o),o.Builder=function(t,e,n){var r=function(t){this.ns=new n.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=t||{}},o=r.prototype;return r.isMessage=function(t){return"string"==typeof t.name&&void 0===t.values&&void 0===t.rpc},r.isMessageField=function(t){return"string"==typeof t.rule&&"string"==typeof t.name&&"string"==typeof t.type&&void 0!==t.id},r.isEnum=function(t){return"string"==typeof t.name&&!(void 0===t.values||!Array.isArray(t.values)||0===t.values.length)},r.isService=function(t){return!("string"!=typeof t.name||"object"!=typeof t.rpc||!t.rpc)},r.isExtend=function(t){return"string"==typeof t.ref},o.reset=function(){return this.ptr=this.ns,this},o.define=function(t){if("string"!=typeof t||!e.TYPEREF.test(t))throw Error("illegal namespace: "+t);return t.split(".").forEach((function(t){var e=this.ptr.getChild(t);null===e&&this.ptr.addChild(e=new n.Namespace(this,this.ptr,t)),this.ptr=e}),this),this},o.create=function(e){if(!e)return this;if(Array.isArray(e)){if(0===e.length)return this;e=e.slice()}else e=[e];for(var i=[e];i.length>0;){if(e=i.pop(),!Array.isArray(e))throw Error("not a valid namespace: "+JSON.stringify(e));for(;e.length>0;){var o=e.shift();if(r.isMessage(o)){var a=new n.Message(this,this.ptr,o.name,o.options,o.isGroup,o.syntax),s={};o.oneofs&&Object.keys(o.oneofs).forEach((function(t){a.addChild(s[t]=new n.Message.OneOf(this,a,t))}),this),o.fields&&o.fields.forEach((function(t){if(null!==a.getChild(0|t.id))throw Error("duplicate or invalid field id in "+a.name+": "+t.id);if(t.options&&"object"!=typeof t.options)throw Error("illegal field options in "+a.name+"#"+t.name);var e=null;if("string"==typeof t.oneof&&!(e=s[t.oneof]))throw Error("illegal oneof in "+a.name+"#"+t.name+": "+t.oneof);t=new n.Message.Field(this,a,t.rule,t.keytype,t.type,t.name,t.id,t.options,e,o.syntax),e&&e.fields.push(t),a.addChild(t)}),this);var l=[];if(o.enums&&o.enums.forEach((function(t){l.push(t)})),o.messages&&o.messages.forEach((function(t){l.push(t)})),o.services&&o.services.forEach((function(t){l.push(t)})),o.extensions&&("number"==typeof o.extensions[0]?a.extensions=[o.extensions]:a.extensions=o.extensions),this.ptr.addChild(a),l.length>0){i.push(e),e=l,l=null,this.ptr=a,a=null;continue}l=null}else if(r.isEnum(o))a=new n.Enum(this,this.ptr,o.name,o.options,o.syntax),o.values.forEach((function(t){a.addChild(new n.Enum.Value(this,a,t.name,t.id))}),this),this.ptr.addChild(a);else if(r.isService(o))a=new n.Service(this,this.ptr,o.name,o.options),Object.keys(o.rpc).forEach((function(t){var e=o.rpc[t];a.addChild(new n.Service.RPCMethod(this,a,t,e.request,e.response,!!e.request_stream,!!e.response_stream,e.options))}),this),this.ptr.addChild(a);else{if(!r.isExtend(o))throw Error("not a valid definition: "+JSON.stringify(o));if(a=this.ptr.resolve(o.ref,!0))o.fields.forEach((function(e){if(null!==a.getChild(0|e.id))throw Error("duplicate extended field id in "+a.name+": "+e.id);if(a.extensions){var i=!1;if(a.extensions.forEach((function(t){e.id>=t[0]&&e.id<=t[1]&&(i=!0)})),!i)throw Error("illegal extended field id in "+a.name+": "+e.id+" (not within valid ranges)")}var r=e.name;this.options.convertFieldsToCamelCase&&(r=t.Util.toCamelCase(r));var o=new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn()+"."+r,e.id,e.options),s=new n.Extension(this,this.ptr,e.name,o);o.extension=s,this.ptr.addChild(s),a.addChild(o)}),this);else if(!/\.?google\.protobuf\./.test(o.ref))throw Error("extended message "+o.ref+" is not defined")}o=null,a=null}e=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},o.import=function(e,n){var r="/";if("string"==typeof n){if(t.Util.IS_NODE&&(n=i(34).resolve(n)),!0===this.files[n])return this.reset();this.files[n]=!0}else if("object"==typeof n){var o,a=n.root;if(t.Util.IS_NODE&&(a=i(34).resolve(a)),(a.indexOf("\\")>=0||n.file.indexOf("\\")>=0)&&(r="\\"),o=t.Util.IS_NODE?i(34).join(a,n.file):a+r+n.file,!0===this.files[o])return this.reset();this.files[o]=!0}if(e.imports&&e.imports.length>0){var s,l=!1;"object"==typeof n?(this.importRoot=n.root,l=!0,s=this.importRoot,n=n.file,(s.indexOf("\\")>=0||n.indexOf("\\")>=0)&&(r="\\")):"string"==typeof n?this.importRoot?s=this.importRoot:n.indexOf("/")>=0?""===(s=n.replace(/\/[^\/]*$/,""))&&(s="/"):n.indexOf("\\")>=0?(s=n.replace(/\\[^\\]*$/,""),r="\\"):s=".":s=null;for(var u=0;u<e.imports.length;u++)if("string"==typeof e.imports[u]){if(!s)throw Error("cannot determine import root");var h=e.imports[u];if("google/protobuf/descriptor.proto"===h)continue;if(h=t.Util.IS_NODE?i(34).join(s,h):s+r+h,!0===this.files[h])continue;/\.proto$/i.test(h)&&!t.DotProto&&(h=h.replace(/\.proto$/,".json"));var c=t.Util.fetch(h);if(null===c)throw Error("failed to import '"+h+"' in '"+n+"': file not found");/\.json$/i.test(h)?this.import(JSON.parse(c+""),h):this.import(t.DotProto.Parser.parse(c),h)}else n?/\.(\w+)$/.test(n)?this.import(e.imports[u],n.replace(/^(.+)\.(\w+)$/,(function(t,e,i){return e+"_import"+u+"."+i}))):this.import(e.imports[u],n+"_import"+u):this.import(e.imports[u]);l&&(this.importRoot=null)}e.package&&this.define(e.package),e.syntax&&function t(e){e.messages&&e.messages.forEach((function(i){i.syntax=e.syntax,t(i)})),e.enums&&e.enums.forEach((function(t){t.syntax=e.syntax}))}(e);var d=this.ptr;return e.options&&Object.keys(e.options).forEach((function(t){d.options[t]=e.options[t]})),e.messages&&(this.create(e.messages),this.ptr=d),e.enums&&(this.create(e.enums),this.ptr=d),e.services&&(this.create(e.services),this.ptr=d),e.extends&&this.create(e.extends),this.reset()},o.resolveAll=function(){var i;if(null==this.ptr||"object"==typeof this.ptr.type)return this;if(this.ptr instanceof n.Namespace)this.ptr.children.forEach((function(t){this.ptr=t,this.resolveAll()}),this);else if(this.ptr instanceof n.Message.Field){if(e.TYPE.test(this.ptr.type))this.ptr.type=t.TYPES[this.ptr.type];else{if(!e.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(!(i=(this.ptr instanceof n.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0)))throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=i,i instanceof n.Enum){if(this.ptr.type=t.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==i.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(i instanceof n.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=i.isGroup?t.TYPES.group:t.TYPES.message}}if(this.ptr.map){if(!e.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=t.TYPES[this.ptr.keyType]}"proto3"===this.ptr.syntax&&this.ptr.repeated&&void 0===this.ptr.options.packed&&-1!==t.PACKABLE_WIRE_TYPES.indexOf(this.ptr.type.wireType)&&(this.ptr.options.packed=!0)}else if(this.ptr instanceof t.Reflect.Service.Method){if(!(this.ptr instanceof t.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(!((i=this.ptr.parent.resolve(this.ptr.requestName,!0))&&i instanceof t.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=i,!((i=this.ptr.parent.resolve(this.ptr.responseName,!0))&&i instanceof t.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=i}else if(!(this.ptr instanceof t.Reflect.Message.OneOf||this.ptr instanceof t.Reflect.Extension||this.ptr instanceof t.Reflect.Enum.Value))throw Error("illegal object in namespace: "+typeof this.ptr+": "+this.ptr);return this.reset()},o.build=function(t){if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!t)return this.result;for(var e="string"==typeof t?t.split("."):t,i=this.result,n=0;n<e.length;n++){if(!i[e[n]]){i=null;break}i=i[e[n]]}return i},o.lookup=function(t,e){return t?this.ns.resolve(t,e):this.ns},o.toString=function(){return"Builder"},r.Message=function(){},r.Enum=function(){},r.Service=function(){},r}(o,o.Lang,o.Reflect),o.Map=function(t,e){var i=function(t,i){if(!t.map)throw Error("field is not a map");if(this.field=t,this.keyElem=new e.Element(t.keyType,null,!0,t.syntax),this.valueElem=new e.Element(t.type,t.resolvedType,!1,t.syntax),this.map={},Object.defineProperty(this,"size",{get:function(){return Object.keys(this.map).length}}),i)for(var n=Object.keys(i),r=0;r<n.length;r++){var o=this.keyElem.valueFromString(n[r]),a=this.valueElem.verifyValue(i[n[r]]);this.map[this.keyElem.valueToString(o)]={key:o,value:a}}},n=i.prototype;function r(t){var e=0;return{next:function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}}}}return n.clear=function(){this.map={}},n.delete=function(t){var e=this.keyElem.valueToString(this.keyElem.verifyValue(t)),i=e in this.map;return delete this.map[e],i},n.entries=function(){for(var t,e=[],i=Object.keys(this.map),n=0;n<i.length;n++)e.push([(t=this.map[i[n]]).key,t.value]);return r(e)},n.keys=function(){for(var t=[],e=Object.keys(this.map),i=0;i<e.length;i++)t.push(this.map[e[i]].key);return r(t)},n.values=function(){for(var t=[],e=Object.keys(this.map),i=0;i<e.length;i++)t.push(this.map[e[i]].value);return r(t)},n.forEach=function(t,e){for(var i,n=Object.keys(this.map),r=0;r<n.length;r++)t.call(e,(i=this.map[n[r]]).value,i.key,this)},n.set=function(t,e){var i=this.keyElem.verifyValue(t),n=this.valueElem.verifyValue(e);return this.map[this.keyElem.valueToString(i)]={key:i,value:n},this},n.get=function(t){var e=this.keyElem.valueToString(this.keyElem.verifyValue(t));if(e in this.map)return this.map[e].value},n.has=function(t){return this.keyElem.valueToString(this.keyElem.verifyValue(t))in this.map},i}(0,o.Reflect),o.loadProto=function(t,e,i){return("string"==typeof e||e&&"string"==typeof e.file&&"string"==typeof e.root)&&(i=e,e=void 0),o.loadJson(o.DotProto.Parser.parse(t),e,i)},o.protoFromString=o.loadProto,o.loadProtoFile=function(t,e,i){if(e&&"object"==typeof e?(i=e,e=null):e&&"function"==typeof e||(e=null),e)return o.Util.fetch("string"==typeof t?t:t.root+"/"+t.file,(function(n){if(null!==n)try{e(null,o.loadProto(n,i,t))}catch(t){e(t)}else e(Error("Failed to fetch file"))}));var n=o.Util.fetch("object"==typeof t?t.root+"/"+t.file:t);return null===n?null:o.loadProto(n,i,t)},o.protoFromFile=o.loadProtoFile,o.newBuilder=function(t){return void 0===(t=t||{}).convertFieldsToCamelCase&&(t.convertFieldsToCamelCase=o.convertFieldsToCamelCase),void 0===t.populateAccessors&&(t.populateAccessors=o.populateAccessors),new o.Builder(t)},o.loadJson=function(t,e,i){return("string"==typeof e||e&&"string"==typeof e.file&&"string"==typeof e.root)&&(i=e,e=null),e&&"object"==typeof e||(e=o.newBuilder()),"string"==typeof t&&(t=JSON.parse(t)),e.import(t,i),e.resolveAll(),e},o.loadJsonFile=function(t,e,i){if(e&&"object"==typeof e?(i=e,e=null):e&&"function"==typeof e||(e=null),e)return o.Util.fetch("string"==typeof t?t:t.root+"/"+t.file,(function(n){if(null!==n)try{e(null,o.loadJson(JSON.parse(n),i,t))}catch(t){e(t)}else e(Error("Failed to fetch file"))}));var n=o.Util.fetch("object"==typeof t?t.root+"/"+t.file:t);return null===n?null:o.loadJson(JSON.parse(n),i,t)},o})?r.apply(e,o):r)||(t.exports=a)}).call(this,i(50))},function(t,e,i){"use strict";(function(t){var n=i(172),r=i(173),o=i(174);function a(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=l.prototype:(null===t&&(t=new l(e)),t.length=e),t}function l(t,e,i){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(t,e,i);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return u(this,t,e,i)}function u(t,e,i,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,i,n){if(e.byteLength,i<0||e.byteLength<i)throw new RangeError("'offset' is out of bounds");if(e.byteLength<i+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===i&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,i):new Uint8Array(e,i,n);l.TYPED_ARRAY_SUPPORT?(t=e).__proto__=l.prototype:t=d(t,e);return t}(t,e,i,n):"string"==typeof e?function(t,e,i){"string"==typeof i&&""!==i||(i="utf8");if(!l.isEncoding(i))throw new TypeError('"encoding" must be a valid string encoding');var n=0|f(e,i),r=(t=s(t,n)).write(e,i);r!==n&&(t=t.slice(0,r));return t}(t,e,i):function(t,e){if(l.isBuffer(e)){var i=0|p(e.length);return 0===(t=s(t,i)).length||e.copy(t,0,0,i),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?s(t,0):d(t,e);if("Buffer"===e.type&&o(e.data))return d(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function c(t,e){if(h(e),t=s(t,e<0?0:0|p(e)),!l.TYPED_ARRAY_SUPPORT)for(var i=0;i<e;++i)t[i]=0;return t}function d(t,e){var i=e.length<0?0:0|p(e.length);t=s(t,i);for(var n=0;n<i;n+=1)t[n]=255&e[n];return t}function p(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function f(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var i=t.length;if(0===i)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return V(t).length;default:if(n)return U(t).length;e=(""+e).toLowerCase(),n=!0}}function m(t,e,i){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return E(this,e,i);case"utf8":case"utf-8":return A(this,e,i);case"ascii":return P(this,e,i);case"latin1":case"binary":return C(this,e,i);case"base64":return _(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,e,i);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function v(t,e,i,n,r){if(0===t.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=r?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(r)return-1;i=t.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof e&&(e=l.from(e,n)),l.isBuffer(e))return 0===e.length?-1:y(t,e,i,n,r);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):y(t,[e],i,n,r);throw new TypeError("val must be string, number or Buffer")}function y(t,e,i,n,r){var o,a=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,l/=2,i/=2}function u(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(r){var h=-1;for(o=i;o<s;o++)if(u(t,o)===u(e,-1===h?0:o-h)){if(-1===h&&(h=o),o-h+1===l)return h*a}else-1!==h&&(o-=o-h),h=-1}else for(i+l>s&&(i=s-l),o=i;o>=0;o--){for(var c=!0,d=0;d<l;d++)if(u(t,o+d)!==u(e,d)){c=!1;break}if(c)return o}return-1}function b(t,e,i,n){i=Number(i)||0;var r=t.length-i;n?(n=Number(n))>r&&(n=r):n=r;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))return a;t[i+a]=s}return a}function w(t,e,i,n){return j(U(e,t.length-i),t,i,n)}function x(t,e,i,n){return j(function(t){for(var e=[],i=0;i<t.length;++i)e.push(255&t.charCodeAt(i));return e}(e),t,i,n)}function M(t,e,i,n){return x(t,e,i,n)}function T(t,e,i,n){return j(V(e),t,i,n)}function S(t,e,i,n){return j(function(t,e){for(var i,n,r,o=[],a=0;a<t.length&&!((e-=2)<0);++a)i=t.charCodeAt(a),n=i>>8,r=i%256,o.push(r),o.push(n);return o}(e,t.length-i),t,i,n)}function _(t,e,i){return 0===e&&i===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,i))}function A(t,e,i){i=Math.min(t.length,i);for(var n=[],r=e;r<i;){var o,a,s,l,u=t[r],h=null,c=u>239?4:u>223?3:u>191?2:1;if(r+c<=i)switch(c){case 1:u<128&&(h=u);break;case 2:128==(192&(o=t[r+1]))&&(l=(31&u)<<6|63&o)>127&&(h=l);break;case 3:o=t[r+1],a=t[r+2],128==(192&o)&&128==(192&a)&&(l=(15&u)<<12|(63&o)<<6|63&a)>2047&&(l<55296||l>57343)&&(h=l);break;case 4:o=t[r+1],a=t[r+2],s=t[r+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(h=l)}null===h?(h=65533,c=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),r+=c}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var i="",n=0;for(;n<e;)i+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return i}(n)}e.Buffer=l,e.SlowBuffer=function(t){+t!=t&&(t=0);return l.alloc(+t)},e.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=a(),l.poolSize=8192,l._augment=function(t){return t.__proto__=l.prototype,t},l.from=function(t,e,i){return u(null,t,e,i)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(t,e,i){return function(t,e,i,n){return h(e),e<=0?s(t,e):void 0!==i?"string"==typeof n?s(t,e).fill(i,n):s(t,e).fill(i):s(t,e)}(null,t,e,i)},l.allocUnsafe=function(t){return c(null,t)},l.allocUnsafeSlow=function(t){return c(null,t)},l.isBuffer=function(t){return!(null==t||!t._isBuffer)},l.compare=function(t,e){if(!l.isBuffer(t)||!l.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var i=t.length,n=e.length,r=0,o=Math.min(i,n);r<o;++r)if(t[r]!==e[r]){i=t[r],n=e[r];break}return i<n?-1:n<i?1:0},l.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(t,e){if(!o(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);var i;if(void 0===e)for(e=0,i=0;i<t.length;++i)e+=t[i].length;var n=l.allocUnsafe(e),r=0;for(i=0;i<t.length;++i){var a=t[i];if(!l.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,r),r+=a.length}return n},l.byteLength=f,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},l.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},l.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},l.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?A(this,0,t):m.apply(this,arguments)},l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){var t="",i=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(t+=" ... ")),"<Buffer "+t+">"},l.prototype.compare=function(t,e,i,n,r){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===i&&(i=t?t.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),e<0||i>t.length||n<0||r>this.length)throw new RangeError("out of range index");if(n>=r&&e>=i)return 0;if(n>=r)return-1;if(e>=i)return 1;if(this===t)return 0;for(var o=(r>>>=0)-(n>>>=0),a=(i>>>=0)-(e>>>=0),s=Math.min(o,a),u=this.slice(n,r),h=t.slice(e,i),c=0;c<s;++c)if(u[c]!==h[c]){o=u[c],a=h[c];break}return o<a?-1:a<o?1:0},l.prototype.includes=function(t,e,i){return-1!==this.indexOf(t,e,i)},l.prototype.indexOf=function(t,e,i){return v(this,t,e,i,!0)},l.prototype.lastIndexOf=function(t,e,i){return v(this,t,e,i,!1)},l.prototype.write=function(t,e,i,n){if(void 0===e)n="utf8",i=this.length,e=0;else if(void 0===i&&"string"==typeof e)n=e,i=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(i)?(i|=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var r=this.length-e;if((void 0===i||i>r)&&(i=r),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return b(this,t,e,i);case"utf8":case"utf-8":return w(this,t,e,i);case"ascii":return x(this,t,e,i);case"latin1":case"binary":return M(this,t,e,i);case"base64":return T(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,i);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function P(t,e,i){var n="";i=Math.min(t.length,i);for(var r=e;r<i;++r)n+=String.fromCharCode(127&t[r]);return n}function C(t,e,i){var n="";i=Math.min(t.length,i);for(var r=e;r<i;++r)n+=String.fromCharCode(t[r]);return n}function E(t,e,i){var n=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>n)&&(i=n);for(var r="",o=e;o<i;++o)r+=z(t[o]);return r}function D(t,e,i){for(var n=t.slice(e,i),r="",o=0;o<n.length;o+=2)r+=String.fromCharCode(n[o]+256*n[o+1]);return r}function L(t,e,i){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,i,n,r,o){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||e<o)throw new RangeError('"value" argument is out of bounds');if(i+n>t.length)throw new RangeError("Index out of range")}function I(t,e,i,n){e<0&&(e=65535+e+1);for(var r=0,o=Math.min(t.length-i,2);r<o;++r)t[i+r]=(e&255<<8*(n?r:1-r))>>>8*(n?r:1-r)}function R(t,e,i,n){e<0&&(e=4294967295+e+1);for(var r=0,o=Math.min(t.length-i,4);r<o;++r)t[i+r]=e>>>8*(n?r:3-r)&255}function N(t,e,i,n,r,o){if(i+n>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function k(t,e,i,n,o){return o||N(t,0,i,4),r.write(t,e,i,n,23,4),i+4}function F(t,e,i,n,o){return o||N(t,0,i,8),r.write(t,e,i,n,52,8),i+8}l.prototype.slice=function(t,e){var i,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),l.TYPED_ARRAY_SUPPORT)(i=this.subarray(t,e)).__proto__=l.prototype;else{var r=e-t;i=new l(r,void 0);for(var o=0;o<r;++o)i[o]=this[o+t]}return i},l.prototype.readUIntLE=function(t,e,i){t|=0,e|=0,i||L(t,e,this.length);for(var n=this[t],r=1,o=0;++o<e&&(r*=256);)n+=this[t+o]*r;return n},l.prototype.readUIntBE=function(t,e,i){t|=0,e|=0,i||L(t,e,this.length);for(var n=this[t+--e],r=1;e>0&&(r*=256);)n+=this[t+--e]*r;return n},l.prototype.readUInt8=function(t,e){return e||L(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,e){return e||L(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,e){return e||L(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,e){return e||L(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,e){return e||L(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,e,i){t|=0,e|=0,i||L(t,e,this.length);for(var n=this[t],r=1,o=0;++o<e&&(r*=256);)n+=this[t+o]*r;return n>=(r*=128)&&(n-=Math.pow(2,8*e)),n},l.prototype.readIntBE=function(t,e,i){t|=0,e|=0,i||L(t,e,this.length);for(var n=e,r=1,o=this[t+--n];n>0&&(r*=256);)o+=this[t+--n]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*e)),o},l.prototype.readInt8=function(t,e){return e||L(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,e){e||L(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt16BE=function(t,e){e||L(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},l.prototype.readInt32LE=function(t,e){return e||L(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,e){return e||L(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,e){return e||L(t,4,this.length),r.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,e){return e||L(t,4,this.length),r.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,e){return e||L(t,8,this.length),r.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,e){return e||L(t,8,this.length),r.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,e,i,n){(t=+t,e|=0,i|=0,n)||O(this,t,e,i,Math.pow(2,8*i)-1,0);var r=1,o=0;for(this[e]=255&t;++o<i&&(r*=256);)this[e+o]=t/r&255;return e+i},l.prototype.writeUIntBE=function(t,e,i,n){(t=+t,e|=0,i|=0,n)||O(this,t,e,i,Math.pow(2,8*i)-1,0);var r=i-1,o=1;for(this[e+r]=255&t;--r>=0&&(o*=256);)this[e+r]=t/o&255;return e+i},l.prototype.writeUInt8=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},l.prototype.writeUInt16LE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):R(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,i,n){if(t=+t,e|=0,!n){var r=Math.pow(2,8*i-1);O(this,t,e,i,r-1,-r)}var o=0,a=1,s=0;for(this[e]=255&t;++o<i&&(a*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+i},l.prototype.writeIntBE=function(t,e,i,n){if(t=+t,e|=0,!n){var r=Math.pow(2,8*i-1);O(this,t,e,i,r-1,-r)}var o=i-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+i},l.prototype.writeInt8=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):I(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):I(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):R(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,i){return t=+t,e|=0,i||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,i){return k(this,t,e,!0,i)},l.prototype.writeFloatBE=function(t,e,i){return k(this,t,e,!1,i)},l.prototype.writeDoubleLE=function(t,e,i){return F(this,t,e,!0,i)},l.prototype.writeDoubleBE=function(t,e,i){return F(this,t,e,!1,i)},l.prototype.copy=function(t,e,i,n){if(i||(i=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-i&&(n=t.length-e+i);var r,o=n-i;if(this===t&&i<e&&e<n)for(r=o-1;r>=0;--r)t[r+e]=this[r+i];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(r=0;r<o;++r)t[r+e]=this[r+i];else Uint8Array.prototype.set.call(t,this.subarray(i,i+o),e);return o},l.prototype.fill=function(t,e,i,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),1===t.length){var r=t.charCodeAt(0);r<256&&(t=r)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;var o;if(e>>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(o=e;o<i;++o)this[o]=t;else{var a=l.isBuffer(t)?t:U(new l(t,n).toString()),s=a.length;for(o=0;o<i-e;++o)this[o+e]=a[o%s]}return this};var B=/[^+\/0-9A-Za-z-_]/g;function z(t){return t<16?"0"+t.toString(16):t.toString(16)}function U(t,e){var i;e=e||1/0;for(var n=t.length,r=null,o=[],a=0;a<n;++a){if((i=t.charCodeAt(a))>55295&&i<57344){if(!r){if(i>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(e-=3)>-1&&o.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(e-=3)>-1&&o.push(239,191,189);if(r=null,i<128){if((e-=1)<0)break;o.push(i)}else if(i<2048){if((e-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return o}function V(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(B,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function j(t,e,i,n){for(var r=0;r<n&&!(r+i>=e.length||r>=t.length);++r)e[r+i]=t[r];return r}}).call(this,i(171))},function(t,e){t.exports={ContextCreated:"scene-renderer-context-created",AfterRender:"after-render",MemoryUsageUpdated:"scene-renderer-memory-usage-updated"}},function(t,e,i){"use strict";i.r(e),function(t){i.d(e,"Easing",(function(){return r})),i.d(e,"Group",(function(){return a})),i.d(e,"Interpolation",(function(){return s})),i.d(e,"Sequence",(function(){return l})),i.d(e,"Tween",(function(){return h})),i.d(e,"VERSION",(function(){return c})),i.d(e,"add",(function(){return g})),i.d(e,"getAll",(function(){return f})),i.d(e,"nextId",(function(){return d})),i.d(e,"now",(function(){return o})),i.d(e,"remove",(function(){return v})),i.d(e,"removeAll",(function(){return m})),i.d(e,"update",(function(){return y}));var n,r={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-r.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*r.Bounce.In(2*t):.5*r.Bounce.Out(2*t-1)+.5}}},o="undefined"==typeof self&&void 0!==t&&t.hrtime?function(){var e=t.hrtime();return 1e3*e[0]+e[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):void 0!==Date.now?Date.now:function(){return(new Date).getTime()},a=function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={}}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},t.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},t.prototype.update=function(t,e){void 0===t&&(t=o()),void 0===e&&(e=!1);var i=Object.keys(this._tweens);if(0===i.length)return!1;for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var n=0;n<i.length;n++){var r=this._tweens[i[n]],a=!e;r&&!1===r.update(t,a)&&!e&&delete this._tweens[i[n]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},t}(),s={Linear:function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n),o=s.Utils.Linear;return e<0?o(t[0],t[1],n):e>1?o(t[i],t[i-1],i-n):o(t[r],t[r+1>i?i:r+1],n-r)},Bezier:function(t,e){for(var i=0,n=t.length-1,r=Math.pow,o=s.Utils.Bernstein,a=0;a<=n;a++)i+=r(1-e,n-a)*r(e,a)*t[a]*o(n,a);return i},CatmullRom:function(t,e){var i=t.length-1,n=i*e,r=Math.floor(n),o=s.Utils.CatmullRom;return t[0]===t[i]?(e<0&&(r=Math.floor(n=i*(1+e))),o(t[(r-1+i)%i],t[r],t[(r+1)%i],t[(r+2)%i],n-r)):e<0?t[0]-(o(t[0],t[0],t[1],t[1],-n)-t[0]):e>1?t[i]-(o(t[i],t[i],t[i-1],t[i-1],n-i)-t[i]):o(t[r?r-1:0],t[r],t[i<r+1?i:r+1],t[i<r+2?i:r+2],n-r)},Utils:{Linear:function(t,e,i){return(e-t)*i+t},Bernstein:function(t,e){var i=s.Utils.Factorial;return i(t)/i(e)/i(t-e)},Factorial:(n=[1],function(t){var e=1;if(n[t])return n[t];for(var i=t;i>1;i--)e*=i;return n[t]=e,e}),CatmullRom:function(t,e,i,n,r){var o=.5*(i-t),a=.5*(n-e),s=r*r;return(2*e-2*i+o+a)*(r*s)+(-3*e+3*i-2*o-a)*s+o*r+e}}},l=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),u=new a,h=function(){function t(t,e){void 0===e&&(e=u),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=r.Linear.None,this._interpolationFunction=s.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=l.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.to=function(t,e){return this._valuesEnd=Object.create(t),void 0!==e&&(this._duration=e),this},t.prototype.duration=function(t){return this._duration=t,this},t.prototype.start=function(t){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var e in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e];return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=void 0!==t?"string"==typeof t?o()+parseFloat(t):t:o(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},t.prototype._setupProperties=function(t,e,i,n){for(var r in i){var o=t[r],a=Array.isArray(o),s=a?"array":typeof o,l=!a&&Array.isArray(i[r]);if("undefined"!==s&&"function"!==s){if(l){var u=i[r];if(0===u.length)continue;u=u.map(this._handleRelativeValue.bind(this,o)),i[r]=[o].concat(u)}if("object"!==s&&!a||!o||l)void 0===e[r]&&(e[r]=o),a||(e[r]*=1),n[r]=l?i[r].slice().reverse():e[r]||0;else{for(var h in e[r]=a?[]:{},o)e[r][h]=o[h];n[r]=a?[]:{},this._setupProperties(o,e[r],i[r],n[r])}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},t.prototype.pause=function(t){return void 0===t&&(t=o()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t,this._group&&this._group.remove(this)),this},t.prototype.resume=function(t){return void 0===t&&(t=o()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},t.prototype.group=function(t){return this._group=t,this},t.prototype.delay=function(t){return this._delayTime=t,this},t.prototype.repeat=function(t){return this._initialRepeat=t,this._repeat=t,this},t.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},t.prototype.yoyo=function(t){return this._yoyo=t,this},t.prototype.easing=function(t){return this._easingFunction=t,this},t.prototype.interpolation=function(t){return this._interpolationFunction=t,this},t.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},t.prototype.onStart=function(t){return this._onStartCallback=t,this},t.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},t.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},t.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},t.prototype.onStop=function(t){return this._onStopCallback=t,this},t.prototype.update=function(t,e){if(void 0===t&&(t=o()),void 0===e&&(e=!0),this._isPaused)return!0;var i,n,r=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(t>r)return!1;e&&this.start(t)}if(this._goToEnd=!1,t<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),n=(t-this._startTime)/this._duration,n=0===this._duration||n>1?1:n;var a=this._easingFunction(n);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,a),this._onUpdateCallback&&this._onUpdateCallback(this._object,n),1===n){if(this._repeat>0){for(i in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[i]||(this._valuesStartRepeat[i]=this._valuesStartRepeat[i]+parseFloat(this._valuesEnd[i])),this._yoyo&&this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i];return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var s=0,l=this._chainedTweens.length;s<l;s++)this._chainedTweens[s].start(this._startTime+this._duration);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(t,e,i,n){for(var r in i)if(void 0!==e[r]){var o=e[r]||0,a=i[r],s=Array.isArray(t[r]),l=Array.isArray(a);!s&&l?t[r]=this._interpolationFunction(a,n):"object"==typeof a&&a?this._updateProperties(t[r],o,a,n):"number"==typeof(a=this._handleRelativeValue(o,a))&&(t[r]=o+(a-o)*n)}},t.prototype._handleRelativeValue=function(t,e){return"string"!=typeof e?e:"+"===e.charAt(0)||"-"===e.charAt(0)?t+parseFloat(e):parseFloat(e)},t.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],i=this._valuesEnd[t];this._valuesStartRepeat[t]="string"==typeof i?this._valuesStartRepeat[t]+parseFloat(i):this._valuesEnd[t],this._valuesEnd[t]=e},t}(),c="18.6.4",d=l.nextId,p=u,f=p.getAll.bind(p),m=p.removeAll.bind(p),g=p.add.bind(p),v=p.remove.bind(p),y=p.update.bind(p),b={Easing:r,Group:a,Interpolation:s,now:o,Sequence:l,nextId:d,Tween:h,VERSION:c,getAll:f,removeAll:m,add:g,remove:v,update:y};e.default=b}.call(this,i(50))},function(t,e){var i,n,r=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(i===setTimeout)return setTimeout(t,0);if((i===o||!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:o}catch(t){i=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var l,u=[],h=!1,c=-1;function d(){h&&l&&(h=!1,l.length?u=l.concat(u):c=-1,u.length&&p())}function p(){if(!h){var t=s(d);h=!0;for(var e=u.length;e;){for(l=u,u=[];++c<e;)l&&l[c].run();c=-1,e=u.length}l=null,h=!1,function(t){if(n===clearTimeout)return clearTimeout(t);if((n===a||!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];u.push(new f(t,e)),1!==u.length||h||s(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,r=i(0),o=i(1),a=i(8),s=i(16),l=i(10),u=i(12),h=i(17),c=i(22);i(3);function d(t){var e=r.UniformsUtils.clone(u.waypoint.uniforms);e.map.value=n,e.opacity.value=0,e.color.value.set(o.reticuleColor);var i=new r.PlaneBufferGeometry(.2,.2,1,1),a=new r.RawShaderMaterial({side:r.DoubleSide,depthWrite:!1,depthTest:!1,transparent:!0,vertexShader:u.waypoint.vertexShader,fragmentShader:u.waypoint.fragmentShader,uniforms:e,name:"waypoint",opacity:0});r.Mesh.call(this,i,a),this.renderOrder=h.reticule,this.player=t,this.direction=new r.Vector3,this.hidden=!0,this.mouseLastMoveTime=Date.now(),this.editHidden=!1}n=G.conf.isCleanUI?s.loadurl(c.splitUrl("./images/nonepointer.png")):s.loadurl(c.splitUrl("./images/pointermain_512x512.png")),d.prototype=Object.create(r.Mesh.prototype),d.prototype.move=function(t,e,i){this.editHidden?this.hidden=!0:(this.hidden=i,this.mouseLastMoveTime=Date.now())},d.prototype.hide=function(){this.hidden||(this.hidden=!0,a.start(l.property(this.material.uniforms.opacity,"value",0),o.reticuleOpacityTransitionTime))},d.prototype.show=function(){this.hidden=!1,this.material.opacity<=0&&a.start(l.property(this.material.uniforms.opacity,"value",o[this.player.mode].reticuleOpacity),o.reticuleOpacityTransitionTime)},d.prototype.changeNormalMaterial=function(){},d.prototype.changeCrossMaterial=function(){},d.prototype.update=function(){this.editHidden},d.prototype.updatePosition=function(t,e){if(!this.hidden){if(!e)return this.hide();var i=e.point,n=t.distanceTo(i),r=1+.01*n;n<1&&(r-=1-n),this.show(),this.scale.set(r,r,r),this.direction=this.direction.multiplyScalar(.8),this.direction.add(e.face.normal.clone().multiplyScalar(.2)),this.position.copy(i).add(e.face.normal.clone().multiplyScalar(.01)),this.lookAt(this.position.clone().add(this.direction))}},d.prototype.writeAsMattertag=function(){var t=Math.floor(4294967296*(1+Math.random())).toString(16)+Math.floor(16*(1+Math.random())).toString(16),e=new Date;this.tagCount=void 0===this.tagCount?1:this.tagCount+1;var i={enabled:!0,version:"0",created:e.toISOString(),created_by:"APITest",position:this.position.clone(),stem:{enabled:o.mattertags.pole.enabled,direction:this.direction.multiplyScalar(o.mattertags.pole.height)},label:"Mattertag "+this.tagCount,description:"Description "+t,floor:function(t){if(t.currentFloor){var e=t.floors.indexOf(t.currentFloor);return e>-1?e:void 0}}(this.player.model),type:"info",metadata:{preferred_camera:{mode:this.player.mode}}},n=this.player.model.addMattertag(t,i).build();n&&(n.disc&&this.player.mattertagDiscs.push(n.disc),n.visible||n.show(o.mattertags.startup.fadeInDuration))},t.exports=d},function(t,e,i){"use strict";var n=i(0),r=i(1),o=i(53);function a(t){o.call(this,t),this.minPolarAngle=r.dollhouseDefault.minPolarAngle,this.maxPolarAngle=r.dollhouseDefault.maxPolarAngle,this.minDistance=r.dollhouseDefault.minDistance,this.maxDistance=r.dollhouseDefault.maxDistance,this.adjustedMinDistance=this.minDistance,this.adjustedMaxDistance=this.maxDistance}a.prototype=Object.create(o.prototype),a.prototype.pan=function(t,e){this.camera.updateMatrix();var i=this.camera.position.clone().sub(this.target).length();i*=Math.tan(this.camera.fov/2*Math.PI/180),this.panLeft(2*t*i/(window.renderHeight || window.innerHeight)),this.panUp(-2*e*i/(window.renderHeight || window.innerHeight))},a.prototype.updateZoom=function(){return this.cameraLength*=this.scale,this.cameraLength},a.prototype.setZoomBounds=function(t){var e=t.min.distanceTo(t.max);this.adjustedMinDistance=Math.max(Math.min(e/2,r.dollhouseDefault.minDistance),0),this.adjustedMaxDistance=Math.min(Math.max(e,r.dollhouseDefault.maxDistance),r.skyboxRadius),this.minDistance=this.adjustedMinDistance,this.maxDistance=this.adjustedMaxDistance},a.prototype.resetRanges=function(t,e){t?(this.minDistance=Math.min(t,this.minDistance),this.maxDistance=Math.max(t,this.maxDistance)):(this.minDistance=this.adjustedMinDistance,this.maxDistance=this.adjustedMaxDistance),e?(this.minPolarAngle=n.Math.degToRad(10),this.maxPolarAngle=n.Math.degToRad(65)):(this.minPolarAngle=r.dollhouseDefault.minPolarAngle,this.maxPolarAngle=r.dollhouseDefault.maxPolarAngle)},a.prototype.toJSON=function(){return o.prototype.toJSON.call(this)},t.exports=a},function(t,e,i){"use strict";var n=i(0),r=i(1),o=i(7),a=i(9),s=i(32),l=i(27),u=i(4).EventEmitter,h=i(28),c=1e-6,d=-1,p=0,f=1,m=2,g=3,v=4;function y(t){this.camera=t,this.camera.controls=this,this.enabled=!1,this.target=new n.Vector3,this.targetBounds=new n.Box3,this.noZoom=!1,this.zoomSpeed=1,this.minDistance=0,this.maxDistance=1/0,this.noRotate=!1,this.noRotateUpDown=!1,this.rotateSpeed=1,this.keyboardZoomSpeed=0,this.noPan=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.minPolarAngle=n.Math.degToRad(25),this.maxPolarAngle=n.Math.degToRad(65),this.noKeys=!1,this.rotationAcceleration=new n.Vector2,this.rotationSpeed=new n.Vector2,this.panAcceleration=new n.Vector2,this.panSpeed=new n.Vector2,this.rotateStart=new n.Vector2,this.rotateEnd=new n.Vector2,this.rotateDelta=new n.Vector2,this.panStart=new n.Vector2,this.panEnd=new n.Vector2,this.panDelta=new n.Vector2,this.panOffset=new n.Vector3,this.offset=new n.Vector3,this.dollyStart=new n.Vector2,this.dollyEnd=new n.Vector2,this.dollyDelta=new n.Vector2,this.phiDelta=0,this.thetaDelta=0,this.scale=1,this.panVector=new n.Vector3,this.lastPosition=new n.Vector3,this.state=d,this.lastMoveTime=0,this.pointersLimit=2,this.pointers=[],this.lon=0,this.lat=0,this.on("touch-one-finger-start",y.touch.rotate.start),this.on("touch-one-finger-move",y.touch.rotate.move),this.on("touch-two-finger-start",y.touch.pan.start),this.on("touch-two-finger-start",y.touch.zoom.start),this.on("touch-two-finger-move",y.touch.zoom.move),this.sendData=!1,this.responseMessage=this.responseMessage.bind(this),this.connect=h(),this.connect.on("operation",this.responseMessage),this._lockedMouseWheel=!1,this.defineProperty()}y.prototype=Object.create(u.prototype),y.prototype.defineProperty=function(){var t=!0,e=this;Object.defineProperty(this,"touchup",{get:function(){return t},set:function(i){t=i,e.connect.busy=!i}}),Object.defineProperty(this,"lockedMouseWheel",{get:function(){return this._lockedMouseWheel},set:function(t){this._lockedMouseWheel=t}})},y.prototype.setBounds=function(t){this.targetBounds=t},y.prototype.bindEvents=function(t){(t=t||document).addEventListener("contextmenu",(function(t){t.preventDefault()})),t.addEventListener("mousedown",this.onMouseDown.bind(this)),t.addEventListener("mousemove",this.onMouseMove.bind(this)),t.addEventListener("mouseup",this.onMouseUp.bind(this)),t.addEventListener("mouseover",function(t){0!==t.which&&0!==t.buttons||this.onMouseUp(t)}.bind(this)),r.useWheel&&(t.addEventListener("mousewheel",this.onMouseWheel.bind(this)),t.addEventListener("DOMMouseScroll",this.onMouseWheel.bind(this))),t.addEventListener("touchstart",this.onTouchStart.bind(this)),t.addEventListener("touchend",this.onTouchEnd.bind(this)),t.addEventListener("touchmove",this.onTouchMove.bind(this)),t.addEventListener("pointerdown",this.onPointerDown.bind(this)),t.addEventListener("pointerup",this.onPointerUp.bind(this)),t.addEventListener("pointerout",this.onPointerUp.bind(this)),t.addEventListener("pointercancel",this.onPointerUp.bind(this)),t.addEventListener("pointermove",this.onPointerMove.bind(this)),t.addEventListener("keydown",this.onKeyDown.bind(this)),t.addEventListener("keyup",this.onKeyUp.bind(this))},y.prototype.isEngaged=function(){return this.state!==d};var b,w,x,M,T,S,_=null,A=null,P=null;y.prototype.rotateLeft=function(t){void 0===t&&(t=this.getAutoRotationAngle()),this.thetaDelta-=t,0===this.thetaDelta&&0===t&&null===_&&this.touchup?(_=!0,this.emit("dollhouse-move-stop")):0<this.thetaDelta?(_=null,.001<this.thetaDelta?(A=!1,this.emit("dollhouse-move")):!1===A&&(A=!0,this.emit("dollhouse-move-stop"))):0>this.thetaDelta&&(_=null,-.001>this.thetaDelta?(P=!1,this.emit("dollhouse-move")):!1===P&&(P=!0,this.emit("dollhouse-move-stop")))},y.prototype.rotateUp=function(t){this.noRotateUpDown||(void 0===t&&(t=this.getAutoRotationAngle()),this.phiDelta-=t)},y.prototype.panLeft=function(t){var e=this.camera.matrix.elements;0==e[0]&&0==e[2]?this.panOffset.set(e[0],0,e[2]):this.panOffset.set(e[0],0,e[2]).normalize(),this.panOffset.multiplyScalar(-t),this.panVector.add(this.panOffset)},y.prototype.panUp=function(t){var e=this.camera.matrix.elements;0==e[4]&&0==e[6]?this.panOffset.set(e[4],0,e[6]):this.panOffset.set(e[4],0,e[6]).normalize(),this.panOffset.multiplyScalar(-t),this.panVector.add(this.panOffset)},y.prototype.dollyIn=function(t){void 0===t&&(t=this.getZoomScale()),G.R.recording&&G.R.save({tap:"zoom",type:"dollhouse",level:1/t}),this.scale/=t,this.emit("dollhouse-move-stop")},y.prototype.dollyOut=function(t){void 0===t&&(t=this.getZoomScale()),G.R.recording&&G.R.save({tap:"zoom",type:"dollhouse",level:t}),this.scale*=t,this.emit("dollhouse-move-stop")},y.prototype.lookAt=function(t,e,i){this.camera.position.copy(t),this.camera.quaternion.copy(i),this.target.copy(e),this.offset.copy(t).sub(e),this.lon=Math.atan2(this.offset.x,this.offset.z),this.lat=Math.atan2(Math.sqrt(this.offset.x*this.offset.x+this.offset.z*this.offset.z),this.offset.y),this.cameraLength=this.offset.length()},y.prototype.update=function(t){var e,i,n,o;if(!G.measurestarted){if(e=this.camera.position,this.updateFromRecord)return this.updateFromRecord=!1,void this.updateCamera(this.lon,this.lat);this.updateFromRecord=!1,t||(t=1/60),this.rotationSpeed.multiplyScalar(1-r.rotationFriction).addScaledVector(this.rotationAcceleration,r.rotationAccelerationOutside*t),this.rotateLeft(-this.rotationSpeed.x),this.noRotateUpDown||this.rotateUp(this.rotationSpeed.y),this.panSpeed.multiplyScalar(1-r.panFriction).addScaledVector(this.panAcceleration,r.panAccelerationOutside*t),this.pan(-this.panSpeed.x,this.panSpeed.y),this.offset.copy(e).sub(this.target),i=Math.atan2(this.offset.x,this.offset.z),n=Math.atan2(Math.sqrt(this.offset.x*this.offset.x+this.offset.z*this.offset.z),this.offset.y),this.autoRotate&&this.rotateLeft(this.getAutoRotationAngle()),o=this.offset.length(),i+=this.thetaDelta,n+=this.phiDelta,i<0&&(i+=2*Math.PI),(this.connect.remoteControl||this.connect.sync)&&"floorplan"!==this.type||(this.lon=i,this.lat=n,this.cameraLength=o),G.R.recording&&this.record(i),this.updateCamera(this.lon,this.lat),this.connect.remoteControl||this.connect.sync||this.sendFrameData(t),this.thetaDelta=0,this.phiDelta=0,this.scale=1,this.panVector.set(0,0,0),this.lastPosition.distanceTo(this.camera.position)>0&&this.lastPosition.copy(this.camera.position)}},y.prototype.updateCamera=(w=new n.Vector3,function(t,e){"floorplan"===this.type&&(t=0,e=0),b=this.updateZoom(),b=Math.max(this.minDistance,Math.min(this.maxDistance,b)),isNaN(t)||isNaN(e)||(e=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,e)),e=Math.max(c,Math.min(Math.PI-c,e)),w.x=b*Math.sin(e)*Math.sin(t),w.y=b*Math.cos(e),w.z=b*Math.sin(e)*Math.cos(t)),this.camera.position.copy(this.target).add(w),this.camera.lookAt(this.target)}),y.prototype.sendFrameData=(S=0,function(t){"dollhouse"===G.player.mode&&((S+=t)<r.connectDelay||Math.abs(x-this.lon)<.001&&Math.abs(M-this.lat)<.001&&Math.abs(T-this.cameraLength)<.001||(S=0,this.connect.sendOperation({type:"outside",lon:this.lon,lat:this.lat,cameraLength:this.cameraLength}),x=this.lon,M=this.lat,T=this.cameraLength))}),y.prototype._progressNumber=function(t,e,i){return t+(e-t)*i},y.prototype._progressRad=function(t,e,i){var n=2*Math.PI,r=Math.PI,o=function(t){return(t%n+n)%n};return t=o(t),(e=o(e))-t>r?this._progressNumber(t+n,e,i):t-e>r?this._progressNumber(t-n,e,i):this._progressNumber(t,e,i)},y.prototype.responseMessage=function(t){var e=this;if("outside"===t.type){var i=t.lon,n=t.lat,o=t.cameraLength;this.tweenProgress&&(this.tweenProgress.stop(),this.tweenProgress=null);var a=this.lon,s=this.lat,l=this.cameraLength;this.tweenProgress=new TWEEN.Tween({progress:0}).to({progress:1},r.animationDelay).easing(TWEEN.Easing.Linear.None).start(),this.tweenProgress.onUpdate((function(t){null===i&&0===i||(e.lon=e._progressRad(a,i,this.progress)),null===n&&0===i||(e.lat=e._progressNumber(s,n,this.progress)),e.cameraLength=e._progressNumber(l,o,this.progress)})),this.tweenProgress.onComplete((function(){this.tweenProgress=null}))}},y.prototype.getAutoRotationAngle=function(t,e){return{lon:t,lat:e}},y.prototype.getAutoRotationAngle=function(){return 2*Math.PI/60/60*this.autoRotateSpeed},y.prototype.getZoomScale=function(){return Math.pow(.95,this.zoomSpeed)},y.prototype.onMouseDown=function(t){if(this.enabled){switch(this.touchup=!1,t.preventDefault(),this.mouseDown=!0,t.button){case 0:if(this.noRotate)return;this.state=p,this.rotateStart.set(t.clientX,this.noRotateUpDown?0:t.clientY),this.rotationSpeed.set(0,0);break;case 1:if(this.noZoom)return;this.state=f,this.dollyStart.set(t.clientX,t.clientY);break;case 2:if(this.noPan)return;this.state=m,this.panStart.set(t.clientX,t.clientY)}this.emit(l.InputStart,"mouse")}},y.prototype.play=function(t){this.touchup&&(this.lon=t.lon,this.lat=t.lat,this.updateFromRecord=!0)},y.prototype.record=function(t){G.player.flying||G.R.rtime&&!(G.R.time.getElapsedTime()-G.R.rtime>.15)||("dollhouse"===G.player.mode?(void 0!==G.R.lastlon&&Math.abs(this.lon-G.R.lastlon)>3&&(this.lon<G.R.lastlon?G.R.lon+=2*Math.PI:G.R.lon-=2*Math.PI),G.R.rtime=G.R.save({tap:"dollhouse",lon:parseFloat((this.lon+G.R.lon).toFixed(5)),lat:parseFloat(this.lat.toFixed(5)),action:"rotate"}),G.R.lastlon=this.lon):"floorplan"===G.player.mode&&(G.R.rtime=G.R.save({tap:"floorplan",lon:parseFloat(this.lon.toFixed(5)),lat:parseFloat(this.lat.toFixed(5)),action:"rotate"})))},y.prototype.onMouseMove=function(t){if(this.enabled&&this.mouseDown&&0!==t.buttons){if(t.preventDefault(),r.delBK&&"floorplan"===G.player.mode)return!1;var e=t.currentTarget;switch(this.state){case p:if(this.noRotate)return;this.rotateEnd.set(t.clientX,this.noRotateUpDown?0:t.clientY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart),this.rotateLeft(2*Math.PI*this.rotateDelta.x/e.clientWidth*this.rotateSpeed),this.rotateUp(2*Math.PI*this.rotateDelta.y/e.clientHeight*this.rotateSpeed),this.rotateStart.copy(this.rotateEnd);break;case f:if(this.noZoom)return;this.dollyEnd.set(t.clientX,t.clientY),this.dollyDelta.subVectors(this.dollyEnd,this.dollyStart),(this.dollyDelta.y>0?this.dollyIn:this.dollyOut).call(this),this.dollyStart.copy(this.dollyEnd);break;case m:if(this.noPan)return;this.panEnd.set(t.clientX,t.clientY),this.panDelta.subVectors(this.panEnd,this.panStart),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.copy(this.panEnd)}this.emit(l.Move,"mouse"),this.lastMoveTime=t.timeStamp,this.update()}},y.prototype.onMouseUp=function(t){if(!this.enabled)return!1;this.mouseDown=!1,this.touchup=!0,this.state=d,"mouseover"!==t.type&&(t.timeStamp>this.lastMoveTime+100?(this.rotationSpeed.set(0,0),this.rotationAcceleration.set(0,0)):this.rotationAcceleration.set(-this.rotateDelta.x,this.rotateDelta.y),this.update(),this.rotationAcceleration.set(0,0),this.rotateDelta.set(0,0))},y.prototype.onMouseWheel=function(t){this._lockedMouseWheel||this.enabled&&!this.noZoom&&r.useWheel&&!G.R.playing&&(r.delBK&&"floorplan"===G.player.mode||(this.emit(l.Move,"wheel"),((t.wheelDelta||-t.detail)>0?this.dollyOut:this.dollyIn).call(this),this.update()))},y.prototype.onKeyDown=function(t){"floorplan"!==G.player.mode&&(!this.enabled||this.noKeys||t.metaKey||t.ctrlKey||(t.preventDefault(),this.handleKeyDown(t.which)))},y.prototype.handleKeyDown=function(t){var e=function(t,e){"y"===t?this.noRotateUpDown?this.keyboardZoomSpeed=e:this.rotationAcceleration.y=e:this.rotationAcceleration.x=e}.bind(this),i=function(t,e){this.panAcceleration[t]=e}.bind(this),n=!0;switch(t){case s.UPARROW:case s.I:e("y",1);break;case s.DOWNARROW:case s.K:e("y",-1);break;case s.LEFTARROW:case s.J:e("x",-1);break;case s.RIGHTARROW:case s.L:e("x",1);break;case s.W:i("y",1);break;case s.S:i("y",-1);break;case s.A:i("x",-1);break;case s.D:i("x",1);break;default:n=!1}n&&this.emit(l.Move,"key")},y.prototype.onKeyUp=function(t){!this.enabled||this.noKeys||(t.preventDefault(),t.stopPropagation(),this.handleKeyUp(t.which))},y.prototype.handleKeyUp=function(t){switch(t){case s.I:case s.K:case s.UPARROW:case s.DOWNARROW:this.keyboardZoomSpeed=0,this.rotationAcceleration.y=0;break;case s.J:case s.L:case s.LEFTARROW:case s.RIGHTARROW:this.rotationAcceleration.x=0;break;case s.S:case s.W:this.panAcceleration.y=0;break;case s.A:case s.D:this.panAcceleration.x=0}},y.prototype.onTouchStart=function(t){if(this.enabled){switch(this.touchup=!1,t.preventDefault(),t.stopPropagation(),t.touches.length){case 1:this.emit("touch-one-finger-start",t);break;case 2:this.emit("touch-two-finger-start",t);break;default:this.state=d}this.rotationSpeed.set(0,0),this.emit(l.InputStart,"touch")}},y.prototype.onTouchMove=function(t){if(this.enabled){if(r.delBK&&"floorplan"===G.player.mode)return!1;switch(t.preventDefault(),t.stopPropagation(),t.touches.length){case 1:this.emit("touch-one-finger-move",t),this.update();break;case 2:this.emit("touch-two-finger-move",t),this.update();break;default:this.state=d}this.lastMoveTime=t.timeStamp}},y.prototype.onTouchEnd=function(t){this.enabled&&(this.emit("touch-one-finger-end",t),this.touchup=!0,this.emit("touch-two-finger-end",t),this.state=d,t.timeStamp>this.lastMoveTime+100?(this.rotationSpeed.set(0,0),this.rotationAcceleration.set(0,0)):this.rotationAcceleration.set(-this.rotateDelta.x,this.rotateDelta.y),this.update(),this.rotationAcceleration.set(0,0),this.rotateDelta.set(0,0))},y.prototype._progressNumber=function(t,e,i){return t+(e-t)*i},y.prototype._progressRad=function(t,e,i){var n=2*Math.PI,r=Math.PI,o=function(t){return(t%n+n)%n};return t=o(t),(e=o(e))-t>r?this._progressNumber(t+n,e,i):t-e>r?this._progressNumber(t-n,e,i):this._progressNumber(t,e,i)},y.prototype.translateWithAnimation=function(t,e,i){var n=this;this.tweenProgress&&(this.tweenProgress.stop(),this.tweenProgress=null);var r=this.lon,o=this.lat;this.tweenProgress=new TWEEN.Tween({progress:0}).to({progress:1},i).easing(TWEEN.Easing.Linear.None).start(),this.tweenProgress.onUpdate((function(){null!==t&&0!==t&&(n.lon=n._progressRad(r,t,this.progress)),null!==e&&0!==e&&(n.lat=n._progressNumber(o,e,this.progress))})),this.tweenProgress.onComplete((function(){this.tweenProgress=null}))},y.prototype.onPointerDown=function(t){this.enabled&&("touch"===t.pointerType&&(this.pointers.length<this.pointersLimit&&this.pointers.push({id:t.pointerId,pageX:t.pageX,pageY:t.pageY}),t.touches=this.pointers,this.onTouchStart(t)),this.emit(l.InputStart,"pointer"))},y.prototype.onPointerMove=function(t){this.enabled&&"touch"===t.pointerType&&(this.pointers.forEach((function(e){t.pointerId===e.id&&(e.pageX=t.pageX,e.pageY=t.pageY)})),t.touches=this.pointers,this.onTouchMove(t))},y.prototype.onPointerUp=function(t){this.enabled&&"touch"===t.pointerType&&(this.pointers.forEach(function(e,i){t.pointerId===e.id&&this.pointers.splice(i,1)}.bind(this)),t.touches=this.pointers,this.onTouchEnd(t))},y.prototype.reset=function(){this.state=d,this.rotationSpeed.set(0,0),this.rotationAcceleration.set(0,0),this.panSpeed.set(0,0),this.panAcceleration.set(0,0)},y.prototype.toJSON=function(){return{_viewpoint:{x:a.toPrecision(this.camera.position.x,4),y:a.toPrecision(this.camera.position.y,4),z:a.toPrecision(this.camera.position.z,4)},_rotation:{x:a.toPrecision(this.camera.quaternion.x,4),y:a.toPrecision(this.camera.quaternion.y,4),z:a.toPrecision(this.camera.quaternion.z,4),w:a.toPrecision(this.camera.quaternion.w,4)}}},y.touch={rotate:{start:function(t){this.state=g,this.rotateStart.set(t.touches[0].pageX,t.touches[0].pageY)},move:function(t){if(this.state===g){this.emit(l.Move,"touch");var e=t.currentTarget;this.rotateEnd.set(t.touches[0].pageX,t.touches[0].pageY),this.rotateDelta.subVectors(this.rotateEnd,this.rotateStart),this.rotateLeft(2*Math.PI*this.rotateDelta.x/e.clientWidth*this.rotateSpeed),this.rotateUp(2*Math.PI*this.rotateDelta.y/e.clientHeight*this.rotateSpeed),this.rotateStart.copy(this.rotateEnd)}}},zoom:{start:function(t){this.state=v;var e=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(e*e+i*i);this.dollyStart.set(0,n)},move:function(t){if(this.state===v){this.emit(l.Move,"touch");var e=t.touches[0].pageX-t.touches[1].pageX,i=t.touches[0].pageY-t.touches[1].pageY,n=Math.sqrt(e*e+i*i);this.dollyEnd.set(0,n),this.dollyDelta.subVectors(this.dollyEnd,this.dollyStart),this.dollyDelta.y>0?this.dollyOut(1-this.dollyDelta.y/500):this.dollyIn(1+this.dollyDelta.y/500),this.dollyStart.copy(this.dollyEnd)}}},pan:{start:function(t){this.state=v,this.panStart.set(o.average(t.touches,"pageX"),o.average(t.touches,"pageY"))},move:function(t){this.state===v&&(this.emit(l.Move,"touch"),this.panEnd.set(o.average(t.touches,"pageX"),o.average(t.touches,"pageY")),this.panDelta.subVectors(this.panEnd,this.panStart),this.pan(this.panDelta.x,this.panDelta.y),this.panStart.copy(this.panEnd),this.rotateDelta.set(0,0))}}},t.exports=y},function(t,e,i){var n=i(0),r=i(1),o=i(53),a=i(9),s=i(3);function l(t){o.call(this,t),this.minDistance=20,this.maxDistance=50,this.noRotateUpDown=!0,this.minPolarAngle=0,this.maxPolarAngle=0,this.absoluteScale=1,this.currentScale=1}l.prototype=Object.create(o.prototype),l.prototype.zoomToContain=function(t){if(r.delBK){var e=Math.max(t.x,t.z,t.x*this.camera.aspect,t.z*this.camera.aspect);this.absoluteScale=e/2/r.orthoBase*1.4,this.currentScale=this.absoluteScale}else{var i=Math.max(t.x,t.z),n=Math.min(t.x,t.z),o=Math.max(i,n*this.camera.aspect),a=Math.max(n,i*this.camera.aspect);this.absoluteScale=(s.aspectRatio()<1?a:o)/2/r.orthoBase*1.2,this.currentScale=this.absoluteScale}},l.prototype.rotateToView=function(t,e){if(r.delBK){var i=0;this.rotateLeft(i),this.update(0)}else{i=0;s.aspectRatio()<1===t.x<t.z?e.z>0&&(i=Math.PI):i=e.x>0?Math.PI/2:-Math.PI/2,this.rotateLeft(i)}},l.prototype.pan=function(t,e){this.camera.updateMatrix(),this.panLeft(t*(this.camera.right-this.camera.left)/(window.renderWidth || window.innerWidth)),this.panUp(-e*(this.camera.top-this.camera.bottom)/(window.renderHeight || window.innerHeight))},l.prototype.updateZoom=function(){return this.absoluteScale*=this.scale-.03*this.keyboardZoomSpeed,this.absoluteScale=Math.max(r.zoomNearLimit,Math.min(this.absoluteScale,r.zoomFarLimit)),this.currentScale=.8*this.currentScale+.2*this.absoluteScale,this.camera.left=-r.orthoBase*this.currentScale,this.camera.right=r.orthoBase*this.currentScale,this.camera.top=r.orthoBase*this.currentScale/this.camera.aspect,this.camera.bottom=-r.orthoBase*this.currentScale/this.camera.aspect,this.camera.updateProjectionMatrix(),this.offset.length()},l.prototype.toJSON=function(){var t=new n.Quaternion,e=(new n.Quaternion).setFromAxisAngle(new n.Vector3(0,1,0),n.Math.degToRad(90)),i=new n.Quaternion;return function(){var n=o.prototype.toJSON.call(this);return t.copy(n._rotation),i.copy(e),i.multiply(t),n._rotation.x=a.toPrecision(i.x,4),n._rotation.y=a.toPrecision(i.y,4),n._rotation.z=a.toPrecision(i.z,4),n._rotation.w=a.toPrecision(i.w,4),n._zoom=a.toPrecision(this.currentScale*this.camera.aspect,4),n}}(),t.exports=l},function(t,e){t.exports={PanoRenderComplete:"panorama.render.complete",TileRenderFailure:"panorama.tile.render.failed",TileRenderSuccess:"panorama.tile.render.success",TileUploadAttempted:"panorama.tile.upload.attempted",UploadAttemptedForAllTiles:"panorama.upload.attempted.all.tiles"}},function(t,e){var i,n,r={};r.RADIANS_PER_DEGREE=Math.PI/180,r.DEGREES_PER_RADIAN=180/Math.PI,r.Vector3=function(t,e,i){this.x=t||0,this.y=e||0,this.z=i||0},r.Matrix4=function(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])},r.Matrix4.prototype={identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},copy:function(t){return this.elements.set(t.elements),this},applyToVector3:function(t){var e=t.x,i=t.y,n=t.z,r=this.elements;return t.x=r[0]*e+r[4]*i+r[8]*n+r[12],t.y=r[1]*e+r[5]*i+r[9]*n+r[13],t.z=r[2]*e+r[6]*i+r[10]*n+r[14],this},getInverse:function(t,e){var i=this.elements,n=t.elements,r=n[0],o=n[1],a=n[2],s=n[3],l=n[4],u=n[5],h=n[6],c=n[7],d=n[8],p=n[9],f=n[10],m=n[11],g=n[12],v=n[13],y=n[14],b=n[15],w=p*y*c-v*f*c+v*h*m-u*y*m-p*h*b+u*f*b,x=g*f*c-d*y*c-g*h*m+l*y*m+d*h*b-l*f*b,M=d*v*c-g*p*c+g*u*m-l*v*m-d*u*b+l*p*b,T=g*p*h-d*v*h-g*u*f+l*v*f+d*u*y-l*p*y,S=r*w+o*x+a*M+s*T;if(0===S){if(e)throw new Error("MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0");return this.identity()}var _=1/S;return i[0]=w*_,i[1]=(v*f*s-p*y*s-v*a*m+o*y*m+p*a*b-o*f*b)*_,i[2]=(u*y*s-v*h*s+v*a*c-o*y*c-u*a*b+o*h*b)*_,i[3]=(p*h*s-u*f*s-p*a*c+o*f*c+u*a*m-o*h*m)*_,i[4]=x*_,i[5]=(d*y*s-g*f*s+g*a*m-r*y*m-d*a*b+r*f*b)*_,i[6]=(g*h*s-l*y*s-g*a*c+r*y*c+l*a*b-r*h*b)*_,i[7]=(l*f*s-d*h*s+d*a*c-r*f*c-l*a*m+r*h*m)*_,i[8]=M*_,i[9]=(g*p*s-d*v*s-g*o*m+r*v*m+d*o*b-r*p*b)*_,i[10]=(l*v*s-g*u*s+g*o*c-r*v*c-l*o*b+r*u*b)*_,i[11]=(d*u*s-l*p*s-d*o*c+r*p*c+l*o*m-r*u*m)*_,i[12]=T*_,i[13]=(d*v*a-g*p*a+g*o*f-r*v*f-d*o*y+r*p*y)*_,i[14]=(g*u*a-l*v*a-g*o*h+r*v*h+l*o*y-r*u*y)*_,i[15]=(l*p*a-d*u*a+d*o*h-r*p*h-l*o*f+r*u*f)*_,this},makeRotationFromQuaternion:function(t){var e=this.elements,i=t.x,n=t.y,r=t.z,o=t.w,a=i+i,s=n+n,l=r+r,u=i*a,h=i*s,c=i*l,d=n*s,p=n*l,f=r*l,m=o*a,g=o*s,v=o*l;return e[0]=1-(d+f),e[4]=h-v,e[8]=c+g,e[1]=h+v,e[5]=1-(u+f),e[9]=p-m,e[2]=c-g,e[6]=p+m,e[10]=1-(u+d),e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this}},r.Quaternion=function(t,e,i,n){this._x=t||0,this._y=e||0,this._z=i||0,this._w=void 0!==n?n:1},r.Quaternion.prototype={get x(){return this._x},set x(t){this._x=t},get y(){return this._y},set y(t){this._y=t},get z(){return this._z},set z(t){this._z=t},get w(){return this._w},set w(t){this._w=t},copy:function(t){this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w},inverse:function(){return this.conjugate().normalize()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this},setFromAxisAngle:function(t,e){var i=e/2,n=Math.sin(i);return this._x=t.x*n,this._y=t.y*n,this._z=t.z*n,this._w=Math.cos(i),this},setFromUnitVectors:function(t,e){return void 0===i&&(i=new r.Vector3),(n=r.dot(t,e)+1)<1e-6?(n=0,Math.abs(t.x)>Math.abs(t.z)?r.setVector(i,-t.y,t.x,0):r.setVector(i,0,-t.z,t.y)):r.cross(t,e,i),this._x=i.x,this._y=i.y,this._z=i.z,this._w=n,this.normalize()},multiply:function(t){return this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var i=t._x,n=t._y,r=t._z,o=t._w,a=e._x,s=e._y,l=e._z,u=e._w;return this._x=i*u+o*a+n*l-r*s,this._y=n*u+o*s+r*a-i*l,this._z=r*u+o*l+i*s-n*a,this._w=o*u-i*a-n*s-r*l,this}},r.convertWorkshopVector=function(t){return new r.Vector3(-t.x,t.y,t.z)},r.convertWorkshopQuaternion=function(t){return new r.Quaternion(-t.x,t.y,t.z,-t.w).multiply(new r.Quaternion(Math.sqrt(2)/2,Math.sqrt(2)/2,0,0))},r.convertWorkshopOrthoZoom=function(t){return-1===t?-1:t/4},r.convertWorkshopPanoramaQuaternion=function(t){return new r.Quaternion(t.x,-t.y,-t.z,t.w).normalize().multiply((new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0),270*r.RADIANS_PER_DEGREE))},r.normalize=function(t){var e=t.x*t.x+t.y*t.y+t.z*t.z,i=Math.sqrt(e);t.x/=i,t.y/=i,t.z/=i},r.dot=function(t,e){return t.x*e.x+t.y*e.y+t.z*e.z},r.cross=function(t,e,i){var n=t.x,r=t.y,o=t.z;i.x=r*e.z-o*e.y,i.y=o*e.x-n*e.z,i.z=n*e.y-r*e.x},r.setVector=function(t,e,i,n){t.x=e,t.y=i,t.z=n},r.copyVector=function(t,e){e.x=t.x,e.y=t.y,e.z=t.z},r.addVector=function(t,e){t.x+=e.x,t.y+=e.y,t.z+=e.z},r.subVector=function(t,e){t.x-=e.x,t.y-=e.y,t.z-=e.z},r.applyQuaternionToVector=function(t,e){var i=e.x,n=e.y,r=e.z,o=t.x,a=t.y,s=t.z,l=t.w,u=l*i+a*r-s*n,h=l*n+s*i-o*r,c=l*r+o*n-a*i,d=-o*i-a*n-s*r;e.x=u*l+d*-o+h*-s-c*-a,e.y=h*l+d*-a+c*-o-u*-s,e.z=c*l+d*-s+u*-a-h*-o},r.angleBetweenVectors=function(t,e){return Math.acos(r.dot(t,e))},t.exports=r},function(t,e,i){(function(e){function n(t){o.call(this,t),this.panoId=t.panoId,this.orthoZoom=t.orthoZoom,this.floorVisibility=t.floorVisibility,this.thumbUrl=t.thumbUrl,this.name=t.name,this.isHero=t.isHero,this.script=t.script,this.cameraType=t.cameraType}var r=(i(0),i(2)),o=(i(1),i(5),i(7),i(8),i(10),i(11),i(16),i(58));i(4).EventEmitter,new r(e),n.prototype=Object.create(o.prototype),n.prototype.isPano=function(){return this.panoId&&""!==this.panoId},t.exports=n}).call(this,"/js/objects/Snapshot.js")},function(t,e,i){(function(e){var n=i(0),r=i(4).EventEmitter;function o(t){t=t||{},this.position=new n.Vector3,this.quaternion=new n.Quaternion,this.update(t)}n=i(0);var a=i(2);i(1),i(5),i(7),i(8),i(10),i(11),i(16),r=i(4).EventEmitter;new a(e),o.prototype=Object.create(r.prototype),o.prototype.isValid=function(){return!!this.cameraMode},o.prototype.update=function(t){return this.cameraMode=t.cameraMode||this.cameraMode,this.pano=t.pano||this.pano,t.position&&this.position.copy(t.position),t.quaternion&&this.quaternion.copy(t.quaternion),this},t.exports=o}).call(this,"/js/objects/View.js")},function(t,e,i){var n=i(0),r=i(5),o=i(8),a=i(20),s=new n.ShaderPass(n.HorizontalBlurShader),l=new n.ShaderPass(n.VerticalBlurShader);l.renderToScreen=!0;var u=(window.renderWidth || window.innerWidth)/(window.renderHeight || window.innerHeight);isNaN(u)&&(u=1);var h={currentBlur:0,aspect:u,blurStrength:1,hblurPass:s,vblurPass:l,bindEvents:function(t){t.on(a.ModeChanged,(function(t,e){t===r.PANORAMA&&(o.cancel(h.blur),o.cancel(h.addBlur),o.start(h.removeBlur,500,null,0,null,"deblur"))}))},blur:function(t){h.currentBlur=1;var e=t*h.blurStrength;l.uniforms.v.value=e/512*h.aspect,s.uniforms.h.value=e/512},addBlur:function(t){t=Math.max(t,h.currentBlur),h.blur(t)},removeBlur:function(t){t=Math.min(1-t,h.currentBlur),h.blur(t)}};h.blur(1),t.exports=h},function(t,e,i){var n=(i(0),i(7)),r=i(14),o=i(21),a=i(4).EventEmitter;function s(){this.modelMap={},this.activeModel=null,this.modelCount=0,this.tileDownloader=null,this.panoRenderer=null}s.prototype.init=function(t,e,i){this.tileDownloader=t,this.panoRenderer=e,this.qualityManager=i},s.prototype.addModel=function(t){this.modelMap[t.modelid]=t,0===this.modelCount&&this.activateModel(t.modelid),this.modelCount++,this.emit(o.ModelAdded)},s.prototype.activateModel=function(t){var e=this.modelMap[t];if(!e)throw new r("Tried to activate invalid model!");var i=this.activeModel;this.activeModel=e,this.tileDownloader.setPanoData(e.panos,e.listImagePanos(),e.modelid),this.tileDownloader.setUrls(e.urls),e.panos.forEach(function(t){t.attachToPanoRenderer(this.panoRenderer),t.tileDownloader=this.tileDownloader,t.qualityManager=this.qualityManager}.bind(this)),this.emit(o.ActiveModelChanged,{oldModel:i,model:e})},s.prototype.getActiveModel=function(){return this.activeModel},n.extend(s,a),t.exports=s},function(t,e,i){var n=i(0),r=i(1);function o(){n.PerspectiveCamera.call(this,r.dollhouseFOV,(window.renderWidth || window.innerWidth)/(window.renderHeight || window.innerHeight),r.dollhouseNear,r.dollhouseFar),this.controls=null}o.prototype=Object.create(n.PerspectiveCamera.prototype),o.prototype.updateAspect=function(t){this.aspect=t,this.updateProjectionMatrix()},t.exports=o},function(t,e,i){var n=i(0),r=i(1);function o(){var t=(window.renderWidth || window.innerWidth)/(window.renderHeight || window.innerHeight);n.OrthographicCamera.call(this,-r.orthoBase,r.orthoBase,r.orthoBase/t,-r.orthoBase/t,r.orthoNear,r.orthoFar),this.controls=null,this.updateAspect(t)}o.prototype=Object.create(n.OrthographicCamera.prototype),o.prototype.updateAspect=function(t){this.aspect=t,this.top=r.orthoBase/t,this.bottom=-r.orthoBase/t,this.updateProjectionMatrix()},t.exports=o},function(t,e){t.exports=Object.freeze({Standard:0,Slow:1,Retain:2})},function(t,e){t.exports=Object.freeze({Show:0,Hide:1,Retain:2})},function(t,e){t.exports=Object.freeze({None:0,Queued:1,ForceQueued:2,Downloading:3,Downloaded:4,DownloadFailed:5})},function(t,e){t.exports={STAY3D:1,FLYTOPANO:2,STARTPANO:3}},function(t,e,i){var n=i(0),r=i(1),o=null;function a(t){o=this,this.player=t,this.raycaster=this.player.raycaster,this.camera=this.player.camera;this.perspectiveCamera=new n.PerspectiveCamera(r.insideFOV,(window.renderWidth || window.innerWidth)/(window.renderHeight || window.innerHeight),r.insideNear,r.insideFar),this.sRender=t.sRender,this.scene=this.sRender.scene,this.lookVector=new n.Vector2,this.renderTarget=new n.WebGLRenderTarget(512,512),this.lensMesh=null}a.prototype.createNewColliders=function(){return!1},a.prototype.createMeasureLens=function(){return!1},a.prototype.onMouseMove=function(t,e,i){return e.chunks.forEach((function(t){t.material.uniforms.mouseAPosition&&t.material.uniforms.measureMode&&(t.material.uniforms.mouseAPosition.value.copy(i),t.material.uniforms.measureMode.value=1)})),!1},a.prototype.show=function(){return!1},a.prototype.hide=function(){return!1},a.prototype.update=function(){return!1},a.prototype.render=function(){this.sRender.mesaueLensRender(o.scene,o.perspectiveCamera,o.renderTarget,!0)},t.exports=a},function(t,e,i){"use strict";function n(){this.enabled=!0}n.prototype.echo=function(t,e){this.enabled&&t.apply(console,e)},n.prototype.log=function(){this.echo(console.debug,arguments)},n.prototype.info=function(){this.echo(console.info,arguments)},n.prototype.debug=function(){this.echo(console.debug,arguments)},n.prototype.warn=function(){this.echo(console.warn,arguments)},n.prototype.error=function(){this.echo(console.error,arguments)};var r=new n;G.ncz_my_log=r,t.exports=r},function(t,e,i){"use strict";var n=i(0),r=i(132);function o(t){this.id=t,this.postil=null,this.settingItem=null}o.prototype.init=function(t){var e;(this.postilEngine={type_1:this.createTorus,type_2:this.createRect},t)||(this.settingItem=new r(this.id),1===this.settingItem.type&&(e=328),2===this.settingItem.type&&(e=320),this.postil=this.postilEngine["type_"+this.id].call(this,8,e,"#ff0000"),this.settingItem.uuid=this.postil.uuid);t&&(this.settingItem=t,1===t.type&&(e=328),2===t.type&&(e=320),this.postil=this.postilEngine["type_"+this.id].call(this,t.fat,e,t.color),this.postil.position.copy(t.position),this.postil.scale.copy(t.scale));return this.settingItem.uuid=this.postil.uuid,this.settingItem.position=this.postil.position,this.settingItem.scale=this.postil.scale,this.initUserData(),this.postil},o.prototype.initUserData=function(){this.postil.name="postil_"+(new Date).getTime(),this.postil.userData.PostilModel=this,this.postil.userData.fat=this.settingItem.fat,this.postil.userData.type="postil",this.postil.userData.follow_mouse=!1,this.postil.userData.box_line=null,this.postil.userData.transform_control=null,this.postil.userData.setting_item=this.settingItem},o.prototype.createTorusTexture=function(t,e,i){var r=document.createElement("canvas"),o=r.getContext("2d"),a=1024,s=a*(t/e);r.width=a*(window.devicePixelRatio?window.devicePixelRatio:1),r.height=a*(window.devicePixelRatio?window.devicePixelRatio:1),o.beginPath(),o.lineWidth=s,o.strokeStyle=i||"#ff0000",o.arc(r.width/2,r.height/2,(r.width-s)/2,0,360,!1),o.stroke(),o.closePath(),window.devicePixelRatio&&o.scale(window.devicePixelRatio,window.devicePixelRatio);var l=new n.CanvasTexture(r);return l.minFilter=n.LinearFilter,l.magFilter=n.LinearFilter,l},o.prototype.createRectTexture=function(t,e,i){var r=document.createElement("canvas"),o=r.getContext("2d"),a=1024,s=a*(t/e);r.width=a*(window.devicePixelRatio?window.devicePixelRatio:1),r.height=a*(window.devicePixelRatio?window.devicePixelRatio:1),o.lineWidth=s,o.strokeStyle=i||"#ff0000",o.moveTo(0,0),o.lineTo(r.width,0),o.lineTo(r.width,r.height),o.lineTo(0,r.height),o.lineTo(0,0),o.stroke(),window.devicePixelRatio&&o.scale(window.devicePixelRatio,window.devicePixelRatio);var l=new n.CanvasTexture(r);return l.minFilter=n.LinearFilter,l.magFilter=n.LinearFilter,l},o.prototype.createPostilOfTexture=function(t){var e=new n.PlaneBufferGeometry(.5,.5),i=new n.MeshBasicMaterial({map:t,side:n.DoubleSide,transparent:!0,depthTest:!1,depthWrite:!1}),r=new n.Mesh(e,i);return r.scale.divideScalar(2),r},o.prototype.createTorus=function(t,e,i){var n=this.createTorusTexture(t,e,i),r=this.createPostilOfTexture(n);return r.userData.default_scale=r.scale.clone(),r.userData.default_size={width:328,height:328},r.userData.default_fat=8,r},o.prototype.createRect=function(t,e,i){var n=this.createRectTexture(t,e,i),r=this.createPostilOfTexture(n);return r.userData.default_scale=r.scale.clone(),r.userData.default_size={width:320,height:320},r.userData.default_fat=8,r},t.exports=o},function(t,e){t.exports={ActionInterrupted:"action.interrupted"}},function(t,e){t.exports={Normal:0,Audio:1,Video:2,IFrame:3}},function(t,e,i){(function(e){new(i(2))(e);var n={parseIdsFromChunkName:function(t,e){e.floorId=n.parseFloor(t),e.roomId=n.parseRoom(t)},parseFloor:function(t){var e,i=t.match(/block_([0-9]+)/);if(!i)return 0;try{e=parseInt(i[1],10)}catch(t){return 0}return this.getfid(e)},getfid:function(t){for(var e=G.settings.building.blocks,i=e.length||0,n=0;n<i;n++)if(e[n].blockidx===t)return e[n].flooridx;return 0},getflooridx:function(){for(var t=G.model.chunks,e=0;e<t.length;e++)if(G.model.chunks[e].id===G.interchunkid)return this.getfid(e);return 0},getrid:function(t){for(var e=G.settings.building.blocks,i=e.length||0,n=0;n<i;n++)if(e[n].blockidx===t)return e[n].roomidx;return 0},parseRoom:function(t){var e,i=t.match(/block_([0-9]+)/);if(!i)return 0;try{e=parseInt(i[1],10)}catch(t){return 0}return this.getrid(e)}};t.exports=n}).call(this,"/js/model/Chunks.js")},function(t,e,i){var n=i(4).EventEmitter,r=function(){this.audioContext=null,window.AudioContext=window.AudioContext||window.webkitAudioContext||window.mozAudioContext||window.msAudioContext,window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame,window.cancelAnimationFrame=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame;try{this.audioContext=new AudioContext}catch(t){}this.audioContext||alert("该浏览器不支持AudioContext,讲房无法正常使用!"),this.bufferList={},this.cellList={}};r.prototype.load=function(t){var e=new XMLHttpRequest;e.open("GET",t,!0),e.responseType="arraybuffer";var i=this;this.audioContext&&(i.cellList[t]=new o(this.audioContext)),e.onload=function(){i.audioContext&&i.audioContext.decodeAudioData(e.response,(function(e){e&&i.cellList[t].setBuffer(e)}))},e.onerror=function(){},e.send()},r.prototype.getCell=function(t){return null!==this.cellList[t]?this.cellList[t]:null};var o=function(t){this.audioContext=t,this.audioBuffer=null,this.source=null,this.pauseTime=0,this.startTime=0,this.readyState=0,this.oncanplay=function(){},this.audioContext&&this.audioContext.addEventListener("ended",(function(){})),this._ended=this._ended.bind(this);var e=this;Object.defineProperty(this,"contextCurrentTime",{get:function(){return e.audioContext.currentTime},set:function(t){t,e.pauseTime=t}}),Object.defineProperty(this,"currentTime",{get:function(){return e.audioContext.currentTime-e.startTime},set:function(t){t,e.pauseTime=t}}),Object.defineProperty(this,"duration",{get:function(){return e.audioBuffer.duration}}),this.keeprunning=this.keeprunning.bind(this),document.body.addEventListener("touchend",this.keeprunning,!1)};o.prototype=Object.create(n.prototype),o.prototype.setBuffer=function(t){this.audioBuffer=t,this.readyState=4,this.oncanplay()},o.prototype.keeprunning=function(){if("running"!==this.audioContext){var t=this;this.audioContext.resume();var e=setTimeout((function(){"running"===t.audioContext.state&&clearTimeout(e)}),0)}},o.prototype.play=function(){var t=0;0!==this.pauseTime&&(t=this.pauseTime,this.pauseTime=0);var e=this.audioContext,i=e.createBufferSource();i.connect(e.destination),i.buffer=this.audioBuffer,i.start||(i.start=i.noteOn,i.stop=i.noteOff),this.source=i,this.startTime=this.contextCurrentTime,i.onended=this._ended,i.start(0,t)},o.prototype._ended=function(){this.emit("play_done")},o.prototype.pause=function(){null!==this.source&&(this.pauseTime=this.contextCurrentTime-this.startTime,this.source.disconnect())},o.prototype.stop=function(){null!==this.source&&this.source.disconnect()};var a,s=(a=null,function(){return null===a&&(a=new r),a});t.exports=s},function(t,e,i){function n(){var t=new r.SphereBufferGeometry(a.skyboxRadius,20,5),e=new r.RawShaderMaterial({fragmentShader:o.skysphere.fragmentShader,vertexShader:o.skysphere.vertexShader,uniforms:r.UniformsUtils.clone(o.skysphere.uniforms),side:r.BackSide,name:"skysphere"});e.uniforms.radius.value=t.parameters.radius,r.Mesh.call(this,t,e)}var r=i(0),o=i(12),a=i(1);n.prototype=Object.create(r.Mesh.prototype),n.prototype.constructor=n,t.exports=n},function(t,e,i){(function(e){function n(t){t.camera&&(t.camera.quaternion=r(t.camera.quaternion)),t.pano&&(t.pano.quaternion=r(t.pano.quaternion))}function r(t){return t=t||new c.Quaternion,0===Math.abs(t.x)&&0===Math.abs(t.y)&&0===Math.abs(t.z)&&0===Math.abs(t.w)&&(t.w=1),t}function o(t){return a.deserialize(t)}var a=i(182),s=i(9),l=i(3),u=i(5),h=i(2),c=i(0),d=new h(e);t.exports={optionsFromString:o,getStartCameraOptions:function(t,e,i,r){var a={};if(r||(a=function(t){var e=l.valueFromHash("start",""),i={};""!==e&&(d.debug("Start override found in parameters, trying to parse..."),(i=o(e)||{}).tag=l.valueFromHash("tag",null),i.panoId&&(i.pano=t.get(i.panoId)));return i}(e)),""!=(a=function(t){var e=l.valueFromHash("o",""),i={};e||(e=t.data.orientationkey);if(e){var n=t.data.orientations;if(null!=n&&null!=n){var r=n.length;for(i=0;i<r;i++)if(n[i].key==e)return n[i]}}return i}(t))&&a.enable){var h=a.location_id,p=a.rotation,f=e.list.length;if(1==a.type){a.mode=u.PANORAMA;for(i=0;i<f;i++)e.list[i].id==h&&(a.pano=e.list[i],a.position=a.pano.position,a.quaternion=p);return a.quaternion&&(a.quaternion=s.convertWorkshopQuaternion(a.quaternion)),a}for(i=0;i<f;i++)e.list[i].id==h&&(a.pano=e.list[i],a.position=a.pano.position,a.quaternion=a.pano.quaternion);return a}var m=l.valueFromHash("l","");if(""!=m){h=m,f=e.list.length;a.mode=u.PANORAMA;for(i=0;i<f;i++)e.list[i].id==h&&(a.pano=e.list[i],a.position=a.pano.position,a.quaternion=a.pano.quaternion);return a.quaternion&&(a.quaternion=s.convertWorkshopQuaternion(a.quaternion)),a}var g=function(t){var e=t.data.images.scenes,i=t.settings;if(i.jf&&i.jf.enable&&i.jf.dataset.length>0)return e[0]._camera;for(var n=0;n<e.length;n++){var r=e[n];if(null!==r.name&&"总述"!==r.name)return r._camera}return""}(t);if(""!==g){h=g._locationid,f=e.list.length,p=g._rotation;a.mode=u.PANORAMA;for(i=0;i<f;i++)e.list[i].id==h&&(a.pano=e.list[i],2==g._type?a.quaternion=a.pano.quaternionAutoScene:a.quaternion=p,a.position=a.pano.position);if(a.quaternion){var v=a.quaternion;a.quaternion=new c.Quaternion(v.x,v.y,v.z,v.w)}return a}var y=t.data.camera_start;if(y)try{n(y),Object.keys(y).length>0&&0===Object.keys(a).length&&(a.mode=u.convertWorkshopModeInt(y.mode),a.position=y.camera.position,a.quaternion=y.camera.quaternion,a.zoom=s.convertWorkshopOrthoZoom(y.camera.zoom),y.pano&&(a.pano=e.get(y.pano.locationid),d.debug("Using camera_start"),d.debug("Modeldata pano: ",a.pano.quaternion),d.debug("Camera start pano: ",y.pano.quaternion)),a.mode!==u.PANORAMA&&(a.floorVisibility=t.heroImage._camera.floor_visibility))}catch(t){d.warn(t.message)}if(0===Object.keys(a).length&&(a=function(t,e){if(!t.heroImage||!t.heroImage._camera._viewpoint)return{};var i={},n=t.heroImage._camera;d.debug("Using start position from thumbnail image"),i.position=n._viewpoint,i.quaternion=n._rotation;try{i.mode=u.convertWorkshopModeInt(0),i.mode===u.PANORAMA?i.pano=e.get(n._locationid):i.floorVisibility=n.floor_visibility}catch(t){d.debug(t.message)}return i}(t,e)),t.outsideAllowed()||a.mode===u.PANORAMA||(a={}),0===Object.keys(a).length){for(i=0;i<e.list.length&&1!=e.list[i].alignmentType;i++);a.pano=e.list[i],a.position=a.pano.position,a.quaternion=a.pano.quaternionAutoScene,d.info("Starting at 1st pano "+a.pano.id)}return a.mode=a.mode||u.PANORAMA,a.pano||(d.debug("No pano selected, choosing the closest one to player location"),a.pano=e.findClosest(a.position||i)),a.mode===u.MESH&&(a.mode=u.PANORAMA,a.position=a.pano?a.pano.position:i),a}}}).call(this,"/js/util/camera.js")},function(t,e){t.exports={TileDownloadSuccess:"tiledownloader.download.success",TileDownloadFailure:"tiledownloader.download.failure",PanoDownloadComplete:"tiledownloader.pano.download.complete"}},function(t,e,i){var n=i(78),r=i(3),o=i(1),a=i(2);t.exports.HousePlay=n,t.exports.Browser=r,t.exports.Config=o,t.exports.Logger=a},function(t,e,i){"use strict";(function(e){window.G={},G.conf={isNewServerPreviewVersion:!1,isNewEditVersion:!1,isCleanUI:0,jfedit:!1,screenshot:!1,modelplaced:!0,modelMeasure:!1,annotation:!1,publicity:!1},i(79),i(80),i(81),i(82),i(83),i(84),i(85),i(86),i(87),i(88),i(89),i(90),i(91),i(92),i(93),i(94),i(95),i(96),i(97),i(10),i(11);var n=i(0),r=i(98),o=i(144),a=i(60),s=i(145),l=i(5),u=i(2),h=i(146),c=i(3),d=i(1),p=i(8),f=i(59),m=i(74),g=(i(25),i(75)),v=i(183),y=i(4).EventEmitter,b=i(184),w=i(186),x=i(191),M=i(195),T=i(196),S=(i(42),i(198)),_=i(199),A=i(48),P=i(66),C=i(20),E=i(27),D=i(201),L=i(28)(),O=i(202);function I(t){t.stopPropagation(),t.preventDefault()}function R(t){y.defaultMaxListeners=1e3,function(t){t.addEventListener("dragenter",I,!1),t.addEventListener("dragover",I,!1)}(t)}function N(t){!function t(e){for(var i in e)"object"==typeof e[i]?t(e[i]):"string"==typeof e[i]&&(e[i]=e[i].replace("modelcdn.3dnest.cn","modelcdn2.3dnest.cn").replace("infocdn.3dnest.cn","infocdn2.3dnest.cn").replace("template.3dnest.cn","template2.3dnest.cn"))}(t)}function k(t,e,i,n){return n.progressCallback=e,t.load(i).progress(F.bind(this,n))}function F(t,e){var i;t.modelElementsToLoad=e[1],(i=t).totalElementsToLoad=i.modelElementsToLoad+i.panoElementsToLoad,function(t){t.totalElementsLoaded++,t.totalPercentageLoaded=t.totalElementsLoaded/t.totalElementsToLoad,t.progressCallback&&t.progressCallback(100*t.totalPercentageLoaded)}(t)}function B(t,e,i){try{t.start(e)}catch(t){throw i.modelid,(n=c.details())&&"Safari"===n.name&&n.version>500&&n.version,t}var n}u.level=d.logLevel,u.consoleEnabled=d.console;var z=function(t){if(this.event={load:new y,player:new y,director:new y,model:new y},this.playContainer=void 0!==t.container?t.container:document.getElementById("player"),this.modelId=void 0!==t.modelId?t.modelId:"",this.settings=void 0!==t.settings?t.settings:{},this.version=void 0!==t.version?t.version:{},this.siteConf=void 0!==t.siteConf?t.siteConf:{},this.enterType=void 0!==t.enterType?t.enterType:2,this.loadingState=!1,this.compassAngle=0,this.lastCompassAngle=0,this.settings.basic.menu&&(d.unit_type=this.settings.basic.menu.unit_type||0,1===d.unit_type&&(d.unit_conversion_value=3.28,d.unit_name="ft",d.unit_sq_name="ft²")),!this.modelId)return this.event.error.emit("invalid_modelid");var e=this.settings.building.blocks;if(e&&this.settings.building)for(var i=0;i<e.length;i++)e[i].blockidx=parseInt(e[i].blockidx),e[i].flooridx=parseInt(e[i].flooridx),e[i].roomidx=parseInt(e[i].roomidx);else this.settings.building.blocks={};G.url=G.url||{},G.url.modelid=this.modelId,G.url.type=this.siteConf.type,window.PREFETCHED_MODELDATA=this.settings;var n=this;this.progStruct={panoElementsToLoad:6,modelElementsToLoad:0,totalElementsLoaded:0,totalElementsToLoad:0,totalPercentageLoaded:0,progressCallback:null},this.qFlag=d.quickstart.enabled,this.quickstartManager=null,this.startOptions=null,this.player=null,this.director=null,this.mattertagManager=null,this.sceneRenderer=null,this.tileDownloader=null,this.qualityManager=null,this.model=null,this.Controller=null,this.panoRenderer=null,this.quickStart=null,this.panoramaSize=new D,this.panoramaSize.on("updatePanoSize",(function(t,e,i){n.panoramaSize.enable&&n.emit("updatePanoSize",t,e,i)})),this.record=null,this.playType="heighlight",R(this.playContainer);var r,o,a=(this.modelId,r=this.version,this.settings,(o=this.siteConf).type,{modelLink:o.modelpre+r.version,infoLink:o.infopre+r.version});G.url.model=a.modelLink,G.url.info=a.infoLink,G.settings=this.settings||{},N(this.settings),this._updatePanorameSize=this._updatePanorameSize.bind(this),this._emitAngle=this._emitAngle.bind(this),this._emitFloorChange=this._emitFloorChange.bind(this),this._emitSpinnerState=this._emitSpinnerState.bind(this),this._emitFlyingEnd=this._emitFlyingEnd.bind(this),this._emitHighlightsBarChange=this._emitHighlightsBarChange.bind(this),this._emitModeChange=this._emitModeChange.bind(this),this._emitMoveState=this._emitMoveState.bind(this),this._emitUpdateTour=this._emitUpdateTour.bind(this),this._emitPanoChange=this._emitPanoChange.bind(this),this._emitPnaoChosen=this._emitPnaoChosen.bind(this),this._emitStopTour=this._emitStopTour.bind(this),this._emitLoadProgress=this._emitLoadProgress.bind(this),this._emitExitMeasureActive=this._emitExitMeasureActive.bind(this),this._emitChoosedHumanModel=this._emitChoosedHumanModel.bind(this),this._emitHumanModelIsLoaded=this._emitHumanModelIsLoaded.bind(this),this._emitAddModelListItem=this._emitAddModelListItem.bind(this),this._emitDeletePutModelSuccess=this._emitDeletePutModelSuccess.bind(this),this._emitHidePutModelInfoPanel=this._emitHidePutModelInfoPanel.bind(this),this._emitShowLoaddingOfLoadPutModel=this._emitShowLoaddingOfLoadPutModel.bind(this),this._emitHideLoaddingOfLoadPutModel=this._emitHideLoaddingOfLoadPutModel.bind(this),this._emitPutModelListLoadingIsOver=this._emitPutModelListLoadingIsOver.bind(this),this._emitResetPutModelInfo=this._emitResetPutModelInfo.bind(this),this._emitSetPutModelToolsPosition=this._emitSetPutModelToolsPosition.bind(this),this._emitHidePutModelSetTools=this._emitHidePutModelSetTools.bind(this),this._emitShowPutModelSetTools=this._emitShowPutModelSetTools.bind(this),this._emitViewModeTransitioning=this._emitViewModeTransitioning.bind(this),this._emitViewModePanorama=this._emitViewModePanorama.bind(this),this._emitShowModelListPanel=this._emitShowModelListPanel.bind(this),this._emitHideModelListPanel=this._emitHideModelListPanel.bind(this),this._emitUpdatePostilShow=this._emitUpdatePostilShow.bind(this),this._emitChoosedPostil=this._emitChoosedPostil.bind(this),this._emitAddPostilItem=this._emitAddPostilItem.bind(this),this._emitUpdatePostilUI=this._emitUpdatePostilUI.bind(this),this._emitHidePostilSetTool=this._emitHidePostilSetTool.bind(this),this._emitDeletePostilSuccess=this._emitDeletePostilSuccess.bind(this),this._emitShowDeleteDialogOfPostil=this._emitShowDeleteDialogOfPostil.bind(this),this._emitShowEditPanelOfPostil=this._emitShowEditPanelOfPostil.bind(this),this._emitShowAllPostils=this._emitShowAllPostils.bind(this),this._emitHideAllPostils=this._emitHideAllPostils.bind(this),this._emitEditConfirm=this._emitEditConfirm.bind(this),this._emitChoosedWeapon=this._emitEditProbeModel.bind(this),this._emitPutProbeModelComplete=this._emitPutProbeModelComplete.bind(this),this._emitGetMeasurementInfo=this._emitGetMeasurementInfo.bind(this),this._emitAddHumanLabel=this._emitAddHumanLabel.bind(this),this._emitChoosedVirtualCamera=this._emitChoosedVirtualCamera.bind(this),this._emitHideAllHumanLabel=this._emitHideAllHumanLabel.bind(this),this._emitAddVirtualCameraLabel=this._emitAddVirtualCameraLabel.bind(this),this._emitHideAllVirtualCameraLabel=this._emitHideAllVirtualCameraLabel.bind(this),this._emitShowVirtualCameraInfo=this._emitShowVirtualCameraInfo.bind(this),this._emitHideVirtualCameraInfo=this._emitHideVirtualCameraInfo.bind(this),this._emitHideRightTools=this._emitHideRightTools.bind(this),this._emitShowRightTools=this._emitShowRightTools.bind(this),this._emitPutModelFollowMouse=this._emitPutModelFollowMouse.bind(this),this._emitPutModelFollowMouseOver=this._emitPutModelFollowMouseOver.bind(this),this._emitPutModelFollowMouseCancel=this._emitPutModelFollowMouseCancel.bind(this),this._emitQuitPutMode=this._emitQuitPutMode.bind(this),this._emitViewModeDollhouse=this._emitViewModeDollhouse.bind(this),this._emitShowVirtualHumanInfo=this._emitShowVirtualHumanInfo.bind(this),this._emitHideVirtualHumanInfo=this._emitHideVirtualHumanInfo.bind(this),this._emitHandleControlPanoramaMove=this._emitHandleControlPanoramaMove.bind(this),this._emitHandleControlDollhouseMove=this._emitHandleControlDollhouseMove.bind(this),this._emitUpateUiRoate=this._emitUpateUiRoate.bind(this),this.registryOri()};function U(t,e){}(z.prototype=Object.create(y.prototype)).start=function(t,i){var u="quickstart"===t||d.quickstart.enabled,y=null,C=null,E=this;this.loadingState=!0,this.record=new O,G.R=this.record,h.initS({url:this.modelId,floors:c.valueFromHash("f",!0),autoload:!1},this.settings).then((function(t){return E.model=t,E.model.startup_type===P.STARTPANO&&(u=!0,d.quickstart.enabled=!0),E.model.loadPanos()})).then((function(){y=g.getStartCameraOptions(E.model,E.model.panos,new n.Vector3(0,0,0),!0),E.sceneRenderer=function(t){var e=new n.PerspectiveCamera,i=new n.Scene,r=new n.AmbientLight(16053492,1);i.add(r);var o=new n.HemisphereLight(16053492,4473924,1);return i.add(o),i.skybox=new m,i.add(i.skybox),i.plane=new n.Mesh(new n.PlaneBufferGeometry(1e5,1e5),new n.RawShaderMaterial({side:n.DoubleSide})),i.plane.position.y=0,i.plane.rotateX(-Math.PI/2),i.plane.material.visible=!1,i.add(i.plane),d.showScreenshotLocations&&t.data.images.forEach((function(t){if(t._camera&&t._camera._viewpoint){var e=t._camera._viewpoint,r=new n.Mesh(new n.BoxGeometry(.3,.3,.3));r.position.copy(e.clone()),i.add(r);var o=t._camera._viewpoint,a=new n.Vector3(0,0,-1).applyQuaternion(o);i.add(new n.ArrowHelper(a,e.clone(),1,16711680))}})),d.showAxis&&(i.add(new n.ArrowHelper(new n.Vector3(0,1,0),new n.Vector3(0,0,0),1,255)),i.add(new n.ArrowHelper(new n.Vector3(0,0,1),new n.Vector3(0,0,0),1,16711680)),i.add(new n.ArrowHelper(new n.Vector3(1,0,0),new n.Vector3(0,0,0),1,65280))),new w(i,e,f)}(E.model),C=function(t,e,i,n){var l=t?1:1e3,u=new M,h=new S({concurrentDownloads:c.valueFromHash("tileconc",4)}),d=new _,f=new a,m=new o,g=new r(e),v=new s(l),y=new T;return u.init(f),h.init(u),d.init(i,h,u),f.init(h,d,u),f.addModel(n),i.addComponent(p),{qualityManager:u,panoRenderer:d,tileDownloader:h,player:g,director:m,modelManager:f,mattertagManager:y,displayController:v}}(u,y.mode,E.sceneRenderer,E.model),E.player=C.player,E.director=C.director,E.mattertagManager=C.mattertagManager,E.tileDownloader=C.tileDownloader,E.qualityManager=C.qualityManager,E.panoRenderer=C.panoRenderer,E.record.init(E.settings.jf),E.model.supportsTiles&&E.tileDownloader.start(),u&&y.mode!==l.PANORAMA&&(u=!1),(u||y.mode===l.PANORAMA)&&y.pano&&E.emit("enterPoint",y.pano.id);var t=null;return u&&(E.quickstartManager=new x(E.qualityManager,E.sceneRenderer.scene,E.sceneRenderer.camera,E.playContainer),B(E.sceneRenderer,E.playContainer,E.model),t=E.quickstartManager.load(y).then((function(){E.sceneRenderer.addComponent(E.quickstartManager),d.autoplay&&(E.quickStart=E.quickstartManager.startLanding()),E.sceneRenderer.once(A.AfterRender,(function(){}))}))),E.director.sLen=E.model.getSceneLength(),E.emit("initLoading"),E.emit("startLoading",E.model,!0,u,E.settings),e.when(t)})).then((function(){return k(E.model,E._emitLoadProgress,!u,E.progStruct)})).then((function(){var e=!1;function r(){var t,i;(e=!0,function(t,e,i,n){var r=i.qualityManager,o=i.panoRenderer,a=i.tileDownloader,s=i.modelManager,l=i.player,u=i.director,h=i.mattertagManager,c=i.displayController;e.scene.add(t),e.qualityManager=r,t.update();var d={camera:e.camera,director:u,modelManager:s,tileDownloader:a,panoRenderer:o,qualityManager:r,mattertagManager:h,container:n};l.init(d),l.setScene(e.scene),u.init(l,s),h.init(s,l,u),c.init(u,l,s,h,n),f.bindEvents(l),e.addComponent(h),e.addComponent(t),e.addComponent(l),e.addComponent(o),e.addComponent(G.R),l.mattertagManager.updateModel()}(E.model,E.sceneRenderer,C,E.playContainer),b.init(E.director,E.player),E.sceneRenderer.started||B(E.sceneRenderer,E.playContainer,E.model),u||E.emit("endLoading",y.mode),(t=E.player,E.model,i=y,t.start(i)).done((function(){if(G.conf.isNewEditVersion&&window.parent&&(window.parent.flag=1),G.model.panosUV.find((function(t){return G.player.currentPano?G.player.currentPano.id==t.id:null}))&&E.player.currentPano){var t=G.player.currentPano;E._emitPanoChange(t,0),E._emitModeChange(null,E.player.mode),E.player.updateWarpEnded()}E.director.autoTour()})),u&&(E.quickstartManager.controls.locked=!1,E.player.control.copy(E.quickstartManager.controls),E.sceneRenderer.removeComponent(E.quickstartManager),E.quickstartManager.destroy()),E.model.supportsTiles)||new v(E.model,E.player).start();E.registryEvent(E.model,E.play,E.director),E.panoramaSize.init(E.player.currentPano),E._initEvent(),E.emit("endLoading",y.mode),E.settings.jf&&E.settings.jf.dataset&&E.settings.jf.dataset.length>0&&E.settings.jf.enable&&(E.playType="Lecture"),E.model&&E.model.steeringWheel&&(E.model.steeringWheel.visible=!0),E.sceneRenderer.once(A.AfterRender,(function(){E.loadingState=!1,E.emit("afterRender"),E.player.mode===l.PANORAMA&&E.model.setEntranceState(!1),E.initMeasure(),G.startEntryPage=!0,E.settings.jf&&E.settings.jf.dataset&&E.settings.jf.dataset.length>0&&E.settings.jf.enable&&(E.playType="Lecture"),E.model.steeringWheel&&(E.model.steeringWheel.visible=!0)}))}y=g.getStartCameraOptions(E.model,E.model.panos,E.player.position),E.model.data.player_options.show3d?E.model.startup_type===P.STARTPANO?y.quickstart=!0:y.quickstart=u:y.quickstart=!0;var o=null;if("guid"===t){var a=!1;E.connectEvent(L,{init:"connect_init_start",init_done:"connect_init_done",wait_connect:"connect_wait_connect",user_added:"connect_uesr_added",bussiness_busy:"connect_call_refuse",user_connected:"connect_user_addIn",close_connect:"connect_close",remote_busy:"connect_remote_operate_busy",callsuccess:"connect_call_success"}),L.on("init_done",(function(){o=setTimeout((function(){u?E.quickStart.done(r):r(),o=null}),1e3)})),L.on("operation",(function(t){E.emit("connect_operation",t)})),L.on("close_connect",(function(t){E.emit("connect_identity_update",t)})),L.on("identity",(function(t){E.emit("connect_identity_update",t)})),L.on("changestate",(function(t){if(o&&clearTimeout(o),!e){var i=function(t,e){for(var i=null,n=e.list,r=0;r<n.length;r++)if(n[r].id===t){i=n[r];break}return i}(t.location,E.model.panos);y.mode=t.mode,y.pano=i,"panorama"===t.mode?(y.position=t.position,y.quaternion=(new n.Quaternion).copy(t.rotation)):"dollhouse"===t.mode?(y.floorVisibility=t.floorVisibility,y.position=t.position,y.quaternion=(new n.Quaternion).copy(t.rotation)):"floorplan"===t.mode&&(y.floorVisibility=t.floorVisibility,y.position=t.position,y.quaternion=(new n.Quaternion).copy(t.rotation),y.zoom=t.zoom),a?r():u?E.quickStart.done(r):r()}}));try{u&&E.quickStart.done((function(){a=!0})),L.joinChannel(i,E.player.getCurrentState)}catch(t){t,u?E.quickStart.done(r):r()}}else u?E.quickStart.done(r):r()})).fail(U.bind(this))},z.prototype.connectEvent=function(t,e){function i(t,e,i){t.on(e,(function(){n.emit(i)}))}var n=this;for(var r in e)i(t,r,e[r])},z.prototype.registryEvent=function(t,e,i){var n=this;this.model.on("floor.changed",this._emitFloorChange),this.model.on("waiting",this._emitSpinnerState),this.model.on("waiting-done",this._emitSpinnerState),this.director.on("tourStop",this._emitStopTour),this.director.on("update.controls",this._emitUpdateTour),this.player.on("PanoAnimation",this._emitPanoChange),this.player.on(C.ModeChanged,this._emitModeChange),this.player.on(C.WarpEnded,(function(){var t=n.player.currentPano;n._emitPanoChange(t,0)})),this.player.on(C.FlyingEnded,this._emitFlyingEnd),this.player.on(C.Ready,(function(){})),this.player.on(C.PanoChosen,this._emitPnaoChosen),this.player.on(C.RulersMove,this._updatePanorameSize),this.player.on(E.RulersWalk,this._updatePanorameSize),this.player.on(C.EditAddTagHighlight,this._EditAddTagHighligh),this.player.on(E.MoveHighlightsBar,this._emitHighlightsBarChange),this.player.on(E.ClickHighlightsBar,this._emitHighlightsBarChange),this.player.on("hide-right-tools",this._emitHideRightTools),this.player.on("show-right-tools",this._emitShowRightTools),this.player.on("addModelListItem",this._emitAddModelListItem),this.player.on("deletePutModelSuccess",this._emitDeletePutModelSuccess),this.player.on("hidePutModelInfoPanel",this._emitHidePutModelInfoPanel),this.player.on("showLoaddingOfLoadPutModel",this._emitShowLoaddingOfLoadPutModel),this.player.on("hideLoaddingOfLoadPutModel",this._emitHideLoaddingOfLoadPutModel),this.player.on("putModelListLoadingIsOver",this._emitPutModelListLoadingIsOver),this.player.on("resetPutModelInfo",this._emitResetPutModelInfo),this.player.on("setPutModelToolsPosition",this._emitSetPutModelToolsPosition),this.player.on("hidePutModelSetTools",this._emitHidePutModelSetTools),this.player.on("showPutModelSetTools",this._emitShowPutModelSetTools),this.player.on("viewModeTransitioning",this._emitViewModeTransitioning),this.player.on("viewModePanorama",this._emitViewModePanorama),this.player.on("showModelListPanel",this._emitShowModelListPanel),this.player.on("hideModelListPanel",this._emitHideModelListPanel),this.player.on("put-model-follow-mouse",this._emitPutModelFollowMouse),this.player.on("put-model-follow-mouse-over",this._emitPutModelFollowMouseOver),this.player.on("put-model-follow-mouse-cancel",this._emitPutModelFollowMouseCancel),this.player.on("quit-put-mode",this._emitQuitPutMode),this.player.on("view-mode-dollhouse",this._emitViewModeDollhouse),this.player.on("handle-control-panorama-move",this._emitHandleControlPanoramaMove),this.player.on("handle-control-dollhouse-move",this._emitHandleControlDollhouseMove),this.player.on("choosedHumanModel",this._emitChoosedHumanModel),this.player.on("humanModelIsLoaded",this._emitHumanModelIsLoaded),this.player.on("add-human-label",this._emitAddHumanLabel),this.player.on("hide-all-human-label",this._emitHideAllHumanLabel),this.player.on("show-virtual-human-info",this._emitShowVirtualHumanInfo),this.player.on("hide-virtual-human-info",this._emitHideVirtualHumanInfo),this.player.on("choosed-weapon",this._emitChoosedWeapon),this.player.on("putProbeModelComplete",this._emitPutProbeModelComplete),this.player.on("choosed-virtual-camera",this._emitChoosedVirtualCamera),this.player.on("add-virtual-camera-label",this._emitAddVirtualCameraLabel),this.player.on("hide-all-virtual-camera-label",this._emitHideAllVirtualCameraLabel),this.player.on("show-virtual-camera-info",this._emitShowVirtualCameraInfo),this.player.on("hide-virtual-camera-info",this._emitHideVirtualCameraInfo),this.player.on("update-ui-rotate",this._emitUpateUiRoate),this.player.on("choosed-postil",this._emitChoosedPostil),this.player.on("add-postil-item",this._emitAddPostilItem),this.player.on("update-postil-ui",this._emitUpdatePostilUI),this.player.on("hide-postil-set-tool",this._emitHidePostilSetTool),this.player.on("show-delete-dialog-of-postil",this._emitShowDeleteDialogOfPostil),this.player.on("delete-postil-success",this._emitDeletePostilSuccess),this.player.on("show-edit-panel-of-postil",this._emitShowEditPanelOfPostil),this.player.on("show-all-postils",this._emitShowAllPostils),this.player.on("hide-all-postils",this._emitHideAllPostils),this.player.on("edit-confirm",this._emitEditConfirm),this.player.on("update-postil-show",this._emitUpdatePostilShow),this.player.on("get-measurement-info",this._emitGetMeasurementInfo),this.player.on("exitMeasureActive",this._emitExitMeasureActive),this.player.controls[l.PANORAMA].on("move",this._emitMoveState),this.player.controls[l.DOLLHOUSE].on("move",this._emitMoveState),this.player.controls[l.FLOORPLAN].on("move",this._emitMoveState),this.sceneRenderer.on("compass",this._emitAngle),this.record.on("recording",(function(){})),this.record.on("readyToRecord",(function(){})),this.record.on("startRecord",(function(){})),this.record.on("stopRecord",(function(){})),this.record.on("countdown",(function(t){})),this.record.on("stopRecordCountDown",(function(t){}));var r=this;this.record.on("emity",(function(){r._emitLectureError("emity")})),this.record.on("loadAudio",(function(){r._emitLectureLoadAudio("load")})),this.record.on("loadAudioDone",(function(){r._emitLectureLoadAudio("done")})),this.record.on("updateView",(function(t,e){r._emitLectureUpdate(t,e)})),this.record.on("housedetail",(function(t){r._emitLectureUI("housedetail",t)})),this.record.on("stop",(function(){r.emit("lecture","stop")})),this.mattertagManager.on("tagActiveEvent",(function(t){r.emit("tag.active",t)})),this.on("afterRender",this._emitFirstRender)},z.prototype._emitFirstRender=function(){var t=this.player.mode,e=this.player.currentPano;this._emitModeChange(null,t),this._emitFlyingEnd(null,null,e,null)},z.prototype._emitLectureError=function(t){this.emit("lectureError",t)},z.prototype._emitLectureLoadAudio=function(t){this.emit("lectureLoadaudio",t)},z.prototype._emitLectureUpdate=function(t,e){this.emit("lectureUpdate",t,e)},z.prototype._emitLectureUI=function(t,e){this.emit("lecutreUI",t,e)},z.prototype._updatePanorameSize=function(){this.panoramaSize.enable&&this.panoramaSize.update(this.player)},z.prototype._updateMeasure=function(){this.Measure.enable&&this.Measure.update(this.player)},z.prototype._emitAngle=function(t){var e={angle:t,director:t};this.model.data.orientation_correct&&(e.angle+=this.model.data.orientation_correct),this.angle=e.director,this.emit("compass",e)},z.prototype._emitHighlightsBarChange=function(t){this.emit("highLightsBarChange",t,this.settings)},z.prototype._EditAddTagHighligh=function(t){G.conf.isNewEditVersion&&G.sendTag("data")},z.prototype._emitPnaoChosen=function(t){this.player.mode;this.emit("panoChosen",this.player)},z.prototype._emitFlyingEnd=function(t,e,i,n){var r={};if(d.delBK){this.model.currentFloor.floorIndex;r.floorUrl=this.model.house_type_url}r.showArea=this.model.floorplan_enable,d.delBK&&i&&i.areaName&&i.areaSize&&(r.areaName=i.areaName,r.areaSize=i.areaSize),this.needsUpdateRadar&&(this.needsUpdateRadar=!1,r.showRadar=!0,r.pano=i),this.player.mattertagManager.ttflying=!1,this.player.mattertagManager.updatetitletags(),this.emit("flyingEnd",r),this.player.baseControls&&this.player.baseControls.onFlyEnd()},z.prototype._emitClickTag=function(t){t&&this.emit("clickTag",t)},z.prototype._emitModeChange=function(t,e){this._updatePanorameSize(),"panorama"===e&&(this.needsUpdateRadar=!0),this.emit("modeChange",t,e)},z.prototype._emitPanoChange=function(t,e){var i=this.model.floorplan_enable;this.emit("panoChange",{pano:t,time:e,showArea:i})},z.prototype._emitStopTour=function(){this.emit("stopTour")},z.prototype._emitUpdateTour=function(){this.emit("updateTour",this.director.describe())},z.prototype._emitSpinnerState=function(){var t="stopSpinner";this.model.waitQueue.length<0?t="stopSpinner":this.loadingState||(t="delayStopSpinner"),this.emit("spinner",t)},z.prototype._emitFloorChange=function(t,e){var i=this.getModelScreenSize(),n={mode:e,model:this.model,project:i,floorIndex:t.floorIndex,imageUrl:"floorplan"===e?this.model.getCurrentHouseTypeImage():""};this.model.allFloorsVisible&&(n.floorIndex="all"),this.emit("floorChange",n)},z.prototype._emitMoveState=function(){(this.emit("move",this.player),this._updatePanorameSize(),this.player.postilControls&&this.player.postilControls.POSTIL)&&(this.player.postilControls.POSTIL.userData.follow_mouse||this.player.postilControls.destroyPostilChoosedState())},z.prototype._emitChoosedHumanModel=function(t){this.emit("choosedHumanModel",t)},z.prototype._emitHumanModelIsLoaded=function(){this.emit("humanModelIsLoaded",!0)},z.prototype._emitAddModelListItem=function(t){this.emit("addModelListItem",t)},z.prototype._emitDeletePutModelSuccess=function(t){this.emit("deletePutModelSuccess",t)},z.prototype._emitHidePutModelInfoPanel=function(){this.emit("hidePutModelInfoPanel")},z.prototype._emitShowLoaddingOfLoadPutModel=function(){this.emit("showLoaddingOfLoadPutModel")},z.prototype._emitHideLoaddingOfLoadPutModel=function(){this.emit("hideLoaddingOfLoadPutModel")},z.prototype._emitPutModelListLoadingIsOver=function(){this.emit("putModelListLoadingIsOver")},z.prototype._emitResetPutModelInfo=function(t){this.emit("resetPutModelInfo",t)},z.prototype._emitSetPutModelToolsPosition=function(t){this.emit("setPutModelToolsPosition",t)},z.prototype._emitShowPutModelSetTools=function(t){this.emit("showPutModelSetTools",t)},z.prototype._emitViewModeTransitioning=function(){this.emit("viewModeTransitioning")},z.prototype._emitViewModePanorama=function(){this.emit("viewModePanorama")},z.prototype._emitHidePutModelSetTools=function(){this.emit("hidePutModelSetTools")},z.prototype._emitShowModelListPanel=function(){this.emit("showModelListPanel")},z.prototype._emitHideModelListPanel=function(){this.emit("hideModelListPanel")},z.prototype._emitChoosedPostil=function(t){this.emit("choosed-postil",t)},z.prototype._emitAddPostilItem=function(t){this.emit("add-postil-item",t)},z.prototype._emitUpdatePostilUI=function(t){this.emit("update-postil-ui",t)},z.prototype._emitHidePostilSetTool=function(){this.emit("hide-postil-set-tool")},z.prototype._emitShowDeleteDialogOfPostil=function(t){this.emit("show-delete-dialog-of-postil",t)},z.prototype._emitDeletePostilSuccess=function(t){this.emit("delete-postil-success",t)},z.prototype._emitShowEditPanelOfPostil=function(){this.emit("show-edit-panel-of-postil")},z.prototype._emitShowAllPostils=function(t){this.emit("show-all-postils",t)},z.prototype._emitHideAllPostils=function(t){this.emit("hide-all-postils",t)},z.prototype._emitEditConfirm=function(t){this.emit("edit-confirm",t)},z.prototype._emitEditProbeModel=function(t){this.emit("edit-probe-model",t)},z.prototype._emitPutProbeModelComplete=function(t){this.emit("putProbeModelComplete",t)},z.prototype._emitGetMeasurementInfo=function(t){this.emit("get-measurement-info",t)},z.prototype._emitAddHumanLabel=function(t){this.emit("add-human-label",t)},z.prototype._emitChoosedVirtualCamera=function(t){this.emit("choosed-virtual-camera",t)},z.prototype._emitHideAllHumanLabel=function(){this.emit("hide-all-human-label")},z.prototype._emitAddVirtualCameraLabel=function(t){this.emit("add-virtual-camera-label",t)},z.prototype._emitHideAllVirtualCameraLabel=function(){this.emit("hide-all-virtual-camera-label")},z.prototype._emitShowVirtualCameraInfo=function(t){this.emit("show-virtual-camera-info",t)},z.prototype._emitHideVirtualCameraInfo=function(){this.emit("hide-virtual-camera-info")},z.prototype._emitHideRightTools=function(){this.emit("hide-right-tools")},z.prototype._emitShowRightTools=function(){this.emit("show-right-tools")},z.prototype._emitPutModelFollowMouse=function(){this.emit("put-model-follow-mouse")},z.prototype._emitPutModelFollowMouseOver=function(){this.emit("put-model-follow-mouse-over")},z.prototype._emitPutModelFollowMouseCancel=function(){this.emit("put-model-follow-mouse-cancel")},z.prototype._emitQuitPutMode=function(){this.emit("quit-put-mode")},z.prototype._emitViewModeDollhouse=function(){this.emit("view-mode-dollhouse")},z.prototype._emitShowVirtualHumanInfo=function(t){this.emit("show-virtual-human-info",t)},z.prototype._emitHideVirtualHumanInfo=function(){this.emit("hide-virtual-human-info")},z.prototype._emitHandleControlPanoramaMove=function(){this.emit("handle-control-panorama-move")},z.prototype._emitHandleControlDollhouseMove=function(){this.emit("handle-control-dollhouse-move")},z.prototype._emitUpdatePostilShow=function(t){this.emit("update-postil-show",t)},z.prototype._initEvent=function(){this.emit("init_UI",this.model),this.emit("load_progress",100)},z.prototype._emitLoadProgress=function(t){this.emit("load_progress",t)},z.prototype._emitExitMeasureActive=function(){this.emit("exitMeasureActive")},z.prototype._emitUpateUiRoate=function(t){this.emit("upateUiRoate",t)},z.prototype._registryKeyEvent=function(){var t=this;c.isMobile()||(document.addEventListener("keydown",(function(e){switch(e.which){case Keys.ZERO:d.debug&&t.model.toggleAlpha();break;case Keys.ONE:t.player.model.has360Views&&!t.player.isInMode(l.TRANSITIONING)?t.player.isInMode(l.PANORAMA)&&t.player.currentPano.isAligned()||(t.player.controls[l.PANORAMA].emit(E.InteractionKey),t.director.tourIsPlaying?t.director.stopTour():t.player.goToLastView(!0)):t.player.isInMode(l.PANORAMA,l.TRANSITIONING)||t.director.changeMode(l.PANORAMA,"key");break;case Keys.TWO:t.model.outsideAllowed()&&!t.player.isInMode(l.DOLLHOUSE,l.TRANSITIONING)&&t.director.changeMode(l.DOLLHOUSE,"key");break;case Keys.THREE:t.model.outsideAllowed()&&!t.player.isInMode(l.FLOORPLAN,l.TRANSITIONING)&&t.director.changeMode(l.FLOORPLAN,"key");break;case Keys.FOUR:t.player.model.has360Views&&!t.player.isInMode(l.TRANSITIONING)&&(t.player.isInMode(l.PANORAMA)&&!t.player.currentPano.isAligned()||(t.player.controls[l.PANORAMA].emit(E.InteractionKey),t.director.tourIsPlaying?t.director.stopTour():t.player.goToLastView(!1)));break;case Keys.SPACE:d.debug&&t.model.toggleExplode();break;case Keys.RETURN:d.debug&&t.model.toggleExplodeUp();break;case Keys.PLUSEQUALS:t.director.player.activatePersistentZooming(!0);break;case Keys.DASHUNDERSCORE:t.director.player.activatePersistentZooming(!1);break;case Keys.EIGHT:t.director.player.decreaseZoomSpeed();break;case Keys.NINE:t.director.player.increaseZoomSpeed()}return t.player&&t.player.reticule.hide(),!0})),document.addEventListener("keyup",(function(e){switch(e.which){case Keys.PLUSEQUALS:t.director.player.deactivatePersistentZooming();break;case Keys.DASHUNDERSCORE:t.director.player.deactivatePersistentZooming()}})))},z.prototype.registryOri=function(){G.ori={},c.isMobile()?G.ori.flag=!0:G.ori.flag=!1,G.ori.isHuawei5X=c.detectHUAWEI5X(),G.ori.gamma=-1e3,G.ori.beta=-1e3,G.ori.alpha=-1e3,G.ori.enable=!0,G.ori.orient=n.Math.degToRad(window.orientation||0),G.orientationHandler=function(t){t.gamma||t.beta||(t.gamma=t.x*(180/Math.PI),t.beta=t.y*(180/Math.PI),t.alpha=t.z*(180/Math.PI));var e=t.gamma,i=t.beta,n=t.alpha;t.accelerationIncludingGravity&&(e=10*event.accelerationIncludingGravity.x,i=10*-event.accelerationIncludingGravity.y,n=10*event.accelerationIncludingGravity.z),G.ori.gamma=e,G.ori.beta=i,G.ori.alpha=n},G.HorientationChange=function(){G.ori.orient=n.Math.degToRad(window.orientation||0)},G.HdeviceOrientation=function(t){var e=n.Math.degToRad(t.alpha),i=n.Math.degToRad(t.beta),r=n.Math.degToRad(t.gamma);G.ori.isHuawei5X?(-1e3==G.ori.alpha&&(G.ori.alpha=e),-1e3==G.ori.beta&&(G.ori.beta=i),-1e3==G.ori.gamma&&(G.ori.gamma=r),Math.abs(e-G.ori.alpha)>.06&&(G.ori.alpha=e),Math.abs(i-G.ori.beta)>.006&&(G.ori.beta=i),Math.abs(r-G.ori.gamma)>.006&&(G.ori.gamma=r)):(G.ori.alpha=e,G.ori.beta=i,G.ori.gamma=r)},window.addEventListener("orientationchange",G.HorientationChange),window.addEventListener("deviceorientation",G.HdeviceOrientation)},z.prototype.getModelScreenSize=function(){function t(t,e){var i=(window.renderWidth || window.innerWidth)/2,r=(window.renderHeight || window.innerHeight)/2,o=t.project(e),a=Math.round(o.x*i+i),s=Math.round(-o.y*r+r);return new n.Vector2(a,s)}var e=this.model.boundingBox,i=this.player.camera,r=new n.Vector3(e.max.x,0,e.max.z),o=new n.Vector3(e.min.x,0,e.min.z),a=new n.Vector3(e.max.x,0,e.min.z),s=new n.Vector3(e.min.x,0,e.max.z),l=t(r,i),u=t(o,i),h=t(a,i),c=t(s,i),d=Math.max(l.x,u.x,h.x,c.x),p=Math.min(l.x,u.x,h.x,c.x),f=Math.max(l.y,u.y,h.y,c.y),m=Math.min(l.y,u.y,h.y,c.y);return{width:d-p,height:f-m,top:m,left:p}},z.prototype.getFloorPlanParam=function(){var t=this.getModelScreenSize(),e={model:this.model,project:t,floorIndex:this.model.currentFloor.floorIndex};return this.player.currentPano&&this.player.currentPano.u&&(e.radar={uv:{u:this.player.currentPano.u,v:this.player.currentPano.v},angle:this.lastCompassAngle}),e},z.prototype.loadHumanModel=function(t){this.player.loadHumanModel(t)},z.prototype.loadProbeModel=function(){this.player.loadProbeModel(1)},z.prototype.selectPutModel=function(t){this.player.selectPutModel(t)},z.prototype.updatePutModelColor=function(t){this.player.updatePutModelColor(t)},z.prototype.showPutModel=function(t){this.player.showPutModel(t)},z.prototype.hidePutModel=function(t){this.player.hidePutModel(t)},z.prototype.handleClickCompleteBtn=function(){this.player.handleClickCompleteBtn()},z.prototype.removePutModel=function(t){this.player.removePutModel(t)},z.prototype.getSettingsDataOfPutModel=function(){return JSON.stringify(this.player.SETTINGS_DATA_PUT)},z.prototype.updateCollision=function(t){this.player.updateCollision(t)},z.prototype.loadModelList=function(t,e){this.player.showModelList(t,e)},z.prototype.showModelList=function(t){this.player.showModelList(t)},z.prototype.hideModelList=function(){this.player.hideModelList()},z.prototype.updatePutModelName=function(t){this.player.updatePutModelName(t)},z.prototype.resetPutModel=function(){this.player.resetPutModel()},z.prototype.updateSizeOfPutModel=function(t){this.player.updateSizeOfPutModel(t)},z.prototype.updatePutModelGroundClearance=function(t){this.player.updatePutModelGroundClearance(t)},z.prototype.updateControlOfPutModel=function(t){this.player.updateControlOfPutModel(t)},z.prototype.showHumanModelBonesNode=function(){this.player.showHumanModelBonesNode()},z.prototype.bundleTranslateControlOfPutModel=function(){this.player.bundleTranslateControlOfPutModel()},z.prototype.bundleRotateControlOfPutModel=function(){this.player.bundleRotateControlOfPutModel()},z.prototype.virtualSetSlideStop=function(t){this.player.virtualSetSlideStop(t)},z.prototype.handleClickModelItem=function(t){this.player.handleClickModelItem(t)},z.prototype.onIntoPutMode=function(){this.player.onIntoPutMode()},z.prototype.onQuitPutMode=function(){this.player.onQuitPutMode()},z.prototype.onApiQuitPutMode=function(){this.player.onApiQuitPutMode()},z.prototype.onIntoEditMode=function(){this.player.onIntoEditMode()},z.prototype.onQuitEditMode=function(){this.player.onQuitEditMode()},z.prototype.onQuitEditMeasure=function(){this.player.onQuitEditMeasure()},z.prototype.onIntoEditMeasure=function(){this.player.onIntoEditMeasure()},z.prototype.loadPostilModel=function(t){this.player.loadPostilModel(t)},z.prototype.updatePostilInfo=function(t){this.player.updatePostilInfo(t)},z.prototype.loadPostilsOfSave=function(t){this.player.loadPostilsOfSave(t)},z.prototype.handleDeletePostil=function(t){this.player.removePostil(t)},z.prototype.deletePostilOfConfirm=function(t){this.player.deletePostilOfConfirm(t)},z.prototype.hidePostilsOfSave=function(){this.player.hidePostilsOfSave()},z.prototype.loadCameraModel=function(t){this.player.loadVirtualCamera(t)},z.prototype.updateCameraFov=function(t){this.player.updateVirtualCameraFov(t)},z.prototype.updateCameraDistance=function(t){this.player.updateVirtualCameraDistance(t)},z.prototype.updateMiniCameraPosition=function(t){this.player.updateMiniCameraPosition(t)},z.prototype.miniCameraScreenShot=function(t){this.player.miniCameraScreenShot(t)},z.prototype.changeMode=function(t){if(!1===this.model.data.player_options.show3d)return!1;"floorplan"===t&&(this.lastCompassAngle=this.angle),this.director.changeMode(t)},z.prototype.play=function(t){if(this.disablePanramaSize(),"Lecture"===this.playType)this.record.pplay(t);else if(this.settings.nestscenes&&this.settings.nestscenes.scenes&&this.settings.nestscenes.scenes.length>0){var e=0;this.model.enableTagMovie&&(e=1),G.playing=!0,this.director.currentScript=e,this.director.playTour()}},z.prototype.pause=function(){"Lecture"===this.playType?this.record.ppause():this.settings.nestscenes&&this.settings.nestscenes.scenes&&this.settings.nestscenes.scenes.length>0&&(this.director.stopTour(),G.playing=!1)},z.prototype.enterVR=function(){return"panorama"===this.player.mode&&(!!c.isMobile()&&(this.sceneRenderer.vrEnabled=!0,G.ori.flag=!0,!0))},z.prototype.exitVR=function(){this.sceneRenderer.vrEnabled=!1,G.ori.flag=!1},z.prototype.gotoFloor=function(t){"all"===t?this.director.allFloors():this.director.gotoFloor(t)},z.prototype.mute=function(){L.setMute(!0)},z.prototype.unmute=function(){L.setMute(!1)},z.prototype.disableTag=function(){this.player.mattertagManager.showtitletags=!1,this.player.mattertagManager.updatetitletags(),this.player.mattertagManager.hideAllMattertags(10,10)},z.prototype.enableTag=function(){this.player.mattertagManager.showtitletags=!0,this.player.mattertagManager.updatetitletags(),this.player.mattertagManager.showAllMattertags(10,10)},z.prototype.warpToPanoByTagId=function(t){var e=t.tagId,i=t.openTag,r=this,o=this.player.model.getTagByTagid(e),a=this.player.model.panos.index[o.data.locationid];if(e){var s=o.position.clone(),l=new n.Matrix4;l.lookAt(a.position,s,new n.Vector3(0,0,-1)),a.quaternion=(new n.Quaternion).setFromRotationMatrix(l)}var u=null;i&&(u=function(){r.openTag(o)}),this.player.warpToPanoById(o.data.locationid,a.quaternion,null,null,"black",1,500,u)},z.prototype.openTag=function(t){var e=this;setTimeout((function(){e.player.mattertagManager.openTag(t)}),1e3)},z.prototype.disablePanramaSize=function(){this.panoramaSize.setEnable(!1)},z.prototype.enablePanramaSize=function(){this.panoramaSize.setEnable(!0),this.panoramaSize.update(this.player)},z.prototype.initMeasure=function(){this.player.initMeasure()},z.prototype.enableMeasure=function(t){this.player.setMeasureEnable(t)},z.prototype.manipulateMeasure=function(t,e,i){switch(t){case"show":this.player.showMeasure(e);break;case"hide":this.player.hideMeasure(e);break;case"showAll":this.player.showAllMeasure();break;case"hideAll":this.player.hideAllMeasure();break;case"delete":this.player.deleteMeasure(e);break;case"changeName":this.player.changeMeasureName(e,i);break;case"changeUnit":this.player.changeUnit(e);break;case"clicked":this.player.clickedOnMeasure(e);break;case"disClicked":this.player.disOnMeasure(e);break;case"setAutoFit":this.player.setAutoFit(e);break;case"setMeasureArea":this.player.setMeasureArea(e)}},z.prototype.gotoScenebyId=function(t){this.director.goToHighlight(t)},z.prototype.getCurrentState=function(){return{panoSize:this.panoramaSize.enable}},z.prototype.setPlaySpeed=function(t){var e="";switch(t){case 1:e="0.3x";break;case 2:e="0.5x";break;case 3:e="1.0x";break;case 4:e="1.5x";break;case 5:e="2.0x";break;default:e="1.0x"}this.player.setSpeedMultiplier(e)},z.prototype.screenshot=function(t){var e=this,i=this.player.reticule;i.hidden=!0,i.material.uniforms.opacity.value=0,this.model.panos.list.forEach((function(t){t.marker&&(t.marker.material.opacity=0)})),setTimeout((function(){var i=document.getElementsByTagName("canvas")[0],n=document.createElement("canvas");n.width=i.width,n.height=i.height;var r=n.getContext("2d");r.drawImage(i,0,0,i.width,i.height),r.scale(.5,.5),t({img:n.toDataURL("image/png"),location:e.player.currentPano.id,position:{x:e.player.camera.quaternion.x,y:e.player.camera.quaternion.y,z:e.player.camera.quaternion.z,w:e.player.camera.quaternion.w}}),e.model.panos.list.forEach((function(t){t.marker&&(t.marker.material.opacity=1)}))}),1e3)},z.prototype.gotoScene=function(t){var e={},i=t.position,r=t.location,o=this.model.panos.index[r];e.pano=o;var a=new n.Vector3(0,0,-1);a.applyQuaternion(i),a.add(o.position),e.lookAtPoint=a,this.player.flyToPano(e)},z.prototype.addModel=function(t){this.player.addModel(t)},z.prototype.setModelPose=function(t){this.player.addModel(t)},t.exports=z}).call(this,i(6))},function(t,e,i){!function(t){"use strict";function e(t){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(t)}function i(t,e){return t&e}function n(t,e){return t|e}function r(t,e){return t^e}function o(t,e){return t&~e}function a(t){if(0==t)return-1;var e=0;return 0==(65535&t)&&(t>>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function s(t){for(var e=0;0!=t;)t&=t-1,++e;return e}var l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function u(t){var e,i,n="";for(e=0;e+3<=t.length;e+=3)i=parseInt(t.substring(e,e+3),16),n+=l.charAt(i>>6)+l.charAt(63&i);for(e+1==t.length?(i=parseInt(t.substring(e,e+1),16),n+=l.charAt(i<<2)):e+2==t.length&&(i=parseInt(t.substring(e,e+2),16),n+=l.charAt(i>>2)+l.charAt((3&i)<<4));(3&n.length)>0;)n+="=";return n}function h(t){var i,n="",r=0,o=0;for(i=0;i<t.length&&"="!=t.charAt(i);++i){var a=l.indexOf(t.charAt(i));a<0||(0==r?(n+=e(a>>2),o=3&a,r=1):1==r?(n+=e(o<<2|a>>4),o=15&a,r=2):2==r?(n+=e(o),n+=e(a>>2),o=3&a,r=3):(n+=e(o<<2|a>>4),n+=e(15&a),r=0))}return 1==r&&(n+=e(o<<2)),n}var c,d,p=function(t,e){return(p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)},f=function(t){var e;if(void 0===c){var i="0123456789ABCDEF";for(c={},e=0;e<16;++e)c[i.charAt(e)]=e;for(i=i.toLowerCase(),e=10;e<16;++e)c[i.charAt(e)]=e;for(e=0;e<" \f\n\r\t \u2028\u2029".length;++e)c[" \f\n\r\t \u2028\u2029".charAt(e)]=-1}var n=[],r=0,o=0;for(e=0;e<t.length;++e){var a=t.charAt(e);if("="==a)break;if(-1!=(a=c[a])){if(void 0===a)throw new Error("Illegal character at offset "+e);r|=a,++o>=2?(n[n.length]=r,r=0,o=0):r<<=4}}if(o)throw new Error("Hex encoding incomplete: 4 bits missing");return n},m={decode:function(t){var e;if(void 0===d){for(d=Object.create(null),e=0;e<64;++e)d["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)]=e;for(e=0;e<"= \f\n\r\t \u2028\u2029".length;++e)d["= \f\n\r\t \u2028\u2029".charAt(e)]=-1}var i=[],n=0,r=0;for(e=0;e<t.length;++e){var o=t.charAt(e);if("="==o)break;if(-1!=(o=d[o])){if(void 0===o)throw new Error("Illegal character at offset "+e);n|=o,++r>=4?(i[i.length]=n>>16,i[i.length]=n>>8&255,i[i.length]=255&n,n=0,r=0):n<<=6}}switch(r){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:i[i.length]=n>>10;break;case 3:i[i.length]=n>>16,i[i.length]=n>>8&255}return i},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(t){var e=m.re.exec(t);if(e)if(e[1])t=e[1];else{if(!e[2])throw new Error("RegExp out of sync");t=e[2]}return m.decode(t)}},g=1e13,v=function(){function t(t){this.buf=[+t||0]}return t.prototype.mulAdd=function(t,e){var i,n,r=this.buf,o=r.length;for(i=0;i<o;++i)(n=r[i]*t+e)<g?e=0:n-=(e=0|n/g)*g,r[i]=n;e>0&&(r[i]=e)},t.prototype.sub=function(t){var e,i,n=this.buf,r=n.length;for(e=0;e<r;++e)(i=n[e]-t)<0?(i+=g,t=1):t=0,n[e]=i;for(;0===n[n.length-1];)n.pop()},t.prototype.toString=function(t){if(10!=(t||10))throw new Error("only base 10 is supported");for(var e=this.buf,i=e[e.length-1].toString(),n=e.length-2;n>=0;--n)i+=(g+e[n]).toString().substring(1);return i},t.prototype.valueOf=function(){for(var t=this.buf,e=0,i=t.length-1;i>=0;--i)e=e*g+t[i];return e},t.prototype.simplify=function(){var t=this.buf;return 1==t.length?t[0]:this},t}(),y=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,b=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function w(t,e){return t.length>e&&(t=t.substring(0,e)+"…"),t}var x,M=function(){function t(e,i){this.hexDigits="0123456789ABCDEF",e instanceof t?(this.enc=e.enc,this.pos=e.pos):(this.enc=e,this.pos=i)}return t.prototype.get=function(t){if(void 0===t&&(t=this.pos++),t>=this.enc.length)throw new Error("Requesting byte offset "+t+" on a stream of length "+this.enc.length);return"string"==typeof this.enc?this.enc.charCodeAt(t):this.enc[t]},t.prototype.hexByte=function(t){return this.hexDigits.charAt(t>>4&15)+this.hexDigits.charAt(15&t)},t.prototype.hexDump=function(t,e,i){for(var n="",r=t;r<e;++r)if(n+=this.hexByte(this.get(r)),!0!==i)switch(15&r){case 7:n+=" ";break;case 15:n+="\n";break;default:n+=" "}return n},t.prototype.isASCII=function(t,e){for(var i=t;i<e;++i){var n=this.get(i);if(n<32||n>176)return!1}return!0},t.prototype.parseStringISO=function(t,e){for(var i="",n=t;n<e;++n)i+=String.fromCharCode(this.get(n));return i},t.prototype.parseStringUTF=function(t,e){for(var i="",n=t;n<e;){var r=this.get(n++);i+=r<128?String.fromCharCode(r):r>191&&r<224?String.fromCharCode((31&r)<<6|63&this.get(n++)):String.fromCharCode((15&r)<<12|(63&this.get(n++))<<6|63&this.get(n++))}return i},t.prototype.parseStringBMP=function(t,e){for(var i,n,r="",o=t;o<e;)i=this.get(o++),n=this.get(o++),r+=String.fromCharCode(i<<8|n);return r},t.prototype.parseTime=function(t,e,i){var n=this.parseStringISO(t,e),r=(i?y:b).exec(n);return r?(i&&(r[1]=+r[1],r[1]+=+r[1]<70?2e3:1900),n=r[1]+"-"+r[2]+"-"+r[3]+" "+r[4],r[5]&&(n+=":"+r[5],r[6]&&(n+=":"+r[6],r[7]&&(n+="."+r[7]))),r[8]&&(n+=" UTC","Z"!=r[8]&&(n+=r[8],r[9]&&(n+=":"+r[9]))),n):"Unrecognized time: "+n},t.prototype.parseInteger=function(t,e){for(var i,n=this.get(t),r=n>127,o=r?255:0,a="";n==o&&++t<e;)n=this.get(t);if(0==(i=e-t))return r?-1:0;if(i>4){for(a=n,i<<=3;0==(128&(+a^o));)a=+a<<1,--i;a="("+i+" bit)\n"}r&&(n-=256);for(var s=new v(n),l=t+1;l<e;++l)s.mulAdd(256,this.get(l));return a+s.toString()},t.prototype.parseBitString=function(t,e,i){for(var n=this.get(t),r="("+((e-t-1<<3)-n)+" bit)\n",o="",a=t+1;a<e;++a){for(var s=this.get(a),l=a==e-1?n:0,u=7;u>=l;--u)o+=s>>u&1?"1":"0";if(o.length>i)return r+w(o,i)}return r+o},t.prototype.parseOctetString=function(t,e,i){if(this.isASCII(t,e))return w(this.parseStringISO(t,e),i);var n=e-t,r="("+n+" byte)\n";n>(i/=2)&&(e=t+i);for(var o=t;o<e;++o)r+=this.hexByte(this.get(o));return n>i&&(r+="…"),r},t.prototype.parseOID=function(t,e,i){for(var n="",r=new v,o=0,a=t;a<e;++a){var s=this.get(a);if(r.mulAdd(128,127&s),o+=7,!(128&s)){if(""===n)if((r=r.simplify())instanceof v)r.sub(80),n="2."+r.toString();else{var l=r<80?r<40?0:1:2;n=l+"."+(r-40*l)}else n+="."+r.toString();if(n.length>i)return w(n,i);r=new v,o=0}}return o>0&&(n+=".incomplete"),n},t}(),T=function(){function t(t,e,i,n,r){if(!(n instanceof S))throw new Error("Invalid tag value.");this.stream=t,this.header=e,this.length=i,this.tag=n,this.sub=r}return t.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},t.prototype.content=function(t){if(void 0===this.tag)return null;void 0===t&&(t=1/0);var e=this.posContent(),i=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+i,t);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(e)?"false":"true";case 2:return this.stream.parseInteger(e,e+i);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(e,e+i,t);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+i,t);case 6:return this.stream.parseOID(e,e+i,t);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return w(this.stream.parseStringUTF(e,e+i),t);case 18:case 19:case 20:case 21:case 22:case 26:return w(this.stream.parseStringISO(e,e+i),t);case 30:return w(this.stream.parseStringBMP(e,e+i),t);case 23:case 24:return this.stream.parseTime(e,e+i,23==this.tag.tagNumber)}return null},t.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},t.prototype.toPrettyString=function(t){void 0===t&&(t="");var e=t+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(e+="+"),e+=this.length,this.tag.tagConstructed?e+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(e+=" (encapsulates)"),e+="\n",null!==this.sub){t+=" ";for(var i=0,n=this.sub.length;i<n;++i)e+=this.sub[i].toPrettyString(t)}return e},t.prototype.posStart=function(){return this.stream.pos},t.prototype.posContent=function(){return this.stream.pos+this.header},t.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},t.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},t.decodeLength=function(t){var e=t.get(),i=127&e;if(i==e)return i;if(i>6)throw new Error("Length over 48 bits not supported at position "+(t.pos-1));if(0===i)return null;e=0;for(var n=0;n<i;++n)e=256*e+t.get();return e},t.prototype.getHexStringValue=function(){var t=this.toHexString(),e=2*this.header,i=2*this.length;return t.substr(e,i)},t.decode=function(e){var i;i=e instanceof M?e:new M(e,0);var n=new M(i),r=new S(i),o=t.decodeLength(i),a=i.pos,s=a-n.pos,l=null,u=function(){var e=[];if(null!==o){for(var n=a+o;i.pos<n;)e[e.length]=t.decode(i);if(i.pos!=n)throw new Error("Content size is not correct for container starting at offset "+a)}else try{for(;;){var r=t.decode(i);if(r.tag.isEOC())break;e[e.length]=r}o=a-i.pos}catch(t){throw new Error("Exception while decoding undefined length content: "+t)}return e};if(r.tagConstructed)l=u();else if(r.isUniversal()&&(3==r.tagNumber||4==r.tagNumber))try{if(3==r.tagNumber&&0!=i.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");l=u();for(var h=0;h<l.length;++h)if(l[h].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(t){l=null}if(null===l){if(null===o)throw new Error("We can't skip over an invalid tag with undefined length at offset "+a);i.pos=a+Math.abs(o)}return new t(n,s,o,r,l)},t}(),S=function(){function t(t){var e=t.get();if(this.tagClass=e>>6,this.tagConstructed=0!=(32&e),this.tagNumber=31&e,31==this.tagNumber){var i=new v;do{e=t.get(),i.mulAdd(128,127&e)}while(128&e);this.tagNumber=i.simplify()}}return t.prototype.isUniversal=function(){return 0===this.tagClass},t.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber},t}(),_=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],A=(1<<26)/_[_.length-1],P=function(){function t(t,e,i){null!=t&&("number"==typeof t?this.fromNumber(t,e,i):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}return t.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var i;if(16==t)i=4;else if(8==t)i=3;else if(2==t)i=1;else if(32==t)i=5;else{if(4!=t)return this.toRadix(t);i=2}var n,r=(1<<i)-1,o=!1,a="",s=this.t,l=this.DB-s*this.DB%i;if(s-- >0)for(l<this.DB&&(n=this[s]>>l)>0&&(o=!0,a=e(n));s>=0;)l<i?(n=(this[s]&(1<<l)-1)<<i-l,n|=this[--s]>>(l+=this.DB-i)):(n=this[s]>>(l-=i)&r,l<=0&&(l+=this.DB,--s)),n>0&&(o=!0),o&&(a+=e(n));return o?a:"0"},t.prototype.negate=function(){var e=O();return t.ZERO.subTo(this,e),e},t.prototype.abs=function(){return this.s<0?this.negate():this},t.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var i=this.t;if(0!=(e=i-t.t))return this.s<0?-e:e;for(;--i>=0;)if(0!=(e=this[i]-t[i]))return e;return 0},t.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+z(this[this.t-1]^this.s&this.DM)},t.prototype.mod=function(e){var i=O();return this.abs().divRemTo(e,null,i),this.s<0&&i.compareTo(t.ZERO)>0&&e.subTo(i,i),i},t.prototype.modPowInt=function(t,e){var i;return i=t<256||e.isEven()?new E(e):new D(e),this.exp(t,i)},t.prototype.clone=function(){var t=O();return this.copyTo(t),t},t.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},t.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},t.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},t.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},t.prototype.toByteArray=function(){var t=this.t,e=[];e[0]=this.s;var i,n=this.DB-t*this.DB%8,r=0;if(t-- >0)for(n<this.DB&&(i=this[t]>>n)!=(this.s&this.DM)>>n&&(e[r++]=i|this.s<<this.DB-n);t>=0;)n<8?(i=(this[t]&(1<<n)-1)<<8-n,i|=this[--t]>>(n+=this.DB-8)):(i=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&i)&&(i|=-256),0==r&&(128&this.s)!=(128&i)&&++r,(r>0||i!=this.s)&&(e[r++]=i);return e},t.prototype.equals=function(t){return 0==this.compareTo(t)},t.prototype.min=function(t){return this.compareTo(t)<0?this:t},t.prototype.max=function(t){return this.compareTo(t)>0?this:t},t.prototype.and=function(t){var e=O();return this.bitwiseTo(t,i,e),e},t.prototype.or=function(t){var e=O();return this.bitwiseTo(t,n,e),e},t.prototype.xor=function(t){var e=O();return this.bitwiseTo(t,r,e),e},t.prototype.andNot=function(t){var e=O();return this.bitwiseTo(t,o,e),e},t.prototype.not=function(){for(var t=O(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},t.prototype.shiftLeft=function(t){var e=O();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},t.prototype.shiftRight=function(t){var e=O();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},t.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(0!=this[t])return t*this.DB+a(this[t]);return this.s<0?this.t*this.DB:-1},t.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,i=0;i<this.t;++i)t+=s(this[i]^e);return t},t.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?0!=this.s:0!=(this[e]&1<<t%this.DB)},t.prototype.setBit=function(t){return this.changeBit(t,n)},t.prototype.clearBit=function(t){return this.changeBit(t,o)},t.prototype.flipBit=function(t){return this.changeBit(t,r)},t.prototype.add=function(t){var e=O();return this.addTo(t,e),e},t.prototype.subtract=function(t){var e=O();return this.subTo(t,e),e},t.prototype.multiply=function(t){var e=O();return this.multiplyTo(t,e),e},t.prototype.divide=function(t){var e=O();return this.divRemTo(t,e,null),e},t.prototype.remainder=function(t){var e=O();return this.divRemTo(t,null,e),e},t.prototype.divideAndRemainder=function(t){var e=O(),i=O();return this.divRemTo(t,e,i),[e,i]},t.prototype.modPow=function(t,e){var i,n,r=t.bitLength(),o=B(1);if(r<=0)return o;i=r<18?1:r<48?3:r<144?4:r<768?5:6,n=r<8?new E(e):e.isEven()?new L(e):new D(e);var a=[],s=3,l=i-1,u=(1<<i)-1;if(a[1]=n.convert(this),i>1){var h=O();for(n.sqrTo(a[1],h);s<=u;)a[s]=O(),n.mulTo(h,a[s-2],a[s]),s+=2}var c,d,p=t.t-1,f=!0,m=O();for(r=z(t[p])-1;p>=0;){for(r>=l?c=t[p]>>r-l&u:(c=(t[p]&(1<<r+1)-1)<<l-r,p>0&&(c|=t[p-1]>>this.DB+r-l)),s=i;0==(1&c);)c>>=1,--s;if((r-=s)<0&&(r+=this.DB,--p),f)a[c].copyTo(o),f=!1;else{for(;s>1;)n.sqrTo(o,m),n.sqrTo(m,o),s-=2;s>0?n.sqrTo(o,m):(d=o,o=m,m=d),n.mulTo(m,a[c],o)}for(;p>=0&&0==(t[p]&1<<r);)n.sqrTo(o,m),d=o,o=m,m=d,--r<0&&(r=this.DB-1,--p)}return n.revert(o)},t.prototype.modInverse=function(e){var i=e.isEven();if(this.isEven()&&i||0==e.signum())return t.ZERO;for(var n=e.clone(),r=this.clone(),o=B(1),a=B(0),s=B(0),l=B(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),i?(o.isEven()&&a.isEven()||(o.addTo(this,o),a.subTo(e,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);for(;r.isEven();)r.rShiftTo(1,r),i?(s.isEven()&&l.isEven()||(s.addTo(this,s),l.subTo(e,l)),s.rShiftTo(1,s)):l.isEven()||l.subTo(e,l),l.rShiftTo(1,l);n.compareTo(r)>=0?(n.subTo(r,n),i&&o.subTo(s,o),a.subTo(l,a)):(r.subTo(n,r),i&&s.subTo(o,s),l.subTo(a,l))}return 0!=r.compareTo(t.ONE)?t.ZERO:l.compareTo(e)>=0?l.subtract(e):l.signum()<0?(l.addTo(e,l),l.signum()<0?l.add(e):l):l},t.prototype.pow=function(t){return this.exp(t,new C)},t.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),i=t.s<0?t.negate():t.clone();if(e.compareTo(i)<0){var n=e;e=i,i=n}var r=e.getLowestSetBit(),o=i.getLowestSetBit();if(o<0)return e;for(r<o&&(o=r),o>0&&(e.rShiftTo(o,e),i.rShiftTo(o,i));e.signum()>0;)(r=e.getLowestSetBit())>0&&e.rShiftTo(r,e),(r=i.getLowestSetBit())>0&&i.rShiftTo(r,i),e.compareTo(i)>=0?(e.subTo(i,e),e.rShiftTo(1,e)):(i.subTo(e,i),i.rShiftTo(1,i));return o>0&&i.lShiftTo(o,i),i},t.prototype.isProbablePrime=function(t){var e,i=this.abs();if(1==i.t&&i[0]<=_[_.length-1]){for(e=0;e<_.length;++e)if(i[0]==_[e])return!0;return!1}if(i.isEven())return!1;for(e=1;e<_.length;){for(var n=_[e],r=e+1;r<_.length&&n<A;)n*=_[r++];for(n=i.modInt(n);e<r;)if(n%_[e++]==0)return!1}return i.millerRabin(t)},t.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},t.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},t.prototype.fromString=function(e,i){var n;if(16==i)n=4;else if(8==i)n=3;else if(256==i)n=8;else if(2==i)n=1;else if(32==i)n=5;else{if(4!=i)return void this.fromRadix(e,i);n=2}this.t=0,this.s=0;for(var r=e.length,o=!1,a=0;--r>=0;){var s=8==n?255&+e[r]:F(e,r);s<0?"-"==e.charAt(r)&&(o=!0):(o=!1,0==a?this[this.t++]=s:a+n>this.DB?(this[this.t-1]|=(s&(1<<this.DB-a)-1)<<a,this[this.t++]=s>>this.DB-a):this[this.t-1]|=s<<a,(a+=n)>=this.DB&&(a-=this.DB))}8==n&&0!=(128&+e[0])&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),o&&t.ZERO.subTo(this,this)},t.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},t.prototype.dlShiftTo=function(t,e){var i;for(i=this.t-1;i>=0;--i)e[i+t]=this[i];for(i=t-1;i>=0;--i)e[i]=0;e.t=this.t+t,e.s=this.s},t.prototype.drShiftTo=function(t,e){for(var i=t;i<this.t;++i)e[i-t]=this[i];e.t=Math.max(this.t-t,0),e.s=this.s},t.prototype.lShiftTo=function(t,e){for(var i=t%this.DB,n=this.DB-i,r=(1<<n)-1,o=Math.floor(t/this.DB),a=this.s<<i&this.DM,s=this.t-1;s>=0;--s)e[s+o+1]=this[s]>>n|a,a=(this[s]&r)<<i;for(s=o-1;s>=0;--s)e[s]=0;e[o]=a,e.t=this.t+o+1,e.s=this.s,e.clamp()},t.prototype.rShiftTo=function(t,e){e.s=this.s;var i=Math.floor(t/this.DB);if(i>=this.t)e.t=0;else{var n=t%this.DB,r=this.DB-n,o=(1<<n)-1;e[0]=this[i]>>n;for(var a=i+1;a<this.t;++a)e[a-i-1]|=(this[a]&o)<<r,e[a-i]=this[a]>>n;n>0&&(e[this.t-i-1]|=(this.s&o)<<r),e.t=this.t-i,e.clamp()}},t.prototype.subTo=function(t,e){for(var i=0,n=0,r=Math.min(t.t,this.t);i<r;)n+=this[i]-t[i],e[i++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n-=t.s;i<this.t;)n+=this[i],e[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<t.t;)n-=t[i],e[i++]=n&this.DM,n>>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e[i++]=this.DV+n:n>0&&(e[i++]=n),e.t=i,e.clamp()},t.prototype.multiplyTo=function(e,i){var n=this.abs(),r=e.abs(),o=n.t;for(i.t=o+r.t;--o>=0;)i[o]=0;for(o=0;o<r.t;++o)i[o+n.t]=n.am(0,r[o],i,o,0,n.t);i.s=0,i.clamp(),this.s!=e.s&&t.ZERO.subTo(i,i)},t.prototype.squareTo=function(t){for(var e=this.abs(),i=t.t=2*e.t;--i>=0;)t[i]=0;for(i=0;i<e.t-1;++i){var n=e.am(i,e[i],t,2*i,0,1);(t[i+e.t]+=e.am(i+1,2*e[i],t,2*i+1,n,e.t-i-1))>=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(i,e[i],t,2*i,0,1)),t.s=0,t.clamp()},t.prototype.divRemTo=function(e,i,n){var r=e.abs();if(!(r.t<=0)){var o=this.abs();if(o.t<r.t)return null!=i&&i.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=O());var a=O(),s=this.s,l=e.s,u=this.DB-z(r[r.t-1]);u>0?(r.lShiftTo(u,a),o.lShiftTo(u,n)):(r.copyTo(a),o.copyTo(n));var h=a.t,c=a[h-1];if(0!=c){var d=c*(1<<this.F1)+(h>1?a[h-2]>>this.F2:0),p=this.FV/d,f=(1<<this.F1)/d,m=1<<this.F2,g=n.t,v=g-h,y=null==i?O():i;for(a.dlShiftTo(v,y),n.compareTo(y)>=0&&(n[n.t++]=1,n.subTo(y,n)),t.ONE.dlShiftTo(h,y),y.subTo(a,a);a.t<h;)a[a.t++]=0;for(;--v>=0;){var b=n[--g]==c?this.DM:Math.floor(n[g]*p+(n[g-1]+m)*f);if((n[g]+=a.am(0,b,n,v,0,h))<b)for(a.dlShiftTo(v,y),n.subTo(y,n);n[g]<--b;)n.subTo(y,n)}null!=i&&(n.drShiftTo(h,i),s!=l&&t.ZERO.subTo(i,i)),n.t=h,n.clamp(),u>0&&n.rShiftTo(u,n),s<0&&t.ZERO.subTo(n,n)}}},t.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},t.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},t.prototype.exp=function(e,i){if(e>4294967295||e<1)return t.ONE;var n=O(),r=O(),o=i.convert(this),a=z(e)-1;for(o.copyTo(n);--a>=0;)if(i.sqrTo(n,r),(e&1<<a)>0)i.mulTo(r,o,n);else{var s=n;n=r,r=s}return i.revert(n)},t.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},t.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),i=Math.pow(t,e),n=B(i),r=O(),o=O(),a="";for(this.divRemTo(n,r,o);r.signum()>0;)a=(i+o.intValue()).toString(t).substr(1)+a,r.divRemTo(n,r,o);return o.intValue().toString(t)+a},t.prototype.fromRadix=function(e,i){this.fromInt(0),null==i&&(i=10);for(var n=this.chunkSize(i),r=Math.pow(i,n),o=!1,a=0,s=0,l=0;l<e.length;++l){var u=F(e,l);u<0?"-"==e.charAt(l)&&0==this.signum()&&(o=!0):(s=i*s+u,++a>=n&&(this.dMultiply(r),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(i,a)),this.dAddOffset(s,0)),o&&t.ZERO.subTo(this,this)},t.prototype.fromNumber=function(e,i,r){if("number"==typeof i)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),n,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(i);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(t.ONE.shiftLeft(e-1),this);else{var o=[],a=7&e;o.length=1+(e>>3),i.nextBytes(o),a>0?o[0]&=(1<<a)-1:o[0]=0,this.fromString(o,256)}},t.prototype.bitwiseTo=function(t,e,i){var n,r,o=Math.min(t.t,this.t);for(n=0;n<o;++n)i[n]=e(this[n],t[n]);if(t.t<this.t){for(r=t.s&this.DM,n=o;n<this.t;++n)i[n]=e(this[n],r);i.t=this.t}else{for(r=this.s&this.DM,n=o;n<t.t;++n)i[n]=e(r,t[n]);i.t=t.t}i.s=e(this.s,t.s),i.clamp()},t.prototype.changeBit=function(e,i){var n=t.ONE.shiftLeft(e);return this.bitwiseTo(n,i,n),n},t.prototype.addTo=function(t,e){for(var i=0,n=0,r=Math.min(t.t,this.t);i<r;)n+=this[i]+t[i],e[i++]=n&this.DM,n>>=this.DB;if(t.t<this.t){for(n+=t.s;i<this.t;)n+=this[i],e[i++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;i<t.t;)n+=t[i],e[i++]=n&this.DM,n>>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e[i++]=n:n<-1&&(e[i++]=this.DV+n),e.t=i,e.clamp()},t.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},t.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},t.prototype.multiplyLowerTo=function(t,e,i){var n=Math.min(this.t+t.t,e);for(i.s=0,i.t=n;n>0;)i[--n]=0;for(var r=i.t-this.t;n<r;++n)i[n+this.t]=this.am(0,t[n],i,n,0,this.t);for(r=Math.min(t.t,e);n<r;++n)this.am(0,t[n],i,n,0,e-n);i.clamp()},t.prototype.multiplyUpperTo=function(t,e,i){--e;var n=i.t=this.t+t.t-e;for(i.s=0;--n>=0;)i[n]=0;for(n=Math.max(e-this.t,0);n<t.t;++n)i[this.t+n-e]=this.am(e-n,t[n],i,0,0,this.t+n-e);i.clamp(),i.drShiftTo(1,i)},t.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,i=this.s<0?t-1:0;if(this.t>0)if(0==e)i=this[0]%t;else for(var n=this.t-1;n>=0;--n)i=(e*i+this[n])%t;return i},t.prototype.millerRabin=function(e){var i=this.subtract(t.ONE),n=i.getLowestSetBit();if(n<=0)return!1;var r=i.shiftRight(n);(e=e+1>>1)>_.length&&(e=_.length);for(var o=O(),a=0;a<e;++a){o.fromInt(_[Math.floor(Math.random()*_.length)]);var s=o.modPow(r,this);if(0!=s.compareTo(t.ONE)&&0!=s.compareTo(i)){for(var l=1;l++<n&&0!=s.compareTo(i);)if(0==(s=s.modPowInt(2,this)).compareTo(t.ONE))return!1;if(0!=s.compareTo(i))return!1}}return!0},t.prototype.square=function(){var t=O();return this.squareTo(t),t},t.prototype.gcda=function(t,e){var i=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(i.compareTo(n)<0){var r=i;i=n,n=r}var o=i.getLowestSetBit(),a=n.getLowestSetBit();if(a<0)e(i);else{o<a&&(a=o),a>0&&(i.rShiftTo(a,i),n.rShiftTo(a,n));var s=function(){(o=i.getLowestSetBit())>0&&i.rShiftTo(o,i),(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),i.compareTo(n)>=0?(i.subTo(n,i),i.rShiftTo(1,i)):(n.subTo(i,n),n.rShiftTo(1,n)),i.signum()>0?setTimeout(s,0):(a>0&&n.lShiftTo(a,n),setTimeout((function(){e(n)}),0))};setTimeout(s,10)}},t.prototype.fromNumberAsync=function(e,i,r,o){if("number"==typeof i)if(e<2)this.fromInt(1);else{this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),n,this),this.isEven()&&this.dAddOffset(1,0);var a=this,s=function(){a.dAddOffset(2,0),a.bitLength()>e&&a.subTo(t.ONE.shiftLeft(e-1),a),a.isProbablePrime(i)?setTimeout((function(){o()}),0):setTimeout(s,0)};setTimeout(s,0)}else{var l=[],u=7&e;l.length=1+(e>>3),i.nextBytes(l),u>0?l[0]&=(1<<u)-1:l[0]=0,this.fromString(l,256)}},t}(),C=function(){function t(){}return t.prototype.convert=function(t){return t},t.prototype.revert=function(t){return t},t.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i)},t.prototype.sqrTo=function(t,e){t.squareTo(e)},t}(),E=function(){function t(t){this.m=t}return t.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},t.prototype.revert=function(t){return t},t.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},t.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),D=function(){function t(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}return t.prototype.convert=function(t){var e=O();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(P.ZERO)>0&&this.m.subTo(e,e),e},t.prototype.revert=function(t){var e=O();return t.copyTo(e),this.reduce(e),e},t.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var i=32767&t[e],n=i*this.mpl+((i*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(t[i=e+this.m.t]+=this.m.am(0,n,t,e,0,this.m.t);t[i]>=t.DV;)t[i]-=t.DV,t[++i]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},t.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}(),L=function(){function t(t){this.m=t,this.r2=O(),this.q3=O(),P.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t)}return t.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=O();return t.copyTo(e),this.reduce(e),e},t.prototype.revert=function(t){return t},t.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},t.prototype.mulTo=function(t,e,i){t.multiplyTo(e,i),this.reduce(i)},t.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},t}();function O(){return new P(null)}function I(t,e){return new P(t,e)}"Microsoft Internet Explorer"==navigator.appName?(P.prototype.am=function(t,e,i,n,r,o){for(var a=32767&e,s=e>>15;--o>=0;){var l=32767&this[t],u=this[t++]>>15,h=s*l+u*a;r=((l=a*l+((32767&h)<<15)+i[n]+(1073741823&r))>>>30)+(h>>>15)+s*u+(r>>>30),i[n++]=1073741823&l}return r},x=30):"Netscape"!=navigator.appName?(P.prototype.am=function(t,e,i,n,r,o){for(;--o>=0;){var a=e*this[t++]+i[n]+r;r=Math.floor(a/67108864),i[n++]=67108863&a}return r},x=26):(P.prototype.am=function(t,e,i,n,r,o){for(var a=16383&e,s=e>>14;--o>=0;){var l=16383&this[t],u=this[t++]>>14,h=s*l+u*a;r=((l=a*l+((16383&h)<<14)+i[n]+r)>>28)+(h>>14)+s*u,i[n++]=268435455&l}return r},x=28),P.prototype.DB=x,P.prototype.DM=(1<<x)-1,P.prototype.DV=1<<x,P.prototype.FV=Math.pow(2,52),P.prototype.F1=52-x,P.prototype.F2=2*x-52;var R,N,k=[];for(R="0".charCodeAt(0),N=0;N<=9;++N)k[R++]=N;for(R="a".charCodeAt(0),N=10;N<36;++N)k[R++]=N;for(R="A".charCodeAt(0),N=10;N<36;++N)k[R++]=N;function F(t,e){var i=k[t.charCodeAt(e)];return null==i?-1:i}function B(t){var e=O();return e.fromInt(t),e}function z(t){var e,i=1;return 0!=(e=t>>>16)&&(t=e,i+=16),0!=(e=t>>8)&&(t=e,i+=8),0!=(e=t>>4)&&(t=e,i+=4),0!=(e=t>>2)&&(t=e,i+=2),0!=(e=t>>1)&&(t=e,i+=1),i}P.ZERO=B(0),P.ONE=B(1);var U,V,j=function(){function t(){this.i=0,this.j=0,this.S=[]}return t.prototype.init=function(t){var e,i,n;for(e=0;e<256;++e)this.S[e]=e;for(i=0,e=0;e<256;++e)i=i+this.S[e]+t[e%t.length]&255,n=this.S[e],this.S[e]=this.S[i],this.S[i]=n;this.i=0,this.j=0},t.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]},t}(),H=null;if(null==H){H=[],V=0;var G=void 0;if(window.crypto&&window.crypto.getRandomValues){var W=new Uint32Array(256);for(window.crypto.getRandomValues(W),G=0;G<W.length;++G)H[V++]=255&W[G]}var q=function(t){if(this.count=this.count||0,this.count>=256||V>=256)window.removeEventListener?window.removeEventListener("mousemove",q,!1):window.detachEvent&&window.detachEvent("onmousemove",q);else try{var e=t.x+t.y;H[V++]=255&e,this.count+=1}catch(t){}};window.addEventListener?window.addEventListener("mousemove",q,!1):window.attachEvent&&window.attachEvent("onmousemove",q)}function Y(){if(null==U){for(U=new j;V<256;){var t=Math.floor(65536*Math.random());H[V++]=255&t}for(U.init(H),V=0;V<H.length;++V)H[V]=0;V=0}return U.next()}var X=function(){function t(){}return t.prototype.nextBytes=function(t){for(var e=0;e<t.length;++e)t[e]=Y()},t}(),Z=function(){function t(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return t.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},t.prototype.doPrivate=function(t){if(null==this.p||null==this.q)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),i=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(i)<0;)e=e.add(this.p);return e.subtract(i).multiply(this.coeff).mod(this.p).multiply(this.q).add(i)},t.prototype.setPublic=function(t,e){null!=t&&null!=e&&t.length>0&&e.length>0&&(this.n=I(t,16),this.e=parseInt(e,16))},t.prototype.encrypt=function(t){var e=function(t,e){if(e<t.length+11)return null;for(var i=[],n=t.length-1;n>=0&&e>0;){var r=t.charCodeAt(n--);r<128?i[--e]=r:r>127&&r<2048?(i[--e]=63&r|128,i[--e]=r>>6|192):(i[--e]=63&r|128,i[--e]=r>>6&63|128,i[--e]=r>>12|224)}i[--e]=0;for(var o=new X,a=[];e>2;){for(a[0]=0;0==a[0];)o.nextBytes(a);i[--e]=a[0]}return i[--e]=2,i[--e]=0,new P(i)}(t,this.n.bitLength()+7>>3);if(null==e)return null;var i=this.doPublic(e);if(null==i)return null;var n=i.toString(16);return 0==(1&n.length)?n:"0"+n},t.prototype.setPrivate=function(t,e,i){null!=t&&null!=e&&t.length>0&&e.length>0&&(this.n=I(t,16),this.e=parseInt(e,16),this.d=I(i,16))},t.prototype.setPrivateEx=function(t,e,i,n,r,o,a,s){null!=t&&null!=e&&t.length>0&&e.length>0&&(this.n=I(t,16),this.e=parseInt(e,16),this.d=I(i,16),this.p=I(n,16),this.q=I(r,16),this.dmp1=I(o,16),this.dmq1=I(a,16),this.coeff=I(s,16))},t.prototype.generate=function(t,e){var i=new X,n=t>>1;this.e=parseInt(e,16);for(var r=new P(e,16);;){for(;this.p=new P(t-n,1,i),0!=this.p.subtract(P.ONE).gcd(r).compareTo(P.ONE)||!this.p.isProbablePrime(10););for(;this.q=new P(n,1,i),0!=this.q.subtract(P.ONE).gcd(r).compareTo(P.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var a=this.p.subtract(P.ONE),s=this.q.subtract(P.ONE),l=a.multiply(s);if(0==l.gcd(r).compareTo(P.ONE)){this.n=this.p.multiply(this.q),this.d=r.modInverse(l),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(s),this.coeff=this.q.modInverse(this.p);break}}},t.prototype.decrypt=function(t){var e=I(t,16),i=this.doPrivate(e);return null==i?null:function(t,e){for(var i=t.toByteArray(),n=0;n<i.length&&0==i[n];)++n;if(i.length-n!=e-1||2!=i[n])return null;for(++n;0!=i[n];)if(++n>=i.length)return null;for(var r="";++n<i.length;){var o=255&i[n];o<128?r+=String.fromCharCode(o):o>191&&o<224?(r+=String.fromCharCode((31&o)<<6|63&i[n+1]),++n):(r+=String.fromCharCode((15&o)<<12|(63&i[n+1])<<6|63&i[n+2]),n+=2)}return r}(i,this.n.bitLength()+7>>3)},t.prototype.generateAsync=function(t,e,i){var n=new X,r=t>>1;this.e=parseInt(e,16);var o=new P(e,16),a=this,s=function(){var e=function(){if(a.p.compareTo(a.q)<=0){var t=a.p;a.p=a.q,a.q=t}var e=a.p.subtract(P.ONE),n=a.q.subtract(P.ONE),r=e.multiply(n);0==r.gcd(o).compareTo(P.ONE)?(a.n=a.p.multiply(a.q),a.d=o.modInverse(r),a.dmp1=a.d.mod(e),a.dmq1=a.d.mod(n),a.coeff=a.q.modInverse(a.p),setTimeout((function(){i()}),0)):setTimeout(s,0)},l=function(){a.q=O(),a.q.fromNumberAsync(r,1,n,(function(){a.q.subtract(P.ONE).gcda(o,(function(t){0==t.compareTo(P.ONE)&&a.q.isProbablePrime(10)?setTimeout(e,0):setTimeout(l,0)}))}))},u=function(){a.p=O(),a.p.fromNumberAsync(t-r,1,n,(function(){a.p.subtract(P.ONE).gcda(o,(function(t){0==t.compareTo(P.ONE)&&a.p.isProbablePrime(10)?setTimeout(l,0):setTimeout(u,0)}))}))};setTimeout(u,0)};setTimeout(s,0)},t.prototype.sign=function(t,e,i){var n=function(t,e){if(e<t.length+22)return null;for(var i=e-t.length-6,n="",r=0;r<i;r+=2)n+="ff";return I("0001"+n+"00"+t,16)}((K[i]||"")+e(t).toString(),this.n.bitLength()/4);if(null==n)return null;var r=this.doPrivate(n);if(null==r)return null;var o=r.toString(16);return 0==(1&o.length)?o:"0"+o},t.prototype.verify=function(t,e,i){var n=I(e,16),r=this.doPublic(n);return null==r?null:function(t){for(var e in K)if(K.hasOwnProperty(e)){var i=K[e],n=i.length;if(t.substr(0,n)==i)return t.substr(n)}return t}(r.toString(16).replace(/^1f+00/,""))==i(t).toString()},t}(),K={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"},Q={};Q.lang={extend:function(t,e,i){if(!e||!t)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var n=function(){};if(n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.superclass=e.prototype,e.prototype.constructor==Object.prototype.constructor&&(e.prototype.constructor=e),i){var r;for(r in i)t.prototype[r]=i[r];var o=function(){},a=["toString","valueOf"];try{/MSIE/.test(navigator.userAgent)&&(o=function(t,e){for(r=0;r<a.length;r+=1){var i=a[r],n=e[i];"function"==typeof n&&n!=Object.prototype[i]&&(t[i]=n)}})}catch(t){}o(t.prototype,i)}}};var J={};void 0!==J.asn1&&J.asn1||(J.asn1={}),J.asn1.ASN1Util=new function(){this.integerToByteHex=function(t){var e=t.toString(16);return e.length%2==1&&(e="0"+e),e},this.bigIntToMinTwosComplementsHex=function(t){var e=t.toString(16);if("-"!=e.substr(0,1))e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var i=e.substr(1).length;i%2==1?i+=1:e.match(/^[0-7]/)||(i+=2);for(var n="",r=0;r<i;r++)n+="f";e=new P(n,16).xor(t).add(P.ONE).toString(16).replace(/^-/,"")}return e},this.getPEMStringFromHex=function(t,e){return hextopem(t,e)},this.newObject=function(t){var e=J.asn1,i=e.DERBoolean,n=e.DERInteger,r=e.DERBitString,o=e.DEROctetString,a=e.DERNull,s=e.DERObjectIdentifier,l=e.DEREnumerated,u=e.DERUTF8String,h=e.DERNumericString,c=e.DERPrintableString,d=e.DERTeletexString,p=e.DERIA5String,f=e.DERUTCTime,m=e.DERGeneralizedTime,g=e.DERSequence,v=e.DERSet,y=e.DERTaggedObject,b=e.ASN1Util.newObject,w=Object.keys(t);if(1!=w.length)throw"key of param shall be only one.";var x=w[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+x+":"))throw"undefined key: "+x;if("bool"==x)return new i(t[x]);if("int"==x)return new n(t[x]);if("bitstr"==x)return new r(t[x]);if("octstr"==x)return new o(t[x]);if("null"==x)return new a(t[x]);if("oid"==x)return new s(t[x]);if("enum"==x)return new l(t[x]);if("utf8str"==x)return new u(t[x]);if("numstr"==x)return new h(t[x]);if("prnstr"==x)return new c(t[x]);if("telstr"==x)return new d(t[x]);if("ia5str"==x)return new p(t[x]);if("utctime"==x)return new f(t[x]);if("gentime"==x)return new m(t[x]);if("seq"==x){for(var M=t[x],T=[],S=0;S<M.length;S++){var _=b(M[S]);T.push(_)}return new g({array:T})}if("set"==x){for(M=t[x],T=[],S=0;S<M.length;S++)_=b(M[S]),T.push(_);return new v({array:T})}if("tag"==x){var A=t[x];if("[object Array]"===Object.prototype.toString.call(A)&&3==A.length){var P=b(A[2]);return new y({tag:A[0],explicit:A[1],obj:P})}var C={};if(void 0!==A.explicit&&(C.explicit=A.explicit),void 0!==A.tag&&(C.tag=A.tag),void 0===A.obj)throw"obj shall be specified for 'tag'.";return C.obj=b(A.obj),new y(C)}},this.jsonToASN1HEX=function(t){return this.newObject(t).getEncodedHex()}},J.asn1.ASN1Util.oidHexToInt=function(t){for(var e="",i=parseInt(t.substr(0,2),16),n=(e=Math.floor(i/40)+"."+i%40,""),r=2;r<t.length;r+=2){var o=("00000000"+parseInt(t.substr(r,2),16).toString(2)).slice(-8);n+=o.substr(1,7),"0"==o.substr(0,1)&&(e=e+"."+new P(n,2).toString(10),n="")}return e},J.asn1.ASN1Util.oidIntToHex=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},i=function(t){var i="",n=new P(t,10).toString(2),r=7-n.length%7;7==r&&(r=0);for(var o="",a=0;a<r;a++)o+="0";for(n=o+n,a=0;a<n.length-1;a+=7){var s=n.substr(a,7);a!=n.length-7&&(s="1"+s),i+=e(parseInt(s,2))}return i};if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var n="",r=t.split("."),o=40*parseInt(r[0])+parseInt(r[1]);n+=e(o),r.splice(0,2);for(var a=0;a<r.length;a++)n+=i(r[a]);return n},J.asn1.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+"".length+",v="+this.hV;var t=this.hV.length/2,e=t.toString(16);if(e.length%2==1&&(e="0"+e),t<128)return e;var i=e.length/2;if(i>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);return(128+i).toString(16)+e},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},J.asn1.DERAbstractString=function(t){J.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?this.setString(t):void 0!==t.str?this.setString(t.str):void 0!==t.hex&&this.setStringHex(t.hex))},Q.lang.extend(J.asn1.DERAbstractString,J.asn1.ASN1Object),J.asn1.DERAbstractTime=function(t){J.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){return utc=t.getTime()+6e4*t.getTimezoneOffset(),new Date(utc)},this.formatDate=function(t,e,i){var n=this.zeroPadding,r=this.localDateToUTC(t),o=String(r.getFullYear());"utc"==e&&(o=o.substr(2,2));var a=o+n(String(r.getMonth()+1),2)+n(String(r.getDate()),2)+n(String(r.getHours()),2)+n(String(r.getMinutes()),2)+n(String(r.getSeconds()),2);if(!0===i){var s=r.getMilliseconds();if(0!=s){var l=n(String(s),3);a=a+"."+(l=l.replace(/[0]+$/,""))}}return a+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(t)},this.setByDateValue=function(t,e,i,n,r,o){var a=new Date(Date.UTC(t,e-1,i,n,r,o,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}},Q.lang.extend(J.asn1.DERAbstractTime,J.asn1.ASN1Object),J.asn1.DERAbstractStructured=function(t){J.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,void 0!==t&&void 0!==t.array&&(this.asn1Array=t.array)},Q.lang.extend(J.asn1.DERAbstractStructured,J.asn1.ASN1Object),J.asn1.DERBoolean=function(){J.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},Q.lang.extend(J.asn1.DERBoolean,J.asn1.ASN1Object),J.asn1.DERInteger=function(t){J.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=J.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new P(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.bigint?this.setByBigInteger(t.bigint):void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},Q.lang.extend(J.asn1.DERInteger,J.asn1.ASN1Object),J.asn1.DERBitString=function(t){if(void 0!==t&&void 0!==t.obj){var e=J.asn1.ASN1Util.newObject(t.obj);t.hex="00"+e.getEncodedHex()}J.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(t){this.hTLV=null,this.isModified=!0,this.hV=t},this.setUnusedBitsAndHexValue=function(t,e){if(t<0||7<t)throw"unused bits shall be from 0 to 7: u = "+t;var i="0"+t;this.hTLV=null,this.isModified=!0,this.hV=i+e},this.setByBinaryString=function(t){var e=8-(t=t.replace(/0+$/,"")).length%8;8==e&&(e=0);for(var i=0;i<=e;i++)t+="0";var n="";for(i=0;i<t.length-1;i+=8){var r=t.substr(i,8),o=parseInt(r,2).toString(16);1==o.length&&(o="0"+o),n+=o}this.hTLV=null,this.isModified=!0,this.hV="0"+e+n},this.setByBooleanArray=function(t){for(var e="",i=0;i<t.length;i++)1==t[i]?e+="1":e+="0";this.setByBinaryString(e)},this.newFalseArray=function(t){for(var e=new Array(t),i=0;i<t;i++)e[i]=!1;return e},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t&&t.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(t):void 0!==t.hex?this.setHexValueIncludingUnusedBits(t.hex):void 0!==t.bin?this.setByBinaryString(t.bin):void 0!==t.array&&this.setByBooleanArray(t.array))},Q.lang.extend(J.asn1.DERBitString,J.asn1.ASN1Object),J.asn1.DEROctetString=function(t){if(void 0!==t&&void 0!==t.obj){var e=J.asn1.ASN1Util.newObject(t.obj);t.hex=e.getEncodedHex()}J.asn1.DEROctetString.superclass.constructor.call(this,t),this.hT="04"},Q.lang.extend(J.asn1.DEROctetString,J.asn1.DERAbstractString),J.asn1.DERNull=function(){J.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},Q.lang.extend(J.asn1.DERNull,J.asn1.ASN1Object),J.asn1.DERObjectIdentifier=function(t){var e=function(t){var e=t.toString(16);return 1==e.length&&(e="0"+e),e},i=function(t){var i="",n=new P(t,10).toString(2),r=7-n.length%7;7==r&&(r=0);for(var o="",a=0;a<r;a++)o+="0";for(n=o+n,a=0;a<n.length-1;a+=7){var s=n.substr(a,7);a!=n.length-7&&(s="1"+s),i+=e(parseInt(s,2))}return i};J.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueOidString=function(t){if(!t.match(/^[0-9.]+$/))throw"malformed oid string: "+t;var n="",r=t.split("."),o=40*parseInt(r[0])+parseInt(r[1]);n+=e(o),r.splice(0,2);for(var a=0;a<r.length;a++)n+=i(r[a]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.setValueName=function(t){var e=J.asn1.x509.OID.name2oid(t);if(""===e)throw"DERObjectIdentifier oidName undefined: "+t;this.setValueOidString(e)},this.getFreshValueHex=function(){return this.hV},void 0!==t&&("string"==typeof t?t.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(t):this.setValueName(t):void 0!==t.oid?this.setValueOidString(t.oid):void 0!==t.hex?this.setValueHex(t.hex):void 0!==t.name&&this.setValueName(t.name))},Q.lang.extend(J.asn1.DERObjectIdentifier,J.asn1.ASN1Object),J.asn1.DEREnumerated=function(t){J.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=J.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new P(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.int?this.setByInteger(t.int):"number"==typeof t?this.setByInteger(t):void 0!==t.hex&&this.setValueHex(t.hex))},Q.lang.extend(J.asn1.DEREnumerated,J.asn1.ASN1Object),J.asn1.DERUTF8String=function(t){J.asn1.DERUTF8String.superclass.constructor.call(this,t),this.hT="0c"},Q.lang.extend(J.asn1.DERUTF8String,J.asn1.DERAbstractString),J.asn1.DERNumericString=function(t){J.asn1.DERNumericString.superclass.constructor.call(this,t),this.hT="12"},Q.lang.extend(J.asn1.DERNumericString,J.asn1.DERAbstractString),J.asn1.DERPrintableString=function(t){J.asn1.DERPrintableString.superclass.constructor.call(this,t),this.hT="13"},Q.lang.extend(J.asn1.DERPrintableString,J.asn1.DERAbstractString),J.asn1.DERTeletexString=function(t){J.asn1.DERTeletexString.superclass.constructor.call(this,t),this.hT="14"},Q.lang.extend(J.asn1.DERTeletexString,J.asn1.DERAbstractString),J.asn1.DERIA5String=function(t){J.asn1.DERIA5String.superclass.constructor.call(this,t),this.hT="16"},Q.lang.extend(J.asn1.DERIA5String,J.asn1.DERAbstractString),J.asn1.DERUTCTime=function(t){J.asn1.DERUTCTime.superclass.constructor.call(this,t),this.hT="17",this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{12}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date))},Q.lang.extend(J.asn1.DERUTCTime,J.asn1.DERAbstractTime),J.asn1.DERGeneralizedTime=function(t){J.asn1.DERGeneralizedTime.superclass.constructor.call(this,t),this.hT="18",this.withMillis=!1,this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==t&&(void 0!==t.str?this.setString(t.str):"string"==typeof t&&t.match(/^[0-9]{14}Z$/)?this.setString(t):void 0!==t.hex?this.setStringHex(t.hex):void 0!==t.date&&this.setByDate(t.date),!0===t.millis&&(this.withMillis=!0))},Q.lang.extend(J.asn1.DERGeneralizedTime,J.asn1.DERAbstractTime),J.asn1.DERSequence=function(t){J.asn1.DERSequence.superclass.constructor.call(this,t),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++)t+=this.asn1Array[e].getEncodedHex();return this.hV=t,this.hV}},Q.lang.extend(J.asn1.DERSequence,J.asn1.DERAbstractStructured),J.asn1.DERSet=function(t){J.asn1.DERSet.superclass.constructor.call(this,t),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,e=0;e<this.asn1Array.length;e++){var i=this.asn1Array[e];t.push(i.getEncodedHex())}return 1==this.sortFlag&&t.sort(),this.hV=t.join(""),this.hV},void 0!==t&&void 0!==t.sortflag&&0==t.sortflag&&(this.sortFlag=!1)},Q.lang.extend(J.asn1.DERSet,J.asn1.DERAbstractStructured),J.asn1.DERTaggedObject=function(t){J.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(t,e,i){this.hT=e,this.isExplicit=t,this.asn1Object=i,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=i.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,e),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==t&&(void 0!==t.tag&&(this.hT=t.tag),void 0!==t.explicit&&(this.isExplicit=t.explicit),void 0!==t.obj&&(this.asn1Object=t.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},Q.lang.extend(J.asn1.DERTaggedObject,J.asn1.ASN1Object);var $=function(t){function e(i){var n=t.call(this)||this;return i&&("string"==typeof i?n.parseKey(i):(e.hasPrivateKeyProperty(i)||e.hasPublicKeyProperty(i))&&n.parsePropertiesFrom(i)),n}return function(t,e){function i(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}(e,t),e.prototype.parseKey=function(t){try{var e=0,i=0,n=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(t)?f(t):m.unarmor(t),r=T.decode(n);if(3===r.sub.length&&(r=r.sub[2].sub[0]),9===r.sub.length){e=r.sub[1].getHexStringValue(),this.n=I(e,16),i=r.sub[2].getHexStringValue(),this.e=parseInt(i,16);var o=r.sub[3].getHexStringValue();this.d=I(o,16);var a=r.sub[4].getHexStringValue();this.p=I(a,16);var s=r.sub[5].getHexStringValue();this.q=I(s,16);var l=r.sub[6].getHexStringValue();this.dmp1=I(l,16);var u=r.sub[7].getHexStringValue();this.dmq1=I(u,16);var h=r.sub[8].getHexStringValue();this.coeff=I(h,16)}else{if(2!==r.sub.length)return!1;var c=r.sub[1].sub[0];e=c.sub[0].getHexStringValue(),this.n=I(e,16),i=c.sub[1].getHexStringValue(),this.e=parseInt(i,16)}return!0}catch(t){return!1}},e.prototype.getPrivateBaseKey=function(){var t={array:[new J.asn1.DERInteger({int:0}),new J.asn1.DERInteger({bigint:this.n}),new J.asn1.DERInteger({int:this.e}),new J.asn1.DERInteger({bigint:this.d}),new J.asn1.DERInteger({bigint:this.p}),new J.asn1.DERInteger({bigint:this.q}),new J.asn1.DERInteger({bigint:this.dmp1}),new J.asn1.DERInteger({bigint:this.dmq1}),new J.asn1.DERInteger({bigint:this.coeff})]};return new J.asn1.DERSequence(t).getEncodedHex()},e.prototype.getPrivateBaseKeyB64=function(){return u(this.getPrivateBaseKey())},e.prototype.getPublicBaseKey=function(){var t=new J.asn1.DERSequence({array:[new J.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new J.asn1.DERNull]}),e=new J.asn1.DERSequence({array:[new J.asn1.DERInteger({bigint:this.n}),new J.asn1.DERInteger({int:this.e})]}),i=new J.asn1.DERBitString({hex:"00"+e.getEncodedHex()});return new J.asn1.DERSequence({array:[t,i]}).getEncodedHex()},e.prototype.getPublicBaseKeyB64=function(){return u(this.getPublicBaseKey())},e.wordwrap=function(t,e){if(!t)return t;var i="(.{1,"+(e=e||64)+"})( +|$\n?)|(.{1,"+e+"})";return t.match(RegExp(i,"g")).join("\n")},e.prototype.getPrivateKey=function(){var t="-----BEGIN RSA PRIVATE KEY-----\n";return t+=e.wordwrap(this.getPrivateBaseKeyB64())+"\n",t+="-----END RSA PRIVATE KEY-----"},e.prototype.getPublicKey=function(){var t="-----BEGIN PUBLIC KEY-----\n";return t+=e.wordwrap(this.getPublicBaseKeyB64())+"\n",t+="-----END PUBLIC KEY-----"},e.hasPublicKeyProperty=function(t){return(t=t||{}).hasOwnProperty("n")&&t.hasOwnProperty("e")},e.hasPrivateKeyProperty=function(t){return(t=t||{}).hasOwnProperty("n")&&t.hasOwnProperty("e")&&t.hasOwnProperty("d")&&t.hasOwnProperty("p")&&t.hasOwnProperty("q")&&t.hasOwnProperty("dmp1")&&t.hasOwnProperty("dmq1")&&t.hasOwnProperty("coeff")},e.prototype.parsePropertiesFrom=function(t){this.n=t.n,this.e=t.e,t.hasOwnProperty("d")&&(this.d=t.d,this.p=t.p,this.q=t.q,this.dmp1=t.dmp1,this.dmq1=t.dmq1,this.coeff=t.coeff)},e}(Z),tt=function(){function t(t){t=t||{},this.default_key_size=parseInt(t.default_key_size,10)||1024,this.default_public_exponent=t.default_public_exponent||"010001",this.log=t.log||!1,this.key=null}return t.prototype.setKey=function(t){this.log&&this.key,this.key=new $(t)},t.prototype.setPrivateKey=function(t){this.setKey(t)},t.prototype.setPublicKey=function(t){this.setKey(t)},t.prototype.decrypt=function(t){try{return this.getKey().decrypt(h(t))}catch(t){return!1}},t.prototype.encrypt=function(t){try{return u(this.getKey().encrypt(t))}catch(t){return!1}},t.prototype.encryptLong=function(t){var e=this.getKey(),i=(e.n.bitLength()+7>>3)-11;try{var n="";return t.length>i?t.match(/.{1,117}/g).forEach((function(t){var i=e.encrypt(t);n+=i})):n=e.encrypt(t),u(n)}catch(t){return!1}},t.prototype.sign=function(t,e,i){try{return u(this.getKey().sign(t,e,i))}catch(t){return!1}},t.prototype.verify=function(t,e,i){try{return this.getKey().verify(t,h(e),i)}catch(t){return!1}},t.prototype.getKey=function(t){if(!this.key){if(this.key=new $,t&&"[object Function]"==={}.toString.call(t))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,t);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},t.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},t.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},t.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},t.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},t.version="3.0.0-rc.1",t}();window.JSEncrypt=tt,t.JSEncrypt=tt,t.default=tt,Object.defineProperty(t,"__esModule",{value:!0})}(e)},function(t,e,i){var n;!function(e,i){"object"==typeof t.exports?t.exports=e.document?i(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return i(t)}:i(e)}("undefined"!=typeof window?window:this,(function(i,r){var o=[],a=o.slice,s=o.concat,l=o.push,u=o.indexOf,h={},c=h.toString,d=h.hasOwnProperty,p={},f=i.document,m="2.1.1",g=function(t,e){return new g.fn.init(t,e)},v=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,y=/^-ms-/,b=/-([\da-z])/gi,w=function(t,e){return e.toUpperCase()};function x(t){var e=t.length,i=g.type(t);return"function"!==i&&!g.isWindow(t)&&(!(1!==t.nodeType||!e)||("array"===i||0===e||"number"==typeof e&&e>0&&e-1 in t))}g.fn=g.prototype={jquery:m,constructor:g,selector:"",length:0,toArray:function(){return a.call(this)},get:function(t){return null!=t?0>t?this[t+this.length]:this[t]:a.call(this)},pushStack:function(t){var e=g.merge(this.constructor(),t);return e.prevObject=this,e.context=this.context,e},each:function(t,e){return g.each(this,t,e)},map:function(t){return this.pushStack(g.map(this,(function(e,i){return t.call(e,i,e)})))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(t){var e=this.length,i=+t+(0>t?e:0);return this.pushStack(i>=0&&e>i?[this[i]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:l,sort:o.sort,splice:o.splice},g.extend=g.fn.extend=function(){var t,e,i,n,r,o,a=arguments[0]||{},s=1,l=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[s]||{},s++),"object"==typeof a||g.isFunction(a)||(a={}),s===l&&(a=this,s--);l>s;s++)if(null!=(t=arguments[s]))for(e in t)i=a[e],a!==(n=t[e])&&(u&&n&&(g.isPlainObject(n)||(r=g.isArray(n)))?(r?(r=!1,o=i&&g.isArray(i)?i:[]):o=i&&g.isPlainObject(i)?i:{},a[e]=g.extend(u,o,n)):void 0!==n&&(a[e]=n));return a},g.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isFunction:function(t){return"function"===g.type(t)},isArray:Array.isArray,isWindow:function(t){return null!=t&&t===t.window},isNumeric:function(t){return!g.isArray(t)&&t-parseFloat(t)>=0},isPlainObject:function(t){return"object"===g.type(t)&&!t.nodeType&&!g.isWindow(t)&&!(t.constructor&&!d.call(t.constructor.prototype,"isPrototypeOf"))},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},type:function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?h[c.call(t)]||"object":typeof t},globalEval:function(t){var e,i=eval;(t=g.trim(t))&&(1===t.indexOf("use strict")?((e=f.createElement("script")).text=t,f.head.appendChild(e).parentNode.removeChild(e)):i(t))},camelCase:function(t){return t.replace(y,"ms-").replace(b,w)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e,i){var n=0,r=t.length,o=x(t);if(i){if(o)for(;r>n&&!1!==e.apply(t[n],i);n++);else for(n in t)if(!1===e.apply(t[n],i))break}else if(o)for(;r>n&&!1!==e.call(t[n],n,t[n]);n++);else for(n in t)if(!1===e.call(t[n],n,t[n]))break;return t},trim:function(t){return null==t?"":(t+"").replace(v,"")},makeArray:function(t,e){var i=e||[];return null!=t&&(x(Object(t))?g.merge(i,"string"==typeof t?[t]:t):l.call(i,t)),i},inArray:function(t,e,i){return null==e?-1:u.call(e,t,i)},merge:function(t,e){for(var i=+e.length,n=0,r=t.length;i>n;n++)t[r++]=e[n];return t.length=r,t},grep:function(t,e,i){for(var n=[],r=0,o=t.length,a=!i;o>r;r++)!e(t[r],r)!==a&&n.push(t[r]);return n},map:function(t,e,i){var n,r=0,o=t.length,a=[];if(x(t))for(;o>r;r++)null!=(n=e(t[r],r,i))&&a.push(n);else for(r in t)null!=(n=e(t[r],r,i))&&a.push(n);return s.apply([],a)},guid:1,proxy:function(t,e){var i,n,r;return"string"==typeof e&&(i=t[e],e=t,t=i),g.isFunction(t)?(n=a.call(arguments,2),(r=function(){return t.apply(e||this,n.concat(a.call(arguments)))}).guid=t.guid=t.guid||g.guid++,r):void 0},now:Date.now,support:p}),g.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),(function(t,e){h["[object "+e+"]"]=e.toLowerCase()}));var M=function(t){var e,i,n,r,o,a,s,l,u,h,c,d,p,f,m,g,v,y,b,w="sizzle"+-new Date,x=t.document,M=0,T=0,S=rt(),_=rt(),A=rt(),P=function(t,e){return t===e&&(c=!0),0},C="undefined",E={}.hasOwnProperty,D=[],L=D.pop,O=D.push,I=D.push,R=D.slice,N=D.indexOf||function(t){for(var e=0,i=this.length;i>e;e++)if(this[e]===t)return e;return-1},k="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",F="[\\x20\\t\\r\\n\\f]",B="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",z=B.replace("w","w#"),U="\\["+F+"*("+B+")(?:"+F+"*([*^$|!~]?=)"+F+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+z+"))|)"+F+"*\\]",V=":("+B+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+U+")*)|.*)\\)|)",j=new RegExp("^"+F+"+|((?:^|[^\\\\])(?:\\\\.)*)"+F+"+$","g"),H=new RegExp("^"+F+"*,"+F+"*"),G=new RegExp("^"+F+"*([>+~]|"+F+")"+F+"*"),W=new RegExp("="+F+"*([^\\]'\"]*?)"+F+"*\\]","g"),q=new RegExp(V),Y=new RegExp("^"+z+"$"),X={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),TAG:new RegExp("^("+B.replace("w","w*")+")"),ATTR:new RegExp("^"+U),PSEUDO:new RegExp("^"+V),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+F+"*(even|odd|(([+-]|)(\\d*)n|)"+F+"*(?:([+-]|)"+F+"*(\\d+)|))"+F+"*\\)|)","i"),bool:new RegExp("^(?:"+k+")$","i"),needsContext:new RegExp("^"+F+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+F+"*((?:-\\d)?\\d*)"+F+"*\\)|)(?=[^-]|$)","i")},Z=/^(?:input|select|textarea|button)$/i,K=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,tt=/'|\\/g,et=new RegExp("\\\\([\\da-f]{1,6}"+F+"?|("+F+")|.)","ig"),it=function(t,e,i){var n="0x"+e-65536;return n!=n||i?e:0>n?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)};try{I.apply(D=R.call(x.childNodes),x.childNodes),D[x.childNodes.length].nodeType}catch(t){I={apply:D.length?function(t,e){O.apply(t,R.call(e))}:function(t,e){for(var i=t.length,n=0;t[i++]=e[n++];);t.length=i-1}}}function nt(t,e,n,r){var o,s,u,h,c,f,v,y,M,T;if((e?e.ownerDocument||e:x)!==p&&d(e),n=n||[],!t||"string"!=typeof t)return n;if(1!==(h=(e=e||p).nodeType)&&9!==h)return[];if(m&&!r){if(o=J.exec(t))if(u=o[1]){if(9===h){if(!(s=e.getElementById(u))||!s.parentNode)return n;if(s.id===u)return n.push(s),n}else if(e.ownerDocument&&(s=e.ownerDocument.getElementById(u))&&b(e,s)&&s.id===u)return n.push(s),n}else{if(o[2])return I.apply(n,e.getElementsByTagName(t)),n;if((u=o[3])&&i.getElementsByClassName&&e.getElementsByClassName)return I.apply(n,e.getElementsByClassName(u)),n}if(i.qsa&&(!g||!g.test(t))){if(y=v=w,M=e,T=9===h&&t,1===h&&"object"!==e.nodeName.toLowerCase()){for(f=a(t),(v=e.getAttribute("id"))?y=v.replace(tt,"\\$&"):e.setAttribute("id",y),y="[id='"+y+"'] ",c=f.length;c--;)f[c]=y+ft(f[c]);M=$.test(t)&&dt(e.parentNode)||e,T=f.join(",")}if(T)try{return I.apply(n,M.querySelectorAll(T)),n}catch(t){}finally{v||e.removeAttribute("id")}}}return l(t.replace(j,"$1"),e,n,r)}function rt(){var t=[];return function e(i,r){return t.push(i+" ")>n.cacheLength&&delete e[t.shift()],e[i+" "]=r}}function ot(t){return t[w]=!0,t}function at(t){var e=p.createElement("div");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function st(t,e){for(var i=t.split("|"),r=t.length;r--;)n.attrHandle[i[r]]=e}function lt(t,e){var i=e&&t,n=i&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||1<<31)-(~t.sourceIndex||1<<31);if(n)return n;if(i)for(;i=i.nextSibling;)if(i===e)return-1;return t?1:-1}function ut(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function ht(t){return function(e){var i=e.nodeName.toLowerCase();return("input"===i||"button"===i)&&e.type===t}}function ct(t){return ot((function(e){return e=+e,ot((function(i,n){for(var r,o=t([],i.length,e),a=o.length;a--;)i[r=o[a]]&&(i[r]=!(n[r]=i[r]))}))}))}function dt(t){return t&&typeof t.getElementsByTagName!==C&&t}for(e in i=nt.support={},o=nt.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},d=nt.setDocument=function(t){var e,r=t?t.ownerDocument||t:x,a=r.defaultView;return r!==p&&9===r.nodeType&&r.documentElement?(p=r,f=r.documentElement,m=!o(r),a&&a!==a.top&&(a.addEventListener?a.addEventListener("unload",(function(){d()}),!1):a.attachEvent&&a.attachEvent("onunload",(function(){d()}))),i.attributes=at((function(t){return t.className="i",!t.getAttribute("className")})),i.getElementsByTagName=at((function(t){return t.appendChild(r.createComment("")),!t.getElementsByTagName("*").length})),i.getElementsByClassName=Q.test(r.getElementsByClassName)&&at((function(t){return t.innerHTML="<div class='a'></div><div class='a i'></div>",t.firstChild.className="i",2===t.getElementsByClassName("i").length})),i.getById=at((function(t){return f.appendChild(t).id=w,!r.getElementsByName||!r.getElementsByName(w).length})),i.getById?(n.find.ID=function(t,e){if(typeof e.getElementById!==C&&m){var i=e.getElementById(t);return i&&i.parentNode?[i]:[]}},n.filter.ID=function(t){var e=t.replace(et,it);return function(t){return t.getAttribute("id")===e}}):(delete n.find.ID,n.filter.ID=function(t){var e=t.replace(et,it);return function(t){var i=typeof t.getAttributeNode!==C&&t.getAttributeNode("id");return i&&i.value===e}}),n.find.TAG=i.getElementsByTagName?function(t,e){return typeof e.getElementsByTagName!==C?e.getElementsByTagName(t):void 0}:function(t,e){var i,n=[],r=0,o=e.getElementsByTagName(t);if("*"===t){for(;i=o[r++];)1===i.nodeType&&n.push(i);return n}return o},n.find.CLASS=i.getElementsByClassName&&function(t,e){return typeof e.getElementsByClassName!==C&&m?e.getElementsByClassName(t):void 0},v=[],g=[],(i.qsa=Q.test(r.querySelectorAll))&&(at((function(t){t.innerHTML="<select msallowclip=''><option selected=''></option></select>",t.querySelectorAll("[msallowclip^='']").length&&g.push("[*^$]="+F+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||g.push("\\["+F+"*(?:value|"+k+")"),t.querySelectorAll(":checked").length||g.push(":checked")})),at((function(t){var e=r.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&g.push("name"+F+"*[*^$|!~]?="),t.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),g.push(",.*:")}))),(i.matchesSelector=Q.test(y=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at((function(t){i.disconnectedMatch=y.call(t,"div"),y.call(t,"[s!='']:x"),v.push("!=",V)})),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),e=Q.test(f.compareDocumentPosition),b=e||Q.test(f.contains)?function(t,e){var i=9===t.nodeType?t.documentElement:t,n=e&&e.parentNode;return t===n||!(!n||1!==n.nodeType||!(i.contains?i.contains(n):t.compareDocumentPosition&&16&t.compareDocumentPosition(n)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},P=e?function(t,e){if(t===e)return c=!0,0;var n=!t.compareDocumentPosition-!e.compareDocumentPosition;return n||(1&(n=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!i.sortDetached&&e.compareDocumentPosition(t)===n?t===r||t.ownerDocument===x&&b(x,t)?-1:e===r||e.ownerDocument===x&&b(x,e)?1:h?N.call(h,t)-N.call(h,e):0:4&n?-1:1)}:function(t,e){if(t===e)return c=!0,0;var i,n=0,o=t.parentNode,a=e.parentNode,s=[t],l=[e];if(!o||!a)return t===r?-1:e===r?1:o?-1:a?1:h?N.call(h,t)-N.call(h,e):0;if(o===a)return lt(t,e);for(i=t;i=i.parentNode;)s.unshift(i);for(i=e;i=i.parentNode;)l.unshift(i);for(;s[n]===l[n];)n++;return n?lt(s[n],l[n]):s[n]===x?-1:l[n]===x?1:0},r):p},nt.matches=function(t,e){return nt(t,null,null,e)},nt.matchesSelector=function(t,e){if((t.ownerDocument||t)!==p&&d(t),e=e.replace(W,"='$1']"),!(!i.matchesSelector||!m||v&&v.test(e)||g&&g.test(e)))try{var n=y.call(t,e);if(n||i.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){}return nt(e,p,null,[t]).length>0},nt.contains=function(t,e){return(t.ownerDocument||t)!==p&&d(t),b(t,e)},nt.attr=function(t,e){(t.ownerDocument||t)!==p&&d(t);var r=n.attrHandle[e.toLowerCase()],o=r&&E.call(n.attrHandle,e.toLowerCase())?r(t,e,!m):void 0;return void 0!==o?o:i.attributes||!m?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},nt.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},nt.uniqueSort=function(t){var e,n=[],r=0,o=0;if(c=!i.detectDuplicates,h=!i.sortStable&&t.slice(0),t.sort(P),c){for(;e=t[o++];)e===t[o]&&(r=n.push(o));for(;r--;)t.splice(n[r],1)}return h=null,t},r=nt.getText=function(t){var e,i="",n=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)i+=r(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[n++];)i+=r(e);return i},(n=nt.selectors={cacheLength:50,createPseudo:ot,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,it),t[3]=(t[3]||t[4]||t[5]||"").replace(et,it),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||nt.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&nt.error(t[0]),t},PSEUDO:function(t){var e,i=!t[6]&&t[2];return X.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":i&&q.test(i)&&(e=a(i,!0))&&(e=i.indexOf(")",i.length-e)-i.length)&&(t[0]=t[0].slice(0,e),t[2]=i.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,it).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=S[t+" "];return e||(e=new RegExp("(^|"+F+")"+t+"("+F+"|$)"))&&S(t,(function(t){return e.test("string"==typeof t.className&&t.className||typeof t.getAttribute!==C&&t.getAttribute("class")||"")}))},ATTR:function(t,e,i){return function(n){var r=nt.attr(n,t);return null==r?"!="===e:!e||(r+="","="===e?r===i:"!="===e?r!==i:"^="===e?i&&0===r.indexOf(i):"*="===e?i&&r.indexOf(i)>-1:"$="===e?i&&r.slice(-i.length)===i:"~="===e?(" "+r+" ").indexOf(i)>-1:"|="===e&&(r===i||r.slice(0,i.length+1)===i+"-"))}},CHILD:function(t,e,i,n,r){var o="nth"!==t.slice(0,3),a="last"!==t.slice(-4),s="of-type"===e;return 1===n&&0===r?function(t){return!!t.parentNode}:function(e,i,l){var u,h,c,d,p,f,m=o!==a?"nextSibling":"previousSibling",g=e.parentNode,v=s&&e.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;m;){for(c=e;c=c[m];)if(s?c.nodeName.toLowerCase()===v:1===c.nodeType)return!1;f=m="only"===t&&!f&&"nextSibling"}return!0}if(f=[a?g.firstChild:g.lastChild],a&&y){for(p=(u=(h=g[w]||(g[w]={}))[t]||[])[0]===M&&u[1],d=u[0]===M&&u[2],c=p&&g.childNodes[p];c=++p&&c&&c[m]||(d=p=0)||f.pop();)if(1===c.nodeType&&++d&&c===e){h[t]=[M,p,d];break}}else if(y&&(u=(e[w]||(e[w]={}))[t])&&u[0]===M)d=u[1];else for(;(c=++p&&c&&c[m]||(d=p=0)||f.pop())&&((s?c.nodeName.toLowerCase()!==v:1!==c.nodeType)||!++d||(y&&((c[w]||(c[w]={}))[t]=[M,d]),c!==e)););return(d-=r)===n||d%n==0&&d/n>=0}}},PSEUDO:function(t,e){var i,r=n.pseudos[t]||n.setFilters[t.toLowerCase()]||nt.error("unsupported pseudo: "+t);return r[w]?r(e):r.length>1?(i=[t,t,"",e],n.setFilters.hasOwnProperty(t.toLowerCase())?ot((function(t,i){for(var n,o=r(t,e),a=o.length;a--;)t[n=N.call(t,o[a])]=!(i[n]=o[a])})):function(t){return r(t,0,i)}):r}},pseudos:{not:ot((function(t){var e=[],i=[],n=s(t.replace(j,"$1"));return n[w]?ot((function(t,e,i,r){for(var o,a=n(t,null,r,[]),s=t.length;s--;)(o=a[s])&&(t[s]=!(e[s]=o))})):function(t,r,o){return e[0]=t,n(e,null,o,i),!i.pop()}})),has:ot((function(t){return function(e){return nt(t,e).length>0}})),contains:ot((function(t){return function(e){return(e.textContent||e.innerText||r(e)).indexOf(t)>-1}})),lang:ot((function(t){return Y.test(t||"")||nt.error("unsupported lang: "+t),t=t.replace(et,it).toLowerCase(),function(e){var i;do{if(i=m?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(i=i.toLowerCase())===t||0===i.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var i=t.location&&t.location.hash;return i&&i.slice(1)===e.id},root:function(t){return t===f},focus:function(t){return t===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return!1===t.disabled},disabled:function(t){return!0===t.disabled},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!n.pseudos.empty(t)},header:function(t){return K.test(t.nodeName)},input:function(t){return Z.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:ct((function(){return[0]})),last:ct((function(t,e){return[e-1]})),eq:ct((function(t,e,i){return[0>i?i+e:i]})),even:ct((function(t,e){for(var i=0;e>i;i+=2)t.push(i);return t})),odd:ct((function(t,e){for(var i=1;e>i;i+=2)t.push(i);return t})),lt:ct((function(t,e,i){for(var n=0>i?i+e:i;--n>=0;)t.push(n);return t})),gt:ct((function(t,e,i){for(var n=0>i?i+e:i;++n<e;)t.push(n);return t}))}}).pseudos.nth=n.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})n.pseudos[e]=ut(e);for(e in{submit:!0,reset:!0})n.pseudos[e]=ht(e);function pt(){}function ft(t){for(var e=0,i=t.length,n="";i>e;e++)n+=t[e].value;return n}function mt(t,e,i){var n=e.dir,r=i&&"parentNode"===n,o=T++;return e.first?function(e,i,o){for(;e=e[n];)if(1===e.nodeType||r)return t(e,i,o)}:function(e,i,a){var s,l,u=[M,o];if(a){for(;e=e[n];)if((1===e.nodeType||r)&&t(e,i,a))return!0}else for(;e=e[n];)if(1===e.nodeType||r){if((s=(l=e[w]||(e[w]={}))[n])&&s[0]===M&&s[1]===o)return u[2]=s[2];if(l[n]=u,u[2]=t(e,i,a))return!0}}}function gt(t){return t.length>1?function(e,i,n){for(var r=t.length;r--;)if(!t[r](e,i,n))return!1;return!0}:t[0]}function vt(t,e,i,n,r){for(var o,a=[],s=0,l=t.length,u=null!=e;l>s;s++)(o=t[s])&&(!i||i(o,n,r))&&(a.push(o),u&&e.push(s));return a}function yt(t,e,i,n,r,o){return n&&!n[w]&&(n=yt(n)),r&&!r[w]&&(r=yt(r,o)),ot((function(o,a,s,l){var u,h,c,d=[],p=[],f=a.length,m=o||function(t,e,i){for(var n=0,r=e.length;r>n;n++)nt(t,e[n],i);return i}(e||"*",s.nodeType?[s]:s,[]),g=!t||!o&&e?m:vt(m,d,t,s,l),v=i?r||(o?t:f||n)?[]:a:g;if(i&&i(g,v,s,l),n)for(u=vt(v,p),n(u,[],s,l),h=u.length;h--;)(c=u[h])&&(v[p[h]]=!(g[p[h]]=c));if(o){if(r||t){if(r){for(u=[],h=v.length;h--;)(c=v[h])&&u.push(g[h]=c);r(null,v=[],u,l)}for(h=v.length;h--;)(c=v[h])&&(u=r?N.call(o,c):d[h])>-1&&(o[u]=!(a[u]=c))}}else v=vt(v===a?v.splice(f,v.length):v),r?r(null,a,v,l):I.apply(a,v)}))}function bt(t){for(var e,i,r,o=t.length,a=n.relative[t[0].type],s=a||n.relative[" "],l=a?1:0,h=mt((function(t){return t===e}),s,!0),c=mt((function(t){return N.call(e,t)>-1}),s,!0),d=[function(t,i,n){return!a&&(n||i!==u)||((e=i).nodeType?h(t,i,n):c(t,i,n))}];o>l;l++)if(i=n.relative[t[l].type])d=[mt(gt(d),i)];else{if((i=n.filter[t[l].type].apply(null,t[l].matches))[w]){for(r=++l;o>r&&!n.relative[t[r].type];r++);return yt(l>1&&gt(d),l>1&&ft(t.slice(0,l-1).concat({value:" "===t[l-2].type?"*":""})).replace(j,"$1"),i,r>l&&bt(t.slice(l,r)),o>r&&bt(t=t.slice(r)),o>r&&ft(t))}d.push(i)}return gt(d)}function wt(t,e){var i=e.length>0,r=t.length>0,o=function(o,a,s,l,h){var c,d,f,m=0,g="0",v=o&&[],y=[],b=u,w=o||r&&n.find.TAG("*",h),x=M+=null==b?1:Math.random()||.1,T=w.length;for(h&&(u=a!==p&&a);g!==T&&null!=(c=w[g]);g++){if(r&&c){for(d=0;f=t[d++];)if(f(c,a,s)){l.push(c);break}h&&(M=x)}i&&((c=!f&&c)&&m--,o&&v.push(c))}if(m+=g,i&&g!==m){for(d=0;f=e[d++];)f(v,y,a,s);if(o){if(m>0)for(;g--;)v[g]||y[g]||(y[g]=L.call(l));y=vt(y)}I.apply(l,y),h&&!o&&y.length>0&&m+e.length>1&&nt.uniqueSort(l)}return h&&(M=x,u=b),v};return i?ot(o):o}return pt.prototype=n.filters=n.pseudos,n.setFilters=new pt,a=nt.tokenize=function(t,e){var i,r,o,a,s,l,u,h=_[t+" "];if(h)return e?0:h.slice(0);for(s=t,l=[],u=n.preFilter;s;){for(a in(!i||(r=H.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(o=[])),i=!1,(r=G.exec(s))&&(i=r.shift(),o.push({value:i,type:r[0].replace(j," ")}),s=s.slice(i.length)),n.filter)!(r=X[a].exec(s))||u[a]&&!(r=u[a](r))||(i=r.shift(),o.push({value:i,type:a,matches:r}),s=s.slice(i.length));if(!i)break}return e?s.length:s?nt.error(t):_(t,l).slice(0)},s=nt.compile=function(t,e){var i,n=[],r=[],o=A[t+" "];if(!o){for(e||(e=a(t)),i=e.length;i--;)(o=bt(e[i]))[w]?n.push(o):r.push(o);(o=A(t,wt(r,n))).selector=t}return o},l=nt.select=function(t,e,r,o){var l,u,h,c,d,p="function"==typeof t&&t,f=!o&&a(t=p.selector||t);if(r=r||[],1===f.length){if((u=f[0]=f[0].slice(0)).length>2&&"ID"===(h=u[0]).type&&i.getById&&9===e.nodeType&&m&&n.relative[u[1].type]){if(!(e=(n.find.ID(h.matches[0].replace(et,it),e)||[])[0]))return r;p&&(e=e.parentNode),t=t.slice(u.shift().value.length)}for(l=X.needsContext.test(t)?0:u.length;l--&&(h=u[l],!n.relative[c=h.type]);)if((d=n.find[c])&&(o=d(h.matches[0].replace(et,it),$.test(u[0].type)&&dt(e.parentNode)||e))){if(u.splice(l,1),!(t=o.length&&ft(u)))return I.apply(r,o),r;break}}return(p||s(t,f))(o,e,!m,r,$.test(t)&&dt(e.parentNode)||e),r},i.sortStable=w.split("").sort(P).join("")===w,i.detectDuplicates=!!c,d(),i.sortDetached=at((function(t){return 1&t.compareDocumentPosition(p.createElement("div"))})),at((function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")}))||st("type|href|height|width",(function(t,e,i){return i?void 0:t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),i.attributes&&at((function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||st("value",(function(t,e,i){return i||"input"!==t.nodeName.toLowerCase()?void 0:t.defaultValue})),at((function(t){return null==t.getAttribute("disabled")}))||st(k,(function(t,e,i){var n;return i?void 0:!0===t[e]?e.toLowerCase():(n=t.getAttributeNode(e))&&n.specified?n.value:null})),nt}(i);g.find=M,g.expr=M.selectors,g.expr[":"]=g.expr.pseudos,g.unique=M.uniqueSort,g.text=M.getText,g.isXMLDoc=M.isXML,g.contains=M.contains;var T=g.expr.match.needsContext,S=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,_=/^.[^:#\[\.,]*$/;function A(t,e,i){if(g.isFunction(e))return g.grep(t,(function(t,n){return!!e.call(t,n,t)!==i}));if(e.nodeType)return g.grep(t,(function(t){return t===e!==i}));if("string"==typeof e){if(_.test(e))return g.filter(e,t,i);e=g.filter(e,t)}return g.grep(t,(function(t){return u.call(e,t)>=0!==i}))}g.filter=function(t,e,i){var n=e[0];return i&&(t=":not("+t+")"),1===e.length&&1===n.nodeType?g.find.matchesSelector(n,t)?[n]:[]:g.find.matches(t,g.grep(e,(function(t){return 1===t.nodeType})))},g.fn.extend({find:function(t){var e,i=this.length,n=[],r=this;if("string"!=typeof t)return this.pushStack(g(t).filter((function(){for(e=0;i>e;e++)if(g.contains(r[e],this))return!0})));for(e=0;i>e;e++)g.find(t,r[e],n);return(n=this.pushStack(i>1?g.unique(n):n)).selector=this.selector?this.selector+" "+t:t,n},filter:function(t){return this.pushStack(A(this,t||[],!1))},not:function(t){return this.pushStack(A(this,t||[],!0))},is:function(t){return!!A(this,"string"==typeof t&&T.test(t)?g(t):t||[],!1).length}});var P,C=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/;(g.fn.init=function(t,e){var i,n;if(!t)return this;if("string"==typeof t){if(!(i="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:C.exec(t))||!i[1]&&e)return!e||e.jquery?(e||P).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof g?e[0]:e,g.merge(this,g.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:f,!0)),S.test(i[1])&&g.isPlainObject(e))for(i in e)g.isFunction(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(n=f.getElementById(i[2]))&&n.parentNode&&(this.length=1,this[0]=n),this.context=f,this.selector=t,this}return t.nodeType?(this.context=this[0]=t,this.length=1,this):g.isFunction(t)?void 0!==P.ready?P.ready(t):t(g):(void 0!==t.selector&&(this.selector=t.selector,this.context=t.context),g.makeArray(t,this))}).prototype=g.fn,P=g(f);var E=/^(?:parents|prev(?:Until|All))/,D={children:!0,contents:!0,next:!0,prev:!0};function L(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}g.extend({dir:function(t,e,i){for(var n=[],r=void 0!==i;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&g(t).is(i))break;n.push(t)}return n},sibling:function(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i}}),g.fn.extend({has:function(t){var e=g(t,this),i=e.length;return this.filter((function(){for(var t=0;i>t;t++)if(g.contains(this,e[t]))return!0}))},closest:function(t,e){for(var i,n=0,r=this.length,o=[],a=T.test(t)||"string"!=typeof t?g(t,e||this.context):0;r>n;n++)for(i=this[n];i&&i!==e;i=i.parentNode)if(i.nodeType<11&&(a?a.index(i)>-1:1===i.nodeType&&g.find.matchesSelector(i,t))){o.push(i);break}return this.pushStack(o.length>1?g.unique(o):o)},index:function(t){return t?"string"==typeof t?u.call(g(t),this[0]):u.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(g.unique(g.merge(this.get(),g(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),g.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return g.dir(t,"parentNode")},parentsUntil:function(t,e,i){return g.dir(t,"parentNode",i)},next:function(t){return L(t,"nextSibling")},prev:function(t){return L(t,"previousSibling")},nextAll:function(t){return g.dir(t,"nextSibling")},prevAll:function(t){return g.dir(t,"previousSibling")},nextUntil:function(t,e,i){return g.dir(t,"nextSibling",i)},prevUntil:function(t,e,i){return g.dir(t,"previousSibling",i)},siblings:function(t){return g.sibling((t.parentNode||{}).firstChild,t)},children:function(t){return g.sibling(t.firstChild)},contents:function(t){return t.contentDocument||g.merge([],t.childNodes)}},(function(t,e){g.fn[t]=function(i,n){var r=g.map(this,e,i);return"Until"!==t.slice(-5)&&(n=i),n&&"string"==typeof n&&(r=g.filter(n,r)),this.length>1&&(D[t]||g.unique(r),E.test(t)&&r.reverse()),this.pushStack(r)}}));var O,I=/\S+/g,R={};function N(){f.removeEventListener("DOMContentLoaded",N,!1),i.removeEventListener("load",N,!1),g.ready()}g.Callbacks=function(t){t="string"==typeof t?R[t]||function(t){var e=R[t]={};return g.each(t.match(I)||[],(function(t,i){e[i]=!0})),e}(t):g.extend({},t);var e,i,n,r,o,a,s=[],l=!t.once&&[],u=function(c){for(e=t.memory&&c,i=!0,a=r||0,r=0,o=s.length,n=!0;s&&o>a;a++)if(!1===s[a].apply(c[0],c[1])&&t.stopOnFalse){e=!1;break}n=!1,s&&(l?l.length&&u(l.shift()):e?s=[]:h.disable())},h={add:function(){if(s){var i=s.length;!function e(i){g.each(i,(function(i,n){var r=g.type(n);"function"===r?t.unique&&h.has(n)||s.push(n):n&&n.length&&"string"!==r&&e(n)}))}(arguments),n?o=s.length:e&&(r=i,u(e))}return this},remove:function(){return s&&g.each(arguments,(function(t,e){for(var i;(i=g.inArray(e,s,i))>-1;)s.splice(i,1),n&&(o>=i&&o--,a>=i&&a--)})),this},has:function(t){return t?g.inArray(t,s)>-1:!(!s||!s.length)},empty:function(){return s=[],o=0,this},disable:function(){return s=l=e=void 0,this},disabled:function(){return!s},lock:function(){return l=void 0,e||h.disable(),this},locked:function(){return!l},fireWith:function(t,e){return!s||i&&!l||(e=[t,(e=e||[]).slice?e.slice():e],n?l.push(e):u(e)),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!i}};return h},g.extend({Deferred:function(t){var e=[["resolve","done",g.Callbacks("once memory"),"resolved"],["reject","fail",g.Callbacks("once memory"),"rejected"],["notify","progress",g.Callbacks("memory")]],i="pending",n={state:function(){return i},always:function(){return r.done(arguments).fail(arguments),this},then:function(){var t=arguments;return g.Deferred((function(i){g.each(e,(function(e,o){var a=g.isFunction(t[e])&&t[e];r[o[1]]((function(){var t=a&&a.apply(this,arguments);t&&g.isFunction(t.promise)?t.promise().done(i.resolve).fail(i.reject).progress(i.notify):i[o[0]+"With"](this===n?i.promise():this,a?[t]:arguments)}))})),t=null})).promise()},promise:function(t){return null!=t?g.extend(t,n):n}},r={};return n.pipe=n.then,g.each(e,(function(t,o){var a=o[2],s=o[3];n[o[1]]=a.add,s&&a.add((function(){i=s}),e[1^t][2].disable,e[2][2].lock),r[o[0]]=function(){return r[o[0]+"With"](this===r?n:this,arguments),this},r[o[0]+"With"]=a.fireWith})),n.promise(r),t&&t.call(r,r),r},when:function(t){var e,i,n,r=0,o=a.call(arguments),s=o.length,l=1!==s||t&&g.isFunction(t.promise)?s:0,u=1===l?t:g.Deferred(),h=function(t,i,n){return function(r){i[t]=this,n[t]=arguments.length>1?a.call(arguments):r,n===e?u.notifyWith(i,n):--l||u.resolveWith(i,n)}};if(s>1)for(e=new Array(s),i=new Array(s),n=new Array(s);s>r;r++)o[r]&&g.isFunction(o[r].promise)?o[r].promise().done(h(r,n,o)).fail(u.reject).progress(h(r,i,e)):--l;return l||u.resolveWith(n,o),u.promise()}}),g.fn.ready=function(t){return g.ready.promise().done(t),this},g.extend({isReady:!1,readyWait:1,holdReady:function(t){t?g.readyWait++:g.ready(!0)},ready:function(t){(!0===t?--g.readyWait:g.isReady)||(g.isReady=!0,!0!==t&&--g.readyWait>0||(O.resolveWith(f,[g]),g.fn.triggerHandler&&(g(f).triggerHandler("ready"),g(f).off("ready"))))}}),g.ready.promise=function(t){return O||(O=g.Deferred(),"complete"===f.readyState?setTimeout(g.ready):(f.addEventListener("DOMContentLoaded",N,!1),i.addEventListener("load",N,!1))),O.promise(t)},g.ready.promise();var k=g.access=function(t,e,i,n,r,o,a){var s=0,l=t.length,u=null==i;if("object"===g.type(i))for(s in r=!0,i)g.access(t,e,s,i[s],!0,o,a);else if(void 0!==n&&(r=!0,g.isFunction(n)||(a=!0),u&&(a?(e.call(t,n),e=null):(u=e,e=function(t,e,i){return u.call(g(t),i)})),e))for(;l>s;s++)e(t[s],i,a?n:n.call(t[s],s,e(t[s],i)));return r?t:u?e.call(t):l?e(t[0],i):o};function F(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=g.expando+Math.random()}g.acceptData=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType},F.uid=1,F.accepts=g.acceptData,F.prototype={key:function(t){if(!F.accepts(t))return 0;var e={},i=t[this.expando];if(!i){i=F.uid++;try{e[this.expando]={value:i},Object.defineProperties(t,e)}catch(n){e[this.expando]=i,g.extend(t,e)}}return this.cache[i]||(this.cache[i]={}),i},set:function(t,e,i){var n,r=this.key(t),o=this.cache[r];if("string"==typeof e)o[e]=i;else if(g.isEmptyObject(o))g.extend(this.cache[r],e);else for(n in e)o[n]=e[n];return o},get:function(t,e){var i=this.cache[this.key(t)];return void 0===e?i:i[e]},access:function(t,e,i){var n;return void 0===e||e&&"string"==typeof e&&void 0===i?void 0!==(n=this.get(t,e))?n:this.get(t,g.camelCase(e)):(this.set(t,e,i),void 0!==i?i:e)},remove:function(t,e){var i,n,r,o=this.key(t),a=this.cache[o];if(void 0===e)this.cache[o]={};else{g.isArray(e)?n=e.concat(e.map(g.camelCase)):(r=g.camelCase(e),e in a?n=[e,r]:n=(n=r)in a?[n]:n.match(I)||[]),i=n.length;for(;i--;)delete a[n[i]]}},hasData:function(t){return!g.isEmptyObject(this.cache[t[this.expando]]||{})},discard:function(t){t[this.expando]&&delete this.cache[t[this.expando]]}};var B=new F,z=new F,U=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,V=/([A-Z])/g;function j(t,e,i){var n;if(void 0===i&&1===t.nodeType)if(n="data-"+e.replace(V,"-$1").toLowerCase(),"string"==typeof(i=t.getAttribute(n))){try{i="true"===i||"false"!==i&&("null"===i?null:+i+""===i?+i:U.test(i)?g.parseJSON(i):i)}catch(t){}z.set(t,e,i)}else i=void 0;return i}g.extend({hasData:function(t){return z.hasData(t)||B.hasData(t)},data:function(t,e,i){return z.access(t,e,i)},removeData:function(t,e){z.remove(t,e)},_data:function(t,e,i){return B.access(t,e,i)},_removeData:function(t,e){B.remove(t,e)}}),g.fn.extend({data:function(t,e){var i,n,r,o=this[0],a=o&&o.attributes;if(void 0===t){if(this.length&&(r=z.get(o),1===o.nodeType&&!B.get(o,"hasDataAttrs"))){for(i=a.length;i--;)a[i]&&(0===(n=a[i].name).indexOf("data-")&&(n=g.camelCase(n.slice(5)),j(o,n,r[n])));B.set(o,"hasDataAttrs",!0)}return r}return"object"==typeof t?this.each((function(){z.set(this,t)})):k(this,(function(e){var i,n=g.camelCase(t);if(o&&void 0===e){if(void 0!==(i=z.get(o,t)))return i;if(void 0!==(i=z.get(o,n)))return i;if(void 0!==(i=j(o,n,void 0)))return i}else this.each((function(){var i=z.get(this,n);z.set(this,n,e),-1!==t.indexOf("-")&&void 0!==i&&z.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){z.remove(this,t)}))}}),g.extend({queue:function(t,e,i){var n;return t?(e=(e||"fx")+"queue",n=B.get(t,e),i&&(!n||g.isArray(i)?n=B.access(t,e,g.makeArray(i)):n.push(i)),n||[]):void 0},dequeue:function(t,e){e=e||"fx";var i=g.queue(t,e),n=i.length,r=i.shift(),o=g._queueHooks(t,e);"inprogress"===r&&(r=i.shift(),n--),r&&("fx"===e&&i.unshift("inprogress"),delete o.stop,r.call(t,(function(){g.dequeue(t,e)}),o)),!n&&o&&o.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return B.get(t,i)||B.access(t,i,{empty:g.Callbacks("once memory").add((function(){B.remove(t,[e+"queue",i])}))})}}),g.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.length<i?g.queue(this[0],t):void 0===e?this:this.each((function(){var i=g.queue(this,t,e);g._queueHooks(this,t),"fx"===t&&"inprogress"!==i[0]&&g.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){g.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var i,n=1,r=g.Deferred(),o=this,a=this.length,s=function(){--n||r.resolveWith(o,[o])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";a--;)(i=B.get(o[a],t+"queueHooks"))&&i.empty&&(n++,i.empty.add(s));return s(),r.promise(e)}});var H=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,G=["Top","Right","Bottom","Left"],W=function(t,e){return t=e||t,"none"===g.css(t,"display")||!g.contains(t.ownerDocument,t)},q=/^(?:checkbox|radio)$/i;!function(){var t=f.createDocumentFragment().appendChild(f.createElement("div")),e=f.createElement("input");e.setAttribute("type","radio"),e.setAttribute("checked","checked"),e.setAttribute("name","t"),t.appendChild(e),p.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="<textarea>x</textarea>",p.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var Y="undefined";p.focusinBubbles="onfocusin"in i;var X=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,K=/^(?:focusinfocus|focusoutblur)$/,Q=/^([^.]*)(?:\.(.+)|)$/;function J(){return!0}function $(){return!1}function tt(){try{return f.activeElement}catch(t){}}g.event={global:{},add:function(t,e,i,n,r){var o,a,s,l,u,h,c,d,p,f,m,v=B.get(t);if(v)for(i.handler&&(i=(o=i).handler,r=o.selector),i.guid||(i.guid=g.guid++),(l=v.events)||(l=v.events={}),(a=v.handle)||(a=v.handle=function(e){return typeof g!==Y&&g.event.triggered!==e.type?g.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(I)||[""]).length;u--;)p=m=(s=Q.exec(e[u])||[])[1],f=(s[2]||"").split(".").sort(),p&&(c=g.event.special[p]||{},p=(r?c.delegateType:c.bindType)||p,c=g.event.special[p]||{},h=g.extend({type:p,origType:m,data:n,handler:i,guid:i.guid,selector:r,needsContext:r&&g.expr.match.needsContext.test(r),namespace:f.join(".")},o),(d=l[p])||((d=l[p]=[]).delegateCount=0,c.setup&&!1!==c.setup.call(t,n,f,a)||t.addEventListener&&t.addEventListener(p,a,!1)),c.add&&(c.add.call(t,h),h.handler.guid||(h.handler.guid=i.guid)),r?d.splice(d.delegateCount++,0,h):d.push(h),g.event.global[p]=!0)},remove:function(t,e,i,n,r){var o,a,s,l,u,h,c,d,p,f,m,v=B.hasData(t)&&B.get(t);if(v&&(l=v.events)){for(u=(e=(e||"").match(I)||[""]).length;u--;)if(p=m=(s=Q.exec(e[u])||[])[1],f=(s[2]||"").split(".").sort(),p){for(c=g.event.special[p]||{},d=l[p=(n?c.delegateType:c.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)h=d[o],!r&&m!==h.origType||i&&i.guid!==h.guid||s&&!s.test(h.namespace)||n&&n!==h.selector&&("**"!==n||!h.selector)||(d.splice(o,1),h.selector&&d.delegateCount--,c.remove&&c.remove.call(t,h));a&&!d.length&&(c.teardown&&!1!==c.teardown.call(t,f,v.handle)||g.removeEvent(t,p,v.handle),delete l[p])}else for(p in l)g.event.remove(t,p+e[u],i,n,!0);g.isEmptyObject(l)&&(delete v.handle,B.remove(t,"events"))}},trigger:function(t,e,n,r){var o,a,s,l,u,h,c,p=[n||f],m=d.call(t,"type")?t.type:t,v=d.call(t,"namespace")?t.namespace.split("."):[];if(a=s=n=n||f,3!==n.nodeType&&8!==n.nodeType&&!K.test(m+g.event.triggered)&&(m.indexOf(".")>=0&&(v=m.split("."),m=v.shift(),v.sort()),u=m.indexOf(":")<0&&"on"+m,(t=t[g.expando]?t:new g.Event(m,"object"==typeof t&&t)).isTrigger=r?2:3,t.namespace=v.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),e=null==e?[t]:g.makeArray(e,[t]),c=g.event.special[m]||{},r||!c.trigger||!1!==c.trigger.apply(n,e))){if(!r&&!c.noBubble&&!g.isWindow(n)){for(l=c.delegateType||m,K.test(l+m)||(a=a.parentNode);a;a=a.parentNode)p.push(a),s=a;s===(n.ownerDocument||f)&&p.push(s.defaultView||s.parentWindow||i)}for(o=0;(a=p[o++])&&!t.isPropagationStopped();)t.type=o>1?l:c.bindType||m,(h=(B.get(a,"events")||{})[t.type]&&B.get(a,"handle"))&&h.apply(a,e),(h=u&&a[u])&&h.apply&&g.acceptData(a)&&(t.result=h.apply(a,e),!1===t.result&&t.preventDefault());return t.type=m,r||t.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),e)||!g.acceptData(n)||u&&g.isFunction(n[m])&&!g.isWindow(n)&&((s=n[u])&&(n[u]=null),g.event.triggered=m,n[m](),g.event.triggered=void 0,s&&(n[u]=s)),t.result}},dispatch:function(t){t=g.event.fix(t);var e,i,n,r,o,s=[],l=a.call(arguments),u=(B.get(this,"events")||{})[t.type]||[],h=g.event.special[t.type]||{};if(l[0]=t,t.delegateTarget=this,!h.preDispatch||!1!==h.preDispatch.call(this,t)){for(s=g.event.handlers.call(this,t,u),e=0;(r=s[e++])&&!t.isPropagationStopped();)for(t.currentTarget=r.elem,i=0;(o=r.handlers[i++])&&!t.isImmediatePropagationStopped();)(!t.namespace_re||t.namespace_re.test(o.namespace))&&(t.handleObj=o,t.data=o.data,void 0!==(n=((g.event.special[o.origType]||{}).handle||o.handler).apply(r.elem,l))&&!1===(t.result=n)&&(t.preventDefault(),t.stopPropagation()));return h.postDispatch&&h.postDispatch.call(this,t),t.result}},handlers:function(t,e){var i,n,r,o,a=[],s=e.delegateCount,l=t.target;if(s&&l.nodeType&&(!t.button||"click"!==t.type))for(;l!==this;l=l.parentNode||this)if(!0!==l.disabled||"click"!==t.type){for(n=[],i=0;s>i;i++)void 0===n[r=(o=e[i]).selector+" "]&&(n[r]=o.needsContext?g(r,this).index(l)>=0:g.find(r,this,null,[l]).length),n[r]&&n.push(o);n.length&&a.push({elem:l,handlers:n})}return s<e.length&&a.push({elem:this,handlers:e.slice(s)}),a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(t,e){return null==t.which&&(t.which=null!=e.charCode?e.charCode:e.keyCode),t}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(t,e){var i,n,r,o=e.button;return null==t.pageX&&null!=e.clientX&&(n=(i=t.target.ownerDocument||f).documentElement,r=i.body,t.pageX=e.clientX+(n&&n.scrollLeft||r&&r.scrollLeft||0)-(n&&n.clientLeft||r&&r.clientLeft||0),t.pageY=e.clientY+(n&&n.scrollTop||r&&r.scrollTop||0)-(n&&n.clientTop||r&&r.clientTop||0)),t.which||void 0===o||(t.which=1&o?1:2&o?3:4&o?2:0),t}},fix:function(t){if(t[g.expando])return t;var e,i,n,r=t.type,o=t,a=this.fixHooks[r];for(a||(this.fixHooks[r]=a=Z.test(r)?this.mouseHooks:X.test(r)?this.keyHooks:{}),n=a.props?this.props.concat(a.props):this.props,t=new g.Event(o),e=n.length;e--;)t[i=n[e]]=o[i];return t.target||(t.target=f),3===t.target.nodeType&&(t.target=t.target.parentNode),a.filter?a.filter(t,o):t},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==tt()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===tt()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&g.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(t){return g.nodeName(t.target,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}},simulate:function(t,e,i,n){var r=g.extend(new g.Event,i,{type:t,isSimulated:!0,originalEvent:{}});n?g.event.trigger(r,null,e):g.event.dispatch.call(e,r),r.isDefaultPrevented()&&i.preventDefault()}},g.removeEvent=function(t,e,i){t.removeEventListener&&t.removeEventListener(e,i,!1)},g.Event=function(t,e){return this instanceof g.Event?(t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?J:$):this.type=t,e&&g.extend(this,e),this.timeStamp=t&&t.timeStamp||g.now(),void(this[g.expando]=!0)):new g.Event(t,e)},g.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=J,t&&t.preventDefault&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=J,t&&t.stopPropagation&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=J,t&&t.stopImmediatePropagation&&t.stopImmediatePropagation(),this.stopPropagation()}},g.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){g.event.special[t]={delegateType:e,bindType:e,handle:function(t){var i,n=this,r=t.relatedTarget,o=t.handleObj;return(!r||r!==n&&!g.contains(n,r))&&(t.type=o.origType,i=o.handler.apply(this,arguments),t.type=e),i}}})),p.focusinBubbles||g.each({focus:"focusin",blur:"focusout"},(function(t,e){var i=function(t){g.event.simulate(e,t.target,g.event.fix(t),!0)};g.event.special[e]={setup:function(){var n=this.ownerDocument||this,r=B.access(n,e);r||n.addEventListener(t,i,!0),B.access(n,e,(r||0)+1)},teardown:function(){var n=this.ownerDocument||this,r=B.access(n,e)-1;r?B.access(n,e,r):(n.removeEventListener(t,i,!0),B.remove(n,e))}}})),g.fn.extend({on:function(t,e,i,n,r){var o,a;if("object"==typeof t){for(a in"string"!=typeof e&&(i=i||e,e=void 0),t)this.on(a,e,i,t[a],r);return this}if(null==i&&null==n?(n=e,i=e=void 0):null==n&&("string"==typeof e?(n=i,i=void 0):(n=i,i=e,e=void 0)),!1===n)n=$;else if(!n)return this;return 1===r&&(o=n,(n=function(t){return g().off(t),o.apply(this,arguments)}).guid=o.guid||(o.guid=g.guid++)),this.each((function(){g.event.add(this,t,n,i,e)}))},one:function(t,e,i,n){return this.on(t,e,i,n,1)},off:function(t,e,i){var n,r;if(t&&t.preventDefault&&t.handleObj)return n=t.handleObj,g(t.delegateTarget).off(n.namespace?n.origType+"."+n.namespace:n.origType,n.selector,n.handler),this;if("object"==typeof t){for(r in t)this.off(r,e,t[r]);return this}return(!1===e||"function"==typeof e)&&(i=e,e=void 0),!1===i&&(i=$),this.each((function(){g.event.remove(this,t,i,e)}))},trigger:function(t,e){return this.each((function(){g.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var i=this[0];return i?g.event.trigger(t,e,i,!0):void 0}});var et=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,it=/<([\w:]+)/,nt=/<|&#?\w+;/,rt=/<(?:script|style|link)/i,ot=/checked\s*(?:[^=]|=\s*.checked.)/i,at=/^$|\/(?:java|ecma)script/i,st=/^true\/(.*)/,lt=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ut={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ht(t,e){return g.nodeName(t,"table")&&g.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function ct(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function dt(t){var e=st.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function pt(t,e){for(var i=0,n=t.length;n>i;i++)B.set(t[i],"globalEval",!e||B.get(e[i],"globalEval"))}function ft(t,e){var i,n,r,o,a,s,l,u;if(1===e.nodeType){if(B.hasData(t)&&(o=B.access(t),a=B.set(e,o),u=o.events))for(r in delete a.handle,a.events={},u)for(i=0,n=u[r].length;n>i;i++)g.event.add(e,r,u[r][i]);z.hasData(t)&&(s=z.access(t),l=g.extend({},s),z.set(e,l))}}function mt(t,e){var i=t.getElementsByTagName?t.getElementsByTagName(e||"*"):t.querySelectorAll?t.querySelectorAll(e||"*"):[];return void 0===e||e&&g.nodeName(t,e)?g.merge([t],i):i}function gt(t,e){var i=e.nodeName.toLowerCase();"input"===i&&q.test(t.type)?e.checked=t.checked:("input"===i||"textarea"===i)&&(e.defaultValue=t.defaultValue)}ut.optgroup=ut.option,ut.tbody=ut.tfoot=ut.colgroup=ut.caption=ut.thead,ut.th=ut.td,g.extend({clone:function(t,e,i){var n,r,o,a,s=t.cloneNode(!0),l=g.contains(t.ownerDocument,t);if(!(p.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||g.isXMLDoc(t)))for(a=mt(s),n=0,r=(o=mt(t)).length;r>n;n++)gt(o[n],a[n]);if(e)if(i)for(o=o||mt(t),a=a||mt(s),n=0,r=o.length;r>n;n++)ft(o[n],a[n]);else ft(t,s);return(a=mt(s,"script")).length>0&&pt(a,!l&&mt(t,"script")),s},buildFragment:function(t,e,i,n){for(var r,o,a,s,l,u,h=e.createDocumentFragment(),c=[],d=0,p=t.length;p>d;d++)if((r=t[d])||0===r)if("object"===g.type(r))g.merge(c,r.nodeType?[r]:r);else if(nt.test(r)){for(o=o||h.appendChild(e.createElement("div")),a=(it.exec(r)||["",""])[1].toLowerCase(),s=ut[a]||ut._default,o.innerHTML=s[1]+r.replace(et,"<$1></$2>")+s[2],u=s[0];u--;)o=o.lastChild;g.merge(c,o.childNodes),(o=h.firstChild).textContent=""}else c.push(e.createTextNode(r));for(h.textContent="",d=0;r=c[d++];)if((!n||-1===g.inArray(r,n))&&(l=g.contains(r.ownerDocument,r),o=mt(h.appendChild(r),"script"),l&&pt(o),i))for(u=0;r=o[u++];)at.test(r.type||"")&&i.push(r);return h},cleanData:function(t){for(var e,i,n,r,o=g.event.special,a=0;void 0!==(i=t[a]);a++){if(g.acceptData(i)&&((r=i[B.expando])&&(e=B.cache[r]))){if(e.events)for(n in e.events)o[n]?g.event.remove(i,n):g.removeEvent(i,n,e.handle);B.cache[r]&&delete B.cache[r]}delete z.cache[i[z.expando]]}}}),g.fn.extend({text:function(t){return k(this,(function(t){return void 0===t?g.text(this):this.empty().each((function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return this.domManip(arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||ht(this,t).appendChild(t)}))},prepend:function(){return this.domManip(arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=ht(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return this.domManip(arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return this.domManip(arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},remove:function(t,e){for(var i,n=t?g.filter(t,this):this,r=0;null!=(i=n[r]);r++)e||1!==i.nodeType||g.cleanData(mt(i)),i.parentNode&&(e&&g.contains(i.ownerDocument,i)&&pt(mt(i,"script")),i.parentNode.removeChild(i));return this},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(g.cleanData(mt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return g.clone(this,t,e)}))},html:function(t){return k(this,(function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!rt.test(t)&&!ut[(it.exec(t)||["",""])[1].toLowerCase()]){t=t.replace(et,"<$1></$2>");try{for(;n>i;i++)1===(e=this[i]||{}).nodeType&&(g.cleanData(mt(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=arguments[0];return this.domManip(arguments,(function(e){t=this.parentNode,g.cleanData(mt(this)),t&&t.replaceChild(e,this)})),t&&(t.length||t.nodeType)?this:this.remove()},detach:function(t){return this.remove(t,!0)},domManip:function(t,e){t=s.apply([],t);var i,n,r,o,a,l,u=0,h=this.length,c=this,d=h-1,f=t[0],m=g.isFunction(f);if(m||h>1&&"string"==typeof f&&!p.checkClone&&ot.test(f))return this.each((function(i){var n=c.eq(i);m&&(t[0]=f.call(this,i,n.html())),n.domManip(t,e)}));if(h&&(n=(i=g.buildFragment(t,this[0].ownerDocument,!1,this)).firstChild,1===i.childNodes.length&&(i=n),n)){for(o=(r=g.map(mt(i,"script"),ct)).length;h>u;u++)a=i,u!==d&&(a=g.clone(a,!0,!0),o&&g.merge(r,mt(a,"script"))),e.call(this[u],a,u);if(o)for(l=r[r.length-1].ownerDocument,g.map(r,dt),u=0;o>u;u++)a=r[u],at.test(a.type||"")&&!B.access(a,"globalEval")&&g.contains(l,a)&&(a.src?g._evalUrl&&g._evalUrl(a.src):g.globalEval(a.textContent.replace(lt,"")))}return this}}),g.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){g.fn[t]=function(t){for(var i,n=[],r=g(t),o=r.length-1,a=0;o>=a;a++)i=a===o?this:this.clone(!0),g(r[a])[e](i),l.apply(n,i.get());return this.pushStack(n)}}));var vt,yt={};function bt(t,e){var n,r=g(e.createElement(t)).appendTo(e.body),o=i.getDefaultComputedStyle&&(n=i.getDefaultComputedStyle(r[0]))?n.display:g.css(r[0],"display");return r.detach(),o}function wt(t){var e=f,i=yt[t];return i||("none"!==(i=bt(t,e))&&i||((e=(vt=(vt||g("<iframe frameborder='0' width='0' height='0'/>")).appendTo(e.documentElement))[0].contentDocument).write(),e.close(),i=bt(t,e),vt.detach()),yt[t]=i),i}var xt=/^margin/,Mt=new RegExp("^("+H+")(?!px)[a-z%]+$","i"),Tt=function(t){return t.ownerDocument.defaultView.getComputedStyle(t,null)};function St(t,e,i){var n,r,o,a,s=t.style;return(i=i||Tt(t))&&(a=i.getPropertyValue(e)||i[e]),i&&(""!==a||g.contains(t.ownerDocument,t)||(a=g.style(t,e)),Mt.test(a)&&xt.test(e)&&(n=s.width,r=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=i.width,s.width=n,s.minWidth=r,s.maxWidth=o)),void 0!==a?a+"":a}function _t(t,e){return{get:function(){return t()?void delete this.get:(this.get=e).apply(this,arguments)}}}!function(){var t,e,n=f.documentElement,r=f.createElement("div"),o=f.createElement("div");if(o.style){function a(){o.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",o.innerHTML="",n.appendChild(r);var a=i.getComputedStyle(o,null);t="1%"!==a.top,e="4px"===a.width,n.removeChild(r)}o.style.backgroundClip="content-box",o.cloneNode(!0).style.backgroundClip="",p.clearCloneStyle="content-box"===o.style.backgroundClip,r.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",r.appendChild(o),i.getComputedStyle&&g.extend(p,{pixelPosition:function(){return a(),t},boxSizingReliable:function(){return null==e&&a(),e},reliableMarginRight:function(){var t,e=o.appendChild(f.createElement("div"));return e.style.cssText=o.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",e.style.marginRight=e.style.width="0",o.style.width="1px",n.appendChild(r),t=!parseFloat(i.getComputedStyle(e,null).marginRight),n.removeChild(r),t}})}}(),g.swap=function(t,e,i,n){var r,o,a={};for(o in e)a[o]=t.style[o],t.style[o]=e[o];for(o in r=i.apply(t,n||[]),e)t.style[o]=a[o];return r};var At=/^(none|table(?!-c[ea]).+)/,Pt=new RegExp("^("+H+")(.*)$","i"),Ct=new RegExp("^([+-])=("+H+")","i"),Et={position:"absolute",visibility:"hidden",display:"block"},Dt={letterSpacing:"0",fontWeight:"400"},Lt=["Webkit","O","Moz","ms"];function Ot(t,e){if(e in t)return e;for(var i=e[0].toUpperCase()+e.slice(1),n=e,r=Lt.length;r--;)if((e=Lt[r]+i)in t)return e;return n}function It(t,e,i){var n=Pt.exec(e);return n?Math.max(0,n[1]-(i||0))+(n[2]||"px"):e}function Rt(t,e,i,n,r){for(var o=i===(n?"border":"content")?4:"width"===e?1:0,a=0;4>o;o+=2)"margin"===i&&(a+=g.css(t,i+G[o],!0,r)),n?("content"===i&&(a-=g.css(t,"padding"+G[o],!0,r)),"margin"!==i&&(a-=g.css(t,"border"+G[o]+"Width",!0,r))):(a+=g.css(t,"padding"+G[o],!0,r),"padding"!==i&&(a+=g.css(t,"border"+G[o]+"Width",!0,r)));return a}function Nt(t,e,i){var n=!0,r="width"===e?t.offsetWidth:t.offsetHeight,o=Tt(t),a="border-box"===g.css(t,"boxSizing",!1,o);if(0>=r||null==r){if((0>(r=St(t,e,o))||null==r)&&(r=t.style[e]),Mt.test(r))return r;n=a&&(p.boxSizingReliable()||r===t.style[e]),r=parseFloat(r)||0}return r+Rt(t,e,i||(a?"border":"content"),n,o)+"px"}function kt(t,e){for(var i,n,r,o=[],a=0,s=t.length;s>a;a++)(n=t[a]).style&&(o[a]=B.get(n,"olddisplay"),i=n.style.display,e?(o[a]||"none"!==i||(n.style.display=""),""===n.style.display&&W(n)&&(o[a]=B.access(n,"olddisplay",wt(n.nodeName)))):(r=W(n),"none"===i&&r||B.set(n,"olddisplay",r?i:g.css(n,"display"))));for(a=0;s>a;a++)(n=t[a]).style&&(e&&"none"!==n.style.display&&""!==n.style.display||(n.style.display=e?o[a]||"":"none"));return t}function Ft(t,e,i,n,r){return new Ft.prototype.init(t,e,i,n,r)}g.extend({cssHooks:{opacity:{get:function(t,e){if(e){var i=St(t,"opacity");return""===i?"1":i}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:"cssFloat"},style:function(t,e,i,n){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,o,a,s=g.camelCase(e),l=t.style;return e=g.cssProps[s]||(g.cssProps[s]=Ot(l,s)),a=g.cssHooks[e]||g.cssHooks[s],void 0===i?a&&"get"in a&&void 0!==(r=a.get(t,!1,n))?r:l[e]:("string"===(o=typeof i)&&(r=Ct.exec(i))&&(i=(r[1]+1)*r[2]+parseFloat(g.css(t,e)),o="number"),void(null!=i&&i==i&&("number"!==o||g.cssNumber[s]||(i+="px"),p.clearCloneStyle||""!==i||0!==e.indexOf("background")||(l[e]="inherit"),a&&"set"in a&&void 0===(i=a.set(t,i,n))||(l[e]=i))))}},css:function(t,e,i,n){var r,o,a,s=g.camelCase(e);return e=g.cssProps[s]||(g.cssProps[s]=Ot(t.style,s)),(a=g.cssHooks[e]||g.cssHooks[s])&&"get"in a&&(r=a.get(t,!0,i)),void 0===r&&(r=St(t,e,n)),"normal"===r&&e in Dt&&(r=Dt[e]),""===i||i?(o=parseFloat(r),!0===i||g.isNumeric(o)?o||0:r):r}}),g.each(["height","width"],(function(t,e){g.cssHooks[e]={get:function(t,i,n){return i?At.test(g.css(t,"display"))&&0===t.offsetWidth?g.swap(t,Et,(function(){return Nt(t,e,n)})):Nt(t,e,n):void 0},set:function(t,i,n){var r=n&&Tt(t);return It(0,i,n?Rt(t,e,n,"border-box"===g.css(t,"boxSizing",!1,r),r):0)}}})),g.cssHooks.marginRight=_t(p.reliableMarginRight,(function(t,e){return e?g.swap(t,{display:"inline-block"},St,[t,"marginRight"]):void 0})),g.each({margin:"",padding:"",border:"Width"},(function(t,e){g.cssHooks[t+e]={expand:function(i){for(var n=0,r={},o="string"==typeof i?i.split(" "):[i];4>n;n++)r[t+G[n]+e]=o[n]||o[n-2]||o[0];return r}},xt.test(t)||(g.cssHooks[t+e].set=It)})),g.fn.extend({css:function(t,e){return k(this,(function(t,e,i){var n,r,o={},a=0;if(g.isArray(e)){for(n=Tt(t),r=e.length;r>a;a++)o[e[a]]=g.css(t,e[a],!1,n);return o}return void 0!==i?g.style(t,e,i):g.css(t,e)}),t,e,arguments.length>1)},show:function(){return kt(this,!0)},hide:function(){return kt(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each((function(){W(this)?g(this).show():g(this).hide()}))}}),g.Tween=Ft,Ft.prototype={constructor:Ft,init:function(t,e,i,n,r,o){this.elem=t,this.prop=i,this.easing=r||"swing",this.options=e,this.start=this.now=this.cur(),this.end=n,this.unit=o||(g.cssNumber[i]?"":"px")},cur:function(){var t=Ft.propHooks[this.prop];return t&&t.get?t.get(this):Ft.propHooks._default.get(this)},run:function(t){var e,i=Ft.propHooks[this.prop];return this.pos=e=this.options.duration?g.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):Ft.propHooks._default.set(this),this}},Ft.prototype.init.prototype=Ft.prototype,Ft.propHooks={_default:{get:function(t){var e;return null==t.elem[t.prop]||t.elem.style&&null!=t.elem.style[t.prop]?(e=g.css(t.elem,t.prop,""))&&"auto"!==e?e:0:t.elem[t.prop]},set:function(t){g.fx.step[t.prop]?g.fx.step[t.prop](t):t.elem.style&&(null!=t.elem.style[g.cssProps[t.prop]]||g.cssHooks[t.prop])?g.style(t.elem,t.prop,t.now+t.unit):t.elem[t.prop]=t.now}}},Ft.propHooks.scrollTop=Ft.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},g.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2}},g.fx=Ft.prototype.init,g.fx.step={};var Bt,zt,Ut=/^(?:toggle|show|hide)$/,Vt=new RegExp("^(?:([+-])=|)("+H+")([a-z%]*)$","i"),jt=/queueHooks$/,Ht=[function(t,e,i){var n,r,o,a,s,l,u,h=this,c={},d=t.style,p=t.nodeType&&W(t),f=B.get(t,"fxshow");for(n in i.queue||(null==(s=g._queueHooks(t,"fx")).unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,h.always((function(){h.always((function(){s.unqueued--,g.queue(t,"fx").length||s.empty.fire()}))}))),1===t.nodeType&&("height"in e||"width"in e)&&(i.overflow=[d.overflow,d.overflowX,d.overflowY],u=g.css(t,"display"),"inline"===("none"===u?B.get(t,"olddisplay")||wt(t.nodeName):u)&&"none"===g.css(t,"float")&&(d.display="inline-block")),i.overflow&&(d.overflow="hidden",h.always((function(){d.overflow=i.overflow[0],d.overflowX=i.overflow[1],d.overflowY=i.overflow[2]}))),e)if(r=e[n],Ut.exec(r)){if(delete e[n],o=o||"toggle"===r,r===(p?"hide":"show")){if("show"!==r||!f||void 0===f[n])continue;p=!0}c[n]=f&&f[n]||g.style(t,n)}else u=void 0;if(g.isEmptyObject(c))"inline"===("none"===u?wt(t.nodeName):u)&&(d.display=u);else for(n in f?"hidden"in f&&(p=f.hidden):f=B.access(t,"fxshow",{}),o&&(f.hidden=!p),p?g(t).show():h.done((function(){g(t).hide()})),h.done((function(){var e;for(e in B.remove(t,"fxshow"),c)g.style(t,e,c[e])})),c)a=Yt(p?f[n]:0,n,h),n in f||(f[n]=a.start,p&&(a.end=a.start,a.start="width"===n||"height"===n?1:0))}],Gt={"*":[function(t,e){var i=this.createTween(t,e),n=i.cur(),r=Vt.exec(e),o=r&&r[3]||(g.cssNumber[t]?"":"px"),a=(g.cssNumber[t]||"px"!==o&&+n)&&Vt.exec(g.css(i.elem,t)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],r=r||[],a=+n||1;do{a/=s=s||".5",g.style(i.elem,t,a+o)}while(s!==(s=i.cur()/n)&&1!==s&&--l)}return r&&(a=i.start=+a||+n||0,i.unit=o,i.end=r[1]?a+(r[1]+1)*r[2]:+r[2]),i}]};function Wt(){return setTimeout((function(){Bt=void 0})),Bt=g.now()}function qt(t,e){var i,n=0,r={height:t};for(e=e?1:0;4>n;n+=2-e)r["margin"+(i=G[n])]=r["padding"+i]=t;return e&&(r.opacity=r.width=t),r}function Yt(t,e,i){for(var n,r=(Gt[e]||[]).concat(Gt["*"]),o=0,a=r.length;a>o;o++)if(n=r[o].call(i,e,t))return n}function Xt(t,e,i){var n,r,o=0,a=Ht.length,s=g.Deferred().always((function(){delete l.elem})),l=function(){if(r)return!1;for(var e=Bt||Wt(),i=Math.max(0,u.startTime+u.duration-e),n=1-(i/u.duration||0),o=0,a=u.tweens.length;a>o;o++)u.tweens[o].run(n);return s.notifyWith(t,[u,n,i]),1>n&&a?i:(s.resolveWith(t,[u]),!1)},u=s.promise({elem:t,props:g.extend({},e),opts:g.extend(!0,{specialEasing:{}},i),originalProperties:e,originalOptions:i,startTime:Bt||Wt(),duration:i.duration,tweens:[],createTween:function(e,i){var n=g.Tween(t,u.opts,e,i,u.opts.specialEasing[e]||u.opts.easing);return u.tweens.push(n),n},stop:function(e){var i=0,n=e?u.tweens.length:0;if(r)return this;for(r=!0;n>i;i++)u.tweens[i].run(1);return e?s.resolveWith(t,[u,e]):s.rejectWith(t,[u,e]),this}}),h=u.props;for(function(t,e){var i,n,r,o,a;for(i in t)if(r=e[n=g.camelCase(i)],o=t[i],g.isArray(o)&&(r=o[1],o=t[i]=o[0]),i!==n&&(t[n]=o,delete t[i]),(a=g.cssHooks[n])&&"expand"in a)for(i in o=a.expand(o),delete t[n],o)i in t||(t[i]=o[i],e[i]=r);else e[n]=r}(h,u.opts.specialEasing);a>o;o++)if(n=Ht[o].call(u,t,h,u.opts))return n;return g.map(h,Yt,u),g.isFunction(u.opts.start)&&u.opts.start.call(t,u),g.fx.timer(g.extend(l,{elem:t,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}g.Animation=g.extend(Xt,{tweener:function(t,e){g.isFunction(t)?(e=t,t=["*"]):t=t.split(" ");for(var i,n=0,r=t.length;r>n;n++)i=t[n],Gt[i]=Gt[i]||[],Gt[i].unshift(e)},prefilter:function(t,e){e?Ht.unshift(t):Ht.push(t)}}),g.speed=function(t,e,i){var n=t&&"object"==typeof t?g.extend({},t):{complete:i||!i&&e||g.isFunction(t)&&t,duration:t,easing:i&&e||e&&!g.isFunction(e)&&e};return n.duration=g.fx.off?0:"number"==typeof n.duration?n.duration:n.duration in g.fx.speeds?g.fx.speeds[n.duration]:g.fx.speeds._default,(null==n.queue||!0===n.queue)&&(n.queue="fx"),n.old=n.complete,n.complete=function(){g.isFunction(n.old)&&n.old.call(this),n.queue&&g.dequeue(this,n.queue)},n},g.fn.extend({fadeTo:function(t,e,i,n){return this.filter(W).css("opacity",0).show().end().animate({opacity:e},t,i,n)},animate:function(t,e,i,n){var r=g.isEmptyObject(t),o=g.speed(e,i,n),a=function(){var e=Xt(this,g.extend({},t),o);(r||B.get(this,"finish"))&&e.stop(!0)};return a.finish=a,r||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(t,e,i){var n=function(t){var e=t.stop;delete t.stop,e(i)};return"string"!=typeof t&&(i=e,e=t,t=void 0),e&&!1!==t&&this.queue(t||"fx",[]),this.each((function(){var e=!0,r=null!=t&&t+"queueHooks",o=g.timers,a=B.get(this);if(r)a[r]&&a[r].stop&&n(a[r]);else for(r in a)a[r]&&a[r].stop&&jt.test(r)&&n(a[r]);for(r=o.length;r--;)o[r].elem!==this||null!=t&&o[r].queue!==t||(o[r].anim.stop(i),e=!1,o.splice(r,1));(e||!i)&&g.dequeue(this,t)}))},finish:function(t){return!1!==t&&(t=t||"fx"),this.each((function(){var e,i=B.get(this),n=i[t+"queue"],r=i[t+"queueHooks"],o=g.timers,a=n?n.length:0;for(i.finish=!0,g.queue(this,t,[]),r&&r.stop&&r.stop.call(this,!0),e=o.length;e--;)o[e].elem===this&&o[e].queue===t&&(o[e].anim.stop(!0),o.splice(e,1));for(e=0;a>e;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete i.finish}))}}),g.each(["toggle","show","hide"],(function(t,e){var i=g.fn[e];g.fn[e]=function(t,n,r){return null==t||"boolean"==typeof t?i.apply(this,arguments):this.animate(qt(e,!0),t,n,r)}})),g.each({slideDown:qt("show"),slideUp:qt("hide"),slideToggle:qt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){g.fn[t]=function(t,i,n){return this.animate(e,t,i,n)}})),g.timers=[],g.fx.tick=function(){var t,e=0,i=g.timers;for(Bt=g.now();e<i.length;e++)(t=i[e])()||i[e]!==t||i.splice(e--,1);i.length||g.fx.stop(),Bt=void 0},g.fx.timer=function(t){g.timers.push(t),t()?g.fx.start():g.timers.pop()},g.fx.interval=13,g.fx.start=function(){zt||(zt=setInterval(g.fx.tick,g.fx.interval))},g.fx.stop=function(){clearInterval(zt),zt=null},g.fx.speeds={slow:600,fast:200,_default:400},g.fn.delay=function(t,e){return t=g.fx&&g.fx.speeds[t]||t,e=e||"fx",this.queue(e,(function(e,i){var n=setTimeout(e,t);i.stop=function(){clearTimeout(n)}}))},function(){var t=f.createElement("input"),e=f.createElement("select"),i=e.appendChild(f.createElement("option"));t.type="checkbox",p.checkOn=""!==t.value,p.optSelected=i.selected,e.disabled=!0,p.optDisabled=!i.disabled,(t=f.createElement("input")).value="t",t.type="radio",p.radioValue="t"===t.value}();var Zt,Kt=g.expr.attrHandle;g.fn.extend({attr:function(t,e){return k(this,g.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){g.removeAttr(this,t)}))}}),g.extend({attr:function(t,e,i){var n,r,o=t.nodeType;if(t&&3!==o&&8!==o&&2!==o)return typeof t.getAttribute===Y?g.prop(t,e,i):(1===o&&g.isXMLDoc(t)||(e=e.toLowerCase(),n=g.attrHooks[e]||(g.expr.match.bool.test(e)?Zt:void 0)),void 0===i?n&&"get"in n&&null!==(r=n.get(t,e))?r:null==(r=g.find.attr(t,e))?void 0:r:null!==i?n&&"set"in n&&void 0!==(r=n.set(t,i,e))?r:(t.setAttribute(e,i+""),i):void g.removeAttr(t,e))},removeAttr:function(t,e){var i,n,r=0,o=e&&e.match(I);if(o&&1===t.nodeType)for(;i=o[r++];)n=g.propFix[i]||i,g.expr.match.bool.test(i)&&(t[n]=!1),t.removeAttribute(i)},attrHooks:{type:{set:function(t,e){if(!p.radioValue&&"radio"===e&&g.nodeName(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}}}}),Zt={set:function(t,e,i){return!1===e?g.removeAttr(t,i):t.setAttribute(i,i),i}},g.each(g.expr.match.bool.source.match(/\w+/g),(function(t,e){var i=Kt[e]||g.find.attr;Kt[e]=function(t,e,n){var r,o;return n||(o=Kt[e],Kt[e]=r,r=null!=i(t,e,n)?e.toLowerCase():null,Kt[e]=o),r}}));var Qt=/^(?:input|select|textarea|button)$/i;g.fn.extend({prop:function(t,e){return k(this,g.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[g.propFix[t]||t]}))}}),g.extend({propFix:{for:"htmlFor",class:"className"},prop:function(t,e,i){var n,r,o=t.nodeType;if(t&&3!==o&&8!==o&&2!==o)return(1!==o||!g.isXMLDoc(t))&&(e=g.propFix[e]||e,r=g.propHooks[e]),void 0!==i?r&&"set"in r&&void 0!==(n=r.set(t,i,e))?n:t[e]=i:r&&"get"in r&&null!==(n=r.get(t,e))?n:t[e]},propHooks:{tabIndex:{get:function(t){return t.hasAttribute("tabindex")||Qt.test(t.nodeName)||t.href?t.tabIndex:-1}}}}),p.optSelected||(g.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null}}),g.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){g.propFix[this.toLowerCase()]=this}));var Jt=/[\t\r\n\f]/g;g.fn.extend({addClass:function(t){var e,i,n,r,o,a,s="string"==typeof t&&t,l=0,u=this.length;if(g.isFunction(t))return this.each((function(e){g(this).addClass(t.call(this,e,this.className))}));if(s)for(e=(t||"").match(I)||[];u>l;l++)if(n=1===(i=this[l]).nodeType&&(i.className?(" "+i.className+" ").replace(Jt," "):" ")){for(o=0;r=e[o++];)n.indexOf(" "+r+" ")<0&&(n+=r+" ");a=g.trim(n),i.className!==a&&(i.className=a)}return this},removeClass:function(t){var e,i,n,r,o,a,s=0===arguments.length||"string"==typeof t&&t,l=0,u=this.length;if(g.isFunction(t))return this.each((function(e){g(this).removeClass(t.call(this,e,this.className))}));if(s)for(e=(t||"").match(I)||[];u>l;l++)if(n=1===(i=this[l]).nodeType&&(i.className?(" "+i.className+" ").replace(Jt," "):"")){for(o=0;r=e[o++];)for(;n.indexOf(" "+r+" ")>=0;)n=n.replace(" "+r+" "," ");a=t?g.trim(n):"",i.className!==a&&(i.className=a)}return this},toggleClass:function(t,e){var i=typeof t;return"boolean"==typeof e&&"string"===i?e?this.addClass(t):this.removeClass(t):this.each(g.isFunction(t)?function(i){g(this).toggleClass(t.call(this,i,this.className,e),e)}:function(){if("string"===i)for(var e,n=0,r=g(this),o=t.match(I)||[];e=o[n++];)r.hasClass(e)?r.removeClass(e):r.addClass(e);else(i===Y||"boolean"===i)&&(this.className&&B.set(this,"__className__",this.className),this.className=this.className||!1===t?"":B.get(this,"__className__")||"")})},hasClass:function(t){for(var e=" "+t+" ",i=0,n=this.length;n>i;i++)if(1===this[i].nodeType&&(" "+this[i].className+" ").replace(Jt," ").indexOf(e)>=0)return!0;return!1}});var $t=/\r/g;g.fn.extend({val:function(t){var e,i,n,r=this[0];return arguments.length?(n=g.isFunction(t),this.each((function(i){var r;1===this.nodeType&&(null==(r=n?t.call(this,i,g(this).val()):t)?r="":"number"==typeof r?r+="":g.isArray(r)&&(r=g.map(r,(function(t){return null==t?"":t+""}))),(e=g.valHooks[this.type]||g.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))}))):r?(e=g.valHooks[r.type]||g.valHooks[r.nodeName.toLowerCase()])&&"get"in e&&void 0!==(i=e.get(r,"value"))?i:"string"==typeof(i=r.value)?i.replace($t,""):null==i?"":i:void 0}}),g.extend({valHooks:{option:{get:function(t){var e=g.find.attr(t,"value");return null!=e?e:g.trim(g.text(t))}},select:{get:function(t){for(var e,i,n=t.options,r=t.selectedIndex,o="select-one"===t.type||0>r,a=o?null:[],s=o?r+1:n.length,l=0>r?s:o?r:0;s>l;l++)if(!(!(i=n[l]).selected&&l!==r||(p.optDisabled?i.disabled:null!==i.getAttribute("disabled"))||i.parentNode.disabled&&g.nodeName(i.parentNode,"optgroup"))){if(e=g(i).val(),o)return e;a.push(e)}return a},set:function(t,e){for(var i,n,r=t.options,o=g.makeArray(e),a=r.length;a--;)((n=r[a]).selected=g.inArray(n.value,o)>=0)&&(i=!0);return i||(t.selectedIndex=-1),o}}}}),g.each(["radio","checkbox"],(function(){g.valHooks[this]={set:function(t,e){return g.isArray(e)?t.checked=g.inArray(g(t).val(),e)>=0:void 0}},p.checkOn||(g.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),g.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),(function(t,e){g.fn[e]=function(t,i){return arguments.length>0?this.on(e,null,t,i):this.trigger(e)}})),g.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)},bind:function(t,e,i){return this.on(t,null,e,i)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,i,n){return this.on(e,t,i,n)},undelegate:function(t,e,i){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",i)}});var te=g.now(),ee=/\?/;g.parseJSON=function(t){return JSON.parse(t+"")},g.parseXML=function(t){var e;if(!t||"string"!=typeof t)return null;try{e=(new DOMParser).parseFromString(t,"text/xml")}catch(t){e=void 0}return(!e||e.getElementsByTagName("parsererror").length)&&g.error("Invalid XML: "+t),e};var ie,ne,re=/#.*$/,oe=/([?&])_=[^&]*/,ae=/^(.*?):[ \t]*([^\r\n]*)$/gm,se=/^(?:GET|HEAD)$/,le=/^\/\//,ue=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,he={},ce={},de="*/".concat("*");try{ne=location.href}catch(t){(ne=f.createElement("a")).href="",ne=ne.href}function pe(t){return function(e,i){"string"!=typeof e&&(i=e,e="*");var n,r=0,o=e.toLowerCase().match(I)||[];if(g.isFunction(i))for(;n=o[r++];)"+"===n[0]?(n=n.slice(1)||"*",(t[n]=t[n]||[]).unshift(i)):(t[n]=t[n]||[]).push(i)}}function fe(t,e,i,n){var r={},o=t===ce;function a(s){var l;return r[s]=!0,g.each(t[s]||[],(function(t,s){var u=s(e,i,n);return"string"!=typeof u||o||r[u]?o?!(l=u):void 0:(e.dataTypes.unshift(u),a(u),!1)})),l}return a(e.dataTypes[0])||!r["*"]&&a("*")}function me(t,e){var i,n,r=g.ajaxSettings.flatOptions||{};for(i in e)void 0!==e[i]&&((r[i]?t:n||(n={}))[i]=e[i]);return n&&g.extend(!0,t,n),t}ie=ue.exec(ne.toLowerCase())||[],g.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:ne,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ie[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":de,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":g.parseJSON,"text xml":g.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?me(me(t,g.ajaxSettings),e):me(g.ajaxSettings,t)},ajaxPrefilter:pe(he),ajaxTransport:pe(ce),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var i,n,r,o,a,s,l,u,h=g.ajaxSetup({},e),c=h.context||h,d=h.context&&(c.nodeType||c.jquery)?g(c):g.event,p=g.Deferred(),f=g.Callbacks("once memory"),m=h.statusCode||{},v={},y={},b=0,w="canceled",x={readyState:0,getResponseHeader:function(t){var e;if(2===b){if(!o)for(o={};e=ae.exec(r);)o[e[1].toLowerCase()]=e[2];e=o[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return 2===b?r:null},setRequestHeader:function(t,e){var i=t.toLowerCase();return b||(t=y[i]=y[i]||t,v[t]=e),this},overrideMimeType:function(t){return b||(h.mimeType=t),this},statusCode:function(t){var e;if(t)if(2>b)for(e in t)m[e]=[m[e],t[e]];else x.always(t[x.status]);return this},abort:function(t){var e=t||w;return i&&i.abort(e),M(0,e),this}};if(p.promise(x).complete=f.add,x.success=x.done,x.error=x.fail,h.url=((t||h.url||ne)+"").replace(re,"").replace(le,ie[1]+"//"),h.type=e.method||e.type||h.method||h.type,h.dataTypes=g.trim(h.dataType||"*").toLowerCase().match(I)||[""],null==h.crossDomain&&(s=ue.exec(h.url.toLowerCase()),h.crossDomain=!(!s||s[1]===ie[1]&&s[2]===ie[2]&&(s[3]||("http:"===s[1]?"80":"443"))===(ie[3]||("http:"===ie[1]?"80":"443")))),h.data&&h.processData&&"string"!=typeof h.data&&(h.data=g.param(h.data,h.traditional)),fe(he,h,e,x),2===b)return x;for(u in(l=h.global)&&0==g.active++&&g.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!se.test(h.type),n=h.url,h.hasContent||(h.data&&(n=h.url+=(ee.test(n)?"&":"?")+h.data,delete h.data),!1===h.cache&&(h.url=oe.test(n)?n.replace(oe,"$1_="+te++):n+(ee.test(n)?"&":"?")+"_="+te++)),h.ifModified&&(g.lastModified[n]&&x.setRequestHeader("If-Modified-Since",g.lastModified[n]),g.etag[n]&&x.setRequestHeader("If-None-Match",g.etag[n])),(h.data&&h.hasContent&&!1!==h.contentType||e.contentType)&&x.setRequestHeader("Content-Type",h.contentType),x.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+de+"; q=0.01":""):h.accepts["*"]),h.headers)x.setRequestHeader(u,h.headers[u]);if(h.beforeSend&&(!1===h.beforeSend.call(c,x,h)||2===b))return x.abort();for(u in w="abort",{success:1,error:1,complete:1})x[u](h[u]);if(i=fe(ce,h,e,x)){x.readyState=1,l&&d.trigger("ajaxSend",[x,h]),h.async&&h.timeout>0&&(a=setTimeout((function(){x.abort("timeout")}),h.timeout));try{b=1,i.send(v,M)}catch(t){if(!(2>b))throw t;M(-1,t)}}else M(-1,"No Transport");function M(t,e,o,s){var u,v,y,w,M,T=e;2!==b&&(b=2,a&&clearTimeout(a),i=void 0,r=s||"",x.readyState=t>0?4:0,u=t>=200&&300>t||304===t,o&&(w=function(t,e,i){for(var n,r,o,a,s=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=t.mimeType||e.getResponseHeader("Content-Type"));if(n)for(r in s)if(s[r]&&s[r].test(n)){l.unshift(r);break}if(l[0]in i)o=l[0];else{for(r in i){if(!l[0]||t.converters[r+" "+l[0]]){o=r;break}a||(a=r)}o=o||a}return o?(o!==l[0]&&l.unshift(o),i[o]):void 0}(h,x,o)),w=function(t,e,i,n){var r,o,a,s,l,u={},h=t.dataTypes.slice();if(h[1])for(a in t.converters)u[a.toLowerCase()]=t.converters[a];for(o=h.shift();o;)if(t.responseFields[o]&&(i[t.responseFields[o]]=e),!l&&n&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=o,o=h.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=u[l+" "+o]||u["* "+o]))for(r in u)if((s=r.split(" "))[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[r]:!0!==u[r]&&(o=s[0],h.unshift(s[1]));break}if(!0!==a)if(a&&t.throws)e=a(e);else try{e=a(e)}catch(t){return{state:"parsererror",error:a?t:"No conversion from "+l+" to "+o}}}return{state:"success",data:e}}(h,w,x,u),u?(h.ifModified&&((M=x.getResponseHeader("Last-Modified"))&&(g.lastModified[n]=M),(M=x.getResponseHeader("etag"))&&(g.etag[n]=M)),204===t||"HEAD"===h.type?T="nocontent":304===t?T="notmodified":(T=w.state,v=w.data,u=!(y=w.error))):(y=T,(t||!T)&&(T="error",0>t&&(t=0))),x.status=t,x.statusText=(e||T)+"",u?p.resolveWith(c,[v,T,x]):p.rejectWith(c,[x,T,y]),x.statusCode(m),m=void 0,l&&d.trigger(u?"ajaxSuccess":"ajaxError",[x,h,u?v:y]),f.fireWith(c,[x,T]),l&&(d.trigger("ajaxComplete",[x,h]),--g.active||g.event.trigger("ajaxStop")))}return x},getJSON:function(t,e,i){return g.get(t,e,i,"json")},getScript:function(t,e){return g.get(t,void 0,e,"script")}}),g.each(["get","post"],(function(t,e){g[e]=function(t,i,n,r){return g.isFunction(i)&&(r=r||n,n=i,i=void 0),g.ajax({url:t,type:e,dataType:r,data:i,success:n})}})),g.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){g.fn[e]=function(t){return this.on(e,t)}})),g._evalUrl=function(t){return g.ajax({url:t,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})},g.fn.extend({wrapAll:function(t){var e;return g.isFunction(t)?this.each((function(e){g(this).wrapAll(t.call(this,e))})):(this[0]&&(e=g(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this)},wrapInner:function(t){return this.each(g.isFunction(t)?function(e){g(this).wrapInner(t.call(this,e))}:function(){var e=g(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)})},wrap:function(t){var e=g.isFunction(t);return this.each((function(i){g(this).wrapAll(e?t.call(this,i):t)}))},unwrap:function(){return this.parent().each((function(){g.nodeName(this,"body")||g(this).replaceWith(this.childNodes)})).end()}}),g.expr.filters.hidden=function(t){return t.offsetWidth<=0&&t.offsetHeight<=0},g.expr.filters.visible=function(t){return!g.expr.filters.hidden(t)};var ge=/%20/g,ve=/\[\]$/,ye=/\r?\n/g,be=/^(?:submit|button|image|reset|file)$/i,we=/^(?:input|select|textarea|keygen)/i;function xe(t,e,i,n){var r;if(g.isArray(e))g.each(e,(function(e,r){i||ve.test(t)?n(t,r):xe(t+"["+("object"==typeof r?e:"")+"]",r,i,n)}));else if(i||"object"!==g.type(e))n(t,e);else for(r in e)xe(t+"["+r+"]",e[r],i,n)}g.param=function(t,e){var i,n=[],r=function(t,e){e=g.isFunction(e)?e():null==e?"":e,n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(void 0===e&&(e=g.ajaxSettings&&g.ajaxSettings.traditional),g.isArray(t)||t.jquery&&!g.isPlainObject(t))g.each(t,(function(){r(this.name,this.value)}));else for(i in t)xe(i,t[i],e,r);return n.join("&").replace(ge,"+")},g.fn.extend({serialize:function(){return g.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=g.prop(this,"elements");return t?g.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!g(this).is(":disabled")&&we.test(this.nodeName)&&!be.test(t)&&(this.checked||!q.test(t))})).map((function(t,e){var i=g(this).val();return null==i?null:g.isArray(i)?g.map(i,(function(t){return{name:e.name,value:t.replace(ye,"\r\n")}})):{name:e.name,value:i.replace(ye,"\r\n")}})).get()}}),g.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(t){}};var Me=0,Te={},Se={0:200,1223:204},_e=g.ajaxSettings.xhr();i.ActiveXObject&&g(i).on("unload",(function(){for(var t in Te)Te[t]()})),p.cors=!!_e&&"withCredentials"in _e,p.ajax=_e=!!_e,g.ajaxTransport((function(t){var e;return p.cors||_e&&!t.crossDomain?{send:function(i,n){var r,o=t.xhr(),a=++Me;if(o.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(r in t.xhrFields)o[r]=t.xhrFields[r];for(r in t.mimeType&&o.overrideMimeType&&o.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)o.setRequestHeader(r,i[r]);e=function(t){return function(){e&&(delete Te[a],e=o.onload=o.onerror=null,"abort"===t?o.abort():"error"===t?n(o.status,o.statusText):n(Se[o.status]||o.status,o.statusText,"string"==typeof o.responseText?{text:o.responseText}:void 0,o.getAllResponseHeaders()))}},o.onload=e(),o.onerror=e("error"),e=Te[a]=e("abort");try{o.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}:void 0})),g.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(t){return g.globalEval(t),t}}}),g.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),g.ajaxTransport("script",(function(t){var e,i;if(t.crossDomain)return{send:function(n,r){e=g("<script>").prop({async:!0,charset:t.scriptCharset,src:t.url}).on("load error",i=function(t){e.remove(),i=null,t&&r("error"===t.type?404:200,t.type)}),f.head.appendChild(e[0])},abort:function(){i&&i()}}}));var Ae=[],Pe=/(=)\?(?=&|$)|\?\?/;g.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Ae.pop()||g.expando+"_"+te++;return this[t]=!0,t}}),g.ajaxPrefilter("json jsonp",(function(t,e,n){var r,o,a,s=!1!==t.jsonp&&(Pe.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Pe.test(t.data)&&"data");return s||"jsonp"===t.dataTypes[0]?(r=t.jsonpCallback=g.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Pe,"$1"+r):!1!==t.jsonp&&(t.url+=(ee.test(t.url)?"&":"?")+t.jsonp+"="+r),t.converters["script json"]=function(){return a||g.error(r+" was not called"),a[0]},t.dataTypes[0]="json",o=i[r],i[r]=function(){a=arguments},n.always((function(){i[r]=o,t[r]&&(t.jsonpCallback=e.jsonpCallback,Ae.push(r)),a&&g.isFunction(o)&&o(a[0]),a=o=void 0})),"script"):void 0})),g.parseHTML=function(t,e,i){if(!t||"string"!=typeof t)return null;"boolean"==typeof e&&(i=e,e=!1),e=e||f;var n=S.exec(t),r=!i&&[];return n?[e.createElement(n[1])]:(n=g.buildFragment([t],e,r),r&&r.length&&g(r).remove(),g.merge([],n.childNodes))};var Ce=g.fn.load;g.fn.load=function(t,e,i){if("string"!=typeof t&&Ce)return Ce.apply(this,arguments);var n,r,o,a=this,s=t.indexOf(" ");return s>=0&&(n=g.trim(t.slice(s)),t=t.slice(0,s)),g.isFunction(e)?(i=e,e=void 0):e&&"object"==typeof e&&(r="POST"),a.length>0&&g.ajax({url:t,type:r,dataType:"html",data:e}).done((function(t){o=arguments,a.html(n?g("<div>").append(g.parseHTML(t)).find(n):t)})).complete(i&&function(t,e){a.each(i,o||[t.responseText,e,t])}),this},g.expr.filters.animated=function(t){return g.grep(g.timers,(function(e){return t===e.elem})).length};var Ee=i.document.documentElement;function De(t){return g.isWindow(t)?t:9===t.nodeType&&t.defaultView}g.offset={setOffset:function(t,e,i){var n,r,o,a,s,l,u=g.css(t,"position"),h=g(t),c={};"static"===u&&(t.style.position="relative"),s=h.offset(),o=g.css(t,"top"),l=g.css(t,"left"),("absolute"===u||"fixed"===u)&&(o+l).indexOf("auto")>-1?(a=(n=h.position()).top,r=n.left):(a=parseFloat(o)||0,r=parseFloat(l)||0),g.isFunction(e)&&(e=e.call(t,i,s)),null!=e.top&&(c.top=e.top-s.top+a),null!=e.left&&(c.left=e.left-s.left+r),"using"in e?e.using.call(t,c):h.css(c)}},g.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){g.offset.setOffset(this,t,e)}));var e,i,n=this[0],r={top:0,left:0},o=n&&n.ownerDocument;return o?(e=o.documentElement,g.contains(e,n)?(typeof n.getBoundingClientRect!==Y&&(r=n.getBoundingClientRect()),i=De(o),{top:r.top+i.pageYOffset-e.clientTop,left:r.left+i.pageXOffset-e.clientLeft}):r):void 0},position:function(){if(this[0]){var t,e,i=this[0],n={top:0,left:0};return"fixed"===g.css(i,"position")?e=i.getBoundingClientRect():(t=this.offsetParent(),e=this.offset(),g.nodeName(t[0],"html")||(n=t.offset()),n.top+=g.css(t[0],"borderTopWidth",!0),n.left+=g.css(t[0],"borderLeftWidth",!0)),{top:e.top-n.top-g.css(i,"marginTop",!0),left:e.left-n.left-g.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent||Ee;t&&!g.nodeName(t,"html")&&"static"===g.css(t,"position");)t=t.offsetParent;return t||Ee}))}}),g.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var n="pageYOffset"===e;g.fn[t]=function(r){return k(this,(function(t,r,o){var a=De(t);return void 0===o?a?a[e]:t[r]:void(a?a.scrollTo(n?i.pageXOffset:o,n?o:i.pageYOffset):t[r]=o)}),t,r,arguments.length,null)}})),g.each(["top","left"],(function(t,e){g.cssHooks[e]=_t(p.pixelPosition,(function(t,i){return i?(i=St(t,e),Mt.test(i)?g(t).position()[e]+"px":i):void 0}))})),g.each({Height:"height",Width:"width"},(function(t,e){g.each({padding:"inner"+t,content:e,"":"outer"+t},(function(i,n){g.fn[n]=function(n,r){var o=arguments.length&&(i||"boolean"!=typeof n),a=i||(!0===n||!0===r?"margin":"border");return k(this,(function(e,i,n){var r;return g.isWindow(e)?e.document.documentElement["client"+t]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+t],r["scroll"+t],e.body["offset"+t],r["offset"+t],r["client"+t])):void 0===n?g.css(e,i,a):g.style(e,i,n,a)}),e,o?n:void 0,o,null)}}))})),g.fn.size=function(){return this.length},g.fn.andSelf=g.fn.addBack,void 0===(n=function(){return g}.apply(e,[]))||(t.exports=n);var Le=i.jQuery,Oe=i.$;return g.noConflict=function(t){return i.$===g&&(i.$=Oe),t&&i.jQuery===g&&(i.jQuery=Le),g},typeof r===Y&&(i.jQuery=i.$=g),g}))},function(t,e,i){var n=i(0);!function(){if("performance"in window==0&&(window.performance={}),"now"in window.performance==0){var t=Date.now();performance.timing&&performance.timing.navigationStart&&(t=performance.timing.navigationStart),window.performance.now=function(){return Date.now()-t}}}(),n.WebGLRenderer.prototype.paramThreeToGL=function(t){var e,i=this.extensions,r=this.context;if(t===n.RepeatWrapping)return r.REPEAT;if(t===n.ClampToEdgeWrapping)return r.CLAMP_TO_EDGE;if(t===n.MirroredRepeatWrapping)return r.MIRRORED_REPEAT;if(t===n.NearestFilter)return r.NEAREST;if(t===n.NearestMipMapNearestFilter)return r.NEAREST_MIPMAP_NEAREST;if(t===n.NearestMipMapLinearFilter)return r.NEAREST_MIPMAP_LINEAR;if(t===n.LinearFilter)return r.LINEAR;if(t===n.LinearMipMapNearestFilter)return r.LINEAR_MIPMAP_NEAREST;if(t===n.LinearMipMapLinearFilter)return r.LINEAR_MIPMAP_LINEAR;if(t===n.UnsignedByteType)return r.UNSIGNED_BYTE;if(t===n.UnsignedShort4444Type)return r.UNSIGNED_SHORT_4_4_4_4;if(t===n.UnsignedShort5551Type)return r.UNSIGNED_SHORT_5_5_5_1;if(t===n.UnsignedShort565Type)return r.UNSIGNED_SHORT_5_6_5;if(t===n.ByteType)return r.BYTE;if(t===n.ShortType)return r.SHORT;if(t===n.UnsignedShortType)return r.UNSIGNED_SHORT;if(t===n.IntType)return r.INT;if(t===n.UnsignedIntType)return r.UNSIGNED_INT;if(t===n.FloatType)return r.FLOAT;if(null!==(e=i.get("OES_texture_half_float"))&&t===n.HalfFloatType)return e.HALF_FLOAT_OES;if(t===n.AlphaFormat)return r.ALPHA;if(t===n.RGBFormat)return r.RGB;if(t===n.RGBAFormat)return r.RGBA;if(t===n.LuminanceFormat)return r.LUMINANCE;if(t===n.LuminanceAlphaFormat)return r.LUMINANCE_ALPHA;if(t===n.AddEquation)return r.FUNC_ADD;if(t===n.SubtractEquation)return r.FUNC_SUBTRACT;if(t===n.ReverseSubtractEquation)return r.FUNC_REVERSE_SUBTRACT;if(t===n.ZeroFactor)return r.ZERO;if(t===n.OneFactor)return r.ONE;if(t===n.SrcColorFactor)return r.SRC_COLOR;if(t===n.OneMinusSrcColorFactor)return r.ONE_MINUS_SRC_COLOR;if(t===n.SrcAlphaFactor)return r.SRC_ALPHA;if(t===n.OneMinusSrcAlphaFactor)return r.ONE_MINUS_SRC_ALPHA;if(t===n.DstAlphaFactor)return r.DST_ALPHA;if(t===n.OneMinusDstAlphaFactor)return r.ONE_MINUS_DST_ALPHA;if(t===n.DstColorFactor)return r.DST_COLOR;if(t===n.OneMinusDstColorFactor)return r.ONE_MINUS_DST_COLOR;if(t===n.SrcAlphaSaturateFactor)return r.SRC_ALPHA_SATURATE;if(null!==(e=i.get("WEBGL_compressed_texture_s3tc"))){if(t===n.RGB_S3TC_DXT1_Format)return e.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===n.RGBA_S3TC_DXT1_Format)return e.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===n.RGBA_S3TC_DXT3_Format)return e.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===n.RGBA_S3TC_DXT5_Format)return e.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(null!==(e=i.get("WEBGL_compressed_texture_pvrtc"))){if(t===n.RGB_PVRTC_4BPPV1_Format)return e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===n.RGB_PVRTC_2BPPV1_Format)return e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===n.RGBA_PVRTC_4BPPV1_Format)return e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===n.RGBA_PVRTC_2BPPV1_Format)return e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(null!==(e=i.get("WEBGL_compressed_texture_etc1"))&&t===n.RGB_ETC1_Format)return e.COMPRESSED_RGB_ETC1_WEBGL;if(null!==(e=i.get("EXT_blend_minmax"))){if(t===n.MinEquation)return e.MIN_EXT;if(t===n.MaxEquation)return e.MAX_EXT}return 0},n.WebGLState=function(t,e,i){var r=this,o=new n.Vector4,a=t.getParameter(t.MAX_VERTEX_ATTRIBS),s=new Uint8Array(a),l=new Uint8Array(a),u=new Uint8Array(a),h={},c=null,d=null,p=null,f=null,m=null,g=null,v=null,y=null,b=!1,w=null,x=null,M=null,T=null,S=null,_=null,A=null,P=null,C=null,E=null,D=null,L=null,O=null,I=null,R=null,N=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),k=void 0,F={},B=new n.Vector4,z=null,U=null,V=new n.Vector4,j=new n.Vector4;this.init=function(){this.clearColor(0,0,0,1),this.clearDepth(1),this.clearStencil(0),this.enable(t.DEPTH_TEST),t.depthFunc(t.LEQUAL),t.frontFace(t.CCW),t.cullFace(t.BACK),this.enable(t.CULL_FACE),this.enable(t.BLEND),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA)},this.initAttributes=function(){for(var t=0,e=s.length;t<e;t++)s[t]=0},this.enableAttribute=function(i){if(s[i]=1,0===l[i]&&(t.enableVertexAttribArray(i),l[i]=1),0!==u[i]){e.get("ANGLE_instanced_arrays");n.vertexAttribDivisorANGLE(i,0),u[i]=0}},this.enableAttributeAndDivisor=function(e,i,r){s[e]=1,0===l[e]&&(t.enableVertexAttribArray(e),l[e]=1),u[e]!==i&&(n.vertexAttribDivisorANGLE(e,i),u[e]=i)},this.disableUnusedAttributes=function(){for(var e=0,i=l.length;e<i;e++)l[e]!==s[e]&&(t.disableVertexAttribArray(e),l[e]=0)},this.enable=function(e){!0!==h[e]&&(t.enable(e),h[e]=!0)},this.disable=function(e){!1!==h[e]&&(t.disable(e),h[e]=!1)},this.getCompressedTextureFormats=function(){if(null===c&&(c=[],e.get("WEBGL_compressed_texture_pvrtc")||e.get("WEBGL_compressed_texture_s3tc")||e.get("WEBGL_compressed_texture_etc1")))for(var i=t.getParameter(t.COMPRESSED_TEXTURE_FORMATS),n=0;n<i.length;n++)c.push(i[n]);return c},this.setBlending=function(e,r,o,a,s,l,u,h){e===n.NoBlending?this.disable(t.BLEND):this.enable(t.BLEND),e===d&&h===b||(e===n.AdditiveBlending?h?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ONE,t.ONE,t.ONE,t.ONE)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.SRC_ALPHA,t.ONE)):e===n.SubtractiveBlending?h?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ZERO,t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ONE_MINUS_SRC_ALPHA)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ZERO,t.ONE_MINUS_SRC_COLOR)):e===n.MultiplyBlending?h?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ZERO,t.ZERO,t.SRC_COLOR,t.SRC_ALPHA)):(t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ZERO,t.SRC_COLOR)):h?(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA)):(t.blendEquationSeparate(t.FUNC_ADD,t.FUNC_ADD),t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA)),d=e,b=h),e===n.CustomBlending?(s=s||r,l=l||o,u=u||a,r===p&&s===g||(t.blendEquationSeparate(i(r),i(s)),p=r,g=s),o===f&&a===m&&l===v&&u===y||(t.blendFuncSeparate(i(o),i(a),i(l),i(u)),f=o,m=a,v=l,y=u)):(p=null,f=null,m=null,g=null,v=null,y=null)},this.setDepthFunc=function(e){if(w!==e){if(e)switch(e){case n.NeverDepth:t.depthFunc(t.NEVER);break;case n.AlwaysDepth:t.depthFunc(t.ALWAYS);break;case n.LessDepth:t.depthFunc(t.LESS);break;case n.LessEqualDepth:t.depthFunc(t.LEQUAL);break;case n.EqualDepth:t.depthFunc(t.EQUAL);break;case n.GreaterEqualDepth:t.depthFunc(t.GEQUAL);break;case n.GreaterDepth:t.depthFunc(t.GREATER);break;case n.NotEqualDepth:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}else t.depthFunc(t.LEQUAL);w=e}},this.setDepthTest=function(e){e?this.enable(t.DEPTH_TEST):this.disable(t.DEPTH_TEST)},this.setDepthWrite=function(e){x!==e&&(t.depthMask(e),x=e)},this.setColorWrite=function(e){M!==e&&(t.colorMask(e,e,e,e),M=e)},this.setStencilFunc=function(e,i,n){S===e&&_===i&&A===n||(t.stencilFunc(e,i,n),S=e,_=i,A=n)},this.setStencilOp=function(e,i,n){P===e&&C===i&&E===n||(t.stencilOp(e,i,n),P=e,C=i,E=n)},this.setStencilTest=function(e){e?this.enable(t.STENCIL_TEST):this.disable(t.STENCIL_TEST)},this.setStencilWrite=function(e){T!==e&&(t.stencilMask(e),T=e)},this.setFlipSided=function(e){D!==e&&(e?t.frontFace(t.CW):t.frontFace(t.CCW),D=e)},this.setLineWidth=function(e){e!==L&&(t.lineWidth(e),L=e)},this.setPolygonOffset=function(e,i,n){e?this.enable(t.POLYGON_OFFSET_FILL):this.disable(t.POLYGON_OFFSET_FILL),!e||O===i&&I===n||(t.polygonOffset(i,n),O=i,I=n)},this.getScissorTest=function(){return R},this.setScissorTest=function(e){R=e,e?this.enable(t.SCISSOR_TEST):this.disable(t.SCISSOR_TEST)},this.activeTexture=function(e){void 0===e&&(e=t.TEXTURE0+N-1),k!==e&&(t.activeTexture(e),k=e)},this.bindTexture=function(e,i){void 0===k&&r.activeTexture();var o=F[k];void 0===o&&(o={type:void 0,texture:void 0},F[k]=o),n.type===e&&n.texture===i||(t.bindTexture(e,i),n.type=e,n.texture=i)},this.compressedTexImage2D=function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(t){}},this.texImage2D=function(){try{t.texImage2D.apply(t,arguments)}catch(t){}},this.clearColor=function(e,i,n,r){o.set(e,i,n,r),!1===B.equals(o)&&(t.clearColor(e,i,n,r),B.copy(o))},this.clearDepth=function(e){z!==e&&(t.clearDepth(e),z=e)},this.clearStencil=function(e){U!==e&&(t.clearStencil(e),U=e)},this.scissor=function(e){!1===V.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),V.copy(e))},this.viewport=function(e){!1===j.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),j.copy(e))},this.reset=function(){for(var e=0;e<l.length;e++)1===l[e]&&(t.disableVertexAttribArray(e),l[e]=0);h={},c=null,k=void 0,F={},d=null,M=null,x=null,T=null,D=null}}},function(t,e){Array.prototype.findIndex||(Array.prototype.findIndex=function(t){if(null==this)throw new TypeError("Array.prototype.findIndex called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var e,i=Object(this),n=i.length>>>0,r=arguments[1],o=0;o<n;o++)if(e=i[o],t.call(r,e,o,i))return o;return-1})},function(t,e,i){i(0).CopyShader={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = opacity * texel;","}"].join("\n")}},function(t,e,i){i(0).HorizontalBlurShader={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float h;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")}},function(t,e,i){i(0).VerticalBlurShader={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float v;","varying vec2 vUv;","void main() {","vec4 sum = vec4( 0.0 );","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;","sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;","gl_FragColor = sum;","}"].join("\n")}},function(t,e,i){var n=i(0);n.SMAAShader=[{defines:{SMAA_THRESHOLD:"0.1"},uniforms:{tDiffuse:{value:null},resolution:{value:new n.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","void SMAAEdgeDetectionVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","vOffset[ 2 ] = texcoord.xyxy + resolution.xyxy * vec4( -2.0, 0.0, 0.0, 2.0 );","}","void main() {","vUv = uv;","SMAAEdgeDetectionVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","vec4 SMAAColorEdgeDetectionPS( vec2 texcoord, vec4 offset[3], sampler2D colorTex ) {","vec2 threshold = vec2( SMAA_THRESHOLD, SMAA_THRESHOLD );","vec4 delta;","vec3 C = texture2D( colorTex, texcoord ).rgb;","vec3 Cleft = texture2D( colorTex, offset[0].xy ).rgb;","vec3 t = abs( C - Cleft );","delta.x = max( max( t.r, t.g ), t.b );","vec3 Ctop = texture2D( colorTex, offset[0].zw ).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, 1.0 ) ) == 0.0 )","discard;","vec3 Cright = texture2D( colorTex, offset[1].xy ).rgb;","t = abs( C - Cright );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Cbottom = texture2D( colorTex, offset[1].zw ).rgb;","t = abs( C - Cbottom );","delta.w = max( max( t.r, t.g ), t.b );","float maxDelta = max( max( max( delta.x, delta.y ), delta.z ), delta.w );","vec3 Cleftleft = texture2D( colorTex, offset[2].xy ).rgb;","t = abs( C - Cleftleft );","delta.z = max( max( t.r, t.g ), t.b );","vec3 Ctoptop = texture2D( colorTex, offset[2].zw ).rgb;","t = abs( C - Ctoptop );","delta.w = max( max( t.r, t.g ), t.b );","maxDelta = max( max( maxDelta, delta.z ), delta.w );","edges.xy *= step( 0.5 * maxDelta, delta.xy );","return vec4( edges, 0.0, 0.0 );","}","void main() {","gl_FragColor = SMAAColorEdgeDetectionPS( vUv, vOffset, tDiffuse );","}"].join("\n")},{defines:{SMAA_MAX_SEARCH_STEPS:"8",SMAA_AREATEX_MAX_DISTANCE:"16",SMAA_AREATEX_PIXEL_SIZE:"( 1.0 / vec2( 160.0, 560.0 ) )",SMAA_AREATEX_SUBTEX_SIZE:"( 1.0 / 7.0 )"},uniforms:{tDiffuse:{value:null},tArea:{value:null},tSearch:{value:null},resolution:{value:new n.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 3 ];","varying vec2 vPixcoord;","void SMAABlendingWeightCalculationVS( vec2 texcoord ) {","vPixcoord = texcoord / resolution;","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -0.25, 0.125, 1.25, 0.125 );","vOffset[ 1 ] = texcoord.xyxy + resolution.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 ) * resolution.xxyy * float( SMAA_MAX_SEARCH_STEPS );","}","void main() {","vUv = uv;","SMAABlendingWeightCalculationVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#define SMAASampleLevelZeroOffset( tex, coord, offset ) texture2D( tex, coord + float( offset ) * resolution, 0.0 )","uniform sampler2D tDiffuse;","uniform sampler2D tArea;","uniform sampler2D tSearch;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[3];","varying vec2 vPixcoord;","vec2 round( vec2 x ) {","return sign( x ) * floor( abs( x ) + 0.5 );","}","float SMAASearchLength( sampler2D searchTex, vec2 e, float bias, float scale ) {","e.r = bias + e.r * scale;","return 255.0 * texture2D( searchTex, e, 0.0 ).r;","}","float SMAASearchXLeft( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x > end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x += 0.25 * resolution.x;","texcoord.x += resolution.x;","texcoord.x += 2.0 * resolution.x;","texcoord.x -= resolution.x * SMAASearchLength(searchTex, e, 0.0, 0.5);","return texcoord.x;","}","float SMAASearchXRight( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 0.0, 1.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 2.0, 0.0 ) * resolution;","if ( ! ( texcoord.x < end && e.g > 0.8281 && e.r == 0.0 ) ) break;","}","texcoord.x -= 0.25 * resolution.x;","texcoord.x -= resolution.x;","texcoord.x -= 2.0 * resolution.x;","texcoord.x += resolution.x * SMAASearchLength( searchTex, e, 0.5, 0.5 );","return texcoord.x;","}","float SMAASearchYUp( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord += vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y > end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y -= 0.25 * resolution.y;","texcoord.y -= resolution.y;","texcoord.y -= 2.0 * resolution.y;","texcoord.y += resolution.y * SMAASearchLength( searchTex, e.gr, 0.0, 0.5 );","return texcoord.y;","}","float SMAASearchYDown( sampler2D edgesTex, sampler2D searchTex, vec2 texcoord, float end ) {","vec2 e = vec2( 1.0, 0.0 );","for ( int i = 0; i < SMAA_MAX_SEARCH_STEPS; i ++ ) {","e = texture2D( edgesTex, texcoord, 0.0 ).rg;","texcoord -= vec2( 0.0, 2.0 ) * resolution;","if ( ! ( texcoord.y < end && e.r > 0.8281 && e.g == 0.0 ) ) break;","}","texcoord.y += 0.25 * resolution.y;","texcoord.y += resolution.y;","texcoord.y += 2.0 * resolution.y;","texcoord.y -= resolution.y * SMAASearchLength( searchTex, e.gr, 0.5, 0.5 );","return texcoord.y;","}","vec2 SMAAArea( sampler2D areaTex, vec2 dist, float e1, float e2, float offset ) {","vec2 texcoord = float( SMAA_AREATEX_MAX_DISTANCE ) * round( 4.0 * vec2( e1, e2 ) ) + dist;","texcoord = SMAA_AREATEX_PIXEL_SIZE * texcoord + ( 0.5 * SMAA_AREATEX_PIXEL_SIZE );","texcoord.y += SMAA_AREATEX_SUBTEX_SIZE * offset;","return texture2D( areaTex, texcoord, 0.0 ).rg;","}","vec4 SMAABlendingWeightCalculationPS( vec2 texcoord, vec2 pixcoord, vec4 offset[ 3 ], sampler2D edgesTex, sampler2D areaTex, sampler2D searchTex, ivec4 subsampleIndices ) {","vec4 weights = vec4( 0.0, 0.0, 0.0, 0.0 );","vec2 e = texture2D( edgesTex, texcoord ).rg;","if ( e.g > 0.0 ) {","vec2 d;","vec2 coords;","coords.x = SMAASearchXLeft( edgesTex, searchTex, offset[ 0 ].xy, offset[ 2 ].x );","coords.y = offset[ 1 ].y;","d.x = coords.x;","float e1 = texture2D( edgesTex, coords, 0.0 ).r;","coords.x = SMAASearchXRight( edgesTex, searchTex, offset[ 0 ].zw, offset[ 2 ].y );","d.y = coords.x;","d = d / resolution.x - pixcoord.x;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 1, 0 ) ).r;","weights.rg = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.y ) );","}","if ( e.r > 0.0 ) {","vec2 d;","vec2 coords;","coords.y = SMAASearchYUp( edgesTex, searchTex, offset[ 1 ].xy, offset[ 2 ].z );","coords.x = offset[ 0 ].x;","d.x = coords.y;","float e1 = texture2D( edgesTex, coords, 0.0 ).g;","coords.y = SMAASearchYDown( edgesTex, searchTex, offset[ 1 ].zw, offset[ 2 ].w );","d.y = coords.y;","d = d / resolution.y - pixcoord.y;","vec2 sqrt_d = sqrt( abs( d ) );","coords.y -= 1.0 * resolution.y;","float e2 = SMAASampleLevelZeroOffset( edgesTex, coords, ivec2( 0, 1 ) ).g;","weights.ba = SMAAArea( areaTex, sqrt_d, e1, e2, float( subsampleIndices.x ) );","}","return weights;","}","void main() {","gl_FragColor = SMAABlendingWeightCalculationPS( vUv, vPixcoord, vOffset, tDiffuse, tArea, tSearch, ivec4( 0.0 ) );","}"].join("\n")},{uniforms:{tDiffuse:{value:null},tColor:{value:null},resolution:{value:new n.Vector2(1/1024,1/512)}},vertexShader:["uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","void SMAANeighborhoodBlendingVS( vec2 texcoord ) {","vOffset[ 0 ] = texcoord.xyxy + resolution.xyxy * vec4( -1.0, 0.0, 0.0, 1.0 );","vOffset[ 1 ] = texcoord.xyxy + resolution.xyxy * vec4( 1.0, 0.0, 0.0, -1.0 );","}","void main() {","vUv = uv;","SMAANeighborhoodBlendingVS( vUv );","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform sampler2D tColor;","uniform vec2 resolution;","varying vec2 vUv;","varying vec4 vOffset[ 2 ];","vec4 SMAANeighborhoodBlendingPS( vec2 texcoord, vec4 offset[ 2 ], sampler2D colorTex, sampler2D blendTex ) {","vec4 a;","a.xz = texture2D( blendTex, texcoord ).xz;","a.y = texture2D( blendTex, offset[ 1 ].zw ).g;","a.w = texture2D( blendTex, offset[ 1 ].xy ).a;","if ( dot(a, vec4( 1.0, 1.0, 1.0, 1.0 )) < 1e-5 ) {","return texture2D( colorTex, texcoord, 0.0 );","} else {","vec2 offset;","offset.x = a.a > a.b ? a.a : -a.b;","offset.y = a.g > a.r ? -a.g : a.r;","if ( abs( offset.x ) > abs( offset.y )) {","offset.y = 0.0;","} else {","offset.x = 0.0;","}","vec4 C = texture2D( colorTex, texcoord, 0.0 );","texcoord += sign( offset ) * resolution;","vec4 Cop = texture2D( colorTex, texcoord, 0.0 );","float s = abs( offset.x ) > abs( offset.y ) ? abs( offset.x ) : abs( offset.y );","C.xyz = pow(C.xyz, vec3(2.2));","Cop.xyz = pow(Cop.xyz, vec3(2.2));","vec4 mixed = mix(C, Cop, s);","mixed.xyz = pow(mixed.xyz, vec3(1.0 / 2.2));","return mixed;","}","}","void main() {","gl_FragColor = SMAANeighborhoodBlendingPS( vUv, vOffset, tColor, tDiffuse );","}"].join("\n")}]},function(t,e,i){var n=i(0);n.EffectComposer=function(t,e){if(this.renderer=t,void 0===e){var i={minFilter:n.LinearFilter,magFilter:n.LinearFilter,format:n.RGBAFormat,stencilBuffer:!1},r=t.getDrawingBufferSize();(e=new n.WebGLRenderTarget(r.width,r.height,i)).texture.name="EffectComposer.rt1"}this.renderTarget1=e,this.renderTarget2=e.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.passes=[],n.CopyShader,n.ShaderPass,this.copyPass=new n.ShaderPass(n.CopyShader)},Object.assign(n.EffectComposer.prototype,{swapBuffers:function(){var t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t},addPass:function(t){this.passes.push(t);var e=this.renderer.getDrawingBufferSize();t.setSize(e.width,e.height)},insertPass:function(t,e){this.passes.splice(e,0,t)},render:function(t){var e,i,r=!1,o=this.passes.length;for(i=0;i<o;i++)if(!1!==(e=this.passes[i]).enabled){if(e.render(this.renderer,this.writeBuffer,this.readBuffer,t,r),e.needsSwap){if(r){var a=this.renderer.context;a.stencilFunc(a.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,t),a.stencilFunc(a.EQUAL,1,4294967295)}this.swapBuffers()}void 0!==n.MaskPass&&(e instanceof n.MaskPass?r=!0:e instanceof n.ClearMaskPass&&(r=!1))}},reset:function(t){if(void 0===t){var e=this.renderer.getDrawingBufferSize();(t=this.renderTarget1.clone()).setSize(e.width,e.height)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=t,this.renderTarget2=t.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2},setSize:function(t,e){this.renderTarget1.setSize(t,e),this.renderTarget2.setSize(t,e);for(var i=0;i<this.passes.length;i++)this.passes[i].setSize(t,e)}}),n.Pass=function(){this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1},Object.assign(n.Pass.prototype,{setSize:function(t,e){},render:function(t,e,i,n,r){}})},function(t,e,i){var n=i(0);n.RenderPass=function(t,e,i,r,o){n.Pass.call(this),this.scene=t,this.camera=e,this.overrideMaterial=i,this.clearColor=r,this.clearAlpha=void 0!==o?o:0,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1},n.RenderPass.prototype=Object.assign(Object.create(n.Pass.prototype),{constructor:n.RenderPass,render:function(t,e,i,n,r){var o,a,s=t.autoClear;t.autoClear=!1,this.scene.overrideMaterial=this.overrideMaterial,this.clearColor&&(o=t.getClearColor().getHex(),a=t.getClearAlpha(),t.setClearColor(this.clearColor,this.clearAlpha)),this.clearDepth&&t.clearDepth(),t.render(this.scene,this.camera,this.renderToScreen?null:i,this.clear),this.clearColor&&t.setClearColor(o,a),this.scene.overrideMaterial=null,t.autoClear=s}})},function(t,e,i){var n=i(0);n.OutlinePass=function(t,e,i,r){this.renderScene=e,this.renderCamera=i,this.selectedObjects=void 0!==r?r:[],this.visibleEdgeColor=new n.Color(1,1,1),this.hiddenEdgeColor=new n.Color(.1,.04,.02),this.edgeGlow=0,this.usePatternTexture=!1,this.edgeThickness=1,this.edgeStrength=3,this.downSampleRatio=2,this.pulsePeriod=0,n.Pass.call(this),this.resolution=void 0!==t?new n.Vector2(t.x,t.y):new n.Vector2(256,256);var o={minFilter:n.LinearFilter,magFilter:n.LinearFilter,format:n.RGBAFormat},a=Math.round(this.resolution.x/this.downSampleRatio),s=Math.round(this.resolution.y/this.downSampleRatio);this.maskBufferMaterial=new n.MeshBasicMaterial({color:16777215}),this.maskBufferMaterial.side=n.DoubleSide,this.renderTargetMaskBuffer=new n.WebGLRenderTarget(this.resolution.x,this.resolution.y,o),this.renderTargetMaskBuffer.texture.name="OutlinePass.mask",this.renderTargetMaskBuffer.texture.generateMipmaps=!1,this.depthMaterial=new n.MeshDepthMaterial,this.depthMaterial.side=n.DoubleSide,this.depthMaterial.depthPacking=n.RGBADepthPacking,this.depthMaterial.blending=n.NoBlending,this.prepareMaskMaterial=this.getPrepareMaskMaterial(),this.prepareMaskMaterial.side=n.DoubleSide,this.prepareMaskMaterial.fragmentShader=function(t,e){var i=e.isPerspectiveCamera?"perspective":"orthographic";return t.replace(/DEPTH_TO_VIEW_Z/g,i+"DepthToViewZ")}(this.prepareMaskMaterial.fragmentShader,this.renderCamera),this.renderTargetDepthBuffer=new n.WebGLRenderTarget(this.resolution.x,this.resolution.y,o),this.renderTargetDepthBuffer.texture.name="OutlinePass.depth",this.renderTargetDepthBuffer.texture.generateMipmaps=!1,this.renderTargetMaskDownSampleBuffer=new n.WebGLRenderTarget(a,s,o),this.renderTargetMaskDownSampleBuffer.texture.name="OutlinePass.depthDownSample",this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps=!1,this.renderTargetBlurBuffer1=new n.WebGLRenderTarget(a,s,o),this.renderTargetBlurBuffer1.texture.name="OutlinePass.blur1",this.renderTargetBlurBuffer1.texture.generateMipmaps=!1,this.renderTargetBlurBuffer2=new n.WebGLRenderTarget(Math.round(a/2),Math.round(s/2),o),this.renderTargetBlurBuffer2.texture.name="OutlinePass.blur2",this.renderTargetBlurBuffer2.texture.generateMipmaps=!1,this.edgeDetectionMaterial=this.getEdgeDetectionMaterial(),this.renderTargetEdgeBuffer1=new n.WebGLRenderTarget(a,s,o),this.renderTargetEdgeBuffer1.texture.name="OutlinePass.edge1",this.renderTargetEdgeBuffer1.texture.generateMipmaps=!1,this.renderTargetEdgeBuffer2=new n.WebGLRenderTarget(Math.round(a/2),Math.round(s/2),o),this.renderTargetEdgeBuffer2.texture.name="OutlinePass.edge2",this.renderTargetEdgeBuffer2.texture.generateMipmaps=!1;this.separableBlurMaterial1=this.getSeperableBlurMaterial(4),this.separableBlurMaterial1.uniforms.texSize.value=new n.Vector2(a,s),this.separableBlurMaterial1.uniforms.kernelRadius.value=1,this.separableBlurMaterial2=this.getSeperableBlurMaterial(4),this.separableBlurMaterial2.uniforms.texSize.value=new n.Vector2(Math.round(a/2),Math.round(s/2)),this.separableBlurMaterial2.uniforms.kernelRadius.value=4,this.overlayMaterial=this.getOverlayMaterial(),n.CopyShader;var l=n.CopyShader;this.copyUniforms=n.UniformsUtils.clone(l.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new n.ShaderMaterial({uniforms:this.copyUniforms,vertexShader:l.vertexShader,fragmentShader:l.fragmentShader,blending:n.NoBlending,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this.oldClearColor=new n.Color,this.oldClearAlpha=1,this.camera=new n.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new n.Scene,this.quad=new n.Mesh(new n.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad),this.tempPulseColor1=new n.Color,this.tempPulseColor2=new n.Color,this.textureMatrix=new n.Matrix4},n.OutlinePass.prototype=Object.assign(Object.create(n.Pass.prototype),{constructor:n.OutlinePass,dispose:function(){this.renderTargetMaskBuffer.dispose(),this.renderTargetDepthBuffer.dispose(),this.renderTargetMaskDownSampleBuffer.dispose(),this.renderTargetBlurBuffer1.dispose(),this.renderTargetBlurBuffer2.dispose(),this.renderTargetEdgeBuffer1.dispose(),this.renderTargetEdgeBuffer2.dispose()},setSize:function(t,e){this.renderTargetMaskBuffer.setSize(t,e);var i=Math.round(t/this.downSampleRatio),r=Math.round(e/this.downSampleRatio);this.renderTargetMaskDownSampleBuffer.setSize(i,r),this.renderTargetBlurBuffer1.setSize(i,r),this.renderTargetEdgeBuffer1.setSize(i,r),this.separableBlurMaterial1.uniforms.texSize.value=new n.Vector2(i,r),i=Math.round(i/2),r=Math.round(r/2),this.renderTargetBlurBuffer2.setSize(i,r),this.renderTargetEdgeBuffer2.setSize(i,r),this.separableBlurMaterial2.uniforms.texSize.value=new n.Vector2(i,r)},changeVisibilityOfSelectedObjects:function(t){function e(e){e.isMesh&&(t?(e.visible=e.userData.oldVisible,delete e.userData.oldVisible):(e.userData.oldVisible=e.visible,e.visible=t))}for(var i=0;i<this.selectedObjects.length;i++){this.selectedObjects[i].traverse(e)}},changeVisibilityOfNonSelectedObjects:function(t){var e=[];function i(t){t.isMesh&&e.push(t)}for(var n=0;n<this.selectedObjects.length;n++){this.selectedObjects[n].traverse(i)}this.renderScene.traverse((function(i){if(i.isMesh||i.isLine||i.isSprite){for(var n=!1,r=0;r<e.length;r++){if(e[r].id===i.id){n=!0;break}}if(!n){var o=i.visible;t&&!i.bVisible||(i.visible=t),i.bVisible=o}}}))},updateTextureMatrix:function(){this.textureMatrix.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),this.textureMatrix.multiply(this.renderCamera.projectionMatrix),this.textureMatrix.multiply(this.renderCamera.matrixWorldInverse)},render:function(t,e,i,r,o){if(this.selectedObjects.length>0){this.oldClearColor.copy(t.getClearColor()),this.oldClearAlpha=t.getClearAlpha();var a=t.autoClear;t.autoClear=!1,o&&t.context.disable(t.context.STENCIL_TEST),t.setClearColor(16777215,1),this.changeVisibilityOfSelectedObjects(!1);var s=this.renderScene.background;if(this.renderScene.background=null,this.renderScene.overrideMaterial=this.depthMaterial,t.render(this.renderScene,this.renderCamera,this.renderTargetDepthBuffer,!0),this.changeVisibilityOfSelectedObjects(!0),this.updateTextureMatrix(),this.changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value=new n.Vector2(this.renderCamera.near,this.renderCamera.far),this.prepareMaskMaterial.uniforms.depthTexture.value=this.renderTargetDepthBuffer.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,t.render(this.renderScene,this.renderCamera,this.renderTargetMaskBuffer,!0),this.renderScene.overrideMaterial=null,this.changeVisibilityOfNonSelectedObjects(!0),this.renderScene.background=s,this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,t.render(this.scene,this.camera,this.renderTargetMaskDownSampleBuffer,!0),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){var l=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(l),this.tempPulseColor2.multiplyScalar(l)}this.quad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value=new n.Vector2(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,t.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=n.OutlinePass.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,t.render(this.scene,this.camera,this.renderTargetBlurBuffer1,!0),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=n.OutlinePass.BlurDirectionY,t.render(this.scene,this.camera,this.renderTargetEdgeBuffer1,!0),this.quad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=n.OutlinePass.BlurDirectionX,t.render(this.scene,this.camera,this.renderTargetBlurBuffer2,!0),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=n.OutlinePass.BlurDirectionY,t.render(this.scene,this.camera,this.renderTargetEdgeBuffer2,!0),this.quad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=this.renderTargetMaskBuffer.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,o&&t.context.enable(t.context.STENCIL_TEST),t.render(this.scene,this.camera,i,!1),t.setClearColor(this.oldClearColor,this.oldClearAlpha),t.autoClear=a}this.renderToScreen&&(this.quad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=i.texture,t.render(this.scene,this.camera))},getPrepareMaskMaterial:function(){return new n.ShaderMaterial({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new n.Vector2(.5,.5)},textureMatrix:{value:new n.Matrix4}},vertexShader:["varying vec4 projTexCoord;","varying vec4 vPosition;","uniform mat4 textureMatrix;","void main() {","\tvPosition = modelViewMatrix * vec4( position, 1.0 );","\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );","\tprojTexCoord = textureMatrix * worldPosition;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["#include <packing>","varying vec4 vPosition;","varying vec4 projTexCoord;","uniform sampler2D depthTexture;","uniform vec2 cameraNearFar;","void main() {","\tfloat depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));","\tfloat viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );","\tfloat depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;","\tgl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);","}"].join("\n")})},getEdgeDetectionMaterial:function(){return new n.ShaderMaterial({uniforms:{maskTexture:{value:null},texSize:{value:new n.Vector2(.5,.5)},visibleEdgeColor:{value:new n.Vector3(1,1,1)},hiddenEdgeColor:{value:new n.Vector3(1,1,1)}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec3 visibleEdgeColor;\t\t\t\tuniform vec3 hiddenEdgeColor;\t\t\t\t\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tvec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\t\t\t\t\tvec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\t\t\t\t\tvec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\t\t\t\t\tvec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\t\t\t\t\tvec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\t\t\t\t\tfloat diff1 = (c1.r - c2.r)*0.5;\t\t\t\t\tfloat diff2 = (c3.r - c4.r)*0.5;\t\t\t\t\tfloat d = length( vec2(diff1, diff2) );\t\t\t\t\tfloat a1 = min(c1.g, c2.g);\t\t\t\t\tfloat a2 = min(c3.g, c4.g);\t\t\t\t\tfloat visibilityFactor = min(a1, a2);\t\t\t\t\tvec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\t\t\t\t\tgl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\t\t\t\t}"})},getSeperableBlurMaterial:function(t){return new n.ShaderMaterial({defines:{MAX_RADIUS:t},uniforms:{colorTexture:{value:null},texSize:{value:new n.Vector2(.5,.5)},direction:{value:new n.Vector2(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include <common>\t\t\t\tvarying vec2 vUv;\t\t\t\tuniform sampler2D colorTexture;\t\t\t\tuniform vec2 texSize;\t\t\t\tuniform vec2 direction;\t\t\t\tuniform float kernelRadius;\t\t\t\t\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\t\t\t\t}\t\t\t\tvoid main() {\t\t\t\t\tvec2 invSize = 1.0 / texSize;\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, kernelRadius);\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\t\t\t\t\tvec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\t\t\t\t\tvec2 uvOffset = delta;\t\t\t\t\tfor( int i = 1; i <= MAX_RADIUS; i ++ ) {\t\t\t\t\t\tfloat w = gaussianPdf(uvOffset.x, kernelRadius);\t\t\t\t\t\tvec3 sample1 = texture2D( colorTexture, vUv + uvOffset).rgb;\t\t\t\t\t\tvec3 sample2 = texture2D( colorTexture, vUv - uvOffset).rgb;\t\t\t\t\t\tdiffuseSum += ((sample1 + sample2) * w);\t\t\t\t\t\tweightSum += (2.0 * w);\t\t\t\t\t\tuvOffset += delta;\t\t\t\t\t}\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, 1.0);\t\t\t\t}"})},getOverlayMaterial:function(){return new n.ShaderMaterial({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\t\t\t\tuniform sampler2D maskTexture;\t\t\t\tuniform sampler2D edgeTexture1;\t\t\t\tuniform sampler2D edgeTexture2;\t\t\t\tuniform sampler2D patternTexture;\t\t\t\tuniform float edgeStrength;\t\t\t\tuniform float edgeGlow;\t\t\t\tuniform bool usePatternTexture;\t\t\t\t\t\t\t\tvoid main() {\t\t\t\t\tvec4 edgeValue1 = texture2D(edgeTexture1, vUv);\t\t\t\t\tvec4 edgeValue2 = texture2D(edgeTexture2, vUv);\t\t\t\t\tvec4 maskColor = texture2D(maskTexture, vUv);\t\t\t\t\tvec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\t\t\t\t\tfloat visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\t\t\t\t\tvec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\t\t\t\t\tvec4 finalColor = edgeStrength * maskColor.r * edgeValue;\t\t\t\t\tif(usePatternTexture)\t\t\t\t\t\tfinalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\t\t\t\t\tgl_FragColor = finalColor;\t\t\t\t}",blending:n.AdditiveBlending,depthTest:!1,depthWrite:!1,transparent:!0})}}),n.OutlinePass.BlurDirectionX=new n.Vector2(1,0),n.OutlinePass.BlurDirectionY=new n.Vector2(0,1)},function(t,e,i){var n=i(0);n.ShaderPass=function(t,e){n.Pass.call(this),this.textureID=void 0!==e?e:"tDiffuse",t instanceof n.ShaderMaterial?(this.uniforms=t.uniforms,this.material=t):t&&(this.uniforms=n.UniformsUtils.clone(t.uniforms),this.material=new n.ShaderMaterial({defines:Object.assign({},t.defines),uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader})),this.camera=new n.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new n.Scene,this.quad=new n.Mesh(new n.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)},n.ShaderPass.prototype=Object.assign(Object.create(n.Pass.prototype),{constructor:n.ShaderPass,render:function(t,e,i,n,r){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=i.texture),this.quad.material=this.material,this.renderToScreen?t.render(this.scene,this.camera):t.render(this.scene,this.camera,e,this.clear)}})},function(t,e,i){var n=i(0);n.MaskPass=function(t,e){n.Pass.call(this),this.scene=t,this.camera=e,this.clear=!0,this.needsSwap=!1,this.inverse=!1},n.MaskPass.prototype=Object.assign(Object.create(n.Pass.prototype),{constructor:n.MaskPass,render:function(t,e,i,n,r){var o,a,s=t.context,l=t.state;l.buffers.color.setMask(!1),l.buffers.depth.setMask(!1),l.buffers.color.setLocked(!0),l.buffers.depth.setLocked(!0),this.inverse?(o=0,a=1):(o=1,a=0),l.buffers.stencil.setTest(!0),l.buffers.stencil.setOp(s.REPLACE,s.REPLACE,s.REPLACE),l.buffers.stencil.setFunc(s.ALWAYS,o,4294967295),l.buffers.stencil.setClear(a),t.render(this.scene,this.camera,i,this.clear),t.render(this.scene,this.camera,e,this.clear),l.buffers.color.setLocked(!1),l.buffers.depth.setLocked(!1),l.buffers.stencil.setFunc(s.EQUAL,1,4294967295),l.buffers.stencil.setOp(s.KEEP,s.KEEP,s.KEEP)}}),n.ClearMaskPass=function(){n.Pass.call(this),this.needsSwap=!1},n.ClearMaskPass.prototype=Object.create(n.Pass.prototype),Object.assign(n.ClearMaskPass.prototype,{render:function(t,e,i,n,r){t.state.buffers.stencil.setTest(!1)}})},function(t,e,i){var n=i(0);n.SMAAPass=function(t,e){n.Pass.call(this),this.edgesRT=new n.WebGLRenderTarget(t,e,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:n.LinearFilter,format:n.RGBFormat}),this.edgesRT.texture.name="SMAAPass.edges",this.weightsRT=new n.WebGLRenderTarget(t,e,{depthBuffer:!1,stencilBuffer:!1,generateMipmaps:!1,minFilter:n.LinearFilter,format:n.RGBAFormat}),this.weightsRT.texture.name="SMAAPass.weights";var i=this,r=new Image;r.src=this.getAreaTexture(),r.onload=function(){i.areaTexture.needsUpdate=!0},this.areaTexture=new n.Texture,this.areaTexture.name="SMAAPass.area",this.areaTexture.image=r,this.areaTexture.format=n.RGBFormat,this.areaTexture.minFilter=n.LinearFilter,this.areaTexture.generateMipmaps=!1,this.areaTexture.flipY=!1;var o=new Image;o.src=this.getSearchTexture(),o.onload=function(){i.searchTexture.needsUpdate=!0},this.searchTexture=new n.Texture,this.searchTexture.name="SMAAPass.search",this.searchTexture.image=o,this.searchTexture.magFilter=n.NearestFilter,this.searchTexture.minFilter=n.NearestFilter,this.searchTexture.generateMipmaps=!1,this.searchTexture.flipY=!1,n.SMAAShader,this.uniformsEdges=n.UniformsUtils.clone(n.SMAAShader[0].uniforms),this.uniformsEdges.resolution.value.set(1/t,1/e),this.materialEdges=new n.ShaderMaterial({defines:Object.assign({},n.SMAAShader[0].defines),uniforms:this.uniformsEdges,vertexShader:n.SMAAShader[0].vertexShader,fragmentShader:n.SMAAShader[0].fragmentShader}),this.uniformsWeights=n.UniformsUtils.clone(n.SMAAShader[1].uniforms),this.uniformsWeights.resolution.value.set(1/t,1/e),this.uniformsWeights.tDiffuse.value=this.edgesRT.texture,this.uniformsWeights.tArea.value=this.areaTexture,this.uniformsWeights.tSearch.value=this.searchTexture,this.materialWeights=new n.ShaderMaterial({defines:Object.assign({},n.SMAAShader[1].defines),uniforms:this.uniformsWeights,vertexShader:n.SMAAShader[1].vertexShader,fragmentShader:n.SMAAShader[1].fragmentShader}),this.uniformsBlend=n.UniformsUtils.clone(n.SMAAShader[2].uniforms),this.uniformsBlend.resolution.value.set(1/t,1/e),this.uniformsBlend.tDiffuse.value=this.weightsRT.texture,this.materialBlend=new n.ShaderMaterial({uniforms:this.uniformsBlend,vertexShader:n.SMAAShader[2].vertexShader,fragmentShader:n.SMAAShader[2].fragmentShader}),this.needsSwap=!1,this.camera=new n.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new n.Scene,this.quad=new n.Mesh(new n.PlaneBufferGeometry(2,2),null),this.quad.frustumCulled=!1,this.scene.add(this.quad)},n.SMAAPass.prototype=Object.assign(Object.create(n.Pass.prototype),{constructor:n.SMAAPass,render:function(t,e,i,n,r){this.uniformsEdges.tDiffuse.value=i.texture,this.quad.material=this.materialEdges,t.render(this.scene,this.camera,this.edgesRT,this.clear),this.quad.material=this.materialWeights,t.render(this.scene,this.camera,this.weightsRT,this.clear),this.uniformsBlend.tColor.value=i.texture,this.quad.material=this.materialBlend,this.renderToScreen?t.render(this.scene,this.camera):t.render(this.scene,this.camera,e,this.clear)},setSize:function(t,e){this.edgesRT.setSize(t,e),this.weightsRT.setSize(t,e),this.materialEdges.uniforms.resolution.value.set(1/t,1/e),this.materialWeights.uniforms.resolution.value.set(1/t,1/e),this.materialBlend.uniforms.resolution.value.set(1/t,1/e)},getAreaTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAIwCAIAAACOVPcQAACBeklEQVR42u39W4xlWXrnh/3WWvuciIzMrKxrV8/0rWbY0+SQFKcb4owIkSIFCjY9AC1BT/LYBozRi+EX+cV+8IMsYAaCwRcBwjzMiw2jAWtgwC8WR5Q8mDFHZLNHTarZGrLJJllt1W2qKrsumZWZcTvn7L3W54e1vrXX3vuciLPPORFR1XE2EomorB0nVuz//r71re/y/1eMvb4Cb3N11xV/PP/2v4UBAwJG/7H8urx6/25/Gf8O5hypMQ0EEEQwAqLfoN/Z+97f/SW+/NvcgQk4sGBJK6H7N4PFVL+K+e0N11yNfkKvwUdwdlUAXPHHL38oa15f/i/46Ih6SuMSPmLAYAwyRKn7dfMGH97jaMFBYCJUgotIC2YAdu+LyW9vvubxAP8kAL8H/koAuOKP3+q6+xGnd5kdYCeECnGIJViwGJMAkQKfDvB3WZxjLKGh8VSCCzhwEWBpMc5/kBbjawT4HnwJfhr+pPBIu7uu+OOTo9vsmtQcniMBGkKFd4jDWMSCRUpLjJYNJkM+IRzQ+PQvIeAMTrBS2LEiaiR9b/5PuT6Ap/AcfAFO4Y3dA3DFH7/VS+M8k4baEAQfMI4QfbVDDGIRg7GKaIY52qAjTAgTvGBAPGIIghOCYAUrGFNgzA7Q3QhgCwfwAnwe5vDejgG44o/fbm1C5ZlYQvQDARPAIQGxCWBM+wWl37ZQESb4gImexGMDouhGLx1Cst0Saa4b4AqO4Hk4gxo+3DHAV/nx27p3JziPM2pVgoiia5MdEzCGULprIN7gEEeQ5IQxEBBBQnxhsDb5auGmAAYcHMA9eAAz8PBol8/xij9+C4Djlim4gJjWcwZBhCBgMIIYxGAVIkH3ZtcBuLdtRFMWsPGoY9rN+HoBji9VBYdwD2ZQg4cnO7OSq/z4rU5KKdwVbFAjNojCQzTlCLPFSxtamwh2jMUcEgg2Wm/6XgErIBhBckQtGN3CzbVacERgCnfgLswhnvqf7QyAq/z4rRZm1YglYE3affGITaZsdIe2FmMIpnOCap25I6jt2kCwCW0D1uAD9sZctNGXcQIHCkINDQgc78aCr+zjtw3BU/ijdpw3zhCwcaONwBvdeS2YZKkJNJsMPf2JKEvC28RXxxI0ASJyzQCjCEQrO4Q7sFArEzjZhaFc4cdv+/JFdKULM4px0DfUBI2hIsy06BqLhGTQEVdbfAIZXYMPesq6VoCHICzUyjwInO4Y411//LYLs6TDa9wvg2CC2rElgAnpTBziThxaL22MYhzfkghz6GAs2VHbbdM91VZu1MEEpupMMwKyVTb5ij9+u4VJG/5EgEMMmFF01cFai3isRbKbzb+YaU/MQbAm2XSMoUPAmvZzbuKYRIFApbtlrfFuUGd6vq2hXNnH78ZLh/iFhsQG3T4D1ib7k5CC6vY0DCbtrohgLEIClXiGtl10zc0CnEGIhhatLBva7NP58Tvw0qE8yWhARLQ8h4+AhQSP+I4F5xoU+VilGRJs6wnS7ruti/4KvAY/CfdgqjsMy4pf8fodQO8/gnuX3f/3xi3om1/h7THr+co3x93PP9+FBUfbNUjcjEmhcrkT+8K7ml7V10Jo05mpIEFy1NmCJWx9SIKKt+EjAL4Ez8EBVOB6havuT/rByPvHXK+9zUcfcbb254+9fydJknYnRr1oGfdaiAgpxu1Rx/Rek8KISftx3L+DfsLWAANn8Hvw0/AFeAGO9DFV3c6D+CcWbL8Dj9e7f+T1k8AZv/d7+PXWM/Z+VvdCrIvuAKO09RpEEQJM0Ci6+B4xhTWr4cZNOvhktabw0ta0rSJmqz3Yw5/AKXwenod7cAhTmBSPKf6JBdvH8IP17h95pXqw50/+BFnj88fev4NchyaK47OPhhtI8RFSvAfDSNh0Ck0p2gLxGkib5NJj/JWCr90EWQJvwBzO4AHcgztwAFN1evHPUVGwfXON+0debT1YeGON9Yy9/63X+OguiwmhIhQhD7l4sMqlG3D86Suc3qWZ4rWjI1X7u0Ytw6x3rIMeIOPDprfe2XzNgyj6PahhBjO4C3e6puDgXrdg+/5l948vF3bqwZetZ+z9Rx9zdIY5pInPK4Nk0t+l52xdK2B45Qd87nM8fsD5EfUhIcJcERw4RdqqH7Yde5V7m1vhNmtedkz6EDzUMF/2jJYWbC+4fzzA/Y+/8PPH3j9dcBAPIRP8JLXd5BpAu03aziOL3VVHZzz3CXWDPWd+SH2AnxIqQoTZpo9Ckc6HIrFbAbzNmlcg8Ag8NFDDAhbJvTBZXbC94P7t68EXfv6o+21gUtPETU7bbkLxvNKRFG2+KXzvtObonPP4rBvsgmaKj404DlshFole1Glfh02fE7bYR7dZ82oTewIBGn1Md6CG6YUF26X376oevOLzx95vhUmgblI6LBZwTCDY7vMq0op5WVXgsObOXJ+1x3qaBl9j1FeLxbhU9w1F+Wiba6s1X/TBz1LnUfuYDi4r2C69f1f14BWfP+p+W2GFKuC9phcELMYRRLur9DEZTUdEH+iEqWdaM7X4WOoPGI+ZYD2+wcQ+y+ioHUZ9dTDbArzxmi/bJI9BND0Ynd6lBdve/butBw8+f/T9D3ABa3AG8W3VPX4hBin+bj8dMMmSpp5pg7fJ6xrBFE2WQQEWnV8Qg3FbAWzYfM1rREEnmvkN2o1+acG2d/9u68GDzx91v3mAjb1zkpqT21OipPKO0b9TO5W0nTdOmAQm0TObts3aBKgwARtoPDiCT0gHgwnbArzxmtcLc08HgF1asN0C4Ms/fvD5I+7PhfqyXE/b7RbbrGyRQRT9ARZcwAUmgdoz0ehJ9Fn7QAhUjhDAQSw0bV3T3WbNa59jzmiP6GsWbGXDX2ytjy8+f9T97fiBPq9YeLdBmyuizZHaqXITnXiMUEEVcJ7K4j3BFPurtB4bixW8wTpweL8DC95szWMOqucFYGsWbGU7p3TxxxefP+r+oTVktxY0v5hbq3KiOKYnY8ddJVSBxuMMVffNbxwIOERShst73HZ78DZrHpmJmH3K6sGz0fe3UUj0eyRrSCGTTc+rjVNoGzNSv05srAxUBh8IhqChiQgVNIIBH3AVPnrsnXQZbLTm8ammv8eVXn/vWpaTem5IXRlt+U/LA21zhSb9cye6jcOfCnOwhIAYXAMVTUNV0QhVha9xjgA27ODJbLbmitt3tRN80lqG6N/khgot4ZVlOyO4WNg3OIMzhIZQpUEHieg2im6F91hB3I2tubql6BYNN9Hj5S7G0G2tahslBWKDnOiIvuAEDzakDQKDNFQT6gbn8E2y4BBubM230YIpBnDbMa+y3dx0n1S0BtuG62lCCXwcY0F72T1VRR3t2ONcsmDjbmzNt9RFs2LO2hQNyb022JisaI8rAWuw4HI3FuAIhZdOGIcdjLJvvObqlpqvWTJnnQbyi/1M9O8UxWhBs//H42I0q1Yb/XPGONzcmm+ri172mHKvZBpHkJaNJz6v9jxqiklDj3U4CA2ugpAaYMWqNXsdXbmJNd9egCnJEsphXNM+MnK3m0FCJ5S1kmJpa3DgPVbnQnPGWIDspW9ozbcO4K/9LkfaQO2KHuqlfFXSbdNzcEcwoqNEFE9zcIXu9/6n/ym/BC/C3aJLzEKPuYVlbFnfhZ8kcWxV3dbv4bKl28566wD+8C53aw49lTABp9PWbsB+knfc/Li3eVizf5vv/xmvnPKg5ihwKEwlrcHqucuVcVOxEv8aH37E3ZqpZypUulrHEtIWKUr+txHg+ojZDGlwnqmkGlzcVi1dLiNSJiHjfbRNOPwKpx9TVdTn3K05DBx4psIk4Ei8aCkJahRgffk4YnEXe07T4H2RR1u27E6wfQsBDofUgjFUFnwC2AiVtA+05J2zpiDK2Oa0c5fmAecN1iJzmpqFZxqYBCYhFTCsUNEmUnIcZ6aEA5rQVhEywG6w7HSW02XfOoBlQmjwulOFQAg66SvJblrTEX1YtJ3uG15T/BH1OfOQeuR8g/c0gdpT5fx2SKbs9EfHTKdM8A1GaJRHLVIwhcGyydZsbifAFVKl5EMKNU2Hryo+06BeTgqnxzYjThVySDikbtJPieco75lYfKAJOMEZBTjoITuWHXXZVhcUDIS2hpiXHV9Ku4u44bN5OYLDOkJo8w+xJSMbhBRHEdEs9JZUCkQrPMAvaHyLkxgkEHxiNkx/x2YB0mGsQ8EUWj/stW5YLhtS5SMu+/YBbNPDCkGTUybN8krRLBGPlZkVOA0j+a1+rkyQKWGaPHPLZOkJhioQYnVZ2hS3zVxMtgC46KuRwbJNd9nV2PHgb36F194ecf/Yeu2vAFe5nm/bRBFrnY4BauE8ERmZRFUn0k8hbftiVYSKMEme2dJCJSCGYAlNqh87bXOPdUkGy24P6d1ll21MBqqx48Fvv8ZHH8HZFY7j/uAq1xMJUFqCSUlJPmNbIiNsmwuMs/q9CMtsZsFO6SprzCS1Z7QL8xCQClEelpjTduDMsmWD8S1PT152BtvmIGvUeDA/yRn83u/x0/4qxoPHjx+PXY9pqX9bgMvh/Nz9kpP4pOe1/fYf3axUiMdHLlPpZCNjgtNFAhcHEDxTumNONhHrBduW+vOyY++70WWnPXj98eA4kOt/mj/5E05l9+O4o8ePx67HFqyC+qSSnyselqjZGaVK2TadbFLPWAQ4NBhHqDCCV7OTpo34AlSSylPtIdd2AJZlyzYQrDJ5lcWGNceD80CunPLGGzsfD+7wRb95NevJI5docQ3tgCyr5bGnyaPRlmwNsFELViOOx9loebGNq2moDOKpHLVP5al2cymWHbkfzGXL7kfRl44H9wZy33tvt+PB/Xnf93e+nh5ZlU18wCiRUa9m7kib9LYuOk+hudQNbxwm0AQqbfloimaB2lM5fChex+ylMwuTbfmXQtmWlenZljbdXTLuOxjI/fDDHY4Hjx8/Hrse0zXfPFxbUN1kKqSCCSk50m0Ajtx3ub9XHBKHXESb8iO6E+qGytF4nO0OG3SXzbJlhxBnKtKyl0NwybjvYCD30aMdjgePHz8eu56SVTBbgxJMliQ3Oauwg0QHxXE2Ez/EIReLdQj42Gzb4CLS0YJD9xUx7bsi0vJi5mUbW1QzL0h0PFk17rtiIPfJk52MB48fPx67npJJwyrBa2RCCQRTbGZSPCxTPOiND4G2pYyOQ4h4jINIJh5wFU1NFZt+IsZ59LSnDqBjZ2awbOku+yInunLcd8VA7rNnOxkPHj9+PGY9B0MWJJNozOJmlglvDMXDEozdhQWbgs/U6oBanGzLrdSNNnZFjOkmbi5bNt1lX7JLLhn3vXAg9/h4y/Hg8ePHI9dzQMEkWCgdRfYykYKnkP7D4rIujsujaKPBsB54vE2TS00ccvFY/Tth7JXeq1hz+qgVy04sAJawTsvOknHfCwdyT062HA8eP348Zj0vdoXF4pilKa2BROed+9fyw9rWRXeTFXESMOanvDZfJuJaSXouQdMdDJZtekZcLLvEeK04d8m474UDuaenW44Hjx8/Xns9YYqZpszGWB3AN/4VHw+k7WSFtJ3Qicuqb/NlVmgXWsxh570xg2UwxUw3WfO6B5nOuO8aA7lnZxuPB48fPx6znm1i4bsfcbaptF3zNT78eFPtwi1OaCNOqp1x3zUGcs/PN++AGD1+fMXrSVm2baTtPhPahbPhA71wIHd2bXzRa69nG+3CraTtPivahV/55tXWg8fyRY/9AdsY8VbSdp8V7cKrrgdfM//z6ILQFtJ2nxHtwmuoB4/kf74+gLeRtvvMaBdeSz34+vifx0YG20jbfTa0C6+tHrwe//NmOG0L8EbSdp8R7cLrrQe/996O+ai3ujQOskpTNULa7jOjXXj99eCd8lHvoFiwsbTdZ0a78PrrwTvlo966pLuRtB2fFe3Cm6oHP9kNH/W2FryxtN1nTLvwRurBO+Kj3pWXHidtx2dFu/Bm68Fb81HvykuPlrb7LGkX3mw9eGs+6h1Y8MbSdjegXcguQLjmevDpTQLMxtJ2N6NdyBZu9AbrwVvwUW+LbteULUpCdqm0HTelXbhNPe8G68Gb8lFvVfYfSNuxvrTdTWoXbozAzdaDZzfkorOj1oxVxlIMlpSIlpLrt8D4hrQL17z+c3h6hU/wv4Q/utps4+bm+6P/hIcf0JwQ5oQGPBL0eKPTYEXTW+eL/2DKn73J9BTXYANG57hz1cEMviVf/4tf5b/6C5pTQkMIWoAq7hTpOJjtAM4pxKu5vg5vXeUrtI09/Mo/5H+4z+Mp5xULh7cEm2QbRP2tFIKR7WM3fPf/jZ3SWCqLM2l4NxID5zB72HQXv3jj/8mLR5xXNA5v8EbFQEz7PpRfl1+MB/hlAN65qgDn3wTgH13hK7T59bmP+NIx1SHHU84nLOITt3iVz8mNO+lPrjGAnBFqmioNn1mTyk1ta47R6d4MrX7tjrnjYUpdUbv2rVr6YpVfsGG58AG8Ah9eyUN8CX4WfgV+G8LVWPDGb+Zd4cU584CtqSbMKxauxTg+dyn/LkVgA+IR8KHtejeFKRtTmLLpxN6mYVLjYxwXf5x2VofiZcp/lwKk4wGOpYDnoIZPdg/AAbwMfx0+ge9dgZvYjuqKe4HnGnykYo5TvJbG0Vj12JagRhwKa44H95ShkZa5RyLGGdfYvG7aw1TsF6iapPAS29mNS3NmsTQZCmgTzFwgL3upCTgtBTRwvGMAKrgLn4evwin8+afJRcff+8izUGUM63GOOuAs3tJkw7J4kyoNreqrpO6cYLQeFUd7TTpr5YOTLc9RUUogUOVJQ1GYJaFLAW0oTmKyYS46ZooP4S4EON3xQ5zC8/CX4CnM4c1PE8ApexpoYuzqlP3d4S3OJP8ZDK7cKWNaTlqmgDiiHwl1YsE41w1zT4iRTm3DBqxvOUsbMKKDa/EHxagtnta072ejc3DOIh5ojvh8l3tk1JF/AV6FU6jh3U8HwEazLgdCLYSQ+MYiAI2ltomkzttUb0gGHdSUUgsIYjTzLG3mObX4FBRaYtpDVNZrih9TgTeYOBxsEnN1gOCTM8Bsw/ieMc75w9kuAT6A+/AiHGvN/+Gn4KRkiuzpNNDYhDGFndWRpE6SVfm8U5bxnSgVV2jrg6JCKmneqey8VMFgq2+AM/i4L4RUbfSi27lNXZ7R7W9RTcq/q9fk4Xw3AMQd4I5ifAZz8FcVtm9SAom/dyN4lczJQW/kC42ZrHgcCoIf1oVMKkVItmMBi9cOeNHGLqOZk+QqQmrbc5YmYgxELUUN35z2iohstgfLIFmcMV7s4CFmI74L9+EFmGsi+tGnAOD4Yk9gIpo01Y4cA43BWGygMdr4YZekG3OBIUXXNukvJS8tqa06e+lSDCtnqqMFu6hWHXCF+WaYt64m9QBmNxi7Ioy7D+fa1yHw+FMAcPt7SysFLtoG4PXAk7JOA3aAxBRqUiAdU9Yp5lK3HLSRFtOim0sa8euEt08xvKjYjzeJ2GU7YawexrnKI9tmobInjFXCewpwriY9+RR4aaezFhMhGCppKwom0ChrgFlKzyPKkGlTW1YQrE9HJqu8hKGgMc6hVi5QRq0PZxNfrYNgE64utmRv6KKHRpxf6VDUaOvNP5jCEx5q185My/7RKz69UQu2im5k4/eownpxZxNLwiZ1AZTO2ZjWjkU9uaB2HFn6Q3u0JcsSx/qV9hTEApRzeBLDJQXxYmTnq7bdLa3+uqFrxLJ5w1TehnNHx5ECvCh2g2c3hHH5YsfdaSKddztfjQ6imKFGSyFwlLzxEGPp6r5IevVjk1AMx3wMqi1NxDVjLBiPs9tbsCkIY5we5/ML22zrCScFxnNtzsr9Wcc3CnD+pYO+4VXXiDE0oc/vQQ/fDK3oPESJMYXNmJa/DuloJZkcTpcYE8lIH8Dz8DJMiynNC86Mb2lNaaqP/+L7f2fcE/yP7/Lde8xfgSOdMxvOixZf/9p3+M4hT1+F+zApxg9XfUvYjc8qX2lfOOpK2gNRtB4flpFu9FTKCp2XJRgXnX6olp1zyYjTKJSkGmLE2NjUr1bxFM4AeAAHBUFIeSLqXR+NvH/M9fOnfHzOD2vCSyQJKzfgsCh+yi/Mmc35F2fUrw7miW33W9hBD1vpuUojFphIyvg7aTeoymDkIkeW3XLHmguMzbIAJejN6B5MDrhipE2y6SoFRO/AK/AcHHZHNIfiWrEe/C6cr3f/yOvrQKB+zMM55/GQdLDsR+ifr5Fiuu+/y+M78LzOE5dsNuXC3PYvYWd8NXvphLSkJIasrlD2/HOqQ+RjcRdjKTGWYhhVUm4yxlyiGPuMsZR7sMCHUBeTuNWA7if+ifXgc/hovftHXs/DV+Fvwe+f8shzMiMcweFgBly3//vwJfg5AN4450fn1Hd1Rm1aBLu22Dy3y3H2+OqMemkbGZ4jozcDjJf6596xOLpC0eMTHbKnxLxH27uZ/bMTGs2jOaMOY4m87CfQwF0dw53oa1k80JRuz/XgS+8fX3N9Af4qPIMfzKgCp4H5TDGe9GGeFPzSsZz80SlPTxXjgwJmC45njzgt2vbQ4b4OAdUK4/vWhO8d8v6EE8fMUsfakXbPpFJeLs2ubM/qdm/la3WP91uWhxXHjoWhyRUq2iJ/+5mA73zwIIo+LoZ/SgvIRjAd1IMvvn98PfgOvAJfhhm8scAKVWDuaRaK8aQ9f7vuPDH6Bj47ZXau7rqYJ66mTDwEDU6lLbCjCK0qTXyl5mnDoeNRxanj3FJbaksTk0faXxHxLrssgPkWB9LnA/MFleXcJozzjwsUvUG0X/QCve51qkMDXp9mtcyOy3rwBfdvVJK7D6/ACSzg3RoruIq5UDeESfEmVclDxnniU82vxMLtceD0hGZWzBNPMM/jSPne2OVatiTKUpY5vY7gc0LdUAWeWM5tH+O2I66AOWw9xT2BuyRVLGdoDHUsVRXOo/c+ZdRXvFfnxWyIV4upFLCl9eAL7h8Zv0QH8Ry8pA2cHzQpGesctVA37ZtklBTgHjyvdSeKY/RZw/kJMk0Y25cSNRWSigQtlULPTw+kzuJPeYEkXjQRpoGZobYsLF79pyd1dMRHInbgFTZqNLhDqiIsTNpoex2WLcy0/X6rHcdMMQvFSd5dWA++4P7xv89deACnmr36uGlL69bRCL6BSZsS6c0TU2TKK5gtWCzgAOOwQcurqk9j8whvziZSMLcq5hbuwBEsYjopUBkqw1yYBGpLA97SRElEmx5MCInBY5vgLk94iKqSWmhIGmkJ4Bi9m4L645J68LyY4wsFYBfUg5feP/6gWWm58IEmKQM89hq7KsZNaKtP5TxxrUZZVkNmMJtjbKrGxLNEbHPJxhqy7lAmbC32ZqeF6lTaknRWcYaFpfLUBh/rwaQycCCJmW15Kstv6jRHyJFry2C1ahkkIW0LO75s61+owxK1y3XqweX9m5YLM2DPFeOjn/iiqCKJ+yKXF8t5Yl/kNsqaSCryxPq5xWTFIaP8KSW0RYxqupaUf0RcTNSSdJZGcKYdYA6kdtrtmyBckfKXwqk0pHpUHlwWaffjNRBYFPUDWa8e3Lt/o0R0CdisKDM89cX0pvRHEfM8ca4t0s2Xx4kgo91MPQJ/0c9MQYq0co8MBh7bz1fio0UUHLR4aAIOvOmoYO6kwlEVODSSTliWtOtH6sPkrtctF9ZtJ9GIerBskvhdVS5cFNv9s1BU0AbdUgdK4FG+dRnjFmDTzniRMdZO1QhzMK355vigbdkpz9P6qjUGE5J2qAcXmwJ20cZUiAD0z+pGMx6xkzJkmEf40Hr4qZfVg2XzF9YOyoV5BjzVkUJngKf8lgNYwKECEHrCNDrWZzMlflS3yBhr/InyoUgBc/lKT4pxVrrC6g1YwcceK3BmNxZcAtz3j5EIpqguh9H6wc011YN75cKDLpFDxuwkrPQmUwW4KTbj9mZTwBwLq4aQMUZbHm1rylJ46dzR0dua2n3RYCWZsiHROeywyJGR7mXKlpryyCiouY56sFkBWEnkEB/raeh/Sw4162KeuAxMQpEkzy5alMY5wamMsWKKrtW2WpEWNnReZWONKWjrdsKZarpFjqCslq773PLmEhM448Pc3+FKr1+94vv/rfw4tEcu+lKTBe4kZSdijBrykwv9vbCMPcLQTygBjzVckSLPRVGslqdunwJ4oegtFOYb4SwxNgWLCmD7T9kVjTv5YDgpo0XBmN34Z/rEHp0sgyz7lngsrm4lvMm2Mr1zNOJYJ5cuxuQxwMGJq/TP5emlb8fsQBZviK4t8hFL+zbhtlpwaRSxQRWfeETjuauPsdGxsBVdO7nmP4xvzSoT29pRl7kGqz+k26B3Oy0YNV+SXbbQas1ctC/GarskRdFpKczVAF1ZXnLcpaMuzVe6lZ2g/1ndcvOVgRG3sdUAY1bKD6achijMPdMxV4muKVorSpiDHituH7rSTs7n/4y5DhRXo4FVBN4vO/zbAcxhENzGbHCzU/98Mcx5e7a31kWjw9FCe/zNeYyQjZsWb1uc7U33pN4Mji6hCLhivqfa9Ss6xLg031AgfesA/l99m9fgvnaF9JoE6bYKmkGNK3aPbHB96w3+DnxFm4hs0drLsk7U8kf/N/CvwQNtllna0rjq61sH8L80HAuvwH1tvBy2ChqWSCaYTaGN19sTvlfzFD6n+iKTbvtayfrfe9ueWh6GJFoxLdr7V72a5ZpvHcCPDzma0wTO4EgbLyedxstO81n57LYBOBzyfsOhUKsW1J1BB5vr/tz8RyqOFylQP9Tvst2JALsC5lsH8PyQ40DV4ANzYa4dedNiKNR1s+x2wwbR7q4/4cTxqEk4LWDebfisuo36JXLiWFjOtLrlNWh3K1rRS4xvHcDNlFnNmWBBAl5SWaL3oPOfnvbr5pdjVnEaeBJSYjuLEkyLLsWhKccadmOphZkOPgVdalj2QpSmfOsADhMWE2ZBu4+EEJI4wKTAuCoC4xwQbWXBltpxbjkXJtKxxabo9e7tyhlgb6gNlSbUpMh+l/FaqzVwewGu8BW1Zx7pTpQDJUjb8tsUTW6+GDXbMn3mLbXlXJiGdggxFAoUrtPS3wE4Nk02UZG2OOzlk7fRs7i95QCLo3E0jtrjnM7SR3uS1p4qtS2nJ5OwtQVHgOvArLBFijZUV9QtSl8dAY5d0E0hM0w3HS2DpIeB6m/A1+HfhJcGUq4sOxH+x3f5+VO+Ds9rYNI7zPXOYWPrtf8bYMx6fuOAX5jzNR0PdsuON+X1f7EERxMJJoU6GkTEWBvVolVlb5lh3tKCg6Wx1IbaMDdJ+9sUCc5KC46hKGCk3IVOS4TCqdBNfUs7Kd4iXf2RjnT/LLysJy3XDcHLh/vde3x8DoGvwgsa67vBk91G5Pe/HbOe7xwym0NXbtiuuDkGO2IJDh9oQvJ4cY4vdoqLDuoH9Zl2F/ofsekn8lkuhIlhQcffUtSjytFyp++p6NiE7Rqx/lodgKVoceEp/CP4FfjrquZaTtj2AvH5K/ywpn7M34K/SsoYDAdIN448I1/0/wveW289T1/lX5xBzc8N5IaHr0XMOQdHsIkDuJFifj20pBm5jzwUv9e2FhwRsvhAbalCIuIw3bhJihY3p6nTFFIZgiSYjfTf3aXuOjmeGn4bPoGvwl+CFzTRczBIuHBEeImHc37/lGfwZR0cXzVDOvaKfNHvwe+suZ771K/y/XcBlsoN996JpBhoE2toYxOznNEOS5TJc6Id5GEXLjrWo+LEWGNpPDU4WAwsIRROu+1vM+0oW37z/MBN9kqHnSArwPfgFJ7Cq/Ai3Ie7g7ncmI09v8sjzw9mzOAEXoIHxURueaAce5V80f/DOuuZwHM8vsMb5wBzOFWM7wymTXPAEvm4vcFpZ2ut0VZRjkiP2MlmLd6DIpbGSiHOjdnUHN90hRYmhTnmvhzp1iKDNj+b7t5hi79lWGwQ+HN9RsfFMy0FXbEwhfuczKgCbyxYwBmcFhhvo/7a44v+i3XWcwDP86PzpGQYdWh7csP5dBvZ1jNzdxC8pBGuxqSW5vw40nBpj5JhMwvOzN0RWqERHMr4Lv1kWX84xLR830G3j6yqZ1a8UstTlW+qJPOZ+sZ7xZPKTJLhiNOAFd6tk+jrTH31ncLOxid8+nzRb128HhUcru/y0Wn6iT254YPC6FtVSIMoW2sk727AhvTtrWKZTvgsmckfXYZWeNRXx/3YQ2OUxLDrbHtN11IwrgXT6c8dATDwLniYwxzO4RzuQqTKSC5gAofMZ1QBK3zQ4JWobFbcvJm87FK+6JXrKahLn54m3p+McXzzYtP8VF/QpJuh1OwieElEoI1pRxPS09FBrkq2tWCU59+HdhNtTIqKm8EBrw2RTOEDpG3IKo2Y7mFdLm3ZeVjYwVw11o/oznceMve4CgMfNym/utA/d/ILMR7gpXzRy9eDsgLcgbs8O2Va1L0zzIdwGGemTBuwROHeoMShkUc7P+ISY3KH5ZZeWqO8mFTxQYeXTNuzvvK5FGPdQfuu00DwYFY9dyhctEt+OJDdnucfpmyhzUJzfsJjr29l8S0bXBfwRS9ZT26tmMIdZucch5ZboMz3Nio3nIOsYHCGoDT4kUA9MiXEp9Xsui1S8th/kbWIrMBxDGLodWUQIWcvnXy+9M23xPiSMOiRPqM+YMXkUN3gXFrZJwXGzUaMpJfyRS9ZT0lPe8TpScuRlbMHeUmlaKDoNuy62iWNTWNFYjoxFzuJs8oR+RhRx7O4SVNSXpa0ZJQ0K1LAHDQ+D9IepkMXpcsq5EVCvClBUIzDhDoyKwDw1Lc59GbTeORivugw1IcuaEOaGWdNm+Ps5fQ7/tm0DjMegq3yM3vb5j12qUId5UZD2oxDSEWOZMSqFl/W+5oynWDa/aI04tJRQ2eTXusg86SQVu/nwSYwpW6wLjlqIzwLuxGIvoAvul0PS+ZNz0/akp/pniO/8JDnGyaCkzbhl6YcqmK/69prxPqtpx2+Km9al9sjL+rwMgHw4jE/C8/HQ3m1vBuL1fldbzd8mOueVJ92syqdEY4KJjSCde3mcRw2TA6szxedn+zwhZMps0XrqEsiUjnC1hw0TELC2Ek7uAAdzcheXv1BYLagspxpzSAoZZUsIzIq35MnFQ9DOrlNB30jq3L4pkhccKUAA8/ocvN1Rzx9QyOtERs4CVsJRK/DF71kPYrxYsGsm6RMh4cps5g1DOmM54Ly1ii0Hd3Y/BMk8VWFgBVmhqrkJCPBHAolwZaWzLR9Vb7bcWdX9NyUYE+uB2BKfuaeBUcjDljbYVY4DdtsVWvzRZdWnyUzDpjNl1Du3aloAjVJTNDpcIOVVhrHFF66lLfJL1zJr9PQ2nFJSBaKoDe+sAvLufZVHVzYh7W0h/c6AAZ+7Tvj6q9j68G/cTCS/3n1vLKHZwNi+P+pS0WkZNMBMUl+LDLuiE4omZy71r3UFMwNJV+VJ/GC5ixVUkBStsT4gGKh0Gm4Oy3qvq7Lbmq24nPdDuDR9deR11XzP4vFu3TYzfnIyiSVmgizUYGqkIXNdKTY9pgb9D2Ix5t0+NHkVzCdU03suWkkVZAoCONCn0T35gAeW38de43mf97sMOpSvj4aa1KYUm58USI7Wxxes03bAZdRzk6UtbzMaCQ6IxO0dy7X+XsjoD16hpsBeGz9dfzHj+R/Hp8nCxZRqkEDTaCKCSywjiaoMJ1TITE9eg7Jqnq8HL6gDwiZb0u0V0Rr/rmvqjxKuaLCX7ZWXTvAY+uvm3z8CP7nzVpngqrJpZKwWnCUjIviYVlirlGOzPLI3SMVyp/elvBUjjDkNhrtufFFErQ8pmdSlbK16toBHlt/HV8uHMX/vEGALkV3RJREiSlopxwdMXOZPLZ+ix+kAHpMKIk8UtE1ygtquttwxNhphrIZ1IBzjGF3IIGxGcBj6q8bHJBG8T9vdsoWrTFEuebEZuVxhhClH6P5Zo89OG9fwHNjtNQTpD0TG9PJLEYqvEY6Rlxy+ZZGfL0Aj62/bnQCXp//eeM4KzfQVJbgMQbUjlMFIm6TpcfWlZje7NBSV6IsEVmumWIbjiloUzQX9OzYdo8L1wjw2PrrpimONfmfNyzKklrgnEkSzT5QWYQW40YShyzqsRmMXbvVxKtGuYyMKaU1ugenLDm5Ily4iT14fP11Mx+xJv+zZ3MvnfdFqxU3a1W/FTB4m3Qfsyc1XUcdVhDeUDZXSFHHLQj/Y5jtC7ZqM0CXGwB4bP11i3LhOvzPGygYtiUBiwQV/4wFO0majijGsafHyRLu0yG6q35cL1rOpVxr2s5cM2jJYMCdc10Aj6q/blRpWJ//+dmm5psMl0KA2+AFRx9jMe2WbC4jQxnikd4DU8TwUjRVacgdlhmr3bpddzuJ9zXqr2xnxJfzP29RexdtjDVZqzkqa6PyvcojGrfkXiJ8SEtml/nYskicv0ivlxbqjemwUjMw5evdg8fUX9nOiC/lf94Q2i7MURk9nW1MSj5j8eAyV6y5CN2S6qbnw3vdA1Iwq+XOSCl663udN3IzLnrt+us25cI1+Z83SXQUldqQq0b5XOT17bGpLd6ssN1VMPf8c+jG8L3NeCnMdF+Ra3fRa9dft39/LuZ/3vwHoHrqGmQFafmiQw6eyzMxS05K4bL9uA+SKUQzCnSDkqOGokXyJvbgJ/BHI+qvY69//4rl20NsmK2ou2dTsyIALv/91/8n3P2Aao71WFGi8KKv1fRC5+J67Q/507/E/SOshqN5TsmYIjVt+kcjAx98iz/4SaojbIV1rexE7/C29HcYD/DX4a0rBOF5VTu7omsb11L/AWcVlcVZHSsqGuXLLp9ha8I//w3Mv+T4Ew7nTBsmgapoCrNFObIcN4pf/Ob/mrvHTGqqgAupL8qWjWPS9m/31jAe4DjA+4+uCoQoT/zOzlrNd3qd4SdphFxsUvYwGWbTWtISc3wNOWH+kHBMfc6kpmpwPgHWwqaSUG2ZWWheYOGQGaHB+eQ/kn6b3pOgLV+ODSn94wDvr8Bvb70/LLuiPPEr8OGVWfDmr45PZyccEmsVXZGe1pRNX9SU5+AVQkNTIVPCHF/jGmyDC9j4R9LfWcQvfiETmgMMUCMN1uNCakkweZsowdYobiMSlnKA93u7NzTXlSfe+SVbfnPQXmg9LpYAQxpwEtONyEyaueWM4FPjjyjG3uOaFmBTWDNgBXGEiQpsaWhnAqIijB07Dlsy3fUGeP989xbWkyf+FF2SNEtT1E0f4DYYVlxFlbaSMPIRMk/3iMU5pME2SIWJvjckciebkQuIRRyhUvkHg/iUljG5kzVog5hV7vIlCuBrmlhvgPfNHQM8lCf+FEGsYbMIBC0qC9a0uuy2wLXVbLBaP5kjHokCRxapkQyzI4QEcwgYHRZBp+XEFTqXFuNVzMtjXLJgX4gAid24Hjwc4N3dtVSe+NNiwTrzH4WVUOlDobUqr1FuAgYllc8pmzoVrELRHSIW8ViPxNy4xwjBpyR55I6J220qQTZYR4guvUICJiSpr9gFFle4RcF/OMB7BRiX8sSfhpNSO3lvEZCQfLUVTKT78Ek1LRLhWN+yLyTnp8qWUZ46b6vxdRGXfHVqx3eI75YaLa4iNNiK4NOW7wPW6lhbSOF9/M9qw8e/aoB3d156qTzxp8pXx5BKAsYSTOIIiPkp68GmTq7sZtvyzBQaRLNxIZ+paozHWoLFeExIhRBrWitHCAHrCF7/thhD8JhYz84wg93QRV88wLuLY8zF8sQ36qF1J455bOlgnELfshKVxYOXKVuKx0jaj22sczTQqPqtV/XDgpswmGTWWMSDw3ssyUunLLrVPGjYRsH5ggHeHSWiV8kT33ycFSfMgkoOK8apCye0J6VW6GOYvffgU9RWsukEi2kUV2nl4dOYUzRik9p7bcA4ggdJ53LxKcEe17B1R8eqAd7dOepV8sTXf5lhejoL85hUdhDdknPtKHFhljOT+bdq0hxbm35p2nc8+Ja1Iw+tJykgp0EWuAAZYwMVwac5KzYMslhvgHdHRrxKnvhTYcfKsxTxtTETkjHO7rr3zjoV25lAQHrqpV7bTiy2aXMmUhTBnKS91jhtR3GEoF0oLnWhWNnYgtcc4N0FxlcgT7yz3TgNIKkscx9jtV1ZKpWW+Ub1tc1eOv5ucdgpx+FJy9pgbLE7xDyXb/f+hLHVGeitHOi6A7ybo3sF8sS7w7cgdk0nJaOn3hLj3uyD0Zp5pazFIUXUpuTTU18d1EPkDoX8SkmWTnVIozEdbTcZjoqxhNHf1JrSS/AcvHjZ/SMHhL/7i5z+POsTUh/8BvNfYMTA8n+yU/MlTZxSJDRStqvEuLQKWwDctMTQogUDyQRoTQG5Kc6oQRE1yV1jCA7ri7jdZyK0sYTRjCR0Hnnd+y7nHxNgTULqw+8wj0mQKxpYvhjm9uSUxg+TTy7s2GtLUGcywhXSKZN275GsqlclX90J6bRI1aouxmgL7Q0Nen5ziM80SqMIo8cSOo+8XplT/5DHNWsSUr/6lLN/QQ3rDyzLruEW5enpf7KqZoShEduuSFOV7DLX7Ye+GmXb6/hnNNqKsVXuMDFpb9Y9eH3C6NGEzuOuI3gpMH/I6e+zDiH1fXi15t3vA1czsLws0TGEtmPEJdiiFPwlwKbgLHAFk4P6ZyPdymYYHGE0dutsChQBl2JcBFlrEkY/N5bQeXQ18gjunuMfMfsBlxJSx3niO485fwO4fGD5T/+3fPQqkneWVdwnw/3bMPkW9Wbqg+iC765Zk+xcT98ibKZc2EdgHcLoF8cSOo/Oc8fS+OyEULF4g4sJqXVcmfMfsc7A8v1/yfGXmL9I6Fn5pRwZhsPv0TxFNlAfZCvG+Oohi82UC5f/2IsJo0cTOm9YrDoKhFPEUr/LBYTUNht9zelHXDqwfPCIw4owp3mOcIQcLttWXFe3VZ/j5H3cIc0G6oPbCR+6Y2xF2EC5cGUm6wKC5tGEzhsWqw5hNidUiKX5gFWE1GXh4/Qplw4sVzOmx9QxU78g3EF6wnZlEN4FzJ1QPSLEZz1KfXC7vd8ssGdIbNUYpVx4UapyFUHzJoTOo1McSkeNn1M5MDQfs4qQuhhX5vQZFw8suwWTcyYTgioISk2YdmkhehG4PkE7w51inyAGGaU+uCXADabGzJR1fn3lwkty0asIo8cROm9Vy1g0yDxxtPvHDAmpu+PKnM8Ix1wwsGw91YJqhteaWgjYBmmQiebmSpwKKzE19hx7jkzSWOm66oPbzZ8Yj6kxVSpYjVAuvLzYMCRo3oTQecOOjjgi3NQ4l9K5/hOGhNTdcWVOTrlgYNkEXINbpCkBRyqhp+LdRB3g0OU6rMfW2HPCFFMV9nSp+uB2woepdbLBuJQyaw/ZFysXrlXwHxI0b0LovEkiOpXGA1Ijagf+KUNC6rKNa9bQnLFqYNkEnMc1uJrg2u64ELPBHpkgWbmwKpJoDhMwNbbGzAp7Yg31wS2T5rGtzit59PrKhesWG550CZpHEzpv2NGRaxlNjbMqpmEIzygJqQfjypycs2pg2cS2RY9r8HUqkqdEgKTWtWTKoRvOBPDYBltja2SO0RGjy9UHtxwRjA11ujbKF+ti5cIR9eCnxUg6owidtyoU5tK4NLji5Q3HCtiyF2IqLGYsHViOXTXOYxucDqG0HyttqYAKqYo3KTY1ekyDXRAm2AWh9JmsVh/ccg9WJ2E8YjG201sPq5ULxxX8n3XLXuMInbft2mk80rRGjCGctJ8/GFdmEQ9Ug4FlE1ll1Y7jtiraqm5Fe04VV8lvSVBL8hiPrfFVd8+7QH3Qbu2ipTVi8cvSGivc9cj8yvH11YMHdNSERtuOslM97feYFOPKzGcsI4zW0YGAbTAOaxCnxdfiYUmVWslxiIblCeAYr9VYR1gM7GmoPrilunSxxeT3DN/2eBQ9H11+nk1adn6VK71+5+Jfct4/el10/7KBZfNryUunWSCPxPECk1rdOv1WVSrQmpC+Tl46YD3ikQYcpunSQgzVB2VHFhxHVGKDgMEY5GLlQnP7FMDzw7IacAWnO6sBr12u+XanW2AO0wQ8pknnFhsL7KYIqhkEPmEXFkwaN5KQphbkUmG72wgw7WSm9RiL9QT925hkjiVIIhphFS9HKI6/8QAjlpXqg9W2C0apyaVDwKQwrwLY3j6ADR13ZyUNByQXHQu6RY09Hu6zMqXRaNZGS/KEJs0cJEe9VH1QdvBSJv9h09eiRmy0V2uJcqHcShcdvbSNg5fxkenkVprXM9rDVnX24/y9MVtncvbKY706anNl3ASll9a43UiacVquXGhvq4s2FP62NGKfQLIQYu9q1WmdMfmUrDGt8eDS0cXozH/fjmUH6Jruvm50hBDSaEU/2Ru2LEN/dl006TSc/g7tfJERxGMsgDUEr104pfWH9lQaN+M4KWQjwZbVc2rZVNHsyHal23wZtIs2JJqtIc/WLXXRFCpJkfE9jvWlfFbsNQ9pP5ZBS0zKh4R0aMFj1IjTcTnvi0Zz2rt7NdvQb2mgbju1plsH8MmbnEk7KbK0b+wC2iy3aX3szW8xeZvDwET6hWZYwqTXSSG+wMETKum0Dq/q+x62gt2ua2ppAo309TRk9TPazfV3qL9H8z7uhGqGqxNVg/FKx0HBl9OVUORn8Q8Jx9gFttGQUDr3tzcXX9xGgN0EpzN9mdZ3GATtPhL+CjxFDmkeEU6x56kqZRusLzALXVqkCN7zMEcqwjmywDQ6OhyUe0Xao1Qpyncrg6wKp9XfWDsaZplElvQ/b3sdweeghorwBDlHzgk1JmMc/wiERICVy2VJFdMjFuLQSp3S0W3+sngt2njwNgLssFGVQdJ0tu0KH4ky1LW4yrbkuaA6Iy9oz/qEMMXMMDWyIHhsAyFZc2peV9hc7kiKvfULxCl9iddfRK1f8kk9qvbdOoBtOg7ZkOZ5MsGrSHsokgLXUp9y88smniwWyuFSIRVmjplga3yD8Uij5QS1ZiM4U3Qw5QlSm2bXjFe6jzzBFtpg+/YBbLAWG7OPynNjlCw65fukGNdkJRf7yM1fOxVzbxOJVocFoYIaGwH22mIQkrvu1E2nGuebxIgW9U9TSiukPGU+Lt++c3DJPKhyhEEbXCQLUpae2exiKy6tMPe9mDRBFCEMTWrtwxN8qvuGnt6MoihKWS5NSyBhbH8StXoAz8PLOrRgLtOT/+4vcu+7vDLnqNvztOq7fmd8sMmY9Xzn1zj8Dq8+XVdu2Nv0IIySgEdQo3xVHps3Q5i3fLFsV4aiqzAiBhbgMDEd1uh8qZZ+lwhjkgokkOIv4xNJmyncdfUUzgB4oFMBtiu71Xumpz/P+cfUP+SlwFExwWW62r7b+LSPxqxn/gvMZ5z9C16t15UbNlq+jbGJtco7p8wbYlL4alSyfWdeuu0j7JA3JFNuVAwtst7F7FhWBbPFNKIUORndWtLraFLmMu7KFVDDOzqkeaiN33YAW/r76wR4XDN/yN1z7hejPau06EddkS/6XThfcz1fI/4K736fO48vlxt2PXJYFaeUkFS8U15XE3428xdtn2kc8GQlf1vkIaNRRnOMvLTWrZbElEHeLWi1o0dlKPAh1MVgbbVquPJ5+Cr8LU5/H/+I2QlHIU2ClXM9G8v7Rr7oc/hozfUUgsPnb3D+I+7WF8kNO92GY0SNvuxiE+2Bt8prVJTkzE64sfOstxuwfxUUoyk8VjcTlsqe2qITSFoSj6Epd4KsT6BZOWmtgE3hBfir8IzZDwgV4ZTZvD8VvPHERo8v+vL1DASHTz/i9OlKueHDjK5Rnx/JB1Vb1ioXdBra16dmt7dgik10yA/FwJSVY6XjA3oy4SqM2frqDPPSRMex9qs3XQtoWxMj7/Er8GWYsXgjaVz4OYumP2+9kbxvny/6kvWsEBw+fcb5bInc8APdhpOSs01tEqIkoiZjbAqKMruLbJYddHuHFRIyJcbdEdbl2sVLaySygunutBg96Y2/JjKRCdyHV+AEFtTvIpbKIXOamknYSiB6KV/0JetZITgcjjk5ZdaskBtWO86UF0ap6ozGXJk2WNiRUlCPFir66lzdm/SLSuK7EUdPz8f1z29Skq6F1fXg8+5UVR6bszncP4Tn4KUkkdJ8UFCY1zR1i8RmL/qQL3rlei4THG7OODlnKko4oI01kd3CaM08Ia18kC3GNoVaO9iDh+hWxSyTXFABXoau7Q6q9OxYg/OVEMw6jdbtSrJ9cBcewGmaZmg+bvkUnUUaGr+ZfnMH45Ivevl61hMcXsxYLFTu1hTm2zViCp7u0o5l+2PSUh9bDj6FgYypufBDhqK2+oXkiuHFHR3zfj+9PtA8oR0xnqX8qn+sx3bFODSbbF0X8EUvWQ8jBIcjo5bRmLOljDNtcqNtOe756h3l0VhKa9hDd2l1eqmsnh0MNMT/Cqnx6BInumhLT8luljzQ53RiJeA/0dxe5NK0o2fA1+GLXr6eNQWHNUOJssQaTRlGpLHKL9fD+IrQzTOMZS9fNQD4AnRNVxvTdjC+fJdcDDWQcyB00B0t9BDwTxXgaAfzDZ/DBXzRnfWMFRwuNqocOmX6OKNkY63h5n/fFcB28McVHqnXZVI27K0i4rDLNE9lDKV/rT+udVbD8dFFu2GGZ8mOt0kAXcoX3ZkIWVtw+MNf5NjR2FbivROHmhV1/pj2egv/fMGIOWTIWrV3Av8N9imV9IWml36H6cUjqEWNv9aNc+veb2sH46PRaHSuMBxvtW+twxctq0z+QsHhux8Q7rCY4Ct8lqsx7c6Sy0dl5T89rIeEuZKoVctIk1hNpfavER6yyH1Vvm3MbsUHy4ab4hWr/OZPcsRBphnaV65/ZcdYPNNwsjN/djlf9NqCw9U5ExCPcdhKxUgLSmfROpLp4WSUr8ojdwbncbvCf+a/YzRaEc6QOvXcGO256TXc5Lab9POvB+AWY7PigWYjzhifbovuunzRawsO24ZqQQAqguBtmpmPB7ysXJfyDDaV/aPGillgz1MdQg4u5MYaEtBNNHFjkRlSpd65lp4hd2AVPTfbV7FGpyIOfmNc/XVsPfg7vzaS/3nkvLL593ANLvMuRMGpQIhiF7kUEW9QDpAUbTWYBcbp4WpacHHY1aacqQyjGZS9HI3yCBT9kUZJhVOD+zUDvEH9ddR11fzPcTDQ5TlgB0KwqdXSavk9BC0pKp0WmcuowSw07VXmXC5guzSa4p0UvRw2lbDiYUx0ExJJRzWzi6Gm8cnEkfXXsdcG/M/jAJa0+bmCgdmQ9CYlNlSYZOKixmRsgiFxkrmW4l3KdFKv1DM8tk6WxPYJZhUUzcd8Kdtgrw/gkfXXDT7+avmfVak32qhtkg6NVdUS5wgkru1YzIkSduTW1FDwVWV3JQVJVuieTc0y4iDpFwc7/BvSalvKdQM8sv662cevz/+8sQVnjVAT0W2wLllw1JiMhJRxgDjCjLQsOzSFSgZqx7lAW1JW0e03yAD3asC+GD3NbQhbe+mN5GXH1F83KDOM4n/e5JIuH4NpdQARrFPBVptUNcjj4cVMcFSRTE2NpR1LEYbYMmfWpXgP9KejaPsLUhuvLCsVXznAG9dfx9SR1ud/3hZdCLHb1GMdPqRJgqDmm76mHbvOXDtiO2QPUcKo/TWkQ0i2JFXpBoo7vij1i1Lp3ADAo+qvG3V0rM//vFnnTE4hxd5Ka/Cor5YEdsLVJyKtDgVoHgtW11pWSjolPNMnrlrVj9Fv2Qn60twMwKPqr+N/wvr8z5tZcDsDrv06tkqyzESM85Ycv6XBWA2birlNCXrI6VbD2lx2L0vQO0QVTVVLH4SE67fgsfVXv8n7sz7/85Z7cMtbE6f088wSaR4kCkCm10s6pKbJhfqiUNGLq+0gLWC6eUAZFPnLjwqtKd8EwGvWX59t7iPW4X/eAN1svgRVSY990YZg06BD1ohLMtyFTI4pKTJsS9xREq9EOaPWiO2gpms7397x6nQJkbh+Fz2q/rqRROX6/M8bJrqlVW4l6JEptKeUFuMYUbtCQ7CIttpGc6MY93x1r1vgAnRXvY5cvwWPqb9uWQm+lP95QxdNMeWhOq1x0Db55C7GcUv2ZUuN6n8iKzsvOxibC//Yfs9Na8r2Rlz02vXXDT57FP/zJi66/EJSmsJKa8QxnoqW3VLQ+jZVUtJwJ8PNX1NQCwfNgdhhHD9on7PdRdrdGPF28rJr1F+3LBdeyv+8yYfLoMYet1vX4upNAjVvwOUWnlNXJXlkzk5Il6kqeoiL0C07qno+/CYBXq/+utlnsz7/Mzvy0tmI4zm4ag23PRN3t/CWryoUVJGm+5+K8RJ0V8Hc88/XHUX/HfiAq7t+BH+x6v8t438enWmdJwFA6ZINriLGKv/95f8lT9/FnyA1NMVEvQyaXuu+gz36f/DD73E4pwqpLcvm/o0Vle78n//+L/NPvoefp1pTJye6e4A/D082FERa5/opeH9zpvh13cNm19/4v/LDe5xMWTi8I0Ta0qKlK27AS/v3/r+/x/2GO9K2c7kVMonDpq7//jc5PKCxeNPpFVzaRr01wF8C4Pu76hXuX18H4LduTr79guuFD3n5BHfI+ZRFhY8w29TYhbbLi/bvBdqKE4fUgg1pBKnV3FEaCWOWyA+m3WpORZr/j+9TKJtW8yBTF2/ZEODI9/QavHkVdGFp/Pjn4Q+u5hXapsP5sOH+OXXA1LiKuqJxiMNbhTkbdJTCy4llEt6NnqRT4dhg1V3nbdrm6dYMecA1yTOL4PWTE9L5VzPFlLBCvlG58AhehnN4uHsAYinyJ+AZ/NkVvELbfOBUuOO5syBIEtiqHU1k9XeISX5bsimrkUUhnGDxourN8SgUsCZVtKyGbyGzHXdjOhsAvOAswSRyIBddRdEZWP6GZhNK/yjwew9ehBo+3jEADu7Ay2n8mDc+TS7awUHg0OMzR0LABhqLD4hJEh/BEGyBdGlSJoXYXtr+3HS4ijzVpgi0paWXtdruGTknXBz+11qT1Q2inxaTzQCO46P3lfLpyS4fou2PH/PupwZgCxNhGlj4IvUuWEsTkqMWm6i4xCSMc9N1RDQoCVcuGItJ/MRWefais+3synowi/dESgJjkilnWnBTGvRWmaw8oR15257t7CHmCf8HOn7cwI8+NQBXMBEmAa8PMRemrNCEhLGEhDQKcGZWS319BX9PFBEwGTbRBhLbDcaV3drFcDqk5kCTd2JF1Wp0HraqBx8U0wwBTnbpCadwBA/gTH/CDrcCs93LV8E0YlmmcyQRQnjBa8JESmGUfIjK/7fkaDJpmD2QptFNVJU1bbtIAjjWQizepOKptRjbzR9Kag6xZmMLLjHOtcLT3Tx9o/0EcTT1XN3E45u24AiwEypDJXihKjQxjLprEwcmRKclaDNZCVqr/V8mYWyFADbusiY5hvgFoU2vio49RgJLn5OsReRFN6tabeetiiy0V7KFHT3HyZLx491u95sn4K1QQSPKM9hNT0wMVvAWbzDSVdrKw4zRjZMyJIHkfq1VAVCDl/bUhNKlGq0zGr05+YAceXVPCttVk0oqjVwMPt+BBefx4yPtGVkUsqY3CHDPiCM5ngupUwCdbkpd8kbPrCWHhkmtIKLEetF2499eS1jZlIPGYnlcPXeM2KD9vLS0bW3ktYNqUllpKLn5ZrsxlIzxvDu5eHxzGLctkZLEY4PgSOg2IUVVcUONzUDBEpRaMoXNmUc0tFZrTZquiLyKxrSm3DvIW9Fil+AkhXu5PhEPx9mUNwqypDvZWdKlhIJQY7vn2OsnmBeOWnYZ0m1iwbbw1U60by5om47iHRV6fOgzjMf/DAZrlP40Z7syxpLK0lJ0gqaAK1c2KQKu7tabTXkLFz0sCftuwX++MyNeNn68k5Buq23YQhUh0SNTJa1ioQ0p4nUG2y0XilF1JqODqdImloPS4Bp111DEWT0jJjVv95uX9BBV7eB3bUWcu0acSVM23YZdd8R8UbQUxJ9wdu3oMuhdt929ME+mh6JXJ8di2RxbTi6TbrDquqV4aUKR2iwT6aZbyOwEXN3DUsWr8Hn4EhwNyHuXHh7/pdaUjtR7vnDh/d8c9xD/s5f501eQ1+CuDiCvGhk1AN/4Tf74RfxPwD3toLarR0zNtsnPzmS64KIRk861dMWCU8ArasG9T9H0ZBpsDGnjtAOM2+/LuIb2iIUGXNgl5ZmKD/Tw8TlaAuihaFP5yrw18v4x1898zIdP+DDAX1bM3GAMvPgRP/cJn3zCW013nrhHkrITyvYuwOUkcHuKlRSW5C6rzIdY4ppnF7J8aAJbQepgbJYBjCY9usGXDKQxq7RZfh9eg5d1UHMVATRaD/4BHK93/1iAgYZ/+jqPn8Dn4UExmWrpa3+ZOK6MvM3bjwfzxNWA2dhs8+51XHSPJiaAhGSpWevEs5xHLXcEGFXYiCONySH3fPWq93JIsBiSWvWyc3CAN+EcXoT7rCSANloPPoa31rt/5PUA/gp8Q/jDD3hyrjzlR8VkanfOvB1XPubt17vzxAfdSVbD1pzAnfgyF3ycadOTOTXhpEUoLC1HZyNGW3dtmjeXgr2r56JNmRwdNNWaQVBddd6rh4MhviEB9EFRD/7RGvePvCbwAL4Mx/D6M541hHO4D3e7g6PafdcZVw689z7NGTwo5om7A8sPhccT6qKcl9NJl9aM/9kX+e59Hh1yPqGuCCZxuITcsmNaJ5F7d0q6J3H48TO1/+M57085q2icdu2U+W36Ldllz9Agiv4YGljoEN908EzvDOrBF98/vtJwCC/BF2AG75xxEmjmMIcjxbjoaxqOK3/4hPOZzhMPBpYPG44CM0dTVm1LjLtUWWVz1Bcf8tEx0zs8O2A2YVHRxKYOiy/aOVoAaMu0i7ubu43njjmd4ibMHU1sIDHaQNKrZND/FZYdk54oCXetjq7E7IVl9eAL7t+oHnwXXtLx44czzoRFHBztYVwtH1d+NOMkupZ5MTM+gUmq90X+Bh9zjRlmaQ+m7YMqUL/veemcecAtOJ0yq1JnVlN27di2E0+Klp1tAJ4KRw1eMI7aJjsO3R8kPSI3fUFXnIOfdQe86sIIVtWDL7h//Ok6vj8vwDk08NEcI8zz7OhBy+WwalzZeZ4+0XniRfst9pAJqQHDGLzVQ2pheZnnv1OWhwO43/AgcvAEXEVVpa4db9sGvNK8wjaENHkfFQ4Ci5i7dqnQlPoLQrHXZDvO3BIXZbJOBrOaEbML6sFL798I4FhKihjHMsPjBUZYCMFr6nvaArxqXPn4lCa+cHfSa2cP27g3Z3ziYTRrcbQNGLQmGF3F3cBdzzzX7AILx0IB9rbwn9kx2G1FW3Inic+ZLIsVvKR8Zwfj0l1fkqo8LWY1M3IX14OX3r9RKTIO+d9XzAI8qRPGPn/4NC2n6o4rN8XJ82TOIvuVA8zLKUHRFgBCetlDZlqR1gLKjS39xoE7Bt8UvA6BxuEDjU3tFsEijgA+615tmZkXKqiEENrh41iLDDZNq4pKTWR3LZfnos81LOuNa15cD956vLMsJd1rqYp51gDUQqMYm2XsxnUhD2jg1DM7SeuJxxgrmpfISSXVIJIS5qJJSvJPEQ49DQTVIbYWJ9QWa/E2+c/oPK1drmC7WSfJRNKBO5Yjvcp7Gc3dmmI/Xh1kDTEuiSnWqQf37h+fTMhGnDf6dsS8SQfQWlqqwXXGlc/PEZ/SC5mtzIV0nAshlQdM/LvUtYutrEZ/Y+EAFtq1k28zQhOwLr1AIeANzhF8t9qzTdZf2qRKO6MWE9ohBYwibbOmrFtNmg3mcS+tB28xv2uKd/agYCvOP+GkSc+0lr7RXzyufL7QbkUpjLjEWFLqOIkAGu2B0tNlO9Eau2W1qcOUvVRgKzypKIQZ5KI3q0MLzqTNRYqiZOqmtqloIRlmkBHVpHmRYV6/HixbO6UC47KOFJnoMrVyr7wYz+SlW6GUaghYbY1I6kkxA2W1fSJokUdSh2LQ1GAimRGm0MT+uu57H5l7QgOWxERpO9moLRPgTtquWCfFlGlIjQaRly9odmzMOWY+IBO5tB4sW/0+VWGUh32qYk79EidWKrjWuiLpiVNGFWFRJVktyeXWmbgBBzVl8anPuXyNJlBJOlKLTgAbi/EYHVHxWiDaVR06GnHQNpJcWcK2jJtiCfG2sEHLzuI66sGrMK47nPIInPnu799935aOK2cvmvubrE38ZzZjrELCmXM2hM7UcpXD2oC3+ECVp7xtIuxptJ0jUr3sBmBS47TVxlvJ1Sqb/E0uLdvLj0lLr29ypdd/eMX3f6lrxGlKwKQxEGvw0qHbkbwrF3uHKwVENbIV2wZ13kNEF6zD+x24aLNMfDTCbDPnEikZFyTNttxWBXDaBuM8KtI2rmaMdUY7cXcUPstqTGvBGSrFWIpNMfbdea990bvAOC1YX0qbc6smDS1mPxSJoW4fwEXvjMmhlijDRq6qale6aJEuFGoppYDoBELQzLBuh/mZNx7jkinv0EtnUp50lO9hbNK57lZaMAWuWR5Yo9/kYwcYI0t4gWM47Umnl3YmpeBPqSyNp3K7s2DSAS/39KRuEN2bS4xvowV3dFRMx/VFcp2Yp8w2nTO9hCXtHG1kF1L4KlrJr2wKfyq77R7MKpFKzWlY9UkhYxyHWW6nBWPaudvEAl3CGcNpSXPZ6R9BbBtIl6cHL3gIBi+42CYXqCx1gfGWe7Ap0h3luyXdt1MKy4YUT9xSF01G16YEdWsouW9mgDHd3veyA97H+Ya47ZmEbqMY72oPztCGvK0onL44AvgC49saZKkWRz4veWljE1FHjbRJaWv6ZKKtl875h4CziFCZhG5rx7tefsl0aRT1bMHZjm8dwL/6u7wCRysaQblQoG5yAQN5zpatMNY/+yf8z+GLcH/Qn0iX2W2oEfXP4GvwQHuIL9AYGnaO3zqAX6946nkgqZNnUhx43DIdQtMFeOPrgy/y3Yd85HlJWwjLFkU3kFwq28xPnuPhMWeS+tDLV9Otllq7pQCf3uXJDN9wFDiUTgefHaiYbdfi3b3u8+iY6TnzhgehI1LTe8lcd7s1wJSzKbahCRxKKztTLXstGAiu3a6rPuQs5pk9TWAan5f0BZmGf7Ylxzzk/A7PAs4QPPPAHeFQ2hbFHszlgZuKZsJcUmbDC40sEU403cEjczstOEypa+YxevL4QBC8oRYqWdK6b7sK25tfE+oDZgtOQ2Jg8T41HGcBE6fTWHn4JtHcu9S7uYgU5KSCkl/mcnq+5/YBXOEr6lCUCwOTOM1taOI8mSxx1NsCXBEmLKbMAg5MkwbLmpBaFOPrNSlO2HnLiEqW3tHEwd8AeiQLmn+2gxjC3k6AxREqvKcJbTEzlpLiw4rNZK6oJdidbMMGX9FULKr0AkW+2qDEPBNNm5QAt2Ik2nftNWHetubosHLo2nG4vQA7GkcVCgVCgaDixHqo9UUn1A6OshapaNR/LPRYFV8siT1cCtJE0k/3WtaNSuUZYKPnsVIW0xXWnMUxq5+En4Kvw/MqQmVXnAXj9Z+9zM98zM/Agy7F/qqj2Nh67b8HjFnPP3iBn/tkpdzwEJX/whIcQUXOaikeliCRGUk7tiwF0rItwMEhjkZ309hikFoRAmLTpEXWuHS6y+am/KB/fM50aLEhGnSMwkpxzOov4H0AvgovwJ1iGzDLtJn/9BU+fAINfwUe6FHSLhu83viV/+/HrOePX+STT2B9uWGbrMHHLldRBlhS/CJQmcRxJFqZica01XixAZsYiH1uolZxLrR/SgxVIJjkpQP4PE9sE59LKLr7kltSBogS5tyszzH8Fvw8/AS8rNOg0xUS9fIaHwb+6et8Q/gyvKRjf5OusOzGx8evA/BP4IP11uN/grca5O0lcsPLJ5YjwI4QkJBOHa0WdMZYGxPbh2W2nR9v3WxEWqgp/G3+6VZbRLSAAZ3BhdhAaUL33VUSw9yjEsvbaQ9u4A/gGXwZXoEHOuU1GSj2chf+Mo+f8IcfcAxfIKVmyunRbYQVnoevwgfw3TXXcw++xNuP4fhyueEUNttEduRVaDttddoP0eSxLe2LENk6itYxlrxBNBYrNNKSQmeaLcm9c8UsaB5WyO6675yyQIAWSDpBVoA/gxmcwEvwoDv0m58UE7gHn+fJOa8/Ywan8EKRfjsopF83eCglX/Sfr7OeaRoQfvt1CGvIDccH5BCvw1sWIzRGC/66t0VTcLZQZtm6PlAasbOJ9iwWtUo7biktTSIPxnR24jxP1ZKaqq+2RcXM9OrBAm/AAs7hDJ5bNmGb+KIfwCs8a3jnjBrOFeMjHSCdbKr+2uOLfnOd9eiA8Hvvwwq54VbP2OqwkB48Ytc4YEOiH2vTXqodabfWEOzso4qxdbqD5L6tbtNPECqbhnA708DZH4QOJUXqScmUlks7Ot6FBuZw3n2mEbaUX7kDzxHOOQk8nKWMzAzu6ZZ8sOFw4RK+6PcuXo9tB4SbMz58ApfKDXf3szjNIIbGpD5TKTRxGkEMLjLl+K3wlWXBsCUxIDU+jbOiysESqAy1MGUJpXgwbTWzNOVEziIXZrJ+VIztl1PUBxTSo0dwn2bOmfDRPD3TRTGlfbCJvO9KvuhL1hMHhB9wPuPRLGHcdOWG2xc0U+5bQtAJT0nRTewXL1pgk2+rZAdeWmz3jxAqfNQQdzTlbF8uJ5ecEIWvTkevAHpwz7w78QujlD/Lr491bD8/1vhM2yrUQRrWXNQY4fGilfctMWYjL72UL/qS9eiA8EmN88nbNdour+PBbbAjOjIa4iBhfFg6rxeKdEGcL6p3EWR1Qq2Qkhs2DrnkRnmN9tG2EAqmgPw6hoL7Oza7B+3SCrR9tRftko+Lsf2F/mkTndN2LmzuMcKTuj/mX2+4Va3ki16+nnJY+S7MefpkidxwnV+4wkXH8TKnX0tsYzYp29DOOoSW1nf7nTh2akYiWmcJOuTidSaqESrTYpwjJJNVGQr+rLI7WsqerHW6Kp/oM2pKuV7T1QY9gjqlZp41/WfKpl56FV/0kvXQFRyeQ83xaTu5E8p5dNP3dUF34ihyI3GSpeCsywSh22ZJdWto9winhqifb7VRvgktxp13vyjrS0EjvrRfZ62uyqddSWaWYlwTPAtJZ2oZ3j/Sgi/mi+6vpzesfAcWNA0n8xVyw90GVFGuZjTXEQy+6GfLGLMLL523f5E0OmxVjDoOuRiH91RKU+vtoCtH7TgmvBLvtFXWLW15H9GTdVw8ow4IlRLeHECN9ym1e9K0I+Cbnhgv4Yu+aD2HaQJ80XDqOzSGAV4+4yCqBxrsJAX6ZTIoX36QnvzhhzzMfFW2dZVLOJfo0zbce5OvwXMFaZ81mOnlTVXpDZsQNuoYWveketKb5+6JOOsgX+NTm7H49fUTlx+WLuWL7qxnOFh4BxpmJx0p2gDzA/BUARuS6phR+pUsY7MMboAHx5xNsSVfVZcYSwqCKrqon7zM+8ecCkeS4nm3rINuaWvVNnMRI1IRpxTqx8PZUZ0Br/UEduo3B3hNvmgZfs9gQPj8vIOxd2kndir3awvJ6BLvoUuOfFWNYB0LR1OQJoUySKb9IlOBx74q1+ADC2G6rOdmFdJcD8BkfualA+BdjOOzP9uUhGUEX/TwhZsUduwRr8wNuXKurCixLBgpQI0mDbJr9dIqUuV+92ngkJZ7xduCk2yZKbfWrH1VBiTg9VdzsgRjW3CVXCvAwDd+c1z9dWw9+B+8MJL/eY15ZQ/HqvTwVdsZn5WQsgRRnMaWaecu3jFvMBEmgg+FJFZsnSl0zjB9OqPYaBD7qmoVyImFvzi41usesV0julaAR9dfR15Xzv9sEruRDyk1nb+QaLU67T885GTls6YgcY+UiMa25M/pwGrbCfzkvR3e0jjtuaFtnwuagHTSb5y7boBH119HXhvwP487jJLsLJ4XnUkHX5sLbS61dpiAXRoZSCrFJ+EjpeU3puVfitngYNo6PJrAigKktmwjyQdZpfq30mmtulaAx9Zfx15Xzv+cyeuiBFUs9zq8Kq+XB9a4PVvph3GV4E3y8HENJrN55H1X2p8VyqSKwVusJDKzXOZzplWdzBUFK9e+B4+uv468xvI/b5xtSAkBHQaPvtqWzllVvEOxPbuiE6+j2pvjcKsbvI7txnRErgfH7LdXqjq0IokKzga14GzQ23SSbCQvO6r+Or7SMIr/efOkkqSdMnj9mBx2DRsiY29Uj6+qK9ZrssCKaptR6HKURdwUYeUWA2kPzVKQO8ku2nU3Anhs/XWkBx3F/7wJtCTTTIKftthue1ty9xvNYLY/zo5KSbIuKbXpbEdSyeRyYdAIwKY2neyoc3+k1XUaufYga3T9daMUx/r8z1s10ITknIO0kuoMt+TB8jK0lpayqqjsJ2qtXAYwBU932zinimgmd6mTRDnQfr88q36NAI+tv24E8Pr8zxtasBqx0+xHH9HhlrwsxxNUfKOHQaZBITNf0uccj8GXiVmXAuPEAKSdN/4GLHhs/XWj92dN/uetNuBMnVR+XWDc25JLjo5Mg5IZIq226tmCsip2zZliL213YrTlL2hcFjpCduyim3M7/eB16q/blQsv5X/esDRbtJeabLIosWy3ycavwLhtxdWzbMmHiBTiVjJo6lCLjXZsi7p9PEPnsq6X6wd4bP11i0rD5fzPm/0A6brrIsllenZs0lCJlU4abakR59enZKrKe3BZihbTxlyZ2zl1+g0wvgmA166/bhwDrcn/7Ddz0eWZuJvfSESug6NzZsox3Z04FIxz0mUjMwVOOVTq1CQ0AhdbBGVdjG/CgsfUX7esJl3K/7ytWHRv683praW/8iDOCqWLLhpljDY1ZpzK75QiaZoOTpLKl60auHS/97oBXrv+umU9+FL+5+NtLFgjqVLCdbmj7pY5zPCPLOHNCwXGOcLquOhi8CmCWvbcuO73XmMUPab+ug3A6/A/78Bwe0bcS2+tgHn4J5pyS2WbOck0F51Vq3LcjhLvZ67p1ABbaL2H67bg78BfjKi/jr3+T/ABV3ilLmNXTI2SpvxWBtt6/Z//D0z/FXaGbSBgylzlsEGp+5//xrd4/ae4d8DUUjlslfIYS3t06HZpvfQtvv0N7AHWqtjP2pW08QD/FLy//da38vo8PNlKHf5y37Dxdfe/oj4kVIgFq3koLReSR76W/bx//n9k8jonZxzWTANVwEniDsg87sOSd/z7//PvMp3jQiptGVWFX2caezzAXwfgtzYUvbr0iozs32c3Uge7varH+CNE6cvEYmzbPZ9hMaYDdjK4V2iecf6EcEbdUDVUARda2KzO/JtCuDbNQB/iTeL0EG1JSO1jbXS+nLxtPMDPw1fh5+EPrgSEKE/8Gry5A73ui87AmxwdatyMEBCPNOCSKUeRZ2P6Myb5MRvgCHmA9ywsMifU+AYXcB6Xa5GibUC5TSyerxyh0j6QgLVpdyhfArRTTLqQjwe4HOD9s92D4Ap54odXAPBWLAwB02igG5Kkc+piN4lvODIFGAZgT+EO4Si1s7fjSR7vcQETUkRm9O+MXyo9OYhfe4xt9STQ2pcZRLayCV90b4D3jR0DYAfyxJ+eywg2IL7NTMXna7S/RpQ63JhWEM8U41ZyQGjwsVS0QBrEKLu8xwZsbi4wLcCT+OGidPIOCe1PiSc9Qt+go+vYqB7cG+B9d8cAD+WJPz0Am2gxXgU9IneOqDpAAXOsOltVuMzpdakJXrdPCzXiNVUpCeOos5cxnpQT39G+XVLhs1osQVvJKPZyNq8HDwd4d7pNDuWJPxVX7MSzqUDU6gfadKiNlUFTzLeFHHDlzO4kpa7aiKhBPGKwOqxsBAmYkOIpipyXcQSPlRTf+Tii0U3EJGaZsDER2qoB3h2hu0qe+NNwUooYU8y5mILbJe6OuX+2FTKy7bieTDAemaQyQ0CPthljSWO+xmFDIYiESjM5xKd6Ik5lvLq5GrQ3aCMLvmCA9wowLuWJb9xF59hVVP6O0CrBi3ZjZSNOvRy+I6klNVRJYRBaEzdN+imiUXQ8iVF8fsp+W4JXw7WISW7fDh7lptWkCwZ4d7QTXyBPfJMYK7SijjFppGnlIVJBJBYj7eUwtiP1IBXGI1XCsjNpbjENVpSAJ2hq2LTywEly3hUYazt31J8w2+aiLx3g3fohXixPfOMYm6zCGs9LVo9MoW3MCJE7R5u/WsOIjrqBoHUO0bJE9vxBpbhsd3+Nb4/vtPCZ4oZYCitNeYuC/8UDvDvy0qvkiW/cgqNqRyzqSZa/s0mqNGjtKOoTm14zZpUauiQgVfqtQiZjq7Q27JNaSK5ExRcrGCXO1FJYh6jR6CFqK7bZdQZ4t8g0rSlPfP1RdBtqaa9diqtzJkQ9duSryi2brQXbxDwbRUpFMBHjRj8+Nt7GDKgvph9okW7LX47gu0SpGnnFQ1S1lYldOsC7hYteR574ZuKs7Ei1lBsfdz7IZoxzzCVmmVqaSySzQbBVAWDek+N4jh9E/4VqZrJjPwiv9BC1XcvOWgO8275CVyBPvAtTVlDJfZkaZGU7NpqBogAj/xEHkeAuJihWYCxGN6e8+9JtSegFXF1TrhhLGP1fak3pebgPz192/8gB4d/6WT7+GdYnpH7hH/DJzzFiYPn/vjW0SgNpTNuPIZoAEZv8tlGw4+RLxy+ZjnKa5NdFoC7UaW0aduoYse6+bXg1DLg6UfRYwmhGEjqPvF75U558SANrElK/+MdpXvmqBpaXOa/MTZaa1DOcSiLaw9j0NNNst3c+63c7EKTpkvKHzu6bPbP0RkuHAVcbRY8ijP46MIbQeeT1mhA+5PV/inyDdQipf8LTvMXbwvoDy7IruDNVZKTfV4CTSRUYdybUCnGU7KUTDxLgCknqUm5aAW6/1p6eMsOYsphLzsHrE0Y/P5bQedx1F/4yPHnMB3/IOoTU9+BL8PhtjuFKBpZXnYNJxTuv+2XqolKR2UQgHhS5novuxVySJhBNRF3SoKK1XZbbXjVwWNyOjlqWJjrWJIy+P5bQedyldNScP+HZ61xKSK3jyrz+NiHG1hcOLL/+P+PDF2gOkekKGiNWKgJ+8Z/x8Iv4DdQHzcpZyF4v19I27w9/yPGDFQvmEpKtqv/TLiWMfn4sofMm9eAH8Ao0zzh7h4sJqYtxZd5/D7hkYPneDzl5idlzNHcIB0jVlQ+8ULzw/nc5/ojzl2juE0apD7LRnJxe04dMz2iOCFNtGFpTuXA5AhcTRo8mdN4kz30nVjEC4YTZQy4gpC7GlTlrePKhGsKKgeXpCYeO0MAd/GH7yKQUlXPLOasOH3FnSphjHuDvEu4gB8g66oNbtr6eMbFIA4fIBJkgayoXriw2XEDQPJrQeROAlY6aeYOcMf+IVYTU3XFlZufMHinGywaW3YLpObVBAsbjF4QJMsVUSayjk4voPsHJOQfPWDhCgDnmDl6XIRerD24HsGtw86RMHOLvVSHrKBdeVE26gKB5NKHzaIwLOmrqBWJYZDLhASG16c0Tn+CdRhWDgWXnqRZUTnPIHuMJTfLVpkoYy5CzylHVTGZMTwkGAo2HBlkQplrJX6U+uF1wZz2uwS1SQ12IqWaPuO4baZaEFBdukksJmkcTOm+YJSvoqPFzxFA/YUhIvWxcmSdPWTWwbAKVp6rxTtPFUZfKIwpzm4IoMfaYQLWgmlG5FME2gdBgm+J7J+rtS/XBbaVLsR7bpPQnpMFlo2doWaVceHk9+MkyguZNCJ1He+kuHTWyQAzNM5YSUg/GlTk9ZunAsg1qELVOhUSAK0LABIJHLKbqaEbHZLL1VA3VgqoiOKXYiS+HRyaEKgsfIqX64HYWbLRXy/qWoylIV9gudL1OWBNgBgTNmxA6b4txDT4gi3Ri7xFSLxtXpmmYnzAcWDZgY8d503LFogz5sbonDgkKcxGsWsE1OI+rcQtlgBBCSOKD1mtqYpIU8cTvBmAT0yZe+zUzeY92fYjTtGipXLhuR0ePoHk0ofNWBX+lo8Z7pAZDk8mEw5L7dVyZZoE/pTewbI6SNbiAL5xeygW4xPRuLCGbhcO4RIeTMFYHEJkYyEO9HmJfXMDEj/LaH781wHHZEtqSQ/69UnGpzH7LKIAZEDSPJnTesJTUa+rwTepI9dLJEawYV+ZkRn9g+QirD8vF8Mq0jFQ29js6kCS3E1+jZIhgPNanHdHFqFvPJLHqFwQqbIA4jhDxcNsOCCQLDomaL/dr5lyJaJU6FxPFjO3JOh3kVMcROo8u+C+jo05GjMF3P3/FuDLn5x2M04xXULPwaS6hBYki+MrMdZJSgPHlcB7nCR5bJ9Kr5ACUn9jk5kivdd8tk95SOGrtqu9lr2IhK65ZtEl7ZKrp7DrqwZfRUSN1el7+7NJxZbywOC8neNKTch5vsTEMNsoCCqHBCqIPRjIPkm0BjvFODGtto99rCl+d3wmHkW0FPdpZtC7MMcVtGFQjJLX5bdQ2+x9ypdc313uj8xlsrfuLgWXz1cRhZvJYX0iNVBRcVcmCXZs6aEf3RQF2WI/TcCbKmGU3IOoDJGDdDub0+hYckt6PlGu2BcxmhbTdj/klhccLGJMcqRjMJP1jW2ETqLSWJ/29MAoORluJ+6LPffBZbi5gqi5h6catQpmOT7/OFf5UorRpLzCqcMltBLhwd1are3kztrSzXO0LUbXRQcdLh/RdSZ+swRm819REDrtqzC4es6Gw4JCKlSnjYVpo0xeq33PrADbFLL3RuCmObVmPN+24kfa+AojDuM4umKe2QwCf6EN906HwjujaitDs5o0s1y+k3lgbT2W2i7FJdnwbLXhJUBq/9liTctSmFC/0OqUinb0QddTWamtjbHRFuWJJ6NpqZ8vO3fZJ37Db+2GkaPYLGHs7XTTdiFQJ68SkVJFVmY6McR5UycflNCsccHFaV9FNbR4NttLxw4pQ7wJd066Z0ohVbzihaxHVExd/ay04oxUKWt+AsdiQ9OUyZ2krzN19IZIwafSTFgIBnMV73ADj7V/K8u1MaY2sJp2HWm0f41tqwajEvdHWOJs510MaAqN4aoSiPCXtN2KSi46dUxHdaMquar82O1x5jqhDGvqmoE9LfxcY3zqA7/x3HA67r9ZG4O6Cuxu12/+TP+eLP+I+HErqDDCDVmBDO4larujNe7x8om2rMug0MX0rL1+IWwdwfR+p1TNTyNmVJ85ljWzbWuGv8/C7HD/izjkHNZNYlhZcUOKVzKFUxsxxN/kax+8zPWPSFKw80rJr9Tizyj3o1gEsdwgWGoxPezDdZ1TSENE1dLdNvuKL+I84nxKesZgxXVA1VA1OcL49dFlpFV5yJMhzyCmNQ+a4BqusPJ2bB+xo8V9u3x48VVIEPS/mc3DvAbXyoYr6VgDfh5do5hhHOCXMqBZUPhWYbWZECwVJljLgMUWOCB4MUuMaxGNUQDVI50TQ+S3kFgIcu2qKkNSHVoM0SHsgoZxP2d5HH8B9woOk4x5bPkKtAHucZsdykjxuIpbUrSILgrT8G7G5oCW+K0990o7E3T6AdW4TilH5kDjds+H64kS0mz24grtwlzDHBJqI8YJQExotPvoC4JBq0lEjjQkyBZ8oH2LnRsQ4Hu1QsgDTJbO8fQDnllitkxuVskoiKbRF9VwzMDvxHAdwB7mD9yCplhHFEyUWHx3WtwCbSMMTCUCcEmSGlg4gTXkHpZXWQ7kpznK3EmCHiXInqndkQjunG5kxTKEeGye7jWz9cyMR2mGiFQ15ENRBTbCp+Gh86vAyASdgmJq2MC6hoADQ3GosP0QHbnMHjyBQvQqfhy/BUbeHd5WY/G/9LK/8Ka8Jd7UFeNWEZvzPb458Dn8DGLOe3/wGL/4xP+HXlRt+M1PE2iLhR8t+lfgxsuh7AfO2AOf+owWhSZRYQbd622hbpKWKuU+XuvNzP0OseRDa+mObgDHJUSc/pKx31QdKffQ5OIJpt8GWjlgTwMc/w5MPCR/yl1XC2a2Yut54SvOtMev55Of45BOat9aWG27p2ZVORRvnEk1hqWMVUmqa7S2YtvlIpspuF1pt0syuZS2NV14mUidCSfzQzg+KqvIYCMljIx2YK2AO34fX4GWdu5xcIAb8MzTw+j/lyWM+Dw/gjs4GD6ehNgA48kX/AI7XXM/XAN4WHr+9ntywqoCakCqmKP0rmQrJJEErG2Upg1JObr01lKQy4jskWalKYfJ/EDLMpjNSHFEUAde2fltaDgmrNaWQ9+AAb8I5vKjz3L1n1LriB/BXkG/wwR9y/oRX4LlioHA4LzP2inzRx/DWmutRweFjeP3tNeSGlaE1Fde0OS11yOpmbIp2u/jF1n2RRZviJM0yBT3IZl2HWImKjQOxIyeU325b/qWyU9Moj1o07tS0G7qJDoGHg5m8yeCxMoEH8GU45tnrNM84D2l297DQ9t1YP7jki/7RmutRweEA77/HWXOh3HCxkRgldDQkAjNTMl2Iloc1qN5JfJeeTlyTRzxURTdn1Ixv2uKjs12AbdEWlBtmVdk2k7FFwj07PCZ9XAwW3dG+8xKzNFr4EnwBZpy9Qzhh3jDXebBpYcpuo4fQ44u+fD1dweEnHzI7v0xuuOALRUV8rXpFyfSTQYkhd7IHm07jpyhlkCmI0ALYqPTpUxXS+z4jgDj1Pflvmz5ecuItpIBxyTHpSTGWd9g1ApfD/bvwUhL4nT1EzqgX7cxfCcNmb3mPL/qi9SwTHJ49oj5ZLjccbTG3pRmlYi6JCG0mQrAt1+i2UXTZ2dv9IlQpN5naMYtviaXlTrFpoMsl3bOAFEa8sqPj2WCMrx3Yjx99qFwO59Aw/wgx+HlqNz8oZvA3exRDvuhL1jMQHPaOJ0+XyA3fp1OfM3qObEVdhxjvynxNMXQV4+GJyvOEFqeQBaIbbO7i63rpxCltdZShPFxkjM2FPVkn3TG+Rp9pO3l2RzFegGfxGDHIAh8SteR0C4HopXzRF61nheDw6TFN05Ebvq8M3VKKpGjjO6r7nhudTEGMtYM92HTDaR1FDMXJ1eThsbKfywyoWwrzRSXkc51flG3vIid62h29bIcFbTGhfV+faaB+ohj7dPN0C2e2lC96+XouFByen9AsunLDJZ9z7NExiUc0OuoYW6UZkIyx2YUR2z6/TiRjyKMx5GbbjLHvHuf7YmtKghf34LJfx63Yg8vrvN2zC7lY0x0tvKezo4HmGYDU+Gab6dFL+KI761lDcNifcjLrrr9LWZJctG1FfU1uwhoQE22ObjdfkSzY63CbU5hzs21WeTddH2BaL11Gi7lVdlxP1nkxqhnKhVY6knS3EPgVGg1JpN5cP/hivujOelhXcPj8HC/LyI6MkteVjlolBdMmF3a3DbsuAYhL44dxzthWSN065xxUd55Lmf0wRbOYOqH09/o9WbO2VtFdaMb4qBgtFJoT1SqoN8wPXMoXLb3p1PUEhxfnnLzGzBI0Ku7FxrKsNJj/8bn/H8fPIVOd3rfrklUB/DOeO+nkghgSPzrlPxluCMtOnDL4Yml6dK1r3vsgMxgtPOrMFUZbEUbTdIzii5beq72G4PD0DKnwjmBULUVFmy8t+k7fZ3pKc0Q4UC6jpVRqS9Umv8bxw35flZVOU1X7qkjnhZlsMbk24qQ6Hz7QcuL6sDC0iHHki96Uh2UdvmgZnjIvExy2TeJdMDZNSbdZyAHe/Yd1xsQhHiKzjh7GxQ4yqMPaywPkjMamvqrYpmO7Knad+ZQC5msCuAPWUoxrxVhrGv7a+KLXFhyONdTMrZ7ke23qiO40ZJUyzgYyX5XyL0mV7NiUzEs9mjtbMN0dERqwyAJpigad0B3/zRV7s4PIfXSu6YV/MK7+OrYe/JvfGMn/PHJe2fyUdtnFrKRNpXV0Y2559aWPt/G4BlvjTMtXlVIWCnNyA3YQBDmYIodFz41PvXPSa6rq9lWZawZ4dP115HXV/M/tnFkkrBOdzg6aP4pID+MZnTJ1SuuB6iZlyiox4HT2y3YBtkUKWooacBQUDTpjwaDt5poBHl1/HXltwP887lKKXxNUEyPqpGTyA699UqY/lt9yGdlUKra0fFWS+36iylVWrAyd7Uw0CZM0z7xKTOduznLIjG2Hx8cDPLb+OvK6Bv7n1DYci4CxUuRxrjBc0bb4vD3rN5Zz36ntLb83eVJIB8LiIzCmn6SMPjlX+yNlTjvIGjs+QzHPf60Aj62/jrzG8j9vYMFtm1VoRWCJdmw7z9N0t+c8cxZpPeK4aTRicS25QhrVtUp7U578chk4q04Wx4YoQSjFryUlpcQ1AbxZ/XVMknIU//OGl7Q6z9Zpxi0+3yFhSkjUDpnCIUhLWVX23KQ+L9vKvFKI0ZWFQgkDLvBoylrHNVmaw10zwCPrr5tlodfnf94EWnQ0lFRWy8pW9LbkLsyUVDc2NSTHGDtnD1uMtchjbCeb1mpxFP0YbcClhzdLu6lfO8Bj6q+bdT2sz/+8SZCV7VIxtt0DUn9L7r4cLYWDSXnseEpOGFuty0qbOVlS7NNzs5FOGJUqQpl2Q64/yBpZf90sxbE+//PGdZ02HSipCbmD6NItmQ4Lk5XUrGpDMkhbMm2ZVheNYV+VbUWTcv99+2NyX1VoafSuC+AN6q9bFIMv5X/eagNWXZxEa9JjlMwNWb00akGUkSoepp1/yRuuqHGbUn3UdBSTxBU6SEVklzWRUkPndVvw2PrrpjvxOvzPmwHc0hpmq82npi7GRro8dXp0KXnUQmhZbRL7NEVp1uuZmO45vuzKsHrktS3GLWXODVjw+vXXLYx4Hf7njRPd0i3aoAGX6W29GnaV5YdyDj9TFkakje7GHYzDoObfddHtOSpoi2SmzJHrB3hM/XUDDEbxP2/oosszcRlehWXUvzHv4TpBVktHqwenFo8uLVmy4DKLa5d3RtLrmrM3aMFr1183E4sewf+85VWeg1c5ag276NZrM9IJVNcmLEvDNaV62aq+14IAOGFsBt973Ra8Xv11YzXwNfmft7Jg2oS+XOyoC8/cwzi66Dhmgk38kUmP1CUiYWOX1bpD2zWXt2FCp7uq8703APAa9dfNdscR/M/bZLIyouVxqJfeWvG9Je+JVckHQ9+CI9NWxz+blX/KYYvO5n2tAP/vrlZ7+8/h9y+9qeB/Hnt967e5mevX10rALDWK//FaAT5MXdBXdP0C/BAes792c40H+AiAp1e1oH8HgH94g/Lttx1gp63op1eyoM/Bvw5/G/7xFbqJPcCXnmBiwDPb/YKO4FX4OjyCb289db2/Noqicw4i7N6TVtoz8tNwDH+8x/i6Ae7lmaQVENzJFb3Di/BFeAwz+Is9SjeQySpPqbLFlNmyz47z5a/AF+AYFvDmHqibSXTEzoT4Gc3OALaqAP4KPFUJ6n+1x+rGAM6Zd78bgJ0a8QN4GU614vxwD9e1Amy6CcskNrczLx1JIp6HE5UZD/DBHrFr2oNlgG4Odv226BodoryjGJ9q2T/AR3vQrsOCS0ctXZi3ruLlhpFDJYl4HmYtjQCP9rhdn4suySLKDt6wLcC52h8xPlcjju1fn+yhuw4LZsAGUuo2b4Fx2UwQu77uqRHXGtg92aN3tQCbFexc0uk93vhTXbct6y7MulLycoUljx8ngDMBg1tvJjAazpEmOtxlzclvj1vQf1Tx7QlPDpGpqgtdSKz/d9/hdy1vTfFHSmC9dGDZbLiezz7Ac801HirGZsWjydfZyPvHXL/Y8Mjzg8BxTZiuwKz4Eb8sBE9zznszmjvFwHKPIWUnwhqfVRcd4Ck0K6ate48m1oOfrX3/yOtvAsJ8zsPAM89sjnddmuLuDPjX9Bu/L7x7xpMzFk6nWtyQfPg278Gn4Aekz2ZgOmU9eJ37R14vwE/BL8G3aibCiWMWWDQ0ZtkPMnlcGeAu/Ag+8ZyecU5BPuy2ILD+sQqyZhAKmn7XZd+jIMTN9eBL7x95xVLSX4On8EcNlXDqmBlqS13jG4LpmGbkF/0CnOi3H8ETOIXzmnmtb0a16Tzxj1sUvQCBiXZGDtmB3KAefPH94xcUa/6vwRn80GOFyjEXFpba4A1e8KQfFF+259tx5XS4egYn8fQsLGrqGrHbztr+uByTahWuL1NUGbDpsnrwBfePPwHHIf9X4RnM4Z2ABWdxUBlqQ2PwhuDxoS0vvqB1JzS0P4h2nA/QgTrsJFn+Y3AOjs9JFC07CGWX1oNX3T/yHOzgDjwPn1PM3g9Jk9lZrMEpxnlPmBbjyo2+KFXRU52TJM/2ALcY57RUzjObbjqxVw++4P6RAOf58pcVsw9Daje3htriYrpDOonre3CudSe6bfkTEgHBHuDiyu5MCsc7BHhYDx7ePxLjqigXZsw+ijMHFhuwBmtoTPtOxOrTvYJDnC75dnUbhfwu/ZW9AgYd+peL68HD+0emKquiXHhWjJg/UrkJYzuiaL3E9aI/ytrCvAd4GcYZMCkSQxfUg3v3j8c4e90j5ZTPdvmJJGHnOCI2nHS8081X013pHuBlV1gB2MX1YNmWLHqqGN/TWmG0y6clJWthxNUl48q38Bi8vtMKyzzpFdSDhxZ5WBA5ZLt8Jv3895DduBlgbPYAj8C4B8hO68FDkoh5lydC4FiWvBOVqjYdqjiLv92t8yPDjrDaiHdUD15qkSURSGmXJwOMSxWAXYwr3zaAufJ66l+94vv3AO+vPcD7aw/w/toDvL/2AO+vPcD7aw/wHuD9tQd4f+0B3l97gPfXHuD9tQd4f+0B3l97gG8LwP8G/AL8O/A5OCq0Ys2KIdv/qOIXG/4mvFAMF16gZD+2Xvu/B8as5+8bfllWyg0zaNO5bfXj6vfhhwD86/Aq3NfRS9t9WPnhfnvCIw/CT8GLcFTMnpntdF/z9V+PWc/vWoIH+FL3Znv57PitcdGP4R/C34avw5fgRVUInCwbsn1yyA8C8zm/BH8NXoXnVE6wVPjdeCI38kX/3+Ct9dbz1pTmHFRu+Hm4O9Ch3clr99negxfwj+ER/DR8EV6B5+DuQOnTgUw5rnkY+FbNU3gNXh0o/JYTuWOvyBf9FvzX663HH/HejO8LwAl8Hl5YLTd8q7sqA3wbjuExfAFegQdwfyDoSkWY8swzEf6o4Qyewefg+cHNbqMQruSL/u/WWc+E5g7vnnEXgDmcDeSGb/F4cBcCgT+GGRzDU3hZYburAt9TEtHgbM6JoxJ+6NMzzTcf6c2bycv2+KK/f+l6LBzw5IwfqZJhA3M472pWT/ajKxnjv4AFnMEpnBTPND6s2J7qHbPAqcMK74T2mZ4VGB9uJA465It+/eL1WKhYOD7xHOkr1ajK7d0C4+ke4Hy9qXZwpgLr+Znm/uNFw8xQOSy8H9IzjUrd9+BIfenYaylf9FsXr8fBAadnPIEDna8IBcwlxnuA0/Wv6GAWPd7dDIKjMdSWueAsBj4M7TOd06qBbwDwKr7oleuxMOEcTuEZTHWvDYUO7aHqAe0Bbq+HEFRzOz7WVoTDQkVds7A4sIIxfCQdCefFRoIOF/NFL1mPab/nvOakSL/Q1aFtNpUb/nFOVX6gzyg/1nISyDfUhsokIzaBR9Kxm80s5mK+6P56il1jXic7nhQxsxSm3OwBHl4fFdLqi64nDQZvqE2at7cWAp/IVvrN6/BFL1mPhYrGMBfOi4PyjuSGf6wBBh7p/FZTghCNWGgMzlBbrNJoPJX2mW5mwZfyRffXo7OFi5pZcS4qZUrlViptrXtw+GQoyhDPS+ANjcGBNRiLCQDPZPMHuiZfdFpPSTcQwwKYdRNqpkjm7AFeeT0pJzALgo7g8YYGrMHS0iocy+YTm2vyRUvvpXCIpQ5pe666TJrcygnScUf/p0NDs/iAI/nqDHC8TmQT8x3NF91l76oDdQGwu61Z6E0ABv7uO1dbf/37Zlv+Zw/Pbh8f1s4Avur6657/+YYBvur6657/+YYBvur6657/+YYBvur6657/+aYBvuL6657/+VMA8FXWX/f8zzcN8BXXX/f8zzcNMFdbf93zP38KLPiK6697/uebtuArrr/u+Z9vGmCusP6653/+1FjwVdZf9/zPN7oHX339dc//fNMu+irrr3v+50+Bi+Zq6697/uebA/jz8Pudf9ht/fWv517J/XUzAP8C/BAeX9WCDrUpZ3/dEMBxgPcfbtTVvsYV5Yn32u03B3Ac4P3b8I+vxNBKeeL9dRMAlwO83959qGO78sT769oB7g3w/vGVYFzKE++v6wV4OMD7F7tckFkmT7y/rhHgpQO8b+4Y46XyxPvrugBeNcB7BRiX8sT767oAvmCA9woAHsoT76+rBJjLBnh3txOvkifeX1dswZcO8G6N7sXyxPvr6i340gHe3TnqVfLE++uKAb50gHcXLnrX8sR7gNdPRqwzwLu7Y/FO5Yn3AK9jXCMGeHdgxDuVJ75VAI8ljP7PAb3/RfjcZfePHBB+79dpfpH1CanN30d+mT1h9GqAxxJGM5LQeeQ1+Tb+EQJrElLb38VHQ94TRq900aMIo8cSOo+8Dp8QfsB8zpqE1NO3OI9Zrj1h9EV78PqE0WMJnUdeU6E+Jjyk/hbrEFIfeWbvId8H9oTRFwdZaxJGvziW0Hn0gqYB/wyZ0PwRlxJST+BOw9m77Amj14ii1yGM/txYQudN0qDzGe4EqfA/5GJCagsHcPaEPWH0esekSwmjRxM6b5JEcZ4ww50ilvAOFxBSx4yLW+A/YU8YvfY5+ALC6NGEzhtmyZoFZoarwBLeZxUhtY4rc3bKnjB6TKJjFUHzJoTOozF2YBpsjcyxDgzhQ1YRUse8+J4wenwmaylB82hC5w0zoRXUNXaRBmSMQUqiWSWkLsaVqc/ZE0aPTFUuJWgeTei8SfLZQeMxNaZSIzbII4aE1Nmr13P2hNHjc9E9guYNCZ032YlNwESMLcZiLQHkE4aE1BFg0yAR4z1h9AiAGRA0jyZ03tyIxWMajMPWBIsxYJCnlITU5ShiHYdZ94TR4wCmSxg9jtB5KyPGYzymAYexWEMwAPIsAdYdV6aObmNPGD0aYLoEzaMJnTc0Ygs+YDw0GAtqxBjkuP38bMRWCHn73xNGjz75P73WenCEJnhwyVe3AEe8TtKdJcYhBl97wuhNAObK66lvD/9J9NS75v17wuitAN5fe4D31x7g/bUHeH/tAd5fe4D3AO+vPcD7aw/w/toDvL/2AO+vPcD7aw/w/toDvAd4f/24ABzZ8o+KLsSLS+Pv/TqTb3P4hKlQrTGh+fbIBT0Axqznnb+L/V2mb3HkN5Mb/nEHeK7d4IcDld6lmDW/iH9E+AH1MdOw/Jlu2T1xNmY98sv4wHnD7D3uNHu54WUuOsBTbQuvBsPT/UfzNxGYzwkP8c+Yz3C+r/i6DcyRL/rZ+utRwWH5PmfvcvYEt9jLDS/bg0/B64DWKrQM8AL8FPwS9beQCe6EMKNZYJol37jBMy35otdaz0Bw2H/C2Smc7+WGB0HWDELBmOByA3r5QONo4V+DpzR/hFS4U8wMW1PXNB4TOqYz9urxRV++ntWCw/U59Ty9ebdWbrgfRS9AYKKN63ZokZVygr8GZ/gfIhZXIXPsAlNjPOLBby5c1eOLvmQ9lwkOy5x6QV1j5TYqpS05JtUgUHUp5toHGsVfn4NX4RnMCe+AxTpwmApTYxqMxwfCeJGjpXzRF61nbcHhUBPqWze9svwcHJ+S6NPscKrEjug78Dx8Lj3T8D4YxGIdxmJcwhi34fzZUr7olevZCw5vkOhoClq5zBPZAnygD/Tl9EzDh6kl3VhsHYcDEb+hCtJSvuiV69kLDm+WycrOTArHmB5/VYyP6jOVjwgGawk2zQOaTcc1L+aLXrKeveDwZqlKrw8U9Y1p66uK8dEzdYwBeUQAY7DbyYNezBfdWQ97weEtAKYQg2xJIkuveAT3dYeLGH+ShrWNwZgN0b2YL7qznr3g8JYAo5bQBziPjx7BPZ0d9RCQp4UZbnFdzBddor4XHN4KYMrB2qHFRIzzcLAHQZ5the5ovui94PCWAPefaYnxIdzRwdHCbuR4B+tbiy96Lzi8E4D7z7S0mEPd+eqO3cT53Z0Y8SV80XvB4Z0ADJi/f7X113f+7p7/+UYBvur6657/+YYBvur6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+aYBvuL6657/+VMA8FXWX/f8z58OgK+y/rrnf75RgLna+uue//lTA/CV1V/3/M837aKvvv6653++UQvmauuve/7nTwfAV1N/3fM/fzr24Cuuv+75nz8FFnxl9dc9//MOr/8/glixwRuUfM4AAAAASUVORK5CYII="},getSearchTexture:function(){return"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEIAAAAhCAAAAABIXyLAAAAAOElEQVRIx2NgGAWjYBSMglEwEICREYRgFBZBqDCSLA2MGPUIVQETE9iNUAqLR5gIeoQKRgwXjwAAGn4AtaFeYLEAAAAASUVORK5CYII="}})},function(t,e,i){var n,r,o=i(0);o.LineSegmentsGeometry=function(){o.InstancedBufferGeometry.call(this),this.type="LineSegmentsGeometry";new o.BufferGeometry;this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.addAttribute("position",new o.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.addAttribute("uv",new o.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))},o.LineSegmentsGeometry.prototype=Object.assign(Object.create(o.InstancedBufferGeometry.prototype),{constructor:o.LineSegmentsGeometry,isLineSegmentsGeometry:!0,applyMatrix:function(t){var e=this.attributes.instanceStart,i=this.attributes.instanceEnd;return void 0!==e&&(t.applyToBufferAttribute(e),t.applyToBufferAttribute(i),e.data.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},setPositions:function(t){var e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));var i=new o.InstancedInterleavedBuffer(e,6,1);return this.addAttribute("instanceStart",new o.InterleavedBufferAttribute(i,3,0)),this.addAttribute("instanceEnd",new o.InterleavedBufferAttribute(i,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},setColors:function(t){var e;t instanceof Float32Array?e=t:Array.isArray(t)&&(e=new Float32Array(t));var i=new o.InstancedInterleavedBuffer(e,6,1);return this.addAttribute("instanceColorStart",new o.InterleavedBufferAttribute(i,3,0)),this.addAttribute("instanceColorEnd",new o.InterleavedBufferAttribute(i,3,3)),this},fromWireframeGeometry:function(t){return this.setPositions(t.attributes.position.array),this},fromEdgesGeometry:function(t){return this.setPositions(t.attributes.position.array),this},fromMesh:function(t){return this.fromWireframeGeometry(new o.WireframeGeometry(t.geometry)),this},fromLineSegements:function(t){var e=t.geometry;return e.isGeometry?this.setPositions(e.vertices):e.isBufferGeometry&&this.setPositions(e.position.array),this},computeBoundingBox:(r=new o.Box3,function(){null===this.boundingBox&&(this.boundingBox=new o.Box3);var t=this.attributes.instanceStart,e=this.attributes.instanceEnd;void 0!==t&&void 0!==e&&(this.boundingBox.setFromBufferAttribute(t),r.setFromBufferAttribute(e),this.boundingBox.union(r))}),computeBoundingSphere:(n=new o.Vector3,function(){null===this.boundingSphere&&(this.boundingSphere=new o.Sphere),null===this.boundingBox&&this.computeBoundingBox();var t=this.attributes.instanceStart,e=this.attributes.instanceEnd;if(void 0!==t&&void 0!==e){var i=this.boundingSphere.center;this.boundingBox.getCenter(i);for(var r=0,a=0,s=t.count;a<s;a++)n.fromBufferAttribute(t,a),r=Math.max(r,i.distanceToSquared(n)),n.fromBufferAttribute(e,a),r=Math.max(r,i.distanceToSquared(n));this.boundingSphere.radius=Math.sqrt(r),isNaN(this.boundingSphere.radius)}}),toJSON:function(){},clone:function(){},copy:function(t){return this}})},function(t,e,i){var n=i(0);n.LineGeometry=function(){n.LineSegmentsGeometry.call(this),this.type="LineGeometry"},n.LineGeometry.prototype=Object.assign(Object.create(n.LineSegmentsGeometry.prototype),{constructor:n.LineGeometry,isLineGeometry:!0,setPositions:function(t){for(var e=t.length-3,i=new Float32Array(2*e),r=0;r<e;r+=3)i[2*r]=t[r],i[2*r+1]=t[r+1],i[2*r+2]=t[r+2],i[2*r+3]=t[r+3],i[2*r+4]=t[r+4],i[2*r+5]=t[r+5];return n.LineSegmentsGeometry.prototype.setPositions.call(this,i),this},setColors:function(t){for(var e=t.length-3,i=new Float32Array(2*e),r=0;r<e;r+=3)i[2*r]=t[r],i[2*r+1]=t[r+1],i[2*r+2]=t[r+2],i[2*r+3]=t[r+3],i[2*r+4]=t[r+4],i[2*r+5]=t[r+5];return n.LineSegmentsGeometry.prototype.setColors.call(this,i),this},fromLine:function(t){var e=t.geometry;return e.isGeometry?this.setPositions(e.vertices):e.isBufferGeometry&&this.setPositions(e.position.array),this},copy:function(t){return this}})},function(t,e,i){var n=i(0);n.UniformsLib.line={linewidth:{value:1},resolution:{value:new n.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}},n.ShaderLib.line={uniforms:n.UniformsUtils.merge([n.UniformsLib.common,n.UniformsLib.fog,n.UniformsLib.line]),vertexShader:"#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nuniform float linewidth;\nuniform vec2 resolution;\nattribute vec3 instanceStart;\nattribute vec3 instanceEnd;\nattribute vec3 instanceColorStart;\nattribute vec3 instanceColorEnd;\nvarying vec2 vUv;\n#ifdef USE_DASH\nuniform float dashScale;\nattribute float instanceDistanceStart;\nattribute float instanceDistanceEnd;\nvarying float vLineDistance;\n#endif\nvoid trimSegment( const in vec4 start, inout vec4 end ) {\nfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\nfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\nfloat nearEstimate = - 0.5 * b / a;\nfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\nend.xyz = mix( start.xyz, end.xyz, alpha );\n}\nvoid main() {\n#ifdef USE_COLOR\nvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n#endif\n#ifdef USE_DASH\nvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n#endif\nfloat aspect = resolution.x / resolution.y;\nvUv = uv;\nvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\nvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\nbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\nif ( perspective ) {\nif ( start.z < 0.0 && end.z >= 0.0 ) {\ntrimSegment( start, end );\n} else if ( end.z < 0.0 && start.z >= 0.0 ) {\ntrimSegment( end, start );\n}\n}\nvec4 clipStart = projectionMatrix * start;\nvec4 clipEnd = projectionMatrix * end;\nvec2 ndcStart = clipStart.xy / clipStart.w;\nvec2 ndcEnd = clipEnd.xy / clipEnd.w;\nvec2 dir = ndcEnd - ndcStart;\ndir.x *= aspect;\ndir = normalize( dir );\nvec2 offset = vec2( dir.y, - dir.x );\ndir.x /= aspect;\noffset.x /= aspect;\nif ( position.x < 0.0 ) offset *= - 1.0;\nif ( position.y < 0.0 ) {\noffset += - dir;\n} else if ( position.y > 1.0 ) {\noffset += dir;\n}\noffset *= linewidth;\noffset /= resolution.y;\nvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\noffset *= clip.w;\nclip.xy += offset;\ngl_Position = clip;\nvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n#include <logdepthbuf_vertex>\n#include <clipping_planes_vertex>\n#include <fog_vertex>\n}",fragmentShader:"uniform vec3 diffuse;\nuniform float opacity;\n#ifdef USE_DASH\nuniform float dashSize;\nuniform float gapSize;\n#endif\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>\nvarying vec2 vUv;\nvoid main() {\n#include <clipping_planes_fragment>\n#ifdef USE_DASH\nif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\nif ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n#endif\nif ( abs( vUv.y ) > 1.0 ) {\nfloat a = vUv.x;\nfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\nfloat len2 = a * a + b * b;\nif ( len2 > 1.0 ) discard;\n}\nvec4 diffuseColor = vec4( diffuse, opacity );\n#include <logdepthbuf_fragment>\n#include <color_fragment>\ngl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );\n#include <premultiplied_alpha_fragment>\n#include <tonemapping_fragment>\n#include <encodings_fragment>\n#include <fog_fragment>\n}"},n.LineMaterial=function(t){n.ShaderMaterial.call(this,{type:"LineMaterial",uniforms:n.UniformsUtils.clone(n.ShaderLib.line.uniforms),vertexShader:n.ShaderLib.line.vertexShader,fragmentShader:n.ShaderLib.line.fragmentShader}),this.dashed=!1,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}}}),this.setValues(t)},n.LineMaterial.prototype=Object.create(n.ShaderMaterial.prototype),n.LineMaterial.prototype.constructor=n.LineMaterial,n.LineMaterial.prototype.isLineMaterial=!0,n.LineMaterial.prototype.copy=function(t){return n.ShaderMaterial.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.resolution=t.resolution,this}},function(t,e,i){var n,r,o=i(0);o.LineSegments2=function(t,e){o.Mesh.call(this),this.type="LineSegments2",this.geometry=void 0!==t?t:new o.LineSegmentsGeometry,this.material=void 0!==e?e:new o.LineMaterial({color:16777215*Math.random()})},o.LineSegments2.prototype=Object.assign(Object.create(o.Mesh.prototype),{constructor:o.LineSegments2,isLineSegments2:!0,computeLineDistances:(n=new o.Vector3,r=new o.Vector3,function(){for(var t=this.geometry,e=t.attributes.instanceStart,i=t.attributes.instanceEnd,a=new Float32Array(2*e.data.count),s=0,l=0,u=e.data.count;s<u;s++,l+=2)n.fromBufferAttribute(e,s),r.fromBufferAttribute(i,s),a[l]=0===l?0:a[l-1],a[l+1]=a[l]+n.distanceTo(r);var h=new o.InstancedInterleavedBuffer(a,2,1);return t.addAttribute("instanceDistanceStart",new o.InterleavedBufferAttribute(h,1,0)),t.addAttribute("instanceDistanceEnd",new o.InterleavedBufferAttribute(h,1,1)),this}),copy:function(t){return this}})},function(t,e,i){var n=i(0);n.Line2=function(t,e){n.LineSegments2.call(this),this.type="Line2",this.geometry=void 0!==t?t:new n.LineGeometry,this.material=void 0!==e?e:new n.LineMaterial({color:16777215*Math.random()})},n.Line2.prototype=Object.assign(Object.create(n.LineSegments2.prototype),{constructor:n.Line2,isLine2:!0,copy:function(t){return this}})},function(t,e,i){"use strict";(function(e){i(49);var n=i(0),r=i(2),o=i(51),a=i(103),s=i(35),l=i(52),u=i(54),h=i(19),c=i(108),d=i(58),p=i(109),f=i(5),m=i(18),g=i(32),v=i(1),y=i(7),b=i(9),w=i(10),x=i(15),M=i(8),T=i(4).EventEmitter,S=i(37),_=i(61),A=i(62),P=i(110),C=i(63),E=i(64),D=i(20),L=i(27),O=i(21),I=i(24),R=i(31),N=i(14),k=i(23),F=i(38),B=i(112),z=i(113),U=i(26),V=i(66),j=i(3),H=i(39),W=i(114),q=(i(13),new r("/js/player.js")),Y=(window.devicePixelRatio,Object.freeze({FlyToPano:M.getUniqueId(),FlyToNewMode:M.getUniqueId(),FlyToSameMode:M.getUniqueId(),FlyToViewFloor:M.getUniqueId(),LookTransition:M.getUniqueId(),ZoomTransition:M.getUniqueId()})),X=i(22),Z=i(16),K=i(28),Q=i(117),J=i(118),$=i(133),tt=i(134),et=i(136),it=i(137),nt=i(69),rt=i(139),ot=i(141),at=i(143),st=i(67);function lt(t){G.player=this,this.currentPano=null,this.currentPanoQuaternion=null,this.nextPano=null,this.camera=null,this.paused=!1,this.flying=!1,this.sceneIntersectionPlane=null,this.target=new n.Vector3,this.mouse=new n.Vector3(1.1,1.1,.5),this.mouseAtMouseDown=new n.Vector2,this.mouseCouldBeClickToMove=!1,this.inMeasureMode=!1,this.mouseLastMoveTime=Date.now(),this.mouseDown=!1,this.mouseDownTimer=null,this.couldBeLongTap=!1,this.containsMouse=!0,this.isTouchEvent=!1,this.isPanoHover=!1,this.reticule=new o(this),this.addTagReticule=new a(this),this.panoMarkers=[],this.spider=new p(this),this.quaternion=new n.Quaternion,this.position=new n.Vector3(15,10,15),this.previousState=null,this.lastInsideView=new d,this.last360View=new d,this.raycaster=new n.Raycaster,this.raycasterP=new n.Raycaster,this.intersect=null,this.lastChangeTime=Date.now(),this.history=new P,this.control=null,this.controls={},this.cameras={},this.path=null,this.model=null,this.domElement=null,this.cachedPanoCandidates=null,this.basePanoSize=0,this.standardPanoSize=0,this.highPanoSize=0,this.ultraHighPanoSize=0,this.zoomLevel=1,this.zooming=0,this.zoomSpeed=.5,this.scrollZoomSpeed=.06,this.zoomSpeedAdjust=.05,this.defaultZoomIncrement=.2,this.speedmultiplier=1,this.baseFov=v.insideFOV,this.zoomFov=this.baseFov,this.zoomEnabled=!0,this.preRenderingEnabled=!1,this.setupCustomProperties(t),this.urlPoint="/pc/add_label.html?",this.urlPoint3="/nest/ifaddtag/?",this.urlHighlights="/nest/ifaddscenes/?",this.normal_length=.1,this.zoomStats=new z,this.scene=null,this.clock=new n.Clock,this.walkOnPano=!1,this.measurementTool=null,this.measureTexture=null,this.connect=K(),this.handleOperation=this.handleOperation.bind(this),this.getCurrentState=this.getCurrentState.bind(this),this.connect.on("operation",this.handleOperation),this.disableNavigator=!1,this.lockedFlyToPano=!1,this.putModelTypes={human:!1,weapon:!1,camera:!1},this.isShowModelList=null,this.isLoadedSaveModel=!1,this.panoramaStartRotationFrom=!1}lt.prototype=Object.create(T.prototype),lt.prototype.init=function(t){this.modelManager=t.modelManager,this.tileDownloader=t.tileDownloader,this.panoRenderer=t.panoRenderer,this.sRender=this.panoRenderer.sceneRenderer,this.qualityManager=t.qualityManager,this.domElement=t.container,this.camera=t.camera,this.mattertagManager=t.mattertagManager,this.setUpControls(),this.path=new c(t.director,this),this.basePanoSize=this.qualityManager.getPanoSize(k.BASE),this.standardPanoSize=this.qualityManager.getPanoSize(k.STANDARD),this.highPanoSize=this.qualityManager.getPanoSize(k.HIGH),this.ultraHighPanoSize=this.qualityManager.getPanoSize(k.ULTRAHIGH),this.tileDownloader.processPriorityQueue=!1,this.tileDownloader.tilePrioritizer=new F(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),this.aiding=new Q(this),this.humanModelControls=new tt(this),this.humanModelControls.canbeUsed=!0,this.weaponModelControls=new et(this),this.weaponModelControls.canbeUsed=!0,this.postilControls=new it(this),this.postilControls.canbeUsed=!0,this.virtualCameraFovControls=new rt(this),this.virtualCameraFovControls.canbeUsed=!0,this.humanModelAnimationControls=new ot(this),this.humanModelAnimationControls.canbeUsed=!0,this.measuringToolControls=new at(this),this.measuringToolControls.canbeUsed=!0,this.baseControls=new J(this),this.putModelUIControls=new $(this),this.sRender.addComponent(this.baseControls),this.bindEvents(t.container),this.updateModel()},lt.prototype.setupCustomProperties=function(t){var e=t||f.PANORAMA;Object.defineProperty(this,"mode",{get:function(){return e},set:function(t){var i=e;e=t,this.onModeUpdated(i,e),this.changeSteeringWheelState(e)}})},lt.prototype.isInMode=function(){for(var t=0;t<arguments.length;t++)if(this.mode===arguments[t])return!0;return!1},lt.prototype.isOutsideMode=function(t){return(t=t||this.mode)===f.DOLLHOUSE||t===f.FLOORPLAN},lt.prototype.is360View=function(t,e){return t===f.PANORAMA&&e&&!e.isAligned()},lt.prototype.setScene=function(t){this.scene=t,this.sceneIntersectionPlane=t.plane,this.path.setScene(t),this.moveReticuleToScene(t)},lt.prototype.moveReticuleToScene=function(t){},lt.prototype.updateModel=function(){function t(t){var e=this.cameras[f.DOLLHOUSE],i=this.controls[f.DOLLHOUSE],n=e.position.y+(t-i.target.y),r=v.showFloorDuration+v.showFloorDelay;M.start(w.property(i.target,"y",t),r,null,v.flydown.movementDelay,x[v.flydown.movementEasing],null,Y.FlyToViewFloor),M.start(w.property(e.position,"y",n),r,null,v.flydown.movementDelay,x[v.flydown.movementEasing],null,Y.FlyToViewFloor)}this.model=this.modelManager.getActiveModel(),this.model.on("floor.changed",function(e,i,n){this.mode===f.DOLLHOUSE&&e!==n&&t.call(this,e.center.y)}.bind(this)),this.model.on("allfloors.toggled",function(e,i){if(this.mode===f.DOLLHOUSE){var n=e?this.model.center.y:lt=i.center.y;t.call(this,n)}}.bind(this)),this.on(D.PanoChosen,this.model.setProjectedPanos.bind(this.model));var e=this;this.model.panos.list.forEach((function(t){t.vrMarker.addEventListener("click",(function(){e.flyToPano({pano:t})}))}))},lt.prototype.updateModelDependentData=function(){this.setModelForControls(this.model),this.getPanoMarkersFromModel(this.model)},lt.prototype.onModelChanged=function(){this.updateModel(),this.updateModelDependentData()},lt.prototype.getPanoMarkersFromModel=function(t){this.panoMarkers=t.panos.list.reduce((function(t,e){return e.marker?t.concat(e.marker):t}),[])},lt.prototype.setModelForControls=function(t){this.controls[f.DOLLHOUSE].setZoomBounds(t.boundingBox);var e=this.model.boundingBox.clone().expandByScalar(v.modelBoundsPadding);[f.DOLLHOUSE,f.FLOORPLAN].forEach(function(t){this.controls[t].setBounds(e)}.bind(this))},lt.prototype.updateControlsForNewMode=function(t,e){this.controls[t]&&(this.controls[t].reset(),this.controls[t].enabled=!1),this.controls[e]&&(this.controls[e].enabled=!0),this.control=this.controls[e]},lt.prototype.getCurrentState=function(){var t=this.mode,e={mode:t,location:this.currentPano.id};return"panorama"===t?(e.position={x:this.camera.position.x,y:this.camera.position.y,z:this.camera.position.z},e.rotation={x:this.camera.quaternion.x,y:this.camera.quaternion.y,z:this.camera.quaternion.z,w:this.camera.quaternion.w}):"floorplan"===t?(e.position={x:this.camera.position.x,y:this.camera.position.y,z:this.camera.position.z},e.rotation={x:this.camera.quaternion.x,y:this.camera.quaternion.y,z:this.camera.quaternion.z,w:this.camera.quaternion.w},e.zoom=3):"dollhouse"===t&&(e.position={x:this.camera.position.x,y:this.camera.position.y,z:this.camera.position.z},e.rotation={x:this.camera.quaternion.x,y:this.camera.quaternion.y,z:this.camera.quaternion.z,w:this.camera.quaternion.w}),e},lt.prototype.setUpControls=function(){var t={};t[f.PANORAMA]=new S,t[f.DOLLHOUSE]=new _,t[f.FLOORPLAN]=new A;var e={};e[f.PANORAMA]=new s(t[f.PANORAMA]),e[f.DOLLHOUSE]=new l(t[f.DOLLHOUSE]),e[f.FLOORPLAN]=new u(t[f.FLOORPLAN]);var i=this.handleControlMove.bind(this),n=this.handleControlInputStart.bind(this);e[f.PANORAMA].on(L.Move,i),e[f.PANORAMA].on(L.Pinch,this.handleControlPinch.bind(this)),e[f.PANORAMA].on(L.Scroll,this.handleControlScroll.bind(this)),e[f.PANORAMA].on(L.RulersMove,this.handleControlRulersMove.bind(this)),e[f.PANORAMA].on(L.TtagsMove,this.handleControlTtagsMove.bind(this)),e[f.PANORAMA].on(L.InputStart,n),e[f.PANORAMA].on(L.PanoramaMove,this.handleControlPanoramaMove.bind(this)),e[f.PANORAMA].on(L.PanoramaMoveStop,this.handleControlPanoramaMoveStop.bind(this)),e[f.DOLLHOUSE].on(L.Move,i),e[f.DOLLHOUSE].on(L.InputStart,n),e[f.DOLLHOUSE].on("dollhouse-move",this.handleDollhouseMove.bind(this)),e[f.DOLLHOUSE].on("dollhouse-move-stop",this.handleDollhouseMoveStop.bind(this)),e[f.FLOORPLAN].on(L.Move,i),e[f.FLOORPLAN].on(L.InputStart,n),this.controls=e,this.cameras=t};var ut,ht,ct=!1,dt=!0;lt.prototype.handleControlPanoramaMove=function(){!1!==dt&&(ct=!1,this.baseControls&&this.baseControls.onHandleControlPanoramaMove())},lt.prototype.handleControlPanoramaMoveStop=function(){!0!==ct&&(dt=!1,ct=!0,this.baseControls&&this.baseControls.onHandleControlPanoramaMoveStop(),setTimeout((function(){dt=!0}),0))},lt.prototype.handleDollhouseMove=function(){this.baseControls&&this.baseControls.onHandleDollhouseMove()},lt.prototype.handleDollhouseMoveStop=function(){this.baseControls&&this.baseControls.onHandleDollhouseMoveStop()},lt.prototype.handleControlRulersMove=function(){this.emit(D.RulersMove)},lt.prototype.handleControlTtagsMove=function(){this.mattertagManager.ttposition(),!1!==dt&&this.baseControls&&this.baseControls.onHandleControlTtagsMove()},lt.prototype.handleControlMove=function(t){this.emit(D.Move,t),"panorama"===this.mode&&this.baseControls&&this.baseControls.onPlayerHandleControlPanoramaMove()},lt.prototype.handleControlInputStart=function(t){this.emit(D.InputStart,t)},lt.prototype.onModeUpdated=function(t,e){this.updateControlsForNewMode(t,e),this.emit(D.ModeChanged,t,e)},lt.prototype.isWarping=function(){return this.path.warping},lt.prototype.getLabelScaleFactor=function(){if(this.isOutsideMode()){return Math.sqrt(this.controls[f.FLOORPLAN].currentScale/10)}return.5},lt.prototype.bindEvents=function(t){for(var e in t!==document&&t.setAttribute("tabindex",-1),this.controls[f.PANORAMA].on(L.FlyInDirection,this.flyLocalDirection.bind(this)),t.addEventListener("mousedown",this.onMouseDown.bind(this),!1),t.addEventListener("mousemove",this.onMouseMove.bind(this),!1),t.addEventListener("mouseover",this.onMouseOver.bind(this)),t.addEventListener("mouseout",this.onMouseOut.bind(this)),t.addEventListener("mouseup",this.onMouseUp.bind(this),!1),t.addEventListener("mouseleave",this.onMouseLeave.bind(this)),this.modelManager.on(O.ActiveModelChanged,this.onModelChanged.bind(this)),t.addEventListener("touchstart",this.onTouchStart.bind(this)),t.addEventListener("touchmove",this.onTouchMove.bind(this)),t.addEventListener("touchend",this.onTouchEnd.bind(this)),t.addEventListener("pointerdown",this.onPointerDown.bind(this)),t.addEventListener("pointermove",this.onPointerMove.bind(this)),t.addEventListener("pointerup",this.onPointerUp.bind(this)),t.addEventListener("pointerout",this.onPointerOut.bind(this)),t.addEventListener("pointercancel",this.onPointerCancel.bind(this)),t.addEventListener("keyup",this.onKeyUpOfPlayerContainer.bind(this)),document.addEventListener("keydown",this.onKeyDown.bind(this)),document.addEventListener("keyup",this.onKeyUp.bind(this)),this.controls)this.controls[e].bindEvents(t);this.on(D.WarpEnded,this.updateWarpEnded.bind(this))},lt.prototype.updateWarpEnded=function(){this.mattertagManager.updateRegionalJumpTags(this.currentPano),this.steeringWheelPos(this.currentPano,null,50)},lt.prototype.onMouseDown=function(t){var i=this;if(this.disableNavigator=!1,this.lockedFlyToPano=!1,this.baseControls&&this.baseControls.onPlayerMouseDown(t),this.measuringToolControls.canbeUsed&&this.measuringToolControls.onPlayerMouseDown(t),this.measurementTool.onMouseDown(t),!this.disableNavigator&&(!this.humanModelControls.HUMANMODEL||this.humanModelControls.HUMANMODEL.userData.follow_mouse)&&(!this.weaponModelControls.CONTROLMODEL||this.weaponModelControls.CONTROLMODEL.userData.follow_mouse)&&(!this.virtualCameraFovControls.VIRTUAL_CAMERA||this.virtualCameraFovControls.VIRTUAL_CAMERA.userData.follow_mouse)){if(this.mattertagManager.intersectTag&&(this.mattertagManager.intersectTag.type===H.Tag360T1||1===this.mattertagManager.intersectTag.subtype))return t.preventDefault(),t.stopImmediatePropagation(),t.currentTarget!==document&&t.currentTarget.focus(),void(0===t.button&&(this.handleInputStart.call(this,t.clientX,t.clientY,!1),this.updateIntersect()));if(this.mattertagManager.intersectTag&&this.mattertagManager.intersectTag.type==H.Pano){var n=this.mattertagManager.intersectTag,r=function(){i.model.panos.index[n.locationId].marker.material.map=Z.loadurl(X.splitUrl("./images/texture/location/location_512x512.png")),n.materials.free.map=Z.loadurl(X.splitUrl("./images/disable_on_256x256.png")),n.materials.hover.map=Z.loadurl(X.splitUrl("./images/disable_on_256x256.png")),n.disc.material.map=Z.loadurl(X.splitUrl("./images/disable_on_256x256.png")),i.model.panos.index[n.locationId].enable=!0},o=function(){i.model.panos.index[n.locationId].marker.material.map=Z.loadurl(X.splitUrl("./images/texture/location/disable_512x512.png")),n.materials.free.map=Z.loadurl(X.splitUrl("./images/disable_off_256x256.png")),n.materials.hover.map=Z.loadurl(X.splitUrl("./images/disable_off_256x256.png")),n.disc.material.map=Z.loadurl(X.splitUrl("./images/disable_off_256x256.png")),i.model.panos.index[n.locationId].enable=!1};if(this.model.panos.index[n.locationId].enable){!function(t){if(G.settings.nestscenes&&G.settings.nestscenes.scenes&&G.settings.nestscenes.scenes.length){for(var e=G.settings.nestscenes.scenes,n=0;n<e.length;n++)if(e[n]._camera._locationid===t)return!1}else{var r=i.model.data.orientationkey;if(r){var o=!1;if(model.data.orientations.forEach((function(e,i){e.key===r&&e.location_id===t&&(o=!0)})),o)return!1}var a=i.model.panos;for(n=0;n<a.length;n++)if(2!=a.list[n].alignmentType)return a.list[n].id!==t}return!0}(n.locationId)?G.toast("已设置为场景点或初始点,不能隐藏"):"sms"===G.u[window.location.host].type?G.conf.isNewEditVersion?e.ajax({url:"/model/roam/hiddenpoint/",type:"POST",data:{point:n.locationId,enable:0}}).success((function(t){o()})).fail((function(t){alert("连接服务器失败")})):e.ajax({url:"/nest/hiddenpoint/",type:"POST",data:{point:n.locationId,enable:0}}).success((function(t){o()})).fail((function(t){alert("连接服务器失败")})):o()}else"sms"===G.u[window.location.host].type?G.conf.isNewEditVersion?e.ajax({url:"/model/roam/hiddenpoint/",type:"POST",data:{point:n.locationId,enable:1}}).success((function(t){r()})).fail((function(t){alert("连接服务器失败")})):e.ajax({url:"/nest/hiddenpoint/",type:"POST",data:{point:n.locationId,enable:1}}).success((function(t){r()})).fail((function(t){alert("连接服务器失败")})):r()}t.currentTarget!==document&&t.currentTarget.focus(),0===t.button&&(this.handleInputStart.call(this,t.clientX,t.clientY,!1),this.updateIntersect())}},lt.prototype.onMouseLeave=function(t){},lt.prototype.onMouseMove=function(t){if(this.baseControls&&this.baseControls.onPlayerMouseMove(t),(G.conf.modelMeasure||G.conf.publicity||G.measureMode)&&this.measuringToolControls.canbeUsed&&this.measuringToolControls.onPlayerMouseMove(t),this.isTouchEvent=!1,this.handleInputMove.call(this,t.clientX,t.clientY,!1),this.inMeasureMode){var e=b.convertWorldPositionToScreen(this.intersect.point,this.camera),i=new n.Vector2(e.x,(window.renderHeight || window.innerHeight)-e.y);i&&(this.measurementTool.onMouseMove(t),this.measureTexture.onMouseMove(t,this.model,i))}else this.model.chunks.forEach((function(t){t.material.uniforms.measureMode&&(t.material.uniforms.measureMode.value=0)}))},lt.prototype.onMouseOver=function(t){this.containsMouse=!0,!this.mouseDown||0!==t.which&&0!==t.buttons||(this.mouseDown=!1)},lt.prototype.onMouseOut=function(t){this.containsMouse=!1},lt.prototype.onMouseUp=function(t){this.baseControls&&this.baseControls.onPlayerMouseUp(t),this.inMeasureMode&&(this.measuringToolControls.canbeUsed&&this.measuringToolControls.onPlayerMouseUp(t),this.measurementTool.onMouseUp(t)),this.handleInputEnd.call(this,t.clientX,t.clientY,!1,t)},lt.prototype.monitorSelect=function(t,e){var i=new Object;if(i.type=this.currentPano.alignmentType,2!=this.currentPano.alignmentType){if(!t)return;(g={}).point=t.point.clone(),g.normal=t.normal.clone();var r=g.point.x,o=g.point.y,a=g.point.z,s=g.normal.x,l=g.normal.y,u=g.normal.z;this.spot=new n.Vector3(r,o,a),this.spot.add(g.normal.clone().multiplyScalar(this.normal_length));var h=this.spot.x-r,c=this.spot.y-o,d=this.spot.z-a,p=this.currentPano.id,f=this.camera.quaternion;i.locationid=p,i.x=r,i.y=o,i.z=a,i.nx=s,i.ny=l,i.nz=u,i.dx=h,i.dy=c,i.dz=d,i.qw=f.y,i.qx=f.z,i.qy=f.w,i.qz=f.x}else{var m=this.getMouseDirection(),g=Math.sqrt(4/(m.x*m.x+m.y*m.y+m.z*m.z));m.multiplyScalar(g),i.x=m.x,i.y=m.y,i.z=m.z,i.panoid=this.currentPano.id}this.emit(D.EditAddTagHighlight,i)},lt.prototype.onTouchStart=function(t){if(t.currentTarget!==document&&t.currentTarget.focus(),!this.mouseDown){var e=y.average(t.changedTouches,"clientX"),i=y.average(t.changedTouches,"clientY");this.handleInputStart.call(this,e,i,!0)}},lt.prototype.onTouchMove=function(t){var e=y.average(t.changedTouches,"clientX"),i=y.average(t.changedTouches,"clientY");this.handleInputMove.call(this,e,i,!0)},lt.prototype.onTouchEnd=function(t){this.updateIntersect(!0);var e=y.average(t.changedTouches,"clientX"),i=y.average(t.changedTouches,"clientY");this.handleInputEnd.call(this,e,i,!0,t)},lt.prototype.onPointerDown=function(t){},lt.prototype.onPointerMove=function(t){},lt.prototype.onPointerUp=function(t){},lt.prototype.onPointerOut=function(t){},lt.prototype.onPointerCancel=function(t){},lt.prototype.onKeyUpOfPlayerContainer=function(t){this.baseControls&&this.baseControls.onPlayerKeyUpPlayerContainer(t)},lt.prototype.onKeyUp=function(t){this.baseControls&&this.baseControls.onPlayerKeyUp(t)},lt.prototype.onKeyDown=function(t){if(this.mode!==f.FLOORPLAN){var e=function(){this.control&&this.control.emit(L.Move,"key")}.bind(this),i=t.which;switch(i){case g.F:e(),this.changeFloor(-1);break;case g.R:e(),this.changeFloor(1);case g.ESC:e(),G.measureMode&&(this.setMeasureEnable(!1),this.emit("exitMeasureActive"),this.measurementTool&&this.measurementTool.singleMeasuring,window.parent.cancelMeasure&&window.parent.cancelMeasure())}}},lt.prototype.handleScrollPinchZoom=function(t){var e=t,i=this.zoomLevel;this.zoomBy(e),this.currentPano&&this.zoomStats.addZoomAction(i,this.zoomLevel,this.currentPano.id)},lt.prototype.handleControlPinch=function(t){v.zoom.enabled?this.handleScrollPinchZoom(1-t):this.flyLocalDirection(new n.Vector3(0,0,t).normalize())},lt.prototype.handleControlScroll=function(t){v.zoom.enabled?(t>0?t=1+this.scrollZoomSpeed:t<0&&(t=1-this.scrollZoomSpeed),0!==t&&this.handleScrollPinchZoom(t)):this.flyLocalDirection(new n.Vector3(0,0,-t).normalize())},lt.prototype.handleInputStart=function(t,e,i){this.isTouchEvent=i,b.convertScreenPositionToNDC(t,e,this.mouse),b.convertScreenPositionToNDC(t,e,this.mouseAtMouseDown),this.mouseCouldBeClickToMove=!0,this.mouseDown=!0},lt.prototype.handleInputMove=function(t,e,i){this.isTouchEvent=i,b.convertScreenPositionToNDC(t,e,this.mouse),!this.inMeasureMode&&this.mouseAtMouseDown.distanceTo(this.mouse)>.02&&(this.mouseCouldBeClickToMove=!1),this.mouseLastMoveTime=Date.now(),this.reticule.move(t,e,i)},lt.prototype.handleInputEnd=function(t,e,i,n){if(this.isTouchEvent=i,this.mouseDown=!1,this.inMeasureMode)this.control&&this.control.emit(L.Move,this.isTouchEvent?"touch":"mouse"),this.history.invalidate();else if(this.controls[f.PANORAMA].emit("interaction.direct"),this.mouseCouldBeClickToMove){if(this.checkMattertagClick(n))return this.control&&(this.control.enabled=!0,this.control.onMouseUp(n)),!0;if(this.control&&this.control.emit(L.Move,this.isTouchEvent?"touch":"mouse"),this.history.invalidate(),this.intersect)return this.flyToPanoClosestToMouse();if(this.mode===f.PANORAMA){var r=this.closestPanoInDirection(this.getMouseDirection());return r?this.flyToPano({pano:r}):this.bump(this.getMouseDirection())}}},lt.prototype.checkMattertagClick=function(t){if(this.mattertagManager.intersectTag){var e=this.isTouchEvent,i=this.mattertagManager.clickedOnTag(e,this,t);return this.mattertagManager.intersectTag.tagid&&this.emit(D.ClickTag,this.mattertagManager.intersectTag.tagid),e||i||M.cancelById(Y.LookTransition),!0}if(this.mattertagManager.activeTag)return!1},lt.prototype.rankedMattertagInDirection=function(t,e){return this.mattertagManager.rankedMattertagInDirection(t,this.position,this.camera,e)},lt.prototype.start=function(t){var i=t.mode,r=t.pano,o=t.position,a=t.quaternion,s=t.tag,l=t.quickstart,u=e.Deferred(),h=new n.Quaternion;h.setFromAxisAngle(new n.Vector3(0,-1,0),Math.PI/4),G.p={position:new n.Vector3(1,1,1),quaternion:h},this.updateModelDependentData(),this.updateFromControls(),this.model.has360Views&&this.findDefaultViews();var c=this.is360View(i,r);return!this.model.outsideAllowed()||c||l?this.startInside(r,o,a,s,u):this.startOutside(t,u),u.done(function(t){this.emit(D.Ready,c,t,s)}.bind(this)),u.promise()},lt.prototype.startOutside=function(t,e){var i=t.mode,n=t.pano,r=t.position,o=t.quaternion,a=t.zoom,s=t.floorVisibility,l=t.tag;this.emit(D.StartOutside,v[i].transitionTime),this.isOutsideMode(i)?(this.model.warpDestFloors(s,!0),M.cancelById(Y.FlyToViewFloor),i===f.FLOORPLAN?this.floorplanMode(r,o,a):this.dollhouseMode(r,o),e.resolve(!1)):this.startInsideWithFlyin(n,r,o,l,e)},lt.prototype.startInside=function(t,i,n,r,o){o=o||e.Deferred(),this.currentPano=t;var a=t&&!t.isAligned();if(i=a?t.position:i||t.position,n=n||t.quaternion,t){a&&this.mattertagManager.update360Tags(t.id);var s=this.startInside.bind(this,t,i,n,r,o);if(this.checkAndWaitForPanoLoad(t,"high","low",this.basePanoSize,s))return}return this.mode=f.PANORAMA,t.floor.enter(this.mode),this.emit(D.PanoChosen,this.currentPano,this.currentPano),this.switchCameraMode(this.mode,n),this.emit(D.StartInside,a),o.resolve(!0),o},lt.prototype.startInsideWithFlyin=function(t,i,n,r,o){if(o=o||e.Deferred(),this.dollhouseMode(),!t)return q.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),o.resolve(!1),o;i=i||t.position;var a=n||t.quaternionAutoScene||this.control.camera.quaternion;t.position;return setTimeout(function(e){this.control&&(this.control.maxDistance=e);var i={mode:f.PANORAMA,pano:t,quaternion:a,callback:function(){o.resolve(!0)}.bind(this)};this.model.data.player_options.show3d&&this.model.startup_type===V.STAY3D&&""==j.valueFromHash("o","")&&""==j.valueFromHash("l","")?o.resolve(!0):this.flyToNewMode(i)}.bind(this,this.control.maxDistance),v.startupFlyinDelay),o},lt.prototype.checkAndWaitForPanoLoad=function(t,e,i,n,r,o,a,s,l,u){return null!=s||(s=!0),this.model.supportsTiles?this.checkAndWaitForTiledPanoLoad(t,n,r,o,a,s,l,u):this.checkAndWaitForWholePanoLoad(t,e,i,r,s)},lt.prototype.checkAndWaitForWholePanoLoad=function(t,e,i,n,r){if(!t)throw new N("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");return r&&this.model.waitForLoad(t,(function(){return t.isLoaded(i)})),!t.isLoaded(e)&&(t.loadCube(e).done(n),!0)},lt.prototype.checkAndWaitForTiledPanoLoad=(ut=new n.Vector3,ht=[],function(t,e,i,n,r,o,a,s){if(!t)throw new N("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");if(ut.copy(m.FORWARD),this.getDirection(ut),t.isLoaded(e))return!1;var l=e+":"+t.id;return ht[l]||(ht[l]=!0,o&&this.model.waitForLoad(t,(function(){return t.isLoaded(e)})),t.loadTiledPano(e,ut,null,a,s).done(function(t,e){ht[l]=!1,i&&i(t,e)}.bind(this)).fail(function(t){ht[l]=!1,n&&n(t)}.bind(this)).progress(function(t,e,i){r&&r(t,e,i)}.bind(this))),!0}),lt.prototype.resetDC=function(){var t=G.p.position.clone(),e=this.model.boundingBox.min.distanceTo(this.model.boundingBox.max);t.add(new n.Vector3(.5*e,.7*e,.5*e)).add(this.getDirection(null,!0).multiplyScalar(-6)),this.controls.dollhouse.lookAt(t,new n.Vector3(0,0,0),G.p.quaternion)},lt.prototype.switchCameraMode=function(t,e){var i=this.controls[t],n=i.camera;switch(t){case f.PANORAMA:n.position.copy(this.currentPano.position);var r=e?m.FORWARD.clone().applyQuaternion(e):this.getDirection().setY(0).normalize();i.lookAt(r.add(n.position));break;case f.DOLLHOUSE:this.resetDC();break;case f.FLOORPLAN:n.position.copy(this.model.center).setY(10),i.target.copy(this.model.center).setY(0),i.zoomToContain(this.model.size),i.rotateToView(this.model.size,this.getDirection())}i.update(0)},lt.prototype.update=function(){var t={},e=[];return function(i){this.updatePersistentZooming(i),this.updateFromControls(i),this.getCurrentNodePanos(e),this.hasChanged(t)&&(this.lastChangeTime=Date.now(),!this.mouseDown&&this.containsMouse&&this.updateIntersect(),this.model.supportsTiles&&this.updateTileDownloader(e),this.emit(D.ViewChanged)),this.model.supportsTiles&&(this.updateTileDownloader(t),this.updatePanoRenderer(t),this.updateZoomPano()),this.updatePreRendering(e),this.reticule.update(),this.path.update(),this.spider.update(),this.cachedPanoCandidates&&v.navigation.panoScores&&this.model.panos.showPanoScores(this.cachedPanoCandidates),this.updateControlLocks(),this.updateMeasureTexture()}}(),lt.prototype.updatePersistentZooming=function(t){1===this.zooming?this.zoomBy(1+this.zoomSpeed*t):-1===this.zooming&&this.zoomBy(1-this.zoomSpeed*t)},lt.prototype.updateControlLocks=function(){this.currentPano&&this.model.supportsTiles&&(this.controls[f.PANORAMA].locked=!this.currentPano.highestFullTileRenderOpCompleted&&this.currentPano.lockUntilRenderingComplete)},lt.prototype.updatePanoRenderer=function(){var t=new n.Vector3;return function(e){(this.nextPano||this.currentPano)&&(t.copy(m.FORWARD),this.getDirection(t),this.panoRenderer.updateDirection(t))}}(),lt.prototype.cleanupInactivePanos=function(){var t=[],e=[];return function(){t.length=0,t.push(this.currentPano),this.nextPano&&t.push(this.nextPano),e.length=0;for(var i=0;i<this.panoRenderer.activePanos.length;i++)e.push(this.panoRenderer.activePanos[i]);for(var n=0;n<e.length;n++){for(var r=e[n],o=!0,a=0;a<t.length;a++)r.id===t[a].id&&(o=!1);o&&r.exit()}}}(),lt.prototype.updatePreRendering=function(){var t={};return function(e){if(1===v.tiling.preRenderTourPanos&&this.preRenderingEnabled){var i=this.nextPano||this.currentPano;if(i&&e&&e.length>1){var n=e.findIndex((function(t){if(t.id===i.id)return!0}));if(n>=0&&n+1<e.length){var r=e[n+1];r.isLoaded(this.basePanoSize)||t[r.id]||(window.setTimeout(function(e){this.checkAndWaitForPanoLoad(e,"high","low",this.basePanoSize,null,null,null,!1,!1,!1),window.setTimeout(function(e){t[e.id]=!1}.bind(this,e),v.tiling.panoPreRenderRepeatDelay)}.bind(this,r),v.tiling.panoPreRenderDelay),t[r.id]=!0)}}}}}(),lt.prototype.enablePreRendering=function(){this.preRenderingEnabled=!0},lt.prototype.disablePreRendering=function(){this.preRenderingEnabled=!1,this.cleanupInactivePanos()},lt.prototype.updateTileDownloader=function(){var t=new n.Vector3;return function(e){var i=this.nextPano||this.currentPano;i&&(t.copy(m.FORWARD),this.getDirection(t),this.tileDownloader.tilePrioritizer.updateCriteria(i,this.position,t,e.length>0?e:null),this.tileDownloader.tilePrioritizer.zoomingActivated=this.zoomLevel>1,this.tileDownloader.processPriorityQueue=!0)}}(),lt.prototype.updateFromControls=function(t){null!=t||(t=0),this.control&&(this.control.update(t),this.quaternion.copy(this.control.camera.quaternion),this.position.copy(this.control.camera.position),this.target.copy(this.control.target),this.control.camera.updateProjectionMatrix(),this.camera.projectionMatrix.copy(this.control.camera.projectionMatrix)),this.camera.position.copy(this.position),this.camera.quaternion.copy(this.quaternion),this.camera.updateMatrix(),this.camera.updateMatrixWorld()},lt.prototype.hasChanged=function(t){if(!this.previousState)return this.previousState={allFloorsVisible:this.model.allFloorsVisible,position:this.position.clone(),quaternion:this.quaternion.clone(),mouse:this.mouse.clone(),zoom:this.getLabelScaleFactor(),currentFloor:this.model.currentFloor,projectionMatrix:this.camera.projectionMatrix.clone(),worldMatrix:this.camera.matrixWorld.clone(),mode:this.mode,modelPosition:this.model.position.clone(),modelCenter:this.model.center.clone(),zooming:this.zooming},!0;var e=this.model.allFloorsVisible===this.previousState.allFloorsVisible&&this.position.equals(this.previousState.position)&&this.quaternion.equals(this.previousState.quaternion)&&this.mouse.equals(this.previousState.mouse)&&this.getLabelScaleFactor()===this.previousState.zoom&&this.model.currentFloor===this.previousState.currentFloor&&this.camera.projectionMatrix.equals(this.previousState.projectionMatrix)&&this.camera.matrixWorld.equals(this.previousState.worldMatrix)&&this.mode===this.previousState.mode&&this.model.position.equals(this.previousState.modelPosition)&&this.model.center.equals(this.previousState.modelCenter)&&null!==this.nextPano&&this.zooming===this.previousState.zooming;return t.allFloorsVisible=this.model.allFloorsVisible!==this.previousState.allFloorsVisible,t.moved=!this.position.equals(this.previousState.position),t.rotated=!this.quaternion.equals(this.previousState.quaternion),t.mouseMoved=!this.mouse.equals(this.previousState.mouse),t.zoomed=this.getLabelScaleFactor()!==this.previousState.zoom,t.floorChanged=this.model.currentFloor!==this.previousState.currentFloor,t.cameraProjectionChanged=!this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),t.cameraWorldMatrixChanged=!this.camera.matrixWorld.equals(this.previousState.worldMatrix),t.modeChanged=this.mode!==this.previousState.mode,t.modelPositionChanged=!this.model.position.equals(this.previousState.modelPosition),t.modelCenterChanged=!this.model.center.equals(this.previousState.modelCenter),t.nextPanoActive=null!==this.nextPano,t.zooming=this.zooming!==this.previousState.zooming,this.previousState.allFloorsVisible=this.model.allFloorsVisible,this.previousState.position.copy(this.position),this.previousState.quaternion.copy(this.quaternion),this.previousState.mouse.copy(this.mouse),this.previousState.zoom=this.getLabelScaleFactor(),this.previousState.currentFloor=this.model.currentFloor,this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),this.previousState.worldMatrix.copy(this.camera.matrixWorld),this.previousState.mode=this.mode,this.previousState.modelPosition.copy(this.model.position),this.previousState.modelCenter.copy(this.model.center),this.previousState.zooming=this.zooming,!e},lt.prototype.updateIntersect=function(t){if(!j.isMobile()||t){var e=this.flying||this.isWarping(),i=this.isOutsideMode()&&this.controls[this.mode].isEngaged(),n=M.getById(Y.LookTransition),r=!(e||i||this.isTouchEvent||n.length&&n[0].running);this.inMeasureMode&&this.intersectPoints(this.mouse,this.camera),this.mattertagManager.intersectMattertag(this.mouse,r,this.camera)||(this.intersect=this.getMouseIntersect(),this.intersect&&this.updateClosestPano(this.intersect),this.closestPano||this.closestPanoInDirection(this.getMouseDirection())?(this.reticule.updatePosition(this.position,this.intersect),v.navigation.panoScores&&!v.navigation.mouseDirection&&this.closestPanoInDirection(this.getDirection())):(this.reticule.updatePosition(this.position,this.intersect),v.isEditVersion&&this.addTagReticule.hide()))}},lt.prototype.intersectPoints=function(t,e){var i=this.mouse.clone(),r=this.model.floors.reduce((function(t,e){return e.hidden?t:t.concat(e.collider.children)}),this.mode===f.PANORAMA?this.panoMarkers:[]),o=new n.Vector3(i.x,i.y,-1).unproject(this.camera);this.raycasterP.set(o,this.getMouseDirection(i));var a=r.concat(G.MT.allSpheres),s=this.raycasterP.intersectObjects(a);if(s.length>0&&"SphereGeometry"==s[0].object.geometry.type){this.raycasterP.set(this.intersect.point,this.intersect.face.normal);this.raycasterP.intersectObjects(r).length}this.intersect&&(this.intersect.point.add(this.intersect.face.normal.clone().multiplyScalar(.01)),G.pointsIntersect={point:this.intersect.point,normal:this.intersect.normal})},lt.prototype.getMouseDirection=function(t){t=t||this.mouse;var e=new n.Vector3(t.x,t.y,-1).unproject(this.camera);return new n.Vector3(t.x,t.y,1).unproject(this.camera).sub(e).normalize()},lt.prototype.getMouseOnWholeIntersect=function(t){},lt.prototype.computeIntersectWithFloor=function(t,e,i){return i=i||this.model.floors.reduce((function(t,e){return e.hidden?t:t.concat(e.collider.children)}),this.mode===f.PANORAMA?this.panoMarkers:[]),this.raycaster.set(t,e,1),this.raycaster.intersectObjects(i)},lt.prototype.getMouseIntersect=function(t,e){t=t||this.mouse.clone(),e=e||this.model.floors.reduce((function(t,e){return e.hidden?t:t.concat(e.collider.children)}),this.mode===f.PANORAMA?this.panoMarkers:[]);var i=new n.Vector3(t.x,t.y,-1).unproject(this.camera),r=this.computeIntersectWithFloor(i,this.getMouseDirection(t),e);if(0===r.length)return null;var o=r[0];o.face&&(o.normal=o.face.normal.applyQuaternion(o.object.quaternion),this.position.clone().sub(o.point).dot(o.normal)<0&&o.normal.negate(),this.currentPano?o.onFloor=o.point.y<this.position.y-.5*this.currentPano.height:o.onFloor=o.point.y<this.position.y-.5,o.horizontal=o.normal.y>.8);return o},lt.prototype.updateClosestPano=function(t){if(this.currentPano){var e=[h.filters.isPanoAligned()];this.mode===f.PANORAMA?(e.push(h.filters.not(this.currentPano)),e.push(h.filters.inFloorDirection(this.currentPano.floorPosition,this.getDirection(),.25)),e.push(h.filters.isNeighbourPanoTo(this.currentPano)),e.push(h.filters.isCloseEnoughTo(t.point,v.panoFloorClickRadius)),e.push(h.filters.isNotBehindNormal(t.point,t.normal))):(e.push(h.filters.isOnVisibleFloor()),this.mode!==f.FLOORPLAN&&e.push(h.filters.inDirection(this.position,this.getDirection(),.25)));var i=this.model.panos.find(e,[h.sortFunctions.floorDistanceToPoint(t.point)]);i!=this.closestPano&&(this.emit(D.ClosestPanoChanging,this.closestPano,i,this.mode),this.closestPano=i)}},lt.prototype.dollhouseMode=function(t,e){this.emit(D.ModeChanging,this.mode,f.DOLLHOUSE),this.mode=f.DOLLHOUSE,this.controls[f.DOLLHOUSE].reset();new n.Vector3(this.model.center.x,0,this.model.center.z),new n.Vector3(15,20,15);this.controls[f.DOLLHOUSE].resetRanges(0,!0),this.resetDC(),this.updateFromControls(),this.model.alpha=1,this.model.skybox.material.uniforms.opacity.value=0},lt.prototype.insideMode=function(t,e){if(e=e||null,this.mode!==f.PANORAMA&&this.mode!==f.TRANSITIONING){var i=[h.filters.isPanoAligned()];this.model.currentFloor&&i.push(h.filters.atFloor(this.model.currentFloor)),t=t||this.currentPano||this.model.panos.find(i,[h.sortFunctions.distanceToPoint(this.control.target)]);var n=null!==this.currentPanoQuaternion?this.currentPanoQuaternion:void 0;this.flyToNewMode({mode:f.PANORAMA,pano:t,callback:e,quaternion:n})}},lt.prototype.fitDollhouse=function(t,e,i){var r=m.FORWARD.clone().applyQuaternion(i);this.control.target.copy(r).add(t);var o=m.RIGHT.clone().applyQuaternion(i),a=m.UP.clone(),s=o.clone().applyAxisAngle(a,Math.PI/2),l=this.model.boundingBox.max.clone(),u=this.model.boundingBox.min.clone(),h=[new n.Vector3(l.x,0,l.z).sub(t),new n.Vector3(l.x,0,u.z).sub(t),new n.Vector3(u.x,0,l.z).sub(t),new n.Vector3(u.x,0,u.z).sub(t)],c=0,d=0,p=0;h.forEach((function(t,e,i){var n=Math.abs(t.dot(o)),r=t.dot(s);n>c&&(c=n,d=r),r>p&&(p=r)}));var f=Math.sqrt(Math.pow(l.x-u.x,2)+Math.pow(l.z-u.z,2)),g=f+1/Math.max(2*f,1);this.modellen=f;var y=Math.max(Math.abs(new n.Vector3(0,l.y,0).sub(t).dot(a)),Math.abs(new n.Vector3(0,u.y,0).sub(t).dot(a))),b=s.clone().multiplyScalar(d).add(e),w=s.clone().multiplyScalar(p).add(e);d=c/Math.tan(this.control.camera.fov/2*this.control.camera.aspect*(Math.PI/180)),p=y/Math.tan(this.control.camera.fov/2*(Math.PI/180)),d=Math.max(.5*d,g),p=Math.max(.5*p,g);var x=r.clone().multiplyScalar(-d).add(b).sub(e).length(),M=r.clone().multiplyScalar(-p).add(b).sub(e).length();this.control.maxDistance=v.skyboxRadius-1,x>=M?this.control.camera.position.set(0,6,0).add(b).add(r.multiplyScalar(1.1*-d)):this.control.camera.position.set(0,6,0).add(w).add(r.multiplyScalar(1.1*-p))},lt.prototype.floorplanMode=function(t,e,i){this.mode=f.FLOORPLAN;var n=this.controls[f.FLOORPLAN];n.reset();var r=t||this.model.center;if(n.target.copy(r).setY(0),n.camera.position.copy(r).setY(10),i?(n.currentScale=i/((window.renderWidth || window.innerWidth)/(window.renderHeight || window.innerHeight)),n.absoluteScale=n.currentScale):n.zoomToContain(this.model.size),e){var o=m.LEFT.clone().applyQuaternion(e);n.rotateLeft(-Math.atan2(o.x,o.z))}else n.rotateToView(this.model.size,this.getDirection());n.update(0)},lt.prototype.nonInterruptingFlyToPano=function(t,e){return t.skipWarpingCheck=!0,this.flyToPano(t,e)},lt.prototype.handleOperation=function(t){if("flytopano"===t.type){var e=t.id,i=this.model.panos.get(e);this.remoteFlyToPano({pano:i})}},lt.prototype.flyToPano=function(t,e){this.lockedFlyToPano||this.connect.getSyncState()&&(this.connect.remoteControl||this.connect.sync||this.connect.sendOperation({type:"flytopano",id:t.pano.id}),this.evalFlyToPano(t,e))},lt.prototype.remoteFlyToPano=function(t,e){this.evalFlyToPano(t,e)},lt.prototype.evalFlyToPano=function(t,e){var i=this,r=t.pano,o=t.lookAtPoint,a=t.duration,s=t.maxDistanceOverride,l=t.skipWarpingCheck,u=t.constantMoveSpeed,h=null,c=null;if(this.isWarping()&&!l){if(this.path.activeTransType===I.BLACK)return q.warn("Player.flyToPano() -> Cannot fly when warping"),e&&e(),!1;(h=y.deepExtend(t)).skipWarpingCheck=!0;var d=this.evalFlyToPano.bind(this,h,null);return this.emit(D.WarpInterruptedWithFlyTo,this.path.activeTransType,d),e&&e(),!1}if(this.updateLastView(),this.mode===f.PANORAMA){if(!r||(h=y.deepExtend(t),c=this.evalFlyToPano.bind(this,h,e),!this.checkAndWaitForPanoLoad(r,"high","low",this.basePanoSize,c))){var p=function(t){e&&e(t)}.bind(this);this.currentPano||(this.currentPano=r,this.path.placeCpm(),this.path.fadeOutCpm(v.path.fadeOutTime),this.spider.draw());var g=a;if("number"!=typeof a){var b=s||v.transition.flytimeMaxDistanceThreshold;g=(Math.min(this.currentPano.position.distanceTo(r.position),b)*v.transition.flytimeDistanceMultiplier+v.transition.flyTime)*this.speedmultiplier}if(v.transition.flySpeed>.01&&(g=1e3*this.currentPano.position.distanceTo(r.position)/v.transition.flySpeed),1!==this.zoomLevel)switch(v.zoom.transitionStyle){case 1:this.smoothZoomToDefault(g/2);break;case 2:return h=y.deepExtend(t),c=this.evalFlyToPano.bind(this,h,e),void this.smoothZoomToDefault(v.zoom.restoreTime*(this.zoomLevel-1),c)}if(o){M.cancelById(Y.LookTransition),g*=v.transition.aimSlowFactor;var T=this.control.camera.quaternion.clone(),S=(new n.Matrix4).lookAt(r.position,o,m.UP),_=(new n.Quaternion).setFromRotationMatrix(S),A=T.clone(),P=new n.Vector3;if(r===this.currentPano){var C=m.FORWARD.clone().applyQuaternion(T),E=m.FORWARD.clone().applyQuaternion(_),O=C.angleTo(E),R=1*Math.sqrt(O)/v.mattertags.navigate.rotateSpeedFactor*1e3;return void M.start(function(t){A.copy(T),w.quaternion(A,_)(t),P.copy(m.FORWARD).applyQuaternion(A).add(this.control.camera.position),this.control.lookAt(P),i.handleControlPanoramaMove()}.bind(this),R,p,0,x[v.transition.movementEasing],null,Y.LookTransition)}}if(r===this.currentPano||this.flying)return void p();this.flying=!0;var N=this.position.clone(),k=this.currentPano;q.debug("Flying to pano ",r.position),this.emit(D.PanoChosen,this.currentPano,r),this.emit(D.FlyingStarted,r.position,N,r,k),o&&M.start(function(t){A.copy(T),w.quaternion(A,_)(t),P.copy(m.FORWARD).applyQuaternion(A).add(this.control.camera.position),this.control.lookAt(P)}.bind(this),g,null,0,x[v.transition.movementEasing],null,Y.LookTransition);var F=u?null:x[v.transition.movementEasing];this.updateRulers(g),this.steeringWheelPos(r,this.currentPano,g),this.measurementTool.updateMeasureVisible(r),this.nextPano=r,this.emit("PanoAnimation",this.nextPano,g),G.R.recording&&this.record(this.currentPano,this.nextPano),M.start(w.uniform(this.model.skybox,"progress",1),g,null,0,x[v.transition.blendEasing],"skyFly",Y.FlyToPano),M.start(w.allUniforms(this.model.chunks,"progress",1),g,null,0,x[v.transition.blendEasing],"chunkFly",Y.FlyToPano),M.start(w.vector(this.cameras[f.PANORAMA].position,r.position),g,function(t){this.flying=!1,this.currentPano.exit(),r.enter(),this.currentPano=r,this.nextPano=null,this.path.placeCpm(),this.path.fadeOutCpm(v.path.fadeOutTime),this.spider.draw(),this.emit(D.FlyingEnded,r.position,N,r,k),p(t),i.currentPano&&(this.walkOnPano||this.emit(L.MoveHighlightsBar,i.currentPano.roomid),this.mattertagManager.updateRegionalJumpTags(r))}.bind(this),0,F,"camFly",Y.FlyToPano)}}else this.flyToNewMode({mode:f.PANORAMA,pano:r,callback:e})},lt.prototype.record=function(t,e){G.R.last&&G.R.last.time+.05>parseFloat(G.R.time.getElapsedTime().toFixed(5))&&G.R.save2({tap:G.R.last.tap,panoid:G.R.last.panoid,action:G.R.last.action,lon:parseFloat(G.R.last.lon.toFixed(5)),lat:parseFloat(G.R.last.lat.toFixed(5)),time:parseFloat(G.R.last.time.toFixed(5))}),G.R.save({tap:"panorama",panoid:t.id,action:"move",destid:e.id})},lt.prototype.updateRulers=function(t){var e=0,i=Math.ceil(t/20),n=this,r=setInterval((function(){++e>i&&clearInterval(r),n.emit(L.RulersWalk)}),20)},lt.prototype.steeringWheelPos=function(t,e,i){if(this.model.steeringWheel&&t.id&&t.position){var n=t.id,r=(G.model.panos.list,this),o=i||400;this.model.steeringWheel.position.copy(t.position),this.model.steeringWheel.material.opacity=0,M.start(w.property(this.model.steeringWheel.material,"opacity",.6),o),this.model.settings.locations.points.forEach((function(t,e){if(t.locationid===n)return r.model.steeringWheel.position.y=t.spot.z+.1,!1}))}},lt.prototype.changeSteeringWheelState=function(t){t===f.PANORAMA?this.model.showSteeringWheel():t!==f.DOLLHOUSE&&t!==f.FLOORPLAN||this.model.hideSteeringWheel()},lt.prototype.fastForwardActivePanoFlight=function(t){t=t||v.transition.fastForwardFactor/10*4+1;for(var e=M.getById(Y.FlyToPano),i=0;i<e.length;i++)M.adjustSpeed(e[i],t)},lt.prototype.setSpeedMultiplier=function(t){var e=1,i=1200;switch(t){case"0.3×":e=3,i*=1.5,v.warp.minWarpTime=i;break;case"0.5×":e=2,i*=1.2,v.warp.minWarpTime=i;break;case"1.0×":e=1;break;case"1.5×":e=.67;break;case"2.0×":e=.5;break;default:e=1}this.speedmultiplier=e},lt.prototype.flyToPanoClosestToMouse=function(){if(Date.now()-this.mouseLastMoveTime>50&&(this.intersect=this.getMouseIntersect(),this.intersect&&this.updateClosestPano(this.intersect)),this.closestPano)return this.flyToPano({pano:this.closestPano});var t=this.getMouseDirection();this.flyDirection(t)||this.flyToPano({pano:this.currentPano})},lt.prototype.flyLocalDirection=function(t){var e=this.getDirection(t),i=1===t.z?.4:.75,n=1===Math.abs(t.x);this.flyDirection(e,i,n)},lt.prototype.flyDirection=function(t,e,i){this.history.invalidate();var n=this.closestPanoInDirection(t,e,i);return n?(this.flyToPano({pano:n}),!0):(this.bump(t),!1)},lt.prototype.closestPanoInDirection=function(t,e,i){return this.rankedPanoInDirection(0,t,e,i)},lt.prototype.rankedPanoInDirection=function(){var t={pano:null,candidates:[]};return function(e,i,n,r){e||(e=0),n=void 0!==n?n:.75;var o=r?"angle":"direction";return this.model.panos.findRankedByScore(e,[h.filters.isPanoAligned(),h.filters.inPanoDirection(this.position,i,n),h.filters.isNeighbourPanoTo(this.currentPano),h.filters.not(this.currentPano)],[h.scoreFunctions.distanceSquared(this.currentPano),h.scoreFunctions[o](this.position,i)],t),this.cachedPanoCandidates=t.candidates,t.pano}}(),lt.prototype.bump=function(t){if(this.mode===f.PANORAMA&&!this.flying&&!this.isWarping()){var e,i,r,o=v.transition,a=(o.flytimeMaxDistanceThreshold*o.flytimeDistanceMultiplier+o.flyTime)/8,s=this.camera.getWorldDirection(new n.Vector3).dot(t);if(Math.abs(s)>.5)e=function(){M.start(w.property(this.cameras[f.PANORAMA],"zoom",s>0?1.04:.96),a,i,0,x.easeInOutSine,"bumpZStart")}.bind(this),i=function(){M.start(w.property(this.cameras[f.PANORAMA],"zoom",1),5*a,r,0,x.easeInOutSine,"bumpZRelax")}.bind(this);else{var l=this.camera.position.clone(),u=t.clone();this.raycaster.set(l,u);var h=this.model.floors.reduce((function(t,e){return t.concat(e.collider.children)}),[]),c=this.raycaster.intersectObjects(h),d=c.length>0?c[0].distance/25:.04,p=l.clone().add(u.multiplyScalar(d));e=function(){M.start(w.vector(this.cameras[f.PANORAMA].position,p),a,i,0,x.easeInOutSine,"bumpTStart")}.bind(this),i=function(){M.start(w.vector(this.cameras[f.PANORAMA].position,l),5*a,r,0,x.easeInOutSine,"bumpTRelax")}.bind(this)}r=function(){this.flying=!1}.bind(this),this.flying=!0,e()}},lt.prototype.changeFloor=function(t,e){var i=this.controls[this.mode];if(i&&i.emit(L.Move,e),e&&this.controls[f.PANORAMA].emit(L.InteractionGui,"floor-control"),!this.is360View(this.mode,this.currentPano))if(this.mode===f.PANORAMA){var n=this.history.reversePano(t);n&&n.isAligned()?this.flyToPano({pano:n}):this.changeFloorByScore(t)}else this.model.setFloor(this.model.nextFloor(t)||this.model.currentFloor)},lt.prototype.changeFloorByScore=function(){var t={pano:null,candidates:[]};return function(e){var i=this.model.nextFloor(e);return i?(this.model.panos.lowestByScore([h.filters.atFloor(i),h.filters.isPanoAligned()],[h.scoreFunctions.distance(this.currentPano),h.scoreFunctions.direction(this.position,new n.Vector3(0,e,0)),h.scoreFunctions.penalizeHeightDifferenceUnder(this.position,.5)],t),void(t.pano?(this.cachedPanoCandidates=t.candidates,this.history.push(e,this.currentPano),this.flyToPano({pano:t.pano})):q.warn("No pano found on selected floor, not moving there."))):void q.debug("player.changeFloor("+e+"): no such floor")}}(),lt.prototype.gotoFloor=function(t,e){var i=t-this.model.currentFloor.floorIndex;this.changeFloor(i,e)},lt.prototype.getDirection=function(t,e){return t=t||(new n.Vector3).copy(m.FORWARD),e?t.applyQuaternion(G.p.quaternion):t.applyQuaternion(this.camera.quaternion)},lt.prototype.getHighlightDirection=function(t){return(t=t||(new n.Vector3).copy(m.FORWARD)).applyQuaternion(this.model.heroImage._camera._rotation)},lt.prototype.flyToSameMode=function(t,e,i,r){var o=this;if(this.mode===f.TRANSITIONING)return q.warn("should not be transitioning here"),void(r&&r(!1));var a=i||!1,s=i?i.position:this.position,l=this.position.clone(),u=this.currentPano;if(q.debug("New pose in mode "+this.mode),t){var h=this.flyToSameMode.bind(this,t,e,i,r);if(this.checkAndWaitForPanoLoad(t,"high","low",this.basePanoSize,h))return}var c=function(){this.emit(D.FlyingEnded,s,l,t,u),r&&r(!0),o.currentPano}.bind(this),d=v[this.mode],p=void 0!==e?e:d.transitionTime,m=new n.Vector3,g=new n.Vector3;if(this.emit(D.FlyingStarted,s,l,t,u),this.mode===f.PANORAMA)q.warn("we should not be here for panorama views");else if(this.mode===f.DOLLHOUSE)if(a){var y=new n.Vector3(0,1,0);this.controls[f.DOLLHOUSE].resetRanges(1,!0),this.model.warpDestFloors(i.floorVisibility),g.copy(i.position);var b=new n.Vector3(0,0,-1).applyQuaternion(i.quaternion),T=new n.Raycaster(g.clone(),b.clone(),0,1/0).intersectObjects(this.model.colliders),S=3;T.length?(m.copy(T[0].point),S=.75*g.distanceTo(m)):(m.copy(b).multiplyScalar(3).add(g),q.debug("Tried to restore dollhouse mode that did not intersect...",i.position,i.quaternion));var _=(new n.Matrix4).lookAt(g,m,y),A=(new n.Euler).setFromRotationMatrix(_,v.warp.eOrder),P=m.distanceTo(g),C=(new n.Matrix4).lookAt(this.cameras[f.DOLLHOUSE].position,this.controls[f.DOLLHOUSE].target,y),E=(new n.Euler).setFromRotationMatrix(C,v.warp.eOrder),L=this.cameras[f.DOLLHOUSE].position.distanceTo(this.controls[f.DOLLHOUSE].target);this.controls[f.DOLLHOUSE].resetRanges(Math.min(L,S),!0);var O=new n.Euler(A.x-E.x,A.y-E.y,A.z-E.z,v.warp.eOrder);O.y>Math.PI?O.y-=2*Math.PI:O.y<-Math.PI&&(O.y+=2*Math.PI),this.path.burnsDir=Math.sign(O.y);var I=new n.Euler(0,0,0,v.warp.eOrder),R=new n.Vector3;M.start(w.vector(this.controls[f.DOLLHOUSE].target,m),p,null,v.flydown.movementDelay,x[v.flydown.movementEasing],null,Y.FlyToSameMode),M.start(function(t,e){I.x=E.x+t*O.x,I.y=E.y+t*O.y,I.z=E.z+t*O.z;var i=L+t*(P-L);R.set(0,0,i).applyEuler(I).add(this.controls[f.DOLLHOUSE].target),this.cameras[f.DOLLHOUSE].position.copy(R).add(this.model.position)}.bind(this),p,null,v.flydown.movementDelay,x[v.flydown.movementEasing],null,Y.FlyToSameMode),M.start(function(t,e){this.controls[f.DOLLHOUSE].update(),this.quaternion.copy(this.cameras[f.DOLLHOUSE].quaternion),this.position.copy(this.cameras[f.DOLLHOUSE].position)}.bind(this),p,null,v.flydown.movementDelay,x[v.flydown.movementEasing],null,Y.FlyToSameMode)}else q.warn("invalid warp destination in flyToSameMode()? ignore it then");else if(this.path.placeCpm(),this.path.fadeInCpm(v.path.fadeInTime),i){this.model.warpDestFloors(i.floorVisibility);var N=this.cameras[f.FLOORPLAN],k=this.controls[f.FLOORPLAN],F=k.target.clone(),B=i.position.clone().sub(F),z=N.position.clone().sub(k.target).length(),U=new n.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize(),V=Math.atan2(k.offset.x,k.offset.z),j=Math.atan2(U.x,U.z),H=k.absoluteScale,G=i.orthoZoom/((window.renderWidth || window.innerWidth)/(window.renderHeight || window.innerHeight));M.start(function(t,e){k.target.copy(B).multiplyScalar(t).add(F);var i=V+(j-V)*t;k.offset.x=z*Math.sin(i),k.offset.z=z*Math.cos(i),N.position.copy(k.target).add(k.offset),k.absoluteScale=H+t*(G-H),k.update(),this.quaternion.copy(N.quaternion),this.position.copy(N.position),this.target.copy(k.target),this.camera.projectionMatrix.copy(N.projectionMatrix)}.bind(this),p,null,0,x[v.flydown.movementEasing],null,Y.FlyToSameMode)}else q.info("flyToSameMode() funny floorplan view? skipping");M.setTimeout(function(t){this.mode=t,c()}.bind(this,this.mode),p,Y.FlyToSameMode),this.mode=f.TRANSITIONING},lt.prototype.ownFlyToNewMode=function(t){var e=(t=t||{}).mode,i=t.pano,n=t.duration,r=t.warpDest,o=t.callback,a=t.force;t.quaternion;if(this.isWarping())return q.warn("Player.flyToNewMode() -> Cannot fly when warping"),void(o||o(!1));if(this.mode!==f.TRANSITIONING)if(e!==this.mode){q.debug("Switching mode to "+e);var s=this.ownFlyToNewMode.bind(this,t);if(!i||!this.checkAndWaitForPanoLoad(i,"low","low",this.basePanoSize,s)){if(!this.model.meshTexturesLoaded&&this.isOutsideMode(e))return q.info("Waiting for model textures to be loaded before going out to dollhouse"),this.model.waitForLoad(this.model,(function(){return self.model.meshTexturesLoaded})),void this.model.loadMeshTextures().done(s);this.history.invalidate(),this.updateLastView();var l=this.mode;this.cameras[e];t=y.deepExtend({},v[e],v[l+"-"+e]);void 0!==n||t.transitionTime}}else a?this.flyToSameMode(i,n,r,o):o&&o(!1);else o&&o(!1)},lt.prototype.flyToNewMode=function(t){var e=this,i=(t=t||{}).mode,r=t.pano,o=t.duration,a=t.warpDest,s=t.callback,l=t.force,u=t.quaternion;if(this.isWarping())return q.warn("Player.flyToNewMode() -> Cannot fly when warping"),void(s&&s(!1));if(this.mode!==f.TRANSITIONING){if(i===this.mode)return l?void this.flyToSameMode(r,o,a,s):void(s&&s(!1));var h=a||!1;q.debug("Switching mode to "+i);var c=this.flyToNewMode.bind(this,t);if(!r||!this.checkAndWaitForPanoLoad(r,"low","low",this.basePanoSize,c)){if(!this.model.meshTexturesLoaded&&this.isOutsideMode(i))return q.info("Waiting for model textures to be loaded before going out to dollhouse"),this.model.waitForLoad(this.model,function(){return this.model.meshTexturesLoaded}.bind(this)),void this.model.loadMeshTextures().done(c);this.history.invalidate(),this.updateLastView();var d=this.mode,p=this.cameras[i];t=y.deepExtend({},v[i],v[d+"-"+i]);var m=void 0!==o?o:t.transitionTime;this.emit(D.ModeChanging,d,i,r),r&&(this.currentPano=r),d===f.PANORAMA&&(this.currentPanoQuaternion=this.quaternion.clone()),this.switchCameraMode(i,u),M.cancelById(Y.LookTransition);var g=(new n.Vector3).copy(this.position);if(i===f.PANORAMA)this.emit(D.PanoChosen,r,r),setTimeout(function(){r.floor.enter(i)}.bind(this),m/2),this.path.fadeOutCpm(v.path.fadeOutTime);else if(i===f.DOLLHOUSE){if(h&&(this.model.stayPut=!0),a?(this.controls[f.DOLLHOUSE].resetRanges(1,!0),this.model.warpDestFloors(a.floorVisibility)):this.model.toggleAllFloors(!0),this.path.placeCpm(),this.path.fadeInCpm(v.path.fadeInTime),h){var b=new n.Vector3(this.model.center.x,0,this.model.center.z);g.set(15,10,15);var T=new n.Vector3(0,0,-1).applyQuaternion(a.quaternion),S=new n.Raycaster(a.position.clone(),T.clone(),0,1/0).intersectObjects([this.sceneIntersectionPlane]);S.length?(b.copy(S[0].point),g.copy(a.position),this.controls[f.DOLLHOUSE].resetRanges(.75*g.distanceTo(b),!0)):(q.warn("Tried to restore dollhouse mode that did not intersect...",a.position,a.quaternion),this.controls[f.DOLLHOUSE].resetRanges(3,!0)),this.controls[f.DOLLHOUSE].target.copy(b),g.add(this.model.position),p.position.copy(g),this.controls[f.DOLLHOUSE].update()}}else if(this.path.placeCpm(),this.path.fadeInCpm(v.path.fadeInTime),a){this.model.warpDestFloors(a.floorVisibility);var _=this.cameras[f.FLOORPLAN],A=this.controls[f.FLOORPLAN],P=_.position.clone().sub(A.target),O=new n.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize(),N=Math.atan2(O.x,O.z);A.target.copy(a.position);var k=P.length();A.offset.x=k*Math.sin(N),A.offset.y=0,A.offset.z=k*Math.cos(N),_.position.copy(A.target).add(A.offset),A.target.clone().sub(p.position),p.quaternion.copy(a.quaternion),A.currentScale=a.orthoZoom/((window.renderWidth || window.innerWidth)/(window.renderHeight || window.innerHeight)),A.absoluteScale=A.currentScale,A.update()}else this.model.currentFloor.enter(i);var F=this.currentPano,B=this.position.clone();this.emit(D.FlyingStarted,g,B,r,this.currentPano),this.flying=!0,this.isOutsideMode(i)&&this.is360View(d,F)?(h||i!==f.DOLLHOUSE||(p.position.set(15,10,15),p.controls.target.set(this.model.center.x,0,this.model.center.z),p.controls.update()),t.blackoutStyle=R.FADEIN,m=v.show360Views.transitionTime,this.fade360View(m,p,t)):this.isOutsideMode(d)&&this.is360View(i,r)?(h&&this.switchCameraMode(i,h.quaternion),this.mode=i,this.path&&this.path.popOutCpm(),t.blackoutStyle=R.END,m=v.show360Views.transitionTime,this.fade360View(m,p,t)):(M.start(w.property(this.model,"alpha",t.modelAlpha,null),m*t.modelAlphaLength,null,t.modelAlphaDelay,null,Y.FlyToNewMode),M.start(w.vector(this.position,p.position),m,null,v.flydown.movementDelay,x[v.flydown.movementEasing],null,Y.FlyToNewMode),M.start(w.quaternion(this.quaternion,p.quaternion),m*t.rotationDuration,null,t.rotationDelay,x[v.flydown.rotationEasing],null,Y.FlyToNewMode),M.start(w.matrix4(this.camera.projectionMatrix,p.projectionMatrix),m*t.cameraMatrixDuration,null,t.cameraMatrixDelay,t.cameraMatrixEase,null,Y.FlyToNewMode),M.start(w.uniform(this.model.skybox,"opacity",t.skyboxOpacity),m*t.skyboxOpacityLength,null,t.skyboxOpacityDelay,null,Y.FlyToNewMode),M.start(w.property(this.reticule.material.uniforms.opacity,"value",0),m,null,Y.FlyToNewMode)),M.setTimeout(function(){this.flying=!1,d===f.PANORAMA&&i!==f.PANORAMA?this.currentPano.exit():d!==f.PANORAMA&&i===f.PANORAMA&&(this.currentPano.enter(),this.path.placeCpm(),this.path.fadeOutCpm(v.path.fadeOutTime),this.spider.draw()),d===f.DOLLHOUSE&&this.controls[f.DOLLHOUSE].resetRanges(),this.mode=i,this.emit(D.FlyingEnded,g,B,this.currentPano,F),e.currentPano&&("panorama"===G.player.mode&&this.emit(L.MoveHighlightsBar,e.currentPano.roomid),this.steeringWheelPos(e.currentPano),this.mattertagManager.updateRegionalJumpTags(e.currentPano),this.measurementTool&&this.measurementTool.updateMeasureVisible(e.currentPano),this.measuringToolControls&&this.measuringToolControls.onFlyEnd()),e.model.entranceMesh&&(e.mode===f.DOLLHOUSE?e.model.setEntranceState(!0):e.model.setEntranceState(!1)),h&&d!==f.PANORAMA&&i===f.PANORAMA?this.startWarp(E.Retain,C.Retain,I.BLACK,null,null,s):s&&s()}.bind(this),m,Y.FlyToNewMode),this.mode=f.TRANSITIONING}}else s&&s(!1)},lt.prototype.fade360View=function(t,i,n){this.mattertagManager.hideShowTagsForBlackoutStyle(n.blackoutStyle,t),e(this.domElement).fadeOut(.5*t,function(){this.model.skybox.material.uniforms.opacity.value=n.skyboxOpacity,this.model.alpha=n.modelAlpha,this.position.copy(i.position),this.quaternion.copy(i.quaternion),this.camera.projectionMatrix.copy(i.projectionMatrix),e(this.domElement).fadeIn(.5*t)}.bind(this))},lt.prototype.findDefaultViews=function(){this.findDefaultView(this.lastInsideView,!0),this.findDefaultView(this.last360View,!1)},lt.prototype.findDefaultView=function(t,e){var i,n=this.model.heroLocations,r=this.model.panos,o=n.findIndex((function(t){if(t.cameraMode!==f.PANORAMA)return!1;var i=r.get(t.panoId);return i&&i.isAligned()===e}));o>=0?(i=r.get(n[o].panoId),t.update({cameraMode:f.PANORAMA,pano:i,position:n[o].position,quaternion:n[o].quaternion})):(o=r.list.findIndex((function(t){return t.isAligned()===e})))>=0?(i=r.list[o],t.update({cameraMode:f.PANORAMA,pano:i,position:i.position})):q.warn("There are no",e?"inside":"360??","views in this model")},lt.prototype.updateLastView=function(){this.mode===f.PANORAMA&&(this.currentPano.isAligned()?this.lastInsideView:this.last360View).update({pano:this.currentPano,position:this.position,quaternion:this.quaternion})},lt.prototype.goToLastView=function(t){var e=t?this.lastInsideView:this.last360View;this.isInMode(f.PANORAMA)&&this.currentPano.isAligned()!==t&&this.updateLastView(),this.isInMode(f.PANORAMA)?(this.path&&this.path.popOutCpm(),this.fadeToView(t,e,v.show360Views.transitionTime)):this.isOutsideMode()&&this.flyToNewMode({mode:e.cameraMode,pano:e.pano,quaternion:e.quaternion})},lt.prototype.setStateWithAnimation=function(t,e){t&&(t.mode&&t.mode!==this.mode&&this.mode!==f.TRANSITIONING?t.mode===f.PANORAMA?this.flyToNewMode({pano:this.model.panos.index[t.panoId],mode:f.PANORAMA}):(s.prototype._progressNumber=function(t,e,i){return t+(e-t)*i},s.prototype._progressRad=function(t,e,i){var n=2*Math.PI,r=Math.PI,o=function(t){return(t%n+n)%n};return t=o(t),(e=o(e))-t>r?this._progressNumber(t+n,e,i):t-e>r?this._progressNumber(t-n,e,i):this._progressNumber(t,e,i)}):this.mode!==f.TRANSITIONING&&this.controls[this.mode].translateWithAnimation(t.lon,t.lat,e),t.zoomLevel&&t.zoomLevel!==this.zoomLevel&&this.zoomTo(t.zoomLevel,!0))},lt.prototype.fadeToView=function(t,i,n){if(!i.isValid()||i.cameraMode===f.PANORAMA&&!i.pano)return q.warn("Tried to fade to an illegal view",i.cameraMode),!1;var r=function(){e(this.domElement).fadeIn(.5*n)}.bind(this),o=t?R.FADEIN:R.END;this.mattertagManager.hideShowTagsForBlackoutStyle(o,n),e(this.domElement).fadeOut(.5*n,function(){this.model.fadePanoMarkers(t?v.panorama.markerOpacity:0),i.cameraMode===f.PANORAMA?this.flyToPano({pano:i.pano,lookAtPoint:m.FORWARD.clone().applyQuaternion(i.quaternion).add(i.pano.position),duration:0},r):this.flyToNewMode({mode:i.cameraMode,quaternion:i.quaternion,duration:0,callback:r})}.bind(this))},lt.prototype.startWarp=function(t,e,i,n,r,o){if(this.control&&(this.control.enabled=!1),this.flying)return q.warn("Player.startWarp() -> Cannot warp when flying"),o&&o(),!1;null!=t||(t=E.Show),this.history.invalidate(),"walk"===i?this.walkOnPano=!0:(this.walkOnPano=!1,this.updateRulers(1e3)),t!=E.Retain?this.path.brushToWarpPano(i,I.BLACK)||(i=I.BLACK):i=this.path.upcomingTransType;var a=this.path.warpDestPano&&!this.path.warpDestPano.isAligned();return this.emit(D.WarpStarted,a,i,n,r),n=n||R.MIDDLE,this.path.warpToPano(i,n,r,function(){e===C.Slow?this.path.discardSlow():e===C.Standard&&this.path.discardPathObject(),this.emit(D.WarpEnded,i),this.control&&(this.control.enabled=!0),o&&o()}.bind(this)),t===E.Hide&&this.path.discardPathObject(),!0},lt.prototype.warpToPanoById=function(t,e,i,n,r,o,a,s){return this.path.setWarpDestinationByPanoId(t,e)?this.startWarp(i,n,r,o,a,s):(q.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),s&&s(),!1)},lt.prototype.warpToPanoByHeroIndex=function(t,e,i,n,r,o,a){if(-1!=e)return this.path.setWarpDestinationByHeroIndex(t)?this.startWarp(e,i,n,r,o,a):(a&&a(),!1);this.startWarp(e,i,n,r,o,a)},lt.prototype.warpToPano=function(t,e,i,n,r,o,a,s){return this.warpToPanoById(t.id,e,i,n,r,o,a,s)},lt.prototype.warpToNonPanoByHeroIndex=function(t,e){return this.path.setWarpDestinationByHeroIndex(t)?(this.path.warpToNonPano(e),!0):(q.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),e&&e(),!1)},lt.prototype.aimTourCamera=function(t,e,i,n){return this.warpToPanoByHeroIndex(t,e,i,null,null,null,n)},lt.prototype.showPathToHeroLocation=function(t){this.mode!==f.PANORAMA&&this.path.setWarpDestinationByHeroIndex(t)&&this.path.brushToWarpPano(I.STD,I.BLACK)},lt.prototype.tourInterlude=function(t,e){this.history.invalidate(),this.path.discardSlow(),this.path.waitNextStep(t,(function(){e&&e()}))},lt.prototype.stopInterlude=function(){this.interruptAndFastForward(null,0)},lt.prototype.interruptAndFastForward=function(t,e){this.isWarping()&&this.emit(D.WarpInterrupted,this.path.activeTransType,t,e),this.flying&&this.emit(D.FlyingInterrupted),this.path.interruptAndFastForward(t,e)},lt.prototype.setSize=function(t,e){var i=t/e;for(var n in this.cameras)this.cameras[n].updateAspect(i)},lt.prototype.toJSON=function(){var t={};return this.control?((t=this.control.toJSON())._type=f.toInt(this.mode),this.isOutsideMode()?this.model.allFloorsVisible?t.floor_visibility=[]:t.floor_visibility=this.model.floors.list.map((function(t){return t.hidden?0:1})):f.PANORAMA&&(t._locationid=this.currentPano.id),t):t},lt.prototype.getCurrentNodePanos=function(t){if(this.model.panos.map,t.length=0,this.path.nodes)for(var e=0;e<this.path.nodes.length;e++){var i=this.path.nodes[e];t.push(this.model.panos.get(i))}},lt.prototype.zoomIncrementally=function(t){var e=this.zoomLevel;this.zoomTo(this.zoomLevel+t),e!==this.zoomLevel&&this.currentPano&&this.zoomStats.addZoomAction(e,this.zoomLevel,this.currentPano.id)},lt.prototype.zoomInIncrementally=function(t){t=t||this.defaultZoomIncrement,this.zoomIncrementally(t)},lt.prototype.zoomOutIncrementally=function(t){t=t||-this.defaultZoomIncrement,this.zoomIncrementally(t)},lt.prototype.zoomBy=function(t){this.zoomTo(this.zoomLevel*t)},lt.prototype.zoomIn=function(){this.zoomBy(1+this.zoomSpeed)},lt.prototype.zoomOut=function(){this.zoomBy(1-this.zoomSpeed)},lt.prototype.jumpTo3D=function(){G.d.changeMode(f.DOLLHOUSE),G.d.jumpingto3d=!0},lt.prototype.zoomTo=function(t,e){if(e||v.zoom.enabled&&this.mode===f.PANORAMA&&this.zoomEnabled){if(t<v.zoom.min?this.zf?this.clock.getElapsedTime()-this.start>3?this.zf=!1:(this.len+=v.zoom.min-t,this.len>.26&&(this.jump=!0,this.zf=!1)):(this.start=this.clock.getElapsedTime(),this.zf=!0,this.len=0,this.jump=!1):(this.zf=!1,this.len=0,this.jump=!1),t<v.zoom.min){t=v.zoom.min;var i=G.model.outsideAllowed(),n=!this.isInMode(f.DOLLHOUSE,f.TRANSITIONING);if(this.jump&&i&&n)return G.R.recording&&G.R.save({tap:"dollhouse"}),void this.jumpTo3D()}if(t>v.zoom.max&&(t=v.zoom.max),t>this.zoomLevel?(this.emit(B.ZoomIn),t===v.zoom.max&&this.emit(B.ZoomMax)):t<this.zoomLevel&&(this.emit(B.ZoomOut),t===v.zoom.min&&this.emit(B.ZoomMin)),this.control){G.R.recording&&G.R.save({tap:"zoom",type:"panorama",level:t});var r=this.control.camera;this.zoomLevel=t,r.fov=this.baseFov*(1/this.zoomLevel),r.updateProjectionMatrix(),this.zoomFov=r.fov}}},lt.prototype.increaseZoomSpeed=function(){this.zoomSpeed=this.clampZoomSpeed(this.zoomSpeed+this.zoomSpeedAdjust)},lt.prototype.decreaseZoomSpeed=function(){this.zoomSpeed=this.clampZoomSpeed(this.zoomSpeed-this.zoomSpeedAdjust)},lt.prototype.clampZoomSpeed=function(t){return t<0?0:t},lt.prototype.activatePersistentZooming=function(t){this.zooming=t?1:-1},lt.prototype.deactivatePersistentZooming=function(){this.zooming=0},lt.prototype.zoomDefault=function(){this.zoomTo(1,!0)},lt.prototype.smoothZoomToDefault=function(t,e){var i,n=this.zoomLevel,r=function(t){t>1&&(t=1),i=n*(1-t)+t,this.zoomTo(i,!0)}.bind(this),o=function(){this.zoomDefault(),e&&window.setTimeout(e,50)}.bind(this);M.start(r,t,o,null,0,x[v.transition.blendEasing])},lt.prototype.updateZoomPano=function(){if(!this.panoRenderer.zoomPanoRenderingDisabled&&this.mode===f.PANORAMA){var t=this.currentPano;if(t){var e=this.zoomLevel>v.zoom.activationThreshold,i=!(this.flying&&this.nextPano&&this.nextPano!==this.currentPano)&&!this.isWarping(),n=e&&i;this.tileDownloader.tilePrioritizer.setZoomingActive(n),this.panoRenderer.setZoomingActive(n,t,!0);var r=function(t,e){this.panoRenderer.resetRenderStatus(t.id,!1,!0,this.qualityManager.getMaxNavPanoSize()),this.panoRenderer.clearAllQueuedUploadsForPano(t.id),this.panoRenderer.renderPanoTiles(t.id,null,!1,!1),t.setZoomed(e)}.bind(this);n&&!t.zoomed?(r(t,!0),this.panoRenderer.enableUltraHighQualityMode(function(){this.qualityManager.useUltraHighResolutionPanos&&!v.zoom.overridemax&&(v.zoom.max=U.ultraHighQualityMaxZoom),n&&r(t,!0)}.bind(this))):!e&&t.zoomed&&r(t,!1)}}},lt.prototype.initMeasure=function(){this.measurementTool=new W(this),this.measureTexture=new st(this),this.measureTexture.createNewColliders(),this.measureTexture.createMeasureLens(),this.measurementTool&&(this.measurementTool.init(this.model),this.measuringToolControls.init(this.measurementTool),this.measurementTool.updateMeasureVisible(this.currentPano))},lt.prototype.updateMeasureMode=function(t){this.measurementTool.updateMode(t)},lt.prototype.setMeasureEnable=function(t){t?(G.measureMode=!0,this.reticule.visible=!0,this.measurementTool.startInsertion({showDistances:!0,showArea:!0,closed:!0},!j.isMobile()),this.measurementTool.intoMeasureMode(!j.isMobile()),this.measureTexture.show()):(G.measureMode=!1,this.reticule.visible=!1,this.measurementTool&&(this.measurementTool.exitMeasureMode(),this.model.chunks.forEach((function(t){t.material.uniforms.measureMode&&(t.material.uniforms.measureMode.value=0)}))),this.measureTexture.hide())},lt.prototype.updateMeasureTexture=function(){this.inMeasureMode&&this.measureTexture&&this.measureTexture.update()},lt.prototype.removeMeasurement=function(){this.measurementTool.removeMeasurement()},lt.prototype.showMeasure=function(t){this.measurementTool.show(t)},lt.prototype.hideMeasure=function(t){this.measurementTool.hide(t)},lt.prototype.showAllMeasure=function(){this.measurementTool.showAll()},lt.prototype.hideAllMeasure=function(){this.measurementTool.hideAll()},lt.prototype.deleteMeasure=function(t){this.measurementTool.delete(t)},lt.prototype.changeMeasureName=function(t,e){this.measurementTool.changeName(t,e)},lt.prototype.clickedOnMeasure=function(t){var e=null;if(this.measurementTool&&this.measurementTool.activeMeasurement&&(e=this.measurementTool.activeMeasurement.points),!this.measurementTool||!this.measurementTool.measurements||e&&e.length>1)return!1;this.measurementTool.selected(t);var i=null,r=null;if(this.measurementTool.measurements.forEach((function(e){e.measureid!==t&&e.uuid!==t||(i=e.location_id,r=e.areaDetail.desc_position)})),i){var o={pano:this.model.panos.index[i],lookAtPoint:new n.Vector3(r.x,r.y,r.z)};this.flyToPano(o)}},lt.prototype.disOnMeasure=function(t){this.measurementTool.disSelected(t)},lt.prototype.changeUnit=function(t){this.measurementTool.changeUnit(t)},lt.prototype.setAutoFit=function(t){this.measurementTool.setAutoFit(t)},lt.prototype.setMeasureArea=function(t){this.measurementTool.setMeasureArea(t)},lt.prototype.loadHumanModel=function(t){this.baseControls&&this.baseControls.loadHumanModel(t)},lt.prototype.updatePutModelColor=function(t){this.humanModelControls.HUMANMODEL&&this.humanModelControls.updateSkinColor(t),this.weaponModelControls.CONTROLMODEL&&this.weaponModelControls.updateModelColor(t)},lt.prototype.hidePutModel=function(t){this.humanModelControls.handleHideHumanModel(t),this.weaponModelControls.handleHideModel(t),this.virtualCameraFovControls.handleHideModel(t)},lt.prototype.showPutModel=function(t){this.putModelUIControls&&this.putModelUIControls.showPutModel(t)},lt.prototype.handleClickCompleteBtn=function(){this.putModelUIControls&&this.putModelUIControls.handleClickCompleteBtn()},lt.prototype.removePutModel=function(t){this.humanModelControls.handleDeleteHumanModel(t),this.weaponModelControls.handleDeleteModel(t),this.virtualCameraFovControls.handleDeleteModel(t)},lt.prototype.showModelList=function(t){this.baseControls&&this.baseControls.showModelsList(t)},lt.prototype.hideModelList=function(){this.baseControls&&this.baseControls.hideModelsList()},lt.prototype.updatePutModelName=function(t){this.putModelUIControls&&this.putModelUIControls.updatePutModelName(t)},lt.prototype.resetPutModel=function(){this.putModelUIControls&&this.putModelUIControls.resetPutModel()},lt.prototype.updatePutModelGroundClearance=function(t){0<=1*t&&(this.emit("hidePutModelSetTools"),this.putModelUIControls&&this.putModelUIControls.updateModelGroundClearance(t))},lt.prototype.updateSizeOfPutModel=function(t){this.emit("hidePutModelSetTools"),this.putModelUIControls&&this.putModelUIControls.updateSizeOfPutModel(t)},lt.prototype.selectPutModel=function(t){},lt.prototype.savePutModel=function(){if(this.baseControls)return this.baseControls.savePutModels()},lt.prototype.showHumanModelBonesNode=function(){this.putModelUIControls&&this.putModelUIControls.showHumanModelBonesNode()},lt.prototype.bundleTranslateControlOfPutModel=function(){this.putModelUIControls&&this.putModelUIControls.bundleTranslateControlOfPutModel()},lt.prototype.bundleRotateControlOfPutModel=function(){this.putModelUIControls&&this.putModelUIControls.bundleRotateControlOfPutModel()},lt.prototype.virtualSetSlideStop=function(t){this.putModelUIControls&&this.putModelUIControls.onVirtualSetSlideStop(t)},lt.prototype.handleClickModelItem=function(t){this.putModelUIControls&&this.putModelUIControls.handleClickModelItem(t)},lt.prototype.loadProbeModel=function(t){this.baseControls&&this.baseControls.loadWeaponModel(t)},lt.prototype.updateCollision=function(t){this.putModelUIControls&&this.putModelUIControls.updateCollision(t)},lt.prototype.loadPostilModel=function(t){this.baseControls&&this.baseControls.loadPostilModel(t)},lt.prototype.updatePostilInfo=function(t){this.putModelUIControls&&this.putModelUIControls.updatePostilInfo(t)},lt.prototype.savePostilsInfo=function(){var t={},e="";if(this.humanModelControls){for(var i=this.postilControls.PostilOfScene,n=0;n<i.length;++n){var r=i[n].userData.setting_item;t[i[n].uuid]=r}return e=JSON.stringify(t),"1"==j.getQueryString("isLocal")&&localStorage.setItem("POSTILS_INFO_SAVE",e),e}},lt.prototype.loadPostilsOfSave=function(t){this.postilControls.hideAll=!1;var e=[];if(0<this.postilControls.PostilOfScene.length){for(var i=0;i<this.postilControls.PostilOfScene.length;++i){var n=this.postilControls.PostilOfScene[i];n.visible=!0;var r=n.userData.setting_item;r.visible=!0,e.push(r),this.emit("add-postil-item",r)}this.emit("show-all-postils",e)}else{var o=this,a=(e=[],[]);for(var s in t)e.push(t[s]);!function t(){var i=e[a.length],n=new nt(i.type).init(i),r=n.userData.setting_item,s=[];r.visible=!0,s.push(r);var l=o.panoMarkers.filter((function(t){return r.current_location_id===t.pano.id}))[0];n.userData.marker=l,o.addPostilIntoScene(n),a.push(n.uuid),a.length!==e.length?t():o.emit("show-all-postils",s)}()}},lt.prototype.addPostilIntoScene=function(t){this.postilControls.PostilOfScene.push(t),this.postilControls.PostilOfKV[t.uuid]=t,this.sRender.scene.add(t),this.emit("add-postil-item",t.userData.setting_item),this.postilControls.updateMarkerTexture(t)},lt.prototype.hidePostilsOfSave=function(){this.postilControls.hideAll=!0;for(var t=[],e=0;e<this.postilControls.PostilOfScene.length;++e){var i=this.postilControls.PostilOfScene[e];i.visible=!1;var n=i.userData.setting_item;n.visible=!1,t.push(n)}this.emit("hide-all-postils",t)},lt.prototype.removePostil=function(t){this.emit("show-delete-dialog-of-postil",t)},lt.prototype.deletePostilOfConfirm=function(t){this.postilControls.handleDeletePostil(t)},lt.prototype.editPostil=function(t){var e=this;if(this.postilControls.PostilOfKV[t]){var i=this.postilControls.PostilOfKV[t],n=i.userData.setting_item,r=n.current_location_id;return this.emit("hide-postil-set-tool"),this.flyToPano({pano:this.model.panos.index[r],lookAtPoint:i.position},(function(t){e.postilControls.POSTIL&&e.postilControls.POSTIL.uuid!==i.uuid&&(e.postilControls.destroyControl(e.postilControls.POSTIL),e.postilControls.destroyBox(e.postilControls.POSTIL)),e.postilControls.POSTIL=i,e.postilControls.handleChoosedPostil(i),e.emit("show-edit-panel-of-postil")})),n}},lt.prototype.editConfirm=function(t){if(this.postilControls.PostilOfKV[t]){var e=this.postilControls.PostilOfKV[t].userData.setting_item;this.emit("edit-confirm",e)}},lt.prototype.loadVirtualCamera=function(t){this.baseControls&&this.baseControls.loadVirtualCamera(t)},lt.prototype.updateVirtualCameraFov=function(t){this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.updateVirtualCameraFov(t)},lt.prototype.updateVirtualCameraDistance=function(t){this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.updateVirtualCameraDistance(t)},lt.prototype.onIntoEditMode=function(){this.putModelUIControls&&this.putModelUIControls.onIntoEditMode()},lt.prototype.onQuitEditMode=function(){this.putModelUIControls&&this.putModelUIControls.onQuitEditMode()},lt.prototype.onIntoPutMode=function(){this.putModelUIControls&&this.putModelUIControls.onIntoPutMode()},lt.prototype.onQuitPutMode=function(){this.putModelUIControls&&this.putModelUIControls.onQuitPutMode()},lt.prototype.onApiQuitPutMode=function(){this.baseControls&&this.baseControls.handleKeyOfESC(),this.putModelUIControls&&this.putModelUIControls.onQuitPutMode()},lt.prototype.onIntoEditMeasure=function(){this.measurementTool&&this.measurementTool.onIntoEditMeasure()},lt.prototype.onQuitEditMeasure=function(){this.measurementTool&&this.measurementTool.onQuitEditMeasure()},lt.prototype.showVirtualCameraMeasurement=function(t){this.putModelUIControls&&this.putModelUIControls.showVirtualCameraMeasurement(t)},lt.prototype.hideVirtualCameraMeasurement=function(t){this.putModelUIControls&&this.putModelUIControls.hideVirtualCameraMeasurement(t)},lt.prototype.addModel=function(t){this.sRender.scene.add(t)},lt.prototype.setModelPose=function(t,e){},t.exports=lt}).call(this,i(6))},function(t,e,i){function n(t){r.call(this,t)}var r=i(14);n.prototype=Object.create(r.prototype),t.exports=n},function(t,e,i){function n(t){r.call(this,t)}var r=i(14);n.prototype=Object.create(r.prototype),t.exports=n},function(t,e){t.exports={NONE:0,CONTEXTUAL:1,ANDROID:2}},function(t,e,i){var n=i(0);t.exports={newBlue:new n.Color("#28eff5"),altBlue:new n.Color(47355),classicBlue:new n.Color(53759),mpYellow:new n.Color(16502016),mpOrange:new n.Color(16428055),mpBlue:new n.Color(12096),mpLtGrey:new n.Color(13751252),mpDkGrey:new n.Color(10000019),mpRed:new n.Color(12525854),mpOrangeDesat:new n.Color(16764529),mpBlueDesat:new n.Color(4034734),mpRedDesat:new n.Color(14705505),white:new n.Color(16777215),yellow:new n.Color("#FFBF32"),black:new n.Color(0),_desat:function(t,e){var i=e||.3,r=(new n.Color).copy(t).getHSL({h:0,s:0,l:0});return(new n.Color).setHSL(r.h,r.s*(1-i),r.l)},_darken:function(t,e){var i=e||.2,r=(new n.Color).copy(t).getHSL({h:0,s:0,l:0});return(new n.Color).setHSL(r.h,r.s,r.l*(1-i))}}},function(t,e,i){var n=i(22);function r(t){var e=o.UniformsUtils.clone(h.waypoint.uniforms);e.map.value=d,e.opacity.value=0,e.color.value.set(a.reticuleColor),o.Mesh.call(this,new o.PlaneBufferGeometry(.2,.2,1,1),new o.RawShaderMaterial({side:o.DoubleSide,depthWrite:!1,depthTest:!1,transparent:!0,vertexShader:h.waypoint.vertexShader,fragmentShader:h.waypoint.fragmentShader,uniforms:e,name:"waypoint",opacity:0})),this.renderOrder=c.reticule,this.player=t,this.direction=new o.Vector3,this.hidden=!0,this.mouseLastMoveTime=Date.now(),this.lineMaterial=new o.LineBasicMaterial({linewidth:a.mattertags.pole.width,color:a.mattertags.pole.color,opacity:1,transparent:!0,alphaTest:a.mattertags.pole.opacity*a.mattertags.visibility.alphaTestLevel}),p.addAttribute("position",new o.BufferAttribute(f,3)),this.line=new o.Line(p,this.lineMaterial),this.line.renderOrder=c.ribbon,this.pObject=new o.Object3D,this.pObject.add(this),this.pObject.add(this.line)}var o=i(0),a=i(1),s=i(8),l=i(16),u=i(10),h=i(12),c=i(17),d=l.loadurl(n.splitUrl("./images/pointermain_512x512.png")),p=new o.BufferGeometry,f=new Float32Array(6);f[0]=f[1]=f[2]=f[3]=f[4]=f[5]=0,r.prototype=Object.create(o.Mesh.prototype),r.prototype.move=function(t,e,i){this.hidden=i,this.mouseLastMoveTime=Date.now()},r.prototype.hide=function(){this.hidden||(this.hidden=!0,s.start(u.property(this.material.uniforms.opacity,"value",0),a.reticuleOpacityTransitionTime))},r.prototype.show=function(){this.hidden=!1,this.material.opacity<=0&&s.start(u.property(this.material.uniforms.opacity,"value",a[this.player.mode].reticuleOpacity),a.reticuleOpacityTransitionTime)},r.prototype.update=function(){Date.now()-this.mouseLastMoveTime>a.hideReticuleTimeout&&!this.hidden&&this.hide()},r.prototype.updatePosition=function(t,e){if(!this.hidden){if(!e)return this.hide();var i=e.point,n=t.distanceTo(i),r=1+.01*n;n<1&&(r-=1-n),this.show(),this.scale.set(r,r,r),this.direction=this.direction.multiplyScalar(.8),this.direction.add(e.face.normal.clone().multiplyScalar(.2)),this.position.copy(i).add(e.face.normal.clone().multiplyScalar(.01)),this.pObject.position.copy(this.position),this.buildPole(e),this.lookAt(this.position.clone().add(this.direction))}},r.prototype.buildPole=function(t){f[0]=f[1]=f[2]=0,f[3]=t.face.normal.x,f[4]=t.face.normal.y,f[5]=t.face.normal.z;var e=new o.Vector3(f[3],f[4],f[5]);e.normalize().multiplyScalar(.5),f[3]=e.x,f[4]=e.y,f[5]=e.z,p.addAttribute("position",new THREE.BufferAttribute(f,3))},r.prototype.writeAsMattertag=function(){var t=Math.floor(4294967296*(1+Math.random())).toString(16)+Math.floor(16*(1+Math.random())).toString(16),e=new Date;this.tagCount=void 0===this.tagCount?1:this.tagCount+1;var i={enabled:!0,version:"0",created:e.toISOString(),created_by:"APITest",position:this.position.clone(),stem:{enabled:a.mattertags.pole.enabled,direction:this.direction.multiplyScalar(a.mattertags.pole.height)},label:"Mattertag "+this.tagCount,description:"Description "+t,floor:function(t){if(t.currentFloor){var e=t.floors.indexOf(t.currentFloor);return e>-1?e:void 0}}(this.player.model),type:"info",metadata:{preferred_camera:{mode:this.player.mode}}},n=this.player.model.addMattertag(t,i).build();n&&(n.disc&&this.player.mattertagDiscs.push(n.disc),n.visible||n.show(a.mattertags.startup.fadeInDuration))},t.exports=r},function(t,e,i){var n=i(105),r=i(3),o="";r.detectAndroid()?o="android":r.detectIOS()&&(o="ios");var a=function(t){n.call(this,t),this.deviceType=o,this.remoteAccid=void 0!==t.remoteAccid?t.remoteAccid:""};a.getUserInfo=function(t){var e=null,i=setTimeout((function(){t()}),200);"ios"==o&&window.NativeClient?window.NativeClient.getUserInfo&&(e=window.NativeClient.getUserInfo((function(n){e=JSON.parse(n),clearTimeout(i),t(e)}))):"android"==o&&window.house365js&&window.house365js.getUserInfo&&(e=window.house365js.getUserInfo(),e=JSON.parse(e),clearTimeout(i),t(e))},(a.prototype=Object.create(n.prototype)).init=function(){var t=this;if("android"===this.deviceType){if(!window.house365js)return this.emit("platform","platform-error"),"platform-error"}else if("ios"===this.deviceType&&!window.NativeClient)return this.emit("platform","platform-error"),"platform-error";return window.onData=function(e){t.emit("onData",e)},window.updateChatStatus=function(e){switch(e=parseInt(e)){case 1:t.emit("calling");break;case 2:case 3:t.emit("onCall",e);break;case 4:t.emit("busy");break;case 5:t.emit("refuse");break;case 6:t.emit("timeout");break;case 7:case 8:t.emit("hangup");break;case 9:t.emit("voice_error")}},this},a.prototype.sendData=function(t){"ios"==this.deviceType?window.NativeClient.sendData&&window.NativeClient.sendData(t):"android"==this.deviceType&&window.house365js.sendData&&window.house365js.sendData(t)},a.prototype.call=function(){"ios"==this.deviceType?window.NativeClient.call&&window.NativeClient.call():"android"==this.deviceType&&window.house365js.call&&window.house365js.call()},a.prototype.mute=function(){"ios"==this.deviceType?window.NativeClient.mute&&window.NativeClient.mute():"android"==this.deviceType&&window.house365js.mute&&window.house365js.mute()},a.prototype.unmute=function(){"ios"==this.deviceType?window.NativeClient.unmute&&window.NativeClient.unmute():"android"==this.deviceType&&window.house365js.unmute&&window.house365js.unmute()},a.prototype.hangup=function(){"ios"==this.deviceType?window.NativeClient.hangup&&window.NativeClient.hangup():"android"==this.deviceType&&window.house365js.hangup&&window.house365js.hangup()},a.prototype.refuse=function(){"ios"==this.deviceType?window.NativeClient.refuse&&window.NativeClient.refuse():"android"==this.deviceType&&window.house365js.refuse&&window.house365js.refuse()},a.prototype.accept=function(){"ios"==this.deviceType?window.NativeClient.accept&&window.NativeClient.accept():"android"==this.deviceType&&window.house365js.accept&&window.house365js.accept()},a.prototype.urgeBroker=function(){"ios"==this.deviceType?window.NativeClient.urgeBroker&&window.NativeClient.urgeBroker():"android"==this.deviceType&&window.house365js.urgeBroker&&window.house365js.urgeBroker()},t.exports=a},function(t,e,i){var n=i(4).EventEmitter,r=function(){this.instance=null};(r.prototype=Object.create(n.prototype)).construct=r,r.prototype.init=function(){},r.prototype.sendData=function(t){},r.prototype.call=function(){},r.prototype.mute=function(){},r.prototype.unmute=function(){},r.prototype.hangup=function(){},r.prototype.refuse=function(){},r.prototype.accept=function(){},t.exports=r},function(t,e){t.exports={UNKNOWN:0,ALIGNED:1,UNALIGNED:2,PLACED:3}},function(t,e){t.exports={LoadComplete:"panorama.load.complete",LoadFailed:"panorama.load.failed",TileLoaded:"panorama.tile.loaded"}},function(t,e,i){(function(e){var n=i(22);function r(t,e){this.obj3d=null,this.nodes=[],this.colorHull=[],this.shortPaths={},this.floorHull=null,this.cameraHull=null,this.floorPathDistance=0,this.floorCurvePoints=null,this.floorCurveColors=null,this.camCurvePoints=null,this.warpDestHeroLoc=null,this.warpDestPano=null,this.warpPathPoints=null,this.warpPathLengths=[0],this.warpLength=0,this.closeWarpDistance=4,this.UP=b.UP.clone(),this.longestStep=0,this.upcomingTransType=null,this.burnsDir=1,this.prevNextDist=0,this.nextI=0,this.activeTransType=null,this.bunnyObj=null,this.director=t,this.player=e,this.modelManager=e.modelManager,this.updateModel(),this.updateDefaultsFromModelData(),this.bindEvents(),this.warping=!1,this.warpInterrupted=!1,this.warpInterruptionBlackoutStyle=null,this.warpInterruptionTravelTime=null}var o=i(0),a=i(2),s=i(5),l=i(17),u=i(24),h=i(1),c=i(9),d=i(10),p=i(15),f=i(8),m=i(57),g=i(59),v=i(12),y=i(16),b=i(18),w=(a=(i(60),new a(e)),i(20)),x=i(31),M=i(21),T={path:y.loadurl(n.splitUrl("./images/texture/location/location_512x512.png")),pathEnd:y.loadurl(n.splitUrl("./images/texture/location/location_512x512.png")),pathStart:y.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAM6VJREFUeAHtfQl0HNWZ7r3VXd2SLLEa2xgc2ySGxwOMiSRsC2IsG1vbMCGGsCYsWcibGSAhEEJeFkyIhyRAkknmvXOGJBMggQAhDAlIsjFY4NjCtqSwH55xDjYDAWN2JGvp6q77vr/UMpLcS3V3Lbeqbx3L3V1177989///uvvlTF2BRmBx96uVNbFpsyMiMpcx83Cu8UOh0FQm6FMcyuk7YwcLxivwGWOcxXEvxgSLW7/xH64E7o8I+hRshH5zJobx+R7uvc0Yf4dx8Q5+vy1M+tTeSPHUzv7EnleebJg1hPvqCigCsAV1yY7A0q6uaGVlw9EiwuZzTTueC34UnBsOz+dwzmb4Kb8QbDdk2QVZdgouXham+TxPsWeHhrpferyxMemnbIp3fgRUAMiPkacplnbtrKioObIOBbOQMz4fzjWfcX4sftMbOzAXag4jTIgXERieFUzgj20d7n+t9/HGuVSzUJckCKgA4HNBtGzsP4xVVZ4CRz9F4wyfvBYixXwWyy32CejZZwq2GXpuZoNDmzuX1LzlFjNFNz8CKgDkx8jRFLW9vfoMduKpqDq3oPregrf78Y4yCBoxIZ4HFp3AonM3e2ZTX12dETQVgiyvCgAelN6KTXtn6nH9DDg7nJ4vB8tqD9gGkcWAEOIxNB06jRHjofWnTnk9iEoESWYVAFwqreVbBqbH9djZ6LA7V3B+KoBWWBeANfoM0KcoNuG/e0eMxP2PLap+s4DsKqlNBJRR2gTKTrKm7g8OieiVn8Wb/ly86U9DHs1OPpUmLwImagZPoGZwb8oY+sO6hgPfzZtDJbCFgAoAtmDKnai5x1iqcf5lpFqFtiyNt6vLJQTQX0CjCA8gIvxybb3+uEtsyoasCgBFFvXKzf3TIrGKSzSNfQm1+3lFklHZSkJA7DBN9qtUYvj2R06p2VMSqTLNrAJAgQXftDVxYiSqXY0Zc+fhba8XmF0ldwEB1AoM9LDck0qat65bGHvGBRahJakCgM2ibe4zmiKMXYO3/ek2s6hkviAgHk0xdsvaWn2dL+wDxlQFgFwFdt99kZa5Z16IDr1r8HdCrqTqmVwIoNPwOfzd0rnzwbvYOecgJqgrEwIqAGRCZfVqrbXtW+cyrq2G4x+dKYm6FwwEEAReYsJc3dF+071s9WozGFJ7J6UKABOx5q09SfTkixswlHfcxEfqV6AREOIFIfj1HfXRB6AHphmoixBQASBtB609xgqg8WO88Rco0wgvAqgRPA33v7ajXl8fXi3ta1b2AWDFluF5uh65FSvvzrAPm0oZdASwQvEhw0hdvX5RxY6g61KK/GUbAFq2vHMAix7wXUzguRIAhnX1XSm2UQ55E5hQ9HOW/PDGzkWHflgOCk/WsSwDQOu2xKUsov0Qyk+bDIj6XX4IoENgD0uZ13WcHPtNuWlfVgGgqXv4E5FY5Da08xvLraCVvvkRQP9AVyqRumxdQ8Xf8qcOR4qyCADWllrVp34d1f3V6OirDEfRKS1cQUCwITQLVg8NbPpJOWxpFvoA0NKTOAlv/F/j7yRXDEYRDSUCqA08hb8vdtbHngqlgmmlQr1ctaUv8TXOta3K+cNswu7oRjZDtkM25A4HOaiGsgbQ9pf3DxaVU36DQvy0HDArKYKMAGoCf+JDey9t/9RB7wVZj0yyhy4AtPYmFmIK771QbHYmhdU9hUAxCGCk4BVMKT63oy62tZj8suYJVROgtdf4Ojbh+YtyflnNLbhyjdqU9pdRGwuuHpMlD0UNwNqKK151u5rNN7l41W83EKBZhKmRwUvCsDVZ4ANA81ZjcSTC78Hw3sfcKGxFUyGQEQHB/juVEuetXag/mfF5QG4GuQnAW/uMb2gRvlE5f0CsLUxi4oVDtkc2CLUC+yINpOB0fFbVAUfehSr/qjDZlNIlmAigSfDA4IevXRjEY88CFwBO7333wBiv+TOcf0kwzUVJHUYEEAQ2JkT/Pz5ad8gHQdIvUAGgqXfv4REeWwvnx6GZ6lIIyIUAgsCzKZFoXlc35Q25JMsuTWACwOi6/egjEHhOdnXUE4WAvwhgvsAuw0iuDMo+A4EIAK1bE3UsqnVA2MP8LV7FXSGQHwEEgbdY0mztWBjrzZ/a3xTSjwK09Rin86jWpZzfX0NR3O0jQLZKNku2az+XPymlDgDNPSPnMY23Axp1mq4/9qG4Fo9ANdmuZcPF03A9p7QBoK03cYWmRe4GAmq7LtfNQDFwCYEY2TDZskv0SyYrZR8AJldcj57+1SVrV2YE0PbcixN0X8IqyO3Y1OIljYm3hckGBNf6hSb6IymGT7PfNMx+QzP6d7/yaj9BNGP2rBrd1Gs0XavhplaTijB88houzBqusWqT8anYTOVorIo7BtulHw2jmVJm0JasLkYIVnfU6jeUTMhhAtIFACtacu3nDusZNnKvw9Gfg8Nv50xsT5l8OzeN7Z2Lql7zQtGWLYNHCk0/JqKJYwTjx8CIKDDQyUkzveAfWB7CvLK9LvYLmeSXKgBQe4mqTBBKKrn8LjCrV1mwLixH3WCkzA2yDjFZQ7URbRmWY+OPNaIQ1ajNOONBOQrTTF2wtj5+z7jbvn6VxtGsHtPRDj/V5mfsfVS3n4C9bMBfV0dd/HlYCewnUBdv7R05HrG8EX/L0Cw5DdIfFCgN3BE2wUzR1l6vP+oO+cKoShEAaJyfhk0gevn29gu0zzm73zTFnWvb12wM3Tl2OG+xue3bSzSNX8QFOxs1hJrCTDVUqQdE0myUYZ6A7wEgPcNvMwQpv+qiYCnBxXpmmne+Z+x58MmGWUOhMvMsyizufrXyYH3amUzTEAw4HcmGk9fL60J17i3MGDzF7+acrwFgdG5/vBtCzCmz4n9GCHYnM0fu7ji5end56T5R29ZtAzOYFr+Ac3YRmgonTnwa7l8IArtSYqTBz7UDvgWA9Kq+jWW0sMdEz/0DjIsfttfG+sJt2sVp19aXqGWCX4cRBVrmLe0cleK0y5yLFhBhFeESv1YR+hIA0uv515XDkl686ZOo4v6eJ1I3tS+Ov5jZDNTd8Qi0PTlyrIhFvoVuz/NRM4iOfxbG7wgCG7GfQJMf+wn4EQB4W6/xR0T5z4SxMMfplMD3242k8cNHFlbuHHdffbWJwMqtQ3P1qH4dkl+Cv1CPDiEIPICJQmdDT7QMvLs8DwAtPca16An+kXcqesxJsEFU9W8bMoxbNjRU/d1j7qFkt6x78IhKXb8GL43LUJuqCqWSUApB4FoEgZu91M/TAEAbeNI+aqGt1gn2h6FE4irl+O6YsBUIYrGfIgh81h0O/lKl5qKZEku83GjUswBAW3dHY1OeQuGFcPdescMU7PLOOv0Rf02oPLi39BorNc7+HaMG80KnMXYbTib2nuTVluNe9bTyCPbtD53zj54k+z3zzV0nKOf3zhUJa8IcC56+h3pzuOZO4AVp+YpHcHpSA0DEvhqryW7xSCdP2GCqbnsylbxCdfB5AndWJtRRGI1Ef4Gpxm1ZEwXwAYLbNQh0t7otuusBAKerLuJCo3a/7rYyntAX7E201b7SUR/9kyf8FBNbCLT2JD8NG/sP1DKn28ogeSLYmCG4uaSzNrbFTVFdDQDWKb1V1U+ByWw3lfCKNt76XZi9d0G5z97zCu9C+aRnFd6N2kBjoXllTI/xwFf44MBJbp5K7GofgHVEdzic3xSmuKHj4TWnK+eX0VVGZaKyoTKissIdU15J7UlGL07yIXupi0sFHu5crT2Jq7im/cQd6t5RRVVsNxbsXNhZq2NprrqCgkBLn7EMC43uQrNgRlBkzianycyr0BT4Wbbnpdx3JQA09SY+GWHaluC3+8Vjw8bIhY8tqn6zFJBVXn8QWL5lYHqFHr8Lw4XL/ZHAGa5Wf4AwF3bWx55yhuJHVBxvAizt6opGGP9VkJ0fbS9MyhLXtz+0ZqVy/o+MJWjfqOyoDKksrTINmgJpecmX0K/xa/Itp1VwvAYQ9Km+FG1NkbpIpm2bnC70cqRnbTfHI3cG+cWEzWK+2Vmv/9jJ8nM0ADR1D38iGos+i6GYSieF9JDWADqQVnXU6+s95KlYeYRAa4+xgmv8AbAL5s5TmPSUTCTnr2uo+JtTkDnaBIjEIrcF1flRRXzL2qZJOb9TtiUdHQrsVMZU1tIJZ0cgvFgtH7OT1mYaxwJAS0/iC0Edf4VB7GLJ5Kky7NFms9xUsiIRsMoYZW2VeZE0/MxGPta6LXGpUzI40gRo2fLOAVw/cAeITXNKMK/oYHLPcymWaPJzWyavdFV8PkLA2o6OxdbBoeg8g0BdCF57hPHBvM5Fh35YquDO1ACiB3w3kM7PRPdg/8AS5fylmlHw8lOZU9ljuKc7aNJbvgafc0LukmsAtKtvTI/SvvWB2rGF3vxkAI83Hvy+E0AqGsFEYGnXewdV1VRjrUrgagKJhJE8vtRdhUuuAeh6hFYsBcv5aTdWVPuV8wfTaZ2UmmyAbCGAfQKxtO+VBEdJNYD0sEqgNsFAQb812uFX8VJJyKnMoUKgdevw0Swa3QSHCNT5FBi2XlnKsHUpNQBs6sscnZTggUUNYNOl1o6Fyvk9wDpQLCybgG1A6IFACT7qg0W/yIsOAFh/vQrtpgVBAcuaT02TfBbGeoMis5LTWwTINmgiGNmKt5yL50Y+SL5YLIXiAgDOeePcWnJZLF9P86Haj3JNXVRKVclTgRUz3xAgGyFbIZvxTYgCGVu+CJ8sMJuVvKiqQ2vPyPkcx3gXw9CPPLR3HLZXutEP3opnMBHA2RXfwzbkNwRFeoFjxzvq478vVN7Co8Z992Gxn7a6UEb+pRePdT68Zo1//BXnICLQ/vCaH6AS8FhgZCefJN8s8Cq4BoApvxdpmnZHgXx8SY623O6R5PACtaQ3M/y0XyM9cXvfuczc5b9L+wnEoxVPYwVhIDYVMU3zYuwZcGchyBZcA0Dj/xuFMPAxrUk7+Sjnz14CGtO+Sn/ZU5T3E7IdsiGgEIjtxdAheE2hJVZQAGjuM5rQLjq+UCZ+pEev341qG6/syK/YtHcmakhn0R99z56yvJ+QDZEtBQEFms1o+WgBwhYUANDAKDjCFCCLY0lp996O9jXfd4xgCAnF4rF/Gd1phun0PYQqOqYS2ZK1I7RjFN0jVKiP2u4DaNqaODEa1Z52T3SHKNO+/ebwArV7b3Y86Xj2KTWzXsVErqlWKsHe3tv/6iw/jqfOLqVcT2jLca5VPA3MpD93IJk0F6xbGHvGDoK2awCRqHa1HYJ+p0GV9ivK+XOXwpTqIy7c5/yUFIHAupc7W1k/JZsi2woCCIX4qq0AQL2hmBZxnuzKo5r2sDqxJ38pCY1fOTlVpnuT05T7b7It2Fi79DjAVy2ftSGorQAQi8Qvln4zRdovLZXcz7BtYFBWSTDBpRGLOOZPVpru0bPJ99XviQjQeZCyH0hKvko+O1HyzL9sBQBNY1/KnF2eu9jY4V/VQZ35ywPzW7MO++V6lp9yeaQgGzOZuEl2be36bN4A0NxjLJX/HHaxQ+zZdbPsheK3fHSSLoaKzsgmBz2jNNmeq/tpBPbswipYsUNuPPi8Ud/NLWXeAICJP1/OTcL/p6Zgl3e2zhvxXxK5JYhGo1dAwlxlrqXTyK2Iz9KRrZHN+SxGXvZ2fDfnMGBT9weHROJTXkeieF5ufiUQ7A/tddFz/GIfFL5Lu/ZUV9Uc8hrahwfmkhk93R8M9r975OON04K1Lj6XUi49a+tN3ocRlM+6RL5ksijL4VRi7xHrGg58NxuxXG8DFolVniO58w8OJRJXZVNO3f8Igcrqgy7J5/yUmtJQ2o9yqm/ZELBsT7DBbM/9vo+yrCAfziVHzgAAc8iZORdhT54JcduGhqq/e8Ir2EzQvOdU/bd1pdPmrB3aIhTyRJbtwQblVjO3D2cNANbMJ85Pk1i5xJBh3CKxfNKI1tyTbIFTH21XIEpLeeymL+d0aRtMyIoByvI08uVs8mUNAKj/n4VM2Z9no+jRfQxZ/Ua9/e2BrXGRdegvG4Vi8mSjFeb7ZINkixLrqKV9OaOIWR2cC35uxhwS3ETnRjKZNH4kgSjSi7Cyd+R/oGG/omBBkcfKW3DG8stAtkg2KavmuXw5YwCwlopyfqqsCqHn9fdq0o+90omyyFfRmC+4PU95KK89LuWdyrJF2KSsKAj4crYl3xkDgB7XzyjGaDwCwOSJlPQzsTzCIicbOvUGrv/5nIlyPURei0auNOqZhUDaJqXcOIR8mXw6U1FlDACoMsrbASTEA+2L4y9mUkbdm4hA1QHVX0bhT5l41/4vyks07Oco35SWTcI2pUUgi0/vFwBqe3t19Bwul1WRZADmYUuBnbVBJHdgow/QKGKzSSkw8FoILn7oNUu7/Minybcnp98vAMxgJ1Lbv3pyQjl+i2fW1cX+KocsckvROnfVmXiDzy5VSqJBtEqlUw7522tjfVgjYGsjDh/wqE779gTW+wUA9GZKW/2HbHdOkF79yIoADotwrAPPSVpZBQ7JA5ltNJNv7xcAMH1QzgAgWIqZI4E5jMRPe27dlliAfpxPOSYDaFk0HSMYYkJko2SrEl6ZfHtCAGjZ2H8YDEfKXX+xPfN6tdWXPavimvY1eyntp3KDpn3uwUlpbR0GW5VSYvi25ePjhJsQAFhV5Snjnsn11TRV9d9Giazc3D9NcOe3byOaRNuGCCqJzLY6yccnBgAm5AwAgvW/Z+x5UFlWfgT0eMX/Qsed48u3iSbRzi+BSmHZKmxWTiQm+viEAKBxJmUAwNvn/icbZg3JCag8UtEwj2DcNScl2pmGkuRBQA5JyFbJZuWQZqIUk318XwCgveIxYah2YnI5fpmmUNV/G0UxwzzhXHT0HG4jaVFJiDbxKCpzmWWS12Z57aivjxbIvgBQUXNkHW7FJCyn99e2r9kooVzSiSQi2pVuC+UFD7d18IJ+2mbf94JXgTxiaV+3su0LAGjjLSyQkCfJsQ/7E2z1ainnWHsCgE0mbduMBmztXW8zedHJiAfxKppAuWSEzVq2K6G+4319XADYf694OWQXG+SQQ24pcLCHYxN/8mnqJa98ssj9XE7bHX8uxL4AgCmM82UEMynkBFEmrFq2DB4JeVZ5KNOqNE8PWQaPlby2+5GvWwFgaVdXFBOAjpUNYuy08tYj9fEXZJNLNnl4VKeTfqNeyUW8iKdX/ILKh2yXbFg6+eHrls9DMCsAVFY2HO3G2HHJigvWBRrAUF3ZEFjc/WolqnSeL9klnsQ7m1zqvoUADqyybFgqOMjXyedJKCsAiAiTsvrPhKna/3lM56D49M9h049D8yRz/jF4WrydpxwuipLa8JjPWwEA87ylnP9vpFQAyOcNmtj/pN98eZx67idvp3Rwm46sNjzm81YA0Bj/uNtAFEH/9fWLKnYUka9ssjRvM5b7ungLi0ssGcoG8cIVTdvw64XndDcHNgo9ijiMNgGEmOMuuyKoC/FcEbnKKosWyX7Sr1dAyCCDV7oWzUdKWxZzSR8rAGAK8Bx8l+pCz992qQSSTJiW3uGPoyOuzW+xSAaSxW85ZOYvpy3zOYSZZvUic5b15BBK5MfFmVABIAfwnEXynfSbI7ejj7C+xJLFUaJhIiajLWModwb5vlYTmzZbRrBTJlcBIEvBnLLprRrU2i7N8tiH2/zSUZl8YB0AlrLaMvm+FhERqy0gG47cNFQAyFIoB1YceCki+AFZHnt+m2QhmTxnHBCGstoy+T76AMzDZcMRbaa9nYuqXpNNLknkwQ7P/HJJZNknRlomvu+G+rIPAbJlsul9N6T5Yh6ucY17P4kkDwBcqPZ/Noha+5Lo+OPzsj337z6fNyqbfxJIzVmIl2STj3yfRgGmyiYYdp5R1f8shYIOJc9W/WURIettmWXLKrRnD/j/84yVfUZTNSbkqwEwCaOlfUzdS9myZeR/4u1/unscSqXMTx+VsVQ64cuPRQHyTWqD76MGIKSrAeAginfCZwKla6Tp8p/WGwQZSy+JwingTft24bncziGmYgzXh4UkefTChor9eZKU3eOm7g8Owcqyz0mvOGS0ZJVeUG8FlNGmyfexnoMd4i0UNriZmgoAk2CKxqq+jFV/VZNuy/cTMlqyyieZvxLJadMHUx+A43vIl4o0TgFSAWA8iDidFx2jgdmAw5JVnSg8vgThZvLZNMqpgkYB5AsAKdUEGG89bUetWoXJNrPG35P5O8lKMssso9eyCTltOo6VwPJtBa5FzAGvC0hmfuhBlnboLxtuQZQ5my5O3JfSpuH71Ako3VkApmGqJkDa6tr6ErWYZSfliU25HINkJtlzpSmnZzLaNPk++gDkawIYmqECQNo7BNMC9/Yfc+wgyz6mg1OfUto0fJ/6AKSrAex+5VUVAFAwy7cMTEeUDuxRXCQ76eCUEwWZjqQ2jRqAuqRFIB6J/xOEky5AFwBYLK1DAVlUUi8RoACQ8JKhHV4zZs/Cevfyvo6774UY2tGunfTrFbqkA+niFT9Z+Uhq0wkaBRiRDTTd1Ms+AHxs7rzzUDbBrz5DB0sX2YzMY3mktGn4voZ1ytLVADRdK/sAoGn+bffttG+ESZdisZHRpsn3aRRAuhoAN8s7ADT3Gqdi1V+IhtB47ahOxbpP8PNJadPwfSn7AFIRVtY1gAjzf7tvp10ujDoVgpGkNp3ARCAxXIgiXqTlJi/bALBy2yCm/PLPeIGztzz4Z0Z185arLNxktGnyfaoBvCcLSGNycGGWbQCIRvTL0fmHF2bILuhk6RYyteyqI6lNv0edgO/YVcKrdFxj1V7xkolPbe/rVVg29iWZZHJUFuhm6ego0WAQk9Gm4ftvowbApdupxGRcul2KvDCz6WLq57GSTr79GRxSnnQjHR0iFygycto0fwfzAOTbfkvj/OhAla5TwoZo6C8rJOWgYwblpbRp+D71AUhXAxBCHJMBw1Dfau0xVuCcPWz6Ge6LdCRdw63l/tpJatNva8KUrwaAI6/LrwbAwzf0t78bpO+Uk65jIEho0+T7qAFob4zJKMsnVpFNadkyeKQs8rgtR1P38CcQ9Frd5iMNfehq6SyNQO4KQrZMNu0ul2Koa29oKZ7aWUxWt/MITS+bZoAWi14JA8G/8rhIV9K5PLTFxvuS2jL5vtaf2POKjAUR0cqjH6BlyzsHoBp2iYxl4KZMpDPp7iYPWWjLasvk+9qTDbOGhGC7ZQFrTA7sWFoeNQC95gt495ffxCfSmXQvg0tGWyafJ99HIKZL7LI+JPoP1cTwB4DVqzUutMslgt1TUSzdgYGnTH1gJqctj/p8GnwuXz8A5yf4UFaesmxu+84/YHLMxz1lKhEz0p0wkEgkd0SR0pZHfd4KADi04GV3NC+J6swVW4YlPAa7JJ0mZMbrP7Abfk5QpIQfYccgbcMzS4DIlaxjPj8aAEzzeVe4lEhUj2jLSiQhbfaVPSPHY7us0OpnF3jCgLCwmz5o6WS1YZH2eSsA8BR7VkpgeXgDQJTLf9KvVzYRaiwkteExn7cCwNBQ90tYGSTdzkDoHW+EEaIPJVzX8q0fHgqlLgyXVsVrQ1gQJsVTkDYnZj5bNiyVgOTr5PMklBUAHm9sTDIhXpRKSggDwzgM1cPjZJOrVHnikcrLoFxlqXRCkx9YWJiERqFRRVp70cyDDUunFnzd8nkIZgWAUQG5lM2AaMjayUu7uqIIbf8snVH4LhD/51FsfBfEQQF4o4PEHCT1ka/vCwA4zFHKAABnWeag5r6TqpzScBaGv8pmnYNdwAkTwsZu+mCkk9N2x/v6uADAtsoIKnqJT2MhmiyiRYJ71p/b9hEqbGiSF9muhBf6APb5+r4AMNz/Wi9kle6MAMh0UHPbt5dIiGPBIjVvS9SjRrO44Ixlk4EvHsUo+AqnbfYgCTVJpH3dEm1fAHi8cS52BxZ9EgrMcLDERTLKVahMEU29/fNhFhaM5LVZ0Tfq66MlsS8A0E9TsM35CsiP51ywsxd3vxroXvOm3r2Ho+p1jh/4BYknYURYBUnmybKSrZLNTr4vw+/JPj4hAKB6KmUAwJBZzcH6tDNlALBYGaIs9k/o6NKLzV8u+QgjwirI+lq2Sqsdpbwm+vjEADA4JGcAICA1LbDNgJaOHXHB+VektAcJhSKsCDMJRbMnksy2OsnHJwSAziU1b2FCkJTrArjgK1q3DcywVwJypeLTZ5+PCSHT5JJKXmkIK8JMXgmzS0Y2SraaPYWPT+Dblo+PE2FCAKD72Cigc9xzeb7SaTla/AJ5BCpAEsHLftVfAWiNJg0qZmSjkp7slMm39wsAaIPJGQBgFpAtcM2A1m3GEowHLyjYAco8A2FG2AUNBpltNJNv7xcAdrNnNgH0ATmB5ye29SWCdWx2pIy2+3baaAKG3aht8hOdhsEhegNp355Abr8A0FdXZ+AQg8cmpJLph+DXySROLllaNw/NRnvw07nSqGfZESDsCMPsKSR7IrFtkk+Tb09GbL8AYCUQQtpmANoBq9qeHDl2siIy/hbxaDhP+vUKbLSlLQy94lcCH8smYZslkHA3axafzhgAjBHjIUzIwD8pL03EIt+SUrJxQq1ct3sKJoPLfdIvjfhIOuozBiVhSFiO/Zb1M22TGf3Jb5nJl8mnM8mRUeD1p055nQtBfQFyXoKdv3Lr0Fw5hRuVKnLoIdRhKd1ccPQEv4u//5tKmSe31+kn0B99p3v0TEJMD0pjKaFooyJZtgiblFVA8mXy6UzyZQwAlBCbBt6bKYMM99CbGdWjusx9ATgOnktz8g0cmzZ86UCd7pxXXt5+eEdd9F/WnhzrGStL+k736BmlobRWnrEEPn+mscT0ADkvskWySTmly+3LWUFdvmVgeoVeQVEja5DwWeHE0EjiqA0NVX/3WY792Df3GU0Rxtfu98DrG6jeC87uZKmR33acXF3Q4S/WpKtI/POY034R+l1837QzxUTz2lp9ndcQ5uO3rHvwiMp47GWki+VL69Nzc9gYnvnYouo3M/HP6tyUAT2HT2TKJMm9WKWuXyOJLBPEAKj+TfwR7B1hsv8jkmY9Ve87avWbC3V+UobyUF6iQbSIJmoH70xQ1MMfvmKaQ8+0Dcrq/KjMiSeyOT+plTUAWDoLeZsBlnycX0YR2PouyX+tW4ePxpSlZi/Foeo6CrrdNNlnd728fWZHffTyjoUx2t/BkYtoEU2iTTyIl/dNBN48iq0jKjlCxLI92KAjxNwikseHc7ZbUsbQHyKxKT9D+6bCLflKostZVWUs9lPQkGeZrebhSb+jPfh3jCRHfpsrypeE8bjML5xzXOIFxu7HrfutJmI0/nl8v9iLJgLaqjhJzDpR+PJxIvn61bI92KCvQuRgjiA9TD6cIwltvJv7au1N3oUAIPUcfFOIps46/ZHcmrj/9PTedw+M8wNeA6dq17hRNZyz32P3htvba2NSbOAyOgNOuwRNhPMhm5vbew+MiA+PfLTukA9cw9cm4ZZeYyWGKKXrkxgvPgLA3ejczbn9fO4mAKjBuX45nqiM3zXO/l2G5aMxVvNF4OO486er+A+jHX42VcPba6NXyOL8ZA8kC8lEspGMaCI87FIToTqNsa9mSLZGNuerEDaY2/HdvDUA4tPWZ7yEGtg8Gzx9SwJlv4dawI2+CYBNINv+4Tt/wxtwrlMywJGewySOOxLJkd95UcV3Sm6iQ02EWDT+ORjYxVjYc4JjtAXb2f7wDz6BjWJNx2gWSAhv/+/i7f/9ArN5nFzsaK/V0R+V+7IVAFp6jGuxx9mPcpPy+algQ0bKOO6RhZU7/ZCkpTd5Jt4K/1Uyb1TxYdl3m6jir6uL/bVkehIQaOpNfFJj2iWobtJS2ZKbCNjW6jOdddEH/VCNJv3oEf0F6FHpB3+7PE1TfLOzXv9xvvR5mwBEIJUYvh1Vuv0WEuQj7ulzFEg0Ev2FpzzHMdNY8Sf9WlV8Jh5iKXYWVaNh3FeGxfkJItKFdCLdSEfsS/9QKU2EUrAeV2RFfbVsTHLnJ18ln7WjoK0aABFq7UveicTU6yv1hTbomRiy+pOXQjZvGZkf0SPPFMrTOqBBsDuSI8O/e+SUmj2F5g9y+pWb+6dF4xWfw5v0YhygN79QXVJG6sS1i+KeHmbjWC2vUGULTI9m4287aqM0FT3vZTsANG1NnBiNak/npeh3AsHeFObwgmImvxQreltf8tfI+wVb+QV7G45/N9r3t3fWx56ylSfkiVp6Eiehn+ASBAJqIky1qe5/ouOROl09uaytvrSKpyHfdE8YlsAkmTQXrFsYs/VCstUEIFlGCYpHS5DLm6xUQFr8bq9OE1ra++FUVLlyDpOOVnfFn1OMrdrNnp7ZUad/VTn/R+ZAWBAmhA1hhNnrf87XRCDMCfuPqLj4jU6mIpsKgPMDu0ftOj8hZrsGQImlmeNOwuS5hClu6KjXV+dJVvLjth7j20zjP8hMSDwDOe4QQyO/m7wZY+b06u4YAi0b+w/jlRhF0PjFMNMTx+5P+DTFd9rr9TUT7rnwo7XHWA05rneBtOMkC10zUVAAIGlbe41nHR3WcRyCfQQxa1Ws6KzVN+y74/CX2t5efQZfsAtkZ+4jPVrFvwsTKG7vODkmf5Npn+DyfmndlliAIHsJmggX4pU1/q3/+m7x9JxMO904pU1Ln7EMqxHXg57t2rJTvAulQ8PGqEkV1J9SsFJgckuhgvmUXsOWUnfReLRb/KeLE84G7ZmojtI2an+i4al0Ff9ryvmdQ52whGF/jbAljAlrwpywT5eBc8zGUSLbIRvCrYL9ZBwZ774KcXOhzApWrHPng3ehADAxSP4LU5hnVOjxu1zrD9Aip2G8/ioxOHQEDPRMGpt2820kP+LuSkjYEsaENWFO2DOUgStc0e4n2yEbcoW+w0TJJzt2Pnh3oWQLbgIQg9aekfO5FimYWaHCOZZeiOuxrPX7jtFThEKPQFuv8T0scrohKIoKM3VBR30ca0QKuwquARD5jvab7sVCYywMC8aFo6ZWN/eMnBcMaZWUfiNAtkI247cctvnDFy2ftJ3ho4RF1QAoe2tP8izse3X/R6Tk/ma1GYVow8gAdeioSyGQEQH0+K/Am78dVX89YwIJb9ICLEx++2MxohUdAMCMY0TgrxgRWFAMY5/yDGB3m0YnN8vwSQ/F1gUEWrcm6nhU6wJpx1d0uiCuRRJtf+og/SR+iGJ4FNUESDPChDZ2bTFMfcxTzaJah2w7y/iIh2KdRsCyCdgGfgbG+S3RR32wKOen/KUEAEbVaVrYYQkSkP9Q5TmMRaPrmnr3Hh4QkZWYLiNg2QJswrINl3k5SZ58r9QmbUkBgJQxjNTV+Eg4qZjbtFDQcyIstm5p13sHuc1L0ZcbAbIBsgWyCbkl3U+6RNr39ntQyI2SA8D6RRU7sBnHzwthKkNams1YdUB1uwoCMpSGPzJQ2ZMNBGRm6wSQyOfI9ybcLOJHyQHA4pn88EY0QgK3nBVTSxuqaqo3quZAEZYT8CxU5lT2ZANBU8XyNficE3I7EgA6Fx36IUuZMp/UkxUriv4RHu9WHYNZIQrdAyprKvMgvvmtwoCvWT7nQMmg6ePchWHBDQC10TmK3lFCVH2LJc1WNUToHeZ+cKKhPhoJguEf5gf/Unli2K8Lw37LSqUzlt+RGsAYsVQidRmGBofGfgfpkwyCxoCtiSBBElzJahsBKlsq46A6P/mW5WO2Nc6f0NEAsK6h4m/onFidn620KappFpiaNixt+RQtmFWmKFsQCNY4/ziNybfIx8bdKvmrowGApBka2PQTVFMCu9UVTQHVsNDJWgxCO8GoK9gI0HbtWNhDZRqk6b2TQSefIt+afL/U36gNOX+N7vGmbQ0y4KOoiMeGjZELg7Ynv/MlGkyK1vFltByc8eXB1CBthdZ+E+ZCN7aRc+UNR4IKbgZtmnAGG+HL49GKp2lXmAwP1S2JEaAyo7ILuvMTxORLbjg/0XYlABDhztrYz1Bt8XR7buLr9IVazAzaEor2hXNtYxGnhS5neqjyU1lRmVHZBR0K8iHyJbf0cKUJMCZs21/eP1hUVT8FJrPH7gX5E4XRxcyRC7zccjzIeHktO23dTbv3BnUoejJeGJp+hQ8OnNT+qYPem/zMqd+uBgASsrU3sRAVjb8Evz8gDTmdOyDYV7w+fMSpAg8rHexP8WnY2H9g01DX9oD0ErvRPQ/NT3XUxba6ydf1AEDCY4LQ1xGVb3VTEa9pozbQnkwlr/DrLEKv9ZWVH53VR8d1wb7aZJWxGLlgX1djwo/jvf6TZfEkABDT1j7jz5h3fcZkAQL9GxMzsCTzX8WeXTd3ts4bCbQuAROejujm0+Z8Azb1v/HWl/qgzkKhtZb51ur/WGi+YtK71gk4WZjUyOAlmMn035PvB/o3DA9vnhu16XOew5HRKwOtS4CEJ6wJc8I+bM5PPmL5ikfl4VkNgPRp3mos1iJ8I9pqUY/085aNYH8YSiSu2tBQ9XdvGZcHt2Xdg0dUxmI/hdN/Nowao92fNFNiydqF+pNe6edpACCl0BSgalvec8u9AsBxPoINYsfk24YM4xYVCJxB13J8Xb8G07Qvg/NXOUNVPiqo+l/bUasXfLhHKZp4HgAgLEcQuB9BAIdAhvpKYBjnN8mk8SPVUVhcOVMHnx7VaZn5JfiLFUclGLng/A/A+emkKZiNd5cfAYAt7dpZUXXAkdiGiS/xTlV/OFG1Dm+t3/NE6qb2xfEX/ZEiWFzbnhw5VsQi34IrnB/a5uK4IoHzbxz88LWmxxvnDo+77clXXwIAaXZ677sHxngN7chS0GGGnqDiDhOcVSoeYFz8sL021ucOi2BTbetL1GLe63Wo6lPt0LMOaj9Rg/M/mxD9Sx6tO+QDP+TwLQCQsrQtk7UzC2Nz/FDeP544NlywOzGr8O5yn1WYnr13Ad70F6F1mPkYcP8KylXOqOvvSomRhnV1U95wlVEO4r4GAJJrxZbheboe3QxBArlDSw5s8z8SLCW4WM9M8873jD0PPtkwK5CbqeRXdGKKxd2vVh6sTzuTadpFOH0XJ/GwyMQU4f8F53/LMJKnOLGxZylo+R4ASPggnshSCugZ8wrWLzi73zTFnWvb12zEwiMzY7qg3sQinea2by/RNA6nZ2fD6WuCqooDcktzQpUUAYAAbesxTmeatWNLqHt7bRrP+5gK+gQ6hDckhdjwSH38BeTztHfYppy5kvGVPSPHRTlfhqr9MkzaOQ2J1TkMdIaGKdra6/VHc4Hn1TNpAgApTNs2WTu3wGK8AiAIfKi6CPfvYsLcYKTMDX5XG7NhZjXnItoyxumPNaIQy69Zlw0c3Ec5ChPHeK+tj9+TI5mnj6RztLbexBUwoMAdNOJpqTH2OkYUnoNBbedMbE+ZfDs3je2di6pe80KOli2DRwpNPyaiiWME48fAiI5Bz/0J4D3TC/6B5SHMK9vrYr+QSX7pAgCBg4lC12N4cLVMQAVBFgSEvVyI7XBK/IkdGhNvo1+hn5ka+hdEv0ixfi1iDpiG2W9oRv/uV17tJ71mzJ5Vo5t6jaZrNWZKq+YRVoPOuRqmmfhkNSbjU1Ee8xBsjhHccvgpQcBDKhmFuL69Tv++VDJBGCkDAIFENQHBtX+DgNLKKFthKnnkQ4Cq/VyYX5XtzT+GlNTORX0CES1yB4RVHYNjJaY+g4RAImWmLpapzT8ZPKkDAAmbHh34L3wN7H7uk0FXv8sCgQH09n9Glt7+bIhLHwBI8KAf55QNfHU/nAig2h+YY+YCEQDITNIzBh+BwHPCaTZKqzAgAOffhRl+K2Udqp2McWAWXBCgNG+aFk9MVkL9VgjIgADZJtloUJyfMAtMACBhadEErZwC0Bvpt7oUArIgQDZJtunnwp5isAhUACAFadkkrZ0G4A8Uo7DKoxBwGgGyRbJJv5b0lqJPYPoAMijJW3qwvRjna8ph04gM+qtbPiNAm71gzca3O+utbbzQ/A/eFeQAYKFNG41GIvweTBf6WPDgVxIHFgHavTclzvNyA083sApcE2AyCFQAycTek1ANe2jyM/VbIeAGAmRrZHNBd37CJvA1gHEFzLFf/NcxZ/0mNAn0cffVV4WAIwigym/A+b/VOXpiTyCr/JOBCFMAsHSzziLk2r1QbPZkZdVvhUCxCMDbX8Fi3nPdPquvWPmKzRf4JsBkxamA6ERVdM4E/mjyybqp3/4gQLZENhU25yc0Q1cDGG8irT2Jq7C3wI9Uk2A8Kuq7XQSoyo+3/jc76nEaUUivUAcAKrOWnsRJGCr8Nf5OCmkZKrVcQABv/afw98XO+thTLpCXhmTomgCTkaUCHOzfdDI22/wm9mQqi113J2OgfheAAGyEbIVsJuzOT6iEvgYwvuibuoc/EYlFbkNtoHH8ffVdIUAI4I3flUqkLlvXUPG3ckGkrALAWKGiWfAFrmk3QflpY/fUZ/kigB7+PSxlXtdxcuw35YZC6JsAmQoUVbv/FMYH80whbsHzRKY06l5ZIJAgGyBbKEfnpxIuyxrAeNMe3WcgcismEJ0x/r76Hm4EaDafYaSuDtLSXTdKpOwDwBiorT0GHVH1Y/QPLBi7pz7DhwDa+U+jM/jajnp9ffi0K1wjFQAmYsZbe5KrOBc3YJ/74yY+Ur8CjYAQLwjBr++oj9IycjT71UUIlGUfQI6iFzCQP7Y/vGa+wAkueFu8lCOtehQABKgMqSypTKlsIbJy/nHlpmoA48DY7+t990Va5p55ocb5N1AjOH6/5+qGvAgI8Tw6+G7u3PngXeycc1LyCuqvZCoA2MS/uc9owhnW16Df9HSbWVQyXxAQj8Lbb1lbq6/zhX3AmKoAUGCBNW1NnBiJalejInmeWmNQIHguJbfm7HN2Typp3rpuYewZl9iEkqwKAEUW6/ItA9NjkfjFmsa+hFrBvCLJqGwlISB2mCb7VSI1csdji6rfLIlUmWZWAcCBgm/uMZain+DLGEY8C4DGHSCpSGRBAD14I6h9/RHt+1+urdcfz5JM3baJgAoANoGyk6yp+4NDIrHKc1AjOAfzCU5DHjXKYge4/Gng7+IJdODfl0oM3beu4cB382dRKewgoAKAHZSKSNO6bWAGi8TOwjHb5+JI7VMBtMK6ABzxpsepumIT/ruXpRJ/7Di5encB2VVSmwgoo7QJVCnJVmzaO1OP62dgKLEFNYPloKUOOs0M6ADe9I9hWV6nMWI8tP7UKa9nTqbuOoWACgBOIWmTznH3vRCbc9TRp6DnGsGAtZT9/AKM1wOLTmDRuZs9s6mvrs6wCaVK5gACKgA4AGIpJFo29h/GqipPQY33FI0zfPJa0IuVQlPivFh5KfpMwTZDz81scGhz55KatySWN/SiqQAgWREv7dpZUVFzZB0KZiFWKM6Hw8xHLeFY/A7U6MJob714EY7+LFbe4Y9tHe5/rffxxrnDkkFe1uKoABCA4l/a1RWtrGw4WkTYfGxkcjw6Fo9CYJgL55qDqvMMP1VA9R2dc2IXZNmJDruXhWk+z1Ps2aGh7pceb2xM+imb4p0fARUA8mMkdYrF3a9W1sSmzY6ICAKCeTjX+KEQeCr60PEppqKA6ffBgvEKfMYxFhHDvRjG0qlGMdbUSOD+CN7SCdynDVJGOBP0pn4P996Bc7/NuMAne1uY9Km9keKpnf2JPa882TBL7bMIYIJ6/X8QmpCW0hsGOwAAAABJRU5ErkJggg==")};r.prototype.setScene=function(t){this.createCpm(t),this.createBunnyObj(t)},r.prototype.updateModel=function(){this.model=this.modelManager.getActiveModel()},r.prototype.bindEvents=function(){this.modelManager.on(M.ActiveModelChanged,this.updateModel.bind(this))},r.prototype.updateDefaultsFromModelData=function(){this.model.data},r.prototype.pointPathDistance=function(t){for(var e=0,i=1;i<t.length;i+=1)e+=t[i-1].distanceTo(t[i]);return e},r.prototype.pointPathLengths=function(t){for(var e=[0],i=1;i<t.length;i+=1)e.push(e[i-1]+t[i-1].distanceTo(t[i]));return e},r.prototype.interpAlongPath=function(t,e,i){var n,r=new o.Vector3,a=e[e.length-1];if(i<1){n=i*a;for(var s=1;s<e.length;s+=1)if(e[s]>n){var l=(n-e[s-1])/(e[s]-e[s-1]);return r.copy(t[s]),r.sub(t[s-1]),r.multiplyScalar(l),r.add(t[s-1]),r}}else r.copy(t[t.length-1]);return r},r.prototype.pathHeight=function(){return this.player.mode!==s.FLOORPLAN?h.path.height:h.path.outsideHeight},r.prototype.createBunnyObj=function(t){this.bunnyObj||(this.bunnyObj=new o.AxesHelper(.1),this.bunnyObj.visible=h.warp.showBunny),this.bunnyObj.parent&&this.bunnyObj.parent.remove(bunnyObj),t.add(this.bunnyObj)},r.prototype.createCpm=function(t){if(!this.currentPanoMarker){var e=this.makeWaypointObj(T.pathEnd,"Current");e.material.uniforms.opacity.value=0,this.currentPanoMarker={mesh:e,placed:!1}}this.currentPanoMarker.mesh.parent&&this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),this.placeCpm(),this.currentPanoMarker.mesh.parent||t.add(this.currentPanoMarker.mesh)},r.prototype.placeCpm=function(){h.path.mapGuides&&this.player.currentPano&&this.player.currentPano.isAligned()?(this.currentPanoMarker.mesh.parent!=this.player.currentPano.floor&&(this.currentPanoMarker.mesh.parent&&this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),this.player.currentPano.floor.add(this.currentPanoMarker.mesh)),this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(this.model.position),this.currentPanoMarker.mesh.position.y+=this.pathHeight(),this.currentPanoMarker.placed=!0):this.popOutCpm()},r.prototype.fadeInCpm=function(t){this.player.mode===s.PANORAMA&&this.player.currentPano&&!this.player.currentPano.isAligned()||h.path.mapGuides&&this.currentPanoMarker.placed&&f.start(d.property(this.currentPanoMarker.mesh.material.uniforms.opacity,"value",1),t)},r.prototype.fadeOutCpm=function(t){f.start(d.property(this.currentPanoMarker.mesh.material.uniforms.opacity,"value",0),t)},r.prototype.popInCpm=function(){h.path.mapGuides&&this.currentPanoMarker.placed&&this.fadeInCpm(2)},r.prototype.popOutCpm=function(){this.fadeOutCpm(2)},r.prototype.brushPrefs={linewidth:7,strokeWidth:15,cvSegments:48,paveStep:.1,paveWidth:.2,lookBlendDist:3,maxTurn:o.Math.degToRad(2)},r.prototype.panoPathDistance=function(t){var e=this.model.panos;if(!t||t.length<2)return 0;for(var i=[],n=0;n<t.length;n+=1)i.push(e.get(t[n]).floorPosition);return this.pointPathDistance(i)},r.prototype.loadTileTexture=function(t){var e=y.load(t,(function(e){e.wrapS=o.RepeatWrapping,e.wrapT=o.RepeatWrapping,e.needsUpdate=!0,a.debug('path texture "'+t+'" is ready')}),(function(){a.error('path texture "'+t+'" failed')}));return e.mapping=o.UVMapping,e},r.prototype.buildWarpDestinationDescriptor=function(t,e,i,n,r,o){return new m({cameraMode:n,position:t,quaternion:e,panoId:i,orthoZoom:o,floorVisibility:r,thumbUrl:null,name:null,isHero:!1})},r.prototype.buildWarpDestinationDescriptorFromHero=function(t){return this.buildWarpDestinationDescriptor(t.position,t.quaternion,this.getHeroId(t),t.cameraMode,t.floorVisibility,t.orthoZoom)},r.prototype.setWarpDestination=function(t){this.warpDestHeroLoc=t},r.prototype.setWarpDestinationByHeroIndex=function(t){var e=this.getHeroDescriptorByHeroIndex(t);return null!==e&&(this.setWarpDestination(e),!0)},r.prototype.setWarpDestinationByPano=function(t,e){return!!this.model.panos.get(t.id)&&this.setWarpDestinationByPanoId(t.id,e)},r.prototype.setWarpDestinationByPanoId=function(t,e){var i=this.model.panos.get(t);if(i){e=e||new o.Quaternion;var n=this.buildWarpDestinationDescriptor(i.position,e,i.id,"panorama",[],-1);return this.setWarpDestination(n),!0}return!1},r.prototype.getHeroDescriptorByHeroIndex=function(t){var e=this.model.heroCount();if(null!==this.warpDestHeroLoc&&e<2)return a.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),this.model.getHeroDescriptorByIndex(0);var i=this.model.getHeroDescriptorByIndex(t);if(i){var n=i.isPano()?i.panoId:i.cameraMode;a.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "'+n+'" out of '+e+" choices.")}return i},r.prototype.getHeroDescriptorByPano=function(t){return this.model.panos.get(t.id)?this.getHeroDescriptorByPanoId(t.id):null},r.prototype.getHeroDescriptorByPanoId=function(t){var e=this.getHeroIndexFromPanoId(t);return this.getHeroDescriptorByHeroIndex(e)},r.prototype.getHeroIndexFromPanoId=function(t){for(var e=0;e<this.model.heroLocations.length;e++){var i=this.model.heroLocations[e],n=this.getHeroId(i);if(n&&n===t)return e}return-1},r.prototype.getHeroPano=function(t){if(null===t)return a.warn("getHeroPano(): no destination"),null;var e=this.getHeroId(t),i=this.model.panos.get(e);return void 0===i&&(i=null,""!==e&&a.debug('unable to find pano "'+e+'"')),i},r.prototype.getHeroId=function(t){return t.panoId},r.prototype.setWarpDestPano=function(){return this.warpDestPano=this.getHeroPano(this.warpDestHeroLoc),this.warpDestPano},r.prototype.brushToWarpPano=function(t,e){if(this.discardPathObject(),!this.setWarpDestPano())return!1;if(this.warpDestHeroLoc.cameraMode!==s.PANORAMA&&a.warn("Can only brush from pano to pano"),!this.warpDestPano)return a.info("No brush"),!1;if(!this.player.currentPano)return a.debug("No current pano, visibility undefined"),!1;if(!this.warpDestPano)return a.info("No wPano, visibility undefined"),!1;if(!this.warpDestPano.isAligned())return a.debug("Cannot brush to unaligned pano"),!1;var i=(t===u.STD||t===u.WALK)&&h.path.mapGuides,n=!0;if(this.player.currentPano.id===this.warpDestPano.id)a.debug("Already at destination pano");else{this.nodes=this.findShortestPath(this.player.currentPano,this.warpDestPano),n=void 0===this.nodes||null===this.nodes||this.nodes.length<1,this.obj3d=new o.Object3D,a.debug('Brushing from "'+this.player.currentPano.id+'" to "'+this.warpDestPano.id+'" ('+(this.nodes?this.nodes.length:0)+")"),n?(a.info('No "walkable" route, using fall-back warp style transition'),t=e):(this.setPathHulls(this.nodes),this.setFloorCurves(),i&&("chevron"===h.path.style?this.obj3d.add(this.drawPathPavement(this.floorCurvePoints)):"ribbon"===h.path.style&&this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints,this.floorCurveColors)))),this.player.currentPano.floor.add(this.obj3d);var r=this.player.mode===s.DOLLHOUSE||this.player.mode===s.FLOORPLAN,l=t===u.STD;if(!n&&(i||l)){if(r){var c=this.makeStartMarker(this.floorHull[0],this.floorCurvePoints);this.obj3d.add(c)}var d=this.makeEndMarker(this.floorHull[this.floorHull.length-1]);this.obj3d.add(d)}this.appearSlow()}return this.upcomingTransType=t,!n},r.prototype.findShortestPath=function(t,e){if(!t||!e)return null;var i=h.warp.walkExtraPanosDistance,n=t.id+":"+e.id+":"+i;if(this.shortPaths.hasOwnProperty(n))return this.shortPaths[n]?this.shortPaths[n].slice():null;var r=e.id+":"+t.id+":"+i;if(this.shortPaths.hasOwnProperty(r))return this.shortPaths[r]?this.shortPaths[r].slice().reverse():null;var o=this.model.panos.aStarSearch(t,e);return this.model.panos.includeNodesNearPath(o,i),this.shortPaths[n]=o?o.slice():null,o},r.prototype.makePathHulls=function(t){var e,i,n,r,o,s=0,l=[],u=[],c=[],d=this.model.panos;r=(e=d.get(t[0])).floor.floorIndex;for(var p=0;p<t.length;p+=1)(i=(e=d.get(t[p])).floorPosition.clone().sub(this.model.position)).y+=this.pathHeight(),l.push(i),u.push(e.position.clone()),n=e.floor.floorIndex,c.push(n>r?h.path.colorUp:n<r?h.path.colorDown:h.path.color),p>0&&((o=u[p].distanceTo(u[p-1]))>s&&(s=o));return s>this.longestStep&&(this.longestStep=s,a.debug("path contains "+s+" meter segment")),{floor:l,camera:u,color:c}},r.prototype.makeFloorCurves=function(t,e,i){var n=this.player.mode===s.PANORAMA?h.path.waypointIndoorRadius:h.path.waypointRadius,r=this.pointPathDistance(t)-2*n,a=t.slice(0),l=a[1].clone().sub(a[0]);l.y=0,l.normalize().multiplyScalar(n),a[0]=(new o.Vector3).copy(a[0]).add(l),(l=a[a.length-2].clone().sub(a[a.length-1])).y=0,l.normalize().multiplyScalar(n),a[a.length-1]=(new o.Vector3).copy(a[a.length-1]).add(l);var u=new o.CatmullRomCurve3(a),c=Math.floor(r/i);c=4*Math.floor(c/4),c=Math.max(4,c);for(var d,p,f=u.getSpacedPoints(c),m=[],g=new o.Vector3,v=0;v<f.length;v+=1){p=0,d=f[v].distanceTo(t[0]);for(var y=1;y<t.length;y+=1)g.copy(f[v]).sub(t[y]),g.y*=4,g.length()<d&&(p=y);m.push(e[p])}return{distance:r,points:f,colors:m}},r.prototype.makeCameraCurvePoints=function(t,e){var i=this.pointPathDistance(t);return new o.CatmullRomCurve3(t).getSpacedPoints(Math.max(2,Math.floor(i/e)))},r.prototype.makeCameraCurveTangents=function(t,e){var i=this.pointPathDistance(t),n=new o.CatmullRomCurve3(t),r=Math.max(2,Math.floor(i/e));r||(r=5);for(var a=[],s=0;s<=r;s++)a.push(n.getTangentAt(s/r));return a},r.prototype.setPathHulls=function(t){var e=this.makePathHulls(t);this.floorHull=e.floor,this.cameraHull=e.camera,this.colorHull=e.color},r.prototype.setFloorCurves=function(){var t=this.makeFloorCurves(this.floorHull,this.colorHull,this.brushPrefs.paveStep);this.floorPathDistance=t.distance,this.floorCurvePoints=t.points,this.floorCurveColors=t.colors},r.prototype.setCameraCurvePoints=function(){this.camCurvePoints=this.makeCameraCurvePoints(this.cameraHull,h.warp.stepFactor*this.brushPrefs.paveStep)},r.prototype.chooseWarpPath=function(t){var e,i,n,r=this.player.cameras[s.PANORAMA];if(this.player.currentPano===this.warpDestPano||!t)return this.warpPathPoints=null,this.warpLength=0,!1;this.nodes=this.findShortestPath(this.player.currentPano,this.warpDestPano),void 0===this.nodes||null===this.nodes||this.nodes.length<1?(a.debug("warp path to unreachable node"),i=(e=this.warpDestPano.position.clone().sub(r.position)).clone().negate(),e.multiplyScalar(.15).add(r.position),i.multiplyScalar(.15).add(this.warpDestPano.position),e.y=r.position.y,i.y=this.warpDestPano.position.y,n=new o.CubicBezierCurve3(r.position.clone(),e,i,this.warpDestPano.position.clone()),this.warpPathPoints=n.getSpacedPoints(this.brushPrefs.cvSegments)):(a.debug("follow warp path (path distance was "+this.nodes.length+" nodes, "+this.floorPathDistance+")"),this.setCameraCurvePoints(),this.warpPathPoints=this.camCurvePoints.slice(0)),this.warpLength=0,this.warpPathLengths=[0];for(var l=new o.Vector3,u=new o.Vector3,c=Math.cos(o.Math.degToRad(h.warp.minBrakeAngle)),d=Math.cos(o.Math.degToRad(h.warp.maxBrakeAngle)),p=1;p<this.warpPathPoints.length;p+=1){l.copy(this.warpPathPoints[p-1]).sub(this.warpPathPoints[p]);var f=l.length();l.y*=h.warp.climbEffort;var m=l.length()/f;if(p>1){l.setY(0).normalize(),u.copy(this.warpPathPoints[p-2]).sub(this.warpPathPoints[p-1]).setY(0).normalize();var g=Math.min(1,l.dot(u)),v=1+(h.warp.brakeStrength-1)*(1-o.Math.smoothstep(g,d,c));m=Math.max(v,m)}this.warpLength+=f*m,this.warpPathLengths[p]=this.warpLength}return!0},r.prototype.drawPathRibbon=function(t,e){this.bunnyObj.visible=h.warp.showBunny;for(var i=.6*h.path.ribbonWidth*.5,n=new o.Vector3,r=new o.Vector3(0,this.pathHeight(),0),a=new o.Geometry,u=new o.Vector3,c=0;c<t.length;c+=1){u.copy(t[c]),0===c?u.sub(t[c+1]):u.sub(t[c-1]).negate(),u.normalize(),n.crossVectors(u,b.UP),n.multiplyScalar(i);var d=(new o.Vector3).copy(t[c]).add(r);d.sub(n),a.vertices.push(d),(d=(new o.Vector3).copy(t[c]).add(r)).add(n),a.vertices.push(d)}var p,f,m,g=0;for(c=0;c<t.length-1;c+=1){var y=2*c,w=g,x=g+=t[c+1].distanceTo(t[c]),M=e[c],S=e[c+1];(p=new o.Face3(y,y+1,y+2)).vertexColors=[new o.Color(M),new o.Color(M),new o.Color(S)],a.faces.push(p),a.faceVertexUvs[0].push([new o.Vector2(0,w),new o.Vector2(1,w),new o.Vector2(0,x)]),(p=new o.Face3(y+2,y+1,y+3)).vertexColors=[new o.Color(S),new o.Color(M),new o.Color(S)],a.faces.push(p),a.faceVertexUvs[0].push([new o.Vector2(0,x),new o.Vector2(1,w),new o.Vector2(1,x)])}a.computeFaceNormals(),a.computeVertexNormals(),this.player.mode===s.PANORAMA?((m=o.UniformsUtils.clone(v.ribbon.uniforms)).map.value=T.path,m.opacity.value=0,m.color.value.set(h.path.color),f=new o.RawShaderMaterial({side:o.DoubleSide,depthWrite:!1,transparent:!0,vertexShader:v.ribbon.vertexShader,fragmentShader:v.ribbon.fragmentShader,uniforms:m,name:"ribbonT",opacity:0})):f=new o.MeshBasicMaterial({color:16777215,side:o.DoubleSide,name:"ribbonOut",vertexColors:o.VertexColors});var _=new o.Mesh(a,f);return _.name="ribbon",this.player.mode===s.PANORAMA&&(_.renderOrder=l.ribbon),_},r.prototype.drawPathPavement=function(t){for(var e,i=new o.Vector3,n=new o.Geometry,r=new o.Vector3,a=0;a<t.length;a+=1)r.copy(t[a]),0===a?r.sub(t[a+1]).negate():r.sub(t[a-1]),r.normalize(),i.crossVectors(r,b.UP),i.multiplyScalar(this.brushPrefs.paveWidth),(e=(new o.Vector3).copy(t[a])).sub(i),n.vertices.push(e),n.vertices.push((new o.Vector3).copy(t[a])),(e=(new o.Vector3).copy(t[a])).add(i),n.vertices.push(e);var l,u,c;for(a=0;a<t.length-1;a+=1)l=3*a+1,c=(u=.25*a)+.25,n.faces.push(new o.Face3(l-1,l,l+3)),n.faceVertexUvs[0].push([new o.Vector2(0,u),new o.Vector2(.5,u),new o.Vector2(.5,c)]),n.faces.push(new o.Face3(l+3,l+2,l-1)),n.faceVertexUvs[0].push([new o.Vector2(.5,c),new o.Vector2(0,c),new o.Vector2(0,u)]),n.faces.push(new o.Face3(l+3,l,l+1)),n.faceVertexUvs[0].push([new o.Vector2(.5,c),new o.Vector2(.5,u),new o.Vector2(1,u)]),n.faces.push(new o.Face3(l+3,l+1,l+4)),n.faceVertexUvs[0].push([new o.Vector2(.5,c),new o.Vector2(1,u),new o.Vector2(1,c)]);var d=this.player.mode===s.PANORAMA?new o.MeshBasicMaterial({color:h.path.color,side:o.DoubleSide,transparent:!0,depthWrite:!1,opacity:0,name:"paveT",map:T.path}):new o.MeshBasicMaterial({color:h.path.color,side:o.DoubleSide,transparent:!0,depthWrite:!1,opacity:1,name:"paveO",map:T.path});return new o.Mesh(n,d)},r.prototype.hintPrefs={rad:.18,width:.0125,depth:.0625,setBack:-.04,markRad:.25,markInnerRad:.16},r.prototype.makeWaypointObj=function(t,e){var i=new o.Geometry,n=this.player.mode===s.PANORAMA?h.path.waypointIndoorRadius:h.path.waypointRadius,r=this.pathHeight();i.vertices.push(new o.Vector3(-n,r,n),new o.Vector3(-n,r,-n),new o.Vector3(n,r,-n),new o.Vector3(n,r,n)),i.faces.push(new o.Face3(0,1,2),new o.Face3(2,3,0)),i.faceVertexUvs[0].push([new o.Vector2(0,0),new o.Vector2(1,0),new o.Vector2(1,1)]),i.faceVertexUvs[0].push([new o.Vector2(1,1),new o.Vector2(0,1),new o.Vector2(0,0)]);var a=o.UniformsUtils.clone(v.waypoint.uniforms);a.map.value=t,a.opacity.value=0,a.color.value.set(h.path.color);var l={side:o.DoubleSide,depthWrite:!1,transparent:!0,vertexShader:v.waypoint.vertexShader,fragmentShader:v.waypoint.fragmentShader,uniforms:a,name:"waypoint",opacity:0};this.player.mode!==s.PANORAMA&&(l.depthTest=!1,l.name="wayPtOut");var u=new o.RawShaderMaterial(l),c=new o.Mesh(i,u);return c.name=e,c},r.prototype.makeStartMarker=function(t,e){var i=(new o.Vector3).copy(e[1]).sub(e[0]);i.y=0,i.normalize();var n=Math.acos(i.x),r=this.makeWaypointObj(T.pathStart,"Start");return r.rotateOnAxis(new o.Vector3(0,1,0),n),r.position.copy(t),r},r.prototype.makeEndMarker=function(t){var e=this.makeWaypointObj(T.pathEnd,"End"),i=this.model.panos.get(this.nodes[0]).floor.floorIndex,n=this.model.panos.get(this.nodes[this.nodes.length-1]).floor.floorIndex;return i<n?e.material.uniforms.color.value.set(h.path.colorUp):i>n&&e.material.uniforms.color.value.set(h.path.colorDown),e.position.copy(t),e},r.prototype.pathClean=function(t){if(t){for(var e in t.children)this.pathClean(t.children[e]);t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()}},r.prototype.discardPathObject=function(){if(this.obj3d){var t=this.obj3d.parent;t&&t.remove(this.obj3d),this.pathClean(this.obj3d)}this.obj3d=null,this.popInCpm()},r.prototype.discardSlow=function(){if(this.obj3d){if(this.player.mode!==s.PANORAMA)return void this.discardPathObject();for(var t,e=0,i=function(){this.discardPathObject()}.bind(this),n=0;n<this.obj3d.children.length;n+=1)void 0!==(t=this.obj3d.children[n]).material&&!0===t.material.transparent&&(void 0!==t.material.uniforms?f.start(d.property(t.material.uniforms.opacity,"value",0),h.path.fadeOutTime,i,0,p[h.warp.blendEasing]):f.start(d.property(t.material,"opacity",0),h.path.fadeOutTime,i,0,p[h.warp.blendEasing]),e+=1,i=null);0===e&&this.discardPathObject(),this.player.mode!==s.PANORAMA&&this.fadeInCpm(h.path.fadeInTime-3)}},r.prototype.appearSlow=function(){var t;this.fadeOutCpm(h.path.fadeInTime);for(var e=this.player.mode===s.PANORAMA?h.path.opacity:1,i=0;i<this.obj3d.children.length;i+=1)void 0!==(t=this.obj3d.children[i]).material&&!0===t.material.transparent&&(void 0!==t.material.uniforms?f.start(d.property(t.material.uniforms.opacity,"value",e),h.path.fadeInTime,null,0,p[h.warp.blendEasing]):f.start(d.property(t.material,"opacity",e),h.path.fadeInTime,null,0,p[h.warp.blendEasing]))},r.prototype.update=function(){this.obj3d&&this.obj3d.updateMatrixWorld()},r.prototype.calcBurnsAmount=function(t){var e=o.Math.degToRad(h.warp.burnsAngle);if(this.player.mode===s.PANORAMA){var i=this.burnsDir*e;if(this.upcomingTransType===u.BLACK)return i;var n=t;if(null===n)return a.warn("Transition request for non-highlight"),i;var r=this.getHeroDescriptorByHeroIndex(n);if(null===r)return i;if(!r.isPano())return i;var l=this.getHeroPano(r),c=this.player.cameras[s.PANORAMA],d=b.FORWARD.clone().applyQuaternion(c.quaternion).setY(0).normalize(),p=Math.min(o.Math.degToRad(h.warp.minBurnsAngle),e),f=function(t){var i=Math.acos(Math.min(1,t.dot(d))),n=(new o.Vector3).crossVectors(d,t);return Math.max(p,Math.min(Math.abs(i),e))*Math.sign(n.y)};if(l==this.player.currentPano)return f(b.FORWARD.clone().applyQuaternion(r.quaternion).setY(0).normalize());var m=this.findShortestPath(this.player.currentPano,l);if(null==m||m.length<1)return a.debug("Empty path ahead..."),i;var g=this.makePathHulls(m),v=new o.CatmullRomCurve3(g.camera),y=Math.min(.1,h.warp.lookAheadDist/v.getLength());return f(v.getPointAt(y).clone().sub(c.position).setY(0).normalize())}if(this.player.mode===s.DOLLHOUSE){var w=this.player.cameras[s.DOLLHOUSE];return this.burnsDir*Math.min(w.controls.rotationAcceleration.x+.05,.02)}return this.burnsDir},r.prototype.waitNextStep=function(t,e){var i=new o.Euler,n=new o.Vector3;if(a.debug("Starting wait: "+(void 0!==e)),2===this.player.currentPano.alignmentType)var r=Math.PI/8,l=h.warp.tourStepDelay*h.warp.waitMultiplier1;else r=this.calcBurnsAmount(t),l=h.warp.tourStepDelay;var u=function(){this.endWarpState(),this.player.mode===s.DOLLHOUSE&&(this.player.cameras[s.DOLLHOUSE].controls.rotationAcceleration.x=0),e&&e()}.bind(this),c=function(t,e){if(this.warpInterrupted)return u(),!0;var o=e||1e3/60;if(h.warp.doBurns)if(this.player.mode===s.PANORAMA){var a=this.player.cameras[s.PANORAMA];i.setFromQuaternion(a.quaternion,h.warp.eOrder);var l=h.warp.waitMultiplier2*o*r/h.warp.tourStepDelay;i.y+=l,n.set(0,0,-1),n.applyEuler(i),n.add(a.position),a.controls.lookAt(n),a.controls.lookVector.copy(n),a.lookAt(n)}else if(this.player.mode===s.DOLLHOUSE){this.player.cameras[s.DOLLHOUSE].controls.rotationAcceleration.x=r}else this.player.controls[s.FLOORPLAN].absoluteScale*=.9996}.bind(this);this.startWarpState(),f.start(c,l,u,0,p.easeInOutQuad,"wait")},r.prototype.warpToNonPano=function(t){if(this.discardPathObject(),this.warpDestHeroLoc.cameraMode===s.DOLLHOUSE||this.warpDestHeroLoc.cameraMode===s.FLOORPLAN){var e=function(){t&&t()}.bind(this);this.player.flyToNewMode({mode:this.warpDestHeroLoc.cameraMode,duration:h.warp.outsideTime,warpDest:this.warpDestHeroLoc,callback:e,force:!0})}else a.warn("no warp destination!!!"),t&&t()},r.prototype._resetWarpShaderParams=function(t){this.player.mode===s.PANORAMA&&(void 0!==t.material.uniforms.blackout&&(t.material.uniforms.blackout.value=0),void 0!==t.material.uniforms.modelAlpha&&(t.material.uniforms.modelAlpha.value=0))},r.prototype._clearWarpShading=function(){for(var t=this.model.chunks,e=0;e<t.length;e+=1)this._resetWarpShaderParams(t[e]),t[e].visible=!0;this._resetWarpShaderParams(this.model.skybox)},r.prototype._warpStopFlying=function(){this.activeTransType=null,this.placeCpm()},r.prototype._wrapupTravelOnlyBits=function(){this._warpStopFlying(),this.warpPathPoints&&(this.player.currentPano.exit(),this.warpDestPano.enter(),this.player.currentPano=this.warpDestPano),this.player.spider.draw(),this.placeCpm()},r.prototype._wrapupTravel=function(t){this._wrapupTravelOnlyBits(),this.warpCameraAim(t)},r.prototype._wrapupWarpShading=function(t){this._clearWarpShading(),this._wrapupTravel(t)},r.prototype.wrapupWarpShadingOnly=function(t,e){e!==x.END&&this._clearWarpShading(),this._wrapupTravelOnlyBits(),this.upcomingTransType=null,t&&t()},r.prototype._warpCameraAim=function(t,e){var i=this.warpDestHeroLoc.quaternion,n=this.warpDestHeroLoc;n&&2==n.cameraType&&G.model.panos.forEach((function(t){t.id==n.panoId&&(i=t.quaternionAutoScene)}));var r=this.player.cameras[s.PANORAMA],l=new o.Vector3(0,0,1).applyQuaternion(i).normalize(),u=new o.Vector3(0,0,1).applyQuaternion(r.quaternion).normalize().dot(l),d=o.Math.radToDeg(Math.acos(u)),m=new o.Euler(0,0,0,h.warp.eOrder).setFromQuaternion(i,h.warp.eOrder),g=(new o.Euler).setFromQuaternion(r.quaternion,h.warp.eOrder),v=new o.Euler(m.x-g.x,m.y-g.y,m.z-g.z,h.warp.eOrder);v.y=c.constrainedTurn(v.y),this.burnsDir=Math.sign(v.y);var y=new o.Euler(0,0,0,h.warp.eOrder),b=new o.Vector3,w=function(t,e){return this.warpInterrupted?void 0:(y.x=g.x+t*v.x,y.y=g.y+t*v.y,y.z=g.z+t*v.z,b.set(0,0,-1),b.applyEuler(y),b.add(r.position),r.controls.lookAt(b),r.controls.lookVector.copy(b),r.lookAt(b))}.bind(this);return d>h.warp.minRotation?f.start(w,t,e,0,p[h.warp.movementEasing]):(a.debug("Aim angle only is "+d.toPrecision(3)+" degrees, skipping explicit re-aim"),void(e&&e()))},r.prototype._warpBendAim=function(t,e,i,n){var r=n||0,a=this.player.cameras[s.PANORAMA],l=new o.Euler(0,0,0,h.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion,h.warp.eOrder),u=(new o.Euler).setFromQuaternion(a.quaternion,h.warp.eOrder),d=new o.Euler(l.x-u.x,l.y-u.y,l.z-u.z,h.warp.eOrder);d.y=c.constrainedTurn(d.y);var m=Math.min(o.Math.degToRad(h.warp.softBendTilt),Math.abs(d.x));d.x=m*Math.sign(d.x),m=Math.min(o.Math.degToRad(Math.max(0,h.warp.softBendAngle)),m),this.burnsDir=Math.sign(d.y),m*=Math.sign(d.y),d.y=m;var g=new o.Euler(0,0,0,h.warp.eOrder),v=new o.Vector3,y=function(t,e){if(t<.5)g.x=u.x+t*d.x,g.y=u.y+t*d.y,g.z=u.z+t*d.z;else{var i=(1-t)*h.warp.softBendEnd;g.x=l.x-i*d.x,g.y=l.y-i*d.y,g.z=l.z-i*d.z}v.set(0,0,-1),v.applyEuler(g),v.add(a.position),a.controls.lookAt(v),a.controls.lookVector.copy(v),a.lookAt(v)}.bind(this);return f.start(y,e,i,r,p[h.warp.movementEasing])},r.prototype._warpStepCameraAim=function(t,e,i){var n=this.player.cameras[s.PANORAMA],r=new o.Euler(0,0,0,h.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion,h.warp.eOrder),a=(new o.Euler).setFromQuaternion(n.quaternion,h.warp.eOrder),l=new o.Euler(r.x-a.x,r.y-a.y,r.z-a.z,h.warp.eOrder);l.y=c.constrainedTurn(l.y),this.burnsDir=Math.sign(l.y);var u=new o.Euler(0,0,0,h.warp.eOrder),d=new o.Vector3,m=function(t,e){t<.5?u.copy(a):u.copy(r),d.set(0,0,-1),d.applyEuler(u),d.add(n.position),n.controls.lookAt(d),n.controls.lookVector.copy(d),n.lookAt(d)}.bind(this);return f.start(m,e,i,0,p[h.warp.movementEasing])},r.prototype.setBurnsDir=function(){var t=this.player.cameras[s.PANORAMA],e=new o.Euler(0,0,0,h.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion,h.warp.eOrder),i=(new o.Euler).setFromQuaternion(t.quaternion,h.warp.eOrder),n=new o.Euler(e.x-i.x,e.y-i.y,e.z-i.z,h.warp.eOrder);n.y=c.constrainedTurn(n.y),this.burnsDir=Math.sign(n.y)},r.prototype.stepWarpPath=function(t,e){var i=this.player.cameras[s.PANORAMA];if(!this.warpPathPoints)return i.position.copy(this.warpDestPano.position),!0;var n=this.warpPathPoints[0],r=this.warpDestPano.position;if(null!==this.nodes&&this.cameraHull.length>1){var a=new o.Vector3;t<.5?a.copy(this.cameraHull[1]).sub(n).normalize().multiplyScalar(h.warp.softPushDist*t).add(n):a.copy(this.cameraHull[this.cameraHull.length-2]).sub(r).normalize().multiplyScalar(h.warp.softPushDist*h.warp.softPushEnd*(1-t)).add(r),i.position.copy(a)}else t<.5?i.position.copy(n):i.position.copy(r)},r.prototype.interruptAndFastForward=function(t,e){this.warping&&(this.warpInterrupted=!0,this.warpInterruptionBlackoutStyle=t,this.warpInterruptionTravelTime=e,null!==this.warpInterruptionBlackoutStyle&&void 0!==this.warpInterruptionBlackoutStyle||(this.warpInterruptionBlackoutStyle=x.MIDDLE),null!==this.warpInterruptionTravelTime&&void 0!==this.warpInterruptionTravelTime||(this.warpInterruptionTravelTime=h.minWarpTime))},r.prototype.warpCameraAim=function(t){var e=h.warp.minWarpTime;if(this.upcomingTransType===u.BLACK)e=h.warp.teleportTime;else{var i=this.player.cameras[s.PANORAMA],n=new o.Euler(0,0,0,h.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion,h.warp.eOrder),r=(new o.Euler).setFromQuaternion(i.quaternion,h.warp.eOrder),a=new o.Euler(n.x-r.x,n.y-r.y,n.z-r.z,h.warp.eOrder);a.y=c.constrainedTurn(a.y);var l=1e3*Math.abs(a.y)/o.Math.degToRad(h.warp.maxAimPerSec);e=Math.max(e,l)}var d=function(){this._warpStopFlying(),this.discardSlow(),t&&t()}.bind(this);this._warpCameraAim(e,d)},r.prototype.warpCommonParameters=function(t,e,i,n){this.model.skybox.material.uniforms.blackout.value=n;var r=d.uniform(this.model.skybox,"progress",1),o=d.allUniforms(this.model.chunks,"progress",1),a=!1,s=function(){if(this.warpInterrupted)return a=!0,!0}.bind(this),l=function(t,e){return i&&a?(this.model.skybox.material.uniforms.progress.value=0,!0):void r(t,e)}.bind(this),u=function(t,e){return i&&a?(o(0),!0):void o(t,e)}.bind(this);f.start(s,t,null,e,null,"safeHaltWatch"),f.start(l,t,null,e,p[h.warp.blendEasing],"skyboxProgress"),f.start(u,t,null,e,p[h.warp.blendEasing],"chunkProgress")},r.prototype.warpTravel_STD=function(t){var e,i=Math.min(h.warp.lookAheadMax,h.warp.lookAheadDist/this.warpLength),n=this.player.cameras[s.PANORAMA],r=(Math.min(.25,3/this.warpLength),Math.min(.35,7/this.warpLength)),l=new o.Euler(0,0,0,h.warp.eOrder),m=new o.Vector3,v=(new o.Euler).setFromQuaternion(n.quaternion,h.warp.eOrder),y=(new o.Euler).copy(v),w=n.position.clone(),M=new o.Matrix4,T=new o.Euler,S=h.warp.minWarpTime;S+=this.warpLength*h.warp.timePerMeter,h.warp.flySpeed>.01&&(S=1e3*this.warpLength/h.warp.flySpeed);var _=!1,A=this.warpDestHeroLoc.quaternion,P=new o.Vector3(0,0,-1).applyQuaternion(A).normalize(),C=this.warpPathPoints[this.warpPathPoints.length-1].clone().sub(this.warpPathPoints[this.warpPathPoints.length-2]).normalize(),E=C.dot(P),D=o.Math.radToDeg(Math.acos(E)),L=function(t){var e=r;return o.Math.smoothstep(t,0,e)*(1-o.Math.smoothstep(t,1-e,1))},O=function(){return M.lookAt(w,e,b.UP),l.setFromRotationMatrix(M,h.warp.eOrder),v.setFromQuaternion(n.quaternion,h.warp.eOrder),T.set(l.x-v.x,l.y-v.y,l.z-v.z,h.warp.eOrder),c.constrainedTurn(T.y)}.bind(this),I=function(t,e){if(this.warpInterrupted)return _=!0,!0}.bind(this),R=function(t,e){return _||!this.warpPathPoints?(g.blur(0),!0):void g.blur(t)}.bind(this),N=d.allUniforms(this.model.chunks,"modelAlpha",1),k=function(t,e){return _||!this.warpPathPoints?(N(0),!0):void N(t,e)}.bind(this),F=function(t,e){if(!this.warpPathPoints)return n.position.copy(this.warpDestPano.position),!0;if(_)return!0;var i=this.interpAlongPath(this.warpPathPoints,this.warpPathLengths,t);n.position.copy(i),w=this.interpAlongPath(this.warpPathPoints,this.warpPathLengths,.99*t)}.bind(this),B=function(t,n){return this.warpPathPoints?!!_||void(e=this.interpAlongPath(this.warpPathPoints,this.warpPathLengths,Math.min(t+i,1))):(a.debug("Lost bunny."),!0)}.bind(this),z=function(t,r){if(_)return a.debug(">>>> Walkthrough interupted at t="+t),!0;if(!this.warpPathPoints)return!0;var s=this.warpLength*t,u=o.Math.smoothstep(s,0,this.brushPrefs.lookBlendDist),d=o.Math.smoothstep(s,this.warpLength-this.brushPrefs.lookBlendDist,this.warpLength);h.warp.matchCam&&(u*=1-d),M.lookAt(w,e,b.UP),l.setFromRotationMatrix(M,h.warp.eOrder),v.setFromQuaternion(n.quaternion,h.warp.eOrder),T.set(l.x-v.x,l.y-v.y,l.z-v.z,h.warp.eOrder),T.y=c.constrainedTurn(T.y),l.x=v.x+u*T.x,l.y=v.y+u*T.y,l.z=v.z+u*T.z,T.set(l.x-y.x,l.y-y.y,l.z-y.z,h.warp.eOrder),T.y=c.constrainedTurn(T.y);var p=o.Math.degToRad(h.warp.maxTurnPerSec)*r/1e3;T.y=Math.sign(T.y)*Math.min(p,Math.abs(T.y)),y.x=y.x+T.x*h.warp.turnFriction,y.y=y.y+T.y*h.warp.turnFriction,y.z=y.z+T.z*h.warp.turnFriction,y.x=Math.max(o.Math.degToRad(h.warp.minDownAngle),y.x);var f=e.clone().sub(w).normalize();if(D<h.warp.maxAimRotation&&d>0){var g=1-d;f.x=f.x*g+d*C.x,f.y=f.y*g+d*C.y,f.z=f.z*g+d*C.z,f.normalize()}this.bunnyObj.position.copy(n.position).add(f),m.set(0,0,-1).applyEuler(y).normalize(),m.multiplyScalar(8),m.add(n.position),t>1-i&&h.warp.matchCam||(n.controls.lookAt(m),n.controls.lookVector.copy(m),n.lookAt(m))}.bind(this),U=function(){_?(this.discardSlow(),this.upcomingTransType=u.BLACK,this.warpTravel_BLACK(-.5,this.warpInterruptionTravelTime,x.BEGINNING,t)):this._wrapupWarpShading(t)}.bind(this);B(0);var V=h.warp.motionLeadTime+1e3*Math.abs(O())/o.Math.degToRad(h.warp.maxTurnPerSec),j=V/(S+=V);this.warpCommonParameters(S,j,!0,x.NONE),f.start(I,S,null,0,null,"_haltWatcher"),h.warp.blur>0&&(g.blurStrength=h.warp.blur,f.start(R,S,null,j,L,"blurring")),f.start(k,S,null,j,L,"modelAlpha"),f.start(F,S,null,j,p[h.warp.blendEasing],"followPath"),f.start(B,S,null,j,p[h.warp.blendEasing],"goBunny"),f.start(z,S,U,0,p[h.warp.blendEasing],"lookAtBunny")},r.prototype.warpTravel_BLACK=function(t,e,i,n){var r=t||0;null!=e||(e=h.warp.teleportTime),this.warpCommonParameters(e,r,!1,i),this.model.chunks.forEach((function(t){t.material.uniforms.blackout.value=i})),this._warpBendAim(null,e,null,r);var o=function(){this.wrapupWarpShadingOnly(n,i)}.bind(this);f.start(this.stepWarpPath.bind(this),e,o,r,p[h.warp.blendEasing],"stepMotion")},r.prototype.flightStepWalk=function(t,e,i){if(this.warpInterrupted)i&&i();else if(this.activeTransType!==u.WALK)this._clearWarpShading(),this._warpStopFlying(),this.player.spider.draw(),this.placeCpm(),i&&i();else if(this.player.currentPano!==t){var n={pano:t,lookAtPoint:e,duration:null,maxDistanceOverride:h.warp.walkMaxDist,skipWarpingCheck:!1,constantMoveSpeed:!0};this.player.nonInterruptingFlyToPano(n,i)}else i&&i()},r.prototype.makeWalkFlightFunc=function(t,e,i){return this.flightStepWalk.bind(this,t,e,i)},r.prototype.warpTravel_WALK=function(t){var e=this.nodes.length,i=this.player.model.panos,n=i.get(this.nodes[e-1]),r=n.position.clone().multiplyScalar(2).sub(i.get(this.nodes[e-2]).position),o=new Array(e+1);o[o.length-1]=function(){t&&t()}.bind(this);for(var a=e-1,s=o.length-1;s>0;s-=1){var l=this.nodes[a];n=i.get(l);var u=r.distanceTo(n.position)<.3?null:r;o[s-1]=this.makeWalkFlightFunc(n,u,o[s]),r=n.position.clone(),a--}o[0]()},r.prototype.warpCameraTravel=function(t,e,i,n){if(this.activeTransType=this.upcomingTransType,this.upcomingTransType=null,t)this.activeTransType==u.BLACK?this.warpTravel_BLACK(null,i,e,n):this.activeTransType===u.WALK?this.warpTravel_WALK(function(){this._clearWarpShading(),this._warpStopFlying(),this.player.spider.draw(),this.placeCpm(),n&&n()}.bind(this)):this.warpTravel_STD(n);else{var r=function(){this._wrapupTravel(n)}.bind(this),o={pano:this.warpDestPano,lookAtPoint:null,duration:null,maxDistanceOverride:null,skipWarpingCheck:!1};this.player.flyToPano(o,r)}},r.prototype.startWarpState=function(){this.warping=!0,this.warpInterrupted=!1,this.warpInterruptionBlackoutStyle=null,this.warpInterruptionTravelTime=null},r.prototype.endWarpState=function(){this.warping=!1},r.prototype.warpToPano=function(t,e,i,n){if(this.warping)a.warn("Cannot warp when already warping");else{if(this.upcomingTransType=t,this.activeTransType=null,!this.setWarpDestPano())return this.upcomingTransType=null,void this.warpToNonPano(n);if(this.player.mode!==s.PANORAMA)return this.upcomingTransType=null,this.discardSlow(),void this.player.flyToNewMode({mode:s.PANORAMA,pano:this.warpDestPano,duration:h.warp.outsideTime,warpDest:this.warpDestHeroLoc,callback:n,force:!0});if(!this.warpDestPano)return a.warn("no warp destination, callback dropped"),void(this.upcomingTransType=null);var r=!(this.model.panos.isNeighbour(this.player.currentPano,this.warpDestPano)&&this.warpDestPano!==this.player.currentPano&&this.warpDestPano.position.distanceTo(this.player.currentPano.position)<h.warp.nearPanoDist),o=this.chooseWarpPath(r);if(o&&this.upcomingTransType!==u.WALK){var l=function(){this.warpToPano(t,e,i,n)}.bind(this);if(this.player.checkAndWaitForPanoLoad(this.warpDestPano,"high","low",this.player.basePanoSize,l))return}this.player.currentPano||(a.warn("Arrived at a very strange spot!"),this.player.currentPano=this.warpDestPano,this.placeCpm(),this.fadeOutCpm(h.path.fadeOutTime),this.player.spider.draw()),a.debug("Warping to pano ",this.warpDestPano.position),this.upcomingTransType!==u.WALK&&this.player.emit(w.PanoChosen,this.player.currentPano,this.warpDestPano),this.player.activeTag&&this.player.dismissActiveTag(),this.startWarpState();var c=function(){this.endWarpState(),n&&n()}.bind(this);o?this.warpCameraTravel(r,e,i,c):this.warpCameraAim(c),this.player.smoothZoomToDefault(h.zoom.restoreTime)}},t.exports=r}).call(this,"/js/objects/ShowPath.js")},function(t,e,i){function n(t){this.player=t,this.obj3d=null,this.UP=new r.Vector3(0,1,0)}var r=i(0),o=i(1);n.prototype.prefs={linewidth:3,height:.07,opacity:.45,endScale:.05},n.prototype.discard=function(){if(this.obj3d){var t=this.obj3d.parent;t&&t.remove(this.obj3d)}this.obj3d=null},n.prototype.draw=function(){if(this.discard(),o.showNeighbors){var t=this.player.currentPano.floor;this.obj3d=new r.Object3D;var e=this.player.model.panos.getNeighbours(this.player.currentPano),i=this.player.currentPano.floorPosition.clone().sub(this.player.model.position);i.y+=this.prefs.height;var n=.1525,a=.0127,s=.255,l=new r.Matrix4;for(var u in e)if(e[u]){var h=this.player.model.panos.get(u),c=(h.position.clone().sub(this.player.model.position),h.position.clone().sub(h.floorPosition)),d=h.floorPosition.clone().sub(this.player.model.position);d.y+=this.prefs.height;var p=new r.Geometry;p.vertices.push(new r.Vector3(0,-a,0),new r.Vector3(-a,0,0),new r.Vector3(0,a,0),new r.Vector3(a,0,0),new r.Vector3(0,-a,0)),p.vertices.push(new r.Vector3(0,-s,0),new r.Vector3(s,-s,0),new r.Vector3(s,n,0),new r.Vector3(-n,n,0),new r.Vector3(-n,.127,0),new r.Vector3(-.19,.1,0),new r.Vector3(-.19,-.2032,0),new r.Vector3(-n,-.2286,0),new r.Vector3(-n,-s,0),new r.Vector3(0,-s,0)),l.identity().setPosition(c),p.applyMatrix(l),p.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),p.vertices.push(new r.Vector3(-this.prefs.endScale,-this.prefs.endScale,0),new r.Vector3(-this.prefs.endScale,this.prefs.endScale,0),new r.Vector3(this.prefs.endScale,this.prefs.endScale,0),new r.Vector3(this.prefs.endScale,-this.prefs.endScale,0)),l.lookAt(d,i,this.UP).setPosition(d),p.applyMatrix(l),p.vertices.push(d,i);var f=new r.Line(p,new r.LineBasicMaterial({color:h.debugColor.getHex(),transparent:!0,opacity:this.prefs.opacity,depthWrite:!1,name:"sLine"+u,linewidth:this.prefs.linewidth}));this.obj3d.add(f)}t.add(this.obj3d)}},n.prototype.update=function(){o.showNeighbors&&this.obj3d&&this.obj3d.updateMatrixWorld()},t.exports=n},function(t,e,i){function n(){this.events=[],this.valid=!1}var r=i(111);n.prototype.push=function(t,e){this.events.push({direction:t,pano:e}),this.valid=!0},n.prototype.pop=function(t){var e=this.events.pop();return this.events.length<1&&(this.valid=!1),e},n.prototype.peek=function(){return this.events.length?this.events[this.events.length-1]:{direction:null,pano:null}},n.prototype.invalidate=function(){this.events=[],this.valid=!1},n.prototype.reversePano=function(t){if(!this.valid)return null;var e=this.peek();return r.opposite(t)===e.direction?(this.pop(),e.pano):null},t.exports=n},function(t,e){var i={UP:1,DOWN:-1,LEFT:"L",RIGHT:"R",FORWARD:"F",BACK:"B",reverse:{},opposite:function(t){return this.reverse[t.toString()]}};i.reverse[i.UP]=i.DOWN,i.reverse[i.DOWN]=i.UP,i.reverse[i.LEFT]=i.RIGHT,i.reverse[i.RIGHT]=i.LEFT,i.reverse[i.FORWARD]=i.BACK,i.reverse[i.BACK]=i.FORWARD,t.exports=i},function(t,e){t.exports={ZoomIn:"zoom.in",ZoomOut:"zoom.out",ZoomMax:"zoom.max",ZoomMin:"zoom.min"}},function(t,e){function i(){this.actionSequence=[],this.actionSequenceInProgress=!1}i.prototype.reset=function(t){this.actionSequenceInProgress=!1,this.actionSequence.length=0},i.prototype.addZoomAction=function(){var t=null,e=null,i=!1,n=function(){if(t=null,this.actionSequence.length>0)this.actionSequence[0].start,this.actionSequence[this.actionSequence.length-1].end;this.reset()};return function(r,o,a){if(r!==o){i||(n=n.bind(this),i=!0),t&&(window.clearTimeout(t),t=null),a===e&&this.actionSequenceInProgress||(this.reset(),e=a),this.actionSequenceInProgress=!0;var s={start:r,end:o};this.actionSequence.push(s),t=window.setTimeout(n,150)}}}(),t.exports=i},function(t,e,i){(function(e){var n=i(0),r=i(3),o=i(115),a=i(67),s=i(20);function l(t){G.MT=this;var i=this,l=0,u=1,h=t.sRender.scene,c=t.sRender.renderer;this.enabled=!1,this.camera=t.camera,this.renderer=c,this.player=t,this.domElement=c.domElement,this.mouse={x:0,y:0},this.allSpheres=[],this.mode="panorama",this.activeMeasurement=null,this.measurements=[],this.backupDollhouseMeasurements=[],this.backupPanoramaMeasurements=[],this.backupFloorplanMeasurements=[],this.sceneMeasurement=h,this.sceneRoot=new n.Object3D,this.sceneMeasurement.add(this.sceneRoot),this.hoveredElement=null,this.modeScale=1,this.getPointType=1,this.inMeasureMode=!1,this.isPC=null,this.movingpointi=-1;var d=this.player.modellen;this.checkradius=d<10?1.5:d>100?5:(d-10)/90*3.5+1.5,this.mouseDownFlag=!1,this.mouseMoveFlag=!1,this.clickOnceHandle=null,this.measureState=!1,this.unit=1,this.mouseDownPos=new n.Vector2,this.pointIntersect=new n.Vector3,this.lockedAddPoint=!1,this.singleMeasuring=!1,this.editMode=!1,this.measureArea=!1,this.measureTexture=new a(this.player),this.oldPoint=null,this.clickMeasureId=null;var p=!1,f=this;function m(t,e,i,n){var r=1/Math.tan(e/2)/i;return t*(r=r*n/2)}Object.defineProperty(this,"autoFit",{get:function(){return p},set:function(t){return p=t,f.activeMeasurement&&(f.activeMeasurement.enableAutoFit=t),t}}),this.init=function(t){var e=t.nestmeasure;e&&e.info&&(e.info.forEach((function(t){i.startInsertion({showDistances:!0,showArea:!0,closed:!0,autoFit:i.autoFit},!0,t),i.intoMeasureMode(!r.isMobile());for(var e=t.vertex_position.length-1;e>=0;e--){var o=new n.Vector3(t.vertex_position[e].x,t.vertex_position[e].y,t.vertex_position[e].z);i.addPoint(o)}i.finishInsertion(!0,t.measureid),i.exitMeasureMode()})),this.player.measuringToolControls&&this.player.measuringToolControls.updateMeasureInfo(this.measurements),G.conf.modelMeasure&&"panorama"===this.player.mode||this.hideAll())},this.onMouseMove=function(t,e){if(i.pointIntersect.copy(i.player.intersect.point),i.mouseDownFlag&&(i.mouseMoveFlag=!0),i.pointIntersect&&i.activeMeasurement&&i.activeMeasurement.points){var n=i.activeMeasurement.points,r=i.activeMeasurement.points.length-1;r>=0&&i.activeMeasurement.setPosition(r,i.pointIntersect),1===n.length?this.singleMeasuring=!0:this.singleMeasuring=!1}},this.updateNormalPoint=function(t){if(t&&i.activeMeasurement&&i.activeMeasurement.points){var e=i.activeMeasurement.points.length-1;e>=0&&i.activeMeasurement.setPosition(e,t)}},this.onMouseDown=function(t){if(this.lockedAddPoint=!1,this.mouseDownPos.set(t.clientX,t.clientY),"floorplan"===this.player.mode)return!1;0===t.button&&(i.mouseDownFlag=!0,i.mouseMoveFlag=!1),e(".measure-edit-title").hide(),e(".measure-label").removeClass("measureActive"),i.clickMeasureId&&(e(".measure-edit-delete").hide(),i.clickMeasureId=null)},this.onMouseUp=function(t){var e=this;if(!this.lockedAddPoint){if("floorplan"===this.player.mode)return!1;if(this.mouseDownPos.distanceTo(new n.Vector2(t.clientX,t.clientY))<3){if(0===t.button)if(this.clickOnceHandle&&this.singleMeasuring)clearTimeout(this.clickOnceHandle),this.clickOnceHandle=null,new n.Vector2(t.clientX,t.clientY).distanceTo(this.oldPoint)<6&&this.addNormalPoint();else this.clickOnceHandle=setTimeout(function(t){e.clickOnceHandle=null,e.addPoint(t),e.measureArea||3!==e.activeMeasurement.points.length||e.endAndReMeasure()}.bind(this,this.pointIntersect.clone()),300),this.oldPoint=new n.Vector2(t.clientX,t.clientY);i.mouseDownFlag=!1}2===t.button&&this.endAndReMeasure()}},this.endAndReMeasure=function(){this.singleMeasuring=!1,this.finishInsertion(!0),this.exitMeasureMode(),this.startInsertion({showDistances:!0,showArea:!0,closed:!0,autoFit:this.autoFit},!0),this.intoMeasureMode(!0),this.player.measuringToolControls&&0<this.measurements.length&&this.player.measuringToolControls.updateMeasureInfo(this.measurements)},this.toast=function(t){setTimeout((function(){document.getElementsByClassName("toast-wrap")[0].getElementsByClassName("toast-msg")[0].innerHTML=t;var i=document.getElementsByClassName("toast-wrap")[0];e(".toast-wrap").addClass("me"),e(".toast-msg").addClass("me"),i.className=i.className.replace("toastAnimate",""),setTimeout((function(){i.className=i.className+" toastAnimate"}),10)}),10)},this.addNormalPoint=function(){if(!(this.activeMeasurement.points.length>1)){var t=G.pointsIntersect.point.clone(),e=G.pointsIntersect.normal.clone(),i=this.player.computeIntersectWithFloor(t,e);if(i.length>0){for(var r=0,o=0;o<i.length;o++)if(i[o].distance>.05){r=o;break}var a=i[r].point;this.activeMeasurement.removeMarker(0),this.addPoint(t,!1),this.addPoint(a,!1),this.addPoint(new n.Vector3,!1),this.endAndReMeasure()}}},this.addPoint=function(t,r){if(i.activeMeasurement&&i.activeMeasurement.points){var o=t||i.pointIntersect,a=new n.Vector3(o.x,o.y,o.z);if(function(t,e){var n=0;if(2<=e.length){for(var r=0,o=e.length;r<o;++r){var a=t.x.toFixed(2)===e[r].x.toFixed(2),s=t.y.toFixed(2)===e[r].y.toFixed(2),l=t.z.toFixed(2)===e[r].z.toFixed(2);a&&s&&l&&n++}if(2===n&&!i.singleMeasuring)return!0}return!1}(a,this.activeMeasurement.points))return;i.activeMeasurement.addMarker(a,r),2==i.activeMeasurement.points.length?e(".measure-edit-cancel, .measure-edit-delete").show():(e(".measure-edit-cancel").hide(),e(".measure-edit-save").show())}this.allSpheres=[];for(var s=[],l=0;i.measurements&&l<i.measurements.length;l++)s.push(i.measurements[l]);for(l=0;l<s.length;l++)for(var u=s[l],h=0;h<u.spheres.length;h++){var c=u.spheres[h];l==s.length-1&&h==u.spheres.length-1||i.allSpheres.push(c)}},this.hideLastPoint=function(){},this.getMousePointCloudIntersection=function(t){var e=this.player.getMouseOnWholeIntersect(t);return e?e.clone():null},this.setAutoFit=function(t){this.autoFit=t},this.setMeasureArea=function(t){this.measureArea=t},this.startInsertion=function(e,r,a){u;var s=void 0===(e=e||{}).showDistances||e.showDistances,l=void 0!==e.showArea&&e.showArea,h=void 0!==e.showAngles&&e.showAngles,c=void 0!==e.closed&&e.closed,d=e.maxMarkers||Number.MAX_SAFE_INTEGER,p=new o(t,a);p.showDistances=s,p.showArea=l,p.showAngles=h,p.showEdge=!0,p.closed=c,p.maxMarkers=d,p.category=1,p.unit=this.unit,p.enableAutoFit=this.autoFit,p.editMode=this.editMode,this.addMeasurement(p,2),a?p.addMarker(new n.Vector3(a.vertex_position[0].x,a.vertex_position[0].y,a.vertex_position[0].z)):i.pointIntersect?p.addMarker(i.pointIntersect.clone()):p.addMarker(new n.Vector3(0,0,0)),this.activeMeasurement=p},this.finishInsertion=function(t,n){if(t){if(this.activeMeasurement&&this.activeMeasurement.points&&this.activeMeasurement.points.length){if(1===this.activeMeasurement.points.length)return!1;2===this.activeMeasurement.points.length||this.activeMeasurement.removeMarker(this.activeMeasurement.points.length-1),this.activeMeasurement.points.length>2&&(i.activeMeasurement.category=2);var o=this.measureData(this.activeMeasurement);n?(i.measurements[i.measurements.length-1].measureid=n,i.measurements[i.measurements.length-1].category=i.activeMeasurement.category):r.valueFromHash("publicity")||r.valueFromHash("publictest")?i.measurements[i.measurements.length-1].measureid=111:"modelMeasure"===r.valueFromHash("iframe_type_editor")?window.parent.addMeasure(o,(function(t){i.measurements[i.measurements.length-2].measureid=t})):i.measurements[i.measurements.length-1].measureid=this.activeMeasurement.uuid}e(".measure-edit-save, .measure-edit-cancel, .measure-edit-delete").hide()}var a={type:"insertion_finished",measurement:this.activeMeasurement};this.dispatchEvent(a),this.activeMeasurement=null,l},this.updateMeasureVisible=function(t){if(!t)return!1;for(var e=0;e<this.measurements.length;e++)this.computeLableVisible(this.measurements[e],t)},this.computeLableVisible=function(t,e){for(var i=e.id,r=e.position,o=new n.Vector3,a=t.edgeLabels.concat(t.areaLabel),s=null,l=[],u=0;u<a.length;u++){(s=a[u]).userData.panoVisibleMap||(s.userData.panoVisibleMap={}),o.subVectors(s.position,r).normalize();var h=this.player.computeIntersectWithFloor(r,o);h.length>0?h[0].distance>s.position.distanceTo(r)||h[0].point.distanceTo(s.position)<.05?(l.push(!0),s.userData.panoVisibleMap[i]=!0):(l.push(!1),s.userData.panoVisibleMap[i]=!1):(l.push(!0),s.userData.panoVisibleMap[i]=!0)}return l},this.changeSize=function(t){for(var e=null,i=this.measurements.length-1;i>=0;i--){var n=this.measurements[i];if(t===n.measureid){e=this.measureData(n);break}}window.parent&&window.parent.changeSize&&e&&(e.measureid=t,e.measureId=t,window.parent.changeSize(e))},this.measureData=function(t){var e=t,i=[];return e.points.forEach((function(t){i.push({x:t.x,y:t.y,z:t.z})})),e.edgeLabels.forEach((function(t,i){e.lineDetail[i]&&(e.lineDetail[i].value=t.textNum)})),{vertex_position:i,quaternion:e.q,areaDetail:e.areaDetail,lineDetail:e.lineDetail,enable:e.enable,mode:e.mode,unit:e.unit,category:e.category,flooridx:e.flooridx,locationid:e.location_id}},this.addMeasurement=function(t,e){if(this.sceneMeasurement.add(t),this.measurements.push(t),1==e)switch(this.mode){case 1:this.backupDollhouseMeasurements.push(t);break;case 2:this.backupPanoramaMeasurements.push(t);break;case 3:this.backupFloorplanMeasurements.push(t)}this.dispatchEvent({type:"measurement_added",measurement:t}),t.addEventListener("marker_added",(function(t){i.dispatchEvent(t)})),t.addEventListener("marker_removed",(function(t){i.dispatchEvent(t)})),t.addEventListener("marker_moved",(function(t){i.dispatchEvent(t)}))},this.changeMode=function(t,e){switch(e){case"panorama":(i.measureState||G.conf.modelMeasure)&&i.showAll();break;case"dollhouse":case"floorplan":break;case"transitioning":i.hideAll()}},this.removeMeasurement=function(t,e){if(!t){var i=this.measurements.length-1;t=this.measurements[i],e=1}if(this.sceneMeasurement.remove(t),(n=this.measurements.indexOf(t))>=0&&this.measurements.splice(n,1),1==e)switch(this.mode){case 1:(n=this.backupDollhouseMeasurements.indexOf(t))>=0&&this.backupDollhouseMeasurements.splice(n,1);break;case 2:(n=this.backupPanoramaMeasurements.indexOf(t))>=0&&this.backupPanoramaMeasurements.splice(n,1);break;case 3:var n;(n=this.backupFloorplanMeasurements.indexOf(t))>=0&&this.backupFloorplanMeasurements.splice(n,1)}},this.updateMode=function(t){switch(this.mode=t,this.changeState(),this.mode){case"panorama":this.getPointType=2,this.modeScale=1;break;case"dollhouse":this.getPointType=2,this.modeScale=20;break;case"floorplan":this.getPointType=1,this.modeScale=20}},this.backup=function(){for(var t=this.measurements.length-1;t>=0;t--){var e=this.measurements[t];this.removeMeasurement(e,2)}},this.restore=function(){var t=null;switch(this.mode){case 1:t=this.backupDollhouseMeasurements;break;case 2:t=this.backupPanoramaMeasurements;break;case 3:t=this.backupFloorplanMeasurements}for(var e=t.length,i=0;i<e;i++){var n=t[i];this.addMeasurement(n,2)}},this.intoMeasureMode=function(t){this.inMeasureMode=!0,this.player.inMeasureMode=!0,this.isPC=t,"panorama"===this.player.mode&&(this.measureState=!0),this.measureTexture.show()},this.exitMeasureMode=function(t){this.inMeasureMode=!1,this.player.inMeasureMode=!1,this.activeMeasurement&&this.activeMeasurement.points&&this.activeMeasurement.points.length&&(this.removeMeasurement(this.activeMeasurement,1),this.activeMeasurement.removeMarker(this.activeMeasurement.points.length-1)),i.activeMeasurement=null,this.player.measuringToolControls.updateMeasureInfo(this.measurements),this.measureTexture.hide()},this.deleteAll=function(){for(var t=this.measurements.length-1;t>=0;t--){var e=this.measurements[t];this.removeMeasurement(e,1)}},this.show=function(t){for(var e=this.measurements.length-1;e>=0;e--){var i=this.measurements[e];i.measureid===t&&this.showOrHide(i,!0)}},this.hide=function(t){for(var e=this.measurements.length-1;e>=0;e--){var i=this.measurements[e];i.measureid===t&&this.showOrHide(i,!1)}},this.showAll=function(){this.measureState=!0;for(var t=this.measurements.length-1;t>=0;t--){var e=this.measurements[t];e.editMode||this.showOrHide(e,!0)}},this.hideAll=function(){for(var t=this.measurements.length-1;t>=0;t--){var e=this.measurements[t];this.showOrHide(e,!1)}"panorama"===this.player.mode&&(this.measureState=!1)},this.delete=function(t){for(var e=this.measurements.length-1;e>=0;e--){var i=this.measurements[e];i.measureid!==t&&i.uuid!==t||this.removeMeasurement(i,1)}this.player.measuringToolControls.updateMeasureInfo(this.measurements)},this.changeName=function(t,e){for(var i=this.measurements.length-1;i>=0;i--){var n=this.measurements[i];n.measureid===t&&n.changeName(e)}this.player.measuringToolControls.updateMeasureInfo(this.measurements)},this.selected=function(t){this.clickMeasureId=t},this.disSelected=function(t){for(var e=this.measurements.length-1;e>=0;e--){var i=this.measurements[e];i.measureid===t&&i.disSelected(t)}},this.changeUnit=function(t){},this.changeState=function(){for(var t=0;t<this.measurements.length;t++){var e=this.measurements[t];if(!e.enable)break;e.modeType=this.mode,e.update()}},this.showOrHide=function(t,e){t.enable=e,t.showDistances=e,t.showArea=e,t.showEdge=e,t.update(),this.player.measuringToolControls.updateMeasureInfo(this.measurements)},this.unbindEventListener=function(){this.domElement.removeEventListener("mousemove",onMouseMove,!1),this.domElement.removeEventListener("mousedown",onMouseDown,!1),this.domElement.removeEventListener("mouseup",onMouseUp,!0)},this.onIntoEditMeasure=function(){this.editMode=!0;for(var t=this.measurements.length-1;t>=0;t--){var e=this.measurements[t];e.editMode&&this.showOrHide(e,!0)}},this.onQuitEditMeasure=function(){this.editMode=!1;for(var t=this.measurements.length-1;t>=0;t--){var e=this.measurements[t];e.editMode&&this.showOrHide(e,!1)}},this.update=function(){if(0===this.measurements.length)return!1;for(var t=[],e=0;e<this.measurements.length;e++)t.push(this.measurements[e]);this.activeMeasurement&&t.push(this.activeMeasurement);for(e=0;e<t.length;e++){for(var r=t[e],o=0;o<r.spheres.length;o++){var a=r.spheres[o];this.allSpheres.push(a);var s=i.camera.position.distanceTo(a.getWorldPosition(new n.Vector3)),l=m(1,i.camera.fov*Math.PI/180,i.player.cameras.floorplan.top,c.domElement.clientHeight),u=30*this.modeScale/l;a.scale.set(u,u,u)}for(o=0;o<r.edgeLabels.length;o++){var h=r.edgeLabels[o];s=i.camera.position.distanceTo(h.getWorldPosition()),l=m(1,i.camera.fov*Math.PI/180,i.player.cameras.floorplan.top,c.domElement.clientHeight),u=90*this.modeScale/l;h.scale.set(u,u,u)}for(o=0;o<r.edgeLabels.length;o++){h=r.angleLabels[o],s=i.camera.position.distanceTo(h.getWorldPosition()),u=70/(l=m(1,i.camera.fov*Math.PI/180,s,c.domElement.clientHeight));h.scale.set(u,u,u)}s=i.camera.position.distanceTo(r.areaLabel.getWorldPosition()),l=m(1,i.camera.fov*Math.PI/180,i.player.cameras.floorplan.top,c.domElement.clientHeight),u=90*this.modeScale/l;r.areaLabel.scale.set(u,u,u)}},this.player.on(s.ModeChanged,this.changeMode),e(".measure-edit-save").on("click",(function(){i.endAndReMeasure(),e(".measure-edit-save, .measure-edit-cancel, .measure-edit-delete").hide()})),e(".measure-edit-cancel").on("click",(function(){i.exitMeasureMode(),i.startInsertion({showDistances:!0,showArea:!0,closed:!0,autoFit:this.autoFit},!0),i.intoMeasureMode(!0),e(".measure-edit-save, .measure-edit-cancel, .measure-edit-delete").hide()})),e(".measure-edit-delete").on("click",(function(){i.exitMeasureMode(),i.startInsertion({showDistances:!0,showArea:!0,closed:!0,autoFit:i.autoFit},!0),i.intoMeasureMode(!0),e(".measure-edit-save, .measure-edit-cancel, .measure-edit-delete").hide(),i.clickMeasureId&&(i.delete(i.clickMeasureId),i.clickMeasureId=null)}))}l.prototype=Object.create(n.EventDispatcher.prototype),t.exports=l}).call(this,i(6))},function(t,e,i){var n=i(0),r=i(116),o=i(9);function a(t,e){G.Measure=this;var i=this;this.player=t,this.camera=t.camera,n.Object3D.call(this),this.enable=!e||e.enable,this.mode=e?e.mode:t.mode,this.location_id=e?e.locationid:t.currentPano.id,this.flooridx=e?e.flooridx:t.currentPano.floorIndex,this.enableAutoFit=!1,this.checked=!1,this.unit=1,this.lineDetail=[],this.areaDetail={name:"",value:0,desc_position:{x:0,y:0,z:0}},this.q=e?e.quaternion:{x:this.camera.quaternion.x,y:this.camera.quaternion.y,z:this.camera.quaternion.z,w:this.camera.quaternion.w},this.points=[],this._showDistances=!0,this._showArea=!0,this._closed=!0,this.maxMarkers=Number.MAX_SAFE_INTEGER,this.spheres=[],this.edges=[],G.edges=this.edges,this.sphereLabels=[],this.edgeLabels=[],this.angleLabels=[],this.text="",this.lockedFitAxis=!1,e&&(1===e.category?this.text="未命名"===e.lineDetail[0].name?"":e.lineDetail[0].name+" ":this.text="未命名"===e.areaDetail.name?"":e.areaDetail.name+" "),this.flooridx||(this.flooridx=0),this.areaLabel=new r(""),this.areaLabel.material.opacity=1,this.areaLabel.textNum=0;var a=new n.SphereGeometry(.01,16,16);this.color=new n.Color(16760622);var s=function(t){t.target.material.emissive.setHex(8947848)},l=function(t){t.target.material.emissive.setHex(0)},u=function(t){var e=t.tool,n=(e.dragstart,e.mouse,e.getMousePointCloudIntersection());if(n){var r=i.spheres.indexOf(e.dragstart.object);i.setPosition(r,n)}t.event.stopImmediatePropagation()},h=function(t){};function c(t){for(var e=(t+="").split("."),i=e[0],n=e.length>1?"."+e[1]:"",r=/(\d+)(\d{3})/;r.test(i);)i=i.replace(r,"$1,$2");return i+n}this.addMarker=function(t,e){var o=!1,c=null;null==e&&(e=!0),e&&0!==this.points.length&&(c=this.points.pop(),o=!0),this.points.push(t),o&&this.points.push(c);var d=new n.Mesh(a,new n.MeshBasicMaterial({flatShading:n.SmoothShading,color:i.color,depthTest:!0,transparent:!0,opacity:1}));d.name="sphere",d.userData.index=this.points.length-1,d.addEventListener("move",s),d.addEventListener("leave",l),d.addEventListener("drag",u),d.addEventListener("drop",h),this.add(d),this.spheres.push(d);var p=new n.LineGeometry;p.setPositions([0,0,0,0,0,0]),G.matLine=new n.LineMaterial({color:16760622,linewidth:2,resolution:new n.Vector2((window.renderWidth || window.innerWidth),(window.renderHeight || window.innerHeight)),depthTest:!0});var f=new n.Line2(p,G.matLine);f.renderOrder=99,f.computeLineDistances(),f.scale.set(1,1,1),f.visible=!0,this.add(f),this.edges.push(f);var m=new r;m.visible=!1,m.textNum=0,this.edgeLabels.push(m);var g=new r;g.material.opacity=1,g.visible=!1,this.angleLabels.push(g),this.add(g);var v={type:"marker_added",measurement:this};this.dispatchEvent(v),this.setPosition(this.points.length-1,t)},this.removeMarker=function(t,e){this.points.splice(t,1),this.remove(this.spheres[t]);var i=0===t?0:t-1;this.remove(this.edges[i]),this.edges.splice(i,1),this.remove(this.edgeLabels[i]),this.edgeLabels.splice(i,1),this.spheres.splice(t,1),this.update(),this.dispatchEvent({type:"marker_removed",measurement:this})},this.setMarker=function(t,e){this.points[t]=e;var i={type:"marker_moved",measure:this,index:t,position:e.position.clone()};this.dispatchEvent(i),this.update()},this.setPosition=function(t,e){this.points[t].copy(e);var i={type:"marker_moved",measure:this,index:t,position:e.clone()};this.dispatchEvent(i),this.update()},this.changeName=function(t){this.text=t,this.update()},this.getPlaneAera=function(){var t=0,e=this.points.length-1,i=[];if(!(this.points.length>=3))return t;var r=new n.Plane;r.setFromCoplanarPoints(this.points[0],this.points[1],this.points[2]),r.constant=0;var o=r.normal,a=o.angleTo(new n.Vector3(0,1,0)),s=(new n.Vector3).crossVectors(o,new n.Vector3(0,1,0)).normalize(),l=(new n.Quaternion).setFromAxisAngle(s,a);i.push({x:0,y:0});for(var u=new n.Vector3,h=1;h<this.points.length;h++)u.subVectors(this.points[h],this.points[0]),r.projectPoint(u.clone(),u),u.applyQuaternion(l),i.push({x:u.x,y:u.z});if(i.length>0)for(h=0;h<i.length;h++){var c=i[h],d=i[e];t+=(d.x+c.x)*(c.y-d.y),e=h}return Math.abs(t/2)},this.getAngleBetweenLines=function(t,e,i){var r=(new n.Vector3).subVectors(e,t),o=(new n.Vector3).subVectors(i,t);return r.angleTo(o)},this.changeUnit=function(t){this.unit=t,this.update()},this.selected=function(){this.checked=!0,this.update()},this.disSelected=function(){this.checked=!1,this.update()},this.fitAxis=function(t,e){if(!this.lockedFitAxis){var i,r=null,o=null,a=null;i=t[e-1],o=t[e],r=new n.Vector3(o.x,i.y,o.z),(a=this.computeFitPosition(r,i,o)).point&&o.copy(a.point),r.set(o.x,o.y,i.z),(a=this.computeFitPosition(r,i,o)).point&&o.copy(a.point),r.set(i.x,o.y,o.z),(a=this.computeFitPosition(r,i,o)).point&&o.copy(a.point)}},this.computeFitPosition=function(t,e,i){var r={point:null,angle:0},o=(new n.Vector3).subVectors(e,t).normalize(),a=(new n.Vector3).subVectors(i,e),s=(new n.Vector3).crossVectors(o,a),l=o.angleTo(a),u=a.length(),h=(new n.Vector3).crossVectors(o,s).normalize();if(u<=1.15)l<=.1?(a.projectOnVector(o),r.point=(new n.Vector3).addVectors(e,a),r.angle=0):l>=3.05?(r.point=(new n.Vector3).addVectors(e,a),r.angle=180):l>=1.48&&l<=1.65&&(a.projectOnVector(h),r.point=(new n.Vector3).addVectors(e,a),r.angle=90);else{var c=Math.abs(Math.sin(l)*u),d=Math.abs(Math.cos(l)*u);c<.2?(a.projectOnVector(o),r.point=(new n.Vector3).addVectors(e,a),r.angle=l>3?180:0):d<.2&&(a.projectOnVector(h),r.point=(new n.Vector3).addVectors(e,a),r.angle=90)}return r},this.cpmputedOutScreen=function(t){var e=!1;return this.points.length>=3&&(e=!0),e},this.update=function(){if(0!==this.points.length)if(1!==this.points.length){var t=this.points.length-1,e=new n.Vector3;this.enableAutoFit&&this.points.length>=2&&this.fitAxis(this.points,t);for(var r=0;r<=t;r++){E=this.points[r];e.add(E)}e.divideScalar(this.points.length);var a=this.cpmputedOutScreen(e);this.areaLabel.position.copy(e),this.areaLabel.userData.screen_position=o.convertWorldPositionToScreen(e.clone(),this.camera),this.areaLabel.visible=this.showArea&&this.points.length>=3;var s=""!==this.text?this.text:"未命名",l=c(this.getPlaneAera().toFixed(2)),u="";u=l+"m²",u=this.text+u,this.areaLabel.setText(u),this.areaLabel.textNum=l,this.checked,this.enable||(this.areaLabel.visible=!1),this.areaLabel.setDepth(a),this.areaDetail.name=s,this.areaDetail.value=this.getPlaneAera().toFixed(2),this.areaDetail.desc_position={x:this.areaLabel.position.x,y:this.areaLabel.position.y,z:this.areaLabel.position.z};for(r=0;r<=t;r++){var h=r,d=r+1>t?0:r+1,p=0===r?t:r-1,f=(E=this.points[h],this.points[d]),m=this.points[p],g=this.spheres[h];g.position.copy(E),g.material.color=i.color;var v=this.edges[h],y=[E.x,E.y,E.z,f.x,f.y,f.z];v.geometry.setPositions(y),v.computeLineDistances(),v.geometry.verticesNeedUpdate=!0,v.geometry.computeBoundingSphere(),this.showEdge&&this.enable?this.showEdge&&(v.visible=h<t||this.closed,g.visible=!0):(v.visible=!1,g.visible=!1),this.checked;var b=this.edgeLabels[r],w=(new n.Vector3).add(E);w.add(f),w=w.multiplyScalar(.5);var x=E.distanceTo(f).toFixed(2);b.position.copy(w),b.userData.screen_position=o.convertWorldPositionToScreen(w.clone(),this.camera);var M=""!==this.text?this.text:"未命名",T=x;this.lineDetail.length===t-1?this.lineDetail.push({name:M,value:x,desc_position:{}}):this.lineDetail.length===t&&(this.lineDetail[t-1].name=M,this.lineDetail[t-1].value=x,this.lineDetail[t-1].desc_position={x:w.x,y:w.y,z:w.z}),b.setText(this.text+T+"m"),b.textNum=T,b.setDepth(a),this.checked,b.visible=this.showDistances&&(h<t||this.closed)&&this.points.length>=2&&x>0,this.enable||(b.visible=!1);var S=this.angleLabels[r],_=this.getAngleBetweenLines(E,m,f),A=f.clone().sub(m);A.multiplyScalar(.5),A=m.clone().add(A).sub(E).normalize();var P=Math.min(E.distanceTo(m),E.distanceTo(f));P/=9;var C=E.clone().add(A.multiplyScalar(P));S.position.copy(C);u=c((_*(180/Math.PI)).toFixed(1))+"°";S.setText(u),S.visible=this.showAngles&&(h<t||this.closed)&&this.points.length>=3&&_>0,this.enable||(S.visible=!1)}}else{var E=this.points[0];this.spheres[0].position.copy(E)}}}a.prototype=Object.create(n.Object3D.prototype),Object.defineProperty(a.prototype,"showArea",{get:function(){return this._showArea},set:function(t){this._showArea=t,this.update()}}),Object.defineProperty(a.prototype,"closed",{get:function(){return this._closed},set:function(t){this._closed=t,this.update()}}),Object.defineProperty(a.prototype,"showDistances",{get:function(){return this._showDistances},set:function(t){this._showDistances=t,this.update()}}),t.exports=a},function(t,e,i){var n=i(0),r=i(3);function o(t){n.Object3D.call(this);var e=new n.Texture;e.minFilter=n.LinearFilter,e.magFilter=n.LinearFilter;var i=new n.SpriteMaterial({map:e,depthTest:!1,depthWrite:!0});this.material=i,this.sprite=new n.Sprite(i),this.sprite.name="measure",this.add(this.sprite),this.borderThickness=1,this.fontface="PingFangSC-Medium,PingFang SC",this.borderColor="rgba(0, 0, 0, 0)",this.backgroundColor="rgba(0, 0, 0, 0.6)",this.textColor="rgba(255, 255, 255, 1)",this.text="",this.fontsize=r.isMobile()?20:16,this.setText(t)}o.prototype=new n.Object3D,o.prototype.setText=function(t){this.text=t,this.update()},o.prototype.setTextColor=function(t){this.textColor=t,this.update()},o.prototype.setBorderColor=function(t){this.borderColor=t,this.update()},o.prototype.setBackgroundColor=function(t){this.backgroundColor=t,this.update()},o.prototype.setDepth=function(t){this.material.depthTest=!t},o.prototype.update=function(){var t=document.createElement("canvas"),e=t.getContext("2d");e.font=this.fontsize+"px "+this.fontface,this.text=" "+this.text+" ";var i=e.measureText(this.text).width+20,r=this.fontsize+14;e.canvas.width=i,e.canvas.height=r,e.font=this.fontsize+"px "+this.fontface,e.fillStyle=this.backgroundColor,e.strokeStyle=this.borderColor,e.lineWidth=this.borderThickness,this.roundRect(e,0,0,i,r,3),e.fillStyle=this.textColor,e.fillText(this.text,9,this.fontsize+6);var o=new n.Texture(t);o.minFilter=n.LinearFilter,o.magFilter=n.LinearFilter,o.needsUpdate=!0,this.sprite.material.map=o,this.sprite.scale.set(.006*i*.4,.006*r*.4,1)},o.prototype.roundRect=function(t,e,i,n,r,o){t.beginPath(),t.moveTo(e+o,i),t.lineTo(e+n-o,i),t.quadraticCurveTo(e+n,i,e+n,i+o),t.lineTo(e+n,i+r-o),t.quadraticCurveTo(e+n,i+r,e+n-o,i+r),t.lineTo(e+o,i+r),t.quadraticCurveTo(e,i+r,e,i+r-o),t.lineTo(e,i+o),t.quadraticCurveTo(e,i,e+o,i),t.closePath(),t.fill(),t.stroke(),t.closePath()},t.exports=o},function(t,e,i){var n=i(0),r=i(9),o=i(13);function a(t){this.player=t,this.sRender=t.sRender}a.prototype.showWireFrame=function(t){var e;0===t&&(e=this.player.model.chunks),1===t&&(e=this.player.model.colliders),2===t&&(e=this.panoMarkers),this.player.model.userData.totalVertices=0,this.player.model.userData.totalFaces=0;for(var i={},n=0;n<e.length;++n){var r,o=e[n];this.removeWireFrame(o),function t(){r=Math.random(),i["_"+r]&&t(),i["_"+r]=1}(),this.addWireFrame(o,16777215*r*10)}},a.prototype.hideWireFrame=function(){for(var t=this.player.model.chunks,e=this.player.model.colliders,i=t.concat(e),n=0;n<i.length;++n){var r=i[n];this.removeWireFrame(r)}},a.prototype.addWireFrame=function(t,e){t.userData.line_segments&&this.removeWireFrame(t);var i=t.geometry,r=new n.Geometry;r.fromBufferGeometry(i).mergeVertices(),this.player.model.userData.totalVertices+=r.vertices.length,this.player.model.userData.totalFaces+=r.faces.length;var o=new n.WireframeGeometry(t.geometry),a=new n.LineSegments(o);a.material.color.setHex(e),a.rotation.copy(t.rotation),a.position.copy(t.position),t.userData.line_segments=a,t.add(a)},a.prototype.removeWireFrame=function(t){if(t.userData.line_segments){var e=t.userData.line_segments;t.userData.line_segments=null,e.geometry.dispose(),e.material.dispose(),t.remove(e)}},a.prototype.showVertexNormals=function(t){for(var e=0===t?this.player.model.chunks:this.player.model.colliders,i=0,r=e.length;i<r;++i){var o=new n.VertexNormalsHelper(e[i],.25);e[i].add(o)}},a.prototype.drawLine=function(t){var e=new n.Vector3(t.x,t.y,t.z),i=o.drawLine(this.player.model.position,e);this.sRender.scene.add(i)},a.prototype.drawFatLine=function(t){var e=new n.LineGeometry;e.setPositions([0,0,0,t.x,t.y,t.z]);var i=new n.LineMaterial({color:16711680,linewidth:2,resolution:new n.Vector2(this.sRender.renderer.domElement.width,this.sRender.renderer.domElement.height)}),r=new n.Line2(e,i);this.sRender.scene.add(r)},a.prototype.udpateShader=function(t,e){t=new n.Vector3(t.x,t.y,t.z),this.player.model.chunks.forEach((function(i){i.material.uniforms.centerT&&i.material.uniforms.centerT.value.copy(t.normalize()),i.material.uniforms.virtualCameraAngle&&(i.material.uniforms.virtualCameraAngle.value=n.Math.degToRad(e))}))},a.prototype.hideChunks=function(){for(var t=this.player.model.chunks,e=0,i=t.length;e<i;++e)t[e].visible=!1},a.prototype.showChunks=function(){for(var t=this.player.model.chunks,e=0,i=t.length;e<i;++e)t[e].visible=!0},a.prototype.showColliders=function(t){for(var e=this.player.model.colliders,i=0,n=e.length;i<n;++i)e[i].material.color.setHex(t),e[i].material.visible=!0},a.prototype.hideColliders=function(){for(var t=this.player.model.colliders,e=0,i=t.length;e<i;++e)t[e].material.visible=!1},a.prototype.getFrustum=function(){var t=new n.Frustum;return t.setFromMatrix((new n.Matrix4).multiplyMatrices(this.sRender.camera.projectionMatrix,this.sRender.camera.matrixWorldInverse)),t},a.prototype.switchDirLight=function(t){if(t){var e=new n.DirectionalLight(16777215);e.position.set(0,5,0),this.sRender.scene.add(e),this.sRender.scene.userData.dir_light=e}else this.sRender.scene.userData.dir_light&&this.sRender.scene.remove(this.sRender.scene.userData.dir_light)},a.prototype.hideHumanModelOfOutScreen=function(){for(var t=this.player.humanModelControls.putModelsOfHuman,e=new n.Vector3,i=!1,a=0,s=t.length;a<s;++a){var l=t[a],u=this.sRender.scene.userData["line"+a];u&&(u.geometry&&u.geometry.dispose(),u.material&&u.material.dispose(),this.sRender.scene.remove(u)),u=o.drawLine(e,l.position,255),this.sRender.scene.add(u),i=r.computeWorldPositionOutCamera(l.position,this.sRender.camera),l.visible=!i}},t.exports=a},function(t,e,i){"use strict";var n=i(0),r=i(5),o=i(3),a=(i(9),i(119)),s=i(121),l=(i(123),i(125)),u=i(127),h=i(129),c=i(69);function d(t,e,i,r,o,a){const s=new n.Group,l=new n.MeshBasicMaterial({color:e}),u=new n.CylinderGeometry(r,r,i,32),h=new n.Mesh(u,l);h.position.y=i/2;const c=new n.MeshBasicMaterial({color:e}),d=new n.ConeGeometry(2*r,3*r,32),p=new n.Mesh(d,c);p.position.y=i;const f=document.createElement("canvas");f.width=32,f.height=32;const m=f.getContext("2d");m.font=o+"px Arial",m.fillStyle=e.getStyle(),m.fillText(t,f.width/2,f.height/2);const g=new n.CanvasTexture(f),v=new n.SpriteMaterial({map:g}),y=new n.Sprite(v);return y.position.y=i+4*r,y.scale.set(.2,.2,.2),s.add(h),s.add(p),s.add(y),s}function p(){var t=new n.ConeGeometry(.2,.5,4),e=new n.Group,i=new n.EdgesGeometry(t),r=new n.MeshBasicMaterial({color:16777215,transparent:!0,opacity:.3}),o=new n.Mesh(t,r),a=new n.LineSegments(i,new n.LineBasicMaterial({color:65280,linewidth:2}));o.rotation.x=Math.PI,a.rotation.x=Math.PI;var s=d("X",new n.Color(16711680),.2,.02,12);s.rotation.z=-Math.PI/2;var l=d("Y",new n.Color(65280),.2,.02,12),u=d("Z",new n.Color(255),.2,.02,12);u.rotation.x=Math.PI/2;var h=new n.Group;return h.add(s),h.add(l),h.add(u),e.add(o),e.add(a),e.add(h),e.name="probemodel",e}function f(t){this.player=t,this.sRender=t.sRender,this.virtualCameraFovControls=t.virtualCameraFovControls,this.humanModelAnimationControls=t.humanModelAnimationControls,this.humanModelControls=t.humanModelControls,this.weaponModelControls=t.weaponModelControls,this.measuringToolControls=t.measuringToolControls,this.postilControls=t.postilControls,this.isEscPutModel=!1,this._isPuttingModel=!1,this.KEYS={k_27:"ESC",k_46:"DEL"},this.MOUSE={button:{_0:"LEFT_BUTTON",_2:"RIGHT_BUTTON"}},this.execState={intoDollhouse:{times:0},intoPanorama:{times:0},intoTransitioning:{times:0}},this.recordCameraPositionChangeList=[],this.recordCameraRotationChangeList=[],this.defineProperty(),this.initStateEngine(),this.initEmitMessage(),G.conf.modelplaced&&o.getQueryString("isLocal")||(this.humanModelControls.canbeSelect=!1,this.weaponModelControls.canbeSelect=!1,this.virtualCameraFovControls.canbeSelect=!1),G.conf.annotation&&o.getQueryString("isLocal")||(this.postilControls.canbeSelect=!1)}f.prototype.defineProperty=function(){Object.defineProperty(this,"isPuttingModel",{get:function(){return this._isPuttingModel},set:function(t){this._isPuttingModel=t}})},f.prototype.checkPlayerMode=function(t){switch(t){case"panorama":this.intoPanorama();break;case"dollhouse":this.intoDollhouse();break;case"floorplan":break;case"transitioning":this.intoTransitioning()}},f.prototype.checkCameraChangeList=function(){var t={},e={};if(5===this.recordCameraPositionChangeList.length&&5===this.recordCameraRotationChangeList.length){var i=0,n=0,r=this.recordCameraPositionChangeList[0];t["k_"+r.x.toFixed(3)+"_"+r.y.toFixed(3)+"_"+r.z.toFixed(3)]=1;for(var o=1;o<5;++o){var a=this.recordCameraPositionChangeList[o];1!==t["k_"+a.x.toFixed(3)+"_"+a.y.toFixed(3)+"_"+a.z.toFixed(3)]&&(i=1)}var s=this.recordCameraRotationChangeList[0];e["k_"+s.x.toFixed(3)+"_"+s.y.toFixed(3)+"_"+s.z.toFixed(3)]=1;for(o=1;o<5;++o){var l=this.recordCameraRotationChangeList[o];1!==e["k_"+l.x.toFixed(3)+"_"+l.y.toFixed(3)+"_"+l.z.toFixed(3)]&&(n=1)}this.recordCameraPositionChangeList=[],this.recordCameraRotationChangeList=[],1===i&&this.onCameraPositionMove(),0===i&&this.onCameraPositionMoveStop(),1===n&&this.onCameraRotationMove(),0===n&&this.onCameraRotationMoveStop()}},f.prototype.checkPuttingState=function(){},f.prototype.initStateEngine=function(){this.MouseStateMachine={LEFT_BUTTON:{state:!1,status:{mousedown:{state:!1,callback:this.handleMouseLeftButtonDown.bind(this)},mouseup:{state:!1,callback:this.handleMouseLeftButtonUp.bind(this)}}},RIGHT_BUTTON:{state:!1,status:{mousedown:{state:!1,callback:this.handleMouseRightButtonDown.bind(this)},mouseup:{state:!1,callback:this.handleMouseRightButtonUp.bind(this)}}},MOVE:{state:!1,callback:this.handleMouseMove.bind(this)}},this.KeysStateMachine={ESC:{state:!1,status:{keyup:{state:!1,callback:this.handleKeyOfESC.bind(this)},keydown:{state:!1,callback:function(){}}}}}},f.prototype.initEmitMessage=function(){this.humanModelControls.emitter.on("human-follow-mouse",this._emitHumanFollowMouse.bind(this)),this.humanModelControls.emitter.on("human-put-over",this._emitHumanPutOver.bind(this)),this.humanModelControls.emitter.on("human-put-cancel",this._emitHumanPutCancel.bind(this)),this.humanModelControls.emitter.on("human-handle-choosed",this._emitHumanHandleChoosed.bind(this)),this.humanModelControls.emitter.on("human-unchoosed",this._emitHumanUnChoosed.bind(this)),this.humanModelControls.emitter.on("human-mouse-in",this._emitHumanMouseIn.bind(this)),this.humanModelControls.emitter.on("human-mouse-out",this._emitHumanMouseOut.bind(this)),this.weaponModelControls.emitter.on("weapon-follow-mouse",this._emitWeaponFollowMouse.bind(this)),this.weaponModelControls.emitter.on("weapon-put-over",this._emitWeaponPutOver.bind(this)),this.weaponModelControls.emitter.on("weapon-put-cancel",this._emitWeaponPutCancel.bind(this)),this.weaponModelControls.emitter.on("weapon-handle-choosed",this._emitWeaponHandleChoosed.bind(this)),this.weaponModelControls.emitter.on("weapon-unchoosed",this._emitWeaponUnChoosed.bind(this)),this.virtualCameraFovControls.emitter.on("virtualCamera-follow-mouse",this._emitVirtualCameraFollowMouse.bind(this)),this.virtualCameraFovControls.emitter.on("virtualCamera-follow-mouse-over",this._emitVirtualCameraFollowMouseOver.bind(this)),this.virtualCameraFovControls.emitter.on("virtualCamera-put-cancel",this._emitVirtualCameraPutCancel.bind(this)),this.virtualCameraFovControls.emitter.on("virtualCamera-handle-choosed",this._emitVirtualCameraHandleChoosed.bind(this)),this.virtualCameraFovControls.emitter.on("virtualCamera-unchoosed",this._emitVirtualCameraUnChoosed.bind(this)),this.virtualCameraFovControls.emitter.on("virtualCamera-mouse-in",this._emitVirtualCameraMouseIn.bind(this)),this.virtualCameraFovControls.emitter.on("virtualCamera-mouse-out",this._emitVirtualCameraMouseOut.bind(this)),this.postilControls.emitter.on("postil-follow-mouse",this._emitPostilFollowMouse.bind(this)),this.postilControls.emitter.on("postil-put-over",this._emitPostilPutOver.bind(this)),this.postilControls.emitter.on("postil-put-cancel",this._emitPostilPutCancel.bind(this))},f.prototype.intoPanorama=function(){1!==this.execState.intoPanorama.times&&(this.execState.intoTransitioning.times=0,this.execState.intoPanorama.times+=1,this.player.emit("viewModePanorama"),this.humanModelControls.canbeUsed&&((G.conf.modelplaced||o.getQueryString("isLocal"))&&(this.humanModelControls.canbeSelect=!0),this.humanModelControls.onIntoPanorama()),this.weaponModelControls.canbeUsed&&((G.conf.modelplaced||o.getQueryString("isLocal"))&&(this.weaponModelControls._canbeSelect=!0),this.weaponModelControls.onIntoPanorama()),this.postilControls.canbeUsed&&((G.conf.annotation||o.getQueryString("isLocal"))&&(this.postilControls.canbeSelect=!0),this.postilControls.onIntoPanorama()),this.virtualCameraFovControls.canbeUsed&&((G.conf.modelplaced||o.getQueryString("isLocal"))&&(this.virtualCameraFovControls._canbeSelect=!0),this.virtualCameraFovControls.onIntoPanorama()),this.postilControls.canbeUsed&&this.postilControls.onIntoPanorama())},f.prototype.intoTransitioning=function(){this.execState.intoPanorama.times=0,this.execState.intoDollhouse.times=0,this.execState.intoTransitioning.times+=1,this.player.emit("viewModeTransitioning"),this.humanModelControls.onIntoTransitioning(),this.virtualCameraFovControls.onIntoTransitioning(),this.weaponModelControls.onIntoTransitioning()},f.prototype.intoDollhouse=function(){1!==this.execState.intoDollhouse.times&&(this.execState.intoTransitioning.times=0,this.execState.intoDollhouse.times+=1,this.player.emit("view-mode-dollhouse"),this.humanModelControls.onIntoDollhouse(),this.virtualCameraFovControls.onIntoDollhouse())},f.prototype.handleKeyOfESC=function(){this.isEscPutModel=!1,this.humanModelControls.canbeUsed&&this.humanModelControls.handleKeyOfEsc(),this.weaponModelControls.canbeUsed&&this.weaponModelControls.handleKeyOfEsc(),this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.handleKeyOfEsc(),this.postilControls.canbeUsed&&this.postilControls.handleKeyOfEsc();var t=this.getChoosedModel();!t||t.userData.follow_mouse?t||this.isEscPutModel||this.player.emit("quit-put-mode"):this.destroyChoosedModelControlState(t)},f.prototype.handleMouseMove=function(){this.humanModelControls.canbeUsed&&this.humanModelControls.handleMouseMove(event),this.weaponModelControls.canbeUsed&&this.weaponModelControls.handleMouseMove(event),this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.handleMouseMove(event),this.postilControls.canbeUsed&&this.postilControls.handleMouseMove(event),this.humanModelControls.HUMANMODEL&&(this.humanModelControls.HUMANMODEL.userData.follow_mouse?(this.weaponModelControls._canbeSelect=!1,this.virtualCameraFovControls._canbeSelect=!1):(this.weaponModelControls._canbeSelect=!0,this.virtualCameraFovControls._canbeSelect=!0)),this.weaponModelControls.CONTROLMODEL&&(this.weaponModelControls.CONTROLMODEL.userData.follow_mouse?(this.humanModelControls.canbeSelect=!1,this.virtualCameraFovControls._canbeSelect=!1):(this.humanModelControls.canbeSelect=!0,this.virtualCameraFovControls._canbeSelect=!0)),this.virtualCameraFovControls.VIRTUAL_CAMERA&&(this.virtualCameraFovControls.VIRTUAL_CAMERA.userData.follow_mouse?(this.humanModelControls.canbeSelect=!1,this.weaponModelControls._canbeSelect=!1):(this.humanModelControls.canbeSelect=!0,this.weaponModelControls._canbeSelect=!0))},f.prototype.handleMouseLeftButtonDown=function(){this.humanModelControls.canbeUsed&&this.humanModelControls.handleMouseLeftButtonDown(),this.weaponModelControls.canbeUsed&&this.weaponModelControls.handleMouseLeftButtonDown(),this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.handleMouseLeftButtonDown(),this.postilControls.canbeUsed&&this.postilControls.handleMouseLeftButtonDown()},f.prototype.handleMouseLeftButtonUp=function(){m&&(m=!1,this.onHandleControlPanoramaMoveStopNoPan()),this.humanModelControls.canbeUsed&&this.humanModelControls.handleMouseLeftButtonUp(),this.weaponModelControls.canbeUsed&&this.weaponModelControls.handleMouseLeftButtonUp(),this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.handleMouseLeftButtonUp(),this.postilControls.canbeUsed&&this.postilControls.handleMouseLeftButtonUp()},f.prototype.handleMouseRightButtonDown=function(){this.humanModelControls.canbeUsed&&this.humanModelControls.handleMouseRightButtonDown(),this.weaponModelControls.canbeUsed&&this.weaponModelControls.handleMouseRightButtonDown(),this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.handleMouseRightButtonDown(),this.postilControls.canbeUsed&&this.postilControls.handleMouseRightButtonDown()},f.prototype.handleMouseRightButtonUp=function(){this.humanModelControls.canbeUsed&&this.humanModelControls.handleMouseRightButtonUp(),this.weaponModelControls.canbeUsed&&this.weaponModelControls.handleMouseRightButtonUp(),this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.handleMouseRightButtonUp(),this.postilControls.canbeUsed&&this.postilControls.handleMouseRightButtonUp()},f.prototype.loadHumanModel=function(t){if(!this._isPuttingModel&&!this.player.inMeasureMode){var e=this;if(10!==t){var i="model/human/model_"+t+".fbx";this.player.emit("showLoaddingOfLoadPutModel"),a.load(i).then((function(i){var n=new l(i,t);n.init(),n.initMatcap().then((function(i){var n=i.userData.setting_item;3===t&&(n.modelName="成年男性"),4===t&&(n.modelName="成年女性"),5===t&&(n.modelName="男性警察"),6===t&&(n.modelName="男性警察"),7===t&&(n.modelName="青年女性"),8===t&&(n.modelName="青年男性"),e.addHumanModel(i)}))}))}else{i="model/human/model_"+t+".glb";this.player.emit("showLoaddingOfLoadPutModel"),s.load(i).then((function(t){var i=new n.Group;i.add(t.scene.children[0]),i.animations=t.animations;var r=new n.AxesHelper(.4);i.add(r),i.scale.set(.8,.8,.8),i.userData.follow_mouse=!0,e.sRender.scene.add(i),e.humanModelAnimationControls.init(i),e.player.emit("hideLoaddingOfLoadPutModel")}))}}},f.prototype.loadWeaponModel=function(t){if(!this._isPuttingModel&&!this.player.inMeasureMode){this.player.emit("showLoaddingOfLoadPutModel");var e=p();new u(e,t).init(),e.userData.setting_item.modelName="探针",this.addWeaponModel(e)}},f.prototype.loadPostilModel=function(t){if(!this._isPuttingModel&&!this.player.inMeasureMode){var e=this,i=new c(t).init();if(i){i.userData.follow_mouse=!0,this.postilControls.POSTIL&&this.postilControls.destroyPostilChoosedState(),this.postilControls.POSTIL=i;var n=setTimeout((function(){e.sRender.scene.add(i),clearTimeout(n)}),300)}}},f.prototype.loadVirtualCamera=function(t){if(!this._isPuttingModel&&!this.player.inMeasureMode){var e=(new h).init();this.addVirtualCamera(e)}},f.prototype.loadModelList=function(t){this.player.isLoadedSaveModel=!0;var e=this,i=[],n=[],r=[],o=[],s={};for(var c in t){"human"!==(f=t[c]).type&&"weapon"!==f.type||(o.push(f.timestamp),s["k_"+f.timestamp]=f),"camera"===f.type&&r.push(f)}o.sort((function(t,e){return t-e}));for(var d=0;d<o.length;++d){var f=s["k_"+o[d]];n.push(f)}function m(){for(var t=[],i=0,n=r.length;i<n;++i)t.push(i+1);var o=[],a=null;!function i(n){if(!n)return o[o.length-1],void e.player.emit("hideLoaddingOfLoadPutModel");var s,l,u;s=n,l=function(e){return o.push(e),i(t.shift())},(u=(new h).init(r[s-1])).userData.is_save=!0,e.addVirtualCameraOfSave(u),null===a&&(a=setTimeout((function(){e.virtualCameraFovControls.addAxleWire(u),e.virtualCameraFovControls.computeCrash(u,l),clearTimeout(a),a=null}),0))}(t.shift())}0<n.length?(e.player.emit("showLoaddingOfLoadPutModel"),function t(){var o=n[i.length];"human"===o.type&&function(t,o,s){o="model/human/model_"+t.mid+".fbx",a.load(o).then((function(o){t.uuid=o.uuid,o.userData.setting_item=t,o.userData.is_save=!0;var a=new l(o,t.mid);a.init(),a.initMatcap().then((function(t){i.push(t.uuid),e.addHumanModelOfSave(t),i.length!==n.length?s():(e.player.emit("hideLoaddingOfLoadPutModel"),e.player.emit("putModelListLoadingIsOver"),0<r.length&&(e.player.emit("showLoaddingOfLoadPutModel"),setTimeout((function(){m()}),200)))}))}))}(o,"",t),"weapon"==o.type&&function(t,o,a){"model/weapon/model_"+t.mid+".obj",t.uuid=s.uuid,s.userData.setting_item=t;var s=p();new u(s,t.mid).init(),s.userData.is_save=!0,i.push(s.uuid),e.addWeaponModelOfSave(s),i.length!==n.length?a():(e.player.emit("hideLoaddingOfLoadPutModel"),e.player.emit("putModelListLoadingIsOver"),0<r.length&&(e.player.emit("showLoaddingOfLoadPutModel"),setTimeout((function(){m()}),200)))}(o,0,t)}()):(e.player.emit("showLoaddingOfLoadPutModel"),setTimeout((function(){m()}),200))},f.prototype.getChoosedModel=function(){return this.humanModelControls.HUMANMODEL||this.weaponModelControls.CONTROLMODEL||this.virtualCameraFovControls.VIRTUAL_CAMERA},f.prototype.addHumanModel=function(t){var e=this.getChoosedModel();e&&this.destroyChoosedModelControlState(e);var i=this;t.userData.follow_mouse=!0,this.humanModelControls.HUMANMODEL=t,this.humanModelControls.initSkeletonBox(t);var n=setTimeout((function(){i.sRender.scene.add(t),i.player.emit("hideLoaddingOfLoadPutModel"),clearTimeout(n)}),300)},f.prototype.addWeaponModel=function(t){var e=this.getChoosedModel();e&&this.destroyChoosedModelControlState(e);var i=this;t.userData.follow_mouse=!0,this.weaponModelControls.initBoundingBox(t),this.weaponModelControls.CONTROLMODEL=t;var n=setTimeout((function(){i.sRender.scene.add(t),i.player.emit("hideLoaddingOfLoadPutModel"),clearTimeout(n)}),300)},f.prototype.addVirtualCamera=function(t){var e=this.getChoosedModel();e&&this.destroyChoosedModelControlState(e),t.userData.follow_mouse=!0;var i=this.virtualCameraFovControls.VIRTUAL_CAMERA;i&&(this.virtualCameraFovControls.destroyBoxHelper(i),this.virtualCameraFovControls.destroyControl(i)),this.virtualCameraFovControls.VIRTUAL_CAMERA=t,this.virtualCameraFovControls.initBoxHelper(t),this.sRender.scene.add(t)},f.prototype.addHumanModelOfSave=function(t){var e=t.userData.setting_item;this.sRender.scene.add(t),this.player.emit("addModelListItem",e),this.humanModelControls.putModelsOfHuman.push(t),this.humanModelControls.putModelsOfHumanKV[t.uuid]=t},f.prototype.addWeaponModelOfSave=function(t){this.sRender.scene.add(t),this.weaponModelControls.WEAPONS_SCENE.push(t),this.weaponModelControls.WEAPONS_KV[t.uuid]=t,this.player.emit("addModelListItem",t.userData.setting_item)},f.prototype.addVirtualCameraOfSave=function(t){this.sRender.scene.add(t),this.virtualCameraFovControls.putModels.push(t),this.virtualCameraFovControls.putModelsOfKV[t.uuid]=t,this.player.emit("addModelListItem",t.userData.setting_item)},f.prototype.savePutModels=function(){for(var t={},e=this.humanModelControls.putModelsOfHuman,i=this.weaponModelControls.WEAPONS_SCENE,n=this.virtualCameraFovControls.putModels,r=e.concat(i).concat(n),a=0,s=r.length;a<s;++a){var l=r[a].userData.setting_item;t[l.uuid]=l}if(o.getQueryString("isLocal")){var u=JSON.stringify(t);localStorage.setItem("SETTINGS_DATA_PUTMODEL",u)}return JSON.stringify(t)},f.prototype.showModelsList=function(t){this.player.isShowModelList=!0,this.player.isLoadedSaveModel?(this.humanModelControls.canbeUsed&&this.humanModelControls.handleSwitchSaveModelVisible(!0),this.weaponModelControls.canbeUsed&&this.weaponModelControls.handleSwitchSaveModelVisible(!0),this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.handleSwitchSaveCameraVisible(!0),this.player.emit("showModelListPanel")):this.loadModelList(t)},f.prototype.hideModelsList=function(){this.player.isShowModelList=!1,this.humanModelControls.canbeUsed&&this.humanModelControls.handleSwitchSaveModelVisible(!1),this.weaponModelControls.canbeUsed&&this.weaponModelControls.handleSwitchSaveModelVisible(!1),this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.handleSwitchSaveCameraVisible(!1),this.player.emit("hideModelListPanel")},f.prototype.switchPutModelCanbeSelect=function(t){this.humanModelControls.canbeUsed&&(this.humanModelControls.canbeSelect=t),this.weaponModelControls.canbeUsed&&(this.weaponModelControls._canbeSelect=t),this.virtualCameraFovControls.canbeUsed&&(this.virtualCameraFovControls._canbeSelect=t)},f.prototype.switchMouseWheelLocked=function(t){this.player.controls&&this.player.controls[r.PANORAMA]&&(this.player.controls[r.PANORAMA].lockedMouseWheel=t,this.player.controls[r.DOLLHOUSE].lockedMouseWheel=t),this.switchKeyMoveDisabled(t),this.switchKeyRotateDisabled(t)},f.prototype.switchKeyMoveDisabled=function(t){this.player.controls&&this.player.controls[r.PANORAMA]&&(this.player.controls[r.PANORAMA].disableKeyMove=t)},f.prototype.switchKeyRotateDisabled=function(t){this.player.controls&&this.player.controls[r.PANORAMA]&&(this.player.controls[r.PANORAMA].disableKeyRotate=t)},f.prototype.destroyChoosedModelControlState=function(t){switch(t.userData.setting_item.type){case"human":this.humanModelControls.destroyInvalidModelControl(t);break;case"weapon":this.weaponModelControls.destroyModelChoosedState(t);break;case"camera":this.virtualCameraFovControls.destroyModelControlState(t)}},f.prototype.onHandleControlPanoramaMove=function(){"panorama"===this.player.mode&&(this.player.emit("handle-control-panorama-move"),this.humanModelControls.canbeUsed&&this.humanModelControls.onHandleControlPanoramaMove(),this.weaponModelControls.canbeUsed&&this.weaponModelControls.onHandleControlPanoramaMove(),this.measuringToolControls.canbeUsed&&this.measuringToolControls.onHandleControlPanoramaMove(),this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.onHandleControlPanoramaMove())},f.prototype.onHandleDollhouseMove=function(){this.player.emit("handle-control-dollhouse-move"),this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.onHandleControlDollhouseMove(),this.humanModelControls.canbeUsed&&this.humanModelControls.onHandleControlDollhouseMove()},f.prototype.onHandleControlTtagsMove=function(){"panorama"===this.player.mode&&(this.humanModelControls.onHandleControlTtagsMove(),this.weaponModelControls.onHandleControlTtagsMove(),this.virtualCameraFovControls.onHandleControlTtagsMove())},f.prototype.onHandleControlPanoramaMoveStop=function(){"panorama"===this.player.mode&&(this.humanModelControls.canbeUsed&&this.humanModelControls.onHandleControlPanoramaMoveStop(),this.weaponModelControls.canbeUsed&&this.weaponModelControls.onHandleControlPanoramaMoveStop(),this.measuringToolControls.canbeUsed&&this.measuringToolControls.onHandleControlPanoramaMoveStop(),this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.onHandleControlPanoramaMoveStop())},f.prototype.onHandleControlPanoramaMoveStopNoPan=function(){this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.onHandleControlPanoramaMoveStopNoPan()},f.prototype.onHandleDollhouseMoveStop=function(){this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.onHandleControlDollhouseMoveStop(),this.humanModelControls.canbeUsed&&this.humanModelControls.onHandleControlDollhouseMoveStop()};var m=!1;f.prototype.onPlayerHandleControlPanoramaMove=function(){m=!0,this.humanModelControls.canbeUsed&&this.humanModelControls.onHandleControlPanoramaMove(),this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.onHandleControlPanoramaMove()},f.prototype.onFlyEnd=function(){"panorama"===this.player.mode&&(this.humanModelControls.onFlyEnd(),this.measuringToolControls.onFlyEnd(),this.virtualCameraFovControls.onFlyEnd())},f.prototype.onPlayerMouseMove=function(t){this.MouseStateMachine.MOVE.state=!0,this.MouseStateMachine.MOVE.callback()},f.prototype.onPlayerMouseDown=function(t){var e=t.button,i=this.MOUSE.button["_"+e];i&&(this.MouseStateMachine[i].state=!0,this.MouseStateMachine[i].status.mousedown.state=!0,this.MouseStateMachine[i].status.mouseup.state=!1,this.MouseStateMachine[i].status.mousedown.callback()),this.MouseStateMachine.MOVE.state=!1},f.prototype.onPlayerMouseUp=function(t){var e=t.button,i=this.MOUSE.button["_"+e];i&&(this.MouseStateMachine[i].state=!0,this.MouseStateMachine[i].status.mousedown.state=!1,this.MouseStateMachine[i].status.mouseup.state=!0,this.MouseStateMachine[i].status.mouseup.callback()),this.MouseStateMachine.MOVE.state=!1},f.prototype.onPlayerKeyUp=function(t){var e=t.keyCode?t.keyCode:t.which;this.KEYS["k_"+e]&&(this.KeysStateMachine[this.KEYS["k_"+e]].state=!0,this.KeysStateMachine[this.KEYS["k_"+e]].status.keyup.state=!0,this.KeysStateMachine[this.KEYS["k_"+e]].status.keyup.callback())},f.prototype.onPlayerKeyUpPlayerContainer=function(t){var e=t.keyCode?t.keyCode:t.which;this.KEYS["k_"+e]&&(this.KeysStateMachine[this.KEYS["k_"+e]].state=!0,this.KeysStateMachine[this.KEYS["k_"+e]].status.keyup.state=!0,this.KeysStateMachine[this.KEYS["k_"+e]].status.keyup.callback())};var g=!1;f.prototype.onCameraPositionMove=function(){g=!1,"panorama"===this.player.mode&&this.virtualCameraFovControls&&this.virtualCameraFovControls.onCameraPositionMove()},f.prototype.onCameraPositionMoveStop=function(){g||(g=!0,"panorama"===this.player.mode&&this.virtualCameraFovControls&&this.virtualCameraFovControls.onCameraPositionMoveStop())};var v=!1;f.prototype.onCameraRotationMove=function(){v=!1,"panorama"===this.player.mode&&this.virtualCameraFovControls&&this.virtualCameraFovControls.onCameraRotationMove()},f.prototype.onCameraRotationMoveStop=function(){v||(v=!0,"panorama"===this.player.mode&&this.virtualCameraFovControls&&this.virtualCameraFovControls.onCameraRotationMoveStop())},f.prototype._emitHumanFollowMouse=function(){this.isEscPutModel=!1,this._isPuttingModel=!0,this.switchPutModelCanbeSelect(!1),this.player.emit("hide-right-tools"),this.player.emit("put-model-follow-mouse"),this.switchMouseWheelLocked(!0)},f.prototype._emitHumanPutOver=function(){this.isEscPutModel=!1,this._isPuttingModel=!1,this.switchPutModelCanbeSelect(!0),this.player.emit("show-right-tools"),this.player.emit("put-model-follow-mouse-over"),this.switchMouseWheelLocked(!1)},f.prototype._emitHumanPutCancel=function(){this.isEscPutModel=!0,this._isPuttingModel=!1,this.switchPutModelCanbeSelect(!0),this.player.emit("show-right-tools"),this.player.emit("put-model-follow-mouse-cancel"),this.switchMouseWheelLocked(!1)},f.prototype._emitHumanHandleChoosed=function(){this.switchMouseWheelLocked(!0)},f.prototype._emitHumanUnChoosed=function(){this.switchMouseWheelLocked(!1)},f.prototype._emitWeaponFollowMouse=function(){this.isEscPutModel=!1,this._isPuttingModel=!0,this.switchPutModelCanbeSelect(!1),this.player.emit("hide-right-tools"),this.player.emit("put-model-follow-mouse"),this.switchMouseWheelLocked(!0)},f.prototype._emitWeaponPutOver=function(){this.isEscPutModel=!1,this._isPuttingModel=!1,this.switchPutModelCanbeSelect(!0),this.player.emit("show-right-tools"),this.player.emit("put-model-follow-mouse-over"),this.switchMouseWheelLocked(!1)},f.prototype._emitWeaponPutCancel=function(){this.isEscPutModel=!0,this._isPuttingModel=!1,this.switchPutModelCanbeSelect(!0),this.player.emit("show-right-tools"),this.player.emit("put-model-follow-mouse-cancel"),this.switchMouseWheelLocked(!1)},f.prototype._emitWeaponHandleChoosed=function(){this.switchMouseWheelLocked(!0)},f.prototype._emitWeaponUnChoosed=function(){this.switchMouseWheelLocked(!1)},f.prototype._emitVirtualCameraFollowMouse=function(){this.isEscPutModel=!1,this._isPuttingModel=!0,this.switchPutModelCanbeSelect(!1),this.player.emit("hide-right-tools"),this.player.emit("put-model-follow-mouse"),this.switchMouseWheelLocked(!0)},f.prototype._emitVirtualCameraFollowMouseOver=function(){this.isEscPutModel=!1,this._isPuttingModel=!1,this.switchPutModelCanbeSelect(!0),this.player.emit("show-right-tools"),this.player.emit("put-model-follow-mouse-over"),this.switchMouseWheelLocked(!1)},f.prototype._emitVirtualCameraPutCancel=function(){this.isEscPutModel=!0,this._isPuttingModel=!1,this.switchPutModelCanbeSelect(!0),this.player.emit("show-right-tools"),this.player.emit("put-model-follow-mouse-cancel"),this.switchMouseWheelLocked(!1)},f.prototype._emitVirtualCameraHandleChoosed=function(){this.switchMouseWheelLocked(!0)},f.prototype._emitVirtualCameraUnChoosed=function(){this.switchMouseWheelLocked(!1)},f.prototype._emitPostilFollowMouse=function(){this._isPuttingModel=!0,this.player.emit("put-model-follow-mouse")},f.prototype._emitPostilPutOver=function(){this._isPuttingModel=!1,this.player.emit("put-model-follow-mouse-over")},f.prototype._emitPostilPutCancel=function(){this._isPuttingModel=!1,this.player.emit("put-model-follow-mouse-cancel")},f.prototype._emitVirtualCameraMouseIn=function(){this.switchMouseWheelLocked(!0)},f.prototype._emitVirtualCameraMouseOut=function(){this.switchMouseWheelLocked(!1)},f.prototype._emitHumanMouseIn=function(){this.switchMouseWheelLocked(!0)},f.prototype._emitHumanMouseOut=function(){this.switchMouseWheelLocked(!1)},f.prototype.updateCameraChangeList=function(){var t=this.sRender.camera.position.clone(),e=this.sRender.camera.rotation.clone();this.recordCameraPositionChangeList.push(t),this.recordCameraRotationChangeList.push(e),this.checkCameraChangeList()};f.prototype.update=function(t){this.updateCameraChangeList(),this.virtualCameraFovControls.update(t),this.humanModelAnimationControls.update(t),this.humanModelControls.update(t),this.weaponModelControls.update(t),this.measuringToolControls.update(t),this.postilControls.update(t),this.checkPlayerMode(this.player.mode)},t.exports=f},function(t,e,i){"use strict";i(120);var n=i(0);function r(){}r.prototype.load=function(t){var e=new n.FBXLoaderOfMeshMatcapMaterial;return new Promise((function(i,n){e.load(t,(function(t){t?i(t):n("FBXLoader Failed")}))}))},t.exports=new r},function(t,e,i){var n=i(0);n.FBXLoaderOfMeshMatcapMaterial=function(){var t,e,i;function r(t){this.manager=void 0!==t?t:n.DefaultLoadingManager}function o(t){this.textureLoader=t}function a(){}function s(){}function l(){}function u(){}function h(t,e){this.dv=new DataView(t),this.offset=0,this.littleEndian=void 0===e||e}function c(){}function d(t){var e=t.match(/FBXVersion: (\d+)/);if(e)return parseInt(e[1]);throw new Error("THREE.FBXLoader: Cannot find the version number for the file given.")}function p(t){return t/46186158e3}r.prototype={constructor:r,crossOrigin:"anonymous",load:function(t,e,i,r){var o=this,a=void 0===o.path?n.LoaderUtils.extractUrlBase(t):o.path,s=new n.FileLoader(this.manager);s.setPath(o.path),s.setResponseType("arraybuffer"),s.load(t,(function(i){try{e(o.parse(i,a))}catch(e){setTimeout((function(){r&&r(e),o.manager.itemError(t)}),0)}}),i,r)},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setCrossOrigin:function(t){return this.crossOrigin=t,this},parse:function(e,i){if(s="Kaydara FBX Binary \0",(a=e).byteLength>=s.length&&s===x(a,0,s.length))t=(new u).parse(e);else{var r=x(e);if(!function(t){var e=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],i=0;for(var n=0;n<e.length;++n){if((o=void 0,o=t[(r=1)-1],t=t.slice(i+r),i++,o)===e[n])return!1}var r,o;return!0}(r))throw new Error("THREE.FBXLoader: Unknown format.");if(d(r)<7e3)throw new Error("THREE.FBXLoader: FBX version not supported, FileVersion: "+d(r));t=(new l).parse(r)}var a,s;return new o(new n.TextureLoader(this.manager).setPath(this.resourcePath||i).setCrossOrigin(this.crossOrigin)).parse(t)}},o.prototype={constructor:o,parse:function(){e=this.parseConnections();var t=this.parseImages(),n=this.parseTextures(t),r=this.parseMaterials(n),o=this.parseDeformers(),s=(new a).parse(o);return this.parseScene(o,s,r),i},parseConnections:function(){var e=new Map;"Connections"in t&&t.Connections.connections.forEach((function(t){var i=t[0],n=t[1],r=t[2];e.has(i)||e.set(i,{parents:[],children:[]});var o={ID:n,relationship:r};e.get(i).parents.push(o),e.has(n)||e.set(n,{parents:[],children:[]});var a={ID:i,relationship:r};e.get(n).children.push(a)}));return e},parseImages:function(){var e={},i={};if("Video"in t.Objects){var n=t.Objects.Video;for(var r in n){var o=n[r];if(e[u=parseInt(r)]=o.RelativeFilename||o.Filename,"Content"in o){var a=o.Content instanceof ArrayBuffer&&o.Content.byteLength>0,s="string"==typeof o.Content&&""!==o.Content;if(a||s){var l=this.parseImage(n[r]);i[o.RelativeFilename||o.Filename]=l}}}}for(var u in e){var h=e[u];void 0!==i[h]?e[u]=i[h]:e[u]=e[u].split("\\").pop()}return e},parseImage:function(t){var e,i=t.Content,r=t.RelativeFilename||t.Filename;switch(r.slice(r.lastIndexOf(".")+1).toLowerCase()){case"bmp":e="image/bmp";break;case"jpg":case"jpeg":e="image/jpeg";break;case"png":e="image/png";break;case"tif":e="image/tiff";break;case"tga":if("function"!=typeof n.TGALoader)return;if(null===n.Loader.Handlers.get(".tga")){var o=new n.TGALoader;o.setPath(this.textureLoader.path),n.Loader.Handlers.add(/\.tga$/i,o)}e="image/tga";break;default:return}if("string"==typeof i)return"data:"+e+";base64,"+i;var a=new Uint8Array(i);return window.URL.createObjectURL(new Blob([a],{type:e}))},parseTextures:function(e){var i=new Map;if("Texture"in t.Objects){var n=t.Objects.Texture;for(var r in n){var o=this.parseTexture(n[r],e);i.set(parseInt(r),o)}}return i},parseTexture:function(t,e){var i=this.loadTexture(t,e);i.ID=t.id,i.name=t.attrName;var r=t.WrapModeU,o=t.WrapModeV,a=void 0!==r?r.value:0,s=void 0!==o?o.value:0;if(i.wrapS=0===a?n.RepeatWrapping:n.ClampToEdgeWrapping,i.wrapT=0===s?n.RepeatWrapping:n.ClampToEdgeWrapping,"Scaling"in t){var l=t.Scaling.value;i.repeat.x=l[0],i.repeat.y=l[1]}return i},loadTexture:function(t,i){var r,o,a=this.textureLoader.path,s=e.get(t.id).children;void 0!==s&&s.length>0&&void 0!==i[s[0].ID]&&(0!==(r=i[s[0].ID]).indexOf("blob:")&&0!==r.indexOf("data:")||this.textureLoader.setPath(void 0));var l=t.FileName.slice(-3).toLowerCase();if("tga"===l){var u=n.Loader.Handlers.get(".tga");o=null===u?new n.Texture:u.load(r)}else o="psd"===l?new n.Texture:this.textureLoader.load(r);return this.textureLoader.setPath(a),o},parseMaterials:function(e){var i=new Map;if("Material"in t.Objects){var n=t.Objects.Material;for(var r in n){var o=this.parseMaterial(n[r],e);null!==o&&i.set(parseInt(r),o)}}return i},parseMaterial:function(t,i){var r=t.id,o=t.attrName,a=t.ShadingModel;if("object"==typeof a&&(a=a.value),!e.has(r))return null;var s,l=this.parseParameters(t,i,r);switch(a.toLowerCase()){case"phong":s=new n.MeshMatcapMaterial;break;case"lambert":s=new n.MeshLambertMaterial;break;default:s=new n.MeshMatcapMaterial}return s.setValues(l),s.name=o,s},parseParameters:function(t,i,r){var o={};t.BumpFactor&&(o.bumpScale=t.BumpFactor.value),t.Diffuse?o.color=(new n.Color).fromArray(t.Diffuse.value):t.DiffuseColor&&"Color"===t.DiffuseColor.type&&(o.color=(new n.Color).fromArray(t.DiffuseColor.value)),t.DisplacementFactor&&(o.displacementScale=t.DisplacementFactor.value),t.Opacity&&(o.opacity=parseFloat(t.Opacity.value)),o.opacity<1&&(o.transparent=!0),t.ReflectionFactor&&(o.reflectivity=t.ReflectionFactor.value);var a=this;return e.get(r).children.forEach((function(t){switch(t.relationship){case"Bump":o.bumpMap=a.getTexture(i,t.ID);break;case"Maya|TEX_ao_map":o.aoMap=a.getTexture(i,t.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":o.map=a.getTexture(i,t.ID);break;case"DisplacementColor":o.displacementMap=a.getTexture(i,t.ID);break;case"EmissiveColor":o.emissiveMap=a.getTexture(i,t.ID);break;case"NormalMap":case"Maya|TEX_normal_map":o.normalMap=a.getTexture(i,t.ID);break;case"ReflectionColor":o.envMap=a.getTexture(i,t.ID),o.envMap.mapping=n.EquirectangularReflectionMapping;break;case"SpecularColor":o.specularMap=a.getTexture(i,t.ID);break;case"TransparentColor":o.alphaMap=a.getTexture(i,t.ID),o.transparent=!0}})),o},getTexture:function(i,n){return"LayeredTexture"in t.Objects&&n in t.Objects.LayeredTexture&&(n=e.get(n).children[0].ID),i.get(n)},parseDeformers:function(){var i={},n={};if("Deformer"in t.Objects){var r=t.Objects.Deformer;for(var o in r){var a=r[o],s=e.get(parseInt(o));if("Skin"===a.attrType){var l=this.parseSkeleton(s,r);l.ID=o,s.parents.length,l.geometryID=s.parents[0].ID,i[o]=l}else if("BlendShape"===a.attrType){var u={id:o};u.rawTargets=this.parseMorphTargets(s,r),u.id=o,s.parents.length,n[o]=u}}}return{skeletons:i,morphTargets:n}},parseSkeleton:function(t,e){var i=[];return t.children.forEach((function(t){var r=e[t.ID];if("Cluster"===r.attrType){var o={ID:t.ID,indices:[],weights:[],transformLink:(new n.Matrix4).fromArray(r.TransformLink.a)};"Indexes"in r&&(o.indices=r.Indexes.a,o.weights=r.Weights.a),i.push(o)}})),{rawBones:i,bones:[]}},parseMorphTargets:function(t,i){for(var n=[],r=0;r<t.children.length;r++){var o=t.children[r],a=i[o.ID],s={name:a.attrName,initialWeight:a.DeformPercent,id:a.id,fullWeights:a.FullWeights.a};if("BlendShapeChannel"!==a.attrType)return;s.geoID=e.get(parseInt(o.ID)).children.filter((function(t){return void 0===t.relationship}))[0].ID,n.push(s)}return n},parseScene:function(r,o,a){i=new n.Group;var l=this.parseModels(r.skeletons,o,a),u=t.Objects.Model,h=this;l.forEach((function(t){var n=u[t.ID];h.setLookAtProperties(t,n),e.get(t.ID).parents.forEach((function(e){var i=l.get(e.ID);void 0!==i&&i.add(t)})),null===t.parent&&i.add(t)})),this.bindSkeleton(r.skeletons,o,l),this.createAmbientLight(),this.setupMorphMaterials(),i.traverse((function(t){if(t.userData.transformData){t.parent&&(t.userData.transformData.parentMatrixWorld=t.parent.matrix);var e=y(t.userData.transformData);t.applyMatrix(e)}}));var c=(new s).parse();1===i.children.length&&i.children[0].isGroup&&(i.children[0].animations=c,i=i.children[0]),i.animations=c},parseModels:function(i,r,o){var a=new Map,s=t.Objects.Model;for(var l in s){var u=parseInt(l),h=s[l],c=e.get(u),d=this.buildSkeleton(c,i,u,h.attrName);if(!d){switch(h.attrType){case"Camera":d=this.createCamera(c);break;case"Light":d=this.createLight(c);break;case"Mesh":d=this.createMesh(c,r,o);break;case"NurbsCurve":d=this.createCurve(c,r);break;case"LimbNode":case"Root":d=new n.Bone;break;case"Null":default:d=new n.Group}d.name=n.PropertyBinding.sanitizeNodeName(h.attrName),d.ID=u}this.getTransformData(d,h),a.set(u,d)}return a},buildSkeleton:function(t,e,i,r){var o=null;return t.parents.forEach((function(t){for(var a in e){var s=e[a];s.rawBones.forEach((function(e,a){if(e.ID===t.ID){var l=o;(o=new n.Bone).matrixWorld.copy(e.transformLink),o.name=n.PropertyBinding.sanitizeNodeName(r),o.ID=i,s.bones[a]=o,null!==l&&o.add(l)}}))}})),o},createCamera:function(e){var i,r;if(e.children.forEach((function(e){var i=t.Objects.NodeAttribute[e.ID];void 0!==i&&(r=i)})),void 0===r)i=new n.Object3D;else{var o=0;void 0!==r.CameraProjectionType&&1===r.CameraProjectionType.value&&(o=1);var a=1;void 0!==r.NearPlane&&(a=r.NearPlane.value/1e3);var s=1e3;void 0!==r.FarPlane&&(s=r.FarPlane.value/1e3);var l=(window.renderWidth || window.innerWidth),u=(window.renderHeight || window.innerHeight);void 0!==r.AspectWidth&&void 0!==r.AspectHeight&&(l=r.AspectWidth.value,u=r.AspectHeight.value);var h=l/u,c=45;void 0!==r.FieldOfView&&(c=r.FieldOfView.value);var d=r.FocalLength?r.FocalLength.value:null;switch(o){case 0:i=new n.PerspectiveCamera(c,h,a,s),null!==d&&i.setFocalLength(d);break;case 1:i=new n.OrthographicCamera(-l/2,l/2,u/2,-u/2,a,s);break;default:i=new n.Object3D}}return i},createLight:function(e){var i,r;if(e.children.forEach((function(e){var i=t.Objects.NodeAttribute[e.ID];void 0!==i&&(r=i)})),void 0===r)i=new n.Object3D;else{var o;o=void 0===r.LightType?0:r.LightType.value;var a=16777215;void 0!==r.Color&&(a=(new n.Color).fromArray(r.Color.value));var s=void 0===r.Intensity?1:r.Intensity.value/100;void 0!==r.CastLightOnObject&&0===r.CastLightOnObject.value&&(s=0);var l=0;void 0!==r.FarAttenuationEnd&&(l=void 0!==r.EnableFarAttenuation&&0===r.EnableFarAttenuation.value?0:r.FarAttenuationEnd.value);switch(o){case 0:i=new n.PointLight(a,s,l,1);break;case 1:i=new n.DirectionalLight(a,s);break;case 2:var u=Math.PI/3;void 0!==r.InnerAngle&&(u=n.Math.degToRad(r.InnerAngle.value));var h=0;void 0!==r.OuterAngle&&(h=n.Math.degToRad(r.OuterAngle.value),h=Math.max(h,1)),i=new n.SpotLight(a,s,l,u,h,1);break;default:i=new n.PointLight(a,s)}void 0!==r.CastShadows&&1===r.CastShadows.value&&(i.castShadow=!0)}return i},createMesh:function(t,e,i){var r,o=null,a=null,s=[];return t.children.forEach((function(t){e.has(t.ID)&&(o=e.get(t.ID)),i.has(t.ID)&&s.push(i.get(t.ID))})),s.length>1?a=s:s.length>0?a=s[0]:(a=new n.MeshMatcapMaterial({color:13421772}),s.push(a)),"color"in o.attributes&&s.forEach((function(t){t.vertexColors=n.VertexColors})),o.FBX_Deformer?(s.forEach((function(t){t.skinning=!0})),(r=new n.SkinnedMesh(o,a)).normalizeSkinWeights()):r=new n.Mesh(o,a),r},createCurve:function(t,e){var i=t.children.reduce((function(t,i){return e.has(i.ID)&&(t=e.get(i.ID)),t}),null),r=new n.LineBasicMaterial({color:3342591,linewidth:1});return new n.Line(i,r)},getTransformData:function(t,e){var i={};"InheritType"in e&&(i.inheritType=parseInt(e.InheritType.value)),i.eulerOrder="RotationOrder"in e?b(e.RotationOrder.value):"ZYX","Lcl_Translation"in e&&(i.translation=e.Lcl_Translation.value),"PreRotation"in e&&(i.preRotation=e.PreRotation.value),"Lcl_Rotation"in e&&(i.rotation=e.Lcl_Rotation.value),"PostRotation"in e&&(i.postRotation=e.PostRotation.value),"Lcl_Scaling"in e&&(i.scale=e.Lcl_Scaling.value),"ScalingOffset"in e&&(i.scalingOffset=e.ScalingOffset.value),"ScalingPivot"in e&&(i.scalingPivot=e.ScalingPivot.value),"RotationOffset"in e&&(i.rotationOffset=e.RotationOffset.value),"RotationPivot"in e&&(i.rotationPivot=e.RotationPivot.value),t.userData.transformData=i},setLookAtProperties:function(r,o){"LookAtProperty"in o&&e.get(r.ID).children.forEach((function(e){if("LookAtProperty"===e.relationship){var o=t.Objects.Model[e.ID];if("Lcl_Translation"in o){var a=o.Lcl_Translation.value;void 0!==r.target?(r.target.position.fromArray(a),i.add(r.target)):r.lookAt((new n.Vector3).fromArray(a))}}}))},bindSkeleton:function(t,i,r){var o=this.parsePoseNodes();for(var a in t){var s=t[a];e.get(parseInt(s.ID)).parents.forEach((function(t){if(i.has(t.ID)){var a=t.ID;e.get(a).parents.forEach((function(t){r.has(t.ID)&&r.get(t.ID).bind(new n.Skeleton(s.bones),o[t.ID])}))}}))}},parsePoseNodes:function(){var e={};if("Pose"in t.Objects){var i=t.Objects.Pose;for(var r in i)if("BindPose"===i[r].attrType){var o=i[r].PoseNode;Array.isArray(o)?o.forEach((function(t){e[t.Node]=(new n.Matrix4).fromArray(t.Matrix.a)})):e[o.Node]=(new n.Matrix4).fromArray(o.Matrix.a)}}return e},createAmbientLight:function(){if("GlobalSettings"in t&&"AmbientColor"in t.GlobalSettings){var e=t.GlobalSettings.AmbientColor.value,r=e[0],o=e[1],a=e[2];if(0!==r||0!==o||0!==a){var s=new n.Color(r,o,a);i.add(new n.AmbientLight(s,1))}}},setupMorphMaterials:function(){var t=this;i.traverse((function(e){e.isMesh&&e.geometry.morphAttributes.position&&e.geometry.morphAttributes.position.length&&(Array.isArray(e.material)?e.material.forEach((function(i,n){t.setupMorphMaterial(e,i,n)})):t.setupMorphMaterial(e,e.material))}))},setupMorphMaterial:function(t,e,n){var r=t.uuid,o=e.uuid,a=!1;if(i.traverse((function(t){t.isMesh&&(Array.isArray(t.material)?t.material.forEach((function(e){e.uuid===o&&t.uuid!==r&&(a=!0)})):t.material.uuid===o&&t.uuid!==r&&(a=!0))})),!0===a){var s=e.clone();s.morphTargets=!0,void 0===n?t.material=s:t.material[n]=s}else e.morphTargets=!0}},a.prototype={constructor:a,parse:function(i){var n=new Map;if("Geometry"in t.Objects){var r=t.Objects.Geometry;for(var o in r){var a=e.get(parseInt(o)),s=this.parseGeometry(a,r[o],i);n.set(parseInt(o),s)}}return n},parseGeometry:function(t,e,i){switch(e.attrType){case"Mesh":return this.parseMeshGeometry(t,e,i);case"NurbsCurve":return this.parseNurbsGeometry(e)}},parseMeshGeometry:function(e,i,n){var r=n.skeletons,o=n.morphTargets,a=e.parents.map((function(e){return t.Objects.Model[e.ID]}));if(0!==a.length){var s=e.children.reduce((function(t,e){return void 0!==r[e.ID]&&(t=r[e.ID]),t}),null),l=e.children.reduce((function(t,e){return void 0!==o[e.ID]&&(t=o[e.ID]),t}),null),u=a[0],h={};"RotationOrder"in u&&(h.eulerOrder=b(u.RotationOrder.value)),"InheritType"in u&&(h.inheritType=parseInt(u.InheritType.value)),"GeometricTranslation"in u&&(h.translation=u.GeometricTranslation.value),"GeometricRotation"in u&&(h.rotation=u.GeometricRotation.value),"GeometricScaling"in u&&(h.scale=u.GeometricScaling.value);var c=y(h);return this.genGeometry(i,s,l,c)}},genGeometry:function(t,e,i,r){var o=new n.BufferGeometry;t.attrName&&(o.name=t.attrName);var a=this.parseGeoNode(t,e),s=this.genBuffers(a),l=new n.Float32BufferAttribute(s.vertex,3);if(r.applyToBufferAttribute(l),o.addAttribute("position",l),s.colors.length>0&&o.addAttribute("color",new n.Float32BufferAttribute(s.colors,3)),e&&(o.addAttribute("skinIndex",new n.Uint16BufferAttribute(s.weightsIndices,4)),o.addAttribute("skinWeight",new n.Float32BufferAttribute(s.vertexWeights,4)),o.FBX_Deformer=e),s.normal.length>0){var u=new n.Float32BufferAttribute(s.normal,3);(new n.Matrix3).getNormalMatrix(r).applyToBufferAttribute(u),o.addAttribute("normal",u)}if(s.uvs.forEach((function(t,e){var i="uv"+(e+1).toString();0===e&&(i="uv"),o.addAttribute(i,new n.Float32BufferAttribute(s.uvs[e],2))})),a.material&&"AllSame"!==a.material.mappingType){var h=s.materialIndex[0],c=0;if(s.materialIndex.forEach((function(t,e){t!==h&&(o.addGroup(c,e-c,h),h=t,c=e)})),o.groups.length>0){var d=o.groups[o.groups.length-1],p=d.start+d.count;p!==s.materialIndex.length&&o.addGroup(p,s.materialIndex.length-p,h)}0===o.groups.length&&o.addGroup(0,s.materialIndex.length,s.materialIndex[0])}return this.addMorphTargets(o,t,i,r),o},parseGeoNode:function(t,e){var i={};if(i.vertexPositions=void 0!==t.Vertices?t.Vertices.a:[],i.vertexIndices=void 0!==t.PolygonVertexIndex?t.PolygonVertexIndex.a:[],t.LayerElementColor&&(i.color=this.parseVertexColors(t.LayerElementColor[0])),t.LayerElementMaterial&&(i.material=this.parseMaterialIndices(t.LayerElementMaterial[0])),t.LayerElementNormal&&(i.normal=this.parseNormals(t.LayerElementNormal[0])),t.LayerElementUV){i.uv=[];for(var n=0;t.LayerElementUV[n];)i.uv.push(this.parseUVs(t.LayerElementUV[n])),n++}return i.weightTable={},null!==e&&(i.skeleton=e,e.rawBones.forEach((function(t,e){t.indices.forEach((function(n,r){void 0===i.weightTable[n]&&(i.weightTable[n]=[]),i.weightTable[n].push({id:e,weight:t.weights[r]})}))}))),i},genBuffers:function(t){var e={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]},i=0,n=0,r=!0,o=[],a=[],s=[],l=[],u=[],h=[],c=this;return t.vertexIndices.forEach((function(d,p){var f=!1;d<0&&(d^=-1,f=!0);var g=[],v=[];if(o.push(3*d,3*d+1,3*d+2),t.color){var y=m(p,i,d,t.color);s.push(y[0],y[1],y[2])}if(t.skeleton){if(void 0!==t.weightTable[d]&&t.weightTable[d].forEach((function(t){v.push(t.weight),g.push(t.id)})),v.length>4){r||(r=!0);var b=[0,0,0,0],w=[0,0,0,0];v.forEach((function(t,e){var i=t,n=g[e];w.forEach((function(t,e,r){if(i>t){r[e]=i,i=t;var o=b[e];b[e]=n,n=o}}))})),g=b,v=w}for(;v.length<4;)v.push(0),g.push(0);for(var x=0;x<4;++x)u.push(v[x]),h.push(g[x])}if(t.normal){y=m(p,i,d,t.normal);a.push(y[0],y[1],y[2])}if(t.material&&"AllSame"!==t.material.mappingType)var M=m(p,i,d,t.material)[0];t.uv&&t.uv.forEach((function(t,e){var n=m(p,i,d,t);void 0===l[e]&&(l[e]=[]),l[e].push(n[0]),l[e].push(n[1])})),n++,f&&(c.genFace(e,t,o,M,a,s,l,u,h,n),i++,n=0,o=[],a=[],s=[],l=[],u=[],h=[])})),e},genFace:function(t,e,i,n,r,o,a,s,l,u){for(var h=2;h<u;h++)t.vertex.push(e.vertexPositions[i[0]]),t.vertex.push(e.vertexPositions[i[1]]),t.vertex.push(e.vertexPositions[i[2]]),t.vertex.push(e.vertexPositions[i[3*(h-1)]]),t.vertex.push(e.vertexPositions[i[3*(h-1)+1]]),t.vertex.push(e.vertexPositions[i[3*(h-1)+2]]),t.vertex.push(e.vertexPositions[i[3*h]]),t.vertex.push(e.vertexPositions[i[3*h+1]]),t.vertex.push(e.vertexPositions[i[3*h+2]]),e.skeleton&&(t.vertexWeights.push(s[0]),t.vertexWeights.push(s[1]),t.vertexWeights.push(s[2]),t.vertexWeights.push(s[3]),t.vertexWeights.push(s[4*(h-1)]),t.vertexWeights.push(s[4*(h-1)+1]),t.vertexWeights.push(s[4*(h-1)+2]),t.vertexWeights.push(s[4*(h-1)+3]),t.vertexWeights.push(s[4*h]),t.vertexWeights.push(s[4*h+1]),t.vertexWeights.push(s[4*h+2]),t.vertexWeights.push(s[4*h+3]),t.weightsIndices.push(l[0]),t.weightsIndices.push(l[1]),t.weightsIndices.push(l[2]),t.weightsIndices.push(l[3]),t.weightsIndices.push(l[4*(h-1)]),t.weightsIndices.push(l[4*(h-1)+1]),t.weightsIndices.push(l[4*(h-1)+2]),t.weightsIndices.push(l[4*(h-1)+3]),t.weightsIndices.push(l[4*h]),t.weightsIndices.push(l[4*h+1]),t.weightsIndices.push(l[4*h+2]),t.weightsIndices.push(l[4*h+3])),e.color&&(t.colors.push(o[0]),t.colors.push(o[1]),t.colors.push(o[2]),t.colors.push(o[3*(h-1)]),t.colors.push(o[3*(h-1)+1]),t.colors.push(o[3*(h-1)+2]),t.colors.push(o[3*h]),t.colors.push(o[3*h+1]),t.colors.push(o[3*h+2])),e.material&&"AllSame"!==e.material.mappingType&&(t.materialIndex.push(n),t.materialIndex.push(n),t.materialIndex.push(n)),e.normal&&(t.normal.push(r[0]),t.normal.push(r[1]),t.normal.push(r[2]),t.normal.push(r[3*(h-1)]),t.normal.push(r[3*(h-1)+1]),t.normal.push(r[3*(h-1)+2]),t.normal.push(r[3*h]),t.normal.push(r[3*h+1]),t.normal.push(r[3*h+2])),e.uv&&e.uv.forEach((function(e,i){void 0===t.uvs[i]&&(t.uvs[i]=[]),t.uvs[i].push(a[i][0]),t.uvs[i].push(a[i][1]),t.uvs[i].push(a[i][2*(h-1)]),t.uvs[i].push(a[i][2*(h-1)+1]),t.uvs[i].push(a[i][2*h]),t.uvs[i].push(a[i][2*h+1])}))},addMorphTargets:function(e,i,n,r){if(null!==n){e.morphAttributes.position=[];var o=this;n.rawTargets.forEach((function(n){var a=t.Objects.Geometry[n.geoID];void 0!==a&&o.genMorphGeometry(e,i,a,r,n.name)}))}},genMorphGeometry:function(t,e,i,r,o){var a=new n.BufferGeometry;i.attrName&&(a.name=i.attrName);for(var s=void 0!==e.PolygonVertexIndex?e.PolygonVertexIndex.a:[],l=void 0!==e.Vertices?e.Vertices.a.slice():[],u=void 0!==i.Vertices?i.Vertices.a:[],h=void 0!==i.Indexes?i.Indexes.a:[],c=0;c<h.length;c++){var d=3*h[c];l[d]+=u[3*c],l[d+1]+=u[3*c+1],l[d+2]+=u[3*c+2]}var p={vertexIndices:s,vertexPositions:l},f=this.genBuffers(p),m=new n.Float32BufferAttribute(f.vertex,3);m.name=o||i.attrName,r.applyToBufferAttribute(m),t.morphAttributes.position.push(m)},parseNormals:function(t){var e=t.MappingInformationType,i=t.ReferenceInformationType,n=t.Normals.a,r=[];return"IndexToDirect"===i&&("NormalIndex"in t?r=t.NormalIndex.a:"NormalsIndex"in t&&(r=t.NormalsIndex.a)),{dataSize:3,buffer:n,indices:r,mappingType:e,referenceType:i}},parseUVs:function(t){var e=t.MappingInformationType,i=t.ReferenceInformationType,n=t.UV.a,r=[];return"IndexToDirect"===i&&(r=t.UVIndex.a),{dataSize:2,buffer:n,indices:r,mappingType:e,referenceType:i}},parseVertexColors:function(t){var e=t.MappingInformationType,i=t.ReferenceInformationType,n=t.Colors.a,r=[];return"IndexToDirect"===i&&(r=t.ColorIndex.a),{dataSize:4,buffer:n,indices:r,mappingType:e,referenceType:i}},parseMaterialIndices:function(t){var e=t.MappingInformationType,i=t.ReferenceInformationType;if("NoMappingInformation"===e)return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:i};for(var n=t.Materials.a,r=[],o=0;o<n.length;++o)r.push(o);return{dataSize:1,buffer:n,indices:r,mappingType:e,referenceType:i}},parseNurbsGeometry:function(t){if(void 0===n.NURBSCurve)return new n.BufferGeometry;var e=parseInt(t.Order);if(isNaN(e))return new n.BufferGeometry;for(var i,r,o=e-1,a=t.KnotVector.a,s=[],l=t.Points.a,u=0,h=l.length;u<h;u+=4)s.push((new n.Vector4).fromArray(l,u));if("Closed"===t.Form)s.push(s[0]);else if("Periodic"===t.Form){i=o,r=a.length-1-i;for(u=0;u<o;++u)s.push(s[u])}var c=new n.NURBSCurve(o,a,s,i,r).getPoints(7*s.length),d=new Float32Array(3*c.length);c.forEach((function(t,e){t.toArray(d,3*e)}));var p=new n.BufferGeometry;return p.addAttribute("position",new n.BufferAttribute(d,3)),p}},s.prototype={constructor:s,parse:function(){var t=[],e=this.parseClips();if(void 0!==e)for(var i in e){var n=e[i],r=this.addClip(n);t.push(r)}return t},parseClips:function(){if(void 0!==t.Objects.AnimationCurve){var e=this.parseAnimationCurveNodes();this.parseAnimationCurves(e);var i=this.parseAnimationLayers(e);return this.parseAnimStacks(i)}},parseAnimationCurveNodes:function(){var e=t.Objects.AnimationCurveNode,i=new Map;for(var n in e){var r=e[n];if(null!==r.attrName.match(/S|R|T|DeformPercent/)){var o={id:r.id,attr:r.attrName,curves:{}};i.set(o.id,o)}}return i},parseAnimationCurves:function(i){var n=t.Objects.AnimationCurve;for(var r in n){var o={id:n[r].id,times:n[r].KeyTime.a.map(p),values:n[r].KeyValueFloat.a},a=e.get(o.id);if(void 0!==a){var s=a.parents[0].ID,l=a.parents[0].relationship;l.match(/X/)?i.get(s).curves.x=o:l.match(/Y/)?i.get(s).curves.y=o:l.match(/Z/)?i.get(s).curves.z=o:l.match(/d|DeformPercent/)&&i.has(s)&&(i.get(s).curves.morph=o)}}},parseAnimationLayers:function(r){var o=t.Objects.AnimationLayer,a=new Map;for(var s in o){var l=[],u=e.get(parseInt(s));if(void 0!==u)u.children.forEach((function(o,a){if(r.has(o.ID)){var s=r.get(o.ID);if(void 0!==s.curves.x||void 0!==s.curves.y||void 0!==s.curves.z){if(void 0===l[a])if(void 0!==(f=e.get(o.ID).parents.filter((function(t){return void 0!==t.relationship}))[0].ID)){var u=t.Objects.Model[f.toString()],h={modelName:n.PropertyBinding.sanitizeNodeName(u.attrName),ID:u.id,initialPosition:[0,0,0],initialRotation:[0,0,0],initialScale:[1,1,1]};i.traverse((function(t){t.ID===u.id&&(h.transform=t.matrix,t.userData.transformData&&(h.eulerOrder=t.userData.transformData.eulerOrder))})),h.transform||(h.transform=new n.Matrix4),"PreRotation"in u&&(h.preRotation=u.PreRotation.value),"PostRotation"in u&&(h.postRotation=u.PostRotation.value),l[a]=h}l[a]&&(l[a][s.attr]=s)}else if(void 0!==s.curves.morph){if(void 0===l[a]){var c=e.get(o.ID).parents.filter((function(t){return void 0!==t.relationship}))[0].ID,d=e.get(c).parents[0].ID,p=e.get(d).parents[0].ID,f=e.get(p).parents[0].ID;u=t.Objects.Model[f],h={modelName:n.PropertyBinding.sanitizeNodeName(u.attrName),morphName:t.Objects.Deformer[c].attrName};l[a]=h}l[a][s.attr]=s}}})),a.set(parseInt(s),l)}return a},parseAnimStacks:function(i){var n=t.Objects.AnimationStack,r={};for(var o in n){var a=e.get(parseInt(o)).children;a.length;var s=i.get(a[0].ID);r[o]={name:n[o].attrName,layer:s}}return r},addClip:function(t){var e=[],i=this;return t.layer.forEach((function(t){e=e.concat(i.generateTracks(t))})),new n.AnimationClip(t.name,-1,e)},generateTracks:function(t){var e=[],i=new n.Vector3,r=new n.Quaternion,o=new n.Vector3;if(t.transform&&t.transform.decompose(i,r,o),i=i.toArray(),r=(new n.Euler).setFromQuaternion(r,t.eulerOrder).toArray(),o=o.toArray(),void 0!==t.T&&Object.keys(t.T.curves).length>0){var a=this.generateVectorTrack(t.modelName,t.T.curves,i,"position");void 0!==a&&e.push(a)}if(void 0!==t.R&&Object.keys(t.R.curves).length>0){var s=this.generateRotationTrack(t.modelName,t.R.curves,r,t.preRotation,t.postRotation,t.eulerOrder);void 0!==s&&e.push(s)}if(void 0!==t.S&&Object.keys(t.S.curves).length>0){var l=this.generateVectorTrack(t.modelName,t.S.curves,o,"scale");void 0!==l&&e.push(l)}if(void 0!==t.DeformPercent){var u=this.generateMorphTrack(t);void 0!==u&&e.push(u)}return e},generateVectorTrack:function(t,e,i,r){var o=this.getTimesForAllAxes(e),a=this.getKeyframeTrackValues(o,e,i);return new n.VectorKeyframeTrack(t+"."+r,o,a)},generateRotationTrack:function(t,e,i,r,o,a){void 0!==e.x&&(this.interpolateRotations(e.x),e.x.values=e.x.values.map(n.Math.degToRad)),void 0!==e.y&&(this.interpolateRotations(e.y),e.y.values=e.y.values.map(n.Math.degToRad)),void 0!==e.z&&(this.interpolateRotations(e.z),e.z.values=e.z.values.map(n.Math.degToRad));var s=this.getTimesForAllAxes(e),l=this.getKeyframeTrackValues(s,e,i);void 0!==r&&((r=r.map(n.Math.degToRad)).push(a),r=(new n.Euler).fromArray(r),r=(new n.Quaternion).setFromEuler(r)),void 0!==o&&((o=o.map(n.Math.degToRad)).push(a),o=(new n.Euler).fromArray(o),o=(new n.Quaternion).setFromEuler(o).inverse());for(var u=new n.Quaternion,h=new n.Euler,c=[],d=0;d<l.length;d+=3)h.set(l[d],l[d+1],l[d+2],a),u.setFromEuler(h),void 0!==r&&u.premultiply(r),void 0!==o&&u.multiply(o),u.toArray(c,d/3*4);return new n.QuaternionKeyframeTrack(t+".quaternion",s,c)},generateMorphTrack:function(t){var e=t.DeformPercent.curves.morph,r=e.values.map((function(t){return t/100})),o=i.getObjectByName(t.modelName).morphTargetDictionary[t.morphName];return new n.NumberKeyframeTrack(t.modelName+".morphTargetInfluences["+o+"]",e.times,r)},getTimesForAllAxes:function(t){var e=[];return void 0!==t.x&&(e=e.concat(t.x.times)),void 0!==t.y&&(e=e.concat(t.y.times)),void 0!==t.z&&(e=e.concat(t.z.times)),e=e.sort((function(t,e){return t-e})).filter((function(t,e,i){return i.indexOf(t)==e}))},getKeyframeTrackValues:function(t,e,i){var n=i,r=[],o=-1,a=-1,s=-1;return t.forEach((function(t){if(e.x&&(o=e.x.times.indexOf(t)),e.y&&(a=e.y.times.indexOf(t)),e.z&&(s=e.z.times.indexOf(t)),-1!==o){var i=e.x.values[o];r.push(i),n[0]=i}else r.push(n[0]);if(-1!==a){var l=e.y.values[a];r.push(l),n[1]=l}else r.push(n[1]);if(-1!==s){var u=e.z.values[s];r.push(u),n[2]=u}else r.push(n[2])})),r},interpolateRotations:function(t){for(var e=1;e<t.values.length;e++){var i=t.values[e-1],n=t.values[e]-i,r=Math.abs(n);if(r>=180){for(var o=r/180,a=n/o,s=i+a,l=t.times[e-1],u=(t.times[e]-l)/o,h=l+u,c=[],d=[];h<t.times[e];)c.push(h),h+=u,d.push(s),s+=a;t.times=M(t.times,e,c),t.values=M(t.values,e,d)}}}},l.prototype={constructor:l,getPrevNode:function(){return this.nodeStack[this.currentIndent-2]},getCurrentNode:function(){return this.nodeStack[this.currentIndent-1]},getCurrentProp:function(){return this.currentProp},pushStack:function(t){this.nodeStack.push(t),this.currentIndent+=1},popStack:function(){this.nodeStack.pop(),this.currentIndent-=1},setCurrentProp:function(t,e){this.currentProp=t,this.currentPropName=e},parse:function(t){this.currentIndent=0,this.allNodes=new c,this.nodeStack=[],this.currentProp=[],this.currentPropName="";var e=this,i=t.split(/[\r\n]+/);return i.forEach((function(t,n){var r=t.match(/^[\s\t]*;/),o=t.match(/^[\s\t]*$/);if(!r&&!o){var a=t.match("^\\t{"+e.currentIndent+"}(\\w+):(.*){",""),s=t.match("^\\t{"+e.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),l=t.match("^\\t{"+(e.currentIndent-1)+"}}");a?e.parseNodeBegin(t,a):s?e.parseNodeProperty(t,s,i[++n]):l?e.popStack():t.match(/^[^\s\t}]/)&&e.parseNodePropertyContinued(t)}})),this.allNodes},parseNodeBegin:function(t,e){var i=e[1].trim().replace(/^"/,"").replace(/"$/,""),n=e[2].split(",").map((function(t){return t.trim().replace(/^"/,"").replace(/"$/,"")})),r={name:i},o=this.parseNodeAttr(n),a=this.getCurrentNode();0===this.currentIndent?this.allNodes.add(i,r):i in a?("PoseNode"===i?a.PoseNode.push(r):void 0!==a[i].id&&(a[i]={},a[i][a[i].id]=a[i]),""!==o.id&&(a[i][o.id]=r)):"number"==typeof o.id?(a[i]={},a[i][o.id]=r):"Properties70"!==i&&(a[i]="PoseNode"===i?[r]:r),"number"==typeof o.id&&(r.id=o.id),""!==o.name&&(r.attrName=o.name),""!==o.type&&(r.attrType=o.type),this.pushStack(r)},parseNodeAttr:function(t){var e=t[0];""!==t[0]&&(e=parseInt(t[0]),isNaN(e)&&(e=t[0]));var i="",n="";return t.length>1&&(i=t[1].replace(/^(\w+)::/,""),n=t[2]),{id:e,name:i,type:n}},parseNodeProperty:function(t,e,i){var n=e[1].replace(/^"/,"").replace(/"$/,"").trim(),r=e[2].replace(/^"/,"").replace(/"$/,"").trim();"Content"===n&&","===r&&(r=i.replace(/"/g,"").replace(/,$/,"").trim());var o=this.getCurrentNode();if("Properties70"!==o.name){if("C"===n){var a=r.split(",").slice(1),s=parseInt(a[0]),l=parseInt(a[1]),u=r.split(",").slice(3);n="connections",function(t,e){for(var i=0,n=t.length,r=e.length;i<r;i++,n++)t[n]=e[i]}(r=[s,l],u=u.map((function(t){return t.trim().replace(/^"/,"")}))),void 0===o[n]&&(o[n]=[])}"Node"===n&&(o.id=r),n in o&&Array.isArray(o[n])?o[n].push(r):"a"!==n?o[n]=r:o.a=r,this.setCurrentProp(o,n),"a"===n&&","!==r.slice(-1)&&(o.a=w(r))}else this.parseNodeSpecialProperty(t,n,r)},parseNodePropertyContinued:function(t){var e=this.getCurrentNode();e.a+=t,","!==t.slice(-1)&&(e.a=w(e.a))},parseNodeSpecialProperty:function(t,e,i){var n=i.split('",').map((function(t){return t.trim().replace(/^\"/,"").replace(/\s/,"_")})),r=n[0],o=n[1],a=n[2],s=n[3],l=n[4];switch(o){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":l=parseFloat(l);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":l=w(l)}this.getPrevNode()[r]={type:o,type2:a,flag:s,value:l},this.setCurrentProp(this.getPrevNode(),r)}},u.prototype={constructor:u,parse:function(t){var e=new h(t);e.skip(23);for(var i=e.getUint32(),n=new c;!this.endOfContent(e);){var r=this.parseNode(e,i);null!==r&&n.add(r.name,r)}return n},endOfContent:function(t){return t.size()%16==0?(t.getOffset()+160+16&-16)>=t.size():t.getOffset()+160+16>=t.size()},parseNode:function(t,e){var i={},n=e>=7500?t.getUint64():t.getUint32(),r=e>=7500?t.getUint64():t.getUint32(),o=(e>=7500?t.getUint64():t.getUint32(),t.getUint8()),a=t.getString(o);if(0===n)return null;for(var s=[],l=0;l<r;l++)s.push(this.parseProperty(t));var u=s.length>0?s[0]:"",h=s.length>1?s[1]:"",c=s.length>2?s[2]:"";for(i.singleProperty=1===r&&t.getOffset()===n;n>t.getOffset();){var d=this.parseNode(t,e);null!==d&&this.parseSubNode(a,i,d)}return i.propertyList=s,"number"==typeof u&&(i.id=u),""!==h&&(i.attrName=h),""!==c&&(i.attrType=c),""!==a&&(i.name=a),i},parseSubNode:function(t,e,i){if(!0===i.singleProperty){var n=i.propertyList[0];Array.isArray(n)?(e[i.name]=i,i.a=n):e[i.name]=n}else if("Connections"===t&&"C"===i.name){var r=[];i.propertyList.forEach((function(t,e){0!==e&&r.push(t)})),void 0===e.connections&&(e.connections=[]),e.connections.push(r)}else if("Properties70"===i.name){Object.keys(i).forEach((function(t){e[t]=i[t]}))}else if("Properties70"===t&&"P"===i.name){var o,a=i.propertyList[0],s=i.propertyList[1],l=i.propertyList[2],u=i.propertyList[3];0===a.indexOf("Lcl ")&&(a=a.replace("Lcl ","Lcl_")),0===s.indexOf("Lcl ")&&(s=s.replace("Lcl ","Lcl_")),o="Color"===s||"ColorRGB"===s||"Vector"===s||"Vector3D"===s||0===s.indexOf("Lcl_")?[i.propertyList[4],i.propertyList[5],i.propertyList[6]]:i.propertyList[4],e[a]={type:s,type2:l,flag:u,value:o}}else void 0===e[i.name]?"number"==typeof i.id?(e[i.name]={},e[i.name][i.id]=i):e[i.name]=i:"PoseNode"===i.name?(Array.isArray(e[i.name])||(e[i.name]=[e[i.name]]),e[i.name].push(i)):void 0===e[i.name][i.id]&&(e[i.name][i.id]=i)},parseProperty:function(t){var e=t.getString(1);switch(e){case"C":return t.getBoolean();case"D":return t.getFloat64();case"F":return t.getFloat32();case"I":return t.getInt32();case"L":return t.getInt64();case"R":var i=t.getUint32();return t.getArrayBuffer(i);case"S":i=t.getUint32();return t.getString(i);case"Y":return t.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":var n=t.getUint32(),r=t.getUint32(),o=t.getUint32();if(0===r)switch(e){case"b":case"c":return t.getBooleanArray(n);case"d":return t.getFloat64Array(n);case"f":return t.getFloat32Array(n);case"i":return t.getInt32Array(n);case"l":return t.getInt64Array(n)}var a=new h(new Zlib.Inflate(new Uint8Array(t.getArrayBuffer(o))).decompress().buffer);switch(e){case"b":case"c":return a.getBooleanArray(n);case"d":return a.getFloat64Array(n);case"f":return a.getFloat32Array(n);case"i":return a.getInt32Array(n);case"l":return a.getInt64Array(n)}default:throw new Error("THREE.FBXLoader: Unknown property type "+e)}}},h.prototype={constructor:h,getOffset:function(){return this.offset},size:function(){return this.dv.buffer.byteLength},skip:function(t){this.offset+=t},getBoolean:function(){return 1==(1&this.getUint8())},getBooleanArray:function(t){for(var e=[],i=0;i<t;i++)e.push(this.getBoolean());return e},getUint8:function(){var t=this.dv.getUint8(this.offset);return this.offset+=1,t},getInt16:function(){var t=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,t},getInt32:function(){var t=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,t},getInt32Array:function(t){for(var e=[],i=0;i<t;i++)e.push(this.getInt32());return e},getUint32:function(){var t=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,t},getInt64:function(){var t,e;return this.littleEndian?(t=this.getUint32(),e=this.getUint32()):(e=this.getUint32(),t=this.getUint32()),2147483648&e?(e=4294967295&~e,4294967295===(t=4294967295&~t)&&(e=e+1&4294967295),-(4294967296*e+(t=t+1&4294967295))):4294967296*e+t},getInt64Array:function(t){for(var e=[],i=0;i<t;i++)e.push(this.getInt64());return e},getUint64:function(){var t,e;return this.littleEndian?(t=this.getUint32(),e=this.getUint32()):(e=this.getUint32(),t=this.getUint32()),4294967296*e+t},getFloat32:function(){var t=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t},getFloat32Array:function(t){for(var e=[],i=0;i<t;i++)e.push(this.getFloat32());return e},getFloat64:function(){var t=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t},getFloat64Array:function(t){for(var e=[],i=0;i<t;i++)e.push(this.getFloat64());return e},getArrayBuffer:function(t){var e=this.dv.buffer.slice(this.offset,this.offset+t);return this.offset+=t,e},getString:function(t){for(var e=[],i=0;i<t;i++)e[i]=this.getUint8();var r=e.indexOf(0);return r>=0&&(e=e.slice(0,r)),n.LoaderUtils.decodeText(new Uint8Array(e))}},c.prototype={constructor:c,add:function(t,e){this[t]=e}};var f=[];function m(t,e,i,n){var r;switch(n.mappingType){case"ByPolygonVertex":r=t;break;case"ByPolygon":r=e;break;case"ByVertice":r=i;break;case"AllSame":r=n.indices[0]}"IndexToDirect"===n.referenceType&&(r=n.indices[r]);var o=r*n.dataSize,a=o+n.dataSize;return function(t,e,i,n){for(var r=i,o=0;r<n;r++,o++)t[o]=e[r];return t}(f,n.buffer,o,a)}var g=new n.Euler,v=new n.Vector3;function y(t){var e,i=new n.Matrix4,r=new n.Matrix4,o=new n.Matrix4,a=new n.Matrix4,s=new n.Matrix4,l=new n.Matrix4,u=new n.Matrix4,h=new n.Matrix4,c=new n.Matrix4,d=new n.Matrix4,p=new n.Matrix4,f=t.inheritType?t.inheritType:0;(t.translation&&i.setPosition(v.fromArray(t.translation)),t.preRotation)&&((e=t.preRotation.map(n.Math.degToRad)).push(t.eulerOrder),r.makeRotationFromEuler(g.fromArray(e)));t.rotation&&((e=t.rotation.map(n.Math.degToRad)).push(t.eulerOrder),o.makeRotationFromEuler(g.fromArray(e)));t.postRotation&&((e=t.postRotation.map(n.Math.degToRad)).push(t.eulerOrder),a.makeRotationFromEuler(g.fromArray(e)));t.scale&&s.scale(v.fromArray(t.scale)),t.scalingOffset&&u.setPosition(v.fromArray(t.scalingOffset)),t.scalingPivot&&l.setPosition(v.fromArray(t.scalingPivot)),t.rotationOffset&&h.setPosition(v.fromArray(t.rotationOffset)),t.rotationPivot&&c.setPosition(v.fromArray(t.rotationPivot)),t.parentMatrixWorld&&(d=t.parentMatrixWorld);var m=r.multiply(o).multiply(a),y=new n.Matrix4;d.extractRotation(y);var b,w,x,M,T=new n.Matrix4;if(T.copyPosition(d),x=T.getInverse(T).multiply(d),w=y.getInverse(y).multiply(x),b=s,0===f)M=y.multiply(m).multiply(w).multiply(b);else if(1===f)M=y.multiply(w).multiply(m).multiply(b);else{var S=(new n.Matrix4).copy(s),_=w.multiply(S.getInverse(S));M=y.multiply(m).multiply(_).multiply(b)}var A=i.multiply(h).multiply(c).multiply(r).multiply(o).multiply(a).multiply(c.getInverse(c)).multiply(u).multiply(l).multiply(s).multiply(l.getInverse(l)),P=(new n.Matrix4).copyPosition(A),C=d.multiply(P);return p.copyPosition(C),A=p.multiply(M)}function b(t){var e=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return 6===(t=t||0)?e[0]:e[t]}function w(t){return t.split(",").map((function(t){return parseFloat(t)}))}function x(t,e,i){return void 0===e&&(e=0),void 0===i&&(i=t.byteLength),n.LoaderUtils.decodeText(new Uint8Array(t,e,i))}function M(t,e,i){return t.slice(0,e).concat(i).concat(t.slice(e))}return r}()},function(t,e,i){!function(){"use strict";i(122);var e=i(0);t.exports={load:function(t){var i=new e.GLTFLoader;return new Promise((function(e,n){i.load(t,(function(t){t&&e(t)}))}))}}}()},function(t,e,i){var n=i(0);n.GLTFLoader=function(){function t(t){this.manager=void 0!==t?t:n.DefaultLoadingManager,this.dracoLoader=null}function e(){var t={};return{get:function(e){return t[e]},add:function(e,i){t[e]=i},remove:function(e){delete t[e]},removeAll:function(){t={}}}}t.prototype={constructor:t,crossOrigin:"anonymous",load:function(t,e,i,r){var o,a=this;o=void 0!==this.resourcePath?this.resourcePath:void 0!==this.path?this.path:n.LoaderUtils.extractUrlBase(t),a.manager.itemStart(t);var s=function(e){r&&r(e),a.manager.itemError(t),a.manager.itemEnd(t)},l=new n.FileLoader(a.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.load(t,(function(i){try{a.parse(i,o,(function(i){e(i),a.manager.itemEnd(t)}),s)}catch(t){s(t)}}),i,s)},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setDRACOLoader:function(t){return this.dracoLoader=t,this},parse:function(t,e,l,u){var f,m={};if("string"==typeof t)f=t;else if(n.LoaderUtils.decodeText(new Uint8Array(t,0,4))===s){try{m[i.KHR_BINARY_GLTF]=new h(t)}catch(t){return void(u&&u(t))}f=m[i.KHR_BINARY_GLTF].content}else f=n.LoaderUtils.decodeText(new Uint8Array(t));var g=JSON.parse(f);if(void 0===g.asset||g.asset.version[0]<2)u&&u(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported. Use LegacyGLTFLoader instead."));else{if(g.extensionsUsed)for(var v=0;v<g.extensionsUsed.length;++v){var y=g.extensionsUsed[v],b=g.extensionsRequired||[];switch(y){case i.KHR_LIGHTS_PUNCTUAL:m[y]=new o(g);break;case i.KHR_MATERIALS_UNLIT:m[y]=new a(g);break;case i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:m[y]=new p(g);break;case i.KHR_DRACO_MESH_COMPRESSION:m[y]=new c(g,this.dracoLoader);break;case i.MSFT_TEXTURE_DDS:m[i.MSFT_TEXTURE_DDS]=new r;break;case i.KHR_TEXTURE_TRANSFORM:m[i.KHR_TEXTURE_TRANSFORM]=new d(g);break;default:b.indexOf(y)}}new U(g,m,{path:e||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager}).parse(l,u)}}};var i={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function r(){if(!n.DDSLoader)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader");this.name=i.MSFT_TEXTURE_DDS,this.ddsLoader=new n.DDSLoader}function o(t){this.name=i.KHR_LIGHTS_PUNCTUAL;var e=t.extensions&&t.extensions[i.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=e.lights||[]}function a(){this.name=i.KHR_MATERIALS_UNLIT}o.prototype.loadLight=function(t){var e,i=this.lightDefs[t],r=new n.Color(16777215);void 0!==i.color&&r.fromArray(i.color);var o=void 0!==i.range?i.range:0;switch(i.type){case"directional":(e=new n.DirectionalLight(r)).target.position.set(0,0,-1),e.add(e.target);break;case"point":(e=new n.PointLight(r)).distance=o;break;case"spot":(e=new n.SpotLight(r)).distance=o,i.spot=i.spot||{},i.spot.innerConeAngle=void 0!==i.spot.innerConeAngle?i.spot.innerConeAngle:0,i.spot.outerConeAngle=void 0!==i.spot.outerConeAngle?i.spot.outerConeAngle:Math.PI/4,e.angle=i.spot.outerConeAngle,e.penumbra=1-i.spot.innerConeAngle/i.spot.outerConeAngle,e.target.position.set(0,0,-1),e.add(e.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+i.type+'".')}return e.position.set(0,0,0),e.decay=2,void 0!==i.intensity&&(e.intensity=i.intensity),e.name=i.name||"light_"+t,Promise.resolve(e)},a.prototype.getMaterialType=function(){return n.MeshBasicMaterial},a.prototype.extendParams=function(t,e,i){var r=[];t.color=new n.Color(1,1,1),t.opacity=1;var o=e.pbrMetallicRoughness;if(o){if(Array.isArray(o.baseColorFactor)){var a=o.baseColorFactor;t.color.fromArray(a),t.opacity=a[3]}void 0!==o.baseColorTexture&&r.push(i.assignTexture(t,"map",o.baseColorTexture))}return Promise.all(r)};var s="glTF",l=1313821514,u=5130562;function h(t){this.name=i.KHR_BINARY_GLTF,this.content=null,this.body=null;var e=new DataView(t,0,12);if(this.header={magic:n.LoaderUtils.decodeText(new Uint8Array(t.slice(0,4))),version:e.getUint32(4,!0),length:e.getUint32(8,!0)},this.header.magic!==s)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected. Use LegacyGLTFLoader instead.");for(var r=new DataView(t,12),o=0;o<r.byteLength;){var a=r.getUint32(o,!0);o+=4;var h=r.getUint32(o,!0);if(o+=4,h===l){var c=new Uint8Array(t,12+o,a);this.content=n.LoaderUtils.decodeText(c)}else if(h===u){var d=12+o;this.body=t.slice(d,d+a)}o+=a}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}function c(t,e){if(!e)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=i.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=e}function d(){this.name=i.KHR_TEXTURE_TRANSFORM}function p(){return{name:i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return n.ShaderMaterial},extendParams:function(t,e,i){var r=e.extensions[this.name],o=n.ShaderLib.standard,a=n.UniformsUtils.clone(o.uniforms),s=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),l=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),u=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),h=["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"),c=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","material.specularRoughness = clamp( 1.0 - glossinessFactor, 0.04, 1.0 );","material.specularColor = specularFactor.rgb;"].join("\n"),d=o.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;").replace("uniform float metalness;","uniform float glossiness;").replace("#include <roughnessmap_pars_fragment>",s).replace("#include <metalnessmap_pars_fragment>",l).replace("#include <roughnessmap_fragment>",u).replace("#include <metalnessmap_fragment>",h).replace("#include <lights_physical_fragment>",c);delete a.roughness,delete a.metalness,delete a.roughnessMap,delete a.metalnessMap,a.specular={value:(new n.Color).setHex(1118481)},a.glossiness={value:.5},a.specularMap={value:null},a.glossinessMap={value:null},t.vertexShader=o.vertexShader,t.fragmentShader=d,t.uniforms=a,t.defines={STANDARD:""},t.color=new n.Color(1,1,1),t.opacity=1;var p=[];if(Array.isArray(r.diffuseFactor)){var f=r.diffuseFactor;t.color.fromArray(f),t.opacity=f[3]}if(void 0!==r.diffuseTexture&&p.push(i.assignTexture(t,"map",r.diffuseTexture)),t.emissive=new n.Color(0,0,0),t.glossiness=void 0!==r.glossinessFactor?r.glossinessFactor:1,t.specular=new n.Color(1,1,1),Array.isArray(r.specularFactor)&&t.specular.fromArray(r.specularFactor),void 0!==r.specularGlossinessTexture){var m=r.specularGlossinessTexture;p.push(i.assignTexture(t,"glossinessMap",m)),p.push(i.assignTexture(t,"specularMap",m))}return Promise.all(p)},createMaterial:function(t){var e=new n.ShaderMaterial({defines:t.defines,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,fog:!0,lights:!0,opacity:t.opacity,transparent:t.transparent});return e.isGLTFSpecularGlossinessMaterial=!0,e.color=t.color,e.map=void 0===t.map?null:t.map,e.lightMap=null,e.lightMapIntensity=1,e.aoMap=void 0===t.aoMap?null:t.aoMap,e.aoMapIntensity=1,e.emissive=t.emissive,e.emissiveIntensity=1,e.emissiveMap=void 0===t.emissiveMap?null:t.emissiveMap,e.bumpMap=void 0===t.bumpMap?null:t.bumpMap,e.bumpScale=1,e.normalMap=void 0===t.normalMap?null:t.normalMap,t.normalScale&&(e.normalScale=t.normalScale),e.displacementMap=null,e.displacementScale=1,e.displacementBias=0,e.specularMap=void 0===t.specularMap?null:t.specularMap,e.specular=t.specular,e.glossinessMap=void 0===t.glossinessMap?null:t.glossinessMap,e.glossiness=t.glossiness,e.alphaMap=null,e.envMap=void 0===t.envMap?null:t.envMap,e.envMapIntensity=1,e.refractionRatio=.98,e.extensions.derivatives=!0,e},cloneMaterial:function(t){var e=t.clone();e.isGLTFSpecularGlossinessMaterial=!0;for(var i=this.specularGlossinessParams,n=0,r=i.length;n<r;n++)e[i[n]]=t[i[n]];return e},refreshUniforms:function(t,e,i,n,r,o){if(!0===r.isGLTFSpecularGlossinessMaterial){var a,s=r.uniforms,l=r.defines;s.opacity.value=r.opacity,s.diffuse.value.copy(r.color),s.emissive.value.copy(r.emissive).multiplyScalar(r.emissiveIntensity),s.map.value=r.map,s.specularMap.value=r.specularMap,s.alphaMap.value=r.alphaMap,s.lightMap.value=r.lightMap,s.lightMapIntensity.value=r.lightMapIntensity,s.aoMap.value=r.aoMap,s.aoMapIntensity.value=r.aoMapIntensity,r.map?a=r.map:r.specularMap?a=r.specularMap:r.displacementMap?a=r.displacementMap:r.normalMap?a=r.normalMap:r.bumpMap?a=r.bumpMap:r.glossinessMap?a=r.glossinessMap:r.alphaMap?a=r.alphaMap:r.emissiveMap&&(a=r.emissiveMap),void 0!==a&&(a.isWebGLRenderTarget&&(a=a.texture),!0===a.matrixAutoUpdate&&a.updateMatrix(),s.uvTransform.value.copy(a.matrix)),r.envMap&&(s.envMap.value=r.envMap,s.envMapIntensity.value=r.envMapIntensity,s.flipEnvMap.value=r.envMap.isCubeTexture?-1:1,s.reflectivity.value=r.reflectivity,s.refractionRatio.value=r.refractionRatio,s.maxMipLevel.value=t.properties.get(r.envMap).__maxMipLevel),s.specular.value.copy(r.specular),s.glossiness.value=r.glossiness,s.glossinessMap.value=r.glossinessMap,s.emissiveMap.value=r.emissiveMap,s.bumpMap.value=r.bumpMap,s.normalMap.value=r.normalMap,s.displacementMap.value=r.displacementMap,s.displacementScale.value=r.displacementScale,s.displacementBias.value=r.displacementBias,null!==s.glossinessMap.value&&void 0===l.USE_GLOSSINESSMAP&&(l.USE_GLOSSINESSMAP="",l.USE_ROUGHNESSMAP=""),null===s.glossinessMap.value&&void 0!==l.USE_GLOSSINESSMAP&&(delete l.USE_GLOSSINESSMAP,delete l.USE_ROUGHNESSMAP)}}}}function f(t,e,i,r){n.Interpolant.call(this,t,e,i,r)}c.prototype.decodePrimitive=function(t,e){var i=this.json,n=this.dracoLoader,r=t.extensions[this.name].bufferView,o=t.extensions[this.name].attributes,a={},s={},l={};for(var u in o){var h=P[u]||u.toLowerCase();a[h]=o[u]}for(u in t.attributes){h=P[u]||u.toLowerCase();if(void 0!==o[u]){var c=i.accessors[t.attributes[u]],d=T[c.componentType];l[h]=d,s[h]=!0===c.normalized}}return e.getDependency("bufferView",r).then((function(t){return new Promise((function(e){n.decodeDracoFile(t,(function(t){for(var i in t.attributes){var n=t.attributes[i],r=s[i];void 0!==r&&(n.normalized=r)}e(t)}),a,l)}))}))},d.prototype.extendTexture=function(t,e){return t=t.clone(),void 0!==e.offset&&t.offset.fromArray(e.offset),void 0!==e.rotation&&(t.rotation=e.rotation),void 0!==e.scale&&t.repeat.fromArray(e.scale),e.texCoord,t.needsUpdate=!0,t},f.prototype=Object.create(n.Interpolant.prototype),f.prototype.constructor=f,f.prototype.copySampleValue_=function(t){for(var e=this.resultBuffer,i=this.sampleValues,n=this.valueSize,r=t*n*3+n,o=0;o!==n;o++)e[o]=i[r+o];return e},f.prototype.beforeStart_=f.prototype.copySampleValue_,f.prototype.afterEnd_=f.prototype.copySampleValue_,f.prototype.interpolate_=function(t,e,i,n){for(var r=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=2*a,l=3*a,u=n-e,h=(i-e)/u,c=h*h,d=c*h,p=t*l,f=p-l,m=-2*d+3*c,g=d-c,v=1-m,y=g-c+h,b=0;b!==a;b++){var w=o[f+b+a],x=o[f+b+s]*u,M=o[p+b+a],T=o[p+b]*u;r[b]=v*w+y*x+m*M+g*T}return r};var m,g=0,v=1,y=2,b=3,w=4,x=5,M=6,T=(n.Matrix3,n.Matrix4,n.Vector2,n.Vector3,n.Vector4,n.Texture,{5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array}),S={9728:n.NearestFilter,9729:n.LinearFilter,9984:n.NearestMipMapNearestFilter,9985:n.LinearMipMapNearestFilter,9986:n.NearestMipMapLinearFilter,9987:n.LinearMipMapLinearFilter},_={33071:n.ClampToEdgeWrapping,33648:n.MirroredRepeatWrapping,10497:n.RepeatWrapping},A=(n.BackSide,n.FrontSide,n.NeverDepth,n.LessDepth,n.EqualDepth,n.LessEqualDepth,n.GreaterEqualDepth,n.NotEqualDepth,n.GreaterEqualDepth,n.AlwaysDepth,n.AddEquation,n.SubtractEquation,n.ReverseSubtractEquation,n.ZeroFactor,n.OneFactor,n.SrcColorFactor,n.OneMinusSrcColorFactor,n.SrcAlphaFactor,n.OneMinusSrcAlphaFactor,n.DstAlphaFactor,n.OneMinusDstAlphaFactor,n.DstColorFactor,n.OneMinusDstColorFactor,n.SrcAlphaSaturateFactor,{SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16}),P={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},C={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},E={CUBICSPLINE:void 0,LINEAR:n.InterpolateLinear,STEP:n.InterpolateDiscrete},D="OPAQUE",L="MASK",O="BLEND",I={"image/png":n.RGBAFormat,"image/jpeg":n.RGBFormat};function R(t,e){return"string"!=typeof t||""===t?"":/^(https?:)?\/\//i.test(t)||/^data:.*,.*$/i.test(t)||/^blob:.*$/i.test(t)?t:e+t}function N(t,e,i){for(var n in i.extensions)void 0===t[n]&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=i.extensions[n])}function k(t,e){void 0!==e.extras&&"object"==typeof e.extras&&(t.userData=e.extras)}function F(t,e){if(t.updateMorphTargets(),void 0!==e.weights)for(var i=0,n=e.weights.length;i<n;i++)t.morphTargetInfluences[i]=e.weights[i];if(e.extras&&Array.isArray(e.extras.targetNames)){var r=e.extras.targetNames;if(t.morphTargetInfluences.length===r.length){t.morphTargetDictionary={};for(i=0,n=r.length;i<n;i++)t.morphTargetDictionary[r[i]]=i}}}function B(t){for(var e="",i=Object.keys(t).sort(),n=0,r=i.length;n<r;n++)e+=i[n]+":"+t[i[n]]+";";return e}function z(t){if(t.isInterleavedBufferAttribute){for(var e=t.count,i=t.itemSize,r=t.array.slice(0,e*i),o=0,a=0;o<e;++o)r[a++]=t.getX(o),i>=2&&(r[a++]=t.getY(o)),i>=3&&(r[a++]=t.getZ(o)),i>=4&&(r[a++]=t.getW(o));return new n.BufferAttribute(r,i,t.normalized)}return t.clone()}function U(t,i,r){this.json=t||{},this.extensions=i||{},this.options=r||{},this.cache=new e,this.primitiveCache={},this.textureLoader=new n.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new n.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer")}function V(t,e,i){var n=e.attributes,r=[];function o(e,n){return i.getDependency("accessor",e).then((function(e){t.addAttribute(n,e)}))}for(var a in n){var s=P[a]||a.toLowerCase();s in t.attributes||r.push(o(n[a],s))}if(void 0!==e.indices&&!t.index){var l=i.getDependency("accessor",e.indices).then((function(e){t.setIndex(e)}));r.push(l)}return k(t,e),Promise.all(r).then((function(){return void 0!==e.targets?function(t,e,i){for(var n=!1,r=!1,o=0,a=e.length;o<a;o++){if(void 0!==(u=e[o]).POSITION&&(n=!0),void 0!==u.NORMAL&&(r=!0),n&&r)break}if(!n&&!r)return Promise.resolve(t);var s=[],l=[];for(o=0,a=e.length;o<a;o++){var u=e[o];if(n){var h=void 0!==u.POSITION?i.getDependency("accessor",u.POSITION):t.attributes.position;s.push(h)}if(r){h=void 0!==u.NORMAL?i.getDependency("accessor",u.NORMAL):t.attributes.normal;l.push(h)}}return Promise.all([Promise.all(s),Promise.all(l)]).then((function(i){for(var o=i[0],a=i[1],s=0,l=o.length;s<l;s++)t.attributes.position!==o[s]&&(o[s]=z(o[s]));for(s=0,l=a.length;s<l;s++)t.attributes.normal!==a[s]&&(a[s]=z(a[s]));for(s=0,l=e.length;s<l;s++){var u=e[s],h="morphTarget"+s;if(n&&void 0!==u.POSITION){var c=o[s];c.name=h;for(var d=t.attributes.position,p=0,f=c.count;p<f;p++)c.setXYZ(p,c.getX(p)+d.getX(p),c.getY(p)+d.getY(p),c.getZ(p)+d.getZ(p))}if(r&&void 0!==u.NORMAL){var m=a[s];m.name=h;var g=t.attributes.normal;for(p=0,f=m.count;p<f;p++)m.setXYZ(p,m.getX(p)+g.getX(p),m.getY(p)+g.getY(p),m.getZ(p)+g.getZ(p))}}return n&&(t.morphAttributes.position=o),r&&(t.morphAttributes.normal=a),t}))}(t,e.targets,i):t}))}return U.prototype.parse=function(t,e){var i=this,n=this.json,r=this.extensions;this.cache.removeAll(),this.markDefs(),Promise.all([this.getDependencies("scene"),this.getDependencies("animation"),this.getDependencies("camera")]).then((function(e){var o={scene:e[0][n.scene||0],scenes:e[0],animations:e[1],cameras:e[2],asset:n.asset,parser:i,userData:{}};N(r,o,n),t(o)})).catch(e)},U.prototype.markDefs=function(){for(var t=this.json.nodes||[],e=this.json.skins||[],i=this.json.meshes||[],n={},r={},o=0,a=e.length;o<a;o++)for(var s=e[o].joints,l=0,u=s.length;l<u;l++)t[s[l]].isBone=!0;for(var h=0,c=t.length;h<c;h++){var d=t[h];void 0!==d.mesh&&(void 0===n[d.mesh]&&(n[d.mesh]=r[d.mesh]=0),n[d.mesh]++,void 0!==d.skin&&(i[d.mesh].isSkinnedMesh=!0))}this.json.meshReferences=n,this.json.meshUses=r},U.prototype.getDependency=function(t,e){var n=t+":"+e,r=this.cache.get(n);if(!r){switch(t){case"scene":r=this.loadScene(e);break;case"node":r=this.loadNode(e);break;case"mesh":r=this.loadMesh(e);break;case"accessor":r=this.loadAccessor(e);break;case"bufferView":r=this.loadBufferView(e);break;case"buffer":r=this.loadBuffer(e);break;case"material":r=this.loadMaterial(e);break;case"texture":r=this.loadTexture(e);break;case"skin":r=this.loadSkin(e);break;case"animation":r=this.loadAnimation(e);break;case"camera":r=this.loadCamera(e);break;case"light":r=this.extensions[i.KHR_LIGHTS_PUNCTUAL].loadLight(e);break;default:throw new Error("Unknown type: "+t)}this.cache.add(n,r)}return r},U.prototype.getDependencies=function(t){var e=this.cache.get(t);if(!e){var 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},U.prototype.loadBuffer=function(t){var e=this.json.buffers[t],n=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[i.KHR_BINARY_GLTF].body);var r=this.options;return new Promise((function(t,i){n.load(R(e.uri,r.path),t,void 0,(function(){i(new Error('THREE.GLTFLoader: Failed to load buffer "'+e.uri+'".'))}))}))},U.prototype.loadBufferView=function(t){var e=this.json.bufferViews[t];return this.getDependency("buffer",e.buffer).then((function(t){var i=e.byteLength||0,n=e.byteOffset||0;return t.slice(n,n+i)}))},U.prototype.loadAccessor=function(t){var e=this,i=this.json,r=this.json.accessors[t];if(void 0===r.bufferView&&void 0===r.sparse)return Promise.resolve(null);var o=[];return void 0!==r.bufferView?o.push(this.getDependency("bufferView",r.bufferView)):o.push(null),void 0!==r.sparse&&(o.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),o.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(o).then((function(t){var o,a,s=t[0],l=A[r.type],u=T[r.componentType],h=u.BYTES_PER_ELEMENT,c=h*l,d=r.byteOffset||0,p=void 0!==r.bufferView?i.bufferViews[r.bufferView].byteStride:void 0,f=!0===r.normalized;if(p&&p!==c){var m="InterleavedBuffer:"+r.bufferView+":"+r.componentType,g=e.cache.get(m);g||(o=new u(s),g=new n.InterleavedBuffer(o,p/h),e.cache.add(m,g)),a=new n.InterleavedBufferAttribute(g,l,d/h,f)}else o=null===s?new u(r.count*l):new u(s,d,r.count*l),a=new n.BufferAttribute(o,l,f);if(void 0!==r.sparse){var v=A.SCALAR,y=T[r.sparse.indices.componentType],b=r.sparse.indices.byteOffset||0,w=r.sparse.values.byteOffset||0,x=new y(t[1],b,r.sparse.count*v),M=new u(t[2],w,r.sparse.count*l);null!==s&&a.setArray(a.array.slice());for(var S=0,_=x.length;S<_;S++){var P=x[S];if(a.setX(P,M[S*l]),l>=2&&a.setY(P,M[S*l+1]),l>=3&&a.setZ(P,M[S*l+2]),l>=4&&a.setW(P,M[S*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return a}))},U.prototype.loadTexture=function(t){var e,r=this,o=this.json,a=this.options,s=this.textureLoader,l=window.URL||window.webkitURL,u=o.textures[t],h=u.extensions||{},c=(e=h[i.MSFT_TEXTURE_DDS]?o.images[h[i.MSFT_TEXTURE_DDS].source]:o.images[u.source]).uri,d=!1;return void 0!==e.bufferView&&(c=r.getDependency("bufferView",e.bufferView).then((function(t){d=!0;var i=new Blob([t],{type:e.mimeType});return c=l.createObjectURL(i)}))),Promise.resolve(c).then((function(t){var e=n.Loader.Handlers.get(t);return e||(e=h[i.MSFT_TEXTURE_DDS]?r.extensions[i.MSFT_TEXTURE_DDS].ddsLoader:s),new Promise((function(i,n){e.load(R(t,a.path),i,void 0,n)}))})).then((function(t){!0===d&&l.revokeObjectURL(c),t.flipY=!1,void 0!==u.name&&(t.name=u.name),e.mimeType in I&&(t.format=I[e.mimeType]);var i=(o.samplers||{})[u.sampler]||{};return t.magFilter=S[i.magFilter]||n.LinearFilter,t.minFilter=S[i.minFilter]||n.LinearMipMapLinearFilter,t.wrapS=_[i.wrapS]||n.RepeatWrapping,t.wrapT=_[i.wrapT]||n.RepeatWrapping,t}))},U.prototype.assignTexture=function(t,e,r){var o=this;return this.getDependency("texture",r.index).then((function(a){if(!a.isCompressedTexture)switch(e){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":a.format=n.RGBFormat}if(o.extensions[i.KHR_TEXTURE_TRANSFORM]){var s=void 0!==r.extensions?r.extensions[i.KHR_TEXTURE_TRANSFORM]:void 0;s&&(a=o.extensions[i.KHR_TEXTURE_TRANSFORM].extendTexture(a,s))}t[e]=a}))},U.prototype.assignFinalMaterial=function(t){var e=t.geometry,r=t.material,o=this.extensions,a=void 0!==e.attributes.tangent,s=void 0!==e.attributes.color,l=void 0===e.attributes.normal,u=!0===t.isSkinnedMesh,h=Object.keys(e.morphAttributes).length>0,c=h&&void 0!==e.morphAttributes.normal;if(t.isPoints){var d="PointsMaterial:"+r.uuid,p=this.cache.get(d);p||(p=new n.PointsMaterial,n.Material.prototype.copy.call(p,r),p.color.copy(r.color),p.map=r.map,p.lights=!1,this.cache.add(d,p)),r=p}else if(t.isLine){d="LineBasicMaterial:"+r.uuid;var f=this.cache.get(d);f||(f=new n.LineBasicMaterial,n.Material.prototype.copy.call(f,r),f.color.copy(r.color),f.lights=!1,this.cache.add(d,f)),r=f}if(a||s||l||u||h){d="ClonedMaterial:"+r.uuid+":";r.isGLTFSpecularGlossinessMaterial&&(d+="specular-glossiness:"),u&&(d+="skinning:"),a&&(d+="vertex-tangents:"),s&&(d+="vertex-colors:"),l&&(d+="flat-shading:"),h&&(d+="morph-targets:"),c&&(d+="morph-normals:");var m=this.cache.get(d);m||(m=r.isGLTFSpecularGlossinessMaterial?o[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].cloneMaterial(r):r.clone(),u&&(m.skinning=!0),a&&(m.vertexTangents=!0),s&&(m.vertexColors=n.VertexColors),l&&(m.flatShading=!0),h&&(m.morphTargets=!0),c&&(m.morphNormals=!0),this.cache.add(d,m)),r=m}r.aoMap&&void 0===e.attributes.uv2&&void 0!==e.attributes.uv&&e.addAttribute("uv2",new n.BufferAttribute(e.attributes.uv.array,2)),r.isGLTFSpecularGlossinessMaterial&&(t.onBeforeRender=o[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].refreshUniforms),t.material=r},U.prototype.loadMaterial=function(t){var e,r=this.json,o=this.extensions,a=r.materials[t],s={},l=a.extensions||{},u=[];if(l[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var h=o[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];e=h.getMaterialType(),u.push(h.extendParams(s,a,this))}else if(l[i.KHR_MATERIALS_UNLIT]){var c=o[i.KHR_MATERIALS_UNLIT];e=c.getMaterialType(),u.push(c.extendParams(s,a,this))}else{e=n.MeshStandardMaterial;var d=a.pbrMetallicRoughness||{};if(s.color=new n.Color(1,1,1),s.opacity=1,Array.isArray(d.baseColorFactor)){var p=d.baseColorFactor;s.color.fromArray(p),s.opacity=p[3]}void 0!==d.baseColorTexture&&u.push(this.assignTexture(s,"map",d.baseColorTexture)),s.metalness=void 0!==d.metallicFactor?d.metallicFactor:1,s.roughness=void 0!==d.roughnessFactor?d.roughnessFactor:1,void 0!==d.metallicRoughnessTexture&&(u.push(this.assignTexture(s,"metalnessMap",d.metallicRoughnessTexture)),u.push(this.assignTexture(s,"roughnessMap",d.metallicRoughnessTexture)))}!0===a.doubleSided&&(s.side=n.DoubleSide);var f=a.alphaMode||D;return f===O?s.transparent=!0:(s.transparent=!1,f===L&&(s.alphaTest=void 0!==a.alphaCutoff?a.alphaCutoff:.5)),void 0!==a.normalTexture&&e!==n.MeshBasicMaterial&&(u.push(this.assignTexture(s,"normalMap",a.normalTexture)),s.normalScale=new n.Vector2(1,1),void 0!==a.normalTexture.scale&&s.normalScale.set(a.normalTexture.scale,a.normalTexture.scale)),void 0!==a.occlusionTexture&&e!==n.MeshBasicMaterial&&(u.push(this.assignTexture(s,"aoMap",a.occlusionTexture)),void 0!==a.occlusionTexture.strength&&(s.aoMapIntensity=a.occlusionTexture.strength)),void 0!==a.emissiveFactor&&e!==n.MeshBasicMaterial&&(s.emissive=(new n.Color).fromArray(a.emissiveFactor)),void 0!==a.emissiveTexture&&e!==n.MeshBasicMaterial&&u.push(this.assignTexture(s,"emissiveMap",a.emissiveTexture)),Promise.all(u).then((function(){var t;return t=e===n.ShaderMaterial?o[i.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(s):new e(s),void 0!==a.name&&(t.name=a.name),t.map&&(t.map.encoding=n.sRGBEncoding),t.emissiveMap&&(t.emissiveMap.encoding=n.sRGBEncoding),t.specularMap&&(t.specularMap.encoding=n.sRGBEncoding),k(t,a),a.extensions&&N(o,t,a),t}))},U.prototype.loadGeometries=function(t){var e=this,r=this.extensions,o=this.primitiveCache;function a(t){return r[i.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(t,e).then((function(i){return V(i,t,e)}))}for(var s,l,u=[],h=0,c=t.length;h<c;h++){var d,p=t[h],f=(l=void 0,(l=(s=p).extensions&&s.extensions[i.KHR_DRACO_MESH_COMPRESSION])?"draco:"+l.bufferView+":"+l.indices+":"+B(l.attributes):s.indices+":"+B(s.attributes)+":"+s.mode),m=o[f];if(m)u.push(m.promise);else d=p.extensions&&p.extensions[i.KHR_DRACO_MESH_COMPRESSION]?a(p):V(new n.BufferGeometry,p,e),o[f]={primitive:p,promise:d},u.push(d)}return Promise.all(u)},U.prototype.loadMesh=function(t){for(var e=this,i=this.json,r=(this.extensions,i.meshes[t]),o=r.primitives,a=[],s=0,l=o.length;s<l;s++){var u=void 0===o[s].material?m=m||new n.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:n.FrontSide}):this.getDependency("material",o[s].material);a.push(u)}return Promise.all(a).then((function(i){return e.loadGeometries(o).then((function(a){for(var s=[],l=0,u=a.length;l<u;l++){var h,c=a[l],d=o[l],p=i[l];if(d.mode===w||d.mode===x||d.mode===M||void 0===d.mode)!0===(h=!0===r.isSkinnedMesh?new n.SkinnedMesh(c,p):new n.Mesh(c,p)).isSkinnedMesh&&h.normalizeSkinWeights(),d.mode===x?h.drawMode=n.TriangleStripDrawMode:d.mode===M&&(h.drawMode=n.TriangleFanDrawMode);else if(d.mode===v)h=new n.LineSegments(c,p);else if(d.mode===b)h=new n.Line(c,p);else if(d.mode===y)h=new n.LineLoop(c,p);else{if(d.mode!==g)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+d.mode);h=new n.Points(c,p)}Object.keys(h.geometry.morphAttributes).length>0&&F(h,r),h.name=r.name||"mesh_"+t,a.length>1&&(h.name+="_"+l),k(h,r),e.assignFinalMaterial(h),s.push(h)}if(1===s.length)return s[0];var f=new n.Group;for(l=0,u=s.length;l<u;l++)f.add(s[l]);return f}))}))},U.prototype.loadCamera=function(t){var e,i=this.json.cameras[t],r=i[i.type];if(r)return"perspective"===i.type?e=new n.PerspectiveCamera(n.Math.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):"orthographic"===i.type&&(e=new n.OrthographicCamera(r.xmag/-2,r.xmag/2,r.ymag/2,r.ymag/-2,r.znear,r.zfar)),void 0!==i.name&&(e.name=i.name),k(e,i),Promise.resolve(e)},U.prototype.loadSkin=function(t){var 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}))},U.prototype.loadAnimation=function(t){for(var e=this.json.animations[t],i=[],r=[],o=[],a=[],s=[],l=0,u=e.channels.length;l<u;l++){var h=e.channels[l],c=e.samplers[h.sampler],d=h.target,p=void 0!==d.node?d.node:d.id,m=void 0!==e.parameters?e.parameters[c.input]:c.input,g=void 0!==e.parameters?e.parameters[c.output]:c.output;i.push(this.getDependency("node",p)),r.push(this.getDependency("accessor",m)),o.push(this.getDependency("accessor",g)),a.push(c),s.push(d)}return Promise.all([Promise.all(i),Promise.all(r),Promise.all(o),Promise.all(a),Promise.all(s)]).then((function(i){for(var r=i[0],o=i[1],a=i[2],s=i[3],l=i[4],u=[],h=0,c=r.length;h<c;h++){var d=r[h],p=o[h],m=a[h],g=s[h],v=l[h];if(void 0!==d){var y;switch(d.updateMatrix(),d.matrixAutoUpdate=!0,C[v.path]){case C.weights:y=n.NumberKeyframeTrack;break;case C.rotation:y=n.QuaternionKeyframeTrack;break;case C.position:case C.scale:default:y=n.VectorKeyframeTrack}var b=d.name?d.name:d.uuid,w=void 0!==g.interpolation?E[g.interpolation]:n.InterpolateLinear,x=[];C[v.path]===C.weights?d.traverse((function(t){!0===t.isMesh&&t.morphTargetInfluences&&x.push(t.name?t.name:t.uuid)})):x.push(b);for(var M=0,T=x.length;M<T;M++){var S=new y(x[M]+"."+C[v.path],p.array,m.array,w);"CUBICSPLINE"===g.interpolation&&(S.createInterpolant=function(t){return new f(this.times,this.values,this.getValueSize()/3,t)},S.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),u.push(S)}}}var _=void 0!==e.name?e.name:"animation_"+t;return new n.AnimationClip(_,void 0,u)}))},U.prototype.loadNode=function(t){var e=this.json,r=this.extensions,o=this,a=e.meshReferences,s=e.meshUses,l=e.nodes[t];return(!0===l.isBone?Promise.resolve(new n.Bone):void 0!==l.mesh?o.getDependency("mesh",l.mesh).then((function(t){var e;if(a[l.mesh]>1){var i=s[l.mesh]++;(e=t.clone()).name+="_instance_"+i,e.onBeforeRender=t.onBeforeRender;for(var n=0,r=e.children.length;n<r;n++)e.children[n].name+="_instance_"+i,e.children[n].onBeforeRender=t.children[n].onBeforeRender}else e=t;return void 0!==l.weights&&e.traverse((function(t){if(t.isMesh)for(var e=0,i=l.weights.length;e<i;e++)t.morphTargetInfluences[e]=l.weights[e]})),e})):void 0!==l.camera?o.getDependency("camera",l.camera):l.extensions&&l.extensions[i.KHR_LIGHTS_PUNCTUAL]&&void 0!==l.extensions[i.KHR_LIGHTS_PUNCTUAL].light?o.getDependency("light",l.extensions[i.KHR_LIGHTS_PUNCTUAL].light):Promise.resolve(new n.Object3D)).then((function(t){if(void 0!==l.name&&(t.name=n.PropertyBinding.sanitizeNodeName(l.name)),k(t,l),l.extensions&&N(r,t,l),void 0!==l.matrix){var e=new n.Matrix4;e.fromArray(l.matrix),t.applyMatrix(e)}else void 0!==l.translation&&t.position.fromArray(l.translation),void 0!==l.rotation&&t.quaternion.fromArray(l.rotation),void 0!==l.scale&&t.scale.fromArray(l.scale);return t}))},U.prototype.loadScene=function(){function t(e,i,r,o){var a=r.nodes[e];return o.getDependency("node",e).then((function(t){return void 0===a.skin?t:o.getDependency("skin",a.skin).then((function(t){for(var i=[],n=0,r=(e=t).joints.length;n<r;n++)i.push(o.getDependency("node",e.joints[n]));return Promise.all(i)})).then((function(i){for(var r=!0===t.isGroup?t.children:[t],o=0,a=r.length;o<a;o++){for(var s=r[o],l=[],u=[],h=0,c=i.length;h<c;h++){var d=i[h];if(d){l.push(d);var p=new n.Matrix4;void 0!==e.inverseBindMatrices&&p.fromArray(e.inverseBindMatrices.array,16*h),u.push(p)}}s.bind(new n.Skeleton(l,u),s.matrixWorld)}return t}));var e})).then((function(e){i.add(e);var n=[];if(a.children)for(var s=a.children,l=0,u=s.length;l<u;l++){var h=s[l];n.push(t(h,e,r,o))}return Promise.all(n)}))}return function(e){var i=this.json,r=this.extensions,o=this.json.scenes[e],a=new n.Scene;void 0!==o.name&&(a.name=o.name),k(a,o),o.extensions&&N(r,a,o);for(var s=o.nodes||[],l=[],u=0,h=s.length;u<h;u++)l.push(t(s[u],a,i,this));return Promise.all(l).then((function(){return a}))}}(),t}()},function(t,e,i){"use strict";i(124);var n=i(0);i(68);function r(){this.loader=new n.OBJLoaderOfMeshMatcapMaterial}r.prototype.load=function(t){var e=this;return new Promise((function(i,n){e.loader.load(t,(function(t){t?i(t):n("load obj model error!")}))}))},t.exports=new r},function(t,e,i){var n=i(0);n.OBJLoaderOfMeshMatcapMaterial=function(){var t=/^[og]\s*(.+)?/,e=/^mtllib /,i=/^usemtl /;function r(){var t={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materialLibraries:[],startObject:function(t,e){if(this.object&&!1===this.object.fromDeclaration)return this.object.name=t,void(this.object.fromDeclaration=!1!==e);var i=this.object&&"function"==typeof this.object.currentMaterial?this.object.currentMaterial():void 0;if(this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0),this.object={name:t||"",fromDeclaration:!1!==e,geometry:{vertices:[],normals:[],colors:[],uvs:[]},materials:[],smooth:!0,startMaterial:function(t,e){var i=this._finalize(!1);i&&(i.inherited||i.groupCount<=0)&&this.materials.splice(i.index,1);var n={index:this.materials.length,name:t||"",mtllib:Array.isArray(e)&&e.length>0?e[e.length-1]:"",smooth:void 0!==i?i.smooth:this.smooth,groupStart:void 0!==i?i.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(t){var e={index:"number"==typeof t?t:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return e.clone=this.clone.bind(e),e}};return this.materials.push(n),n},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(t){var e=this.currentMaterial();if(e&&-1===e.groupEnd&&(e.groupEnd=this.geometry.vertices.length/3,e.groupCount=e.groupEnd-e.groupStart,e.inherited=!1),t&&this.materials.length>1)for(var i=this.materials.length-1;i>=0;i--)this.materials[i].groupCount<=0&&this.materials.splice(i,1);return t&&0===this.materials.length&&this.materials.push({name:"",smooth:this.smooth}),e}},i&&i.name&&"function"==typeof i.clone){var n=i.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)},finalize:function(){this.object&&"function"==typeof this.object._finalize&&this.object._finalize(!0)},parseVertexIndex:function(t,e){var i=parseInt(t,10);return 3*(i>=0?i-1:i+e/3)},parseNormalIndex:function(t,e){var i=parseInt(t,10);return 3*(i>=0?i-1:i+e/3)},parseUVIndex:function(t,e){var i=parseInt(t,10);return 2*(i>=0?i-1:i+e/2)},addVertex:function(t,e,i){var n=this.vertices,r=this.object.geometry.vertices;r.push(n[t+0],n[t+1],n[t+2]),r.push(n[e+0],n[e+1],n[e+2]),r.push(n[i+0],n[i+1],n[i+2])},addVertexPoint:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addVertexLine:function(t){var e=this.vertices;this.object.geometry.vertices.push(e[t+0],e[t+1],e[t+2])},addNormal:function(t,e,i){var n=this.normals,r=this.object.geometry.normals;r.push(n[t+0],n[t+1],n[t+2]),r.push(n[e+0],n[e+1],n[e+2]),r.push(n[i+0],n[i+1],n[i+2])},addColor:function(t,e,i){var n=this.colors,r=this.object.geometry.colors;r.push(n[t+0],n[t+1],n[t+2]),r.push(n[e+0],n[e+1],n[e+2]),r.push(n[i+0],n[i+1],n[i+2])},addUV:function(t,e,i){var n=this.uvs,r=this.object.geometry.uvs;r.push(n[t+0],n[t+1]),r.push(n[e+0],n[e+1]),r.push(n[i+0],n[i+1])},addUVLine:function(t){var e=this.uvs;this.object.geometry.uvs.push(e[t+0],e[t+1])},addFace:function(t,e,i,n,r,o,a,s,l){var u=this.vertices.length,h=this.parseVertexIndex(t,u),c=this.parseVertexIndex(e,u),d=this.parseVertexIndex(i,u);if(this.addVertex(h,c,d),void 0!==n&&""!==n){var p=this.uvs.length;h=this.parseUVIndex(n,p),c=this.parseUVIndex(r,p),d=this.parseUVIndex(o,p),this.addUV(h,c,d)}if(void 0!==a&&""!==a){var f=this.normals.length;h=this.parseNormalIndex(a,f),c=a===s?h:this.parseNormalIndex(s,f),d=a===l?h:this.parseNormalIndex(l,f),this.addNormal(h,c,d)}this.colors.length>0&&this.addColor(h,c,d)},addPointGeometry:function(t){this.object.geometry.type="Points";for(var e=this.vertices.length,i=0,n=t.length;i<n;i++)this.addVertexPoint(this.parseVertexIndex(t[i],e))},addLineGeometry:function(t,e){this.object.geometry.type="Line";for(var i=this.vertices.length,n=this.uvs.length,r=0,o=t.length;r<o;r++)this.addVertexLine(this.parseVertexIndex(t[r],i));var a=0;for(o=e.length;a<o;a++)this.addUVLine(this.parseUVIndex(e[a],n))}};return t.startObject("",!1),t}function o(t){this.manager=void 0!==t?t:n.DefaultLoadingManager,this.materials=null}return o.prototype={constructor:o,load:function(t,e,i,r){var o=this,a=new n.FileLoader(o.manager);a.setPath(this.path),a.load(t,(function(t){e(o.parse(t))}),i,r)},setPath:function(t){return this.path=t,this},setMaterials:function(t){return this.materials=t,this},parse:function(o){var a=new r;-1!==o.indexOf("\r\n")&&(o=o.replace(/\r\n/g,"\n")),-1!==o.indexOf("\\\n")&&(o=o.replace(/\\\n/g,""));for(var s=o.split("\n"),l="",u="",h=[],c="function"==typeof"".trimLeft,d=0,p=s.length;d<p;d++)if(l=s[d],0!==(l=c?l.trimLeft():l.trim()).length&&"#"!==(u=l.charAt(0)))if("v"===u){var f=l.split(/\s+/);switch(f[0]){case"v":a.vertices.push(parseFloat(f[1]),parseFloat(f[2]),parseFloat(f[3])),8===f.length&&a.colors.push(parseFloat(f[4]),parseFloat(f[5]),parseFloat(f[6]));break;case"vn":a.normals.push(parseFloat(f[1]),parseFloat(f[2]),parseFloat(f[3]));break;case"vt":a.uvs.push(parseFloat(f[1]),parseFloat(f[2]))}}else if("f"===u){for(var m=l.substr(1).trim().split(/\s+/),g=[],v=0,y=m.length;v<y;v++){var b=m[v];if(b.length>0){var w=b.split("/");g.push(w)}}var x=g[0];for(v=1,y=g.length-1;v<y;v++){var M=g[v],T=g[v+1];a.addFace(x[0],M[0],T[0],x[1],M[1],T[1],x[2],M[2],T[2])}}else if("l"===u){var S=l.substring(1).trim().split(" "),_=[],A=[];if(-1===l.indexOf("/"))_=S;else for(var P=0,C=S.length;P<C;P++){var E=S[P].split("/");""!==E[0]&&_.push(E[0]),""!==E[1]&&A.push(E[1])}a.addLineGeometry(_,A)}else if("p"===u){var D=l.substr(1).trim().split(" ");a.addPointGeometry(D)}else if(null!==(h=t.exec(l))){var L=(" "+h[0].substr(1).trim()).substr(1);a.startObject(L)}else if(i.test(l))a.object.startMaterial(l.substring(7).trim(),a.materialLibraries);else if(e.test(l))a.materialLibraries.push(l.substring(7).trim());else{if("s"!==u){if("\0"===l)continue;throw new Error('THREE.OBJLoader: Unexpected line: "'+l+'"')}if((h=l.split(" ")).length>1){var O=h[1].trim().toLowerCase();a.object.smooth="0"!==O&&"off"!==O}else a.object.smooth=!0;(q=a.object.currentMaterial())&&(q.smooth=a.object.smooth)}a.finalize();var I=new n.Group;I.materialLibraries=[].concat(a.materialLibraries);for(d=0,p=a.objects.length;d<p;d++){var R=a.objects[d],N=R.geometry,k=R.materials,F="Line"===N.type,B="Points"===N.type,z=!1;if(0!==N.vertices.length){var U=new n.BufferGeometry;U.addAttribute("position",new n.Float32BufferAttribute(N.vertices,3)),N.normals.length>0?U.addAttribute("normal",new n.Float32BufferAttribute(N.normals,3)):U.computeVertexNormals(),N.colors.length>0&&(z=!0,U.addAttribute("color",new n.Float32BufferAttribute(N.colors,3))),N.uvs.length>0&&U.addAttribute("uv",new n.Float32BufferAttribute(N.uvs,2));for(var V,j=[],H=0,G=k.length;H<G;H++){var W=k[H],q=void 0;if(null!==this.materials)if(q=this.materials.create(W.name),!F||!q||q instanceof n.LineBasicMaterial){if(B&&q&&!(q instanceof n.PointsMaterial)){var Y=new n.PointsMaterial({size:10,sizeAttenuation:!1});n.Material.prototype.copy.call(Y,q),Y.color.copy(q.color),Y.map=q.map,Y.lights=!1,q=Y}}else{var X=new n.LineBasicMaterial;n.Material.prototype.copy.call(X,q),X.color.copy(q.color),X.lights=!1,q=X}q||((q=F?new n.LineBasicMaterial:B?new n.PointsMaterial({size:1,sizeAttenuation:!1}):new n.MeshMatcapMaterial).name=W.name),q.flatShading=!W.smooth,q.vertexColors=z?n.VertexColors:n.NoColors,j.push(q)}if(j.length>1){for(H=0,G=k.length;H<G;H++){W=k[H];U.addGroup(W.groupStart,W.groupCount,H)}V=F?new n.LineSegments(U,j):B?new n.Points(U,j):new n.Mesh(U,j)}else V=F?new n.LineSegments(U,j[0]):B?new n.Points(U,j[0]):new n.Mesh(U,j[0]);V.name=R.name,I.add(V)}}return I}},o}()},function(t,e,i){"use strict";var n=i(0),r=i(126),o={Bip001_Neck:"Neck",Bip001_Spine:"Spine",Bip001_Spine1:"Spine1",Bip001_L_Clavicle:"LeftShoulder",Bip001_L_UpperArm:"LeftArm",Bip001_L_Forearm:"LeftForeArm",Bip001_L_Hand:"LeftHand",Bip001_L_Thigh:"LeftUpLeg",Bip001_L_Calf:"LeftLeg",Bip001_L_Foot:"LeftFoot",Bip001_R_Clavicle:"RightShoulder",Bip001_R_UpperArm:"RightArm",Bip001_R_Forearm:"RightForeArm",Bip001_R_Hand:"RightHand",Bip001_R_Thigh:"RightUpLeg",Bip001_R_Calf:"RightLeg",Bip001_R_Foot:"RightFoot",Neck:"Neck",Spine:"Spine",Spine1:"Spine1",LeftShoulder:"LeftShoulder",LeftArm:"LeftArm",LeftForeArm:"LeftForeArm",LeftHand:"LeftHand",LeftUpLeg:"LeftUpLeg",LeftLeg:"LeftLeg",LeftFoot:"LeftFoot",RightShoulder:"RightShoulder",RightArm:"RightArm",RightForeArm:"RightForeArm",RightHand:"RightHand",RightUpLeg:"RightUpLeg",RightLeg:"RightLeg",RightFoot:"RightFoot"};function a(t,e){this.model=t,this.mid=e,this.settingItem={}}a.prototype.init=function(){this.model.userData.is_save?(this.settingItem=this.model.userData.setting_item,this.restoreOfSettingItem(this.settingItem)):(this.settingItem=new r(this.mid,this.model.uuid),this.settingItem.position=this.model.position,this.settingItem.rotation=this.model.rotation,this.settingItem.scale=this.model.scale,this.model.userData.setting_item=this.settingItem),this.initUserData(this.model),this.initSkeletonHelper(this.model)},a.prototype.restoreOfSettingItem=function(t){this.model.position.copy(t.position),this.model.rotation.copy(t.rotation),this.model.scale.copy(t.scale),this.model.visible=t.isShow,t.position=this.model.position,t.rotation=this.model.rotation,t.scale=this.model.scale,t.headTop_center_position=(new n.Vector3).copy(t.headTop_center_position)},a.prototype.initUserData=function(t){t.userData.handle_choosed=!1,t.userData.follow_mouse=!1,t.userData.skeleton_helper=null,t.userData.skeleton_box=null,t.userData.transform_control=null,t.userData.setting_item=this.settingItem},a.prototype.initSkeletonHelper=function(t){if(!t.userData.skeleton_helper){var e=new n.SkeletonHelper(t);e.visible=!1,t.userData.skeleton_helper=e,G.render.scene.add(e),this.initBones2(e.bones)}},a.prototype.initBons=function(t){var e=this,i={};for(var r in this.settingItem.bones_rotation)i[r]=null;var a=t.children.filter((function(t){return"Hips"===t.name||"Bip001"===t.name}))[0],s=new n.Vector3(1,1,1);(.1>=100*a.scale.x||.1>=100*a.scale.y||.1>=100*a.scale.z)&&(s.x=10,s.y=10,s.z=10),a.traverse((function(n){var r=o[n.name];if(null===i[r]){if(i[r]=n,n.userData.current_scale=s,n.userData.rotation_default={x:n.rotation.x,y:n.rotation.y,z:n.rotation.z},t.userData.is_save){var a=t.userData.setting_item;n.rotation.copy(a.bones_rotation[r])}e.settingItem.bones_rotation[r]=n.rotation}})),t.userData.bones=i},a.prototype.initBones2=function(t){var e={};for(var i in this.settingItem.bones_rotation)e[i]=null;for(var n=0,r=t.length;n<r;++n){var a=t[n],s=o[a.name];if(void 0!==s&&null===e[s]){if(e[s]=a,a.userData.rotation_default={x:a.rotation.x,y:a.rotation.y,z:a.rotation.z},this.model.userData.is_save){var l=this.model.userData.setting_item;a.rotation.copy(l.bones_rotation[s])}this.settingItem.bones_rotation[s]=a.rotation}}this.model.userData.bones=e},a.prototype.initMatcap=function(){var t=this,e=new n.TextureLoader;return new Promise((function(i,n){e.load("model/texture/matcaps/matcap-porcelain-white.jpg",(function(e){e?(t.model.traverse((function(i){"SkinnedMesh"===i.type&&(i.userData.type="HumanSkin",i.material.matcap=e,i.material.color.setHex(t.settingItem.skin_color),i.skeleton.update()),"AmbientLight"===i.type&&t.model.remove(i)})),i(t.model)):n("add matcap error!")}))}))},t.exports=a},function(t,e,i){"use strict";var n=i(0);t.exports=function(t,e){this.mid=t,this.uuid=e,this.type="human",this.modelName="人体模型",this.raycaster=!1,this.isShow=!0,this.ground_clearance=0,this.geometric_scaling=!0,this.origin_skin_color="0x484DC2",this.origin_size={width:0,height:0,depth:0},this.origin_scale=new n.Vector3(1,1,1),this.origin_position=new n.Vector3,this.origin_rotation=new n.Euler,this.skin_color="0x484DC2",this.size={width:0,height:0,depth:0},this.scale=new n.Vector3,this.position=new n.Vector3,this.rotation=new n.Euler,this.collision=!1,this.bones_rotation={Neck:new n.Euler,Spine1:new n.Euler,LeftHand:new n.Euler,LeftArm:new n.Euler,LeftForeArm:new n.Euler,LeftFoot:new n.Euler,LeftUpLeg:new n.Euler,LeftLeg:new n.Euler,RightHand:new n.Euler,RightArm:new n.Euler,RightForeArm:new n.Euler,RightFoot:new n.Euler,RightUpLeg:new n.Euler,RightLeg:new n.Euler},this.timestamp=0,this.current_location_id="",this.headTop_center_position=new n.Vector3,this.headTop_center_screen_position={x:0,y:0},this.labelIsShow=!0,this.labelBlockView=!1}},function(t,e,i){"use strict";var n=i(0),r=(i(68),i(128));function o(t,e){this.id=e,this.model=t,this.settingItem=null}o.prototype.init=function(){this.model.userData.setting_item&&(this.settingItem=this.model.userData.setting_item,this.restoreOfSettingItem(this.settingItem)),void 0===this.model.userData.setting_item&&(this.settingItem=new r(this.id,this.model.uuid),this.settingItem.position=this.model.position,this.settingItem.rotation=this.model.rotation,this.settingItem.scale=this.model.scale),this.initUserData(this.model)},o.prototype.initUserData=function(t){t.userData.handle_choosed=!1,t.userData.follow_mouse=!1,t.userData.box_helper=null,t.userData.transform_control=null,t.userData.setting_item=this.settingItem},o.prototype.initMatcap=function(){var t=this;new n.TextureLoader;return new Promise((function(e,i){e(t.model)}))},o.prototype.restoreOfSettingItem=function(t){this.model.position.copy(t.position),this.model.rotation.copy(t.rotation),this.model.scale.copy(t.scale),this.model.visible=t.isShow,t.position=this.model.position,t.rotation=this.model.rotation,t.scale=this.model.scale},t.exports=o},function(t,e,i){"use strict";var n=i(0);t.exports=function(t,e){this.mid=t,this.uuid=e,this.type="weapon",this.modelName="凶器",this.raycaster=!1,this.isShow=!0,this.ground_clearance=0,this.geometric_scaling=!0,this.origin_skin_color="0xc3c3c3",this.origin_size={width:0,height:0,depth:0},this.origin_scale=new n.Vector3(1,1,1),this.origin_position=new n.Vector3,this.origin_rotation=new n.Euler,this.skin_color="0x999999",this.size={width:0,height:0,depth:0},this.scale=new n.Vector3,this.position=new n.Vector3,this.rotation=new n.Euler,this.collision=!1,this.timestamp=0,this.current_location_id=""}},function(t,e,i){"use strict";i(0);var n=i(130),r=i(131);function o(){this.model=new r,this._settingItem=null,this.defineProperty()}o.prototype.defineProperty=function(){Object.defineProperty(this,"settingItem",{get:function(){return this._settingItem},set:function(t){this._settingItem=t,this._settingItem.uuid=this.model.uuid,this.restoreOfSettingItem(this._settingItem)}})},o.prototype.init=function(t){return t?this.settingItem=t:(this._settingItem=new n(this.model.uuid),this._settingItem.position=this.model.position,this._settingItem.rotation=this.model.rotation),this.initUserData(this.model),this.model},o.prototype.initUserData=function(t){t.userData.handle_choosed=!1,t.userData.follow_mouse=!1,t.userData.box_helper=null,t.userData.transform_control=null,t.userData.face_group=null,t.userData.setting_item=this._settingItem},o.prototype.restoreOfSettingItem=function(t){this.model.position.copy(t.position),this.model.rotation.copy(t.rotation),this.model.visible=t.isShow,t.position=this.model.position,t.rotation=this.model.rotation,t.origin_position=this.model.position,t.origin_rotation=this.model.rotation,this.model.FOV=t.FOV,this.model.DISTANCE=t.DISTANCE},t.exports=o},function(t,e,i){"use strict";var n=i(0);t.exports=function(){this.type="camera",this.mid=1,this.uuid=null,this.modelName="摄像头",this.position=new n.Vector3,this.rotation=new n.Euler,this.FOV=0,this.DISTANCE=0,this.FOV_MIN=10,this.FOV_MAX=180,this.DISTANCE_MIN=300,this.DISTANCE_MAX=1e3,this.isShow=!0,this.origin_position=new n.Vector3,this.origin_rotation=new n.Euler,this.isBarrier=!1,this.isLabelShow=!0,this.labelPosition={x:0,y:0},this.labelPosition2={x:0,y:0},this.hasSpaceData=!1,this.directionDistanceType={axis_1_0_0:0,"axis_0_-1_0":0,"axis_0_0_-1":0},this.axleWireWidthDirectionRotate={axis_1_0_0:0,"axis_0_-1_0":0,"axis_0_0_-1":0},this.current_location_id=""}},function(t,e,i){"use strict";var n=i(0);function r(){n.Group.call(this),this._R=.025,this._H=.15,this._FOV=30,this._DISTANCE=300,this.segmentOfCone=320,this.userData.virtual_camera=null,this.userData.cone=null,this._visible=!0,this.init(),this.defineProperty()}r.prototype=Object.create(n.Group.prototype),r.prototype.defineProperty=function(){Object.defineProperty(this,"FOV",{get:function(){return this._FOV},set:function(t){this._FOV=t,this.update()}}),Object.defineProperty(this,"DISTANCE",{get:function(){return this._DISTANCE},set:function(t){this._DISTANCE=t,this.update()}})},r.prototype.init=function(){var t=new n.CylinderBufferGeometry(this._R,this._R,this._H,32),e=new n.MeshLambertMaterial({color:3355443,opacity:1,transparent:!0}),i=new n.Mesh(t,e);i.geometry.rotateX(Math.PI/2),i.name="VirtualCamera",this.userData.virtual_camera=i,this.add(i);var r=Math.tan(.5*this._FOV*Math.PI/180)*this._DISTANCE*.01,o=(t=new n.ConeGeometry(r,.01*this._DISTANCE,this.segmentOfCone),e=new n.MeshPhongMaterial({color:16776960,transparent:!0,opacity:0,depthWrite:!1,side:n.DoubleSide}),new n.Mesh(t,e));o.name="cone",o.rotateX(-Math.PI/2),o.geometry.translate(0,.01*-this._DISTANCE*.5-.5*this._H,0),this.userData.cone=o,this.add(o)},r.prototype.update=function(){var t=this.userData.cone;if(t){var e=Math.tan(.5*this._FOV*Math.PI/180)*this._DISTANCE*.01;t.geometry=new n.ConeGeometry(e,.01*this._DISTANCE,this.segmentOfCone),t.geometry.translate(0,.01*-this._DISTANCE*.5-.5*this._H,0)}},t.exports=r},function(t,e,i){"use strict";var n=i(0);t.exports=function(t){this.uuid=null,this.type=t,this.color="#ff0000",this.title="未命名",this.desc="",this.imgs=[],this.position=new n.Vector3(0,0,0),this.scale=new n.Vector3(1,1,1),this.fat=0,this.size={width:0,height:0},this.default_scale=new n.Vector3(1,1,1),this.default_color="#ff0000",this.default_fat=0,this.default_size={width:0,height:0},this.visible=!0,this.screenPosition={x:0,y:0},this.current_location_id="",this.size_slide_stop=null,this.distanceToScreenCenter=0}},function(t,e,i){"use strict";function n(t){this.player=t,this.sRender=t.sRender,this.humanModelControls=t.humanModelControls,this.weaponModelControls=t.weaponModelControls,this.postilControls=t.postilControls,this.virtualCameraFovControls=t.virtualCameraFovControls}n.prototype.resetPutModel=function(){this.humanModelControls.canbeUsed&&this.humanModelControls.restoreOriginSetting(),this.weaponModelControls.canbeUsed&&this.weaponModelControls.restoreOriginSetting(),this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.restoreOriginSetting()},n.prototype.showPutModel=function(t){this.humanModelControls.handleShowModel(t),this.weaponModelControls.handleShowModel(t),this.virtualCameraFovControls.handleShowModel(t)},n.prototype.showHumanModelBonesNode=function(){if(this.humanModelControls.canbeUsed&&this.humanModelControls.HUMANMODEL){var t=this.humanModelControls.HUMANMODEL;this.humanModelControls.initBonesNode(t),this.humanModelControls.destroyControl(t)}},n.prototype.showVirtualCameraMeasurement=function(t){var e=this.virtualCameraFovControls.putModelsOfKV[t];e&&this.virtualCameraFovControls.computeSpaceData(e,!0)},n.prototype.hideVirtualCameraMeasurement=function(t){var e=this.virtualCameraFovControls.putModelsOfKV[t];e&&this.virtualCameraFovControls.destroySpaceData(e)},n.prototype.bundleTranslateControlOfPutModel=function(){this.humanModelControls.canbeUsed&&this.humanModelControls.bundleControlOfTranslate(),this.weaponModelControls.canbeUsed&&this.weaponModelControls.bundleControlOfTranslate(),this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.bundleControlOfTranslate()},n.prototype.bundleRotateControlOfPutModel=function(){this.humanModelControls.canbeUsed&&this.humanModelControls.bundleControlOfRotate(),this.weaponModelControls.canbeUsed&&this.weaponModelControls.bundleControlOfRotate(),this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.bundleControlOfRotate()},n.prototype.handleClickModelItem=function(t){var e=this.humanModelControls.putModelsOfHumanKV[t],i=this.weaponModelControls.WEAPONS_KV[t],n=this.virtualCameraFovControls.putModelsOfKV[t],r=e||i||n;if(r)var o=r.userData.setting_item.current_location_id;this.player.flyToPano({pano:this.player.model.panos.index[o],lookAtPoint:r.position,duration:360},(function(t){}))},n.prototype.handleClickCompleteBtn=function(){this.humanModelControls.canbeUsed&&this.humanModelControls.handleComplete(),this.weaponModelControls.canbeUsed&&this.weaponModelControls.handleComplete(),this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.handleComplete()},n.prototype.onIntoEditMode=function(){this.humanModelControls.canbeUsed&&(this.humanModelControls.canbeSelect=!1,this.humanModelControls.handleShowCurrentModel()),this.weaponModelControls.canbeUsed&&(this.weaponModelControls._canbeSelect=!1,this.weaponModelControls.handleShowCurrentModel()),this.virtualCameraFovControls.canbeUsed&&(this.virtualCameraFovControls._canbeSelect=!1,this.virtualCameraFovControls.handleShowCurrentCamera())},n.prototype.onQuitEditMode=function(){this.humanModelControls.canbeUsed&&(this.humanModelControls.canbeSelect=!1,this.humanModelControls.handleHideCurrentModel()),this.weaponModelControls.canbeUsed&&(this.weaponModelControls._canbeSelect=!1,this.weaponModelControls.handleHideCurrentModel()),this.virtualCameraFovControls.canbeUsed&&(this.virtualCameraFovControls._canbeSelect=!1,this.virtualCameraFovControls.handleHideCurrentCamera())},n.prototype.onIntoPutMode=function(){this.humanModelControls.canbeUsed&&(this.humanModelControls.canbeSelect=!0),this.weaponModelControls.canbeUsed&&(this.weaponModelControls._canbeSelect=!0),this.virtualCameraFovControls.canbeUsed&&(this.virtualCameraFovControls._canbeSelect=!0)},n.prototype.onQuitPutMode=function(){this.humanModelControls.canbeUsed&&(this.humanModelControls.canbeSelect=!1,this.humanModelControls.destroyInvalidModelControl()),this.weaponModelControls.canbeUsed&&(this.weaponModelControls._canbeSelect=!1,this.weaponModelControls.destroyModelChoosedState()),this.virtualCameraFovControls.canbeUsed&&(this.virtualCameraFovControls._canbeSelect=!1,this.virtualCameraFovControls.destroyModelControlState())},n.prototype.onVirtualSetSlideStop=function(t){switch(t){case"camera-fov":this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.onCameraFovSlideStop();break;case"camera-distance":this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.onCameraDistanceSlideStop();break;default:this.humanModelControls.canbeUsed&&(this.humanModelControls.needUpdateSkeletonBox=!0,this.humanModelControls.updateSetToolsAndControlPosition()),this.weaponModelControls.canbeUsed&&this.weaponModelControls.updateSetToolsAndControlPosition()}},n.prototype.updatePutModelName=function(t){this.humanModelControls.canbeUsed&&this.humanModelControls.updateModelName(t),this.weaponModelControls.canbeUsed&&this.weaponModelControls.updateModelName(t),this.virtualCameraFovControls.canbeUsed&&this.virtualCameraFovControls.updateModelName(t)},n.prototype.updateSizeOfPutModel=function(t){this.humanModelControls.canbeUsed&&this.humanModelControls.updateSize(t),this.weaponModelControls.canbeUsed&&this.weaponModelControls.updateSize(t)},n.prototype.updateModelGroundClearance=function(t){this.humanModelControls.canbeUsed&&this.humanModelControls.updateModelGroundClearance(t),this.weaponModelControls.canbeUsed&&this.weaponModelControls.updateModelGroundClearance(t)},n.prototype.updateCollision=function(t){this.humanModelControls.canbeUsed&&this.humanModelControls.HUMANMODEL&&(this.humanModelControls.collision=t),this.weaponModelControls.canbeUsed&&this.weaponModelControls.CONTROLMODEL&&(this.weaponModelControls.collision=t)},n.prototype.updatePostilInfo=function(t){this.postilControls.canbeUsed&&this.postilControls.updatePostilInfo(t)},t.exports=n},function(t,e,i){"use strict";var n=i(0),r=i(9),o=i(13),a=i(40)(n),s=i(4).EventEmitter,l=(new n.TextureLoader).load("images/bone_node_default_2x.png"),u=(new n.TextureLoader).load("images/bone_node_choosed_2x.png"),h=(i(135),i(41));function c(t){this._canbeUsed=!1,this._canbeChoosed=!0,this._canbeSelect=!0,this._needUpdateSkeletonBox=!1,this._collision=!1,this.player=t,this.sRender=t.sRender,this.mouse=new n.Vector3,this.raycaster=new n.Raycaster,this.raycaster2=new n.Raycaster,this.putModelsOfHuman=[],this.putModelsOfHumanKV={},this.HUMANMODEL=null,this.INTERSECTS_SKIN=null,this.BONENODE=null,this.boneNodes=[],this.controls=[],this.viewMode={transitioning:!1,panorama:!1},this.currentColliders=[],this._box_top_center=new n.Vector3,this.collision_d=.05,this.modelControlChange=!1,this.boneControlChange=!1,this.locationId=null,this.eye=new n.Vector3,this.unitY=new n.Vector3(0,1,0),this.emitter=new s,this.defineProperty(),this.initStateEngine()}c.prototype.defineProperty=function(){Object.defineProperty(this,"canbeUsed",{get:function(){return this._canbeUsed},set:function(t){this._canbeUsed=t}}),Object.defineProperty(this,"canbeSelect",{get:function(){return this._canbeSelect},set:function(t){this._canbeSelect=t}}),Object.defineProperty(this,"collision",{get:function(){return this._collision},set:function(t){this._collision=t,this.HUMANMODEL.userData.setting_item.collision=t;var e=this.HUMANMODEL.userData.transform_control;if(e)for(var i in e.MOVELOCK)e.MOVELOCK[i].state=!1}}),Object.defineProperty(this,"box_top_center",{get:function(){return this._box_top_center},set:function(t){this._box_top_center=t}}),Object.defineProperty(this,"needUpdateSkeletonBox",{get:function(){return this._needUpdateSkeletonBox},set:function(t){t&&this.HUMANMODEL&&this.updateSkeletonBox(this.HUMANMODEL)}})},c.prototype.initStateEngine=function(){this.MouseStateEngine={mouseMoveIn:{state:!1,callback:this.handleMouseMoveInVirtualHuman.bind(this)},mouseMoveOut:{state:!1,callback:this.handleMouseMoveOutVirtualHuman.bind(this)}},this.MouseStateEngineTranstion={mouseMoveIn:{mouseMoveOut:function(){this.MouseStateEngine.mouseMoveIn.state&&(this.MouseStateEngine.mouseMoveIn.state=!1,this.MouseStateEngine.mouseMoveOut.state=!0,this.MouseStateEngine.mouseMoveOut.callback())}.bind(this)}}},c.prototype.init=function(t){if(this.HUMANMODEL){if(this.HUMANMODEL.uuid===t.uuid)return;this.destroyInvalidModelControl()}this.HUMANMODEL=t,this.initSkeletonBox(this.HUMANMODEL),this.bundleControlOfTranslate();var e=t.userData.setting_item,i=t.userData.skeleton_box;this.updateSetToolsPosition(i),this.player.emit("choosedHumanModel",e),this.player.emit("showPutModelSetTools","human")},c.prototype.initBonesNode=function(t){if(0<this.boneNodes.length)this.handleSwitchBonesNodeVisible(!0);else{var e=t.userData.bones;for(var i in e){var r=e[i],o=new n.SpriteMaterial({map:l,side:n.DoubleSide,transparent:!0,depthTest:!1}),a=new n.Sprite(o),s=r.localToWorld(r.position.clone().applyMatrix4(r.matrixWorld));a.scale.divideScalar(22),a.position.copy(s),a.userData.type="BoneNode",a.userData.mouse_hover=!1,a.userData.handle_choosed=!1,a.userData.bundle_bone=r,this.sRender.scene.add(a),this.boneNodes[this.boneNodes.length]=a}}},c.prototype.initSkeletonHelper=function(t){if(!t.userData.skeleton_helper){var e=new n.SkeletonHelper(t);e.visible=!1,t.userData.skeleton_helper=e,this.sRender.scene.add(e)}},c.prototype.initSkeletonBox=function(t){if(!t.userData.skeleton_box){var e=t.userData.skeleton_helper,i=new n.BoxHelper(e,5756395);i.visible=!1,i.geometry.computeBoundingBox(),i.userData.out_screen=!1,t.userData.skeleton_box=i,this.sRender.scene.add(i),this.initBoundingCube(i)}},c.prototype.initBoundingCube=function(t){t.geometry.computeBoundingBox();var e=this.HUMANMODEL.userData.box_helper_fatline;e&&(this.sRender.scene.remove(e),e.traverse((function(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()})));var i=o.drawBoxHelperOfLine2(t,5756395,this.sRender.renderer.domElement);this.sRender.scene.add(i),this.HUMANMODEL.userData.box_helper_fatline=i;var r=t.geometry.boundingBox,a=r.getSize(new n.Vector3),s=r.getCenter(new n.Vector3),l=this.HUMANMODEL.userData.box_cube;if(l)return l.geometry=new n.BoxGeometry(a.x,a.y,a.z,2,2,2),void l.position.copy(s);var u=new n.BoxGeometry(a.x,a.y,a.z,2,2,2),h=new n.MeshBasicMaterial({color:65280,transparent:!0,opacity:0,depthTest:!0,depthWrite:!1}),c=new n.Mesh(u,h);c.position.copy(s),this.HUMANMODEL.userData.box_cube=c,this.sRender.scene.add(c)},c.prototype.initFilterSphere=function(t){var e=this.HUMANMODEL.userData.filter_sphere;t.geometry.computeBoundingSphere();var i=t.geometry.boundingSphere,r=i.center;if(e)return e.geometry.copy(new n.SphereBufferGeometry(i.radius,32,32)),void e.position.copy(r);var o=new n.SphereBufferGeometry(i.radius,32,32),a=new n.MeshBasicMaterial({color:13421772,transparent:!0,opacity:.2,depthWrite:!1}),s=new n.Mesh(o,a);s.position.copy(r),s.userData.radius=i.radius,this.HUMANMODEL.userData.filter_sphere=s,this.sRender.scene.add(s)},c.prototype.bundleControlOfModel=function(t,e){if(t.userData.transform_control)return(i=t.userData.transform_control).setMode(e),void this.destroyBoneNodes();var i,n=this,r=t.userData.skeleton_box;(i=new a(this.sRender.camera,this.sRender.renderer.domElement)).attach(t),i.setMode(e),i.setSize(.5),this.updateControlPosition(i,r),i.addEventListener("objectChange",(function(t){n.modelControlChange=!0,n.needUpdateSkeletonBox=!0,n.player.emit("hidePutModelSetTools"),n.updateGroudClearance(),"translate"===this.getMode()&&n.updateControlPosition(i,r)})),i.addEventListener("mouseDown",(function(t){i.MOVELOCK[i.axis].state=!1})),i.addEventListener("mouseUp",(function(e){if(n.modelControlChange=!1,n.updateSetToolsPosition(r),n.player.emit("showPutModelSetTools","human"),"rotate"===this.getMode()&&n.updateControlPosition(i,r),n._collision){var o=n.computeContainsPoint(t,n.currentColliders);0<o.length&&n.computeCrash_2(o)}})),t.userData.transform_control=i,this.sRender.scene.add(i),this.controls.push(i),this.destroyBoneNodes()},c.prototype.bundleControlOfBone=function(t){var e=this,i=new a(this.sRender.camera,this.sRender.renderer.domElement);i.attach(t),i.setMode("rotate"),i.setSize(.5),i.addEventListener("objectChange",(function(t){e.boneControlChange=!0,e.needUpdateSkeletonBox=!0,e.handleSwitchBonesNodeVisible(!0)})),i.addEventListener("mouseDown",(function(t){i.MOVELOCK[i.axis].state=!1})),i.addEventListener("mouseUp",(function(t){e.boneControlChange=!1})),t.userData.transform_control=i,this.sRender.scene.add(i),this.controls.push(i)},c.prototype.bundleControlOfTranslate=function(){this.HUMANMODEL&&this.bundleControlOfModel(this.HUMANMODEL,"translate")},c.prototype.bundleControlOfRotate=function(){this.HUMANMODEL&&this.bundleControlOfModel(this.HUMANMODEL,"rotate")},c.prototype.onHandleControlPanoramaMove=function(){this._canbeChoosed=!1,this.INTERSECTS_SKIN&&(this.INTERSECTS_SKIN=null),this.HUMANMODEL&&!this.HUMANMODEL.userData.follow_mouse&&this.player.emit("hidePutModelSetTools"),this.pickedObject&&!this.pickedObject.parent.userData.handle_choosed&&this.MouseStateEngine.mouseMoveIn.state&&this.updateLabelPosition(this.pickedObject.parent)},c.prototype.onHandleControlTtagsMove=function(){this.player.emit("hide-virtual-human-info"),this.HUMANMODEL&&!this.HUMANMODEL.userData.follow_mouse&&this.player.emit("hidePutModelSetTools")},c.prototype.onHandleControlPanoramaMoveStop=function(){if(this.HUMANMODEL&&!this.HUMANMODEL.userData.follow_mouse){var t=this.HUMANMODEL.userData.skeleton_box,e=!this.modelControlChange,i=!this.boneControlChange,n=!t.userData.out_screen;e&&i&&n&&(this.updateSetToolsPosition(t),this.player.emit("showPutModelSetTools","human"))}},c.prototype.onHandleControlDollhouseMove=function(){},c.prototype.onHandleControlDollhouseMoveStop=function(){},c.prototype.onFlyEnd=function(){},c.prototype.onIntoPanorama=function(){0<this.putModelsOfHuman.length&&this.player.emit("showModelListPanel")},c.prototype.onIntoDollhouse=function(){},c.prototype.onIntoTransitioning=function(){this.destroyInvalidModelControl()},c.prototype.getOriginModelInfo=function(t){var e=t.userData.setting_item,i=t.userData.skeleton_box;i.geometry.computeBoundingBox(),e.timestamp=(new Date).getTime();var r=i.geometry.boundingBox.getSize(new n.Vector3),o=1e3*r.x.toFixed(3),a=1e3*r.y.toFixed(3),s=1e3*r.z.toFixed(3);0===e.origin_size.width&&0===e.origin_size.height&&0===e.origin_size.depth&&(e.origin_size={width:o,height:a,depth:s}),e.size={width:o,height:a,depth:s},e.origin_position.copy(t.position.clone()),e.origin_rotation.copy(t.rotation.clone()),e.origin_scale.copy(t.scale.clone())},c.prototype.getHeadTopPosition=function(t){for(var e=t.userData.skeleton_helper.bones,i=["Bip001_HeadNub","head_end"],r=null,o=0;o<e.length;++o){var a=e[o],s=a.name;if(-1!==i.indexOf(s)){r=a;break}}return r?r.localToWorld(r.position.clone().applyMatrix4(r.matrixWorld)).clone():new n.Vector3},c.prototype.destroySkeletonBox=function(t){if(t.userData.skeleton_box){var e=t.userData.skeleton_box;this.sRender.scene.remove(e),e.geometry.dispose(),e.material.dispose(),t.userData.skeleton_box=null}if(t.userData.box_helper_fatline){var i=t.userData.box_helper_fatline;this.sRender.scene.remove(i),i.traverse((function(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()})),t.userData.box_helper_fatline=null}},c.prototype.destroySkeletonHelper=function(t){if(t.userData.skeleton_helper){var e=t.userData.skeleton_helper;this.sRender.scene.remove(e),e.geometry.dispose(),e.material.dispose(),t.userData.skeleton_helper=null}},c.prototype.destroyBoneNodes=function(){if(this.BONENODE){var t=this.BONENODE.userData.bundle_bone;this.destroyControl(t),this.BONENODE=null}for(var e=0,i=this.boneNodes.length;e<i;++e){var n=this.boneNodes[e];this.sRender.scene.remove(n),n.geometry.dispose(),n.material.dispose()}this.boneNodes=[]},c.prototype.destroyControl=function(t){if(t.userData.transform_control){var e=t.userData.transform_control;t.userData.transform_control=null,e.dispose(),e.detach(),this.sRender.scene.remove(e),this.BONENODE=null}},c.prototype.destroyInvalidModelControl=function(t){(t=t||this.HUMANMODEL)&&(this.destroySkeletonBox(t),this.destroyControl(t),t.userData.handle_choosed=!1,this.HUMANMODEL=null,this.emitter.emit("human-unchoosed"),this.INTERSECTS_SKIN&&(this.INTERSECTS_SKIN=null),this.destroyBoneNodes(),this.player.emit("hidePutModelSetTools"),this.player.emit("hidePutModelInfoPanel"))},c.prototype.destroyModelFromScene=function(t){this.sRender.scene.remove(t),t.traverse((function(t){t.material&&t.material.dispose(),t.geometry&&t.geometry.dispose()}))},c.prototype.destroyLabel=function(t){t.geometry.dispose(),t.material.dispose(),this.sRender.scene.remove(t)},c.prototype.handlePutModel=function(t){t.userData.follow_mouse=!1;var e=t.userData.setting_item;""===e.current_location_id&&(e.current_location_id=this.locationId),this.putModelsOfHuman.push(t),this.putModelsOfHumanKV[t.uuid]=t,this.HUMANMODEL=null,this.getOriginModelInfo(t),this.destroySkeletonBox(t),this.player.emit("addModelListItem",t.userData.setting_item),this.emitter.emit("human-put-over")},c.prototype.handleKeyOfEsc=function(){if(this.HUMANMODEL&&this.HUMANMODEL.userData.follow_mouse){var t=this.HUMANMODEL;this.destroyInvalidModelControl(t),this.destroyModelFromScene(t),this.player.emit("deletePutModelSuccess",t.uuid),this.emitter.emit("human-put-cancel")}},c.prototype.handleMouseLeftButtonDown=function(){if(!1!==h.canbeChoosedOfMode3D||"panorama"===this.player.mode){if(this._canbeChoosed=!0,0<this.putModelsOfHuman.length){if(this.HUMANMODEL&&this.HUMANMODEL.userData.follow_mouse)return;this._canbeSelect&&this.handleSelectModel()}if(0<this.boneNodes.length){if(this.HUMANMODEL&&this.HUMANMODEL.userData.follow_mouse)return;this.handleSelectBoneNode()}}},c.prototype.handleMouseLeftButtonUp=function(){this._canbeChoosed&&(this.BONENODE&&this.handleChoosedBoneNode(this.BONENODE),this.INTERSECTS_SKIN&&(this.player.weaponModelControls.destroyModelChoosedState(),this.player.virtualCameraFovControls.destroyModelControlState(),this.handleChoosedModel(this.INTERSECTS_SKIN.parent)))},c.prototype.handleMouseRightButtonDown=function(){},c.prototype.handleMouseRightButtonUp=function(){this.HUMANMODEL&&this.HUMANMODEL.userData.follow_mouse&&this.handlePutModel(this.HUMANMODEL)},c.prototype.handleSelectModel=function(){this.raycaster.setFromCamera(this.mouse,this.sRender.camera);var t=this.raycaster.intersectObjects(this.putModelsOfHuman,!0);if(0<t.length){var e=t[0],i=e.object;"SkinnedMesh"===e.object.type&&(this.INTERSECTS_SKIN=i,this.player.disableNavigator=!0)}},c.prototype.handleSelectBoneNode=function(){this.raycaster.setFromCamera(this.mouse,this.sRender.camera);var t=this.raycaster.intersectObjects(this.boneNodes);if(0<t.length){this.player.disableNavigator=!0;var e=t[0];if(this.BONENODE&&this.BONENODE.uuid!==e.object.uuid){this.BONENODE.userData.handle_choosed=!1,this.BONENODE.material.map=l,this.BONENODE.scale.divideScalar(1.5);var i=this.BONENODE.userData.bundle_bone;this.destroyControl(i)}this.BONENODE=e.object}},c.prototype.handleChoosedBoneNode=function(){var t=this.BONENODE.userData.bundle_bone;t.userData.transform_control||(this.BONENODE.userData.handle_choosed=!0,this.BONENODE.material.map=u,this.BONENODE.scale.multiplyScalar(1.5),this.bundleControlOfBone(t))},c.prototype.handleHumanModelFollowMouse=function(t,e){t.position.copy(e),this.emitter.emit("human-follow-mouse")},c.prototype.handleChoosedModel=function(t){if(t.visible){t.userData.handle_choosed=!0;var e=t.userData.setting_item;this._collision=e.collision,this.init(t),this.emitter.emit("human-handle-choosed")}},c.prototype.handleDeleteHumanModel=function(t){if(this.putModelsOfHumanKV[t]){var e=this.putModelsOfHumanKV[t];e.userData.handle_choosed&&(this.destroyInvalidModelControl(e),this.player.emit("hidePutModelSetTools"),this.player.emit("hidePutModelInfoPanel")),this.destroyModelFromScene(e),this.putModelsOfHuman.splice(this.putModelsOfHuman.indexOf(e),1),delete this.putModelsOfHumanKV[t],this.player.emit("deletePutModelSuccess",t),0===this.putModelsOfHuman.length&&0===this.player.weaponModelControls.WEAPONS_SCENE.length&&0===this.player.virtualCameraFovControls.putModels.length&&this.player.emit("hideModelListPanel")}},c.prototype.handleHideHumanModel=function(t){if(this.putModelsOfHumanKV[t]){var e=this.putModelsOfHumanKV[t],i=e.userData.setting_item;i.isShow=!1,e.visible=i.isShow,e.userData.handle_choosed&&(this.destroyInvalidModelControl(e),this.player.emit("hidePutModelSetTools"))}},c.prototype.handleShowModel=function(t){if(this.putModelsOfHumanKV[t]){var e=this.putModelsOfHumanKV[t],i=e.userData.setting_item;i.isShow=!0,e.visible=i.isShow}},c.prototype.handleShowCurrentModel=function(){for(var t=0,e=this.putModelsOfHuman.length;t<e;++t){var i=this.putModelsOfHuman[t];!0!==i.userData.is_save&&(i.visible=!0)}},c.prototype.handleHideCurrentModel=function(){for(var t=0,e=this.putModelsOfHuman.length;t<e;++t){var i=this.putModelsOfHuman[t];!0!==i.userData.is_save&&(i.visible=!1),i.userData.handle_choosed&&(this.destroyInvalidModelControl(i),this.player.emit("hidePutModelSetTools"))}},c.prototype.handleSwitchHumanLabelVisible=function(t,e){t.userData.setting_item.labelIsShow=e},c.prototype.handleSwitchSaveModelVisible=function(t){for(var e=0,i=this.putModelsOfHuman.length;e<i;++e){var n=this.putModelsOfHuman[e];n.userData.is_save&&(n.visible=t,!1===t&&n.userData.handle_choosed&&(this.destroyInvalidModelControl(n),this.player.emit("hidePutModelSetTools")))}},c.prototype.handleSwitchBonesNodeVisible=function(t){for(var e=0,i=this.boneNodes.length;e<i;++e){var n=this.boneNodes[e],r=n.userData.bundle_bone,o=r.localToWorld(r.position.clone().applyMatrix4(r.matrixWorld));n.position.copy(o),n.visible=t}},c.prototype.handleMouseMoveInVirtualHuman=function(t){document.body.style.cursor="pointer",this.emitter.emit("human-mouse-in");var e=t.parent,i=e.userData.setting_item,n=this.getHeadTopPosition(e);i.headTop_center_position=n,i.headTop_center_screen_position=r.convertWorldPositionToScreen(n,this.sRender.camera),this.player.emit("show-virtual-human-info",i)},c.prototype.handleMouseMoveOutVirtualHuman=function(){document.body.style.cursor="",this.emitter.emit("human-mouse-out"),this.player.emit("hide-virtual-human-info")},c.prototype.handleMouseMove=function(){if(this.mouse.copy(this.player.mouse),this.HUMANMODEL&&this.HUMANMODEL.userData.follow_mouse&&(this.handleHumanModelFollowMouse(this.HUMANMODEL,this.player.intersect.point),this.needUpdateSkeletonBox=!0),0<this.putModelsOfHuman.length){var t=this.putModelsOfHuman.filter((function(t){return!1===t.userData.handle_choosed}));0<t.length&&this.handlePickupVirtualHuman(t)}},c.prototype.handlePickupVirtualHuman=function(t){this.raycaster.setFromCamera(this.mouse,this.sRender.camera);var e=this.raycaster.intersectObjects(t,!0);if(0<e.length){var i=e[0].object;"SkinnedMesh"===i.type?(this.pickedObject=i,this.MouseStateEngine.mouseMoveIn.state=!0,this.MouseStateEngine.mouseMoveIn.callback(i)):this.MouseStateEngineTranstion.mouseMoveIn.mouseMoveOut()}else this.MouseStateEngineTranstion.mouseMoveIn.mouseMoveOut()},c.prototype.handleComplete=function(){this.destroyInvalidModelControl()},c.prototype.restoreOriginPose=function(t){var e=t.userData.bones,i=t.userData.setting_item;for(var r in e){var o=e[r],a=o.userData.rotation_default,s=new n.Euler(a.x,a.y,a.z,"XYZ"),l=new n.Quaternion;l.setFromEuler(s),o.quaternion.copy(l.clone())}var u=i.origin_rotation,h=new n.Euler(u.x,u.y,u.z,"XYZ"),c=new n.Quaternion;c.setFromEuler(h),t.quaternion.copy(c.clone())},c.prototype.restoreOriginSetting=function(){if(this.HUMANMODEL){var t=this,e=this.HUMANMODEL,i=e.userData.setting_item,n=e.userData.skeleton_box,r=e.userData.transform_control;if(e.position.y=i.origin_position.y,i.ground_clearance=0,e.scale.copy(i.origin_scale),i.size.width=i.origin_size.width,i.size.height=i.origin_size.height,i.size.depth=i.origin_size.depth,this.updateSkinColor({hex:i.origin_skin_color}),this.restoreOriginPose(e),r)var o=setTimeout((function(){t.needUpdateSkeletonBox=!0,t.updateControlPosition(r,n),t.updateSetToolsPosition(n),clearTimeout(o)}),100);this.player.emit("resetPutModelInfo",i)}},c.prototype.computeContainsPoint=function(t,e){for(var i=t.userData.skeleton_box,n=(t.userData.box_cube.geometry.vertices,i.geometry.boundingSphere.center),r=[],o=0,a=e.length;o<a;++o){var s=e[o];s.geometry.boundingBox.containsPoint(n)&&r.push(s)}return r};var d=null,p=null,f=null;c.prototype.computeCrash_2=function(t){var e=this,i=this.HUMANMODEL,o=i.userData.transform_control;i.userData.box_cube;i.userData.skeleton_box&&function a(s){var l=i.userData.skeleton_box,u=r.getVerticesOfItemSize(l.geometry);l.geometry.computeBoundingBox();for(var h=l.geometry.boundingBox.getCenter(new n.Vector3),c=new n.Vector3,m=0,g=0;g<u.length;++g){var v=u[g].applyMatrix4(l.matrix);c.subVectors(v,h).normalize();var y=new n.Raycaster(h,c).intersectObjects(t);if(0<y.length){var b=y[0],w=b.object,x=(b.point,b.distance),M=b.face.normal;x<c.length()&&(m=1,o.axis&&(p=o.axis,o.MOVELOCK[p].state=!0),null===d&&(d=(new n.Vector3).subVectors(M.applyMatrix4(w.matrixWorld),w.position).normalize()))}}1===m&&(null===f&&(f=(new Date).getTime()),i.position.add(d.clone().divideScalar(100)),e.needUpdateSkeletonBox=!0,2e3>(new Date).getTime()-f?requestAnimationFrame(a):(d=null,f=null,o.MOVELOCK[p].state=!1,e.updateControlPosition(o,l)));0===m&&p&&(d=null,o.MOVELOCK[p].state=!1,e.updateControlPosition(o,l))}()},c.prototype.computeHumanLabelVisible=function(t,e){if(0<this.putModelsOfHuman.length)for(var i=0,r=this.putModelsOfHuman.length;i<r;++i){var o=this.putModelsOfHuman[i].userData.setting_item,a=o.headTop_center_position.clone(),s=new n.Vector3;s.subVectors(t.position,a).normalize(),this.raycaster2.set(a,s,1);var l=this.raycaster2.intersectObjects(e);if(0<l.length)l[0].distance<a.distanceTo(t.position)?o.labelBlockView=!0:o.labelBlockView=!1;else o.labelBlockView=!1}},c.prototype.updateControlOfMode=function(t){if(this.HUMANMODEL){var e=this.HUMANMODEL.userData.transform_control;e?e.setMode(t):this.bundleControlOfModel(this.HUMANMODEL,t)}},c.prototype.updateSkeletonBox=function(t){var e=t.userData.skeleton_box,i=t.userData.setting_item;e.update(),e.geometry.computeBoundingBox();var n=this.getHeadTopPosition(t);i.headTop_center_position=n,i.headTop_center_screen_position=r.convertWorldPositionToScreen(n,this.sRender.camera),this.initBoundingCube(e)},c.prototype.updateControls=function(){for(var t=0;t<this.controls.length;++t)this.controls[t].update()},c.prototype.updateBoneNodesDirection=function(){for(var t=0;t<this.boneNodes.length;++t)this.boneNodes[t].lookAt(this.sRender.camera.position)},c.prototype.updateControlPosition=function(t,e){e.geometry.computeBoundingBox();var i=e.geometry.boundingBox,r=i.getCenter(new n.Vector3),o=i.getSize(new n.Vector3),a=new n.Vector3(r.x,r.y-.5*o.y,r.z);t.currentWorldPosition.copy(a)},c.prototype.updateSkinColor=function(t){var e=this.HUMANMODEL;e.traverse((function(e){"SkinnedMesh"===e.type&&e.material.color.setHex(t.hex)})),e.userData.setting_item.skin_color=t.hex},c.prototype.updateModelName=function(t){this.HUMANMODEL&&(this.HUMANMODEL.userData.setting_item.modelName=t)},c.prototype.updateSetToolsPosition=function(t){t.geometry.computeBoundingBox();for(var e=r.getVerticesOfItemSize(t.geometry),i={},n={},o=[],a=[],s=0;s<e.length;++s){var l=e[s].clone();if(!r.computeWorldPositionOutCamera(l,this.sRender.camera)){var u=r.convertWorldPositionToScreen(l,this.sRender.camera);o.push(u.x),a.push(u.y),i["k_"+u.x]=u,n["k_"+u.y]=u}}var h=i["k_"+Math.max.apply(null,o)];this.player.emit("setPutModelToolsPosition",h)},c.prototype.updateGroudClearance=function(){if(this.HUMANMODEL){var t=this.HUMANMODEL,e=t.userData.setting_item,i=e.origin_position,n=100*(t.position.clone().y-i.y);e.ground_clearance=n,this.player.emit("resetPutModelInfo",e)}},c.prototype.updateModelGroundClearance=function(t){if(this.HUMANMODEL){var e=this.HUMANMODEL,i=e.userData.setting_item;e.position.y=i.origin_position.y+.01*t,i.ground_clearance=t;var n=e.userData.transform_control,r=e.userData.skeleton_box;this.needUpdateSkeletonBox=!0,this.updateSetToolsPosition(r),n&&this.updateControlPosition(n,r)}},c.prototype.updateSize=function(t){if(this.HUMANMODEL){var e=this.HUMANMODEL,i=e.userData.setting_item,n=e.userData.transform_control,r=i.origin_size,o=i.origin_scale,a=o.x/r.width,s=o.y/r.height,l=o.z/r.depth,u=t.width*a,h=t.height*s,c=t.depth*l;e.scale.set(u,h,c),i.scale=e.scale,i.size={width:u*r.width,height:h*r.height,depth:c*r.depth},this.needUpdateSkeletonBox=!0;var d=e.userData.skeleton_box;this.updateSetToolsPosition(d),n&&this.updateControlPosition(n,d)}},c.prototype.updateSetToolsAndControlPosition=function(){if(this.HUMANMODEL){var t=this.HUMANMODEL,e=t.userData.skeleton_box,i=t.userData.transform_control;this.updateSetToolsPosition(e),this.player.emit("showPutModelSetTools","human"),i&&e&&this.updateControlPosition(i,e)}},c.prototype.updateBoxHelperIsOutScrren=function(t){if("panorama"===this.player.mode){for(var e=r.getVerticesOfItemSize(t.geometry),i={},n=0,o=e.length;n<o;++n){var a=e[n],s=a.applyMatrix4(this.sRender.camera.matrixWorldInverse).applyMatrix4(this.sRender.camera.projectionMatrix),l=Math.abs(s.x)>1,u=Math.abs(s.y)>1,h=Math.abs(s.z)>1;(l||u||h)&&(1,i["k_"+n]=a)}e.length===Object.keys(i).length?(this.player.emit("hidePutModelSetTools"),t.userData.out_screen=!0):t.userData.out_screen=!1}},c.prototype.updateLabelPosition=function(t){if(t){var e=t.userData.setting_item,i=this.getHeadTopPosition(t);e.headTop_center_position=i,e.headTop_center_screen_position=r.convertWorldPositionToScreen(i,this.sRender.camera),this.player.emit("show-virtual-human-info",e)}},c.prototype.updateHumanLabel=function(t){for(var e=0,i=t.length;e<i;++e){var n=t[e],o=n.userData.setting_item;o.headTop_center_screen_position=r.convertWorldPositionToScreen(o.headTop_center_position,this.sRender.camera),r.computeWorldPositionOutCamera(o.headTop_center_position,this.sRender.camera)?o.labelIsShow=!1:o.labelIsShow=!0,n.visible||(o.labelIsShow=!1)}},c.prototype.update=function(){if(0<this.controls.length&&this.updateControls(),this.player&&(this.player.currentPano&&this.player.currentPano.id&&(this.locationId=this.player.currentPano.id),0===this.currentColliders.length&&(this.currentColliders=this.player.model.floors.reduce((function(t,e){return e.hidden?t:t.concat(e.collider.children)}),[]))),this.HUMANMODEL){var t=this.HUMANMODEL.userData;t.handle_choosed&&this.updateBoxHelperIsOutScrren(t.skeleton_box)}},t.exports=c},function(t,e,i){"use strict";var n=i(0),r=i(13);function o(t){n.Sprite.call(this),this.geometry=new n.PlaneBufferGeometry,this.init(t)}o.prototype=Object.create(n.Sprite.prototype),o.prototype.init=function(t){var e=r.initCanvasLabel(t),i=e.texture,o=e.canvas;this.width=o.width,this.height=o.height,this.material=new n.ShaderMaterial({uniforms:{tDiffuse:{value:i},width:{value:o.width},height:{value:o.height},domWidth:{value:t.renderDom.width},domHeight:{value:t.renderDom.height}},vertexShader:["precision highp float;","uniform float width;","uniform float height;","uniform float domWidth;","uniform float domHeight;","varying vec2 vUv;","void main() {","vUv = uv;","vec4 proj = projectionMatrix * modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0);","gl_Position = vec4(","proj.x / proj.w + position.x * width / domWidth * 2.0,","proj.y / proj.w + position.y * height / domHeight * 2.0,","proj.z / proj.w,","1.0",");","}"].join("\n"),fragmentShader:["precision highp float;","uniform sampler2D tDiffuse;","uniform float width;","uniform float height;","varying vec2 vUv;","void main() {","vec2 _uv = vec2(","(floor(vUv.s * width) + 0.5) / width,","(floor(vUv.t * height) + 0.5) / height",");","gl_FragColor = texture2D( tDiffuse, _uv );","}"].join("\n"),transparent:!0})},t.exports=o},function(t,e,i){"use strict";var n=i(0),r=i(9),o=i(4).EventEmitter,a=i(40)(n),s=i(13),l=i(41);function u(t){this._canbeUsed=!1,this._canbeSelect=!0,this._canbeChoosed=!0,this.player=t,this.sRender=t.sRender,this.raycaster=new n.Raycaster,this.mouse=new n.Vector3,this.CONTROLMODEL=null,this.CURRENTMODEL=null,this.INTERSECT=null,this.WEAPONS_SCENE=[],this.ACTIVEMODEL=null,this.WEAPONS_KV={},this.controls=[],this._collision=!1,this.collision_d=.05,this.modelControlChange=!1,this.emitter=new o,this.defineProperty(),this.initStateEngine()}window.THREE=n,u.prototype.defineProperty=function(){Object.defineProperty(this,"canbeUsed",{get:function(){return this._canbeUsed},set:function(t){this._canbeUsed=t}}),Object.defineProperty(this,"canbeSelect",{get:function(){return this._canbeSelect},set:function(t){this._canbeSelect=t}}),Object.defineProperty(this,"collision",{get:function(t){return this._collision},set:function(t){this._collision=t;var e=this.CONTROLMODEL.userData.setting_item,i=this.CONTROLMODEL.userData.transform_control;if(e.collision=t,i)for(var n in i.MOVELOCK)i.MOVELOCK[n].state=!1}})},u.prototype.initStateEngine=function(){this.MouseStateEngine={mouseMoveIn:{state:!1,callback:this.handleMouseMoveInWeapon.bind(this)},mouseMoveOut:{state:!1,callback:this.handleMouseMoveOutWeapon.bind(this)}},this.MouseStateEngineTranstion={mouseMoveIn:{mouseMoveOut:function(){this.MouseStateEngine.mouseMoveIn.state&&(this.MouseStateEngine.mouseMoveIn.state=!1,this.MouseStateEngine.mouseMoveOut.state=!0,this.MouseStateEngine.mouseMoveOut.callback())}.bind(this)}}},u.prototype.initBoundingBox=function(t){if(!t.userData.box_helper){var e=new n.BoxHelper(t,5756395);e.visible=!1,e.geometry.computeBoundingBox();var i=e.geometry.boundingBox.getSize(new n.Vector3);e.userData.out_screen=!1,t.userData.box_helper=e,t.userData.box_size=i,this.sRender.scene.add(e);var r=s.drawBoxHelperOfLine2(e,5756395,this.sRender.renderer.domElement);t.userData.box_helper_fatline=r,this.sRender.scene.add(r)}},u.prototype.initOriginInfo=function(t){var e=t.userData.setting_item,i=t.userData.box_helper;i.geometry.computeBoundingBox(),e.timestamp=(new Date).getTime();var r=i.geometry.boundingBox.getSize(new n.Vector3),o=r.x.toFixed(3),a=r.y.toFixed(3),s=r.z.toFixed(3);0===e.origin_size.width&&0===e.origin_size.height&&0===e.origin_size.depth&&(e.origin_size={width:o,height:a,depth:s}),e.size={width:o,height:a,depth:s},e.origin_position.copy(t.position.clone()),e.origin_rotation.copy(t.rotation.clone()),e.origin_scale.copy(t.scale.clone()),e.current_location_id=this.player.currentPano.id};var h=!1;u.prototype.onHandleControlPanoramaMove=function(){h=!1,this._canbeChoosed=!1,this.CONTROLMODEL&&this.player.emit("hidePutModelSetTools"),this.INTERSECT&&(this.INTERSECT=null)},u.prototype.onHandleControlTtagsMove=function(){this.CONTROLMODEL&&this.player.emit("hidePutModelSetTools")},u.prototype.onHandleControlPanoramaMoveStop=function(){if(!h&&(h=!0,this.CONTROLMODEL&&!this.CONTROLMODEL.userData.follow_mouse)){var t=this.CONTROLMODEL.userData.box_helper;this.modelControlChange||t.userData.out_screen||(this.updateSetToolsPosition(t),this.player.emit("showPutModelSetTools","weapon"))}},u.prototype.onIntoPanorama=function(){0<this.WEAPONS_SCENE.length&&this.player.emit("showModelListPanel")},u.prototype.onIntoTransitioning=function(){this.destroyModelChoosedState()},u.prototype.handleMouseMove=function(){if(this.mouse.copy(this.player.mouse),this.CONTROLMODEL&&this.CONTROLMODEL.userData.follow_mouse&&this.player.intersect&&this.player.intersect.point&&(this.handleModelFollowingMouse(this.CONTROLMODEL,this.player.intersect.point),this.updateBoundingBox()),0<this.WEAPONS_SCENE.length){var t=this.WEAPONS_SCENE.filter((function(t){return!1===t.userData.handle_choosed}));0<t.length&&this.handlePickupWeapon(t)}},u.prototype.handleMouseLeftButtonDown=function(){if((!1!==l.canbeChoosedOfMode3D||"panorama"===this.player.mode)&&(this._canbeChoosed=!0,0<this.WEAPONS_SCENE.length)){if(this.CONTROLMODEL&&this.CONTROLMODEL.userData.follow_mouse)return;this._canbeSelect&&this.handleSelectModel()}},u.prototype.handleMouseLeftButtonUp=function(){this._canbeChoosed&&this.INTERSECT&&(this.player.humanModelControls.destroyInvalidModelControl(),this.player.virtualCameraFovControls.destroyModelControlState(),(this.INTERSECT.name="probeModel")?this.handleChooseModel(this.INTERSECT.parent):this.handleChooseModel(this.INTERSECT.parent.parent.parent),this.INTERSECT=null)},u.prototype.handleMouseRightButtonDown=function(){},u.prototype.handleMouseRightButtonUp=function(){this.CONTROLMODEL&&this.CONTROLMODEL.userData.follow_mouse&&this.handlePutModel(this.CONTROLMODEL)},u.prototype.handleModelFollowingMouse=function(t,e){var i=t.userData.box_size,r=(new n.Vector3).copy(e.clone());r.y+=i.y,t.position.copy(r),this.emitter.emit("weapon-follow-mouse")},u.prototype.handlePutModel=function(t){t.userData.follow_mouse=!1,this.WEAPONS_SCENE.push(t),this.WEAPONS_KV[t.uuid]=t,this.initOriginInfo(t),this.destroyBoundingBox(t),this.player.emit("addModelListItem",t.userData.setting_item),this.CONTROLMODEL=null,this.emitter.emit("weapon-put-over")},u.prototype.handleSelectModel=function(){this.raycaster.setFromCamera(this.mouse,this.sRender.camera);var t=this.raycaster.intersectObjects(this.WEAPONS_SCENE,!0);if(0<t.length){var e=t[0].object;this.INTERSECT=e,this.player.disableNavigator=!0}},u.prototype.handleChooseModel=function(t){if(t.visible&&(this.CONTROLMODEL&&t.uuid!==this.CONTROLMODEL.uuid&&this.destroyModelChoosedState(),!this.CONTROLMODEL||t.uuid!==this.CONTROLMODEL.uuid)){this.CURRENTMODEL=t,document.body.style.cursor="",t.userData.handle_choosed=!0,this.CONTROLMODEL=t,this.initBoundingBox(t),this.bundleControlOfTranslate();var e=t.userData.box_helper;this.updateSetToolsPosition(e),this.player.emit("showPutModelSetTools","weapon"),this.player.emit("choosed-weapon",t.userData.setting_item),this.emitter.emit("weapon-handle-choosed")}},u.prototype.handleKeyOfEsc=function(){if(this.CONTROLMODEL&&this.CONTROLMODEL.userData.follow_mouse){var t=this.CONTROLMODEL;this.destroyModelChoosedState(t),this.destroyModelFromScene(t),this.emitter.emit("weapon-put-cancel")}},u.prototype.handleDeleteModel=function(t){if(this.WEAPONS_KV[t]){var e=this.WEAPONS_KV[t];e.userData.handle_choosed&&(this.destroyModelChoosedState(e),this.player.emit("hidePutModelSetTools"),this.player.emit("hidePutModelInfoPanel")),this.destroyModelFromScene(e),this.WEAPONS_SCENE.splice(this.WEAPONS_SCENE.indexOf(e),1),delete this.WEAPONS_KV[t],this.player.emit("deletePutModelSuccess",t),0===this.WEAPONS_SCENE.length&&0===this.player.humanModelControls.putModelsOfHuman.length&&0===this.player.virtualCameraFovControls.putModels.length&&this.player.emit("hideModelListPanel")}},u.prototype.handleShowModel=function(t){if(this.WEAPONS_KV[t]){var e=this.WEAPONS_KV[t],i=e.userData.setting_item;i.isShow=!0,e.visible=i.isShow}},u.prototype.handleHideModel=function(t){if(this.WEAPONS_KV[t]){var e=this.WEAPONS_KV[t],i=e.userData.setting_item;i.isShow=!1,e.visible=i.isShow,e.userData.handle_choosed&&(this.destroyModelChoosedState(e),this.player.emit("hidePutModelSetTools"))}},u.prototype.handleShowCurrentModel=function(){for(var t=0,e=this.WEAPONS_SCENE.length;t<e;++t){var i=this.WEAPONS_SCENE[t];!0!==i.userData.is_save&&(i.visible=!0)}},u.prototype.handleHideCurrentModel=function(){for(var t=0,e=this.WEAPONS_SCENE.length;t<e;++t){var i=this.WEAPONS_SCENE[t];!0!==i.userData.is_save&&(i.visible=!1),i.userData.handle_choosed&&(this.destroyModelChoosedState(i),this.player.emit("hidePutModelSetTools"))}},u.prototype.handleSwitchSaveModelVisible=function(t){for(var e=0,i=this.WEAPONS_SCENE.length;e<i;++e){var n=this.WEAPONS_SCENE[e];n.userData.is_save&&(n.visible=t,!1===t&&n.userData.handle_choosed&&(this.destroyModelChoosedState(n),this.player.emit("hidePutModelSetTools")))}},u.prototype.handleHideAllModel=function(){for(var t=0,e=this.WEAPONS_SCENE.length;t<e;++t){var i=this.WEAPONS_SCENE[t];i.visible=!1,i.userData.handle_choosed&&(this.destroyModelChoosedState(i),this.player.emit("hidePutModelSetTools"))}},u.prototype.handleComplete=function(){if(this.destroyModelChoosedState(),this.CURRENTMODEL){var t=this.CURRENTMODEL.getWorldPosition(),e=this.CURRENTMODEL.getWorldQuaternion();this.player.emit("putProbeModelComplete",{worldPosition:t,worldQuaternion:e})}},u.prototype.handlePickupWeapon=function(t){this.raycaster.setFromCamera(this.mouse,this.sRender.camera);var e=this.raycaster.intersectObjects(t,!0);if(0<e.length){var i=e[0].object;this.MouseStateEngine.mouseMoveIn.state=!0,this.MouseStateEngine.mouseMoveIn.callback(i)}else this.MouseStateEngineTranstion.mouseMoveIn.mouseMoveOut()},u.prototype.handleMouseMoveInWeapon=function(t){document.body.style.cursor="pointer",this.sRender.outlinePass.selectedObjects=[t.parent]},u.prototype.handleMouseMoveOutWeapon=function(){document.body.style.cursor="",this.sRender.outlinePass.selectedObjects=[]},u.prototype.bundleControlOfTranslate=function(){this.CONTROLMODEL&&this.bundleControlOfModel(this.CONTROLMODEL,"translate")},u.prototype.bundleControlOfRotate=function(){this.CONTROLMODEL&&this.bundleControlOfModel(this.CONTROLMODEL,"rotate")},u.prototype.bundleControlOfModel=function(t,e){if(t.userData.transform_control){(n=t.userData.transform_control).setMode(e)}else{var i=this,n=new a(this.sRender.camera,this.sRender.renderer.domElement),r=t.userData.box_helper;this.updateControlPosition(n,r),n.attach(t),n.setMode(e),n.setSize(.5),n.addEventListener("objectChange",(function(e){i.modelControlChange=!0,i.player.emit("hidePutModelSetTools"),i.updateGroudClearance(),i.updateBoundingBox(),"translate"===n.getMode()&&i.updateControlPosition(n,r),i._collision&&i.computeCrash_2(t)})),n.addEventListener("mouseUp",(function(t){i.modelControlChange=!1,"rotate"===n.getMode()&&i.updateControlPosition(n,r),i.updateSetToolsPosition(r),i.player.emit("showPutModelSetTools","weapon")})),n.addEventListener("mouseDown",(function(t){n.MOVELOCK[n.axis].state=!1})),t.userData.transform_control=n,this.controls.push(n),this.sRender.scene.add(n)}},u.prototype.bundleControlOfTranslate=function(){this.CONTROLMODEL&&this.bundleControlOfModel(this.CONTROLMODEL,"translate")},u.prototype.bundleControlOfRotate=function(){this.CONTROLMODEL&&this.bundleControlOfModel(this.CONTROLMODEL,"rotate")},u.prototype.destroyBoundingBox=function(t){if(t.userData.box_helper){var e=t.userData.box_helper;t.userData.box_helper=null,e.geometry.dispose(),e.material.dispose(),this.sRender.scene.remove(e)}if(t.userData.box_helper_fatline){var i=t.userData.box_helper_fatline;this.sRender.scene.remove(i),i.traverse((function(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()})),t.userData.box_helper_fatline=null}},u.prototype.destroyModelChoosedState=function(t){(t=t||this.CONTROLMODEL)&&(this.destroyControl(this.CONTROLMODEL),this.destroyBoundingBox(this.CONTROLMODEL),this.CONTROLMODEL=null,this.emitter.emit("weapon-unchoosed"),this.player.emit("hidePutModelSetTools"),this.player.emit("hidePutModelInfoPanel"))},u.prototype.destroyControl=function(t){if(t.userData.transform_control){var e=t.userData.transform_control;e.dispose(),e.detach(),this.sRender.scene.remove(e),t.userData.handle_choosed=!1,t.userData.transform_control=null}},u.prototype.destroyModelFromScene=function(t){this.sRender.scene.remove(t),t.traverse((function(t){t.material&&t.material.dispose(),t.geometry&&t.geometry.dispose()}))},u.prototype.restoreOriginSetting=function(){if(this.CONTROLMODEL){var t=this,e=this.CONTROLMODEL,i=e.userData.setting_item,n=e.userData.box_helper,r=e.userData.transform_control;e.position.y=i.origin_position.y,i.ground_clearance=0;var o=i.origin_rotation;if(e.rotation.copy(o),e.scale.copy(i.origin_scale),i.size.width=i.origin_size.width,i.size.height=i.origin_size.height,i.size.depth=i.origin_size.depth,this.updateModelColor({hex:i.origin_skin_color}),r)var a=setTimeout((function(){t.updateBoundingBox(),t.updateControlPosition(r,n),t.updateSetToolsPosition(n),clearTimeout(a)}),100);this.player.emit("resetPutModelInfo",i)}},u.prototype.computeCrash_2=function(t){if(t.userData.box_helper){var e=t.userData.transform_control,i=t.userData.box_helper,o=i.geometry;o.computeBoundingBox();for(var a=o.boundingBox,s=r.getVerticesOfItemSize(o),l=a.getCenter(new n.Vector3),u=0;u<s.length;++u){s[u].userData={},s[u].userData.name="v_"+u;var h=s[u].clone().applyMatrix4(i.matrix).sub(l),c=new n.Raycaster(l,h).intersectObjects(this.player.model.colliders);if(0<c.length){var d=c[0],p=d.object,f=d.face,m=(d.point,d.distance);f.normal.applyMatrix4(p.matrixWorld).sub(p.position).normalize();h.length()+this.collision_d>=m&&(e.MOVELOCK[e.axis].state=!0)}}}},u.prototype.updateBoundingBox=function(t){if((t=t||this.CONTROLMODEL).userData.box_helper){var e=t.userData.box_helper;e.update();var i=t.userData.box_helper_fatline;i&&(this.sRender.scene.remove(i),i.traverse((function(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()})));var n=s.drawBoxHelperOfLine2(e,5756395,this.sRender.renderer.domElement);t.userData.box_helper_fatline=n,this.sRender.scene.add(n)}},u.prototype.updateControlPosition=function(t,e){e.geometry.computeBoundingBox();var i=e.geometry.boundingBox,r=i.getCenter(new n.Vector3),o=i.getSize(new n.Vector3),a=new n.Vector3(r.x,r.y-.5*o.y,r.z);t.currentWorldPosition.copy(a)},u.prototype.updateSetToolsPosition=function(t){t.geometry.computeBoundingBox();for(var e=r.getVerticesOfItemSize(t.geometry),i={},n={},o=[],a=[],s=0;s<e.length;++s){var l=e[s].clone();if(!r.computeWorldPositionOutCamera(l,this.sRender.camera)){var u=r.convertWorldPositionToScreen(l,this.sRender.camera);o.push(u.x),a.push(u.y),i["k_"+u.x]=u,n["k_"+u.y]=u}}var h=i["k_"+Math.max.apply(null,o)];this.player.emit("setPutModelToolsPosition",h)},u.prototype.updateModelColor=function(t){this.CONTROLMODEL.traverse((function(e){"Mesh"===e.type&&e.material.color.setHex(t.hex)})),this.CONTROLMODEL.userData.setting_item.skin_color=t.hex},u.prototype.updateSize=function(t){if(this.CONTROLMODEL){var e=this.CONTROLMODEL,i=e.userData.setting_item,n=i.origin_size,r=i.origin_scale,o=r.x/n.width,a=r.y/n.height,s=r.z/n.depth,l=t.width*o,u=t.height*a,h=t.depth*s;e.scale.set(l,u,h),i.scale=e.scale,i.size={width:l*n.width,height:u*n.height,depth:h*n.depth},this.updateBoundingBox()}},u.prototype.updateGroudClearance=function(){if(this.CONTROLMODEL){var t=this.CONTROLMODEL,e=t.userData.setting_item,i=e.origin_position,n=t.position.clone().y-i.y;e.ground_clearance=n,this.player.emit("resetPutModelInfo",e)}},u.prototype.updateModelGroundClearance=function(t){if(this.CONTROLMODEL){var e=this.CONTROLMODEL,i=e.userData.setting_item;e.position.y=i.origin_position.y+.01*t,i.ground_clearance=t;var n=e.userData.transform_control,r=e.userData.box_helper;this.updateBoundingBox(),this.updateSetToolsPosition(r),n&&this.updateControlPosition(n,r)}},u.prototype.updateSetToolsAndControlPosition=function(){if(this.CONTROLMODEL){var t=this.CONTROLMODEL,e=t.userData.box_helper,i=t.userData.transform_control;this.updateSetToolsPosition(e),i&&e&&this.updateControlPosition(i,e),this.player.emit("showPutModelSetTools","weapon")}},u.prototype.updateBoxHelperIsOutScrren=function(t){if("panorama"===this.player.mode){for(var e=r.getVerticesOfItemSize(t.geometry),i={},n=0,o=e.length;n<o;++n){var a=e[n],s=a.applyMatrix4(this.sRender.camera.matrixWorldInverse).applyMatrix4(this.sRender.camera.projectionMatrix),l=Math.abs(s.x)>1,u=Math.abs(s.y)>1,h=Math.abs(s.z)>1;(l||u||h)&&(1,i["k_"+n]=a)}e.length===Object.keys(i).length?(this.player.emit("hidePutModelSetTools"),t.userData.out_screen=!0):t.userData.out_screen=!1}},u.prototype.updateModelName=function(t){this.CONTROLMODEL&&(this.CONTROLMODEL.userData.setting_item.modelName=t)},u.prototype.updateControls=function(){if(0<this.controls.length)for(var t=0;t<this.controls.length;++t)this.controls[t].update()},u.prototype.update=function(){if(this.updateControls(),this.CONTROLMODEL){var t=this.CONTROLMODEL.userData;t.handle_choosed&&this.updateBoxHelperIsOutScrren(t.box_helper)}},t.exports=u},function(t,e,i){"use strict";var n=i(0),r=i(9),o=(i(13),i(3),i(4).EventEmitter),a=i(138)(n),s=(new n.TextureLoader).load("./images/texture/location/location_red_512x512.png");function l(t){this._canbeUsed=!1,this._canbeSelect=!1,this.player=t,this.sRender=t.sRender,this.locationId=null,this.raycaster=new n.Raycaster,this.mouse=new n.Vector3,this.POSTIL=null,this.controls=[],this.PostilOfScene=[],this.PostilOfKV={},this.hideAll=!1,this.defineProperty(),this.emitter=new o}l.prototype.defineProperty=function(){Object.defineProperty(this,"canbeUsed",{get:function(){return this._canbeUsed},set:function(t){this._canbeUsed=t}}),Object.defineProperty(this,"canbeSelect",{get:function(){return this._canbeSelect},set:function(t){this._canbeSelect=t}})},l.prototype.initBox=function(){if(!this.POSTIL.userData.box_line){this.POSTIL.geometry.computeBoundingBox();var t=this.POSTIL.geometry.boundingBox.getSize(new n.Vector3),e=new n.PlaneBufferGeometry(t.x,t.y),i=new n.EdgesGeometry(e),r=new n.LineSegments(i,new n.LineBasicMaterial({color:65280}));this.POSTIL.userData.box_line=r,this.POSTIL.add(r)}},l.prototype.onIntoPanorama=function(){this.destroyPostilChoosedState()},l.prototype.handleMouseLeftButtonDown=function(){if("panorama"===this.player.mode&&0<this.PostilOfScene.length){if(this.POSTIL&&this.POSTIL.userData.follow_mouse)return;this._canbeSelect&&this.handleSelectPostil()}},l.prototype.handleMouseLeftButtonUp=function(){"panorama"===this.player.mode&&this.POSTIL&&!this.POSTIL.userData.follow_mouse&&this.handleChoosedPostil(this.POSTIL)},l.prototype.handleMouseRightButtonDown=function(){},l.prototype.handleMouseRightButtonUp=function(){"panorama"===this.player.mode&&this.POSTIL&&this.POSTIL.userData.follow_mouse&&(this.handlePutPostil(this.POSTIL),this.POSTIL=null)},l.prototype.handleMouseMove=function(){!this.player||this.player&&"panorama"!==this.player.mode||(this.mouse.copy(this.player.mouse),"panorama"===this.player.mode&&this.POSTIL&&this.POSTIL.userData.follow_mouse&&0<this.player.model.colliders.length&&this.handlePostilFollowingMouse2(this.POSTIL,this.player.intersect))},l.prototype.handlePutPostil=function(t){var e=this;t.userData.follow_mouse=!1;var i=this.player.panoMarkers.filter((function(t){return e.locationId===t.pano.id}))[0];t.userData.marker=i,this.PostilOfScene.push(t),this.PostilOfKV[t.uuid]=t,this.destroyPositionLine(t),this.updateSettingItem(t),this.updateMarkerTexture(t),t.userData.marker=i;var r=new n.BoxHelper(t);this.sRender.scene.add(r),r.visible=!1,t.userData.box_helper=r,this.player.emit("add-postil-item",t.userData.setting_item),this.emitter.emit("postil-put-over")},l.prototype.handleKeyOfEsc=function(){this.POSTIL&&this.POSTIL.userData.follow_mouse&&(this.destroyPositionLine(),this.sRender.scene.remove(this.POSTIL),this.POSTIL.geometry.dispose(),this.POSTIL.material.dispose(),this.POSTIL=null,this.emitter.emit("postil-put-cancel"))},l.prototype.handleModelFollowingMouse=function(t,e){this.raycaster.setFromCamera(this.mouse,this.sRender.camera);var i=this.raycaster.intersectObjects(e);if(0<i.length){var n=i[0];if(n.face){var r=n.face.normal.applyMatrix4(n.object.matrixWorld).sub(n.object.position).normalize();t.position.set(0,0,0),t.lookAt(r),t.position.copy(n.point)}}},l.prototype.handlePostilFollowingMouse2=function(t,e){if(e.face){var i=e.point,n=e.face.normal.applyMatrix4(e.object.matrixWorld).sub(e.object.position).normalize(),r=i.clone();t.position.copy(r.add(n.divideScalar(6)).clone()),this.destroyPositionLine(),this.addPositionLine(i,t.position),t.lookAt(this.sRender.camera.position),this.emitter.emit("postil-follow-mouse")}},l.prototype.handleSelectPostil=function(){this.raycaster.setFromCamera(this.mouse,this.sRender.camera);var t=this.raycaster.intersectObjects(this.PostilOfScene);if(0<t.length){this.player.disableNavigator=!0;var e=t[0];this.POSTIL&&this.POSTIL.uuid!==e.object.uuid&&(this.destroyControl(this.POSTIL),this.destroyBox(this.POSTIL)),this.POSTIL=e.object}},l.prototype.handleChoosedPostil=function(t){t.userData.handle_choosed=!0,this.bundleControl(t),this.updateSettingItem(t),this.player.emit("choosed-postil",t.userData.setting_item)},l.prototype.handleDeletePostil=function(t){if(this.PostilOfKV[t]){var e=this.PostilOfKV[t],i=e.userData.marker,n=i.userData.postils,r=i.userData.default_texture;e.userData.transform_control&&(this.destroyControl(e),this.destroyBox(e),this.POSTIL.userData.transform_control=null,this.POSTIL=null,this.player.emit("hide-postil-set-tool")),this.sRender.scene.remove(e),e.geometry.dispose(),e.material.dispose(),this.PostilOfScene.splice(this.PostilOfScene.indexOf(e),1),delete this.PostilOfKV[t],delete n[t],0===Object.keys(n).length&&(i.material.map=r,i.material.map.needsUpdate=!0),this.player.emit("delete-postil-success",t)}},l.prototype.handleEditPostil=function(t){if(this.PostilOfKV[t])return this.PostilOfKV[t].userData.setting_item},l.prototype.bundleControl=function(t){var e=this,i=t.userData.setting_item;if(!t.userData.transform_control){var n=new a(this.sRender.camera,this.sRender.renderer.domElement);n.attach(t),n.setMode("translate"),n.setSize(.5),n.addEventListener("objectChange",(function(i){e.player.emit("hide-postil-set-tool"),e.updateSettingItem(t)})),n.addEventListener("mouseUp",(function(t){e.player.emit("update-postil-ui",i)})),n.addEventListener("mouseDown",(function(t){})),t.userData.transform_control=n,this.controls.push(n),this.sRender.scene.add(n)}},l.prototype.addPositionLine=function(t,e){if(this.POSTIL){var i=new n.LineBasicMaterial({color:16777215}),r=new n.Geometry;r.vertices.push(t,e);var o=new n.Line(r,i);o.name="position_line",this.sRender.scene.userData.position_line=o,this.sRender.scene.add(o)}},l.prototype.destroyPositionLine=function(){if(this.sRender.scene.userData.position_line){var t=this.sRender.scene.userData.position_line;this.sRender.scene.userData.position_line=null,this.sRender.scene.remove(t),t.geometry.dispose(),t.material.dispose()}},l.prototype.destroyPostilChoosedState=function(){this.POSTIL&&(this.POSTIL.userData.setting_item.visible=!0,this.destroyControl(this.POSTIL),this.destroyBox(this.POSTIL),this.POSTIL=null,this.player.emit("hide-postil-set-tool"))},l.prototype.destroyControl=function(t){if(t.userData.transform_control){var e=t.userData.transform_control;t.userData.transform_control=null,t.userData.handle_choosed=!1,e.dispose(),e.detach(),this.sRender.scene.remove(e)}},l.prototype.destroyBox=function(t){if(t.userData.box_line){var e=t.userData.box_line;t.userData.box_line=null,t.remove(e),e.geometry.dispose(),e.material.dispose()}},l.prototype.updateSettingItem=function(t){var e=t.userData.setting_item;if(e.scale=t.scale,e.position=t.position,e.default_scale=t.userData.default_scale,e.default_size=t.userData.default_size,e.default_fat=t.userData.default_fat,0===e.size.width&&(e.size=t.userData.default_size),0===e.fat&&(e.fat=t.userData.default_fat),t.userData.box_helper){var i=r.getVerticesOfItemSize(t.geometry)[1].clone().applyMatrix4(t.matrixWorld);e.screenPosition=r.convertWorldPositionToScreen(i,this.sRender.camera)}""===e.current_location_id&&(e.current_location_id=this.locationId)},l.prototype.updatePostilInfo=function(t){var e=t.info,i=t.change_type;if("size"===i&&e.size_slide_stop&&(this.updateSettingItem(this.POSTIL),this.player.emit("update-postil-ui",e)),"fat"===i||"color"===i){var n,r=e.fat,o=e.color,a=e.size.width;1===e.type&&(n=this.POSTIL.userData.PostilModel.createTorusTexture(r,a,o)),2===e.type&&(n=this.POSTIL.userData.PostilModel.createRectTexture(r,a,o)),this.POSTIL.material.map=n}},l.prototype.updateDirectionOfPostil=function(){for(var t=0,e=this.PostilOfScene.length;t<e;++t){this.PostilOfScene[t].lookAt(this.sRender.camera.position)}},l.prototype.updateControlsOfPostil=function(){if(0<this.controls.length)for(var t=0;t<this.controls.length;++t)this.controls[t].update()},l.prototype.updateShowOfPostil=function(t){if(!this.hideAll){for(var e=[],i=0,o=this.PostilOfScene.length;i<o;++i){var a=this.PostilOfScene[i],s=a.userData.setting_item;if(t===s.current_location_id){a.visible=!0;var l=r.convertWorldPositionToScreen(new n.Vector3(0,0,0),this.sRender.camera);l=new n.Vector2(l.x,l.y);var u=r.convertWorldPositionToScreen(a.position.clone(),this.sRender.camera);u=new n.Vector2(u.x,u.y),s.distanceToScreenCenter=u.distanceTo(l);var h=r.getVerticesOfItemSize(a.geometry)[1].applyMatrix4(a.matrixWorld);s.screenPosition=r.convertWorldPositionToScreen(h.clone(),this.sRender.camera),this.computedOutScrren(a),a.userData.handle_choosed&&(s.visible=!1),e[e.length]=s}else a.visible=!1}this.player.emit("update-postil-show",e)}},l.prototype.updateMarkerTexture=function(t){var e=t.userData.marker;e.userData.postils[t.uuid]=1,e.material.map=s,e.material.map.needsUpdate=!0},l.prototype.computedOutScrren=function(t){var e=t.position.clone(),i=t.userData.setting_item;if("panorama"===this.player.mode){var n=e.applyMatrix4(this.sRender.camera.matrixWorldInverse).applyMatrix4(this.sRender.camera.projectionMatrix);i.visible=!0;var r=Math.abs(n.x)>1,o=Math.abs(n.y)>1,a=Math.abs(n.z)>1;r||o||a?(i.visible=!1,t.visible=!1):(i.visible=!0,t.visible=!0)}else i.visible=!1},l.prototype.update=function(){this.updateDirectionOfPostil(),this.updateControlsOfPostil(),this.player.currentPano&&this.player.currentPano.id&&(this.locationId=this.player.currentPano.id,this.updateShowOfPostil(this.locationId))},t.exports=l},function(t,e){t.exports=function(t){var e=function(e){t.MeshBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.transparent=!0,this.opacity=.8,this.color.setHex(e.color),this.highlight=function(t){this.opacity=t?1:.8}};(e.prototype=Object.create(t.MeshBasicMaterial.prototype)).constructor=e;var i=function(e){t.LineBasicMaterial.call(this),this.depthTest=!1,this.depthWrite=!1,this.transparent=!0,this.linewidth=1,this.color.setHex(e.color)};function n(e,i){t.Object3D.call(this),i=void 0!==i?i:document,this.object=void 0,this.visible=!1,this.translationSnap=null,this.rotationSnap=null,this.space="world",this.size=1,this.axis=null;var n=this,r="translate",o=!1,a={translate:new t.TransformGizmoDIY2Translate};for(var s in this._gizmo=a,a){var l=a[s];l.visible=s===r,this.add(l)}var u={type:"change"},h={type:"mouseDown"},c={type:"mouseUp",mode:r},d={type:"objectChange"},p=new t.Raycaster,f=new t.Vector2,m=new t.Vector3,g=new t.Vector3,v=new t.Vector3,y=new t.Vector3,b=1,w=new t.Vector3,x=new t.Matrix4,M=new t.Vector3,T=new t.Quaternion,S=new t.Vector3(1,0,0),_=new t.Vector3(0,1,0),A=new t.Vector3(0,0,1),P=new t.Quaternion,C=new t.Quaternion,E=new t.Quaternion,D=new t.Quaternion,L=new t.Vector3,O=new t.Vector3,I=new t.Matrix4,R=new t.Matrix4,N=new t.Vector3,k=new t.Vector3,F=new t.Euler,B=new t.Matrix4,z=new t.Vector3,U=new t.Euler;function V(t){if(void 0!==n.object&&!0!==o&&(void 0===t.button||0===t.button)){var e=W(t.changedTouches?t.changedTouches[0]:t,a[r].pickers.children),i=null;e&&(i=e.object.name,t.preventDefault()),n.axis!==i&&(n.axis=i,n.update(),n.dispatchEvent(u))}}function j(t){if(void 0!==n.object&&!0!==o&&(void 0===t.button||0===t.button)){var e=t.changedTouches?t.changedTouches[0]:t;if(0===e.button||void 0===e.button){var i=W(e,a[r].pickers.children);if(i){t.preventDefault(),t.stopPropagation(),n.dispatchEvent(h),n.axis=i.object.name,n.update(),w.copy(z).sub(k).normalize(),a[r].setActivePlane(n.axis,w);var s=W(e,[a[r].activePlane]);s&&(L.copy(n.object.position),O.copy(n.object.scale),I.extractRotation(n.object.matrix),B.extractRotation(n.object.matrixWorld),R.extractRotation(n.object.parent.matrixWorld),N.setFromMatrixScale(x.getInverse(n.object.parent.matrixWorld)),g.copy(s.point));var l=i.object,u=n.getMode(),c=n._gizmo[u].pickerGizmos;if("rotate"===u&&l.userData.isPicker){for(var d in c){(p=c[d][0][0].children[0]).visible=!1}l.parent.getObjectByName("Torus").visible=!0,l.parent.getObjectByName("ArcSurface").visible=!0}if("translate"===u&&l.userData.isPicker)for(var d in c){var p=c[d][0][0];n.axis!==d&&(p.visible=!1)}}}o=!0}}function H(e){if(void 0!==n.object&&null!==n.axis&&!1!==o&&(void 0===e.button||0===e.button)){var i=W(e.changedTouches?e.changedTouches[0]:e,[a[r].activePlane]);if(!1!==i){if(e.preventDefault(),e.stopPropagation(),m.copy(i.point),"translate"===r&&(m.sub(g),m.multiply(N),"local"===n.space&&(m.applyMatrix4(x.getInverse(B)),-1===n.axis.search("X")&&(m.x=0),-1===n.axis.search("Y")&&(m.y=0),-1===n.axis.search("Z")&&(m.z=0),m.applyMatrix4(I),n.object.position.copy(L),n.object.position.add(m)),"world"!==n.space&&-1===n.axis.search("XYZ")||(-1===n.axis.search("X")&&(m.x=0),-1===n.axis.search("Y")&&(m.y=0),-1===n.axis.search("Z")&&(m.z=0),m.applyMatrix4(x.getInverse(R)),n.object.position.copy(L),n.object.position.add(m)),null!==n.translationSnap&&("local"===n.space&&n.object.position.applyMatrix4(x.getInverse(B)),-1!==n.axis.search("X")&&(n.object.position.x=Math.round(n.object.position.x/n.translationSnap)*n.translationSnap),-1!==n.axis.search("Y")&&(n.object.position.y=Math.round(n.object.position.y/n.translationSnap)*n.translationSnap),-1!==n.axis.search("Z")&&(n.object.position.z=Math.round(n.object.position.z/n.translationSnap)*n.translationSnap),"local"===n.space&&n.object.position.applyMatrix4(B))),"rotate"===r&&(m.sub(k),m.multiply(N),M.copy(g).sub(k),M.multiply(N),"world"===n.space)){if(v.set(Math.atan2(m.z,m.y),Math.atan2(m.x,m.z),Math.atan2(m.y,m.x)),y.set(Math.atan2(M.z,M.y),Math.atan2(M.x,M.z),Math.atan2(M.y,M.x)),T.setFromRotationMatrix(x.getInverse(R)),null!==n.rotationSnap?(C.setFromAxisAngle(S,Math.round((v.x-y.x)/n.rotationSnap)*n.rotationSnap),E.setFromAxisAngle(_,Math.round((v.y-y.y)/n.rotationSnap)*n.rotationSnap),D.setFromAxisAngle(A,Math.round((v.z-y.z)/n.rotationSnap)*n.rotationSnap)):(C.setFromAxisAngle(S,v.x-y.x),E.setFromAxisAngle(_,v.y-y.y),D.setFromAxisAngle(A,v.z-y.z)),P.setFromRotationMatrix(B),"X"===n.axis){T.multiplyQuaternions(T,C);var s=n._gizmo[r].pickerGizmos.X[0][0].getObjectByName("ArcSurface");(l=new t.Quaternion).setFromAxisAngle(A,v.x),s.quaternion.copy(l)}if("Y"===n.axis){T.multiplyQuaternions(T,E);s=n._gizmo[r].pickerGizmos.Y[0][0].getObjectByName("ArcSurface");(l=new t.Quaternion).setFromAxisAngle(A,v.y),s.quaternion.copy(l)}if("Z"===n.axis){T.multiplyQuaternions(T,D);var l;s=n._gizmo[r].pickerGizmos.Z[0][0].getObjectByName("ArcSurface");(l=new t.Quaternion).setFromAxisAngle(A,v.z),s.quaternion.copy(l)}T.multiplyQuaternions(T,P),n.object.quaternion.copy(T)}n.update(),n.dispatchEvent(u),n.dispatchEvent(d)}}}function G(t){if(t.preventDefault(),void 0===t.button||0===t.button){if(o&&null!==n.axis){c.mode=r,n.dispatchEvent(c);var e=n.getMode(),i=n.axis,a=n._gizmo[e].pickerGizmos;if("rotate"===e){for(var s in a){(l=a[s][0][0].children[0]).visible=!0}a[i][0][0].getObjectByName("Torus").visible=!1,a[i][0][0].getObjectByName("ArcSurface").visible=!1}if("translate"===e)for(var s in a){var l=a[s][0][0];n.axis!==s&&(l.visible=!0)}}o=!1,"TouchEvent"in window&&t instanceof TouchEvent?(n.axis=null,n.update(),n.dispatchEvent(u)):V(t)}}function W(t,n){var r=i.getBoundingClientRect(),o=(t.clientX-r.left)/r.width,a=(t.clientY-r.top)/r.height;f.set(2*o-1,-2*a+1),p.setFromCamera(f,e);var s=p.intersectObjects(n,!0);return!!s[0]&&s[0]}i.addEventListener("mousedown",j,!1),i.addEventListener("touchstart",j,!1),i.addEventListener("mousemove",V,!1),i.addEventListener("touchmove",V,!1),i.addEventListener("mousemove",H,!1),i.addEventListener("touchmove",H,!1),i.addEventListener("mouseup",G,!1),i.addEventListener("mouseout",G,!1),i.addEventListener("touchend",G,!1),i.addEventListener("touchcancel",G,!1),i.addEventListener("touchleave",G,!1),this.dispose=function(){i.removeEventListener("mousedown",j),i.removeEventListener("touchstart",j),i.removeEventListener("mousemove",V),i.removeEventListener("touchmove",V),i.removeEventListener("mousemove",H),i.removeEventListener("touchmove",H),i.removeEventListener("mouseup",G),i.removeEventListener("mouseout",G),i.removeEventListener("touchend",G),i.removeEventListener("touchcancel",G),i.removeEventListener("touchleave",G)},this.attach=function(t){this.object=t,this.visible=!0,this.update()},this.detach=function(){this.object=void 0,this.visible=!1,this.axis=null},this.getMode=function(){return r},this.setMode=function(t){for(var e in"scale"===(r=t||r)&&(n.space="local"),a)a[e].visible=e===r;this.update(),n.dispatchEvent(u)},this.setTranslationSnap=function(t){n.translationSnap=t},this.setRotationSnap=function(t){n.rotationSnap=t},this.setSize=function(t){n.size=t,this.update(),n.dispatchEvent(u)},this.setSpace=function(t){n.space=t,this.update(),n.dispatchEvent(u)},this.update=function(){void 0!==n.object&&(n.object.updateMatrixWorld(),k.setFromMatrixPosition(n.object.matrixWorld),F.setFromRotationMatrix(x.extractRotation(n.object.matrixWorld)),e.updateMatrixWorld(),z.setFromMatrixPosition(e.matrixWorld),U.setFromRotationMatrix(x.extractRotation(e.matrixWorld)),b=k.distanceTo(z)/6*n.size,this.position.copy(k),this.scale.set(b,b,b),e instanceof t.PerspectiveCamera?w.copy(z).sub(k).normalize():e instanceof t.OrthographicCamera&&w.copy(z).normalize(),"local"===n.space?a[r].update(F,w):"world"===n.space&&a[r].update(new t.Euler,w),a[r].highlight(n.axis))}}return(i.prototype=Object.create(t.LineBasicMaterial.prototype)).constructor=i,t.TransformGizmoDIY2=function(){this.init=function(){t.Object3D.call(this),this.handles=new t.Object3D,this.pickers=new t.Object3D,this.planes=new t.Object3D,this.add(this.handles),this.add(this.pickers),this.add(this.planes);var e=new t.PlaneBufferGeometry(50,50,2,2),i=new t.MeshBasicMaterial({visible:!1,side:t.DoubleSide}),n={XY:new t.Mesh(e,i),YZ:new t.Mesh(e,i),XZ:new t.Mesh(e,i)};for(var r in n.YZ.rotation.set(0,Math.PI/2,0),n.XZ.rotation.set(-Math.PI/2,0,0),n)n[r].name=r,this.planes.add(n[r]),this.planes[r]=n[r];var o=function(t,e){for(var i in t)for(r=t[i].length;r--;){var n=t[i][r][0],o=t[i][r][1],a=t[i][r][2];n.name=i,o&&n.position.set(o[0],o[1],o[2]),a&&n.rotation.set(a[0],a[1],a[2]),e.add(n)}};o(this.handleGizmos,this.handles),o(this.pickerGizmos,this.pickers),this.traverse((function(e){if(e instanceof t.Mesh){e.updateMatrix();var i=e.geometry.clone();i.applyMatrix(e.matrix),e.geometry=i,e.position.set(0,0,0),e.rotation.set(0,0,0),e.scale.set(1,1,1)}}))},this.highlight=function(t){this.traverse((function(e){e.material&&e.material.highlight&&(e.name===t?e.material.highlight(!0):e.material.highlight(!1))}))}},t.TransformGizmoDIY2.prototype=Object.create(t.Object3D.prototype),t.TransformGizmoDIY2.prototype.constructor=t.TransformGizmoDIY2,t.TransformGizmoDIY2.prototype.update=function(t,e){},t.TransformGizmoDIY2Translate=function(){t.TransformGizmoDIY2.call(this);var n=new t.BufferGeometry;n.addAttribute("position",new t.Float32BufferAttribute([0,0,0,.3,0,0],3));var r=new t.Line(n,new i({color:65280}));r.userData.isLine=!0;var o=new t.BufferGeometry;o.addAttribute("position",new t.Float32BufferAttribute([0,0,0,0,.3,0],3));var a=new t.Line(o,new i({color:16711680}));a.userData.isLine=!0;var s=new t.BufferGeometry;s.addAttribute("position",new t.Float32BufferAttribute([0,0,0,0,0,.3],3));var l=new t.Line(s,new i({color:16776960}));r.userData.isLine=!0,this.handleGizmos={X:[[r]],Y:[[a]],Z:[[l]]};var u=function(){for(var e=[{x:0,y:18},{x:0,y:10},{x:-36,y:10},{x:-36,y:-8},{x:0,y:-8},{x:0,y:-18},{x:36,y:0}],i=new t.Shape,n=0;n<e.length;++n)0===n?i.moveTo(e[n].x,e[n].y):i.lineTo(e[n].x,e[n].y);return new t.ExtrudeBufferGeometry(i,{depth:8,bevelEnabled:!1,bevelSegments:1,steps:1,bevelSize:1,bevelThickness:1})},h=new t.Mesh(new u,new e({visible:!0,transparent:!0,color:65280}));h.scale.set(.01,.01,.01),h.userData.isPicker=!0;var c=new t.Mesh(new u,new e({visible:!0,transparent:!0,color:16711680}));c.scale.set(.01,.01,.01),c.userData.isPicker=!0;var d=new t.Mesh(new u,new e({visible:!0,transparent:!0,color:16776960}));d.scale.set(.01,.01,.01),d.userData.isPicker=!0,this.pickerGizmos={X:[[h,[.8,0,0],[Math.PI/2,0,0]]],Y:[[c,[0,.8,0],[0,0,Math.PI/2]]],Z:[[d,[0,0,.8],[Math.PI/2,0,Math.PI/2]]]},this.setActivePlane=function(e,i){var n=new t.Matrix4;i.applyMatrix4(n.getInverse(n.extractRotation(this.planes.XY.matrixWorld))),"X"===e&&(this.activePlane=this.planes.XY,Math.abs(i.y)>Math.abs(i.z)&&(this.activePlane=this.planes.XZ)),"Y"===e&&(this.activePlane=this.planes.XY,Math.abs(i.x)>Math.abs(i.z)&&(this.activePlane=this.planes.YZ)),"Z"===e&&(this.activePlane=this.planes.XZ,Math.abs(i.x)>Math.abs(i.y)&&(this.activePlane=this.planes.YZ)),"XY"===e&&(this.activePlane=this.planes.XY),"YZ"===e&&(this.activePlane=this.planes.YZ),"XZ"===e&&(this.activePlane=this.planes.XZ)};var p=new t.Vector3(1,0,0),f=new t.Vector3(0,1,0),m=new t.Vector3(0,0,1),g=new t.Quaternion,v=new t.Quaternion,y=new t.Vector3(0,1,0);this.update=function(e,i){t.TransformGizmoDIY2.prototype.update.apply(this,arguments),this.traverse((function(e){var n;"X"===e.name&&((n=y.copy(p).applyQuaternion(g).dot(i))<0&&(e.scale.x=-1),n>0&&(e.scale.x=1));if("Y"===e.name){var r=new t.Quaternion,o=new t.Quaternion;r.setFromAxisAngle(f,Math.atan2(i.x,i.z)),o.multiplyQuaternions(o,r),e.quaternion.copy(o)}"Z"===e.name&&((n=y.copy(m).applyQuaternion(v).dot(i))<0&&(e.scale.z=-1),n>0&&(e.scale.z=1))}))},this.init()},t.TransformGizmoDIY2Translate.prototype=Object.create(t.TransformGizmoDIY2.prototype),t.TransformGizmoDIY2Translate.prototype.constructor=t.TransformGizmoDIY2Translate,n.prototype=Object.create(t.Object3D.prototype),n.prototype.constructor=n,n}},function(t,e,i){"use strict";var n=i(0),r=i(40)(n),o=i(9),a=i(13),s=i(4).EventEmitter,l=i(140),u=i(41);function h(t){this._canbeUsed=!1,this._canbeChoosed=!1,this._canbeSelect=!0,this.player=t,this.sRender=t.sRender,this.raycaster=new n.Raycaster,this.VIRTUAL_CAMERA=null,this.VIRTUAL_CAMERA_INTERSECT=null,this.putModels=[],this.putModelsOfKV={},this.controls=[],this.crossFadeControls=[],this.colliders=[],this.newColliders=[],this.newCollidersBoxCube=[],this.emitter=new s,this.defineProperty(),this.initStateEngine()}h.prototype.defineProperty=function(){Object.defineProperty(this,"canbeUsed",{get:function(){return this._canbeUsed},set:function(t){this._canbeUsed=t}}),Object.defineProperty(this,"canbeSelect",{get:function(){return this._canbeSelect},set:function(t){this._canbeSelect=t}})},h.prototype.initStateEngine=function(){this.MouseStateEngine={mouseMoveIn:{state:!1,callback:this.handleMouseMoveInVirtualCamera.bind(this)},mouseMoveOut:{state:!1,callback:this.handleMouseMoveOutVirtualCamera.bind(this)}},this.MouseStateEngineTranstion={mouseMoveIn:{mouseMoveOut:function(){this.MouseStateEngine.mouseMoveIn.state&&(this.MouseStateEngine.mouseMoveIn.state=!1,this.MouseStateEngine.mouseMoveOut.state=!0,this.MouseStateEngine.mouseMoveOut.callback())}.bind(this)}}},h.prototype.initBoxHelper=function(t){if(!t.userData.box_helper){var e=new n.BoxHelper(t);e.visible=!1,e.geometry.computeBoundingBox();var i=e.geometry.boundingBox.getSize(new n.Vector3);e.userData.box_size=i,t.userData.box_helper=e,this.sRender.scene.add(e)}},h.prototype.initPositionLine=function(t,e){if(this.VIRTUAL_CAMERA){var i=new n.LineBasicMaterial({color:16777215}),r=new n.Geometry;r.vertices.push(t,e);var o=new n.Line(r,i);o.name="position_line",this.sRender.scene.userData.position_line=o,this.sRender.scene.add(o)}},h.prototype.initOriginSettingItem=function(t){var e=t.userData.setting_item;e.uuid=t.uuid,e.FOV=t.FOV,e.DISTANCE=t.DISTANCE,e.origin_position.copy(t.position.clone()),e.origin_rotation.copy(t.rotation.clone()),e.current_location_id=this.player.currentPano.id},h.prototype.initNewCollider=function(t){this.newColliders=[];for(var e=new n.MeshBasicMaterial({side:n.FrontSide,transparent:!0,opacity:0}),i=0,r=t.length;i<r;++i){var o=t[i],a=(new n.Geometry).fromBufferGeometry(o.geometry),s=new n.Mesh(a,e);this.sRender.scene.add(s),this.newColliders.push(s);var l=new n.BoxHelper(s,255);l.visible=!1,this.sRender.scene.add(l),s.userData.box_helper=l;var u=this.initBoundingCube(l,2,0);this.sRender.scene.add(u),this.newCollidersBoxCube.push(u)}for(i=0,r=this.newCollidersBoxCube.length;i<r;++i){u=this.newCollidersBoxCube[i],o=t[i];u.userData.collider=o}},h.prototype.initLabel=function(t){this.player.emit("add-virtual-camera-label",t)},h.prototype.initBoundingCube=function(t,e,i){t.geometry.computeBoundingBox();var r=t.geometry.boundingBox,o=r.getSize(new n.Vector3),a=r.getCenter(new n.Vector3),s=new n.BoxGeometry(o.x,o.y,o.z,e,e,e),l=new n.MeshBasicMaterial({color:i,transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}),u=new n.Mesh(s,l);return u.position.copy(a),u};var c=!1;h.prototype.onHandleControlPanoramaMove=function(){c=!1,this._canbeChoosed=!1,this.player.emit("hide-all-virtual-camera-label"),this.VIRTUAL_CAMERA&&!this.VIRTUAL_CAMERA.userData.follow_mouse&&this.player.emit("hidePutModelSetTools"),this.VIRTUAL_CAMERA_INTERSECT&&(this.VIRTUAL_CAMERA_INTERSECT=null)},h.prototype.onHandleControlPanoramaMoveStop=function(){if(!c&&(c=!0,this.VIRTUAL_CAMERA&&!this.VIRTUAL_CAMERA.userData.follow_mouse)){var t=this.VIRTUAL_CAMERA.userData.virtual_camera;this.VIRTUAL_CAMERA.userData.setting_item;this.updateSetToolsPosition(t),t.userData.out_screen||this.player.emit("showPutModelSetTools","camera")}},h.prototype.onHandleControlPanoramaMoveStopNoPan=function(){},h.prototype.onHandleControlDollhouseMove=function(){this.VIRTUAL_CAMERA&&this.player.emit("hidePutModelSetTools")},h.prototype.onHandleControlDollhouseMoveStop=function(){if(this.VIRTUAL_CAMERA){var t=this.VIRTUAL_CAMERA.userData.virtual_camera;this.VIRTUAL_CAMERA.userData.setting_item;this.updateSetToolsPosition(t),this.player.emit("showPutModelSetTools","camera")}},h.prototype.onCameraFovSlideStop=function(){this.VIRTUAL_CAMERA},h.prototype.onCameraDistanceSlideStop=function(){this.VIRTUAL_CAMERA},h.prototype.onIntoPanorama=function(){0<this.putModels.length&&(this.player.emit("showModelListPanel"),this.updateAllLabelPosition(this.putModels,!0),this.handleShowAllPlaceMonitor())},h.prototype.onIntoTransitioning=function(){this.destroyModelControlState(),this.handleHideAllPlaceMonitor(),this.player.emit("hide-all-virtual-camera-label")},h.prototype.onIntoDollhouse=function(){G.conf.modelplaced,this.handleShowAllPlaceMonitor(),this.player.emit("hide-all-virtual-camera-label")},h.prototype.onHandleControlTtagsMove=function(){this.player.emit("hide-all-virtual-camera-label")},h.prototype.onFlyEnd=function(){this.computeLabelBarrier(this.player.currentPano,this.colliders),this.updateAllLabelPosition(this.putModels)},h.prototype.onCameraPositionMove=function(){},h.prototype.onCameraPositionMoveStop=function(){this.updateAllLabelPosition(this.putModels)},h.prototype.onCameraRotationMove=function(){},h.prototype.onCameraRotationMoveStop=function(){this.updateAllLabelPosition(this.putModels)},h.prototype.handleMouseMove=function(){if(this.VIRTUAL_CAMERA&&this.VIRTUAL_CAMERA.userData.follow_mouse&&this.handleModelFollowingMouse(this.VIRTUAL_CAMERA),0<this.putModels.length){var t=this.putModels.filter((function(t){return!1===t.userData.handle_choosed}));0<t.length&&this.handlePickupVirtualCamera(t)}},h.prototype.handlePickupVirtualCamera=function(t){this.raycaster.setFromCamera(this.player.mouse,this.sRender.camera);var e=this.raycaster.intersectObjects(t,!0);if(0<e.length){var i=e[0].object;"VirtualCamera"===i.name?(this.pickedObject=i,this.MouseStateEngine.mouseMoveIn.state=!0,this.MouseStateEngine.mouseMoveIn.callback(i)):this.MouseStateEngineTranstion.mouseMoveIn.mouseMoveOut()}else this.MouseStateEngineTranstion.mouseMoveIn.mouseMoveOut()},h.prototype.handleMouseLeftButtonDown=function(){if((!1!==u.canbeChoosedOfMode3D||"panorama"===this.player.mode)&&(this._canbeChoosed=!0,0<this.putModels.length)){if(this.VIRTUAL_CAMERA&&this.VIRTUAL_CAMERA.userData.follow_mouse)return;this._canbeSelect&&this.handleSelectModel(this.putModels)}},h.prototype.handleMouseLeftButtonUp=function(){if(this._canbeChoosed&&this.VIRTUAL_CAMERA_INTERSECT){this.player.humanModelControls.destroyInvalidModelControl(),this.player.weaponModelControls.destroyModelChoosedState();var t=this.VIRTUAL_CAMERA_INTERSECT.parent;this.handleChoosedModel(t),this.VIRTUAL_CAMERA_INTERSECT=null}},h.prototype.handleMouseRightButtonDown=function(){},h.prototype.handleMouseRightButtonUp=function(){if(this.VIRTUAL_CAMERA&&this.VIRTUAL_CAMERA.userData.follow_mouse){var t=this.VIRTUAL_CAMERA;this.handlePutModel(t),this.destroyBoxHelper(t),this.destroyPositionLine(),this.putModels.push(t),this.putModelsOfKV[t.uuid]=t,this.VIRTUAL_CAMERA=null,this.player.emit("addModelListItem",t.userData.setting_item)}},h.prototype.handleModelFollowingMouse=function(t){t.userData.virtual_camera.geometry.computeBoundingBox();var e=this.player.intersect,i=e.object,n=e.face.normal,r=e.point,o=n.applyMatrix4(i.matrixWorld).sub(i.position).normalize();t.position.set(0,0,0),t.lookAt(o),t.position.copy(r.clone().add(n.divideScalar(8))),this.emitter.emit("virtualCamera-follow-mouse"),this.destroyPositionLine(),this.initPositionLine(r,t.position)},h.prototype.handlePutModel=function(t){var e=this;t.userData.follow_mouse=!1;var i=t.userData.setting_item;this.emitter.emit("virtualCamera-follow-mouse-over"),this.initOriginSettingItem(t),this.addAxleWire(t),this.computeCrash(t,(function(){e.computeSpaceData(t,!1),e.updateLabelPosition(t,i),e.initLabel(i)}))},h.prototype.handleMouseMoveInVirtualCamera=function(t){document&&(document.body.style.cursor="pointer");t.parent;this.sRender.outlinePass.selectedObjects=[t],this.emitter.emit("virtualCamera-mouse-in")},h.prototype.handleMouseMoveOutVirtualCamera=function(){document&&(document.body.style.cursor=""),this.sRender.outlinePass.selectedObjects=[],this.emitter.emit("virtualCamera-mouse-out")},h.prototype.handleSelectModel=function(t){this.raycaster.setFromCamera(this.player.mouse,this.sRender.camera);var e=this.raycaster.intersectObjects(t,!0);if(0<e.length){var i=e[0].object;"VirtualCamera"===i.name&&(this.player.disableNavigator=!0,this.player.lockedFlyToPano=!0,this.VIRTUAL_CAMERA_INTERSECT=i)}},h.prototype.handleChoosedModel=function(t){if(t.visible&&(this.VIRTUAL_CAMERA&&t.uuid!==this.VIRTUAL_CAMERA.uuid&&this.destroyModelControlState(this.VIRTUAL_CAMERA),!this.VIRTUAL_CAMERA||t.uuid!==this.VIRTUAL_CAMERA.uuid)){t.userData.handle_choosed=!0,this.VIRTUAL_CAMERA=t;var e=t.userData.virtual_camera,i=t.userData.setting_item;e.material.opacity=1,this.initBoxHelper(t),this.bundleControlOfTranslate(),this.updateSetToolsPosition(t.userData.virtual_camera),this.destroySpaceData(t),this.emitter.emit("virtualCamera-handle-choosed"),this.player.emit("showPutModelSetTools","camera"),this.player.emit("choosed-virtual-camera",t.userData.setting_item);var n={positions:t.userData.axle_wire.geometry.vertices,fov:t.FOV,distance:t.DISTANCE,quaternion:t.quaternion};this.sRender.emit("virtual-update-position",n),i.isLabelShow=!1,this.initLabel(i)}},h.prototype.handleKeyOfEsc=function(){if(this.VIRTUAL_CAMERA&&this.VIRTUAL_CAMERA.userData.follow_mouse){var t=this.VIRTUAL_CAMERA;this.destroyPositionLine(),this.destroyModelControlState(t),this.destroyModelFromScene(t),this.emitter.emit("virtualCamera-put-cancel")}},h.prototype.handleHideModel=function(t){if(this.putModelsOfKV[t]){var e=this.putModelsOfKV[t],i=e.userData.cone,n=e.userData.face_group,r=i.userData.place_monitor,o=e.userData.axle_wire,a=e.userData.setting_item;this.switchSpaceDataVisible(e,!1),e.userData.handle_choosed&&(this.destroyModelControlState(e),this.player.emit("hidePutModelSetTools"),this.player.emit("hidePutModelInfoPanel")),n&&(n.visible=!1),r&&(r.visible=!1),o&&(o.visible=!1),e.visible=!1,a.isShow=!1}},h.prototype.handleShowModel=function(t){if(this.putModelsOfKV[t]){var e=this.putModelsOfKV[t],i=e.userData.cone,n=e.userData.face_group,r=i.userData.place_monitor,o=e.userData.axle_wire,a=e.userData.setting_item;this.switchSpaceDataVisible(e,!0),n&&(n.visible=!0),r&&(r.visible=!0),o&&(o.visible=!0),e.visible=!0,a.isShow=!0}},h.prototype.handleDeleteModel=function(t){if(this.putModelsOfKV[t]){var e=this.putModelsOfKV[t];e.userData.handle_choosed&&(this.destroyModelControlState(e),this.player.emit("hidePutModelSetTools"),this.player.emit("hidePutModelInfoPanel")),this.destroySpaceData(e),this.destroyModelFromScene(e),this.putModels.splice(this.putModels.indexOf(e),1),delete this.putModelsOfKV[t],this.player.emit("deletePutModelSuccess",t),0===this.putModels.length&&0===this.player.humanModelControls.putModelsOfHuman.length&&0===this.player.weaponModelControls.WEAPONS_SCENE.length&&this.player.emit("hideModelListPanel")}},h.prototype.handleHideCurrentCamera=function(){for(var t=0,e=this.putModels.length;t<e;++t){var i=this.putModels[t];!0!==i.userData.is_save&&this.handleHideModel(i.uuid)}},h.prototype.handleShowCurrentCamera=function(){for(var t=0,e=this.putModels.length;t<e;++t){var i=this.putModels[t];!0!==i.userData.is_save&&this.handleShowModel(i.uuid)}},h.prototype.handleSwitchSaveCameraVisible=function(t){for(var e=0,i=this.putModels.length;e<i;++e){var n=this.putModels[e],r=n.userData.setting_item;n.userData.is_save&&(!1===t&&(n.userData.handle_choosed&&(this.destroyModelControlState(n),this.player.emit("hidePutModelSetTools")),this.handleHideModel(r.uuid)),!0===t&&this.handleShowModel(r.uuid))}},h.prototype.handleHideAllPlaceMonitor=function(){for(var t=0,e=this.putModels.length;t<e;++t){var i=this.putModels[t],n=i.userData.cone,r=i.userData.face_group,o=n.userData.place_monitor;r&&i.visible&&(r.visible=!1),o&&i.visible&&(o.visible=!1)}},h.prototype.handleShowAllPlaceMonitor=function(){for(var t=0,e=this.putModels.length;t<e;++t){var i=this.putModels[t],n=i.userData.cone,r=i.userData.face_group,o=n.userData.place_monitor;r&&i.visible&&(r.visible=!0),o&&i.visible&&(o.visible=!0)}},h.prototype.handleSwitchLabelVisible=function(t,e){},h.prototype.handleComplete=function(){if(this.VIRTUAL_CAMERA){var t=this.VIRTUAL_CAMERA,e=t.userData.setting_item;this.destroyModelControlState(t),this.computeCrash(t),this.computeSpaceData(t,!1),this.updateLabelPosition(t,e),"panorama"===this.player.mode?e.isLabelShow=!0:e.isLabelShow=!1,this.initLabel(e)}},h.prototype.bundleControlOfTranslate=function(){this.VIRTUAL_CAMERA&&this.bundleControlOfModel(this.VIRTUAL_CAMERA,"translate")},h.prototype.bundleControlOfRotate=function(){this.VIRTUAL_CAMERA&&this.bundleControlOfModel(this.VIRTUAL_CAMERA,"rotate")},h.prototype.bundleControlOfModel=function(t,e){if(t.userData.transform_control){(n=t.userData.transform_control).setMode(e)}else{var i=this,n=new r(this.sRender.camera,this.sRender.renderer.domElement),o=t.userData.virtual_camera,a=t.userData.cone;t.userData.setting_item;this.updateControlPosition(n,o.position.clone().applyMatrix4(o.matrixWorld)),n.attach(t),n.setMode(e),n.setSize(.5),n.addEventListener("objectChange",(function(e){"translate"===n.getMode()&&i.updateControlPosition(n,o.position.clone().applyMatrix4(o.matrixWorld)),a.visible=!0,i.updateAxleWire(t),i.player.emit("hidePutModelSetTools"),i.destroyPlaceMonitor(t),i.destroyCrossFace(t)})),n.addEventListener("mouseDown",(function(t){})),n.addEventListener("mouseUp",(function(t){"rotate"===n.getMode()&&i.updateControlPosition(n,o.position.clone().applyMatrix4(o.matrixWorld)),i.updateSetToolsPosition(o),i.player.emit("showPutModelSetTools","camera")})),t.userData.transform_control=n,this.controls.push(n),this.sRender.scene.add(n)}};var d={name:"totalIntersects"};h.prototype.computeCrash=function(t,e){var i=this;void 0===e&&this.player.emit("showLoaddingOfLoadPutModel");var r=setTimeout((function(){var o=t.userData.axle_wire,a=t.userData.cone,s=a.geometry.vertices,l=new n.Raycaster,u=new n.Vector3,h=a.localToWorld(s[0].clone()),c=new WeakMap;c.set(d,[]);var p=h.clone(),f=s[s.length-1].clone(),m=a.localToWorld(f),g=i.newColliders;if(o){var v=o.userData.startVec.clone(),y=o.userData.endVec.clone(),b=o.userData.direct_vector.clone();l.set(v,b.normalize());var w=l.intersectObjects(g),x=v.distanceTo(y);if(0<w.length){var M=(A=w[0]).point;A.distance<=x&&i.updateAxleWire(t,M)}}for(var T=1,S=s.length-1;T<S;++T){f=s[T].clone();var _=a.localToWorld(f);u.subVectors(_,h),l.set(h,u.normalize());var A;w=l.intersectObjects(g),x=h.distanceTo(_);if(0<w.length)(A=w[0]).distance<=x?c.get(d).push(A):c.get(d).push({point:_});else c.get(d).push({point:_})}c.get(d).push(c.get(d)[0]),i.destroyPlaceMonitor(t);var P=new n.Group,C=new n.MeshBasicMaterial({color:65280,side:n.DoubleSide,transparent:!0,opacity:0,depthTest:!0,depthWrite:!1});for(T=0,S=c.get(d).length;T<S-1;++T){var E=new n.Geometry,D=h.clone(),L=c.get(d)[T].point,O=c.get(d)[T+1].point;E.vertices.push(D,L,O);var I=new n.Face3(0,1,2);E.faces.push(I);var R=new n.Mesh(E,C);P.add(R)}c.set(d,null),i.sRender.scene.add(P),a.visible=!1,a.userData.place_monitor=P,i.computeCrossFace(p,m,.5*t.FOV,g,t),i.player.emit("hideLoaddingOfLoadPutModel"),e&&e(),clearTimeout(r)}),100)},h.prototype.computeCrossShape=function(t){for(var e=0;e<t.length;++e){if(!t[e+1])return;var i=t[e].point,n=t[e+1].point,r=this.sRender.scene.userData["shape_line_"+e];r&&(r.geometry&&r.geometry.dispose(),r.material&&r.material.dispose(),this.sRender.scene.remove(r),this.sRender.scene.userData["shape_line_"+e]=null,r=null),r=a.drawLine(i,n,255),this.sRender.scene.add(r),this.sRender.scene.userData["shape_line_"+e]=r}};var p=new n.MeshBasicMaterial({color:65280,side:n.FrontSide,transparent:!0,opacity:.2,depthTest:!0,depthWrite:!1}),f={};h.prototype.computeCrossFace=function(t,e,i,r,o){var a=this;this.destroyCrossFace(o);var s=new n.Group;this.sRender.scene.add(s),o.userData.face_group=s,r.forEach((function(n){for(var r=n.geometry.vertices,s=n.geometry.faces,l=0,u=s.length;l<u;++l){var h=s[l];a.computeCurrentFace(h,r,t,e,i,n,o)}})),f={}},h.prototype.computeCurrentFace=function(t,e,i,r,o,a,s){var l=s.userData.face_group,u=t.normal.clone(),h=e[t.a].clone(),c=e[t.b].clone(),d=e[t.c].clone(),m=0,g=new n.Triangle;g.set(h,c,d);var v=g.getMidpoint(new n.Vector3),y="uuid_"+a.uuid+"face_"+t.a+"_"+t.b+"_"+t.c;if(f[y])m=1;else{var b=(new n.Vector3).subVectors(v,i),w=(new n.Vector3).subVectors(r,i),x=Math.acos(b.clone().normalize().dot(w.clone().normalize())),M=n.Math.radToDeg(x);if(M<=o||Math.abs(o-M)<1.125)b.clone().projectOnVector(w.clone()).length()<=w.length()&&(m=1,f[y]=1,this.computeBarrier(i,v)&&(m=0))}if(1===m){var T=new n.Geometry;T.vertices[0]=e[t.a].clone(),T.vertices[1]=e[t.b].clone(),T.vertices[2]=e[t.c].clone(),T.faces.push(new n.Face3(0,1,2));var S=new n.Mesh(T,p);S.position.add(u.divideScalar(1e3).clone()),l.add(S)}},h.prototype.computeFilterColliders=function(t,e,i){var r=[],o={};this.player.hideWireFrame();for(var a=0,s=t.length;a<s;++a){var l=t[a];l.geometry.computeBoundingBox();var u=l.geometry.boundingBox,h=u.getCenter(new n.Vector3),c=u.containsPoint(e),d=u.containsPoint(i),p=h.distanceTo(e)<=e.distanceTo(i),f=0;(c||d||p)&&(!function t(){f=Math.random(),o["_"+f]&&t(),o["_"+f]=1}(),this.player.addWireFrame(l,16777215*f*10),r.push(l))}return r},h.prototype.computeFilterColliders2=function(t,e){var i=t.userData.box_helper;i?i.update():(i=new n.BoxHelper(t,16711680),this.sRender.scene.add(i),t.userData.box_helper=i);var r=this.sRender.scene.userData.cone_box_cube;r&&(r.geometry&&r.geometry.dispose(),r.material&&r.material.dispose(),this.sRender.scene.remove(r)),(r=this.initBoundingCube(i,2,16711680)).geometry.computeBoundingBox(),this.sRender.scene.add(r),this.sRender.scene.userData.cone_box_cube=r;var o=r.geometry.vertices,a=new n.Raycaster,s=r.position.clone(),l=new n.Vector3;this.player.hideWireFrame();for(var u=0,h=o.length;u<h;++u){var c=o[u].applyMatrix4(r.matrixWorld);l.subVectors(c,s),a.set(s,l,1);var d=a.intersectObjects(this.newCollidersBoxCube);if(0<d.length)for(var p=0;p<d.length;++p){var f=d[p].object.userData.collider;this.player.addWireFrame(f,16777215*Math.random())}}for(u=0,h=this.newCollidersBoxCube.length;u<h;++u){var m=this.newCollidersBoxCube[u];m.geometry.computeBoundingBox();m.geometry.boundingBox.getCenter(new n.Vector3).applyMatrix4(m.matrixWorld);for(var g=m.geometry.vertices,v=(p=0,g.length);p<v;++p){c=g[p].applyMatrix4(m.matrixWorld);if(r.geometry.boundingBox.containsPoint(c)){f=m.userData.collider;this.player.addWireFrame(f,16777215*Math.random())}}}return[]},h.prototype.computeLabelBarrier=function(t,e){for(var i=new n.Raycaster,r=0,o=this.putModels.length;r<o;++r){var a=this.putModels[r],s=a.userData.virtual_camera,l=a.userData.setting_item;s.geometry.computeBoundingBox();var u=s.geometry.boundingBox.getCenter(new n.Vector3);u=u.clone().applyMatrix4(s.matrixWorld);var h=new n.Vector3;h.subVectors(t.position,u).normalize(),i.set(u,h,1);var c=i.intersectObjects(e);if(0<c.length)c[0].distance<u.distanceTo(t.position)?l.isBarrier=!0:l.isBarrier=!1;else l.isBarrier=!1}};var m=new n.Raycaster,g=new n.Vector3;h.prototype.computeBarrier=function(t,e){g.subVectors(e,t),m.set(t,g.normalize());var i=m.intersectObjects(this.newColliders),n=t.distanceTo(e);if(0<i.length){var r=i[0].distance;if(r<n&&n-r>.01)return!0}return!1},h.prototype.computeLabelPosition=function(t){t.geometry.computeBoundingBox();var e=t.geometry.boundingBox.getSize(new n.Vector3),i=t.position.clone().applyMatrix4(t.matrixWorld);return i.y+=e.y,i},h.prototype.computeSpaceData=function(t,e){var i=t.userData.setting_item,r=t.userData.virtual_camera;e&&(this.destroySpaceData(t),r.material.opacity=.7);for(var s=o.getVerticesOfItemSize(r.geometry),l=r.position.clone().applyMatrix4(r.matrixWorld),u=s[s.length-2].clone().applyMatrix4(r.matrixWorld),h=s[s.length-1].clone().applyMatrix4(r.matrixWorld),c=new n.Vector3(1,0,0),d=(new n.Vector3(-1,0,0),new n.Vector3(0,1,0),new n.Vector3(0,-1,0)),p=(new n.Vector3(0,0,1),new n.Vector3(0,0,-1)),f=((new n.Vector3).subVectors(h,u).normalize(),[c,d,p]),m=new n.Raycaster,g=t.userData.axle_wire.userData.direct_vector,v=0,y=f.length;v<y;++v){var b=f[v];m.set(l,b,1);var w=m.intersectObjects(this.colliders);if(0<w.length){var x=w[0],M=x.point,T=x.distance,S="axis_"+b.x+"_"+b.y+"_"+b.z;i.directionDistanceType[S]=T;var _=g.clone().normalize().dot(b.clone().normalize()),A=Math.acos(_)/(Math.PI/180);if(i.axleWireWidthDirectionRotate[S]=A,!0===e){var P=a.drawFatLine(l,M,16776960,1.4);P.material.depthWrite=!1,t.userData.space_data.push(P);var C=l.clone(),E=M.clone(),D=new n.Line3(C,E).getCenter(new n.Vector3),L=this.addMeasureLabel(D,T,P,S);P.userData.label=L,this.sRender.scene.add(P),this.sRender.scene.add(L),i.hasSpaceData=!0}}}},h.prototype.computeRotateAngle=function(t){for(var e=t.userData.setting_item,i=t.userData.virtual_camera,r=i.position.clone().applyMatrix4(i.matrixWorld),o=t.userData.axle_wire.userData.direct_vector,a=new n.Raycaster,s=[new n.Vector3(1,0,0),new n.Vector3(0,-1,0),new n.Vector3(0,0,-1)],l=0,u=s.length;l<u;++l){var h=s[l];if(a.set(r,h,1),0<a.intersectObjects(this.colliders).length){var c="axis_"+h.x+"_"+h.y+"_"+h.z,d=o.clone().normalize().dot(h.clone().normalize()),p=Math.acos(d)/(Math.PI/180);e.axleWireWidthDirectionRotate[c]=p}}this.player.emit("update-ui-rotate",e.axleWireWidthDirectionRotate)},h.prototype.addMeasureLabel=function(t,e,i,n){var r={"axis_0_-1_0":"离地","axis_0_0_-1":"后边",axis_1_0_0:"侧边"},o={text:(r[n]?r[n]+" ":"")+e.toFixed(2)+"m",fontSize:14,fontFace:"Arial",renderDom:this.sRender.renderer.domElement},a=new l(o);return a.scale.set(.0015,.0015,.0015),a.position.copy(t),a},h.prototype.addAxleWire=function(t,e){if(!t.userData.axle_wire){var i=t.userData.cone,r=t.userData.virtual_camera,o=i.geometry.vertices,s=r.position.clone().applyMatrix4(r.matrixWorld),l=e||i.localToWorld(o[o.length-1].clone()),u=new n.Vector3,h=a.drawLine(s,l,16777215);h.userData.startVec=s,h.userData.endVec=l,h.userData.direct_vector=u.subVectors(l,s),t.userData.axle_wire=h;var c={positions:h.geometry.vertices,fov:t.FOV,distance:t.DISTANCE,quaternion:t.quaternion};this.sRender.emit("virtual-update-position",c),this.computeRotateAngle(t)}},h.prototype.switchSpaceDataVisible=function(t,e){var i=t.userData.space_data;if(i&&0<i.length)for(var n=0,r=i.length;n<r;++n){var o=i[n];if(o.visible=e,o.userData.label)o.userData.label.visible=e}},h.prototype.destroyAxleWire=function(t){var e=t.userData.axle_wire;e&&(e.material&&e.material.dispose(),e.geometry&&e.geometry.dispose(),this.sRender.scene.remove(e),t.userData.axle_wire=null)},h.prototype.destroyBoxHelper=function(t){var e=t.userData.box_helper;e&&(e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose(),this.sRender.scene.remove(e),t.userData.box_helper=null)},h.prototype.destroyControl=function(t){var e=t.userData.transform_control;e&&(t.userData.handle_choosed=!1,t.userData.transform_control=null,e.dispose(),e.detach(),this.sRender.scene.remove(e),this.controls.splice(this.controls.indexOf(e),1))},h.prototype.destroyPositionLine=function(){if(this.sRender.scene.userData.position_line){var t=this.sRender.scene.userData.position_line;this.sRender.scene.userData.position_line=null,this.sRender.scene.remove(t),t.geometry.dispose(),t.material.dispose()}},h.prototype.destroyModelControlState=function(t){(t=t||this.VIRTUAL_CAMERA)&&(this.destroyBoxHelper(t),this.destroyControl(t),this.VIRTUAL_CAMERA=null,this.player.emit("hidePutModelSetTools"),this.player.emit("hidePutModelInfoPanel"),this.emitter.emit("virtualCamera-unchoosed"))},h.prototype.destroyModelFromScene=function(t){(t=t||this.VIRTUAL_CAMERA)&&(this.destroyBoxHelper(t),this.destroyControl(t),t.traverse((function(t){t.material&&t.material.dispose(),t.geometry&&t.geometry.dispose()})),this.sRender.scene.remove(t),this.destroyPlaceMonitor(t),this.destroyCrossFace(t),this.destroyAxleWire(t))},h.prototype.destroyPlaceMonitor=function(t){var e=t.userData.cone,i=e.userData.place_monitor;i&&(i.traverse((function(t){t.isMesh&&(t.geometry.dispose(),t.material.dispose())})),this.sRender.scene.remove(i),e.userData.place_monitor=null)},h.prototype.destroyCrossFace=function(t){var e=t.userData.face_group;e&&(e.traverse((function(t){t.isMesh&&(t.geometry.dispose(),t.material.dispose())})),this.sRender.scene.remove(e),t.userData.face_group=null)},h.prototype.destroySpaceData=function(t){t.userData.virtual_camera.material.opacity=1;var e=t.userData.space_data,i=t.userData.setting_item;if(e&&0<e.length){for(var n=0,r=e.length;n<r;++n){var o=e[n];if(o.geometry&&o.geometry.dispose(),o.material&&o.material.dispose(),this.sRender.scene.remove(o),o.userData.label){var a=o.userData.label;a.geometry&&a.geometry.dispose(),a.material&&a.material.dispose(),this.sRender.scene.remove(a)}}i.hasSpaceData=!1}e=[],t.userData.space_data=[]},h.prototype.restoreOriginSetting=function(){if(this.VIRTUAL_CAMERA){var t=this.VIRTUAL_CAMERA,e=t.userData.cone,i=t.userData.setting_item;this.destroyPlaceMonitor(t),this.destroyCrossFace(t),t.FOV=i.FOV_MIN,t.DISTANCE=i.DISTANCE_MIN,e.visible=!0,i.FOV=i.FOV_MIN,i.DISTANCE=i.DISTANCE_MIN,this.player.emit("resetPutModelInfo",i),this.updateAxleWire(t)}},h.prototype.updateBoxHelper=function(t){var e=t.userData.box_helper;e&&e.update()},h.prototype.updateControlPosition=function(t,e){t.currentWorldPosition.copy(e)},h.prototype.updateSetToolsPosition=function(t){var e=t.position.clone().applyMatrix4(t.matrixWorld);if(o.computeWorldPositionOutCamera(e.clone(),this.sRender.camera))t.userData.out_screen=!0,this.player.emit("hidePutModelSetTools");else{t.userData.out_screen=!1;var i=o.convertWorldPositionToScreen(e,this.sRender.camera);this.player.emit("setPutModelToolsPosition",i)}},h.prototype.updateVirtualCameraFov=function(t){var e=this.VIRTUAL_CAMERA;e&&(e.userData.cone.visible=!0,e.FOV=t,this.updateAxleWire(e),this.destroyPlaceMonitor(e),this.destroyCrossFace(e))},h.prototype.updateVirtualCameraDistance=function(t){var e=this.VIRTUAL_CAMERA;e&&(e.userData.cone.visible=!0,e.DISTANCE=t,this.updateAxleWire(e),this.destroyPlaceMonitor(e),this.destroyCrossFace(e))},h.prototype.updateModelName=function(t){if(this.VIRTUAL_CAMERA){this.VIRTUAL_CAMERA.userData.virtual_camera;this.VIRTUAL_CAMERA.userData.setting_item.modelName=t}},h.prototype.updateLabelPosition=function(t,e){var i=t.userData.virtual_camera,n=i.position.clone().applyMatrix4(i.matrixWorld);o.computeWorldPositionOutCamera(n,this.sRender.camera)?e.isLabelShow=!1:t.userData.handle_choosed||(e.isLabelShow=!0);var r=o.convertWorldPositionToScreen(n,this.sRender.camera);e.labelPosition2=r},h.prototype.updateAllLabelPosition=function(t,e){if(0<t.length)for(var i=t,n=0,r=i.length;n<r;++n){var o=i[n],a=o.userData.setting_item;e&&(a.isLabelShow=!0),this.updateLabelPosition(o,a),this.initLabel(a)}},h.prototype.updateAxleWire=function(t,e){this.destroyAxleWire(t),this.addAxleWire(t,e)},h.prototype.update=function(){if(0<this.controls.length)for(var t=0,e=this.controls.length;t<e;++t)this.controls[t].update();this.VIRTUAL_CAMERA&&(this.updateBoxHelper(this.VIRTUAL_CAMERA),this.VIRTUAL_CAMERA.userData.cone.material.clippingPlanes=this.sRender.clipPlanes);this.player&&0===this.colliders.length&&(this.colliders=this.player.model.floors.reduce((function(t,e){return e.hidden?t:t.concat(e.collider.children)}),[]))},t.exports=h},function(t,e,i){"use strict";var n=i(0),r=i(13);function o(t){n.Sprite.call(this),this.geometry=new n.PlaneBufferGeometry,this.init(t)}o.prototype=Object.create(n.Sprite.prototype),o.prototype.init=function(t){var e=r.initCanvasLabel(t,"rgba( 255, 255, 255, 1 )","rgba( 0, 0, 0, 1 )"),i=e.texture,o=e.canvas;this.width=o.width,this.height=o.height,this.material=new n.ShaderMaterial({uniforms:{tDiffuse:{value:i},width:{value:o.width},height:{value:o.height},domWidth:{value:t.renderDom.width},domHeight:{value:t.renderDom.height}},vertexShader:["precision highp float;","uniform float width;","uniform float height;","uniform float domWidth;","uniform float domHeight;","varying vec2 vUv;","void main() {","vUv = uv;","vec4 proj = projectionMatrix * modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0);","gl_Position = vec4(","proj.x / proj.w + position.x * width / domWidth * 2.0,","proj.y / proj.w + position.y * height / domHeight * 2.0,","proj.z / proj.w,","1.0",");","}"].join("\n"),fragmentShader:["precision highp float;","uniform sampler2D tDiffuse;","uniform float width;","uniform float height;","varying vec2 vUv;","void main() {","vec2 _uv = vec2(","(floor(vUv.s * width) + 0.5) / width,","(floor(vUv.t * height) + 0.5) / height",");","gl_FragColor = texture2D( tDiffuse, _uv );","}"].join("\n"),transparent:!0})},t.exports=o},function(t,e,i){"use strict";var n=i(0),r=(i(142),i(13));function o(t){this._canbeUsed=!1,this.player=t,this.HUMAN=null,this.INTERSETCT_SKIN=null,this.ray=new n.Raycaster,this.clock=new n.Clock,this.MOUSE={btn_0:"LEFT_BUTTON",btn_2:"RIGHT_BUTTON"},this.startPosition=new n.Vector3,this.mixer=null,this.actions=[],this.idleAction=null,this.walkAction=null,this.actionMode="",this.walkSpeed=.022,this.defineProperty(),this.initStateEngine(),this.endPosition=null}o.prototype.defineProperty=function(){Object.defineProperty(this,"canbeUsed",{get:function(){return this._canbeUsed},set:function(t){this._canbeUsed=t}})},o.prototype.init=function(t){this.HUMAN=t,this.HUMAN.userData.skeleton_box=null,this.HUMAN.userData.skeleton_helper=null,this.initSkeletonHelper(this.HUMAN),this.initSkeletonBox(this.HUMAN)},o.prototype.initStateEngine=function(){this.ActionStateEngine={WALK:{state:!1,status:{start_fade:{state:!1,callback:this.runFadeOfIdleToWalk},fading:function(){},end_fade:{state:!1,callback:this.runFadeOfIdleToWalkEnd}}},IDLE:{state:!1,status:{start_fade:{state:!1,callback:this.runFadeOfWalkToIdle},fading:function(){},end_fade:{state:!1,callback:this.runFadeOfWalkToIdleEnd}}}},this.MouseStateMachine={LEFT_BUTTON:{state:!1,status:{mousedown:{state:!1,callback:this.handleMouseLeftButtonDown},mouseup:{state:!1,callback:this.handleMouseLeftButtonUp}}},RIGHT_BUTTON:{state:!1,status:{mousedown:{state:!1,callback:function(){}},mouseup:{state:!1,callback:this.handleMouseRightButtonUp}}},MOVE:{state:!1,callback:this.handleMouseMove},LEAVE:{state:!1,callback:function(){}}}},o.prototype.initSkeletonHelper=function(t){if(!t.userData.skeleton_helper){var e=new n.SkeletonHelper(t);t.userData.skeleton_helper=e,this.player.sRender.scene.add(e)}},o.prototype.initSkeletonBox=function(t){if(!t.userData.skeleton_box){var e=t.userData.skeleton_helper,i=new n.BoxHelper(e,5756395);i.geometry.computeBoundingBox(),i.userData.bottom_center_position=null,t.userData.skeleton_box=i,this.player.sRender.scene.add(i)}};o.prototype.initAction=function(t){this.mixer=new n.AnimationMixer(t),t.userData.mixer=this.mixer,this.idleAction=this.mixer.clipAction(this.HUMAN.animations[0]),this.walkAction=this.mixer.clipAction(this.HUMAN.animations[3]),this.idleAction.name="idle",this.walkAction.name="walk",this.actions=[this.idleAction,this.walkAction],this.activateAllActions()},o.prototype.handleWalk=function(){this.ActionStateEngine.WALK.state||(this.ActionStateEngine.WALK.state=!0,this.ActionStateEngine.IDLE.state=!1,this.ActionStateEngine.IDLE.status.start_fade.state=!1,this.ActionStateEngine.IDLE.status.end_fade.state=!1,this.ActionStateEngine.WALK.status.start_fade.callback.call(this,0))},o.prototype.handleWalkAssign=function(t){this.endPosition=t},o.prototype.handleIdle=function(){this.ActionStateEngine.IDLE.state||(this.ActionStateEngine.IDLE.state=!0,this.ActionStateEngine.WALK.state=!1,this.ActionStateEngine.WALK.status.start_fade.state=!1,this.ActionStateEngine.WALK.status.end_fade.state=!1,this.ActionStateEngine.IDLE.status.start_fade.callback.call(this,0))},o.prototype.handleMouseMove=function(){this.HUMAN&&this.HUMAN.userData.follow_mouse&&this.HUMAN.position.copy(this.player.intersect.point)},o.prototype.handleMouseLeftButtonDown=function(){if(this.HUMAN&&!this.HUMAN.userData.follow_mouse){this.player.disableNavigator=!0;var t=r.drawLine(this.HUMAN.position,this.player.intersect.point,255);this.player.sRender.scene.add(t),this.player.sRender.scene.userData.walk_line=t,this.HUMAN.lookAt(this.player.intersect.point),this.HUMAN.rotateY(Math.PI),this.startPosition=this.HUMAN.position.clone(),this.handleWalk()}},o.prototype.handleMouseLeftButtonUp=function(){var t=this.player.sRender.scene.userData.walk_line;t&&(t.geometry.dispose(),t.material.dispose(),this.player.sRender.scene.remove(t),this.player.sRender.scene.userData.walk_line=null),this.HUMAN&&(this.handleIdle(),this.player.disableNavigator=!0)},o.prototype.handleMouseRightButtonUp=function(){this.HUMAN&&this.HUMAN.userData.follow_mouse&&(this.HUMAN.userData.follow_mouse=!1,this.initAction(this.HUMAN))},o.prototype.runFadeOfIdleToWalk=function(t){var e=this;this.setWeight(this.walkAction,1),this.ActionStateEngine.WALK.status.start_fade.state=!0,this.ActionStateEngine.WALK.status.end_fade.state=!1,this.idleAction.crossFadeTo(this.walkAction,t,!0);var i=setTimeout((function(){e.ActionStateEngine.WALK.status.start_fade.state=!1,e.ActionStateEngine.WALK.status.end_fade.state=!0,e.ActionStateEngine.WALK.status.end_fade.callback.call(e),clearTimeout(i)}),1e3*t)},o.prototype.runFadeOfIdleToWalkEnd=function(){},o.prototype.runFadeOfWalkToIdle=function(t){var e=this;this.setWeight(this.idleAction,1),this.ActionStateEngine.IDLE.status.start_fade.state=!0,this.ActionStateEngine.IDLE.status.end_fade.state=!1,this.walkAction.crossFadeTo(this.idleAction,.5,!0);var i=setTimeout((function(){e.ActionStateEngine.IDLE.status.start_fade.state=!1,e.ActionStateEngine.IDLE.status.end_fade.state=!0,e.ActionStateEngine.IDLE.status.end_fade.callback.call(e),clearTimeout(i)}),1e3*t)},o.prototype.runFadeOfWalkToIdleEnd=function(){},o.prototype.runActionOfWalk=function(t,e){t.distanceTo(e);var i=e.clone().sub(t).normalize();this.HUMAN.position.add(i.clone().multiplyScalar(1.4*this.walkSpeed))},o.prototype.activateAllActions=function(){this.setWeight(this.idleAction,1),this.setWeight(this.walkAction,0),this.actions.forEach((function(t){t.play()}))},o.prototype.setWeight=function(t,e){t.enabled=!0,t.setEffectiveTimeScale(1),t.setEffectiveWeight(e),1===e&&(this.actionMode=t.name)},o.prototype.onPlayerMouseMove=function(t){this.MouseStateMachine.MOVE.state=!0,this.MouseStateMachine.MOVE.callback.call(this)},o.prototype.onPlayerMouseDown=function(t){var e=t.button,i=this.MOUSE["btn_"+e];this.MouseStateMachine.MOVE.state=!1,i&&(this.MouseStateMachine[i].state=!0,this.MouseStateMachine[i].status.mousedown.state=!0,this.MouseStateMachine[i].status.mouseup.state=!1,this.MouseStateMachine[i].status.mousedown.callback.call(this))},o.prototype.onPlayerMouseUp=function(t){var e=t.button,i=this.MOUSE["btn_"+e];this.MouseStateMachine.MOVE.state=!1,i&&(this.MouseStateMachine[i].state=!0,this.MouseStateMachine[i].status.mousedown.state=!1,this.MouseStateMachine[i].status.mouseup.state=!0,this.MouseStateMachine[i].status.mouseup.callback.call(this))},o.prototype.updateSkeletonBox=function(t){var e=t.userData.skeleton_box;if(e){e.update(),e.geometry.computeBoundingBox();var i=e.geometry.boundingBox,r=i.getCenter(new n.Vector3),o=i.getSize(new n.Vector3),a=new n.Vector3(r.x,r.y-.5*o.y,r.z);e.userData.bottom_center_position=a}};o.prototype.updateHumanPosition=function(){if(this.HUMAN){var t=this.HUMAN.userData.skeleton_box;if(t)t.userData.bottom_center_position.applyMatrix4(this.HUMAN.matrix),this.HUMAN.position.copy(new n.Vector3(this.HUMAN.position.x,this.HUMAN.position.y,this.HUMAN.position.z))}},o.prototype.update=function(){var t=this.clock.getDelta();if(this.HUMAN){this.updateSkeletonBox(this.HUMAN);var e=this.HUMAN.userData.mixer;e&&e.update(t),this.ActionStateEngine.WALK.status.end_fade.state&&(this.endPosition?this.runActionOfWalk(this.startPosition,this.endPosition):this.player.intersect.point&&this.runActionOfWalk(this.startPosition,this.player.intersect.point))}},t.exports=o},function(t,e,i){t.exports=function(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={exports:{},id:n,loaded:!1};return t[n].call(r.exports,r,r.exports,e),r.loaded=!0,r.exports}var i={};return e.m=t,e.c=i,e.p="",e(0)}([function(t,e,i){"use strict";var n=function(t){return t&&t.__esModule?t:{default:t}}(i(1));t.exports=n.default},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var r=n(i(2)),o=n(i(6)),a=n(i(3)),s=n(i(7)),l=n(i(8)),u=n(i(10)),h=n(i(11)),c=n(i(12)),d=n(i(13)),p=n(i(14)),f=n(i(15)),m=n(i(16)),g=n(i(9)),v=n(i(17));e.default={color:{Color:r.default,math:o.default,interpret:a.default},controllers:{Controller:s.default,BooleanController:l.default,OptionController:u.default,StringController:h.default,NumberController:c.default,NumberControllerBox:d.default,NumberControllerSlider:p.default,FunctionController:f.default,ColorController:m.default},dom:{dom:g.default},gui:{GUI:v.default},GUI:v.default}},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,i){Object.defineProperty(t,e,{get:function(){return"RGB"===this.__state.space||c.recalculateRGB(this,e,i),this.__state[e]},set:function(t){"RGB"!==this.__state.space&&(c.recalculateRGB(this,e,i),this.__state.space="RGB"),this.__state[e]=t}})}function a(t,e){Object.defineProperty(t,e,{get:function(){return"HSV"===this.__state.space||c.recalculateHSV(this),this.__state[e]},set:function(t){"HSV"!==this.__state.space&&(c.recalculateHSV(this),this.__state.space="HSV"),this.__state[e]=t}})}e.__esModule=!0;var s=n(i(3)),l=n(i(6)),u=n(i(4)),h=n(i(5)),c=function(){function t(){if(r(this,t),this.__state=s.default.apply(this,arguments),!1===this.__state)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}return t.prototype.toString=function(){return(0,u.default)(this)},t.prototype.toHexString=function(){return(0,u.default)(this,!0)},t.prototype.toOriginal=function(){return this.__state.conversion.write(this)},t}();c.recalculateRGB=function(t,e,i){if("HEX"===t.__state.space)t.__state[e]=l.default.component_from_hex(t.__state.hex,i);else{if("HSV"!==t.__state.space)throw new Error("Corrupted color state");h.default.extend(t.__state,l.default.hsv_to_rgb(t.__state.h,t.__state.s,t.__state.v))}},c.recalculateHSV=function(t){var e=l.default.rgb_to_hsv(t.r,t.g,t.b);h.default.extend(t.__state,{s:e.s,v:e.v}),h.default.isNaN(e.h)?h.default.isUndefined(t.__state.h)&&(t.__state.h=0):t.__state.h=e.h},c.COMPONENTS=["r","g","b","h","s","v","hex","a"],o(c.prototype,"r",2),o(c.prototype,"g",1),o(c.prototype,"b",0),a(c.prototype,"h"),a(c.prototype,"s"),a(c.prototype,"v"),Object.defineProperty(c.prototype,"a",{get:function(){return this.__state.a},set:function(t){this.__state.a=t}}),Object.defineProperty(c.prototype,"hex",{get:function(){return"HEX"!==!this.__state.space&&(this.__state.hex=l.default.rgb_to_hex(this.r,this.g,this.b)),this.__state.hex},set:function(t){this.__state.space="HEX",this.__state.hex=t}}),e.default=c},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var r=n(i(4)),o=n(i(5)),a=[{litmus:o.default.isString,conversions:{THREE_CHAR_HEX:{read:function(t){var e=t.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null!==e&&{space:"HEX",hex:parseInt("0x"+e[1].toString()+e[1].toString()+e[2].toString()+e[2].toString()+e[3].toString()+e[3].toString(),0)}},write:r.default},SIX_CHAR_HEX:{read:function(t){var e=t.match(/^#([A-F0-9]{6})$/i);return null!==e&&{space:"HEX",hex:parseInt("0x"+e[1].toString(),0)}},write:r.default},CSS_RGB:{read:function(t){var e=t.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==e&&{space:"RGB",r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3])}},write:r.default},CSS_RGBA:{read:function(t){var e=t.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);return null!==e&&{space:"RGB",r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3]),a:parseFloat(e[4])}},write:r.default}}},{litmus:o.default.isNumber,conversions:{HEX:{read:function(t){return{space:"HEX",hex:t,conversionName:"HEX"}},write:function(t){return t.hex}}}},{litmus:o.default.isArray,conversions:{RGB_ARRAY:{read:function(t){return 3===t.length&&{space:"RGB",r:t[0],g:t[1],b:t[2]}},write:function(t){return[t.r,t.g,t.b]}},RGBA_ARRAY:{read:function(t){return 4===t.length&&{space:"RGB",r:t[0],g:t[1],b:t[2],a:t[3]}},write:function(t){return[t.r,t.g,t.b,t.a]}}}},{litmus:o.default.isObject,conversions:{RGBA_OBJ:{read:function(t){return!!(o.default.isNumber(t.r)&&o.default.isNumber(t.g)&&o.default.isNumber(t.b)&&o.default.isNumber(t.a))&&{space:"RGB",r:t.r,g:t.g,b:t.b,a:t.a}},write:function(t){return{r:t.r,g:t.g,b:t.b,a:t.a}}},RGB_OBJ:{read:function(t){return!!(o.default.isNumber(t.r)&&o.default.isNumber(t.g)&&o.default.isNumber(t.b))&&{space:"RGB",r:t.r,g:t.g,b:t.b}},write:function(t){return{r:t.r,g:t.g,b:t.b}}},HSVA_OBJ:{read:function(t){return!!(o.default.isNumber(t.h)&&o.default.isNumber(t.s)&&o.default.isNumber(t.v)&&o.default.isNumber(t.a))&&{space:"HSV",h:t.h,s:t.s,v:t.v,a:t.a}},write:function(t){return{h:t.h,s:t.s,v:t.v,a:t.a}}},HSV_OBJ:{read:function(t){return!!(o.default.isNumber(t.h)&&o.default.isNumber(t.s)&&o.default.isNumber(t.v))&&{space:"HSV",h:t.h,s:t.s,v:t.v}},write:function(t){return{h:t.h,s:t.s,v:t.v}}}}}],s=void 0,l=void 0;e.default=function(){l=!1;var t=arguments.length>1?o.default.toArray(arguments):arguments[0];return o.default.each(a,(function(e){if(e.litmus(t))return o.default.each(e.conversions,(function(e,i){if(s=e.read(t),!1===l&&!1!==s)return l=s,s.conversionName=i,s.conversion=e,o.default.BREAK})),o.default.BREAK})),l}},function(t,e){"use strict";e.__esModule=!0,e.default=function(t,e){var i=t.__state.conversionName.toString(),n=Math.round(t.r),r=Math.round(t.g),o=Math.round(t.b),a=t.a,s=Math.round(t.h),l=t.s.toFixed(1),u=t.v.toFixed(1);if(e||"THREE_CHAR_HEX"===i||"SIX_CHAR_HEX"===i){for(var h=t.hex.toString(16);h.length<6;)h="0"+h;return"#"+h}return"CSS_RGB"===i?"rgb("+n+","+r+","+o+")":"CSS_RGBA"===i?"rgba("+n+","+r+","+o+","+a+")":"HEX"===i?"0x"+t.hex.toString(16):"RGB_ARRAY"===i?"["+n+","+r+","+o+"]":"RGBA_ARRAY"===i?"["+n+","+r+","+o+","+a+"]":"RGB_OBJ"===i?"{r:"+n+",g:"+r+",b:"+o+"}":"RGBA_OBJ"===i?"{r:"+n+",g:"+r+",b:"+o+",a:"+a+"}":"HSV_OBJ"===i?"{h:"+s+",s:"+l+",v:"+u+"}":"HSVA_OBJ"===i?"{h:"+s+",s:"+l+",v:"+u+",a:"+a+"}":"unknown format"}},function(t,e){"use strict";e.__esModule=!0;var i=Array.prototype.forEach,n=Array.prototype.slice,r={BREAK:{},extend:function(t){return this.each(n.call(arguments,1),(function(e){(this.isObject(e)?Object.keys(e):[]).forEach(function(i){this.isUndefined(e[i])||(t[i]=e[i])}.bind(this))}),this),t},defaults:function(t){return this.each(n.call(arguments,1),(function(e){(this.isObject(e)?Object.keys(e):[]).forEach(function(i){this.isUndefined(t[i])&&(t[i]=e[i])}.bind(this))}),this),t},compose:function(){var t=n.call(arguments);return function(){for(var e=n.call(arguments),i=t.length-1;i>=0;i--)e=[t[i].apply(this,e)];return e[0]}},each:function(t,e,n){if(t)if(i&&t.forEach&&t.forEach===i)t.forEach(e,n);else if(t.length===t.length+0){var r,o=void 0;for(o=0,r=t.length;o<r;o++)if(o in t&&e.call(n,t[o],o)===this.BREAK)return}else for(var a in t)if(e.call(n,t[a],a)===this.BREAK)return},defer:function(t){setTimeout(t,0)},debounce:function(t,e){var i=void 0;return function(){function n(){i=null}var r=this,o=arguments,a=!i;clearTimeout(i),i=setTimeout(n,e),a&&t.apply(r,o)}},toArray:function(t){return t.toArray?t.toArray():n.call(t)},isUndefined:function(t){return void 0===t},isNull:function(t){return null===t},isNaN:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){return isNaN(t)})),isArray:Array.isArray||function(t){return t.constructor===Array},isObject:function(t){return t===Object(t)},isNumber:function(t){return t===t+0},isString:function(t){return t===t+""},isBoolean:function(t){return!1===t||!0===t},isFunction:function(t){return"[object Function]"===Object.prototype.toString.call(t)}};e.default=r},function(t,e){"use strict";e.__esModule=!0;var i=void 0,n={hsv_to_rgb:function(t,e,i){var n=Math.floor(t/60)%6,r=t/60-Math.floor(t/60),o=i*(1-e),a=i*(1-r*e),s=i*(1-(1-r)*e),l=[[i,s,o],[a,i,o],[o,i,s],[o,a,i],[s,o,i],[i,o,a]][n];return{r:255*l[0],g:255*l[1],b:255*l[2]}},rgb_to_hsv:function(t,e,i){var n=Math.min(t,e,i),r=Math.max(t,e,i),o=r-n,a=void 0;return 0===r?{h:NaN,s:0,v:0}:(a=t===r?(e-i)/o:e===r?2+(i-t)/o:4+(t-e)/o,(a/=6)<0&&(a+=1),{h:360*a,s:o/r,v:r/255})},rgb_to_hex:function(t,e,i){var n=this.hex_with_component(0,2,t);return n=this.hex_with_component(n,1,e),this.hex_with_component(n,0,i)},component_from_hex:function(t,e){return t>>8*e&255},hex_with_component:function(t,e,n){return n<<(i=8*e)|t&~(255<<i)}};e.default=n},function(t,e){"use strict";e.__esModule=!0;var i=function(){function t(e,i){(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.initialValue=e[i],this.domElement=document.createElement("div"),this.object=e,this.property=i,this.__onChange=void 0,this.__onFinishChange=void 0}return t.prototype.onChange=function(t){return this.__onChange=t,this},t.prototype.onFinishChange=function(t){return this.__onFinishChange=t,this},t.prototype.setValue=function(t){return this.object[this.property]=t,this.__onChange&&this.__onChange.call(this,t),this.updateDisplay(),this},t.prototype.getValue=function(){return this.object[this.property]},t.prototype.updateDisplay=function(){return this},t.prototype.isModified=function(){return this.initialValue!==this.getValue()},t}();e.default=i},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var r=n(i(7)),o=n(i(9)),a=function(t){function e(i,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,i,n)),a=r;return r.__prev=r.getValue(),r.__checkbox=document.createElement("input"),r.__checkbox.setAttribute("type","checkbox"),o.default.bind(r.__checkbox,"change",(function(){a.setValue(!a.__prev)}),!1),r.domElement.appendChild(r.__checkbox),r.updateDisplay(),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.setValue=function(e){var i=t.prototype.setValue.call(this,e);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),i},e.prototype.updateDisplay=function(){return!0===this.getValue()?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0):this.__checkbox.checked=!1,t.prototype.updateDisplay.call(this)},e}(r.default);e.default=a},function(t,e,i){"use strict";function n(t){if("0"===t||r.default.isUndefined(t))return 0;var e=t.match(a);return r.default.isNull(e)?0:parseFloat(e[1])}e.__esModule=!0;var r=function(t){return t&&t.__esModule?t:{default:t}}(i(5)),o={};r.default.each({HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},(function(t,e){r.default.each(t,(function(t){o[t]=e}))}));var a=/(\d+(\.\d+)?)px/,s={makeSelectable:function(t,e){void 0!==t&&void 0!==t.style&&(t.onselectstart=e?function(){return!1}:function(){},t.style.MozUserSelect=e?"auto":"none",t.style.KhtmlUserSelect=e?"auto":"none",t.unselectable=e?"on":"off")},makeFullscreen:function(t,e,i){var n=i,o=e;r.default.isUndefined(o)&&(o=!0),r.default.isUndefined(n)&&(n=!0),t.style.position="absolute",o&&(t.style.left=0,t.style.right=0),n&&(t.style.top=0,t.style.bottom=0)},fakeEvent:function(t,e,i,n){var a=i||{},s=o[e];if(!s)throw new Error("Event type "+e+" not supported.");var l=document.createEvent(s);switch(s){case"MouseEvents":var u=a.x||a.clientX||0,h=a.y||a.clientY||0;l.initMouseEvent(e,a.bubbles||!1,a.cancelable||!0,window,a.clickCount||1,0,0,u,h,!1,!1,!1,!1,0,null);break;case"KeyboardEvents":var c=l.initKeyboardEvent||l.initKeyEvent;r.default.defaults(a,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),c(e,a.bubbles||!1,a.cancelable,window,a.ctrlKey,a.altKey,a.shiftKey,a.metaKey,a.keyCode,a.charCode);break;default:l.initEvent(e,a.bubbles||!1,a.cancelable||!0)}r.default.defaults(l,n),t.dispatchEvent(l)},bind:function(t,e,i,n){var r=n||!1;return t.addEventListener?t.addEventListener(e,i,r):t.attachEvent&&t.attachEvent("on"+e,i),s},unbind:function(t,e,i,n){var r=n||!1;return t.removeEventListener?t.removeEventListener(e,i,r):t.detachEvent&&t.detachEvent("on"+e,i),s},addClass:function(t,e){if(void 0===t.className)t.className=e;else if(t.className!==e){var i=t.className.split(/ +/);-1===i.indexOf(e)&&(i.push(e),t.className=i.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}return s},removeClass:function(t,e){if(e)if(t.className===e)t.removeAttribute("class");else{var i=t.className.split(/ +/),n=i.indexOf(e);-1!==n&&(i.splice(n,1),t.className=i.join(" "))}else t.className=void 0;return s},hasClass:function(t,e){return new RegExp("(?:^|\\s+)"+e+"(?:\\s+|$)").test(t.className)||!1},getWidth:function(t){var e=getComputedStyle(t);return n(e["border-left-width"])+n(e["border-right-width"])+n(e["padding-left"])+n(e["padding-right"])+n(e.width)},getHeight:function(t){var e=getComputedStyle(t);return n(e["border-top-width"])+n(e["border-bottom-width"])+n(e["padding-top"])+n(e["padding-bottom"])+n(e.height)},getOffset:function(t){var e=t,i={left:0,top:0};if(e.offsetParent)do{i.left+=e.offsetLeft,i.top+=e.offsetTop,e=e.offsetParent}while(e);return i},isActive:function(t){return t===document.activeElement&&(t.type||t.href)}};e.default=s},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var r=n(i(7)),o=n(i(9)),a=n(i(5)),s=function(t){function e(i,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,i,n)),l=r,u=s;return s.__select=document.createElement("select"),a.default.isArray(l)&&function(){var t={};a.default.each(l,(function(e){t[e]=e})),l=t}(),a.default.each(l,(function(t,e){var i=document.createElement("option");i.innerHTML=e,i.setAttribute("value",t),u.__select.appendChild(i)})),s.updateDisplay(),o.default.bind(s.__select,"change",(function(){var t=this.options[this.selectedIndex].value;u.setValue(t)})),s.domElement.appendChild(s.__select),s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.setValue=function(e){var i=t.prototype.setValue.call(this,e);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),i},e.prototype.updateDisplay=function(){return o.default.isActive(this.__select)?this:(this.__select.value=this.getValue(),t.prototype.updateDisplay.call(this))},e}(r.default);e.default=s},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var r=n(i(7)),o=n(i(9)),a=function(t){function e(i,n){function r(){s.setValue(s.__input.value)}!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var a=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,i,n)),s=a;return a.__input=document.createElement("input"),a.__input.setAttribute("type","text"),o.default.bind(a.__input,"keyup",r),o.default.bind(a.__input,"change",r),o.default.bind(a.__input,"blur",(function(){s.__onFinishChange&&s.__onFinishChange.call(s,s.getValue())})),o.default.bind(a.__input,"keydown",(function(t){13===t.keyCode&&this.blur()})),a.updateDisplay(),a.domElement.appendChild(a.__input),a}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.updateDisplay=function(){return o.default.isActive(this.__input)||(this.__input.value=this.getValue()),t.prototype.updateDisplay.call(this)},e}(r.default);e.default=a},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function r(t){var e=t.toString();return e.indexOf(".")>-1?e.length-e.indexOf(".")-1:0}e.__esModule=!0;var o=n(i(7)),a=n(i(5)),s=function(t){function e(i,n,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,i,n)),l=o||{};return s.__min=l.min,s.__max=l.max,s.__step=l.step,a.default.isUndefined(s.__step)?0===s.initialValue?s.__impliedStep=1:s.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(s.initialValue))/Math.LN10))/10:s.__impliedStep=s.__step,s.__precision=r(s.__impliedStep),s}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.setValue=function(e){var i=e;return void 0!==this.__min&&i<this.__min?i=this.__min:void 0!==this.__max&&i>this.__max&&(i=this.__max),void 0!==this.__step&&i%this.__step!=0&&(i=Math.round(i/this.__step)*this.__step),t.prototype.setValue.call(this,i)},e.prototype.min=function(t){return this.__min=t,this},e.prototype.max=function(t){return this.__max=t,this},e.prototype.step=function(t){return this.__step=t,this.__impliedStep=t,this.__precision=r(t),this},e}(o.default);e.default=s},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var r=n(i(12)),o=n(i(9)),a=n(i(5)),s=function(t){function e(i,n,r){function s(){c.__onFinishChange&&c.__onFinishChange.call(c,c.getValue())}function l(t){var e=d-t.clientY;c.setValue(c.getValue()+e*c.__impliedStep),d=t.clientY}function u(){o.default.unbind(window,"mousemove",l),o.default.unbind(window,"mouseup",u),s()}!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var h=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,i,n,r));h.__truncationSuspended=!1;var c=h,d=void 0;return h.__input=document.createElement("input"),h.__input.setAttribute("type","text"),o.default.bind(h.__input,"change",(function(){var t=parseFloat(c.__input.value);a.default.isNaN(t)||c.setValue(t)})),o.default.bind(h.__input,"blur",(function(){s()})),o.default.bind(h.__input,"mousedown",(function(t){o.default.bind(window,"mousemove",l),o.default.bind(window,"mouseup",u),d=t.clientY})),o.default.bind(h.__input,"keydown",(function(t){13===t.keyCode&&(c.__truncationSuspended=!0,this.blur(),c.__truncationSuspended=!1,s())})),h.updateDisplay(),h.domElement.appendChild(h.__input),h}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.updateDisplay=function(){return this.__input.value=this.__truncationSuspended?this.getValue():function(t,e){var i=Math.pow(10,e);return Math.round(t*i)/i}(this.getValue(),this.__precision),t.prototype.updateDisplay.call(this)},e}(r.default);e.default=s},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var r=n(i(12)),o=n(i(9)),a=function(t){function e(i,n,r,a,s){function l(t){t.preventDefault();var e=c.__background.getBoundingClientRect();return c.setValue(function(t,e,i,n,r){return n+(t-e)/(i-e)*(r-n)}(t.clientX,e.left,e.right,c.__min,c.__max)),!1}function u(){o.default.unbind(window,"mousemove",l),o.default.unbind(window,"mouseup",u),c.__onFinishChange&&c.__onFinishChange.call(c,c.getValue())}!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var h=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,i,n,{min:r,max:a,step:s})),c=h;return h.__background=document.createElement("div"),h.__foreground=document.createElement("div"),o.default.bind(h.__background,"mousedown",(function(t){document.activeElement.blur(),o.default.bind(window,"mousemove",l),o.default.bind(window,"mouseup",u),l(t)})),o.default.addClass(h.__background,"slider"),o.default.addClass(h.__foreground,"slider-fg"),h.updateDisplay(),h.__background.appendChild(h.__foreground),h.domElement.appendChild(h.__background),h}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.updateDisplay=function(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+"%",t.prototype.updateDisplay.call(this)},e}(r.default);e.default=a},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var r=n(i(7)),o=n(i(9)),a=function(t){function e(i,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var a=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,i,n)),s=a;return a.__button=document.createElement("div"),a.__button.innerHTML=void 0===r?"Fire":r,o.default.bind(a.__button,"click",(function(t){return t.preventDefault(),s.fire(),!1})),o.default.addClass(a.__button,"button"),a.domElement.appendChild(a.__button),a}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.fire=function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())},e}(r.default);e.default=a},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function r(t,e,i,n){t.style.background="",u.default.each(c,(function(r){t.style.cssText+="background: "+r+"linear-gradient("+e+", "+i+" 0%, "+n+" 100%); "}))}e.__esModule=!0;var o=n(i(7)),a=n(i(9)),s=n(i(2)),l=n(i(3)),u=n(i(5)),h=function(t){function e(i,n){function o(t){f(t),a.default.bind(window,"mousemove",f),a.default.bind(window,"mouseup",h)}function h(){a.default.unbind(window,"mousemove",f),a.default.unbind(window,"mouseup",h),p()}function c(){var t=(0,l.default)(this.value);!1!==t?(v.__color.__state=t,v.setValue(v.__color.toOriginal())):this.value=v.__color.toString()}function d(){a.default.unbind(window,"mousemove",m),a.default.unbind(window,"mouseup",d),p()}function p(){v.__onFinishChange&&v.__onFinishChange.call(v,v.__color.toOriginal())}function f(t){t.preventDefault();var e=v.__saturation_field.getBoundingClientRect(),i=(t.clientX-e.left)/(e.right-e.left),n=1-(t.clientY-e.top)/(e.bottom-e.top);return n>1?n=1:n<0&&(n=0),i>1?i=1:i<0&&(i=0),v.__color.v=n,v.__color.s=i,v.setValue(v.__color.toOriginal()),!1}function m(t){t.preventDefault();var e=v.__hue_field.getBoundingClientRect(),i=1-(t.clientY-e.top)/(e.bottom-e.top);return i>1?i=1:i<0&&(i=0),v.__color.h=360*i,v.setValue(v.__color.toOriginal()),!1}!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var g=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,t.call(this,i,n));g.__color=new s.default(g.getValue()),g.__temp=new s.default(0);var v=g;g.domElement=document.createElement("div"),a.default.makeSelectable(g.domElement,!1),g.__selector=document.createElement("div"),g.__selector.className="selector",g.__saturation_field=document.createElement("div"),g.__saturation_field.className="saturation-field",g.__field_knob=document.createElement("div"),g.__field_knob.className="field-knob",g.__field_knob_border="2px solid ",g.__hue_knob=document.createElement("div"),g.__hue_knob.className="hue-knob",g.__hue_field=document.createElement("div"),g.__hue_field.className="hue-field",g.__input=document.createElement("input"),g.__input.type="text",g.__input_textShadow="0 1px 1px ",a.default.bind(g.__input,"keydown",(function(t){13===t.keyCode&&c.call(this)})),a.default.bind(g.__input,"blur",c),a.default.bind(g.__selector,"mousedown",(function(){a.default.addClass(this,"drag").bind(window,"mouseup",(function(){a.default.removeClass(v.__selector,"drag")}))}));var y=document.createElement("div");return u.default.extend(g.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),u.default.extend(g.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:g.__field_knob_border+(g.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),u.default.extend(g.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),u.default.extend(g.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),u.default.extend(y.style,{width:"100%",height:"100%",background:"none"}),r(y,"top","rgba(0,0,0,0)","#000"),u.default.extend(g.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),function(t){t.style.background="",t.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",t.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",t.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",t.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",t.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"}(g.__hue_field),u.default.extend(g.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:g.__input_textShadow+"rgba(0,0,0,0.7)"}),a.default.bind(g.__saturation_field,"mousedown",o),a.default.bind(g.__field_knob,"mousedown",o),a.default.bind(g.__hue_field,"mousedown",(function(t){m(t),a.default.bind(window,"mousemove",m),a.default.bind(window,"mouseup",d)})),g.__saturation_field.appendChild(y),g.__selector.appendChild(g.__field_knob),g.__selector.appendChild(g.__saturation_field),g.__selector.appendChild(g.__hue_field),g.__hue_field.appendChild(g.__hue_knob),g.domElement.appendChild(g.__input),g.domElement.appendChild(g.__selector),g.updateDisplay(),g}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.updateDisplay=function(){var t=(0,l.default)(this.getValue());if(!1!==t){var e=!1;u.default.each(s.default.COMPONENTS,(function(i){if(!u.default.isUndefined(t[i])&&!u.default.isUndefined(this.__color.__state[i])&&t[i]!==this.__color.__state[i])return e=!0,{}}),this),e&&u.default.extend(this.__color.__state,t)}u.default.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var i=this.__color.v<.5||this.__color.s>.5?255:0,n=255-i;u.default.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+i+","+i+","+i+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,r(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),u.default.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+i+","+i+","+i+")",textShadow:this.__input_textShadow+"rgba("+n+","+n+","+n+",.7)"})},e}(o.default),c=["-moz-","-o-","-webkit-","-ms-",""];e.default=h},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function r(t,e,i){var n=document.createElement("li");return e&&n.appendChild(e),i?t.__ul.insertBefore(n,i):t.__ul.appendChild(n),t.onResize(),n}function o(t,e){var i=t.__preset_select[t.__preset_select.selectedIndex];i.innerHTML=e?i.value+"*":i.value}function a(t,e,i){if(i.__li=e,i.__gui=t,C.default.extend(i,{options:function(e){if(arguments.length>1){var n=i.__li.nextElementSibling;return i.remove(),l(t,i.object,i.property,{before:n,factoryArgs:[C.default.toArray(arguments)]})}if(C.default.isArray(e)||C.default.isObject(e)){var r=i.__li.nextElementSibling;return i.remove(),l(t,i.object,i.property,{before:r,factoryArgs:[e]})}},name:function(t){return i.__li.firstElementChild.firstElementChild.innerHTML=t,i},listen:function(){return i.__gui.listen(i),i},remove:function(){return i.__gui.remove(i),i}}),i instanceof T.default)!function(){var t=new M.default(i.object,i.property,{min:i.__min,max:i.__max,step:i.__step});C.default.each(["updateDisplay","onChange","onFinishChange","step"],(function(e){var n=i[e],r=t[e];i[e]=t[e]=function(){var e=Array.prototype.slice.call(arguments);return r.apply(t,e),n.apply(i,e)}})),P.default.addClass(e,"has-slider"),i.domElement.insertBefore(t.domElement,i.domElement.firstElementChild)}();else if(i instanceof M.default){var n=function(e){if(C.default.isNumber(i.__min)&&C.default.isNumber(i.__max)){var n=i.__li.firstElementChild.firstElementChild.innerHTML,r=i.__gui.__listening.indexOf(i)>-1;i.remove();var o=l(t,i.object,i.property,{before:i.__li.nextElementSibling,factoryArgs:[i.__min,i.__max,i.__step]});return o.name(n),r&&o.listen(),o}return e};i.min=C.default.compose(n,i.min),i.max=C.default.compose(n,i.max)}else i instanceof w.default?(P.default.bind(e,"click",(function(){P.default.fakeEvent(i.__checkbox,"click")})),P.default.bind(i.__checkbox,"click",(function(t){t.stopPropagation()}))):i instanceof x.default?(P.default.bind(e,"click",(function(){P.default.fakeEvent(i.__button,"click")})),P.default.bind(e,"mouseover",(function(){P.default.addClass(i.__button,"hover")})),P.default.bind(e,"mouseout",(function(){P.default.removeClass(i.__button,"hover")}))):i instanceof S.default&&(P.default.addClass(e,"color"),i.updateDisplay=C.default.compose((function(t){return e.style.borderLeftColor=i.__color.toString(),t}),i.updateDisplay),i.updateDisplay());i.setValue=C.default.compose((function(e){return t.getRoot().__preset_select&&i.isModified()&&o(t.getRoot(),!0),e}),i.setValue)}function s(t,e){var i=t.getRoot(),n=i.__rememberedObjects.indexOf(e.object);if(-1!==n){var r=i.__rememberedObjectIndecesToControllers[n];if(void 0===r&&(r={},i.__rememberedObjectIndecesToControllers[n]=r),r[e.property]=e,i.load&&i.load.remembered){var o=i.load.remembered,a=void 0;if(o[t.preset])a=o[t.preset];else{if(!o[D])return;a=o[D]}if(a[n]&&void 0!==a[n][e.property]){var s=a[n][e.property];e.initialValue=s,e.setValue(s)}}}}function l(t,e,i,n){if(void 0===e[i])throw new Error('Object "'+e+'" has no property "'+i+'"');var o=void 0;if(n.color)o=new S.default(e,i);else{var l=[e,i].concat(n.factoryArgs);o=y.default.apply(t,l)}n.before instanceof b.default&&(n.before=n.before.__li),s(t,o),P.default.addClass(o.domElement,"c");var u=document.createElement("span");P.default.addClass(u,"property-name"),u.innerHTML=o.property;var h=document.createElement("div");h.appendChild(u),h.appendChild(o.domElement);var c=r(t,h,n.before);return P.default.addClass(c,F.CLASS_CONTROLLER_ROW),o instanceof S.default?P.default.addClass(c,"color"):P.default.addClass(c,m(o.getValue())),a(t,c,o),t.__controllers.push(o),o}function u(t,e){return document.location.href+"."+e}function h(t,e,i){var n=document.createElement("option");n.innerHTML=e,n.value=e,t.__preset_select.appendChild(n),i&&(t.__preset_select.selectedIndex=t.__preset_select.length-1)}function c(t,e){e.style.display=t.useLocalStorage?"block":"none"}function d(t){var e=t.__save_row=document.createElement("li");P.default.addClass(t.domElement,"has-save"),t.__ul.insertBefore(e,t.__ul.firstChild),P.default.addClass(e,"save-row");var i=document.createElement("span");i.innerHTML="&nbsp;",P.default.addClass(i,"button gears");var n=document.createElement("span");n.innerHTML="Save",P.default.addClass(n,"button"),P.default.addClass(n,"save");var r=document.createElement("span");r.innerHTML="New",P.default.addClass(r,"button"),P.default.addClass(r,"save-as");var o=document.createElement("span");o.innerHTML="Revert",P.default.addClass(o,"button"),P.default.addClass(o,"revert");var a=t.__preset_select=document.createElement("select");t.load&&t.load.remembered?C.default.each(t.load.remembered,(function(e,i){h(t,i,i===t.preset)})):h(t,D,!1),P.default.bind(a,"change",(function(){for(var e=0;e<t.__preset_select.length;e++)t.__preset_select[e].innerHTML=t.__preset_select[e].value;t.preset=this.value})),e.appendChild(a),e.appendChild(i),e.appendChild(n),e.appendChild(r),e.appendChild(o),L&&function(){var e=document.getElementById("dg-local-explain"),i=document.getElementById("dg-local-storage");document.getElementById("dg-save-locally").style.display="block","true"===localStorage.getItem(u(0,"isLocal"))&&i.setAttribute("checked","checked"),c(t,e),P.default.bind(i,"change",(function(){t.useLocalStorage=!t.useLocalStorage,c(t,e)}))}();var s=document.getElementById("dg-new-constructor");P.default.bind(s,"keydown",(function(t){!t.metaKey||67!==t.which&&67!==t.keyCode||O.hide()})),P.default.bind(i,"click",(function(){s.innerHTML=JSON.stringify(t.getSaveObject(),void 0,2),O.show(),s.focus(),s.select()})),P.default.bind(n,"click",(function(){t.save()})),P.default.bind(r,"click",(function(){var e=prompt("Enter a new preset name.");e&&t.saveAs(e)})),P.default.bind(o,"click",(function(){t.revert()}))}function p(t,e){t.domElement.style.width=e+"px",t.__save_row&&t.autoPlace&&(t.__save_row.style.width=e+"px"),t.__closeButton&&(t.__closeButton.style.width=e+"px")}function f(t,e){var i={};return C.default.each(t.__rememberedObjects,(function(n,r){var o={},a=t.__rememberedObjectIndecesToControllers[r];C.default.each(a,(function(t,i){o[i]=e?t.initialValue:t.getValue()})),i[r]=o})),i}var m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},g=n(i(18)),v=n(i(19)),y=n(i(20)),b=n(i(7)),w=n(i(8)),x=n(i(15)),M=n(i(13)),T=n(i(14)),S=n(i(16)),_=n(i(21)),A=n(i(22)),P=n(i(9)),C=n(i(5)),E=n(i(23));g.default.inject(E.default);var D="Default",L=function(){try{return"localStorage"in window&&null!==window.localStorage}catch(t){return!1}}(),O=void 0,I=!0,R=void 0,N=!1,k=[],F=function t(e){var i=this,n=e||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),P.default.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],n=C.default.defaults(n,{autoPlace:!0,width:t.DEFAULT_WIDTH}),n=C.default.defaults(n,{resizable:n.autoPlace,hideable:n.autoPlace}),C.default.isUndefined(n.load)?n.load={preset:D}:n.preset&&(n.load.preset=n.preset),C.default.isUndefined(n.parent)&&n.hideable&&k.push(this),n.resizable=C.default.isUndefined(n.parent)&&n.resizable,n.autoPlace&&C.default.isUndefined(n.scrollable)&&(n.scrollable=!0);var o=L&&"true"===localStorage.getItem(u(0,"isLocal")),a=void 0;if(Object.defineProperties(this,{parent:{get:function(){return n.parent}},scrollable:{get:function(){return n.scrollable}},autoPlace:{get:function(){return n.autoPlace}},preset:{get:function(){return i.parent?i.getRoot().preset:n.load.preset},set:function(t){i.parent?i.getRoot().preset=t:n.load.preset=t,function(t){for(var e=0;e<t.__preset_select.length;e++)t.__preset_select[e].value===t.preset&&(t.__preset_select.selectedIndex=e)}(this),i.revert()}},width:{get:function(){return n.width},set:function(t){n.width=t,p(i,t)}},name:{get:function(){return n.name},set:function(t){n.name=t,titleRowName&&(titleRowName.innerHTML=n.name)}},closed:{get:function(){return n.closed},set:function(e){n.closed=e,n.closed?P.default.addClass(i.__ul,t.CLASS_CLOSED):P.default.removeClass(i.__ul,t.CLASS_CLOSED),this.onResize(),i.__closeButton&&(i.__closeButton.innerHTML=e?t.TEXT_OPEN:t.TEXT_CLOSED)}},load:{get:function(){return n.load}},useLocalStorage:{get:function(){return o},set:function(t){L&&(o=t,t?P.default.bind(window,"unload",a):P.default.unbind(window,"unload",a),localStorage.setItem(u(0,"isLocal"),t))}}}),C.default.isUndefined(n.parent)){if(n.closed=!1,P.default.addClass(this.domElement,t.CLASS_MAIN),P.default.makeSelectable(this.domElement,!1),L&&o){i.useLocalStorage=!0;var s=localStorage.getItem(u(0,"gui"));s&&(n.load=JSON.parse(s))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=t.TEXT_CLOSED,P.default.addClass(this.__closeButton,t.CLASS_CLOSE_BUTTON),this.domElement.appendChild(this.__closeButton),P.default.bind(this.__closeButton,"click",(function(){i.closed=!i.closed}))}else{void 0===n.closed&&(n.closed=!0);var l=document.createTextNode(n.name);P.default.addClass(l,"controller-name");var h=r(i,l);P.default.addClass(this.__ul,t.CLASS_CLOSED),P.default.addClass(h,"title"),P.default.bind(h,"click",(function(t){return t.preventDefault(),i.closed=!i.closed,!1})),n.closed||(this.closed=!1)}n.autoPlace&&(C.default.isUndefined(n.parent)&&(I&&(R=document.createElement("div"),P.default.addClass(R,"dg"),P.default.addClass(R,t.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(R),I=!1),R.appendChild(this.domElement),P.default.addClass(this.domElement,t.CLASS_AUTO_PLACE)),this.parent||p(i,n.width)),this.__resizeHandler=function(){i.onResizeDebounced()},P.default.bind(window,"resize",this.__resizeHandler),P.default.bind(this.__ul,"webkitTransitionEnd",this.__resizeHandler),P.default.bind(this.__ul,"transitionend",this.__resizeHandler),P.default.bind(this.__ul,"oTransitionEnd",this.__resizeHandler),this.onResize(),n.resizable&&function(t){function e(e){return e.preventDefault(),t.width+=r-e.clientX,t.onResize(),r=e.clientX,!1}function i(){P.default.removeClass(t.__closeButton,F.CLASS_DRAG),P.default.unbind(window,"mousemove",e),P.default.unbind(window,"mouseup",i)}function n(n){return n.preventDefault(),r=n.clientX,P.default.addClass(t.__closeButton,F.CLASS_DRAG),P.default.bind(window,"mousemove",e),P.default.bind(window,"mouseup",i),!1}var r=void 0;t.__resize_handle=document.createElement("div"),C.default.extend(t.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"}),P.default.bind(t.__resize_handle,"mousedown",n),P.default.bind(t.__closeButton,"mousedown",n),t.domElement.insertBefore(t.__resize_handle,t.domElement.firstElementChild)}(this),a=function(){L&&"true"===localStorage.getItem(u(0,"isLocal"))&&localStorage.setItem(u(0,"gui"),JSON.stringify(i.getSaveObject()))},this.saveToLocalStorageIfPossible=a,n.parent||function(){var t=i.getRoot();t.width+=1,C.default.defer((function(){t.width-=1}))}()};F.toggleHide=function(){N=!N,C.default.each(k,(function(t){t.domElement.style.display=N?"none":""}))},F.CLASS_AUTO_PLACE="a",F.CLASS_AUTO_PLACE_CONTAINER="ac",F.CLASS_MAIN="main",F.CLASS_CONTROLLER_ROW="cr",F.CLASS_TOO_TALL="taller-than-window",F.CLASS_CLOSED="closed",F.CLASS_CLOSE_BUTTON="close-button",F.CLASS_DRAG="drag",F.DEFAULT_WIDTH=245,F.TEXT_CLOSED="Close Controls",F.TEXT_OPEN="Open Controls",F._keydownHandler=function(t){"text"===document.activeElement.type||72!==t.which&&72!==t.keyCode||F.toggleHide()},P.default.bind(window,"keydown",F._keydownHandler,!1),C.default.extend(F.prototype,{add:function(t,e){return l(this,t,e,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(t,e){return l(this,t,e,{color:!0})},remove:function(t){this.__ul.removeChild(t.__li),this.__controllers.splice(this.__controllers.indexOf(t),1);var e=this;C.default.defer((function(){e.onResize()}))},destroy:function(){this.autoPlace&&R.removeChild(this.domElement),P.default.unbind(window,"keydown",F._keydownHandler,!1),P.default.unbind(window,"resize",this.__resizeHandler),this.saveToLocalStorageIfPossible&&P.default.unbind(window,"unload",this.saveToLocalStorageIfPossible)},addFolder:function(t){if(void 0!==this.__folders[t])throw new Error('You already have a folder in this GUI by the name "'+t+'"');var e={name:t,parent:this};e.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[t]&&(e.closed=this.load.folders[t].closed,e.load=this.load.folders[t]);var i=new F(e);this.__folders[t]=i;var n=r(this,i.domElement);return P.default.addClass(n,"folder"),i},open:function(){this.closed=!1},close:function(){this.closed=!0},onResize:function(){var t=this.getRoot();if(t.scrollable){var e=P.default.getOffset(t.__ul).top,i=0;C.default.each(t.__ul.childNodes,(function(e){t.autoPlace&&e===t.__save_row||(i+=P.default.getHeight(e))})),(window.renderHeight || window.innerHeight)-e-20<i?(P.default.addClass(t.domElement,F.CLASS_TOO_TALL),t.__ul.style.height=(window.renderHeight || window.innerHeight)-e-20+"px"):(P.default.removeClass(t.domElement,F.CLASS_TOO_TALL),t.__ul.style.height="auto")}t.__resize_handle&&C.default.defer((function(){t.__resize_handle.style.height=t.__ul.offsetHeight+"px"})),t.__closeButton&&(t.__closeButton.style.width=t.width+"px")},onResizeDebounced:C.default.debounce((function(){this.onResize()}),200),remember:function(){if(C.default.isUndefined(O)&&((O=new A.default).domElement.innerHTML=v.default),this.parent)throw new Error("You can only call remember on a top level GUI.");var t=this;C.default.each(Array.prototype.slice.call(arguments),(function(e){0===t.__rememberedObjects.length&&d(t),-1===t.__rememberedObjects.indexOf(e)&&t.__rememberedObjects.push(e)})),this.autoPlace&&p(this,this.width)},getRoot:function(){for(var t=this;t.parent;)t=t.parent;return t},getSaveObject:function(){var t=this.load;return t.closed=this.closed,this.__rememberedObjects.length>0&&(t.preset=this.preset,t.remembered||(t.remembered={}),t.remembered[this.preset]=f(this)),t.folders={},C.default.each(this.__folders,(function(e,i){t.folders[i]=e.getSaveObject()})),t},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=f(this),o(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(t){this.load.remembered||(this.load.remembered={},this.load.remembered[D]=f(this,!0)),this.load.remembered[t]=f(this),this.preset=t,h(this,t,!0),this.saveToLocalStorageIfPossible()},revert:function(t){C.default.each(this.__controllers,(function(e){this.getRoot().load.remembered?s(t||this.getRoot(),e):e.setValue(e.initialValue),e.__onFinishChange&&e.__onFinishChange.call(e,e.getValue())}),this),C.default.each(this.__folders,(function(t){t.revert(t)})),t||o(this.getRoot(),!1)},listen:function(t){var e=0===this.__listening.length;this.__listening.push(t),e&&function t(e){0!==e.length&&_.default.call(window,(function(){t(e)})),C.default.each(e,(function(t){t.updateDisplay()}))}(this.__listening)},updateDisplay:function(){C.default.each(this.__controllers,(function(t){t.updateDisplay()})),C.default.each(this.__folders,(function(t){t.updateDisplay()}))}}),t.exports=F},function(t,e){"use strict";t.exports={load:function(t,e){var i=e||document,n=i.createElement("link");n.type="text/css",n.rel="stylesheet",n.href=t,i.getElementsByTagName("head")[0].appendChild(n)},inject:function(t,e){var i=e||document,n=document.createElement("style");n.type="text/css",n.innerHTML=t;var r=i.getElementsByTagName("head")[0];try{r.appendChild(n)}catch(t){}}}},function(t,e){t.exports="<div id=dg-save class=\"dg dialogue\"> Here's the new load parameter for your <code>GUI</code>'s constructor: <textarea id=dg-new-constructor></textarea> <div id=dg-save-locally> <input id=dg-local-storage type=checkbox /> Automatically save values to <code>localStorage</code> on exit. <div id=dg-local-explain>The values saved to <code>localStorage</code> will override those passed to <code>dat.GUI</code>'s constructor. This makes it easier to work incrementally, but <code>localStorage</code> is fragile, and your friends may not see the same values you do. </div> </div> </div>"},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var r=n(i(10)),o=n(i(13)),a=n(i(14)),s=n(i(11)),l=n(i(15)),u=n(i(8)),h=n(i(5));e.default=function(t,e){var i=t[e];return h.default.isArray(arguments[2])||h.default.isObject(arguments[2])?new r.default(t,e,arguments[2]):h.default.isNumber(i)?h.default.isNumber(arguments[2])&&h.default.isNumber(arguments[3])?h.default.isNumber(arguments[4])?new a.default(t,e,arguments[2],arguments[3],arguments[4]):new a.default(t,e,arguments[2],arguments[3]):h.default.isNumber(arguments[4])?new o.default(t,e,{min:arguments[2],max:arguments[3],step:arguments[4]}):new o.default(t,e,{min:arguments[2],max:arguments[3]}):h.default.isString(i)?new s.default(t,e):h.default.isFunction(i)?new l.default(t,e,""):h.default.isBoolean(i)?new u.default(t,e):null}},function(t,e){"use strict";e.__esModule=!0,e.default=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){setTimeout(t,1e3/60)}},function(t,e,i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var r=n(i(9)),o=n(i(5)),a=function(){function t(){(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")})(this,t),this.backgroundElement=document.createElement("div"),o.default.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),r.default.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),o.default.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var e=this;r.default.bind(this.backgroundElement,"click",(function(){e.hide()}))}return t.prototype.show=function(){var t=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),o.default.defer((function(){t.backgroundElement.style.opacity=1,t.domElement.style.opacity=1,t.domElement.style.webkitTransform="scale(1)"}))},t.prototype.hide=function(){var t=this,e=function e(){t.domElement.style.display="none",t.backgroundElement.style.display="none",r.default.unbind(t.domElement,"webkitTransitionEnd",e),r.default.unbind(t.domElement,"transitionend",e),r.default.unbind(t.domElement,"oTransitionEnd",e)};r.default.bind(this.domElement,"webkitTransitionEnd",e),r.default.bind(this.domElement,"transitionend",e),r.default.bind(this.domElement,"oTransitionEnd",e),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"},t.prototype.layout=function(){this.domElement.style.left=(window.renderWidth || window.innerWidth)/2-r.default.getWidth(this.domElement)/2+"px",this.domElement.style.top=(window.renderHeight || window.innerHeight)/2-r.default.getHeight(this.domElement)/2+"px"},t}();e.default=a},function(t,e,i){(t.exports=i(24)()).push([t.id,".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1!important}.dg.main .close-button.drag,.dg.main:hover .close-button{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;transition:opacity .1s linear;border:0;position:absolute;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-x:hidden}.dg.a.has-save>ul{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{position:fixed;top:0;z-index:1002}.dg li{-webkit-transition:height .1s ease-out;transition:height .1s ease-out}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;overflow:hidden;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid transparent}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:9px}.dg .c select{margin-top:5px}.dg .cr.boolean,.dg .cr.boolean *,.dg .cr.function,.dg .cr.function *,.dg .cr.function .property-name{cursor:pointer}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco,monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px Lucida Grande,sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid hsla(0,0%,100%,.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2fa1d6}.dg .cr.number input[type=text]{color:#2fa1d6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.boolean:hover,.dg .cr.function:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2fa1d6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}",""])},function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e<this.length;e++){var i=this[e];i[2]?t.push("@media "+i[2]+"{"+i[1]+"}"):t.push(i[1])}return t.join("")},t.i=function(e,i){"string"==typeof e&&(e=[[null,e,""]]);for(var n={},r=0;r<this.length;r++){var o=this[r][0];"number"==typeof o&&(n[o]=!0)}for(r=0;r<e.length;r++){var a=e[r];"number"==typeof a[0]&&n[a[0]]||(i&&!a[2]?a[2]=i:i&&(a[2]="("+a[2]+") and ("+i+")"),t.push(a))}},t}}])},function(t,e,i){"use strict";var n=i(0),r=(i(13),i(9));function o(t){this._canbeUsed=!1,this.player=t,this.sRender=t.sRender,this.ray=new n.Raycaster,this.mouse=new n.Vector3,this.INTERSECT=null,this.measurementTool=null,this.vertexMesh=null,this.activeMeasurement=null,this.labelsInCamera={},this.currentInfo=[],this.dragging=!1,this.defineProperty(),this.initStateEngine()}o.prototype.defineProperty=function(){Object.defineProperty(this,"canbeUsed",{get:function(){return this._canbeUsed},set:function(t){this._canbeUsed=t}})},o.prototype.initStateEngine=function(){},o.prototype.init=function(t){this.measurementTool=t},o.prototype.selectMeasurementVertexMesh=function(t){this.ray.setFromCamera(this.mouse,this.sRender.camera);var e=this.ray.intersectObjects(t);0<e.length?(this.INTERSECT=e[0],document.body.style.cursor="pointer"):(this.INTERSECT=null,document.body.style.cursor="default")},o.prototype.handleChoosedMeasurementVertexMesh=function(t){this.vertexMesh=t.object,this.activeMeasurement=this.vertexMesh.parent,this.measurementTool.lockedAddPoint=!0},o.prototype.onPlayerMouseDown=function(){this.INTERSECT&&(this.player.disableNavigator=!0,this.player.controls.panorama.lockedRotationFrom=!0,this.handleChoosedMeasurementVertexMesh(this.INTERSECT))},o.prototype.onPlayerMouseMove=function(){if(this.mouse.copy(this.player.mouse),!this.vertexMesh){var t=!!this.measurementTool,e=this.measurementTool.singleMeasuring&&!!this.measurementTool.inMeasureMode,i=1<this.measurementTool.measurements.length;t&&e&&i&&this.selectMeasurementVertexMesh(this.measurementTool.allSpheres)}this.vertexMesh&&this.dragMeasurementVertexMesh(),this.player.inMeasureMode&&this.measurementTool&&!this.measurementTool.singleMeasuring&&this.updateMeasureInfo(this.measurementTool.measurements)},o.prototype.onPlayerMouseUp=function(){this.vertexMesh&&(this.player.controls.panorama.lockedRotationFrom=!1,this.vertexMesh=null),this.dragging&&(this.measurementTool.updateMeasureVisible(this.player.currentPano),this.updateMeasureInfo(this.measurementTool.measurements),this.measurementTool.changeSize(this.activeMeasurement.measureid))},o.prototype.onHandleControlPanoramaMove=function(){var t=G.conf.modelMeasure||G.conf.publicity||!G.conf.modelMeasure&&!G.conf.publicity,e=!!this.measurementTool&&0<this.measurementTool.measurements.length;t&&e&&(this.measurementTool.lockedAddPoint=!0,this.updateMeasureInfo(this.measurementTool.measurements))},o.prototype.onHandleControlPanoramaMoveStop=function(){G.conf.modelMeasure||G.conf.publicity||!G.conf.modelMeasure&&G.conf.publicity,!!this.measurementTool&&this.measurementTool.measurements.length},o.prototype.onFlyEnd=function(){var t=G.conf.modelMeasure||G.conf.publicity,e=!!this.measurementTool&&0<this.measurementTool.measurements.length;t&&e&&this.updateMeasureInfo(this.measurementTool.measurements)},o.prototype.dragMeasurementVertexMesh=function(){this.dragging=!0,this.vertexMesh.position.copy(this.player.intersect.point),this.activeMeasurement.points[this.vertexMesh.userData.index].copy(this.vertexMesh.position),this.activeMeasurement.lockedFitAxis=!0,this.activeMeasurement.update(),this.updateMeasureInfo(this.measurementTool.measurements)},o.prototype.computeOutScreen=function(t){var e=t.position.clone().applyMatrix4(this.sRender.camera.matrixWorldInverse).applyMatrix4(this.sRender.camera.projectionMatrix),i=Math.abs(e.x)>1,n=Math.abs(e.y)>1,r=Math.abs(e.z)>1;t.userData.out_camera=!!(i||n||r)},o.prototype.computeCrossCollider=function(t){},o.prototype.updateMeasureInfo=function(t){var e=[];if(this.measurementTool&&!this.measurementTool.measureState)return!1;for(var i=0,n=t.length;i<n;++i){for(var o=t[i].edges,a=t[i].edgeLabels,s=t[i].areaLabel,l=t[i].category,u=t[i].uuid,h=0,c=a.length;h<c;++h)a[h].userData.screen_position=r.convertWorldPositionToScreen(a[h].position.clone(),this.sRender.camera),this.computeOutScreen(a[h]);this.computeOutScreen(s),s.userData.screen_position=r.convertWorldPositionToScreen(s.position.clone(),this.sRender.camera),e.push({edges:o,edgeLabels:a,areaLabel:s,category:l,uuid:u})}this.player.emit("get-measurement-info",e)};o.prototype.update=function(){var t=!!this.measurementTool&&0<this.measurementTool.measurements.length;this.player.flying&&t&&this.updateMeasureInfo(this.measurementTool.measurements)},t.exports=o},function(t,e,i){function n(){G.d=this,this.endlessLoop=a.warp.loop,this.clock=new r.Clock(!0),this.model=null,this.player=null,this.currentItem=null,this.destinationItem=null,this.tourIsPlaying=!1,this.transitionStage=w.None,this.nextFunc=null,this.onTheBus=!1,this.reachSource=null,this.interrupted=!1,this.nItems=0,this.currentScript=1,this.walkingSectionPaused=!1,this.sLen=0,this.connect=b(),this.handleOperation=this.handleOperation.bind(this),this.connect.on("operation",this.handleOperation)}var r=i(0),o=i(2),a=i(1),s=i(8),l=i(4).EventEmitter,u=i(5),h=i(24),c=(i(8),i(21)),d=i(70),p=i(20),f=i(27),m=i(31),g=i(63),v=i(64),y=(i(3),new o("/js/director.js")),b=i(28),w=Object.freeze({None:0,Moving:1,Aiming:2,Interlude:3}),x=Object.freeze({Forward:1,NoChange:0,Backwards:-1});i(71);n.prototype=Object.create(l.prototype),n.prototype.init=function(t,e){this.player=t,this.modelManager=e,this.updateModel(),this.resetAll(),this.bindEvents()},n.prototype.resetAll=function(){if(this.currentItem=null,this.destinationItem=null,this.tourIsPlaying=!1,this.transitionStage=w.None,this.nextFunc=null,this.onTheBus=!1,this.reachSource=null,this.interrupted=!1,this.model)switch(this.model.switch_scene_type){case 1:this.defaultWarpStyle=h.BLACK;break;case 2:this.defaultWarpStyle=h.WALK;break;case 3:this.defaultWarpStyle=h.STD;break;default:this.defaultWarpStyle=h.BLACK}else this.defaultWarpStyle=h.BLACK,y.warn('No model yet, choosing "'+this.defaultWarpStyle+'" transitions');this.resetSpecialTransition()},n.prototype.updateModel=function(){this.model=this.modelManager.getActiveModel(),this.nItems=this.model.heroLocations.length-1},n.prototype.bindEvents=function(){this.modelManager.on(c.ActiveModelChanged,this.updateModel.bind(this)),this.player.on(p.WarpInterruptedWithFlyTo,this.handleFlyToWarpInterruption.bind(this)),this.player.on(p.Move,this.handlePlayerMove.bind(this)),this.player.on(p.PanoChosen,this.handlePlayerPanoChosen.bind(this)),this.player.on(p.ModeChanged,this.handlePlayerModeChanged.bind(this)),this.player.on(p.InputStart,this.handlePlayerInputStart.bind(this)),this.player.on(p.FlyingStarted,this.handlePlayerFlyingStarted.bind(this))},n.prototype.handleFlyToWarpInterruption=function(t,e){t===h.WALK?(this.interrupt(m.FADEIN),this.pauseWalkingSection(),this.player.fastForwardActivePanoFlight()):this.transitionStage===w.Interlude&&(this.interrupt(m.NONE),e&&e())},n.prototype.handlePlayerMove=function(t){this.transitionStage===w.Interlude&&this.interrupt(m.NONE)},n.prototype.handlePlayerPanoChosen=function(t,e){this.intermediateState()||t.id===e.id||(this.onTheBus=!1,this.emit("update.controls"))},n.prototype.handlePlayerModeChanged=function(t,e){this.intermediateState()||t===e||(this.onTheBus=!1,this.emit("update.controls"))},n.prototype.handlePlayerInputStart=function(t){this.transitionStage===w.Interlude&&this.interrupt(m.NONE)},n.prototype.handlePlayerFlyingStarted=function(){this.clearWalkingSectionPaused(),G.player.mattertagManager.ttflying=!0},n.prototype.describe=function(){return{nItems:this.nItems,currentItem:this.currentItem,destinationItem:this.destinationItem,tourIsPlaying:this.tourIsPlaying,onTheBus:this.onTheBus,endlessLoop:this.endlessLoop,viewMode:this.player.mode,inTransition:this._inTransition(),transitionStage:this.transitionStage}},n.prototype._inTransition=function(){return this.player.flying||this.player.isWarping()||this.player.mode===u.TRANSITIONING||this.tourIsPlaying},n.prototype.bounceable=function(){var t=this.clock.getDelta();return this.isInterrupted()||t<.9&&t>.01||this.player.flying&&!this.player.isWarping()},n.prototype.currentMoveDirection=function(){return null===this.currentItem||void 0===this.currentItem?x.Forward:this.destinationItem===this.currentItem?x.NoChange:this.destinationItem>this.currentItem?x.Forward:x.Backwards},n.prototype.clearPath=function(){this._inTransition()||this.player.path.discardPathObject()},n.prototype.allFloors=function(){G.R.recording&&G.R.save({tap:"floor",action:"all"}),this.connect.getSyncState()&&(this.connect.remoteControl||this.connect.sync||this.connect.sendOperation({type:"floorchange",floorIndex:"all"}),this.showAllFloors())},n.prototype.showAllFloors=function(){var t=this.player.controls[this.player.mode];t&&t.emit("move","gui"),this.player.controls[u.PANORAMA].emit(f.InteractionGui,"floor-control"),this.model.toggleAllFloors()},n.prototype.gotoFloor=function(t){G.R.recording&&G.R.save({tap:"floor",action:""+parseInt(t)}),this.connect.getSyncState()&&(this.connect.remoteControl||this.connect.sync||this.connect.sendOperation({type:"floorchange",floorIndex:t}),this.player.gotoFloor(t,"gui"))},n.prototype.openTag=function(){this.player.mattertagManager.closeTag(),null!==this.currentItem&&void 0!==this.currentItem||(this.currentItem=0);this.currentItem-this.sLen<0||G.R.recording},n.prototype.actionComplete=function(t){var e=this.transitionStage;if(this.interrupted=!1,this.transitionStage=w.None,this.resetSpecialTransition(),null!==this.destinationItem&&this.setCurrentItem(this.destinationItem),this.tourIsPlaying||(this.player.disablePreRendering(),this.player.mode===u.PANORAMA&&this.player.currentPano.isAligned()&&this.model.fadePanoMarkers()),this.emit("update.controls"),this.currentScript&&(this.model.enableTagMovie&&e===w.Interlude||this.model.enableTagMovie&&e===w.Aiming&&null===this.nextFunc))this.emit("gotoheighlight_done"),G.R.pafter();else if(this.nextFunc){var i=this.nextFunc;this.nextFunc=null,i()}else this.emit("gotoheighlight_done"),G.R.pafter()},n.prototype.awaitCompletion=function(t,e){this.nextFunc=e,t()},n.prototype.updateSuccessFunction=function(t){this.nextFunc=t},n.prototype.interrupt=function(t,e){return!(!this.wouldInterrupt()||!this.canInterrupt())&&(this.tourIsPlaying&&(this.player.zoomEnabled=this.wasZoomEnabled),this.tourIsPlaying=!1,this.interrupted=!0,this.nextFunc=null,this.emit(d.ActionInterruped),null!=t||(t=m.BEGINNING),this.player.interruptAndFastForward(t,e),!0)},n.prototype.wouldInterrupt=function(){return this.transitionStage!==w.None},n.prototype.intermediateState=function(){return this.transitionStage!==w.None},n.prototype.isInterrupted=function(){return this.interrupted},n.prototype.canInterrupt=function(){return this.transitionStage!==w.Aiming&&this.transitionStage!==w.Moving||this.transitionStage===w.Moving&&this.player.mode===u.PANORAMA&&this.nextWarpStyle!==h.BLACK},n.prototype.pauseWalkingSection=function(){this.walkingSectionPaused=!0},n.prototype.clearWalkingSectionPaused=function(){this.walkingSectionPaused=!1},n.prototype.autoTour=function(){G.settings.nestscenes&&G.settings.nestscenes.scenes&&G.settings.nestscenes.scenes.length&&!G.settings.nestscenes.scenes[0].script&&a.warp.auto>=0&&s.trigger({duration:1e3*Math.min(300,a.warp.auto),done:function(){this.playTour()}.bind(this),name:"_atr"})},n.prototype.atDestinationPano=function(){if(!this.player.currentPano||null===this.destinationItem)return!1;var t=this.player.currentPano.id;if(void 0===t)return!1;var e=this.model.heroLocations;return null!==this.destinationItem&&void 0!==e[this.destinationItem]&&t==e[this.destinationItem].panoId},n.prototype.redirectToItem=function(t,e){if(null!=t)if(this.wouldInterrupt())if(this.player.mode!==u.TRANSITIONING){y.debug("Director.redirectToItem() -> Redirecting to "+t+" via "+e);var i=function(){s.setTimeout(function(){this.setDestinationItem(t),this.goToDestination(!0,m.BEGINNING,a.warp.warpInterruptionRedirectTime,!1)}.bind(this),0)}.bind(this);this.interrupt(m.END,0),this.updateSuccessFunction(i)}else y.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");else y.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");else y.warn("Director.redirectToItem() -> Redirecting to null item.")},n.prototype.useSpecialTransition=function(t){void 0!==t&&this.defaultWarpStyle!==h.BLACK&&y.debug("useSpecialTransition(): "+t),this.nextWarpStyle=this.defaultWarpStyle},n.prototype.resetSpecialTransition=function(){this.nextWarpStyle=this.defaultWarpStyle},n.prototype.arrivedAtDestination=function(t){if(this.player.flying||this.player.isWarping())y.warn("Cannot advance to interlude or aiming while player is flying or warping.");else{this.transitionStage=w.Aiming;var e=this.tourIsPlaying?this.tourInterlude.bind(this,this.nextItem(this.currentItem)):null;this.player.model.fadePanoMarkers(0),this.tour360view(),this.awaitCompletion(function(){this.resetSpecialTransition(),t?this.player.aimTourCamera(this.destinationItem,v.Hide,g.Slow,this.actionComplete.bind(this)):this.actionComplete()}.bind(this),e)}},n.prototype.toast=function(t){setTimeout((function(){document.getElementsByClassName("toast-wrap")[0].getElementsByClassName("toast-msg")[0].innerHTML=t;var e=document.getElementsByClassName("toast-wrap")[0];e.className=e.className.replace("toastAnimate",""),setTimeout((function(){e.className=e.className+" toastAnimate"}),10)}),10)},n.prototype.tour360view=function(){this.model},n.prototype.goToDestination=function(t,e,i,n){if(this.onTheBus=!0,this.emit("update.controls"),this.player.updateLastView(),n||!this.atDestinationPano())if(this.player.flying||this.player.isWarping())y.warn("Cannot go to new destination while player is flying or warping.");else{var r=this.model.getHeroDescriptorByIndex(this.destinationItem),o=null,a=null;if(this.player.mattertagManager.update360Tags(r.panoId),r.isPano()){var s=0===this.destinationItem||t?h.BLACK:this.nextWarpStyle;a=this.player.warpToPanoByHeroIndex.bind(this.player,this.destinationItem,v.Show,g.Slow,s,e,i,this.actionComplete.bind(this)),o=this.arrivedAtDestination.bind(this,!0)}else a=this.player.warpToNonPanoByHeroIndex.bind(this.player,this.destinationItem,this.actionComplete.bind(this)),o=this.arrivedAtDestination.bind(this,!1);this.transitionStage=w.Moving,this.model.fadePanoMarkers(0),this.awaitCompletion(function(){a()}.bind(this),o),this.emit("update.controls")}else this.arrivedAtDestination(!0)},n.prototype.tourInterlude=function(){if(this.model.fadePanoMarkers(0),this.emit("update.controls"),this.tourIsPlaying)return this.atEndOfTour()&&!this.endlessLoop?(this.stopTour(),void(this.player.mode===u.PANORAMA&&this.model.fadePanoMarkers(a.panorama.markerOpacity))):void this.awaitCompletion(function(){this.transitionStage=w.Interlude,this.player.tourInterlude(this.nextItem(this.currentItem),this.actionComplete.bind(this))}.bind(this),this.goNext.bind(this))},n.prototype.playTour=function(t){this.bounceable()||(this.tourIsPlaying?y.info("tour is already playing"):this.wouldInterrupt()||(this.player.emit("tour_auto",this.defaultWarpStyle),this.reachSource="play",this.tourIsPlaying=!0,this.wasZoomEnabled=this.player.zoomEnabled,this.player.zoomEnabled=!1,this.resetSpecialTransition(),this.emit("update.controls"),this.player.enablePreRendering(),this.walkingSectionPaused?(this.clearWalkingSectionPaused(),this.goToDestination()):this.goNext()))},n.prototype.hideTourBar=function(){},n.prototype.stopTour=function(){this.emit("tourStop"),this.isInterrupted()||(this.tourIsPlaying&&(this.player.zoomEnabled=this.wasZoomEnabled),this.tourIsPlaying=!1,this.interrupt(),this.clearWalkingSectionPaused(),this.resetSpecialTransition(),this.emit("update.controls")),this.hideTourBar()},n.prototype.goToHighlight=function(t){if(this.canInterrupt()||!this.wouldInterrupt()){if(this.wouldInterrupt()&&(t===this.destinationItem?this.interrupt():this.redirectToItem(t,"goToHighlight")),this.isInterrupted())return void(G.R.fgotoh=!1);this.clearWalkingSectionPaused(),this.setDestinationItem(t),this.useSpecialTransition("Hilight"),this.goToDestination()}},n.prototype.goToHighlightByLocation=function(t){var e=this.model.heroLocations.findIndex((function(e){return!(!e.panoId||e.panoId!=t)}));if(this.canInterrupt()||!this.wouldInterrupt()){if(y.debug("<tour.goto "+e+">"),this.wouldInterrupt()&&(e===this.destinationItem?this.interrupt():this.redirectToItem(e,"goToHighlight")),this.isInterrupted())return;this.clearWalkingSectionPaused(),this.setDestinationItem(e),this.useSpecialTransition("Hilight"),this.goToDestination()}},n.prototype.prevHighlight=function(){this.bounceable()||(this.player.emit("tour_manual","prev"),this.interrupt(m.BEGINNING)||this.isInterrupted()||(this.clearWalkingSectionPaused(),this.reachSource="prev",this.goPrev()))},n.prototype.nextHighlight=function(){this.bounceable()||(this.player.emit("tour_manual","next"),this.interrupt(m.BEGINNING)||this.isInterrupted()||(this.clearWalkingSectionPaused(),this.reachSource="next",this.goNext()))},n.prototype.handleOperation=function(t){if("changemode"===t.type){var e=t.mode;this.remoteChangeMode(e)}else if("floorchange"===t.type){var i=t.floorIndex;"all"===i?this.showAllFloors():this.player.gotoFloor(i,"remote")}},n.prototype.changeMode=function(t,e){this.connect.getSyncState()&&!G.measureMode&&(this.connect.remoteControl||this.connect.sync||this.connect.sendOperation({type:"changemode",mode:t}),this.evalChangeMode(t,e))},n.prototype.remoteChangeMode=function(t){this.evalChangeMode(t)},n.prototype.evalChangeMode=function(t,e){var i=e||"gui";switch(this.wouldInterrupt()&&this.interrupt(),this.player.controls[t].emit("interaction."+i),this.clearWalkingSectionPaused(),t){case u.PANORAMA:this.player.insideMode();break;case u.DOLLHOUSE:case u.FLOORPLAN:this.player.flyToNewMode({mode:t})}},n.prototype.atEndOfTour=function(){return this.currentItem>=this.nItems-1},n.prototype.firstDestination=function(){if(this.nItems<=0)return null;for(var t=0;t<this.nItems;t++)if(this.model.images.list[t].script===this.currentScript)return t;return 0},n.prototype.finalDestination=function(){if(this.nItems<=0)return null;for(var t=this.nItems-1;t>=0;t--)if(this.model.images.list[t].script===this.currentScript)return t;return 0},n.prototype.goPrev=function(){this.tourAdvance(-1)},n.prototype.goNext=function(){null===this.currentItem&&(this.currentItem=this.finalDestination());for(var t,e=!1,i=this.currentItem+1;i<this.nItems;i++)if(this.model.images.list[i].script===this.currentScript){t=i-this.currentItem,e=!0;break}e||(t=this.nItems-this.currentItem),0===t&&(t=1),this.tourAdvance(t)},n.prototype.setDestinationItem=function(t){t>this.nItems&&(t=this.firstDestination()),this.destinationItem=t,this.emit("update.controls")},n.prototype.setCurrentItem=function(t){this.currentItem=t,this.emit("update.controls")},n.prototype.nextItem=function(t){return t?t>this.nItems&&this.endlessLoop?this.firstDestination():t<this.nItems?t+1:void 0:this.firstDestination()},n.prototype.prevItem=function(t){return null===t?this.firstDestination():t<0?this.endlessLoop?this.lastDestination():null:t-1},n.prototype.tourAdvance=function(t){y.debug("tourAdvance("+t+")"),null===this.currentItem||void 0===this.currentItem?this.setDestinationItem(this.firstDestination()):this.setDestinationItem(this.currentItem+t),this.destinationItem<0?(this.setDestinationItem(this.finalDestination()),this.useSpecialTransition("reverse-looping to end")):this.destinationItem>=this.nItems&&(this.setDestinationItem(this.firstDestination()),this.useSpecialTransition("looping back to start")),this.goToDestination()},n.prototype.compassAdd=function(t){this.model.adjustCompass+=t},n.prototype.compassReset=function(t){this.model.adjustCompass=t},t.exports=n},function(t,e,i){(function(e){(function(n){function r(t){this.player=null,this.director=null,this.modelManager=null,this.container=null,this.mattertagManager=null,this.fadeInSpeed=t,null!==this.fadeInSpeed&&void 0!==this.fadeInSpeed||(this.fadeInSpeed=0)}var o=i(0),a=i(2),s=(i(7),i(20)),l=i(70),u=i(1),h=i(5),c=(i(24),i(31),i(21)),d=i(42),p=i(8),f=i(10),m=new a(n);r.prototype.init=function(t,e,i,n,r){this.player=e,this.director=t,this.modelManager=i,this.mattertagManager=n,this.container=r,this.updateModel(),this.bindEvents()},r.prototype.bindEvents=function(){this.modelManager.on(c.ActiveModelChanged,this.updateModel.bind(this)),this.player.on(s.ModeChanging,this.handlePlayerModeChanging.bind(this)),this.player.on(s.ModeChanged,this.handlePlayerModeChanged.bind(this)),this.player.on(s.ClosestPanoChanging,this.handleClosestPanoChanging.bind(this)),this.player.on(s.StartInside,this.handleStartInside.bind(this)),this.player.on(s.StartOutside,this.handleStartOutside.bind(this)),this.player.on(s.WarpStarted,this.handleWarpStarted.bind(this)),this.director.on(l.ActionInterrupted,this.handleActionInterruption.bind(this)),this.mattertagManager.on(d.TagActivated,this.onMattertagActivated.bind(this)),this.mattertagManager.on(d.TagNavigation,this.onNavigationToMattertag.bind(this))},r.prototype.updateModel=function(){this.model=this.modelManager.getActiveModel()},r.prototype.handleWarpStarted=function(){this.hidePlayerReticule()},r.prototype.onMattertagActivated=function(){this.hidePlayerReticule()},r.prototype.onNavigationToMattertag=function(){this.hidePlayerReticule()},r.prototype.handlePlayerModeChanging=function(t,e,i){var n=this.modelManager.getActiveModel(),r=this.player.is360View(e,i)||this.director.tourIsPlaying?0:u[e].markerOpacity;n.fadePanoMarkers(r),n.setMode(e)},r.prototype.handlePlayerModeChanged=function(t,e){var i=this.modelManager.getActiveModel(),n=e===h.PANORAMA?o.DoubleSide:o.FrontSide;i.setSide(n),i.setMode(e),"dollhouse"===e&&(G.R.lon=0,G.R.lastlon=void 0)},r.prototype.handleClosestPanoChanging=function(t,e,i){i!==h.TRANSITIONING&&(t&&!this.director.tourIsPlaying&&t.hoverOff(i),e&&!this.director.tourIsPlaying&&e.hoverOn(i))},r.prototype.handleActionInterruption=function(){},r.prototype.handleStartInside=function(t){var e=u[this.player.mode],i=t?0:e.transitionTime*e.skyboxOpacityLength;this.fadeIn(this.fadeInSpeed),this.model.alpha=0,this.model.skybox.material.uniforms.opacity.value=1,this.model.fadePanoMarkers(t?0:e.markerOpacity);var n=this.player.reticule;p.start(f.property(n.material,"opacity",0),i,null,0,null,"retReOpac")},r.prototype.handleStartOutside=function(t){this.fadeIn(t)},r.prototype.fadeIn=function(t){null!=t||(t=2e3,m.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),e(this.container).fadeIn(t)},r.prototype.hidePlayerReticule=function(){this.player.reticule.hide()},t.exports=r}).call(this,"/js/DisplayController.js")}).call(this,i(6))},function(t,e,i){(function(e){var n=i(0),r=(i(11),i(1)),o=i(2),a=i(9),s=i(25),l=i(19),u=i(147),h=i(12),c=i(8),d=i(45),p=i(51),f=i(74),m=i(44),g=i(61),v=i(62),y=i(37),b=i(52),w=i(54),x=i(35),M=i(180);new o("js/showcase");n.ImageUtils.crossOrigin=r.crossOrigin,t.exports={shaders:h,transitions:c,Model:u,Chunk:d,Floor:m,Skybox:f,Reticule:p,Panorama:l,DollhouseCamera:g,FloorplanCamera:v,PanoramaCamera:y,DollhouseControls:b,FloorplanControls:w,PanoramaControls:x,initS:function(t,i){if(!t.url)throw'getModel(): missing parameter "url"';t.autoload=void 0===t.autoload||t.autoload;var n=s.parseModelid(t.url);t.urlBase=n.urlBase,t.urlModel=n.urlModel,t.urlFiles=n.urlFiles;var r=this._getPlatformError();return r?e.Deferred().reject(r).promise():(this.options=t,this.createS(i))},_getPlatformError:function(){var t=(new M).getResult();return"IE"===t.browser.name&&parseInt(t.browser.major)<11?"webgl-unsupported":"iOS"===t.os.name&&/^[0-7][$\.]/.test(t.os.version)?"webgl-ios":window.WebGLRenderingContext?null:"webgl-unsupported"},_loadModel:function(t){return e.when(t)},createS:function(t){t.nestscenes=s.normalizeModeldata(t.nestscenes,a);var i=new u(this.options,t);return e.when(i)}}}).call(this,i(6))},function(t,e,i){(function(e){i(148);var n=i(149),r=i(0),o=i(11),a=i(150),s=i(151),l=i(5),u=i(17),h=i(44),c=i(154),d=i(45),p=i(1),f=i(2),m=i(155),g=i(19),v=i(160),y=i(166),b=i(175),w=i(176),x=i(8),M=i(7),T=i(3),S=i(177),_=i(178),A=i(72),P=i(14),C=i(4).EventEmitter,E=i(73)(),D=new f("/js/model/Model.js");function L(t,e){this.settings=e,G.model=this,e.floors="",r.Object3D.call(this),this.modelid=e.basic.model.modelid,this.moreHouse=e.nestrecommends?0===e.nestrecommends.models.length?null:e.nestrecommends.models:null;var i=e.basic;G.settings.basic.menu.compass_enable=!0,window.disclaimer&&window.disclaimer.content&&i.user&&1!==parseInt(i.user.group)&&(i.model.disclaimer=window.disclaimer),this.data={modelid:i.model.modelid,name:i.model.name,floors:"",image:-1===e.nestscenes.backgroundimgurl.indexOf("background.")?e.nestscenes.backgroundimgurl:"",mobileimg:e.nestscenes.backgroundmobileimgurl&&e.nestscenes.backgroundmobileimgurl.indexOf("mobile.")>=0?e.nestscenes.backgroundmobileimgurl:"",images:e.nestscenes,player_options:{highlight_reel:!0,tour_buttons:!0,contact_email:!0,address:i.menu.address_enable,contact_name:i.menu.contact_name_enable,presented_by:i.menu.producer_enable,floor_plan:!0,dollhouse:!0,fast_transitions:!1,model_summary:i.menu.description_enable,contact_phone:i.menu.phone_enable,model_name:!0,autoplay:!1,bottom_presented_by:i.menu.bottom_presented_enable,show3d:void 0===i.menu.single_indoor||!i.menu.single_indoor,businessname:i.menu.businessname_enable,innerimage:i.menu.innerimage_enable},camera_start:null,summary:i.menu.description,description_voice_url:i.menu.description_voice_url,presented_by:i.menu.producer,address:i.menu.address,contact_name:i.menu.contact_name,contact_phone:i.menu.phone,contact_email:i.menu.contact_email,bottom_presented_by:i.menu.bottom_presented_by,audio:i.model.audio,businessname:i.menu.businessname,innerimage:i.menu.innerimage,orientations:e.locations.orientations,orientationkey:e.locations.orientationkey,orientation_correct:i.menu.orientation_correct};var o=T.valueFromHash("cleanui",0);if(o&&(G.conf.isCleanUI=o),this.settings.panorama_settings&&(p.panoramaSettings=this.settings.panorama_settings,p.screenshot?p.insideFOV=p.panoramaSettings.screenshot_fov82?82:70:p.insideFOV=p.panoramaSettings.loading_fov82?82:70),e.nestmeasure?this.nestmeasure=e.nestmeasure:this.nestmeasure={info:[],settings:{unit:1}},this.scene_enable=i.menu.scene_enable,this.scene_autoplay=i.menu.scene_autoplay,this.single_3D=i.menu.single_3D,this.innermap_enable=!1,this.innermap_type=i.menu.innermap_type,this.innermap_imgurl=i.menu.innermap_imgurl,this.outermap_enable=i.menu.outermap_enable,this.outermap_type=i.menu.outermap_type,this.outermap_url=i.menu.outermap_url,this.visiotors_enable=i.menu.visiotors_enable,this.mlanguage_enable=i.menu.mlanguage_enable,this.measure_enable=i.menu.measure_enable,this.mlanguage_type=null,this.t_logo_enable=i.menu.t_logo_enable,this.t_logo_url=i.menu.t_logo_url,this.house_type_enabled=i.menu.house_type_enabled,this.floorplan_enable=!1!==i.menu.floorplan_enable,this.inside_limit=51,this.model_name_style=i.menu.model_name_style,this.menu_autohide=i.menu.menu_autohide,this.share_enable=i.model.share_enable,this.startup_type=i.menu.startup_type||3,this.switch_scene_type=i.menu.switch_scene_type,this.oauth=i.menu.oauth,this.back_url=i.menu.back_url,this.entrance=e.building.house?e.building.house.entrance:null,this.entranceMesh=null,this.rooms_real=e.building.rooms,this.panosUV=[],this.buildFloors=e.building,i.menu.house_type_url?this.house_type_url=i.menu.house_type_url:e.building.floors&&e.building.floors[0]&&(this.house_type_url=e.building.floors[0].planurl),this.building_tag_enable=i.model.building_tag_enable,this.tour_tag_enable=i.model.tour_tag_enable,G.P={a:.025,b:0,c:.01},this.loading_enable=i.menu.loading_enable,this.iframe_screen_enable=i.menu.iframe_screen_enable,this.straight_enable=i.menu.straight_enable,this.catalogue=e.catalogue,this.catalogue&&((!this.catalogue.tagopentime||this.catalogue.tagopentime<0)&&(this.catalogue.tagopentime=5),(!this.catalogue.mediamaxtime||this.catalogue.mediamaxtime<0)&&(this.catalogue.mediamaxtime=180),(!this.catalogue.iframemaxtime||this.catalogue.iframemaxtime<0)&&(this.catalogue.iframemaxtime=20)),p.zoom.enabled=!0,e.nestscenes.scenes&&e.nestscenes.scenes.length>0){for(var s=-1,u=0;u<e.nestscenes.scenes.length;u++)if(1!==e.nestscenes.scenes[u].script){s=u;break}-1!==s&&(e.nestscenes.scenes[s].init_point=!0,this.normalMovie=!0)}this.outline_fills=e.building.outlines,this.language=null,this.language_type=null,this.options=t,this.urls=new a(t.urlFiles),this.isPublic=2!==e.basic.privacy,this.images=new S(this),this.images.extend(e.nestscenes.scenes),this.scenes360=[],this.points=e.locations.points,this.gotoFrom360Item=-1,e.nestscenes.path=n.Catalogue,this.switch_scene_type=2,this.jfData=null,e.jf&&e.jf.enable&&e.jf.dataset.length&&(this.jfData=e.jf.dataset,G.R.arrSet=e.jf.dataset,G.R.arrSet.forEach((function(t,e){var i=G.R.arrSet[e].audiourl;E.load(i)})));for(s=-1,u=0;u<e.nestscenes.scenes.length;u++)if(1===e.nestscenes.scenes[u].script){s=u;break}-1!==s&&(this.enableTagMovie=!0);var d=null,f=null;if(this.images.getLength()>0){var m=this.images.list.length,g=this.points.length;for(u=0;u<m;u++)1==this.images.list[u].type?-1==this.gotoFrom360Item&&(d=this.images.list[u]._camera._locationid,f=this.images.list[u]._camera._rotation,this.gotoFrom360Item=u):2==this.images.list[u].type&&this.scenes360.push(this.images.list[u]);if(!d)for(u=0;u<m;u++)for(s=0;s<g;s++)this.points[s].locationid==this.images.list[u]._camera._locationid&&(1==this.points[s].type?-1==this.gotoFrom360Item&&(d=this.images.list[u]._camera._locationid,f=this.images.list[u]._camera._rotation,this.gotoFrom360Item=u):this.scenes360.push(this.images.list[u]));if(!d)for(u=0;u<g;u++)if(1==this.points[u].type){d=this.points[u].locationid,f=this.points[u].rotation,this.gotoFrom360Item=this.images.getLength();break}if(null!=d){var y={init_point:!0,name:"",sceneid:"test",shortcuturl:"",_camera:{_locationid:d,_rotation:f,_type:0,_viewpoint:new r.Vector3(0,0,0),_zoom:0,_zoom_enable:0}};this.images.add(y)}}-1==this.gotoFrom360Item&&(this.gotoFrom360Item=0),this.enableOri=i.model.orientation,T.isMobile()||(this.enableOri=!1),G.ori.flag=!1,this.vr_num=0,this.vr_enable=!(null!=i.menu.vr_enable&&!i.menu.vr_enable),this.vr_enable&&this.vr_num++,this.enableOri&&this.vr_num++,this.heroImage=this.images.getbg(),this.heroLocations=[],this.outdoorPanoLocations=[],this.floors=new c(this),this.floorsEnabled=void 0===t.floors||t.floors,this.changingFloor=!1,this.chunks=[],this.panos=new v,this.colliders=[],this.loadPanosPromise=null,this.loadMeshTexturesPromise=null,this.meshTexturesLoaded=!1,this.mattertags={},this.tagsShown=!1,this.shouldShowMattertags=!1,this.has360Views=!0,this.supportedModes={},this.supportedModes[l.PANORAMA]=!0,this.supportedModes[l.DOLLHOUSE]=!e.player_options||e.player_options.dollhouse,this.supportedModes[l.FLOORPLAN]=!e.player_options||e.player_options.floor_plan,this.supportedModes[l.TRANSITIONING]=!0,this.steeringWheel=null,this.steeringWheelVisible=null,this.supportsTiles=!!i.model.multiple,p.tiling.allowUltraHighResolution=!!i.model.hq,p.tiling.mobileHighQualityOverride=!!i.model.mobile2k,this.adjustCompass=parseFloat(i.model.adjustCompass?i.model.adjustCompass:0),this.mode=l.DOLLHOUSE,this.size=null,this.center=null,this.boundingBox=new r.Box3,this.currentFloor=null,this.allFloorsVisible=!0,this.projectedPano0=null,this.projectedPano1=null,this.floorsEnabled&&e.floors&&-1!==e.floors.indexOf(",")&&e.floors.split(",").forEach(function(t,e){this.addFloor(new h(this,e,t.trim()))}.bind(this)),this.floorsHeight=this.setFloorsHeight(e),this.enablefilter=!1;var b=G.settings.locations.points;for(u=0;u<b.length;u++)!b[u].color||0===b[u].color.brightness&&0===b[u].color.contrast&&1===b[u].color.gamma&&0===b[u].color.hue&&0===b[u].color.saturation&&0===b[u].color.vibrance||(this.enablefilter=!0);this.waitQueue=[],this.on("load",function(t){0!==this.waitQueue.length&&(this.waitQueue=this.waitQueue.filter((function(t){return!t.isLoadedCallback()})),0===this.waitQueue.length&&this.emit("waiting-done"))}.bind(this)),this.setupCustomProperties()}L.prototype=Object.create(r.Object3D.prototype),M.extend(L,C),L.prototype.setupCustomProperties=function(){var t=p.modelAlpha;Object.defineProperty(this,"alpha",{get:function(){return t},set:function(e){t=e,this.chunks.forEach((function(e){e.material&&e.material.uniforms.modelAlpha&&(e.material.uniforms.modelAlpha.value=t)}))}})};var O=function(){var t=parseInt(T.getQueryString("lang"));return t||(t=function(){var t=null;switch(window.navigator.userLanguage?window.navigator.userLanguage.substring(0,2).toLowerCase():window.navigator.language.substring(0,2).toLowerCase()){case"zh":t=3;break;case"en":t=1;break;case"ja":t=2;break;default:t=1}return t}()),t};L.prototype.buildDollHouseCompass=function(){var t=this,e=new r.CircleGeometry(.5,32),i=new r.TextureLoader;i.setCrossOrigin(!0);var n=new r.Vector3;n.x=(t.boundingBox.max.x-t.boundingBox.min.x)/2,n.y=(t.boundingBox.max.y-t.boundingBox.min.y)/2,n.z=(t.boundingBox.max.z-t.boundingBox.min.z)/2,i.load("./images/ewsn_512.png",(function(i){var o=new r.MeshBasicMaterial({map:i,transparent:!0,opacity:.9,side:r.DoubleSide,depthTest:!1}),a=new r.Mesh(e,o);if(a.visible=null!==t.dollHouseCompass&&t.dollHouseCompass,a.rotation.set(-Math.PI/2,0,0),t.data.orientation_correct){var s=-t.data.orientation_correct*Math.PI/180;a.rotation.set(-Math.PI/2,0,s)}a.position.copy(n),t.add(a),t.dollHouseCompass=a}))},L.prototype.buildStreeringWheel=function(){var t=this,e=new r.CircleGeometry(.62,32),i=new r.TextureLoader;i.setCrossOrigin(!0);var n=O(),o="./images/ewsn_512.png";1==n?o="./images/ewsn_en_512.png":2==n&&(o="./images/ewsn_jp_512.png"),i.load(o,(function(i){var n=new r.MeshBasicMaterial({map:i,transparent:!0,opacity:.5,side:r.DoubleSide,depthTest:!1}),o=new r.Mesh(e,n);if(o.visible=null!==t.steeringWheelVisible&&t.steeringWheelVisible,o.rotation.set(-Math.PI/2,0,0),t.data.orientation_correct){var a=-t.data.orientation_correct*Math.PI/180;o.rotation.set(-Math.PI/2,0,a)}t.add(o),t.steeringWheel=o}))},L.prototype.showSteeringWheel=function(){this.steeringWheel?this.steeringWheel.visible=!0:this.steeringWheelVisible=!0},L.prototype.hideSteeringWheel=function(){this.steeringWheel?this.steeringWheel.visible=!1:this.steeringWheelVisible=!1},L.prototype.getCurrentHouseTypeImage=function(){var t="",e=this.buildFloors.floors;return(t=e&&e.length>0&&"number"==typeof this.currentFloor.floorIndex&&this.currentFloor.floorIndex<e.lenght?e[this.currentFloor.floorIndex]&&e[this.currentFloor.floorIndex].planurl:this.house_type_url)?t="http:"===window.location.protocol?t:t.replace("http:","https:"):""},L.prototype.toggleAlpha=function(){this.alpha<1?this.alpha=1:this.alpha=0},L.prototype.load=function(t){var i=function(){return e.when(this.loadPanos(),this.loadMesh())}.bind(this);i=i(),t?i=i.then(this.loadMeshTextures.bind(this)):i.then(this.loadMeshTextures.bind(this));var n=e.when(this.loadHighlightReel(),this.loadMattertags());return e.when(i,n).done(this.build.bind(this))},L.prototype.loadMesh=function(){var t=e.Deferred(),i=this;return y.load(i.urls,(function(e,n){if(0===e.length){D.warn("No geometry found for model, loading faux geometry, disabling outside mode"),i.supportedModes[l.DOLLHOUSE]=!1,i.supportedModes[l.FLOORPLAN]=!1;var o=new d({geometry:new r.PlaneBufferGeometry(5,5,1,1)});o.material.visible=!1,o.rotateX(-Math.PI/2),o.geometry.computeBoundingBox(),e=[o]}e.forEach((function(t){var e=i.floorsEnabled?A.parseFloor(t.name):0;i.addChunk(e,t)})),i.floors.sort(),t.resolve(i)}),(function(e,i){t.notify(e,i)}),(function(e){D.error(e),t.reject("loading-failed")})),t.promise()},L.prototype.flyToTagid=function(t){if(!G.d.tourIsPlaying){G.player.mattertagManager.closeTag();var e=this.getTagByTagid(t);if(e){var i={pano:this.panos.index[e.locationId],lookAtPoint:{x:e.position.x,y:e.position.y,z:e.position.z}};if(G.d.flyingtag)return;G.d.flyingtag=!0,G.d.player.flyToPano(i,(function(){G.d.player.mattertagManager.openTag(e),G.d.flyingtag=!1}))}}},L.prototype.loadMeshTextures=function(){return this.loadTexturesPromise||(this.loadTexturesPromise=b.load(this).then(function(){this.meshTexturesLoaded=!0}.bind(this))),this.loadTexturesPromise},L.prototype.generateEntrance=function(t){var e=t.world.ep,i=t.world.sp,n=new r.Vector3(e.x,e.y+.5,e.z),o=new r.Vector3(i.x,i.y+.5,i.z),a=(new r.Vector3).subVectors(n,o).divideScalar(2),s=(new r.Vector3).subVectors(n,o).normalize(),l=new r.Vector3(0,1,0),u=(new r.Vector3).crossVectors(l,s),h=l.angleTo(s),c=(new r.Quaternion).setFromAxisAngle(u,h),d=o.sub(a),p={actiontype:2,base:{y:d.y+.5,x:d.x,z:d.z},details:{subtype:0,tagpictype:null,title:this.settings.entry_door_text,tagpicurl:"",time:""},enable:!0,locationid:"location_10000",normal:{y:1,x:0,z:0},showtitle:!0,stem:{direction:{y:.1,x:0,z:0},enabled:!1},tagid:"1",tagtitle:""},f=new r.CylinderGeometry(.04,.16,.7,4),m=new r.MeshBasicMaterial({color:3342335}),g=new r.Mesh(f,m);return g.position.copy(d),g.quaternion.multiply(c),g.visible=!0,{mesh:g,info:p}},L.prototype.setEntranceState=function(t){this.entrance&&this.entranceMesh&&(this.entranceMesh.visible=t)},L.prototype.loadMattertags=function(){var t=e.Deferred();if(!p.mattertags.enabled||G.conf.screenshot)return t.resolve();var i=this,n=this.options.urlBase+"/play/data/"+this.modelid+"/nesttags";return o.get(n,{responseType:"json",fetchNum:1,prefetchFrom:"nesttags",auth:this.isPublic?null:p.authorizationHeader}).done(function(e){if(!(e&&e.setting&&e.setting.display))return t.resolve();var n,r=e.info,o=this.building_tag_enable,a=this.tour_tag_enable;if(o=isNaN(parseInt(o))?1:parseInt(o),a=isNaN(parseInt(a))?1:parseInt(a),r=r.filter((function(t){return 1==o||2!=parseInt(t.actiontype)})),this.entrance&&this.entrance.world&&1==o){var s=this.generateEntrance(this.entrance);r.push(s.info),this.entranceMesh=s.mesh,this.add(s.mesh)}var l=0;for(var u in G.titletags=[],r)(n=r[u]).enable&&(this.mattertags[u]=new m(this,u,n),n.showtitle&&n.tagtitle&&12!==n.details.templatetype&&(n.details.tagpictype=2,n.details.tagpicurl=n.tagtitle,this.mattertags[1e4+parseInt(u)]=new m(this,1e4+parseInt(u),n)),12===n.details.templatetype&&G.titletags.push(this.mattertags[u]));if(n={actiontype:1,base:{x:1e4,y:1e4,z:1e4},details:{description:"faketag",subtype:1,tagpictype:1,tagpicurl:null,templatetype:9,title:"faketag"},enable:!0,flooridx:0,locationid:"location_01",normal:{x:0,y:0,z:0},showtitle:!1,stem:{direction:{x:0,y:0,z:0},enabled:!1},tagid:"faketag"},this.mattertags[2e4]=new m(this,2e4,n),this.buildFloors.rooms&&1==a){var h="";l=0;this.buildFloors.rooms.forEach((function(t,e){t.connected_rooms&&(h=t.roomidx,t.connected_rooms.forEach((function(t,e){t.position.y?t.position.y=t.position.y+.1:t.position.x=0,n={actiontype:1,details:{description:"区域跳转标签",subtype:0,tagpictype:2,tagpicurl:null,templatetype:13,title:t.target_name},enable:!0,flooridx:0,locationid:"location_01",showtitle:!1,stem:{direction:{x:0,y:0,z:0},enabled:!1},tagid:"faketag",target_room:t.target_room,target_scene:t.target_scene,end_position:t.end_position,base:{x:t.position.x||0,y:t.position.y||0,z:t.position.z||0},roomidx:h},i.mattertags[3e4+parseInt(l)]=new m(i,3e4+parseInt(l),n),l++})))}))}t.resolve()}.bind(this)).fail((function(){D.warn("Getting tags failed, not displaying tags."),t.resolve()})),t},L.prototype.buildTagsForAddTag=function(t){var e=0;for(var i in this.mattertags)e++;var n=new m(this,e,t);this.mattertags[e]=n,this.mattertags[e].build(),this.mattertags[e].disc.material.opacity=1},L.prototype.newBuildTagsForAddTag=function(t){var e=0;for(var i in this.delTag(t.tagid),this.mattertags)parseInt(i)<1e4&&(e=parseInt(i)+1);var n=new m(this,e,t);this.mattertags[e]=n,this.mattertags[e].build(),this.mattertags[e].disc.material.opacity=1,t.showtitle&&t.tagtitle&&(e+=1e4,t.details.tagpictype=2,t.details.tagpicurl=t.tagtitle,this.mattertags[e]=new m(this,e,t),this.mattertags[e].build(),this.mattertags[e].disc.material.opacity=1)},L.prototype.delTag=function(t){var e="closed",i="open",n="active",r=null;for(var o in this.mattertags)if(this.mattertags[o]&&this.mattertags[o].tagid&&this.mattertags[o].tagid==t){r=this.mattertags[o];break}null!=r&&(r.floor.remove(r.obj3d),r.boardState!==i&&r.boardState!==n||(r.setClosedState(),r.boardState=e),delete this.mattertags[o])},L.prototype.newAddScene=function(t){},L.prototype.getSceneLength=function(){for(var t=this.settings.nestscenes.scenes,e=0,i=0;i<t.length;i++)0!==t[i].script&&void 0!==t[i].script||e++;return e},L.prototype.build360TagsForAddTag=function(t){var e=Object.keys(this.mattertags).length,i=this.mattertags[0],n=JSON.parse(JSON.stringify(i.data));n.base.x=t.base.x,n.base.y=t.base.y,n.base.z=t.base.z,n.details.title=t.details.title,n.details.templatetype=t.details.templatetype,n.locationid=t.locationid;var r=new m(this,e,n);return this.mattertags[e]=r,this.mattertags[e].build(),this.mattertags[e].disc.material.opacity=1,n.locationid},L.prototype.removeScene=function(t){for(var e=this.heroLocations.length-1;e>=0;e--)this.heroLocations[e].panoId==t&&this.heroLocations.splice(e,1);G.d.updateModel()},L.prototype.loadPanos=function(){if(this.loadPanosPromise)return this.loadPanosPromise;var t=new w(this),i=this;return this.loadPanosPromise=t.load().then((function(t){return i.data.sweeps&&Object.keys(i.data.sweeps).length>0&&(t=t.filter((function(t){return!(!i.data.sweeps[t.locationid]||void 0===i.data.sweeps[t.locationid].enabled)&&i.data.sweeps[t.locationid].enable}))),i.panos.extend(t.map((function(t){return new g(i,t.locationid,t,i.supportsTiles)}))),i.panos.forEach((function(t){if(p.delBK&&1==t.alignmentType){var e=new Object;e.id=t.id,e.u=t.u,e.v=t.v,i.panosUV.push(e)}t.neighbourUUIDs&&(t.neighbourUUIDs.forEach((function(e){var n=i.panos.get(e);n&&i.panos.setNeighbour(t,n,!0)})),t.neighbourPanos=i.panos.getNeighbours(t)||i.panos.setNeighbour(t,t,!0))})),0===i.panos.length&&(D.warn("Model has no panos, turning off inside mode"),i.supportedModes[l.PANORAMA]=!1),e.when(i)})),this.loadPanosPromise},L.prototype.oldloadPanos=function(){if(this.loadPanosPromise)return this.loadPanosPromise;var t=new w(this);return this.loadPanosPromise=t.load().then(function(t){return this.data.sweeps&&Object.keys(this.data.sweeps).length>0&&(t=t.filter(function(t){return!(!this.data.sweeps[t.locationid]||void 0===this.data.sweeps[t.locationid].enabled)&&this.data.sweeps[t.locationid].enabled}.bind(this))),this.panos.extend(t.map(function(t){return new g(this,t.locationid,t,this.supportsTiles)}.bind(this))),this.panos.forEach(function(t){if(p.delBK&&1==t.alignmentType){var e=new Object;e.id=t.id,e.u=t.u,e.v=t.v,this.panosUV.push(e)}}.bind(this)),this.panos.forEach(function(t){t.neighbourUUIDs&&(t.neighbourUUIDs.forEach(function(e){var i=this.panos.get(e);i&&this.panos.setNeighbour(t,i,!0)}.bind(this)),t.neighbourPanos=this.panos.getNeighbours(t)||this.panos.setNeighbour(t,t,!0))}.bind(this)),0===this.panos.length&&(D.warn("Model has no panos, turning off inside mode"),this.supportedModes[l.PANORAMA]=!1),e.when(this)}.bind(this)),this.loadPanosPromise},L.prototype.loadHighlightReel=function(){var t=e.Deferred(),i=this.options.urlBase+"/play/data/"+this.modelid+"/nestscenes";return o.get(i,{responseType:"json",fetchNum:1,prefetchFrom:"nestscenes",auth:this.isPublic?null:p.authorizationHeader}).done(function(e){t.resolve()}.bind(this)).fail((function(){D.warn("Getting highlight reel failed, no highlights available"),t.resolve()})),t},L.prototype.loadMeasures=function(){},L.prototype.waitForLoad=function(t,e){e()||(this.waitQueue.push({object:t,isLoadedCallback:e}),1===this.waitQueue.length&&this.emit("waiting"))},L.prototype.update=function(t){this.panos.update(t)},L.prototype.hide=function(){this.floors.hide()},L.prototype.show=function(){this.floors.show()},L.prototype.floorNames=function(){return this.floors.names()},L.prototype.warpDestFloors=function(t,e){if(t&&this.floors.length===t.length){var i=t.findIndex(function(t){return t}.bind(this));-1!==i&&this.setFloor(this.floors.list[i],null,e)}else this.toggleAllFloors(!0)},L.prototype.setFloor=function(t,e,i){this.allFloorsVisible&&this.emit("allfloors.toggled",!1,this.currentFloor),this.allFloorsVisible=!1,this._setFloor(t,e,i)},L.prototype.toggleAllFloors=function(t){this.allFloorsVisible=void 0!==t?t:!this.allFloorsVisible,this.emit("allfloors.toggled",this.allFloorsVisible,this.currentFloor),this._setFloor(this.currentFloor)},L.prototype._setFloor=function(t,e,i){e=e||this.mode,this.currentFloor=t,this.emit("floor.changed",t,e,this.currentFloor);var n=null;if(this.floors.list.forEach(function(t){t.toggle(t===this.currentFloor||this.allFloorsVisible,i||this.allFloorsVisible)}.bind(this)),e===l.PANORAMA){if(this.show(),this.shouldShowMattertags&&this.tagsShown)for(n in this.mattertags)this.mattertags[n].show(p.showFloorDuration)}else if((e===l.FLOORPLAN||e===l.DOLLHOUSE)&&this.shouldShowMattertags&&this.tagsShown)for(n in this.mattertags){var r=this.mattertags[n];this.allFloorsVisible?r.show(p.showFloorDuration):r.floor===this.currentFloor?r.show(p.showFloorDuration,p.showFloorDelay):r.hide(p.hideFloorDuration,p.hideFloorDelay)}var o=this,a=t;x.start((function(){}),p.showFloorDelay,function(){o.floors.forEach((function(t){t.chunks.forEach((function(e){e.renderOrder=t===a?u.visibleFloor:u.ghostFloor}))}))}.bind(this))},L.prototype.toggleExplode=function(){this.floors.toggleExplodeHorizontal()},L.prototype.toggleExplodeUp=function(){this.floors.toggleExplodeVertical()},L.prototype.nextFloor=function(t){return this.floors.nextFloor(this.currentFloor,t)},L.prototype.addFloor=function(t){this.floors.add(t)},L.prototype.getFloorAtPoint=function(t){return this.floors.getFloorAtPoint(t)},L.prototype.getTagByIdx=function(t){return t>=1e4&&(t-=1e4),this.mattertags[t]},L.prototype.getTagByTagid=function(t){for(var e=Object.keys(this.mattertags).length,i=0;i<e;i++)if(this.mattertags[i].tagid===t)return this.mattertags[i];return null},L.prototype.addChunk=function(t,e){this.floors.getOrMakeFloor(t).addChunk(e),this.chunks.push(e)},L.prototype.setMode=function(t){if(!this.supportedModes[t])throw new P("Mode not supported for this model: "+t);this.mode=t,this.chunks.forEach((function(e){e.setMode(t)}))},L.prototype.build=function(){var t=this;function i(t,e){return new r.Quaternion(t.x,t.y,t.z,t.w).multiply((new r.Quaternion).setFromAxisAngle(new r.Vector3(1,0,0),r.Math.degToRad(e)))}this.heroLocations=this.images.getHeroLocations(this.panos),this.has360Views=p.show360Views.enabled&&this.heroLocations.some(function(t){return t.cameraMode===l.PANORAMA&&this.panos.get(t.panoId)&&!this.panos.get(t.panoId).isAligned()}.bind(this)),null===this.heroImage&&D.warn("No hero image defined."),this.currentFloor=this.floors.last(),this.floors.build(),this.colliders=this.floors.reduce((function(t,e){return t.concat(e.collider.children)}),[]);var n=[],o=[];if(this.panos.forEach(function(t){2==t.alignmentType?o.push(t):n.push(t)}.bind(this)),n.forEach(function(t){t.build1(),t.on("enter",function(){t.floor!==this.currentFloor&&this.setFloor(t.floor)}.bind(this))}.bind(this)),o.forEach(function(t){t.build1(),t.on("enter",function(){t.floor!==this.currentFloor&&this.setFloor(t.floor)}.bind(this))}.bind(this)),G.conf.isNewEditVersion&&(parent.window.showHiddenPano?G.editPanos=!0:G.editPanos=!1),this.panos.forEach((function(e){if(e.build2(),1===e.alignmentType&&G.conf.isNewEditVersion&&G.editPanos){var i={actiontype:1,base:{x:e.marker.position.x,y:e.marker.position.y,z:e.marker.position.z},details:{templatetype:9e3,subtype:0,time:"2017-09-15 03:39:33",title:"点击隐藏或显示全景点:"+e.id,description:"pano使能",tagpictype:1},enable:!0,locationid:e.id,normal:{x:0,y:1,z:0},stem:{direction:{x:0,y:1,z:0},enabled:!0},tagid:"pano_"+e.id};t.buildTagsForAddTag(i)}})),this.floors.forEach(function(t){this.boundingBox.union(t.boundingBox)}.bind(this)),this.outline_fills){t=this;this.outline_fills.forEach((function(e){var i=t.floors.get(e.flooridx).boundingBox.min.y+.8;e.segments.forEach((function(e){var n=new r.Geometry;e.forEach((function(t){n.vertices.push(new r.Vector3(t.x,i,-t.y))}));var o=new r.PointsMaterial({color:16711680,size:.01,transparent:!0,opacity:0}),a=new r.Points(n,o);a.geometry.computeBoundingBox(),t.boundingBox.union(a.geometry.boundingBox)}))}))}for(var a in this.size=this.boundingBox.getSize(new r.Vector3),this.center=this.boundingBox.getCenter(new r.Vector3),this.floors.forEach(function(t){D.info("Floor "+t+": "+t.children.length+" chunks, "+t.panos.length+" panos.")}.bind(this)),this.panos.populate_path_graph(),this.skybox=new s(this.boundingBox),this.skybox.matrixWorldNeedsUpdate=!0,this.add(this.skybox),this.mattertags)12!==this.mattertags[a].type&&this.mattertags[a].build();if(1==p.thirdCustomer&&(null==this.floorNavigationMesh||null==this.floorNavigationMesh)){var u=new r.PlaneBufferGeometry(this.boundingBox.max.x-this.boundingBox.min.x,this.boundingBox.max.z-this.boundingBox.min.z),h=new r.TextureLoader;h.setCrossOrigin(!0);var c=h.load("https://template2.3dnest.cn/dianli/"+this.modelid+".png"),d=new r.MeshBasicMaterial({map:c,side:r.FrontSide,transparent:!0,opacity:1});this.floorNavigationMesh=new r.Mesh(u,d);var f=(new r.Vector3).copy(this.boundingBox.getCenter(new r.Vector3)),m=this.boundingBox.max.y,v=f.clone().setY(m);this.floorNavigationMesh.position.copy(v),"zq_sxex_17"==this.modelid?this.floorNavigationMesh.quaternion.copy(i(this.floorNavigationMesh.quaternion,-95)):"zq_dnjl_7"==this.modelid?this.floorNavigationMesh.quaternion.copy(i(this.floorNavigationMesh.quaternion,-92)):"zq_sxsx_18"==this.modelid?this.floorNavigationMesh.quaternion.copy(i(this.floorNavigationMesh.quaternion,-95)):"zq_ylck_24"==this.modelid?this.floorNavigationMesh.quaternion.copy(i(this.floorNavigationMesh.quaternion,-92)):this.floorNavigationMesh.quaternion.copy(i(this.floorNavigationMesh.quaternion,-90)),this.add(this.floorNavigationMesh)}return D.debug("Done building model"),g.raycastsDone>0&&(D.warn("raycasts: "+g.raycastsDone),D.warn("raycasts skipped: "+g.raycastsSkipped)),this.buildRooms(),e.when(this)},L.prototype.buildRooms=function(){this.rooms=new _(this),this.rooms.createFromChunks(this.chunks),this.rooms.calcRoomBoundaries()},L.prototype.updateProjectedPanos=function(){this.projectedPano0&&this.projectedPano1&&this.setProjectedPanos(this.projectedPano0,this.projectedPano1,!1)},L.prototype.setProjectedPanos=function(t,e,i){null!=i||(i=!0),i=!!i,this.projectedPano0=t,this.projectedPano1=e,this.skybox.material.setProjectedPanos(t,e,i),this.chunks.forEach((function(n){n.materialInside.setProjectedPanos(t,e,i)}))},L.prototype.setSide=function(t){this.floors.forEach((function(e){e.collider.material.side=t}))},L.prototype.setSide=function(t){this.floors.forEach((function(e){e.collider.material.side=t}))},L.prototype.heroCount=function(){return this.heroLocations?this.heroLocations.length:0},L.prototype.getHeroDescriptorByIndex=function(t){if(t<0)return D.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),null;if(this.heroCount()<1)return D.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),null;var e=this.heroLocations[t];return void 0===e?(D.warn("Model.getHeroDescriptorByIndex() -> Index "+t+" is not a validindex"),null):e},L.prototype.findPanoramicHero=function(){for(var t in this.heroLocations)if(this.heroLocations[t].cameraMode===l.PANORAMA)return this.heroLocations[t];return null},L.prototype.listImagePanos=function(){var t=[],e=this;return this.images.forEach((function(i){if(i._camera&&i._camera._locationid){var n=e.panos.get(i._camera._locationid);n&&(e.supportsTiles||n.isLoaded("high")||t.push(n))}})),t},L.prototype.fadePanoMarkers=function(t,e){this.panos.fadeMarkerOpacity(t,e)},L.prototype.setSweepVisibility=function(t){this.panos.forEach((function(e){e.marker&&(e.marker.visible=t)}))},L.prototype.outsideAllowed=function(){return this.supportedModes[l.DOLLHOUSE]&&this.supportedModes[l.FLOORPLAN]},L.prototype.setFloorsHeight=function(t){var e=t.locations.points,i=t.building.totalfloor,n={totalfloor:i,height:[]};if(i&&i>1){for(var r=[],o=0;o<i;o++)r.push([]);e.forEach((function(t){null!==t.flooridx&&r[t.flooridx].push(t.spot.z)})),r.forEach((function(t){t.sort((function(t,e){return t-e}));var e=Math.floor(t.length/2);n.height.push(t[e])}))}return n},t.exports=L}).call(this,i(6))},function(t,e){t.exports={Chinese:0,English:1,Japanese:2}},function(t,e){t.exports={Default:0,Fastmovie:1,Catalogue:2}},function(t,e,i){(function(e){(function(n){function r(t){this.cache=null,this.expires=0}function o(){this.baseUrl=null,this.cache=null,this.expires=0}function a(){this.baseUrl=null,this.expires=0}function s(t){this.initialLoadingPromise=null,this.endpoint=t+"?type=3",this.urlContainer=null,this.authorizationHeader=c.getAuthorizationHeader(),this.containerClasses=[a,o,r]}var l=i(11),u=i(2),h=i(26),c=i(25),d=new u(n);r.prototype={version:1,validate:function(t){return"catalog.json"in t&&Object.keys(t).length>0},update:function(t){return this.cache=t,this.expires=Date.now()+h.signedUrlDefaultExpireTime,e.when()},get:function(t){return this.cache[t]}},o.prototype={version:2,validate:function(t){return"catalog.json"in t&&"base.url"in t&&Object.keys(t).length>1},update:function(t){return this.baseUrl=t["base.url"],this.cache=t,this.expires=Date.now()+h.signedUrlDefaultExpireTime,e.when()},get:function(t){var e=this.cache[t];return e?this.baseUrl.replace("{{filename}}",t)+e:null}},a.prototype={version:3,validate:function(t){return!0},update:function(t){return this.baseUrl=t.locationpics,t.expires?this.expires=1e3*t.expires:this.expires=Date.now()+h.signedUrlDefaultExpireTime,e.when()},get:function(t){return this.baseUrl.replace("{{filename}}",t)}},s.prototype={init:function(){return this.initialLoadingPromise||(setInterval(function(){}.bind(this),h.signedUrlCheckInterval),this.initialLoadingPromise=this.refresh()),this.initialLoadingPromise},refresh:function(t){var i=void 0===(t=t||{}).cache||t.cache;return l.get(this.endpoint,{responseType:"json",prefetchFrom:i?"basic":null,cache:i,auth:this.authorizationHeader}).then(function(t){if(this.urlContainer&&this.urlContainer.validate(t))return this.urlContainer.update(t);for(var n=0;n<this.containerClasses.length;n++){var r=new(0,this.containerClasses[n]);if(r.validate(t))return d.info("Using urls version "+r.version),this.urlContainer=r,this.urlContainer.update(t)}return i?this.refresh({cache:!1}):e.Deferred().reject("missing-urls")}.bind(this),(function(t){return"loading-failed"}))},get:function(t){return G.url.model+"/"+t}},t.exports=s}).call(this,"/js/util/ModelUrls.js")}).call(this,i(6))},function(t,e,i){(function(e){function n(t){u.time("Computing a nice bounding cubemap");var e=new a({side:r.BackSide,transparent:!0});e.uniforms.modelAlpha.value=0,e.uniforms.opacity.value=1-s.modelAlpha,this.renderOrder=l.boundingSkybox,o.call(this,t,e),u.timeEnd("Computing a nice bounding cubemap")}var r=i(0),o=(i(5),i(12),i(152)),a=i(43),s=i(1),l=i(17),u=new(i(2))(e);n.prototype=Object.create(o.prototype),n.prototype.constructor=n,t.exports=n}).call(this,"/js/objects/BoundingTextureSkybox.js")},function(t,e,i){function n(t,e,i){var n=(t=t.clone()).getSize(new r.Vector3),o=new r.BoxGeometry(n.x,n.y,n.z);o.boundingBox=t,r.Mesh.call(this,o,e),this.position.copy(t.getCenter(new r.Vector3)),this.frustumCulled=!1,i&&this.add(new r.WireframeHelper(this))}var r=i(0);n.prototype=Object.create(r.Mesh.prototype),n.prototype.constructor=n,t.exports=n},function(t,e,i){"use strict";i(5);var n=i(0);function r(t){this.chunksize=t||10,this.chunks={},this.boundingBoxes={},this.children=[],this.offset=new n.Vector3(0,.5,0),this.material=new n.MeshBasicMaterial({color:16777215})}r.prototype.add=function(t){var e,i,r,o,a,s,l,u,h=t.attributes,c=new n.Vector3;if(h?(e=h.position.array,i=t.index?t.index.array:void 0):(e=t.vertices,t.faces),i)for(var d=0,p=i.length;d<p;d+=3){var f=3*i[d],m=3*i[d+1],g=3*i[d+2];r=(e[f]+e[m]+e[g])/3,o=(e[f+1]+e[m+1]+e[g+1])/3,a=(e[f+2]+e[m+2]+e[g+2])/3,(s=Math.floor(r/this.chunksize)+"."+Math.floor(o/this.chunksize)+"."+Math.floor(a/this.chunksize))in this.chunks?(u=this.chunks[s],l=this.boundingBoxes[s]):(u=this.chunks[s]=[],l=this.boundingBoxes[s]=new n.Box3),u.push(e[f],e[f+1],e[f+2],e[m],e[m+1],e[m+2],e[g],e[g+1],e[g+2]),l.expandByPoint(c.set(e[f],e[f+1],e[f+2])),l.expandByPoint(c.set(e[m],e[m+1],e[m+2])),l.expandByPoint(c.set(e[g],e[g+1],e[g+2]))}else for(d=0,p=e.length;d<p;d+=9)r=(e[d]+e[d+3]+e[d+6])/3,o=(e[d+1]+e[d+4]+e[d+7])/3,a=(e[d+2]+e[d+5]+e[d+8])/3,(s=Math.floor(r/this.chunksize)+"."+Math.floor(o/this.chunksize)+"."+Math.floor(a/this.chunksize))in this.chunks?(u=this.chunks[s],l=this.boundingBoxes[s]):(u=this.chunks[s]=[],l=this.boundingBoxes[s]=new n.Box3),u.push(e[d],e[d+1],e[d+2],e[d+3],e[d+4],e[d+5],e[d+6],e[d+7],e[d+8]),l.expandByPoint(c.set(e[d],e[d+1],e[d+2])),l.expandByPoint(c.set(e[d+3],e[d+4],e[d+5])),l.expandByPoint(c.set(e[d+6],e[d+7],e[d+8]))},r.prototype.build=function(){var t=new n.Object3D;for(var e in t.material=this.material,this.chunks){var i=this.chunks[e],r=new n.BufferGeometry,o=new n.BufferAttribute(new Float32Array(i),3);r.addAttribute("position",o),r.boundingBox=this.boundingBoxes[e];var a=new n.Mesh(r,this.material);a.material.visible=!1,t.add(a),this.chunks[e]=[]}return t},t.exports=r},function(t,e,i){function n(t){s.call(this),this.model=t,this.exploded=!1}var r=i(44),o=i(2),a=i(8),s=i(33),l=i(7),u=i(15),h=i(0);new o("/js/model/FloorCollection.js"),l.inherit(n,s),n.prototype.add=function(t){s.prototype.add.call(this,t),this.model.add(t)},n.prototype.getIndex=function(t){return t.floorIndex},n.prototype.build=function(){this.list.forEach((function(t){t.build()}))},n.prototype.size=function(){return this.length},n.prototype.sort=function(){s.prototype.sort.call(this,(function(t,e){return t.floorIndex-e.floorIndex}))},n.prototype.nextFloor=function(t,e){return this.index[t.floorIndex+e]||null},n.prototype.getFloorAtPoint=function(t){for(var e=null,i=1/0,n=0;n<this.list.length;n++){var r=this.list[n],o=r.distanceToPoint(t);(!e||i>o)&&(i=o,e=r)}return e},n.prototype.getOrMakeFloor=function(t){var e=this.index[t];return e||(e=new r(this.model,t),this.add(e)),e},n.prototype.hide=function(){this.list.forEach((function(t){t.hide()}))},n.prototype.show=function(){this.list.forEach((function(t){t.show()}))},n.prototype.names=function(){return this.list.reduce((function(t,e){return t.concat(e.name)}),[])},n.prototype.toggleExplodeHorizontal=function(){function t(t,e){t.position.x=i[t.floorIndex]*e,t.position.y=1*t.floorIndex*e}var e,i=[],n=0;this.list.forEach((function(t,r,o){e=r>0?Math.max(o[r-1].boundingBox.max.x-t.boundingBox.min.x,t.boundingBox.getSize(new h.Vector3).x/2):0,n+=e,i[r]=n})),i=i.map((function(t){return t-n/2})),this.exploded?this.list.forEach(function(e){a.start(function(i){t(e,1-i)}.bind(this),1500,null,0,u.easeOutExpo)}.bind(this)):this.list.forEach(function(e){a.start(function(i){t(e,i)}.bind(this),1500,null,0,u.easeOutExpo)}.bind(this)),this.exploded=!this.exploded},n.prototype.toggleExplodeVertical=function(){function t(t,i){t.position.y=(5*t.floorIndex-e.y/2)*i,t.panos.forEach((function(e){e.position.y=e.origin.y+t.position.y,e.skyboxMesh.position.y=e.origin.y+t.position.y}))}var e=this.model.size;this.exploded?this.list.forEach((function(e){a.start((function(i){t(e,1-i)}),1500,null,0,u.easeOutExpo)})):this.list.forEach((function(e){a.start((function(i){t(e,i)}),1500,null,0,u.easeOutExpo)})),this.exploded=!this.exploded},t.exports=n},function(t,e,i){(function(e){var n,r=i(156),o=i(0),a=i(2),s=i(3),l=i(1),u=i(5),h=i(17),c=i(16),d=i(19),p=i(8),f=i(10),m=i(15),g=i(157),v=i(4).EventEmitter,y=i(39),b=i(71),w=new a("/js/mattertag/Mattertag.js"),x=i(158),M=i(159),T=i(22),S="closed",_="opening",A="open",P="closing",C="active";function E(t,e,i,n,r){this.tilesHorizontal=e,this.tilesVertical=i,this.numberOfTiles=n,t.wrapS=t.wrapT=o.RepeatWrapping,t.repeat.set(1/this.tilesHorizontal,1/this.tilesVertical),this.tileDisplayDuration=r,this.currentLoopTime=this.currentTile=this.currentDisplayTime=0,this.inStop=!1,this.totalcount=0,this.update=function(e){for(this.inStop?(this.totalcount++,800<this.totalcount&&(this.totalcount=0,this.inStop=!1)):this.currentDisplayTime+=e;this.currentDisplayTime>this.tileDisplayDuration;)this.currentDisplayTime-=this.tileDisplayDuration,this.currentTile++,t.offset.x=this.currentTile%this.tilesHorizontal/this.tilesHorizontal,t.offset.y=Math.floor(this.currentTile/this.tilesHorizontal)/this.tilesVertical}}function D(t,i,n){var r=n.version||"0";if("0"!==r&&w.info("nesttags version: "+r),this.data=n,this.model=t,this.player=G.player,this.locationId=n.locationid,this.i=i,this.tagid=n.tagid,this.enabled=l.mattertags.enabled&&n.enable,this.label=n.details.title?n.details.title:"",this.subtype=n.details.subtype,this.tagInfoUrl=n.details.url,this.audioenable=n.details.audioenable,n.details.templatetype===y.Audio&&(this.audioenable=!0),this.audiourl=n.details.audiourl||n.details.url,this.videourl=n.details.videourl,this.tagPicUrl=n.details.tagpicurl,this.tagPicType=n.details.tagpictype,this.parsedDescription=[],this.links=[],this.floor=null,this.floorIndex=n.flooridx||0,this.isBuilt=!1,this.des=this.data.details.description,G.player&&G.player.currentPano&&2===G.player.currentPano.alignmentType?this.rt360=!0:this.rt360=!1,2e4===i&&(n.details.templatetype=y.Tag360T1),n.details.templatetype===y.ImageText&&n.details.audioenable&&n.details.audiourl&&(n.details.templatetype=y.ImageTextAudio),n.details.templatetype===y.TextOnly&&n.details.audioenable&&n.details.audiourl&&(n.details.templatetype=y.TextAudio),n.actiontype==y.ClassifyType.Building?(this.type=y.BuildingType,this.mediatype=b.Normal):(this.type=n.details.templatetype,n.details.templatetype===y.BuildingType||n.details.templatetype===y.TextOnly||n.details.templatetype===y.ImageText||n.details.templatetype===y.OtherModel?this.mediatype=b.Normal:n.details.templatetype===y.Audio||n.details.templatetype===y.TextAudio||n.details.templatetype===y.ImageTextAudio?(this.mediadiv=(n.details.templatetype,y.ImageTextAudio,window.document.getElementById("audio-tag")),this.mediatype=b.Audio):n.details.templatetype===y.Video?(this.mediadiv=window.document.getElementById("video-tag"),this.mediatype=b.Video):n.details.templatetype===y.IFrame?this.mediatype=b.IFrame:this.mediatype=b.Normal),n.details.audioenable&&n.details.audiourl&&(n.details.templatetype=y.TextAudio),this.imgaudioControl={loop:""},this.picDescription=null,this.audioControl={loop:""},this.audioPauseTime=0,this.highlightStatus=!1,this.mode=u.PANORAMA,n.preferred_camera&&n.preferred_camera.mode&&(this.mode=n.preferred_camera.mode),this.obj3d=this.disc=this.billboard=null,this.geometry={},this.geometry.disc=new o.PlaneBufferGeometry(1,1),this.geometry.discGif=new o.PlaneBufferGeometry(2,2),this.geometry.discBuilding=new o.PlaneBufferGeometry(2,2),this.geometry.discTo360Tag=new o.PlaneBufferGeometry(1,1),this.geometry.discFrom360Tag=new o.PlaneBufferGeometry(1,.6),this.geometry.discOtherModel=new o.PlaneBufferGeometry(2,2),this.geometry.discOtherModelText=new o.PlaneBufferGeometry(2,2),this.geometry.cutout=new o.SphereBufferGeometry(.5,16,8),this.type===y.BuildingType&&this.label){var a=G.settings.locations.points;if(a&&a.forEach((function(t,e){if(n.locationid===t.locationid)return n.base.y=t.viewpoint.z,!1})),this.label.length>6){var s=.22*this.label.length+.3;this.geometry.discBuilding=new o.PlaneBufferGeometry(s,.5)}else{s=.35*this.label.length+.3;this.geometry.discBuilding=new o.PlaneBufferGeometry(s,.5)}}if(this.type===y.Audio){this.materialsAudio={};var h=T.splitUrl("./images/audioon_128x128.png"),d=T.splitUrl("./images/audiooff_128x128.png");if(this.tagPicType!=M.Pic&&this.tagPicType!=M.GIF||null==this.tagPicUrl||""==this.tagPicUrl||(h=this.tagPicUrl,d=this.tagPicUrl.replace(".png","_hover.png")),this.tagPicType===M.Text)this.materialsAudio.free=this.buildDiscMaterial(this.getText(this.tagPicUrl,1)),this.materialsAudio.hover=this.buildDiscMaterial(this.getText(this.tagPicUrl,1));else if(this.tagPicType===M.GIF){var p=this.getTexture(h);this.materialsAudio.free=this.buildDiscMaterial(p),this.materialsAudio.hover=this.buildDiscMaterial(p),this.clock=new o.Clock,this.gifObject=new E(p,1,25,25,30)}else this.materialsAudio.free=this.buildDiscMaterial(this.getTexture(h)),this.materialsAudio.hover=this.buildDiscMaterial(this.getTexture(d));this.materialsAudio.disable=this.materialsAudio.free.clone(),this.materialsAudio.disable.opacity=l.mattertags.disc.disabledOpacity,this.materialsAudio.cutout=new o.MeshBasicMaterial({transparent:!0,opacity:1,colorWrite:!1}),this.materialsAudio.pole=new o.LineBasicMaterial({linewidth:l.mattertags.pole.width,color:l.mattertags.pole.color,opacity:l.mattertags.startup.hideUntilStart?0:l.mattertags.pole.opacity,transparent:!0,alphaTest:l.mattertags.pole.opacity*l.mattertags.visibility.alphaTestLevel}),this.materialsAudio={free:this.materialsAudio.free.clone(),hover:this.materialsAudio.hover.clone(),disable:this.materialsAudio.disable.clone(),pole:this.materialsAudio.pole.clone(),cutout:this.materialsAudio.cutout.clone()},this.audioControl.loop=n.details.loop,this.tagInfoUrl=n.details.url,this.materials=this.materialsAudio}else if(this.type===y.OtherModel||this.type===y.TagTo360||this.type===y.Tag360T1||this.type===y.TextOnly){this.materialsOtherModel={};h=T.splitUrl("./images/goto_256x256.png"),d=T.splitUrl("./images/goto_256x256.png");if(this.tagPicType!==M.Pic&&this.tagPicType!==M.GIF||null===this.tagPicUrl||""===this.tagPicUrl||(h=d=this.tagPicUrl),this.type===y.Title)this.geometry.disc=new o.PlaneBufferGeometry(12,3),this.materialsOtherModel.free=this.materialsOtherModel.hover=this.buildDiscMaterial();else if(this.tagPicType===M.Text)this.materialsOtherModel.free=this.buildDiscMaterial(this.getText(this.tagPicUrl,1)),this.materialsOtherModel.hover=this.buildDiscMaterial(this.getText(this.tagPicUrl,1));else if(this.tagPicType===M.GIF){p=this.getTexture(h);this.materialsOtherModel.free=this.buildDiscMaterial(p),this.materialsOtherModel.hover=this.buildDiscMaterial(p),this.clock=new o.Clock,this.gifObject=new E(p,1,25,25,30)}else this.materialsOtherModel.free=this.buildDiscMaterial(this.getTexture(h)),this.materialsOtherModel.hover=this.buildDiscMaterial(this.getTexture(d));this.materialsOtherModel.disable=this.materialsOtherModel.free.clone(),this.materialsOtherModel.disable.opacity=l.mattertags.disc.disabledOpacity,this.materialsOtherModel.cutout=new o.MeshBasicMaterial({transparent:!0,opacity:1,colorWrite:!1}),this.materialsOtherModel.pole=new o.LineBasicMaterial({linewidth:l.mattertags.pole.width,color:l.mattertags.pole.color,opacity:l.mattertags.startup.hideUntilStart?0:l.mattertags.pole.opacity,transparent:!0,alphaTest:l.mattertags.pole.opacity*l.mattertags.visibility.alphaTestLevel}),this.materialsOtherModel={free:this.materialsOtherModel.free.clone(),hover:this.materialsOtherModel.hover.clone(),disable:this.materialsOtherModel.disable.clone(),pole:this.materialsOtherModel.pole.clone(),cutout:this.materialsOtherModel.cutout.clone()},this.tagInfoUrl=n.details.url,this.materials=this.materialsOtherModel,this.materials.free.map.needsUpdate=!0}else if(this.type===y.Title)e(".viewport-tags").append('<a id="titletag'+this.i+'" href="javascript:;" class="viewport-tag js-tag visible" style="z-index:20;"><div class="viewport-tag-point"></div><div class="viewport-tag-label"><span class="viewport-tag-label-name">'+n.details.title+"</span></div></a>");else if(this.type===y.ImageText||this.type===y.ImageTextAudio||this.type===y.IKEA||this.type===y.Video){this.materialsNotAudio={};h=T.splitUrl("./images/tagnormal_128x128.png"),d=T.splitUrl("./images/taghover_128x128.png");if(this.tagPicType!==M.Pic&&this.tagPicType!==M.GIF||null===this.tagPicUrl||""===this.tagPicUrl||(h=d=this.tagPicUrl),this.tagPicType===M.Text)this.materialsNotAudio.free=this.buildDiscMaterial(this.getText(this.tagPicUrl,1)),this.materialsNotAudio.hover=this.buildDiscMaterial(this.getText(this.tagPicUrl,1));else if(this.tagPicType===M.GIF){p=this.getTexture(h);this.materialsNotAudio.free=this.buildDiscMaterial(p),this.materialsNotAudio.hover=this.buildDiscMaterial(p),this.clock=new o.Clock,this.gifObject=new E(p,1,25,25,30)}else this.materialsNotAudio.free=this.buildDiscMaterial(this.getTexture(h)),this.materialsNotAudio.hover=this.buildDiscMaterial(this.getTexture(d));this.materialsNotAudio.disable=this.materialsNotAudio.free.clone(),this.materialsNotAudio.disable.opacity=l.mattertags.disc.disabledOpacity,this.materialsNotAudio.cutout=new o.MeshBasicMaterial({transparent:!0,opacity:1,colorWrite:!1}),this.materialsNotAudio.pole=new o.LineBasicMaterial({linewidth:l.mattertags.pole.width,color:l.mattertags.pole.color,opacity:l.mattertags.startup.hideUntilStart?0:l.mattertags.pole.opacity,transparent:!0,alphaTest:l.mattertags.pole.opacity*l.mattertags.visibility.alphaTestLevel}),this.materialsNotAudio={free:this.materialsNotAudio.free.clone(),hover:this.materialsNotAudio.hover.clone(),disable:this.materialsNotAudio.disable.clone(),pole:this.materialsNotAudio.pole.clone(),cutout:this.materialsNotAudio.cutout.clone()},this.imgaudioControl=n.details.audioloop?n.details.audioloop:{loop:""},this.materials=this.materialsNotAudio}else if(this.type===y.Tag360T1){if({free:c.loadCanvas(this.label),hover:c.loadCanvas(this.label)},this.materials360Type={},2===this.subtype){this.tagPicType=3;h=T.splitUrl("./images/gif8_128x3200.png"),p=this.getTexture(h);this.materials360Type.free=this.buildDiscMaterial(p),this.materials360Type.hover=this.buildDiscMaterial(p),this.clock=new o.Clock,this.gifObject=new E(p,1,25,25,30)}else this.materials360Type.free=this.buildDiscMaterial(this.getText(this.label,1)),this.materials360Type.hover=this.buildDiscMaterial(this.getText(this.label,1));this.materials360Type.disable=this.materials360Type.free.clone(),this.materials360Type.disable.opacity=l.mattertags.disc.disabledOpacity,this.materials360Type.cutout=new o.MeshBasicMaterial({transparent:!0,opacity:1,colorWrite:!1}),this.materials360Type.pole=new o.LineBasicMaterial({linewidth:l.mattertags.pole.width,color:l.mattertags.pole.color,opacity:l.mattertags.startup.hideUntilStart?0:l.mattertags.pole.opacity,transparent:!0,alphaTest:l.mattertags.pole.opacity*l.mattertags.visibility.alphaTestLevel}),this.materials360Type={free:this.materials360Type.free.clone(),hover:this.materials360Type.hover.clone(),disable:this.materials360Type.disable.clone(),pole:this.materials360Type.pole.clone(),cutout:this.materials360Type.cutout.clone()},this.materials=this.materials360Type}else if(this.type===y.BuildingType)({free:c.loadCanvas(this.label),hover:c.loadCanvas(this.label)}),this.materialsBuilding={},this.materialsBuilding.free=this.buildDiscMaterial(this.getText(this.label)),this.materialsBuilding.hover=this.buildDiscMaterial(this.getText(this.label)),this.materialsBuilding.disable=this.materialsBuilding.free.clone(),this.materialsBuilding.disable.opacity=l.mattertags.disc.disabledOpacity,this.materialsBuilding.cutout=new o.MeshBasicMaterial({transparent:!0,opacity:1,colorWrite:!1}),this.materialsBuilding.pole=new o.LineBasicMaterial({linewidth:l.mattertags.pole.width,color:l.mattertags.pole.color,opacity:l.mattertags.startup.hideUntilStart?0:l.mattertags.pole.opacity,transparent:!0,alphaTest:l.mattertags.pole.opacity*l.mattertags.visibility.alphaTestLevel}),this.materialsBuilding={free:this.materialsBuilding.free.clone(),hover:this.materialsBuilding.hover.clone(),disable:this.materialsBuilding.disable.clone(),pole:this.materialsBuilding.pole.clone(),cutout:this.materialsBuilding.cutout.clone()},this.materials=this.materialsBuilding;else if(this.type===y.RegionalJump)this.materialsRegional={},this.materialsRegional.free=this.buildDiscMaterial(c.loadCanvasRe(this.label)),this.materialsRegional.hover=this.buildDiscMaterial(c.loadCanvasRe(this.label)),this.materialsRegional.disable=this.materialsRegional.free.clone(),this.materialsRegional.disable.opacity=l.mattertags.disc.disabledOpacity,this.materialsRegional.cutout=new o.MeshBasicMaterial({transparent:!0,opacity:1,colorWrite:!1}),this.materialsRegional.pole=new o.LineBasicMaterial({linewidth:l.mattertags.pole.width,color:l.mattertags.pole.color,opacity:l.mattertags.startup.hideUntilStart?0:l.mattertags.pole.opacity,transparent:!0,alphaTest:l.mattertags.pole.opacity*l.mattertags.visibility.alphaTestLevel}),this.materialsRegional={free:this.materialsRegional.free.clone(),hover:this.materialsRegional.hover.clone(),disable:this.materialsRegional.disable.clone(),pole:this.materialsRegional.pole.clone(),cutout:this.materialsRegional.cutout.clone()},this.materials=this.materialsRegional;else if(this.type===y.TagTo360){if({free:c.loadCanvas(this.label),hover:c.loadCanvas(this.label)},this.materialsTo360={},2===this.subtype){this.tagPicType=3;h=T.splitUrl("./images/gif8_128x3200.png"),p=this.getTexture(h);this.materialsTo360.free=this.buildDiscMaterial(p),this.materialsTo360.hover=this.buildDiscMaterial(p),this.clock=new o.Clock,this.gifObject=new E(p,1,25,25,30)}else this.materialsTo360.free=this.buildDiscMaterial(this.getText(this.label,1)),this.materialsTo360.hover=this.buildDiscMaterial(this.getText(this.label,1));this.materialsTo360.disable=this.materialsTo360.free.clone(),this.materialsTo360.disable.opacity=l.mattertags.disc.disabledOpacity,this.materialsTo360.cutout=new o.MeshBasicMaterial({transparent:!0,opacity:1,colorWrite:!1}),this.materialsTo360.pole=new o.LineBasicMaterial({linewidth:l.mattertags.pole.width,color:l.mattertags.pole.color,opacity:l.mattertags.startup.hideUntilStart?0:l.mattertags.pole.opacity,transparent:!0,alphaTest:l.mattertags.pole.opacity*l.mattertags.visibility.alphaTestLevel}),this.materialsTo360={free:this.materialsTo360.free.clone(),hover:this.materialsTo360.hover.clone(),disable:this.materialsTo360.disable.clone(),pole:this.materialsTo360.pole.clone(),cutout:this.materialsTo360.cutout.clone()},this.tagInfoUrl=n.details.url,this.materials=this.materialsTo360}else if(this.type===y.Pano){if(this.materialsNotAudio={},t.panos.index[this.locationId].enable?(h=T.splitUrl("./images/disable_on_256x256.png"),d=T.splitUrl("./images/disable_on_256x256.png")):(h=T.splitUrl("./images/disable_off_256x256.png"),d=T.splitUrl("./images/disable_off_256x256.png")),this.tagPicType!==M.Pic&&this.tagPicType!==M.GIF||null===this.tagPicUrl||""===this.tagPicUrl||void 0===this.tagPicUrl||(h=d=this.tagPicUrl),this.tagPicType===M.Text)this.materialsNotAudio.free=this.buildDiscMaterial(this.getText(this.tagPicUrl,1)),this.materialsNotAudio.hover=this.buildDiscMaterial(this.getText(this.tagPicUrl,1));else if(this.tagPicType===M.GIF){p=this.getTexture(h);this.materialsNotAudio.free=this.buildDiscMaterial(p),this.materialsNotAudio.hover=this.buildDiscMaterial(p),this.clock=new o.Clock,this.gifObject=new E(p,1,25,25,30)}else this.materialsNotAudio.free=this.buildDiscMaterial(this.getTexture(h)),this.materialsNotAudio.hover=this.buildDiscMaterial(this.getTexture(d));this.materialsNotAudio.disable=this.materialsNotAudio.free.clone(),this.materialsNotAudio.disable.opacity=l.mattertags.disc.disabledOpacity,this.materialsNotAudio.cutout=new o.MeshBasicMaterial({transparent:!0,opacity:1,colorWrite:!1}),this.materialsNotAudio.pole=new o.LineBasicMaterial({linewidth:l.mattertags.pole.width,color:l.mattertags.pole.color,opacity:l.mattertags.startup.hideUntilStart?0:l.mattertags.pole.opacity,transparent:!0,alphaTest:l.mattertags.pole.opacity*l.mattertags.visibility.alphaTestLevel}),this.materialsNotAudio={free:this.materialsNotAudio.free.clone(),hover:this.materialsNotAudio.hover.clone(),disable:this.materialsNotAudio.disable.clone(),pole:this.materialsNotAudio.pole.clone(),cutout:this.materialsNotAudio.cutout.clone()},this.materials=this.materialsNotAudio}else{this.materialsNotAudio={};h=T.splitUrl("./images/tagnormal_128x128.png"),d=T.splitUrl("./images/taghover_128x128.png");if(this.tagPicType!==M.Pic&&this.tagPicType!==M.GIF||null===this.tagPicUrl||""===this.tagPicUrl||(h=d=this.tagPicUrl),this.tagPicType===M.Text)this.materialsNotAudio.free=this.buildDiscMaterial(this.getText(this.tagPicUrl,1)),this.materialsNotAudio.hover=this.buildDiscMaterial(this.getText(this.tagPicUrl,1));else if(this.tagPicType===M.GIF){p=this.getTexture(h);this.materialsNotAudio.free=this.buildDiscMaterial(p),this.materialsNotAudio.hover=this.buildDiscMaterial(p),this.clock=new o.Clock,this.gifObject=new E(p,1,25,25,30)}else this.materialsNotAudio.free=this.buildDiscMaterial(this.getTexture(h)),this.materialsNotAudio.hover=this.buildDiscMaterial(this.getTexture(d));this.materialsNotAudio.disable=this.materialsNotAudio.free.clone(),this.materialsNotAudio.disable.opacity=l.mattertags.disc.disabledOpacity,this.materialsNotAudio.cutout=new o.MeshBasicMaterial({transparent:!0,opacity:1,colorWrite:!1}),this.materialsNotAudio.pole=new o.LineBasicMaterial({linewidth:l.mattertags.pole.width,color:l.mattertags.pole.color,opacity:l.mattertags.startup.hideUntilStart?0:l.mattertags.pole.opacity,transparent:!0,alphaTest:l.mattertags.pole.opacity*l.mattertags.visibility.alphaTestLevel}),this.materialsNotAudio={free:this.materialsNotAudio.free.clone(),hover:this.materialsNotAudio.hover.clone(),disable:this.materialsNotAudio.disable.clone(),pole:this.materialsNotAudio.pole.clone(),cutout:this.materialsNotAudio.cutout.clone()},this.materials=this.materialsNotAudio}this.position=(new o.Vector3).copy(n.base);var f=(new o.Vector3).copy(n.stem.direction);if(this.type,y.Title,this.discPosition=f,this.basepos=this.position.clone(),this.discpos2=this.discPosition.clone(),this.discPosition.y+=.03,this.discScale=.05,this.poleEnabled=n.stem.enabled,this.boardOrientation="",this.boardState=S,this.hoveringBillboard=!1,this.animationScale=0,this.visibleTransition=null,this.boardTransition=null,this.fadeInTimer=void 0,this.fadeOutTimer=void 0,l.mattertags.enableLinking&&(this.type===y.TextOnly||this.type===y.TextAudio)){var m=this.parseLinks(n.details.description,t.modelid);this.links=m.links,this.parsedDescription=m.description}}var L=document.getElementById("tag-billboards"),O=document.getElementById("audio-tag"),I=document.getElementById("audio-tag"),R=document.getElementById("video-tag");D.prototype=Object.create(v.prototype),D.raycaster=new o.Raycaster,D.prototype.build=function(){return this.enabled&&!this.isBuilt&&l.mattertags.enablePanoSize?(this.floor=this.model.floors.get(this.floorIndex)||this.model.floors.first(),this.floor&&(this.billboard=this.buildBillboard(),this.obj3d=this.buildObject3D(),this.floor.add(this.obj3d)),this.isBuilt=!0,this):null},D.prototype.draw=function(t,e){},D.prototype.buildObject3D=function(){var t=new o.Object3D;if(t.position.copy(this.position),this.tagPicType===M.Text)if(this.tagPicUrl){var e=.35*this.tagPicUrl.length+.2;this.geometry.discOtherModelText=new o.PlaneBufferGeometry(e,.5),this.disc=new o.Mesh(this.geometry.discOtherModelText,this.materials.free)}else this.disc=new o.Mesh(this.geometry.discOtherModelText,this.materials.free);else this.type===y.BuildingType?this.disc=new o.Mesh(this.geometry.discBuilding,this.materials.free):this.type===y.OtherModel?this.disc=new o.Mesh(this.geometry.discOtherModel,this.materials.free):this.type===y.Tag360T1?this.disc=new o.Mesh(this.geometry.discFrom360Tag,this.materials.free):this.type===y.TagTo360?this.disc=new o.Mesh(this.geometry.discTo360Tag,this.materials.free):this.tagPicType===M.Text?this.disc=new o.Mesh(this.geometry.discGif,this.materials.free):this.disc=new o.Mesh(this.geometry.disc,this.materials.free);2e4===this.i&&(this.geometry.disc=new o.PlaneBufferGeometry(1e-4,1e-4),this.disc=new o.Mesh(this.geometry.disc,this.materials.free)),this.type!=y.Tag360T1&&this.disc.position.copy(this.discPosition),this.disc.renderOrder=h.mattertagDisc,this.disc.tag=this;var i=new o.Mesh(this.geometry.cutout,this.materials.cutout);if(i.renderOrder=h.mattertagCutout,this.disc.add(i),this.poleEnabled){var n=this.buildPole();n.renderOrder=h.mattertagStem,t.add(n)}return t.add(this.disc)},D.prototype.updateTagMaterial=function(t){this.materials.free=this.buildDiscMaterial(this.getTexture(t)),this.disc.material=this.materials.free,this.disc.material.needUpdate=!0},D.prototype.buildTextObject3D=function(t){var e=Object.create(t);e.type=-1;var i=new o.Object3D;e.position.y+=.05,i.position.copy(e.position),e.disc=new o.Mesh(e.geometry.discOtherModel,e.materials.free),e.discPosition.y+=.05,e.disc.position.copy(e.discPosition),e.disc.renderOrder=h.mattertagDisc,e.disc.tag=this;var n=new o.Mesh(e.geometry.cutout,e.materials.cutout);if(n.renderOrder=h.mattertagCutout,e.disc.add(n),e.poleEnabled){var r=e.buildPole();r.renderOrder=h.mattertagStem,i.add(r)}return i.add(e.disc)},D.prototype.buildDiscMaterial=function(t,e){if(this.type===y.Title){var i=document.createElement("canvas");i.width=1024,i.height=256;var n=i.getContext("2d");return this.dc=i,this.ctx=n,new o.MeshBasicMaterial({map:new o.Texture(i),transparent:!0,opacity:1,alphaTest:l.mattertags.visibility.alphaTestLevel,depthTest:!1})}if(1==e){var r=new o.SpriteMaterial({opacity:l.mattertags.startup.hideUntilStart?0:l.mattertags.disc.opacity,transparent:!0,map:t});return r.map.offset=new o.Vector2(0,0),r.map.repeat=new o.Vector2(1/17,1),r.depthTest=!1,r.blending=o.AdditiveBlending,r}return new o.MeshBasicMaterial({map:t,transparent:!0,opacity:l.mattertags.startup.hideUntilStart?0:l.mattertags.disc.opacity,alphaTest:l.mattertags.visibility.alphaTestLevel})},D.prototype.initAnimation=function(){var t=this.disc.material.map.offset;this.cursorAnimate=new TWEEN.Tween(t).to({x:1},1e3).onStart((function(){})).onStop((function(){t.x=0})).onUpdate((function(){})).onComplete((function(){t.x=0,setTimeout((function(){}),1500)})),this.cursorAnimate.easing((function(t){return Math.floor(17*t)/17})),this.cursorAnimate.repeat(Number.POSITIVE_INFINITY),this.cursorAnimate.start()},D.prototype.getTexture=function(t){return c.loadurl(t)},D.prototype.getText=function(t,e){return e?c.loadCanvasIn(t):c.loadCanvas(t)},D.prototype.buildPole=function(){return this.geom=new o.BufferGeometry,this.ar=new Float32Array(6),this.ar[0]=this.ar[1]=this.ar[2]=0,this.ar[3]=this.discPosition.x,this.ar[4]=this.discPosition.y,this.ar[5]=this.discPosition.z,this.geom.addAttribute("position",new o.BufferAttribute(this.ar,3)),this.line=new o.Line(this.geom,this.materials.pole),this.line},D.prototype.parseLinks=function(t,e){var i=/\[([^\]]*)\]\((.*?)(?:\)(?:\s|$))/,n=[],r=[],o=[];for(t=t.slice();;){var a=t.match(i);if(!a)break;r.push(t.slice(0,a.index)),t=t.slice(a.index+a[0].length),-1===a[2].indexOf("javascript:")&&n.push(a)}return r.push(t),l.mls||(o=this.buildLinks(n,e)),{links:o,description:r}},D.prototype.buildLinks=function(t,e){return t.map((function(t){var i=g.EXT_LINK,n=t[1],r=t[2];return-1===r.indexOf("://")&&(r="https://"+r),-1===r.indexOf("matterport.com/show")&&-1===r.indexOf(window.location.host+"/show")||(-1!==r.indexOf(e)&&-1!==r.indexOf("start=")?i=g.NAVIGATION:(i=g.MODEL,r+="&play=1")),{label:n,URL:r,type:i}}))},D.prototype.buildBillboard=function(){var t,i;if(this.type===y.Audio){(i=document.createElement("div")).className="c_circleProgress_wrapper",L.appendChild(i);var n=document.createElement("div");n.className="c_wrapper c_right",i.appendChild(n);var r=document.createElement("div");r.className="c_circleProgress c_rightcircle",n.appendChild(r);var o=document.createElement("div");o.className="c_wrapper c_left",i.appendChild(o);var a=document.createElement("div");a.className="c_circleProgress c_leftcircle",o.appendChild(a)}else{(i=document.createElement("div")).className="tag-container has-hotzone",L.appendChild(i),(t=document.createElement("div")).className="tag-body",i.appendChild(t);var s=document.createElement("p");s.className="tag-label",s.textContent=this.label,e(".tag-label").css("line-height",1.5),e(".tag-label").css("letter-spacing","1px"),t.appendChild(s),this.buildContents(t),t.addEventListener("mouseover",function(t){this.boardState===A&&i.classList.remove("has-hotzone")}.bind(this)),t.addEventListener("mousedown",(function(t){t.stopPropagation()})),t.addEventListener("mouseup",(function(t){t.stopPropagation()})),i.addEventListener("mousedown",u("mousedown")),i.addEventListener("mouseup",u("mouseup")),i.addEventListener("mouseenter",function(t){(l.mattertags.animation.hoverOnClosing||this.boardState!==P)&&(this.hoveringBillboard=!0,this.emit("enter",this),this.setHoverState())}.bind(this)),i.addEventListener("mouseleave",function(t){this.hoveringBillboard=!1,this.emit("leave",this),this.boardState!==C&&this.setFreeState()}.bind(this))}function u(t){return function(e){var i,n=document.getElementById("player");try{i=new MouseEvent(t,e)}catch(n){(i=document.createEvent("MouseEvents")).initMouseEvent(t,e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}n.dispatchEvent(i)}}return i},D.prototype.buildContents=function(t){function i(t){var i=document.createElement("span");return i.className="tag-desc",e(".tag-desc").css("line-height",1.6),e(i).html(null!=t?t:""),i}this.links.forEach(function(e,n){var r=i(this.parsedDescription[n]);t.appendChild(r);var o=document.createElement("a");if(o.classList.add("tag-link"),o.setAttribute("data-linktype",e.type),o.setAttribute("data-tagID",this.i),o.href=e.URL,o.textContent=e.label+" ",e.type===g.EXT_LINK){r.textContent+="→ ";var a=document.createElement("i");a.classList.add("icon-ext-link"),a.title="Link to external web site",o.appendChild(a)}t.appendChild(o)}.bind(this));var n=i(this.parsedDescription[this.parsedDescription.length-1]);t.appendChild(n)},D.prototype.scrollAll=function(t){},D.prototype.setFreeState=function(t,e){O.volume=1,this.type===y.ImageText||this.type===y.ImageTextAudio||this.type===y.IKEA||this.type===y.Video?this.setClosedState():this.type===y.Audio?e&&(this.setClosedState(),this.stopAudio()):!t&&this.hoveringBillboard||(this.fadeOutTimer||(this.fadeOutTimer=p.setTimeout(function(){this.disc.material=this.materials.free,this.boardState!==S&&(this.boardState=P,this.animateBoard())}.bind(this),l.mattertags.animation.animOutDelay)),p.cancel(this.fadeInTimer),this.fadeInTimer=void 0)},D.prototype.startAudio=function(){var t=this;function e(t,e,i){return t*(1-i)+i*e}function i(i,n){n<=.5?(i.firstElementChild.firstElementChild.style.webkitTransform="rotate("+e(-135,45,n)+"deg)",i.lastElementChild.firstElementChild.style.webkitTransform="rotate(-135deg)"):(i.firstElementChild.firstElementChild.style.webkitTransform="rotate(45deg)",i.lastElementChild.firstElementChild.style.webkitTransform="rotate("+e(-135,45,n)+"deg)"),G.R.longplaying?(t.billboard.style.display="block",t.billboard.style.visibility="visible"):t.billboard.style.display="none"}O.loop=this.audioControl.loop,O.src=this.audiourl,O.currentTime=0,O.play(),this.played?(O.oncanplay=function(){},t.intvl=setInterval((function(){var e=O.currentTime/O.duration;i(t.billboard,e)}),1e3)):(this.played=!0,O.oncanplay=function(){t.intvl=setInterval((function(){var e=O.currentTime/O.duration;i(t.billboard,e)}),1e3)}),O.onended=function(){O.oncanplay=function(){},t.intvl&&(clearInterval(t.intvl),t.intvl=null,t.billboard.style.display="none")}},D.prototype.stopAudio=function(){O.ended||(O.oncanplay=function(){},this.intvl&&(clearInterval(this.intvl),this.intvl=null),O.pause(),this.audioPauseTime=O.currentTime,this.billboard.style.display="none")},D.prototype.setHoverState=function(t,i){var o=this;this.model,this.model.language;if(this.boardState!==C)if(e("#tag-detail").hasClass("open")||(e("#drawer").hasClass("open")?this.highlightStatus=!0:this.highlightStatus=!1),this.type===y.ImageText||this.type===y.ImageTextAudio||this.type===y.IKEA||this.type===y.Video){if(this.audioenable&&this.audiourl&&(O.volume=.7,O.loop=this.imgaudioControl.loop,O.src=this.audiourl,O.currentTime=0,O.play()),this.type===y.Video?(R.src=this.videourl,R.oncanplay=function(){e("#video-tag").css("display","block"),e(".topimg").css("height","0px")}):(s.isMobile()?e(".topimg").css("height","240px"):e(".topimg").css("height","350px"),e("#video-tag").css("display","none")),e.isArray(this.data.details.imageurl))!function(t){e(".topimg").hide(),e("#slidePictures").show();for(var i=0;i<t.length;i++){var n=r.getSize(t[i]);if(n.width&&n.height){var o=n.width/n.height;if(o>1.5)var a='<div class="swiper-slide moreImages"><img class="imageCon longimgCon" src='+t[i]+' alt=""></div>';else if(o<.8)a='<div class="swiper-slide moreImages"><img class="imageCon highimgCon" src='+t[i]+' alt=""></div>';else a='<div class="swiper-slide moreImages"><img class="imageCon commimgCon" src='+t[i]+' alt=""></div>'}e("#wrapperPic").append(a)}new x("#slidePictures",{speed:500,loop:!0,setWrapperSize:!0,observer:!0,observeParents:!0}),e(".imageCon").on("click",(function(t){t.stopPropagation(),t.cancelBubble=!0;var i=e(this).attr("src"),n=r.getWinSize(i);e(".originpic").css("background-image","url("+i+")"),e(".picsize").css({width:n.width,height:n.height}),e(".picsize").attr("data-with",n.width),e(".picsize").attr("data-height",n.height),e("#picsizeScroll").css({left:"50%",top:"50%",transform:"translate(-50%, -50%)"}),e(".originpic-container").fadeIn(300)})),e(".btn-prev3, .btn-next3").delay(750).fadeIn(500).fadeOut(500).fadeIn(500).fadeOut(500)}(this.data.details.imageurl);else{e("#slidePictures").hide(),e(".topimg").show();var a=r.getSize(this.data.details.imageurl);if(a.width&&a.height){var u=a.width/a.height;u>1.5?e(".imageCon").removeClass("highimgCon commimgCon").addClass("longimgCon"):u<.8?e(".imageCon").removeClass("longimgCon commimgCon").addClass("highimgCon"):e(".imageCon").removeClass("longimgCon highimgCon").addClass("commimgCon")}e(".topimg .imageCon").attr("src",this.data.details.imageurl),e(".originpic").css("background-image","url("+this.data.details.imageurl+")");var h=r.getWinSize(this.data.details.imageurl);e(".picsize").css({width:h.width,height:h.height}),e(".topimg").on("click",(function(){e(".originpic-container").fadeIn(300)})),e(".originpic-container").on("click",(function(){e(".originpic-container").fadeOut(300)}))}var c,d=this.data.details.isNew?'<span style="color: red">新 </span>':"",f=this.data.details.price?'<br/><span style="font-size: 200%;color:black;">¥ '+this.data.details.price+"</span>":"";c=s.isMobile()?"ikea":"ikeapc",this.type===y.IKEA?(e(".topimg").addClass(c),e(".middletitle").html(this.data.details.name1?d+this.data.details.name1:""),e(".middlecontent").html(this.data.details.name2?this.data.details.name2+f:""+f)):(e(".topimg").removeClass(c),e(".middletitle").html(this.label?d+this.label:""),e(".middlecontent").html(this.data.details.description?this.data.details.description:"")),void 0!==this.tagInfoUrl&&""!==this.tagInfoUrl?(e(".bottomlink").css("display","block"),n=this.tagInfoUrl,e(".bl-text").on("click",(function(t){window.open(n)}))):e(".bottomlink").css("display","none"),s.isMobile()&&(e(window).width()<=375||e(window).height()<=418)?e(".middletext").css({height:"88px","margin-bottom":"30px","overflow-y":"auto"}):e(".middletext").css({height:"110px","margin-bottom":"34px","overflow-y":"auto"}),this.label||this.data.details.description||this.tagInfoUrl||e(".middletext").css({height:"0px","margin-bottom":"0","overflow-y":"hidden"}),e(".pctagcontainer").fadeIn(300),e(".middletext").scrollTop(0)}else if(this.type===y.Audio){o=this;O.addEventListener("ended",(function(){"loop"!==O.loop&&(o.setFreeState(!0,!0),O.currentTime=0)})),0==i?(1===!this.subtype&&(this.disc.material=this.materials.hover),this.startAudio()):1==i&&(1===!this.subtype&&(this.disc.material=this.materials.hover),O.loop=this.audioControl.loop,O.src=this.audiourl,O.currentTime=O.ended?0:this.audioPauseTime,O.play())}else if(8===this.type)this.hoveringBillboard||this.billboard.classList.add("has-hotzone"),this.fadeInTimer&&t&&this.setActiveState(),p.cancel(this.fadeOutTimer),this.fadeOutTimer=void 0;else if(this.type===y.OtherModel)0===i&&this.tagInfoUrl&&window.open(this.tagInfoUrl);else if(this.type===y.Video){window.document.getElementById("audio-bar").pause(),e(".pwVideo").fadeIn(300,(function(){document.getElementById("iframe-video").clientHeight;s.isMobile()?e(".video-play").hide():e(".video-play").fadeIn(200)})).css("display","flex"),e(".help_back").fadeIn(500)}else(this.type===y.TextOnly||this.type===y.TextAudio)&&this.audioenable&&this.audiourl&&0===i&&(O.volume=.7,I.loop="",I.src=this.audiourl,I.currentTime=0,I.play()),e(".tag-body").scrollTop(0),this.hoveringBillboard||this.billboard.classList.add("has-hotzone"),this.fadeInTimer?t&&this.setActiveState():this.type===y.TextOnly&&(this.fadeInTimer=p.setTimeout(function(){1===!this.subtype&&(this.disc.material=this.materials.hover),this.boardState!==A&&(this.boardState=_,this.animateBoard(function(){t&&this.setActiveState()}.bind(this)))}.bind(this),l.mattertags.animation.animInDelay)),p.cancel(this.fadeOutTimer),this.fadeOutTimer=void 0},D.prototype.setClosedState=function(){this.disc.material=this.materials.free,this.emit("tag.closed"),this.boardState=S,this.billboard.style.visibility="hidden",this.billboard.classList.contains("has-hotzone")||this.billboard.classList.add("has-hotzone"),this.type===y.Video&&(e("#video-tag")[0].pause(),e("#video-tag")[0].currentTime=0),this.type===y.ImageTextAudio&&O.pause()},D.prototype.setActiveState=function(){this.type!==y.OtherModel&&this.type!==y.IFrame&&this.type!==y.Audio&&(this.boardState=C,this.billboard.classList.remove("has-hotzone"))},D.prototype.hide=function(t,i){this.disc.visible=!1;var n=e.Deferred();if(0===this.materials.free.opacity&&!p.isRunning(this.visibleTransition))return n.resolve().promise();t=t||0,i=i||0,p.cancel(this.visibleTransition),this.type===y.Audio&&(this.billboard.style.display="none");var r=this.materials.free.opacity/l.mattertags.disc.opacity,o=i+t,a=i/o;return this.visibleTransition=p.start(function(t){f.property(this.materials.free,"opacity",0)(t),f.property(this.materials.hover,"opacity",0)(t),f.property(this.materials.pole,"opacity",0)(t)}.bind(this),o*r,(function(){n.resolve()}),a,m[l.warp.blendEasing]),n.promise()},D.prototype.show=function(t,i){this.disc.visible=!0;var n=e.Deferred();if(this.materials.free.opacity===l.mattertags.disc.opacity&&!p.isRunning(this.visibleTransition))return n.resolve().promise();t=t||0,i=i||0,p.cancel(this.visibleTransition);var r=(l.mattertags.disc.opacity-this.materials.free.opacity)/l.mattertags.disc.opacity,o=i+t,a=i/o;return this.type===y.Audio&&this.intvl&&(this.billboard.style.display="block",this.billboard.style.visibility="visible"),this.visibleTransition=p.start(function(t){f.property(this.materials.free,"opacity",l.mattertags.disc.opacity)(t),f.property(this.materials.hover,"opacity",l.mattertags.disc.opacity)(t),f.property(this.materials.pole,"opacity",l.mattertags.pole.opacity)(t)}.bind(this),o*r,(function(){n.resolve()}),a,m[l.warp.blendEasing]),n.promise()},D.prototype.closestPanoTowardTag=function(t,e){var i=[],n=[],r=this.disc.getWorldPosition(new o.Vector3);if(t===u.PANORAMA){var a=e.position.clone().sub(r).normalize();i.push(d.filters.isPanoAligned()),i.push(d.filters.inPanoDirection(r,a,.5)),i.push(d.filters.isNeighbourPanoTo(e)),n.push(d.scoreFunctions.direction(r,a))}var s=new o.Vector3;i.push((function(t){return Math.abs(t.position.x-r.x)>l.mattertags.visibility.cameraClearance||Math.abs(t.position.z-r.z)>l.mattertags.visibility.cameraClearance}),(function(t){s.copy(r).sub(t.position);var e=-o.Math.radToDeg(Math.atan(s.y/Math.sqrt(s.x*s.x+s.z*s.z))),i=l.mattertags.navigate.tiltTolerance;return l.insideLookLimitDown-i<e&&e<l.insideLookLimitUp+i})),n.push(d.scoreFunctions.distanceSquared(this,-2));var h=this.model.panos.sortByScore(i,n);if(l.mattertags.navigate.lineOfSight){for(var c=0;c<h.length;c++){var p=h[c].pano,f=p.position.distanceTo(r);if(!l.mattertags.visibility.anyDistance&&f>l.mattertags.visibility.visibleDistance)return null;D.raycaster.set(p.position,r.clone().sub(p.position).normalize());var m=D.raycaster.intersectObjects(this.model.colliders);if(0===m.length||m[0].distance>f)return p}return null}return h.length>0?h[0].pano:null},D.prototype.examineMattertag=function(t,e){var i,n,r,a=t.mode;if(l.mattertags.navigate.nearestPano&&1!==this.subtype&&(i=this.closestPanoTowardTag(a,t.currentPano)),i||(i=t.currentPano),n="disc"===l.mattertags.navigate.aimAt?this.disc.getWorldPosition(new o.Vector3):"object"===l.mattertags.navigate.aimAt?this.obj3d.getWorldPosition(new o.Vector3):"nothing"===l.mattertags.navigate.aimAt?null:this.obj3d.getWorldPosition(new o.Vector3).add(this.discPosition.clone().multiplyScalar(.5)),r=l.mattertags.navigate.reactivate?function(){e(this),this.setActiveState()}.bind(this):null,a===u.PANORAMA)t.flyToPano({pano:i,lookAtPoint:n,duration:null,maxDistanceOverride:null,skipWarpingCheck:!1},r);else{var s={pano:i};if(n){var h=(new o.Matrix4).lookAt(i.position,n,new o.Vector3(0,1,0));s.quaternion=(new o.Quaternion).setFromRotationMatrix(h)}l.mattertags.navigate.reactivate&&(s.callback=r),s.duration=1500,s.mode=u.PANORAMA,t.flyToNewMode(s)}},D.prototype.update=function(t,e,i,n,r){var o=this.model;if(this.type!==y.Title){if(this.i>=1e4&&this.disc&&this.disc.position&&e&&e.position){var a=this.basepos.distanceTo(e.position);if(G&&G.P){var s=Math.max(a*G.P.a-G.P.b,G.P.c);this.disc.position.y=this.discpos2.y-s}}this.type===y.BuildingType?t===u.DOLLHOUSE?this.enabled=!0:(this.enabled=!1,this.obj3d.visible=!1,this.hideDisc(t,e,i,n)):this.type===y.RegionalJump?t===u.PANORAMA?this.enabled=!0:(this.enabled=!1,this.obj3d.visible=!1,this.hideDisc(t,e,i,n)):this.type===y.Tag360T1||1===this.subtype?t!==u.PANORAMA?(this.enabled=!1,this.obj3d.visible=!1,this.hideDisc(t,e,i,n)):i&&(this.obj3d.position.copy(i.position.clone().add(this.position)),!this.i>=1e4&&this.disc.position.copy(this.discPosition),this.locationId==r?this.enabled=!0:(this.enabled=!1,this.obj3d.visible=!1,this.hideDisc(t,e,i,n))):(G.settings.nesttags.setting.show_in_3d||(t!==u.PANORAMA?this.materials.free.opacity=0:this.materials.free.opacity=l.mattertags.disc.opacity),l.mattertags.enablePanoSize&&(this.enabled=!0)),l.mattertags.enablePanoSize||(this.materials.free.opacity=0,this.enabled=!1),this.enabled&&(this.updateDisc(t,e,i,n,o),this.boardState===S&&this.type!==y.Audio||this.updateBillboard(e))}},D.prototype.updateDisc=function(t,e,i,n,r){if(G.conf.isNewEditVersion&&("-1"==this.tagid||"-2"==this.tagid))if(this.rt360){var a=this.player.getMouseDirection(),s=Math.sqrt(4/(a.x*a.x+a.y*a.y+a.z*a.z));a.multiplyScalar(s),this.obj3d.position.copy(i.position.clone().add(a)),this.disc.position.copy(this.discPosition)}else{var h=this.player.intersect;if(null!=h){(s={}).point=h.point.clone(),s.normal=h.normal.clone();var c=s.normal.clone().multiplyScalar(.1);this.obj3d.position.copy(s.point),this.disc.position.copy(c),null!=this.ar&&(this.ar[3]=c.x,this.ar[4]=c.y,this.ar[5]=c.z,this.geom.addAttribute("position",new o.BufferAttribute(this.ar,3)))}}var d,p=G.settings.nesttags.setting,f=l.mattertags.visibility,m=l.mattertags.disc.scale,g=this.disc.getWorldPosition(new o.Vector3);if(t===u.PANORAMA?(d=e.position.distanceTo(g),this.type!==y.RegionalJump&&(1!=this.subtype&&this.type!=y.Tag360T1&&this.type!==y.Title?p.autohide&&(d>p.autohide_length?this.materials.free.opacity=0:this.materials.free.opacity=l.mattertags.disc.opacity):this.type===y.Title||(this.materials.free.opacity=l.mattertags.disc.opacity))):d=f.visibleDistance,this.obj3d.visible=0!==this.disc.material.opacity&&(f.anyDistance||d<=f.visibleDistance||t===u.TRANSITIONING)&&(!f.hideViaFloor||this.tagVisibleOnCurrentFloor(t))&&(!f.hideOffScreenDisc||!this.offScreen(this.disc,e))&&(!f.hideOffScreenObject||!this.offScreen(this.obj3d,e)),this.obj3d.visible){this.disc.quaternion.copy(e.quaternion);var v=m.maxSize-(m.maxSize-m.minSize)*o.Math.smoothstep(d,m.nearBound,m.farBound),b=g.clone().project(e),w=new o.Vector3((window.renderWidth || window.innerWidth)/2,(window.renderHeight || window.innerHeight)/2,1).multiply(b),x=new o.Vector3(v/2,0,0).add(w),M=(s=new o.Vector3(2/(window.renderWidth || window.innerWidth),2/(window.renderHeight || window.innerHeight),1).multiply(x)).clone().unproject(e).clone().distanceTo(g),T=1+m.responsiveness/100*(D.viewportScale(this.type)-1);this.discScale=M*T,this.disc.scale.set(this.discScale,this.discScale,this.discScale),this.type===y.RegionalJump&&this.obj3d.visible}},D.prototype.hideDisc=function(t,e,i,n){this.obj3d.visible=!1,this.billboard.style.display="none"},D.prototype.tagVisibleOnCurrentFloor=function(t){if(this.clock&&this.gifObject){var e=this.clock.getDelta();this.gifObject.update(1e3*e)}return t!==u.DOLLHOUSE&&t!==u.FLOORPLAN||this.model.allFloorsVisible||!this.floor.hidden},D.prototype.offScreen=function(t,e){var i=t.getWorldPosition(new o.Vector3).project(e);return!(-1<i.x&&i.x<1&&-1<i.y&&i.y<1)},D.viewportScale=function(t){return D.viewportWidth===(window.renderWidth || window.innerWidth)&&D.viewportHeight===(window.renderHeight || window.innerHeight)||(D.viewportWidth=(window.renderWidth || window.innerWidth),D.viewportHeight=(window.renderHeight || window.innerHeight)),t===y.BuildingType?(D.currentViewportScaleBuilding=Math.sqrt(Math.min(D.viewportWidth,D.viewportHeight)/l.mattertags.disc.scale.buildingViewportSize),D.currentViewportScaleBuilding):(D.currentViewportScaleCommon=Math.sqrt(Math.min(D.viewportWidth,D.viewportHeight)/l.mattertags.disc.scale.baseViewportSize),D.currentViewportScaleCommon)},D.prototype.newBillboardOrientation=function(t){if(this.boardOrientation&&this.boardState!==_)return this.boardOrientation;var e=1/3,i=t.y<-e?0:t.y<e?1:2,n=t.x<-e?0:t.x<e?1:2,r="";return r+=0===n?"right":2===n?"left":"",r+=0===i?"-down":2===i?"-up":"",1===n&&(r=0===i?"bottom":2===i?"top":"",1===i&&(r=(window.renderWidth || window.innerWidth)>(window.renderHeight || window.innerHeight)?t.x<0?"right":"left":t.y<0?"bottom":"top")),r},D.prototype.regionalJumpOrientation=function(t){var e=this.disc.getWorldPosition(new o.Vector3).clone().project(t);return e.x<-.5?"Left":e.x<.5?"Center":"Right"},D.prototype.updateBillboard=function(t){var e=this.disc.getWorldPosition(new o.Vector3),i=e.clone().project(t);if(i.y*=-1,this.type!==y.Audio){var n=this.newBillboardOrientation(i);if(n!==this.boardOrientation){this.billboard.style.transform=this.billboard.style.webkitTransform="",this.billboard.classList.remove("tag-container-"+this.boardOrientation),this.billboard.classList.add("tag-container-"+n);var r=window.getComputedStyle(this.billboard);this.billboard.initialTransform=r.transform||r.webkitTransform,"none"===this.billboard.initialTransform&&(this.billboard.initialTransform="");var a=window.getComputedStyle(this.billboard).transform.slice(7,-1).split(","),s=-a[4],u=-a[5];this.billboard.style.webkitTransformOrigin=s+"px "+u+"px",this.billboard.style.transformOrigin=s+"px "+u+"px",this.boardOrientation=n}}var h=new o.Vector3(-this.discScale/2,0,0).applyQuaternion(t.quaternion).add(e).project(t),c=Math.abs(i.x-h.x)*(window.renderWidth || window.innerWidth),d=Math.sqrt(c/40)*l.mattertags.boardScale.boardToDiscRatio,p=(i.x+1)*(window.renderWidth || window.innerWidth)/2,f=(i.y+1)*(window.renderHeight || window.innerHeight)/2;this.type===y.IFrame||this.type===y.ImageTextAudio?(this.billboard.screenTransform=this.billboard.initialTransform+" translate("+p+"px, "+f+"px) scale(0)",this.billboard.style.visibility="hidden"):this.type===y.Audio?(this.billboard.screenTransform=" translate("+p+"px, "+f+"px) scale("+1*d+")",this.billboard.style.webkitTransform=this.billboard.screenTransform,this.billboard.style.transform=this.billboard.screenTransform):(this.billboard.screenTransform=this.billboard.initialTransform+" translate("+p+"px, "+f+"px) scale("+d*this.animationScale+")",this.billboard.style.webkitTransform=this.billboard.screenTransform,this.billboard.style.transform=this.billboard.screenTransform)},D.prototype.animateBoard=function(t,i){this.boardState===_?(e(".tag-container").show(),p.cancel(this.boardTransition),s.detectSamsungNative()?(this.boardOrientation=null,this.billboard.style.visibility="visible",this.emit("tag.opened"),this.boardState=A,t&&t()):(this.billboard.style.webkitTransform="scale(0)",this.billboard.style.transform="scale(0)",this.billboard.style.visibility="visible",this.boardTransition=p.start(f.property(this,"animationScale",1),l.mattertags.animation.animInTime,function(){this.emit("tag.opened"),this.boardState=A,t&&t()}.bind(this)))):this.boardState===P&&(p.cancel(this.boardTransition),this.boardTransition=p.start(f.property(this,"animationScale",0),l.mattertags.animation.animOutTime,function(){this.emit("tag.closed"),this.boardState=S,this.billboard.style.visibility="hidden",this.billboard.classList.contains("has-hotzone")||this.billboard.classList.add("has-hotzone"),i&&i()}.bind(this)))},t.exports=D}).call(this,i(6))},function(t,e){t.exports={getSize:function(t){var e=0,i=0;if(null!=t){var n=t.substring(t.lastIndexOf("_")+1,t.lastIndexOf("."));if(null!=n){var r=n.split("x");null!=r&&r.length>1&&(e=parseInt(r[0],0),i=parseInt(r[1],0))}}return{width:e,height:i}},getWinSize:function(t){var e=this.getSize(t);if(!e.width||!e.height||e.width<=(window.renderWidth || window.innerWidth)&&e.height<=(window.renderHeight || window.innerHeight))return e;var i=e.width/e.height;return i>=(window.renderWidth || window.innerWidth)/(window.renderHeight || window.innerHeight)?(e.width=(window.renderWidth || window.innerWidth),e.height=e.width/i):(e.height=(window.renderHeight || window.innerHeight),e.width=e.height*i),e}}},function(t,e){t.exports={NAVIGATION:"navigation",MODEL:"model",EXT_LINK:"ext-link"}},function(t,e,i){(function(e){(function(){"use strict";var i,n,r,o=function(t,n){if(!(this instanceof o))return new o(t,n);var r={direction:"horizontal",touchEventsTarget:"container",initialSlide:0,speed:300,autoplay:!1,autoplayDisableOnInteraction:!0,autoplayStopOnLast:!1,iOSEdgeSwipeDetection:!1,iOSEdgeSwipeThreshold:20,freeMode:!1,freeModeMomentum:!0,freeModeMomentumRatio:1,freeModeMomentumBounce:!0,freeModeMomentumBounceRatio:1,freeModeMomentumVelocityRatio:1,freeModeSticky:!1,freeModeMinimumVelocity:.02,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",coverflow:{rotate:50,stretch:0,depth:100,modifier:1,slideShadows:!0},flip:{slideShadows:!0,limitRotation:!0},cube:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94},fade:{crossFade:!1},parallax:!1,zoom:!1,zoomMax:3,zoomMin:1,zoomToggle:!0,scrollbar:null,scrollbarHide:!0,scrollbarDraggable:!1,scrollbarSnapOnRelease:!1,keyboardControl:!1,mousewheelControl:!1,mousewheelReleaseOnEdges:!1,mousewheelInvert:!1,mousewheelForceToAxis:!1,mousewheelSensitivity:1,mousewheelEventsTarged:"container",hashnav:!1,hashnavWatchState:!1,history:!1,replaceState:!1,breakpoints:void 0,spaceBetween:0,slidesPerView:1,slidesPerColumn:1,slidesPerColumnFill:"column",slidesPerGroup:1,centeredSlides:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,onlyExternal:!1,threshold:0,touchMoveStopPropagation:!0,touchReleaseOnEdges:!1,uniqueNavElements:!0,pagination:null,paginationElement:"span",paginationClickable:!1,paginationHide:!1,paginationBulletRender:null,paginationProgressRender:null,paginationFractionRender:null,paginationCustomRender:null,paginationType:"bullets",resistance:!0,resistanceRatio:.85,nextButton:null,prevButton:null,watchSlidesProgress:!1,watchSlidesVisibility:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,lazyLoading:!1,lazyLoadingInPrevNext:!1,lazyLoadingInPrevNextAmount:1,lazyLoadingOnTransitionStart:!1,preloadImages:!0,updateOnImagesReady:!0,loop:!1,loopAdditionalSlides:0,loopedSlides:null,control:void 0,controlInverse:!1,controlBy:"slide",normalizeSlideIndex:!0,allowSwipeToPrev:!0,allowSwipeToNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",passiveListeners:!0,containerModifierClass:"swiper-container-",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideDuplicateActiveClass:"swiper-slide-duplicate-active",slideVisibleClass:"swiper-slide-visible",slideDuplicateClass:"swiper-slide-duplicate",slideNextClass:"swiper-slide-next",slideDuplicateNextClass:"swiper-slide-duplicate-next",slidePrevClass:"swiper-slide-prev",slideDuplicatePrevClass:"swiper-slide-duplicate-prev",wrapperClass:"swiper-wrapper",bulletClass:"swiper-pagination-bullet",bulletActiveClass:"swiper-pagination-bullet-active",buttonDisabledClass:"swiper-button-disabled",paginationCurrentClass:"swiper-pagination-current",paginationTotalClass:"swiper-pagination-total",paginationHiddenClass:"swiper-pagination-hidden",paginationProgressbarClass:"swiper-pagination-progressbar",paginationClickableClass:"swiper-pagination-clickable",paginationModifierClass:"swiper-pagination-",lazyLoadingClass:"swiper-lazy",lazyStatusLoadingClass:"swiper-lazy-loading",lazyStatusLoadedClass:"swiper-lazy-loaded",lazyPreloaderClass:"swiper-lazy-preloader",notificationClass:"swiper-notification",preloaderClass:"preloader",zoomContainerClass:"swiper-zoom-container",observer:!1,observeParents:!1,a11y:!1,prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}",runCallbacksOnInit:!0},a=n&&n.virtualTranslate;n=n||{};var l={};for(var u in n)if("object"!=typeof n[u]||null===n[u]||(n[u].nodeType||n[u]===window||n[u]===document||void 0!==s&&n[u]instanceof s||void 0!==e&&n[u]instanceof e))l[u]=n[u];else for(var h in l[u]={},n[u])l[u][h]=n[u][h];for(var c in r)if(void 0===n[c])n[c]=r[c];else if("object"==typeof n[c])for(var d in r[c])void 0===n[c][d]&&(n[c][d]=r[c][d]);var p=this;if(p.params=n,p.originalParams=l,p.classNames=[],void 0!==i&&void 0!==s&&(i=s),(void 0!==i||(i=void 0===s?window.Dom7||window.Zepto||window.jQuery:s))&&(p.$=i,p.currentBreakpoint=void 0,p.getActiveBreakpoint=function(){if(!p.params.breakpoints)return!1;var t,e=!1,i=[];for(t in p.params.breakpoints)p.params.breakpoints.hasOwnProperty(t)&&i.push(t);i.sort((function(t,e){return parseInt(t,10)>parseInt(e,10)}));for(var n=0;n<i.length;n++)(t=i[n])>=(window.renderWidth || window.innerWidth)&&!e&&(e=t);return e||"max"},p.setBreakpoint=function(){var t=p.getActiveBreakpoint();if(t&&p.currentBreakpoint!==t){var e=t in p.params.breakpoints?p.params.breakpoints[t]:p.originalParams,i=p.params.loop&&e.slidesPerView!==p.params.slidesPerView;for(var n in e)p.params[n]=e[n];p.currentBreakpoint=t,i&&p.destroyLoop&&p.reLoop(!0)}},p.params.breakpoints&&p.setBreakpoint(),p.container=i(t),0!==p.container.length)){if(p.container.length>1){var f=[];return p.container.each((function(){f.push(new o(this,n))})),f}p.container[0].swiper=p,p.container.data("swiper",p),p.classNames.push(p.params.containerModifierClass+p.params.direction),p.params.freeMode&&p.classNames.push(p.params.containerModifierClass+"free-mode"),p.support.flexbox||(p.classNames.push(p.params.containerModifierClass+"no-flexbox"),p.params.slidesPerColumn=1),p.params.autoHeight&&p.classNames.push(p.params.containerModifierClass+"autoheight"),(p.params.parallax||p.params.watchSlidesVisibility)&&(p.params.watchSlidesProgress=!0),p.params.touchReleaseOnEdges&&(p.params.resistanceRatio=0),["cube","coverflow","flip"].indexOf(p.params.effect)>=0&&(p.support.transforms3d?(p.params.watchSlidesProgress=!0,p.classNames.push(p.params.containerModifierClass+"3d")):p.params.effect="slide"),"slide"!==p.params.effect&&p.classNames.push(p.params.containerModifierClass+p.params.effect),"cube"===p.params.effect&&(p.params.resistanceRatio=0,p.params.slidesPerView=1,p.params.slidesPerColumn=1,p.params.slidesPerGroup=1,p.params.centeredSlides=!1,p.params.spaceBetween=0,p.params.virtualTranslate=!0),"fade"!==p.params.effect&&"flip"!==p.params.effect||(p.params.slidesPerView=1,p.params.slidesPerColumn=1,p.params.slidesPerGroup=1,p.params.watchSlidesProgress=!0,p.params.spaceBetween=0,void 0===a&&(p.params.virtualTranslate=!0)),p.params.grabCursor&&p.support.touch&&(p.params.grabCursor=!1),p.wrapper=p.container.children("."+p.params.wrapperClass),p.params.pagination&&(p.paginationContainer=i(p.params.pagination),p.params.uniqueNavElements&&"string"==typeof p.params.pagination&&p.paginationContainer.length>1&&1===p.container.find(p.params.pagination).length&&(p.paginationContainer=p.container.find(p.params.pagination)),"bullets"===p.params.paginationType&&p.params.paginationClickable?p.paginationContainer.addClass(p.params.paginationModifierClass+"clickable"):p.params.paginationClickable=!1,p.paginationContainer.addClass(p.params.paginationModifierClass+p.params.paginationType)),(p.params.nextButton||p.params.prevButton)&&(p.params.nextButton&&(p.nextButton=i(p.params.nextButton),p.params.uniqueNavElements&&"string"==typeof p.params.nextButton&&p.nextButton.length>1&&1===p.container.find(p.params.nextButton).length&&(p.nextButton=p.container.find(p.params.nextButton))),p.params.prevButton&&(p.prevButton=i(p.params.prevButton),p.params.uniqueNavElements&&"string"==typeof p.params.prevButton&&p.prevButton.length>1&&1===p.container.find(p.params.prevButton).length&&(p.prevButton=p.container.find(p.params.prevButton)))),p.isHorizontal=function(){return"horizontal"===p.params.direction},p.rtl=p.isHorizontal()&&("rtl"===p.container[0].dir.toLowerCase()||"rtl"===p.container.css("direction")),p.rtl&&p.classNames.push(p.params.containerModifierClass+"rtl"),p.rtl&&(p.wrongRTL="-webkit-box"===p.wrapper.css("display")),p.params.slidesPerColumn>1&&p.classNames.push(p.params.containerModifierClass+"multirow"),p.device.android&&p.classNames.push(p.params.containerModifierClass+"android"),p.container.addClass(p.classNames.join(" ")),p.translate=0,p.progress=0,p.velocity=0,p.lockSwipeToNext=function(){p.params.allowSwipeToNext=!1,!1===p.params.allowSwipeToPrev&&p.params.grabCursor&&p.unsetGrabCursor()},p.lockSwipeToPrev=function(){p.params.allowSwipeToPrev=!1,!1===p.params.allowSwipeToNext&&p.params.grabCursor&&p.unsetGrabCursor()},p.lockSwipes=function(){p.params.allowSwipeToNext=p.params.allowSwipeToPrev=!1,p.params.grabCursor&&p.unsetGrabCursor()},p.unlockSwipeToNext=function(){p.params.allowSwipeToNext=!0,!0===p.params.allowSwipeToPrev&&p.params.grabCursor&&p.setGrabCursor()},p.unlockSwipeToPrev=function(){p.params.allowSwipeToPrev=!0,!0===p.params.allowSwipeToNext&&p.params.grabCursor&&p.setGrabCursor()},p.unlockSwipes=function(){p.params.allowSwipeToNext=p.params.allowSwipeToPrev=!0,p.params.grabCursor&&p.setGrabCursor()},p.setGrabCursor=function(t){p.container[0].style.cursor="move",p.container[0].style.cursor=t?"-webkit-grabbing":"-webkit-grab",p.container[0].style.cursor=t?"-moz-grabbin":"-moz-grab",p.container[0].style.cursor=t?"grabbing":"grab"},p.unsetGrabCursor=function(){p.container[0].style.cursor=""},p.params.grabCursor&&p.setGrabCursor(),p.imagesToLoad=[],p.imagesLoaded=0,p.loadImage=function(t,e,i,n,r,o){var a;function s(){o&&o()}t.complete&&r?s():e?((a=new window.Image).onload=s,a.onerror=s,n&&(a.sizes=n),i&&(a.srcset=i),e&&(a.src=e)):s()},p.preloadImages=function(){function t(){null!=p&&p&&(void 0!==p.imagesLoaded&&p.imagesLoaded++,p.imagesLoaded===p.imagesToLoad.length&&(p.params.updateOnImagesReady&&p.update(),p.emit("onImagesReady",p)))}p.imagesToLoad=p.container.find("img");for(var e=0;e<p.imagesToLoad.length;e++)p.loadImage(p.imagesToLoad[e],p.imagesToLoad[e].currentSrc||p.imagesToLoad[e].getAttribute("src"),p.imagesToLoad[e].srcset||p.imagesToLoad[e].getAttribute("srcset"),p.imagesToLoad[e].sizes||p.imagesToLoad[e].getAttribute("sizes"),!0,t)},p.autoplayTimeoutId=void 0,p.autoplaying=!1,p.autoplayPaused=!1,p.startAutoplay=function(){return void 0===p.autoplayTimeoutId&&(!!p.params.autoplay&&(!p.autoplaying&&(p.autoplaying=!0,p.emit("onAutoplayStart",p),void I())))},p.stopAutoplay=function(t){p.autoplayTimeoutId&&(p.autoplayTimeoutId&&clearTimeout(p.autoplayTimeoutId),p.autoplaying=!1,p.autoplayTimeoutId=void 0,p.emit("onAutoplayStop",p))},p.pauseAutoplay=function(t){p.autoplayPaused||(p.autoplayTimeoutId&&clearTimeout(p.autoplayTimeoutId),p.autoplayPaused=!0,0===t?(p.autoplayPaused=!1,I()):p.wrapper.transitionEnd((function(){p&&(p.autoplayPaused=!1,p.autoplaying?I():p.stopAutoplay())})))},p.minTranslate=function(){return-p.snapGrid[0]},p.maxTranslate=function(){return-p.snapGrid[p.snapGrid.length-1]},p.updateAutoHeight=function(){var t,e=[],i=0;if("auto"!==p.params.slidesPerView&&p.params.slidesPerView>1)for(t=0;t<Math.ceil(p.params.slidesPerView);t++){var n=p.activeIndex+t;if(n>p.slides.length)break;e.push(p.slides.eq(n)[0])}else e.push(p.slides.eq(p.activeIndex)[0]);for(t=0;t<e.length;t++)if(void 0!==e[t]){var r=e[t].offsetHeight;i=r>i?r:i}i&&p.wrapper.css("height",i+"px")},p.updateContainerSize=function(){var t,e;t=void 0!==p.params.width?p.params.width:p.container[0].clientWidth,e=void 0!==p.params.height?p.params.height:p.container[0].clientHeight,0===t&&p.isHorizontal()||0===e&&!p.isHorizontal()||(t=t-parseInt(p.container.css("padding-left"),10)-parseInt(p.container.css("padding-right"),10),e=e-parseInt(p.container.css("padding-top"),10)-parseInt(p.container.css("padding-bottom"),10),p.width=t,p.height=e,p.size=p.isHorizontal()?p.width:p.height)},p.updateSlidesSize=function(){p.slides=p.wrapper.children("."+p.params.slideClass),p.snapGrid=[],p.slidesGrid=[],p.slidesSizesGrid=[];var t,e=p.params.spaceBetween,i=-p.params.slidesOffsetBefore,n=0,r=0;if(void 0!==p.size){var o,a;"string"==typeof e&&e.indexOf("%")>=0&&(e=parseFloat(e.replace("%",""))/100*p.size),p.virtualSize=-e,p.rtl?p.slides.css({marginLeft:"",marginTop:""}):p.slides.css({marginRight:"",marginBottom:""}),p.params.slidesPerColumn>1&&(o=Math.floor(p.slides.length/p.params.slidesPerColumn)===p.slides.length/p.params.slidesPerColumn?p.slides.length:Math.ceil(p.slides.length/p.params.slidesPerColumn)*p.params.slidesPerColumn,"auto"!==p.params.slidesPerView&&"row"===p.params.slidesPerColumnFill&&(o=Math.max(o,p.params.slidesPerView*p.params.slidesPerColumn)));var s,l=p.params.slidesPerColumn,u=o/l,h=u-(p.params.slidesPerColumn*u-p.slides.length);for(t=0;t<p.slides.length;t++){a=0;var c,d,f,m=p.slides.eq(t);if(p.params.slidesPerColumn>1)"column"===p.params.slidesPerColumnFill?(f=t-(d=Math.floor(t/l))*l,(d>h||d===h&&f===l-1)&&++f>=l&&(f=0,d++),c=d+f*o/l,m.css({"-webkit-box-ordinal-group":c,"-moz-box-ordinal-group":c,"-ms-flex-order":c,"-webkit-order":c,order:c})):d=t-(f=Math.floor(t/u))*u,m.css("margin-"+(p.isHorizontal()?"top":"left"),0!==f&&p.params.spaceBetween&&p.params.spaceBetween+"px").attr("data-swiper-column",d).attr("data-swiper-row",f);"none"!==m.css("display")&&("auto"===p.params.slidesPerView?(a=p.isHorizontal()?m.outerWidth(!0):m.outerHeight(!0),p.params.roundLengths&&(a=O(a))):(a=(p.size-(p.params.slidesPerView-1)*e)/p.params.slidesPerView,p.params.roundLengths&&(a=O(a)),p.isHorizontal()?p.slides[t].style.width=a+"px":p.slides[t].style.height=a+"px"),p.slides[t].swiperSlideSize=a,p.slidesSizesGrid.push(a),p.params.centeredSlides?(i=i+a/2+n/2+e,0===n&&0!==t&&(i=i-p.size/2-e),0===t&&(i=i-p.size/2-e),Math.abs(i)<.001&&(i=0),r%p.params.slidesPerGroup==0&&p.snapGrid.push(i),p.slidesGrid.push(i)):(r%p.params.slidesPerGroup==0&&p.snapGrid.push(i),p.slidesGrid.push(i),i=i+a+e),p.virtualSize+=a+e,n=a,r++)}if(p.virtualSize=Math.max(p.virtualSize,p.size)+p.params.slidesOffsetAfter,p.rtl&&p.wrongRTL&&("slide"===p.params.effect||"coverflow"===p.params.effect)&&p.wrapper.css({width:p.virtualSize+p.params.spaceBetween+"px"}),p.support.flexbox&&!p.params.setWrapperSize||(p.isHorizontal()?p.wrapper.css({width:p.virtualSize+p.params.spaceBetween+"px"}):p.wrapper.css({height:p.virtualSize+p.params.spaceBetween+"px"})),p.params.slidesPerColumn>1&&(p.virtualSize=(a+p.params.spaceBetween)*o,p.virtualSize=Math.ceil(p.virtualSize/p.params.slidesPerColumn)-p.params.spaceBetween,p.isHorizontal()?p.wrapper.css({width:p.virtualSize+p.params.spaceBetween+"px"}):p.wrapper.css({height:p.virtualSize+p.params.spaceBetween+"px"}),p.params.centeredSlides)){for(s=[],t=0;t<p.snapGrid.length;t++)p.snapGrid[t]<p.virtualSize+p.snapGrid[0]&&s.push(p.snapGrid[t]);p.snapGrid=s}if(!p.params.centeredSlides){for(s=[],t=0;t<p.snapGrid.length;t++)p.snapGrid[t]<=p.virtualSize-p.size&&s.push(p.snapGrid[t]);p.snapGrid=s,Math.floor(p.virtualSize-p.size)-Math.floor(p.snapGrid[p.snapGrid.length-1])>1&&p.snapGrid.push(p.virtualSize-p.size)}0===p.snapGrid.length&&(p.snapGrid=[0]),0!==p.params.spaceBetween&&(p.isHorizontal()?p.rtl?p.slides.css({marginLeft:e+"px"}):p.slides.css({marginRight:e+"px"}):p.slides.css({marginBottom:e+"px"})),p.params.watchSlidesProgress&&p.updateSlidesOffset()}},p.updateSlidesOffset=function(){for(var t=0;t<p.slides.length;t++)p.slides[t].swiperSlideOffset=p.isHorizontal()?p.slides[t].offsetLeft:p.slides[t].offsetTop},p.currentSlidesPerView=function(){var t,e,i=1;if(p.params.centeredSlides){var n,r=p.slides[p.activeIndex].swiperSlideSize;for(t=p.activeIndex+1;t<p.slides.length;t++)p.slides[t]&&!n&&(i++,(r+=p.slides[t].swiperSlideSize)>p.size&&(n=!0));for(e=p.activeIndex-1;e>=0;e--)p.slides[e]&&!n&&(i++,(r+=p.slides[e].swiperSlideSize)>p.size&&(n=!0))}else for(t=p.activeIndex+1;t<p.slides.length;t++)p.slidesGrid[t]-p.slidesGrid[p.activeIndex]<p.size&&i++;return i},p.updateSlidesProgress=function(t){if(void 0===t&&(t=p.translate||0),0!==p.slides.length){void 0===p.slides[0].swiperSlideOffset&&p.updateSlidesOffset();var e=-t;p.rtl&&(e=t),p.slides.removeClass(p.params.slideVisibleClass);for(var i=0;i<p.slides.length;i++){var n=p.slides[i],r=(e+(p.params.centeredSlides?p.minTranslate():0)-n.swiperSlideOffset)/(n.swiperSlideSize+p.params.spaceBetween);if(p.params.watchSlidesVisibility){var o=-(e-n.swiperSlideOffset),a=o+p.slidesSizesGrid[i];(o>=0&&o<p.size||a>0&&a<=p.size||o<=0&&a>=p.size)&&p.slides.eq(i).addClass(p.params.slideVisibleClass)}n.progress=p.rtl?-r:r}}},p.updateProgress=function(t){void 0===t&&(t=p.translate||0);var e=p.maxTranslate()-p.minTranslate(),i=p.isBeginning,n=p.isEnd;0===e?(p.progress=0,p.isBeginning=p.isEnd=!0):(p.progress=(t-p.minTranslate())/e,p.isBeginning=p.progress<=0,p.isEnd=p.progress>=1),p.isBeginning&&!i&&p.emit("onReachBeginning",p),p.isEnd&&!n&&p.emit("onReachEnd",p),p.params.watchSlidesProgress&&p.updateSlidesProgress(t),p.emit("onProgress",p,p.progress)},p.updateActiveIndex=function(){var t,e,i,n=p.rtl?p.translate:-p.translate;for(e=0;e<p.slidesGrid.length;e++)void 0!==p.slidesGrid[e+1]?n>=p.slidesGrid[e]&&n<p.slidesGrid[e+1]-(p.slidesGrid[e+1]-p.slidesGrid[e])/2?t=e:n>=p.slidesGrid[e]&&n<p.slidesGrid[e+1]&&(t=e+1):n>=p.slidesGrid[e]&&(t=e);p.params.normalizeSlideIndex&&(t<0||void 0===t)&&(t=0),(i=Math.floor(t/p.params.slidesPerGroup))>=p.snapGrid.length&&(i=p.snapGrid.length-1),t!==p.activeIndex&&(p.snapIndex=i,p.previousIndex=p.activeIndex,p.activeIndex=t,p.updateClasses(),p.updateRealIndex())},p.updateRealIndex=function(){p.realIndex=parseInt(p.slides.eq(p.activeIndex).attr("data-swiper-slide-index")||p.activeIndex,10)},p.updateClasses=function(){p.slides.removeClass(p.params.slideActiveClass+" "+p.params.slideNextClass+" "+p.params.slidePrevClass+" "+p.params.slideDuplicateActiveClass+" "+p.params.slideDuplicateNextClass+" "+p.params.slideDuplicatePrevClass);var t=p.slides.eq(p.activeIndex);t.addClass(p.params.slideActiveClass),n.loop&&(t.hasClass(p.params.slideDuplicateClass)?p.wrapper.children("."+p.params.slideClass+":not(."+p.params.slideDuplicateClass+')[data-swiper-slide-index="'+p.realIndex+'"]').addClass(p.params.slideDuplicateActiveClass):p.wrapper.children("."+p.params.slideClass+"."+p.params.slideDuplicateClass+'[data-swiper-slide-index="'+p.realIndex+'"]').addClass(p.params.slideDuplicateActiveClass));var e=t.next("."+p.params.slideClass).addClass(p.params.slideNextClass);p.params.loop&&0===e.length&&(e=p.slides.eq(0)).addClass(p.params.slideNextClass);var r=t.prev("."+p.params.slideClass).addClass(p.params.slidePrevClass);if(p.params.loop&&0===r.length&&(r=p.slides.eq(-1)).addClass(p.params.slidePrevClass),n.loop&&(e.hasClass(p.params.slideDuplicateClass)?p.wrapper.children("."+p.params.slideClass+":not(."+p.params.slideDuplicateClass+')[data-swiper-slide-index="'+e.attr("data-swiper-slide-index")+'"]').addClass(p.params.slideDuplicateNextClass):p.wrapper.children("."+p.params.slideClass+"."+p.params.slideDuplicateClass+'[data-swiper-slide-index="'+e.attr("data-swiper-slide-index")+'"]').addClass(p.params.slideDuplicateNextClass),r.hasClass(p.params.slideDuplicateClass)?p.wrapper.children("."+p.params.slideClass+":not(."+p.params.slideDuplicateClass+')[data-swiper-slide-index="'+r.attr("data-swiper-slide-index")+'"]').addClass(p.params.slideDuplicatePrevClass):p.wrapper.children("."+p.params.slideClass+"."+p.params.slideDuplicateClass+'[data-swiper-slide-index="'+r.attr("data-swiper-slide-index")+'"]').addClass(p.params.slideDuplicatePrevClass)),p.paginationContainer&&p.paginationContainer.length>0){var o,a=p.params.loop?Math.ceil((p.slides.length-2*p.loopedSlides)/p.params.slidesPerGroup):p.snapGrid.length;if(p.params.loop?((o=Math.ceil((p.activeIndex-p.loopedSlides)/p.params.slidesPerGroup))>p.slides.length-1-2*p.loopedSlides&&(o-=p.slides.length-2*p.loopedSlides),o>a-1&&(o-=a),o<0&&"bullets"!==p.params.paginationType&&(o=a+o)):o=void 0!==p.snapIndex?p.snapIndex:p.activeIndex||0,"bullets"===p.params.paginationType&&p.bullets&&p.bullets.length>0&&(p.bullets.removeClass(p.params.bulletActiveClass),p.paginationContainer.length>1?p.bullets.each((function(){i(this).index()===o&&i(this).addClass(p.params.bulletActiveClass)})):p.bullets.eq(o).addClass(p.params.bulletActiveClass)),"fraction"===p.params.paginationType&&(p.paginationContainer.find("."+p.params.paginationCurrentClass).text(o+1),p.paginationContainer.find("."+p.params.paginationTotalClass).text(a)),"progress"===p.params.paginationType){var s=(o+1)/a,l=s,u=1;p.isHorizontal()||(u=s,l=1),p.paginationContainer.find("."+p.params.paginationProgressbarClass).transform("translate3d(0,0,0) scaleX("+l+") scaleY("+u+")").transition(p.params.speed)}"custom"===p.params.paginationType&&p.params.paginationCustomRender&&(p.paginationContainer.html(p.params.paginationCustomRender(p,o+1,a)),p.emit("onPaginationRendered",p,p.paginationContainer[0]))}p.params.loop||(p.params.prevButton&&p.prevButton&&p.prevButton.length>0&&(p.isBeginning?(p.prevButton.addClass(p.params.buttonDisabledClass),p.params.a11y&&p.a11y&&p.a11y.disable(p.prevButton)):(p.prevButton.removeClass(p.params.buttonDisabledClass),p.params.a11y&&p.a11y&&p.a11y.enable(p.prevButton))),p.params.nextButton&&p.nextButton&&p.nextButton.length>0&&(p.isEnd?(p.nextButton.addClass(p.params.buttonDisabledClass),p.params.a11y&&p.a11y&&p.a11y.disable(p.nextButton)):(p.nextButton.removeClass(p.params.buttonDisabledClass),p.params.a11y&&p.a11y&&p.a11y.enable(p.nextButton))))},p.updatePagination=function(){if(p.params.pagination&&p.paginationContainer&&p.paginationContainer.length>0){var t="";if("bullets"===p.params.paginationType){for(var e=p.params.loop?Math.ceil((p.slides.length-2*p.loopedSlides)/p.params.slidesPerGroup):p.snapGrid.length,i=0;i<e;i++)p.params.paginationBulletRender?t+=p.params.paginationBulletRender(p,i,p.params.bulletClass):t+="<"+p.params.paginationElement+' class="'+p.params.bulletClass+'"></'+p.params.paginationElement+">";p.paginationContainer.html(t),p.bullets=p.paginationContainer.find("."+p.params.bulletClass),p.params.paginationClickable&&p.params.a11y&&p.a11y&&p.a11y.initPagination()}"fraction"===p.params.paginationType&&(t=p.params.paginationFractionRender?p.params.paginationFractionRender(p,p.params.paginationCurrentClass,p.params.paginationTotalClass):'<span class="'+p.params.paginationCurrentClass+'"></span> / <span class="'+p.params.paginationTotalClass+'"></span>',p.paginationContainer.html(t)),"progress"===p.params.paginationType&&(t=p.params.paginationProgressRender?p.params.paginationProgressRender(p,p.params.paginationProgressbarClass):'<span class="'+p.params.paginationProgressbarClass+'"></span>',p.paginationContainer.html(t)),"custom"!==p.params.paginationType&&p.emit("onPaginationRendered",p,p.paginationContainer[0])}},p.update=function(t){var e;p&&(p.updateContainerSize(),p.updateSlidesSize(),p.updateProgress(),p.updatePagination(),p.updateClasses(),p.params.scrollbar&&p.scrollbar&&p.scrollbar.set(),t?(p.controller&&p.controller.spline&&(p.controller.spline=void 0),p.params.freeMode?(i(),p.params.autoHeight&&p.updateAutoHeight()):(("auto"===p.params.slidesPerView||p.params.slidesPerView>1)&&p.isEnd&&!p.params.centeredSlides?p.slideTo(p.slides.length-1,0,!1,!0):p.slideTo(p.activeIndex,0,!1,!0))||i()):p.params.autoHeight&&p.updateAutoHeight());function i(){p.rtl,p.translate;e=Math.min(Math.max(p.translate,p.maxTranslate()),p.minTranslate()),p.setWrapperTranslate(e),p.updateActiveIndex(),p.updateClasses()}},p.onResize=function(t){p.params.onBeforeResize&&p.params.onBeforeResize(p),p.params.breakpoints&&p.setBreakpoint();var e=p.params.allowSwipeToPrev,i=p.params.allowSwipeToNext;p.params.allowSwipeToPrev=p.params.allowSwipeToNext=!0,p.updateContainerSize(),p.updateSlidesSize(),("auto"===p.params.slidesPerView||p.params.freeMode||t)&&p.updatePagination(),p.params.scrollbar&&p.scrollbar&&p.scrollbar.set(),p.controller&&p.controller.spline&&(p.controller.spline=void 0);var n=!1;if(p.params.freeMode){var r=Math.min(Math.max(p.translate,p.maxTranslate()),p.minTranslate());p.setWrapperTranslate(r),p.updateActiveIndex(),p.updateClasses(),p.params.autoHeight&&p.updateAutoHeight()}else p.updateClasses(),n=("auto"===p.params.slidesPerView||p.params.slidesPerView>1)&&p.isEnd&&!p.params.centeredSlides?p.slideTo(p.slides.length-1,0,!1,!0):p.slideTo(p.activeIndex,0,!1,!0);p.params.lazyLoading&&!n&&p.lazy&&p.lazy.load(),p.params.allowSwipeToPrev=e,p.params.allowSwipeToNext=i,p.params.onAfterResize&&p.params.onAfterResize(p)},p.touchEventsDesktop={start:"mousedown",move:"mousemove",end:"mouseup"},window.navigator.pointerEnabled?p.touchEventsDesktop={start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled&&(p.touchEventsDesktop={start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}),p.touchEvents={start:p.support.touch||!p.params.simulateTouch?"touchstart":p.touchEventsDesktop.start,move:p.support.touch||!p.params.simulateTouch?"touchmove":p.touchEventsDesktop.move,end:p.support.touch||!p.params.simulateTouch?"touchend":p.touchEventsDesktop.end},(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&("container"===p.params.touchEventsTarget?p.container:p.wrapper).addClass("swiper-wp8-"+p.params.direction),p.initEvents=function(t){var e=t?"off":"on",i=t?"removeEventListener":"addEventListener",r="container"===p.params.touchEventsTarget?p.container[0]:p.wrapper[0],o=p.support.touch?r:document,a=!!p.params.nested;if(p.browser.ie)r[i](p.touchEvents.start,p.onTouchStart,!1),o[i](p.touchEvents.move,p.onTouchMove,a),o[i](p.touchEvents.end,p.onTouchEnd,!1);else{if(p.support.touch){var s=!("touchstart"!==p.touchEvents.start||!p.support.passiveListener||!p.params.passiveListeners)&&{passive:!0,capture:!1};r[i](p.touchEvents.start,p.onTouchStart,s),r[i](p.touchEvents.move,p.onTouchMove,a),r[i](p.touchEvents.end,p.onTouchEnd,s)}(n.simulateTouch&&!p.device.ios&&!p.device.android||n.simulateTouch&&!p.support.touch&&p.device.ios)&&(r[i]("mousedown",p.onTouchStart,!1),document[i]("mousemove",p.onTouchMove,a),document[i]("mouseup",p.onTouchEnd,!1))}window[i]("resize",p.onResize),p.params.nextButton&&p.nextButton&&p.nextButton.length>0&&(p.nextButton[e]("click",p.onClickNext),p.params.a11y&&p.a11y&&p.nextButton[e]("keydown",p.a11y.onEnterKey)),p.params.prevButton&&p.prevButton&&p.prevButton.length>0&&(p.prevButton[e]("click",p.onClickPrev),p.params.a11y&&p.a11y&&p.prevButton[e]("keydown",p.a11y.onEnterKey)),p.params.pagination&&p.params.paginationClickable&&(p.paginationContainer[e]("click","."+p.params.bulletClass,p.onClickIndex),p.params.a11y&&p.a11y&&p.paginationContainer[e]("keydown","."+p.params.bulletClass,p.a11y.onEnterKey)),(p.params.preventClicks||p.params.preventClicksPropagation)&&r[i]("click",p.preventClicks,!0)},p.attachEvents=function(){p.initEvents()},p.detachEvents=function(){p.initEvents(!0)},p.allowClick=!0,p.preventClicks=function(t){p.allowClick||(p.params.preventClicks&&t.preventDefault(),p.params.preventClicksPropagation&&p.animating&&(t.stopPropagation(),t.stopImmediatePropagation()))},p.onClickNext=function(t){t.preventDefault(),p.isEnd&&!p.params.loop||p.slideNext()},p.onClickPrev=function(t){t.preventDefault(),p.isBeginning&&!p.params.loop||p.slidePrev()},p.onClickIndex=function(t){t.preventDefault();var e=i(this).index()*p.params.slidesPerGroup;p.params.loop&&(e+=p.loopedSlides),p.slideTo(e)},p.updateClickedSlide=function(t){var e=R(t,"."+p.params.slideClass),n=!1;if(e)for(var r=0;r<p.slides.length;r++)p.slides[r]===e&&(n=!0);if(!e||!n)return p.clickedSlide=void 0,void(p.clickedIndex=void 0);if(p.clickedSlide=e,p.clickedIndex=i(e).index(),p.params.slideToClickedSlide&&void 0!==p.clickedIndex&&p.clickedIndex!==p.activeIndex){var o,a=p.clickedIndex,s="auto"===p.params.slidesPerView?p.currentSlidesPerView():p.params.slidesPerView;if(p.params.loop){if(p.animating)return;o=parseInt(i(p.clickedSlide).attr("data-swiper-slide-index"),10),p.params.centeredSlides?a<p.loopedSlides-s/2||a>p.slides.length-p.loopedSlides+s/2?(p.fixLoop(),a=p.wrapper.children("."+p.params.slideClass+'[data-swiper-slide-index="'+o+'"]:not(.'+p.params.slideDuplicateClass+")").eq(0).index(),setTimeout((function(){p.slideTo(a)}),0)):p.slideTo(a):a>p.slides.length-s?(p.fixLoop(),a=p.wrapper.children("."+p.params.slideClass+'[data-swiper-slide-index="'+o+'"]:not(.'+p.params.slideDuplicateClass+")").eq(0).index(),setTimeout((function(){p.slideTo(a)}),0)):p.slideTo(a)}else p.slideTo(a)}};var m,g,v,y,b,w,x,M,T,S,_,A,P="input, select, textarea, button, video",C=Date.now(),E=[];for(var D in p.animating=!1,p.touches={startX:0,startY:0,currentX:0,currentY:0,diff:0},p.onTouchStart=function(t){if(t.originalEvent&&(t=t.originalEvent),(_="touchstart"===t.type)||!("which"in t)||3!==t.which)if(p.params.noSwiping&&R(t,"."+p.params.noSwipingClass))p.allowClick=!0;else if(!p.params.swipeHandler||R(t,p.params.swipeHandler)){var e=p.touches.currentX="touchstart"===t.type?t.targetTouches[0].pageX:t.pageX,n=p.touches.currentY="touchstart"===t.type?t.targetTouches[0].pageY:t.pageY;if(!(p.device.ios&&p.params.iOSEdgeSwipeDetection&&e<=p.params.iOSEdgeSwipeThreshold)){if(m=!0,g=!1,v=!0,b=void 0,A=void 0,p.touches.startX=e,p.touches.startY=n,y=Date.now(),p.allowClick=!0,p.updateContainerSize(),p.swipeDirection=void 0,p.params.threshold>0&&(M=!1),"touchstart"!==t.type){var r=!0;i(t.target).is(P)&&(r=!1),document.activeElement&&i(document.activeElement).is(P)&&document.activeElement.blur(),r&&t.preventDefault()}p.emit("onTouchStart",p,t)}}},p.onTouchMove=function(t){if(t.originalEvent&&(t=t.originalEvent),!_||"mousemove"!==t.type){if(t.preventedByNestedSwiper)return p.touches.startX="touchmove"===t.type?t.targetTouches[0].pageX:t.pageX,void(p.touches.startY="touchmove"===t.type?t.targetTouches[0].pageY:t.pageY);if(p.params.onlyExternal)return p.allowClick=!1,void(m&&(p.touches.startX=p.touches.currentX="touchmove"===t.type?t.targetTouches[0].pageX:t.pageX,p.touches.startY=p.touches.currentY="touchmove"===t.type?t.targetTouches[0].pageY:t.pageY,y=Date.now()));if(_&&p.params.touchReleaseOnEdges&&!p.params.loop)if(p.isHorizontal()){if(p.touches.currentX<p.touches.startX&&p.translate<=p.maxTranslate()||p.touches.currentX>p.touches.startX&&p.translate>=p.minTranslate())return}else if(p.touches.currentY<p.touches.startY&&p.translate<=p.maxTranslate()||p.touches.currentY>p.touches.startY&&p.translate>=p.minTranslate())return;if(_&&document.activeElement&&t.target===document.activeElement&&i(t.target).is(P))return g=!0,void(p.allowClick=!1);if(v&&p.emit("onTouchMove",p,t),!(t.targetTouches&&t.targetTouches.length>1)){var e;if(p.touches.currentX="touchmove"===t.type?t.targetTouches[0].pageX:t.pageX,p.touches.currentY="touchmove"===t.type?t.targetTouches[0].pageY:t.pageY,void 0===b)p.isHorizontal()&&p.touches.currentY===p.touches.startY||!p.isHorizontal()&&p.touches.currentX===p.touches.startX?b=!1:(e=180*Math.atan2(Math.abs(p.touches.currentY-p.touches.startY),Math.abs(p.touches.currentX-p.touches.startX))/Math.PI,b=p.isHorizontal()?e>p.params.touchAngle:90-e>p.params.touchAngle);if(b&&p.emit("onTouchMoveOpposite",p,t),void 0===A&&(p.touches.currentX===p.touches.startX&&p.touches.currentY===p.touches.startY||(A=!0)),m)if(b)m=!1;else if(A){p.allowClick=!1,p.emit("onSliderMove",p,t),t.preventDefault(),p.params.touchMoveStopPropagation&&!p.params.nested&&t.stopPropagation(),g||(n.loop&&p.fixLoop(),x=p.getWrapperTranslate(),p.setWrapperTransition(0),p.animating&&p.wrapper.trigger("webkitTransitionEnd transitionend oTransitionEnd MSTransitionEnd msTransitionEnd"),p.params.autoplay&&p.autoplaying&&(p.params.autoplayDisableOnInteraction?p.stopAutoplay():p.pauseAutoplay()),S=!1,!p.params.grabCursor||!0!==p.params.allowSwipeToNext&&!0!==p.params.allowSwipeToPrev||p.setGrabCursor(!0)),g=!0;var r=p.touches.diff=p.isHorizontal()?p.touches.currentX-p.touches.startX:p.touches.currentY-p.touches.startY;r*=p.params.touchRatio,p.rtl&&(r=-r),p.swipeDirection=r>0?"prev":"next",w=r+x;var o=!0;if(r>0&&w>p.minTranslate()?(o=!1,p.params.resistance&&(w=p.minTranslate()-1+Math.pow(-p.minTranslate()+x+r,p.params.resistanceRatio))):r<0&&w<p.maxTranslate()&&(o=!1,p.params.resistance&&(w=p.maxTranslate()+1-Math.pow(p.maxTranslate()-x-r,p.params.resistanceRatio))),o&&(t.preventedByNestedSwiper=!0),!p.params.allowSwipeToNext&&"next"===p.swipeDirection&&w<x&&(w=x),!p.params.allowSwipeToPrev&&"prev"===p.swipeDirection&&w>x&&(w=x),p.params.threshold>0){if(!(Math.abs(r)>p.params.threshold||M))return void(w=x);if(!M)return M=!0,p.touches.startX=p.touches.currentX,p.touches.startY=p.touches.currentY,w=x,void(p.touches.diff=p.isHorizontal()?p.touches.currentX-p.touches.startX:p.touches.currentY-p.touches.startY)}p.params.followFinger&&((p.params.freeMode||p.params.watchSlidesProgress)&&p.updateActiveIndex(),p.params.freeMode&&(0===E.length&&E.push({position:p.touches[p.isHorizontal()?"startX":"startY"],time:y}),E.push({position:p.touches[p.isHorizontal()?"currentX":"currentY"],time:(new window.Date).getTime()})),p.updateProgress(w),p.setWrapperTranslate(w))}}}},p.onTouchEnd=function(t){if(t.originalEvent&&(t=t.originalEvent),v&&p.emit("onTouchEnd",p,t),v=!1,m){p.params.grabCursor&&g&&m&&(!0===p.params.allowSwipeToNext||!0===p.params.allowSwipeToPrev)&&p.setGrabCursor(!1);var e,n=Date.now(),r=n-y;if(p.allowClick&&(p.updateClickedSlide(t),p.emit("onTap",p,t),r<300&&n-C>300&&(T&&clearTimeout(T),T=setTimeout((function(){p&&(p.params.paginationHide&&p.paginationContainer.length>0&&!i(t.target).hasClass(p.params.bulletClass)&&p.paginationContainer.toggleClass(p.params.paginationHiddenClass),p.emit("onClick",p,t))}),300)),r<300&&n-C<300&&(T&&clearTimeout(T),p.emit("onDoubleTap",p,t))),C=Date.now(),setTimeout((function(){p&&(p.allowClick=!0)}),0),m&&g&&p.swipeDirection&&0!==p.touches.diff&&w!==x)if(m=g=!1,e=p.params.followFinger?p.rtl?p.translate:-p.translate:-w,p.params.freeMode){if(e<-p.minTranslate())return void p.slideTo(p.activeIndex);if(e>-p.maxTranslate())return void(p.slides.length<p.snapGrid.length?p.slideTo(p.snapGrid.length-1):p.slideTo(p.slides.length-1));if(p.params.freeModeMomentum){if(E.length>1){var o=E.pop(),a=E.pop(),s=o.position-a.position,l=o.time-a.time;p.velocity=s/l,p.velocity=p.velocity/2,Math.abs(p.velocity)<p.params.freeModeMinimumVelocity&&(p.velocity=0),(l>150||(new window.Date).getTime()-o.time>300)&&(p.velocity=0)}else p.velocity=0;p.velocity=p.velocity*p.params.freeModeMomentumVelocityRatio,E.length=0;var u=1e3*p.params.freeModeMomentumRatio,h=p.velocity*u,c=p.translate+h;p.rtl&&(c=-c);var d,f=!1,b=20*Math.abs(p.velocity)*p.params.freeModeMomentumBounceRatio;if(c<p.maxTranslate())p.params.freeModeMomentumBounce?(c+p.maxTranslate()<-b&&(c=p.maxTranslate()-b),d=p.maxTranslate(),f=!0,S=!0):c=p.maxTranslate();else if(c>p.minTranslate())p.params.freeModeMomentumBounce?(c-p.minTranslate()>b&&(c=p.minTranslate()+b),d=p.minTranslate(),f=!0,S=!0):c=p.minTranslate();else if(p.params.freeModeSticky){var M,_=0;for(_=0;_<p.snapGrid.length;_+=1)if(p.snapGrid[_]>-c){M=_;break}c=Math.abs(p.snapGrid[M]-c)<Math.abs(p.snapGrid[M-1]-c)||"next"===p.swipeDirection?p.snapGrid[M]:p.snapGrid[M-1],p.rtl||(c=-c)}if(0!==p.velocity)u=p.rtl?Math.abs((-c-p.translate)/p.velocity):Math.abs((c-p.translate)/p.velocity);else if(p.params.freeModeSticky)return void p.slideReset();p.params.freeModeMomentumBounce&&f?(p.updateProgress(d),p.setWrapperTransition(u),p.setWrapperTranslate(c),p.onTransitionStart(),p.animating=!0,p.wrapper.transitionEnd((function(){p&&S&&(p.emit("onMomentumBounce",p),p.setWrapperTransition(p.params.speed),p.setWrapperTranslate(d),p.wrapper.transitionEnd((function(){p&&p.onTransitionEnd()})))}))):p.velocity?(p.updateProgress(c),p.setWrapperTransition(u),p.setWrapperTranslate(c),p.onTransitionStart(),p.animating||(p.animating=!0,p.wrapper.transitionEnd((function(){p&&p.onTransitionEnd()})))):p.updateProgress(c),p.updateActiveIndex()}(!p.params.freeModeMomentum||r>=p.params.longSwipesMs)&&(p.updateProgress(),p.updateActiveIndex())}else{var A,P=0,D=p.slidesSizesGrid[0];for(A=0;A<p.slidesGrid.length;A+=p.params.slidesPerGroup)void 0!==p.slidesGrid[A+p.params.slidesPerGroup]?e>=p.slidesGrid[A]&&e<p.slidesGrid[A+p.params.slidesPerGroup]&&(P=A,D=p.slidesGrid[A+p.params.slidesPerGroup]-p.slidesGrid[A]):e>=p.slidesGrid[A]&&(P=A,D=p.slidesGrid[p.slidesGrid.length-1]-p.slidesGrid[p.slidesGrid.length-2]);var L=(e-p.slidesGrid[P])/D;if(r>p.params.longSwipesMs){if(!p.params.longSwipes)return void p.slideTo(p.activeIndex);"next"===p.swipeDirection&&(L>=p.params.longSwipesRatio?p.slideTo(P+p.params.slidesPerGroup):p.slideTo(P)),"prev"===p.swipeDirection&&(L>1-p.params.longSwipesRatio?p.slideTo(P+p.params.slidesPerGroup):p.slideTo(P))}else{if(!p.params.shortSwipes)return void p.slideTo(p.activeIndex);"next"===p.swipeDirection&&p.slideTo(P+p.params.slidesPerGroup),"prev"===p.swipeDirection&&p.slideTo(P)}}else m=g=!1}},p._slideTo=function(t,e){return p.slideTo(t,e,!0,!0)},p.slideTo=function(t,e,i,n){void 0===i&&(i=!0),void 0===t&&(t=0),t<0&&(t=0),p.snapIndex=Math.floor(t/p.params.slidesPerGroup),p.snapIndex>=p.snapGrid.length&&(p.snapIndex=p.snapGrid.length-1);var r=-p.snapGrid[p.snapIndex];if(p.params.autoplay&&p.autoplaying&&(n||!p.params.autoplayDisableOnInteraction?p.pauseAutoplay(e):p.stopAutoplay()),p.updateProgress(r),p.params.normalizeSlideIndex)for(var o=0;o<p.slidesGrid.length;o++)-Math.floor(100*r)>=Math.floor(100*p.slidesGrid[o])&&(t=o);return!(!p.params.allowSwipeToNext&&r<p.translate&&r<p.minTranslate())&&(!(!p.params.allowSwipeToPrev&&r>p.translate&&r>p.maxTranslate()&&(p.activeIndex||0)!==t)&&(void 0===e&&(e=p.params.speed),p.previousIndex=p.activeIndex||0,p.activeIndex=t,p.updateRealIndex(),p.rtl&&-r===p.translate||!p.rtl&&r===p.translate?(p.params.autoHeight&&p.updateAutoHeight(),p.updateClasses(),"slide"!==p.params.effect&&p.setWrapperTranslate(r),!1):(p.updateClasses(),p.onTransitionStart(i),0===e||p.browser.lteIE9?(p.setWrapperTranslate(r),p.setWrapperTransition(0),p.onTransitionEnd(i)):(p.setWrapperTranslate(r),p.setWrapperTransition(e),p.animating||(p.animating=!0,p.wrapper.transitionEnd((function(){p&&p.onTransitionEnd(i)})))),!0)))},p.onTransitionStart=function(t){void 0===t&&(t=!0),p.params.autoHeight&&p.updateAutoHeight(),p.lazy&&p.lazy.onTransitionStart(),t&&(p.emit("onTransitionStart",p),p.activeIndex!==p.previousIndex&&(p.emit("onSlideChangeStart",p),p.activeIndex>p.previousIndex?p.emit("onSlideNextStart",p):p.emit("onSlidePrevStart",p)))},p.onTransitionEnd=function(t){p.animating=!1,p.setWrapperTransition(0),void 0===t&&(t=!0),p.lazy&&p.lazy.onTransitionEnd(),t&&(p.emit("onTransitionEnd",p),p.activeIndex!==p.previousIndex&&(p.emit("onSlideChangeEnd",p),p.activeIndex>p.previousIndex?p.emit("onSlideNextEnd",p):p.emit("onSlidePrevEnd",p))),p.params.history&&p.history&&p.history.setHistory(p.params.history,p.activeIndex),p.params.hashnav&&p.hashnav&&p.hashnav.setHash()},p.slideNext=function(t,e,i){if(p.params.loop){if(p.animating)return!1;p.fixLoop();p.container[0].clientLeft;return p.slideTo(p.activeIndex+p.params.slidesPerGroup,e,t,i)}return p.slideTo(p.activeIndex+p.params.slidesPerGroup,e,t,i)},p._slideNext=function(t){return p.slideNext(!0,t,!0)},p.slidePrev=function(t,e,i){if(p.params.loop){if(p.animating)return!1;p.fixLoop();p.container[0].clientLeft;return p.slideTo(p.activeIndex-1,e,t,i)}return p.slideTo(p.activeIndex-1,e,t,i)},p._slidePrev=function(t){return p.slidePrev(!0,t,!0)},p.slideReset=function(t,e,i){return p.slideTo(p.activeIndex,e,t)},p.disableTouchControl=function(){return p.params.onlyExternal=!0,!0},p.enableTouchControl=function(){return p.params.onlyExternal=!1,!0},p.setWrapperTransition=function(t,e){p.wrapper.transition(t),"slide"!==p.params.effect&&p.effects[p.params.effect]&&p.effects[p.params.effect].setTransition(t),p.params.parallax&&p.parallax&&p.parallax.setTransition(t),p.params.scrollbar&&p.scrollbar&&p.scrollbar.setTransition(t),p.params.control&&p.controller&&p.controller.setTransition(t,e),p.emit("onSetTransition",p,t)},p.setWrapperTranslate=function(t,e,i){var n=0,r=0;p.isHorizontal()?n=p.rtl?-t:t:r=t,p.params.roundLengths&&(n=O(n),r=O(r)),p.params.virtualTranslate||(p.support.transforms3d?p.wrapper.transform("translate3d("+n+"px, "+r+"px, 0px)"):p.wrapper.transform("translate("+n+"px, "+r+"px)")),p.translate=p.isHorizontal()?n:r;var o=p.maxTranslate()-p.minTranslate();(0===o?0:(t-p.minTranslate())/o)!==p.progress&&p.updateProgress(t),e&&p.updateActiveIndex(),"slide"!==p.params.effect&&p.effects[p.params.effect]&&p.effects[p.params.effect].setTranslate(p.translate),p.params.parallax&&p.parallax&&p.parallax.setTranslate(p.translate),p.params.scrollbar&&p.scrollbar&&p.scrollbar.setTranslate(p.translate),p.params.control&&p.controller&&p.controller.setTranslate(p.translate,i),p.emit("onSetTranslate",p,p.translate)},p.getTranslate=function(t,e){var i,n,r,o;return void 0===e&&(e="x"),p.params.virtualTranslate?p.rtl?-p.translate:p.translate:(r=window.getComputedStyle(t,null),window.WebKitCSSMatrix?((n=r.transform||r.webkitTransform).split(",").length>6&&(n=n.split(", ").map((function(t){return t.replace(",",".")})).join(", ")),o=new window.WebKitCSSMatrix("none"===n?"":n)):i=(o=r.MozTransform||r.OTransform||r.MsTransform||r.msTransform||r.transform||r.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,")).toString().split(","),"x"===e&&(n=window.WebKitCSSMatrix?o.m41:16===i.length?parseFloat(i[12]):parseFloat(i[4])),"y"===e&&(n=window.WebKitCSSMatrix?o.m42:16===i.length?parseFloat(i[13]):parseFloat(i[5])),p.rtl&&n&&(n=-n),n||0)},p.getWrapperTranslate=function(t){return void 0===t&&(t=p.isHorizontal()?"x":"y"),p.getTranslate(p.wrapper[0],t)},p.observers=[],p.initObservers=function(){if(p.params.observeParents)for(var t=p.container.parents(),e=0;e<t.length;e++)N(t[e]);N(p.container[0],{childList:!1}),N(p.wrapper[0],{attributes:!1})},p.disconnectObservers=function(){for(var t=0;t<p.observers.length;t++)p.observers[t].disconnect();p.observers=[]},p.createLoop=function(){p.wrapper.children("."+p.params.slideClass+"."+p.params.slideDuplicateClass).remove();var t=p.wrapper.children("."+p.params.slideClass);"auto"!==p.params.slidesPerView||p.params.loopedSlides||(p.params.loopedSlides=t.length),p.loopedSlides=parseInt(p.params.loopedSlides||p.params.slidesPerView,10),p.loopedSlides=p.loopedSlides+p.params.loopAdditionalSlides,p.loopedSlides>t.length&&(p.loopedSlides=t.length);var e,n=[],r=[];for(t.each((function(e,o){var a=i(this);e<p.loopedSlides&&r.push(o),e<t.length&&e>=t.length-p.loopedSlides&&n.push(o),a.attr("data-swiper-slide-index",e)})),e=0;e<r.length;e++)p.wrapper.append(i(r[e].cloneNode(!0)).addClass(p.params.slideDuplicateClass));for(e=n.length-1;e>=0;e--)p.wrapper.prepend(i(n[e].cloneNode(!0)).addClass(p.params.slideDuplicateClass))},p.destroyLoop=function(){p.wrapper.children("."+p.params.slideClass+"."+p.params.slideDuplicateClass).remove(),p.slides.removeAttr("data-swiper-slide-index")},p.reLoop=function(t){var e=p.activeIndex-p.loopedSlides;p.destroyLoop(),p.createLoop(),p.updateSlidesSize(),t&&p.slideTo(e+p.loopedSlides,0,!1)},p.fixLoop=function(){var t;p.activeIndex<p.loopedSlides?(t=p.slides.length-3*p.loopedSlides+p.activeIndex,t+=p.loopedSlides,p.slideTo(t,0,!1,!0)):("auto"===p.params.slidesPerView&&p.activeIndex>=2*p.loopedSlides||p.activeIndex>p.slides.length-2*p.params.slidesPerView)&&(t=-p.slides.length+p.activeIndex+p.loopedSlides,t+=p.loopedSlides,p.slideTo(t,0,!1,!0))},p.appendSlide=function(t){if(p.params.loop&&p.destroyLoop(),"object"==typeof t&&t.length)for(var e=0;e<t.length;e++)t[e]&&p.wrapper.append(t[e]);else p.wrapper.append(t);p.params.loop&&p.createLoop(),p.params.observer&&p.support.observer||p.update(!0)},p.prependSlide=function(t){p.params.loop&&p.destroyLoop();var e=p.activeIndex+1;if("object"==typeof t&&t.length){for(var i=0;i<t.length;i++)t[i]&&p.wrapper.prepend(t[i]);e=p.activeIndex+t.length}else p.wrapper.prepend(t);p.params.loop&&p.createLoop(),p.params.observer&&p.support.observer||p.update(!0),p.slideTo(e,0,!1)},p.removeSlide=function(t){p.params.loop&&(p.destroyLoop(),p.slides=p.wrapper.children("."+p.params.slideClass));var e,i=p.activeIndex;if("object"==typeof t&&t.length){for(var n=0;n<t.length;n++)e=t[n],p.slides[e]&&p.slides.eq(e).remove(),e<i&&i--;i=Math.max(i,0)}else e=t,p.slides[e]&&p.slides.eq(e).remove(),e<i&&i--,i=Math.max(i,0);p.params.loop&&p.createLoop(),p.params.observer&&p.support.observer||p.update(!0),p.params.loop?p.slideTo(i+p.loopedSlides,0,!1):p.slideTo(i,0,!1)},p.removeAllSlides=function(){for(var t=[],e=0;e<p.slides.length;e++)t.push(e);p.removeSlide(t)},p.effects={fade:{setTranslate:function(){for(var t=0;t<p.slides.length;t++){var e=p.slides.eq(t),i=-e[0].swiperSlideOffset;p.params.virtualTranslate||(i-=p.translate);var n=0;p.isHorizontal()||(n=i,i=0);var r=p.params.fade.crossFade?Math.max(1-Math.abs(e[0].progress),0):1+Math.min(Math.max(e[0].progress,-1),0);e.css({opacity:r}).transform("translate3d("+i+"px, "+n+"px, 0px)")}},setTransition:function(t){if(p.slides.transition(t),p.params.virtualTranslate&&0!==t){var e=!1;p.slides.transitionEnd((function(){if(!e&&p){e=!0,p.animating=!1;for(var t=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],i=0;i<t.length;i++)p.wrapper.trigger(t[i])}}))}}},flip:{setTranslate:function(){for(var t=0;t<p.slides.length;t++){var e=p.slides.eq(t),n=e[0].progress;p.params.flip.limitRotation&&(n=Math.max(Math.min(e[0].progress,1),-1));var r=-180*n,o=0,a=-e[0].swiperSlideOffset,s=0;if(p.isHorizontal()?p.rtl&&(r=-r):(s=a,a=0,o=-r,r=0),e[0].style.zIndex=-Math.abs(Math.round(n))+p.slides.length,p.params.flip.slideShadows){var l=p.isHorizontal()?e.find(".swiper-slide-shadow-left"):e.find(".swiper-slide-shadow-top"),u=p.isHorizontal()?e.find(".swiper-slide-shadow-right"):e.find(".swiper-slide-shadow-bottom");0===l.length&&(l=i('<div class="swiper-slide-shadow-'+(p.isHorizontal()?"left":"top")+'"></div>'),e.append(l)),0===u.length&&(u=i('<div class="swiper-slide-shadow-'+(p.isHorizontal()?"right":"bottom")+'"></div>'),e.append(u)),l.length&&(l[0].style.opacity=Math.max(-n,0)),u.length&&(u[0].style.opacity=Math.max(n,0))}e.transform("translate3d("+a+"px, "+s+"px, 0px) rotateX("+o+"deg) rotateY("+r+"deg)")}},setTransition:function(t){if(p.slides.transition(t).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(t),p.params.virtualTranslate&&0!==t){var e=!1;p.slides.eq(p.activeIndex).transitionEnd((function(){if(!e&&p&&i(this).hasClass(p.params.slideActiveClass)){e=!0,p.animating=!1;for(var t=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],n=0;n<t.length;n++)p.wrapper.trigger(t[n])}}))}}},cube:{setTranslate:function(){var t,e=0;p.params.cube.shadow&&(p.isHorizontal()?(0===(t=p.wrapper.find(".swiper-cube-shadow")).length&&(t=i('<div class="swiper-cube-shadow"></div>'),p.wrapper.append(t)),t.css({height:p.width+"px"})):0===(t=p.container.find(".swiper-cube-shadow")).length&&(t=i('<div class="swiper-cube-shadow"></div>'),p.container.append(t)));for(var n=0;n<p.slides.length;n++){var r=p.slides.eq(n),o=90*n,a=Math.floor(o/360);p.rtl&&(o=-o,a=Math.floor(-o/360));var s=Math.max(Math.min(r[0].progress,1),-1),l=0,u=0,h=0;n%4==0?(l=4*-a*p.size,h=0):(n-1)%4==0?(l=0,h=4*-a*p.size):(n-2)%4==0?(l=p.size+4*a*p.size,h=p.size):(n-3)%4==0&&(l=-p.size,h=3*p.size+4*p.size*a),p.rtl&&(l=-l),p.isHorizontal()||(u=l,l=0);var c="rotateX("+(p.isHorizontal()?0:-o)+"deg) rotateY("+(p.isHorizontal()?o:0)+"deg) translate3d("+l+"px, "+u+"px, "+h+"px)";if(s<=1&&s>-1&&(e=90*n+90*s,p.rtl&&(e=90*-n-90*s)),r.transform(c),p.params.cube.slideShadows){var d=p.isHorizontal()?r.find(".swiper-slide-shadow-left"):r.find(".swiper-slide-shadow-top"),f=p.isHorizontal()?r.find(".swiper-slide-shadow-right"):r.find(".swiper-slide-shadow-bottom");0===d.length&&(d=i('<div class="swiper-slide-shadow-'+(p.isHorizontal()?"left":"top")+'"></div>'),r.append(d)),0===f.length&&(f=i('<div class="swiper-slide-shadow-'+(p.isHorizontal()?"right":"bottom")+'"></div>'),r.append(f)),d.length&&(d[0].style.opacity=Math.max(-s,0)),f.length&&(f[0].style.opacity=Math.max(s,0))}}if(p.wrapper.css({"-webkit-transform-origin":"50% 50% -"+p.size/2+"px","-moz-transform-origin":"50% 50% -"+p.size/2+"px","-ms-transform-origin":"50% 50% -"+p.size/2+"px","transform-origin":"50% 50% -"+p.size/2+"px"}),p.params.cube.shadow)if(p.isHorizontal())t.transform("translate3d(0px, "+(p.width/2+p.params.cube.shadowOffset)+"px, "+-p.width/2+"px) rotateX(90deg) rotateZ(0deg) scale("+p.params.cube.shadowScale+")");else{var m=Math.abs(e)-90*Math.floor(Math.abs(e)/90),g=1.5-(Math.sin(2*m*Math.PI/360)/2+Math.cos(2*m*Math.PI/360)/2),v=p.params.cube.shadowScale,y=p.params.cube.shadowScale/g,b=p.params.cube.shadowOffset;t.transform("scale3d("+v+", 1, "+y+") translate3d(0px, "+(p.height/2+b)+"px, "+-p.height/2/y+"px) rotateX(-90deg)")}var w=p.isSafari||p.isUiWebView?-p.size/2:0;p.wrapper.transform("translate3d(0px,0,"+w+"px) rotateX("+(p.isHorizontal()?0:e)+"deg) rotateY("+(p.isHorizontal()?-e:0)+"deg)")},setTransition:function(t){p.slides.transition(t).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(t),p.params.cube.shadow&&!p.isHorizontal()&&p.container.find(".swiper-cube-shadow").transition(t)}},coverflow:{setTranslate:function(){for(var t=p.translate,e=p.isHorizontal()?-t+p.width/2:-t+p.height/2,n=p.isHorizontal()?p.params.coverflow.rotate:-p.params.coverflow.rotate,r=p.params.coverflow.depth,o=0,a=p.slides.length;o<a;o++){var s=p.slides.eq(o),l=p.slidesSizesGrid[o],u=(e-s[0].swiperSlideOffset-l/2)/l*p.params.coverflow.modifier,h=p.isHorizontal()?n*u:0,c=p.isHorizontal()?0:n*u,d=-r*Math.abs(u),f=p.isHorizontal()?0:p.params.coverflow.stretch*u,m=p.isHorizontal()?p.params.coverflow.stretch*u:0;Math.abs(m)<.001&&(m=0),Math.abs(f)<.001&&(f=0),Math.abs(d)<.001&&(d=0),Math.abs(h)<.001&&(h=0),Math.abs(c)<.001&&(c=0);var g="translate3d("+m+"px,"+f+"px,"+d+"px) rotateX("+c+"deg) rotateY("+h+"deg)";if(s.transform(g),s[0].style.zIndex=1-Math.abs(Math.round(u)),p.params.coverflow.slideShadows){var v=p.isHorizontal()?s.find(".swiper-slide-shadow-left"):s.find(".swiper-slide-shadow-top"),y=p.isHorizontal()?s.find(".swiper-slide-shadow-right"):s.find(".swiper-slide-shadow-bottom");0===v.length&&(v=i('<div class="swiper-slide-shadow-'+(p.isHorizontal()?"left":"top")+'"></div>'),s.append(v)),0===y.length&&(y=i('<div class="swiper-slide-shadow-'+(p.isHorizontal()?"right":"bottom")+'"></div>'),s.append(y)),v.length&&(v[0].style.opacity=u>0?u:0),y.length&&(y[0].style.opacity=-u>0?-u:0)}}p.browser.ie&&(p.wrapper[0].style.perspectiveOrigin=e+"px 50%")},setTransition:function(t){p.slides.transition(t).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(t)}}},p.lazy={initialImageLoaded:!1,loadImageInSlide:function(t,e){if(void 0!==t&&(void 0===e&&(e=!0),0!==p.slides.length)){var n=p.slides.eq(t),r=n.find("."+p.params.lazyLoadingClass+":not(."+p.params.lazyStatusLoadedClass+"):not(."+p.params.lazyStatusLoadingClass+")");!n.hasClass(p.params.lazyLoadingClass)||n.hasClass(p.params.lazyStatusLoadedClass)||n.hasClass(p.params.lazyStatusLoadingClass)||(r=r.add(n[0])),0!==r.length&&r.each((function(){var t=i(this);t.addClass(p.params.lazyStatusLoadingClass);var r=t.attr("data-background"),o=t.attr("data-src"),a=t.attr("data-srcset"),s=t.attr("data-sizes");p.loadImage(t[0],o||r,a,s,!1,(function(){if(null!=p&&p){if(r?(t.css("background-image",'url("'+r+'")'),t.removeAttr("data-background")):(a&&(t.attr("srcset",a),t.removeAttr("data-srcset")),s&&(t.attr("sizes",s),t.removeAttr("data-sizes")),o&&(t.attr("src",o),t.removeAttr("data-src"))),t.addClass(p.params.lazyStatusLoadedClass).removeClass(p.params.lazyStatusLoadingClass),n.find("."+p.params.lazyPreloaderClass+", ."+p.params.preloaderClass).remove(),p.params.loop&&e){var i=n.attr("data-swiper-slide-index");if(n.hasClass(p.params.slideDuplicateClass)){var l=p.wrapper.children('[data-swiper-slide-index="'+i+'"]:not(.'+p.params.slideDuplicateClass+")");p.lazy.loadImageInSlide(l.index(),!1)}else{var u=p.wrapper.children("."+p.params.slideDuplicateClass+'[data-swiper-slide-index="'+i+'"]');p.lazy.loadImageInSlide(u.index(),!1)}}p.emit("onLazyImageReady",p,n[0],t[0])}})),p.emit("onLazyImageLoad",p,n[0],t[0])}))}},load:function(){var t,e=p.params.slidesPerView;if("auto"===e&&(e=0),p.lazy.initialImageLoaded||(p.lazy.initialImageLoaded=!0),p.params.watchSlidesVisibility)p.wrapper.children("."+p.params.slideVisibleClass).each((function(){p.lazy.loadImageInSlide(i(this).index())}));else if(e>1)for(t=p.activeIndex;t<p.activeIndex+e;t++)p.slides[t]&&p.lazy.loadImageInSlide(t);else p.lazy.loadImageInSlide(p.activeIndex);if(p.params.lazyLoadingInPrevNext)if(e>1||p.params.lazyLoadingInPrevNextAmount&&p.params.lazyLoadingInPrevNextAmount>1){var n=p.params.lazyLoadingInPrevNextAmount,r=e,o=Math.min(p.activeIndex+r+Math.max(n,r),p.slides.length),a=Math.max(p.activeIndex-Math.max(r,n),0);for(t=p.activeIndex+e;t<o;t++)p.slides[t]&&p.lazy.loadImageInSlide(t);for(t=a;t<p.activeIndex;t++)p.slides[t]&&p.lazy.loadImageInSlide(t)}else{var s=p.wrapper.children("."+p.params.slideNextClass);s.length>0&&p.lazy.loadImageInSlide(s.index());var l=p.wrapper.children("."+p.params.slidePrevClass);l.length>0&&p.lazy.loadImageInSlide(l.index())}},onTransitionStart:function(){p.params.lazyLoading&&(p.params.lazyLoadingOnTransitionStart||!p.params.lazyLoadingOnTransitionStart&&!p.lazy.initialImageLoaded)&&p.lazy.load()},onTransitionEnd:function(){p.params.lazyLoading&&!p.params.lazyLoadingOnTransitionStart&&p.lazy.load()}},p.scrollbar={isTouched:!1,setDragPosition:function(t){var e=p.scrollbar,i=(p.isHorizontal()?"touchstart"===t.type||"touchmove"===t.type?t.targetTouches[0].pageX:t.pageX||t.clientX:"touchstart"===t.type||"touchmove"===t.type?t.targetTouches[0].pageY:t.pageY||t.clientY)-e.track.offset()[p.isHorizontal()?"left":"top"]-e.dragSize/2,n=-p.minTranslate()*e.moveDivider,r=-p.maxTranslate()*e.moveDivider;i<n?i=n:i>r&&(i=r),i=-i/e.moveDivider,p.updateProgress(i),p.setWrapperTranslate(i,!0)},dragStart:function(t){var e=p.scrollbar;e.isTouched=!0,t.preventDefault(),t.stopPropagation(),e.setDragPosition(t),clearTimeout(e.dragTimeout),e.track.transition(0),p.params.scrollbarHide&&e.track.css("opacity",1),p.wrapper.transition(100),e.drag.transition(100),p.emit("onScrollbarDragStart",p)},dragMove:function(t){var e=p.scrollbar;e.isTouched&&(t.preventDefault?t.preventDefault():t.returnValue=!1,e.setDragPosition(t),p.wrapper.transition(0),e.track.transition(0),e.drag.transition(0),p.emit("onScrollbarDragMove",p))},dragEnd:function(t){var e=p.scrollbar;e.isTouched&&(e.isTouched=!1,p.params.scrollbarHide&&(clearTimeout(e.dragTimeout),e.dragTimeout=setTimeout((function(){e.track.css("opacity",0),e.track.transition(400)}),1e3)),p.emit("onScrollbarDragEnd",p),p.params.scrollbarSnapOnRelease&&p.slideReset())},draggableEvents:!1!==p.params.simulateTouch||p.support.touch?p.touchEvents:p.touchEventsDesktop,enableDraggable:function(){var t=p.scrollbar,e=p.support.touch?t.track:document;i(t.track).on(t.draggableEvents.start,t.dragStart),i(e).on(t.draggableEvents.move,t.dragMove),i(e).on(t.draggableEvents.end,t.dragEnd)},disableDraggable:function(){var t=p.scrollbar,e=p.support.touch?t.track:document;i(t.track).off(t.draggableEvents.start,t.dragStart),i(e).off(t.draggableEvents.move,t.dragMove),i(e).off(t.draggableEvents.end,t.dragEnd)},set:function(){if(p.params.scrollbar){var t=p.scrollbar;t.track=i(p.params.scrollbar),p.params.uniqueNavElements&&"string"==typeof p.params.scrollbar&&t.track.length>1&&1===p.container.find(p.params.scrollbar).length&&(t.track=p.container.find(p.params.scrollbar)),t.drag=t.track.find(".swiper-scrollbar-drag"),0===t.drag.length&&(t.drag=i('<div class="swiper-scrollbar-drag"></div>'),t.track.append(t.drag)),t.drag[0].style.width="",t.drag[0].style.height="",t.trackSize=p.isHorizontal()?t.track[0].offsetWidth:t.track[0].offsetHeight,t.divider=p.size/p.virtualSize,t.moveDivider=t.divider*(t.trackSize/p.size),t.dragSize=t.trackSize*t.divider,p.isHorizontal()?t.drag[0].style.width=t.dragSize+"px":t.drag[0].style.height=t.dragSize+"px",t.divider>=1?t.track[0].style.display="none":t.track[0].style.display="",p.params.scrollbarHide&&(t.track[0].style.opacity=0)}},setTranslate:function(){if(p.params.scrollbar){var t,e=p.scrollbar,i=(p.translate,e.dragSize);t=(e.trackSize-e.dragSize)*p.progress,p.rtl&&p.isHorizontal()?(t=-t)>0?(i=e.dragSize-t,t=0):-t+e.dragSize>e.trackSize&&(i=e.trackSize+t):t<0?(i=e.dragSize+t,t=0):t+e.dragSize>e.trackSize&&(i=e.trackSize-t),p.isHorizontal()?(p.support.transforms3d?e.drag.transform("translate3d("+t+"px, 0, 0)"):e.drag.transform("translateX("+t+"px)"),e.drag[0].style.width=i+"px"):(p.support.transforms3d?e.drag.transform("translate3d(0px, "+t+"px, 0)"):e.drag.transform("translateY("+t+"px)"),e.drag[0].style.height=i+"px"),p.params.scrollbarHide&&(clearTimeout(e.timeout),e.track[0].style.opacity=1,e.timeout=setTimeout((function(){e.track[0].style.opacity=0,e.track.transition(400)}),1e3))}},setTransition:function(t){p.params.scrollbar&&p.scrollbar.drag.transition(t)}},p.controller={LinearSpline:function(t,e){var i,n,r,o,a,s=function(t,e){for(n=-1,i=t.length;i-n>1;)t[r=i+n>>1]<=e?n=r:i=r;return i};this.x=t,this.y=e,this.lastIndex=t.length-1;this.x.length;this.interpolate=function(t){return t?(a=s(this.x,t),o=a-1,(t-this.x[o])*(this.y[a]-this.y[o])/(this.x[a]-this.x[o])+this.y[o]):0}},getInterpolateFunction:function(t){p.controller.spline||(p.controller.spline=p.params.loop?new p.controller.LinearSpline(p.slidesGrid,t.slidesGrid):new p.controller.LinearSpline(p.snapGrid,t.snapGrid))},setTranslate:function(t,e){var i,n,r=p.params.control;function a(e){t=e.rtl&&"horizontal"===e.params.direction?-p.translate:p.translate,"slide"===p.params.controlBy&&(p.controller.getInterpolateFunction(e),n=-p.controller.spline.interpolate(-t)),n&&"container"!==p.params.controlBy||(i=(e.maxTranslate()-e.minTranslate())/(p.maxTranslate()-p.minTranslate()),n=(t-p.minTranslate())*i+e.minTranslate()),p.params.controlInverse&&(n=e.maxTranslate()-n),e.updateProgress(n),e.setWrapperTranslate(n,!1,p),e.updateActiveIndex()}if(Array.isArray(r))for(var s=0;s<r.length;s++)r[s]!==e&&r[s]instanceof o&&a(r[s]);else r instanceof o&&e!==r&&a(r)},setTransition:function(t,e){var i,n=p.params.control;function r(e){e.setWrapperTransition(t,p),0!==t&&(e.onTransitionStart(),e.wrapper.transitionEnd((function(){n&&(e.params.loop&&"slide"===p.params.controlBy&&e.fixLoop(),e.onTransitionEnd())})))}if(Array.isArray(n))for(i=0;i<n.length;i++)n[i]!==e&&n[i]instanceof o&&r(n[i]);else n instanceof o&&e!==n&&r(n)}},p.hashnav={onHashCange:function(t,e){var i=document.location.hash.replace("#","");i!==p.slides.eq(p.activeIndex).attr("data-hash")&&p.slideTo(p.wrapper.children("."+p.params.slideClass+'[data-hash="'+i+'"]').index())},attachEvents:function(t){var e=t?"off":"on";i(window)[e]("hashchange",p.hashnav.onHashCange)},setHash:function(){if(p.hashnav.initialized&&p.params.hashnav)if(p.params.replaceState&&window.history&&window.history.replaceState)window.history.replaceState(null,null,"#"+p.slides.eq(p.activeIndex).attr("data-hash")||!1);else{var t=p.slides.eq(p.activeIndex),e=t.attr("data-hash")||t.attr("data-history");document.location.hash=e||""}},init:function(){if(p.params.hashnav&&!p.params.history){p.hashnav.initialized=!0;var t=document.location.hash.replace("#","");if(t)for(var e=0,i=p.slides.length;e<i;e++){var n=p.slides.eq(e);if((n.attr("data-hash")||n.attr("data-history"))===t&&!n.hasClass(p.params.slideDuplicateClass)){var r=n.index();p.slideTo(r,0,p.params.runCallbacksOnInit,!0)}}p.params.hashnavWatchState&&p.hashnav.attachEvents()}},destroy:function(){p.params.hashnavWatchState&&p.hashnav.attachEvents(!0)}},p.history={init:function(){if(p.params.history){if(!window.history||!window.history.pushState)return p.params.history=!1,void(p.params.hashnav=!0);p.history.initialized=!0,this.paths=this.getPathValues(),(this.paths.key||this.paths.value)&&(this.scrollToSlide(0,this.paths.value,p.params.runCallbacksOnInit),p.params.replaceState||window.addEventListener("popstate",this.setHistoryPopState))}},setHistoryPopState:function(){p.history.paths=p.history.getPathValues(),p.history.scrollToSlide(p.params.speed,p.history.paths.value,!1)},getPathValues:function(){var t=window.location.pathname.slice(1).split("/"),e=t.length;return{key:t[e-2],value:t[e-1]}},setHistory:function(t,e){if(p.history.initialized&&p.params.history){var i=p.slides.eq(e),n=this.slugify(i.attr("data-history"));window.location.pathname.includes(t)||(n=t+"/"+n),p.params.replaceState?window.history.replaceState(null,null,n):window.history.pushState(null,null,n)}},slugify:function(t){return t.toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")},scrollToSlide:function(t,e,i){if(e)for(var n=0,r=p.slides.length;n<r;n++){var o=p.slides.eq(n);if(this.slugify(o.attr("data-history"))===e&&!o.hasClass(p.params.slideDuplicateClass)){var a=o.index();p.slideTo(a,t,i)}}else p.slideTo(0,t,i)}},p.disableKeyboardControl=function(){p.params.keyboardControl=!1,i(document).off("keydown",k)},p.enableKeyboardControl=function(){p.params.keyboardControl=!0,i(document).on("keydown",k)},p.mousewheel={event:!1,lastScrollTime:(new window.Date).getTime()},p.params.mousewheelControl&&(p.mousewheel.event=navigator.userAgent.indexOf("firefox")>-1?"DOMMouseScroll":function(){var t="onwheel"in document;if(!t){var e=document.createElement("div");e.setAttribute("onwheel","return;"),t="function"==typeof e.onwheel}return!t&&document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")&&(t=document.implementation.hasFeature("Events.wheel","3.0")),t}()?"wheel":"mousewheel"),p.disableMousewheelControl=function(){if(!p.mousewheel.event)return!1;var t=p.container;return"container"!==p.params.mousewheelEventsTarged&&(t=i(p.params.mousewheelEventsTarged)),t.off(p.mousewheel.event,F),p.params.mousewheelControl=!1,!0},p.enableMousewheelControl=function(){if(!p.mousewheel.event)return!1;var t=p.container;return"container"!==p.params.mousewheelEventsTarged&&(t=i(p.params.mousewheelEventsTarged)),t.on(p.mousewheel.event,F),p.params.mousewheelControl=!0,!0},p.parallax={setTranslate:function(){p.container.children("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each((function(){B(this,p.progress)})),p.slides.each((function(){var t=i(this);t.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each((function(){B(this,Math.min(Math.max(t[0].progress,-1),1))}))}))},setTransition:function(t){void 0===t&&(t=p.params.speed),p.container.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each((function(){var e=i(this),n=parseInt(e.attr("data-swiper-parallax-duration"),10)||t;0===t&&(n=0),e.transition(n)}))}},p.zoom={scale:1,currentScale:1,isScaling:!1,gesture:{slide:void 0,slideWidth:void 0,slideHeight:void 0,image:void 0,imageWrap:void 0,zoomMax:p.params.zoomMax},image:{isTouched:void 0,isMoved:void 0,currentX:void 0,currentY:void 0,minX:void 0,minY:void 0,maxX:void 0,maxY:void 0,width:void 0,height:void 0,startX:void 0,startY:void 0,touchesStart:{},touchesCurrent:{}},velocity:{x:void 0,y:void 0,prevPositionX:void 0,prevPositionY:void 0,prevTime:void 0},getDistanceBetweenTouches:function(t){if(t.targetTouches.length<2)return 1;var e=t.targetTouches[0].pageX,i=t.targetTouches[0].pageY,n=t.targetTouches[1].pageX,r=t.targetTouches[1].pageY;return Math.sqrt(Math.pow(n-e,2)+Math.pow(r-i,2))},onGestureStart:function(t){var e=p.zoom;if(!p.support.gestures){if("touchstart"!==t.type||"touchstart"===t.type&&t.targetTouches.length<2)return;e.gesture.scaleStart=e.getDistanceBetweenTouches(t)}e.gesture.slide&&e.gesture.slide.length||(e.gesture.slide=i(this),0===e.gesture.slide.length&&(e.gesture.slide=p.slides.eq(p.activeIndex)),e.gesture.image=e.gesture.slide.find("img, svg, canvas"),e.gesture.imageWrap=e.gesture.image.parent("."+p.params.zoomContainerClass),e.gesture.zoomMax=e.gesture.imageWrap.attr("data-swiper-zoom")||p.params.zoomMax,0!==e.gesture.imageWrap.length)?(e.gesture.image.transition(0),e.isScaling=!0):e.gesture.image=void 0},onGestureChange:function(t){var e=p.zoom;if(!p.support.gestures){if("touchmove"!==t.type||"touchmove"===t.type&&t.targetTouches.length<2)return;e.gesture.scaleMove=e.getDistanceBetweenTouches(t)}e.gesture.image&&0!==e.gesture.image.length&&(p.support.gestures?e.scale=t.scale*e.currentScale:e.scale=e.gesture.scaleMove/e.gesture.scaleStart*e.currentScale,e.scale>e.gesture.zoomMax&&(e.scale=e.gesture.zoomMax-1+Math.pow(e.scale-e.gesture.zoomMax+1,.5)),e.scale<p.params.zoomMin&&(e.scale=p.params.zoomMin+1-Math.pow(p.params.zoomMin-e.scale+1,.5)),e.gesture.image.transform("translate3d(0,0,0) scale("+e.scale+")"))},onGestureEnd:function(t){var e=p.zoom;!p.support.gestures&&("touchend"!==t.type||"touchend"===t.type&&t.changedTouches.length<2)||e.gesture.image&&0!==e.gesture.image.length&&(e.scale=Math.max(Math.min(e.scale,e.gesture.zoomMax),p.params.zoomMin),e.gesture.image.transition(p.params.speed).transform("translate3d(0,0,0) scale("+e.scale+")"),e.currentScale=e.scale,e.isScaling=!1,1===e.scale&&(e.gesture.slide=void 0))},onTouchStart:function(t,e){var i=t.zoom;i.gesture.image&&0!==i.gesture.image.length&&(i.image.isTouched||("android"===t.device.os&&e.preventDefault(),i.image.isTouched=!0,i.image.touchesStart.x="touchstart"===e.type?e.targetTouches[0].pageX:e.pageX,i.image.touchesStart.y="touchstart"===e.type?e.targetTouches[0].pageY:e.pageY))},onTouchMove:function(t){var e=p.zoom;if(e.gesture.image&&0!==e.gesture.image.length&&(p.allowClick=!1,e.image.isTouched&&e.gesture.slide)){e.image.isMoved||(e.image.width=e.gesture.image[0].offsetWidth,e.image.height=e.gesture.image[0].offsetHeight,e.image.startX=p.getTranslate(e.gesture.imageWrap[0],"x")||0,e.image.startY=p.getTranslate(e.gesture.imageWrap[0],"y")||0,e.gesture.slideWidth=e.gesture.slide[0].offsetWidth,e.gesture.slideHeight=e.gesture.slide[0].offsetHeight,e.gesture.imageWrap.transition(0),p.rtl&&(e.image.startX=-e.image.startX),p.rtl&&(e.image.startY=-e.image.startY));var i=e.image.width*e.scale,n=e.image.height*e.scale;if(!(i<e.gesture.slideWidth&&n<e.gesture.slideHeight)){if(e.image.minX=Math.min(e.gesture.slideWidth/2-i/2,0),e.image.maxX=-e.image.minX,e.image.minY=Math.min(e.gesture.slideHeight/2-n/2,0),e.image.maxY=-e.image.minY,e.image.touchesCurrent.x="touchmove"===t.type?t.targetTouches[0].pageX:t.pageX,e.image.touchesCurrent.y="touchmove"===t.type?t.targetTouches[0].pageY:t.pageY,!e.image.isMoved&&!e.isScaling){if(p.isHorizontal()&&Math.floor(e.image.minX)===Math.floor(e.image.startX)&&e.image.touchesCurrent.x<e.image.touchesStart.x||Math.floor(e.image.maxX)===Math.floor(e.image.startX)&&e.image.touchesCurrent.x>e.image.touchesStart.x)return void(e.image.isTouched=!1);if(!p.isHorizontal()&&Math.floor(e.image.minY)===Math.floor(e.image.startY)&&e.image.touchesCurrent.y<e.image.touchesStart.y||Math.floor(e.image.maxY)===Math.floor(e.image.startY)&&e.image.touchesCurrent.y>e.image.touchesStart.y)return void(e.image.isTouched=!1)}t.preventDefault(),t.stopPropagation(),e.image.isMoved=!0,e.image.currentX=e.image.touchesCurrent.x-e.image.touchesStart.x+e.image.startX,e.image.currentY=e.image.touchesCurrent.y-e.image.touchesStart.y+e.image.startY,e.image.currentX<e.image.minX&&(e.image.currentX=e.image.minX+1-Math.pow(e.image.minX-e.image.currentX+1,.8)),e.image.currentX>e.image.maxX&&(e.image.currentX=e.image.maxX-1+Math.pow(e.image.currentX-e.image.maxX+1,.8)),e.image.currentY<e.image.minY&&(e.image.currentY=e.image.minY+1-Math.pow(e.image.minY-e.image.currentY+1,.8)),e.image.currentY>e.image.maxY&&(e.image.currentY=e.image.maxY-1+Math.pow(e.image.currentY-e.image.maxY+1,.8)),e.velocity.prevPositionX||(e.velocity.prevPositionX=e.image.touchesCurrent.x),e.velocity.prevPositionY||(e.velocity.prevPositionY=e.image.touchesCurrent.y),e.velocity.prevTime||(e.velocity.prevTime=Date.now()),e.velocity.x=(e.image.touchesCurrent.x-e.velocity.prevPositionX)/(Date.now()-e.velocity.prevTime)/2,e.velocity.y=(e.image.touchesCurrent.y-e.velocity.prevPositionY)/(Date.now()-e.velocity.prevTime)/2,Math.abs(e.image.touchesCurrent.x-e.velocity.prevPositionX)<2&&(e.velocity.x=0),Math.abs(e.image.touchesCurrent.y-e.velocity.prevPositionY)<2&&(e.velocity.y=0),e.velocity.prevPositionX=e.image.touchesCurrent.x,e.velocity.prevPositionY=e.image.touchesCurrent.y,e.velocity.prevTime=Date.now(),e.gesture.imageWrap.transform("translate3d("+e.image.currentX+"px, "+e.image.currentY+"px,0)")}}},onTouchEnd:function(t,e){var i=t.zoom;if(i.gesture.image&&0!==i.gesture.image.length){if(!i.image.isTouched||!i.image.isMoved)return i.image.isTouched=!1,void(i.image.isMoved=!1);i.image.isTouched=!1,i.image.isMoved=!1;var n=300,r=300,o=i.velocity.x*n,a=i.image.currentX+o,s=i.velocity.y*r,l=i.image.currentY+s;0!==i.velocity.x&&(n=Math.abs((a-i.image.currentX)/i.velocity.x)),0!==i.velocity.y&&(r=Math.abs((l-i.image.currentY)/i.velocity.y));var u=Math.max(n,r);i.image.currentX=a,i.image.currentY=l;var h=i.image.width*i.scale,c=i.image.height*i.scale;i.image.minX=Math.min(i.gesture.slideWidth/2-h/2,0),i.image.maxX=-i.image.minX,i.image.minY=Math.min(i.gesture.slideHeight/2-c/2,0),i.image.maxY=-i.image.minY,i.image.currentX=Math.max(Math.min(i.image.currentX,i.image.maxX),i.image.minX),i.image.currentY=Math.max(Math.min(i.image.currentY,i.image.maxY),i.image.minY),i.gesture.imageWrap.transition(u).transform("translate3d("+i.image.currentX+"px, "+i.image.currentY+"px,0)")}},onTransitionEnd:function(t){var e=t.zoom;e.gesture.slide&&t.previousIndex!==t.activeIndex&&(e.gesture.image.transform("translate3d(0,0,0) scale(1)"),e.gesture.imageWrap.transform("translate3d(0,0,0)"),e.gesture.slide=e.gesture.image=e.gesture.imageWrap=void 0,e.scale=e.currentScale=1)},toggleZoom:function(t,e){var n,r,o,a,s,l,u,h,c,d,p,f,m,g,v,y,b=t.zoom;(b.gesture.slide||(b.gesture.slide=t.clickedSlide?i(t.clickedSlide):t.slides.eq(t.activeIndex),b.gesture.image=b.gesture.slide.find("img, svg, canvas"),b.gesture.imageWrap=b.gesture.image.parent("."+t.params.zoomContainerClass)),b.gesture.image&&0!==b.gesture.image.length)&&(void 0===b.image.touchesStart.x&&e?(n="touchend"===e.type?e.changedTouches[0].pageX:e.pageX,r="touchend"===e.type?e.changedTouches[0].pageY:e.pageY):(n=b.image.touchesStart.x,r=b.image.touchesStart.y),b.scale&&1!==b.scale?(b.scale=b.currentScale=1,b.gesture.imageWrap.transition(300).transform("translate3d(0,0,0)"),b.gesture.image.transition(300).transform("translate3d(0,0,0) scale(1)"),b.gesture.slide=void 0):(b.scale=b.currentScale=b.gesture.imageWrap.attr("data-swiper-zoom")||t.params.zoomMax,e?(v=b.gesture.slide[0].offsetWidth,y=b.gesture.slide[0].offsetHeight,o=b.gesture.slide.offset().left+v/2-n,a=b.gesture.slide.offset().top+y/2-r,u=b.gesture.image[0].offsetWidth,h=b.gesture.image[0].offsetHeight,c=u*b.scale,d=h*b.scale,m=-(p=Math.min(v/2-c/2,0)),g=-(f=Math.min(y/2-d/2,0)),(s=o*b.scale)<p&&(s=p),s>m&&(s=m),(l=a*b.scale)<f&&(l=f),l>g&&(l=g)):(s=0,l=0),b.gesture.imageWrap.transition(300).transform("translate3d("+s+"px, "+l+"px,0)"),b.gesture.image.transition(300).transform("translate3d(0,0,0) scale("+b.scale+")")))},attachEvents:function(t){var e=t?"off":"on";if(p.params.zoom){p.slides;var n=!("touchstart"!==p.touchEvents.start||!p.support.passiveListener||!p.params.passiveListeners)&&{passive:!0,capture:!1};p.support.gestures?(p.slides[e]("gesturestart",p.zoom.onGestureStart,n),p.slides[e]("gesturechange",p.zoom.onGestureChange,n),p.slides[e]("gestureend",p.zoom.onGestureEnd,n)):"touchstart"===p.touchEvents.start&&(p.slides[e](p.touchEvents.start,p.zoom.onGestureStart,n),p.slides[e](p.touchEvents.move,p.zoom.onGestureChange,n),p.slides[e](p.touchEvents.end,p.zoom.onGestureEnd,n)),p[e]("touchStart",p.zoom.onTouchStart),p.slides.each((function(t,n){i(n).find("."+p.params.zoomContainerClass).length>0&&i(n)[e](p.touchEvents.move,p.zoom.onTouchMove)})),p[e]("touchEnd",p.zoom.onTouchEnd),p[e]("transitionEnd",p.zoom.onTransitionEnd),p.params.zoomToggle&&p.on("doubleTap",p.zoom.toggleZoom)}},init:function(){p.zoom.attachEvents()},destroy:function(){p.zoom.attachEvents(!0)}},p._plugins=[],p.plugins){var L=p.plugins[D](p,p.params[D]);L&&p._plugins.push(L)}return p.callPlugins=function(t){for(var e=0;e<p._plugins.length;e++)t in p._plugins[e]&&p._plugins[e][t](arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])},p.emitterEventListeners={},p.emit=function(t){var e;if(p.params[t]&&p.params[t](arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),p.emitterEventListeners[t])for(e=0;e<p.emitterEventListeners[t].length;e++)p.emitterEventListeners[t][e](arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]);p.callPlugins&&p.callPlugins(t,arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])},p.on=function(t,e){return t=z(t),p.emitterEventListeners[t]||(p.emitterEventListeners[t]=[]),p.emitterEventListeners[t].push(e),p},p.off=function(t,e){var i;if(t=z(t),void 0===e)return p.emitterEventListeners[t]=[],p;if(p.emitterEventListeners[t]&&0!==p.emitterEventListeners[t].length){for(i=0;i<p.emitterEventListeners[t].length;i++)p.emitterEventListeners[t][i]===e&&p.emitterEventListeners[t].splice(i,1);return p}},p.once=function(t,e){t=z(t);var i=function(){e(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4]),p.off(t,i)};return p.on(t,i),p},p.a11y={makeFocusable:function(t){return t.attr("tabIndex","0"),t},addRole:function(t,e){return t.attr("role",e),t},addLabel:function(t,e){return t.attr("aria-label",e),t},disable:function(t){return t.attr("aria-disabled",!0),t},enable:function(t){return t.attr("aria-disabled",!1),t},onEnterKey:function(t){13===t.keyCode&&(i(t.target).is(p.params.nextButton)?(p.onClickNext(t),p.isEnd?p.a11y.notify(p.params.lastSlideMessage):p.a11y.notify(p.params.nextSlideMessage)):i(t.target).is(p.params.prevButton)&&(p.onClickPrev(t),p.isBeginning?p.a11y.notify(p.params.firstSlideMessage):p.a11y.notify(p.params.prevSlideMessage)),i(t.target).is("."+p.params.bulletClass)&&i(t.target)[0].click())},liveRegion:i('<span class="'+p.params.notificationClass+'" aria-live="assertive" aria-atomic="true"></span>'),notify:function(t){var e=p.a11y.liveRegion;0!==e.length&&(e.html(""),e.html(t))},init:function(){p.params.nextButton&&p.nextButton&&p.nextButton.length>0&&(p.a11y.makeFocusable(p.nextButton),p.a11y.addRole(p.nextButton,"button"),p.a11y.addLabel(p.nextButton,p.params.nextSlideMessage)),p.params.prevButton&&p.prevButton&&p.prevButton.length>0&&(p.a11y.makeFocusable(p.prevButton),p.a11y.addRole(p.prevButton,"button"),p.a11y.addLabel(p.prevButton,p.params.prevSlideMessage)),i(p.container).append(p.a11y.liveRegion)},initPagination:function(){p.params.pagination&&p.params.paginationClickable&&p.bullets&&p.bullets.length&&p.bullets.each((function(){var t=i(this);p.a11y.makeFocusable(t),p.a11y.addRole(t,"button"),p.a11y.addLabel(t,p.params.paginationBulletMessage.replace(/{{index}}/,t.index()+1))}))},destroy:function(){p.a11y.liveRegion&&p.a11y.liveRegion.length>0&&p.a11y.liveRegion.remove()}},p.init=function(){p.params.loop&&p.createLoop(),p.updateContainerSize(),p.updateSlidesSize(),p.updatePagination(),p.params.scrollbar&&p.scrollbar&&(p.scrollbar.set(),p.params.scrollbarDraggable&&p.scrollbar.enableDraggable()),"slide"!==p.params.effect&&p.effects[p.params.effect]&&(p.params.loop||p.updateProgress(),p.effects[p.params.effect].setTranslate()),p.params.loop?p.slideTo(p.params.initialSlide+p.loopedSlides,0,p.params.runCallbacksOnInit):(p.slideTo(p.params.initialSlide,0,p.params.runCallbacksOnInit),0===p.params.initialSlide&&(p.parallax&&p.params.parallax&&p.parallax.setTranslate(),p.lazy&&p.params.lazyLoading&&(p.lazy.load(),p.lazy.initialImageLoaded=!0))),p.attachEvents(),p.params.observer&&p.support.observer&&p.initObservers(),p.params.preloadImages&&!p.params.lazyLoading&&p.preloadImages(),p.params.zoom&&p.zoom&&p.zoom.init(),p.params.autoplay&&p.startAutoplay(),p.params.keyboardControl&&p.enableKeyboardControl&&p.enableKeyboardControl(),p.params.mousewheelControl&&p.enableMousewheelControl&&p.enableMousewheelControl(),p.params.hashnavReplaceState&&(p.params.replaceState=p.params.hashnavReplaceState),p.params.history&&p.history&&p.history.init(),p.params.hashnav&&p.hashnav&&p.hashnav.init(),p.params.a11y&&p.a11y&&p.a11y.init(),p.emit("onInit",p)},p.cleanupStyles=function(){p.container.removeClass(p.classNames.join(" ")).removeAttr("style"),p.wrapper.removeAttr("style"),p.slides&&p.slides.length&&p.slides.removeClass([p.params.slideVisibleClass,p.params.slideActiveClass,p.params.slideNextClass,p.params.slidePrevClass].join(" ")).removeAttr("style").removeAttr("data-swiper-column").removeAttr("data-swiper-row"),p.paginationContainer&&p.paginationContainer.length&&p.paginationContainer.removeClass(p.params.paginationHiddenClass),p.bullets&&p.bullets.length&&p.bullets.removeClass(p.params.bulletActiveClass),p.params.prevButton&&i(p.params.prevButton).removeClass(p.params.buttonDisabledClass),p.params.nextButton&&i(p.params.nextButton).removeClass(p.params.buttonDisabledClass),p.params.scrollbar&&p.scrollbar&&(p.scrollbar.track&&p.scrollbar.track.length&&p.scrollbar.track.removeAttr("style"),p.scrollbar.drag&&p.scrollbar.drag.length&&p.scrollbar.drag.removeAttr("style"))},p.destroy=function(t,e){p.detachEvents(),p.stopAutoplay(),p.params.scrollbar&&p.scrollbar&&p.params.scrollbarDraggable&&p.scrollbar.disableDraggable(),p.params.loop&&p.destroyLoop(),e&&p.cleanupStyles(),p.disconnectObservers(),p.params.zoom&&p.zoom&&p.zoom.destroy(),p.params.keyboardControl&&p.disableKeyboardControl&&p.disableKeyboardControl(),p.params.mousewheelControl&&p.disableMousewheelControl&&p.disableMousewheelControl(),p.params.a11y&&p.a11y&&p.a11y.destroy(),p.params.history&&!p.params.replaceState&&window.removeEventListener("popstate",p.history.setHistoryPopState),p.params.hashnav&&p.hashnav&&p.hashnav.destroy(),p.emit("onDestroy"),!1!==t&&(p=null)},p.init(),p}function O(t){return Math.floor(t)}function I(){var t=p.params.autoplay,e=p.slides.eq(p.activeIndex);e.attr("data-swiper-autoplay")&&(t=e.attr("data-swiper-autoplay")||p.params.autoplay),p.autoplayTimeoutId=setTimeout((function(){p.params.loop?(p.fixLoop(),p._slideNext(),p.emit("onAutoplay",p)):p.isEnd?n.autoplayStopOnLast?p.stopAutoplay():(p._slideTo(0),p.emit("onAutoplay",p)):(p._slideNext(),p.emit("onAutoplay",p))}),t)}function R(t,e){var n=i(t.target);if(!n.is(e))if("string"==typeof e)n=n.parents(e);else if(e.nodeType){var r;return n.parents().each((function(t,i){i===e&&(r=e)})),r?e:void 0}if(0!==n.length)return n[0]}function N(t,e){e=e||{};var i=new(window.MutationObserver||window.WebkitMutationObserver)((function(t){t.forEach((function(t){p.onResize(!0),p.emit("onObserverUpdate",p,t)}))}));i.observe(t,{attributes:void 0===e.attributes||e.attributes,childList:void 0===e.childList||e.childList,characterData:void 0===e.characterData||e.characterData}),p.observers.push(i)}function k(t){t.originalEvent&&(t=t.originalEvent);var e=t.keyCode||t.charCode;if(!p.params.allowSwipeToNext&&(p.isHorizontal()&&39===e||!p.isHorizontal()&&40===e))return!1;if(!p.params.allowSwipeToPrev&&(p.isHorizontal()&&37===e||!p.isHorizontal()&&38===e))return!1;if(!(t.shiftKey||t.altKey||t.ctrlKey||t.metaKey||document.activeElement&&document.activeElement.nodeName&&("input"===document.activeElement.nodeName.toLowerCase()||"textarea"===document.activeElement.nodeName.toLowerCase()))){if(37===e||39===e||38===e||40===e){var i=!1;if(p.container.parents("."+p.params.slideClass).length>0&&0===p.container.parents("."+p.params.slideActiveClass).length)return;var n={left:window.pageXOffset,top:window.pageYOffset},r=(window.renderWidth || window.innerWidth),o=(window.renderHeight || window.innerHeight),a=p.container.offset();p.rtl&&(a.left=a.left-p.container[0].scrollLeft);for(var s=[[a.left,a.top],[a.left+p.width,a.top],[a.left,a.top+p.height],[a.left+p.width,a.top+p.height]],l=0;l<s.length;l++){var u=s[l];u[0]>=n.left&&u[0]<=n.left+r&&u[1]>=n.top&&u[1]<=n.top+o&&(i=!0)}if(!i)return}p.isHorizontal()?(37!==e&&39!==e||(t.preventDefault?t.preventDefault():t.returnValue=!1),(39===e&&!p.rtl||37===e&&p.rtl)&&p.slideNext(),(37===e&&!p.rtl||39===e&&p.rtl)&&p.slidePrev()):(38!==e&&40!==e||(t.preventDefault?t.preventDefault():t.returnValue=!1),40===e&&p.slideNext(),38===e&&p.slidePrev()),p.emit("onKeyPress",p,e)}}function F(t){t.originalEvent&&(t=t.originalEvent);var e=0,i=p.rtl?-1:1,n=function(t){var e=0,i=0,n=0,r=0;return"detail"in t&&(i=t.detail),"wheelDelta"in t&&(i=-t.wheelDelta/120),"wheelDeltaY"in t&&(i=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=i,i=0),n=10*e,r=10*i,"deltaY"in t&&(r=t.deltaY),"deltaX"in t&&(n=t.deltaX),(n||r)&&t.deltaMode&&(1===t.deltaMode?(n*=40,r*=40):(n*=800,r*=800)),n&&!e&&(e=n<1?-1:1),r&&!i&&(i=r<1?-1:1),{spinX:e,spinY:i,pixelX:n,pixelY:r}}(t);if(p.params.mousewheelForceToAxis)if(p.isHorizontal()){if(!(Math.abs(n.pixelX)>Math.abs(n.pixelY)))return;e=n.pixelX*i}else{if(!(Math.abs(n.pixelY)>Math.abs(n.pixelX)))return;e=n.pixelY}else e=Math.abs(n.pixelX)>Math.abs(n.pixelY)?-n.pixelX*i:-n.pixelY;if(0!==e){if(p.params.mousewheelInvert&&(e=-e),p.params.freeMode){var r=p.getWrapperTranslate()+e*p.params.mousewheelSensitivity,o=p.isBeginning,a=p.isEnd;if(r>=p.minTranslate()&&(r=p.minTranslate()),r<=p.maxTranslate()&&(r=p.maxTranslate()),p.setWrapperTransition(0),p.setWrapperTranslate(r),p.updateProgress(),p.updateActiveIndex(),(!o&&p.isBeginning||!a&&p.isEnd)&&p.updateClasses(),p.params.freeModeSticky?(clearTimeout(p.mousewheel.timeout),p.mousewheel.timeout=setTimeout((function(){p.slideReset()}),300)):p.params.lazyLoading&&p.lazy&&p.lazy.load(),p.emit("onScroll",p,t),p.params.autoplay&&p.params.autoplayDisableOnInteraction&&p.stopAutoplay(),0===r||r===p.maxTranslate())return}else{if((new window.Date).getTime()-p.mousewheel.lastScrollTime>60)if(e<0)if(p.isEnd&&!p.params.loop||p.animating){if(p.params.mousewheelReleaseOnEdges)return!0}else p.slideNext(),p.emit("onScroll",p,t);else if(p.isBeginning&&!p.params.loop||p.animating){if(p.params.mousewheelReleaseOnEdges)return!0}else p.slidePrev(),p.emit("onScroll",p,t);p.mousewheel.lastScrollTime=(new window.Date).getTime()}return t.preventDefault?t.preventDefault():t.returnValue=!1,!1}}function B(t,e){var n,r,o;t=i(t);var a=p.rtl?-1:1;n=t.attr("data-swiper-parallax")||"0",r=t.attr("data-swiper-parallax-x"),o=t.attr("data-swiper-parallax-y"),r||o?(r=r||"0",o=o||"0"):p.isHorizontal()?(r=n,o="0"):(o=n,r="0"),r=r.indexOf("%")>=0?parseInt(r,10)*e*a+"%":r*e*a+"px",o=o.indexOf("%")>=0?parseInt(o,10)*e+"%":o*e+"px",t.transform("translate3d("+r+", "+o+",0px)")}function z(t){return 0!==t.indexOf("on")&&(t=t[0]!==t[0].toUpperCase()?"on"+t[0].toUpperCase()+t.substring(1):"on"+t),t}};o.prototype={isSafari:(r=window.navigator.userAgent.toLowerCase(),r.indexOf("safari")>=0&&r.indexOf("chrome")<0&&r.indexOf("android")<0),isUiWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent),isArray:function(t){return"[object Array]"===Object.prototype.toString.apply(t)},browser:{ie:window.navigator.pointerEnabled||window.navigator.msPointerEnabled,ieTouch:window.navigator.msPointerEnabled&&window.navigator.msMaxTouchPoints>1||window.navigator.pointerEnabled&&window.navigator.maxTouchPoints>1,lteIE9:(n=document.createElement("div"),n.innerHTML="\x3c!--[if lte IE 9]><i></i><![endif]--\x3e",1===n.getElementsByTagName("i").length)},device:function(){var t=window.navigator.userAgent,e=t.match(/(Android);?[\s\/]+([\d.]+)?/),i=t.match(/(iPad).*OS\s([\d_]+)/),n=t.match(/(iPod)(.*OS\s([\d_]+))?/),r=!i&&t.match(/(iPhone\sOS|iOS)\s([\d_]+)/);return{ios:i||r||n,android:e}}(),support:{touch:window.Modernizr&&!0===Modernizr.touch||!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch),transforms3d:window.Modernizr&&!0===Modernizr.csstransforms3d||function(){var t=document.createElement("div").style;return"webkitPerspective"in t||"MozPerspective"in t||"OPerspective"in t||"MsPerspective"in t||"perspective"in t}(),flexbox:function(){for(var t=document.createElement("div").style,e="alignItems webkitAlignItems webkitBoxAlign msFlexAlign mozBoxAlign webkitFlexDirection msFlexDirection mozBoxDirection mozBoxOrient webkitBoxDirection webkitBoxOrient".split(" "),i=0;i<e.length;i++)if(e[i]in t)return!0}(),observer:"MutationObserver"in window||"WebkitMutationObserver"in window,passiveListener:function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveListener",null,e)}catch(t){}return t}(),gestures:"ongesturestart"in window},plugins:{}};for(var a,s=function(){var t=function(t){var e=0;for(e=0;e<t.length;e++)this[e]=t[e];return this.length=t.length,this},e=function(e,i){var n=[],r=0;if(e&&!i&&e instanceof t)return e;if(e)if("string"==typeof e){var o,a,s=e.trim();if(s.indexOf("<")>=0&&s.indexOf(">")>=0){var l="div";for(0===s.indexOf("<li")&&(l="ul"),0===s.indexOf("<tr")&&(l="tbody"),0!==s.indexOf("<td")&&0!==s.indexOf("<th")||(l="tr"),0===s.indexOf("<tbody")&&(l="table"),0===s.indexOf("<option")&&(l="select"),(a=document.createElement(l)).innerHTML=e,r=0;r<a.childNodes.length;r++)n.push(a.childNodes[r])}else for(o=i||"#"!==e[0]||e.match(/[ .<>:~]/)?(i||document).querySelectorAll(e):[document.getElementById(e.split("#")[1])],r=0;r<o.length;r++)o[r]&&n.push(o[r])}else if(e.nodeType||e===window||e===document)n.push(e);else if(e.length>0&&e[0].nodeType)for(r=0;r<e.length;r++)n.push(e[r]);return new t(n)};return t.prototype={addClass:function(t){if(void 0===t)return this;for(var e=t.split(" "),i=0;i<e.length;i++)for(var n=0;n<this.length;n++)this[n].classList.add(e[i]);return this},removeClass:function(t){for(var e=t.split(" "),i=0;i<e.length;i++)for(var n=0;n<this.length;n++)this[n].classList.remove(e[i]);return this},hasClass:function(t){return!!this[0]&&this[0].classList.contains(t)},toggleClass:function(t){for(var e=t.split(" "),i=0;i<e.length;i++)for(var n=0;n<this.length;n++)this[n].classList.toggle(e[i]);return this},attr:function(t,e){if(1===arguments.length&&"string"==typeof t)return this[0]?this[0].getAttribute(t):void 0;for(var i=0;i<this.length;i++)if(2===arguments.length)this[i].setAttribute(t,e);else for(var n in t)this[i][n]=t[n],this[i].setAttribute(n,t[n]);return this},removeAttr:function(t){for(var e=0;e<this.length;e++)this[e].removeAttribute(t);return this},data:function(t,e){if(void 0!==e){for(var i=0;i<this.length;i++){var n=this[i];n.dom7ElementDataStorage||(n.dom7ElementDataStorage={}),n.dom7ElementDataStorage[t]=e}return this}if(this[0]){var r=this[0].getAttribute("data-"+t);return r||(this[0].dom7ElementDataStorage&&t in this[0].dom7ElementDataStorage?this[0].dom7ElementDataStorage[t]:void 0)}},transform:function(t){for(var e=0;e<this.length;e++){var i=this[e].style;i.webkitTransform=i.MsTransform=i.msTransform=i.MozTransform=i.OTransform=i.transform=t}return this},transition:function(t){"string"!=typeof t&&(t+="ms");for(var e=0;e<this.length;e++){var i=this[e].style;i.webkitTransitionDuration=i.MsTransitionDuration=i.msTransitionDuration=i.MozTransitionDuration=i.OTransitionDuration=i.transitionDuration=t}return this},on:function(t,i,n,r){function o(t){var r=t.target;if(e(r).is(i))n.call(r,t);else for(var o=e(r).parents(),a=0;a<o.length;a++)e(o[a]).is(i)&&n.call(o[a],t)}var a,s,l=t.split(" ");for(a=0;a<this.length;a++)if("function"==typeof i||!1===i)for("function"==typeof i&&(n=arguments[1],r=arguments[2]||!1),s=0;s<l.length;s++)this[a].addEventListener(l[s],n,r);else for(s=0;s<l.length;s++)this[a].dom7LiveListeners||(this[a].dom7LiveListeners=[]),this[a].dom7LiveListeners.push({listener:n,liveListener:o}),this[a].addEventListener(l[s],o,r);return this},off:function(t,e,i,n){for(var r=t.split(" "),o=0;o<r.length;o++)for(var a=0;a<this.length;a++)if("function"==typeof e||!1===e)"function"==typeof e&&(i=arguments[1],n=arguments[2]||!1),this[a].removeEventListener(r[o],i,n);else if(this[a].dom7LiveListeners)for(var s=0;s<this[a].dom7LiveListeners.length;s++)this[a].dom7LiveListeners[s].listener===i&&this[a].removeEventListener(r[o],this[a].dom7LiveListeners[s].liveListener,n);return this},once:function(t,e,i,n){var r=this;function o(a){i(a),r.off(t,e,o,n)}"function"==typeof e&&(e=!1,i=arguments[1],n=arguments[2]),r.on(t,e,o,n)},trigger:function(t,e){for(var i=0;i<this.length;i++){var n;try{n=new window.CustomEvent(t,{detail:e,bubbles:!0,cancelable:!0})}catch(i){(n=document.createEvent("Event")).initEvent(t,!0,!0),n.detail=e}this[i].dispatchEvent(n)}return this},transitionEnd:function(t){var e,i=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],n=this;function r(o){if(o.target===this)for(t.call(this,o),e=0;e<i.length;e++)n.off(i[e],r)}if(t)for(e=0;e<i.length;e++)n.on(i[e],r);return this},width:function(){return this[0]===window?(window.renderWidth || window.innerWidth):this.length>0?parseFloat(this.css("width")):null},outerWidth:function(t){return this.length>0?t?this[0].offsetWidth+parseFloat(this.css("margin-right"))+parseFloat(this.css("margin-left")):this[0].offsetWidth:null},height:function(){return this[0]===window?(window.renderHeight || window.innerHeight):this.length>0?parseFloat(this.css("height")):null},outerHeight:function(t){return this.length>0?t?this[0].offsetHeight+parseFloat(this.css("margin-top"))+parseFloat(this.css("margin-bottom")):this[0].offsetHeight:null},offset:function(){if(this.length>0){var t=this[0],e=t.getBoundingClientRect(),i=document.body,n=t.clientTop||i.clientTop||0,r=t.clientLeft||i.clientLeft||0,o=window.pageYOffset||t.scrollTop,a=window.pageXOffset||t.scrollLeft;return{top:e.top+o-n,left:e.left+a-r}}return null},css:function(t,e){var i;if(1===arguments.length){if("string"!=typeof t){for(i=0;i<this.length;i++)for(var n in t)this[i].style[n]=t[n];return this}if(this[0])return window.getComputedStyle(this[0],null).getPropertyValue(t)}if(2===arguments.length&&"string"==typeof t){for(i=0;i<this.length;i++)this[i].style[t]=e;return this}return this},each:function(t){for(var e=0;e<this.length;e++)t.call(this[e],e,this[e]);return this},html:function(t){if(void 0===t)return this[0]?this[0].innerHTML:void 0;for(var e=0;e<this.length;e++)this[e].innerHTML=t;return this},text:function(t){if(void 0===t)return this[0]?this[0].textContent.trim():null;for(var e=0;e<this.length;e++)this[e].textContent=t;return this},is:function(i){if(!this[0])return!1;var n,r;if("string"==typeof i){var o=this[0];if(o===document)return i===document;if(o===window)return i===window;if(o.matches)return o.matches(i);if(o.webkitMatchesSelector)return o.webkitMatchesSelector(i);if(o.mozMatchesSelector)return o.mozMatchesSelector(i);if(o.msMatchesSelector)return o.msMatchesSelector(i);for(n=e(i),r=0;r<n.length;r++)if(n[r]===this[0])return!0;return!1}if(i===document)return this[0]===document;if(i===window)return this[0]===window;if(i.nodeType||i instanceof t){for(n=i.nodeType?[i]:i,r=0;r<n.length;r++)if(n[r]===this[0])return!0;return!1}return!1},index:function(){if(this[0]){for(var t=this[0],e=0;null!==(t=t.previousSibling);)1===t.nodeType&&e++;return e}},eq:function(e){if(void 0===e)return this;var i,n=this.length;return new t(e>n-1?[]:e<0?(i=n+e)<0?[]:[this[i]]:[this[e]])},append:function(e){var i,n;for(i=0;i<this.length;i++)if("string"==typeof e){var r=document.createElement("div");for(r.innerHTML=e;r.firstChild;)this[i].appendChild(r.firstChild)}else if(e instanceof t)for(n=0;n<e.length;n++)this[i].appendChild(e[n]);else this[i].appendChild(e);return this},prepend:function(e){var i,n;for(i=0;i<this.length;i++)if("string"==typeof e){var r=document.createElement("div");for(r.innerHTML=e,n=r.childNodes.length-1;n>=0;n--)this[i].insertBefore(r.childNodes[n],this[i].childNodes[0])}else if(e instanceof t)for(n=0;n<e.length;n++)this[i].insertBefore(e[n],this[i].childNodes[0]);else this[i].insertBefore(e,this[i].childNodes[0]);return this},insertBefore:function(t){for(var i=e(t),n=0;n<this.length;n++)if(1===i.length)i[0].parentNode.insertBefore(this[n],i[0]);else if(i.length>1)for(var r=0;r<i.length;r++)i[r].parentNode.insertBefore(this[n].cloneNode(!0),i[r])},insertAfter:function(t){for(var i=e(t),n=0;n<this.length;n++)if(1===i.length)i[0].parentNode.insertBefore(this[n],i[0].nextSibling);else if(i.length>1)for(var r=0;r<i.length;r++)i[r].parentNode.insertBefore(this[n].cloneNode(!0),i[r].nextSibling)},next:function(i){return this.length>0?i?this[0].nextElementSibling&&e(this[0].nextElementSibling).is(i)?new t([this[0].nextElementSibling]):new t([]):this[0].nextElementSibling?new t([this[0].nextElementSibling]):new t([]):new t([])},nextAll:function(i){var n=[],r=this[0];if(!r)return new t([]);for(;r.nextElementSibling;){var o=r.nextElementSibling;i?e(o).is(i)&&n.push(o):n.push(o),r=o}return new t(n)},prev:function(i){return this.length>0?i?this[0].previousElementSibling&&e(this[0].previousElementSibling).is(i)?new t([this[0].previousElementSibling]):new t([]):this[0].previousElementSibling?new t([this[0].previousElementSibling]):new t([]):new t([])},prevAll:function(i){var n=[],r=this[0];if(!r)return new t([]);for(;r.previousElementSibling;){var o=r.previousElementSibling;i?e(o).is(i)&&n.push(o):n.push(o),r=o}return new t(n)},parent:function(t){for(var i=[],n=0;n<this.length;n++)t?e(this[n].parentNode).is(t)&&i.push(this[n].parentNode):i.push(this[n].parentNode);return e(e.unique(i))},parents:function(t){for(var i=[],n=0;n<this.length;n++)for(var r=this[n].parentNode;r;)t?e(r).is(t)&&i.push(r):i.push(r),r=r.parentNode;return e(e.unique(i))},find:function(e){for(var i=[],n=0;n<this.length;n++)for(var r=this[n].querySelectorAll(e),o=0;o<r.length;o++)i.push(r[o]);return new t(i)},children:function(i){for(var n=[],r=0;r<this.length;r++)for(var o=this[r].childNodes,a=0;a<o.length;a++)i?1===o[a].nodeType&&e(o[a]).is(i)&&n.push(o[a]):1===o[a].nodeType&&n.push(o[a]);return new t(e.unique(n))},remove:function(){for(var t=0;t<this.length;t++)this[t].parentNode&&this[t].parentNode.removeChild(this[t]);return this},add:function(){var t,i,n=this;for(t=0;t<arguments.length;t++){var r=e(arguments[t]);for(i=0;i<r.length;i++)n[n.length]=r[i],n.length++}return n}},e.fn=t.prototype,e.unique=function(t){for(var e=[],i=0;i<t.length;i++)-1===e.indexOf(t[i])&&e.push(t[i]);return e},e}(),l=["jQuery","Zepto","Dom7"],u=0;u<l.length;u++)window[l[u]]&&h(window[l[u]]);function h(t){t.fn.swiper=function(e){var i;return t(this).each((function(){var t=new o(this,e);i||(i=t)})),i}}(a=void 0===s?window.Dom7||window.Zepto||window.jQuery:s)&&("transitionEnd"in a.fn||(a.fn.transitionEnd=function(t){var e,i=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],n=this;function r(o){if(o.target===this)for(t.call(this,o),e=0;e<i.length;e++)n.off(i[e],r)}if(t)for(e=0;e<i.length;e++)n.on(i[e],r);return this}),"transform"in a.fn||(a.fn.transform=function(t){for(var e=0;e<this.length;e++){var i=this[e].style;i.webkitTransform=i.MsTransform=i.msTransform=i.MozTransform=i.OTransform=i.transform=t}return this}),"transition"in a.fn||(a.fn.transition=function(t){"string"!=typeof t&&(t+="ms");for(var e=0;e<this.length;e++){var i=this[e].style;i.webkitTransitionDuration=i.MsTransitionDuration=i.msTransitionDuration=i.MozTransitionDuration=i.OTransitionDuration=i.transitionDuration=t}return this}),"outerWidth"in a.fn||(a.fn.outerWidth=function(t){return this.length>0?t?this[0].offsetWidth+parseFloat(this.css("margin-right"))+parseFloat(this.css("margin-left")):this[0].offsetWidth:null})),t.exports=o}).call(this,"/js/util/Swiper.js")}).call(this,i(6))},function(t,e){t.exports={Pic:1,Text:2,GIF:3}},function(t,e,i){(function(e){function n(){h.call(this),this.neighbourMap={},this.map=null}var r=i(0),o=i(7),a=i(1),s=i(19),l=i(161),u=new(i(2))(e),h=i(33),c=i(8);o.inherit(n,h),n.prototype.getIndex=function(t){return t.id},n.prototype.find=function(t,e){var i=o.filterAll(this.list,t);if(i.length>0)return e&&e.forEach((function(t){i=o.stableSort(i,t)})),i[0]},n.prototype.sortByScore=function(t,e){var i=o.filterAll(this.list,t);return i.length>0?i=i.map((function(t){return{pano:t,score:e.reduce((function(e,i){return e+i(t)}),0)}})).sort((function(t,e){return e.score-t.score})):null},n.prototype.lowestByScore=function(t,e,i){return this.findRankedByScore(0,t,e,i)},n.prototype.findRankedByScore=function(t,e,i,n){n&&(n.candidates=null,n.pano=null),t||(t=0);var r=this.sortByScore(e,i);return r&&0!==r.length&&t<r.length?(n&&(n.candidates=r,n.pano=r[t].pano),r[t].pano):null},n.prototype.showPanoScores=function(t){this.list.forEach((function(t){t.removeTextSprite()}));var e=6344768;t.forEach((function(t){t.pano.addTextSprite(t.score.toFixed(2),e),e=16428055}))},n.prototype.isNeighbour=function(t,e){return this.neighbourMap[t.id][e.id]},n.prototype.getNeighbours=function(t){return this.neighbourMap[t.id]},n.prototype.setNeighbour=function(t,e,i){return this.neighbourMap[t.id]||(this.neighbourMap[t.id]={}),this.neighbourMap[e.id]||(this.neighbourMap[e.id]={}),this.neighbourMap[t.id][t.id]=!0,this.neighbourMap[e.id][e.id]=!0,this.neighbourMap[t.id][e.id]=i,this.neighbourMap[e.id][t.id]=i,this.neighbourMap[t.id]},n.prototype.findClosest=function(t,e){var i=[s.filters.isPanoAligned()];return e&&i.push(s.filters.inDirection(t,e,.75)),this.find(i,[s.sortFunctions.distanceToPoint(t)])},n.prototype.dualNeighbors=function(t,e){var i,n=[];for(i in this.neighbourMap[t.id])this.neighbourMap[e.id][i]&&n.push(i);return n},n.prototype.populate_path_graph=function(){var t,e,i,n,o,a,s,l,h=Date.now(),c={},d=0,p=new r.Vector3(0,0,0);for(t=0;t<this.list.length;t++){for(e in s={},l=!1,i=(o=this.list[t]).neighbourPanos||o.findNeighourPanos())if(i[e]){a=this.index[e],p.copy(o.floorPosition),p.sub(a.floorPosition);var f=Math.sqrt(p.x*p.x+p.z*p.z),m=(Math.abs(p.y),Math.max(f,.01),Math.max(0,Math.abs(p.y)-.2));m>0?(m=Math.pow(4*m,2),f=Math.pow(f,2),n=Math.sqrt(m*m+f*f)):n=p.length(),s[a.id]=n,l=!0}l?c[o.id]=s:d+=1}this.map=c,u.info("graph ready in "+(Date.now()-h)+"ms, "+d+" had no neighbors")},n.prototype.aStarSearch=function(t,e){var i=Date.now(),n=new l({start:t,isEnd:function(t){return t===e},neighbor:function(t){var e=t.neighbourPanos||t.findNeighourPanos(),i=[];for(var n in e)i.push(this.index[n]);return i}.bind(this),distance:function(t,e){return this.map[t.id][e.id]}.bind(this),heuristic:function(t,e){return 1}.bind(this),hash:function(t){return t.id},timeout:5e3});if(u.debug("A* search in "+(Date.now()-i)+"ms"),"success"!==n.status)return u.debug("Did not find A* path from "+t+" to "+e),null;u.debug("Total cost "+n.cost.toPrecision(3)+", "+n.path.length+" steps");var r=[];return n.path.forEach((function(t){r.push(t.id)})),r},n.prototype.includeNodesNearPath=function(){var t=new r.Vector3,e=new r.Vector3,i=new r.Vector3,n=new r.Vector3,o=new r.Vector3,a=new r.Vector3,s=new r.Vector3,l=new r.Vector3,u=[],h=new r.Vector3,c=new r.Vector3;return function(r,d){if(r)for(var p=function(t,e,i){return o.copy(e).sub(t),o.dot(i)},f=function(t,e){return p(h,t.position,i)-p(h,e.position,i)},m=0;m<r.length-1;){var g=r[m],v=r[m+1],y=this.index[g],b=this.index[v];h.copy(y.position),c.copy(b.position),u.length=0,t.copy(c).sub(h),i.copy(t).normalize();for(var w=0;w<this.list.length;w++){var x=this.list[w];o.copy(x.position).sub(h);var M=o.dot(i);if(M>0)if(s.copy(i),s.multiplyScalar(M),a.copy(o),a.sub(s),a.length()<d)e.copy(t).negate(),n.copy(e).normalize(),l.copy(x.position).sub(c),l.dot(n)>0&&u.push(x)}if(u.length>0){u.sort(f);for(var T=r.length+u.length-1;T>=m+u.length;T--)r[T]=r[T-u.length];for(var S=0;S<u.length;S++)r[S+m+1]=u[S].id}m+=u.length+1}}}(),n.prototype.fadeMarkerOpacity=function(t,e){var i=void 0===t?a.panorama.markerOpacity:t,n=this.list.findIndex((function(t){return t.marker}));if(n>=0){var r=this.list[n].marker.material.opacity;if(r!==t){var o=i-r;c.trigger({func:function(t,e){var i=r+t*o;this.forEach((function(t){t.marker&&(t.marker.material.opacity=i)}))}.bind(this),duration:void 0===e?a.markerOpacityTransitionTime:e,name:"_fpm"})}}},n.prototype.update=function(t){this.forEach((function(e){e.update(t)}))},t.exports=n}).call(this,"/js/util/PanoramaCollection.js")},function(t,e,i){function n(t){if(void 0!==t.parent){var e=n(t.parent);return e.push(t.data),e}return[t.data]}function r(t){return t.toString()}function o(t,e){return t.f-e.f}var a=i(162),s=i(163),l=i(165);t.exports=function(t){void 0===t.timeout&&(t.timeout=1/0);var e=t.hash||r,i={data:t.start,g:0,h:t.heuristic(t.start)},u=i;i.f=i.h;var h=new a,c=new s(o),d=l();c.push(i),d.set(e(i.data),i);for(var p=new Date;c.size();){if(new Date-p>t.timeout)return{status:"timeout",cost:u.g,path:n(u)};var f=c.pop();if(d.delete(e(f.data)),t.isEnd(f.data)){var m=n(f);return{status:"success",cost:f.g,path:m}}h.add(e(f.data));for(var g=t.neighbor(f.data),v=0;v<g.length;v++){var y=g[v];if(!h.contains(e(y))){var b=f.g+t.distance(f.data,y),w=d.get(e(y)),x=!1;if(void 0===w)w={data:y},d.set(e(y),w);else{if(w.g<b)continue;x=!0}w.parent=f,w.g=b,w.h=t.heuristic(y),w.f=b+w.h,w.h<u.h&&(u=w),x?c.heapify():c.push(w)}}}return{status:"noPath",cost:u.g,path:n(u)}}},function(t,e,i){function n(t){if(this.set={},this.infContains=function(){return!0},"object"==typeof t)if(t instanceof Array)for(var e=0;e<t.length;e++)this.set[t[e]]=!0;else this.set=t;else if("function"==typeof t)this.infContains=t;else if(void 0!==t)throw new Error("set must be either an array or an object.")}t.exports=n,n.prototype.contains=function(t){return!!this.set[t]},n.prototype.has=n.prototype.contains,n.prototype.add=function(t){if(1==arguments.length)this.set[t]=!0;else for(var e=0;e<arguments.length;e++)this.set[arguments[e]]=!0},n.prototype.addAll=function(t){if("object"!=typeof t&&!(t instanceof Array))throw new Error("arr must be an array.");for(var e=0;e<t.length;e++)this.add(t[e])},n.prototype.remove=function(t){if(1==arguments.length)delete this.set[t];else for(var e=0;e<arguments.length;e++)delete this.set[arguments[e]]},n.prototype.delete=n.prototype.remove,n.prototype.clear=function(){this.set={}},n.prototype.size=function(){return Object.keys(this.set).length},n.prototype.toString=function(){return"{"+Object.keys(this.set).toString()+"}"},n.prototype.toArray=function(){return void 0===this.set?[]:Object.keys(this.set)},n.prototype["*values"]=n.prototype.toArray},function(t,e,i){t.exports=i(164)},function(t,e,i){var n,r,o;(function(){var i,a,s,l,u,h,c,d,p,f,m,g,v,y,b;s=Math.floor,f=Math.min,a=function(t,e){return t<e?-1:t>e?1:0},p=function(t,e,i,n,r){var o;if(null==i&&(i=0),null==r&&(r=a),i<0)throw new Error("lo must be non-negative");for(null==n&&(n=t.length);i<n;)r(e,t[o=s((i+n)/2)])<0?n=o:i=o+1;return[].splice.apply(t,[i,i-i].concat(e)),e},h=function(t,e,i){return null==i&&(i=a),t.push(e),y(t,0,t.length-1,i)},u=function(t,e){var i,n;return null==e&&(e=a),i=t.pop(),t.length?(n=t[0],t[0]=i,b(t,0,e)):n=i,n},d=function(t,e,i){var n;return null==i&&(i=a),n=t[0],t[0]=e,b(t,0,i),n},c=function(t,e,i){var n;return null==i&&(i=a),t.length&&i(t[0],e)<0&&(e=(n=[t[0],e])[0],t[0]=n[1],b(t,0,i)),e},l=function(t,e){var i,n,r,o,l,u;for(null==e&&(e=a),l=[],n=0,r=(o=function(){u=[];for(var e=0,i=s(t.length/2);0<=i?e<i:e>i;0<=i?e++:e--)u.push(e);return u}.apply(this).reverse()).length;n<r;n++)i=o[n],l.push(b(t,i,e));return l},v=function(t,e,i){var n;if(null==i&&(i=a),-1!==(n=t.indexOf(e)))return y(t,0,n,i),b(t,n,i)},m=function(t,e,i){var n,r,o,s,u;if(null==i&&(i=a),!(r=t.slice(0,e)).length)return r;for(l(r,i),o=0,s=(u=t.slice(e)).length;o<s;o++)n=u[o],c(r,n,i);return r.sort(i).reverse()},g=function(t,e,i){var n,r,o,s,h,c,d,m,g;if(null==i&&(i=a),10*e<=t.length){if(!(o=t.slice(0,e).sort(i)).length)return o;for(r=o[o.length-1],s=0,c=(d=t.slice(e)).length;s<c;s++)i(n=d[s],r)<0&&(p(o,n,0,null,i),o.pop(),r=o[o.length-1]);return o}for(l(t,i),g=[],h=0,m=f(e,t.length);0<=m?h<m:h>m;0<=m?++h:--h)g.push(u(t,i));return g},y=function(t,e,i,n){var r,o,s;for(null==n&&(n=a),r=t[i];i>e&&n(r,o=t[s=i-1>>1])<0;)t[i]=o,i=s;return t[i]=r},b=function(t,e,i){var n,r,o,s,l;for(null==i&&(i=a),r=t.length,l=e,o=t[e],n=2*e+1;n<r;)(s=n+1)<r&&!(i(t[n],t[s])<0)&&(n=s),t[e]=t[n],n=2*(e=n)+1;return t[e]=o,y(t,l,e,i)},i=function(){function t(t){this.cmp=null!=t?t:a,this.nodes=[]}return t.push=h,t.pop=u,t.replace=d,t.pushpop=c,t.heapify=l,t.updateItem=v,t.nlargest=m,t.nsmallest=g,t.prototype.push=function(t){return h(this.nodes,t,this.cmp)},t.prototype.pop=function(){return u(this.nodes,this.cmp)},t.prototype.peek=function(){return this.nodes[0]},t.prototype.contains=function(t){return-1!==this.nodes.indexOf(t)},t.prototype.replace=function(t){return d(this.nodes,t,this.cmp)},t.prototype.pushpop=function(t){return c(this.nodes,t,this.cmp)},t.prototype.heapify=function(){return l(this.nodes,this.cmp)},t.prototype.updateItem=function(t){return v(this.nodes,t,this.cmp)},t.prototype.clear=function(){return this.nodes=[]},t.prototype.empty=function(){return 0===this.nodes.length},t.prototype.size=function(){return this.nodes.length},t.prototype.clone=function(){var e;return(e=new t).nodes=this.nodes.slice(0),e},t.prototype.toArray=function(){return this.nodes.slice(0)},t.prototype.insert=t.prototype.push,t.prototype.top=t.prototype.peek,t.prototype.front=t.prototype.peek,t.prototype.has=t.prototype.contains,t.prototype.copy=t.prototype.clone,t}(),r=[],void 0===(o="function"==typeof(n=function(){return i})?n.apply(e,r):n)||(t.exports=o)}).call(this)},function(t,e,i){"use strict";var n=Object.prototype.hasOwnProperty;function r(t){return"~"+t}function o(t){return t.substring("~".length)}function a(t){if("string"!=typeof t)throw new TypeError("key must be a string.")}t.exports=function(t){var e=Object.create(null),i=0,s={};return function(t,e){for(var i in e)Object.defineProperty(t,i,{value:e[i],configurable:!0,writable:!0})}(s,{get:function(t,i){a(t);var n=r(t);return n in e?e[n]:i},set:function(t,n){a(t);var o=r(t);return o in e||++i,e[o]=n},has:function(t){return a(t),r(t)in e},delete:function(t){a(t);var n=r(t);return n in e&&(--i,delete e[n],!0)},clear:function(){e=Object.create(null),i=0},forEach:function(t,i){if("function"!=typeof t)throw new TypeError("`callback` must be a function");for(var r in e)if(n.call(e,r)){var a=o(r),l=e[r];t.call(i,l,a,s)}}}),Object.defineProperty(s,"size",{get:function(){return i},configurable:!0}),"object"==typeof t&&null!==t&&Object.keys(t).forEach((function(e){s.set(e,t[e])})),s}},function(t,e,i){(function(e){var n=(i(0),i(1),i(3),i(167)),r=new(i(2))(e);t.exports={getLoaders:function(t){return[["_50k",".dam",n],["",".dam",n]][t]},load:function(t,e,i,n,o){o=o||0;var a=this.getLoaders(o);if(a){var s=a[0],l=a[1],u=new a[2](t),h=G.url.model+"/model.nest",c=this;h?(r.debug("Trying "+s+l),u.load(h,e,i,(function(){c.load(t,e,i,n,++o)}))):(r.debug("Skipping "+l+", not available"),this.load(t,e,i,n,++o))}else n&&n("No suitable model file found...")}}}).call(this,"/js/loaders/ModelLoader.js")},function(t,e,i){(function(e,n){var r=i(0),o=i(46),a=i(2),s=(i(7),i(11)),l=i(45),u=new a(n);function h(t){this.urls=t;var i=e("bWVzc2FnZSBtZXNoZXMgew0KICAgIHJlcXVpcmVkIHN0cmluZyB2ZXJzaW9uID0gMTsNCiAgICByZXBlYXRlZCBibG9ja19kZWZhdWx0IGJsb2NrX2RlZmF1bHQgPSAyOw0KICAgIHJlcGVhdGVkIGJsb2NrX21vZGVsIGJsb2NrX21vZGVsID0gMzsNCiAgICByZXBlYXRlZCBibG9ja19jdXN0b21pemVkIGJsb2NrX2N1c3RvbWl6ZWQgPSA0Ow0KfQ0KDQptZXNzYWdlIHZlcnRpY2VzX3NpbXBsZSB7DQogICAgcmVwZWF0ZWQgZmxvYXQgdXYgPSAxIFtwYWNrZWQ9dHJ1ZV07DQogICAgcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMiBbcGFja2VkPXRydWVdOw0KfQ0KDQptZXNzYWdlIGZhY2VzX3NpbXBsZSB7DQogICAgcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOw0KfQ0KDQptZXNzYWdlIGJsb2NrX21vZGVsIHsNCiAgICBvcHRpb25hbCB2ZXJ0aWNlc19zaW1wbGUgdmVydGljZXMgPSAxOw0KICAgIG9wdGlvbmFsIGZhY2VzX3NpbXBsZSBmYWNlcyA9IDI7DQogICAgb3B0aW9uYWwgc3RyaW5nIGJsb2NrX25hbWUgPSAzOw0KICAgIG9wdGlvbmFsIHN0cmluZyB0eHRuYW1lID0gNDsNCn0NCg0KbWVzc2FnZSBibG9ja19kZWZhdWx0IHsNCiAgICByZXBlYXRlZCBibG9ja19kZWZhdWx0X3VuaXQgZGVmYXVsdF91bml0cyA9IDE7DQp9DQoNCm1lc3NhZ2UgYmxvY2tfZGVmYXVsdF91bml0IHsNCiAgICByZXF1aXJlZCBzdHJpbmcgdW5pdF9pZCA9IDE7DQogICAgb3B0aW9uYWwgdmVydGljZXNfc2ltcGxlIHZlcnRpY2VzID0gMjsNCiAgICBvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAzOw0KICAgIG9wdGlvbmFsIHN0cmluZyBibG9ja19kZXMgPSA0Ow0KICAgIG9wdGlvbmFsIHN0cmluZyB0eHRuYW1lID0gNTsNCn0NCg0KbWVzc2FnZSBibG9ja19jdXN0b21pemVkIHsNCiAgICByZXBlYXRlZCBibG9ja19jdXN0b21pemVkX3VuaXQgY3VzdG9taXplZF91bml0cyA9IDE7DQp9DQoNCm1lc3NhZ2UgYmxvY2tfY3VzdG9taXplZF91bml0IHsNCiAgICByZXF1aXJlZCBzdHJpbmcgdW5pdF9pZCA9IDE7DQogICAgcmVxdWlyZWQgc3RyaW5nIHJlbGF0ZWRfaWQgPSAyOw0KICAgIG9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDM7DQogICAgb3B0aW9uYWwgZmFjZXNfc2ltcGxlIGZhY2VzID0gNDsNCiAgICBvcHRpb25hbCBzdHJpbmcgYmxvY2tfZGVzID0gNTsNCiAgICBvcHRpb25hbCBzdHJpbmcgdHh0bmFtZSA9IDY7DQp9DQo=","base64");this.decoder=o.loadProto(i).build("meshes")}window.dcodeIO&&(o=window.dcodeIO.ProtoBuf),h.prototype={constructor:h,load:function(t,e,i,n){return u.time("download"),s.get(t,{responseType:"arraybuffer"}).done(function(r){u.timeEnd("download"),this.parse(r,t,e,i,n)}.bind(this)).fail(n)},parse:function(t,e,i,n,r){var o=this.readProtobuf(t);if(!o)return r();try{u.time("convert to webgl"),this.convertProtobufToSceneObject(o,e,i,n,r),u.timeEnd("convert to webgl")}catch(t){return u.error("failed parsing .dam"),u.error(t.message),r()}},readProtobuf:function(t){var e;try{u.time("parse proto"),e=this.decoder.decode(t),u.timeEnd("parse proto")}catch(t){return u.error("failed parsing proto for .dam"),u.error(t.message),null}return e},convertProtobufToSceneObject:function(t,e,i,n,o){if(0===t.block_model.length)return u.warn("No chunks in damfile..."),i([]);var a=new r.Matrix4;a.set(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1);var s=t.block_model.map((function(t){var i=new r.BufferGeometry;return i.addAttribute("position",new r.BufferAttribute(new Float32Array(t.vertices.xyz,0,3),3)),t.vertices.uv.length>0&&i.addAttribute("uv",new r.BufferAttribute(new Float32Array(t.vertices.uv,0,2),2)),i.setIndex(new r.BufferAttribute(new Uint32Array(t.faces.faces,0,1),1)),i.applyMatrix(a),i.computeBoundingBox(),new l({geometry:i,textureName:t.txtname,name:t.block_name,meshUrl:e})}));return s?i(s):(u.error("no blocks..."),o())}},t.exports=h}).call(this,i(47).Buffer,"/js/loaders/DamLoader.js")},function(t,e,i){var n,r,o;r=[i(169)],void 0===(o="function"==typeof(n=function(t){"use strict";var e=function(t,i,r){if(void 0===t&&(t=e.DEFAULT_CAPACITY),void 0===i&&(i=e.DEFAULT_ENDIAN),void 0===r&&(r=e.DEFAULT_NOASSERT),!r){if((t|=0)<0)throw RangeError("Illegal capacity");i=!!i,r=!!r}this.buffer=0===t?n:new ArrayBuffer(t),this.view=0===t?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=t,this.littleEndian=i,this.noAssert=r};e.VERSION="5.0.1",e.LITTLE_ENDIAN=!0,e.BIG_ENDIAN=!1,e.DEFAULT_CAPACITY=16,e.DEFAULT_ENDIAN=e.BIG_ENDIAN,e.DEFAULT_NOASSERT=!1,e.Long=t||null;var i=e.prototype;i.__isByteBuffer__,Object.defineProperty(i,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var n=new ArrayBuffer(0),r=String.fromCharCode;function o(t){var e=0;return function(){return e<t.length?t.charCodeAt(e++):null}}function a(){var t=[],e=[];return function(){if(0===arguments.length)return e.join("")+r.apply(String,t);t.length+arguments.length>1024&&(e.push(r.apply(String,t)),t.length=0),Array.prototype.push.apply(t,arguments)}}function s(t,e,i,n,r){var o,a,s=8*r-n-1,l=(1<<s)-1,u=l>>1,h=-7,c=i?r-1:0,d=i?-1:1,p=t[e+c];for(c+=d,o=p&(1<<-h)-1,p>>=-h,h+=s;h>0;o=256*o+t[e+c],c+=d,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=256*a+t[e+c],c+=d,h-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=u}return(p?-1:1)*a*Math.pow(2,o-n)}function l(t,e,i,n,r,o){var a,s,l,u=8*o-r-1,h=(1<<u)-1,c=h>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,f=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+c>=1?d/l:d*Math.pow(2,1-c))*l>=2&&(a++,l/=2),a+c>=h?(s=0,a=h):a+c>=1?(s=(e*l-1)*Math.pow(2,r),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,r),a=0));r>=8;t[i+p]=255&s,p+=f,s/=256,r-=8);for(a=a<<r|s,u+=r;u>0;t[i+p]=255&a,p+=f,a/=256,u-=8);t[i+p-f]|=128*m}e.accessor=function(){return Uint8Array},e.allocate=function(t,i,n){return new e(t,i,n)},e.concat=function(t,i,n,r){"boolean"!=typeof i&&"string"==typeof i||(r=n,n=i,i=void 0);for(var o,a=0,s=0,l=t.length;s<l;++s)e.isByteBuffer(t[s])||(t[s]=e.wrap(t[s],i)),(o=t[s].limit-t[s].offset)>0&&(a+=o);if(0===a)return new e(0,n,r);var u,h=new e(a,n,r);for(s=0;s<l;)(o=(u=t[s++]).limit-u.offset)<=0||(h.view.set(u.view.subarray(u.offset,u.limit),h.offset),h.offset+=o);return h.limit=h.offset,h.offset=0,h},e.isByteBuffer=function(t){return!0===(t&&t.__isByteBuffer__)},e.type=function(){return ArrayBuffer},e.wrap=function(t,n,r,o){if("string"!=typeof n&&(o=r,r=n,n=void 0),"string"==typeof t)switch(void 0===n&&(n="utf8"),n){case"base64":return e.fromBase64(t,r);case"hex":return e.fromHex(t,r);case"binary":return e.fromBinary(t,r);case"utf8":return e.fromUTF8(t,r);case"debug":return e.fromDebug(t,r);default:throw Error("Unsupported encoding: "+n)}if(null===t||"object"!=typeof t)throw TypeError("Illegal buffer");var a;if(e.isByteBuffer(t))return(a=i.clone.call(t)).markedOffset=-1,a;if(t instanceof Uint8Array)a=new e(0,r,o),t.length>0&&(a.buffer=t.buffer,a.offset=t.byteOffset,a.limit=t.byteOffset+t.byteLength,a.view=new Uint8Array(t.buffer));else if(t instanceof ArrayBuffer)a=new e(0,r,o),t.byteLength>0&&(a.buffer=t,a.offset=0,a.limit=t.byteLength,a.view=t.byteLength>0?new Uint8Array(t):null);else{if("[object Array]"!==Object.prototype.toString.call(t))throw TypeError("Illegal buffer");(a=new e(t.length,r,o)).limit=t.length;for(var s=0;s<t.length;++s)a.view[s]=t[s]}return a},i.writeBitSet=function(t,e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if(!(t instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var n,r=e,o=t.length,a=o>>3,s=0;for(e+=this.writeVarint32(o,e);a--;)n=1&!!t[s++]|(1&!!t[s++])<<1|(1&!!t[s++])<<2|(1&!!t[s++])<<3|(1&!!t[s++])<<4|(1&!!t[s++])<<5|(1&!!t[s++])<<6|(1&!!t[s++])<<7,this.writeByte(n,e++);if(s<o){var l=0;for(n=0;s<o;)n|=(1&!!t[s++])<<l++;this.writeByte(n,e++)}return i?(this.offset=e,this):e-r},i.readBitSet=function(t){var e=void 0===t;e&&(t=this.offset);var i,n=this.readVarint32(t),r=n.value,o=r>>3,a=0,s=[];for(t+=n.length;o--;)i=this.readByte(t++),s[a++]=!!(1&i),s[a++]=!!(2&i),s[a++]=!!(4&i),s[a++]=!!(8&i),s[a++]=!!(16&i),s[a++]=!!(32&i),s[a++]=!!(64&i),s[a++]=!!(128&i);if(a<r){var l=0;for(i=this.readByte(t++);a<r;)s[a++]=!!(i>>l++&1)}return e&&(this.offset=t),s},i.readBytes=function(t,e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+t>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+"+t+") <= "+this.buffer.byteLength)}var n=this.slice(e,e+t);return i&&(this.offset+=t),n},i.writeBytes=i.append,i.writeInt8=function(t,e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=1;var n=this.buffer.byteLength;return e>n&&this.resize((n*=2)>e?n:e),e-=1,this.view[e]=t,i&&(this.offset+=1),this},i.writeByte=i.writeInt8,i.readInt8=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var i=this.view[t];return 128==(128&i)&&(i=-(255-i+1)),e&&(this.offset+=1),i},i.readByte=i.readInt8,i.writeUint8=function(t,e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=1;var n=this.buffer.byteLength;return e>n&&this.resize((n*=2)>e?n:e),e-=1,this.view[e]=t,i&&(this.offset+=1),this},i.writeUInt8=i.writeUint8,i.readUint8=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var i=this.view[t];return e&&(this.offset+=1),i},i.readUInt8=i.readUint8,i.writeInt16=function(t,e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=2;var n=this.buffer.byteLength;return e>n&&this.resize((n*=2)>e?n:e),e-=2,this.littleEndian?(this.view[e+1]=(65280&t)>>>8,this.view[e]=255&t):(this.view[e]=(65280&t)>>>8,this.view[e+1]=255&t),i&&(this.offset+=2),this},i.writeShort=i.writeInt16,i.readInt16=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+2) <= "+this.buffer.byteLength)}var i=0;return this.littleEndian?(i=this.view[t],i|=this.view[t+1]<<8):(i=this.view[t]<<8,i|=this.view[t+1]),32768==(32768&i)&&(i=-(65535-i+1)),e&&(this.offset+=2),i},i.readShort=i.readInt16,i.writeUint16=function(t,e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=2;var n=this.buffer.byteLength;return e>n&&this.resize((n*=2)>e?n:e),e-=2,this.littleEndian?(this.view[e+1]=(65280&t)>>>8,this.view[e]=255&t):(this.view[e]=(65280&t)>>>8,this.view[e+1]=255&t),i&&(this.offset+=2),this},i.writeUInt16=i.writeUint16,i.readUint16=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+2) <= "+this.buffer.byteLength)}var i=0;return this.littleEndian?(i=this.view[t],i|=this.view[t+1]<<8):(i=this.view[t]<<8,i|=this.view[t+1]),e&&(this.offset+=2),i},i.readUInt16=i.readUint16,i.writeInt32=function(t,e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=4;var n=this.buffer.byteLength;return e>n&&this.resize((n*=2)>e?n:e),e-=4,this.littleEndian?(this.view[e+3]=t>>>24&255,this.view[e+2]=t>>>16&255,this.view[e+1]=t>>>8&255,this.view[e]=255&t):(this.view[e]=t>>>24&255,this.view[e+1]=t>>>16&255,this.view[e+2]=t>>>8&255,this.view[e+3]=255&t),i&&(this.offset+=4),this},i.writeInt=i.writeInt32,i.readInt32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var i=0;return this.littleEndian?(i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0),i|=0,e&&(this.offset+=4),i},i.readInt=i.readInt32,i.writeUint32=function(t,e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=4;var n=this.buffer.byteLength;return e>n&&this.resize((n*=2)>e?n:e),e-=4,this.littleEndian?(this.view[e+3]=t>>>24&255,this.view[e+2]=t>>>16&255,this.view[e+1]=t>>>8&255,this.view[e]=255&t):(this.view[e]=t>>>24&255,this.view[e+1]=t>>>16&255,this.view[e+2]=t>>>8&255,this.view[e+3]=255&t),i&&(this.offset+=4),this},i.writeUInt32=i.writeUint32,i.readUint32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var i=0;return this.littleEndian?(i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0):(i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0),e&&(this.offset+=4),i},i.readUInt32=i.readUint32,t&&(i.writeInt64=function(e,i){var n=void 0===i;if(n&&(i=this.offset),!this.noAssert){if("number"==typeof e)e=t.fromNumber(e);else if("string"==typeof e)e=t.fromString(e);else if(!(e&&e instanceof t))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=t.fromNumber(e):"string"==typeof e&&(e=t.fromString(e)),i+=8;var r=this.buffer.byteLength;i>r&&this.resize((r*=2)>i?r:i),i-=8;var o=e.low,a=e.high;return this.littleEndian?(this.view[i+3]=o>>>24&255,this.view[i+2]=o>>>16&255,this.view[i+1]=o>>>8&255,this.view[i]=255&o,i+=4,this.view[i+3]=a>>>24&255,this.view[i+2]=a>>>16&255,this.view[i+1]=a>>>8&255,this.view[i]=255&a):(this.view[i]=a>>>24&255,this.view[i+1]=a>>>16&255,this.view[i+2]=a>>>8&255,this.view[i+3]=255&a,i+=4,this.view[i]=o>>>24&255,this.view[i+1]=o>>>16&255,this.view[i+2]=o>>>8&255,this.view[i+3]=255&o),n&&(this.offset+=8),this},i.writeLong=i.writeInt64,i.readInt64=function(e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var n=0,r=0;this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0,e+=4,r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0,e+=4,n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0);var o=new t(n,r,!1);return i&&(this.offset+=8),o},i.readLong=i.readInt64,i.writeUint64=function(e,i){var n=void 0===i;if(n&&(i=this.offset),!this.noAssert){if("number"==typeof e)e=t.fromNumber(e);else if("string"==typeof e)e=t.fromString(e);else if(!(e&&e instanceof t))throw TypeError("Illegal value: "+e+" (not an integer or Long)");if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}"number"==typeof e?e=t.fromNumber(e):"string"==typeof e&&(e=t.fromString(e)),i+=8;var r=this.buffer.byteLength;i>r&&this.resize((r*=2)>i?r:i),i-=8;var o=e.low,a=e.high;return this.littleEndian?(this.view[i+3]=o>>>24&255,this.view[i+2]=o>>>16&255,this.view[i+1]=o>>>8&255,this.view[i]=255&o,i+=4,this.view[i+3]=a>>>24&255,this.view[i+2]=a>>>16&255,this.view[i+1]=a>>>8&255,this.view[i]=255&a):(this.view[i]=a>>>24&255,this.view[i+1]=a>>>16&255,this.view[i+2]=a>>>8&255,this.view[i+3]=255&a,i+=4,this.view[i]=o>>>24&255,this.view[i+1]=o>>>16&255,this.view[i+2]=o>>>8&255,this.view[i+3]=255&o),n&&(this.offset+=8),this},i.writeUInt64=i.writeUint64,i.readUint64=function(e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var n=0,r=0;this.littleEndian?(n=this.view[e+2]<<16,n|=this.view[e+1]<<8,n|=this.view[e],n+=this.view[e+3]<<24>>>0,e+=4,r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0,e+=4,n=this.view[e+1]<<16,n|=this.view[e+2]<<8,n|=this.view[e+3],n+=this.view[e]<<24>>>0);var o=new t(n,r,!0);return i&&(this.offset+=8),o},i.readUInt64=i.readUint64),i.writeFloat32=function(t,e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof t)throw TypeError("Illegal value: "+t+" (not a number)");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=4;var n=this.buffer.byteLength;return e>n&&this.resize((n*=2)>e?n:e),e-=4,l(this.view,t,e,this.littleEndian,23,4),i&&(this.offset+=4),this},i.writeFloat=i.writeFloat32,i.readFloat32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var i=s(this.view,t,this.littleEndian,23,4);return e&&(this.offset+=4),i},i.readFloat=i.readFloat32,i.writeFloat64=function(t,e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof t)throw TypeError("Illegal value: "+t+" (not a number)");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}e+=8;var n=this.buffer.byteLength;return e>n&&this.resize((n*=2)>e?n:e),e-=8,l(this.view,t,e,this.littleEndian,52,8),i&&(this.offset+=8),this},i.writeDouble=i.writeFloat64,i.readFloat64=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var i=s(this.view,t,this.littleEndian,52,8);return e&&(this.offset+=8),i},i.readDouble=i.readFloat64,e.MAX_VARINT32_BYTES=5,e.calculateVarint32=function(t){return(t>>>=0)<128?1:t<16384?2:t<1<<21?3:t<1<<28?4:5},e.zigZagEncode32=function(t){return((t|=0)<<1^t>>31)>>>0},e.zigZagDecode32=function(t){return t>>>1^-(1&t)|0},i.writeVarint32=function(t,i){var n=void 0===i;if(n&&(i=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}var r,o=e.calculateVarint32(t);i+=o;var a=this.buffer.byteLength;for(i>a&&this.resize((a*=2)>i?a:i),i-=o,t>>>=0;t>=128;)r=127&t|128,this.view[i++]=r,t>>>=7;return this.view[i++]=t,n?(this.offset=i,this):o},i.writeVarint32ZigZag=function(t,i){return this.writeVarint32(e.zigZagEncode32(t),i)},i.readVarint32=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var i,n=0,r=0;do{if(!this.noAssert&&t>this.limit){var o=Error("Truncated");throw o.truncated=!0,o}i=this.view[t++],n<5&&(r|=(127&i)<<7*n),++n}while(0!=(128&i));return r|=0,e?(this.offset=t,r):{value:r,length:n}},i.readVarint32ZigZag=function(t){var i=this.readVarint32(t);return"object"==typeof i?i.value=e.zigZagDecode32(i.value):i=e.zigZagDecode32(i),i},t&&(e.MAX_VARINT64_BYTES=10,e.calculateVarint64=function(e){"number"==typeof e?e=t.fromNumber(e):"string"==typeof e&&(e=t.fromString(e));var i=e.toInt()>>>0,n=e.shiftRightUnsigned(28).toInt()>>>0,r=e.shiftRightUnsigned(56).toInt()>>>0;return 0==r?0==n?i<16384?i<128?1:2:i<1<<21?3:4:n<16384?n<128?5:6:n<1<<21?7:8:r<128?9:10},e.zigZagEncode64=function(e){return"number"==typeof e?e=t.fromNumber(e,!1):"string"==typeof e?e=t.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned()),e.shiftLeft(1).xor(e.shiftRight(63)).toUnsigned()},e.zigZagDecode64=function(e){return"number"==typeof e?e=t.fromNumber(e,!1):"string"==typeof e?e=t.fromString(e,!1):!1!==e.unsigned&&(e=e.toSigned()),e.shiftRightUnsigned(1).xor(e.and(t.ONE).toSigned().negate()).toSigned()},i.writeVarint64=function(i,n){var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("number"==typeof i)i=t.fromNumber(i);else if("string"==typeof i)i=t.fromString(i);else if(!(i&&i instanceof t))throw TypeError("Illegal value: "+i+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}"number"==typeof i?i=t.fromNumber(i,!1):"string"==typeof i?i=t.fromString(i,!1):!1!==i.unsigned&&(i=i.toSigned());var o=e.calculateVarint64(i),a=i.toInt()>>>0,s=i.shiftRightUnsigned(28).toInt()>>>0,l=i.shiftRightUnsigned(56).toInt()>>>0;n+=o;var u=this.buffer.byteLength;switch(n>u&&this.resize((u*=2)>n?u:n),n-=o,o){case 10:this.view[n+9]=l>>>7&1;case 9:this.view[n+8]=9!==o?128|l:127&l;case 8:this.view[n+7]=8!==o?s>>>21|128:s>>>21&127;case 7:this.view[n+6]=7!==o?s>>>14|128:s>>>14&127;case 6:this.view[n+5]=6!==o?s>>>7|128:s>>>7&127;case 5:this.view[n+4]=5!==o?128|s:127&s;case 4:this.view[n+3]=4!==o?a>>>21|128:a>>>21&127;case 3:this.view[n+2]=3!==o?a>>>14|128:a>>>14&127;case 2:this.view[n+1]=2!==o?a>>>7|128:a>>>7&127;case 1:this.view[n]=1!==o?128|a:127&a}return r?(this.offset+=o,this):o},i.writeVarint64ZigZag=function(t,i){return this.writeVarint64(e.zigZagEncode64(t),i)},i.readVarint64=function(e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var n=e,r=0,o=0,a=0,s=0;if(r=127&(s=this.view[e++]),128&s&&(r|=(127&(s=this.view[e++]))<<7,(128&s||this.noAssert&&void 0===s)&&(r|=(127&(s=this.view[e++]))<<14,(128&s||this.noAssert&&void 0===s)&&(r|=(127&(s=this.view[e++]))<<21,(128&s||this.noAssert&&void 0===s)&&(o=127&(s=this.view[e++]),(128&s||this.noAssert&&void 0===s)&&(o|=(127&(s=this.view[e++]))<<7,(128&s||this.noAssert&&void 0===s)&&(o|=(127&(s=this.view[e++]))<<14,(128&s||this.noAssert&&void 0===s)&&(o|=(127&(s=this.view[e++]))<<21,(128&s||this.noAssert&&void 0===s)&&(a=127&(s=this.view[e++]),(128&s||this.noAssert&&void 0===s)&&(a|=(127&(s=this.view[e++]))<<7,128&s||this.noAssert&&void 0===s))))))))))throw Error("Buffer overrun");var l=t.fromBits(r|o<<28,o>>>4|a<<24,!1);return i?(this.offset=e,l):{value:l,length:e-n}},i.readVarint64ZigZag=function(i){var n=this.readVarint64(i);return n&&n.value instanceof t?n.value=e.zigZagDecode64(n.value):n=e.zigZagDecode64(n),n}),i.writeCString=function(t,e){var i=void 0===e;i&&(e=this.offset);var n,r=t.length;if(!this.noAssert){if("string"!=typeof t)throw TypeError("Illegal str: Not a string");for(n=0;n<r;++n)if(0===t.charCodeAt(n))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}r=h.calculateUTF16asUTF8(o(t))[1],e+=r+1;var a=this.buffer.byteLength;return e>a&&this.resize((a*=2)>e?a:e),e-=r+1,h.encodeUTF16toUTF8(o(t),function(t){this.view[e++]=t}.bind(this)),this.view[e++]=0,i?(this.offset=e,this):r},i.readCString=function(t){var e=void 0===t;if(e&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var i,n=t,r=-1;return h.decodeUTF8toUTF16(function(){if(0===r)return null;if(t>=this.limit)throw RangeError("Illegal range: Truncated data, "+t+" < "+this.limit);return 0===(r=this.view[t++])?null:r}.bind(this),i=a(),!0),e?(this.offset=t,i()):{string:i(),length:t-n}},i.writeIString=function(t,e){var i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("string"!=typeof t)throw TypeError("Illegal str: Not a string");if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var n,r=e;n=h.calculateUTF16asUTF8(o(t),this.noAssert)[1],e+=4+n;var a=this.buffer.byteLength;if(e>a&&this.resize((a*=2)>e?a:e),e-=4+n,this.littleEndian?(this.view[e+3]=n>>>24&255,this.view[e+2]=n>>>16&255,this.view[e+1]=n>>>8&255,this.view[e]=255&n):(this.view[e]=n>>>24&255,this.view[e+1]=n>>>16&255,this.view[e+2]=n>>>8&255,this.view[e+3]=255&n),e+=4,h.encodeUTF16toUTF8(o(t),function(t){this.view[e++]=t}.bind(this)),e!==r+4+n)throw RangeError("Illegal range: Truncated data, "+e+" == "+(e+4+n));return i?(this.offset=e,this):e-r},i.readIString=function(t){var i=void 0===t;if(i&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+4) <= "+this.buffer.byteLength)}var n=t,r=this.readUint32(t),o=this.readUTF8String(r,e.METRICS_BYTES,t+=4);return t+=o.length,i?(this.offset=t,o.string):{string:o.string,length:t-n}},e.METRICS_CHARS="c",e.METRICS_BYTES="b",i.writeUTF8String=function(t,e){var i,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}var r=e;i=h.calculateUTF16asUTF8(o(t))[1],e+=i;var a=this.buffer.byteLength;return e>a&&this.resize((a*=2)>e?a:e),e-=i,h.encodeUTF16toUTF8(o(t),function(t){this.view[e++]=t}.bind(this)),n?(this.offset=e,this):e-r},i.writeString=i.writeUTF8String,e.calculateUTF8Chars=function(t){return h.calculateUTF16asUTF8(o(t))[0]},e.calculateUTF8Bytes=function(t){return h.calculateUTF16asUTF8(o(t))[1]},e.calculateString=e.calculateUTF8Bytes,i.readUTF8String=function(t,i,n){"number"==typeof i&&(n=i,i=void 0);var r=void 0===n;if(r&&(n=this.offset),void 0===i&&(i=e.METRICS_CHARS),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal length: "+t+" (not an integer)");if(t|=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var o,s=0,l=n;if(i===e.METRICS_CHARS){if(o=a(),h.decodeUTF8(function(){return s<t&&n<this.limit?this.view[n++]:null}.bind(this),(function(t){++s,h.UTF8toUTF16(t,o)})),s!==t)throw RangeError("Illegal range: Truncated data, "+s+" == "+t);return r?(this.offset=n,o()):{string:o(),length:n-l}}if(i===e.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+t>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+"+t+") <= "+this.buffer.byteLength)}var u=n+t;if(h.decodeUTF8toUTF16(function(){return n<u?this.view[n++]:null}.bind(this),o=a(),this.noAssert),n!==u)throw RangeError("Illegal range: Truncated data, "+n+" == "+u);return r?(this.offset=n,o()):{string:o(),length:n-l}}throw TypeError("Unsupported metrics: "+i)},i.readString=i.readUTF8String,i.writeVString=function(t,i){var n=void 0===i;if(n&&(i=this.offset),!this.noAssert){if("string"!=typeof t)throw TypeError("Illegal str: Not a string");if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}var r,a,s=i;r=h.calculateUTF16asUTF8(o(t),this.noAssert)[1],a=e.calculateVarint32(r),i+=a+r;var l=this.buffer.byteLength;if(i>l&&this.resize((l*=2)>i?l:i),i-=a+r,i+=this.writeVarint32(r,i),h.encodeUTF16toUTF8(o(t),function(t){this.view[i++]=t}.bind(this)),i!==s+r+a)throw RangeError("Illegal range: Truncated data, "+i+" == "+(i+r+a));return n?(this.offset=i,this):i-s},i.readVString=function(t){var i=void 0===t;if(i&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var n=t,r=this.readVarint32(t),o=this.readUTF8String(r.value,e.METRICS_BYTES,t+=r.length);return t+=o.length,i?(this.offset=t,o.string):{string:o.string,length:t-n}},i.append=function(t,i,n){"number"!=typeof i&&"string"==typeof i||(n=i,i=void 0);var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}t instanceof e||(t=e.wrap(t,i));var o=t.limit-t.offset;if(o<=0)return this;n+=o;var a=this.buffer.byteLength;return n>a&&this.resize((a*=2)>n?a:n),n-=o,this.view.set(t.view.subarray(t.offset,t.limit),n),t.offset+=o,r&&(this.offset+=o),this},i.appendTo=function(t,e){return t.append(this,e),this},i.assert=function(t){return this.noAssert=!t,this},i.capacity=function(){return this.buffer.byteLength},i.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},i.clone=function(t){var i=new e(0,this.littleEndian,this.noAssert);return t?(i.buffer=new ArrayBuffer(this.buffer.byteLength),i.view=new Uint8Array(i.buffer)):(i.buffer=this.buffer,i.view=this.view),i.offset=this.offset,i.markedOffset=this.markedOffset,i.limit=this.limit,i},i.compact=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}if(0===t&&e===this.buffer.byteLength)return this;var i=e-t;if(0===i)return this.buffer=n,this.view=null,this.markedOffset>=0&&(this.markedOffset-=t),this.offset=0,this.limit=0,this;var r=new ArrayBuffer(i),o=new Uint8Array(r);return o.set(this.view.subarray(t,e)),this.buffer=r,this.view=o,this.markedOffset>=0&&(this.markedOffset-=t),this.offset=0,this.limit=i,this},i.copy=function(t,i){if(void 0===t&&(t=this.offset),void 0===i&&(i=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof i||i%1!=0)throw TypeError("Illegal end: Not an integer");if(i>>>=0,t<0||t>i||i>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+i+" <= "+this.buffer.byteLength)}if(t===i)return new e(0,this.littleEndian,this.noAssert);var n=i-t,r=new e(n,this.littleEndian,this.noAssert);return r.offset=0,r.limit=n,r.markedOffset>=0&&(r.markedOffset-=t),this.copyTo(r,0,t,i),r},i.copyTo=function(t,i,n,r){var o,a;if(!this.noAssert&&!e.isByteBuffer(t))throw TypeError("Illegal target: Not a ByteBuffer");if(i=(a=void 0===i)?t.offset:0|i,n=(o=void 0===n)?this.offset:0|n,r=void 0===r?this.limit:0|r,i<0||i>t.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+i+" <= "+t.buffer.byteLength);if(n<0||r>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);var s=r-n;return 0===s?t:(t.ensureCapacity(i+s),t.view.set(this.view.subarray(n,r),i),o&&(this.offset+=s),a&&(t.offset+=s),this)},i.ensureCapacity=function(t){var e=this.buffer.byteLength;return e<t?this.resize((e*=2)>t?e:t):this},i.fill=function(t,e,i){var n=void 0===e;if(n&&(e=this.offset),"string"==typeof t&&t.length>0&&(t=t.charCodeAt(0)),void 0===e&&(e=this.offset),void 0===i&&(i=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal value: "+t+" (not an integer)");if(t|=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof i||i%1!=0)throw TypeError("Illegal end: Not an integer");if(i>>>=0,e<0||e>i||i>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+i+" <= "+this.buffer.byteLength)}if(e>=i)return this;for(;e<i;)this.view[e++]=t;return n&&(this.offset=e),this},i.flip=function(){return this.limit=this.offset,this.offset=0,this},i.mark=function(t){if(t=void 0===t?this.offset:t,!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=t,this},i.order=function(t){if(!this.noAssert&&"boolean"!=typeof t)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!t,this},i.LE=function(t){return this.littleEndian=void 0===t||!!t,this},i.BE=function(t){return this.littleEndian=void 0!==t&&!t,this},i.prepend=function(t,i,n){"number"!=typeof i&&"string"==typeof i||(n=i,i=void 0);var r=void 0===n;if(r&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}t instanceof e||(t=e.wrap(t,i));var o=t.limit-t.offset;if(o<=0)return this;var a=o-n;if(a>0){var s=new ArrayBuffer(this.buffer.byteLength+a),l=new Uint8Array(s);l.set(this.view.subarray(n,this.buffer.byteLength),o),this.buffer=s,this.view=l,this.offset+=a,this.markedOffset>=0&&(this.markedOffset+=a),this.limit+=a,n+=a}else new Uint8Array(this.buffer);return this.view.set(t.view.subarray(t.offset,t.limit),n-o),t.offset=t.limit,r&&(this.offset-=o),this},i.prependTo=function(t,e){return t.prepend(this,e),this},i.printDebug=function(t){"function"!=typeof t&&(t=void 0),t(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},i.remaining=function(){return this.limit-this.offset},i.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},i.resize=function(t){if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal capacity: "+t+" (not an integer)");if((t|=0)<0)throw RangeError("Illegal capacity: 0 <= "+t)}if(this.buffer.byteLength<t){var e=new ArrayBuffer(t),i=new Uint8Array(e);i.set(this.view),this.buffer=e,this.view=i}return this},i.reverse=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}return t===e||Array.prototype.reverse.call(this.view.subarray(t,e)),this},i.skip=function(t){if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal length: "+t+" (not an integer)");t|=0}var e=this.offset+t;if(!this.noAssert&&(e<0||e>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+t+" <= "+this.buffer.byteLength);return this.offset=e,this},i.slice=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}var i=this.clone();return i.offset=t,i.limit=e,i},i.toBuffer=function(t){var e=this.offset,i=this.limit;if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: Not an integer");if(e>>>=0,"number"!=typeof i||i%1!=0)throw TypeError("Illegal limit: Not an integer");if(i>>>=0,e<0||e>i||i>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+i+" <= "+this.buffer.byteLength)}if(!t&&0===e&&i===this.buffer.byteLength)return this.buffer;if(e===i)return n;var r=new ArrayBuffer(i-e);return new Uint8Array(r).set(new Uint8Array(this.buffer).subarray(e,i),0),r},i.toArrayBuffer=i.toBuffer,i.toString=function(t,e,i){if(void 0===t)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof t&&(i=e=t="utf8"),t){case"utf8":return this.toUTF8(e,i);case"base64":return this.toBase64(e,i);case"hex":return this.toHex(e,i);case"binary":return this.toBinary(e,i);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+t)}};var u=function(){for(var t={},e=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],i=[],n=0,r=e.length;n<r;++n)i[e[n]]=n;return t.encode=function(t,i){for(var n,r;null!==(n=t());)i(e[n>>2&63]),r=(3&n)<<4,null!==(n=t())?(i(e[63&((r|=n>>4&15)|n>>4&15)]),r=(15&n)<<2,null!==(n=t())?(i(e[63&(r|n>>6&3)]),i(e[63&n])):(i(e[63&r]),i(61))):(i(e[63&r]),i(61),i(61))},t.decode=function(t,e){var n,r,o;function a(t){throw Error("Illegal character code: "+t)}for(;null!==(n=t());)if(void 0===(r=i[n])&&a(n),null!==(n=t())&&(void 0===(o=i[n])&&a(n),e(r<<2>>>0|(48&o)>>4),null!==(n=t()))){if(void 0===(r=i[n])){if(61===n)break;a(n)}if(e((15&o)<<4>>>0|(60&r)>>2),null!==(n=t())){if(void 0===(o=i[n])){if(61===n)break;a(n)}e((3&r)<<6>>>0|o)}}},t.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)},t}();i.toBase64=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),e|=0,(t|=0)<0||e>this.capacity||t>e)throw RangeError("begin, end");var i;return u.encode(function(){return t<e?this.view[t++]:null}.bind(this),i=a()),i()},e.fromBase64=function(t,i){if("string"!=typeof t)throw TypeError("str");var n=new e(t.length/4*3,i),r=0;return u.decode(o(t),(function(t){n.view[r++]=t})),n.limit=r,n},e.btoa=function(t){return e.fromBinary(t).toBase64()},e.atob=function(t){return e.fromBase64(t).toBinary()},i.toBinary=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),e|=0,(t|=0)<0||e>this.capacity()||t>e)throw RangeError("begin, end");if(t===e)return"";for(var i=[],n=[];t<e;)i.push(this.view[t++]),i.length>=1024&&(n.push(String.fromCharCode.apply(String,i)),i=[]);return n.join("")+String.fromCharCode.apply(String,i)},e.fromBinary=function(t,i){if("string"!=typeof t)throw TypeError("str");for(var n,r=0,o=t.length,a=new e(o,i);r<o;){if((n=t.charCodeAt(r))>255)throw RangeError("illegal char code: "+n);a.view[r++]=n}return a.limit=o,a},i.toDebug=function(t){for(var e,i=-1,n=this.buffer.byteLength,r="",o="",a="";i<n;){if(-1!==i&&(r+=(e=this.view[i])<16?"0"+e.toString(16).toUpperCase():e.toString(16).toUpperCase(),t&&(o+=e>32&&e<127?String.fromCharCode(e):".")),++i,t&&i>0&&i%16==0&&i!==n){for(;r.length<51;)r+=" ";a+=r+o+"\n",r=o=""}i===this.offset&&i===this.limit?r+=i===this.markedOffset?"!":"|":i===this.offset?r+=i===this.markedOffset?"[":"<":i===this.limit?r+=i===this.markedOffset?"]":">":r+=i===this.markedOffset?"'":t||0!==i&&i!==n?" ":""}if(t&&" "!==r){for(;r.length<51;)r+=" ";a+=r+o+"\n"}return t?a:r},e.fromDebug=function(t,i,n){for(var r,o,a=t.length,s=new e((a+1)/3|0,i,n),l=0,u=0,h=!1,c=!1,d=!1,p=!1,f=!1;l<a;){switch(r=t.charAt(l++)){case"!":if(!n){if(c||d||p){f=!0;break}c=d=p=!0}s.offset=s.markedOffset=s.limit=u,h=!1;break;case"|":if(!n){if(c||p){f=!0;break}c=p=!0}s.offset=s.limit=u,h=!1;break;case"[":if(!n){if(c||d){f=!0;break}c=d=!0}s.offset=s.markedOffset=u,h=!1;break;case"<":if(!n){if(c){f=!0;break}c=!0}s.offset=u,h=!1;break;case"]":if(!n){if(p||d){f=!0;break}p=d=!0}s.limit=s.markedOffset=u,h=!1;break;case">":if(!n){if(p){f=!0;break}p=!0}s.limit=u,h=!1;break;case"'":if(!n){if(d){f=!0;break}d=!0}s.markedOffset=u,h=!1;break;case" ":h=!1;break;default:if(!n&&h){f=!0;break}if(o=parseInt(r+t.charAt(l++),16),!n&&(isNaN(o)||o<0||o>255))throw TypeError("Illegal str: Not a debug encoded string");s.view[u++]=o,h=!0}if(f)throw TypeError("Illegal str: Invalid symbol at "+l)}if(!n){if(!c||!p)throw TypeError("Illegal str: Missing offset or limit");if(u<s.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+u+" < "+a)}return s},i.toHex=function(t,e){if(t=void 0===t?this.offset:t,e=void 0===e?this.limit:e,!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}for(var i,n=new Array(e-t);t<e;)(i=this.view[t++])<16?n.push("0",i.toString(16)):n.push(i.toString(16));return n.join("")},e.fromHex=function(t,i,n){if(!n){if("string"!=typeof t)throw TypeError("Illegal str: Not a string");if(t.length%2!=0)throw TypeError("Illegal str: Length not a multiple of 2")}for(var r,o=t.length,a=new e(o/2|0,i),s=0,l=0;s<o;s+=2){if(r=parseInt(t.substring(s,s+2),16),!n&&(!isFinite(r)||r<0||r>255))throw TypeError("Illegal str: Contains non-hex characters");a.view[l++]=r}return a.limit=l,a};var h=function(){var t={MAX_CODEPOINT:1114111,encodeUTF8:function(t,e){var i=null;for("number"==typeof t&&(i=t,t=function(){return null});null!==i||null!==(i=t());)i<128?e(127&i):i<2048?(e(i>>6&31|192),e(63&i|128)):i<65536?(e(i>>12&15|224),e(i>>6&63|128),e(63&i|128)):(e(i>>18&7|240),e(i>>12&63|128),e(i>>6&63|128),e(63&i|128)),i=null},decodeUTF8:function(t,e){for(var i,n,r,o,a=function(t){t=t.slice(0,t.indexOf(null));var e=Error(t.toString());throw e.name="TruncatedError",e.bytes=t,e};null!==(i=t());)if(0==(128&i))e(i);else if(192==(224&i))null===(n=t())&&a([i,n]),e((31&i)<<6|63&n);else if(224==(240&i))(null===(n=t())||null===(r=t()))&&a([i,n,r]),e((15&i)<<12|(63&n)<<6|63&r);else{if(240!=(248&i))throw RangeError("Illegal starting byte: "+i);(null===(n=t())||null===(r=t())||null===(o=t()))&&a([i,n,r,o]),e((7&i)<<18|(63&n)<<12|(63&r)<<6|63&o)}},UTF16toUTF8:function(t,e){for(var i,n=null;null!==(i=null!==n?n:t());)i>=55296&&i<=57343&&null!==(n=t())&&n>=56320&&n<=57343?(e(1024*(i-55296)+n-56320+65536),n=null):e(i);null!==n&&e(n)},UTF8toUTF16:function(t,e){var i=null;for("number"==typeof t&&(i=t,t=function(){return null});null!==i||null!==(i=t());)i<=65535?e(i):(e(55296+((i-=65536)>>10)),e(i%1024+56320)),i=null},encodeUTF16toUTF8:function(e,i){t.UTF16toUTF8(e,(function(e){t.encodeUTF8(e,i)}))},decodeUTF8toUTF16:function(e,i){t.decodeUTF8(e,(function(e){t.UTF8toUTF16(e,i)}))},calculateCodePoint:function(t){return t<128?1:t<2048?2:t<65536?3:4},calculateUTF8:function(t){for(var e,i=0;null!==(e=t());)i+=e<128?1:e<2048?2:e<65536?3:4;return i},calculateUTF16asUTF8:function(e){var i=0,n=0;return t.UTF16toUTF8(e,(function(t){++i,n+=t<128?1:t<2048?2:t<65536?3:4})),[i,n]}};return t}();return i.toUTF8=function(t,e){if(void 0===t&&(t=this.offset),void 0===e&&(e=this.limit),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof e||e%1!=0)throw TypeError("Illegal end: Not an integer");if(e>>>=0,t<0||t>e||e>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+e+" <= "+this.buffer.byteLength)}var i;try{h.decodeUTF8toUTF16(function(){return t<e?this.view[t++]:null}.bind(this),i=a())}catch(i){if(t!==e)throw RangeError("Illegal range: Truncated data, "+t+" != "+e)}return i()},e.fromUTF8=function(t,i,n){if(!n&&"string"!=typeof t)throw TypeError("Illegal str: Not a string");var r=new e(h.calculateUTF16asUTF8(o(t),!0)[1],i,n),a=0;return h.encodeUTF16toUTF8(o(t),(function(t){r.view[a++]=t})),r.limit=a,r},e})?n.apply(e,r):n)||(t.exports=o)},function(t,e,i){var n,r,o;r=[],void 0===(o="function"==typeof(n=function(){"use strict";function t(t,e,i){this.low=0|t,this.high=0|e,this.unsigned=!!i}function e(t){return!0===(t&&t.__isLong__)}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),t.isLong=e;var i={},n={};function r(t,e){var r,o,s;return e?(s=0<=(t>>>=0)&&t<256)&&(o=n[t])?o:(r=a(t,(0|t)<0?-1:0,!0),s&&(n[t]=r),r):(s=-128<=(t|=0)&&t<128)&&(o=i[t])?o:(r=a(t,t<0?-1:0,!1),s&&(i[t]=r),r)}function o(t,e){if(isNaN(t)||!isFinite(t))return e?m:f;if(e){if(t<0)return m;if(t>=c)return w}else{if(t<=-d)return x;if(t+1>=d)return b}return t<0?o(-t,e).neg():a(t%h|0,t/h|0,e)}function a(e,i,n){return new t(e,i,n)}t.fromInt=r,t.fromNumber=o,t.fromBits=a;var s=Math.pow;function l(t,e,i){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return f;if("number"==typeof e?(i=e,e=!1):e=!!e,(i=i||10)<2||36<i)throw RangeError("radix");var n;if((n=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return l(t.substring(1),e,i).neg();for(var r=o(s(i,8)),a=f,u=0;u<t.length;u+=8){var h=Math.min(8,t.length-u),c=parseInt(t.substring(u,u+h),i);if(h<8){var d=o(s(i,h));a=a.mul(d).add(o(c))}else a=(a=a.mul(r)).add(o(c))}return a.unsigned=e,a}function u(e){return e instanceof t?e:"number"==typeof e?o(e):"string"==typeof e?l(e):a(e.low,e.high,e.unsigned)}t.fromString=l,t.fromValue=u;var h=4294967296,c=h*h,d=c/2,p=r(1<<24),f=r(0);t.ZERO=f;var m=r(0,!0);t.UZERO=m;var g=r(1);t.ONE=g;var v=r(1,!0);t.UONE=v;var y=r(-1);t.NEG_ONE=y;var b=a(-1,2147483647,!1);t.MAX_VALUE=b;var w=a(-1,-1,!0);t.MAX_UNSIGNED_VALUE=w;var x=a(0,-2147483648,!1);t.MIN_VALUE=x;var M=t.prototype;return M.toInt=function(){return this.unsigned?this.low>>>0:this.low},M.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},M.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(x)){var e=o(t),i=this.div(e),n=i.mul(e).sub(this);return i.toString(t)+n.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var r=o(s(t,6),this.unsigned),a=this,l="";;){var u=a.div(r),h=(a.sub(u.mul(r)).toInt()>>>0).toString(t);if((a=u).isZero())return h+l;for(;h.length<6;)h="0"+h;l=""+h+l}},M.getHighBits=function(){return this.high},M.getHighBitsUnsigned=function(){return this.high>>>0},M.getLowBits=function(){return this.low},M.getLowBitsUnsigned=function(){return this.low>>>0},M.getNumBitsAbs=function(){if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<<e);e--);return 0!=this.high?e+33:e+1},M.isZero=function(){return 0===this.high&&0===this.low},M.isNegative=function(){return!this.unsigned&&this.high<0},M.isPositive=function(){return this.unsigned||this.high>=0},M.isOdd=function(){return 1==(1&this.low)},M.isEven=function(){return 0==(1&this.low)},M.equals=function(t){return e(t)||(t=u(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},M.eq=M.equals,M.notEquals=function(t){return!this.eq(t)},M.neq=M.notEquals,M.lessThan=function(t){return this.comp(t)<0},M.lt=M.lessThan,M.lessThanOrEqual=function(t){return this.comp(t)<=0},M.lte=M.lessThanOrEqual,M.greaterThan=function(t){return this.comp(t)>0},M.gt=M.greaterThan,M.greaterThanOrEqual=function(t){return this.comp(t)>=0},M.gte=M.greaterThanOrEqual,M.compare=function(t){if(e(t)||(t=u(t)),this.eq(t))return 0;var i=this.isNegative(),n=t.isNegative();return i&&!n?-1:!i&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},M.comp=M.compare,M.negate=function(){return!this.unsigned&&this.eq(x)?x:this.not().add(g)},M.neg=M.negate,M.add=function(t){e(t)||(t=u(t));var i=this.high>>>16,n=65535&this.high,r=this.low>>>16,o=65535&this.low,s=t.high>>>16,l=65535&t.high,h=t.low>>>16,c=0,d=0,p=0,f=0;return p+=(f+=o+(65535&t.low))>>>16,d+=(p+=r+h)>>>16,c+=(d+=n+l)>>>16,c+=i+s,a((p&=65535)<<16|(f&=65535),(c&=65535)<<16|(d&=65535),this.unsigned)},M.subtract=function(t){return e(t)||(t=u(t)),this.add(t.neg())},M.sub=M.subtract,M.multiply=function(t){if(this.isZero())return f;if(e(t)||(t=u(t)),t.isZero())return f;if(this.eq(x))return t.isOdd()?x:f;if(t.eq(x))return this.isOdd()?x:f;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(p)&&t.lt(p))return o(this.toNumber()*t.toNumber(),this.unsigned);var i=this.high>>>16,n=65535&this.high,r=this.low>>>16,s=65535&this.low,l=t.high>>>16,h=65535&t.high,c=t.low>>>16,d=65535&t.low,m=0,g=0,v=0,y=0;return v+=(y+=s*d)>>>16,g+=(v+=r*d)>>>16,v&=65535,g+=(v+=s*c)>>>16,m+=(g+=n*d)>>>16,g&=65535,m+=(g+=r*c)>>>16,g&=65535,m+=(g+=s*h)>>>16,m+=i*d+n*c+r*h+s*l,a((v&=65535)<<16|(y&=65535),(m&=65535)<<16|(g&=65535),this.unsigned)},M.mul=M.multiply,M.divide=function(t){if(e(t)||(t=u(t)),t.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?m:f;var i,n,r;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return m;if(t.gt(this.shru(1)))return v;r=m}else{if(this.eq(x))return t.eq(g)||t.eq(y)?x:t.eq(x)?g:(i=this.shr(1).div(t).shl(1)).eq(f)?t.isNegative()?g:y:(n=this.sub(t.mul(i)),r=i.add(n.div(t)));if(t.eq(x))return this.unsigned?m:f;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();r=f}for(n=this;n.gte(t);){i=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(i)/Math.LN2),l=a<=48?1:s(2,a-48),h=o(i),c=h.mul(t);c.isNegative()||c.gt(n);)c=(h=o(i-=l,this.unsigned)).mul(t);h.isZero()&&(h=g),r=r.add(h),n=n.sub(c)}return r},M.div=M.divide,M.modulo=function(t){return e(t)||(t=u(t)),this.sub(this.div(t).mul(t))},M.mod=M.modulo,M.not=function(){return a(~this.low,~this.high,this.unsigned)},M.and=function(t){return e(t)||(t=u(t)),a(this.low&t.low,this.high&t.high,this.unsigned)},M.or=function(t){return e(t)||(t=u(t)),a(this.low|t.low,this.high|t.high,this.unsigned)},M.xor=function(t){return e(t)||(t=u(t)),a(this.low^t.low,this.high^t.high,this.unsigned)},M.shiftLeft=function(t){return e(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?a(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):a(0,this.low<<t-32,this.unsigned)},M.shl=M.shiftLeft,M.shiftRight=function(t){return e(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?a(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):a(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},M.shr=M.shiftRight,M.shiftRightUnsigned=function(t){if(e(t)&&(t=t.toInt()),0==(t&=63))return this;var i=this.high;return t<32?a(this.low>>>t|i<<32-t,i>>>t,this.unsigned):a(32===t?i:i>>>t-32,0,this.unsigned)},M.shru=M.shiftRightUnsigned,M.toSigned=function(){return this.unsigned?a(this.low,this.high,!1):this},M.toUnsigned=function(){return this.unsigned?this:a(this.low,this.high,!0)},M.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},M.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255]},M.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24&255,t>>>16&255,t>>>8&255,255&t,e>>>24&255,e>>>16&255,e>>>8&255,255&e]},t})?n.apply(e,r):n)||(t.exports=o)},function(t,e){},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";e.byteLength=function(t){var e=u(t),i=e[0],n=e[1];return 3*(i+n)/4-n},e.toByteArray=function(t){var e,i,n=u(t),a=n[0],s=n[1],l=new o(function(t,e,i){return 3*(e+i)/4-i}(0,a,s)),h=0,c=s>0?a-4:a;for(i=0;i<c;i+=4)e=r[t.charCodeAt(i)]<<18|r[t.charCodeAt(i+1)]<<12|r[t.charCodeAt(i+2)]<<6|r[t.charCodeAt(i+3)],l[h++]=e>>16&255,l[h++]=e>>8&255,l[h++]=255&e;2===s&&(e=r[t.charCodeAt(i)]<<2|r[t.charCodeAt(i+1)]>>4,l[h++]=255&e);1===s&&(e=r[t.charCodeAt(i)]<<10|r[t.charCodeAt(i+1)]<<4|r[t.charCodeAt(i+2)]>>2,l[h++]=e>>8&255,l[h++]=255&e);return l},e.fromByteArray=function(t){for(var e,i=t.length,r=i%3,o=[],a=0,s=i-r;a<s;a+=16383)o.push(h(t,a,a+16383>s?s:a+16383));1===r?(e=t[i-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===r&&(e=(t[i-2]<<8)+t[i-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return o.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,l=a.length;s<l;++s)n[s]=a[s],r[a.charCodeAt(s)]=s;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return-1===i&&(i=e),[i,i===e?0:4-i%4]}function h(t,e,i){for(var r,o,a=[],s=e;s<i;s+=3)r=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(n[(o=r)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,i,n,r){var o,a,s=8*r-n-1,l=(1<<s)-1,u=l>>1,h=-7,c=i?r-1:0,d=i?-1:1,p=t[e+c];for(c+=d,o=p&(1<<-h)-1,p>>=-h,h+=s;h>0;o=256*o+t[e+c],c+=d,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=256*a+t[e+c],c+=d,h-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=u}return(p?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,i,n,r,o){var a,s,l,u=8*o-r-1,h=(1<<u)-1,c=h>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,f=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+c>=1?d/l:d*Math.pow(2,1-c))*l>=2&&(a++,l/=2),a+c>=h?(s=0,a=h):a+c>=1?(s=(e*l-1)*Math.pow(2,r),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,r),a=0));r>=8;t[i+p]=255&s,p+=f,s/=256,r-=8);for(a=a<<r|s,u+=r;u>0;t[i+p]=255&a,p+=f,a/=256,u-=8);t[i+p-f]|=128*m}},function(t,e){var i={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==i.call(t)}},function(t,e,i){(function(e){var n=i(7),r=i(16),o=i(3),a=i(2),s=i(1),l=new a("/js/loaders/ModelTextureLoader.js");t.exports.load=function(t){function i(t){t||(c++,h.notify(c,a),c===a&&h.resolve())}if(!t.chunks[0]||!t.chunks[0].meshUrl)return e.when();var a=n.countUnique(t.chunks.map((function(t){return t.textureName}))),u="high";o.isMobile()&&"high"===u&&(o.detectSamsungS6()?(l.warn("Galaxy S6 cannot handle large textures, turning down quality."),u="low"):a>s.maxMobileTextures&&(l.warn("Model probably too large for mobile, turning down quality."),u="low"));var h=e.Deferred(),c=0,d=G.url.model+"/texture_"+u+"/";return t.chunks.forEach((function(t){if(!t.material.map&&t.textureName){var e=d+t.textureName;t.setTextureMap(r.load(e,i.bind(this,r.isLoaded(e))))}})),h.promise()}}).call(this,i(6))},function(t,e,i){(function(e){(function(n,r){i(1),i(46);var o=i(11),a=(i(7),i(9)),s=i(2),l=i(0),u=new s(r);function h(t){this.model=t,this.modelDataPath=G.url.model+"/vision.modeldata"}h.prototype.load=function(){return this.modelDataPath?(u.info("Using vision.modeldata"),this.loadVisionModelData()):(u.warn("No sweep file found"),e.when([]))},h.prototype.loadVisionModelData=function(){var t=this;return o.get(this.modelDataPath,{responseType:"json",fetchNum:1,prefetchFrom:"locations"}).then(function(e){var i=e.points.map((function(t){var e=t.color;return e?(e.brightness||(e.brightness=0),e.contrast||(e.contrast=0),null!==e.gamma&&void 0!==e.gamma||(e.gamma=1),e.hue||(e.hue=0),e.saturation||(e.saturation=0),e.vibrance||(e.vibrance=0),e.balance||(e.balance=new l.Vector3(0,0,0))):e={brightness:0,contrast:0,gamma:1,hue:0,saturation:0,vibrance:0,balance:new l.Vector3(0,0,0)},{enable:t.enable,locationid:t.locationid,position:{x:t.viewpoint.x,y:t.viewpoint.y,z:t.viewpoint.z},quaternion:{x:t.rotation.x,y:t.rotation.y,z:t.rotation.z,w:t.rotation.w},puck:{x:t.spot.x,y:t.spot.y,z:t.spot.z},u:t.u,v:t.v,floor:t.flooridx,neighbours:t.vps,alignmentType:t.type,angle_enable:t.angle_enable,angle_x:t.angle_x,angle_y:t.angle_y,angle_z:t.angle_z,launch:t.launch,color:e,roomid:t.roomidx}})).map((function(e){if(t.model.straight_enable){var i=new l.Euler;i.setFromQuaternion(new l.Quaternion(e.quaternion.x,e.quaternion.y,e.quaternion.z,e.quaternion.w),"ZYX",!1),i._x=0,i._y=0;var n=new l.Quaternion;n.setFromEuler(i,!1),e.quaternion.x=n.x,e.quaternion.y=n.y,e.quaternion.z=n.z,e.quaternion.w=n.w}return e.position=a.convertVisionVector(e.position),e.quaternion=a.convertVisionQuaternion(e.quaternion),e.quaternionAutoScene=a.convertVisionQuaternionAutoScene(e.quaternion),e.puck=a.convertVisionVector(e.puck),e}));return i.forEach((function(t){t.neighbours=t.neighbours.map((function(t){return i[t].locationid}))})),!G.conf.jfedit&&G.conf.isNewEditVersion||(i=i.filter((function(t){return t.enable}))),i}.bind(this))},t.exports=h}).call(this,i(47).Buffer,"/js/loaders/SweepDataLoader.js"),function(n,r){i(1),i(46);var o=i(11),a=(i(7),i(9)),s=i(2),l=i(0),u=new s(r);function h(t){this.model=t,this.modelDataPath=G.url.model+"/vision.modeldata"}h.prototype.load=function(){return this.modelDataPath?(u.info("Using vision.modeldata"),this.loadVisionModelData()):(u.warn("No sweep file found"),e.when([]))},h.prototype.loadVisionModelData=function(){var t=this;return o.get(this.modelDataPath,{responseType:"json",fetchNum:1,prefetchFrom:"locations"}).then(function(e){var i=e.points.map((function(t){var e=t.color;return e?(e.brightness||(e.brightness=0),e.contrast||(e.contrast=0),null!==e.gamma&&void 0!==e.gamma||(e.gamma=1),e.hue||(e.hue=0),e.saturation||(e.saturation=0),e.vibrance||(e.vibrance=0),e.balance||(e.balance=new l.Vector3(0,0,0))):e={brightness:0,contrast:0,gamma:1,hue:0,saturation:0,vibrance:0,balance:new l.Vector3(0,0,0)},{enable:t.enable,locationid:t.locationid,position:{x:t.viewpoint.x,y:t.viewpoint.y,z:t.viewpoint.z},quaternion:{x:t.rotation.x,y:t.rotation.y,z:t.rotation.z,w:t.rotation.w},puck:{x:t.spot.x,y:t.spot.y,z:t.spot.z},u:t.u,v:t.v,floor:t.flooridx,neighbours:t.vps,alignmentType:t.type,angle_enable:t.angle_enable,angle_x:t.angle_x,angle_y:t.angle_y,angle_z:t.angle_z,launch:t.launch,color:e,roomid:t.roomidx}})).map((function(e){if(t.model.straight_enable){var i=new l.Euler;i.setFromQuaternion(new l.Quaternion(e.quaternion.x,e.quaternion.y,e.quaternion.z,e.quaternion.w),"ZYX",!1),i._x=0,i._y=0;var n=new l.Quaternion;n.setFromEuler(i,!1),e.quaternion.x=n.x,e.quaternion.y=n.y,e.quaternion.z=n.z,e.quaternion.w=n.w}return e.position=a.convertVisionVector(e.position),e.quaternion=a.convertVisionQuaternion(e.quaternion),e.quaternionAutoScene=a.convertVisionQuaternionAutoScene(e.quaternion),e.puck=a.convertVisionVector(e.puck),e}));return i.forEach((function(t){t.neighbours=t.neighbours.map((function(t){return i[t].locationid}))})),!G.conf.jfedit&&G.conf.isNewEditVersion||(i=i.filter((function(t){return t.enable}))),i}.bind(this))},t.exports=h}.call(this,i(47).Buffer,"/js/loaders/SweepDataLoader.js")}).call(this,i(6))},function(t,e,i){(function(e){function n(){u.call(this)}var r=i(1),o=i(2),a=i(5),s=i(57),l=(i(9),i(7)),u=i(33),h=new o(e);l.inherit(n,u),n.prototype.getbg=function(){for(var t=0;t<this.list.length;t++)if(this.list[t].init_point)return this.list[t];return null},n.prototype.filterByModesAndReel=function(t,e){for(var i,n=t[a.DOLLHOUSE],r=t[a.FLOORPLAN],o=[],s=0;s<e.length;s++)i=this.index[e[s].sceneid],0==s&&(i.isHero=!0),i&&o.push(i);(o=o.filter((function(t){var e;if(t._camera&&void 0!==t._camera._type){try{e=a.convertWorkshopModeInt(t._camera._type)}catch(t){return void h.debug(t.message)}return e===a.PANORAMA||e===a.FLOORPLAN&&r||e===a.DOLLHOUSE&&n}}))).length!==this.list.length&&(h.info("Disallowed "+(this.list.length-o.length)+" highlight images"),this.list=o,this.reIndex()),this.list=o,this.reIndex()},n.prototype.getHeroLocations=function(t){var e=[],i=!1;if(0===this.list.length)return[];for(var o=0;o<this.list.length;++o){var l=this.list[o],u=l.shortcuturl,h=l.name;if(l.script=l.script?l.script:0,l._camera&&void 0!==l._camera._rotation){if(!r.show360Views.enabled&&l._camera._locationid){var c=t.get(l._camera._locationid);if(c&&!c.isAligned())continue}if(a.convertWorkshopModeInt(l._camera._type)===a.MESH)continue;var d=new s({cameraMode:"panorama",position:l._camera._viewpoint,quaternion:l._camera._rotation,panoId:l._camera._locationid,orthoZoom:l._camera._zoom,floorVisibility:void 0!==l._camera.floor_visibility?l._camera.floor_visibility.slice(0):[],thumbUrl:u,name:n.filterImageName(h),isHero:l.init_point,script:l.script,cameraType:l._camera._type});e.push(d),i=i||l.init_point}}return e.length>0&&!i&&(e[0].isHero=!0),e},n.prototype.getIndex=function(t){return t.sceneid},n.filterImageName=function(t){return""===t||t.match(/^[0-9.]+_[0-9.]+$/)?null:t},t.exports=n}).call(this,"/js/model/ImageCollection.js")},function(t,e,i){(function(e){function n(){s.call(this)}var r=i(179),o=(i(1),i(2)),a=(i(8),i(15),i(7)),s=i(33),l=i(72);new o(e),a.inherit(n,s),n.prototype.getIndex=function(t){return t.roomId},n.prototype.calcRoomBoundaries=function(){this.forEach((function(t){t.calcBoundaries()}))},n.prototype.createFromChunks=function(t){var e={floorId:-1,roomId:-1},i={};t.forEach(function(t){l.parseIdsFromChunkName(t.name,e);var o=i[e.roomId];if(!o){var a=n.generateRoomId(e.floorId,e.roomId);o=new r(e.floorId,a),this.add(o),i[e.roomId]=o}o.addChunk(t)}.bind(this)),this.calcRoomBoundaries()},n.generateRoomId=function(t,e){return t+"_"+e},t.exports=n}).call(this,"/js/model/RoomCollection.js")},function(t,e,i){function n(t,e){this.chunks=[],this.floorId=t,this.roomId=e,this.position=new r.Vector3}var r=i(0);n.prototype.addChunk=function(t){this.chunks.push(t)},n.prototype.calcBoundaries=function(){for(var t=new r.Vector3,e=new r.Vector3(0,0,0),i=new r.Vector3(0,0,0),n=new r.Vector3(0,0,0),o=0,a=0;a<this.chunks.length;a++){var s=this.chunks[a].geometry.attributes.position;if(s)for(var l=0;l<s.array.length;l+=3)t.set(s.array[l],s.array[l+1],s.array[l+2]),e.add(t),0===l?(i.copy(t),n.copy(t)):(i.max(t),n.min(t)),o++}o>0?(e.multiplyScalar(1/o),this.average=e):this.average=null,this.boundsMax=i,this.boundsMin=n,this.center=new r.Vector3,this.center.copy(i).sub(n).multiplyScalar(.5).add(n)},t.exports=n},function(t,e,i){var n;!function(r,o){"use strict";var a="model",s="name",l="type",u="vendor",h="version",c="mobile",d="tablet",p="smarttv",f=function(t){for(var e={},i=0;i<t.length;i++)e[t[i].toUpperCase()]=t[i];return e},m=function(t,e){return"string"==typeof t&&-1!==g(e).indexOf(g(t))},g=function(t){return t.toLowerCase()},v=function(t,e){if("string"==typeof t)return t=t.replace(/^\s\s*/,""),void 0===e?t:t.substring(0,350)},y=function(t,e){for(var i,n,r,o,a,s,l=0;l<e.length&&!a;){var u=e[l],h=e[l+1];for(i=n=0;i<u.length&&!a&&u[i];)if(a=u[i++].exec(t))for(r=0;r<h.length;r++)s=a[++n],"object"==typeof(o=h[r])&&o.length>0?2===o.length?"function"==typeof o[1]?this[o[0]]=o[1].call(this,s):this[o[0]]=o[1]:3===o.length?"function"!=typeof o[1]||o[1].exec&&o[1].test?this[o[0]]=s?s.replace(o[1],o[2]):void 0:this[o[0]]=s?o[1].call(this,s,o[2]):void 0:4===o.length&&(this[o[0]]=s?o[3].call(this,s.replace(o[1],o[2])):void 0):this[o]=s||void 0;l+=2}},b=function(t,e){for(var i in e)if("object"==typeof e[i]&&e[i].length>0){for(var n=0;n<e[i].length;n++)if(m(e[i][n],t))return"?"===i?void 0:i}else if(m(e[i],t))return"?"===i?void 0:i;return t},w={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},x={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[h,[s,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[h,[s,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[s,h],[/opios[\/ ]+([\w\.]+)/i],[h,[s,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[h,[s,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[s,h],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[h,[s,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[h,[s,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[h,[s,"WeChat"]],[/konqueror\/([\w\.]+)/i],[h,[s,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[h,[s,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[h,[s,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[s,/(.+)/,"$1 Secure Browser"],h],[/\bfocus\/([\w\.]+)/i],[h,[s,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[h,[s,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[h,[s,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[h,[s,"Dolphin"]],[/coast\/([\w\.]+)/i],[h,[s,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[h,[s,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[h,[s,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[s,"360 Browser"]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[s,/(.+)/,"$1 Browser"],h],[/(comodo_dragon)\/([\w\.]+)/i],[[s,/_/g," "],h],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[s,h],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[s],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[s,"Facebook"],h],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[s,h],[/\bgsa\/([\w\.]+) .*safari\//i],[h,[s,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[h,[s,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[h,[s,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[s,"Chrome WebView"],h],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[h,[s,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[s,h],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[h,[s,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[h,s],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[s,[h,b,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[s,h],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[s,"Netscape"],h],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[h,[s,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[s,h],[/(cobalt)\/([\w\.]+)/i],[s,[h,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[["architecture","amd64"]],[/(ia32(?=;))/i],[["architecture",g]],[/((?:i[346]|x)86)[;\)]/i],[["architecture","ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[["architecture","arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[["architecture","armhf"]],[/windows (ce|mobile); ppc;/i],[["architecture","arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[["architecture",/ower/,"",g]],[/(sun4\w)[;\)]/i],[["architecture","sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[["architecture",g]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[a,[u,"Samsung"],[l,d]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[a,[u,"Samsung"],[l,c]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[a,[u,"Apple"],[l,c]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[a,[u,"Apple"],[l,d]],[/(macintosh);/i],[a,[u,"Apple"]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[a,[u,"Sharp"],[l,c]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[a,[u,"Huawei"],[l,d]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[a,[u,"Huawei"],[l,c]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[a,/_/g," "],[u,"Xiaomi"],[l,c]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[a,/_/g," "],[u,"Xiaomi"],[l,d]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[a,[u,"OPPO"],[l,c]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[a,[u,"Vivo"],[l,c]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[a,[u,"Realme"],[l,c]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[a,[u,"Motorola"],[l,c]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[a,[u,"Motorola"],[l,d]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[a,[u,"LG"],[l,d]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[a,[u,"LG"],[l,c]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[a,[u,"Lenovo"],[l,d]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[a,/_/g," "],[u,"Nokia"],[l,c]],[/(pixel c)\b/i],[a,[u,"Google"],[l,d]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[a,[u,"Google"],[l,c]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[a,[u,"Sony"],[l,c]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[a,"Xperia Tablet"],[u,"Sony"],[l,d]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[a,[u,"OnePlus"],[l,c]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[a,[u,"Amazon"],[l,d]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[a,/(.+)/g,"Fire Phone $1"],[u,"Amazon"],[l,c]],[/(playbook);[-\w\),; ]+(rim)/i],[a,u,[l,d]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[a,[u,"BlackBerry"],[l,c]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[a,[u,"ASUS"],[l,d]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[a,[u,"ASUS"],[l,c]],[/(nexus 9)/i],[a,[u,"HTC"],[l,d]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[u,[a,/_/g," "],[l,c]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[a,[u,"Acer"],[l,d]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[a,[u,"Meizu"],[l,c]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[u,a,[l,c]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[u,a,[l,d]],[/(surface duo)/i],[a,[u,"Microsoft"],[l,d]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[a,[u,"Fairphone"],[l,c]],[/(u304aa)/i],[a,[u,"AT&T"],[l,c]],[/\bsie-(\w*)/i],[a,[u,"Siemens"],[l,c]],[/\b(rct\w+) b/i],[a,[u,"RCA"],[l,d]],[/\b(venue[\d ]{2,7}) b/i],[a,[u,"Dell"],[l,d]],[/\b(q(?:mv|ta)\w+) b/i],[a,[u,"Verizon"],[l,d]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[a,[u,"Barnes & Noble"],[l,d]],[/\b(tm\d{3}\w+) b/i],[a,[u,"NuVision"],[l,d]],[/\b(k88) b/i],[a,[u,"ZTE"],[l,d]],[/\b(nx\d{3}j) b/i],[a,[u,"ZTE"],[l,c]],[/\b(gen\d{3}) b.+49h/i],[a,[u,"Swiss"],[l,c]],[/\b(zur\d{3}) b/i],[a,[u,"Swiss"],[l,d]],[/\b((zeki)?tb.*\b) b/i],[a,[u,"Zeki"],[l,d]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[u,"Dragon Touch"],a,[l,d]],[/\b(ns-?\w{0,9}) b/i],[a,[u,"Insignia"],[l,d]],[/\b((nxa|next)-?\w{0,9}) b/i],[a,[u,"NextBook"],[l,d]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[u,"Voice"],a,[l,c]],[/\b(lvtel\-)?(v1[12]) b/i],[[u,"LvTel"],a,[l,c]],[/\b(ph-1) /i],[a,[u,"Essential"],[l,c]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[a,[u,"Envizen"],[l,d]],[/\b(trio[-\w\. ]+) b/i],[a,[u,"MachSpeed"],[l,d]],[/\btu_(1491) b/i],[a,[u,"Rotor"],[l,d]],[/(shield[\w ]+) b/i],[a,[u,"Nvidia"],[l,d]],[/(sprint) (\w+)/i],[u,a,[l,c]],[/(kin\.[onetw]{3})/i],[[a,/\./g," "],[u,"Microsoft"],[l,c]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[a,[u,"Zebra"],[l,d]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[a,[u,"Zebra"],[l,c]],[/smart-tv.+(samsung)/i],[u,[l,p]],[/hbbtv.+maple;(\d+)/i],[[a,/^/,"SmartTV"],[u,"Samsung"],[l,p]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[u,"LG"],[l,p]],[/(apple) ?tv/i],[u,[a,"Apple TV"],[l,p]],[/crkey/i],[[a,"Chromecast"],[u,"Google"],[l,p]],[/droid.+aft(\w)( bui|\))/i],[a,[u,"Amazon"],[l,p]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[a,[u,"Sharp"],[l,p]],[/(bravia[\w ]+)( bui|\))/i],[a,[u,"Sony"],[l,p]],[/(mitv-\w{5}) bui/i],[a,[u,"Xiaomi"],[l,p]],[/Hbbtv.*(technisat) (.*);/i],[u,a,[l,p]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[u,v],[a,v],[l,p]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,p]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[u,a,[l,"console"]],[/droid.+; (shield) bui/i],[a,[u,"Nvidia"],[l,"console"]],[/(playstation [345portablevi]+)/i],[a,[u,"Sony"],[l,"console"]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[a,[u,"Microsoft"],[l,"console"]],[/((pebble))app/i],[u,a,[l,"wearable"]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[a,[u,"Apple"],[l,"wearable"]],[/droid.+; (glass) \d/i],[a,[u,"Google"],[l,"wearable"]],[/droid.+; (wt63?0{2,3})\)/i],[a,[u,"Zebra"],[l,"wearable"]],[/(quest( 2| pro)?)/i],[a,[u,"Facebook"],[l,"wearable"]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[u,[l,"embedded"]],[/(aeobc)\b/i],[a,[u,"Amazon"],[l,"embedded"]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[a,[l,c]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[a,[l,d]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,d]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[l,c]],[/(android[-\w\. ]{0,9});.+buil/i],[a,[u,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[h,[s,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[h,[s,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[s,h],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[h,s]],os:[[/microsoft (windows) (vista|xp)/i],[s,h],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[s,[h,b,w]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[s,"Windows"],[h,b,w]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/ios;fbsv\/([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[h,/_/g,"."],[s,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[s,"Mac OS"],[h,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[h,s],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[s,h],[/\(bb(10);/i],[h,[s,"BlackBerry"]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[h,[s,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[h,[s,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[h,[s,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[h,[s,"watchOS"]],[/crkey\/([\d\.]+)/i],[h,[s,"Chromecast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[s,"Chromium OS"],h],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[s,h],[/(sunos) ?([\w\.\d]*)/i],[[s,"Solaris"],h],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[s,h]]},M=function(t,e){if("object"==typeof t&&(e=t,t=void 0),!(this instanceof M))return new M(t,e).getResult();var i=void 0!==r&&r.navigator?r.navigator:void 0,n=t||(i&&i.userAgent?i.userAgent:""),o=i&&i.userAgentData?i.userAgentData:void 0,u=e?function(t,e){var i={};for(var n in t)e[n]&&e[n].length%2==0?i[n]=e[n].concat(t[n]):i[n]=t[n];return i}(x,e):x,p=i&&i.userAgent==n;return this.getBrowser=function(){var t,e={};return e[s]=void 0,e[h]=void 0,y.call(e,n,u.browser),e.major="string"==typeof(t=e[h])?t.replace(/[^\d\.]/g,"").split(".")[0]:void 0,p&&i&&i.brave&&"function"==typeof i.brave.isBrave&&(e[s]="Brave"),e},this.getCPU=function(){var t={architecture:void 0};return y.call(t,n,u.cpu),t},this.getDevice=function(){var t={vendor:void 0,model:void 0,type:void 0};return y.call(t,n,u.device),p&&!t[l]&&o&&o.mobile&&(t[l]=c),p&&"Macintosh"==t[a]&&i&&void 0!==i.standalone&&i.maxTouchPoints&&i.maxTouchPoints>2&&(t[a]="iPad",t[l]=d),t},this.getEngine=function(){var t={name:void 0,version:void 0};return y.call(t,n,u.engine),t},this.getOS=function(){var t={name:void 0,version:void 0};return y.call(t,n,u.os),p&&!t[s]&&o&&"Unknown"!=o.platform&&(t[s]=o.platform.replace(/chrome os/i,"Chromium OS").replace(/macos/i,"Mac OS")),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(t){return n="string"==typeof t&&t.length>350?v(t,350):t,this},this.setUA(n),this};M.VERSION="0.7.35",M.BROWSER=f([s,h,"major"]),M.CPU=f(["architecture"]),M.DEVICE=f([a,u,l,"console",c,p,d,"wearable","embedded"]),M.ENGINE=M.OS=f([s,h]),void 0!==e?(void 0!==t&&t.exports&&(e=t.exports=M),e.UAParser=M):i(181)?void 0===(n=function(){return M}.call(e,i,e,t))||(t.exports=n):void 0!==r&&(r.UAParser=M);var T=void 0!==r&&(r.jQuery||r.Zepto);if(T&&!T.ua){var S=new M;T.ua=S.getResult(),T.ua.get=function(){return S.getUA()},T.ua.set=function(t){S.setUA(t);var e=S.getResult();for(var i in e)T.ua[i]=e[i]}}}("object"==typeof window?window:this)},function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e,i){(function(e){var n=i(0),r=i(5),o=new(i(2))(e);t.exports={serialize:function(t){return encodeURI(JSON.stringify(t))},deserialize:function(t){try{var e=JSON.parse(decodeURI(t));return{mode:r.fromInt(e._type),panoId:e._locationid,position:(new n.Vector3).copy(e._viewpoint),quaternion:(new n.Quaternion).copy(e._rotation),zoom:e._zoom,floorVisibility:e.floor_visibility}}catch(e){o.debug("Not able to parse start location as JSON; falling back to old array style parsing");try{var i=t.split(","),a={x:parseFloat(i[2]),y:parseFloat(i[3]),z:parseFloat(i[4])},s={x:parseFloat(i[5]),y:parseFloat(i[6]),z:parseFloat(i[7]),w:parseFloat(i[8])};return{mode:r.fromInt(i[0]),panoId:i[1],position:(new n.Vector3).copy(a),quaternion:(new n.Quaternion).copy(s)}}catch(e){o.warn('Invalid start override, ignoring: "'+t+'"',e.message)}}return null}}}).call(this,"/js/controls/serializer.js")},function(t,e,i){(function(e){function n(t,e){this.model=t,this.panos=t.panos,this.player=e,this.imagePanos=this.listImagePanos(),this.retryMinimumTime=1e4}var r=(i(0),i(5)),o=(i(1),i(19)),a=new(i(2))(e);n.prototype.start=function(){this.loadNextPano(function(t){t?this.start():(a.debug("No suitable pano loaded, waiting a little while before looking again"),setTimeout(function(){this.start()}.bind(this),1e3))}.bind(this))},n.prototype.validLoadTarget=function(t){return t&&!t.isLoaded("high")&&Date.now()-t.failedLoadingAt>this.retryMinimumTime},n.prototype.listImagePanos=function(){var t=[],e=this;return this.model.images.forEach((function(i){if(i._camera&&i._camera._locationid){var n=e.model.panos.get(i._camera._locationid);n&&!n.isLoaded("high")&&t.push(n)}})),t},n.prototype.nextNotLoadedImage=function(){for(;this.imagePanos.length>0;){var t=this.imagePanos[0];if(!t.isLoaded("high"))return t;this.imagePanos.shift()}return null},n.prototype.loadNextPano=function(t){var e,i,n=this.model.waitQueue.filter((function(t){return t.object instanceof o}));n.length>0?(e=n[0].object,a.debug("Overrode pano selection: Flying to an unloaded pano "+e.id)):this.validLoadTarget(this.player.currentPano)?(e=this.player.currentPano,a.debug("Overrode pano selection: Currently at an unloaded pano "+e.id)):this.validLoadTarget(this.player.closestPano)?(e=this.player.closestPano,a.debug("Overrode pano selection: Hovering over an unloaded pano "+e.id)):this.validLoadTarget(this.nextNotLoadedImage())?(i="high",e=this.imagePanos[0],a.debug("Overrode pano selection: Highlight image "+e.id)):this.player.mode===r.PANORAMA&&((e=this.panos.lowestByScore([this.validLoadTarget.bind(this),o.filters.isNeighbourPanoTo(this.player.currentPano)],[o.scoreFunctions.distance(this.player.currentPano),o.scoreFunctions.direction(this.player.position,this.player.getDirection()),o.scoreFunctions.inFieldOfView(this.player.position,this.player.getDirection())]))&&a.debug("Normal pano selection: neighbor "+e.id)),e?(i=i||e.isLoaded("low")?"high":"low",a.debug("Preloading "+i+"-res pano "+e.id),e.loadCube(i).done(t).fail((function(){a.warn("Failed preloading pano",e.id,", marking it as failed and forgetting it for a while"),t()}))):t&&t(null)},t.exports=n}).call(this,"/js/preloaders.js")},function(t,e,i){(function(e){function n(t,e,i){t&&(t=t.toLowerCase().trim());var n=new h.Vector3(0,1,0),r=Math.PI/3,o=Math.PI/2;switch(t){case"left":i.copy(e),i.applyAxisAngle(n,o);break;case"right":i.copy(e),i.applyAxisAngle(n,-o);break;case"forwardleft":i.copy(e),i.applyAxisAngle(n,r);break;case"forwardright":i.copy(e),i.applyAxisAngle(n,-r);break;case"forward":default:i.copy(e)}return i}function r(t,e){if(t){var i={pano:t,lookAtPoint:null,duration:null,maxDistanceOverride:null,skipWarpingCheck:!1};this.player.flyToPano(i,(function(){e&&e({success:!0,message:"Transition complete."})}))}else y.warn("Automation -> clickPanoObject: Unable to find pano."),e&&e({success:!1,error:"Unable to find pano."})}function o(t,e){var i=this.findRankedPano(t,e);return i>=0?this.handleToObject[i]:(y.warn("Automation -> findRankedPanoObject: Unable to find nearby pano."),null)}function a(t,e){var i=this.findRankedMattertag(t,e);return i>=0?this.handleToObject[i]:(y.warn("Automation -> findRankedMattertagObject: Unable to find nearby Mattertag."),null)}function s(t,e){e.copy(m.FORWARD),t.getDirection(e)}var l,u,h=i(0),c=i(2),d=i(5),p=i(32),f=i(1),m=i(18),g=i(185),v=i(9),y=new c(e),b=null,w=(u=new h.Vector3,function(t){t?(u.copy(t.position),u.add(t.discPosition),v.projectPositionToCanvas(u,this.player.camera,u),this.click(u.x,u.y)):y.warn("Automation -> clickMattertagObject: Unable to find Mattertag.")}),x=(l=new h.Vector3,function(t){var e=this.player.getDirection(),i=0,n=0;if(this.player.mode===d.PANORAMA)i=f.insideLookLimitUp,n=f.insideLookLimitDown;else{if(this.player.mode!==d.DOLLHOUSE)return t;i=f.dollhouseDefault.maxPolarAngle,n=f.dollhouseDefault.minPolarAngle}l.copy(e),l.y=0,l.normalize();var r=-h.Math.radToDeg(l.angleTo(e));return t>(i-=r)&&(t=i),t<(n-=r)&&(t=n),t});g.setReceiver((function(t,e,i){if(e){var n=e.targetFunction,r=e.params;if(n){var o=b[n];if(o){(r=r||{}).onDone=function(t){g.respondToMessage(i,t)};var a=[];for(var s in r)r.hasOwnProperty(s)&&a.push(r[s]);o.apply(b,a)}}}}));var M={};b={handleToObject:{},objectToHandle:{},handleCount:0,director:null,player:null,init:function(t,e){this.director=t,this.player=e;var i=M.onInitComplete;i?function(t){t({success:!0,message:"Init complete."})}(i):M.onInitComplete={completed:!0}},findRankedPano:function(t,e){var i=new h.Vector3,r=new h.Vector3;return function(t,e){s(this.player,r),n(e,r,i);var o=this.player.rankedPanoInDirection(t,i);if(o){var a=this.objectToHandle[o.id];return a||(this.objectToHandle[o.id]=a=this.handleCount++,this.handleToObject[a]=o),a}return y.warn("Automation -> findRankedPano: Unable to find nearby pano."),-1}}(),findRankedMattertag:function(t,e){var i=new h.Vector3,r=new h.Vector3;return function(t,e){s(this.player,r),n(e,r,i);var o=this.player.rankedMattertagInDirection(t,i);if(o){var a=this.objectToHandle[o.i];return a||(this.objectToHandle[o.i]=a=this.handleCount++,this.handleToObject[a]=o),a}return y.warn("Automation -> findRankedMattertag: Unable to find nearby Mattertag."),-1}}(),clickNearestMattertag:function(t){this.clickRankedMattertag(0,t)},clickRankedMattertag:function(t,e){var i=a.call(this,t,e);i&&w.call(this,i)},clickNearestPano:function(t,e){this.clickRankedPano(0,t,e)},clickRankedPano:function(t,e,i){var n=o.call(this,t,e);n?r.call(this,n,i):i(null)},clickPano:function(t,e){var i=this.handleTable[t];i?r.call(this,i,e):e(null)},rotate:function(){function t(t){return"right"===t?p.RIGHTARROW:"left"===t?p.LEFTARROW:"up"===t?p.I:"down"===t?p.K:void 0}var e=(new h.Vector3,new h.Vector3),i=new h.Vector3(0,0,0),n=!1,r=new h.Vector3;return function(o,a,s){if(!n){if(!a||isNaN(a))return y.warn("Automation -> rotate: Invalid rotation angle."),void(s&&s({success:!1,error:"Invalid rotation angle."}));"right"===o||"left"===o?(i.set(0,1,0),"right"===o&&(a=-a)):"up"===o||"down"===o?(i.set(1,0,0),"down"===o&&(a=-a),a=x.call(this,a)):(y.warn("Automation -> rotate: Invalid direction for rotation: "+o),s&&s({success:!1,error:"Invalid direction for rotation."})),a=h.Math.degToRad(a),e=this.player.getDirection(),n=!0;var l=this.player.controls[this.player.mode];l.handleKeyDown(t(o));var u=0;(function i(){r.copy(m.FORWARD),this.player.getDirection(r);var h=r.angleTo(e);(u+=Math.abs(h))>=Math.abs(a)?(n=!1,l.handleKeyUp(t(o)),s&&s({success:!0,message:"Rotation complete."})):(e.copy(r),window.setTimeout(i.bind(this),4))}).bind(this)()}}}(),click:function(t,e,i){!0===i&&(t=t/100*(window.renderWidth || window.innerWidth),e=e/100*(window.renderHeight || window.innerHeight)),this.player.handleInputStart(t,e),this.player.updateIntersect(),this.player.handleInputEnd(t,e)},mouseOver:function(t,e,i){!0===i&&(t=t/100*(window.renderWidth || window.innerWidth),e=e/100*(window.renderHeight || window.innerHeight)),this.player.handleInputMove(t,e),this.player.updateIntersect()}},t.exports=b,window.__showcaseAutomationApi=b}).call(this,"/js/automation.js")},function(t,e,i){!function(){if("performance"in window==0&&(window.performance={}),Date.now=Date.now||function(){return(new Date).getTime()},"now"in window.performance==0){var t=Date.now();performance.timing&&performance.timing.navigationStart&&(t=performance.timing.navigationStart),window.performance.now=function(){return Date.now()-t}}}();var n=n||{};!function(t){var e=0,i=0,n=1,r=function(t,e,i,n){return{uid:t,message:e,type:i,waitForResponse:n}},o={},a={},s=null;window.addEventListener("message",(function(e){var i=e.origin||e.originalEvent.origin;t.receiveMessage(i,e.data,e.source)}),!1),t.setReceiver=function(t){s=t},t.sendMessage=function(t,n,a,s){var l=e++;if(s){var u={targetWindow:t,uid:l,timestamp:performance.now(),onResponse:s};o[l]=u}var h=r(l,a,i,!!s);t.postMessage(h,n)},t.receiveMessage=function(t,e,r){if(e){if(e.type===i&&e.waitForResponse){var l={uid:e.uid,timestamp:performance.now(),sourceWindow:r};a[e.uid]=l}if(e.type===n){var u=e.uid,h=o[u];o[u]=null,h.onResponse&&h.onResponse(e.message)}}s&&s(t,e.message,e.uid)},t.respondToMessage=function(t,e){var i=a[t];if(i&&i.sourceWindow){var o=r(t,e,n,!1);i.sourceWindow.postMessage(o,"*"),a[o.uid]=null}}}(n),t.exports=n},function(t,e,i){"use strict";(function(e){var n,r,o,a=i(49),s=i(0),l=i(12),u=i(187),h=i(29),c=i(48),d=i(14),p=(i(188),i(3)),f=i(1),m=i(189),g=i(4).EventEmitter,v=i(22),y=i(190),b=-1,w=0;function x(t,e,i){this.scene=t,this.camera=e,this.renderer=null,this.stats=null,this.effects=i,this.animateCallback=null,this.composer=null,this.qualityManager=null,t.renderWidth=0,t.renderHeight=0,this.updateClock=new s.Clock,this.components=[],this.updateListeners=[],this.resizeListeners=[],this.forceUpdateSize=!1,this.started=!1,this.outlinePass=null,this.miniCameraControls=new y(this)}window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame,x.prototype=Object.create(g.prototype),x.prototype.addComponent=function(t){this.components.push(t),t.update&&this.updateListeners.push(t),t.setSize&&(this.resizeListeners.push(t),this.forceUpdateSize=!0)},x.prototype.removeComponent=function(t){var e=function(e){return e!=t};this.components=this.components.filter(e),this.updateListeners=this.updateListeners.filter(e),this.resizeListeners=this.resizeListeners.filter(e)},x.prototype.start=function(t){if(this.started)throw new d("Can't start SceneRenderer, already started");this.createContext(t),this.boluoVrInit(),this.initComposer(),this.started=!0,this.miniCameraControls.init(),(M=M.bind(this))()},x.prototype.createContext=function(t){this.renderer=new s.WebGLRenderer({preserveDrawingBuffer:!0});var e=(window.renderWidth || window.innerWidth),i=(window.renderHeight || window.innerHeight);this.renderer.setPixelRatio(window.devicePixelRatio?window.devicePixelRatio:1),this.renderer.setSize(e,i),this.emit(c.ContextCreated),this.renderer.domElement.id="house-player",t.appendChild(this.renderer.domElement)},x.prototype.getTextureTypeFromTarget=function(t,e){switch(e){case t.TEXTURE_CUBE_MAP_POSITIVE_X:case t.TEXTURE_CUBE_MAP_NEGATIVE_X:case t.TEXTURE_CUBE_MAP_POSITIVE_Y:case t.TEXTURE_CUBE_MAP_NEGATIVE_Y:case t.TEXTURE_CUBE_MAP_POSITIVE_Z:case t.TEXTURE_CUBE_MAP_NEGATIVE_Z:return u.TextureCube;case t.TEXTURE_2D:return u.Texture2D;default:return null}},x.prototype.overrideTextures=function(){var t=this.renderer.context,e=0,i=t.createTexture;t.createTexture=function(){var n=i.call(t);return n.id=e++,this.textures[n.id]=n,n}.bind(this);var n=t.texImage2D;t.texImage2D=function(e,i,r,o,a,s,l,h,c){var d,p=this.getTextureTypeFromTarget(t,e);d=p===u.TextureCube?t.getParameter(t.TEXTURE_BINDING_CUBE_MAP):t.getParameter(t.TEXTURE_BINDING_2D),void 0!==l?n.call(t,e,i,r,o,a,s,l,h,c):(l=o,h=a,o=(c=s).naturalWidth,a=c.naturalHeight,n.call(t,e,i,r,l,h,c));var f=this.textures[d.id];f.width=p===u.TextureCube?6*o:o,f.height=a}.bind(this);var r=t.deleteTexture;t.deleteTexture=function(e){delete this.textures[e.id],r.call(t,e)}.bind(this)},x.prototype.initComposer=function(){var t=(window.renderWidth || window.innerWidth)*this.renderer.getPixelRatio(),e=(window.renderHeight || window.innerHeight)*this.renderer.getPixelRatio();this.composer=new s.EffectComposer(this.renderer);var i=new s.RenderPass(this.scene,this.camera);this.composer.addPass(i),this.outlinePass=new s.OutlinePass(new s.Vector2(t,e),this.scene,this.camera),this.outlinePass.visibleEdgeColor.set(59381),this.outlinePass.hiddenEdgeColor.set(59381),this.outlinePass.edgeThickness=1,this.outlinePass.edgeStrength=3,this.composer.addPass(this.outlinePass);var n=new s.SMAAPass(t,e);n.renderToScreen=!0,this.composer.addPass(n)},x.prototype.setSize=function(t,e){this.renderWidth=t,this.renderHeight=e,this.effects.aspect=t/e,this.renderer.setSize(t,e),this.composer.setSize(t,e);for(var i=0;i<this.resizeListeners.length;i++)this.resizeListeners[i].setSize(t,e);G.render=this},x.prototype.render=function(t){this.renderer.setViewport(0,0,(window.renderWidth || window.innerWidth),(window.renderHeight || window.innerHeight)),0<this.effects.currentBlur?this.composer.render(t):this.renderer.render(this.scene,this.camera),this.miniCameraControls.render()},x.prototype.boluoVrInit=function(){this.isHuawei5X=p.detectHUAWEI5X(),this.oldRenderer=this.renderer,this.newRenderer=new this.vrRenderer(this.renderer,this,this.camera);var t=this;window._vrEnabled=!1,Object.defineProperty(t,"vrEnabled",{get:function(){return window._vrEnabled},set:function(e){(e=!!e)?(t.renderer=t.newRenderer,window.vrMarkers.forEach((function(t){t.visible=!0}))):(t.renderer=t.oldRenderer,window.vrMarkers.forEach((function(t){t.visible=!1}))),t.cursor.visible=e,t.setSize((window.renderWidth || window.innerWidth),(window.renderHeight || window.innerHeight)),window._vrEnabled=e}}),this.createCursor(.5,!1,1,16777215,0);var e={setSize:function(e,i){t.camera.aspect=e/i}};this.resizeListeners.push(e),this.vrLoadingInit()},x.prototype.vrLoadingInit=function(){var t=new(t=function(t){var e=this,i=new s.RingGeometry(1.3,1.5,32,32,0,1.2*Math.PI),n=new s.MeshBasicMaterial({color:4967932,side:s.DoubleSide}),r=new s.Mesh(i,n);this.mesh=r,r.position.z=-2,r.scale.set(.08,.08,.08),r.visible=!1,t.add(r),e.enabled=!1,this.update=function(t){1==e.enabled&&(r.rotation.z+=15*t)}})(this.camera);window.Loading=t,this.updateListeners.push(t)},x.prototype.createCursor=function(t,e,i,n,r){var o,a=new s.SpriteMaterial({opacity:i,color:n,transparent:e,map:this.boluoGetTexture(v.splitUrl("./images/cursor.png")),needsUpdate:!0,side:s.DoubleSide});a.map.offset=new s.Vector2(1/17*r,0),a.map.repeat=new s.Vector2(1/17,1),a.depthTest=!1,a.blending=s.AdditiveBlending,(o=new s.Sprite(a)).scale.set(t,t,t),o.position.z=-2,o.visible=!1,o.name="cursor",this.camera.add(o),this.scene.add(this.camera),this.cursor=o;var l=new this.CursorAnimation(this.scene,o,this.camera);this.cursor.triggerTargetEvent=l.triggerTargetEvent,this.updateListeners.push(l)},x.prototype.CursorAnimation=function(t,i,n){this.cursor=i,this.raycaster=new s.Raycaster,this.targetEventObj={},this.type=1,this.tweenFlag=!0,this.target=n,this.euler=new s.Euler,this.q0=new s.Quaternion,this.q1=new s.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),this.zee=new s.Vector3(0,0,1),this.alpha=-1e3,this.beta=-1e3,this.gamma=-1e3,this.orient=s.Math.degToRad(window.orientation||0);var r=this;window.addEventListener("orientationchange",(function(){r.orient=s.Math.degToRad(window.orientation||0)})),window.addEventListener("deviceorientation",(function(t){var i=s.Math.degToRad(t.alpha),n=s.Math.degToRad(t.beta),o=s.Math.degToRad(t.gamma);this.isHuawei5X?(-1e3===r.alpha&&(r.alpha=i),-1e3===r.beta&&(r.beta=n),-1e3===r.gamma&&(r.gamma=o),Math.abs(i-r.alpha)>.06&&(r.alpha=i),Math.abs(n-r.beta)>.006&&(r.beta=n),Math.abs(o-r.gamma)>.006&&(r.gamma=o)):(r.alpha=i,r.beta=n,r.gamma=o);if(f.vrDebug){e("#info-device-orientation").css("display","block");var a="";a+="alpha=("+r.alpha+")<BR/>",a+="beta=("+r.beta+")<BR/>",a+="gamma="+r.gamma+"<BR/>",document.getElementById("info-device-orientation").innerHTML=a}})),this.setObjectQuaternion=function(t,e,i,o,a){r.euler.set(i,e,-o,"YXZ"),t.setFromEuler(r.euler),t.multiply(r.q1),t.multiply(r.q0.setFromAxisAngle(r.zee,-a)),n.updateMatrixWorld()},parent!==window&&window.addEventListener("message",(function(t){if(!t.data.type||"ZqApi.TagModule"!==t.data.type){var e=JSON.parse(t.data),i=-1!==window.navigator.userAgent.indexOf("KIW-TL00H");e&&e.alpha&&e.beta&&e.gamma&&function(t){var i=s.Math.degToRad(e.alpha),n=s.Math.degToRad(e.beta),o=s.Math.degToRad(e.gamma);t?(-1e3===r.alpha&&(r.alpha=i),-1e3===r.beta&&(r.beta=n),-1e3===r.gamma&&(r.gamma=o),Math.abs(i-r.alpha)>.06&&(r.alpha=i),Math.abs(n-r.beta)>.006&&(r.beta=n),Math.abs(o-r.gamma)>.006&&(r.gamma=o)):(r.alpha=i,r.beta=n,r.gamma=o)}(i)}})),this.update=function(t){a.update(),window._vrEnabled&&(this.setObjectQuaternion(this.target.quaternion,this.alpha,this.beta,this.gamma,this.orient),this.triggerTargetEvent())},this.triggerTargetEvent=function(){var t=this.choseObj(),e=t?t.object:void 0;this.targetEventObj.currentObj=e,e!==this.targetEventObj.lastObj&&(e&&this.autoCursorPosition(t),1===this.type?(this.cursorAnimate&&this.cursorAnimate.stop(),e&&e.enabled&&this.startAnimate(function(){this.clickCallback(e)}.bind(this))):this.type,this.targetEventObj.lastObj=e)},this.choseObj=function(){this.raycaster.setFromCamera({x:0,y:0},n);this.raycaster.ray;var t=window.vrMarkers,e=this.raycaster.intersectObjects(t);if(e.length>0)return e[0]},this.clickCallback=function(t){this.runTHREEAction(t,"onclick")},this.runTHREEAction=function(t,e){switch(e){case"onclick":t._listeners&&t._listeners.click&&t._listeners.click.forEach((function(t){t()}));break;case"onhover":t._listeners&&t._listeners.hover&&t._listeners.hover.forEach((function(t){t()}));break;case"onout":t._listeners&&t._listeners.out&&t._listeners.out.forEach((function(t){t()}))}},this.startAnimate=function(t){this.tweenFlag&&this.initAnimation(t)},this.initAnimation=function(t){var e=this,i=this.cursor.material.map.offset;e.tweenFlag=!1,this.cursorAnimate=new a.Tween(i).to({x:1},1e3).onStart((function(){e.tweenFlag=!1})).onStop((function(){e.tweenFlag=!0,this.x=0,i.x=0})).onUpdate((function(){})).onComplete((function(){t(),i.x=0,setTimeout((function(){e.tweenFlag=!0}),1500)})),this.cursorAnimate.easing((function(t){return Math.floor(17*t)/17})),this.cursorAnimate.start()},this.autoCursorPosition=function(t){var e=Math.abs(t.distance-10);this.cursor.position.z=-e,e/=10,this.cursor.scale.set(e,e,e)}},x.prototype.vrRenderer=function(t,e,i){var n=new e.vrCamera(i);n.bananaAspect=.8,this.width,this.height;e=this;this.setSize=function(i,n){t.setSize.call(this,i,n),e.width=i,e.height=n},this.render=function(e,i,r,o){var a,s;if(i.__RESS__SKIP__STEREO__)return t.render(e,i,r,o);if("PerspectiveCamera"===i.type)a=n.cameraL,s=n.cameraR,e.updateMatrixWorld(),null===i.parent&&i.updateMatrixWorld(),n.vrCameraUpdate(i);else{if("OrthographicCamera"!==i.type)return DEBUG&&void 0;a=s=i}t.setScissorTest(!0),t.setScissor(0,0,this.width/2,this.height),t.setViewport(0,0,this.width/2,this.height),t.render.call(this,e,a,r,o),t.setScissor(this.width/2,0,this.width/2,this.height),t.setViewport(this.width/2,0,this.width/2,this.height),t.render.call(this,e,s,r,o),t.setScissorTest(!1)},this.__proto__={__proto__:t}},x.prototype.vrCamera=function(t){this.type="StereoCamera",this._aspect=1,this._overlap=.064,this.cameraL=new s.PerspectiveCamera,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new s.PerspectiveCamera,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this.eyeRight=new s.Matrix4,this.eyeLeft=new s.Matrix4,this.vrCameraNeedsUpdate=!0,Object.defineProperty(this,"bananaAspect",{get:function(){return this._aspect},set:function(t){this._aspect!==t&&(this.vrCameraNeedsUpdate=!0),this._aspect=t}}),Object.defineProperty(this,"overlap",{get:function(){return this._overlap},set:function(t){this._overlap!==t&&(this.vrCameraNeedsUpdate=!0),this._overlap=t}}),this.vrCameraUpdate=function(t){if(this.vrCameraNeedsUpdate=this.vrCameraNeedsUpdate||this.bananaFov!==t.fov||this.bananaReal_aspect!==t.aspect*this.bananaAspect||this.bananaNear!==t.near||this.bananaFar!==t.far,this.vrCameraNeedsUpdate){this.vrCameraNeedsUpdate=!1,this.bananaFocus=t.focus,this.bananaFov=t.fov,this.bananaReal_aspect=t.aspect*this.bananaAspect,this.bananaNear=t.near,this.bananaFar=t.far,this.bananaFocus=10;var e,i,n=t.projectionMatrix.clone(),r=this.overlap/2,o=r*this.bananaNear/this.bananaFocus,a=this.bananaNear*Math.tan(Math.PI/180*this.bananaFov*.5);this.eyeLeft.elements[12]=-r,this.eyeRight.elements[12]=r,e=-a*this.bananaReal_aspect+o,i=a*this.bananaReal_aspect+o,n.elements[0]=2*this.bananaNear/(i-e),n.elements[8]=(i+e)/(i-e),this.cameraL.projectionMatrix.copy(n),e=-a*this.bananaReal_aspect-o,i=a*this.bananaReal_aspect-o,n.elements[0]=2*this.bananaNear/(i-e),n.elements[8]=(i+e)/(i-e),this.cameraR.projectionMatrix.copy(n)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(this.eyeLeft),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(this.eyeRight)}},x.prototype.boluoGetTexture=function(t){var e=new s.TextureLoader;return e.crossOrigin="anonymous",e.load(t)},x.prototype.updateScreenSize=function(){((window.renderWidth || window.innerWidth)!=this.renderWidth||(window.renderHeight || window.innerHeight)!=this.renderHeight||this.forceUpdateSize)&&(this.setSize((window.renderWidth || window.innerWidth),(window.renderHeight || window.innerHeight)),this.forceUpdateSize=!1)},x.prototype.updateComponents=function(){for(var t=Math.min(1,this.updateClock.getDelta()),e=0;e<this.updateListeners.length;e++)this.updateListeners[e].update(t)},x.prototype.computeCompassAngle=function(){var t=this.camera.getWorldDirection(new s.Vector3),e=(new s.Vector2).subVectors(new s.Vector2(t.z,t.x),new s.Vector2(0,-1));e.y=e.y-1;var i=e.length(),n=Math.acos(e.x/i);e.y<0&&(n*=-1),n=180*n/Math.PI+180,this.emit("compass",n)},x.prototype.getImageData=(r=document.createElement("canvas"),o=r.getContext("2d"),function(t,e,i){return r.width==e&&r.height==i||(r.width=e,r.height=i),o.drawImage(t,0,0,e,i),o.getImageData(0,0,e,i)}),x.prototype.initSizedTexture2D=function(t,e,i){var n=this.renderer,r=n.context,o=n.state,a=new s.Texture(null);a.flipY=!1,!0!==i&&(i=!1),a.generateMipmaps=i;var l=n.paramThreeToGL(a.format),u=n.paramThreeToGL(a.type),h=n.properties.get(a),c=r.createTexture();o.bindTexture(r.TEXTURE_2D,c),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,a.flipY),r.texImage2D(r.TEXTURE_2D,0,l,t,t,0,l,u,null),a.wrapS=e,a.wrapT=e;var d=n.paramThreeToGL(e);return r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,d),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,d),i?(a.magFilter=s.LinearFilter,a.minFilter=s.LinearMipMapLinearFilter,r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR_MIPMAP_NEAREST),r.generateMipmap(r.TEXTURE_2D)):(a.magFilter=s.LinearFilter,a.minFilter=s.LinearFilter,r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR)),o.bindTexture(r.TEXTURE_2D,null),h.__webglTexture=c,a},x.prototype.initSizedCubeMap=function(t,e){var i=this.renderer,n=i.context,r=i.state,o=new s.CubeTexture([null,null,null,null,null,null]);o.flipY=!1,o.generateMipmaps=e;var a=i.paramThreeToGL(o.format),l=i.paramThreeToGL(o.type),u=i.properties.get(o),h=n.createTexture();r.bindTexture(n.TEXTURE_CUBE_MAP,h),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,o.flipY);for(var c=0;c<6;c++)n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X+c,0,a,t,t,0,a,l,null);return e?(o.magFilter=s.LinearFilter,o.minFilter=s.LinearMipMapLinearFilter,n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MIN_FILTER,n.LINEAR_MIPMAP_LINEAR),n.texParameteri(n.TEXTURE_CUBE_MAP,n.GENERATE_MIPMAP,n.TRUE),n.generateMipmap(n.TEXTURE_CUBE_MAP)):(o.magFilter=s.LinearFilter,o.minFilter=s.LinearFilter,n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_CUBE_MAP,n.TEXTURE_MIN_FILTER,n.LINEAR)),r.bindTexture(n.TEXTURE_CUBE_MAP,null),u.__image__webglTextureCube=h,o},x.prototype.deallocateCubeTexture=function(t){var e=this.renderer,i=e.context,n=e.properties.get(t);i.deleteTexture(n.__image__webglTextureCube)},x.prototype.uploadTexture2D=function(t,e,i,n,r,o){var a=this.renderer,s=a.context,l=a.state,u=a.properties.get(e);l.bindTexture(s.TEXTURE_2D,u.__webglTexture),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,e.flipY),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.premultiplyAlpha),s.pixelStorei(s.UNPACK_ALIGNMENT,e.unpackAlignment),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,a.paramThreeToGL(e.wrapS)),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,a.paramThreeToGL(e.wrapT)),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,a.paramThreeToGL(e.magFilter)),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,a.paramThreeToGL(e.minFilter)),s.texSubImage2D(s.TEXTURE_2D,0,i,n,s.RGBA,s.UNSIGNED_BYTE,t),e.generateMipmaps&&s.generateMipmap(s.TEXTURE_2D),l.bindTexture(s.TEXTURE_2D,null)},x.prototype.rebuildMipMaps2D=function(t){var e=this.renderer,i=e.context,n=e.state;e.properties.get(t),i.generateMipmap(i.TEXTURE_2D),n.bindTexture(i.TEXTURE_2D,null)},x.prototype.rebuildMipMaps3D=function(t){var e=this.renderer,i=e.context,n=e.state,r=e.properties.get(t);n.bindTexture(i.TEXTURE_CUBE_MAP,r.__image__webglTextureCube),i.generateMipmap(i.TEXTURE_CUBE_MAP),n.bindTexture(i.TEXTURE_CUBE_MAP,null)},x.prototype.renderToCubeMap=function(){var t=!1,e=null,i=null,n=null,r=null,o=null;return function(a,u,h,c,d,p,f,m,g,v,y,b,w,x,M,T){this.renderer.context,t||((i=new s.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z=150,(e=new s.Scene).add(i),n=new s.ShaderMaterial({uniforms:{tDiffuse:{type:"t",value:null},alpha:{type:"f",value:1}},vertexShader:l.basicTextured.vertexShader,fragmentShader:l.basicTextured.fragmentShader,depthWrite:!1,depthTest:!1,side:s.DoubleSide}),r=new s.PlaneBufferGeometry(1,1),(o=new s.Mesh(r,n)).position.z=0,e.add(o),t=!0);var S=r.getAttribute("uv");S.setDynamic(!0),S.needsUpdate=!0;var _=S.array,A=d/h,P=p/c,C=f/h,E=m/c;_[0]=A,_[1]=P+E,_[2]=A+C,_[3]=P+E,_[4]=A,_[5]=P,_[6]=A+C,_[7]=P;var D=r.getAttribute("position");D.setDynamic(!0),D.needsUpdate=!0;var L=D.array,O=g/u.width-.5,I=v/u.height-.5,R=y/u.width,N=b/u.height;L[0]=O,L[1]=I+N,L[3]=O+R,L[4]=I+N,L[6]=O,L[7]=I,L[9]=O+R,L[10]=I,this.renderer.properties.get(a),n.uniforms.tDiffuse.value=a,n.blending=x||s.NoBlending,n.transparent=!!M,null!=T||(T=1),n.uniforms.alpha.value=T,n.needUpdate=!0,u.activeCubeFace=w,u.viewport.set(0,0,u.width,u.height);var k=this.renderer.autoClear;this.renderer.autoClear=!1,this.renderer.render(e,i,u,!1),this.renderer.autoClear=k}}(),x.prototype.copyCubeMap=function(){var t=!1,e=null,i=null,n=null,r=null,o=null,a=new s.Euler;return new s.Vector3,function(u,h,c,d,p,f,m,g,v){if(this.renderer,!t){(i=new s.OrthographicCamera(-1,1,1,-1,0,200)).position.set(0,0,0),(e=new s.Scene).add(i),n=new s.ShaderMaterial({uniforms:{tDiffuse:{type:"t",value:null},alpha:{type:"f",value:1}},vertexShader:l.copyCubeMap.vertexShader,fragmentShader:l.copyCubeMap.fragmentShader,depthWrite:!1,depthTest:!1,side:s.DoubleSide}),r=new s.BoxGeometry(2,2,2),o=new s.Mesh(r,n),e.add(o),t=!0}for(var y=0;y<6;y++)x.getCubeOrientationForCubeFace(y,a),o.rotation.copy(a),o.matrixWorldNeedsUpdate=!0,o.updateMatrixWorld(),n.uniforms.tDiffuse.value=u,n.blending=m||s.NoBlending,n.transparent=!!g,null!=v||(v=1),n.uniforms.alpha.value=v,n.needUpdate=!0,h.activeCubeFace=y,h.viewport.set(0,0,p,f),this.renderer.render(e,i,h,!1)}}(),x.getCubeOrientationForCubeFace=function(t,e){switch(t){case h.GL_TEXTURE_CUBE_MAP_POSITIVE_X:e.set(0,-Math.PI/2,0);break;case h.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:e.set(0,Math.PI/2,0);break;case h.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:e.set(Math.PI/2,Math.PI,0);break;case h.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:e.set(-Math.PI/2,Math.PI,0);break;case h.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:e.set(0,-Math.PI,0);break;case h.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:e.set(0,0,0)}},x.prototype.renderSolidTileToCubeMap=function(){var t=!1,e=null,i=null,n=null,r=null,o=null;return function(a,l,u,h,c,d,p,f,m,g){if(this.renderer.context,!t){(i=new s.OrthographicCamera(-.5,.5,.5,-.5,-200,200)).position.z=150,(e=new s.Scene).add(i);var v=["void main() { "," vec4 pos = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );"," gl_Position = pos; ","}"].join("\n"),y=["uniform vec4 blockColor;","uniform float alpha;","void main() {"," gl_FragColor = vec4(blockColor.rgb, alpha);","}"].join("\n");n=new s.ShaderMaterial({uniforms:{blockColor:{type:"v4",value:null},alpha:{type:"f",value:1}},vertexShader:v,fragmentShader:y,depthWrite:!1,depthTest:!1,side:s.DoubleSide}),(r=new s.PlaneBufferGeometry(1,1)).getAttribute("position"),(o=new s.Mesh(r,n)).position.z=0,e.add(o),t=!0}n.uniforms.blockColor.value=p,null!=g||(g=1),n.uniforms.alpha.value=g,n.blending=f||s.NoBlending,n.transparent=!!m,n.needUpdate=!0,a.activeCubeFace=d,a.viewport.set(l,u,h,c),this.renderer.render(e,i,a,!1)}}(),x.prototype.showFPS=function(){this.stats=new m,document.body.appendChild(this.stats.domElement)};var M=function(t){if(window.requestAnimationFrame(M),this.updateScreenSize(),this.updateComponents(),this.render(t),this.stats&&this.stats.update(),-1==b&&G.model.settings.basic&&G.model.settings.basic.user){var e=G.model.settings.basic.user.group;b=15==e?1:0}if(1==b&&!0===G.startEntryPage&&!G.frameRate&&G.player&&"panorama"===G.player.mode){n||(n=(performance||Date).now());var i=function(){var t;w++;var e=(performance||Date).now();if(e>=n+1e3&&(t=1e3*w/(e-n),n=e,w=0),t)return Math.ceil(t)}();G.frameRate=i}this.computeCompassAngle(),this.emit(c.AfterRender)};x.prototype.mesaueLensRender=function(t,e,i,n){this.renderer.render(t,e,i,n)},t.exports=x}).call(this,i(6))},function(t,e){t.exports={Texture2D:0,TextureCube:1}},function(t,e,i){function n(t){r.call(this,t)}var r=i(14);n.prototype=Object.create(r.prototype),t.exports=n},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 o=(performance||Date).now(),a=o,s=0,l=t(new n.Panel("FPS","#0ff","#002")),u=t(new n.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var h=t(new n.Panel("MB","#f08","#201"));return e(0),{REVISION:16,dom:r,addPanel:t,showPanel:e,begin:function(){o=(performance||Date).now()},end:function(){s++;var t=(performance||Date).now();if(u.update(t-o,200),t>a+1e3&&(l.update(1e3*s/(t-a),100),a=t,s=0,h)){var e=performance.memory;h.update(e.usedJSHeapSize/1048576,e.jsHeapSizeLimit/1048576)}return t},update:function(){o=this.end()},domElement:r,setMode:e}}).Panel=function(t,e,i){var n=1/0,r=0,o=Math.round,a=o(window.devicePixelRatio||1),s=80*a,l=48*a,u=3*a,h=2*a,c=3*a,d=15*a,p=74*a,f=30*a,m=document.createElement("canvas");m.width=s,m.height=l,m.style.cssText="width:80px;height:48px";var g=m.getContext("2d");return g.font="bold "+9*a+"px Helvetica,Arial,sans-serif",g.textBaseline="top",g.fillStyle=i,g.fillRect(0,0,s,l),g.fillStyle=e,g.fillText(t,u,h),g.fillRect(c,d,p,f),g.fillStyle=i,g.globalAlpha=.9,g.fillRect(c,d,p,f),{dom:m,update:function(l,v){n=Math.min(n,l),r=Math.max(r,l),g.fillStyle=i,g.globalAlpha=1,g.fillRect(0,0,s,d),g.fillStyle=e,g.fillText(o(l)+" "+t+" ("+o(n)+"-"+o(r)+")",u,h),g.drawImage(m,c+a,d,p-a,f,c,d,p-a,f),g.fillRect(c+p-a,d,a,f),g.fillStyle=i,g.globalAlpha=.9,g.fillRect(c+p-a,d,a,o((1-l/v)*f))}}},n)},function(t,e,i){var n=i(0),r=i(8),o=i(10),a=null,s=null,l={top:-451,left:(window.renderWidth || window.innerWidth)-480-260},u=!0;function h(t){a=t,this.player=null,s=this}h.prototype.init=function(){this.player=G.player,a.miniCamera=new n.PerspectiveCamera,a.on("virtual-update-position",(function(t){a.miniCamera=new n.PerspectiveCamera(t.fov,1,.5,t.distance),a.miniCamera.position.copy(t.positions[0]),a.miniCamera.quaternion.copy(t.quaternion),a.miniCamera.lookAt(t.positions[1]),a.miniCamera.updateProjectionMatrix()})),s.player.updateMiniCameraPosition=function(t){r.start(o.property(l,t.direction,t.new),200),"left"===t.direction&&(u=!(t.new>t.old))},s.player.on("choosed-virtual-camera",(function(){l.left=(window.renderWidth || window.innerWidth)-480-260,r.start(o.property(l,"top",0),200)})),s.player.on("hidePutModelInfoPanel",(function(){r.start(o.property(l,"top",-415),200),l.left=(window.renderWidth || window.innerWidth)-480-260})),s.player.miniCameraScreenShot=function(t){s.getImage(t)},s.player.saveVirturalCameraScreenshot=function(){var t=window.screenshotData,e=[];return t.forEach((function(t,i){e.push({uuid:i,name:t.name,url:t.url})})),t=null,JSON.stringify(e)}},h.prototype.render=function(){a.renderer.clearDepth(),a.renderer.setScissorTest(!0),a.renderer.setScissor(l.left,l.top,480,360),a.renderer.setViewport(l.left,l.top,480,360),a.renderer.render(a.scene,a.miniCamera),a.renderer.setScissorTest(!1)},h.prototype.getImage=function(t){var e=new Image;e.src=a.renderer.domElement.toDataURL("image/png",1),e.onload=function(){var i=document.createElement("canvas"),n=i.getContext("2d");i.width=480*window.devicePixelRatio,i.height=360*window.devicePixelRatio,n.drawImage(e,l.left*window.devicePixelRatio,0,(window.renderWidth || window.innerWidth)*window.devicePixelRatio,(window.renderHeight || window.innerHeight)*window.devicePixelRatio,0,0,(window.renderWidth || window.innerWidth)*window.devicePixelRatio,(window.renderHeight || window.innerHeight)*window.devicePixelRatio);var r=i.toDataURL("image/png");t&&t(r)}},window.addEventListener("resize",(function(){l.left=u?(window.renderWidth || window.innerWidth)-480-260:(window.renderWidth || window.innerWidth)-480-5})),t.exports=h},function(t,e,i){(function(e){function n(t,e,i,n){this.qualityManager=t,this.scene=e,this.camera=i,this.container=n,this.quickstartCamera=new p,this.endFOV=a.insideFOV,this.quickstartCamera.fov=this.endFOV+g.quickstart.fovChange,this.controls=new f(this.quickstartCamera),this.controls.bindEvents(n),this.controls.enabled=!0,this.controls.locked=!0,this.skybox=null}var r=i(0),o=i(2),a=i(26),s=i(8),l=i(10),u=i(15),h=i(18),c=i(23),d=(i(43),i(192)),p=i(37),f=i(35),m=(i(30),i(75),i(193)),g=(i(3),i(1)),v=i(194),y=new o("/js/scene/QuickstartManager.js");n.prototype.load=function(t){t.pano.shouldRedrawOnBaseLoaded=!0;var i,n=this,r=h.FORWARD.clone().applyQuaternion(t.quaternion),o=r.clone().negate();this.controls.lookAt(r.add(this.quickstartCamera.position));var a=this.qualityManager.getPanoSize(c.BASE);this.qualityManager.getPanoSize(c.STANDARD);if(t.pano.tiled){window.loadingCount=1,window.firstPanoId=t.pano.id,y.warn("Loading startPano, TILED",t.pano.id),t.pano.update();var s=m.getHFOVForCamera(this.quickstartCamera,(window.renderWidth || window.innerWidth),(window.renderHeight || window.innerHeight)),l=this.quickstartCamera.fov;y.warn("Quickstart loading tiles in frustum: [horizontal FOV: "+s+", vertical FOV: "+l+"]"),i=t.pano.loadTiledPano(a,o,null,!1,!1,!0)}else y.warn("Loading startPano",t.pano.id),i=t.pano.loadCube("high");return e.when(i).then(function(){n.init(t.pano,t.quaternion),t.pano.tiled?i.done(function(){t.pano.lockUntilRenderingComplete=!1,this.controls.locked=!1}.bind(this)):this.controls.locked=!1}.bind(this))},n.prototype.init=function(t,i){y.info("Quickstart done loading, adding scene objects"),t.lockUntilRenderingComplete=!0,this.skybox=new r.Mesh(new r.CubeGeometry(1,1,1),new d({side:r.BackSide})),this.skybox.material.uniforms.map.value=t.skybox,this.skybox.quaternion.copy(t.quaternion),this.scene.add(this.skybox),e(this.container).show()},n.prototype.update=function(t){this.controls.update(t),this.camera.copy(this.quickstartCamera)},n.prototype.setSize=function(t,e){this.quickstartCamera.updateAspect(t/e)},n.prototype.destroy=function(){this.scene.remove(this.skybox)},n.prototype.startLanding=function(){function t(){var t=s.getById("quickAnimation"),e=t.length>0?t[0].current:g.quickstart.animation,n=e<g.quickstart.animation?g.quickstart.animation-e:0;setTimeout(r,n),i()}function i(){o.forEach((function(e){document.body.removeEventListener(e,t,!0)}))}var n=e.Deferred(),r=n.resolve.bind(n);s.start(l.property(this.quickstartCamera,"fov",this.endFOV,function(){this.quickstartCamera.updateProjectionMatrix()}.bind(this)),g.quickstart.animation,null,0,u.easeOutQuad,null,"quickAnimation");var o=["touchstart","mousedown","keydown"];o.forEach((function(e){document.body.addEventListener(e,t,!0)}));var a=v.isQuickstartHelpEnabled()?g.quickstart.fadeOutDelay:g.quickstart.animation;return setTimeout(r,a),setTimeout(i,a),n.promise()},t.exports=n}).call(this,i(6))},function(t,e,i){function n(t){t=t||{},r.RawShaderMaterial.call(this,a.extendObject({fragmentShader:o.cube.fragmentShader,vertexShader:o.cube.vertexShader,uniforms:r.UniformsUtils.clone(o.cube.uniforms),name:"CubemapMaterial"},t))}var r=i(0),o=i(12),a=i(7);n.prototype=Object.create(r.RawShaderMaterial.prototype),n.prototype.constructor=n,t.exports=n},function(t,e,i){var n=i(56),r=function(t,e,i){var r=e,o=i;return 2*Math.atan(Math.tan(t*n.RADIANS_PER_DEGREE/2)*(r/o))*n.DEGREES_PER_RADIAN};t.exports={getHFOVForCamera:function(t,e,i){return r(t.fov,e,i)},getHFOVFromVFov:r}},function(t,e,i){var n=i(3),r=i(2),o=i(1),a=new r("/js/gui/helpManager.js"),s=function(){var t;try{return t=window.localStorage.getItem("visitCount")||"0",t=(parseFloat(t)+1).toString(),window.localStorage.setItem("visitCount",t),a.debug("visitCount = "+t),t}catch(e){t="1",a.debug("couldn't set local storage")}}();t.exports={isHelpEnabled:function(){return("1"===s||"1"===n.valueFromHash("help",null))&&"0"!==n.valueFromHash("help",null)&&o.warp.auto<0},isQuickstartHelpEnabled:function(){if(o.quickstart.enabled&&this.isHelpEnabled())return!0},isStandardHelpEnabled:function(){if(!o.quickstart.enabled&&this.isHelpEnabled())return!0}}},function(t,e,i){function n(t,e,i){this.maxNavPanoSize=-1,this.maxZoomPanoSize=-1,this.devicePixelDensity=t,this.deviceScreenSize=e,this.clientBandwidth=i,this.panoSizeClassMap={},this.useHighResolutionPanos=!0,this.useUltraHighResolutionPanos=!1,this.modelHasUltraHighPanos=!1}var r=i(23),o=i(1),a=i(3),s=i(26),l=(i(25),i(21));n.prototype.init=function(t){this.buildPanoSizeClassMap(this.devicePixelDensity,this.deviceScreenSize,this.clientBandwidth),this.ultraHighSize=this.getPanoSize(r.ULTRAHIGH),this.highSize=this.getPanoSize(r.HIGH),this.standardSize=this.getPanoSize(r.STANDARD),this.baseSize=this.getPanoSize(r.BASE),o.tiling.maxZoomPanoQuality&&this.ultraHighSize<=o.tiling.maxZoomPanoQuality&&(o.tiling.allowUltraHighResolution=!0),this.highQualityThreshold=a.valueFromHash("threshold2k",s.windowHeightHighQualityThreshold),this.updateMaximums(),t.on(l.ActiveModelChanged,this.onModelChanged.bind(this))},n.prototype.updateFromModel=function(t){this.updateHighResolutionSettings(t),this.updateUltraHighResolutionSettings(t)},n.prototype.updateHighResolutionSettings=function(t){this.updateMaximums()},n.prototype.updateUltraHighResolutionSettings=function(t){o.tiling.allowUltraHighResolution&&this.modelHasUltraHighPanos?this.useUltraHighResolutionPanos=!0:this.useUltraHighResolutionPanos=!1,this.updateMaximums()},n.prototype.enableUltraHighQualityMode=function(){this.modelHasUltraHighPanos=!0,this.updateUltraHighResolutionSettings(null)},n.prototype.ultraHighQualityModeEnabled=function(){return this.modelHasUltraHighPanos},n.prototype.onModelChanged=function(t){this.updateFromModel(t.model),this.updateMaximums()},n.prototype.updateMaximums=function(){this.maxNavPanoSize=o.tiling.maxNavPanoQuality||this.detectMaxNavPanoSize(),this.maxZoomPanoSize=o.tiling.maxZoomPanoQuality||this.detectMaxZoomPanoSize(),this.maxZoomPanoSize<this.maxNavPanoSize&&(this.maxNavPanoSize=this.maxZoomPanoSize)},n.prototype.buildPanoSizeClassMap=function(){this.panoSizeClassMap[r.BASE]=512,this.panoSizeClassMap[r.STANDARD]=1024,this.panoSizeClassMap[r.HIGH]=2048,this.panoSizeClassMap[r.ULTRAHIGH]=4096},n.prototype.getPanoSize=function(t){return this.panoSizeClassMap[t]},n.prototype.getMaxPossiblePanoSize=function(){return this.getPanoSize(r.ULTRAHIGH)},n.prototype.getMaxPanoSize=function(){return this.maxZoomPanoSize},n.prototype.getMaxNavPanoSize=function(){return this.maxNavPanoSize},n.prototype.getMaxZoomPanoSize=function(){return this.maxZoomPanoSize},n.prototype.detectMaxNavPanoSizeClass=function(){var t="";return t=o.screenshot?o.panoramaSettings.screenshot_2k?r.HIGH:r.STANDARD:o.panoramaSettings.loading_2k?r.HIGH:r.STANDARD,this.useHighResolutionPanos?(a.isMobile()||((window.renderHeight || window.innerHeight),this.highQualityThreshold),t):r.STANDARD},n.prototype.detectMaxNavPanoSize=function(){var t=this.detectMaxNavPanoSizeClass();return this.getPanoSize(t)},n.prototype.detectMaxZoomPanoSize=function(){return this.useHighResolutionPanos?a.isMobile()?o.tiling.mobileHighQualityOverride?this.getPanoSize(r.HIGH):this.getPanoSize(r.STANDARD):this.useUltraHighResolutionPanos?this.getPanoSize(r.ULTRAHIGH):this.getPanoSize(r.HIGH):this.getPanoSize(r.STANDARD)},t.exports=n},function(t,e,i){(function(e){var n,r,o,a,s,l,u,h,c=i(0),d=i(2),p=i(7),f=i(1),m=i(24),g=i(31),v=i(21),y=i(42),b=i(20),w=i(197),x=i(4).EventEmitter,M=i(39),T=new d("/js/mattertag/MattertagManager.js");function S(){this.tagState=w.IDLE,this.intersectTag=null,this.hoveredTag=null,this.activeTag=null,this.mattertagDiscs=[],this.raycaster=new c.Raycaster,this.modelManager=null,this.player=null,this.director=null,this.totalMattertags=0,this.lastAudioTag=null,this.hide360TagForce=""}p.extend(S,x),S.prototype.init=function(t,i,n){this.modelManager=t,this.player=i,this.director=n,this.updateModel(),this.bindEvents();var r=this;e("#iframe-close, .help_back").click((function(){e("#iframe-close").addClass("css-sprites"),document.getElementsByClassName("iframe-open")[0].src="about:blank",r.dismissExaminedTag()})),e(".closeTagContainer").on("click",(function(){e(".pctagcontainer").fadeOut(300,(function(){e(".moreImages").remove()})),setTimeout((function(){e(".imageCon").attr("src","").removeClass("longimgCon highimgCon commimgCon"),e(".topimg").removeClass("topimgCss")}),300),r.dismissExaminedTag()})),G.settings.building.rooms&&(this.hasroom=!0)},S.prototype.update=function(t){this.updateTags(this.player.mode,this.player.camera,this.player.currentPano,this.player.flying)},S.prototype.updateTags=function(t,e,i,n){for(var r in this.model.mattertags)12!==this.model.mattertags[r].type&&this.model.mattertags[r].update(t,e,i,n,this.show360TagPanoId)},S.prototype.updateModel=function(){this.model=this.modelManager.getActiveModel(),this.getMattertagsFromModel(),this.totalMattertags=Object.keys(this.model.mattertags).length},S.prototype.getMattertagsFromModel=function(){for(var t in this.mattertagDiscs=[],this.model.mattertags){var e=this.model.mattertags[t].disc;e&&this.mattertagDiscs.push(e)}},S.prototype.bindEvents=function(){this.modelManager.on(v.ActiveModelChanged,this.updateModel.bind(this)),this.player.on(b.ModeChanging,this.onPlayerModeChanging.bind(this)),this.player.on(b.Move,this.onPlayerMove.bind(this)),this.player.on(b.Ready,this.onPlayerReady.bind(this)),this.player.on(b.FlyingEnded,this.onPlayerFlyingEnded.bind(this)),this.player.on(b.WarpStarted,this.handleWarpStart.bind(this)),this.player.on(b.WarpInterrupted,this.handleWarpInterruption.bind(this))},S.prototype.handleWarpStart=function(t,e,i,n){this.dismissExaminedTag(),e===m.BLACK&&(n=n||f.warp.teleportTime,t&&(i=g.END),this.hideShowTagsForBlackoutStyle(i,n))},S.prototype.handleWarpInterruption=function(t,e,i){i=i||f.warp.teleportTime,this.hideShowTagsForBlackoutStyle(e,i)},S.prototype.hideShowTagsForBlackoutStyle=function(t,e){var i=0,n=0,r=e/2;switch(null==t&&(t=g.MIDDLE),t){case g.END:this.hideAllMattertags(r);break;case g.BEGINNING:this.hideAllMattertags().done(this.showAllMattertags.bind(this,r));break;case g.NONE:break;case g.MIDDLE:i=r,n=r,this.hideAllMattertags(n),setTimeout(function(){this.showAllMattertags(i)}.bind(this),n);break;case g.FADEIN:setTimeout(function(){this.showAllMattertags(r)}.bind(this),r)}},S.prototype.onPlayerModeChanging=function(){this.dismissExaminedTag()},S.prototype.onPlayerMove=function(){this.dismissExaminedTag(!0)},S.prototype.onPlayerReady=function(t,e,i){this.startAllMattertags(t,e?i:null)},S.prototype.onPlayerFlyingEnded=function(t,e){t&&this.updateClosestTags(t)},S.prototype.dismissExaminedTag=function(t){t&&this.activeTag&&this.activeTag.type===M.Audio?(this.boardState,this.tagState=w.BROWSE):(this.activeTag&&this.tagState===w.EXAMINE&&this.dismissActiveTag(),this.hoveredTag&&(this.hoveredTag.setFreeState(!0),this.hoveredTag=null))},S.prototype.startAllMattertags=function(t,e){this.model.shouldShowMattertags=f.mattertags.enabled,t||(this.showAllMattertags(f.mattertags.startup.fadeInDuration,f.mattertags.startup.fadeInDelay),e&&setTimeout(function(){this.activateTag(this.model.getTagByIdx(e))}.bind(this),f.mattertags.startup.fadeInDuration/2))},S.prototype.showAllMattertags=function(t,i){function n(){++o===this.totalMattertags&&(this.model.tagsShown=!0,r.resolve())}var r=e.Deferred(),o=0;if(!this.model.shouldShowMattertags)return r.resolve().promise();for(var a in this.model.mattertags){var s=this.model.mattertags[a];s.type!==M.Title&&s.type!==M.RegionalJump&&s.show(t,i).done(n.bind(this))}return this.showtitletags=!0,this.updatetitletags(),r.promise()},S.prototype.updatetitletags=function(){if(this.showtitletags&&G.titletags&&"panorama"===G.player.mode){var t,i,n,r=G.player.camera.clone();this.ttagsshow=[],this.ttagshide=[];for(var o=0;o<G.titletags.length;o++)if(G.player&&G.player.currentPano&&2===G.player.currentPano.alignmentType)this.ttagsshow.push(G.titletags[o]);else if("dollhouse"!==G.player.mode&&"floorplan"!==G.player.mode)if(this.hasroom)n=G.titletags[o],G.player.currentPano&&G.model.panos.index[n.locationId]&&G.player.currentPano.roomid===G.model.panos.index[n.locationId].roomid?this.ttagsshow.push(G.titletags[o]):this.ttagshide.push(G.titletags[o]);else{if((i=(t=G.titletags[o].position).clone().distanceTo(r.position))<=f.titletagMaxdistance){var a=new c.Raycaster(r.position,r.position.clone().sub(t).normalize()).intersectObjects(G.model.colliders);if(a.length,!a.length||a[0].distance-i>-.5){this.ttagsshow.push(G.titletags[o]);continue}}this.ttagshide.push(G.titletags[o])}else this.ttagshide.push(G.titletags[o]);this.ttposition()}else e(".viewport-tag").css("display","none")},S.prototype.ttposition=function(){if(!this.ttagsshow)return!0;for(var t=G.player.camera.clone(),i=t.getWorldDirection(new c.Vector3),n=0;n<this.ttagsshow.length;n++){var r=this.ttagsshow[n],o=r.position;if(o.clone().sub(t.position).normalize().angleTo(i)>Math.PI/2)e("#titletag"+r.i).css("display","none");else{var a=o.clone().project(t),s=(a.x+1)/2*100,l=(1-a.y)/2*100;e("#titletag"+r.i).css({display:"",left:s+"%",top:l+"%"})}}for(n=0;n<this.ttagshide.length;n++)e("#titletag"+this.ttagshide[n].i).css("display","none")},S.prototype.updateRegionalJumpTags=function(t){var e=null;for(var i in this.model.mattertags){var n=this.model.mattertags[i],r=n.data;i>=3e4&&(t.roomid===n.data.roomidx?(n.isTargetRoomHavePoint=!1,e=new c.Line3(new c.Vector3(r.base.x,0,r.base.z),new c.Vector3(t.position.x,0,t.position.z)),this.model.settings.locations.points.forEach((function(t){t.roomidx===n.data.target_room&&(n.isTargetRoomHavePoint=!0)})),!n.isTargetRoomHavePoint||e.distance()<1?n.hide(0,0):n.show(0,0)):n.hide(0,0))}},S.prototype.hideAllMattertags=function(t,i){function n(){++o===this.totalMattertags&&(this.model.tagsShown=!1,r.resolve())}var r=e.Deferred(),o=0;for(var a in this.model.mattertags){var s=this.model.mattertags[a];s.type!==M.RegionalJump&&s.type!==M.Title&&-1!==s.tagid&&-2!==s.tagid&&(s.hide(t,i).done(n.bind(this)),s===this.activeTag&&this.dismissActiveTag()),s.type!==M.RegionalJump&&s.type!==M.Title&&-1!==s.tagid&&-2!==s.tagid?(s.hide(t,i).done(n.bind(this)),s===this.activeTag&&this.dismissActiveTag()):12===s.type&&-1!==s.tagid&&-2!==s.tagid&&++o===this.totalMattertags&&(this.model.tagsShown=!1,r.resolve())}return r.promise()},S.prototype.update360Tags=function(t){var i=e.Deferred();for(var n in this.hideAllMattertags(f.mattertags.startup.fadeInDuration),this.model.mattertags){var r=this.model.mattertags[n];if(r.type==M.Tag360T1||1===r.subtype){var o=this;setTimeout((function(){o.show360TagPanoId=t}),600)}}return i.promise()},S.prototype.hideAllMattertagsExceptType=function(t,i,n){function r(){++a===this.totalMattertags&&(this.model.tagsShown=!1,o.resolve())}var o=e.Deferred(),a=0;for(var s in this.model.mattertags){var l=this.model.mattertags[s];l.type!==t&&(l.hide(i,n).done(r.bind(this)),l===this.activeTag&&this.dismissActiveTag())}return o.promise()},S.prototype.activateTag=function(t,e){e=e||w.EXAMINE,this.activeTag=t,"panorama"===this.player.mode&&(this.activeTag.type===M.IFrame||this.activeTag.type===M.ImageText||this.activeTag.type===M.ImageTextAudio||this.activeTag.type===M.Video||this.activeTag===M.IKEA?document.getElementsByTagName("html").item(0).style.cursor="default":this.activeTag.type===M.Tag360T1||(document.getElementsByTagName("html").item(0).style.cursor="default",(this.activeTag.type!=M.TextOnly&&this.activeTag!==M.TextAudio||null!=this.activeTag.label&&""!=this.activeTag.label)&&(this.activeTag.type==M.TagTo360||this.activeTag.setHoverState(e===w.EXAMINE)))),this.tagState=e,T.error("=========emitTagEvent=======state",e),this.emit(y.TagActivated,t),this.emitTagEvent(t,e)},S.prototype.activateAudioTag=function(t,e,i){e=e||w.EXAMINE,this.activeTag=t,this.activeTag.setHoverState(e===w.EXAMINE,i),this.tagState=e,this.emit(y.TagActivated,t)},S.prototype.activateOtherModelTag=function(t,e,i){e=e||w.EXAMINE,this.activeTag=t,this.activeTag.setHoverState(e===w.EXAMINE,i),this.tagState=e,this.emit(y.TagActivated,t)},S.prototype.dismissActiveTag=function(t){if(null!==this.activeTag){t?this.lastAudioTag&&this.lastAudioTag.setFreeState(!0,!0):this.activeTag.setFreeState(!0);var e=this.activeTag;this.activeTag=null,this.tagState=w.IDLE,this.emit(y.TagDismissed,e)}},S.prototype.dismissAudioActiveTag=function(){if(null!=this.activeTag){var t=this.activeTag;this.lastAudioTag.setFreeState(!0,!0),this.activeTag=null,this.tagState=w.IDLE,this.emit(y.TagDismissed,t)}},S.prototype.pauseAudioTag=function(){null!=this.lastAudioTag&&this.lastAudioTag.setFreeState(!0,!0)},S.prototype.openTag=function(t,e,i){t&&(this.activeTag=t,this.tagState=w.EXAMINE,t.setHoverState(!0,0),e&&e>=0&&(this.toid=setTimeout(function(){this.closeTag(),i&&i()}.bind(this),e)))},S.prototype.closeTag=function(){e(".pctagcontainer").fadeOut(300),e("#iframe-parent").css("display","none"),e(".help_back").css("display","none"),this.activeTag&&(this.activeTag.stopAudio(),this.activeTag.setClosedState()),this.dismissExaminedTag(),this.activeTag=null,this.tagState=w.IDLE},S.prototype.clickedOnTag=function(t,e,i){var n,r,o,a,s,l,u,h=this;if(this.intersectTag.type===M.BuildingType)return i.stopPropagation(),!0;if(this.intersectTag.type===M.TagTo360||this.intersectTag.type===M.Tag360T1){if(i.stopPropagation(),this.director){var d=function(t){var e=-1;for(var i in h.player.model.images.list)h.player.model.images.list[i].sceneid==t&&(e=i);return e}(this.intersectTag.tagInfoUrl);-1===d&&(d=0),this.director.goToHighlight(d)}return!0}if(this.intersectTag.type===M.RegionalJump){i.stopPropagation();var p=(n=this.intersectTag.data.target_room,r=this.intersectTag.data.base,o=G.settings.locations.points,a=[],s=null,l=[],u=null,o&&(o.forEach((function(t){n===t.roomidx&&(s=new c.Line3(new c.Vector3(r.x,0,r.z),new c.Vector3(t.viewpoint.x,0,t.viewpoint.y)),t.lineLength=s.distance(),l.push(s.distance()),a.push(t))})),l.sort((function(t,e){return t-e})),a.forEach((function(t){t.lineLength===l[0]&&(u=t.locationid)}))),u),f=(function(t){var e=G.settings.nestscenes.scenes,i=null,n=new c.Vector3,r=t.target_scene,o=new c.Vector3(t.base.x,0,t.base.z),a=new c.Vector3(t.end_position.x,0,t.end_position.z);e&&(e.forEach((function(t){r===parseInt(t.sceneid)&&(i=t._camera._locationid)})),G.settings.locations.points.forEach((function(t){i===t.locationid&&n.copy(t.spot).add((new c.Vector3).subVectors(a,o))})))}(this.intersectTag.data),e);h.intersectTag.data.base,h.intersectTag.data.end_position;return f.model.panos.list.forEach((function(t){p===t.id&&f.flyToPano({pano:t})})),!0}if(!(this.intersectTag.type!=M.TextOnly&&this.intersectTag!==M.TextAudio||null!=this.intersectTag.label&&""!=this.intersectTag.label))return!0;if(this.intersectTag.type==M.Pano)return!0;if(!t)return this.tagState!==w.EXAMINE?(this.intersectTag.type===M.Audio?(null==this.lastAudioTag&&(this.lastAudioTag=this.intersectTag),this.intersectTag.i==this.lastAudioTag.i?"active"==this.intersectTag.boardState?this.dismissActiveTag(!0):this.intersectTag.setHoverState(!0,0):(this.dismissActiveTag(!0),this.intersectTag.setHoverState(!0,0),this.lastAudioTag=this.intersectTag)):(this.pauseAudioTag(),this.dismissActiveTag(!0),this.intersectTag.type===M.OtherModel||this.intersectTag.type===M.IFrame||this.intersectTag.type===M.ImageText||this.intersectTag.type===M.ImageTextAudio||this.intersectTag.type===M.TextOnly||this.intersectTag.type===M.TextAudio||this.intersectTag===M.IKEA?this.intersectTag.setHoverState(!0,0):this.intersectTag.setHoverState(!0)),this.activeTag=this.intersectTag,(this.intersectTag.type!==M.IFrame&&this.intersectTag.type!==M.ImageText&&this.intersectTag.type!==M.ImageTextAudio||this.intersectTag!==M.IKEA)&&this.activeTag.examineMattertag(this.player,this.activateTag.bind(this)),this.tagState=w.EXAMINE,this.emit(y.TagNavigation,this.activeTag),!0):(this.dismissActiveTag(!0),!1);if(this.tagState===w.IDLE)return this.intersectTag.type===M.Audio?(null==this.lastAudioTag&&(this.lastAudioTag=this.intersectTag),this.intersectTag.i==this.lastAudioTag.i?this.activateAudioTag(this.intersectTag,w.EXAMINE,1):(this.dismissAudioActiveTag(),this.lastAudioTag=this.intersectTag,this.activateAudioTag(this.intersectTag,w.EXAMINE,0))):(this.pauseAudioTag(),this.dismissActiveTag(),this.intersectTag.type===M.OtherModel||this.intersectTag.type===M.IFrame||this.intersectTag.type===M.ImageText||this.intersectTag.type===M.ImageTextAudio||this.intersectTag.type===M.Video||this.intersectTag.type===M.TextOnly||this.intersectTag.type===M.TextAudio||this.intersectTag===M.IKEA?this.activateOtherModelTag(this.intersectTag,w.EXAMINE,0):this.activateTag(this.intersectTag,w.EXAMINE));if(this.tagState===w.EXAMINE)return this.intersectTag!==this.activeTag?this.intersectTag.type===M.Audio?(this.pauseAudioTag(),this.dismissActiveTag(),this.lastAudioTag=this.intersectTag,this.activateAudioTag(this.intersectTag,w.EXAMINE,1)):(this.pauseAudioTag(),this.dismissActiveTag(),this.intersectTag.type===M.OtherModel||this.intersectTag.type===M.IFrame||this.intersectTag.type===M.ImageText||this.intersectTag.type===M.ImageTextAudio||this.intersectTag===M.IKEA?this.activateOtherModelTag(this.intersectTag,w.EXAMINE,0):this.activateTag(this.intersectTag,w.EXAMINE)):this.intersectTag.type===M.Audio?(this.pauseAudioTag(),this.dismissActiveTag(),!1):(this.dismissActiveTag(),this.intersectTag.type!==M.ImageText&&this.intersectTag.type!==M.ImageTextAudio&&this.intersectTag!==M.IKEA||this.intersectTag.label||this.intersectTag.data.details.description||this.intersectTag.tagInfoUrl||this.activateOtherModelTag(this.intersectTag,w.EXAMINE,0),!1);if(this.tagState===w.BROWSE){if(this.intersectTag.type!==M.Audio)return this.pauseAudioTag(),this.dismissActiveTag(),this.intersectTag.type===M.OtherModel||this.intersectTag.type===M.IFrame||this.intersectTag.type===M.ImageText||this.intersectTag.type===M.ImageTextAudio||this.intersectTag===M.IKEA?this.activateOtherModelTag(this.intersectTag,w.EXAMINE,0):this.activateTag(this.intersectTag,w.EXAMINE);this.intersectTag.i==this.lastAudioTag.i?(this.pauseAudioTag(),this.dismissActiveTag()):(this.pauseAudioTag(),this.lastAudioTag=this.intersectTag,this.intersectTag.setHoverState(!0,0))}},S.prototype.disposeCursorFor360=function(t){t&&t.type===M.Tag360T1?document.getElementsByTagName("html").item(0).style.cursor="pointer":document.getElementsByTagName("html").item(0).style.cursor="default"},S.prototype.intersectMattertag=(n=new c.Vector3,r=new c.Vector3,o=new c.Vector3,function(t,e,i){var a=null,s=this.mattertagDiscs.filter((function(t){return t.parent.visible}));if(s.length>0){var l=this.model.floors.reduce((function(t,e){return e.hidden?t:t.concat(e.collider.children)}),s);n.set(t.x,t.y,-1).unproject(i),r.set(t.x,t.y,1).unproject(i),o.copy(r).sub(n).normalize(),this.raycaster.set(n,o);var u=this.raycaster.intersectObjects(l);u.length>0&&-1!==s.indexOf(u[0].object)&&u[0].object.tag.type&&((a=u[0].object.tag).i>=3e4?a=G.model.mattertags[a.i]:a.i>=1e4&&(a=G.model.mattertags[a.i-1e4]))}return this.intersectTag=a,this.disposeCursorFor360(a),e&&(this.activeTag&&a!==this.activeTag&&(this.tagState===w.BROWSE||this.tagState===w.EXAMINE&&a)&&this.dismissActiveTag(),a&&a!==this.activeTag&&(a.listeners("enter").length<1&&(a.on("enter",function(t){this.hoveredTag=t}.bind(this)),a.on("leave",function(t){this.hoveredTag=null}.bind(this))),this.activateTag(a,w.BROWSE))),a}),S.prototype.rankedMattertagInDirection=(a=[],s=[],l=new c.Vector3,u=new c.Vector3,h=new c.Vector3,function(t,e,i,n){var r=0;s.length=0;for(var o=0;o<this.closestMattertags.length;o++){var c=this.closestMattertags[o];u.copy(c.position),u.add(c.discPosition),l.copy(e),l.sub(u).negate(),l.normalize();var d=l.dot(n);if(d>=0&&(h.copy(u),h.project(i),this.intersectMattertag(h,!1,i))){if(r>=a.length)for(var p=0;p<64;p++)a.push({tag:c,dot:d});var f=a[r];f.tag=c,f.dot=d,f.position=math.projectPositionToCanvas(u,i),s.push(f),r++}}return s.sort((function(t,e){return t.dot>e.dot?-1:t.dot<e.dot?1:0})),t<s.length?s[t].tag:null}),S.prototype.updateClosestTags=function(){var t=new c.Vector3;return function(e){this.closestMattertags||(this.closestMattertags=[]),this.closestMattertags.length=0;var i=this.model.mattertags;if(i)for(var n in i)if(i.hasOwnProperty(n)){if(n>=1e4)return;var r=i[n],o=r.position;t.copy(e),t.sub(o).negate();var a=t.lengthSq();12!==r.type&&a<30&&this.closestMattertags.push(r)}}}(),S.prototype.emitTagEvent=function(t,e){if(T.warn("=========emitTagEvent=======tag===mode",t,e),"-1"!==t.tagid){var i=t.data.details,n="";for(var r in e===w.EXAMINE?e="click":e===w.BROWSE&&(e="hover"),t.type===M.TextOnly&&(i.orientationAndPosition=t.getBillboardOrientationAndPosition(this.player.camera)),M)if(i.templatetype===M[r]){n=r,i.type=r;break}var o={tagId:t.tagid,type:n,mode:e,detail:i};"click"===e&&(this.tagState=w.BROWSE,this.activeTag=t),this.emit("tagActiveEvent",o)}},t.exports=S}).call(this,i(6))},function(t,e){t.exports={IDLE:"idle",BROWSE:"browse",EXAMINE:"examine"}},function(t,e,i){(function(e){function n(t){this.panos=null,this.retryMinimumTime=1e4,this.urls=null,this.panoLoadCallbacks={},this.downloadDescriptors={},this.priorityQueue=[],this.forceQueue=[],this.activeDownloads=[],this.qualityManager=null,this.tilePrioritizer=null,this.refreshInterval=null,this.processPriorityQueue=!1,this.concurrentDownloads=t.concurrentDownloads||1,this.downloadTestResults={}}var r,o,a,s,l=i(0),u=(i(5),i(1)),h=(i(19),i(2)),c=(i(18),i(23),i(76)),d=i(38),p=i(30),f=(i(29),i(65)),m=i(36),g=i(11),v=i(4).EventEmitter,y=(new h(e),Object.freeze({Testing:1,Success:2,Fail:3}));n.prototype=Object.create(v.prototype),n.IDLE_REFRESH_DELAY=500,n.ACTIVE_REFRESH_DELAY=0,n.DOWNLOAD_RETRIES=4,n.prototype.init=function(t){this.qualityManager=t},n.prototype.setUrls=function(t){this.urls=t},n.prototype.setPanoData=function(t,e,i){this.panos=t,this.imagePanos=e,this.panoGroupId=i},n.prototype.start=function(){this.refreshUpdateInterval(0)},n.prototype.stop=function(){window.cancel(this.refreshInterval)},n.prototype.refreshUpdateInterval=function(t){t||(t=0),this.refreshInterval=window.setTimeout(function(){this.update()?this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY):this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)}.bind(this),t)},n.prototype.update=function(){var t=this.forceQueue.length>0;return this.processQueueForDownloading(this.forceQueue),this.processPriorityQueue&&(this.queuePrioritizedTilesForPanos(this.panos),this.priorityQueue.length>0&&(t=!0),this.processQueueForDownloading(this.priorityQueue)),t},n.prototype.forceQueueTilesForPano=(a=[],s=[],function(t,e,i,n,r,o){a.length=0;for(var l=this.getTileDownloadDescriptors(t,e),u=0;u<l.length;u++){var h=l[u];h.status!==f.None&&h.status!==f.Queued||a.push(h)}if(i&&a.length>0){d.sortPanoTiles(a,t,i),s.length=0,p.matchingTilesInDirection(t,e,i,n,r,s);for(var c=0,m=function(t){return t.face===g.face&&t.faceTileIndex===g.faceTileIndex};c<a.length;){var g=a[c];s.findIndex(m)<0?a.splice(c,1):c++}}for(var v=0;v<a.length;v++)this.forceQueue.push(a[v]);this.setStatusForAllDescriptors(this.forceQueue,f.ForceQueued),this.clearFromQueue(this.priorityQueue,f.ForceQueued,!1),o&&this.processQueueForDownloading(this.forceQueue,!0)}),n.prototype.clearForceQueue=function(){this.clearQueue(this.forceQueue)},n.prototype.queuePrioritizedTilesForPanos=function(t){this.tilePrioritizer&&(this.clearQueue(this.priorityQueue),this.tilePrioritizer.filterAndPrioritize(this.priorityQueue,t,this),this.clearFromQueue(this.priorityQueue,f.None,!0),this.setStatusOrRemoveForAllDescriptors(this.priorityQueue,f.Queued))},n.prototype.clearQueue=function(t){this.setStatusForAllDescriptors(t,f.None),t.length=0},n.prototype.clearFromQueue=function(t,e,i){for(var n=0;n<t.length;n++){var r=t[n];r&&(e===r.status&&!i||e!==r.status&&i)&&(t[n]=null)}},n.prototype.setStatusForAllDescriptors=function(t,e){for(var i=0;i<t.length;i++){var n=t[i];n&&(n.status=e)}},n.prototype.setStatusOrRemoveForAllDescriptors=function(t,e){for(var i=0;i<t.length;i++){var n=t[i];n&&(n.status!==e?n.status=e:t[i]=null)}},n.prototype.getTileDownloadDescriptors=function(t,e){var i=this.getAllTileDownloadDescriptorsForPano(t),n=i[e];return n||(n=this.buildDownloadDescriptorArray(e),i[e]=n,this.initTileDownloadDescriptors(n,t,e)),n},n.prototype.getAllTileDownloadDescriptorsForPano=function(t){var e=this.downloadDescriptors[t.id];return e||(e={},this.downloadDescriptors[t.id]=e),e},n.prototype.processQueueForDownloading=function(t,e){if(this.cleanupActiveDownloads(),this.activeDownloads.length<this.concurrentDownloads||e)for(var i=e?t.length:this.concurrentDownloads-this.activeDownloads.length,n=0,r=0;n<i&&t.length>0;r++){var o=t.shift();o&&(this.startDownload(o),n++)}},n.prototype.testDownload=function(t,e,i){var n=this.downloadTestResults[t];if(n)n===y.Success?i(!0):n===y.Fail&&i(!1);else{this.downloadTestResults[t]=y.Testing;var r=this.panos.list[0],o=this.getTileUrl(r.id,t,e,0),a=function(e){this.downloadTestResults[t]=y.Success,i(!0)}.bind(this),s=function(){this.downloadTestResults[t]=y.Fail,i(!1)}.bind(this);this.loadImage(o,0,a,s)}},n.prototype.startDownload=function(t){t.status=f.Downloading;var e=this.getTileUrl(t.pano.id,t.panoSize,t.tileSize,t.tileIndex);this.activeDownloads.push(t),this.loadImage(e,n.DOWNLOAD_RETRIES,this.downloadComplete.bind(this,t),this.downloadFailed.bind(this,t))},n.prototype.downloadFailed=function(t,e){},n.prototype.downloadComplete=function(t,e){if(t.panoGroupId===this.panoGroupId){var i=this.getPanoLoadCallbacks(t.pano,t.panoSize);t.status=f.Downloaded,i&&i.onProgress&&i.onProgress(t.pano,t.panoSize);var n={panoId:t.pano.id,image:e,tileSize:t.tileSize,panoSize:t.panoSize,tileIndex:t.tileIndex,faceTileIndex:t.faceTileIndex,totalTiles:t.totalTiles,face:t.face,tileX:t.tileX,tileY:t.tileY,direction:t.direction};t.image=e,this.emit(c.TileDownloadSuccess,n),this.isPanoDownloaded(t.pano,t.panoSize)&&(n={panoId:t.pano.id,tileSize:t.tileSize,panoSize:t.panoSize},this.emit(c.PanoDownloadComplete,n),i&&i.onLoad&&i.onLoad(t.pano,t.panoSize))}},n.prototype.cleanupActiveDownloads=function(){var t=[];return function(){t.length=0;for(var e=0;e<this.activeDownloads.length;e++){var i=this.activeDownloads[e];i.status!==f.Downloaded&&i.status!==f.Failed&&t.push(i)}this.activeDownloads.length=0,this.activeDownloads.push.apply(this.activeDownloads,t)}}(),n.prototype.isPanoDownloaded=function(t,e){var i=this.getTileDownloadDescriptors(t,e);if(i.length<=0)return!1;for(var n=0;n<i.length;n++){if(i[n].status!==f.Downloaded)return!1}return!0},n.prototype.setPanoLoadCallbacks=function(t,e,i,n,r){var o=t.id+":"+this.qualityManager.getPanoSize(e);this.panoLoadCallbacks[o]={onLoad:i,onFail:n,onProgress:r}},n.prototype.getPanoLoadCallbacks=function(t,e){var i=t.id+":"+e;return this.panoLoadCallbacks[i]},n.prototype.buildDownloadDescriptorArray=function(t){for(var e=p.getTileCountForSize(t),i=[],n=0;n<e;n++){var r=this.buildDownloadDescriptor();i.push(r)}return i},n.prototype.buildDownloadDescriptor=function(){return{panoGroupId:null,pano:null,panoSize:-1,tileSize:-1,tileIndex:-1,totalTiles:-1,faceTileIndex:-1,status:f.None,url:null,image:null,direction:new l.Vector3,face:-1,cubeFace:-1,tileX:-1,tileY:-1}},n.prototype.initTileDownloadDescriptors=function(t,e,i){for(var n=0;n<t.length;n++){var r=t[n];this.initTileDownloadDescriptor(r,e,i,n)}},n.prototype.initTileDownloadDescriptor=function(t,e,i,n){var r=i>=p.TILE_SIZE?p.TILE_SIZE:i;t.face=p.getFaceForTile(i,n),t.cubeFace=m.mapFaceToCubemapFace(t.face),t.panoGroupId=this.panoGroupId,t.pano=e,t.panoSize=i,t.tileSize=r,t.tileIndex=n,t.totalTiles=p.getTileCountForSize(i),t.status=f.None,t.image=null,p.getTileLocation(t.panoSize,t.tileIndex,t),p.getTileVector(t.panoSize,t.tileSize,t.cubeFace,t.tileX,t.tileY,p.LocationOnTile.Center,0,t.direction)},n.prototype.getTileUrl=(r={256:"256",512:"512",1024:"1k",2048:"2k",4096:"4k"},o={face:-1,faceTileIndex:-1,tileX:-1,tileY:-1},function(t,e,i,n){p.getTileLocation(e,n,o);var a=Math.floor(e/i),s=a*a,l=Math.floor(n/s),h="";return 1===u.tiling.customCompression&&(h="_"+u.tiling["q"+r[e]]),this.urls.get("multiple/"+t+"/"+r[e]+h+"_face"+l+"_"+o.tileX+"_"+o.tileY+".jpg")}),n.prototype.loadImage=function(t,e,i,n){g.getImage(t,e).then((function(t){i(t)})).fail(n)},t.exports=n}).call(this,"/js/tile/TileDownloader.js")},function(t,e,i){function n(t){var e,i={renderTarget:null,inUse:!1,size:-1,pano:null};return i.inUse=!0,i.size=t,e=i,E.push(e),i}function r(t){for(var e=0;e<E.length;e++){var i=E[e];if(i.renderTarget===t)return i.inUse=!1,!0}return!1}function o(){this.tileDirectory={},this.activeRenderTargetDescriptors={},this.activePanos=[],this.panoLODDescriptors={},this.panoDescriptors={},this.tileTrees={},this.sceneRenderer=null,this.tileDownloader=null,this.forceQueue=[],this.uploadQueues={},this.uploadInterval=null,this.uploadIntervalCancelled=!1,this.usingTileOverlay=!1,this.overlayTilesLoaded=!1,this.overlayTileBase=null,this.overlayTilesBasic={},this.overlayTilesEnhanced={},this.zoomRenderTarget=null,this.zoomPano=null,this.zoomingActive=!1,this.zoomPanoId=null,this.zoomPanoRenderingDisabled=!1,this.direction=new u.Vector3,this.initTime=-1,this.maxBaseUploadsPerFrame=A,this.maxNonBaseUploadsPerFrame=_}function a(){this.uploadIntervalCancelled||this.overlayTilesLoaded||(this.usingTileOverlay?this.refreshUploadInterval(this.uploadIntervalDelay):(M=!0,this.updateUploadQueue(this.maxNonBaseUploadsPerFrame,this.maxBaseUploadsPerFrame),this.peekNextFromUploadQueue()?this.refreshUploadInterval(T):this.uploadInterval=null))}var s,l,u=i(0),h=i(14),c=i(1),d=i(23),p=i(55),f=i(48),m=i(76),g=i(18),v=i(200),y=i(38),b=i(30),w=i(36),x=i(4).EventEmitter,M=!1,T=c.tiling.uploadIntervalDelay,S=c.tiling.initialIntervalDelay,_=c.tiling.maxNonBaseUploadsPerFrame,A=c.tiling.maxBaseUploadsPerFrame,P=0,C=1,E=[];o.prototype=Object.create(x.prototype),o.prototype.init=function(t,e,i){this.sceneRenderer=t,this.tileDownloader=e,this.qualityManager=i,this.bindEvents(),this.sceneRenderer.on(f.ContextCreated,this.loadOverlayTiles.bind(this)),this.initTime=performance.now()},o.prototype.getActivePanoTextures=function(t){t=t||[];for(var e=0;e<E.length;e++){var i=E[e];i.renderTarget&&i.renderTarget.texture&&t.push(i.renderTarget.texture)}},o.prototype.hasQueuedTiles=function(){var t=this.peekNextFromUploadQueue();return null!=t},o.prototype.getActiveRenderTargetDescriptor=function(t){return this.activeRenderTargetDescriptors[t]},o.prototype.setActiveRenderTargetDescriptor=function(t,e){this.activeRenderTargetDescriptors[t]=e},o.prototype.loadOverlayTiles=function(){if(0!==c.tiling.overlayStyle){var t=0,e=function(e,n,r){e=n?e[n]=this.sceneRenderer.initSizedTexture2D(b.TILE_SIZE,u.ClampToEdgeWrapping):this.overlayTileBase=this.sceneRenderer.initSizedTexture2D(b.TILE_SIZE,u.ClampToEdgeWrapping),this.sceneRenderer.uploadTexture2D(r,e,0,0,b.TILE_SIZE,b.TILE_SIZE),++t===i.length&&(this.overlayTilesLoaded=!0)}.bind(this),i=[["images/outlineBase.png",e.bind(this,this.overlayTileBase,null)],["images/outlineBasic512.png",e.bind(this,this.overlayTilesBasic,256)],["images/outlineBasic512.png",e.bind(this,this.overlayTilesBasic,512)],["images/outlineBasic1024.png",e.bind(this,this.overlayTilesBasic,1024)],["images/outlineBasic2048.png",e.bind(this,this.overlayTilesBasic,2048)],["images/outlineBasic4096.png",e.bind(this,this.overlayTilesBasic,4096)],["images/outlineEnhanced512.png",e.bind(this,this.overlayTilesEnhanced,256)],["images/outlineEnhanced512.png",e.bind(this,this.overlayTilesEnhanced,512)],["images/outlineEnhanced1024.png",e.bind(this,this.overlayTilesEnhanced,1024)],["images/outlineEnhanced2048.png",e.bind(this,this.overlayTilesEnhanced,2048)],["images/outlineEnhanced4096.png",e.bind(this,this.overlayTilesEnhanced,4096)]];i.forEach(function(t){this.tileDownloader.loadImage(t[0],0,t[1])}.bind(this)),this.usingTileOverlay=!0}else this.usingTileOverlay=!1},o.prototype.bindEvents=function(){this.tileDownloader.on(m.TileDownloadSuccess,this.onTileDownloaded.bind(this))},o.prototype.setupZoomRenderTarget=function(){if(this.qualityManager.getMaxZoomPanoSize()>=this.qualityManager.getMaxNavPanoSize()){if(this.zoomRenderTarget&&this.zoomRenderTarget.width===this.qualityManager.getMaxZoomPanoSize())return;var t=this.zoomRenderTarget;if(this.zoomRenderTarget=this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(),!1),t){var e=t.width,i=this.zoomRenderTarget.width;this.sceneRenderer.copyCubeMap(t.texture,this.zoomRenderTarget,e,e,i,i),t.texture.dispose(),t.texture.loaded=!1,t.texture.version=0,this.sceneRenderer.deallocateCubeTexture(t.texture),t.texture=null}this.zoomPanoRenderingDisabled=!1}else this.zoomPanoRenderingDisabled=!0},o.prototype.enableUltraHighQualityMode=function(t){if(!this.qualityManager.ultraHighQualityModeEnabled()){var e=this.qualityManager.getPanoSize(d.ULTRAHIGH);this.tileDownloader.testDownload(e,b.TILE_SIZE,function(e){e&&(this.qualityManager.enableUltraHighQualityMode(),this.setupZoomRenderTarget(),t())}.bind(this))}},o.prototype.activateTiledPano=function(t,e,i){i&&this.clearAllQueuedUploads();for(var o=0;o<b.FACES_PER_PANO;o++)this.initTileTree(t.id,o,this.qualityManager.getMaxPossiblePanoSize());this.linkAllTilesAndNodes(t);var a=this.getActiveRenderTargetDescriptor(t.id);if(e>this.qualityManager.getMaxNavPanoSize()&&(e=this.qualityManager.getMaxNavPanoSize()),!a||e!==a.size){if(a&&r(a.renderTarget),!(a=function(t){for(var e=0;e<E.length;e++){var i=E[e];if(!i.inUse&&i.size===t)return i.inUse=!0,i}return null}(e))){var s=this.initTiledPano(e,!1);(a=n(s.width)).renderTarget=s}a.pano=t,this.resetPanoDescriptor(t.id),this.resetPanoLODDescriptors(t.id),this.resetRenderStatus(t.id,!0,!0)}this.setActiveRenderTargetDescriptor(t.id,a);var l=i?0:1;return this.updateActivePanos(t,l),a.renderTarget},o.prototype.deactivateTiledPano=function(t){var e=this.getActiveRenderTargetDescriptor(t.id);this.isRenderTargetDescriptorValid(e)&&r(e.renderTarget),this.setActiveRenderTargetDescriptor(t.id,null);var i=this.getUploadQueueForPano(t.id);this.clearUploadQueue(i),this.updateActivePanos()},o.prototype.updateActivePanos=(s=[],function(t,e){s.length=0;for(var i=0;i<this.activePanos.length;i++){t&&s.length===e&&s.push(t);var n=this.activePanos[i],r=this.getActiveRenderTargetDescriptor(n.id);t&&n.id===t.id||!this.isRenderTargetDescriptorValid(r)||s.push(n)}t&&e>=s.length&&s.push(t),this.activePanos.length=0,this.activePanos.push.apply(this.activePanos,s)}),o.prototype.getActivePanoCount=function(){return this.activePanos.length},o.prototype.resetRenderStatus=function(t,e,i,n){var r=function(t,n,r,o){i&&(n.tile.zoomUploaded=!1),e&&(n.tile.uploaded=!1)},o=null;n&&(o=v.getLevelCountForSize(b.TILE_SIZE,n)+1);for(var a=0;a<b.FACES_PER_PANO;a++){this.getTileTree(t,a).breadthFirst({callback:r.bind(this,a),minLevel:o})}},o.prototype.copyBaseRenderStatusToZoomed=function(t){for(var e=v.getLevelCountForSize(b.TILE_SIZE,this.qualityManager.getMaxNavPanoSize()),i=function(t,e,i,n){e.tile.zoomUploaded=e.tile.uploaded,e.zoomCovered=e.covered},n=0;n<b.FACES_PER_PANO;n++){this.getTileTree(t,n).breadthFirst({callback:i.bind(this,n),maxLevel:e})}},o.prototype.renderPanoTiles=(l=[],function(t,e,i,n){this.zoomRenderTarget&&this.zoomRenderTarget.width===this.qualityManager.getMaxZoomPanoSize()||this.zoomPanoRenderingDisabled||this.setupZoomRenderTarget(),e=e||this.direction||g.FORWARD;var r=this.getActiveRenderTargetDescriptor(t);if(!this.isRenderTargetDescriptorValid(r))throw new h("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");for(var o=0;o<b.FACES_PER_PANO;o++){var a=this.getTileTree(t,o);l.length=0,a.breadthFirst({saveVisited:l});for(var s=0;s<l.length;s++){var u=l[s];this.queueTileUpload(u.tile,!1,n||0===s&&i)}}this.updateDirection(e)}),o.prototype.isRenderTargetDescriptorValid=function(t){return t&&t.renderTarget},o.prototype.isPanoActive=function(t){var e=this.getActiveRenderTargetDescriptor(t);return this.isRenderTargetDescriptorValid(e)},o.prototype.isPanoZoomed=function(t){return this.zoomingActive&&this.zoomPanoId===t},o.prototype.initTileTree=function(t,e,i){var n=this.tileTrees[t];n||(n=[],this.tileTrees[t]=n);var r=n[e];if(!r){var o=v.getLevelCountForSize(b.TILE_SIZE,i);r=new v(b.TILE_SIZE,o),n[e]=r}},o.prototype.getTileTree=function(t,e){var i=this.tileTrees[t];if(!i)throw new h("PanoRenderer.getTileTree() -> Tree array not yet initialized!");var n=i[e];if(!n)throw new h("PanoRenderer.getTileTree() -> Tree not yet initialized!");return n},o.prototype.initTiledPano=function(t,e){var i=this.sceneRenderer.renderer,n=(i.context,new u.WebGLRenderTargetCube(t,t,{stencilBuffer:!1})),r=new u.CubeTexture([]);n.texture=r,r.image=[null,null,null,null,null,null],r.flipY=!0,e?(r.generateMipmaps=!0,r.magFilter=u.LinearFilter,r.minFilter=u.LinearMipMapLinearFilter):(r.generateMipmaps=!1,r.magFilter=u.LinearFilter,r.minFilter=u.LinearFilter),r.format=u.RGBAFormat,i.setRenderTarget(n),i.setRenderTarget(null);var o=i.properties.get(r);return o.__image__webglTextureCube=o.__webglTexture,n},o.prototype.getUploadQueueForPano=function(t){var e=this.uploadQueues[t];return e||(e=[],this.uploadQueues[t]=e),e},o.prototype.isTileUploaded=function(t){return this.isPanoZoomed(t.panoId)?t.zoomUploaded:t.uploaded},o.prototype.setUploaded=function(t,e){this.isPanoZoomed(t.panoId)?t.zoomUploaded=e:t.uploaded=e},o.prototype.queueTileUpload=function(t,e,i){var n=this.getActiveRenderTargetDescriptor(t.panoId);if(this.isRenderTargetDescriptorValid(n)&&t.downloaded&&!this.isTileUploaded(t)&&(!t.uploadQueued||i)&&(!(t.panoSize>this.qualityManager.getMaxNavPanoSize())||this.zoomingActive)){var r=this.getUploadQueueForPano(t.panoId);i?this.uploadTile(t,!1):(this.shoulPushToFrontOfQueue(t)?this.forceQueue.push(t):e&&this.direction?y.insertSortedPanoTile(r,t,n.pano,this.direction):r.push(t),t.uploadQueued=!0,this.uploadInterval||this.uploadIntervalCancelled||this.refreshUploadInterval(0))}},o.prototype.shoulPushToFrontOfQueue=function(t){return 0===v.getLevelCountForSize(b.TILE_SIZE,t.panoSize)},o.prototype.getTopUploadQueue=function(){for(var t=null,e=null,i=P;i<=C;i++)for(var n=0;n<this.activePanos.length;n++)if(t=this.activePanos[n],(e=this.getUploadQueueForPano(t.id)).length>0)switch(i){case P:if(0===e[0].level)return e;break;case C:return e}return null},o.prototype.getNextFromUploadQueue=function(){var t=function(t){var e=t.shift();return e.uploadQueued=!1,e};return function(){if(this.forceQueue.length>0)return t(this.forceQueue);var e=this.getTopUploadQueue();return e&&e.length>0?t(e):null}}(),o.prototype.peekNextFromUploadQueue=function(){if(this.forceQueue.length>0)return this.forceQueue[0];var t=this.getTopUploadQueue();return t&&t.length>0?t[0]:null},o.prototype.clearAllQueuedUploads=function(){this.clearAllUploadQueues(null,0)},o.prototype.clearAllQueuedUploadsForPano=function(t){this.clearAllUploadQueues(t,0)},o.prototype.clearAllUploadQueues=function(t,e){if(t)this.clearUploadQueue(this.getUploadQueueForPano(t),e),this.clearUploadQueue(this.forceQueue,e,t);else{for(var i=0;i<this.activePanos.length;i++){var n=this.activePanos[i];this.clearUploadQueue(this.getUploadQueueForPano(n.id),e)}this.clearUploadQueue(this.forceQueue,e)}},o.prototype.clearUploadQueue=function(t,e,i){null!=e||(e=0);for(var n=0;n<t.length;){var r=t[n];(!i||i&&i===r.tile.panoId)&&r.level>=e?(r.uploadQueued=!1,t.splice(n,1)):n++}},o.prototype.refreshUploadInterval=function(){var t=null;return function(e){this.uploadIntervalCancelled||(t||(t=a.bind(this)),null!=e||(e=T),M||(e=S),this.uploadInterval=window.setTimeout(t,e),this.uploadIntervalDelay=e)}}(),o.prototype.update=function(){var t=performance.now(),e=0;return function(){this.uploadIntervalCancelled=!0,window.clearTimeout(this.uploadInterval),this.uploadInterval=null,!(performance.now()-t>T||0===e)||!this.overlayTilesLoaded&&this.usingTileOverlay||(this.updateUploadQueue(this.maxNonBaseUploadsPerFrame,this.maxBaseUploadsPerFrame),t=performance.now()),e++}}(),o.prototype.updateUploadQueue=function(t,e){t||(t=1);for(var i=0,n=0;!(n>=e||i>=t);){var r=this.getNextFromUploadQueue();if(!r)break;if(0!==r.level?i++:n++,!(r.panoSize>this.qualityManager.getMaxNavPanoSize())||this.zoomingActive){var o=this.getActiveRenderTargetDescriptor(r.panoId);this.isRenderTargetDescriptorValid(o)&&this.uploadTile(r,r.forceUpload)}}},o.prototype.updateDirection=function(t){if(t=t||this.direction){this.direction=t;for(var e=0;e<this.activePanos.length;e++){var i=this.activePanos[e],n=this.getUploadQueueForPano(i.id);y.sortPanoTiles(n,i,this.direction)}}},o.prototype.uploadTile=function(){var t={},e=(new u.Vector4,c.tiling.overlayStyle);return function(i,n){var r=i.panoId,o=i.image,a=i.tileSize,s=i.panoSize,l=i.tileIndex,h=(i.faceTileIndex,i.totalTiles),c=(i.face,i.tileX),d=i.tileY,f=!0,m=!1,g=(this.getPanoDescriptor(r),this.getPanoLODDescriptor(r,s)),v=this.getActiveRenderTargetDescriptor(r),y=v.renderTarget,b=v.size;if(this.isPanoZoomed(r)&&(y=this.zoomRenderTarget,b=this.qualityManager.getMaxZoomPanoSize()),this.isRenderTargetDescriptorValid(v)||(f=!1,m=!1),n||(this.anyUploaded(i.node)&&(f=!1,m=!0),this.isTileUploaded(i)&&(f=!1,m=!1)),f){var w=a/s*b,x=c*a/s*b,M=d*a/s*b;t[a]||(t[a]=this.sceneRenderer.initSizedTexture2D(a,u.ClampToEdgeWrapping));var T=t[a];if(this.sceneRenderer.uploadTexture2D(o,T,0,0,a,a),1===e||2===e){var S=1===e?this.overlayTilesBasic:this.overlayTilesEnhanced;this.sceneRenderer.renderToCubeMap(T,y,a,a,0,0,a,a,x,M,w,w,i.cubeFace),this.sceneRenderer.renderToCubeMap(S[s],y,a,a,0,0,a,a,x,M,w,w,i.cubeFace,u.NormalBlending,!0,.5)}else this.sceneRenderer.renderToCubeMap(T,y,a,a,0,0,a,a,x,M,w,w,i.cubeFace);g.uploadCount++,this.emit(p.TileRenderSuccess,r,s,l,h),g.uploadCount===h&&this.emit(p.PanoRenderComplete,r,s,h),this.setUploaded(i,!0),this.addCoverageForNode(i.node)}else this.setUploaded(i,!1);return i.uploadAttempted||(g.uploadAttempts++,this.emit(p.TileUploadAttempted,r,s,l,h)),i.uploadAttempted=!0,g.uploadAttempts===h&&this.emit(p.UploadAttemptedForAllTiles,r,s,h),m}}(),o.prototype.linkTileAndNode=function(t,e){e.tile=t,t.node=e},o.prototype.linkAllTilesAndNodes=function(t){for(var e=function(e,i,n,r,o){var a=this.getTileDirectoryEntry(t.id,i,r,o);this.linkTileAndNode(a,n)},i=0;i<b.FACES_PER_PANO;i++){var n=this.getTileTree(t.id,i);n.breadthFirst({callback:e.bind(this,n,i)})}},o.prototype.anyUploaded=function(t){if(!t)return!1;if(t.tile&&this.isTileUploaded(t.tile))return!0;if(t.children)for(var e=0;e<t.children.length;e++){var i=t.children[e];if(this.anyUploaded(i))return!0}return!1},o.prototype.setNodeCovered=function(t,e){this.isPanoZoomed(t.tile.panoId)?t.zoomCovered=e:t.covered=e},o.prototype.isNodeCovered=function(t){return!!t&&(this.isPanoZoomed(t.tile.panoId)?t.zoomCovered:t.covered)},o.prototype.addCoverageForNode=function(t){if(this.setNodeCovered(t,!0),t.parent&&t.covered){var e=t.parent;this.nodeSubcovered(e)&&this.addCoverageForNode(e,!0)}},o.prototype.calcFullCoverage=function(t){var e=!1;if(t.children)for(var i=0;i<t.children.length;i++){var n=t.children[i];e=e||this.calcFullCoverage(n)}t.covered=t.tile.uploaded||e},o.prototype.nodeSubcovered=function(t){if(!t.children)return!1;for(var e=0;e<t.children.length;e++)if(!t.children[e]||!this.isNodeCovered(t.children[e]))return!1;return!0},o.prototype.resetPanoDescriptor=function(t){this.getPanoDescriptor(t)},o.prototype.getPanoDescriptor=function(t){var e=this.panoDescriptors[t];return e||(e={},this.panoDescriptors[t]=e),e},o.prototype.resetPanoLODDescriptors=function(t){var e=this.getPanoLODDescriptors(t);for(var i in e)if(e.hasOwnProperty(i)){var n=e[i];n.uploadCount=0,n.uploadAttempts=0}},o.prototype.getPanoLODDescriptor=function(t,e){var i=this.getPanoLODDescriptors(t),n=i[e];return n||(n={uploadCount:0,uploadAttempts:0},i[e]=n),n},o.prototype.getPanoLODDescriptors=function(t){var e=this.panoLODDescriptors[t];return e||(e={},this.panoLODDescriptors[t]=e),e},o.prototype.onTileDownloaded=function(t){var e=v.getLevelCountForSize(b.TILE_SIZE,t.panoSize),i=this.getTileDirectoryEntry(t.panoId,t.face,e,t.faceTileIndex);if(i.downloaded=!0,i.image=t.image,i.panoSize=t.panoSize,i.tileX=t.tileX,i.tileY=t.tileY,i.totalTiles=t.totalTiles,i.tileIndex=t.tileIndex,i.faceTileIndex=t.faceTileIndex,i.face=t.face,i.cubeFace=w.mapFaceToCubemapFace(t.face),i.panoId=t.panoId,i.tileSize=t.tileSize,i.direction=(new u.Vector3).copy(t.direction),i.node=null,i.level=v.getLevelCountForSize(b.TILE_SIZE,i.panoSize),this.isPanoActive(i.panoId)){var n=this.getTileTree(i.panoId,i.face).getSubNode(i.panoSize,i.tileX,i.tileY);this.linkTileAndNode(i,n),this.queueTileUpload(i,!0)}},o.prototype.getTileDirectoryEntry=function(t,e,i,n){var r=this.tileDirectory[t];r||(r={},this.tileDirectory[t]=r);var o=16384*e+1024*i+n,a=r[o];return a||(a={downloaded:!1,uploaded:!1,zoomUploaded:!1},r[o]=a),a._key=t+":"+e+":"+i+":"+n,a._tileKey=o,a},o.prototype.setZoomingActive=function(t,e,i){this.zoomPanoRenderingDisabled||t===this.zoomingActive&&this.zoomPanoId===e.id||(this.zoomingActive=t,this.zoomPanoId=e.id,this.zoomingActive&&(this.zoomPanoId!==e.id||i)&&this.updateZoomedPanoFromBase(e))},o.prototype.updateZoomedPanoFromBase=function(t){if(!this.zoomPanoRenderingDisabled){var e=this.getActiveRenderTargetDescriptor(t.id);if(e&&e.renderTarget){var i=this.qualityManager.getMaxZoomPanoSize(),n=e.renderTarget,r=e.size;this.sceneRenderer.copyCubeMap(n.texture,this.zoomRenderTarget,r,r,i,i),this.copyBaseRenderStatusToZoomed(t.id)}}},t.exports=o},function(t,e){function i(t){t.root=function t(e,i,r){if(r>e.levels)return null;var o=new n(e,i);e.allNodes.push(o);for(var s=0;s<a;s++)o.children[s]=t(e,o,r+1);return o}(t,null,0)}function n(t,e){this.tree=t,this.parent=e,this.children=[],this.id=++r}var r=0,o=2,a=o*o;function s(t,e){this.levels=e,this.tileSize=t,this.root=null,this.allNodes=[],i(this)}s.TraversalType=Object.freeze({PreOrder:0,PostOrder:1}),s.getLevelCountForSize=function(t,e){var i=0;for(e<t&&(e=t);!((e/=o)<t);)i++;return i},s.getSizeForLevel=function(t,e){return Math.pow(o,e)*t},s.prototype.getSubNode=function(t,e,i){(!e||t<this.tileSize)&&(e=0),(!i||t<this.tileSize)&&(i=0),t<this.tileSize&&(t=this.tileSize);var n=s.getLevelCountForSize(this.tileSize,t);return function t(e,i,n,r,a){if(!e)return null;if(0===n)return e;if(!e.children||0===e.children.length)return null;var s=Math.pow(o,n)/o,l=r%s,u=a%s,h=Math.floor(a/s),c=Math.floor(r/s),d=h*o+c;return t(e.children[d],i+1,n-1,l,u)}(this.root,0,n,e,i)},s.prototype.breadthFirst=function(t){var e=!!(t=t||{}).nullLevelEnd,i=t.maxLevel,n=t.minLevel,r=t.callback,o=t.saveVisited,a=[],s={},l=0;for(a.push(this.root),a.push(s);a.length>0&&!(i&&l>i);){var u=a.shift();if(u===s)(!n||l>=n)&&(r&&e&&r(null),o&&e&&o.push(null)),a.length>0&&a.push(s),l++,0;else{if(u.children)for(var h=0;h<u.children.length;h++){u.children[h]&&a.push(u.children[h])}var c=this.getFaceIndexFromNode(u);(!n||l>=n)&&(r&&r(u,l,c),o&&o.push(u))}}},s.prototype.getFaceIndexFromNode=function(t){if(!t)return-1;for(var e=1,i=t,n=0,r=0;;){var a=i.parent;if(!a)break;for(var s=-1,l=0;l<a.children.length;l++)a.children[l]===i&&(s=l);n=s%o*e+n,r=Math.floor(s/o)*e+r,e*=o,i=a}return r*e+n},s.prototype.depthFirst=function(t,e,i){!function t(e,i,n,r,a,l,u,h){if(e){u=u||s.TraversalType.PreOrder;var c=r*o+n;if(u===s.TraversalType.PreOrder&&(a&&a(e,i,c,n,r),l&&l.push(e)),e.children&&0!==e.children.length){for(var d=r*o,p=n*o,f=0;f<o;f++)for(var m=0;m<o;m++)t(e.children[m*o+f],i+1,p+f,d+m,a,l,u,h);u===s.TraversalType.PostOrder&&(a&&a(e,i,c,n,r),l&&l.push(e))}}}(this.root,0,0,0,t,e,i,this.tileSize)},t.exports=s},function(t,e,i){(function(e){var n=i(0),r=i(5),o=i(4).EventEmitter;function a(){this.enable=!1}a.prototype=Object.create(o.prototype),a.prototype.init=function(t){this.lineLeft=this.buildPanoDom("left"),this.lineRight=this.buildPanoDom("right"),this.lineHeight=this.buildPanoDom("height"),this.frames=0,this.checkedPoint=null,this.areaName=t?t.areaName:null,this.raycaster=new n.Raycaster},a.prototype.buildPanoDom=function(t){var i=document.createElement("div");i.className="pano-size-line",e("#pano-size")[0].appendChild(i);var n=document.createElement("em");i.appendChild(n);var r=document.createElement("div");r.className="pano-size-label";var o=document.createElement("div");o.className="pano-size-label-point";var a=document.createElement("div");return t&&(a.className="pano-size-label-name "+t),i.appendChild(r),r.appendChild(o),r.appendChild(a),i},a.prototype.setEnable=function(t){this.enable=t;var e=document.getElementById("pano-size");e.style.display=t?"block":"none"},a.prototype.update=function(t){if(this.enable){var i,o,a=t.mode,s=t.camera,l=t.currentPano,u=l.floorIndex||0,h=this.getFloorCeilingHeight(t);if(this.frames+=1,a!==r.PANORAMA||null===l||!l.areasPoints)return this.lineLeft.style.display=this.lineRight.style.display=this.lineHeight.style.display="none",!1;for(var c,d=l.areasPoints,p=0,f=[],m=[],g=this.checkedPoint,v=this.areaName,y=s.getWorldDirection(new n.Vector3),b=0;b<d.length;b++){var w=new n.Vector3(y.x,y.y,y.z),x=new n.Vector3(d[b].x-s.position.x,d[b].y-s.position.y,d[b].z-s.position.z);this.raycaster.set(s.position,x),m.push(w.angleTo(x)),f[p]=d[b],p++}for(var M=m.slice().sort((function(t,e){return t-e}))[0],T=0;T<m.length;T++)if(M===m[T]){var S=T;this.checkedPoint=T,this.areaName=l.areaName}if(v!==this.areaName&&(g=null),g!==this.checkedPoint&&g)return this.lineLeft.style.display=this.lineRight.style.display=this.lineHeight.style.display="none",!1;this.lineLeft.style.display=this.lineRight.style.display=this.lineHeight.style.display="block",c={x:f[S].x,y:h[u],z:f[S].z},i=0===S?f[f.length-1]:f[S-1],o=S===f.length-1?f[0]:f[S+1],0===Math.round(f[S].y)&&(f[S].y=0===S?f[S+1].y:f[0].y);var _=this.getAngleAndDistance(f[S],c,s),A=this.getAngleAndDistance(f[S],i,s),P=this.getAngleAndDistance(f[S],o,s);this.emit("updatePanoSize",this.lineHeight,"height",_),this.emit("updatePanoSize",this.lineLeft,"left",A),this.emit("updatePanoSize",this.lineRight,"right",P),e(this.lineLeft).addClass("reverse"),e(this.lineHeight).removeClass("rock").addClass("around"),-90<A.angle<90&&e(this.lineLeft).addClass(""),90<P.angle<270&&e(this.lineLeft).addClass("")}},a.prototype.getFloorCeilingHeight=function(t){var e=[],i=t.model.floorsHeight,n=i.totalfloor,r=i.height;return n>1?r.forEach((function(i,o){e[o]=o===n-1?t.model.boundingBox.max.y:r[o+1]})):e.push(t.model.boundingBox.max.y),e},a.prototype.getAngleAndDistance=function(t,e,i){function r(t){var e,r,o=t.project(i);return o.y*=-1,e=Math.round((o.x+1)*(window.renderWidth || window.innerWidth)/2),r=Math.round((o.y+1)*(window.renderHeight || window.innerHeight)/2),new n.Vector2(e,r)}var o=new n.Matrix4,a=new n.Line3(new n.Vector3(t.x,t.y,t.z),new n.Vector3(e.x,e.y,e.z)),s=a.distance();o.multiplyMatrices(i.projectionMatrix,o.getInverse(i.matrixWorld));var l=o.elements,u=new n.Vector3(l[3]+l[2],l[7]+l[6],l[11]+l[10]),h=new n.Plane(u,l[15]+l[14]),c=(new n.Vector3).copy(a.start).dot(h.normal)+h.constant,d=(new n.Vector3).copy(a.end).dot(h.normal)+h.constant;if(c<0&&d<0)return null;var p=h.intersectLine(a);void 0!==p&&(c<0?a.start.copy(p):a.end.copy(p));var f=r(a.start),m=r(a.end),g=this.getAngle(f,m);return g.point=f,g.length=s,g},a.prototype.updateUI=function(t,i,n){null!==n?(t.style.display="block",setTimeout((function(){t.style.top=n.point.y+"px",t.style.left=n.point.x+"px",t.style.width=n.dis+"px",t.style.webkitTransform="rotate("+n.angle+"deg)",t.style.transform="rotate("+n.angle+"deg)",e(".pano-size-label-name").hasClass(i)}),0)):t.style.display="none"},a.prototype.getAngle=function(t,e){var i=(new n.Vector2).subVectors(e,t),r=i.length(),o=Math.acos(i.x/r);return i.y<0&&(o*=-1),{angle:180*o/Math.PI,dis:r}},t.exports=a}).call(this,i(6))},function(t,e,n){(function(e){var r=n(4).EventEmitter,o=n(73)(),a=n(5),s=n(0),l=n(1),u=function(){this.debug=!1,this.arr=[],this.parr=[],this.arrSet=[],this.cur=0,this.len=0,this.lon=0,this.playing=!1,this.pidx=0,this.pcur=0,this.enable=!0,this.longplaying=!1,this.adiv=null,this.loadAudio=this.loadAudio.bind(this)};(u.prototype=Object.create(r.prototype)).constructor=u,u.prototype.init=function(t){if(t&&o.audioContext){t&&t.enable&&t.dataset.length&&(this.arrSet=t.dataset,this.arrSet.forEach((function(t,e){var i=t.audiourl;o&&o.load(i)}))),this.len=t.dataset.length}else this.enable=!1},u.prototype.startRecord=function(t){this.recording?this.emit("recording"):(this.emit("readyToRecord"),this.recordstart=!0,this.rtime=0,this.loadAudio(t),this.ridx=t)},u.prototype.endRecord=function(){this.recording=!1,this.elapsedtime=this.time.getElapsedTime(),this.time.stop(),this.elapsedtime>this.adiv.duration&&(this.elapsedtime=this.adiv.duration),this.send({data:this.arr,totalTime:parseFloat(this.elapsedtime.toFixed(5))}),G.player.controls[a.PANORAMA].rtime=0,this.adiv.currentTime=0,this.adiv.pause(),this.emit("stopRecord"),this.pidx=0},u.prototype.save=function(t){return t.time=parseFloat(this.time.getElapsedTime().toFixed(5)),this.arr.push(t),t.time},u.prototype.save2=function(t){this.arr.push(t)},u.prototype.checkserver=function(){return window.parent&&window.parent.NestP},u.prototype.send=function(t){this.arrSet[this.recordidx]={name:this.arrSet[this.recordidx].name,audiourl:this.arrSet[this.recordidx].audiourl,totalTime:t.totalTime,record:t.data.concat()},this.checkserver()&&window.parent.NestP.record(t)},u.prototype.reset=function(){this.arr=[],this.time=new s.Clock(!1)},u.prototype.trytopause=function(t,e){t!==this.pidx&&(this.playing=!1,this.stop(),e&&(this.want=t,setTimeout(e,500)))},u.prototype.perviewPlay=function(t){G.d.currentScript=1,this.inputidx=t,this.load(function(){this.cplay()}.bind(this))},u.prototype.pplay=function(t){if(this.enable){if(!this.checkEnable())return this.emit("emity"),!1;if(void 0===t&&(t=this.pidx),t===this.pidx)this.checkstate()?this.ppause():this.loadAudio(t);else if(this.stopAction(),this.stopAudio(),this.clearview(this.pidx),this.checkstate()){var e=this.pidx;this.pidx=t,this.rstop(e,this.loadAudio,t)}else this.pidx=t,this.loadAudio(t);this.setCurrentView(this.pidx)}},u.prototype.checkEnable=function(){return 0!==this.arrSet.length},u.prototype.presume=function(t,e){this.checkstate()||(void 0===t?t=this.pidx:this.pidx=t,this.pplay(t))},u.prototype.preset=function(){},u.prototype.ppause=function(t){this.checkstate()&&(void 0===t&&(t=this.pidx),this.rpause(t),this.paused=!0)},u.prototype.loadAudio=function(t){function i(){if(n.floading=!1,n.adiv.oncanplay=function(){},n.fgotoh=!0,n.inputidx=t,G.player.flying||G.player.isWarping())var e=setInterval((function(){G.player.flying||G.player.isWarping()||(clearInterval(e),G.d.goToHighlight(t))}),100);else G.d.goToHighlight(t)}var n=this;this.pidx=t;var r=this.arrSet[t].audiourl;if(o.audioContext&&(this.adiv=o.getCell(r)),null!==this.adiv&&(this.floading=!0,4===this.adiv.readyState?i():(this.emit("loadingAudio"),this.adiv.oncanplay=function(){i(),this.emit("loadAudioDone")}),this.debug&&!this.debugstart)){this.debugstart=!0;var a="audioBuffer:",s=this.adiv.audioBuffer;s?(a+="duration:"+s.duration+",",a+="length:"+s.length+",",a+="numberOfChannels:"+s.numberOfChannels+",",a+="sampleRate:"+s.sampleRate+","):a+="undefined",setInterval((function(){e(".debuginfo").html(a),e(".debugpanel").show()}),1e3)}},u.prototype.rstop=function(t,e,i){this.rpause(t),this.clearview(t),G.d.tourIsPlaying?setTimeout(function(){this.rstop(t,e,i)}.bind(this),500):(this.stopAction(),this.stopAudio(),e(i))},u.prototype.stopAction=function(){this.playing=!1,this.exetime&&this.exetime.stop(),this.exetime=new s.Clock(!1),this.parr=[],this.w=void 0,this.st=0,this.arrSet[this.pidx].inited=!1},u.prototype.stopAudio=function(){this.adiv.currentTime=0,this.adiv.pause()},u.prototype.rpause=function(t){this.floading&&(this.adiv.oncanplay=function(){},this.floading=!1),this.fgotoh&&(this.fgotoh=!1),this.acpause(),this.aupause()},u.prototype.acpause=function(){this.playing=!1,this.exetime&&this.exetime.stop()},u.prototype.acresume=function(){this.arrSet[this.pidx].inited?(this.playing=!0,this.exetime.start()):this.acstart(this.pidx)},u.prototype.aupause=function(){this.adiv.pause()},u.prototype.auresume=function(){this.adiv.play()},u.prototype._emitCountDown=function(t){this.emit("countdown",t)},u.prototype.pafter=function(){var t=this;if(this.fgotoh)if(this.fgotoh=!1,this.recordstart){this._emitCountDown(3);var e=3,i=setInterval(function(){--e>0?t._emitCountDown(e):t.emit("startRecord"),0==e&&(clearInterval(i),this.recordstart=!1,this.arr=[],this.recordidx=this.ridx,this.time=new s.Clock(!1),this.time.start(),this.rtime=void 0,this.recording=!0,this.austart(this.inputidx))}.bind(this),1e3)}else this.paused?(this.paused=!1,this.acresume(),this.auresume()):(this.acstart(this.pidx),this.austart(this.pidx))},u.prototype.acstart=function(t){this.parr=[],this.parr=this.arrSet[t].record.concat(),this.totalTime=this.arrSet[t].totalTime,this.totalTime||(this.totalTime=this.adiv.duration),this.exetime=new s.Clock(!1),this.exetime.start(),this.playing=!0,this.arrSet[t].inited=!0},u.prototype.austart=function(){this.adiv.currentTime=0,this.adiv.play()},u.prototype.load=function(t){e(".aloading_back").css("display","block");var i=this,n=0,r=setInterval((function(){++n>100&&(clearInterval(r),e(".aloading_back").css("display","none")),4===i.adiv.readyState&&(e(".aloading_back").css("display","none"),clearInterval(r),t&&t())}),100)},u.prototype.pause=function(){this.trytopause()},u.prototype.next=function(){return this.pidx++,this.pidx===this.len?(this.pidx=0,this.stop(),-1):this.pidx},u.prototype.cplay=function(){G.d.goToHighlight(this.pidx)},u.prototype.cstop=function(){G.d.stopTour(),G.playing=!1},u.prototype.stop=function(){this.playing=!1,this.exetime.stop(),this.exetime=new s.Clock(!1),this.adiv.currentTime=0,this.adiv.pause(),this.emit("stop")},u.prototype.update=function(t){if(this.recording){var e=this.adiv.duration-this.time.getElapsedTime();this.recordnotice(e)}else this.playing&&(this.cur=this.exetime.getElapsedTime(),this.excute(),this.changeview(),G.player.mattertagManager.showtitletags&&G.player.mattertagManager.ttposition())},u.prototype.recordnotice=function(t){t<=0?(G.toast("录制结束"),this.autoend()):this.emit("stopRecordCountDown",t)},u.prototype.autoend=function(){this.endRecord()},u.prototype.excute=function(){var t;if(void 0===this.w)this.parr&&this.parr.length?(this.w=this.parr[0],this.outdated()?(this.last={lon:this.parr[0].lon,tap:this.parr[0].tap,action:this.parr[0].action},this.parse(),this.w=void 0,this.parr.shift()):(t=this.smoothable())&&("dollhouse"===t||"floorplan"===t?this.cal2(t):"panorama"===t&&this.cal2())):this.playing&&this.cur>=this.totalTime&&this.rstop(this.pidx,function(){var t=this.next();t>=0&&this.pplay(t)}.bind(this));else if(this.outdated())this.last={lon:this.parr[0].lon,tap:this.parr[0].tap,action:this.parr[0].action},this.parse(),this.w=void 0,this.parr.shift();else{if(!(t=this.smoothable()))return;"dollhouse"===t||"floorplan"===t?this.get2(t):"panorama"===t&&this.get2(),this.uu(t)}},u.prototype.clearnext=function(){var t=this.w,e=1.5,i=this.actiontype(t);2===i?e+=1:3===i&&(e+=l.transition.flyTime);t.time;this.w=void 0,this.actiontype(this.parr[0])||this.parr[0].time>e||this.parr.shift()},u.prototype.smoothable=function(){var t=this.w;return"dollhouse"===t.tap&&G.player.mode===a.DOLLHOUSE?"dollhouse":"floorplan"===t.tap&&G.player.mode===a.FLOORPLAN?"floorplan":!("panorama"!==t.tap||"rotate"!==t.action||G.player.mode!==a.PANORAMA||!G.player.currentPano||G.player.currentPano.id!==t.panoid)&&"panorama"},u.prototype.outdated=function(){return this.cur>=this.w.time},u.prototype.cal3=function(t){var e=this.w.time-this.cur;this.st=this.cur,this.iv3={target:this.calv3((new s.Vector3).copy(this.w.target),G.player.controls[t].target,e),offset:this.calv3((new s.Vector3).copy(this.w.offset),G.player.controls[t].offset,e),camera:this.calv3((new s.Vector3).copy(this.w.camera),G.player.controls[t].camera.position,e)},this.initv3={target:G.player.controls[t].target.clone(),offset:G.player.controls[t].offset.clone(),camera:G.player.controls[t].camera.position.clone()}},u.prototype.cal2=function(t){t||(t=a.PANORAMA);var e=this.w.time-this.cur;this.st=this.cur,this.iv2={lon:(this.w.lon-G.player.controls[t].lon)/e,lat:(this.w.lat-G.player.controls[t].lat)/e},this.initv2={lon:G.player.controls[t].lon,lat:G.player.controls[t].lat}},u.prototype.calv3=function(t,e,i){return t.clone().sub(e).multiplyScalar(1/i)},u.prototype.get3=function(t){for(i in this.step={},this.iv3)this.step[i]=this.iv3[i].clone().multiply(this.cur-this.st).add(this.initv3[i])},u.prototype.get2=function(){this.step={},this.step.lon=this.iv2.lon*(this.cur-this.st)+this.initv2.lon,this.step.lat=this.iv2.lat*(this.cur-this.st)+this.initv2.lat},u.prototype.uu=function(t){t!==a.FLOORPLAN&&G.player.controls[t].play(this.step)},u.prototype.changeview=function(){if(this.playing){var t=this.cur/this.totalTime*100;if(t>100)return;this.emit("updateView",this.pidx,t)}},u.prototype.setCurrentView=function(t){this.emit("updateView",t,0)},u.prototype.clearview=function(t){this.emit("updateView",t,0)},u.prototype.checkstate=function(){return!!(G.d&&G.d.tourIsPlaying||this.playing||this.floading||this.fgotoh)},u.prototype.parse=function(){var t=this.w;if(t.tap)switch(t.tap){case"housedetail":this.housedetail(null,t.open);break;case"dollhouse":if(t.action)if(G.player.mode!==a.DOLLHOUSE&&G.player.mode!==a.TRANSITIONING)G.d.changeMode(a.DOLLHOUSE,"gui");else switch(t.action){case"rotate":G.player.controls[a.DOLLHOUSE].play(t)}else G.d.changeMode(a.DOLLHOUSE,"gui");break;case"floorplan":t.action?G.player.mode!==a.FLOORPLAN&&G.player.mode!==a.TRANSITIONING?G.d.changeMode(a.FLOORPLAN,"gui"):t.action:G.d.changeMode(a.FLOORPLAN,"gui");break;case"panorama":t.action?G.player.mode!==a.PANORAMA&&G.player.mode!==a.TRANSITIONING?t.panoid?G.player.flyToNewMode({mode:a.PANORAMA,pano:G.model.panos.index[t.panoid]}):G.d.changeMode(a.PANORAMA,"gui"):"move"===t.action?G.player.flyToPano({pano:G.model.panos.index[t.destid]}):G.player.currentPano&&G.player.currentPano.id!==t.panoid?G.player.flyToPano({pano:G.model.panos.index[t.panoid]}):"rotate"===t.action&&(this.panoid=t.panoid,G.player.controls[a.PANORAMA].play(t)):G.d.changeMode(a.PANORAMA,"gui");break;case"outermap":break;case"floor":"all"===t.action?G.d.allFloors():G.d.gotoFloor(parseInt(t.action));break;case"zoom":if(t.type===a.PANORAMA&&G.player.mode===a.PANORAMA){var e=G.player.controls[a.PANORAMA].camera;G.player.zoomLevel=t.level,e.fov=G.player.baseFov*(1/G.player.zoomLevel),e.updateProjectionMatrix(),G.player.zoomFov=e.fov}else t.type===a.DOLLHOUSE&&G.player.mode===a.DOLLHOUSE&&G.player.controls[a.DOLLHOUSE].dollyOut(parseFloat(t.level))}},u.prototype.actiontype=function(t){switch(t.tap){case"housedetail":case"outermap":return 1;case"dollhouse":case"floorplan":case"panorama":return"rotate"===t.action?0:"move"===t.action?3:2;case"floor":return 2;case"zoom":return 1}return 0},u.prototype.housedetail=function(t,e){this.emit("housedetail",e)},t.exports=u}).call(this,n(6))}])}));
  3. //# sourceMappingURL=HOUSEPLAY.js.map