From a32bc05ee0e978d7bdb48262881d15e6c6f105b0 Mon Sep 17 00:00:00 2001 From: GenevieveBuckley <30920819+GenevieveBuckley@users.noreply.github.com> Date: Wed, 31 Oct 2018 19:52:32 +1100 Subject: [PATCH 1/8] Add development copy of file https://unpkg.com/jupyter-threejs@2.0.1/dist/index.js --- js/dist/jupyter-threejs.js | 58 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 js/dist/jupyter-threejs.js diff --git a/js/dist/jupyter-threejs.js b/js/dist/jupyter-threejs.js new file mode 100644 index 00000000..cd838e65 --- /dev/null +++ b/js/dist/jupyter-threejs.js @@ -0,0 +1,58 @@ +define("jupyter-threejs",["@jupyter-widgets/base"],function(__WEBPACK_EXTERNAL_MODULE__2__){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=165)}([function(e,t,r){"use strict";function n(){}r.r(t),r.d(t,"WebGLRenderTargetCube",function(){return Kt}),r.d(t,"WebGLRenderTarget",function(){return Yt}),r.d(t,"WebGLRenderer",function(){return hi}),r.d(t,"ShaderLib",function(){return ar}),r.d(t,"UniformsLib",function(){return or}),r.d(t,"UniformsUtils",function(){return rr}),r.d(t,"ShaderChunk",function(){return tr}),r.d(t,"FogExp2",function(){return li}),r.d(t,"Fog",function(){return ui}),r.d(t,"Scene",function(){return pi}),r.d(t,"Sprite",function(){return vi}),r.d(t,"LOD",function(){return yi}),r.d(t,"SkinnedMesh",function(){return _i}),r.d(t,"Skeleton",function(){return gi}),r.d(t,"Bone",function(){return bi}),r.d(t,"Mesh",function(){return Nr}),r.d(t,"LineSegments",function(){return Mi}),r.d(t,"LineLoop",function(){return Ti}),r.d(t,"Line",function(){return wi}),r.d(t,"Points",function(){return Ei}),r.d(t,"Group",function(){return ii}),r.d(t,"VideoTexture",function(){return Ai}),r.d(t,"DataTexture",function(){return Zt}),r.d(t,"DataTexture3D",function(){return Hr}),r.d(t,"CompressedTexture",function(){return Pi}),r.d(t,"CubeTexture",function(){return Gr}),r.d(t,"CanvasTexture",function(){return Ci}),r.d(t,"DepthTexture",function(){return Li}),r.d(t,"Texture",function(){return qt}),r.d(t,"CompressedTextureLoader",function(){return sa}),r.d(t,"DataTextureLoader",function(){return ca}),r.d(t,"CubeTextureLoader",function(){return la}),r.d(t,"TextureLoader",function(){return ua}),r.d(t,"ObjectLoader",function(){return ds}),r.d(t,"MaterialLoader",function(){return ss}),r.d(t,"BufferGeometryLoader",function(){return cs}),r.d(t,"DefaultLoadingManager",function(){return ia}),r.d(t,"LoadingManager",function(){return na}),r.d(t,"JSONLoader",function(){return ps}),r.d(t,"ImageLoader",function(){return ha}),r.d(t,"ImageBitmapLoader",function(){return gs}),r.d(t,"FontLoader",function(){return ws}),r.d(t,"FileLoader",function(){return aa}),r.d(t,"Loader",function(){return ls}),r.d(t,"LoaderUtils",function(){return us}),r.d(t,"Cache",function(){return ra}),r.d(t,"AudioLoader",function(){return Ts}),r.d(t,"SpotLightShadow",function(){return Ia}),r.d(t,"SpotLight",function(){return Da}),r.d(t,"PointLight",function(){return Na}),r.d(t,"RectAreaLight",function(){return Wa}),r.d(t,"HemisphereLight",function(){return Fa}),r.d(t,"DirectionalLightShadow",function(){return Ga}),r.d(t,"DirectionalLight",function(){return Ha}),r.d(t,"AmbientLight",function(){return Va}),r.d(t,"LightShadow",function(){return za}),r.d(t,"Light",function(){return ka}),r.d(t,"StereoCamera",function(){return Ss}),r.d(t,"PerspectiveCamera",function(){return ai}),r.d(t,"OrthographicCamera",function(){return Ua}),r.d(t,"CubeCamera",function(){return Es}),r.d(t,"ArrayCamera",function(){return si}),r.d(t,"Camera",function(){return oi}),r.d(t,"AudioListener",function(){return As}),r.d(t,"PositionalAudio",function(){return Cs}),r.d(t,"AudioContext",function(){return Ms}),r.d(t,"AudioAnalyser",function(){return Ls}),r.d(t,"Audio",function(){return Ps}),r.d(t,"VectorKeyframeTrack",function(){return is}),r.d(t,"StringKeyframeTrack",function(){return ns}),r.d(t,"QuaternionKeyframeTrack",function(){return rs}),r.d(t,"NumberKeyframeTrack",function(){return es}),r.d(t,"ColorKeyframeTrack",function(){return $a}),r.d(t,"BooleanKeyframeTrack",function(){return Qa}),r.d(t,"PropertyMixer",function(){return Rs}),r.d(t,"PropertyBinding",function(){return ks}),r.d(t,"KeyframeTrack",function(){return Ja}),r.d(t,"AnimationUtils",function(){return qa}),r.d(t,"AnimationObjectGroup",function(){return Fs}),r.d(t,"AnimationMixer",function(){return Is}),r.d(t,"AnimationClip",function(){return os}),r.d(t,"Uniform",function(){return Ds}),r.d(t,"InstancedBufferGeometry",function(){return Ns}),r.d(t,"BufferGeometry",function(){return Cr}),r.d(t,"Geometry",function(){return mr}),r.d(t,"InterleavedBufferAttribute",function(){return fi}),r.d(t,"InstancedInterleavedBuffer",function(){return Us}),r.d(t,"InterleavedBuffer",function(){return di}),r.d(t,"InstancedBufferAttribute",function(){return Gs}),r.d(t,"Face3",function(){return hr}),r.d(t,"Object3D",function(){return dr}),r.d(t,"Raycaster",function(){return Hs}),r.d(t,"Layers",function(){return ur}),r.d(t,"EventDispatcher",function(){return n}),r.d(t,"Clock",function(){return qs}),r.d(t,"QuaternionLinearInterpolant",function(){return ts}),r.d(t,"LinearInterpolant",function(){return Ka}),r.d(t,"DiscreteInterpolant",function(){return Za}),r.d(t,"CubicInterpolant",function(){return Ya}),r.d(t,"Interpolant",function(){return Xa}),r.d(t,"Triangle",function(){return Ir}),r.d(t,"Math",function(){return It}),r.d(t,"Spherical",function(){return Xs}),r.d(t,"Cylindrical",function(){return Ys}),r.d(t,"Plane",function(){return $t}),r.d(t,"Frustum",function(){return er}),r.d(t,"Sphere",function(){return Qt}),r.d(t,"Ray",function(){return zr}),r.d(t,"Matrix4",function(){return Nt}),r.d(t,"Matrix3",function(){return Ht}),r.d(t,"Box3",function(){return Jt}),r.d(t,"Box2",function(){return Ks}),r.d(t,"Line3",function(){return Zs}),r.d(t,"Euler",function(){return lr}),r.d(t,"Vector4",function(){return Xt}),r.d(t,"Vector3",function(){return Gt}),r.d(t,"Vector2",function(){return Dt}),r.d(t,"Quaternion",function(){return Ut}),r.d(t,"Color",function(){return ir}),r.d(t,"ImmediateRenderObject",function(){return Js}),r.d(t,"VertexNormalsHelper",function(){return Qs}),r.d(t,"SpotLightHelper",function(){return $s}),r.d(t,"SkeletonHelper",function(){return ec}),r.d(t,"PointLightHelper",function(){return tc}),r.d(t,"RectAreaLightHelper",function(){return rc}),r.d(t,"HemisphereLightHelper",function(){return nc}),r.d(t,"GridHelper",function(){return ic}),r.d(t,"PolarGridHelper",function(){return oc}),r.d(t,"FaceNormalsHelper",function(){return ac}),r.d(t,"DirectionalLightHelper",function(){return sc}),r.d(t,"CameraHelper",function(){return cc}),r.d(t,"BoxHelper",function(){return hc}),r.d(t,"Box3Helper",function(){return lc}),r.d(t,"PlaneHelper",function(){return uc}),r.d(t,"ArrowHelper",function(){return pc}),r.d(t,"AxesHelper",function(){return dc}),r.d(t,"Shape",function(){return ja}),r.d(t,"Path",function(){return Ba}),r.d(t,"ShapePath",function(){return bs}),r.d(t,"Font",function(){return _s}),r.d(t,"CurvePath",function(){return Oa}),r.d(t,"Curve",function(){return pa}),r.d(t,"ImageUtils",function(){return Vt}),r.d(t,"ShapeUtils",function(){return bo}),r.d(t,"WebGLUtils",function(){return ni}),r.d(t,"WireframeGeometry",function(){return Ri}),r.d(t,"ParametricGeometry",function(){return Oi}),r.d(t,"ParametricBufferGeometry",function(){return Bi}),r.d(t,"TetrahedronGeometry",function(){return Fi}),r.d(t,"TetrahedronBufferGeometry",function(){return zi}),r.d(t,"OctahedronGeometry",function(){return Ii}),r.d(t,"OctahedronBufferGeometry",function(){return Di}),r.d(t,"IcosahedronGeometry",function(){return Ni}),r.d(t,"IcosahedronBufferGeometry",function(){return Ui}),r.d(t,"DodecahedronGeometry",function(){return Gi}),r.d(t,"DodecahedronBufferGeometry",function(){return Hi}),r.d(t,"PolyhedronGeometry",function(){return ji}),r.d(t,"PolyhedronBufferGeometry",function(){return ki}),r.d(t,"TubeGeometry",function(){return Vi}),r.d(t,"TubeBufferGeometry",function(){return Wi}),r.d(t,"TorusKnotGeometry",function(){return qi}),r.d(t,"TorusKnotBufferGeometry",function(){return Xi}),r.d(t,"TorusGeometry",function(){return Yi}),r.d(t,"TorusBufferGeometry",function(){return Ki}),r.d(t,"TextGeometry",function(){return Eo}),r.d(t,"TextBufferGeometry",function(){return Ao}),r.d(t,"SphereGeometry",function(){return Po}),r.d(t,"SphereBufferGeometry",function(){return Co}),r.d(t,"RingGeometry",function(){return Lo}),r.d(t,"RingBufferGeometry",function(){return Ro}),r.d(t,"PlaneGeometry",function(){return Or}),r.d(t,"PlaneBufferGeometry",function(){return Br}),r.d(t,"LatheGeometry",function(){return Oo}),r.d(t,"LatheBufferGeometry",function(){return Bo}),r.d(t,"ShapeGeometry",function(){return jo}),r.d(t,"ShapeBufferGeometry",function(){return ko}),r.d(t,"ExtrudeGeometry",function(){return wo}),r.d(t,"ExtrudeBufferGeometry",function(){return Mo}),r.d(t,"EdgesGeometry",function(){return zo}),r.d(t,"ConeGeometry",function(){return No}),r.d(t,"ConeBufferGeometry",function(){return Uo}),r.d(t,"CylinderGeometry",function(){return Io}),r.d(t,"CylinderBufferGeometry",function(){return Do}),r.d(t,"CircleGeometry",function(){return Go}),r.d(t,"CircleBufferGeometry",function(){return Ho}),r.d(t,"BoxGeometry",function(){return Lr}),r.d(t,"BoxBufferGeometry",function(){return Rr}),r.d(t,"ShadowMaterial",function(){return Wo}),r.d(t,"SpriteMaterial",function(){return mi}),r.d(t,"RawShaderMaterial",function(){return qo}),r.d(t,"ShaderMaterial",function(){return Fr}),r.d(t,"PointsMaterial",function(){return Si}),r.d(t,"MeshPhysicalMaterial",function(){return Yo}),r.d(t,"MeshStandardMaterial",function(){return Xo}),r.d(t,"MeshPhongMaterial",function(){return Ko}),r.d(t,"MeshToonMaterial",function(){return Zo}),r.d(t,"MeshNormalMaterial",function(){return Jo}),r.d(t,"MeshLambertMaterial",function(){return Qo}),r.d(t,"MeshDepthMaterial",function(){return $n}),r.d(t,"MeshDistanceMaterial",function(){return ei}),r.d(t,"MeshBasicMaterial",function(){return Dr}),r.d(t,"MeshMatcapMaterial",function(){return $o}),r.d(t,"LineDashedMaterial",function(){return ea}),r.d(t,"LineBasicMaterial",function(){return xi}),r.d(t,"Material",function(){return kr}),r.d(t,"Float64BufferAttribute",function(){return Sr}),r.d(t,"Float32BufferAttribute",function(){return Tr}),r.d(t,"Uint32BufferAttribute",function(){return Mr}),r.d(t,"Int32BufferAttribute",function(){return wr}),r.d(t,"Uint16BufferAttribute",function(){return xr}),r.d(t,"Int16BufferAttribute",function(){return _r}),r.d(t,"Uint8ClampedBufferAttribute",function(){return br}),r.d(t,"Uint8BufferAttribute",function(){return gr}),r.d(t,"Int8BufferAttribute",function(){return yr}),r.d(t,"BufferAttribute",function(){return vr}),r.d(t,"ArcCurve",function(){return fa}),r.d(t,"CatmullRomCurve3",function(){return _a}),r.d(t,"CubicBezierCurve",function(){return Ta}),r.d(t,"CubicBezierCurve3",function(){return Sa}),r.d(t,"EllipseCurve",function(){return da}),r.d(t,"LineCurve",function(){return Ea}),r.d(t,"LineCurve3",function(){return Aa}),r.d(t,"QuadraticBezierCurve",function(){return Pa}),r.d(t,"QuadraticBezierCurve3",function(){return Ca}),r.d(t,"SplineCurve",function(){return La}),r.d(t,"REVISION",function(){return i}),r.d(t,"MOUSE",function(){return o}),r.d(t,"CullFaceNone",function(){return a}),r.d(t,"CullFaceBack",function(){return s}),r.d(t,"CullFaceFront",function(){return c}),r.d(t,"CullFaceFrontBack",function(){return h}),r.d(t,"FrontFaceDirectionCW",function(){return l}),r.d(t,"FrontFaceDirectionCCW",function(){return u}),r.d(t,"BasicShadowMap",function(){return p}),r.d(t,"PCFShadowMap",function(){return d}),r.d(t,"PCFSoftShadowMap",function(){return f}),r.d(t,"FrontSide",function(){return m}),r.d(t,"BackSide",function(){return v}),r.d(t,"DoubleSide",function(){return y}),r.d(t,"FlatShading",function(){return g}),r.d(t,"SmoothShading",function(){return b}),r.d(t,"NoColors",function(){return _}),r.d(t,"FaceColors",function(){return x}),r.d(t,"VertexColors",function(){return w}),r.d(t,"NoBlending",function(){return M}),r.d(t,"NormalBlending",function(){return T}),r.d(t,"AdditiveBlending",function(){return S}),r.d(t,"SubtractiveBlending",function(){return E}),r.d(t,"MultiplyBlending",function(){return A}),r.d(t,"CustomBlending",function(){return P}),r.d(t,"AddEquation",function(){return C}),r.d(t,"SubtractEquation",function(){return L}),r.d(t,"ReverseSubtractEquation",function(){return R}),r.d(t,"MinEquation",function(){return O}),r.d(t,"MaxEquation",function(){return B}),r.d(t,"ZeroFactor",function(){return j}),r.d(t,"OneFactor",function(){return k}),r.d(t,"SrcColorFactor",function(){return F}),r.d(t,"OneMinusSrcColorFactor",function(){return z}),r.d(t,"SrcAlphaFactor",function(){return I}),r.d(t,"OneMinusSrcAlphaFactor",function(){return D}),r.d(t,"DstAlphaFactor",function(){return N}),r.d(t,"OneMinusDstAlphaFactor",function(){return U}),r.d(t,"DstColorFactor",function(){return G}),r.d(t,"OneMinusDstColorFactor",function(){return H}),r.d(t,"SrcAlphaSaturateFactor",function(){return V}),r.d(t,"NeverDepth",function(){return W}),r.d(t,"AlwaysDepth",function(){return q}),r.d(t,"LessDepth",function(){return X}),r.d(t,"LessEqualDepth",function(){return Y}),r.d(t,"EqualDepth",function(){return K}),r.d(t,"GreaterEqualDepth",function(){return Z}),r.d(t,"GreaterDepth",function(){return J}),r.d(t,"NotEqualDepth",function(){return Q}),r.d(t,"MultiplyOperation",function(){return $}),r.d(t,"MixOperation",function(){return ee}),r.d(t,"AddOperation",function(){return te}),r.d(t,"NoToneMapping",function(){return re}),r.d(t,"LinearToneMapping",function(){return ne}),r.d(t,"ReinhardToneMapping",function(){return ie}),r.d(t,"Uncharted2ToneMapping",function(){return oe}),r.d(t,"CineonToneMapping",function(){return ae}),r.d(t,"UVMapping",function(){return se}),r.d(t,"CubeReflectionMapping",function(){return ce}),r.d(t,"CubeRefractionMapping",function(){return he}),r.d(t,"EquirectangularReflectionMapping",function(){return le}),r.d(t,"EquirectangularRefractionMapping",function(){return ue}),r.d(t,"SphericalReflectionMapping",function(){return pe}),r.d(t,"CubeUVReflectionMapping",function(){return de}),r.d(t,"CubeUVRefractionMapping",function(){return fe}),r.d(t,"RepeatWrapping",function(){return me}),r.d(t,"ClampToEdgeWrapping",function(){return ve}),r.d(t,"MirroredRepeatWrapping",function(){return ye}),r.d(t,"NearestFilter",function(){return ge}),r.d(t,"NearestMipMapNearestFilter",function(){return be}),r.d(t,"NearestMipMapLinearFilter",function(){return _e}),r.d(t,"LinearFilter",function(){return xe}),r.d(t,"LinearMipMapNearestFilter",function(){return we}),r.d(t,"LinearMipMapLinearFilter",function(){return Me}),r.d(t,"UnsignedByteType",function(){return Te}),r.d(t,"ByteType",function(){return Se}),r.d(t,"ShortType",function(){return Ee}),r.d(t,"UnsignedShortType",function(){return Ae}),r.d(t,"IntType",function(){return Pe}),r.d(t,"UnsignedIntType",function(){return Ce}),r.d(t,"FloatType",function(){return Le}),r.d(t,"HalfFloatType",function(){return Re}),r.d(t,"UnsignedShort4444Type",function(){return Oe}),r.d(t,"UnsignedShort5551Type",function(){return Be}),r.d(t,"UnsignedShort565Type",function(){return je}),r.d(t,"UnsignedInt248Type",function(){return ke}),r.d(t,"AlphaFormat",function(){return Fe}),r.d(t,"RGBFormat",function(){return ze}),r.d(t,"RGBAFormat",function(){return Ie}),r.d(t,"LuminanceFormat",function(){return De}),r.d(t,"LuminanceAlphaFormat",function(){return Ne}),r.d(t,"RGBEFormat",function(){return Ue}),r.d(t,"DepthFormat",function(){return Ge}),r.d(t,"DepthStencilFormat",function(){return He}),r.d(t,"RedFormat",function(){return Ve}),r.d(t,"RGB_S3TC_DXT1_Format",function(){return We}),r.d(t,"RGBA_S3TC_DXT1_Format",function(){return qe}),r.d(t,"RGBA_S3TC_DXT3_Format",function(){return Xe}),r.d(t,"RGBA_S3TC_DXT5_Format",function(){return Ye}),r.d(t,"RGB_PVRTC_4BPPV1_Format",function(){return Ke}),r.d(t,"RGB_PVRTC_2BPPV1_Format",function(){return Ze}),r.d(t,"RGBA_PVRTC_4BPPV1_Format",function(){return Je}),r.d(t,"RGBA_PVRTC_2BPPV1_Format",function(){return Qe}),r.d(t,"RGB_ETC1_Format",function(){return $e}),r.d(t,"RGBA_ASTC_4x4_Format",function(){return et}),r.d(t,"RGBA_ASTC_5x4_Format",function(){return tt}),r.d(t,"RGBA_ASTC_5x5_Format",function(){return rt}),r.d(t,"RGBA_ASTC_6x5_Format",function(){return nt}),r.d(t,"RGBA_ASTC_6x6_Format",function(){return it}),r.d(t,"RGBA_ASTC_8x5_Format",function(){return ot}),r.d(t,"RGBA_ASTC_8x6_Format",function(){return at}),r.d(t,"RGBA_ASTC_8x8_Format",function(){return st}),r.d(t,"RGBA_ASTC_10x5_Format",function(){return ct}),r.d(t,"RGBA_ASTC_10x6_Format",function(){return ht}),r.d(t,"RGBA_ASTC_10x8_Format",function(){return lt}),r.d(t,"RGBA_ASTC_10x10_Format",function(){return ut}),r.d(t,"RGBA_ASTC_12x10_Format",function(){return pt}),r.d(t,"RGBA_ASTC_12x12_Format",function(){return dt}),r.d(t,"LoopOnce",function(){return ft}),r.d(t,"LoopRepeat",function(){return mt}),r.d(t,"LoopPingPong",function(){return vt}),r.d(t,"InterpolateDiscrete",function(){return yt}),r.d(t,"InterpolateLinear",function(){return gt}),r.d(t,"InterpolateSmooth",function(){return bt}),r.d(t,"ZeroCurvatureEnding",function(){return _t}),r.d(t,"ZeroSlopeEnding",function(){return xt}),r.d(t,"WrapAroundEnding",function(){return wt}),r.d(t,"TrianglesDrawMode",function(){return Mt}),r.d(t,"TriangleStripDrawMode",function(){return Tt}),r.d(t,"TriangleFanDrawMode",function(){return St}),r.d(t,"LinearEncoding",function(){return Et}),r.d(t,"sRGBEncoding",function(){return At}),r.d(t,"GammaEncoding",function(){return Pt}),r.d(t,"RGBEEncoding",function(){return Ct}),r.d(t,"LogLuvEncoding",function(){return Lt}),r.d(t,"RGBM7Encoding",function(){return Rt}),r.d(t,"RGBM16Encoding",function(){return Ot}),r.d(t,"RGBDEncoding",function(){return Bt}),r.d(t,"BasicDepthPacking",function(){return jt}),r.d(t,"RGBADepthPacking",function(){return kt}),r.d(t,"TangentSpaceNormalMap",function(){return Ft}),r.d(t,"ObjectSpaceNormalMap",function(){return zt}),r.d(t,"CubeGeometry",function(){return Lr}),r.d(t,"Face4",function(){return fc}),r.d(t,"LineStrip",function(){return mc}),r.d(t,"LinePieces",function(){return vc}),r.d(t,"MeshFaceMaterial",function(){return yc}),r.d(t,"MultiMaterial",function(){return gc}),r.d(t,"PointCloud",function(){return bc}),r.d(t,"Particle",function(){return _c}),r.d(t,"ParticleSystem",function(){return xc}),r.d(t,"PointCloudMaterial",function(){return wc}),r.d(t,"ParticleBasicMaterial",function(){return Mc}),r.d(t,"ParticleSystemMaterial",function(){return Tc}),r.d(t,"Vertex",function(){return Sc}),r.d(t,"DynamicBufferAttribute",function(){return Ec}),r.d(t,"Int8Attribute",function(){return Ac}),r.d(t,"Uint8Attribute",function(){return Pc}),r.d(t,"Uint8ClampedAttribute",function(){return Cc}),r.d(t,"Int16Attribute",function(){return Lc}),r.d(t,"Uint16Attribute",function(){return Rc}),r.d(t,"Int32Attribute",function(){return Oc}),r.d(t,"Uint32Attribute",function(){return Bc}),r.d(t,"Float32Attribute",function(){return jc}),r.d(t,"Float64Attribute",function(){return kc}),r.d(t,"ClosedSplineCurve3",function(){return Fc}),r.d(t,"SplineCurve3",function(){return zc}),r.d(t,"Spline",function(){return Ic}),r.d(t,"AxisHelper",function(){return Dc}),r.d(t,"BoundingBoxHelper",function(){return Nc}),r.d(t,"EdgesHelper",function(){return Uc}),r.d(t,"WireframeHelper",function(){return Gc}),r.d(t,"XHRLoader",function(){return Hc}),r.d(t,"BinaryTextureLoader",function(){return Vc}),r.d(t,"GeometryUtils",function(){return Wc}),r.d(t,"Projector",function(){return qc}),r.d(t,"CanvasRenderer",function(){return Xc}),r.d(t,"SceneUtils",function(){return Yc}),r.d(t,"LensFlare",function(){return Kc}),void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}),void 0===Math.sign&&(Math.sign=function(e){return e<0?-1:e>0?1:+e}),"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(e){if(void 0===e||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1;r>8&255]+e[t>>16&255]+e[t>>24&255]+"-"+e[255&r]+e[r>>8&255]+"-"+e[r>>16&15|64]+e[r>>24&255]+"-"+e[63&n|128]+e[n>>8&255]+"-"+e[n>>16&255]+e[n>>24&255]+e[255&i]+e[i>>8&255]+e[i>>16&255]+e[i>>24&255]).toUpperCase()}}(),clamp:function(e,t,r){return Math.max(t,Math.min(r,e))},euclideanModulo:function(e,t){return(e%t+t)%t},mapLinear:function(e,t,r,n,i){return n+(e-t)*(i-n)/(r-t)},lerp:function(e,t,r){return(1-r)*e+r*t},smoothstep:function(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*(3-2*e)},smootherstep:function(e,t,r){return e<=t?0:e>=r?1:(e=(e-t)/(r-t))*e*e*(e*(6*e-15)+10)},randInt:function(e,t){return e+Math.floor(Math.random()*(t-e+1))},randFloat:function(e,t){return e+Math.random()*(t-e)},randFloatSpread:function(e){return e*(.5-Math.random())},degToRad:function(e){return e*It.DEG2RAD},radToDeg:function(e){return e*It.RAD2DEG},isPowerOfTwo:function(e){return 0==(e&e-1)&&0!==e},ceilPowerOfTwo:function(e){return Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},floorPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))}};function Dt(e,t){this.x=e||0,this.y=t||0}function Nt(){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")}function Ut(e,t,r,n){this._x=e||0,this._y=t||0,this._z=r||0,this._w=void 0!==n?n:1}function Gt(e,t,r){this.x=e||0,this.y=t||0,this.z=r||0}function Ht(){this.elements=[1,0,0,0,1,0,0,0,1],arguments.length>0&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}Object.defineProperties(Dt.prototype,{width:{get:function(){return this.x},set:function(e){this.x=e}},height:{get:function(){return this.y},set:function(e){this.y=e}}}),Object.assign(Dt.prototype,{isVector2:!0,set:function(e,t){return this.x=e,this.y=t,this},setScalar:function(e){return this.x=e,this.y=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(e){return this.x=e.x,this.y=e.y,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this)},addScalar:function(e){return this.x+=e,this.y+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this)},subScalar:function(e){return this.x-=e,this.y-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this},multiply:function(e){return this.x*=e.x,this.y*=e.y,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this},divide:function(e){return this.x/=e.x,this.y/=e.y,this},divideScalar:function(e){return this.multiplyScalar(1/e)},applyMatrix3:function(e){var t=this.x,r=this.y,n=e.elements;return this.x=n[0]*t+n[3]*r+n[6],this.y=n[1]*t+n[4]*r+n[7],this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this},clampScalar:function(){var e=new Dt,t=new Dt;return function(r,n){return e.set(r,r),t.set(n,n),this.clamp(e,t)}}(),clampLength:function(e,t){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))},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(e){return this.x*e.x+this.y*e.y},cross:function(e){return this.x*e.y-this.y*e.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 e=Math.atan2(this.y,this.x);return e<0&&(e+=2*Math.PI),e},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,r=this.y-e.y;return t*t+r*r},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)},setLength:function(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this},lerpVectors:function(e,t,r){return this.subVectors(t,e).multiplyScalar(r).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e},fromBufferAttribute:function(e,t,r){return void 0!==r&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this},rotateAround:function(e,t){var r=Math.cos(t),n=Math.sin(t),i=this.x-e.x,o=this.y-e.y;return this.x=i*r-o*n+e.x,this.y=i*n+o*r+e.y,this}}),Object.assign(Nt.prototype,{isMatrix4:!0,set:function(e,t,r,n,i,o,a,s,c,h,l,u,p,d,f,m){var v=this.elements;return v[0]=e,v[4]=t,v[8]=r,v[12]=n,v[1]=i,v[5]=o,v[9]=a,v[13]=s,v[2]=c,v[6]=h,v[10]=l,v[14]=u,v[3]=p,v[7]=d,v[11]=f,v[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 Nt).fromArray(this.elements)},copy:function(e){var t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],this},copyPosition:function(e){var t=this.elements,r=e.elements;return t[12]=r[12],t[13]=r[13],t[14]=r[14],this},extractBasis:function(e,t,r){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),r.setFromMatrixColumn(this,2),this},makeBasis:function(e,t,r){return this.set(e.x,t.x,r.x,0,e.y,t.y,r.y,0,e.z,t.z,r.z,0,0,0,0,1),this},extractRotation:function(){var e=new Gt;return function(t){var r=this.elements,n=t.elements,i=1/e.setFromMatrixColumn(t,0).length(),o=1/e.setFromMatrixColumn(t,1).length(),a=1/e.setFromMatrixColumn(t,2).length();return r[0]=n[0]*i,r[1]=n[1]*i,r[2]=n[2]*i,r[3]=0,r[4]=n[4]*o,r[5]=n[5]*o,r[6]=n[6]*o,r[7]=0,r[8]=n[8]*a,r[9]=n[9]*a,r[10]=n[10]*a,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,this}}(),makeRotationFromEuler:function(e){e&&e.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var t=this.elements,r=e.x,n=e.y,i=e.z,o=Math.cos(r),a=Math.sin(r),s=Math.cos(n),c=Math.sin(n),h=Math.cos(i),l=Math.sin(i);if("XYZ"===e.order){var u=o*h,p=o*l,d=a*h,f=a*l;t[0]=s*h,t[4]=-s*l,t[8]=c,t[1]=p+d*c,t[5]=u-f*c,t[9]=-a*s,t[2]=f-u*c,t[6]=d+p*c,t[10]=o*s}else if("YXZ"===e.order){var m=s*h,v=s*l,y=c*h,g=c*l;t[0]=m+g*a,t[4]=y*a-v,t[8]=o*c,t[1]=o*l,t[5]=o*h,t[9]=-a,t[2]=v*a-y,t[6]=g+m*a,t[10]=o*s}else if("ZXY"===e.order){m=s*h,v=s*l,y=c*h,g=c*l;t[0]=m-g*a,t[4]=-o*l,t[8]=y+v*a,t[1]=v+y*a,t[5]=o*h,t[9]=g-m*a,t[2]=-o*c,t[6]=a,t[10]=o*s}else if("ZYX"===e.order){u=o*h,p=o*l,d=a*h,f=a*l;t[0]=s*h,t[4]=d*c-p,t[8]=u*c+f,t[1]=s*l,t[5]=f*c+u,t[9]=p*c-d,t[2]=-c,t[6]=a*s,t[10]=o*s}else if("YZX"===e.order){var b=o*s,_=o*c,x=a*s,w=a*c;t[0]=s*h,t[4]=w-b*l,t[8]=x*l+_,t[1]=l,t[5]=o*h,t[9]=-a*h,t[2]=-c*h,t[6]=_*l+x,t[10]=b-w*l}else if("XZY"===e.order){b=o*s,_=o*c,x=a*s,w=a*c;t[0]=s*h,t[4]=-l,t[8]=c*h,t[1]=b*l+w,t[5]=o*h,t[9]=_*l-x,t[2]=x*l-_,t[6]=a*h,t[10]=w*l+b}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this},makeRotationFromQuaternion:function(){var e=new Gt(0,0,0),t=new Gt(1,1,1);return function(r){return this.compose(e,r,t)}}(),lookAt:function(){var e=new Gt,t=new Gt,r=new Gt;return function(n,i,o){var a=this.elements;return r.subVectors(n,i),0===r.lengthSq()&&(r.z=1),r.normalize(),e.crossVectors(o,r),0===e.lengthSq()&&(1===Math.abs(o.z)?r.x+=1e-4:r.z+=1e-4,r.normalize(),e.crossVectors(o,r)),e.normalize(),t.crossVectors(r,e),a[0]=e.x,a[4]=t.x,a[8]=r.x,a[1]=e.y,a[5]=t.y,a[9]=r.y,a[2]=e.z,a[6]=t.z,a[10]=r.z,this}}(),multiply:function(e,t){return void 0!==t?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(e,t)):this.multiplyMatrices(this,e)},premultiply:function(e){return this.multiplyMatrices(e,this)},multiplyMatrices:function(e,t){var r=e.elements,n=t.elements,i=this.elements,o=r[0],a=r[4],s=r[8],c=r[12],h=r[1],l=r[5],u=r[9],p=r[13],d=r[2],f=r[6],m=r[10],v=r[14],y=r[3],g=r[7],b=r[11],_=r[15],x=n[0],w=n[4],M=n[8],T=n[12],S=n[1],E=n[5],A=n[9],P=n[13],C=n[2],L=n[6],R=n[10],O=n[14],B=n[3],j=n[7],k=n[11],F=n[15];return i[0]=o*x+a*S+s*C+c*B,i[4]=o*w+a*E+s*L+c*j,i[8]=o*M+a*A+s*R+c*k,i[12]=o*T+a*P+s*O+c*F,i[1]=h*x+l*S+u*C+p*B,i[5]=h*w+l*E+u*L+p*j,i[9]=h*M+l*A+u*R+p*k,i[13]=h*T+l*P+u*O+p*F,i[2]=d*x+f*S+m*C+v*B,i[6]=d*w+f*E+m*L+v*j,i[10]=d*M+f*A+m*R+v*k,i[14]=d*T+f*P+m*O+v*F,i[3]=y*x+g*S+b*C+_*B,i[7]=y*w+g*E+b*L+_*j,i[11]=y*M+g*A+b*R+_*k,i[15]=y*T+g*P+b*O+_*F,this},multiplyScalar:function(e){var t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this},applyToBufferAttribute:function(){var e=new Gt;return function(t){for(var r=0,n=t.count;r=0?1:-1,g=1-v*v;if(g>Number.EPSILON){var b=Math.sqrt(g),_=Math.atan2(b,v*y);m=Math.sin(m*_)/b,a=Math.sin(a*_)/b}var x=a*y;if(s=s*m+u*x,c=c*m+p*x,h=h*m+d*x,l=l*m+f*x,m===1-a){var w=1/Math.sqrt(s*s+c*c+h*h+l*l);s*=w,c*=w,h*=w,l*=w}}e[t]=s,e[t+1]=c,e[t+2]=h,e[t+3]=l}}),Object.defineProperties(Ut.prototype,{x:{get:function(){return this._x},set:function(e){this._x=e,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(e){this._y=e,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(e){this._z=e,this.onChangeCallback()}},w:{get:function(){return this._w},set:function(e){this._w=e,this.onChangeCallback()}}}),Object.assign(Ut.prototype,{isQuaternion:!0,set:function(e,t,r,n){return this._x=e,this._y=t,this._z=r,this._w=n,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this.onChangeCallback(),this},setFromEuler:function(e,t){if(!e||!e.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");var r=e._x,n=e._y,i=e._z,o=e.order,a=Math.cos,s=Math.sin,c=a(r/2),h=a(n/2),l=a(i/2),u=s(r/2),p=s(n/2),d=s(i/2);return"XYZ"===o?(this._x=u*h*l+c*p*d,this._y=c*p*l-u*h*d,this._z=c*h*d+u*p*l,this._w=c*h*l-u*p*d):"YXZ"===o?(this._x=u*h*l+c*p*d,this._y=c*p*l-u*h*d,this._z=c*h*d-u*p*l,this._w=c*h*l+u*p*d):"ZXY"===o?(this._x=u*h*l-c*p*d,this._y=c*p*l+u*h*d,this._z=c*h*d+u*p*l,this._w=c*h*l-u*p*d):"ZYX"===o?(this._x=u*h*l-c*p*d,this._y=c*p*l+u*h*d,this._z=c*h*d-u*p*l,this._w=c*h*l+u*p*d):"YZX"===o?(this._x=u*h*l+c*p*d,this._y=c*p*l+u*h*d,this._z=c*h*d-u*p*l,this._w=c*h*l-u*p*d):"XZY"===o&&(this._x=u*h*l-c*p*d,this._y=c*p*l-u*h*d,this._z=c*h*d+u*p*l,this._w=c*h*l+u*p*d),!1!==t&&this.onChangeCallback(),this},setFromAxisAngle:function(e,t){var r=t/2,n=Math.sin(r);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(r),this.onChangeCallback(),this},setFromRotationMatrix:function(e){var t,r=e.elements,n=r[0],i=r[4],o=r[8],a=r[1],s=r[5],c=r[9],h=r[2],l=r[6],u=r[10],p=n+s+u;return p>0?(t=.5/Math.sqrt(p+1),this._w=.25/t,this._x=(l-c)*t,this._y=(o-h)*t,this._z=(a-i)*t):n>s&&n>u?(t=2*Math.sqrt(1+n-s-u),this._w=(l-c)/t,this._x=.25*t,this._y=(i+a)/t,this._z=(o+h)/t):s>u?(t=2*Math.sqrt(1+s-n-u),this._w=(o-h)/t,this._x=(i+a)/t,this._y=.25*t,this._z=(c+l)/t):(t=2*Math.sqrt(1+u-n-s),this._w=(a-i)/t,this._x=(o+h)/t,this._y=(c+l)/t,this._z=.25*t),this.onChangeCallback(),this},setFromUnitVectors:function(){var e,t=new Gt;return function(r,n){return void 0===t&&(t=new Gt),(e=r.dot(n)+1)<1e-6?(e=0,Math.abs(r.x)>Math.abs(r.z)?t.set(-r.y,r.x,0):t.set(0,-r.z,r.y)):t.crossVectors(r,n),this._x=t.x,this._y=t.y,this._z=t.z,this._w=e,this.normalize()}}(),angleTo:function(e){return 2*Math.acos(Math.abs(It.clamp(this.dot(e),-1,1)))},rotateTowards:function(e,t){var r=this.angleTo(e);if(0===r)return this;var n=Math.min(1,t/r);return this.slerp(e,n),this},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._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 e=this.length();return 0===e?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this.onChangeCallback(),this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(e,t)):this.multiplyQuaternions(this,e)},premultiply:function(e){return this.multiplyQuaternions(e,this)},multiplyQuaternions:function(e,t){var r=e._x,n=e._y,i=e._z,o=e._w,a=t._x,s=t._y,c=t._z,h=t._w;return this._x=r*h+o*a+n*c-i*s,this._y=n*h+o*s+i*a-r*c,this._z=i*h+o*c+r*s-n*a,this._w=o*h-r*a-n*s-i*c,this.onChangeCallback(),this},slerp:function(e,t){if(0===t)return this;if(1===t)return this.copy(e);var r=this._x,n=this._y,i=this._z,o=this._w,a=o*e._w+r*e._x+n*e._y+i*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=r,this._y=n,this._z=i,this;var s=1-a*a;if(s<=Number.EPSILON){var c=1-t;return this._w=c*o+t*this._w,this._x=c*r+t*this._x,this._y=c*n+t*this._y,this._z=c*i+t*this._z,this.normalize()}var h=Math.sqrt(s),l=Math.atan2(h,a),u=Math.sin((1-t)*l)/h,p=Math.sin(t*l)/h;return this._w=o*u+this._w*p,this._x=r*u+this._x*p,this._y=n*u+this._y*p,this._z=i*u+this._z*p,this.onChangeCallback(),this},equals:function(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w},fromArray:function(e,t){return void 0===t&&(t=0),this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this.onChangeCallback(),this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e},onChange:function(e){return this.onChangeCallback=e,this},onChangeCallback:function(){}}),Object.assign(Gt.prototype,{isVector3:!0,set:function(e,t,r){return this.x=e,this.y=t,this.z=r,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this},multiply:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(e,t)):(this.x*=e.x,this.y*=e.y,this.z*=e.z,this)},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this},multiplyVectors:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this},applyEuler:function(){var e=new Ut;return function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(e.setFromEuler(t))}}(),applyAxisAngle:function(){var e=new Ut;return function(t,r){return this.applyQuaternion(e.setFromAxisAngle(t,r))}}(),applyMatrix3:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[3]*r+i[6]*n,this.y=i[1]*t+i[4]*r+i[7]*n,this.z=i[2]*t+i[5]*r+i[8]*n,this},applyMatrix4:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements,o=1/(i[3]*t+i[7]*r+i[11]*n+i[15]);return this.x=(i[0]*t+i[4]*r+i[8]*n+i[12])*o,this.y=(i[1]*t+i[5]*r+i[9]*n+i[13])*o,this.z=(i[2]*t+i[6]*r+i[10]*n+i[14])*o,this},applyQuaternion:function(e){var t=this.x,r=this.y,n=this.z,i=e.x,o=e.y,a=e.z,s=e.w,c=s*t+o*n-a*r,h=s*r+a*t-i*n,l=s*n+i*r-o*t,u=-i*t-o*r-a*n;return this.x=c*s+u*-i+h*-a-l*-o,this.y=h*s+u*-o+l*-i-c*-a,this.z=l*s+u*-a+c*-o-h*-i,this},project:function(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)},unproject:function(){var e=new Nt;return function(t){return this.applyMatrix4(e.getInverse(t.projectionMatrix)).applyMatrix4(t.matrixWorld)}}(),transformDirection:function(e){var t=this.x,r=this.y,n=this.z,i=e.elements;return this.x=i[0]*t+i[4]*r+i[8]*n,this.y=i[1]*t+i[5]*r+i[9]*n,this.z=i[2]*t+i[6]*r+i[10]*n,this.normalize()},divide:function(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this},divideScalar:function(e){return this.multiplyScalar(1/e)},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this},clampScalar:function(){var e=new Gt,t=new Gt;return function(r,n){return e.set(r,r,r),t.set(n,n,n),this.clamp(e,t)}}(),clampLength:function(e,t){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))},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(e){return this.x*e.x+this.y*e.y+this.z*e.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(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this},lerpVectors:function(e,t,r){return this.subVectors(t,e).multiplyScalar(r).add(e)},cross:function(e,t){return void 0!==t?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(e,t)):this.crossVectors(this,e)},crossVectors:function(e,t){var r=e.x,n=e.y,i=e.z,o=t.x,a=t.y,s=t.z;return this.x=n*s-i*a,this.y=i*o-r*s,this.z=r*a-n*o,this},projectOnVector:function(e){var t=e.dot(this)/e.lengthSq();return this.copy(e).multiplyScalar(t)},projectOnPlane:function(){var e=new Gt;return function(t){return e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e=new Gt;return function(t){return this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(e){var t=this.dot(e)/Math.sqrt(this.lengthSq()*e.lengthSq());return Math.acos(It.clamp(t,-1,1))},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(e){var t=this.x-e.x,r=this.y-e.y,n=this.z-e.z;return t*t+r*r+n*n},manhattanDistanceTo:function(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)},setFromSpherical:function(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)},setFromSphericalCoords:function(e,t,r){var n=Math.sin(t)*e;return this.x=n*Math.sin(r),this.y=Math.cos(t)*e,this.z=n*Math.cos(r),this},setFromCylindrical:function(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)},setFromCylindricalCoords:function(e,t,r){return this.x=e*Math.sin(t),this.y=r,this.z=e*Math.cos(t),this},setFromMatrixPosition:function(e){var t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this},setFromMatrixScale:function(e){var t=this.setFromMatrixColumn(e,0).length(),r=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=r,this.z=n,this},setFromMatrixColumn:function(e,t){return this.fromArray(e.elements,4*t)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e},fromBufferAttribute:function(e,t,r){return void 0!==r&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}}),Object.assign(Ht.prototype,{isMatrix3:!0,set:function(e,t,r,n,i,o,a,s,c){var h=this.elements;return h[0]=e,h[1]=n,h[2]=a,h[3]=t,h[4]=i,h[5]=s,h[6]=r,h[7]=o,h[8]=c,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.elements)},copy:function(e){var t=this.elements,r=e.elements;return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],this},setFromMatrix4:function(e){var t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},applyToBufferAttribute:function(){var e=new Gt;return function(t){for(var r=0,n=t.count;r2048||t.height>2048?t.toDataURL("image/jpeg",.6):t.toDataURL("image/png")}},Wt=0;function qt(e,t,r,n,i,o,a,s,c,h){Object.defineProperty(this,"id",{value:Wt++}),this.uuid=It.generateUUID(),this.name="",this.image=void 0!==e?e:qt.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==t?t:qt.DEFAULT_MAPPING,this.wrapS=void 0!==r?r:ve,this.wrapT=void 0!==n?n:ve,this.magFilter=void 0!==i?i:xe,this.minFilter=void 0!==o?o:Me,this.anisotropy=void 0!==c?c:1,this.format=void 0!==a?a:Ie,this.type=void 0!==s?s:Te,this.offset=new Dt(0,0),this.repeat=new Dt(1,1),this.center=new Dt(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Ht,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==h?h:Et,this.version=0,this.onUpdate=null}function Xt(e,t,r,n){this.x=e||0,this.y=t||0,this.z=r||0,this.w=void 0!==n?n:1}function Yt(e,t,r){this.width=e,this.height=t,this.scissor=new Xt(0,0,e,t),this.scissorTest=!1,this.viewport=new Xt(0,0,e,t),void 0===(r=r||{}).minFilter&&(r.minFilter=xe),this.texture=new qt(void 0,void 0,r.wrapS,r.wrapT,r.magFilter,r.minFilter,r.format,r.type,r.anisotropy,r.encoding),this.texture.generateMipmaps=void 0===r.generateMipmaps||r.generateMipmaps,this.depthBuffer=void 0===r.depthBuffer||r.depthBuffer,this.stencilBuffer=void 0===r.stencilBuffer||r.stencilBuffer,this.depthTexture=void 0!==r.depthTexture?r.depthTexture:null}function Kt(e,t,r){Yt.call(this,e,t,r),this.activeCubeFace=0,this.activeMipMapLevel=0}function Zt(e,t,r,n,i,o,a,s,c,h,l,u){qt.call(this,null,o,a,s,c,h,n,i,l,u),this.image={data:e,width:t,height:r},this.magFilter=void 0!==c?c:ge,this.minFilter=void 0!==h?h:ge,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}function Jt(e,t){this.min=void 0!==e?e:new Gt(1/0,1/0,1/0),this.max=void 0!==t?t:new Gt(-1/0,-1/0,-1/0)}function Qt(e,t){this.center=void 0!==e?e:new Gt,this.radius=void 0!==t?t:0}function $t(e,t){this.normal=void 0!==e?e:new Gt(1,0,0),this.constant=void 0!==t?t:0}function er(e,t,r,n,i,o){this.planes=[void 0!==e?e:new $t,void 0!==t?t:new $t,void 0!==r?r:new $t,void 0!==n?n:new $t,void 0!==i?i:new $t,void 0!==o?o:new $t]}qt.DEFAULT_IMAGE=void 0,qt.DEFAULT_MAPPING=se,qt.prototype=Object.assign(Object.create(n.prototype),{constructor:qt,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(e){return this.name=e.name,this.image=e.image,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.encoding=e.encoding,this},toJSON:function(e){var t=void 0===e||"string"==typeof e;if(!t&&void 0!==e.textures[this.uuid])return e.textures[this.uuid];var r={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,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY};if(void 0!==this.image){var n=this.image;if(void 0===n.uuid&&(n.uuid=It.generateUUID()),!t&&void 0===e.images[n.uuid]){var i;if(Array.isArray(n)){i=[];for(var o=0,a=n.length;o1)switch(this.wrapS){case me:e.x=e.x-Math.floor(e.x);break;case ve:e.x=e.x<0?0:1;break;case ye:1===Math.abs(Math.floor(e.x)%2)?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x)}if(e.y<0||e.y>1)switch(this.wrapT){case me:e.y=e.y-Math.floor(e.y);break;case ve:e.y=e.y<0?0:1;break;case ye:1===Math.abs(Math.floor(e.y)%2)?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y)}return this.flipY&&(e.y=1-e.y),e}}),Object.defineProperty(qt.prototype,"needsUpdate",{set:function(e){!0===e&&this.version++}}),Object.assign(Xt.prototype,{isVector4:!0,set:function(e,t,r,n){return this.x=e,this.y=t,this.z=r,this.w=n,this},setScalar:function(e){return this.x=e,this.y=e,this.z=e,this.w=e,this},setX:function(e){return this.x=e,this},setY:function(e){return this.y=e,this},setZ:function(e){return this.z=e,this},setW:function(e){return this.w=e,this},setComponent:function(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this},getComponent:function(e){switch(e){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: "+e)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=void 0!==e.w?e.w:1,this},add:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(e,t)):(this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this)},addScalar:function(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this},addVectors:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this},addScaledVector:function(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this},sub:function(e,t){return void 0!==t?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(e,t)):(this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this)},subScalar:function(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this},subVectors:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this},multiplyScalar:function(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this},applyMatrix4:function(e){var t=this.x,r=this.y,n=this.z,i=this.w,o=e.elements;return this.x=o[0]*t+o[4]*r+o[8]*n+o[12]*i,this.y=o[1]*t+o[5]*r+o[9]*n+o[13]*i,this.z=o[2]*t+o[6]*r+o[10]*n+o[14]*i,this.w=o[3]*t+o[7]*r+o[11]*n+o[15]*i,this},divideScalar:function(e){return this.multiplyScalar(1/e)},setAxisAngleFromQuaternion:function(e){this.w=2*Math.acos(e.w);var t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this},setAxisAngleFromRotationMatrix:function(e){var t,r,n,i,o=e.elements,a=o[0],s=o[4],c=o[8],h=o[1],l=o[5],u=o[9],p=o[2],d=o[6],f=o[10];if(Math.abs(s-h)<.01&&Math.abs(c-p)<.01&&Math.abs(u-d)<.01){if(Math.abs(s+h)<.1&&Math.abs(c+p)<.1&&Math.abs(u+d)<.1&&Math.abs(a+l+f-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;var m=(a+1)/2,v=(l+1)/2,y=(f+1)/2,g=(s+h)/4,b=(c+p)/4,_=(u+d)/4;return m>v&&m>y?m<.01?(r=0,n=.707106781,i=.707106781):(n=g/(r=Math.sqrt(m)),i=b/r):v>y?v<.01?(r=.707106781,n=0,i=.707106781):(r=g/(n=Math.sqrt(v)),i=_/n):y<.01?(r=.707106781,n=.707106781,i=0):(r=b/(i=Math.sqrt(y)),n=_/i),this.set(r,n,i,t),this}var x=Math.sqrt((d-u)*(d-u)+(c-p)*(c-p)+(h-s)*(h-s));return Math.abs(x)<.001&&(x=1),this.x=(d-u)/x,this.y=(c-p)/x,this.z=(h-s)/x,this.w=Math.acos((a+l+f-1)/2),this},min:function(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this},max:function(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this},clamp:function(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this},clampScalar:function(){var e,t;return function(r,n){return void 0===e&&(e=new Xt,t=new Xt),e.set(r,r,r,r),t.set(n,n,n,n),this.clamp(e,t)}}(),clampLength:function(e,t){var r=this.length();return this.divideScalar(r||1).multiplyScalar(Math.max(e,Math.min(t,r)))},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(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.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(e){return this.normalize().multiplyScalar(e)},lerp:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this},lerpVectors:function(e,t,r){return this.subVectors(t,e).multiplyScalar(r).add(e)},equals:function(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w},fromArray:function(e,t){return void 0===t&&(t=0),this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this},toArray:function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=0),e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e},fromBufferAttribute:function(e,t,r){return void 0!==r&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}}),Yt.prototype=Object.assign(Object.create(n.prototype),{constructor:Yt,isWebGLRenderTarget:!0,setSize:function(e,t){this.width===e&&this.height===t||(this.width=e,this.height=t,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.width=e.width,this.height=e.height,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.depthTexture=e.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Kt.prototype=Object.create(Yt.prototype),Kt.prototype.constructor=Kt,Kt.prototype.isWebGLRenderTargetCube=!0,Zt.prototype=Object.create(qt.prototype),Zt.prototype.constructor=Zt,Zt.prototype.isDataTexture=!0,Object.assign(Jt.prototype,{isBox3:!0,set:function(e,t){return this.min.copy(e),this.max.copy(t),this},setFromArray:function(e){for(var t=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,c=e.length;si&&(i=h),l>o&&(o=l),u>a&&(a=u)}return this.min.set(t,r,n),this.max.set(i,o,a),this},setFromBufferAttribute:function(e){for(var t=1/0,r=1/0,n=1/0,i=-1/0,o=-1/0,a=-1/0,s=0,c=e.count;si&&(i=h),l>o&&(o=l),u>a&&(a=u)}return this.min.set(t,r,n),this.max.set(i,o,a),this},setFromPoints:function(e){this.makeEmpty();for(var t=0,r=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .getParameter() target is now required"),t=new Gt),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)},intersectsSphere:function(){var e=new Gt;return function(t){return this.clampPoint(t.center,e),e.distanceToSquared(t.center)<=t.radius*t.radius}}(),intersectsPlane:function(e){var t,r;return e.normal.x>0?(t=e.normal.x*this.min.x,r=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,r=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,r+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,r+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,r+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,r+=e.normal.z*this.min.z),t<=-e.constant&&r>=-e.constant},intersectsTriangle:function(){var e=new Gt,t=new Gt,r=new Gt,n=new Gt,i=new Gt,o=new Gt,a=new Gt,s=new Gt,c=new Gt,h=new Gt;function l(n){var i,o;for(i=0,o=n.length-3;i<=o;i+=3){a.fromArray(n,i);var s=c.x*Math.abs(a.x)+c.y*Math.abs(a.y)+c.z*Math.abs(a.z),h=e.dot(a),l=t.dot(a),u=r.dot(a);if(Math.max(-Math.max(h,l,u),Math.min(h,l,u))>s)return!1}return!0}return function(a){if(this.isEmpty())return!1;this.getCenter(s),c.subVectors(this.max,s),e.subVectors(a.a,s),t.subVectors(a.b,s),r.subVectors(a.c,s),n.subVectors(t,e),i.subVectors(r,t),o.subVectors(e,r);var u=[0,-n.z,n.y,0,-i.z,i.y,0,-o.z,o.y,n.z,0,-n.x,i.z,0,-i.x,o.z,0,-o.x,-n.y,n.x,0,-i.y,i.x,0,-o.y,o.x,0];return!!l(u)&&(!!l(u=[1,0,0,0,1,0,0,0,1])&&(h.crossVectors(n,i),l(u=[h.x,h.y,h.z])))}}(),clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box3: .clampPoint() target is now required"),t=new Gt),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new Gt;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),getBoundingSphere:function(){var e=new Gt;return function(t){return void 0===t&&(console.warn("THREE.Box3: .getBoundingSphere() target is now required"),t=new Qt),this.getCenter(t.center),t.radius=.5*this.getSize(e).length(),t}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},applyMatrix4:function(){var e=[new Gt,new Gt,new Gt,new Gt,new Gt,new Gt,new Gt,new Gt];return function(t){return this.isEmpty()?this:(e[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),e[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),e[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),e[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),e[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),e[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),e[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),e[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(e),this)}}(),translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),Object.assign(Qt.prototype,{set:function(e,t){return this.center.copy(e),this.radius=t,this},setFromPoints:function(){var e=new Jt;return function(t,r){var n=this.center;void 0!==r?n.copy(r):e.setFromPoints(t).getCenter(n);for(var i=0,o=0,a=t.length;othis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t},getBoundingBox:function(e){return void 0===e&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),e=new Jt),e.set(this.center,this.center),e.expandByScalar(this.radius),e},applyMatrix4:function(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this},translate:function(e){return this.center.add(e),this},equals:function(e){return e.center.equals(this.center)&&e.radius===this.radius}}),Object.assign($t.prototype,{set:function(e,t){return this.normal.copy(e),this.constant=t,this},setComponents:function(e,t,r,n){return this.normal.set(e,t,r),this.constant=n,this},setFromNormalAndCoplanarPoint:function(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this},setFromCoplanarPoints:function(){var e=new Gt,t=new Gt;return function(r,n,i){var o=e.subVectors(i,n).cross(t.subVectors(r,n)).normalize();return this.setFromNormalAndCoplanarPoint(o,r),this}}(),clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.normal.copy(e.normal),this.constant=e.constant,this},normalize:function(){var e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(e){return this.normal.dot(e)+this.constant},distanceToSphere:function(e){return this.distanceToPoint(e.center)-e.radius},projectPoint:function(e,t){return void 0===t&&(console.warn("THREE.Plane: .projectPoint() target is now required"),t=new Gt),t.copy(this.normal).multiplyScalar(-this.distanceToPoint(e)).add(e)},intersectLine:function(){var e=new Gt;return function(t,r){void 0===r&&(console.warn("THREE.Plane: .intersectLine() target is now required"),r=new Gt);var n=t.delta(e),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(t.start)?r.copy(t.start):void 0;var o=-(t.start.dot(this.normal)+this.constant)/i;return o<0||o>1?void 0:r.copy(n).multiplyScalar(o).add(t.start)}}(),intersectsLine:function(e){var t=this.distanceToPoint(e.start),r=this.distanceToPoint(e.end);return t<0&&r>0||r<0&&t>0},intersectsBox:function(e){return e.intersectsPlane(this)},intersectsSphere:function(e){return e.intersectsPlane(this)},coplanarPoint:function(e){return void 0===e&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),e=new Gt),e.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var e=new Gt,t=new Ht;return function(r,n){var i=n||t.getNormalMatrix(r),o=this.coplanarPoint(e).applyMatrix4(r),a=this.normal.applyMatrix3(i).normalize();return this.constant=-o.dot(a),this}}(),translate:function(e){return this.constant-=e.dot(this.normal),this},equals:function(e){return e.normal.equals(this.normal)&&e.constant===this.constant}}),Object.assign(er.prototype,{set:function(e,t,r,n,i,o){var a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(r),a[3].copy(n),a[4].copy(i),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){for(var t=this.planes,r=0;r<6;r++)t[r].copy(e.planes[r]);return this},setFromMatrix:function(e){var t=this.planes,r=e.elements,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],c=r[5],h=r[6],l=r[7],u=r[8],p=r[9],d=r[10],f=r[11],m=r[12],v=r[13],y=r[14],g=r[15];return t[0].setComponents(a-n,l-s,f-u,g-m).normalize(),t[1].setComponents(a+n,l+s,f+u,g+m).normalize(),t[2].setComponents(a+i,l+c,f+p,g+v).normalize(),t[3].setComponents(a-i,l-c,f-p,g-v).normalize(),t[4].setComponents(a-o,l-h,f-d,g-y).normalize(),t[5].setComponents(a+o,l+h,f+d,g+y).normalize(),this},intersectsObject:function(){var e=new Qt;return function(t){var r=t.geometry;return null===r.boundingSphere&&r.computeBoundingSphere(),e.copy(r.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSprite:function(){var e=new Qt;return function(t){return e.center.set(0,0,0),e.radius=.7071067811865476,e.applyMatrix4(t.matrixWorld),this.intersectsSphere(e)}}(),intersectsSphere:function(e){for(var t=this.planes,r=e.center,n=-e.radius,i=0;i<6;i++){if(t[i].distanceToPoint(r)0?t.max.x:t.min.x,e.y=i.normal.y>0?t.max.y:t.min.y,e.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(e)<0)return!1}return!0}}(),containsPoint:function(e){for(var t=this.planes,r=0;r<6;r++)if(t[r].distanceToPoint(e)<0)return!1;return!0}});var tr={alphamap_fragment:"#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",alphamap_pars_fragment:"#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",alphatest_fragment:"#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",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\n",aomap_pars_fragment:"#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",begin_vertex:"\nvec3 transformed = vec3( position );\n",beginnormal_vertex:"\nvec3 objectNormal = vec3( normal );\n",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 ) {\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}\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\n",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\n",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\n",clipping_planes_pars_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvarying vec3 vViewPosition;\n#endif\n",clipping_planes_vertex:"#if NUM_CLIPPING_PLANES > 0 && ! defined( PHYSICAL ) && ! defined( PHONG ) && ! defined( MATCAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n",color_fragment:"#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",color_pars_fragment:"#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",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}\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\n",defaultnormal_vertex:"vec3 transformedNormal = normalMatrix * objectNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n",displacementmap_pars_vertex:"#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",displacementmap_vertex:"#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",emissivemap_fragment:"#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",emissivemap_pars_fragment:"#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",encodings_fragment:" gl_FragColor = linearToOutputTexel( gl_FragColor );\n",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}\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\n",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\n",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\n",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\n",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\n",fog_vertex:"#ifdef USE_FOG\n\tfogDepth = -mvPosition.z;\n#endif\n",fog_pars_vertex:"#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif\n",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\n",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\n",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\n",lightmap_fragment:"#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",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\n",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\n",lights_phong_fragment:"BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",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)\n",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\n",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}\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\n",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\n",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\n",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\n",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\n",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\n",map_fragment:"#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",map_pars_fragment:"#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",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\n",map_particle_pars_fragment:"#ifdef USE_MAP\n\tuniform mat3 uvTransform;\n\tuniform sampler2D map;\n#endif\n",metalnessmap_fragment:"float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif\n",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\n",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\n",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\n",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\n",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\n",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}\n",premultiplied_alpha_fragment:"#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",project_vertex:"vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\ngl_Position = projectionMatrix * mvPosition;\n",dithering_fragment:"#if defined( DITHERING )\n gl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif\n",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\n",roughnessmap_fragment:"float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif\n",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\n",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\n",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\n",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}\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\n",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\n",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\n",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\n",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}\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\n",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\n",background_frag:"uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n}\n",background_vert:"varying vec2 vUv;\nvoid main() {\n\tvUv = uv;\n\tgl_Position = vec4( position, 1.0 );\n\tgl_Position.z = 1.0;\n}\n",cube_frag:"uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldPosition;\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\tgl_FragColor.a *= opacity;\n}\n",cube_vert:"varying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n\tgl_Position.z = gl_Position.w;\n}\n",depth_frag:"#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - gl_FragCoord.z ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( gl_FragCoord.z );\n\t#endif\n}\n",depth_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",distanceRGBA_frag:"#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main () {\n\t#include \n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include \n\t#include \n\t#include \n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}\n",distanceRGBA_vert:"#define DISTANCE\nvarying vec3 vWorldPosition;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include \n\t\t#include \n\t\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvWorldPosition = worldPosition.xyz;\n}\n",equirect_frag:"uniform sampler2D tEquirect;\nvarying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\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\tgl_FragColor = texture2D( tEquirect, sampleUV );\n}\n",equirect_vert:"varying vec3 vWorldPosition;\n#include \nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\t#include \n\t#include \n}\n",linedashed_frag:"uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n",linedashed_vert:"uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}\n",meshbasic_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\treflectedLight.indirectDiffuse += texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include \n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshbasic_vert:"#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifdef USE_ENVMAP\n\t#include \n\t#include \n\t#include \n\t#include \n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshlambert_frag:"uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include \n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshlambert_vert:"#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshmatcap_frag:"#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\tvec4 matcapColor = texture2D( matcap, uv );\n\tmatcapColor = matcapTexelToLinear( matcapColor );\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshmatcap_vert:"#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n}\n",meshphong_frag:"#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include \n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshphong_vert:"#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshphysical_frag:"#define PHYSICAL\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",meshphysical_vert:"#define PHYSICAL\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\tvViewPosition = - mvPosition.xyz;\n\t#include \n\t#include \n\t#include \n}\n",normal_frag:"#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}\n",normal_vert:"#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || ( defined( USE_NORMALMAP ) && ! defined( OBJECTSPACE_NORMALMAP ) )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}\n",points_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n\t#include \n}\n",points_vert:"uniform float size;\nuniform float scale;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include \n\t#include \n\t#include \n\t#include \n}\n",shadow_frag:"uniform vec3 color;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include \n}\n",shadow_vert:"#include \n#include \nvoid main() {\n\t#include \n\t#include \n\t#include \n\t#include \n\t#include \n}\n",sprite_frag:"uniform vec3 diffuse;\nuniform float opacity;\n#include \n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include \n\t#include \n\t#include \n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include \n\t#include \n\t#include \n}\n",sprite_vert:"uniform float rotation;\nuniform vec2 center;\n#include \n#include \n#include \n#include \n#include \nvoid main() {\n\t#include \n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include \n\t#include \n\t#include \n}\n"},rr={merge:function(e){for(var t={},r=0;r>16&255)/255,this.g=(e>>8&255)/255,this.b=(255&e)/255,this},setRGB:function(e,t,r){return this.r=e,this.g=t,this.b=r,this},setHSL:function(){function e(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+6*(t-e)*(2/3-r):e}return function(t,r,n){if(t=It.euclideanModulo(t,1),r=It.clamp(r,0,1),n=It.clamp(n,0,1),0===r)this.r=this.g=this.b=n;else{var i=n<=.5?n*(1+r):n+r-n*r,o=2*n-i;this.r=e(o,i,t+1/3),this.g=e(o,i,t),this.b=e(o,i,t-1/3)}return this}}(),setStyle:function(e){function t(t){void 0!==t&&parseFloat(t)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}var r;if(r=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)){var n,i=r[1],o=r[2];switch(i){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,t(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,t(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,c=parseInt(n[3],10)/100;return t(n[5]),this.setHSL(a,s,c)}}}else if(r=/^\#([A-Fa-f0-9]+)$/.exec(e)){var h,l=(h=r[1]).length;if(3===l)return this.r=parseInt(h.charAt(0)+h.charAt(0),16)/255,this.g=parseInt(h.charAt(1)+h.charAt(1),16)/255,this.b=parseInt(h.charAt(2)+h.charAt(2),16)/255,this;if(6===l)return this.r=parseInt(h.charAt(0)+h.charAt(1),16)/255,this.g=parseInt(h.charAt(2)+h.charAt(3),16)/255,this.b=parseInt(h.charAt(4)+h.charAt(5),16)/255,this}e&&e.length>0&&(void 0!==(h=nr[e])?this.setHex(h):console.warn("THREE.Color: Unknown color "+e));return this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(e){return this.r=e.r,this.g=e.g,this.b=e.b,this},copyGammaToLinear:function(e,t){return void 0===t&&(t=2),this.r=Math.pow(e.r,t),this.g=Math.pow(e.g,t),this.b=Math.pow(e.b,t),this},copyLinearToGamma:function(e,t){void 0===t&&(t=2);var r=t>0?1/t:1;return this.r=Math.pow(e.r,r),this.g=Math.pow(e.g,r),this.b=Math.pow(e.b,r),this},convertGammaToLinear:function(e){return this.copyGammaToLinear(this,e),this},convertLinearToGamma:function(e){return this.copyLinearToGamma(this,e),this},copySRGBToLinear:function(){function e(e){return e<.04045?.0773993808*e:Math.pow(.9478672986*e+.0521327014,2.4)}return function(t){return this.r=e(t.r),this.g=e(t.g),this.b=e(t.b),this}}(),copyLinearToSRGB:function(){function e(e){return e<.0031308?12.92*e:1.055*Math.pow(e,.41666)-.055}return function(t){return this.r=e(t.r),this.g=e(t.g),this.b=e(t.b),this}}(),convertSRGBToLinear:function(){return this.copySRGBToLinear(this),this},convertLinearToSRGB:function(){return this.copyLinearToSRGB(this),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(e){void 0===e&&(console.warn("THREE.Color: .getHSL() target is now required"),e={h:0,s:0,l:0});var t,r,n=this.r,i=this.g,o=this.b,a=Math.max(n,i,o),s=Math.min(n,i,o),c=(s+a)/2;if(s===a)t=0,r=0;else{var h=a-s;switch(r=c<=.5?h/(a+s):h/(2-a-s),a){case n:t=(i-o)/h+(i1){for(var t=0;t1){for(var t=0;t0){n.children=[];for(s=0;s0&&(r.geometries=u),p.length>0&&(r.materials=p),d.length>0&&(r.textures=d),f.length>0&&(r.images=f),a.length>0&&(r.shapes=a)}return r.object=n,r;function m(e){var t=[];for(var r in e){var n=e[r];delete n.metadata,t.push(n)}return t}},clone:function(e){return(new this.constructor).copy(this,e)},copy:function(e,t){if(void 0===t&&(t=!0),this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.userData=JSON.parse(JSON.stringify(e.userData)),!0===t)for(var r=0;rt&&(t=e[r]);return t}mr.prototype=Object.assign(Object.create(n.prototype),{constructor:mr,isGeometry:!0,applyMatrix:function(e){for(var t=(new Ht).getNormalMatrix(e),r=0,n=this.vertices.length;r0)for(p=0;p0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){var e,t,r;for(this.computeFaceNormals(),e=0,t=this.faces.length;e0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){var e,t,r,n,i;for(r=0,n=this.faces.length;r=0;r--){var f=p[r];for(this.faces.splice(f,1),a=0,s=this.faceVertexUvs.length;a0,v=d.vertexNormals.length>0,y=1!==d.color.r||1!==d.color.g||1!==d.color.b,g=d.vertexColors.length>0,b=0;if(b=M(b=M(b=M(b=M(b=M(b=M(b=M(b=M(b,0,0),1,!0),2,!1),3,f),4,m),5,v),6,y),7,g),a.push(b),a.push(d.a,d.b,d.c),a.push(d.materialIndex),f){var _=this.faceVertexUvs[0][i];a.push(E(_[0]),E(_[1]),E(_[2]))}if(m&&a.push(T(d.normal)),v){var x=d.vertexNormals;a.push(T(x[0]),T(x[1]),T(x[2]))}if(y&&a.push(S(d.color)),g){var w=d.vertexColors;a.push(S(w[0]),S(w[1]),S(w[2]))}}function M(e,t,r){return r?e|1<0&&(e.data.colors=h),u.length>0&&(e.data.uvs=[u]),e.data.faces=a,e},clone:function(){return(new mr).copy(this)},copy:function(e){var t,r,n,i,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=e.name;var s=e.vertices;for(t=0,r=s.length;t0,a=i[1]&&i[1].length>0,s=e.morphTargets,c=s.length;if(c>0){t=[];for(var h=0;h0){l=[];for(h=0;h0&&0===r.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(h=0;h0?1:-1,h.push(C.x,C.y,C.z),l.push(g/m),l.push(1-b/v),A+=1}}for(b=0;b65535?Mr:xr)(e,1):this.index=e},addAttribute:function(e,t){return t&&t.isBufferAttribute||t&&t.isInterleavedBufferAttribute?"index"===e?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(t),this):(this.attributes[e]=t,this):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.addAttribute(e,new vr(arguments[1],arguments[2])))},getAttribute:function(e){return this.attributes[e]},removeAttribute:function(e){return delete this.attributes[e],this},addGroup:function(e,t,r){this.groups.push({start:e,count:t,materialIndex:void 0!==r?r:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(e,t){this.drawRange.start=e,this.drawRange.count=t},applyMatrix:function(e){var t=this.attributes.position;void 0!==t&&(e.applyToBufferAttribute(t),t.needsUpdate=!0);var r=this.attributes.normal;void 0!==r&&((new Ht).getNormalMatrix(e).applyToBufferAttribute(r),r.needsUpdate=!0);return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(){var e=new Nt;return function(t){return e.makeRotationX(t),this.applyMatrix(e),this}}(),rotateY:function(){var e=new Nt;return function(t){return e.makeRotationY(t),this.applyMatrix(e),this}}(),rotateZ:function(){var e=new Nt;return function(t){return e.makeRotationZ(t),this.applyMatrix(e),this}}(),translate:function(){var e=new Nt;return function(t,r,n){return e.makeTranslation(t,r,n),this.applyMatrix(e),this}}(),scale:function(){var e=new Nt;return function(t,r,n){return e.makeScale(t,r,n),this.applyMatrix(e),this}}(),lookAt:function(){var e=new dr;return function(t){e.lookAt(t),e.updateMatrix(),this.applyMatrix(e.matrix)}}(),center:function(){var e=new Gt;return function(){return this.computeBoundingBox(),this.boundingBox.getCenter(e).negate(),this.translate(e.x,e.y,e.z),this}}(),setFromObject:function(e){var t=e.geometry;if(e.isPoints||e.isLine){var r=new Tr(3*t.vertices.length,3),n=new Tr(3*t.colors.length,3);if(this.addAttribute("position",r.copyVector3sArray(t.vertices)),this.addAttribute("color",n.copyColorsArray(t.colors)),t.lineDistances&&t.lineDistances.length===t.vertices.length){var i=new Tr(t.lineDistances.length,1);this.addAttribute("lineDistance",i.copyArray(t.lineDistances))}null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone())}else e.isMesh&&t&&t.isGeometry&&this.fromGeometry(t);return this},setFromPoints:function(e){for(var t=[],r=0,n=e.length;r0){var r=new Float32Array(3*e.normals.length);this.addAttribute("normal",new vr(r,3).copyVector3sArray(e.normals))}if(e.colors.length>0){var n=new Float32Array(3*e.colors.length);this.addAttribute("color",new vr(n,3).copyColorsArray(e.colors))}if(e.uvs.length>0){var i=new Float32Array(2*e.uvs.length);this.addAttribute("uv",new vr(i,2).copyVector2sArray(e.uvs))}if(e.uvs2.length>0){var o=new Float32Array(2*e.uvs2.length);this.addAttribute("uv2",new vr(o,2).copyVector2sArray(e.uvs2))}for(var a in this.groups=e.groups,e.morphTargets){for(var s=[],c=e.morphTargets[a],h=0,l=c.length;h0){var d=new Tr(4*e.skinIndices.length,4);this.addAttribute("skinIndex",d.copyVector4sArray(e.skinIndices))}if(e.skinWeights.length>0){var f=new Tr(4*e.skinWeights.length,4);this.addAttribute("skinWeight",f.copyVector4sArray(e.skinWeights))}return null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Jt);var e=this.attributes.position;void 0!==e?this.boundingBox.setFromBufferAttribute(e):this.boundingBox.makeEmpty(),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)},computeBoundingSphere:function(){var e=new Jt,t=new Gt;return function(){null===this.boundingSphere&&(this.boundingSphere=new Qt);var r=this.attributes.position;if(r){var n=this.boundingSphere.center;e.setFromBufferAttribute(r),e.getCenter(n);for(var i=0,o=0,a=r.count;o0&&(e.userData=this.userData),void 0!==this.parameters){var t=this.parameters;for(var r in t)void 0!==t[r]&&(e[r]=t[r]);return e}e.data={attributes:{}};var n=this.index;if(null!==n){var i=Array.prototype.slice.call(n.array);e.data.index={type:n.array.constructor.name,array:i}}var o=this.attributes;for(var r in o){var a=o[r];i=Array.prototype.slice.call(a.array);e.data.attributes[r]={itemSize:a.itemSize,type:a.array.constructor.name,array:i,normalized:a.normalized}}var s=this.groups;s.length>0&&(e.data.groups=JSON.parse(JSON.stringify(s)));var c=this.boundingSphere;return null!==c&&(e.data.boundingSphere={center:c.center.toArray(),radius:c.radius}),e},clone:function(){return(new Cr).copy(this)},copy:function(e){var t,r,n;this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.name=e.name;var i=e.index;null!==i&&this.setIndex(i.clone());var o=e.attributes;for(t in o){var a=o[t];this.addAttribute(t,a.clone())}var s=e.morphAttributes;for(t in s){var c=[],h=s[t];for(r=0,n=h.length;r0&&(r.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(r.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(r.wireframe=this.wireframe),this.wireframeLinewidth>1&&(r.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(r.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(r.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(r.morphTargets=!0),!0===this.skinning&&(r.skinning=!0),!1===this.visible&&(r.visible=!1),"{}"!==JSON.stringify(this.userData)&&(r.userData=this.userData),t){var i=n(e.textures),o=n(e.images);i.length>0&&(r.textures=i),o.length>0&&(r.images=o)}return r},clone:function(){return(new this.constructor).copy(this)},copy:function(e){this.name=e.name,this.fog=e.fog,this.lights=e.lights,this.blending=e.blending,this.side=e.side,this.flatShading=e.flatShading,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.premultipliedAlpha=e.premultipliedAlpha,this.overdraw=e.overdraw,this.visible=e.visible,this.userData=JSON.parse(JSON.stringify(e.userData)),this.clipShadows=e.clipShadows,this.clipIntersection=e.clipIntersection;var t=e.clippingPlanes,r=null;if(null!==t){var n=t.length;r=new Array(n);for(var i=0;i!==n;++i)r[i]=t[i].clone()}return this.clippingPlanes=r,this.shadowSide=e.shadowSide,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Fr.prototype=Object.create(kr.prototype),Fr.prototype.constructor=Fr,Fr.prototype.isShaderMaterial=!0,Fr.prototype.copy=function(e){return kr.prototype.copy.call(this,e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=rr.clone(e.uniforms),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.lights=e.lights,this.clipping=e.clipping,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this.extensions=e.extensions,this},Fr.prototype.toJSON=function(e){var t=kr.prototype.toJSON.call(this,e);for(var r in t.uniforms={},this.uniforms){var n=this.uniforms[r].value;n.isTexture?t.uniforms[r]={type:"t",value:n.toJSON(e).uuid}:n.isColor?t.uniforms[r]={type:"c",value:n.getHex()}:n.isVector2?t.uniforms[r]={type:"v2",value:n.toArray()}:n.isVector3?t.uniforms[r]={type:"v3",value:n.toArray()}:n.isVector4?t.uniforms[r]={type:"v4",value:n.toArray()}:n.isMatrix4?t.uniforms[r]={type:"m4",value:n.toArray()}:t.uniforms[r]={value:n}}return Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t},Object.assign(zr.prototype,{set:function(e,t){return this.origin.copy(e),this.direction.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this},at:function(e,t){return void 0===t&&(console.warn("THREE.Ray: .at() target is now required"),t=new Gt),t.copy(this.direction).multiplyScalar(e).add(this.origin)},lookAt:function(e){return this.direction.copy(e).sub(this.origin).normalize(),this},recast:function(){var e=new Gt;return function(t){return this.origin.copy(this.at(t,e)),this}}(),closestPointToPoint:function(e,t){void 0===t&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),t=new Gt),t.subVectors(e,this.origin);var r=t.dot(this.direction);return r<0?t.copy(this.origin):t.copy(this.direction).multiplyScalar(r).add(this.origin)},distanceToPoint:function(e){return Math.sqrt(this.distanceSqToPoint(e))},distanceSqToPoint:function(){var e=new Gt;return function(t){var r=e.subVectors(t,this.origin).dot(this.direction);return r<0?this.origin.distanceToSquared(t):(e.copy(this.direction).multiplyScalar(r).add(this.origin),e.distanceToSquared(t))}}(),distanceSqToSegment:function(){var e=new Gt,t=new Gt,r=new Gt;return function(n,i,o,a){e.copy(n).add(i).multiplyScalar(.5),t.copy(i).sub(n).normalize(),r.copy(this.origin).sub(e);var s,c,h,l,u=.5*n.distanceTo(i),p=-this.direction.dot(t),d=r.dot(this.direction),f=-r.dot(t),m=r.lengthSq(),v=Math.abs(1-p*p);if(v>0)if(c=p*d-f,l=u*v,(s=p*f-d)>=0)if(c>=-l)if(c<=l){var y=1/v;h=(s*=y)*(s+p*(c*=y)+2*d)+c*(p*s+c+2*f)+m}else c=u,h=-(s=Math.max(0,-(p*c+d)))*s+c*(c+2*f)+m;else c=-u,h=-(s=Math.max(0,-(p*c+d)))*s+c*(c+2*f)+m;else c<=-l?h=-(s=Math.max(0,-(-p*u+d)))*s+(c=s>0?-u:Math.min(Math.max(-u,-f),u))*(c+2*f)+m:c<=l?(s=0,h=(c=Math.min(Math.max(-u,-f),u))*(c+2*f)+m):h=-(s=Math.max(0,-(p*u+d)))*s+(c=s>0?u:Math.min(Math.max(-u,-f),u))*(c+2*f)+m;else c=p>0?-u:u,h=-(s=Math.max(0,-(p*c+d)))*s+c*(c+2*f)+m;return o&&o.copy(this.direction).multiplyScalar(s).add(this.origin),a&&a.copy(t).multiplyScalar(c).add(e),h}}(),intersectSphere:function(){var e=new Gt;return function(t,r){e.subVectors(t.center,this.origin);var n=e.dot(this.direction),i=e.dot(e)-n*n,o=t.radius*t.radius;if(i>o)return null;var a=Math.sqrt(o-i),s=n-a,c=n+a;return s<0&&c<0?null:s<0?this.at(c,r):this.at(s,r)}}(),intersectsSphere:function(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius},distanceToPlane:function(e){var t=e.normal.dot(this.direction);if(0===t)return 0===e.distanceToPoint(this.origin)?0:null;var r=-(this.origin.dot(e.normal)+e.constant)/t;return r>=0?r:null},intersectPlane:function(e,t){var r=this.distanceToPlane(e);return null===r?null:this.at(r,t)},intersectsPlane:function(e){var t=e.distanceToPoint(this.origin);return 0===t||e.normal.dot(this.direction)*t<0},intersectBox:function(e,t){var r,n,i,o,a,s,c=1/this.direction.x,h=1/this.direction.y,l=1/this.direction.z,u=this.origin;return c>=0?(r=(e.min.x-u.x)*c,n=(e.max.x-u.x)*c):(r=(e.max.x-u.x)*c,n=(e.min.x-u.x)*c),h>=0?(i=(e.min.y-u.y)*h,o=(e.max.y-u.y)*h):(i=(e.max.y-u.y)*h,o=(e.min.y-u.y)*h),r>o||i>n?null:((i>r||r!=r)&&(r=i),(o=0?(a=(e.min.z-u.z)*l,s=(e.max.z-u.z)*l):(a=(e.max.z-u.z)*l,s=(e.min.z-u.z)*l),r>s||a>n?null:((a>r||r!=r)&&(r=a),(s=0?r:n,t)))},intersectsBox:function(){var e=new Gt;return function(t){return null!==this.intersectBox(t,e)}}(),intersectTriangle:function(){var e=new Gt,t=new Gt,r=new Gt,n=new Gt;return function(i,o,a,s,c){t.subVectors(o,i),r.subVectors(a,i),n.crossVectors(t,r);var h,l=this.direction.dot(n);if(l>0){if(s)return null;h=1}else{if(!(l<0))return null;h=-1,l=-l}e.subVectors(this.origin,i);var u=h*this.direction.dot(r.crossVectors(e,r));if(u<0)return null;var p=h*this.direction.dot(t.cross(e));if(p<0)return null;if(u+p>l)return null;var d=-h*e.dot(n);return d<0?null:this.at(d/l,c)}}(),applyMatrix4:function(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this},equals:function(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}}),Object.assign(Ir,{getNormal:function(){var e=new Gt;return function(t,r,n,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new Gt),i.subVectors(n,r),e.subVectors(t,r),i.cross(e);var o=i.lengthSq();return o>0?i.multiplyScalar(1/Math.sqrt(o)):i.set(0,0,0)}}(),getBarycoord:function(){var e=new Gt,t=new Gt,r=new Gt;return function(n,i,o,a,s){e.subVectors(a,i),t.subVectors(o,i),r.subVectors(n,i);var c=e.dot(e),h=e.dot(t),l=e.dot(r),u=t.dot(t),p=t.dot(r),d=c*u-h*h;if(void 0===s&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),s=new Gt),0===d)return s.set(-2,-1,-1);var f=1/d,m=(u*l-h*p)*f,v=(c*p-h*l)*f;return s.set(1-m-v,v,m)}}(),containsPoint:function(){var e=new Gt;return function(t,r,n,i){return Ir.getBarycoord(t,r,n,i,e),e.x>=0&&e.y>=0&&e.x+e.y<=1}}(),getUV:function(){var e=new Gt;return function(t,r,n,i,o,a,s,c){return this.getBarycoord(t,r,n,i,e),c.set(0,0),c.addScaledVector(o,e.x),c.addScaledVector(a,e.y),c.addScaledVector(s,e.z),c}}()}),Object.assign(Ir.prototype,{set:function(e,t,r){return this.a.copy(e),this.b.copy(t),this.c.copy(r),this},setFromPointsAndIndices:function(e,t,r,n){return this.a.copy(e[t]),this.b.copy(e[r]),this.c.copy(e[n]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this},getArea:function(){var e=new Gt,t=new Gt;return function(){return e.subVectors(this.c,this.b),t.subVectors(this.a,this.b),.5*e.cross(t).length()}}(),getMidpoint:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),e=new Gt),e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(e){return Ir.getNormal(this.a,this.b,this.c,e)},getPlane:function(e){return void 0===e&&(console.warn("THREE.Triangle: .getPlane() target is now required"),e=new Gt),e.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(e,t){return Ir.getBarycoord(e,this.a,this.b,this.c,t)},containsPoint:function(e){return Ir.containsPoint(e,this.a,this.b,this.c)},getUV:function(e,t,r,n,i){return Ir.getUV(e,this.a,this.b,this.c,t,r,n,i)},intersectsBox:function(e){return e.intersectsTriangle(this)},closestPointToPoint:function(){var e=new Gt,t=new Gt,r=new Gt,n=new Gt,i=new Gt,o=new Gt;return function(a,s){void 0===s&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),s=new Gt);var c,h,l=this.a,u=this.b,p=this.c;e.subVectors(u,l),t.subVectors(p,l),n.subVectors(a,l);var d=e.dot(n),f=t.dot(n);if(d<=0&&f<=0)return s.copy(l);i.subVectors(a,u);var m=e.dot(i),v=t.dot(i);if(m>=0&&v<=m)return s.copy(u);var y=d*v-m*f;if(y<=0&&d>=0&&m<=0)return c=d/(d-m),s.copy(l).addScaledVector(e,c);o.subVectors(a,p);var g=e.dot(o),b=t.dot(o);if(b>=0&&g<=b)return s.copy(p);var _=g*f-d*b;if(_<=0&&f>=0&&b<=0)return h=f/(f-b),s.copy(l).addScaledVector(t,h);var x=m*b-g*v;if(x<=0&&v-m>=0&&g-b>=0)return r.subVectors(p,u),h=(v-m)/(v-m+(g-b)),s.copy(u).addScaledVector(r,h);var w=1/(x+_+y);return c=_*w,h=y*w,s.copy(l).addScaledVector(e,c).addScaledVector(t,h)}}(),equals:function(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}),Dr.prototype=Object.create(kr.prototype),Dr.prototype.constructor=Dr,Dr.prototype.isMeshBasicMaterial=!0,Dr.prototype.copy=function(e){return kr.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this},Nr.prototype=Object.assign(Object.create(dr.prototype),{constructor:Nr,isMesh:!0,setDrawMode:function(e){this.drawMode=e},copy:function(e){return dr.prototype.copy.call(this,e),this.drawMode=e.drawMode,void 0!==e.morphTargetInfluences&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),void 0!==e.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this},updateMorphTargets:function(){var e,t,r,n=this.geometry;if(n.isBufferGeometry){var i=n.morphAttributes,o=Object.keys(i);if(o.length>0){var a=i[o[0]];if(void 0!==a)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=a.length;e0)for(this.morphTargetInfluences=[],this.morphTargetDictionary={},e=0,t=s.length;er.far?null:{distance:c,point:d.clone(),object:e}}function m(e,t,r,a,s,c,d,m,v){n.fromBufferAttribute(s,d),i.fromBufferAttribute(s,m),o.fromBufferAttribute(s,v);var y=f(e,t,r,a,n,i,o,p);if(y){c&&(h.fromBufferAttribute(c,d),l.fromBufferAttribute(c,m),u.fromBufferAttribute(c,v),y.uv=Ir.getUV(p,n,i,o,h,l,u,new Dt));var g=new hr(d,m,v);Ir.getNormal(n,i,o,g.normal),y.face=g}return y}return function(d,v){var y,g=this.geometry,b=this.material,_=this.matrixWorld;if(void 0!==b&&(null===g.boundingSphere&&g.computeBoundingSphere(),r.copy(g.boundingSphere),r.applyMatrix4(_),!1!==d.ray.intersectsSphere(r)&&(e.getInverse(_),t.copy(d.ray).applyMatrix4(e),null===g.boundingBox||!1!==t.intersectsBox(g.boundingBox))))if(g.isBufferGeometry){var x,w,M,T,S,E,A,P,C,L=g.index,R=g.attributes.position,O=g.attributes.uv,B=g.groups,j=g.drawRange;if(null!==L)if(Array.isArray(b))for(T=0,E=B.length;T0&&(I=G);for(var H=0,V=U.length;H0)return e;var i=t*r,o=Yr[i];if(void 0===o&&(o=new Float32Array(i),Yr[i]=o),0!==t){n.toArray(o,0);for(var a=1,s=0;a!==t;++a)s+=r,e[a].toArray(o,s)}return o}function en(e,t){if(e.length!==t.length)return!1;for(var r=0,n=e.length;r/gm,function(e,t){var r=tr[t];if(void 0===r)throw new Error("Can not resolve #include <"+t+">");return Gn(r)})}function Hn(e){return e.replace(/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,function(e,t,r,n){for(var i="",o=parseInt(t);o0?e.gammaFactor:1,_=a.isWebGL2?"":function(e,t,r){return[(e=e||{}).derivatives||t.envMapCubeUV||t.bumpMap||t.normalMap&&!t.objectSpaceNormalMap||t.flatShading?"#extension GL_OES_standard_derivatives : enable":"",(e.fragDepth||t.logarithmicDepthBuffer)&&r.get("EXT_frag_depth")?"#extension GL_EXT_frag_depth : enable":"",e.drawBuffers&&r.get("WEBGL_draw_buffers")?"#extension GL_EXT_draw_buffers : require":"",(e.shaderTextureLOD||t.envMap)&&r.get("EXT_shader_texture_lod")?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Dn).join("\n")}(n.extensions,o,t),x=function(e){var t=[];for(var r in e){var n=e[r];!1!==n&&t.push("#define "+r+" "+n)}return t.join("\n")}(c),w=s.createProgram();if(n.isRawShaderMaterial?((y=[x].filter(Dn).join("\n")).length>0&&(y+="\n"),(g=[_,x].filter(Dn).join("\n")).length>0&&(g+="\n")):(y=["precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+i.name,x,o.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+b,"#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 "+m:"",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 "+u:"",o.sizeAttenuation?"#define USE_SIZEATTENUATION":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&(a.isWebGL2||t.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(Dn).join("\n"),g=[_,"precision "+o.precision+" float;","precision "+o.precision+" int;","#define SHADER_NAME "+i.name,x,o.alphaTest?"#define ALPHATEST "+o.alphaTest+(o.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+b,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.envMap?"#define "+m:"",o.envMap?"#define "+v:"",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 "+u:"",o.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",o.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",o.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",o.logarithmicDepthBuffer&&(a.isWebGL2||t.get("EXT_frag_depth"))?"#define USE_LOGDEPTHBUF_EXT":"",o.envMap&&(a.isWebGL2||t.get("EXT_shader_texture_lod"))?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;",o.toneMapping!==re?"#define TONE_MAPPING":"",o.toneMapping!==re?tr.tonemapping_pars_fragment:"",o.toneMapping!==re?function(e,t){var r;switch(t){case ne:r="Linear";break;case ie:r="Reinhard";break;case oe:r="Uncharted2";break;case ae:r="OptimizedCineon";break;default:throw new Error("unsupported toneMapping: "+t)}return"vec3 "+e+"( vec3 color ) { return "+r+"ToneMapping( color ); }"}("toneMapping",o.toneMapping):"",o.dithering?"#define DITHERING":"",o.outputEncoding||o.mapEncoding||o.matcapEncoding||o.envMapEncoding||o.emissiveMapEncoding?tr.encodings_pars_fragment:"",o.mapEncoding?In("mapTexelToLinear",o.mapEncoding):"",o.matcapEncoding?In("matcapTexelToLinear",o.matcapEncoding):"",o.envMapEncoding?In("envMapTexelToLinear",o.envMapEncoding):"",o.emissiveMapEncoding?In("emissiveMapTexelToLinear",o.emissiveMapEncoding):"",o.outputEncoding?function(e,t){var r=zn(t);return"vec4 "+e+"( vec4 value ) { return LinearTo"+r[0]+r[1]+"; }"}("linearToOutputTexel",o.outputEncoding):"",o.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Dn).join("\n")),h=Un(h=Nn(h=Gn(h),o),o),l=Un(l=Nn(l=Gn(l),o),o),h=Hn(h),l=Hn(l),a.isWebGL2&&!n.isRawShaderMaterial){var M=!1,T=/^\s*#version\s+300\s+es\s*\n/;n.isShaderMaterial&&null!==h.match(T)&&null!==l.match(T)&&(M=!0,h=h.replace(T,""),l=l.replace(T,"")),y=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+y,g=["#version 300 es\n","#define varying in",M?"":"out highp vec4 pc_fragColor;",M?"":"#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 S=y+h,E=g+l,A=kn(s,s.VERTEX_SHADER,S),P=kn(s,s.FRAGMENT_SHADER,E);s.attachShader(w,A),s.attachShader(w,P),void 0!==n.index0AttributeName?s.bindAttribLocation(w,0,n.index0AttributeName):!0===o.morphTargets&&s.bindAttribLocation(w,0,"position"),s.linkProgram(w);var C,L,R=s.getProgramInfoLog(w).trim(),O=s.getShaderInfoLog(A).trim(),B=s.getShaderInfoLog(P).trim(),j=!0,k=!0;return!1===s.getProgramParameter(w,s.LINK_STATUS)?(j=!1,console.error("THREE.WebGLProgram: shader error: ",s.getError(),"gl.VALIDATE_STATUS",s.getProgramParameter(w,s.VALIDATE_STATUS),"gl.getProgramInfoLog",R,O,B)):""!==R?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",R):""!==O&&""!==B||(k=!1),k&&(this.diagnostics={runnable:j,material:n,programLog:R,vertexShader:{log:O,prefix:y},fragmentShader:{log:B,prefix:g}}),s.deleteShader(A),s.deleteShader(P),this.getUniforms=function(){return void 0===C&&(C=new jn(s,w,e)),C},this.getAttributes=function(){return void 0===L&&(L=function(e,t){for(var r={},n=e.getProgramParameter(t,e.ACTIVE_ATTRIBUTES),i=0;i0,maxBones:p,useVertexTexture:r.floatVertexTextures,morphTargets:t.morphTargets,morphNormals:t.morphNormals,maxMorphTargets:e.maxMorphTargets,maxMorphNormals:e.maxMorphNormals,numDirLights:n.directional.length,numPointLights:n.point.length,numSpotLights:n.spot.length,numRectAreaLights:n.rectArea.length,numHemiLights:n.hemi.length,numClippingPlanes:c,numClipIntersection:h,dithering:t.dithering,shadowMapEnabled:e.shadowMap.enabled&&l.receiveShadow&&o.length>0,shadowMapType:e.shadowMap.type,toneMapping:e.toneMapping,physicallyCorrectLights:e.physicallyCorrectLights,premultipliedAlpha:t.premultipliedAlpha,alphaTest:t.alphaTest,doubleSided:t.side===y,flipSided:t.side===v,depthPacking:void 0!==t.depthPacking&&t.depthPacking}},this.getProgramCode=function(t,r){var n=[];if(r.shaderID?n.push(r.shaderID):(n.push(t.fragmentShader),n.push(t.vertexShader)),void 0!==t.defines)for(var i in t.defines)n.push(i),n.push(t.defines[i]);for(var a=0;a1&&r.sort(qn),n.length>1&&n.sort(Xn)}}},e[n]=i),i},dispose:function(){e={}}}}var Kn,Zn=0;function Jn(){var e=new function(){var e={};return{get:function(t){if(void 0!==e[t.id])return e[t.id];var r;switch(t.type){case"DirectionalLight":r={direction:new Gt,color:new ir,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Dt};break;case"SpotLight":r={position:new Gt,direction:new Gt,color:new ir,distance:0,coneCos:0,penumbraCos:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Dt};break;case"PointLight":r={position:new Gt,color:new ir,distance:0,decay:0,shadow:!1,shadowBias:0,shadowRadius:1,shadowMapSize:new Dt,shadowCameraNear:1,shadowCameraFar:1e3};break;case"HemisphereLight":r={direction:new Gt,skyColor:new ir,groundColor:new ir};break;case"RectAreaLight":r={color:new ir,position:new Gt,halfWidth:new Gt,halfHeight:new Gt}}return e[t.id]=r,r}}},t={id:Zn++,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:[]},r=new Gt,n=new Nt,i=new Nt;return{setup:function(o,a,s){for(var c=0,h=0,l=0,u=0,p=0,d=0,f=0,m=0,v=s.matrixWorldInverse,y=0,g=o.length;y0:s&&s.isGeometry&&(m=s.morphTargets&&s.morphTargets.length>0)),t.isSkinnedMesh&&!1===r.skinning&&console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",t);var v=t.isSkinnedMesh&&r.skinning,y=0;m&&(y|=h),v&&(y|=l),c=u[y]}if(e.localClippingEnabled&&!0===r.clipShadows&&0!==r.clippingPlanes.length){var _=c.uuid,x=r.uuid,w=g[_];void 0===w&&(w={},g[_]=w);var M=w[x];void 0===M&&(M=c.clone(),w[x]=M),c=M}return c.visible=r.visible,c.wireframe=r.wireframe,c.side=null!=r.shadowSide?r.shadowSide:b[r.side],c.clipShadows=r.clipShadows,c.clippingPlanes=r.clippingPlanes,c.clipIntersection=r.clipIntersection,c.wireframeLinewidth=r.wireframeLinewidth,c.linewidth=r.linewidth,n&&c.isMeshDistanceMaterial&&(c.referencePosition.copy(i),c.nearDistance=o,c.farDistance=a),c}function L(r,i,o,a){if(!1!==r.visible){if(r.layers.test(i.layers)&&(r.isMesh||r.isLine||r.isPoints)&&r.castShadow&&(!r.frustumCulled||n.intersectsObject(r))){r.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,r.matrixWorld);var s=t.update(r),h=r.material;if(Array.isArray(h))for(var l=s.groups,u=0,p=l.length;ut||e.height>t){if("data"in e)return void console.warn("THREE.WebGLRenderer: image in DataTexture is too big ("+e.width+"x"+e.height+").");var r=t/Math.max(e.width,e.height),n=document.createElementNS("http://www.w3.org/1999/xhtml","canvas");return n.width=Math.floor(e.width*r),n.height=Math.floor(e.height*r),n.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,n.width,n.height),console.warn("THREE.WebGLRenderer: image is too big ("+e.width+"x"+e.height+"). Resized to "+n.width+"x"+n.height),n}return e}function l(e){return It.isPowerOfTwo(e.width)&&It.isPowerOfTwo(e.height)}function u(e,t){return e.generateMipmaps&&t&&e.minFilter!==ge&&e.minFilter!==xe}function p(t,r,i,o){e.generateMipmap(t),n.get(r).__maxMipLevel=Math.log(Math.max(i,o))*Math.LOG2E}function d(t,r){if(!i.isWebGL2)return t;if(t===e.RED){if(r===e.FLOAT)return e.R32F;if(r===e.HALF_FLOAT)return e.R16F;if(r===e.UNSIGNED_BYTE)return e.R8}if(t===e.RGB){if(r===e.FLOAT)return e.RGB32F;if(r===e.HALF_FLOAT)return e.RGB16F;if(r===e.UNSIGNED_BYTE)return e.RGB8}if(t===e.RGBA){if(r===e.FLOAT)return e.RGBA32F;if(r===e.HALF_FLOAT)return e.RGBA16F;if(r===e.UNSIGNED_BYTE)return e.RGBA8}return t}function f(t){return t===ge||t===be||t===_e?e.NEAREST:e.LINEAR}function m(t){var r=t.target;r.removeEventListener("dispose",m),function(t){var r=n.get(t);if(t.image&&r.__image__webglTextureCube)e.deleteTexture(r.__image__webglTextureCube);else{if(void 0===r.__webglInit)return;e.deleteTexture(r.__webglTexture)}n.remove(t)}(r),r.isVideoTexture&&delete c[r.id],a.memory.textures--}function v(t){var r=t.target;r.removeEventListener("dispose",v),function(t){var r=n.get(t),i=n.get(t.texture);if(!t)return;void 0!==i.__webglTexture&&e.deleteTexture(i.__webglTexture);t.depthTexture&&t.depthTexture.dispose();if(t.isWebGLRenderTargetCube)for(var o=0;o<6;o++)e.deleteFramebuffer(r.__webglFramebuffer[o]),r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer[o]);else e.deleteFramebuffer(r.__webglFramebuffer),r.__webglDepthbuffer&&e.deleteRenderbuffer(r.__webglDepthbuffer);n.remove(t.texture),n.remove(t)}(r),a.memory.textures--}function y(t,i){var o=n.get(t);if(t.isVideoTexture&&function(e){var t=e.id,r=a.render.frame;c[t]!==r&&(c[t]=r,e.update())}(t),t.version>0&&o.__version!==t.version){var s=t.image;if(void 0===s)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==s.complete)return void b(o,t,i);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}r.activeTexture(e.TEXTURE0+i),r.bindTexture(e.TEXTURE_2D,o.__webglTexture)}function g(r,a,s){var c;if(s?(e.texParameteri(r,e.TEXTURE_WRAP_S,o.convert(a.wrapS)),e.texParameteri(r,e.TEXTURE_WRAP_T,o.convert(a.wrapT)),e.texParameteri(r,e.TEXTURE_MAG_FILTER,o.convert(a.magFilter)),e.texParameteri(r,e.TEXTURE_MIN_FILTER,o.convert(a.minFilter))):(e.texParameteri(r,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(r,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),a.wrapS===ve&&a.wrapT===ve||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),e.texParameteri(r,e.TEXTURE_MAG_FILTER,f(a.magFilter)),e.texParameteri(r,e.TEXTURE_MIN_FILTER,f(a.minFilter)),a.minFilter!==ge&&a.minFilter!==xe&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),c=t.get("EXT_texture_filter_anisotropic")){if(a.type===Le&&null===t.get("OES_texture_float_linear"))return;if(a.type===Re&&null===(i.isWebGL2||t.get("OES_texture_half_float_linear")))return;(a.anisotropy>1||n.get(a).__currentAnisotropy)&&(e.texParameterf(r,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(a.anisotropy,i.getMaxAnisotropy())),n.get(a).__currentAnisotropy=a.anisotropy)}}function b(t,n,c){var f;f=n.isDataTexture3D?e.TEXTURE_3D:e.TEXTURE_2D,void 0===t.__webglInit&&(t.__webglInit=!0,n.addEventListener("dispose",m),t.__webglTexture=e.createTexture(),a.memory.textures++),r.activeTexture(e.TEXTURE0+c),r.bindTexture(f,t.__webglTexture),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,n.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,n.unpackAlignment);var v=h(n.image,i.maxTextureSize);(function(e){return!i.isWebGL2&&(e.wrapS!==ve||e.wrapT!==ve||e.minFilter!==ge&&e.minFilter!==xe)})(n)&&!1===l(v)&&(v=function(e){return e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof ImageBitmap?(void 0===s&&(s=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),s.width=It.floorPowerOfTwo(e.width),s.height=It.floorPowerOfTwo(e.height),s.getContext("2d").drawImage(e,0,0,s.width,s.height),console.warn("THREE.WebGLRenderer: image is not power of two ("+e.width+"x"+e.height+"). Resized to "+s.width+"x"+s.height),s):e}(v));var y=l(v),b=o.convert(n.format),_=o.convert(n.type),x=d(b,_);g(f,n,y);var w,M=n.mipmaps;if(n.isDepthTexture){if(x=e.DEPTH_COMPONENT,n.type===Le){if(!i.isWebGL2)throw new Error("Float Depth Texture only supported in WebGL2.0");x=e.DEPTH_COMPONENT32F}else i.isWebGL2&&(x=e.DEPTH_COMPONENT16);n.format===Ge&&x===e.DEPTH_COMPONENT&&n.type!==Ae&&n.type!==Ce&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),n.type=Ae,_=o.convert(n.type)),n.format===He&&(x=e.DEPTH_STENCIL,n.type!==ke&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),n.type=ke,_=o.convert(n.type))),r.texImage2D(e.TEXTURE_2D,0,x,v.width,v.height,0,b,_,null)}else if(n.isDataTexture)if(M.length>0&&y){for(var T=0,S=M.length;T-1?r.compressedTexImage2D(e.TEXTURE_2D,T,x,w.width,w.height,0,w.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):r.texImage2D(e.TEXTURE_2D,T,x,w.width,w.height,0,b,_,w.data);t.__maxMipLevel=M.length-1}else if(n.isDataTexture3D)r.texImage3D(e.TEXTURE_3D,0,x,v.width,v.height,v.depth,0,b,_,v.data),t.__maxMipLevel=0;else if(M.length>0&&y){for(T=0,S=M.length;T0&&o.__version!==t.version?b(o,t,i):(r.activeTexture(e.TEXTURE0+i),r.bindTexture(e.TEXTURE_3D,o.__webglTexture))},this.setTextureCube=function(t,s){var c=n.get(t);if(6===t.image.length)if(t.version>0&&c.__version!==t.version){c.__image__webglTextureCube||(t.addEventListener("dispose",m),c.__image__webglTextureCube=e.createTexture(),a.memory.textures++),r.activeTexture(e.TEXTURE0+s),r.bindTexture(e.TEXTURE_CUBE_MAP,c.__image__webglTextureCube),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t.flipY);for(var f=t&&t.isCompressedTexture,v=t.image[0]&&t.image[0].isDataTexture,y=[],b=0;b<6;b++)y[b]=f||v?v?t.image[b].image:t.image[b]:h(t.image[b],i.maxCubemapSize);var _=y[0],x=l(_),w=o.convert(t.format),M=o.convert(t.type),T=d(w,M);for(g(e.TEXTURE_CUBE_MAP,t,x),b=0;b<6;b++)if(f)for(var S,E=y[b].mipmaps,A=0,P=E.length;A-1?r.compressedTexImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+b,A,T,S.width,S.height,0,S.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+b,A,T,S.width,S.height,0,w,M,S.data);else v?r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+b,0,T,y[b].width,y[b].height,0,w,M,y[b].data):r.texImage2D(e.TEXTURE_CUBE_MAP_POSITIVE_X+b,0,T,w,M,y[b]);c.__maxMipLevel=f?E.length-1:0,u(t,x)&&p(e.TEXTURE_CUBE_MAP,t,_.width,_.height),c.__version=t.version,t.onUpdate&&t.onUpdate(t)}else r.activeTexture(e.TEXTURE0+s),r.bindTexture(e.TEXTURE_CUBE_MAP,c.__image__webglTextureCube)},this.setTextureCubeDynamic=function(t,i){r.activeTexture(e.TEXTURE0+i),r.bindTexture(e.TEXTURE_CUBE_MAP,n.get(t).__webglTexture)},this.setupRenderTarget=function(t){var i=n.get(t),o=n.get(t.texture);t.addEventListener("dispose",v),o.__webglTexture=e.createTexture(),a.memory.textures++;var s=!0===t.isWebGLRenderTargetCube,c=l(t);if(s){i.__webglFramebuffer=[];for(var h=0;h<6;h++)i.__webglFramebuffer[h]=e.createFramebuffer()}else i.__webglFramebuffer=e.createFramebuffer();if(s){for(r.bindTexture(e.TEXTURE_CUBE_MAP,o.__webglTexture),g(e.TEXTURE_CUBE_MAP,t.texture,c),h=0;h<6;h++)_(i.__webglFramebuffer[h],t,e.COLOR_ATTACHMENT0,e.TEXTURE_CUBE_MAP_POSITIVE_X+h);u(t.texture,c)&&p(e.TEXTURE_CUBE_MAP,t.texture,t.width,t.height),r.bindTexture(e.TEXTURE_CUBE_MAP,null)}else r.bindTexture(e.TEXTURE_2D,o.__webglTexture),g(e.TEXTURE_2D,t.texture,c),_(i.__webglFramebuffer,t,e.COLOR_ATTACHMENT0,e.TEXTURE_2D),u(t.texture,c)&&p(e.TEXTURE_2D,t.texture,t.width,t.height),r.bindTexture(e.TEXTURE_2D,null);t.depthBuffer&&w(t)},this.updateRenderTargetMipmap=function(t){var i=t.texture;if(u(i,l(t))){var o=t.isWebGLRenderTargetCube?e.TEXTURE_CUBE_MAP:e.TEXTURE_2D,a=n.get(i).__webglTexture;r.bindTexture(o,a),p(o,i,t.width,t.height),r.bindTexture(o,null)}}}function ni(e,t,r){return{convert:function(n){var i;if(n===me)return e.REPEAT;if(n===ve)return e.CLAMP_TO_EDGE;if(n===ye)return e.MIRRORED_REPEAT;if(n===ge)return e.NEAREST;if(n===be)return e.NEAREST_MIPMAP_NEAREST;if(n===_e)return e.NEAREST_MIPMAP_LINEAR;if(n===xe)return e.LINEAR;if(n===we)return e.LINEAR_MIPMAP_NEAREST;if(n===Me)return e.LINEAR_MIPMAP_LINEAR;if(n===Te)return e.UNSIGNED_BYTE;if(n===Oe)return e.UNSIGNED_SHORT_4_4_4_4;if(n===Be)return e.UNSIGNED_SHORT_5_5_5_1;if(n===je)return e.UNSIGNED_SHORT_5_6_5;if(n===Se)return e.BYTE;if(n===Ee)return e.SHORT;if(n===Ae)return e.UNSIGNED_SHORT;if(n===Pe)return e.INT;if(n===Ce)return e.UNSIGNED_INT;if(n===Le)return e.FLOAT;if(n===Re){if(r.isWebGL2)return e.HALF_FLOAT;if(null!==(i=t.get("OES_texture_half_float")))return i.HALF_FLOAT_OES}if(n===Fe)return e.ALPHA;if(n===ze)return e.RGB;if(n===Ie)return e.RGBA;if(n===De)return e.LUMINANCE;if(n===Ne)return e.LUMINANCE_ALPHA;if(n===Ge)return e.DEPTH_COMPONENT;if(n===He)return e.DEPTH_STENCIL;if(n===Ve)return e.RED;if(n===C)return e.FUNC_ADD;if(n===L)return e.FUNC_SUBTRACT;if(n===R)return e.FUNC_REVERSE_SUBTRACT;if(n===j)return e.ZERO;if(n===k)return e.ONE;if(n===F)return e.SRC_COLOR;if(n===z)return e.ONE_MINUS_SRC_COLOR;if(n===I)return e.SRC_ALPHA;if(n===D)return e.ONE_MINUS_SRC_ALPHA;if(n===N)return e.DST_ALPHA;if(n===U)return e.ONE_MINUS_DST_ALPHA;if(n===G)return e.DST_COLOR;if(n===H)return e.ONE_MINUS_DST_COLOR;if(n===V)return e.SRC_ALPHA_SATURATE;if((n===We||n===qe||n===Xe||n===Ye)&&null!==(i=t.get("WEBGL_compressed_texture_s3tc"))){if(n===We)return i.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===qe)return i.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===Xe)return i.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===Ye)return i.COMPRESSED_RGBA_S3TC_DXT5_EXT}if((n===Ke||n===Ze||n===Je||n===Qe)&&null!==(i=t.get("WEBGL_compressed_texture_pvrtc"))){if(n===Ke)return i.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Ze)return i.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===Je)return i.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Qe)return i.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(n===$e&&null!==(i=t.get("WEBGL_compressed_texture_etc1")))return i.COMPRESSED_RGB_ETC1_WEBGL;if((n===et||n===tt||n===rt||n===nt||n===it||n===ot||n===at||n===st||n===ct||n===ht||n===lt||n===ut||n===pt||n===dt)&&null!==(i=t.get("WEBGL_compressed_texture_astc")))return n;if(n===O||n===B){if(r.isWebGL2){if(n===O)return e.MIN;if(n===B)return e.MAX}if(null!==(i=t.get("EXT_blend_minmax"))){if(n===O)return i.MIN_EXT;if(n===B)return i.MAX_EXT}}if(n===ke){if(r.isWebGL2)return e.UNSIGNED_INT_24_8;if(null!==(i=t.get("WEBGL_depth_texture")))return i.UNSIGNED_INT_24_8_WEBGL}return 0}}}function ii(){dr.call(this),this.type="Group"}function oi(){dr.call(this),this.type="Camera",this.matrixWorldInverse=new Nt,this.projectionMatrix=new Nt,this.projectionMatrixInverse=new Nt}function ai(e,t,r,n){oi.call(this),this.type="PerspectiveCamera",this.fov=void 0!==e?e:50,this.zoom=1,this.near=void 0!==r?r:.1,this.far=void 0!==n?n:2e3,this.focus=10,this.aspect=void 0!==t?t:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}function si(e){ai.call(this),this.cameras=e||[]}function ci(e){var t=this,r=null,n=null,i=null,o=[],a=new Nt,s=new Nt,c="stage";"undefined"!=typeof window&&"VRFrameData"in window&&(n=new window.VRFrameData,window.addEventListener("vrdisplaypresentchange",g,!1));var h=new Nt,l=new Ut,u=new Gt,p=new ai;p.bounds=new Xt(0,0,.5,1),p.layers.enable(1);var d=new ai;d.bounds=new Xt(.5,0,.5,1),d.layers.enable(2);var f,m,v=new si([p,d]);function y(){return null!==r&&!0===r.isPresenting}function g(){if(y()){var n=r.getEyeParameters("left"),i=n.renderWidth,o=n.renderHeight;m=e.getPixelRatio(),f=e.getSize(),e.setDrawingBufferSize(2*i,o,1),x.start()}else t.enabled&&e.setDrawingBufferSize(f.width,f.height,m),x.stop()}v.layers.enable(1),v.layers.enable(2);var b=[];function _(e){for(var t=navigator.getGamepads&&navigator.getGamepads(),r=0,n=0,i=t.length;r0),e.numPlanes=r,e.numIntersection=0}function h(t,r,n,i){var c=null!==t?t.length:0,h=null;if(0!==c){if(h=s.value,!0!==i||null===h){var l=n+4*c,u=r.matrixWorldInverse;a.getNormalMatrix(u),(null===h||h.length0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision>0)return"highp";t="mediump"}return"mediump"===t&&e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision>0&&e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}var o="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext,a=void 0!==r.precision?r.precision:"highp",s=i(a);s!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",s,"instead."),a=s);var c=!0===r.logarithmicDepthBuffer,h=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),l=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_TEXTURE_SIZE),p=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),d=e.getParameter(e.MAX_VERTEX_ATTRIBS),f=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),m=e.getParameter(e.MAX_VARYING_VECTORS),v=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),y=l>0,g=o||!!t.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==n)return n;var r=t.get("EXT_texture_filter_anisotropic");return n=null!==r?e.getParameter(r.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:i,precision:a,logarithmicDepthBuffer:c,maxTextures:h,maxVertexTextures:l,maxTextureSize:u,maxCubemapSize:p,maxAttributes:d,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:v,vertexTextures:y,floatFragmentTextures:g,floatVertexTextures:y&&g}}(b,_,e)).isWebGL2||(_.get("WEBGL_depth_texture"),_.get("OES_texture_float"),_.get("OES_texture_half_float"),_.get("OES_texture_half_float_linear"),_.get("OES_standard_derivatives"),_.get("OES_element_index_uint"),_.get("ANGLE_instanced_arrays")),_.get("OES_texture_float_linear"),H=new ni(b,_,x),(w=new function(e,t,r,n){var i=new function(){var t=!1,r=new Xt,n=null,i=new Xt(0,0,0,0);return{setMask:function(r){n===r||t||(e.colorMask(r,r,r,r),n=r)},setLocked:function(e){t=e},setClear:function(t,n,o,a,s){!0===s&&(t*=a,n*=a,o*=a),r.set(t,n,o,a),!1===i.equals(r)&&(e.clearColor(t,n,o,a),i.copy(r))},reset:function(){t=!1,n=null,i.set(-1,0,0,0)}}},o=new function(){var t=!1,r=null,n=null,i=null;return{setTest:function(t){t?oe(e.DEPTH_TEST):ae(e.DEPTH_TEST)},setMask:function(n){r===n||t||(e.depthMask(n),r=n)},setFunc:function(t){if(n!==t){if(t)switch(t){case W:e.depthFunc(e.NEVER);break;case q:e.depthFunc(e.ALWAYS);break;case X:e.depthFunc(e.LESS);break;case Y:e.depthFunc(e.LEQUAL);break;case K:e.depthFunc(e.EQUAL);break;case Z:e.depthFunc(e.GEQUAL);break;case J:e.depthFunc(e.GREATER);break;case Q:e.depthFunc(e.NOTEQUAL);break;default:e.depthFunc(e.LEQUAL)}else e.depthFunc(e.LEQUAL);n=t}},setLocked:function(e){t=e},setClear:function(t){i!==t&&(e.clearDepth(t),i=t)},reset:function(){t=!1,r=null,n=null,i=null}}},h=new function(){var t=!1,r=null,n=null,i=null,o=null,a=null,s=null,c=null,h=null;return{setTest:function(t){t?oe(e.STENCIL_TEST):ae(e.STENCIL_TEST)},setMask:function(n){r===n||t||(e.stencilMask(n),r=n)},setFunc:function(t,r,a){n===t&&i===r&&o===a||(e.stencilFunc(t,r,a),n=t,i=r,o=a)},setOp:function(t,r,n){a===t&&s===r&&c===n||(e.stencilOp(t,r,n),a=t,s=r,c=n)},setLocked:function(e){t=e},setClear:function(t){h!==t&&(e.clearStencil(t),h=t)},reset:function(){t=!1,r=null,n=null,i=null,o=null,a=null,s=null,c=null,h=null}}},l=e.getParameter(e.MAX_VERTEX_ATTRIBS),u=new Uint8Array(l),p=new Uint8Array(l),d=new Uint8Array(l),f={},m=null,g=null,b=null,_=null,x=null,w=null,L=null,R=null,O=null,B=null,j=!1,k=null,F=null,z=null,I=null,D=null,N=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),U=!1,G=0,H=e.getParameter(e.VERSION);-1!==H.indexOf("WebGL")?(G=parseFloat(/^WebGL\ ([0-9])/.exec(H)[1]),U=G>=1):-1!==H.indexOf("OpenGL ES")&&(G=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(H)[1]),U=G>=2);var V=null,$={},ee=new Xt,te=new Xt;function re(t,r,n){var i=new Uint8Array(4),o=e.createTexture();e.bindTexture(t,o),e.texParameteri(t,e.TEXTURE_MIN_FILTER,e.NEAREST),e.texParameteri(t,e.TEXTURE_MAG_FILTER,e.NEAREST);for(var a=0;a65535?Mr:xr)(a,1),t.update(n,e.ELEMENT_ARRAY_BUFFER),i[r.id]=n,n}}}(b,B,L),k=new function(e,t){var r={};return{update:function(n){var i=t.render.frame,o=n.geometry,a=e.get(n,o);return r[a.id]!==i&&(o.isGeometry&&a.updateFromObject(n),e.update(a),r[a.id]=i),a},dispose:function(){r={}}}}(j,L),N=new function(e){var t={},r=new Float32Array(8);return{update:function(n,i,o,a){var s=n.morphTargetInfluences,c=s.length,h=t[i.id];if(void 0===h){h=[];for(var l=0;l=0){var c=n[a];if(void 0!==c){var h=c.normalized,l=c.itemSize,u=B.get(c);if(void 0===u)continue;var p=u.buffer,d=u.type,f=u.bytesPerElement;if(c.isInterleavedBufferAttribute){var m=c.data,v=m.stride,y=c.offset;m&&m.isInstancedInterleavedBuffer?(w.enableAttributeAndDivisor(s,m.meshPerAttribute),void 0===r.maxInstancedCount&&(r.maxInstancedCount=m.meshPerAttribute*m.count)):w.enableAttribute(s),b.bindBuffer(b.ARRAY_BUFFER,p),b.vertexAttribPointer(s,l,d,h,v*f,y*f)}else c.isInstancedBufferAttribute?(w.enableAttributeAndDivisor(s,c.meshPerAttribute),void 0===r.maxInstancedCount&&(r.maxInstancedCount=c.meshPerAttribute*c.count)):w.enableAttribute(s),b.bindBuffer(b.ARRAY_BUFFER,p),b.vertexAttribPointer(s,l,d,h,0,0)}else if(void 0!==o){var g=o[a];if(void 0!==g)switch(g.length){case 2:b.vertexAttrib2fv(s,g);break;case 3:b.vertexAttrib3fv(s,g);break;case 4:b.vertexAttrib4fv(s,g);break;default:b.vertexAttrib1fv(s,g)}}}}w.disableUnusedAttributes()}(n,s,r),null!==l&&b.bindBuffer(b.ELEMENT_ARRAY_BUFFER,h.buffer));var f=1/0;null!==l?f=l.count:void 0!==u&&(f=u.count);var m=r.drawRange.start*p,v=r.drawRange.count*p,y=null!==o?o.start*p:0,g=null!==o?o.count*p:1/0,M=Math.max(m,y),T=Math.min(f,m+v,y+g)-1,S=Math.max(0,T-M+1);if(0!==S){if(i.isMesh)if(!0===n.wireframe)w.setLineWidth(n.wireframeLinewidth*Se()),d.setMode(b.LINES);else switch(i.drawMode){case Mt:d.setMode(b.TRIANGLES);break;case Tt:d.setMode(b.TRIANGLE_STRIP);break;case St:d.setMode(b.TRIANGLE_FAN)}else if(i.isLine){var E=n.linewidth;void 0===E&&(E=1),w.setLineWidth(E*Se()),i.isLineSegments?d.setMode(b.LINES):i.isLineLoop?d.setMode(b.LINE_LOOP):d.setMode(b.LINE_STRIP)}else i.isPoints?d.setMode(b.POINTS):i.isSprite&&d.setMode(b.TRIANGLES);r&&r.isInstancedBufferGeometry?r.maxInstancedCount>0&&d.renderInstances(r,M,S):d.render(M,S)}},this.compile=function(e,t){(g=I.get(e,t)).init(),e.traverse(function(e){e.isLight&&(g.pushLight(e),e.castShadow&&g.pushShadow(e))}),g.setupLights(t),e.traverse(function(t){if(t.material)if(Array.isArray(t.material))for(var r=0;r=0&&e.numSupportedMorphTargets++}if(e.morphNormals){e.numSupportedMorphNormals=0;for(f=0;f=0&&e.numSupportedMorphNormals++}var m=n.shader.uniforms;(e.isShaderMaterial||e.isRawShaderMaterial)&&!0!==e.clipping||(n.numClippingPlanes=be.numPlanes,n.numIntersection=be.numIntersection,m.clippingPlanes=be.uniform),n.fog=t,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,e.lights&&(m.ambientLightColor.value=i.state.ambient,m.directionalLights.value=i.state.directional,m.spotLights.value=i.state.spot,m.rectAreaLights.value=i.state.rectArea,m.pointLights.value=i.state.point,m.hemisphereLights.value=i.state.hemi,m.directionalShadowMap.value=i.state.directionalShadowMap,m.directionalShadowMatrix.value=i.state.directionalShadowMatrix,m.spotShadowMap.value=i.state.spotShadowMap,m.spotShadowMatrix.value=i.state.spotShadowMatrix,m.pointShadowMap.value=i.state.pointShadowMap,m.pointShadowMatrix.value=i.state.pointShadowMatrix);var v=n.program.getUniforms(),y=jn.seqWithValue(v.seq,m);n.uniformsList=y}function Ge(e,t,r,n){ue=0;var i=R.get(r),o=g.state.lights,a=i.lightsHash,s=o.state.hash;if(_e&&(xe||e!==ae)){var c=e===ae&&r.id===ie;be.setState(r.clippingPlanes,r.clipIntersection,r.clipShadows,e,i,c)}!1===r.needsUpdate&&(void 0===i.program?r.needsUpdate=!0:r.fog&&i.fog!==t?r.needsUpdate=!0:(!r.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===i.numClippingPlanes||i.numClippingPlanes===be.numPlanes&&i.numIntersection===be.numIntersection)||(r.needsUpdate=!0)),r.needsUpdate&&(Ue(r,t,n),r.needsUpdate=!1);var h=!1,l=!1,u=!1,p=i.program,d=p.getUniforms(),f=i.shader.uniforms;if(w.useProgram(p.program)&&(h=!0,l=!0,u=!0),r.id!==ie&&(ie=r.id,l=!0),h||ae!==e){if(d.setValue(b,"projectionMatrix",e.projectionMatrix),x.logarithmicDepthBuffer&&d.setValue(b,"logDepthBufFC",2/(Math.log(e.far+1)/Math.LN2)),ae!==e&&(ae=e,l=!0,u=!0),r.isShaderMaterial||r.isMeshPhongMaterial||r.isMeshStandardMaterial||r.envMap){var m=d.map.cameraPosition;void 0!==m&&m.setValue(b,Me.setFromMatrixPosition(e.matrixWorld))}(r.isMeshPhongMaterial||r.isMeshLambertMaterial||r.isMeshBasicMaterial||r.isMeshStandardMaterial||r.isShaderMaterial||r.skinning)&&d.setValue(b,"viewMatrix",e.matrixWorldInverse)}if(r.skinning){d.setOptional(b,n,"bindMatrix"),d.setOptional(b,n,"bindMatrixInverse");var y=n.skeleton;if(y){var _=y.bones;if(x.floatVertexTextures){if(void 0===y.boneTexture){var M=Math.sqrt(4*_.length);M=It.ceilPowerOfTwo(M),M=Math.max(M,4);var T=new Float32Array(M*M*4);T.set(y.boneMatrices);var S=new Zt(T,M,M,Ie,Le);S.needsUpdate=!0,y.boneMatrices=T,y.boneTexture=S,y.boneTextureSize=M}d.setValue(b,"boneTexture",y.boneTexture),d.setValue(b,"boneTextureSize",y.boneTextureSize)}else d.setOptional(b,y,"boneMatrices")}}return l&&(d.setValue(b,"toneMappingExposure",V.toneMappingExposure),d.setValue(b,"toneMappingWhitePoint",V.toneMappingWhitePoint),r.lights&&function(e,t){e.ambientLightColor.needsUpdate=t,e.directionalLights.needsUpdate=t,e.pointLights.needsUpdate=t,e.spotLights.needsUpdate=t,e.rectAreaLights.needsUpdate=t,e.hemisphereLights.needsUpdate=t}(f,u),t&&r.fog&&function(e,t){e.fogColor.value=t.color,t.isFog?(e.fogNear.value=t.near,e.fogFar.value=t.far):t.isFogExp2&&(e.fogDensity.value=t.density)}(f,t),r.isMeshBasicMaterial?He(f,r):r.isMeshLambertMaterial?(He(f,r),function(e,t){t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap)}(f,r)):r.isMeshPhongMaterial?(He(f,r),r.isMeshToonMaterial?function(e,t){Ve(e,t),t.gradientMap&&(e.gradientMap.value=t.gradientMap)}(f,r):Ve(f,r)):r.isMeshStandardMaterial?(He(f,r),r.isMeshPhysicalMaterial?function(e,t){We(e,t),e.reflectivity.value=t.reflectivity,e.clearCoat.value=t.clearCoat,e.clearCoatRoughness.value=t.clearCoatRoughness}(f,r):We(f,r)):r.isMeshMatcapMaterial?(He(f,r),function(e,t){t.matcap&&(e.matcap.value=t.matcap);t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===v&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===v&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(f,r)):r.isMeshDepthMaterial?(He(f,r),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(f,r)):r.isMeshDistanceMaterial?(He(f,r),function(e,t){t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias);e.referencePosition.value.copy(t.referencePosition),e.nearDistance.value=t.nearDistance,e.farDistance.value=t.farDistance}(f,r)):r.isMeshNormalMaterial?(He(f,r),function(e,t){t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===v&&(e.bumpScale.value*=-1));t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===v&&e.normalScale.value.negate());t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}(f,r)):r.isLineBasicMaterial?(function(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity}(f,r),r.isLineDashedMaterial&&function(e,t){e.dashSize.value=t.dashSize,e.totalSize.value=t.dashSize+t.gapSize,e.scale.value=t.scale}(f,r)):r.isPointsMaterial?function(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity,e.size.value=t.size*fe,e.scale.value=.5*de,e.map.value=t.map,null!==t.map&&(!0===t.map.matrixAutoUpdate&&t.map.updateMatrix(),e.uvTransform.value.copy(t.map.matrix))}(f,r):r.isSpriteMaterial?function(e,t){e.diffuse.value=t.color,e.opacity.value=t.opacity,e.rotation.value=t.rotation,e.map.value=t.map,null!==t.map&&(!0===t.map.matrixAutoUpdate&&t.map.updateMatrix(),e.uvTransform.value.copy(t.map.matrix))}(f,r):r.isShadowMaterial&&(f.color.value=r.color,f.opacity.value=r.opacity),void 0!==f.ltc_1&&(f.ltc_1.value=or.LTC_1),void 0!==f.ltc_2&&(f.ltc_2.value=or.LTC_2),jn.upload(b,i.uniformsList,f,V)),r.isShaderMaterial&&!0===r.uniformsNeedUpdate&&(jn.upload(b,i.uniformsList,f,V),r.uniformsNeedUpdate=!1),r.isSpriteMaterial&&d.setValue(b,"center",n.center),d.setValue(b,"modelViewMatrix",n.modelViewMatrix),d.setValue(b,"normalMatrix",n.normalMatrix),d.setValue(b,"modelMatrix",n.matrixWorld),p}function He(e,t){var r;e.opacity.value=t.opacity,t.color&&(e.diffuse.value=t.color),t.emissive&&e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),t.map&&(e.map.value=t.map),t.alphaMap&&(e.alphaMap.value=t.alphaMap),t.specularMap&&(e.specularMap.value=t.specularMap),t.envMap&&(e.envMap.value=t.envMap,e.flipEnvMap.value=t.envMap&&t.envMap.isCubeTexture?-1:1,e.reflectivity.value=t.reflectivity,e.refractionRatio.value=t.refractionRatio,e.maxMipLevel.value=R.get(t.envMap).__maxMipLevel),t.lightMap&&(e.lightMap.value=t.lightMap,e.lightMapIntensity.value=t.lightMapIntensity),t.aoMap&&(e.aoMap.value=t.aoMap,e.aoMapIntensity.value=t.aoMapIntensity),t.map?r=t.map:t.specularMap?r=t.specularMap:t.displacementMap?r=t.displacementMap:t.normalMap?r=t.normalMap:t.bumpMap?r=t.bumpMap:t.roughnessMap?r=t.roughnessMap:t.metalnessMap?r=t.metalnessMap:t.alphaMap?r=t.alphaMap:t.emissiveMap&&(r=t.emissiveMap),void 0!==r&&(r.isWebGLRenderTarget&&(r=r.texture),!0===r.matrixAutoUpdate&&r.updateMatrix(),e.uvTransform.value.copy(r.matrix))}function Ve(e,t){e.specular.value=t.specular,e.shininess.value=Math.max(t.shininess,1e-4),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===v&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===v&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias)}function We(e,t){e.roughness.value=t.roughness,e.metalness.value=t.metalness,t.roughnessMap&&(e.roughnessMap.value=t.roughnessMap),t.metalnessMap&&(e.metalnessMap.value=t.metalnessMap),t.emissiveMap&&(e.emissiveMap.value=t.emissiveMap),t.bumpMap&&(e.bumpMap.value=t.bumpMap,e.bumpScale.value=t.bumpScale,t.side===v&&(e.bumpScale.value*=-1)),t.normalMap&&(e.normalMap.value=t.normalMap,e.normalScale.value.copy(t.normalScale),t.side===v&&e.normalScale.value.negate()),t.displacementMap&&(e.displacementMap.value=t.displacementMap,e.displacementScale.value=t.displacementScale,e.displacementBias.value=t.displacementBias),t.envMap&&(e.envMapIntensity.value=t.envMapIntensity)}ze.setAnimationLoop(function(e){Pe.isPresenting()||Fe&&Fe(e)}),"undefined"!=typeof window&&ze.setContext(window),this.setAnimationLoop=function(e){Fe=e,Pe.setAnimationLoop(e),ze.start()},this.render=function(e,t,r,n){if(t&&t.isCamera){if(!$){oe.geometry=null,oe.program=null,oe.wireframe=!1,ie=-1,ae=null,!0===e.autoUpdate&&e.updateMatrixWorld(),null===t.parent&&t.updateMatrixWorld(),Pe.enabled&&(t=Pe.getCamera(t)),(g=I.get(e,t)).init(),e.onBeforeRender(V,e,t,r),we.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),ge.setFromMatrix(we),xe=this.localClippingEnabled,_e=be.init(this.clippingPlanes,xe,t),(f=z.get(e,t)).init(),function e(t,r,n){if(!1===t.visible)return;var i=t.layers.test(r.layers);if(i)if(t.isLight)g.pushLight(t),t.castShadow&&g.pushShadow(t);else if(t.isSprite){if(!t.frustumCulled||ge.intersectsSprite(t)){n&&Me.setFromMatrixPosition(t.matrixWorld).applyMatrix4(we);var o=k.update(t),a=t.material;f.push(t,o,a,Me.z,null)}}else if(t.isImmediateRenderObject)n&&Me.setFromMatrixPosition(t.matrixWorld).applyMatrix4(we),f.push(t,null,t.material,Me.z,null);else if((t.isMesh||t.isLine||t.isPoints)&&(t.isSkinnedMesh&&t.skeleton.update(),!t.frustumCulled||ge.intersectsObject(t))){n&&Me.setFromMatrixPosition(t.matrixWorld).applyMatrix4(we);var o=k.update(t),a=t.material;if(Array.isArray(a))for(var s=o.groups,c=0,h=s.length;c=x.maxTextures&&console.warn("THREE.WebGLRenderer: Trying to use "+e+" texture units while this GPU supports only "+x.maxTextures),ue+=1,e},this.setTexture2D=function(){var e=!1;return function(t,r){t&&t.isWebGLRenderTarget&&(e||(console.warn("THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead."),e=!0),t=t.texture),O.setTexture2D(t,r)}}(),this.setTexture3D=function(e,t){O.setTexture3D(e,t)},this.setTexture=function(){var e=!1;return function(t,r){e||(console.warn("THREE.WebGLRenderer: .setTexture is deprecated, use setTexture2D instead."),e=!0),O.setTexture2D(t,r)}}(),this.setTextureCube=function(){var e=!1;return function(t,r){t&&t.isWebGLRenderTargetCube&&(e||(console.warn("THREE.WebGLRenderer.setTextureCube: don't use cube render targets as textures. Use their .texture property instead."),e=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?O.setTextureCube(t,r):O.setTextureCubeDynamic(t,r)}}(),this.setFramebuffer=function(e){ee=e},this.getRenderTarget=function(){return te},this.setRenderTarget=function(e){te=e,e&&void 0===R.get(e).__webglFramebuffer&&O.setupRenderTarget(e);var t=ee,r=!1;if(e){var n=R.get(e).__webglFramebuffer;e.isWebGLRenderTargetCube?(t=n[e.activeCubeFace],r=!0):t=n,ce.copy(e.viewport),he.copy(e.scissor),le=e.scissorTest}else ce.copy(me).multiplyScalar(fe),he.copy(ve).multiplyScalar(fe),le=ye;if(re!==t&&(b.bindFramebuffer(b.FRAMEBUFFER,t),re=t),w.viewport(ce),w.scissor(he),w.setScissorTest(le),r){var i=R.get(e.texture);b.framebufferTexture2D(b.FRAMEBUFFER,b.COLOR_ATTACHMENT0,b.TEXTURE_CUBE_MAP_POSITIVE_X+e.activeCubeFace,i.__webglTexture,e.activeMipMapLevel)}},this.readRenderTargetPixels=function(e,t,r,n,i,o){if(e&&e.isWebGLRenderTarget){var a=R.get(e).__webglFramebuffer;if(a){var s=!1;a!==re&&(b.bindFramebuffer(b.FRAMEBUFFER,a),s=!0);try{var c=e.texture,h=c.format,l=c.type;if(h!==Ie&&H.convert(h)!==b.getParameter(b.IMPLEMENTATION_COLOR_READ_FORMAT))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(l===Te||H.convert(l)===b.getParameter(b.IMPLEMENTATION_COLOR_READ_TYPE)||l===Le&&(x.isWebGL2||_.get("OES_texture_float")||_.get("WEBGL_color_buffer_float"))||l===Re&&(x.isWebGL2?_.get("EXT_color_buffer_float"):_.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");b.checkFramebufferStatus(b.FRAMEBUFFER)===b.FRAMEBUFFER_COMPLETE?t>=0&&t<=e.width-n&&r>=0&&r<=e.height-i&&b.readPixels(t,r,n,i,H.convert(h),H.convert(l),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&b.bindFramebuffer(b.FRAMEBUFFER,re)}}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.copyFramebufferToTexture=function(e,t,r){var n=t.image.width,i=t.image.height,o=H.convert(t.format);this.setTexture2D(t,0),b.copyTexImage2D(b.TEXTURE_2D,r||0,o,e.x,e.y,n,i,0)},this.copyTextureToTexture=function(e,t,r,n){var i=t.image.width,o=t.image.height,a=H.convert(r.format),s=H.convert(r.type);this.setTexture2D(r,0),t.isDataTexture?b.texSubImage2D(b.TEXTURE_2D,n||0,e.x,e.y,i,o,a,s,t.image.data):b.texSubImage2D(b.TEXTURE_2D,n||0,e.x,e.y,a,s,t.image)}}function li(e,t){this.name="",this.color=new ir(e),this.density=void 0!==t?t:25e-5}function ui(e,t,r){this.name="",this.color=new ir(e),this.near=void 0!==t?t:1,this.far=void 0!==r?r:1e3}function pi(){dr.call(this),this.type="Scene",this.background=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0}function di(e,t){this.array=e,this.stride=t,this.count=void 0!==e?e.length/t:0,this.dynamic=!1,this.updateRange={offset:0,count:-1},this.version=0}function fi(e,t,r,n){this.data=e,this.itemSize=t,this.offset=r,this.normalized=!0===n}function mi(e){kr.call(this),this.type="SpriteMaterial",this.color=new ir(16777215),this.map=null,this.rotation=0,this.sizeAttenuation=!0,this.lights=!1,this.transparent=!0,this.setValues(e)}function vi(e){if(dr.call(this),this.type="Sprite",void 0===Kn){Kn=new Cr;var t=new di(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);Kn.setIndex([0,1,2,0,2,3]),Kn.addAttribute("position",new fi(t,3,0,!1)),Kn.addAttribute("uv",new fi(t,2,3,!1))}this.geometry=Kn,this.material=void 0!==e?e:new mi,this.center=new Dt(.5,.5)}function yi(){dr.call(this),this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}})}function gi(e,t){if(e=e||[],this.bones=e.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),void 0===t)this.calculateInverses();else if(this.bones.length===t.length)this.boneInverses=t.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(var r=0,n=this.bones.length;r=0?(e(v-1e-5,m,u),p.subVectors(l,u)):(e(v+1e-5,m,u),p.subVectors(u,l)),m-1e-5>=0?(e(v,m-1e-5,u),d.subVectors(l,u)):(e(v,m+1e-5,u),d.subVectors(u,l)),h.crossVectors(p,d).normalize(),s.push(h.x,h.y,h.z),c.push(v,m)}}for(n=0;n.9&&a<.1&&(t<.2&&(o[e+0]+=1),r<.2&&(o[e+2]+=1),n<.2&&(o[e+4]+=1))}}()}(),this.addAttribute("position",new Tr(i,3)),this.addAttribute("normal",new Tr(i.slice(),3)),this.addAttribute("uv",new Tr(o,2)),0===n?this.computeVertexNormals():this.normalizeNormals()}function Fi(e,t){mr.call(this),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new zi(e,t)),this.mergeVertices()}function zi(e,t){ki.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],e,t),this.type="TetrahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Ii(e,t){mr.call(this),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Di(e,t)),this.mergeVertices()}function Di(e,t){ki.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],e,t),this.type="OctahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Ni(e,t){mr.call(this),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Ui(e,t)),this.mergeVertices()}function Ui(e,t){var r=(1+Math.sqrt(5))/2,n=[-1,r,0,1,r,0,-1,-r,0,1,-r,0,0,-1,r,0,1,r,0,-1,-r,0,1,-r,r,0,-1,r,0,1,-r,0,-1,-r,0,1];ki.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],e,t),this.type="IcosahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Gi(e,t){mr.call(this),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t},this.fromBufferGeometry(new Hi(e,t)),this.mergeVertices()}function Hi(e,t){var r=(1+Math.sqrt(5))/2,n=1/r,i=[-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,-r,0,-n,r,0,n,-r,0,n,r,-n,-r,0,-n,r,0,n,-r,0,n,r,0,-r,0,-n,r,0,-n,-r,0,n,r,0,n];ki.call(this,i,[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],e,t),this.type="DodecahedronBufferGeometry",this.parameters={radius:e,detail:t}}function Vi(e,t,r,n,i,o){mr.call(this),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:r,radialSegments:n,closed:i},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");var a=new Wi(e,t,r,n,i);this.tangents=a.tangents,this.normals=a.normals,this.binormals=a.binormals,this.fromBufferGeometry(a),this.mergeVertices()}function Wi(e,t,r,n,i){Cr.call(this),this.type="TubeBufferGeometry",this.parameters={path:e,tubularSegments:t,radius:r,radialSegments:n,closed:i},t=t||64,r=r||1,n=n||8,i=i||!1;var o=e.computeFrenetFrames(t,i);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;var a,s,c=new Gt,h=new Gt,l=new Dt,u=new Gt,p=[],d=[],f=[],m=[];function v(i){u=e.getPointAt(i/t,u);var a=o.normals[i],l=o.binormals[i];for(s=0;s<=n;s++){var f=s/n*Math.PI*2,m=Math.sin(f),v=-Math.cos(f);h.x=v*a.x+m*l.x,h.y=v*a.y+m*l.y,h.z=v*a.z+m*l.z,h.normalize(),d.push(h.x,h.y,h.z),c.x=u.x+r*h.x,c.y=u.y+r*h.y,c.z=u.z+r*h.z,p.push(c.x,c.y,c.z)}}!function(){for(a=0;an.far||i.push({distance:g,point:e.clone(),uv:Ir.getUV(e,a,s,c,h,l,u,new Dt),face:null,object:this})}}}(),clone:function(){return new this.constructor(this.material).copy(this)},copy:function(e){return dr.prototype.copy.call(this,e),void 0!==e.center&&this.center.copy(e.center),this}}),yi.prototype=Object.assign(Object.create(dr.prototype),{constructor:yi,copy:function(e){dr.prototype.copy.call(this,e,!1);for(var t=e.levels,r=0,n=t.length;r1){e.setFromMatrixPosition(r.matrixWorld),t.setFromMatrixPosition(this.matrixWorld);var i=e.distanceTo(t);n[0].object.visible=!0;for(var o=1,a=n.length;o=n[o].distance;o++)n[o-1].object.visible=!1,n[o].object.visible=!0;for(;oh))d.applyMatrix4(this.matrixWorld),(T=n.ray.origin.distanceTo(d))n.far||i.push({distance:T,point:p.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this})}else for(g=0,b=v.length/3-1;gh))d.applyMatrix4(this.matrixWorld),(T=n.ray.origin.distanceTo(d))n.far||i.push({distance:T,point:p.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this})}}else if(a.isGeometry){var w=a.vertices,M=w.length;for(g=0;gh))d.applyMatrix4(this.matrixWorld),(T=n.ray.origin.distanceTo(d))n.far||i.push({distance:T,point:p.clone().applyMatrix4(this.matrixWorld),index:g,face:null,faceIndex:null,object:this})}}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Mi.prototype=Object.assign(Object.create(wi.prototype),{constructor:Mi,isLineSegments:!0,computeLineDistances:function(){var e=new Gt,t=new Gt;return function(){var r=this.geometry;if(r.isBufferGeometry)if(null===r.index){for(var n=r.attributes.position,i=[],o=0,a=n.count;on.far)return;i.push({distance:c,distanceToRay:Math.sqrt(a),point:p.clone(),index:r,face:null,object:o})}}}}(),clone:function(){return new this.constructor(this.geometry,this.material).copy(this)}}),Ai.prototype=Object.assign(Object.create(qt.prototype),{constructor:Ai,isVideoTexture:!0,update:function(){var e=this.image;e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),Pi.prototype=Object.create(qt.prototype),Pi.prototype.constructor=Pi,Pi.prototype.isCompressedTexture=!0,Ci.prototype=Object.create(qt.prototype),Ci.prototype.constructor=Ci,Ci.prototype.isCanvasTexture=!0,Li.prototype=Object.create(qt.prototype),Li.prototype.constructor=Li,Li.prototype.isDepthTexture=!0,Ri.prototype=Object.create(Cr.prototype),Ri.prototype.constructor=Ri,Oi.prototype=Object.create(mr.prototype),Oi.prototype.constructor=Oi,Bi.prototype=Object.create(Cr.prototype),Bi.prototype.constructor=Bi,ji.prototype=Object.create(mr.prototype),ji.prototype.constructor=ji,ki.prototype=Object.create(Cr.prototype),ki.prototype.constructor=ki,Fi.prototype=Object.create(mr.prototype),Fi.prototype.constructor=Fi,zi.prototype=Object.create(ki.prototype),zi.prototype.constructor=zi,Ii.prototype=Object.create(mr.prototype),Ii.prototype.constructor=Ii,Di.prototype=Object.create(ki.prototype),Di.prototype.constructor=Di,Ni.prototype=Object.create(mr.prototype),Ni.prototype.constructor=Ni,Ui.prototype=Object.create(ki.prototype),Ui.prototype.constructor=Ui,Gi.prototype=Object.create(mr.prototype),Gi.prototype.constructor=Gi,Hi.prototype=Object.create(ki.prototype),Hi.prototype.constructor=Hi,Vi.prototype=Object.create(mr.prototype),Vi.prototype.constructor=Vi,Wi.prototype=Object.create(Cr.prototype),Wi.prototype.constructor=Wi,qi.prototype=Object.create(mr.prototype),qi.prototype.constructor=qi,Xi.prototype=Object.create(Cr.prototype),Xi.prototype.constructor=Xi,Yi.prototype=Object.create(mr.prototype),Yi.prototype.constructor=Yi,Ki.prototype=Object.create(Cr.prototype),Ki.prototype.constructor=Ki;var Zi=function(e,t,r){r=r||2;var n,i,o,a,s,c,h,l=t&&t.length,u=l?t[0]*r:e.length,p=Ji(e,0,u,r,!0),d=[];if(!p)return d;if(l&&(p=function(e,t,r,n){var i,o,a,s,c,h=[];for(i=0,o=t.length;i80*r){n=o=e[0],i=a=e[1];for(var f=r;fo&&(o=s),c>a&&(a=c);h=0!==(h=Math.max(o-n,a-i))?1/h:0}return $i(p,d,r,n,i,h),d};function Ji(e,t,r,n,i){var o,a;if(i===function(e,t,r,n){for(var i=0,o=t,a=r-n;o0)for(o=t;o=t;o-=n)a=vo(o,e[o],e[o+1],a);return a&&uo(a,a.next)&&(yo(a),a=a.next),a}function Qi(e,t){if(!e)return e;t||(t=e);var r,n=e;do{if(r=!1,n.steiner||!uo(n,n.next)&&0!==lo(n.prev,n,n.next))n=n.next;else{if(yo(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function $i(e,t,r,n,i,o,a){if(e){!a&&o&&function(e,t,r,n){var i=e;do{null===i.z&&(i.z=ao(i.x,i.y,t,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==e);i.prevZ.nextZ=null,i.prevZ=null,function(e){var t,r,n,i,o,a,s,c,h=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,n=r,s=0,t=0;t0||c>0&&n;)0!==s&&(0===c||!n||r.z<=n.z)?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,c--),o?o.nextZ=i:e=i,i.prevZ=o,o=i;r=n}o.nextZ=null,h*=2}while(a>1)}(i)}(e,n,i,o);for(var s,c,h=e;e.prev!==e.next;)if(s=e.prev,c=e.next,o?to(e,n,i,o):eo(e))t.push(s.i/r),t.push(e.i/r),t.push(c.i/r),yo(e),e=c.next,h=c.next;else if((e=c)===h){a?1===a?$i(e=ro(e,t,r),t,r,n,i,o,2):2===a&&no(e,t,r,n,i,o):$i(Qi(e),t,r,n,i,o,1);break}}}function eo(e){var t=e.prev,r=e,n=e.next;if(lo(t,r,n)>=0)return!1;for(var i=e.next.next;i!==e.prev;){if(co(t.x,t.y,r.x,r.y,n.x,n.y,i.x,i.y)&&lo(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function to(e,t,r,n){var i=e.prev,o=e,a=e.next;if(lo(i,o,a)>=0)return!1;for(var s=i.xo.x?i.x>a.x?i.x:a.x:o.x>a.x?o.x:a.x,l=i.y>o.y?i.y>a.y?i.y:a.y:o.y>a.y?o.y:a.y,u=ao(s,c,t,r,n),p=ao(h,l,t,r,n),d=e.nextZ;d&&d.z<=p;){if(d!==e.prev&&d!==e.next&&co(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&lo(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=e.prevZ;d&&d.z>=u;){if(d!==e.prev&&d!==e.next&&co(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&lo(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function ro(e,t,r){var n=e;do{var i=n.prev,o=n.next.next;!uo(i,o)&&po(i,n,n.next,o)&&fo(i,o)&&fo(o,i)&&(t.push(i.i/r),t.push(n.i/r),t.push(o.i/r),yo(n),yo(n.next),n=e=o),n=n.next}while(n!==e);return n}function no(e,t,r,n,i,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&ho(a,s)){var c=mo(a,s);return a=Qi(a,a.next),c=Qi(c,c.next),$i(a,t,r,n,i,o),void $i(c,t,r,n,i,o)}s=s.next}a=a.next}while(a!==e)}function io(e,t){return e.x-t.x}function oo(e,t){if(t=function(e,t){var r,n=t,i=e.x,o=e.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<=i&&s>a){if(a=s,s===i){if(o===n.y)return n;if(o===n.next.y)return n.next}r=n.x=n.x&&n.x>=l&&i!==n.x&&co(or.x)&&fo(n,e)&&(r=n,p=c),n=n.next;return r}(e,t)){var r=mo(t,e);Qi(r,r.next)}}function ao(e,t,r,n,i){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function so(e){var t=e,r=e;do{t.x=0&&(e-a)*(n-s)-(r-a)*(t-s)>=0&&(r-a)*(o-s)-(i-a)*(n-s)>=0}function ho(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&po(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&fo(e,t)&&fo(t,e)&&function(e,t){var r=e,n=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;do{r.y>o!=r.next.y>o&&r.next.y!==r.y&&i<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==e);return n}(e,t)}function lo(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function uo(e,t){return e.x===t.x&&e.y===t.y}function po(e,t,r,n){return!!(uo(e,t)&&uo(r,n)||uo(e,n)&&uo(r,t))||lo(e,t,r)>0!=lo(e,t,n)>0&&lo(r,n,e)>0!=lo(r,n,t)>0}function fo(e,t){return lo(e.prev,e,e.next)<0?lo(e,t,e.next)>=0&&lo(e,e.prev,t)>=0:lo(e,t,e.prev)<0||lo(e,e.next,t)<0}function mo(e,t){var r=new go(e.i,e.x,e.y),n=new go(t.i,t.x,t.y),i=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=i,i.prev=r,n.next=r,r.prev=n,o.next=n,n.prev=o,n}function vo(e,t,r,n){var i=new go(e,t,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function yo(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function go(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}var bo={area:function(e){for(var t=e.length,r=0,n=t-1,i=0;i2&&e[t-1].equals(e[0])&&e.pop()}function xo(e,t){for(var r=0;rNumber.EPSILON){var p=Math.sqrt(l),d=Math.sqrt(c*c+h*h),f=t.x-s/p,m=t.y+a/p,v=((r.x-h/d-f)*h-(r.y+c/d-m)*c)/(a*h-s*c),y=(n=f+a*v-e.x)*n+(i=m+s*v-e.y)*i;if(y<=2)return new Dt(n,i);o=Math.sqrt(y/2)}else{var g=!1;a>Number.EPSILON?c>Number.EPSILON&&(g=!0):a<-Number.EPSILON?c<-Number.EPSILON&&(g=!0):Math.sign(s)===Math.sign(h)&&(g=!0),g?(n=-s,i=a,o=Math.sqrt(l)):(n=a,i=s,o=Math.sqrt(l/2))}return new Dt(n/o,i/o)}for(var D=[],N=0,U=P.length,G=U-1,H=N+1;N=0;L--){for(O=L/p,B=l*Math.cos(O*Math.PI/2),R=u*Math.sin(O*Math.PI/2),N=0,U=P.length;N=0;){r=N,(n=N-1)<0&&(n=e.length-1);var i=0,o=s+2*p;for(i=0;i0)&&f.push(x,w,T),(c!==r-1||h0&&y(!0),t>0&&y(!1)),this.setIndex(h),this.addAttribute("position",new Tr(l,3)),this.addAttribute("normal",new Tr(u,3)),this.addAttribute("uv",new Tr(p,2))}function No(e,t,r,n,i,o,a){Io.call(this,0,e,t,r,n,i,o,a),this.type="ConeGeometry",this.parameters={radius:e,height:t,radialSegments:r,heightSegments:n,openEnded:i,thetaStart:o,thetaLength:a}}function Uo(e,t,r,n,i,o,a){Do.call(this,0,e,t,r,n,i,o,a),this.type="ConeBufferGeometry",this.parameters={radius:e,height:t,radialSegments:r,heightSegments:n,openEnded:i,thetaStart:o,thetaLength:a}}function Go(e,t,r,n){mr.call(this),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:r,thetaLength:n},this.fromBufferGeometry(new Ho(e,t,r,n)),this.mergeVertices()}function Ho(e,t,r,n){Cr.call(this),this.type="CircleBufferGeometry",this.parameters={radius:e,segments:t,thetaStart:r,thetaLength:n},e=e||1,t=void 0!==t?Math.max(3,t):8,r=void 0!==r?r:0,n=void 0!==n?n:2*Math.PI;var i,o,a=[],s=[],c=[],h=[],l=new Gt,u=new Dt;for(s.push(0,0,0),c.push(0,0,1),h.push(.5,.5),o=0,i=3;o<=t;o++,i+=3){var p=r+o/t*n;l.x=e*Math.cos(p),l.y=e*Math.sin(p),s.push(l.x,l.y,l.z),c.push(0,0,1),u.x=(s[i]/e+1)/2,u.y=(s[i+1]/e+1)/2,h.push(u.x,u.y)}for(i=1;i<=t;i++)a.push(i,i+1,0);this.setIndex(a),this.addAttribute("position",new Tr(s,3)),this.addAttribute("normal",new Tr(c,3)),this.addAttribute("uv",new Tr(h,2))}Eo.prototype=Object.create(mr.prototype),Eo.prototype.constructor=Eo,Ao.prototype=Object.create(Mo.prototype),Ao.prototype.constructor=Ao,Po.prototype=Object.create(mr.prototype),Po.prototype.constructor=Po,Co.prototype=Object.create(Cr.prototype),Co.prototype.constructor=Co,Lo.prototype=Object.create(mr.prototype),Lo.prototype.constructor=Lo,Ro.prototype=Object.create(Cr.prototype),Ro.prototype.constructor=Ro,Oo.prototype=Object.create(mr.prototype),Oo.prototype.constructor=Oo,Bo.prototype=Object.create(Cr.prototype),Bo.prototype.constructor=Bo,jo.prototype=Object.create(mr.prototype),jo.prototype.constructor=jo,jo.prototype.toJSON=function(){var e=mr.prototype.toJSON.call(this);return Fo(this.parameters.shapes,e)},ko.prototype=Object.create(Cr.prototype),ko.prototype.constructor=ko,ko.prototype.toJSON=function(){var e=Cr.prototype.toJSON.call(this);return Fo(this.parameters.shapes,e)},zo.prototype=Object.create(Cr.prototype),zo.prototype.constructor=zo,Io.prototype=Object.create(mr.prototype),Io.prototype.constructor=Io,Do.prototype=Object.create(Cr.prototype),Do.prototype.constructor=Do,No.prototype=Object.create(Io.prototype),No.prototype.constructor=No,Uo.prototype=Object.create(Do.prototype),Uo.prototype.constructor=Uo,Go.prototype=Object.create(mr.prototype),Go.prototype.constructor=Go,Ho.prototype=Object.create(Cr.prototype),Ho.prototype.constructor=Ho;var Vo=Object.freeze({WireframeGeometry:Ri,ParametricGeometry:Oi,ParametricBufferGeometry:Bi,TetrahedronGeometry:Fi,TetrahedronBufferGeometry:zi,OctahedronGeometry:Ii,OctahedronBufferGeometry:Di,IcosahedronGeometry:Ni,IcosahedronBufferGeometry:Ui,DodecahedronGeometry:Gi,DodecahedronBufferGeometry:Hi,PolyhedronGeometry:ji,PolyhedronBufferGeometry:ki,TubeGeometry:Vi,TubeBufferGeometry:Wi,TorusKnotGeometry:qi,TorusKnotBufferGeometry:Xi,TorusGeometry:Yi,TorusBufferGeometry:Ki,TextGeometry:Eo,TextBufferGeometry:Ao,SphereGeometry:Po,SphereBufferGeometry:Co,RingGeometry:Lo,RingBufferGeometry:Ro,PlaneGeometry:Or,PlaneBufferGeometry:Br,LatheGeometry:Oo,LatheBufferGeometry:Bo,ShapeGeometry:jo,ShapeBufferGeometry:ko,ExtrudeGeometry:wo,ExtrudeBufferGeometry:Mo,EdgesGeometry:zo,ConeGeometry:No,ConeBufferGeometry:Uo,CylinderGeometry:Io,CylinderBufferGeometry:Do,CircleGeometry:Go,CircleBufferGeometry:Ho,BoxGeometry:Lr,BoxBufferGeometry:Rr});function Wo(e){kr.call(this),this.type="ShadowMaterial",this.color=new ir(0),this.transparent=!0,this.setValues(e)}function qo(e){Fr.call(this,e),this.type="RawShaderMaterial"}function Xo(e){kr.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new ir(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 ir(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ft,this.normalScale=new Dt(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(e)}function Yo(e){Xo.call(this),this.defines={PHYSICAL:""},this.type="MeshPhysicalMaterial",this.reflectivity=.5,this.clearCoat=0,this.clearCoatRoughness=0,this.setValues(e)}function Ko(e){kr.call(this),this.type="MeshPhongMaterial",this.color=new ir(16777215),this.specular=new ir(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ir(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ft,this.normalScale=new Dt(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=$,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(e)}function Zo(e){Ko.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.gradientMap=null,this.setValues(e)}function Jo(e){kr.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ft,this.normalScale=new Dt(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(e)}function Qo(e){kr.call(this),this.type="MeshLambertMaterial",this.color=new ir(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new ir(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=$,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(e)}function $o(e){if(kr.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new ir(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Ft,this.normalScale=new Dt(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(e),null===this.matcap){var t=document.createElement("canvas");t.width=1,t.height=1;var r=t.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,1,1),this.matcap=new THREE.CanvasTexture(t)}}function ea(e){xi.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}Wo.prototype=Object.create(kr.prototype),Wo.prototype.constructor=Wo,Wo.prototype.isShadowMaterial=!0,Wo.prototype.copy=function(e){return kr.prototype.copy.call(this,e),this.color.copy(e.color),this},qo.prototype=Object.create(Fr.prototype),qo.prototype.constructor=qo,qo.prototype.isRawShaderMaterial=!0,Xo.prototype=Object.create(kr.prototype),Xo.prototype.constructor=Xo,Xo.prototype.isMeshStandardMaterial=!0,Xo.prototype.copy=function(e){return kr.prototype.copy.call(this,e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapIntensity=e.envMapIntensity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Yo.prototype=Object.create(Xo.prototype),Yo.prototype.constructor=Yo,Yo.prototype.isMeshPhysicalMaterial=!0,Yo.prototype.copy=function(e){return Xo.prototype.copy.call(this,e),this.defines={PHYSICAL:""},this.reflectivity=e.reflectivity,this.clearCoat=e.clearCoat,this.clearCoatRoughness=e.clearCoatRoughness,this},Ko.prototype=Object.create(kr.prototype),Ko.prototype.constructor=Ko,Ko.prototype.isMeshPhongMaterial=!0,Ko.prototype.copy=function(e){return kr.prototype.copy.call(this,e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Zo.prototype=Object.create(Ko.prototype),Zo.prototype.constructor=Zo,Zo.prototype.isMeshToonMaterial=!0,Zo.prototype.copy=function(e){return Ko.prototype.copy.call(this,e),this.gradientMap=e.gradientMap,this},Jo.prototype=Object.create(kr.prototype),Jo.prototype.constructor=Jo,Jo.prototype.isMeshNormalMaterial=!0,Jo.prototype.copy=function(e){return kr.prototype.copy.call(this,e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},Qo.prototype=Object.create(kr.prototype),Qo.prototype.constructor=Qo,Qo.prototype.isMeshLambertMaterial=!0,Qo.prototype.copy=function(e){return kr.prototype.copy.call(this,e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},$o.prototype=Object.create(kr.prototype),$o.prototype.constructor=$o,$o.prototype.isMeshMatcapMaterial=!0,$o.prototype.copy=function(e){return kr.prototype.copy.call(this,e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.skinning=e.skinning,this.morphTargets=e.morphTargets,this.morphNormals=e.morphNormals,this},ea.prototype=Object.create(xi.prototype),ea.prototype.constructor=ea,ea.prototype.isLineDashedMaterial=!0,ea.prototype.copy=function(e){return xi.prototype.copy.call(this,e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this};var ta=Object.freeze({ShadowMaterial:Wo,SpriteMaterial:mi,RawShaderMaterial:qo,ShaderMaterial:Fr,PointsMaterial:Si,MeshPhysicalMaterial:Yo,MeshStandardMaterial:Xo,MeshPhongMaterial:Ko,MeshToonMaterial:Zo,MeshNormalMaterial:Jo,MeshLambertMaterial:Qo,MeshDepthMaterial:$n,MeshDistanceMaterial:ei,MeshBasicMaterial:Dr,MeshMatcapMaterial:$o,LineDashedMaterial:ea,LineBasicMaterial:xi,Material:kr}),ra={enabled:!1,files:{},add:function(e,t){!1!==this.enabled&&(this.files[e]=t)},get:function(e){if(!1!==this.enabled)return this.files[e]},remove:function(e){delete this.files[e]},clear:function(){this.files={}}};function na(e,t,r){var n=this,i=!1,o=0,a=0,s=void 0;this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=r,this.itemStart=function(e){a++,!1===i&&void 0!==n.onStart&&n.onStart(e,o,a),i=!0},this.itemEnd=function(e){o++,void 0!==n.onProgress&&n.onProgress(e,o,a),o===a&&(i=!1,void 0!==n.onLoad&&n.onLoad())},this.itemError=function(e){void 0!==n.onError&&n.onError(e)},this.resolveURL=function(e){return s?s(e):e},this.setURLModifier=function(e){return s=e,this}}var ia=new na,oa={};function aa(e){this.manager=void 0!==e?e:ia}function sa(e){this.manager=void 0!==e?e:ia,this._parser=null}function ca(e){this.manager=void 0!==e?e:ia,this._parser=null}function ha(e){this.manager=void 0!==e?e:ia}function la(e){this.manager=void 0!==e?e:ia}function ua(e){this.manager=void 0!==e?e:ia}function pa(){this.type="Curve",this.arcLengthDivisions=200}function da(e,t,r,n,i,o,a,s){pa.call(this),this.type="EllipseCurve",this.aX=e||0,this.aY=t||0,this.xRadius=r||1,this.yRadius=n||1,this.aStartAngle=i||0,this.aEndAngle=o||2*Math.PI,this.aClockwise=a||!1,this.aRotation=s||0}function fa(e,t,r,n,i,o){da.call(this,e,t,r,r,n,i,o),this.type="ArcCurve"}function ma(){var e=0,t=0,r=0,n=0;function i(i,o,a,s){e=i,t=a,r=-3*i+3*o-2*a-s,n=2*i-2*o+a+s}return{initCatmullRom:function(e,t,r,n,o){i(t,r,o*(r-e),o*(n-t))},initNonuniformCatmullRom:function(e,t,r,n,o,a,s){var c=(t-e)/o-(r-e)/(o+a)+(r-t)/a,h=(r-t)/a-(n-t)/(a+s)+(n-r)/s;i(t,r,c*=a,h*=a)},calc:function(i){var o=i*i;return e+t*i+r*o+n*(o*i)}}}Object.assign(aa.prototype,{load:function(e,t,r,n){void 0===e&&(e=""),void 0!==this.path&&(e=this.path+e),e=this.manager.resolveURL(e);var i=this,o=ra.get(e);if(void 0!==o)return i.manager.itemStart(e),setTimeout(function(){t&&t(o),i.manager.itemEnd(e)},0),o;if(void 0===oa[e]){var a=e.match(/^data:(.*?)(;base64)?,(.*)$/);if(a){var s=a[1],c=!!a[2],h=a[3];h=window.decodeURIComponent(h),c&&(h=window.atob(h));try{var l,u=(this.responseType||"").toLowerCase();switch(u){case"arraybuffer":case"blob":for(var p=new Uint8Array(h.length),d=0;d0||0===e.search(/^data\:image\/jpeg/);i.format=n?ze:Ie,i.needsUpdate=!0,void 0!==t&&t(i)},r,n),i},setCrossOrigin:function(e){return this.crossOrigin=e,this},setPath:function(e){return this.path=e,this}}),Object.assign(pa.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(e,t){var r=this.getUtoTmapping(e);return this.getPoint(r,t)},getPoints:function(e){void 0===e&&(e=5);for(var t=[],r=0;r<=e;r++)t.push(this.getPoint(r/e));return t},getSpacedPoints:function(e){void 0===e&&(e=5);for(var t=[],r=0;r<=e;r++)t.push(this.getPointAt(r/e));return t},getLength:function(){var e=this.getLengths();return e[e.length-1]},getLengths:function(e){if(void 0===e&&(e=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var t,r,n=[],i=this.getPoint(0),o=0;for(n.push(0),r=1;r<=e;r++)o+=(t=this.getPoint(r/e)).distanceTo(i),n.push(o),i=t;return this.cacheArcLengths=n,n},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(e,t){var r,n=this.getLengths(),i=0,o=n.length;r=t||e*n[o-1];for(var a,s=0,c=o-1;s<=c;)if((a=n[i=Math.floor(s+(c-s)/2)]-r)<0)s=i+1;else{if(!(a>0)){c=i;break}c=i-1}if(n[i=c]===r)return i/(o-1);var h=n[i];return(i+(r-h)/(n[i+1]-h))/(o-1)},getTangent:function(e){var t=e-1e-4,r=e+1e-4;t<0&&(t=0),r>1&&(r=1);var n=this.getPoint(t);return this.getPoint(r).clone().sub(n).normalize()},getTangentAt:function(e){var t=this.getUtoTmapping(e);return this.getTangent(t)},computeFrenetFrames:function(e,t){var r,n,i,o=new Gt,a=[],s=[],c=[],h=new Gt,l=new Nt;for(r=0;r<=e;r++)n=r/e,a[r]=this.getTangentAt(n),a[r].normalize();s[0]=new Gt,c[0]=new Gt;var u=Number.MAX_VALUE,p=Math.abs(a[0].x),d=Math.abs(a[0].y),f=Math.abs(a[0].z);for(p<=u&&(u=p,o.set(1,0,0)),d<=u&&(u=d,o.set(0,1,0)),f<=u&&o.set(0,0,1),h.crossVectors(a[0],o).normalize(),s[0].crossVectors(a[0],h),c[0].crossVectors(a[0],s[0]),r=1;r<=e;r++)s[r]=s[r-1].clone(),c[r]=c[r-1].clone(),h.crossVectors(a[r-1],a[r]),h.length()>Number.EPSILON&&(h.normalize(),i=Math.acos(It.clamp(a[r-1].dot(a[r]),-1,1)),s[r].applyMatrix4(l.makeRotationAxis(h,i))),c[r].crossVectors(a[r],s[r]);if(!0===t)for(i=Math.acos(It.clamp(s[0].dot(s[e]),-1,1)),i/=e,a[0].dot(h.crossVectors(s[0],s[e]))>0&&(i=-i),r=1;r<=e;r++)s[r].applyMatrix4(l.makeRotationAxis(a[r],i*r)),c[r].crossVectors(a[r],s[r]);return{tangents:a,normals:s,binormals:c}},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this},toJSON:function(){var e={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e},fromJSON:function(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}),da.prototype=Object.create(pa.prototype),da.prototype.constructor=da,da.prototype.isEllipseCurve=!0,da.prototype.getPoint=function(e,t){for(var r=t||new Dt,n=2*Math.PI,i=this.aEndAngle-this.aStartAngle,o=Math.abs(i)n;)i-=n;i0?0:(Math.floor(Math.abs(l)/c)+1)*c:0===u&&l===c-1&&(l=c-2,u=1),this.closed||l>0?r=s[(l-1)%c]:(va.subVectors(s[0],s[1]).add(s[0]),r=va),n=s[l%c],i=s[(l+1)%c],this.closed||l+2n.length-2?n.length-1:o+1],l=n[o>n.length-3?n.length-1:o+2];return r.set(xa(a,s.x,c.x,h.x,l.x),xa(a,s.y,c.y,h.y,l.y)),r},La.prototype.copy=function(e){pa.prototype.copy.call(this,e),this.points=[];for(var t=0,r=e.points.length;t=t){var i=r[n]-t,o=this.curves[n],a=o.getLength(),s=0===a?0:1-i/a;return o.getPointAt(s)}n++}return null},getLength:function(){var e=this.getCurveLengths();return e[e.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 e=[],t=0,r=0,n=this.curves.length;r1&&!r[r.length-1].equals(r[0])&&r.push(r[0]),r},copy:function(e){pa.prototype.copy.call(this,e),this.curves=[];for(var t=0,r=e.curves.length;t0){var h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);var l=c.getPoint(1);this.currentPoint.copy(l)},copy:function(e){return Oa.prototype.copy.call(this,e),this.currentPoint.copy(e.currentPoint),this},toJSON:function(){var e=Oa.prototype.toJSON.call(this);return e.currentPoint=this.currentPoint.toArray(),e},fromJSON:function(e){return Oa.prototype.fromJSON.call(this,e),this.currentPoint.fromArray(e.currentPoint),this}}),ja.prototype=Object.assign(Object.create(Ba.prototype),{constructor:ja,getPointsHoles:function(e){for(var t=[],r=0,n=this.holes.length;r=i)break e;var s=t[1];e=(i=t[--r-1]))break t}o=r,r=0}for(;r>>1;et;)--o;if(++o,0!==i||o!==n){i>=o&&(i=(o=Math.max(o,1))-1);var a=this.getValueSize();this.times=qa.arraySlice(r,i,o),this.values=qa.arraySlice(this.values,i*a,o*a)}return this},validate:function(){var e=!0,t=this.getValueSize();t-Math.floor(t)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);var r=this.times,n=this.values,i=r.length;0===i&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);for(var o=null,a=0;a!==i;a++){var s=r[a];if("number"==typeof s&&isNaN(s)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,s),e=!1;break}if(null!==o&&o>s){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,s,o),e=!1;break}o=s}if(void 0!==n&&qa.isTypedArray(n)){a=0;for(var c=n.length;a!==c;++a){var h=n[a];if(isNaN(h)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,h),e=!1;break}}}return e},optimize:function(){for(var e=this.times,t=this.values,r=this.getValueSize(),n=this.getInterpolation()===bt,i=1,o=e.length-1,a=1;a0){e[i]=e[o];for(f=o*r,m=i*r,p=0;p!==r;++p)t[m+p]=t[f+p];++i}return i!==e.length&&(this.times=qa.arraySlice(e,0,i),this.values=qa.arraySlice(t,0,i*r)),this}}),Qa.prototype=Object.assign(Object.create(Ja.prototype),{constructor:Qa,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:yt,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),$a.prototype=Object.assign(Object.create(Ja.prototype),{constructor:$a,ValueTypeName:"color"}),es.prototype=Object.assign(Object.create(Ja.prototype),{constructor:es,ValueTypeName:"number"}),ts.prototype=Object.assign(Object.create(Xa.prototype),{constructor:ts,interpolate_:function(e,t,r,n){for(var i=this.resultBuffer,o=this.sampleValues,a=this.valueSize,s=e*a,c=(r-t)/(n-t),h=s+a;s!==h;s+=4)Ut.slerpFlat(i,0,o,s-a,o,s,c);return i}}),rs.prototype=Object.assign(Object.create(Ja.prototype),{constructor:rs,ValueTypeName:"quaternion",DefaultInterpolation:gt,InterpolantFactoryMethodLinear:function(e){return new ts(this.times,this.values,this.getValueSize(),e)},InterpolantFactoryMethodSmooth:void 0}),ns.prototype=Object.assign(Object.create(Ja.prototype),{constructor:ns,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:yt,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),is.prototype=Object.assign(Object.create(Ja.prototype),{constructor:is,ValueTypeName:"vector"}),Object.assign(os,{parse:function(e){for(var t=[],r=e.tracks,n=1/(e.fps||1),i=0,o=r.length;i!==o;++i)t.push(as(r[i]).scale(n));return new os(e.name,e.duration,t)},toJSON:function(e){for(var t=[],r=e.tracks,n={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid},i=0,o=r.length;i!==o;++i)t.push(Ja.toJSON(r[i]));return n},CreateFromMorphTargetSequence:function(e,t,r,n){for(var i=t.length,o=[],a=0;a1){var h=n[u=c[1]];h||(n[u]=h=[]),h.push(s)}}var l=[];for(var u in n)l.push(os.CreateFromMorphTargetSequence(u,n[u],t,r));return l},parseAnimation:function(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;for(var r=function(e,t,r,n,i){if(0!==r.length){var o=[],a=[];qa.flattenJSON(r,o,a,n),0!==o.length&&i.push(new e(t,o,a))}},n=[],i=e.name||"default",o=e.length||-1,a=e.fps||30,s=e.hierarchy||[],c=0;c1?e.skinWeights[n+1]:0,s=r>2?e.skinWeights[n+2]:0,c=r>3?e.skinWeights[n+3]:0;t.skinWeights.push(new Xt(o,a,s,c))}if(e.skinIndices)for(n=0,i=e.skinIndices.length;n1?e.skinIndices[n+1]:0,u=r>2?e.skinIndices[n+2]:0,p=r>3?e.skinIndices[n+3]:0;t.skinIndices.push(new Xt(h,l,u,p))}t.bones=e.bones,t.bones&&t.bones.length>0&&(t.skinWeights.length!==t.skinIndices.length||t.skinIndices.length!==t.vertices.length)&&console.warn("When skinning, number of vertices ("+t.vertices.length+"), skinIndices ("+t.skinIndices.length+"), and skinWeights ("+t.skinWeights.length+") should match.")}(e,r),function(e,t){var r=e.scale;if(void 0!==e.morphTargets)for(var n=0,i=e.morphTargets.length;n0){console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');var l=t.faces,u=e.morphColors[0].colors;for(n=0,i=l.length;n0&&(t.animations=r)}(e,r),r.computeFaceNormals(),r.computeBoundingSphere(),void 0===e.materials||0===e.materials.length?{geometry:r}:{geometry:r,materials:ls.prototype.initMaterials(e.materials,this.resourcePath||t,this.crossOrigin)}}}()}),Object.assign(ds.prototype,{crossOrigin:"anonymous",load:function(e,t,r,n){""===this.texturePath&&(this.texturePath=e.substring(0,e.lastIndexOf("/")+1));var i=this;new aa(i.manager).load(e,function(r){var o=null;try{o=JSON.parse(r)}catch(t){return void 0!==n&&n(t),void console.error("THREE:ObjectLoader: Can't parse "+e+".",t.message)}var a=o.metadata;void 0!==a&&void 0!==a.type&&"geometry"!==a.type.toLowerCase()?i.parse(o,t):console.error("THREE.ObjectLoader: Can't load "+e+". Use THREE.JSONLoader instead.")},r,n)},setTexturePath:function(e){return this.texturePath=e,this},setCrossOrigin:function(e){return this.crossOrigin=e,this},parse:function(e,t){var r=this.parseShape(e.shapes),n=this.parseGeometries(e.geometries,r),i=this.parseImages(e.images,function(){void 0!==t&&t(s)}),o=this.parseTextures(e.textures,i),a=this.parseMaterials(e.materials,o),s=this.parseObject(e.object,n,a);return e.animations&&(s.animations=this.parseAnimations(e.animations)),void 0!==e.images&&0!==e.images.length||void 0!==t&&t(s),s},parseShape:function(e){var t={};if(void 0!==e)for(var r=0,n=e.length;r0){var o=new ha(new na(t));o.setCrossOrigin(this.crossOrigin);for(var a=0,s=e.length;a0?new _i(a,s):new Nr(a,s);break;case"LOD":n=new yi;break;case"Line":n=new wi(i(e.geometry),o(e.material),e.mode);break;case"LineLoop":n=new Ti(i(e.geometry),o(e.material));break;case"LineSegments":n=new Mi(i(e.geometry),o(e.material));break;case"PointCloud":case"Points":n=new Ei(i(e.geometry),o(e.material));break;case"Sprite":n=new vi(o(e.material));break;case"Group":n=new ii;break;default:n=new dr}if(n.uuid=e.uuid,void 0!==e.name&&(n.name=e.name),void 0!==e.matrix?(n.matrix.fromArray(e.matrix),void 0!==e.matrixAutoUpdate&&(n.matrixAutoUpdate=e.matrixAutoUpdate),n.matrixAutoUpdate&&n.matrix.decompose(n.position,n.quaternion,n.scale)):(void 0!==e.position&&n.position.fromArray(e.position),void 0!==e.rotation&&n.rotation.fromArray(e.rotation),void 0!==e.quaternion&&n.quaternion.fromArray(e.quaternion),void 0!==e.scale&&n.scale.fromArray(e.scale)),void 0!==e.castShadow&&(n.castShadow=e.castShadow),void 0!==e.receiveShadow&&(n.receiveShadow=e.receiveShadow),e.shadow&&(void 0!==e.shadow.bias&&(n.shadow.bias=e.shadow.bias),void 0!==e.shadow.radius&&(n.shadow.radius=e.shadow.radius),void 0!==e.shadow.mapSize&&n.shadow.mapSize.fromArray(e.shadow.mapSize),void 0!==e.shadow.camera&&(n.shadow.camera=this.parseObject(e.shadow.camera))),void 0!==e.visible&&(n.visible=e.visible),void 0!==e.frustumCulled&&(n.frustumCulled=e.frustumCulled),void 0!==e.renderOrder&&(n.renderOrder=e.renderOrder),void 0!==e.userData&&(n.userData=e.userData),void 0!==e.layers&&(n.layers.mask=e.layers),void 0!==e.children)for(var c=e.children,h=0;hNumber.EPSILON){if(h<0&&(a=t[o],c=-c,s=t[i],h=-h),e.ys.y)continue;if(e.y===a.y){if(e.x===a.x)return!0}else{var l=h*(e.x-a.x)-c*(e.y-a.y);if(0===l)return!0;if(l<0)continue;n=!n}}else{if(e.y!==a.y)continue;if(s.x<=e.x&&e.x<=a.x||a.x<=e.x&&e.x<=s.x)return!0}}return n}var i=bo.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===t)return r(o);var a,s,c,h=[];if(1===o.length)return s=o[0],(c=new ja).curves=s.curves,h.push(c),h;var l=!i(o[0].getPoints());l=e?!l:l;var u,p,d=[],f=[],m=[],v=0;f[v]=void 0,m[v]=[];for(var y=0,g=o.length;y1){for(var b=!1,_=[],x=0,w=f.length;x0&&(b||(m=d))}y=0;for(var P=f.length;y0){this.source.connect(this.filters[0]);for(var e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(var e=1,t=this.filters.length;e=.5)for(var o=0;o!==i;++o)e[t+o]=e[r+o]},_slerp:function(e,t,r,n){Ut.slerpFlat(e,t,e,t,e,r,n)},_lerp:function(e,t,r,n,i){for(var o=1-n,a=0;a!==i;++a){var s=t+a;e[s]=e[s]*o+e[r+a]*n}}});var Os,Bs;function js(e,t,r){var n=r||ks.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,n)}function ks(e,t,r){this.path=t,this.parsedPath=r||ks.parseTrackName(t),this.node=ks.findNode(e,this.parsedPath.nodeName)||e,this.rootNode=e}function Fs(){this.uuid=It.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;var e={};this._indicesByUUID=e;for(var t=0,r=arguments.length;t!==r;++t)e[arguments[t].uuid]=t;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 zs(e,t,r){this._mixer=e,this._clip=t,this._localRoot=r||null;for(var n=t.tracks,i=n.length,o=new Array(i),a={endingStart:_t,endingEnd:_t},s=0;s!==i;++s){var c=n[s].createInterpolant(null);o[s]=c,c.settings=a}this._interpolantSettings=a,this._interpolants=o,this._propertyBindings=new Array(i),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=mt,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 Is(e){this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function Ds(e){"string"==typeof e&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),e=arguments[1]),this.value=e}function Ns(){Cr.call(this),this.type="InstancedBufferGeometry",this.maxInstancedCount=void 0}function Us(e,t,r){di.call(this,e,t),this.meshPerAttribute=r||1}function Gs(e,t,r,n){"number"==typeof r&&(n=r,r=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),vr.call(this,e,t,r),this.meshPerAttribute=n||1}function Hs(e,t,r,n){this.ray=new zr(e,t),this.near=r||0,this.far=n||1/0,this.params={Mesh:{},Line:{},LOD:{},Points:{threshold:1},Sprite:{}},Object.defineProperties(this.params,{PointCloud:{get:function(){return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),this.Points}}})}function Vs(e,t){return e.distance-t.distance}function Ws(e,t,r,n){if(!1!==e.visible&&(e.raycast(t,r),!0===n))for(var i=e.children,o=0,a=i.length;o=t){var l=t++,u=e[l];r[u.uuid]=h,e[h]=u,r[c]=l,e[l]=s;for(var p=0,d=i;p!==d;++p){var f=n[p],m=f[l],v=f[h];f[h]=m,f[l]=v}}}this.nCachedObjects_=t},uncache:function(){for(var e=this._objects,t=e.length,r=this.nCachedObjects_,n=this._indicesByUUID,i=this._bindings,o=i.length,a=0,s=arguments.length;a!==s;++a){var c=arguments[a].uuid,h=n[c];if(void 0!==h)if(delete n[c],h0)for(var c=this._interpolants,h=this._propertyBindings,l=0,u=c.length;l!==u;++l)c[l].evaluate(a),h[l].accumulate(n,s)}else this._updateWeight(e)},_updateWeight:function(e){var t=0;if(this.enabled){t=this.weight;var r=this._weightInterpolant;if(null!==r){var n=r.evaluate(e)[0];t*=n,e>r.parameterPositions[1]&&(this.stopFading(),0===n&&(this.enabled=!1))}}return this._effectiveWeight=t,t},_updateTimeScale:function(e){var t=0;if(!this.paused){t=this.timeScale;var r=this._timeScaleInterpolant;if(null!==r)t*=r.evaluate(e)[0],e>r.parameterPositions[1]&&(this.stopWarping(),0===t?this.paused=!0:this.timeScale=t)}return this._effectiveTimeScale=t,t},_updateTime:function(e){var t=this.time+e,r=this._clip.duration,n=this.loop,i=this._loopCount,o=n===vt;if(0===e)return-1===i?t:o&&1==(1&i)?r-t:t;if(n===ft){-1===i&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(t>=r)t=r;else{if(!(t<0))break e;t=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(-1===i&&(e>=0?(i=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),t>=r||t<0){var a=Math.floor(t/r);t-=r*a,i+=Math.abs(a);var s=this.repetitions-i;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,t=e>0?r:0,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(1===s){var c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}if(o&&1==(1&i))return this.time=t,r-t}return this.time=t,t},_setEndings:function(e,t,r){var n=this._interpolantSettings;r?(n.endingStart=xt,n.endingEnd=xt):(n.endingStart=e?this.zeroSlopeAtStart?xt:_t:wt,n.endingEnd=t?this.zeroSlopeAtEnd?xt:_t:wt)},_scheduleFading:function(e,t,r){var n=this._mixer,i=n.time,o=this._weightInterpolant;null===o&&(o=n._lendControlInterpolant(),this._weightInterpolant=o);var a=o.parameterPositions,s=o.sampleValues;return a[0]=i,s[0]=t,a[1]=i+e,s[1]=r,this}}),Is.prototype=Object.assign(Object.create(n.prototype),{constructor:Is,_bindAction:function(e,t){var r=e._localRoot||this._root,n=e._clip.tracks,i=n.length,o=e._propertyBindings,a=e._interpolants,s=r.uuid,c=this._bindingsByRootAndName,h=c[s];void 0===h&&(h={},c[s]=h);for(var l=0;l!==i;++l){var u=n[l],p=u.name,d=h[p];if(void 0!==d)o[l]=d;else{if(void 0!==(d=o[l])){null===d._cacheIndex&&(++d.referenceCount,this._addInactiveBinding(d,s,p));continue}var f=t&&t._propertyBindings[l].binding.parsedPath;++(d=new Rs(ks.create(r,p,f),u.ValueTypeName,u.getValueSize())).referenceCount,this._addInactiveBinding(d,s,p),o[l]=d}a[l].resultBuffer=d.buffer}},_activateAction:function(e){if(!this._isActiveAction(e)){if(null===e._cacheIndex){var t=(e._localRoot||this._root).uuid,r=e._clip.uuid,n=this._actionsByClip[r];this._bindAction(e,n&&n.knownActions[0]),this._addInactiveAction(e,r,t)}for(var i=e._propertyBindings,o=0,a=i.length;o!==a;++o){var s=i[o];0==s.useCount++&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}},_deactivateAction:function(e){if(this._isActiveAction(e)){for(var t=e._propertyBindings,r=0,n=t.length;r!==n;++r){var i=t[r];0==--i.useCount&&(i.restoreOriginalState(),this._takeBackBinding(i))}this._takeBackAction(e)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;var e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}},_isActiveAction:function(e){var t=e._cacheIndex;return null!==t&&tthis.max.x||e.ythis.max.y)},containsBox:function(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y},getParameter:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .getParameter() target is now required"),t=new Dt),t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)},clampPoint:function(e,t){return void 0===t&&(console.warn("THREE.Box2: .clampPoint() target is now required"),t=new Dt),t.copy(e).clamp(this.min,this.max)},distanceToPoint:function(){var e=new Dt;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),intersect:function(e){return this.min.max(e.min),this.max.min(e.max),this},union:function(e){return this.min.min(e.min),this.max.max(e.max),this},translate:function(e){return this.min.add(e),this.max.add(e),this},equals:function(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}),Object.assign(Zs.prototype,{set:function(e,t){return this.start.copy(e),this.end.copy(t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(e){return this.start.copy(e.start),this.end.copy(e.end),this},getCenter:function(e){return void 0===e&&(console.warn("THREE.Line3: .getCenter() target is now required"),e=new Gt),e.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(e){return void 0===e&&(console.warn("THREE.Line3: .delta() target is now required"),e=new Gt),e.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(e,t){return void 0===t&&(console.warn("THREE.Line3: .at() target is now required"),t=new Gt),this.delta(t).multiplyScalar(e).add(this.start)},closestPointToPointParameter:function(){var e=new Gt,t=new Gt;return function(r,n){e.subVectors(r,this.start),t.subVectors(this.end,this.start);var i=t.dot(t),o=t.dot(e)/i;return n&&(o=It.clamp(o,0,1)),o}}(),closestPointToPoint:function(e,t,r){var n=this.closestPointToPointParameter(e,t);return void 0===r&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),r=new Gt),this.delta(r).multiplyScalar(n).add(this.start)},applyMatrix4:function(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this},equals:function(e){return e.start.equals(this.start)&&e.end.equals(this.end)}}),Js.prototype=Object.create(dr.prototype),Js.prototype.constructor=Js,Js.prototype.isImmediateRenderObject=!0,Qs.prototype=Object.create(Mi.prototype),Qs.prototype.constructor=Qs,Qs.prototype.update=function(){var e=new Gt,t=new Gt,r=new Ht;return function(){var n=["a","b","c"];this.object.updateMatrixWorld(!0),r.getNormalMatrix(this.object.matrixWorld);var i=this.object.matrixWorld,o=this.geometry.attributes.position,a=this.object.geometry;if(a&&a.isGeometry)for(var s=a.vertices,c=a.faces,h=0,l=0,u=c.length;l.99999?this.quaternion.set(0,0,0,1):r.y<-.99999?this.quaternion.set(1,0,0,0):(t.set(r.z,0,-r.x).normalize(),e=Math.acos(r.y),this.quaternion.setFromAxisAngle(t,e))}}(),pc.prototype.setLength=function(e,t,r){void 0===t&&(t=.2*e),void 0===r&&(r=.2*t),this.line.scale.set(1,Math.max(0,e-t),1),this.line.updateMatrix(),this.cone.scale.set(r,t,r),this.cone.position.y=e,this.cone.updateMatrix()},pc.prototype.setColor=function(e){this.line.material.color.copy(e),this.cone.material.color.copy(e)},dc.prototype=Object.create(Mi.prototype),dc.prototype.constructor=dc;var mc=0,vc=1;function yc(e){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),e}function gc(e){return void 0===e&&(e=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),e.isMultiMaterial=!0,e.materials=e,e.clone=function(){return e.slice()},e}function bc(e,t){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new Ei(e,t)}function _c(e){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new vi(e)}function xc(e,t){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new Ei(e,t)}function wc(e){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new Si(e)}function Mc(e){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new Si(e)}function Tc(e){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new Si(e)}function Sc(e,t,r){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new Gt(e,t,r)}function Ec(e,t){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),new vr(e,t).setDynamic(!0)}function Ac(e,t){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new yr(e,t)}function Pc(e,t){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new gr(e,t)}function Cc(e,t){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new br(e,t)}function Lc(e,t){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new _r(e,t)}function Rc(e,t){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new xr(e,t)}function Oc(e,t){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new wr(e,t)}function Bc(e,t){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Mr(e,t)}function jc(e,t){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Tr(e,t)}function kc(e,t){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Sr(e,t)}function Fc(e){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),_a.call(this,e),this.type="catmullrom",this.closed=!0}function zc(e){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),_a.call(this,e),this.type="catmullrom"}function Ic(e){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),_a.call(this,e),this.type="catmullrom"}function Dc(e){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new dc(e)}function Nc(e,t){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new hc(e,t)}function Uc(e,t){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new Mi(new zo(e.geometry),new xi({color:void 0!==t?t:16777215}))}function Gc(e,t){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new Mi(new Ri(e.geometry),new xi({color:void 0!==t?t:16777215}))}function Hc(e){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new aa(e)}function Vc(e){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new ca(e)}pa.create=function(e,t){return console.log("THREE.Curve.create() has been deprecated"),e.prototype=Object.create(pa.prototype),e.prototype.constructor=e,e.prototype.getPoint=t,e},Object.assign(Oa.prototype,{createPointsGeometry:function(e){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getPoints(e);return this.createGeometry(t)},createSpacedPointsGeometry:function(e){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");var t=this.getSpacedPoints(e);return this.createGeometry(t)},createGeometry:function(e){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");for(var t=new mr,r=0,n=e.length;r=0&&t<=S};y.each=y.forEach=function(e,t,r){var n,i;if(t=b(t,r),A(e))for(n=0,i=e.length;n=3;return function(t,r,n,i){var o=!A(t)&&y.keys(t),a=(o||t).length,s=e>0?0:a-1;for(i||(n=t[o?o[s]:s],s+=e);s>=0&&s=0},y.invoke=x(function(e,t,r){var n,i;return y.isFunction(t)?i=t:y.isArray(t)&&(n=t.slice(0,-1),t=t[t.length-1]),y.map(e,function(e){var o=i;if(!o){if(n&&n.length&&(e=T(e,n)),null==e)return;o=e[t]}return null==o?o:o.apply(e,r)})}),y.pluck=function(e,t){return y.map(e,y.property(t))},y.where=function(e,t){return y.filter(e,y.matcher(t))},y.findWhere=function(e,t){return y.find(e,y.matcher(t))},y.max=function(e,t,r){var n,i,o=-1/0,a=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,c=(e=A(e)?e:y.values(e)).length;so&&(o=n);else t=_(t,r),y.each(e,function(e,r,n){((i=t(e,r,n))>a||i===-1/0&&o===-1/0)&&(o=e,a=i)});return o},y.min=function(e,t,r){var n,i,o=1/0,a=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,c=(e=A(e)?e:y.values(e)).length;sn||void 0===r)return 1;if(r0?0:i-1;o>=0&&o0?a=o>=0?o:Math.max(o+s,a):s=o>=0?Math.min(o+1,s):o+s+1;else if(r&&o&&s)return n[o=r(n,i)]===i?o:-1;if(i!=i)return(o=t(l.call(n,a,s),y.isNaN))>=0?o+a:-1;for(o=e>0?a:s-1;o>=0&&ot?(n&&(clearTimeout(n),n=null),s=h,a=e.apply(i,o),n||(i=o=null)):n||!1===r.trailing||(n=setTimeout(c,l)),a};return h.cancel=function(){clearTimeout(n),s=0,n=i=o=null},h},y.debounce=function(e,t,r){var n,i,o=function(t,r){n=null,r&&(i=e.apply(t,r))},a=x(function(a){if(n&&clearTimeout(n),r){var s=!n;n=setTimeout(o,t),s&&(i=e.apply(this,a))}else n=y.delay(o,t,this,a);return i});return a.cancel=function(){clearTimeout(n),n=null},a},y.wrap=function(e,t){return y.partial(t,e)},y.negate=function(e){return function(){return!e.apply(this,arguments)}},y.compose=function(){var e=arguments,t=e.length-1;return function(){for(var r=t,n=e[t].apply(this,arguments);r--;)n=e[r].call(this,n);return n}},y.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}},y.before=function(e,t){var r;return function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=null),r}},y.once=y.partial(y.before,2),y.restArguments=x;var k=!{toString:null}.propertyIsEnumerable("toString"),F=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],z=function(e,t){var r=F.length,n=e.constructor,i=y.isFunction(n)&&n.prototype||s,o="constructor";for(y.has(e,o)&&!y.contains(t,o)&&t.push(o);r--;)(o=F[r])in e&&e[o]!==i[o]&&!y.contains(t,o)&&t.push(o)};y.keys=function(e){if(!y.isObject(e))return[];if(f)return f(e);var t=[];for(var r in e)y.has(e,r)&&t.push(r);return k&&z(e,t),t},y.allKeys=function(e){if(!y.isObject(e))return[];var t=[];for(var r in e)t.push(r);return k&&z(e,t),t},y.values=function(e){for(var t=y.keys(e),r=t.length,n=Array(r),i=0;i1&&(n=b(n,t[1])),t=y.allKeys(e)):(n=U,t=R(t,!1,!1),e=Object(e));for(var i=0,o=t.length;i1&&(r=t[1])):(t=y.map(R(t,!1,!1),String),n=function(e,r){return!y.contains(t,r)}),y.pick(e,n,r)}),y.defaults=I(y.allKeys,!0),y.create=function(e,t){var r=w(e);return t&&y.extendOwn(r,t),r},y.clone=function(e){return y.isObject(e)?y.isArray(e)?e.slice():y.extend({},e):e},y.tap=function(e,t){return t(e),e},y.isMatch=function(e,t){var r=y.keys(t),n=r.length;if(null==e)return!n;for(var i=Object(e),o=0;o":">",'"':""","'":"'","`":"`"},V=y.invert(H),W=function(e){var t=function(t){return e[t]},r="(?:"+y.keys(e).join("|")+")",n=RegExp(r),i=RegExp(r,"g");return function(e){return e=null==e?"":""+e,n.test(e)?e.replace(i,t):e}};y.escape=W(H),y.unescape=W(V),y.result=function(e,t,r){y.isArray(t)||(t=[t]);var n=t.length;if(!n)return y.isFunction(r)?r.call(e):r;for(var i=0;i/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var X=/(.)^/,Y={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},K=/\\|'|\r|\n|\u2028|\u2029/g,Z=function(e){return"\\"+Y[e]};y.template=function(e,t,r){!t&&r&&(t=r),t=y.defaults({},t,y.templateSettings);var n,i=RegExp([(t.escape||X).source,(t.interpolate||X).source,(t.evaluate||X).source].join("|")+"|$","g"),o=0,a="__p+='";e.replace(i,function(t,r,n,i,s){return a+=e.slice(o,s).replace(K,Z),o=s+t.length,r?a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?a+="'+\n((__t=("+n+"))==null?'':__t)+\n'":i&&(a+="';\n"+i+"\n__p+='"),t}),a+="';\n",t.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{n=new Function(t.variable||"obj","_",a)}catch(e){throw e.source=a,e}var s=function(e){return n.call(this,e,y)},c=t.variable||"obj";return s.source="function("+c+"){\n"+a+"}",s},y.chain=function(e){var t=y(e);return t._chain=!0,t};var J=function(e,t){return e._chain?y(t).chain():t};y.mixin=function(e){return y.each(y.functions(e),function(t){var r=y[t]=e[t];y.prototype[t]=function(){var e=[this._wrapped];return h.apply(e,arguments),J(this,r.apply(y,e))}}),y},y.mixin(y),y.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=a[e];y.prototype[e]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==e&&"splice"!==e||0!==r.length||delete r[0],J(this,r)}}),y.each(["concat","join","slice"],function(e){var t=a[e];y.prototype[e]=function(){return J(this,t.apply(this._wrapped,arguments))}}),y.prototype.value=function(){return this._wrapped},y.prototype.valueOf=y.prototype.toJSON=y.prototype.value,y.prototype.toString=function(){return String(this._wrapped)},void 0===(n=function(){return y}.apply(t,[]))||(r.exports=n)}()}).call(this,r(17),r(45)(e))},function(e,t){e.exports=__WEBPACK_EXTERNAL_MODULE__2__},function(e,t,r){"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),n(r(89)),n(r(172)),n(r(173)),t.version=r(174).version},function(e,t,r){var n=r(11),i=r(0);function o(e,t){var i,a=r(91).resolvePromisesDict;return Array.isArray(e)?(i=[],e.forEach(function(e){i.push(o(e,t))}),n.all(i)):e instanceof Object?(i={},Object.keys(e).forEach(function(r){i[r]=o(e[r],t)}),a(i)):"string"==typeof e&&"IPY_MODEL_"===e.slice(0,10)?t.get_model(e.slice(10,e.length)).then(function(e){return e.initPromise.then(function(){return e.obj})}):n.resolve(e)}e.exports={serializeUniforms:function(e){var t={};for(var r in e){var n=e[r].value;null===n?t[r]={value:null}:n.isTexture?t[r]={type:"t",value:n.ipymodelId}:n.isColor?t[r]={type:"c",value:"#"+n.getHexString()}:n.isVector2?t[r]={type:"v2",value:n.toArray()}:n.isVector3?t[r]={type:"v3",value:n.toArray()}:n.isVector4?t[r]={type:"v4",value:n.toArray()}:n.isMatrix3?t[r]={type:"m3",value:n.toArray()}:n.isMatrix4?t[r]={type:"m4",value:n.toArray()}:t[r]={value:n}}return t},deserializeUniforms:function(e,t){var r={},a=[];for(var s in e){var c=e[s],h=c.value;switch(c.type){case"t":a.push(o(h,t).then(function(e){r[s]={value:e}}));break;case"c":r[s]={value:(new i.Color).set(c.value)};break;case"v2":r[s]={value:(new i.Vector2).fromArray(c.value)};break;case"v3":r[s]={value:(new i.Vector3).fromArray(c.value)};break;case"v4":r[s]={value:(new i.Vector4).fromArray(c.value)};break;case"m3":r[s]={value:(new i.Matrix3).fromArray(c.value)};break;case"m4":r[s]={value:(new i.Matrix4).fromArray(c.value)};break;default:r[s]={value:c.value}}}return n.all(a).then(function(){return r})},unpackThreeModel:function e(t,i){var o,a=r(91).resolvePromisesDict;return Array.isArray(t)?(o=[],t.forEach(function(t){o.push(e(t,i))}),n.all(o)):t instanceof Object?(o={},Object.keys(t).forEach(function(r){o[r]=e(t[r],i)}),a(o)):"string"==typeof t&&"IPY_MODEL_"===t.slice(0,10)?i.get_model(t.slice(10,t.length)).then(function(e){return e.initPromise.then(function(){return e})}):n.resolve(t)},unpackThreeObj:o}},function(module,exports,__webpack_require__){var _=__webpack_require__(1),widgets=__webpack_require__(2),Promise=__webpack_require__(11),ndarray=__webpack_require__(25),dataserializers=__webpack_require__(3),THREE=__webpack_require__(0),Enums=__webpack_require__(90),utils=__webpack_require__(21),EXTENSION_SPEC_VERSION=__webpack_require__(61).EXTENSION_SPEC_VERSION;function listenNested(e,t,r){t.forEach(function(t){var n=e.get(t)||[];n instanceof ThreeModel?(e.listenTo(n,"change",r),e.listenTo(n,"childchange",r)):utils.childModelsNested(n).forEach(function(t){e.listenTo(t,"change",r),e.listenTo(t,"childchange",r)}),e.on("change:"+t,function(e,n){var i=e.previous(t)||[],o=n||[];if(i instanceof ThreeModel&&e.stopListening(i),o instanceof ThreeModel&&(e.listenTo(o,"change",r),e.listenTo(o,"childchange",r)),!(i instanceof ThreeModel&&o instanceof ThreeModel))if(i instanceof ThreeModel)utils.childModelsNested(o).forEach(function(t){e.listenTo(t,"change",r),e.listenTo(t,"childchange",r)});else if(o instanceof ThreeModel)utils.childModelsNested(i).forEach(function(t){e.stopListening(t)});else{var a=utils.nestedDiff(o,i);a.added.forEach(function(t){e.listenTo(t,"change",r),e.listenTo(t,"childchange",r)}),a.removed.forEach(function(t){e.stopListening(t)})}})})}var ThreeModel=widgets.WidgetModel.extend({defaults:function(){return _.extend(widgets.WidgetModel.prototype.defaults.call(this),{_model_name:this.constructor.model_name,_model_module:this.constructor.model_module,_model_module_version:this.constructor.model_module_version})},initialize:function(e,t){if(widgets.WidgetModel.prototype.initialize.apply(this,arguments),this.createPropertiesArrays(),t.three_obj){this.save_changes();var r=t.three_obj;return delete t.three_obj,this.processNewObj(r),void(this.initPromise=this.createUninitializedChildren().bind(this).then(function(){this.syncToModel(!0),this.setupListeners()}))}this.initPromise=this.createThreeObjectAsync().bind(this).then(function(){return this.createUninitializedChildren()}).then(function(){this.syncToModel(),this.syncToThreeObj(!0),this.setupListeners()})},createPropertiesArrays:function(){this.three_properties=[],this.three_nested_properties=[],this.datawidget_properties=[],this.enum_property_types={},this.props_created_by_three={},this.property_converters={},this.property_assigners={},this.property_mappers={},this.initialized_from_three={}},setupListeners:function(){this.three_properties.forEach(function(e){var t=this.get(e);t&&(this.listenTo(t,"change",this.onChildChanged.bind(this)),this.listenTo(t,"childchange",this.onChildChanged.bind(this))),this.on("change:"+e,function(t,r){var n=this.previous(e),i=r;n&&this.stopListening(n),i&&(this.listenTo(i,"change",this.onChildChanged.bind(this)),this.listenTo(i,"childchange",this.onChildChanged.bind(this)))},this)},this),listenNested(this,this.three_nested_properties,this.onChildChanged.bind(this)),this.datawidget_properties.forEach(function(e){dataserializers.listenToUnion(this,e,this.onChildChanged.bind(this),!1)},this),this.on("change",this.onChange,this),this.on("msg:custom",this.onCustomMessage,this)},processNewObj:function(e){return e.ipymodelId=this.model_id,e.ipymodel=this,this.obj=e,e},createUninitializedChildren:function(){var e=_.filter(this.three_properties,function(e){return"uninitialized"===this.get(e)},this);return Promise.all(_.map(e,function(e){this.initialized_from_three[e]=!0;var t=this.obj[e],r=utils.lookupThreeConstructorName(t)+"Model",n=__webpack_require__(60)[r];return utils.createModel(n,this.widget_manager,t)},this))},createThreeObjectAsync:function(){var e;if(this.constructThreeObjectAsync)e=this.constructThreeObjectAsync();else{if(!this.constructThreeObject)throw new Error("no THREE construct method exists: this.createThreeObjectAsync");e=Promise.resolve(this.constructThreeObject())}return e.bind(this).then(this.processNewObj)},constructThreeObject:function(){},onCustomMessage:function(e,t){switch(e.type){case"exec_three_obj_method":this.onExecThreeObjMethod(e.method_name,e.args,e.buffers);break;case"freeze":break;case"print":console.log("SERVER: "+JSON.stringify(e.msg));break;default:console.error("ERROR: invalid custom message",e)}},onExecThreeObjMethod:function(e,t,r){if(console.debug("execThreeObjMethod: "+e+"("+t.map(JSON.stringify).join(",")+")"),!(e in this.obj))throw new Error("Invalid methodName: "+e);return t=t.map(function(e){return Array.isArray(e)?2===e.length?(new THREE.Vector2).fromArray(e):3===e.length?(new THREE.Vector3).fromArray(e):4===e.length?(new THREE.Vector4).fromArray(e):9===e.length?(new THREE.Matrix3).fromArray(e):16===e.length?(new THREE.Matrix4).fromArray(e):e:"string"==typeof e&&/IPY_MODEL_/.test(e)?(e=e.replace("IPY_MODEL_",""),this.widget_manager.get_model(e).then(function(e){return e.obj})):e},this),Promise.all(t).bind(this).then(function(t){var r=this.obj[e].apply(this.obj,t);this.syncToModel(!0),null!==r&&void 0!==r&&(r.ipymodel&&(r=r.ipymodel),console.debug("sending return value to server..."),this.send({type:"exec_three_obj_method_retval",method_name:e,ret_val:r},this.callbacks(),null))})},onChange:function(e,t){"pushFromThree"!==t&&(this.syncToThreeObj(),this.syncToModel())},onChildChanged:function(e){console.debug("child changed: "+e.model_id),this.trigger("childchange",this)},syncToThreeObj:function(e){_.each(this.property_converters,function(t,r){if(e||this.hasChanged(r)){var n=this[this.property_assigners[r]]||this.assignDirect;if(n=n.bind(this),t){var i=this[t+="ModelToThree"];if(!i)throw new Error("invalid converter name: "+t);n(this.obj,r,i.bind(this)(this.get(r),r))}else n(this.obj,r,this.get(r))}},this),_.each(this.property_mappers,function(e){if(!e)throw new Error("invalid mapper name: "+e);var t=this[e+="ModelToThree"];if(!t)throw new Error("invalid mapper name: "+e);t.bind(this)()},this)},syncToModel:function(e){e=null!==e&&e;var t={};_.each(this.property_converters,function(r,n){if(!(e||n in this.props_created_by_three)){if(!this.initialized_from_three[n])return;delete this.initialized_from_three[n]}if(r){var i=this[r+="ThreeToModel"];if(!i)throw new Error("invalid converter name: "+r);t[n]=i.bind(this)(this.obj[n],n)}else t[n]=this.obj[n]},this),t&&this.set(t,"pushFromThree"),_.each(this.property_mappers,function(e,t){if(!e)throw new Error("invalid mapper name: "+e);var r=this[e+="ThreeToModel"];if(!r)throw new Error("invalid mapper name: "+e);r.bind(this)(t)},this),this.save_changes()},assignDirect:function(e,t,r){e[t]=r},assignArray:function(e,t,r){var n=e[t];null!==n&&void 0!==n?n.splice.apply(n,[0,n.length].concat(r)):e[t]=r},convertFloatModelToThree:function(e){if("string"==typeof e||e instanceof String){if("inf"===(e=e.toLowerCase()))return 1/0;if("-inf"===e)return-1/0;if("nan"===e)return NaN}return e},convertFloatThreeToModel:function(e){return isFinite(e)?e:isNaN(e)?"nan":e===1/0?"inf":e===-1/0?"-inf":e},convertBoolModelToThree:function(e){return e},convertBoolThreeToModel:function(e){return null===e?null:!!e},convertEnumModelToThree:function(e){return null===e?null:THREE[e]},convertEnumThreeToModel:function(e,t){if(null===e)return null;var r=this.enum_property_types[t];return Enums[r][e]},convertVectorModelToThree:function(e){var t;switch(e.length){case 2:t=new THREE.Vector2;break;case 3:t=new THREE.Vector3;break;case 4:t=new THREE.Vector4;break;default:throw new Error("model vector has invalid length: "+e.length)}return t.fromArray(e),t},convertVectorThreeToModel:function(e){return e.toArray()},assignVector:function(e,t,r){e[t].copy(r)},convertEulerModelToThree:function(e){return(new THREE.Euler).fromArray(e)},convertEulerThreeToModel:function(e){return e.toArray()},assignEuler:function(e,t,r){e[t].copy(r)},convertVectorArrayModelToThree:function(e,t){return e.map(function(e){return this.convertVectorModelToThree(e,t)},this)},convertVectorArrayThreeToModel:function(e,t){return e.map(function(e){return this.convertVectorThreeToModel(e,t)},this)},convertColorArrayModelToThree:function(e,t){return e.map(function(e){return this.convertColorModelToThree(e,t)},this)},convertColorArrayThreeToModel:function(e,t){return e.map(function(e){return this.convertColorThreeToModel(e,t)},this)},convertFaceModelToThree:function(e){var t=e[3];void 0!==t&&null!==t&&(t=Array.isArray(t)&&t.length>0&&Array.isArray(t[0])?t.map(function(e){return this.convertVectorModelToThree(e)},this):this.convertVectorModelToThree(t));var r=e[4];return void 0!==r&&null!==r&&(r=Array.isArray(r)?r.map(function(e){return new THREE.Color(e)},this):new THREE.Color(r)),new THREE.Face3(e[0],e[1],e[2],t,r,e[5])},convertFaceThreeToModel:function(e){return[e.a,e.b,e.c,e.normal.toArray(),this.convertColorThreeToModel(e.color),e.materialIndex,this.convertVectorArrayThreeToModel(e.vertexNormals),this.convertColorArrayThreeToModel(e.vertexColors)]},convertFaceArrayModelToThree:function(e,t){return e.map(function(e){return this.convertFaceModelToThree(e,t)},this)},convertFaceArrayThreeToModel:function(e,t){return e.map(function(e){return this.convertFaceThreeToModel(e,t)},this)},convertMatrixModelToThree:function(e){var t;switch(e.length){case 9:t=new THREE.Matrix3;break;case 16:t=new THREE.Matrix4;break;default:throw new Error("model matrix has invalid length: "+e.length)}return t.fromArray(e),t},convertMatrixThreeToModel:function(e){return e.toArray()},assignMatrix:function(e,t,r){e[t].copy(r)},convertFunctionModelToThree:function(fnStr){var fn;return eval("fn = "+fnStr),fn},convertFunctionThreeToModelToThree:function(e){return e.toString()},convertThreeTypeModelToThree:function(e){return e?e.obj:null},convertThreeTypeThreeToModel:function(e){return e?e.ipymodel:e},assignDict:function(e,t,r){if(e[t]!==r){if(void 0===e[t]||null===e[t]){if(null===r||void 0===r)return;e[t]={}}Object.keys(e[t]).forEach(function(r){delete e[t][r]}),Object.assign(e[t],r)}},convertThreeTypeArrayModelToThree:function(e,t){return Array.isArray(e)?e.map(function(e){return this.convertThreeTypeModelToThree(e,t)},this):this.convertThreeTypeModelToThree(e,t)},convertThreeTypeArrayThreeToModel:function(e,t){return Array.isArray(e)?e.map(function(e){return this.convertThreeTypeThreeToModel(e,t)},this):this.convertThreeTypeThreeToModel(e,t)},convertThreeTypeDictModelToThree:function(e,t){return _.mapObject(e,function(e){return this.convertThreeTypeModelToThree(e,t)},this)},convertThreeTypeDictThreeToModel:function(e,t){return _.mapObject(e,function(e){return this.convertThreeTypeThreeToModel(e,t)},this)},convertMorphAttributesModelToThree:function(e,t){return _.mapObject(e,function(e){return e.map(function(e){return this.convertThreeTypeModelToThree(e,t)},this)},this)},convertMorphAttributesThreeToModel:function(e,t){return _.mapObject(e,function(e){return e.map(function(e){return this.convertThreeTypeThreeToModel(e,t)},this)},this)},convertArrayBufferModelToThree:function(e,t){var r=dataserializers.getArray(e);return r&&r.data},convertArrayBufferThreeToModel:function(e,t){if(null===e)return null;var r=this.get(t),n=dataserializers.getArray(r);return n&&n.data===e?r:ndarray(e)},convertColorModelToThree:function(e){return null===e?null:new THREE.Color(e)},convertColorThreeToModel:function(e){return null===e?null:"#"+e.getHexString()}},{model_module:"jupyter-threejs",model_name:"ThreeModel",model_module_version:EXTENSION_SPEC_VERSION});module.exports={ThreeModel:ThreeModel}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){var n=r(1),i=r(355).Object3DModel,o=i.extend({createPropertiesArrays:function(){i.prototype.createPropertiesArrays.call(this),this.property_assigners.children="assignChildren"},assignChildren:function(e,t,r){var i=e[t],o=n.difference(i,r),a=n.difference(r,i);o.length>0&&e.remove.apply(e,o),a.length>0&&e.add.apply(e,a)}});e.exports={Object3DModel:o}},function(e,t,r){var n=r(10),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4),r(5).ThreeModel),a=o.extend({defaults:function(){return n.extend(o.prototype.defaults.call(this),{name:"",type:"BaseGeometry"})},constructThreeObject:function(){var e=new i.BaseGeometry;return Promise.resolve(e)},createPropertiesArrays:function(){o.prototype.createPropertiesArrays.call(this),this.props_created_by_three.type=!0,this.property_converters.name=null,this.property_converters.type=null}},{model_name:"BaseGeometryModel",serializers:n.extend({},o.serializers)});e.exports={BaseGeometryModel:a}},function(e,t,r){"use strict";(function(e){ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +var n=r(92),i=r(180),o=r(94);function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function f(e,t){if(c.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return N(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(e).length;default:if(n)return N(e).length;t=(""+t).toLowerCase(),n=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t)return t&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){var o,a=1,s=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,r/=2}function h(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var l=-1;for(o=r;os&&(r=s-c),o=r;o>=0;o--){for(var u=!0,p=0;pi&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function T(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function S(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:h>223?3:h>191?2:1;if(i+u<=r)switch(u){case 1:h<128&&(l=h);break;case 2:128==(192&(o=e[i+1]))&&(c=(31&h)<<6|63&o)>127&&(l=c);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(c=(15&h)<<12|(63&o)<<6|63&a)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(c=(15&h)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&c<1114112&&(l=c)}null===l?(l=65533,u=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=u}return function(e){var t=e.length;if(t<=E)return String.fromCharCode.apply(String,e);var r="",n=0;for(;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,r);case"utf8":case"utf-8":return S(this,t,r);case"ascii":return A(this,t,r);case"latin1":case"binary":return P(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},c.prototype.compare=function(e,t,r,n,i){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var o=i-n,a=r-t,s=Math.min(o,a),h=this.slice(n,i),l=e.slice(t,r),u=0;ui)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return g(this,e,t,r);case"utf8":case"utf-8":return b(this,e,t,r);case"ascii":return _(this,e,t,r);case"latin1":case"binary":return x(this,e,t,r);case"base64":return w(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function A(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,r,n,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function B(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function j(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function k(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,o){return o||k(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function z(e,t,r,n,o){return o||k(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){var r,n=this.length;if(e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||R(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||O(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):B(this,e,t,!0),t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):B(this,e,t,!1),t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):j(this,e,t,!0),t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);O(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);O(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):B(this,e,t,!0),t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):B(this,e,t,!1),t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):j(this,e,t,!0),t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||O(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):j(this,e,t,!1),t+4},c.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return z(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return z(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=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),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function U(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(I,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(17))},function(e,t,r){(function(t,r,n){e.exports=function(){var e,i,o;return function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var c="function"==typeof _dereq_&&_dereq_;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var h=new Error("Cannot find module '"+a+"'");throw h.code="MODULE_NOT_FOUND",h}var l=r[a]={exports:{}};t[a][0].call(l.exports,function(e){var r=t[a][1][e];return i(r||e)},l,l.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof _dereq_&&_dereq_,a=0;a0;){var t=e.shift();if("function"==typeof t){var r=e.shift(),n=e.shift();t.call(r,n)}else t._settlePromises()}},c.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},c.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},c.prototype._reset=function(){this._isTickUsed=!1},r.exports=c,r.exports.firstLineError=i},{"./queue":26,"./schedule":29,"./util":36}],3:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){var i=!1,o=function(e,t){this._reject(t)},a=function(e,t){t.promiseRejectionQueued=!0,t.bindingPromise._then(o,o,null,this,e)},s=function(e,t){0==(50397184&this._bitField)&&this._resolveCallback(t.target)},c=function(e,t){t.promiseRejectionQueued||this._reject(e)};e.prototype.bind=function(o){i||(i=!0,e.prototype._propagateFrom=n.propagateFromFunction(),e.prototype._boundValue=n.boundValueFunction());var h=r(o),l=new e(t);l._propagateFrom(this,1);var u=this._target();if(l._setBoundTo(h),h instanceof e){var p={promiseRejectionQueued:!1,promise:l,target:u,bindingPromise:h};u._then(t,a,void 0,l,p),h._then(s,c,void 0,l,p),l._setOnCancel(h)}else l._resolveCallback(u);return l},e.prototype._setBoundTo=function(e){void 0!==e?(this._bitField=2097152|this._bitField,this._boundTo=e):this._bitField=-2097153&this._bitField},e.prototype._isBound=function(){return 2097152==(2097152&this._bitField)},e.bind=function(t,r){return e.resolve(r).bind(t)}}},{}],4:[function(e,t,r){"use strict";var n;"undefined"!=typeof Promise&&(n=Promise);var i=e("./promise")();i.noConflict=function(){try{Promise===i&&(Promise=n)}catch(e){}return i},t.exports=i},{"./promise":22}],5:[function(e,t,r){"use strict";var n=Object.create;if(n){var i=n(null),o=n(null);i[" size"]=o[" size"]=0}t.exports=function(t){var r=e("./util"),n=r.canEvaluate;function i(e){var n=this.pop(),i=function(e,n){var i;if(null!=e&&(i=e[n]),"function"!=typeof i){var o="Object "+r.classString(e)+" has no method '"+r.toString(n)+"'";throw new t.TypeError(o)}return i}(e,n);return i.apply(e,this)}function o(e){return e[this]}function a(e){var t=+this;return t<0&&(t=Math.max(0,t+e.length)),e[t]}r.isIdentifier,t.prototype.call=function(e){var t=[].slice.call(arguments,1);return t.push(e),this._then(i,void 0,void 0,t,void 0)},t.prototype.get=function(e){var t,r="number"==typeof e;if(r)t=a;else if(n){var i=(void 0)(e);t=null!==i?i:o}else t=o;return this._then(t,void 0,void 0,e,void 0)}}},{"./util":36}],6:[function(e,t,r){"use strict";t.exports=function(t,r,n,i){var o=e("./util"),a=o.tryCatch,s=o.errorObj,c=t._async;t.prototype.break=t.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var e=this,t=e;e._isCancellable();){if(!e._cancelBy(t)){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}var r=e._cancellationParent;if(null==r||!r._isCancellable()){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}e._isFollowing()&&e._followee().cancel(),e._setWillBeCancelled(),t=e,e=r}},t.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},t.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},t.prototype._cancelBy=function(e){return e===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},t.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},t.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},t.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},t.prototype._unsetOnCancel=function(){this._onCancelField=void 0},t.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},t.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},t.prototype._doInvokeOnCancel=function(e,t){if(o.isArray(e))for(var r=0;r=0)return r[e]}return e.prototype._promiseCreated=function(){},e.prototype._pushContext=function(){},e.prototype._popContext=function(){return null},e._peekContext=e.prototype._peekContext=function(){},n.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,r.push(this._trace))},n.prototype._popContext=function(){if(void 0!==this._trace){var e=r.pop(),t=e._promiseCreated;return e._promiseCreated=null,t}return null},n.CapturedTrace=null,n.create=function(){if(t)return new n},n.deactivateLongStackTraces=function(){},n.activateLongStackTraces=function(){var r=e.prototype._pushContext,o=e.prototype._popContext,a=e._peekContext,s=e.prototype._peekContext,c=e.prototype._promiseCreated;n.deactivateLongStackTraces=function(){e.prototype._pushContext=r,e.prototype._popContext=o,e._peekContext=a,e.prototype._peekContext=s,e.prototype._promiseCreated=c,t=!1},t=!0,e.prototype._pushContext=n.prototype._pushContext,e.prototype._popContext=n.prototype._popContext,e._peekContext=e.prototype._peekContext=i,e.prototype._promiseCreated=function(){var e=this._peekContext();e&&null==e._promiseCreated&&(e._promiseCreated=this)}},n}},{}],9:[function(e,r,n){"use strict";r.exports=function(r,n){var i,o,a,s=r._getDomain,c=r._async,h=e("./errors").Warning,l=e("./util"),u=l.canAttachTrace,p=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,d=/\((?:timers\.js):\d+:\d+\)/,f=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,m=null,v=null,y=!1,g=!(0==l.env("BLUEBIRD_DEBUG")),b=!(0==l.env("BLUEBIRD_WARNINGS")||!g&&!l.env("BLUEBIRD_WARNINGS")),_=!(0==l.env("BLUEBIRD_LONG_STACK_TRACES")||!g&&!l.env("BLUEBIRD_LONG_STACK_TRACES")),x=0!=l.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(b||!!l.env("BLUEBIRD_W_FORGOTTEN_RETURN"));r.prototype.suppressUnhandledRejections=function(){var e=this._target();e._bitField=-1048577&e._bitField|524288},r.prototype._ensurePossibleRejectionHandled=function(){if(0==(524288&this._bitField)){this._setRejectionIsUnhandled();var e=this;setTimeout(function(){e._notifyUnhandledRejection()},1)}},r.prototype._notifyUnhandledRejectionIsHandled=function(){H("rejectionHandled",i,void 0,this)},r.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},r.prototype._returnedNonUndefined=function(){return 0!=(268435456&this._bitField)},r.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var e=this._settledValue();this._setUnhandledRejectionIsNotified(),H("unhandledRejection",o,e,this)}},r.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},r.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-262145&this._bitField},r.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},r.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},r.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},r.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},r.prototype._warn=function(e,t,r){return D(e,t,r||this)},r.onPossiblyUnhandledRejection=function(e){var t=s();o="function"==typeof e?null===t?e:l.domainBind(t,e):void 0},r.onUnhandledRejectionHandled=function(e){var t=s();i="function"==typeof e?null===t?e:l.domainBind(t,e):void 0};var w=function(){};r.longStackTraces=function(){if(c.haveItemsQueued()&&!J.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!J.longStackTraces&&W()){var e=r.prototype._captureStackTrace,t=r.prototype._attachExtraTrace;J.longStackTraces=!0,w=function(){if(c.haveItemsQueued()&&!J.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");r.prototype._captureStackTrace=e,r.prototype._attachExtraTrace=t,n.deactivateLongStackTraces(),c.enableTrampoline(),J.longStackTraces=!1},r.prototype._captureStackTrace=z,r.prototype._attachExtraTrace=I,n.activateLongStackTraces(),c.disableTrampolineIfNecessary()}},r.hasLongStackTraces=function(){return J.longStackTraces&&W()};var M=function(){try{if("function"==typeof CustomEvent){var e=new CustomEvent("CustomEvent");return l.global.dispatchEvent(e),function(e,t){var r=new CustomEvent(e.toLowerCase(),{detail:t,cancelable:!0});return!l.global.dispatchEvent(r)}}if("function"==typeof Event){var e=new Event("CustomEvent");return l.global.dispatchEvent(e),function(e,t){var r=new Event(e.toLowerCase(),{cancelable:!0});return r.detail=t,!l.global.dispatchEvent(r)}}var e=document.createEvent("CustomEvent");return e.initCustomEvent("testingtheevent",!1,!0,{}),l.global.dispatchEvent(e),function(e,t){var r=document.createEvent("CustomEvent");return r.initCustomEvent(e.toLowerCase(),!1,!0,t),!l.global.dispatchEvent(r)}}catch(e){}return function(){return!1}}(),T=l.isNode?function(){return t.emit.apply(t,arguments)}:l.global?function(e){var t="on"+e.toLowerCase(),r=l.global[t];return!!r&&(r.apply(l.global,[].slice.call(arguments,1)),!0)}:function(){return!1};function S(e,t){return{promise:t}}var E={promiseCreated:S,promiseFulfilled:S,promiseRejected:S,promiseResolved:S,promiseCancelled:S,promiseChained:function(e,t,r){return{promise:t,child:r}},warning:function(e,t){return{warning:t}},unhandledRejection:function(e,t,r){return{reason:t,promise:r}},rejectionHandled:S},A=function(e){var t=!1;try{t=T.apply(null,arguments)}catch(e){c.throwLater(e),t=!0}var r=!1;try{r=M(e,E[e].apply(null,arguments))}catch(e){c.throwLater(e),r=!0}return r||t};function P(){return!1}function C(e,t,r){var n=this;try{e(t,r,function(e){if("function"!=typeof e)throw new TypeError("onCancel must be a function, got: "+l.toString(e));n._attachCancellationCallback(e)})}catch(e){return e}}function L(e){if(!this._isCancellable())return this;var t=this._onCancel();void 0!==t?l.isArray(t)?t.push(e):this._setOnCancel([t,e]):this._setOnCancel(e)}function R(){return this._onCancelField}function O(e){this._onCancelField=e}function B(){this._cancellationParent=void 0,this._onCancelField=void 0}function j(e,t){if(0!=(1&t)){this._cancellationParent=e;var r=e._branchesRemainingToCancel;void 0===r&&(r=0),e._branchesRemainingToCancel=r+1}0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)}r.config=function(e){if("longStackTraces"in(e=Object(e))&&(e.longStackTraces?r.longStackTraces():!e.longStackTraces&&r.hasLongStackTraces()&&w()),"warnings"in e){var t=e.warnings;J.warnings=!!t,x=J.warnings,l.isObject(t)&&"wForgottenReturn"in t&&(x=!!t.wForgottenReturn)}if("cancellation"in e&&e.cancellation&&!J.cancellation){if(c.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");r.prototype._clearCancellationData=B,r.prototype._propagateFrom=j,r.prototype._onCancel=R,r.prototype._setOnCancel=O,r.prototype._attachCancellationCallback=L,r.prototype._execute=C,k=j,J.cancellation=!0}return"monitoring"in e&&(e.monitoring&&!J.monitoring?(J.monitoring=!0,r.prototype._fireEvent=A):!e.monitoring&&J.monitoring&&(J.monitoring=!1,r.prototype._fireEvent=P)),r},r.prototype._fireEvent=P,r.prototype._execute=function(e,t,r){try{e(t,r)}catch(e){return e}},r.prototype._onCancel=function(){},r.prototype._setOnCancel=function(e){},r.prototype._attachCancellationCallback=function(e){},r.prototype._captureStackTrace=function(){},r.prototype._attachExtraTrace=function(){},r.prototype._clearCancellationData=function(){},r.prototype._propagateFrom=function(e,t){};var k=function(e,t){0!=(2&t)&&e._isBound()&&this._setBoundTo(e._boundTo)};function F(){var e=this._boundTo;return void 0!==e&&e instanceof r?e.isFulfilled()?e.value():void 0:e}function z(){this._trace=new K(this._peekContext())}function I(e,t){if(u(e)){var r=this._trace;if(void 0!==r&&t&&(r=r._parent),void 0!==r)r.attachExtraTrace(e);else if(!e.__stackCleaned__){var n=U(e);l.notEnumerableProp(e,"stack",n.message+"\n"+n.stack.join("\n")),l.notEnumerableProp(e,"__stackCleaned__",!0)}}}function D(e,t,n){if(J.warnings){var i,o=new h(e);if(t)n._attachExtraTrace(o);else if(J.longStackTraces&&(i=r._peekContext()))i.attachExtraTrace(o);else{var a=U(o);o.stack=a.message+"\n"+a.stack.join("\n")}A("warning",o)||G(o,"",!0)}}function N(e){for(var t=[],r=0;r0?function(e){for(var t=e.stack.replace(/\s+$/g,"").split("\n"),r=0;r0&&"SyntaxError"!=e.name&&(t=t.slice(r)),t}(e):[" (No stack trace)"],{message:r,stack:"SyntaxError"==e.name?t:N(t)}}function G(e,t,r){if("undefined"!=typeof console){var n;if(l.isObject(e)){var i=e.stack;n=t+v(i,e)}else n=t+String(e);"function"==typeof a?a(n,r):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(n)}}function H(e,t,r,n){var i=!1;try{"function"==typeof t&&(i=!0,"rejectionHandled"===e?t(n):t(r,n))}catch(e){c.throwLater(e)}"unhandledRejection"===e?A(e,r,n)||i||G(r,"Unhandled rejection "):A(e,n)}function V(e){var t;if("function"==typeof e)t="[function "+(e.name||"anonymous")+"]";else{if(t=e&&"function"==typeof e.toString?e.toString():l.toString(e),/\[object [a-zA-Z0-9$_]+\]/.test(t))try{var r=JSON.stringify(e);t=r}catch(e){}0===t.length&&(t="(empty array)")}return"(<"+function(e){return e.length<41?e:e.substr(0,38)+"..."}(t)+">, no stack trace)"}function W(){return"function"==typeof Z}var q=function(){return!1},X=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;function Y(e){var t=e.match(X);if(t)return{fileName:t[1],line:parseInt(t[2],10)}}function K(e){this._parent=e,this._promisesCreated=0;var t=this._length=1+(void 0===e?0:e._length);Z(this,K),t>32&&this.uncycle()}l.inherits(K,Error),n.CapturedTrace=K,K.prototype.uncycle=function(){var e=this._length;if(!(e<2)){for(var t=[],r={},n=0,i=this;void 0!==i;++n)t.push(i),i=i._parent;for(var n=(e=this._length=n)-1;n>=0;--n){var o=t[n].stack;void 0===r[o]&&(r[o]=n)}for(var n=0;n0&&(t[s-1]._parent=void 0,t[s-1]._length=1),t[n]._parent=void 0,t[n]._length=1;var c=n>0?t[n-1]:this;s=0;--l)t[l]._length=h,h++;return}}}},K.prototype.attachExtraTrace=function(e){if(!e.__stackCleaned__){this.uncycle();for(var t=U(e),r=t.message,n=[t.stack],i=this;void 0!==i;)n.push(N(i.stack.split("\n"))),i=i._parent;!function(e){for(var t=e[0],r=1;r=0;--s)if(n[s]===o){a=s;break}for(var s=a;s>=0;--s){var c=n[s];if(t[i]!==c)break;t.pop(),i--}t=n}}(n),function(e){for(var t=0;t=0)return m=/@/,v=t,y=!0,function(e){e.stack=(new Error).stack};try{throw new Error}catch(e){n="stack"in e}return"stack"in i||!n||"number"!=typeof Error.stackTraceLimit?(v=function(e,t){return"string"==typeof e?e:"object"!=typeof t&&"function"!=typeof t||void 0===t.name||void 0===t.message?V(t):t.toString()},null):(m=e,v=t,function(e){Error.stackTraceLimit+=6;try{throw new Error}catch(t){e.stack=t.stack}Error.stackTraceLimit-=6})}();"undefined"!=typeof console&&void 0!==console.warn&&(a=function(e){console.warn(e)},l.isNode&&t.stderr.isTTY?a=function(e,t){var r=t?"":"";console.warn(r+e+"\n")}:l.isNode||"string"!=typeof(new Error).stack||(a=function(e,t){console.warn("%c"+e,t?"color: darkorange":"color: red")}));var J={warnings:b,longStackTraces:!1,cancellation:!1,monitoring:!1};return _&&r.longStackTraces(),{longStackTraces:function(){return J.longStackTraces},warnings:function(){return J.warnings},cancellation:function(){return J.cancellation},monitoring:function(){return J.monitoring},propagateFromFunction:function(){return k},boundValueFunction:function(){return F},checkForgottenReturns:function(e,t,r,n,i){if(void 0===e&&null!==t&&x){if(void 0!==i&&i._returnedNonUndefined())return;if(0==(65535&n._bitField))return;r&&(r+=" ");var o="",a="";if(t._trace){for(var s=t._trace.stack.split("\n"),c=N(s),h=c.length-1;h>=0;--h){var l=c[h];if(!d.test(l)){var u=l.match(f);u&&(o="at "+u[1]+":"+u[2]+":"+u[3]+" ");break}}if(c.length>0)for(var p=c[0],h=0;h0&&(a="\n"+s[h-1]);break}}var m="a promise was created in a "+r+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+a;n._warn(m,!0,t)}},setBounds:function(e,t){if(W()){for(var r,n,i=e.stack.split("\n"),o=t.stack.split("\n"),a=-1,s=-1,c=0;c=s||(q=function(e){if(p.test(e))return!0;var t=Y(e);return!!(t&&t.fileName===r&&a<=t.line&&t.line<=s)})}},warn:D,deprecated:function(e,t){var r=e+" is deprecated and will be removed in a future version.";return t&&(r+=" Use "+t+" instead."),D(r)},CapturedTrace:K,fireDomEvent:M,fireGlobalEvent:T}}},{"./errors":12,"./util":36}],10:[function(e,t,r){"use strict";t.exports=function(e){function t(){return this.value}function r(){throw this.reason}e.prototype.return=e.prototype.thenReturn=function(r){return r instanceof e&&r.suppressUnhandledRejections(),this._then(t,void 0,void 0,{value:r},void 0)},e.prototype.throw=e.prototype.thenThrow=function(e){return this._then(r,void 0,void 0,{reason:e},void 0)},e.prototype.catchThrow=function(e){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:e},void 0);var t=arguments[1];return this.caught(e,function(){throw t})},e.prototype.catchReturn=function(r){if(arguments.length<=1)return r instanceof e&&r.suppressUnhandledRejections(),this._then(void 0,t,void 0,{value:r},void 0);var n=arguments[1];return n instanceof e&&n.suppressUnhandledRejections(),this.caught(r,function(){return n})}}},{}],11:[function(e,t,r){"use strict";t.exports=function(e,t){var r=e.reduce,n=e.all;function i(){return n(this)}e.prototype.each=function(e){return r(this,e,t,0)._then(i,void 0,void 0,this,void 0)},e.prototype.mapSeries=function(e){return r(this,e,t,t)},e.each=function(e,n){return r(e,n,t,0)._then(i,void 0,void 0,e,void 0)},e.mapSeries=function(e,n){return r(e,n,t,t)}}},{}],12:[function(e,t,r){"use strict";var n,i,o=e("./es5"),a=o.freeze,s=e("./util"),c=s.inherits,h=s.notEnumerableProp;function l(e,t){function r(n){if(!(this instanceof r))return new r(n);h(this,"message","string"==typeof n?n:t),h(this,"name",e),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return c(r,Error),r}var u=l("Warning","warning"),p=l("CancellationError","cancellation error"),d=l("TimeoutError","timeout error"),f=l("AggregateError","aggregate error");try{n=TypeError,i=RangeError}catch(e){n=l("TypeError","type error"),i=l("RangeError","range error")}for(var m="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),v=0;v1?e.cancelPromise._reject(t):e.cancelPromise._cancel(),e.cancelPromise=null,!0)}function u(){return d.call(this,this.promise._target()._settledValue())}function p(e){if(!l(this,e))return a.e=e,a}function d(e){var i=this.promise,s=this.handler;if(!this.called){this.called=!0;var c=this.isFinallyHandler()?s.call(i._boundValue()):s.call(i._boundValue(),e);if(c===n)return c;if(void 0!==c){i._setReturnedNonUndefined();var d=r(c,i);if(d instanceof t){if(null!=this.cancelPromise){if(d._isCancelled()){var f=new o("late cancellation observer");return i._attachExtraTrace(f),a.e=f,a}d.isPending()&&d._attachCancellationCallback(new h(this))}return d._then(u,p,void 0,this,void 0)}}}return i.isRejected()?(l(this),a.e=e,a):(l(this),e)}return c.prototype.isFinallyHandler=function(){return 0===this.type},h.prototype._resultCancelled=function(){l(this.finallyHandler)},t.prototype._passThrough=function(e,t,r,n){return"function"!=typeof e?this.then():this._then(r,n,void 0,new c(this,t,e),void 0)},t.prototype.lastly=t.prototype.finally=function(e){return this._passThrough(e,0,d,d)},t.prototype.tap=function(e){return this._passThrough(e,1,d)},t.prototype.tapCatch=function(e){var r=arguments.length;if(1===r)return this._passThrough(e,1,void 0,d);var n,o=new Array(r-1),a=0;for(n=0;n0&&"function"==typeof arguments[t]&&(e=arguments[t]);var n=[].slice.call(arguments);e&&n.pop();var i=new r(n).promise();return void 0!==e?i.spread(e):i}}},{"./util":36}],18:[function(e,t,r){"use strict";t.exports=function(t,r,n,i,o,a){var s=t._getDomain,c=e("./util"),h=c.tryCatch,l=c.errorObj,u=t._async;function p(e,t,r,n){this.constructor$(e),this._promise._captureStackTrace();var i=s();this._callback=null===i?t:c.domainBind(i,t),this._preservedValues=n===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=[],u.invoke(this._asyncInit,this,void 0)}function d(e,r,i,o){if("function"!=typeof r)return n("expecting a function but got "+c.classString(r));var a=0;if(void 0!==i){if("object"!=typeof i||null===i)return t.reject(new TypeError("options argument must be an object but it is "+c.classString(i)));if("number"!=typeof i.concurrency)return t.reject(new TypeError("'concurrency' must be a number but it is "+c.classString(i.concurrency)));a=i.concurrency}return a="number"==typeof a&&isFinite(a)&&a>=1?a:0,new p(e,r,a,o).promise()}c.inherits(p,r),p.prototype._asyncInit=function(){this._init$(void 0,-2)},p.prototype._init=function(){},p.prototype._promiseFulfilled=function(e,r){var n=this._values,o=this.length(),s=this._preservedValues,c=this._limit;if(r<0){if(n[r=-1*r-1]=e,c>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(c>=1&&this._inFlight>=c)return n[r]=e,this._queue.push(r),!1;null!==s&&(s[r]=e);var u=this._promise,p=this._callback,d=u._boundValue();u._pushContext();var f=h(p).call(d,e,r,o),m=u._popContext();if(a.checkForgottenReturns(f,m,null!==s?"Promise.filter":"Promise.map",u),f===l)return this._reject(f.e),!0;var v=i(f,this._promise);if(v instanceof t){var y=(v=v._target())._bitField;if(0==(50397184&y))return c>=1&&this._inFlight++,n[r]=v,v._proxy(this,-1*(r+1)),!1;if(0==(33554432&y))return 0!=(16777216&y)?(this._reject(v._reason()),!0):(this._cancel(),!0);f=v._value()}n[r]=f}var g=++this._totalResolved;return g>=o&&(null!==s?this._filter(n,s):this._resolve(n),!0)},p.prototype._drainQueue=function(){for(var e=this._queue,t=this._limit,r=this._values;e.length>0&&this._inFlight1){o.deprecated("calling Promise.try with more than 1 argument");var h=arguments[1],l=arguments[2];n=a.isArray(h)?s(e).apply(l,h):s(e).call(l,h)}else n=s(e)();var u=c._popContext();return o.checkForgottenReturns(n,u,"Promise.try",c),c._resolveFromSyncValue(n),c},t.prototype._resolveFromSyncValue=function(e){e===a.errorObj?this._rejectCallback(e.e,!1):this._resolveCallback(e,!0)}}},{"./util":36}],20:[function(e,t,r){"use strict";var n=e("./util"),i=n.maybeWrapAsError,o=e("./errors"),a=o.OperationalError,s=e("./es5"),c=/^(?:name|message|stack|cause)$/;function h(e){var t;if(function(e){return e instanceof Error&&s.getPrototypeOf(e)===Error.prototype}(e)){(t=new a(e)).name=e.name,t.message=e.message,t.stack=e.stack;for(var r=s.keys(e),i=0;i1){var r,n=new Array(t-1),i=0;for(r=0;r0&&"function"!=typeof e&&"function"!=typeof t){var r=".then() only accepts functions but was passed: "+h.classString(e);arguments.length>1&&(r+=", "+h.classString(t)),this._warn(r)}return this._then(e,t,void 0,void 0,void 0)},C.prototype.done=function(e,t){var r=this._then(e,t,void 0,void 0,void 0);r._setIsFinal()},C.prototype.spread=function(e){return"function"!=typeof e?o("expecting a function but got "+h.classString(e)):this.all()._then(e,void 0,void 0,y,void 0)},C.prototype.toJSON=function(){var e={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(e.fulfillmentValue=this.value(),e.isFulfilled=!0):this.isRejected()&&(e.rejectionReason=this.reason(),e.isRejected=!0),e},C.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new _(this).promise()},C.prototype.error=function(e){return this.caught(h.originatesFromRejection,e)},C.getNewLibraryCopy=r.exports,C.is=function(e){return e instanceof C},C.fromNode=C.fromCallback=function(e){var t=new C(v);t._captureStackTrace();var r=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=P(e)(E(t,r));return n===A&&t._rejectCallback(n.e,!0),t._isFateSealed()||t._setAsyncGuaranteed(),t},C.all=function(e){return new _(e).promise()},C.cast=function(e){var t=b(e);return t instanceof C||((t=new C(v))._captureStackTrace(),t._setFulfilled(),t._rejectionHandler0=e),t},C.resolve=C.fulfilled=C.cast,C.reject=C.rejected=function(e){var t=new C(v);return t._captureStackTrace(),t._rejectCallback(e,!0),t},C.setScheduler=function(e){if("function"!=typeof e)throw new f("expecting a function but got "+h.classString(e));return p.setScheduler(e)},C.prototype._then=function(e,t,r,n,i){var o=void 0!==i,a=o?i:new C(v),c=this._target(),l=c._bitField;o||(a._propagateFrom(this,3),a._captureStackTrace(),void 0===n&&0!=(2097152&this._bitField)&&(n=0!=(50397184&l)?this._boundValue():c===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,a));var u=s();if(0!=(50397184&l)){var d,f,y=c._settlePromiseCtx;0!=(33554432&l)?(f=c._rejectionHandler0,d=e):0!=(16777216&l)?(f=c._fulfillmentHandler0,d=t,c._unsetRejectionIsUnhandled()):(y=c._settlePromiseLateCancellationObserver,f=new m("late cancellation observer"),c._attachExtraTrace(f),d=t),p.invoke(y,c,{handler:null===u?d:"function"==typeof d&&h.domainBind(u,d),promise:a,receiver:n,value:f})}else c._addCallbacks(e,t,a,n,u);return a},C.prototype._length=function(){return 65535&this._bitField},C.prototype._isFateSealed=function(){return 0!=(117506048&this._bitField)},C.prototype._isFollowing=function(){return 67108864==(67108864&this._bitField)},C.prototype._setLength=function(e){this._bitField=-65536&this._bitField|65535&e},C.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},C.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},C.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},C.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},C.prototype._isFinal=function(){return(4194304&this._bitField)>0},C.prototype._unsetCancelled=function(){this._bitField=-65537&this._bitField},C.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},C.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},C.prototype._setAsyncGuaranteed=function(){p.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},C.prototype._receiverAt=function(e){var t=0===e?this._receiver0:this[4*e-4+3];if(t!==c)return void 0===t&&this._isBound()?this._boundValue():t},C.prototype._promiseAt=function(e){return this[4*e-4+2]},C.prototype._fulfillmentHandlerAt=function(e){return this[4*e-4+0]},C.prototype._rejectionHandlerAt=function(e){return this[4*e-4+1]},C.prototype._boundValue=function(){},C.prototype._migrateCallback0=function(e){e._bitField;var t=e._fulfillmentHandler0,r=e._rejectionHandler0,n=e._promise0,i=e._receiverAt(0);void 0===i&&(i=c),this._addCallbacks(t,r,n,i,null)},C.prototype._migrateCallbackAt=function(e,t){var r=e._fulfillmentHandlerAt(t),n=e._rejectionHandlerAt(t),i=e._promiseAt(t),o=e._receiverAt(t);void 0===o&&(o=c),this._addCallbacks(r,n,i,o,null)},C.prototype._addCallbacks=function(e,t,r,n,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=r,this._receiver0=n,"function"==typeof e&&(this._fulfillmentHandler0=null===i?e:h.domainBind(i,e)),"function"==typeof t&&(this._rejectionHandler0=null===i?t:h.domainBind(i,t));else{var a=4*o-4;this[a+2]=r,this[a+3]=n,"function"==typeof e&&(this[a+0]=null===i?e:h.domainBind(i,e)),"function"==typeof t&&(this[a+1]=null===i?t:h.domainBind(i,t))}return this._setLength(o+1),o},C.prototype._proxy=function(e,t){this._addCallbacks(void 0,void 0,t,e,null)},C.prototype._resolveCallback=function(e,t){if(0==(117506048&this._bitField)){if(e===this)return this._rejectCallback(n(),!1);var r=b(e,this);if(!(r instanceof C))return this._fulfill(e);t&&this._propagateFrom(r,2);var i=r._target();if(i!==this){var o=i._bitField;if(0==(50397184&o)){var a=this._length();a>0&&i._migrateCallback0(this);for(var s=1;s>>16)){if(e===this){var r=n();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=e,(65535&t)>0&&(0!=(134217728&t)?this._settlePromises():p.settlePromises(this))}},C.prototype._reject=function(e){var t=this._bitField;if(!((117506048&t)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=e,this._isFinal())return p.fatalError(e,h.isNode);(65535&t)>0?p.settlePromises(this):this._ensurePossibleRejectionHandled()}},C.prototype._fulfillPromises=function(e,t){for(var r=1;r0){if(0!=(16842752&e)){var r=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,r,e),this._rejectPromises(t,r)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,e),this._fulfillPromises(t,n)}this._setLength(0)}this._clearCancellationData()},C.prototype._settledValue=function(){var e=this._bitField;return 0!=(33554432&e)?this._rejectionHandler0:0!=(16777216&e)?this._fulfillmentHandler0:void 0},C.defer=C.pending=function(){M.deprecated("Promise.defer","new Promise");var e=new C(v);return{promise:e,resolve:L,reject:R}},h.notEnumerableProp(C,"_makeSelfResolutionError",n),e("./method")(C,v,b,o,M),e("./bind")(C,v,b,M),e("./cancel")(C,_,o,M),e("./direct_resolve")(C),e("./synchronous_inspection")(C),e("./join")(C,_,b,v,p,s),C.Promise=C,C.version="3.5.1",e("./map.js")(C,_,o,b,v,M),e("./call_get.js")(C),e("./using.js")(C,o,b,w,v,M),e("./timers.js")(C,v,M),e("./generators.js")(C,o,v,b,a,M),e("./nodeify.js")(C),e("./promisify.js")(C,v),e("./props.js")(C,_,b,o),e("./race.js")(C,v,b,o),e("./reduce.js")(C,_,o,b,v,M),e("./settle.js")(C,_,M),e("./some.js")(C,_,o),e("./filter.js")(C,v),e("./each.js")(C,v),e("./any.js")(C),h.toFastProperties(C),h.toFastProperties(C.prototype),O({a:1}),O({b:2}),O({c:3}),O(1),O(function(){}),O(void 0),O(!1),O(new C(v)),M.setBounds(u.firstLineError,h.lastLineError),C}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(e,t,r){"use strict";t.exports=function(t,r,n,i,o){var a=e("./util");function s(e){var n=this._promise=new t(r);e instanceof t&&n._propagateFrom(e,3),n._setOnCancel(this),this._values=e,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return a.isArray,a.inherits(s,o),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function e(r,o){var s=n(this._values,this._promise);if(s instanceof t){var c=(s=s._target())._bitField;if(this._values=s,0==(50397184&c))return this._promise._setAsyncGuaranteed(),s._then(e,this._reject,void 0,this,o);if(0==(33554432&c))return 0!=(16777216&c)?this._reject(s._reason()):this._cancel();s=s._value()}if(null!==(s=a.asArray(s)))0!==s.length?this._iterate(s):-5===o?this._resolveEmptyArray():this._resolve(function(e){switch(e){case-2:return[];case-3:return{};case-6:return new Map}}(o));else{var h=i("expecting an array or an iterable object but got "+a.classString(s)).reason();this._promise._rejectCallback(h,!1)}},s.prototype._iterate=function(e){var r=this.getActualLength(e.length);this._length=r,this._values=this.shouldCopyValues()?new Array(r):this._values;for(var i=this._promise,o=!1,a=null,s=0;s=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(e){return this._totalResolved++,this._reject(e),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var e=this._values;if(this._cancel(),e instanceof t)e.cancel();else for(var r=0;r=this._length){var n;if(this._isMap)n=function(e){for(var t=new o,r=e.length/2|0,n=0;n>1},t.prototype.props=function(){return u(this)},t.props=function(e){return u(e)}}},{"./es5":13,"./util":36}],26:[function(e,t,r){"use strict";function n(e){this._capacity=e,this._length=0,this._front=0}n.prototype._willBeOverCapacity=function(e){return this._capacity=this._length&&(this._resolve(this._values),!0)},a.prototype._promiseFulfilled=function(e,t){var r=new i;return r._bitField=33554432,r._settledValueField=e,this._promiseResolved(t,r)},a.prototype._promiseRejected=function(e,t){var r=new i;return r._bitField=16777216,r._settledValueField=e,this._promiseResolved(t,r)},t.settle=function(e){return n.deprecated(".settle()",".reflect()"),new a(e).promise()},t.prototype.settle=function(){return t.settle(this)}}},{"./util":36}],31:[function(e,t,r){"use strict";t.exports=function(t,r,n){var i=e("./util"),o=e("./errors").RangeError,a=e("./errors").AggregateError,s=i.isArray,c={};function h(e){this.constructor$(e),this._howMany=0,this._unwrap=!1,this._initialized=!1}function l(e,t){if((0|t)!==t||t<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new h(e),i=r.promise();return r.setHowMany(t),r.init(),i}i.inherits(h,r),h.prototype._init=function(){if(this._initialized)if(0!==this._howMany){this._init$(void 0,-5);var e=s(this._values);!this._isResolved()&&e&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}else this._resolve([])},h.prototype.init=function(){this._initialized=!0,this._init()},h.prototype.setUnwrap=function(){this._unwrap=!0},h.prototype.howMany=function(){return this._howMany},h.prototype.setHowMany=function(e){this._howMany=e},h.prototype._promiseFulfilled=function(e){return this._addFulfilled(e),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},h.prototype._promiseRejected=function(e){return this._addRejected(e),this._checkOutcome()},h.prototype._promiseCancelled=function(){return this._values instanceof t||null==this._values?this._cancel():(this._addRejected(c),this._checkOutcome())},h.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var e=new a,t=this.length();t0?this._reject(e):this._cancel(),!0}return!1},h.prototype._fulfilled=function(){return this._totalResolved},h.prototype._rejected=function(){return this._values.length-this.length()},h.prototype._addRejected=function(e){this._values.push(e)},h.prototype._addFulfilled=function(e){this._values[this._totalResolved++]=e},h.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},h.prototype._getRangeError=function(e){var t="Input array must contain at least "+this._howMany+" items but contains only "+e+" items";return new o(t)},h.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},t.some=function(e,t){return l(e,t)},t.prototype.some=function(e){return l(this,e)},t._SomePromiseArray=h}},{"./errors":12,"./util":36}],32:[function(e,t,r){"use strict";t.exports=function(e){function t(e){void 0!==e?(e=e._target(),this._bitField=e._bitField,this._settledValueField=e._isFateSealed()?e._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}t.prototype._settledValue=function(){return this._settledValueField};var r=t.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},n=t.prototype.error=t.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=t.prototype.isFulfilled=function(){return 0!=(33554432&this._bitField)},o=t.prototype.isRejected=function(){return 0!=(16777216&this._bitField)},a=t.prototype.isPending=function(){return 0==(50397184&this._bitField)},s=t.prototype.isResolved=function(){return 0!=(50331648&this._bitField)};t.prototype.isCancelled=function(){return 0!=(8454144&this._bitField)},e.prototype.__isCancelled=function(){return 65536==(65536&this._bitField)},e.prototype._isCancelled=function(){return this._target().__isCancelled()},e.prototype.isCancelled=function(){return 0!=(8454144&this._target()._bitField)},e.prototype.isPending=function(){return a.call(this._target())},e.prototype.isRejected=function(){return o.call(this._target())},e.prototype.isFulfilled=function(){return i.call(this._target())},e.prototype.isResolved=function(){return s.call(this._target())},e.prototype.value=function(){return r.call(this._target())},e.prototype.reason=function(){var e=this._target();return e._unsetRejectionIsUnhandled(),n.call(e)},e.prototype._value=function(){return this._settledValue()},e.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},e.PromiseInspection=t}},{}],33:[function(e,t,r){"use strict";t.exports=function(t,r){var n=e("./util"),i=n.errorObj,o=n.isObject,a={}.hasOwnProperty;return function(e,s){if(o(e)){if(e instanceof t)return e;var c=function(e){try{return function(e){return e.then}(e)}catch(e){return i.e=e,i}}(e);if(c===i){s&&s._pushContext();var h=t.reject(c.e);return s&&s._popContext(),h}if("function"==typeof c){if(function(e){try{return a.call(e,"_promise0")}catch(e){return!1}}(e)){var h=new t(r);return e._then(h._fulfill,h._reject,void 0,h,null),h}return function(e,o,a){var s=new t(r),c=s;a&&a._pushContext(),s._captureStackTrace(),a&&a._popContext();var h=!0,l=n.tryCatch(o).call(e,function(e){s&&(s._resolveCallback(e),s=null)},function(e){s&&(s._rejectCallback(e,h,!0),s=null)});return h=!1,s&&l===i&&(s._rejectCallback(l.e,!0,!0),s=null),c}(e,c,s)}}return e}}},{"./util":36}],34:[function(e,t,r){"use strict";t.exports=function(t,r,n){var i=e("./util"),o=t.TimeoutError;function a(e){this.handle=e}a.prototype._resultCancelled=function(){clearTimeout(this.handle)};var s=function(e){return c(+this).thenReturn(e)},c=t.delay=function(e,i){var o,c;return void 0!==i?(o=t.resolve(i)._then(s,null,null,e,void 0),n.cancellation()&&i instanceof t&&o._setOnCancel(i)):(o=new t(r),c=setTimeout(function(){o._fulfill()},+e),n.cancellation()&&o._setOnCancel(new a(c)),o._captureStackTrace()),o._setAsyncGuaranteed(),o};function h(e){return clearTimeout(this.handle),e}function l(e){throw clearTimeout(this.handle),e}t.prototype.delay=function(e){return c(e,this)},t.prototype.timeout=function(e,t){var r,s;e=+e;var c=new a(setTimeout(function(){r.isPending()&&function(e,t,r){var n;n="string"!=typeof t?t instanceof Error?t:new o("operation timed out"):new o(t),i.markAsOriginatingFromRejection(n),e._attachExtraTrace(n),e._reject(n),null!=r&&r.cancel()}(r,t,s)},e));return n.cancellation()?(s=this.then(),(r=s._then(h,l,void 0,c,void 0))._setOnCancel(c)):r=this._then(h,l,void 0,c,void 0),r}}},{"./util":36}],35:[function(e,t,r){"use strict";t.exports=function(t,r,n,i,o,a){var s=e("./util"),c=e("./errors").TypeError,h=e("./util").inherits,l=s.errorObj,u=s.tryCatch,p={};function d(e){setTimeout(function(){throw e},0)}function f(e,r){var i=0,a=e.length,s=new t(o);return function o(){if(i>=a)return s._fulfill();var c=function(e){var t=n(e);return t!==e&&"function"==typeof e._isDisposable&&"function"==typeof e._getDisposer&&e._isDisposable()&&t._setDisposable(e._getDisposer()),t}(e[i++]);if(c instanceof t&&c._isDisposable()){try{c=n(c._getDisposer().tryDispose(r),e.promise)}catch(e){return d(e)}if(c instanceof t)return c._then(o,d,null,null,null)}o()}(),s}function m(e,t,r){this._data=e,this._promise=t,this._context=r}function v(e,t,r){this.constructor$(e,t,r)}function y(e){return m.isDisposer(e)?(this.resources[this.index]._setDisposable(e),e.promise()):e}function g(e){this.length=e,this.promise=null,this[e-1]=null}m.prototype.data=function(){return this._data},m.prototype.promise=function(){return this._promise},m.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():p},m.prototype.tryDispose=function(e){var t=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=t!==p?this.doDispose(t,e):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},m.isDisposer=function(e){return null!=e&&"function"==typeof e.resource&&"function"==typeof e.tryDispose},h(v,m),v.prototype.doDispose=function(e,t){var r=this.data();return r.call(e,e,t)},g.prototype._resultCancelled=function(){for(var e=this.length,r=0;r0},t.prototype._getDisposer=function(){return this._disposer},t.prototype._unsetDisposable=function(){this._bitField=-131073&this._bitField,this._disposer=void 0},t.prototype.disposer=function(e){if("function"==typeof e)return new v(e,this,i());throw new c}}},{"./errors":12,"./util":36}],36:[function(e,n,i){"use strict";var o=e("./es5"),a="undefined"==typeof navigator,s={e:{}},c,h="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r?r:void 0!==this?this:null;function l(){try{var e=c;return c=null,e.apply(this,arguments)}catch(e){return s.e=e,s}}function u(e){return c=e,l}var p=function(e,t){var r={}.hasOwnProperty;function n(){for(var n in this.constructor=e,this.constructor$=t,t.prototype)r.call(t.prototype,n)&&"$"!==n.charAt(n.length-1)&&(this[n+"$"]=t.prototype[n])}return n.prototype=t.prototype,e.prototype=new n,e.prototype};function d(e){return null==e||!0===e||!1===e||"string"==typeof e||"number"==typeof e}function f(e){return"function"==typeof e||"object"==typeof e&&null!==e}function m(e){return d(e)?new Error(A(e)):e}function v(e,t){var r,n=e.length,i=new Array(n+1);for(r=0;r1,n=t.length>0&&!(1===t.length&&"constructor"===t[0]),i=x.test(e+"")&&o.names(e).length>0;if(r||n||i)return!0}return!1}catch(e){return!1}}function M(e){function t(){}t.prototype=e;for(var r=8;r--;)new t;return e}var T=/^[a-z$_][a-z$_0-9]*$/i;function S(e){return T.test(e)}function E(e,t,r){for(var n=new Array(e),i=0;i10||e[0]>0}(),G.isNode&&G.toFastProperties(t);try{throw new Error}catch(e){G.lastLineError=e}n.exports=G},{"./es5":13}]},{},[4])(4)}(),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(this,r(20),r(17),r(88).setImmediate)},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a=r(215).Buffer}catch(e){}function s(e,t,r){for(var n=0,i=Math.min(e.length,r),o=t;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===t?this._parseHex(e,i):this._parseBase(e,t,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)i=s(e,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==t&&(i=s(e,t,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,h=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],u=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,c=a/67108864|0;r.words[0]=s;for(var h=1;h>>26,u=67108863&c,p=Math.min(h,t.length-1),d=Math.max(0,h-e.length+1);d<=p;d++){var f=h-d|0;l+=(a=(i=0|e.words[f])*(o=0|t.words[d])+u)/67108864|0,u=67108863&a}r.words[h]=0|u,c=0|l}return 0!==c?r.words[h]=0|c:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(e=e||10,t=0|t||1,16===e||"hex"===e){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?h[6-c.length]+c+r:c+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var p=l[e],d=u[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var m=f.modn(d).toString(e);r=(f=f.idivn(d)).isZero()?m+r:h[p-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,c="le"===t,h=new e(o),l=this.clone();if(c){for(s=0;!l.isZero();s++)a=l.andln(255),l.iushrn(8),h[s]=a;for(;s=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==o&&a>26,this.words[a]=67108863&t;if(0===o&&a>>13,d=0|a[1],f=8191&d,m=d>>>13,v=0|a[2],y=8191&v,g=v>>>13,b=0|a[3],_=8191&b,x=b>>>13,w=0|a[4],M=8191&w,T=w>>>13,S=0|a[5],E=8191&S,A=S>>>13,P=0|a[6],C=8191&P,L=P>>>13,R=0|a[7],O=8191&R,B=R>>>13,j=0|a[8],k=8191&j,F=j>>>13,z=0|a[9],I=8191&z,D=z>>>13,N=0|s[0],U=8191&N,G=N>>>13,H=0|s[1],V=8191&H,W=H>>>13,q=0|s[2],X=8191&q,Y=q>>>13,K=0|s[3],Z=8191&K,J=K>>>13,Q=0|s[4],$=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ce=8191&se,he=se>>>13,le=0|s[8],ue=8191&le,pe=le>>>13,de=0|s[9],fe=8191&de,me=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ve=(h+(n=Math.imul(u,U))|0)+((8191&(i=(i=Math.imul(u,G))+Math.imul(p,U)|0))<<13)|0;h=((o=Math.imul(p,G))+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(f,U),i=(i=Math.imul(f,G))+Math.imul(m,U)|0,o=Math.imul(m,G);var ye=(h+(n=n+Math.imul(u,V)|0)|0)+((8191&(i=(i=i+Math.imul(u,W)|0)+Math.imul(p,V)|0))<<13)|0;h=((o=o+Math.imul(p,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,G))+Math.imul(g,U)|0,o=Math.imul(g,G),n=n+Math.imul(f,V)|0,i=(i=i+Math.imul(f,W)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,W)|0;var ge=(h+(n=n+Math.imul(u,X)|0)|0)+((8191&(i=(i=i+Math.imul(u,Y)|0)+Math.imul(p,X)|0))<<13)|0;h=((o=o+Math.imul(p,Y)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(_,U),i=(i=Math.imul(_,G))+Math.imul(x,U)|0,o=Math.imul(x,G),n=n+Math.imul(y,V)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,W)|0,n=n+Math.imul(f,X)|0,i=(i=i+Math.imul(f,Y)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,Y)|0;var be=(h+(n=n+Math.imul(u,Z)|0)|0)+((8191&(i=(i=i+Math.imul(u,J)|0)+Math.imul(p,Z)|0))<<13)|0;h=((o=o+Math.imul(p,J)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(M,U),i=(i=Math.imul(M,G))+Math.imul(T,U)|0,o=Math.imul(T,G),n=n+Math.imul(_,V)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,Y)|0,n=n+Math.imul(f,Z)|0,i=(i=i+Math.imul(f,J)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,J)|0;var _e=(h+(n=n+Math.imul(u,$)|0)|0)+((8191&(i=(i=i+Math.imul(u,ee)|0)+Math.imul(p,$)|0))<<13)|0;h=((o=o+Math.imul(p,ee)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(E,U),i=(i=Math.imul(E,G))+Math.imul(A,U)|0,o=Math.imul(A,G),n=n+Math.imul(M,V)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,W)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,J)|0,n=n+Math.imul(f,$)|0,i=(i=i+Math.imul(f,ee)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,ee)|0;var xe=(h+(n=n+Math.imul(u,re)|0)|0)+((8191&(i=(i=i+Math.imul(u,ne)|0)+Math.imul(p,re)|0))<<13)|0;h=((o=o+Math.imul(p,ne)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(C,U),i=(i=Math.imul(C,G))+Math.imul(L,U)|0,o=Math.imul(L,G),n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(A,V)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,Y)|0,n=n+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,J)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,J)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,ee)|0,n=n+Math.imul(f,re)|0,i=(i=i+Math.imul(f,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var we=(h+(n=n+Math.imul(u,oe)|0)|0)+((8191&(i=(i=i+Math.imul(u,ae)|0)+Math.imul(p,oe)|0))<<13)|0;h=((o=o+Math.imul(p,ae)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,G))+Math.imul(B,U)|0,o=Math.imul(B,G),n=n+Math.imul(C,V)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(L,V)|0,o=o+Math.imul(L,W)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,Y)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,J)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,J)|0,n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ne)|0,n=n+Math.imul(f,oe)|0,i=(i=i+Math.imul(f,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0;var Me=(h+(n=n+Math.imul(u,ce)|0)|0)+((8191&(i=(i=i+Math.imul(u,he)|0)+Math.imul(p,ce)|0))<<13)|0;h=((o=o+Math.imul(p,he)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(k,U),i=(i=Math.imul(k,G))+Math.imul(F,U)|0,o=Math.imul(F,G),n=n+Math.imul(O,V)|0,i=(i=i+Math.imul(O,W)|0)+Math.imul(B,V)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,Y)|0,n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,J)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,J)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,ae)|0,n=n+Math.imul(f,ce)|0,i=(i=i+Math.imul(f,he)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,he)|0;var Te=(h+(n=n+Math.imul(u,ue)|0)|0)+((8191&(i=(i=i+Math.imul(u,pe)|0)+Math.imul(p,ue)|0))<<13)|0;h=((o=o+Math.imul(p,pe)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,G))+Math.imul(D,U)|0,o=Math.imul(D,G),n=n+Math.imul(k,V)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(F,V)|0,o=o+Math.imul(F,W)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,Y)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,J)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,J)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,ae)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,ae)|0,n=n+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(g,ce)|0,o=o+Math.imul(g,he)|0,n=n+Math.imul(f,ue)|0,i=(i=i+Math.imul(f,pe)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,pe)|0;var Se=(h+(n=n+Math.imul(u,fe)|0)|0)+((8191&(i=(i=i+Math.imul(u,me)|0)+Math.imul(p,fe)|0))<<13)|0;h=((o=o+Math.imul(p,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(I,V),i=(i=Math.imul(I,W))+Math.imul(D,V)|0,o=Math.imul(D,W),n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(F,X)|0,o=o+Math.imul(F,Y)|0,n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,J)|0)+Math.imul(B,Z)|0,o=o+Math.imul(B,J)|0,n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,ae)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,ae)|0,n=n+Math.imul(_,ce)|0,i=(i=i+Math.imul(_,he)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,he)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,pe)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,pe)|0;var Ee=(h+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,me)|0)+Math.imul(m,fe)|0))<<13)|0;h=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(I,X),i=(i=Math.imul(I,Y))+Math.imul(D,X)|0,o=Math.imul(D,Y),n=n+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,J)|0)+Math.imul(F,Z)|0,o=o+Math.imul(F,J)|0,n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(B,$)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(L,re)|0,o=o+Math.imul(L,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,ae)|0,n=n+Math.imul(M,ce)|0,i=(i=i+Math.imul(M,he)|0)+Math.imul(T,ce)|0,o=o+Math.imul(T,he)|0,n=n+Math.imul(_,ue)|0,i=(i=i+Math.imul(_,pe)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,pe)|0;var Ae=(h+(n=n+Math.imul(y,fe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(g,fe)|0))<<13)|0;h=((o=o+Math.imul(g,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(I,Z),i=(i=Math.imul(I,J))+Math.imul(D,Z)|0,o=Math.imul(D,J),n=n+Math.imul(k,$)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(F,$)|0,o=o+Math.imul(F,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,ae)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,ae)|0,n=n+Math.imul(E,ce)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(A,ce)|0,o=o+Math.imul(A,he)|0,n=n+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,pe)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,pe)|0;var Pe=(h+(n=n+Math.imul(_,fe)|0)|0)+((8191&(i=(i=i+Math.imul(_,me)|0)+Math.imul(x,fe)|0))<<13)|0;h=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(I,$),i=(i=Math.imul(I,ee))+Math.imul(D,$)|0,o=Math.imul(D,ee),n=n+Math.imul(k,re)|0,i=(i=i+Math.imul(k,ne)|0)+Math.imul(F,re)|0,o=o+Math.imul(F,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,ae)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,ae)|0,n=n+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,he)|0)+Math.imul(L,ce)|0,o=o+Math.imul(L,he)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,pe)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,pe)|0;var Ce=(h+(n=n+Math.imul(M,fe)|0)|0)+((8191&(i=(i=i+Math.imul(M,me)|0)+Math.imul(T,fe)|0))<<13)|0;h=((o=o+Math.imul(T,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(I,re),i=(i=Math.imul(I,ne))+Math.imul(D,re)|0,o=Math.imul(D,ne),n=n+Math.imul(k,oe)|0,i=(i=i+Math.imul(k,ae)|0)+Math.imul(F,oe)|0,o=o+Math.imul(F,ae)|0,n=n+Math.imul(O,ce)|0,i=(i=i+Math.imul(O,he)|0)+Math.imul(B,ce)|0,o=o+Math.imul(B,he)|0,n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,pe)|0)+Math.imul(L,ue)|0,o=o+Math.imul(L,pe)|0;var Le=(h+(n=n+Math.imul(E,fe)|0)|0)+((8191&(i=(i=i+Math.imul(E,me)|0)+Math.imul(A,fe)|0))<<13)|0;h=((o=o+Math.imul(A,me)|0)+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,n=Math.imul(I,oe),i=(i=Math.imul(I,ae))+Math.imul(D,oe)|0,o=Math.imul(D,ae),n=n+Math.imul(k,ce)|0,i=(i=i+Math.imul(k,he)|0)+Math.imul(F,ce)|0,o=o+Math.imul(F,he)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,pe)|0)+Math.imul(B,ue)|0,o=o+Math.imul(B,pe)|0;var Re=(h+(n=n+Math.imul(C,fe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(L,fe)|0))<<13)|0;h=((o=o+Math.imul(L,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(I,ce),i=(i=Math.imul(I,he))+Math.imul(D,ce)|0,o=Math.imul(D,he),n=n+Math.imul(k,ue)|0,i=(i=i+Math.imul(k,pe)|0)+Math.imul(F,ue)|0,o=o+Math.imul(F,pe)|0;var Oe=(h+(n=n+Math.imul(O,fe)|0)|0)+((8191&(i=(i=i+Math.imul(O,me)|0)+Math.imul(B,fe)|0))<<13)|0;h=((o=o+Math.imul(B,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(I,ue),i=(i=Math.imul(I,pe))+Math.imul(D,ue)|0,o=Math.imul(D,pe);var Be=(h+(n=n+Math.imul(k,fe)|0)|0)+((8191&(i=(i=i+Math.imul(k,me)|0)+Math.imul(F,fe)|0))<<13)|0;h=((o=o+Math.imul(F,me)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863;var je=(h+(n=Math.imul(I,fe))|0)+((8191&(i=(i=Math.imul(I,me))+Math.imul(D,fe)|0))<<13)|0;return h=((o=Math.imul(D,me))+(i>>>13)|0)+(je>>>26)|0,je&=67108863,c[0]=ve,c[1]=ye,c[2]=ge,c[3]=be,c[4]=_e,c[5]=xe,c[6]=we,c[7]=Me,c[8]=Te,c[9]=Se,c[10]=Ee,c[11]=Ae,c[12]=Pe,c[13]=Ce,c[14]=Le,c[15]=Re,c[16]=Oe,c[17]=Be,c[18]=je,0!==h&&(c[19]=h,r.length++),r};function f(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(d=p),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?d(this,e,t):r<63?p(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):f(this,e,t)},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},m.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,h=0;h=0&&(0!==l||h>=i);h--){var u=0|this.words[h];this.words[h]=l<<26-o|u>>>o,l=u&s}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,c=n.length-i.length;if("mod"!==t){(s=new o(null)).length=c+1,s.words=new Array(s.length);for(var h=0;h=0;u--){var p=67108864*(0|n.words[i.length+u])+(0|n.words[i.length+u-1]);for(p=Math.min(p/a|0,67108863),n._ishlnsubmul(i,p,u);0!==n.negative;)p--,n.negative=0,n._ishlnsubmul(i,1,u),n.isZero()||(n.negative^=1);s&&(s.words[u]=p)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),c=new o(1),h=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),u=t.clone();!t.isZero();){for(var p=0,d=1;0==(t.words[0]&d)&&p<26;++p,d<<=1);if(p>0)for(t.iushrn(p);p-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(u)),i.iushrn(1),a.iushrn(1);for(var f=0,m=1;0==(r.words[0]&m)&&f<26;++f,m<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(l),c.isub(u)),s.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(c)):(r.isub(t),s.isub(i),c.isub(a))}return{a:s,b:c,gcd:r.iushln(h)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,l=1;0==(t.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(t.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var u=0,p=1;0==(r.words[0]&p)&&u<26;++u,p<<=1);if(u>0)for(r.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new w(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){w.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(g,y),g.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=o}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},g.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new g;else if("p224"===e)t=new b;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return v[e]=t,t},w.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},w.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},w.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},w.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},w.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},w.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},w.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},w.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},w.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},w.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},w.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},w.prototype.isqr=function(e){return this.imul(e,e.clone())},w.prototype.sqr=function(e){return this.mul(e,e)},w.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),c=s.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,h).cmp(c);)l.redIAdd(c);for(var u=this.pow(l,i),p=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),f=a;0!==d.cmp(s);){for(var m=d,v=0;0!==m.cmp(s);v++)m=m.redSqr();n(v=0;n--){for(var h=t.words[n],l=c-1;l>=0;l--){var u=h>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==u||0!==a?(a<<=1,a|=u,(4===++s||0===n&&0===l)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}c=26}return i},w.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},w.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new M(e)},i(M,w),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)}).call(this,r(45)(e))},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4),r(5).ThreeModel),a=o.extend({defaults:function(){return n.extend(o.prototype.defaults.call(this),{name:"",type:"BaseBufferGeometry"})},constructThreeObject:function(){var e=new i.BaseBufferGeometry;return Promise.resolve(e)},createPropertiesArrays:function(){o.prototype.createPropertiesArrays.call(this),this.props_created_by_three.type=!0,this.property_converters.name=null,this.property_converters.type=null}},{model_name:"BaseBufferGeometryModel",serializers:n.extend({},o.serializers)});e.exports={BaseBufferGeometryModel:a}},function(e,t,r){r(1);var n=r(494).MaterialModel,i=n.extend({onCustomMessage:function(e,t){switch(e.type){case"needsUpdate":this.obj.needsUpdate=!0,this.trigger("childchange",this);break;default:n.prototype.onCustomMessage.call(arguments)}}});e.exports={MaterialModel:i}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4),r(5).ThreeModel),a=o.extend({defaults:function(){return n.extend(o.prototype.defaults.call(this),{name:"",mapping:"UVMapping",wrapS:"ClampToEdgeWrapping",wrapT:"ClampToEdgeWrapping",magFilter:"LinearFilter",minFilter:"LinearMipMapLinearFilter",format:"RGBAFormat",type:"UnsignedByteType",anisotropy:1,repeat:[1,1],offset:[0,0],generateMipmaps:!0,premultiplyAlpha:!1,flipY:!0,unpackAlignment:4,encoding:"LinearEncoding",version:0,rotation:0})},constructThreeObject:function(){var e=new i.Texture;return Promise.resolve(e)},createPropertiesArrays:function(){o.prototype.createPropertiesArrays.call(this),this.props_created_by_three.id=!0,this.props_created_by_three.version=!0,this.enum_property_types.mapping="MappingModes",this.enum_property_types.wrapS="WrappingModes",this.enum_property_types.wrapT="WrappingModes",this.enum_property_types.magFilter="Filters",this.enum_property_types.minFilter="Filters",this.enum_property_types.format="PixelFormats",this.enum_property_types.type="DataTypes",this.enum_property_types.encoding="TextureEncodings",this.property_converters.name=null,this.property_converters.mapping="convertEnum",this.property_converters.wrapS="convertEnum",this.property_converters.wrapT="convertEnum",this.property_converters.magFilter="convertEnum",this.property_converters.minFilter="convertEnum",this.property_converters.format="convertEnum",this.property_converters.type="convertEnum",this.property_converters.anisotropy="convertFloat",this.property_converters.repeat="convertVector",this.property_converters.offset="convertVector",this.property_converters.generateMipmaps="convertBool",this.property_converters.premultiplyAlpha="convertBool",this.property_converters.flipY="convertBool",this.property_converters.unpackAlignment=null,this.property_converters.encoding="convertEnum",this.property_converters.version=null,this.property_converters.rotation="convertFloat",this.property_assigners.repeat="assignVector",this.property_assigners.offset="assignVector"}},{model_name:"TextureModel",serializers:n.extend({},o.serializers)});e.exports={TextureModel:a}},function(e,t,r){"use strict";var n=t;n.version=r(221).version,n.utils=r(222),n.rand=r(116),n.curve=r(49),n.curves=r(227),n.ec=r(235),n.eddsa=r(239)},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=r,r.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},function(e,t,r){"use strict";var n=r(18),i=r(6);function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function s(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n>8,a=255&i;o?r.push(o,a):r.push(a)}else for(n=0;n>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,s){var c=0,h=t;return c+=(h=h+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,c,h){var l=0,u=t;return l+=(u=u+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,c,h){return t+n+o+s+h>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var c,h=[],l=!1,u=-1;function p(){l&&c&&(l=!1,c.length?h=c.concat(h):u=-1,h.length&&d())}function d(){if(!l){var e=s(p);l=!0;for(var t=h.length;t;){for(c=h,h=[];++u1)for(var r=1;rn&&c.copy(a));c.radius=.5*(n+i+e),c.center.addScaledVector(s,.5+i)}}),c}}();function h(e,t,r,n){n=void 0===n?.1:n;var i=e.position.distanceTo(t),o=i-r,a=i+r;e.near=(1-n)*o,e.far=(1+n)*a,e.near=Math.max(e.near,.01*r)}function l(e,t,r,n){n=void 0===n?20:n;var i=e.position.distanceTo(t),o=i-r,a=i+r;e.near=1/n*o,e.far=n*a,e.near=Math.max(e.near,.001*r)}function u(e){var t;return 0===(t=Array.isArray(e)?e:Object.keys(e).map(function(t){return e[t]})).length?t:t[0]instanceof i.WidgetModel?t:a.flatten(t.map(function(e){return u(e)}),!0)}function p(e,t){return{added:a.difference(e,t),removed:a.difference(t,e),kept:a.intersection(t,e)}}function d(e,t){var r=Object.keys(e),n=Object.keys(t);return{added:a.difference(r,n).map(function(t){return e[t]}),removed:a.difference(n,r).map(function(e){return t[e]}),kept:a.intersection(r,n).map(function(t){return e[t]})}}var f={};e.exports={createModel:function(e,t,r){var n=i.uuid(),o=new e({},{widget_manager:t,model_id:n,three_obj:r});o.name=e.model_name,o.module=e.model_module;var s=o.initPromise.then(function(){var r=i.remove_buffers(o.serialize(o.get_state(!0))),s={state:a.extend({},r.state,{_model_name:e.model_name,_model_module:e.model_module,_model_module_version:e.model_module_version,_view_name:null,_view_module:null,_view_module_version:""}),buffer_paths:r.buffer_paths},c=r.buffers,h={version:i.PROTOCOL_VERSION};return t._create_comm(t.comm_target_name,n,s,h,c)}).then(function(e){return o.comm=e,e.on_close(a.bind(o._handle_comm_closed,o)),e.on_msg(a.bind(o._handle_comm_msg,o)),o.comm_live=!0,o});return t.register_model(n,s),s},computeBoundingSphere:c,computeBoundingBox:s,customModelsLut:f,shrinkFrustumPlanes:h,safeFrustumPlanes:l,lookAtSphere:function(e,t,r,n){n=void 0===n?"safe":n,e.isPerspectiveCamera||console.error("Expecting a perspective camera.");var i=1.5*r/Math.tan(.5*e.fov*Math.PI/180);if(e.position.setX(t.x),e.position.setY(t.y),e.position.setZ(t.z+i),e.lookAt(t.clone()),"tight"===n)h(e,t,r);else if("safe"===n)l(e,t,r);else if(n)throw new Error("setNearFar argument to lookAtSphere invalid: "+n);e.updateProjectionMatrix()},childModelsNested:u,arrayDiff:p,dictDiff:d,nestedDiff:function(e,t){var r;r=Array.isArray(e)?p(e,t):d(e,t);var n=a.flatten([r.added,r.removed,r.kept]);return 0===n.length?n:n[0]instanceof i.WidgetModel?r:{added:u(r.added),removed:u(r.removed)}},getObjectScene:function(e){for(;e.parent;)e=e.parent;return"Scene"===e.type?e:null},getModelScene:function(e){for(var t=e.obj;t.parent;)t=t.parent;return"Scene"===t.type?t.ipymodel:null},lookupThreeConstructorName:function(e){var t=e.constructor.name;return void 0!==o[t]?t:void 0!==f[t]?f[t]:(n||(n=Object.keys(o).reduce(function(e,t){var r=o[t];return r.prototype&&r.prototype.constructor.name&&(e[r.prototype.constructor.name]=t),e},{})),n[t])}}},function(e,t,r){var n=r(131),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();e.exports=o},function(e,t,r){var n=r(8).Buffer,i=r(63).Transform,o=r(67).StringDecoder;function a(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(6)(a,i),a.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=a},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3)),a=(r(4),r(5).ThreeModel),s=a.extend({defaults:function(){return n.extend(a.prototype.defaults.call(this),{name:"",times:void 0,values:void 0,interpolation:"InterpolateLinear"})},constructThreeObject:function(){var e=new i.KeyframeTrack(this.get("name"),this.convertArrayBufferModelToThree(this.get("times"),"times"),this.convertArrayBufferModelToThree(this.get("values"),"values"),this.convertEnumModelToThree(this.get("interpolation"),"interpolation"));return Promise.resolve(e)},createPropertiesArrays:function(){a.prototype.createPropertiesArrays.call(this),this.datawidget_properties.push("times"),this.datawidget_properties.push("values"),this.enum_property_types.interpolation="InterpolationModes",this.property_converters.name=null,this.property_converters.times="convertArrayBuffer",this.property_converters.values="convertArrayBuffer",this.property_converters.interpolation="convertEnum"}},{model_name:"KeyframeTrackModel",serializers:n.extend({times:o.data_union_serialization,values:o.data_union_serialization},a.serializers)});e.exports={KeyframeTrackModel:s}},function(e,t,r){var n=r(170),i=r(171),o="undefined"!=typeof Float64Array;function a(e,t){return e[0]-t[0]}function s(){var e,t=this.stride,r=new Array(t.length);for(e=0;eMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===t&&o.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):o.push("ORDER})")),o.push("proto.set=function "+r+"_set("+c.join(",")+",v){"),i?o.push("return this.data.set("+l+",v)}"):o.push("return this.data["+l+"]=v}"),o.push("proto.get=function "+r+"_get("+c.join(",")+"){"),i?o.push("return this.data.get("+l+")}"):o.push("return this.data["+l+"]}"),o.push("proto.index=function "+r+"_index(",c.join(),"){return "+l+"}"),o.push("proto.hi=function "+r+"_hi("+c.join(",")+"){return new "+r+"(this.data,"+a.map(function(e){return["(typeof i",e,"!=='number'||i",e,"<0)?this.shape[",e,"]:i",e,"|0"].join("")}).join(",")+","+a.map(function(e){return"this.stride["+e+"]"}).join(",")+",this.offset)}");var d=a.map(function(e){return"a"+e+"=this.shape["+e+"]"}),f=a.map(function(e){return"c"+e+"=this.stride["+e+"]"});o.push("proto.lo=function "+r+"_lo("+c.join(",")+"){var b=this.offset,d=0,"+d.join(",")+","+f.join(","));for(var m=0;m=0){d=i"+m+"|0;b+=c"+m+"*d;a"+m+"-=d}");o.push("return new "+r+"(this.data,"+a.map(function(e){return"a"+e}).join(",")+","+a.map(function(e){return"c"+e}).join(",")+",b)}"),o.push("proto.step=function "+r+"_step("+c.join(",")+"){var "+a.map(function(e){return"a"+e+"=this.shape["+e+"]"}).join(",")+","+a.map(function(e){return"b"+e+"=this.stride["+e+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(m=0;m=0){c=(c+this.stride["+m+"]*i"+m+")|0}else{a.push(this.shape["+m+"]);b.push(this.stride["+m+"])}");return o.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),o.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+a.map(function(e){return"shape["+e+"]"}).join(",")+","+a.map(function(e){return"stride["+e+"]"}).join(",")+",offset)}"),new Function("CTOR_LIST","ORDER",o.join("\n"))(h[e],s)}var h={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=function(e,t,r,n){if(void 0===e)return(0,h.array[0])([]);"number"==typeof e&&(e=[e]),void 0===t&&(t=[e.length]);var a=t.length;if(void 0===r){r=new Array(a);for(var s=a-1,l=1;s>=0;--s)r[s]=l,l*=t[s]}if(void 0===n)for(n=0,s=0;s'),this.teardownViewer(),this.$frozenRenderer=this.$el.find("img"),this.updateSize(),this.controls&&this.$frozenRenderer.on("mouseenter",n.bind(function(){this.debug("frozenRenderer.mouseenter"),this.tick()},this)))},teardownViewer:function(){this.$renderer.off("mouseenter"),this.$renderer.off("mouseleave"),this.isFrozen=!0,c.release(this.renderer),this.$renderer=null,this.renderer=null,this.controls&&this.disableControls(),this.$el.css("margin-bottom","auto")},enableControls:function(){this.debug("Enable controls");var e=this;this.controls.forEach(function(t){t.enabled=!0,t.connectEvents(e.$renderer[0]),t.addEventListener("change",e.tick.bind(e))})},disableControls:function(){this.debug("Disable controls");var e=this;this.controls.forEach(function(t){t.enabled=!1,t.dispose(),t.removeEventListener("change",e.tick.bind(e))})},onCustomMessage:function(e,t){switch(e.type){case"freeze":this.freeze()}},onRendererReclaimed:function(){this.debug("ThreeView WebGL context is being reclaimed: "+this.renderer.poolId),this.freeze()},log:function(e){console.log("TV("+this.id+"): "+e)},debug:function(e){console.debug("TV("+this.id+"): "+e)},lazyRendererSetup:function(){throw new Error("RenderableView should not be used directly, please subclass!")}});e.exports={RenderableModel:u,RenderableView:p}},function(e,t,r){"use strict";(function(t,n){var i=r(8).Buffer,o=t.crypto||t.msCrypto;o&&o.getRandomValues?e.exports=function(e,r){if(e>65536)throw new Error("requested too many random bytes");var a=new t.Uint8Array(e);e>0&&o.getRandomValues(a);var s=i.from(a.buffer);if("function"==typeof r)return n.nextTick(function(){r(null,s)});return s}:e.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,r(17),r(20))},function(e,t,r){var n=r(8).Buffer;function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,i=this._blockSize,o=e.length,a=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},function(e,t,r){var n=r(278),i=r(283);e.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4),r(7).Object3DModel),a=o.extend({defaults:function(){return n.extend(o.prototype.defaults.call(this),{matrixWorldInverse:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],projectionMatrix:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],type:"Camera"})},constructThreeObject:function(){var e=new i.Camera;return Promise.resolve(e)},createPropertiesArrays:function(){o.prototype.createPropertiesArrays.call(this),this.props_created_by_three.matrixWorldInverse=!0,this.props_created_by_three.projectionMatrix=!0,this.props_created_by_three.type=!0,this.props_created_by_three.rotation=!0,this.props_created_by_three.quaternion=!0,this.props_created_by_three.matrixWorldNeedsUpdate=!0,this.property_converters.matrixWorldInverse="convertMatrix",this.property_converters.projectionMatrix="convertMatrix",this.property_converters.type=null,this.property_assigners.matrixWorldInverse="assignMatrix",this.property_assigners.projectionMatrix="assignMatrix"}},{model_name:"CameraModel",serializers:n.extend({},o.serializers)});e.exports={CameraModel:a}},function(e,t,r){r(1);var n=r(458).LightShadowModel,i=n.extend({syncToThreeObj:function(e){(e||this.hasChanged("mapSize"))&&(this.obj.map=null),n.prototype.syncToThreeObj.apply(this,arguments)}});e.exports={LightShadowModel:i}},function(e,t,r){"use strict";var n=r(6),i=r(62),o=r(68),a=r(69),s=r(23);function c(e){s.call(this,"digest"),this._hash=e}n(c,s),c.prototype._update=function(e){this._hash.update(e)},c.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new o:new c(a(e))}},function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,r(10).Buffer)},function(e,t,r){(function(t){e.exports=function(e,r){for(var n=Math.min(e.length,r.length),i=new t(n),o=0;o=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o>>24]^l[f>>>16&255]^u[m>>>8&255]^p[255&v]^t[y++],a=h[f>>>24]^l[m>>>16&255]^u[v>>>8&255]^p[255&d]^t[y++],s=h[m>>>24]^l[v>>>16&255]^u[d>>>8&255]^p[255&f]^t[y++],c=h[v>>>24]^l[d>>>16&255]^u[f>>>8&255]^p[255&m]^t[y++],d=o,f=a,m=s,v=c;return o=(n[d>>>24]<<24|n[f>>>16&255]<<16|n[m>>>8&255]<<8|n[255&v])^t[y++],a=(n[f>>>24]<<24|n[m>>>16&255]<<16|n[v>>>8&255]<<8|n[255&d])^t[y++],s=(n[m>>>24]<<24|n[v>>>16&255]<<16|n[d>>>8&255]<<8|n[255&f])^t[y++],c=(n[v>>>24]<<24|n[d>>>16&255]<<16|n[f>>>8&255]<<8|n[255&m])^t[y++],[o>>>=0,a>>>=0,s>>>=0,c>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,c=0;c<256;++c){var h=s^s<<1^s<<2^s<<3^s<<4;h=h>>>8^255&h^99,r[a]=h,n[h]=a;var l=e[a],u=e[l],p=e[u],d=257*e[h]^16843008*h;i[0][a]=d<<24|d>>>8,i[1][a]=d<<16|d>>>16,i[2][a]=d<<8|d>>>24,i[3][a]=d,d=16843009*p^65537*u^257*l^16843008*a,o[0][h]=d<<24|d>>>8,o[1][h]=d<<16|d>>>16,o[2][h]=d<<8|d>>>24,o[3][h]=d,0===a?a=s=1:(a=l^e[e[e[p^l]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function h(e){this._key=i(e),this._reset()}h.blockSize=16,h.keySize=32,h.prototype.blockSize=h.blockSize,h.prototype.keySize=h.keySize,h.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,n=4*(r+1),i=[],o=0;o>>24,a=c.SBOX[a>>>24]<<24|c.SBOX[a>>>16&255]<<16|c.SBOX[a>>>8&255]<<8|c.SBOX[255&a],a^=s[o/t|0]<<24):t>6&&o%t==4&&(a=c.SBOX[a>>>24]<<24|c.SBOX[a>>>16&255]<<16|c.SBOX[a>>>8&255]<<8|c.SBOX[255&a]),i[o]=i[o-t]^a}for(var h=[],l=0;l>>24]]^c.INV_SUB_MIX[1][c.SBOX[p>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[p>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&p]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=h},h.prototype.encryptBlockRaw=function(e){return a(e=i(e),this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},h.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},h.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var r=a(e,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},h.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},e.exports.AES=h},function(e,t,r){var n=r(8).Buffer,i=r(62);e.exports=function(e,t,r,o){if(n.isBuffer(e)||(e=n.from(e,"binary")),t&&(n.isBuffer(t)||(t=n.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=r/8,s=n.alloc(a),c=n.alloc(o||0),h=n.alloc(0);a>0||o>0;){var l=new i;l.update(h),l.update(e),t&&l.update(t),h=l.digest();var u=0;if(a>0){var p=s.length-a;u=Math.min(a,h.length),h.copy(s,p,0,u),a-=u}if(u0){var d=c.length-o,f=Math.min(o,h.length-u);h.copy(c,d,u,u+f),o-=f}}return h.fill(0),{key:s,iv:c}}},function(e,t,r){"use strict";var n=t;n.base=r(223),n.short=r(224),n.mont=r(225),n.edwards=r(226)},function(e,t,r){(function(t){var n=r(242),i=r(254),o=r(255),a=r(71),s=r(105);function c(e){var r;"object"!=typeof e||t.isBuffer(e)||(r=e.passphrase,e=e.key),"string"==typeof e&&(e=new t(e));var c,h,l=o(e,r),u=l.tag,p=l.data;switch(u){case"CERTIFICATE":h=n.certificate.decode(p,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(h||(h=n.PublicKey.decode(p,"der")),c=h.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(h.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return h.subjectPrivateKey=h.subjectPublicKey,{type:"ec",data:h};case"1.2.840.10040.4.1":return h.algorithm.params.pub_key=n.DSAparam.decode(h.subjectPublicKey.data,"der"),{type:"dsa",data:h.algorithm.params};default:throw new Error("unknown key id "+c)}throw new Error("unknown key type "+u);case"ENCRYPTED PRIVATE KEY":p=function(e,r){var n=e.algorithm.decrypt.kde.kdeparams.salt,o=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),c=i[e.algorithm.decrypt.cipher.algo.join(".")],h=e.algorithm.decrypt.cipher.iv,l=e.subjectPrivateKey,u=parseInt(c.split("-")[1],10)/8,p=s.pbkdf2Sync(r,n,o,u),d=a.createDecipheriv(c,p,h),f=[];return f.push(d.update(l)),f.push(d.final()),t.concat(f)}(p=n.EncryptedPrivateKey.decode(p,"der"),r);case"PRIVATE KEY":switch(c=(h=n.PrivateKey.decode(p,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(h.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:h.algorithm.curve,privateKey:n.ECPrivateKey.decode(h.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return h.algorithm.params.priv_key=n.DSAparam.decode(h.subjectPrivateKey,"der"),{type:"dsa",params:h.algorithm.params};default:throw new Error("unknown key id "+c)}throw new Error("unknown key type "+u);case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(p,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(p,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(p,"der")};case"EC PRIVATE KEY":return{curve:(p=n.ECPrivateKey.decode(p,"der")).parameters.value,privateKey:p.privateKey};default:throw new Error("unknown key type "+u)}}e.exports=c,c.signature=n.signature}).call(this,r(10).Buffer)},function(e,t,r){var n=r(268),i=r(269),o=r(270),a=r(271),s=r(272);function c(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\n\t\tuniform float linewidth;\n\t\tuniform vec2 resolution;\n\n\t\tattribute vec3 instanceStart;\n\t\tattribute vec3 instanceEnd;\n\n\t\tattribute vec3 instanceColorStart;\n\t\tattribute vec3 instanceColorEnd;\n\n\t\tvarying vec2 vUv;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashScale;\n\t\t\tattribute float instanceDistanceStart;\n\t\t\tattribute float instanceDistanceEnd;\n\t\t\tvarying float vLineDistance;\n\n\t\t#endif\n\n\t\tvoid trimSegment( const in vec4 start, inout vec4 end ) {\n\n\t\t\t// trim end segment so it terminates between the camera plane and the near plane\n\n\t\t\t// conservative estimate of the near plane\n\t\t\tfloat a = projectionMatrix[ 2 ][ 2 ]; // 3nd entry in 3th column\n\t\t\tfloat b = projectionMatrix[ 3 ][ 2 ]; // 3nd entry in 4th column\n\t\t\tfloat nearEstimate = - 0.5 * b / a;\n\n\t\t\tfloat alpha = ( nearEstimate - start.z ) / ( end.z - start.z );\n\n\t\t\tend.xyz = mix( start.xyz, end.xyz, alpha );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\t#ifdef USE_COLOR\n\n\t\t\t\tvColor.xyz = ( position.y < 0.5 ) ? instanceColorStart : instanceColorEnd;\n\n\t\t\t#endif\n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tvLineDistance = ( position.y < 0.5 ) ? dashScale * instanceDistanceStart : dashScale * instanceDistanceEnd;\n\n\t\t\t#endif\n\n\t\t\tfloat aspect = resolution.x / resolution.y;\n\n\t\t\tvUv = uv;\n\n\t\t\t// camera space\n\t\t\tvec4 start = modelViewMatrix * vec4( instanceStart, 1.0 );\n\t\t\tvec4 end = modelViewMatrix * vec4( instanceEnd, 1.0 );\n\n\t\t\t// special case for perspective projection, and segments that terminate either in, or behind, the camera plane\n\t\t\t// clearly the gpu firmware has a way of addressing this issue when projecting into ndc space\n\t\t\t// but we need to perform ndc-space calculations in the shader, so we must address this issue directly\n\t\t\t// perhaps there is a more elegant solution -- WestLangley\n\n\t\t\tbool perspective = ( projectionMatrix[ 2 ][ 3 ] == - 1.0 ); // 4th entry in the 3rd column\n\n\t\t\tif ( perspective ) {\n\n\t\t\t\tif ( start.z < 0.0 && end.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( start, end );\n\n\t\t\t\t} else if ( end.z < 0.0 && start.z >= 0.0 ) {\n\n\t\t\t\t\ttrimSegment( end, start );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// clip space\n\t\t\tvec4 clipStart = projectionMatrix * start;\n\t\t\tvec4 clipEnd = projectionMatrix * end;\n\n\t\t\t// ndc space\n\t\t\tvec2 ndcStart = clipStart.xy / clipStart.w;\n\t\t\tvec2 ndcEnd = clipEnd.xy / clipEnd.w;\n\n\t\t\t// direction\n\t\t\tvec2 dir = ndcEnd - ndcStart;\n\n\t\t\t// account for clip-space aspect ratio\n\t\t\tdir.x *= aspect;\n\t\t\tdir = normalize( dir );\n\n\t\t\t// perpendicular to dir\n\t\t\tvec2 offset = vec2( dir.y, - dir.x );\n\n\t\t\t// undo aspect ratio adjustment\n\t\t\tdir.x /= aspect;\n\t\t\toffset.x /= aspect;\n\n\t\t\t// sign flip\n\t\t\tif ( position.x < 0.0 ) offset *= - 1.0;\n\n\t\t\t// endcaps\n\t\t\tif ( position.y < 0.0 ) {\n\n\t\t\t\toffset += - dir;\n\n\t\t\t} else if ( position.y > 1.0 ) {\n\n\t\t\t\toffset += dir;\n\n\t\t\t}\n\n\t\t\t// adjust for linewidth\n\t\t\toffset *= linewidth;\n\n\t\t\t// adjust for clip-space to screen-space conversion // maybe resolution should be based on viewport ...\n\t\t\toffset /= resolution.y;\n\n\t\t\t// select end\n\t\t\tvec4 clip = ( position.y < 0.5 ) ? clipStart : clipEnd;\n\n\t\t\t// back to clip space\n\t\t\toffset *= clip.w;\n\n\t\t\tclip.xy += offset;\n\n\t\t\tgl_Position = clip;\n\n\t\t\tvec4 mvPosition = ( position.y < 0.5 ) ? start : end; // this is an approximation\n\n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\n\t\t}\n\t\t",fragmentShader:"\n\t\tuniform vec3 diffuse;\n\t\tuniform float opacity;\n\n\t\t#ifdef USE_DASH\n\n\t\t\tuniform float dashSize;\n\t\t\tuniform float gapSize;\n\n\t\t#endif\n\n\t\tvarying float vLineDistance;\n\n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\t\t#include \n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include \n\n\t\t\t#ifdef USE_DASH\n\n\t\t\t\tif ( vUv.y < - 1.0 || vUv.y > 1.0 ) discard; // discard endcaps\n\n\t\t\t\tif ( mod( vLineDistance, dashSize + gapSize ) > dashSize ) discard; // todo - FIX\n\n\t\t\t#endif\n\n\t\t\tif ( abs( vUv.y ) > 1.0 ) {\n\n\t\t\t\tfloat a = vUv.x;\n\t\t\t\tfloat b = ( vUv.y > 0.0 ) ? vUv.y - 1.0 : vUv.y + 1.0;\n\t\t\t\tfloat len2 = a * a + b * b;\n\n\t\t\t\tif ( len2 > 1.0 ) discard;\n\n\t\t\t}\n\n\t\t\tvec4 diffuseColor = vec4( diffuse, opacity );\n\n\t\t\t#include \n\t\t\t#include \n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );\n\n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\t\t\t#include \n\n\t\t}\n\t\t"};var i=function(e){n.ShaderMaterial.call(this,{type:"LineMaterial",uniforms:n.UniformsUtils.clone(lineShaders.uniforms),vertexShader:lineShaders.vertexShader,fragmentShader:lineShaders.fragmentShader}),this.dashed=!1,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(e){this.uniforms.diffuse.value=e}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(e){this.uniforms.linewidth.value=e}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(e){this.uniforms.dashScale.value=e}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(e){this.uniforms.dashSize.value=e}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(e){this.uniforms.gapSize.value=e}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(e){this.uniforms.resolution.value.copy(e)}}}),this.setValues(e)};(i.prototype=Object.create(n.ShaderMaterial.prototype)).constructor=i,i.prototype.isLineMaterial=!0,i.prototype.copy=function(e){return n.ShaderMaterial.prototype.copy.call(this,e),this.color.copy(e.color),this.linewidth=e.linewidth,this.resolution=e.resolution,this.dashScale=e.dashScale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this},e.exports={LineMaterial:i}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4),r(5).ThreeModel),a=o.extend({defaults:function(){return n.extend(o.prototype.defaults.call(this),{normal:[0,0,0],constant:0})},constructThreeObject:function(){var e=new i.Plane(this.convertVectorModelToThree(this.get("normal"),"normal"),this.convertFloatModelToThree(this.get("constant"),"constant"));return Promise.resolve(e)},createPropertiesArrays:function(){o.prototype.createPropertiesArrays.call(this),this.property_converters.normal="convertVector",this.property_converters.constant="convertFloat",this.property_assigners.normal="assignVector"}},{model_name:"PlaneModel",serializers:n.extend({},o.serializers)});e.exports={PlaneModel:a}},function(e,t,r){var n=r(1),i=r(532).MeshModel,o={serialize:function(e,t){if(void 0===e)return[]}},a=i.extend({},{serializers:n.extend({morphTargetInfluences:o},i.serializers)});e.exports={MeshModel:a}},function(e,t,r){e.exports.version=r(44).version;var n=[r(166),r(333),r(347),r(352),r(362),r(371),r(388),r(397),r(416),r(451),r(469),r(470),r(474),r(492),r(507),r(523),r(541),r(560),r(562),r(61)];for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];for(var a in o)o.hasOwnProperty(a)&&(e.exports[a]=o[a])}},function(e,t){e.exports.EXTENSION_SPEC_VERSION="2.0.0"},function(e,t,r){"use strict";(function(t){var n=r(6),i=r(95),o=new Array(16);function a(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function s(e,t){return e<>>32-t}function c(e,t,r,n,i,o,a){return s(e+(t&r|~t&n)+i+o|0,a)+t|0}function h(e,t,r,n,i,o,a){return s(e+(t&n|r&~n)+i+o|0,a)+t|0}function l(e,t,r,n,i,o,a){return s(e+(t^r^n)+i+o|0,a)+t|0}function u(e,t,r,n,i,o,a){return s(e+(r^(t|~n))+i+o|0,a)+t|0}n(a,i),a.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,a=this._d;n=u(n=u(n=u(n=u(n=l(n=l(n=l(n=l(n=h(n=h(n=h(n=h(n=c(n=c(n=c(n=c(n,i=c(i,a=c(a,r=c(r,n,i,a,e[0],3614090360,7),n,i,e[1],3905402710,12),r,n,e[2],606105819,17),a,r,e[3],3250441966,22),i=c(i,a=c(a,r=c(r,n,i,a,e[4],4118548399,7),n,i,e[5],1200080426,12),r,n,e[6],2821735955,17),a,r,e[7],4249261313,22),i=c(i,a=c(a,r=c(r,n,i,a,e[8],1770035416,7),n,i,e[9],2336552879,12),r,n,e[10],4294925233,17),a,r,e[11],2304563134,22),i=c(i,a=c(a,r=c(r,n,i,a,e[12],1804603682,7),n,i,e[13],4254626195,12),r,n,e[14],2792965006,17),a,r,e[15],1236535329,22),i=h(i,a=h(a,r=h(r,n,i,a,e[1],4129170786,5),n,i,e[6],3225465664,9),r,n,e[11],643717713,14),a,r,e[0],3921069994,20),i=h(i,a=h(a,r=h(r,n,i,a,e[5],3593408605,5),n,i,e[10],38016083,9),r,n,e[15],3634488961,14),a,r,e[4],3889429448,20),i=h(i,a=h(a,r=h(r,n,i,a,e[9],568446438,5),n,i,e[14],3275163606,9),r,n,e[3],4107603335,14),a,r,e[8],1163531501,20),i=h(i,a=h(a,r=h(r,n,i,a,e[13],2850285829,5),n,i,e[2],4243563512,9),r,n,e[7],1735328473,14),a,r,e[12],2368359562,20),i=l(i,a=l(a,r=l(r,n,i,a,e[5],4294588738,4),n,i,e[8],2272392833,11),r,n,e[11],1839030562,16),a,r,e[14],4259657740,23),i=l(i,a=l(a,r=l(r,n,i,a,e[1],2763975236,4),n,i,e[4],1272893353,11),r,n,e[7],4139469664,16),a,r,e[10],3200236656,23),i=l(i,a=l(a,r=l(r,n,i,a,e[13],681279174,4),n,i,e[0],3936430074,11),r,n,e[3],3572445317,16),a,r,e[6],76029189,23),i=l(i,a=l(a,r=l(r,n,i,a,e[9],3654602809,4),n,i,e[12],3873151461,11),r,n,e[15],530742520,16),a,r,e[2],3299628645,23),i=u(i,a=u(a,r=u(r,n,i,a,e[0],4096336452,6),n,i,e[7],1126891415,10),r,n,e[14],2878612391,15),a,r,e[5],4237533241,21),i=u(i,a=u(a,r=u(r,n,i,a,e[12],1700485571,6),n,i,e[3],2399980690,10),r,n,e[10],4293915773,15),a,r,e[1],2240044497,21),i=u(i,a=u(a,r=u(r,n,i,a,e[8],1873313359,6),n,i,e[15],4264355552,10),r,n,e[6],2734768916,15),a,r,e[13],1309151649,21),i=u(i,a=u(a,r=u(r,n,i,a,e[4],4149444226,6),n,i,e[11],3174756917,10),r,n,e[2],718787259,15),a,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+a|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=new t(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=a}).call(this,r(10).Buffer)},function(e,t,r){e.exports=i;var n=r(64).EventEmitter;function i(){n.call(this)}r(6)(i,n),i.Readable=r(65),i.Writable=r(186),i.Duplex=r(187),i.Transform=r(188),i.PassThrough=r(189),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",c));var a=!1;function s(){a||(a=!0,e.end())}function c(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function h(e){if(l(),0===n.listenerCount(this,"error"))throw e}function l(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",c),r.removeListener("error",h),e.removeListener("error",h),r.removeListener("end",l),r.removeListener("close",l),e.removeListener("close",l)}return r.on("error",h),e.on("error",h),r.on("end",l),r.on("close",l),e.on("close",l),e.emit("pipe",r),e}},function(e,t){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(e){return"function"==typeof e}function i(e){return"object"==typeof e&&null!==e}function o(e){return void 0===e}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!function(e){return"number"==typeof e}(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,r,a,s,c,h;if(this._events||(this._events={}),"error"===e&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}if(o(r=this._events[e]))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(i(r))for(s=Array.prototype.slice.call(arguments,1),a=(h=r.slice()).length,c=0;c0&&this._events[e].length>a&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){if(!n(t))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(e,i),r||(r=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},r.prototype.removeListener=function(e,t){var r,o,a,s;if(!n(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(a=(r=this._events[e]).length,o=-1,r===t||n(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(i(r)){for(s=a;s-- >0;)if(r[s]===t||r[s].listener&&r[s].listener===t){o=s;break}if(o<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?n(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(n(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,r){(t=e.exports=r(96)).Stream=t,t.Readable=t,t.Writable=r(66),t.Duplex=r(26),t.Transform=r(99),t.PassThrough=r(185)},function(e,t,r){"use strict";(function(t,n,i){var o=r(46);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;e.entry=null;for(;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=g;var s,c=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:o.nextTick;g.WritableState=y;var h=r(35);h.inherits=r(6);var l={deprecate:r(184)},u=r(97),p=r(8).Buffer,d=i.Uint8Array||function(){};var f,m=r(98);function v(){}function y(e,t){s=s||r(26),e=e||{};var n=t instanceof s;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,h=e.writableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(h||0===h)?h:l,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var u=!1===e.decodeStrings;this.decodeStrings=!u,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(T,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),T(e,t))}(e,r,n,t,i);else{var a=w(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||x(e,r),n?c(_,e,r,a,i):_(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function g(e){if(s=s||r(26),!(f.call(g,this)||this instanceof s))return new g(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function b(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function _(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),T(e,t)}function x(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var s=0,c=!0;r;)i[s]=r,r.isBuf||(c=!1),r=r.next,s+=1;i.allBuffers=c,b(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var h=r.chunk,l=r.encoding,u=r.callback;if(b(e,t,!1,t.objectMode?1:h.length,h,l,u),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function w(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function M(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),T(e,t)})}function T(e,t){var r=w(t);return r&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(M,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}h.inherits(g,u),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:l.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(e){return!!f.call(this,e)||this===g&&(e&&e._writableState instanceof y)}})):f=function(e){return e instanceof this},g.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},g.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&function(e){return p.isBuffer(e)||e instanceof d}(e);return a&&!p.isBuffer(e)&&(e=function(e){return p.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=v),n.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(n,a),i=!1),i}(this,n,e,r))&&(n.pendingcb++,i=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=p.from(t,r));return t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var c=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(g.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),g.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},g.prototype._writev=null,g.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,T(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),g.prototype.destroy=m.destroy,g.prototype._undestroy=m.undestroy,g.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(20),r(88).setImmediate,r(17))},function(e,t,r){"use strict";var n=r(8).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=h,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=l,this.end=u,t=3;break;default:return this.write=p,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function h(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function u(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function p(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(e.lastNeed=i-1),i;if(--n=0)return i>0&&(e.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";var n=r(10).Buffer,i=r(6),o=r(95),a=new Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],h=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],l=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],u=[0,1518500249,1859775393,2400959708,2840853838],p=[1352829926,1548603684,1836072691,2053994217,0];function d(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function f(e,t){return e<>>32-t}function m(e,t,r,n,i,o,a,s){return f(e+(t^r^n)+o+a|0,s)+i|0}function v(e,t,r,n,i,o,a,s){return f(e+(t&r|~t&n)+o+a|0,s)+i|0}function y(e,t,r,n,i,o,a,s){return f(e+((t|~r)^n)+o+a|0,s)+i|0}function g(e,t,r,n,i,o,a,s){return f(e+(t&n|r&~n)+o+a|0,s)+i|0}function b(e,t,r,n,i,o,a,s){return f(e+(t^(r|~n))+o+a|0,s)+i|0}i(d,o),d.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,d=0|this._e,_=0|this._a,x=0|this._b,w=0|this._c,M=0|this._d,T=0|this._e,S=0;S<80;S+=1){var E,A;S<16?(E=m(r,n,i,o,d,e[s[S]],u[0],h[S]),A=b(_,x,w,M,T,e[c[S]],p[0],l[S])):S<32?(E=v(r,n,i,o,d,e[s[S]],u[1],h[S]),A=g(_,x,w,M,T,e[c[S]],p[1],l[S])):S<48?(E=y(r,n,i,o,d,e[s[S]],u[2],h[S]),A=y(_,x,w,M,T,e[c[S]],p[2],l[S])):S<64?(E=g(r,n,i,o,d,e[s[S]],u[3],h[S]),A=v(_,x,w,M,T,e[c[S]],p[3],l[S])):(E=b(r,n,i,o,d,e[s[S]],u[4],h[S]),A=m(_,x,w,M,T,e[c[S]],p[4],l[S])),r=d,d=o,o=f(i,10),i=n,n=E,_=T,T=M,M=f(w,10),w=x,x=A}var P=this._b+i+M|0;this._b=this._c+o+T|0,this._c=this._d+d+_|0,this._d=this._e+r+x|0,this._e=this._a+n+w|0,this._a=P},d.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=d},function(e,t,r){(t=e.exports=function(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r}).sha=r(190),t.sha1=r(191),t.sha224=r(192),t.sha256=r(100),t.sha384=r(193),t.sha512=r(101)},function(e,t,r){"use strict";t.utils=r(199),t.Cipher=r(200),t.DES=r(201),t.CBC=r(202),t.EDE=r(203)},function(e,t,r){var n=r(204),i=r(212),o=r(111);t.createCipher=t.Cipher=n.createCipher,t.createCipheriv=t.Cipheriv=n.createCipheriv,t.createDecipher=t.Decipher=i.createDecipher,t.createDecipheriv=t.Decipheriv=i.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(o)}},function(e,t,r){var n={ECB:r(205),CBC:r(206),CFB:r(207),CFB8:r(208),CFB1:r(209),OFB:r(210),CTR:r(109),GCM:r(109)},i=r(111);for(var o in i)i[o].module=n[i[o].mode];e.exports=i},function(e,t,r){(function(t){var n=r(12),i=r(29);function o(e,r){var i=function(e){var t=a(e);return{blinder:t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(r),o=r.modulus.byteLength(),s=(n.mont(r.modulus),new n(e).mul(i.blinder).umod(r.modulus)),c=s.toRed(n.mont(r.prime1)),h=s.toRed(n.mont(r.prime2)),l=r.coefficient,u=r.prime1,p=r.prime2,d=c.redPow(r.exponent1),f=h.redPow(r.exponent2);d=d.fromRed(),f=f.fromRed();var m=d.isub(f).imul(l).umod(u);return m.imul(p),f.iadd(m),new t(f.imul(i.unblinder).umod(r.modulus).toArray(!1,o))}function a(e){for(var t=e.modulus.byteLength(),r=new n(i(t));r.cmp(e.modulus)>=0||!r.umod(e.prime1)||!r.umod(e.prime2);)r=new n(i(t));return r}e.exports=o,o.getr=a}).call(this,r(10).Buffer)},function(e,t,r){var n=t;n.utils=r(19),n.common=r(37),n.sha=r(228),n.ripemd=r(232),n.hmac=r(233),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(e,t,r){var n=r(31)(r(22),"Map");e.exports=n},function(e,t,r){var n=r(22).Symbol;e.exports=n},function(e,t){var r=Array.isArray;e.exports=r},function(e,t,r){var n=r(0),i=function(e,t){this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.target=new n.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.25,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!1,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:n.MOUSE.LEFT,MIDDLE:n.MOUSE.MIDDLE,RIGHT:n.MOUSE.RIGHT},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return l.phi},this.getAzimuthalAngle=function(){return l.theta},this.reset=function(){r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(i),r.update(),c=s.NONE},this.update=function(){var t=new n.Vector3,o=(new n.Quaternion).setFromUnitVectors(e.up,new n.Vector3(0,1,0)),a=o.clone().inverse(),m=new n.Vector3,v=new n.Quaternion;return function(){var e=r.object.position;return t.copy(e).sub(r.target),t.applyQuaternion(o),l.setFromVector3(t),r.autoRotate&&c===s.NONE&&S(2*Math.PI/60/60*r.autoRotateSpeed),l.theta+=u.theta,l.phi+=u.phi,l.theta=Math.max(r.minAzimuthAngle,Math.min(r.maxAzimuthAngle,l.theta)),l.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,l.phi)),l.makeSafe(),l.radius*=p,l.radius=Math.max(r.minDistance,Math.min(r.maxDistance,l.radius)),r.target.add(d),t.setFromSpherical(l),t.applyQuaternion(a),e.copy(r.target).add(t),r.object.lookAt(r.target),void 0!==r.object.focus&&(r.object.focus=r.object.position.distanceTo(r.target)),!0===r.enableDamping?(u.theta*=1-r.dampingFactor,u.phi*=1-r.dampingFactor,d.multiplyScalar(1-r.dampingFactor)):(u.set(0,0,0),d.set(0,0,0)),p=1,!!(f||m.distanceToSquared(r.object.position)>h||8*(1-v.dot(r.object.quaternion))>h)&&(r.dispatchEvent(i),m.copy(r.object.position),v.copy(r.object.quaternion),f=!1,!0)}}(),this.connectEvents=function(e){e&&(r.domElement=e),r.domElement.addEventListener("contextmenu",U,!1),r.domElement.addEventListener("mousedown",B,!1),r.domElement.addEventListener("mousewheel",F,{passive:!1}),r.domElement.addEventListener("MozMousePixelScroll",F,{passive:!1}),r.domElement.addEventListener("touchstart",I,{passive:!0}),r.domElement.addEventListener("touchend",N,!1),r.domElement.addEventListener("touchmove",D,{passive:!1}),r.domElement.addEventListener("keydown",z,!1)},this.dispose=function(){r.domElement.removeEventListener("contextmenu",U,!1),r.domElement.removeEventListener("mousedown",B,!1),r.domElement.removeEventListener("mousewheel",F,!1),r.domElement.removeEventListener("MozMousePixelScroll",F,!1),r.domElement.removeEventListener("touchstart",I,!1),r.domElement.removeEventListener("touchend",N,!1),r.domElement.removeEventListener("touchmove",D,!1),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",k,!1),document.removeEventListener("mouseout",k,!1),r.domElement.removeEventListener("keydown",z,!1)};var r=this,i={type:"change"},o={type:"start"},a={type:"end"},s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY_PAN:4},c=s.NONE,h=1e-6,l=new n.Spherical,u=new n.Spherical,p=1,d=new n.Vector3,f=!1,m=new n.Vector2,v=new n.Vector2,y=new n.Vector2,g=new n.Vector2,b=new n.Vector2,_=new n.Vector2,x=new n.Vector2,w=new n.Vector2,M=new n.Vector2;function T(){return Math.pow(.95,r.zoomSpeed)}function S(e){u.theta-=e}function E(e){u.phi-=e}var A=function(){var e=new n.Vector3;return function(t,r){e.setFromMatrixColumn(r,0),e.multiplyScalar(-t),d.add(e)}}(),P=function(){var e=new n.Vector3;return function(t,n){!0===r.screenSpacePanning?e.setFromMatrixColumn(n,1):(e.setFromMatrixColumn(n,0),e.crossVectors(r.object.up,e)),e.multiplyScalar(t),d.add(e)}}(),C=function(){var e=new n.Vector3;return function(t,n){var i=r.domElement===document?r.domElement.body:r.domElement;if("PerspectiveCamera"===r.object.type){var o=r.object.position;e.copy(o).sub(r.target);var a=e.length();a*=Math.tan(r.object.fov/2*Math.PI/180),A(2*t*a/i.clientHeight,r.object.matrix),P(2*n*a/i.clientHeight,r.object.matrix)}else"OrthographicCamera"===r.object.type?(A(t*(r.object.right-r.object.left)/r.object.zoom/i.clientWidth,r.object.matrix),P(n*(r.object.top-r.object.bottom)/r.object.zoom/i.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}}();function L(e){"PerspectiveCamera"===r.object.type?p/=e:"OrthographicCamera"===r.object.type?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom*e)),r.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function R(e){"PerspectiveCamera"===r.object.type?p*=e:"OrthographicCamera"===r.object.type?(r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/e)),r.object.updateProjectionMatrix(),f=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function O(e){g.set(e.clientX,e.clientY)}function B(e){if(!1!==r.enabled){if(e.preventDefault(),e.button===r.mouseButtons.LEFT)if(e.ctrlKey||e.metaKey){if(!1===r.enablePan)return;O(e),c=s.PAN}else{if(!1===r.enableRotate)return;!function(e){m.set(e.clientX,e.clientY)}(e),c=s.ROTATE}else if(e.button===r.mouseButtons.MIDDLE){if(!1===r.enableZoom)return;!function(e){x.set(e.clientX,e.clientY)}(e),c=s.DOLLY}else if(e.button===r.mouseButtons.RIGHT){if(!1===r.enablePan)return;O(e),c=s.PAN}c!==s.NONE&&(document.addEventListener("mousemove",j,!1),document.addEventListener("mouseup",k,!1),document.addEventListener("mouseout",k,!1),r.dispatchEvent(o))}}function j(e){if(!1!==r.enabled)if(e.preventDefault(),c===s.ROTATE){if(!1===r.enableRotate)return;!function(e){v.set(e.clientX,e.clientY),y.subVectors(v,m).multiplyScalar(r.rotateSpeed);var t=r.domElement===document?r.domElement.body:r.domElement;S(2*Math.PI*y.x/t.clientHeight),E(2*Math.PI*y.y/t.clientHeight),m.copy(v),r.update()}(e)}else if(c===s.DOLLY){if(!1===r.enableZoom)return;!function(e){w.set(e.clientX,e.clientY),M.subVectors(w,x),M.y>0?L(T()):M.y<0&&R(T()),x.copy(w),r.update()}(e)}else if(c===s.PAN){if(!1===r.enablePan)return;!function(e){b.set(e.clientX,e.clientY),_.subVectors(b,g).multiplyScalar(r.panSpeed),C(_.x,_.y),g.copy(b),r.update()}(e)}}function k(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),document.removeEventListener("mousemove",j,!1),document.removeEventListener("mouseup",k,!1),document.removeEventListener("mouseout",k,!1),r.dispatchEvent(a),c=s.NONE)}function F(e){!1!==r.enabled&&!1!==r.enableZoom&&c===s.NONE&&(e.preventDefault(),e.stopPropagation(),r.dispatchEvent(o),function(e){var t=0;void 0!==e.wheelDelta?t=e.wheelDelta:void 0!==e.detail&&(t=-e.detail),t>0?R(T()):t<0&&L(T()),r.update()}(e),r.dispatchEvent(a))}function z(e){!1!==r.enabled&&!1!==r.enableKeys&&!1!==r.enablePan&&function(e){switch(e.keyCode){case r.keys.UP:C(0,r.keyPanSpeed),r.update();break;case r.keys.BOTTOM:C(0,-r.keyPanSpeed),r.update();break;case r.keys.LEFT:C(r.keyPanSpeed,0),r.update();break;case r.keys.RIGHT:C(-r.keyPanSpeed,0),r.update()}}(e)}function I(e){if(!1!==r.enabled){switch(e.preventDefault(),e.touches.length){case 1:if(!1===r.enableRotate)return;!function(e){m.set(e.touches[0].pageX,e.touches[0].pageY)}(e),c=s.TOUCH_ROTATE;break;case 2:if(!1===r.enableZoom&&!1===r.enablePan)return;!function(e){if(r.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,i=Math.sqrt(t*t+n*n);x.set(0,i)}if(r.enablePan){var o=.5*(e.touches[0].pageX+e.touches[1].pageX),a=.5*(e.touches[0].pageY+e.touches[1].pageY);g.set(o,a)}}(e),c=s.TOUCH_DOLLY_PAN;break;default:c=s.NONE}c!==s.NONE&&r.dispatchEvent(o)}}function D(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:if(!1===r.enableRotate)return;if(c!==s.TOUCH_ROTATE)return;!function(e){v.set(e.touches[0].pageX,e.touches[0].pageY),y.subVectors(v,m).multiplyScalar(r.rotateSpeed);var t=r.domElement===document?r.domElement.body:r.domElement;S(2*Math.PI*y.x/t.clientHeight),E(2*Math.PI*y.y/t.clientHeight),m.copy(v),r.update()}(e);break;case 2:if(!1===r.enableZoom&&!1===r.enablePan)return;if(c!==s.TOUCH_DOLLY_PAN)return;!function(e){if(r.enableZoom){var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY,i=Math.sqrt(t*t+n*n);w.set(0,i),M.set(0,Math.pow(w.y/x.y,r.zoomSpeed)),L(M.y),x.copy(w)}if(r.enablePan){var o=.5*(e.touches[0].pageX+e.touches[1].pageX),a=.5*(e.touches[0].pageY+e.touches[1].pageY);b.set(o,a),_.subVectors(b,g).multiplyScalar(r.panSpeed),C(_.x,_.y),g.copy(b)}r.update()}(e);break;default:c=s.NONE}}function N(e){!1!==r.enabled&&(r.dispatchEvent(a),c=s.NONE)}function U(e){e.preventDefault()}this.connectEvents(),this.update()};(i.prototype=Object.create(n.EventDispatcher.prototype)).constructor=i,Object.defineProperties(i.prototype,{center:{get:function(){return console.warn("THREE.OrbitControls: .center has been renamed to .target"),this.target}},noZoom:{get:function(){return console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),!this.enableZoom},set:function(e){console.warn("THREE.OrbitControls: .noZoom has been deprecated. Use .enableZoom instead."),this.enableZoom=!e}},noRotate:{get:function(){return console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),!this.enableRotate},set:function(e){console.warn("THREE.OrbitControls: .noRotate has been deprecated. Use .enableRotate instead."),this.enableRotate=!e}},noPan:{get:function(){return console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),!this.enablePan},set:function(e){console.warn("THREE.OrbitControls: .noPan has been deprecated. Use .enablePan instead."),this.enablePan=!e}},noKeys:{get:function(){return console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),!this.enableKeys},set:function(e){console.warn("THREE.OrbitControls: .noKeys has been deprecated. Use .enableKeys instead."),this.enableKeys=!e}},staticMoving:{get:function(){return console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),!this.constraint.enableDamping},set:function(e){console.warn("THREE.OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead."),this.constraint.enableDamping=!e}},dynamicDampingFactor:{get:function(){return console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.constraint.dampingFactor},set:function(e){console.warn("THREE.OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead."),this.constraint.dampingFactor=e}}}),e.exports={OrbitControls:i}},function(e,t,r){r(1);var n=r(354),i=n.PerspectiveCameraModel.extend({syncToThreeObj:function(){n.PerspectiveCameraModel.prototype.syncToThreeObj.apply(this,arguments),this.obj.updateProjectionMatrix()}});e.exports={PerspectiveCameraModel:i}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4)),a=r(5).ThreeModel,s=(r(81).InterleavedBufferModel,a.extend({defaults:function(){return n.extend(a.prototype.defaults.call(this),{data:null,itemSize:0,offset:0,normalized:!1})},constructThreeObject:function(){var e=new i.InterleavedBufferAttribute(this.convertThreeTypeModelToThree(this.get("data"),"data"),this.get("itemSize"),this.get("offset"),this.convertBoolModelToThree(this.get("normalized"),"normalized"));return Promise.resolve(e)},createPropertiesArrays:function(){a.prototype.createPropertiesArrays.call(this),this.three_properties.push("data"),this.property_converters.data="convertThreeType",this.property_converters.itemSize=null,this.property_converters.offset=null,this.property_converters.normalized="convertBool"}},{model_name:"InterleavedBufferAttributeModel",serializers:n.extend({data:{deserialize:o.unpackThreeModel}},a.serializers)}));e.exports={InterleavedBufferAttributeModel:s}},function(e,t,r){var n=r(11),i=r(3),o=r(25),a=r(0),s=r(374).InterleavedBufferModel,c=s.extend({createPropertiesArrays:function(){s.prototype.createPropertiesArrays.call(this),this.property_mappers.InterleavedBufferArray="mapInterleavedBufferArray",delete this.property_converters.array},decodeData:function(){var e=i.getArray(this.get("array")),t=1===e.dimension?1:e.shape[e.dimension-1];return{array:this.convertArrayBufferModelToThree(e,"array"),itemSize:t}},constructThreeObject:function(){var e=this.decodeData(),t=new a.InterleavedBuffer(e.array,e.itemSize);return t.needsUpdate=!0,n.resolve(t)},mapInterleavedBufferArrayModelToThree:function(){var e=this.decodeData();this.obj.setArray(e.array),this.obj.needsUpdate=!0,this.set({version:this.obj.version},"pushFromThree")},mapInterleavedBufferArrayThreeToModel:function(){var e=this.obj.array,t=this.get("array");t?i.getArray(t).data.set(e):this.set("array",o(e,[this.obj.count,this.obj.itemSize]))},onChildChanged:function(e){e===this.get("array")&&this.mapInterleavedBufferArrayModelToThree()}});e.exports={InterleavedBufferModel:c}},function(e,t,r){var n=r(56).LineSegmentsGeometry,i=function(){n.call(this),this.type="LineGeometry"};i.prototype=Object.assign(Object.create(n.prototype),{constructor:i,isLineGeometry:!0,setPositions:function(e){for(var t=e.length-3,r=new Float32Array(2*t),i=0;i0){var n=this.freePool.pop(e);n?r=n.renderer:(n=this.freePool.shift(),r=this._replaceRenderer(n.renderer,e))}else if(this.numCreated<8)r=this._createRenderer(e);else{var i=this.claimedPool.pop(e),o=null===i;o&&(i=this.claimedPool.shift()),r=i.renderer;try{i.onReclaim()}catch(e){throw this.freePool.push(null,r),e}o&&(r=this._replaceRenderer(i.renderer,e))}return console.debug("RendererPool.acquire(id="+r.poolId+")"),this.claimedPool.push(e,function(e,t){return{id:e.poolId,claimTime:new Date,renderer:e,onReclaim:t}}(r,t)),r.clear(),r},release:function(e){console.debug("RendererPool.release(id="+e.poolId+")");var t=e.poolId,r=this.claimedPool.popFind(function(e){return e.renderer.poolId===t});r&&(this.freePool.push(r.key,r.value),r.value.onReclaim())},onContextLost:function(e){var t=this.claimedPool.popFind(function(t){return t.renderer.domElement===e.target});t?(this.freePool.push(t.key,t.value),t.value.onReclaim()):console.warn("Could not find lost context")}}),e.exports=new a},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r(169),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(17))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(25);function i(e){if("array"===e||"buffer"===e||"generic"===e)throw new Error("Cannot serialize ndarray with dtype: "+e+".");return"uint8_clamped"===e&&(e="uint8"),e}function o(e,r){return null===e?null:n(new t.typesToArray[e.dtype](e.buffer.buffer),e.shape)}function a(e,t){if(null===e)return null;var r=i(e.dtype);return{shape:e.shape,dtype:r,buffer:e.data}}t.ensureSerializableDtype=i,t.JSONToArray=o,t.arrayToJSON=a,t.array_serialization={deserialize:o,serialize:a},t.typesToArray={int8:Int8Array,int16:Int16Array,int32:Int32Array,uint8:Uint8Array,uint8_clamped:Uint8ClampedArray,uint16:Uint16Array,uint32:Uint32Array,float32:Float32Array,float64:Float64Array}},function(e,t){e.exports={Equations:{100:"AddEquation",101:"SubtractEquation",102:"ReverseSubtractEquation",103:"MinEquation",104:"MaxEquation"},BlendFactors:{200:"ZeroFactor",201:"OneFactor",202:"SrcColorFactor",203:"OneMinusSrcColorFactor",204:"SrcAlphaFactor",205:"OneMinusSrcAlphaFactor",206:"DstAlphaFactor",207:"OneMinusDstAlphaFactor",208:"DstColorFactor",209:"OneMinusDstColorFactor",210:"SrcAlphaSaturateFactor"},Side:{0:"FrontSide",1:"BackSide",2:"DoubleSide"},Shading:{1:"FlatShading",2:"SmoothShading"},Colors:{0:"NoColors",1:"FaceColors",2:"VertexColors"},BlendingMode:{0:"NoBlending",1:"NormalBlending",2:"AdditiveBlending",3:"SubtractiveBlending",4:"MultiplyBlending",5:"CustomBlending"},DepthMode:{0:"NeverDepth",1:"AlwaysDepth",2:"LessDepth",3:"LessEqualDepth",4:"EqualDepth",5:"GreaterEqualDepth",6:"GreaterDepth",7:"NotEqualDepth"},Operations:{0:"MultiplyOperation",1:"MixOperation",2:"AddOperation"},MappingModes:{300:"UVMapping",301:"CubeReflectionMapping",302:"CubeRefractionMapping",303:"EquirectangularReflectionMapping",304:"EquirectangularRefractionMapping",305:"SphericalReflectionMapping",306:"CubeUVReflectionMapping",307:"CubeUVRefractionMapping"},WrappingModes:{1000:"RepeatWrapping",1001:"ClampToEdgeWrapping",1002:"MirroredRepeatWrapping"},Filters:{1003:"NearestFilter",1004:"NearestMipMapNearestFilter",1005:"NearestMipMapLinearFilter",1006:"LinearFilter",1007:"LinearMipMapNearestFilter",1008:"LinearMipMapLinearFilter"},DataTypes:{1009:"UnsignedByteType",1010:"ByteType",1011:"ShortType",1012:"UnsignedShortType",1013:"IntType",1014:"UnsignedIntType",1015:"FloatType",1016:"HalfFloatType"},PixelTypes:{1017:"UnsignedShort4444Type",1018:"UnsignedShort5551Type",1019:"UnsignedShort565Type",1020:"UnsignedInt248Type"},PixelFormats:{1021:"AlphaFormat",1022:"RGBFormat",1023:"RGBAFormat",1024:"LuminanceFormat",1025:"LuminanceAlphaFormat",1026:"DepthFormat",1027:"DepthStencilFormat",1028:"RedFormat"},DepthFormats:{1026:"DepthFormat",1027:"DepthStencilFormat"},CompressedTextureFormats:{33776:"RGB_S3TC_DXT1_Format",33777:"RGBA_S3TC_DXT1_Format",33778:"RGBA_S3TC_DXT3_Format",33779:"RGBA_S3TC_DXT5_Format",35840:"RGB_PVRTC_4BPPV1_Format",35841:"RGB_PVRTC_2BPPV1_Format",35842:"RGBA_PVRTC_4BPPV1_Format",35843:"RGBA_PVRTC_2BPPV1_Format",36196:"RGB_ETC1_Format",37808:"RGBA_ASTC_4x4_Format",37809:"RGBA_ASTC_5x4_Format",37810:"RGBA_ASTC_5x5_Format",37811:"RGBA_ASTC_6x5_Format",37812:"RGBA_ASTC_6x6_Format",37813:"RGBA_ASTC_8x5_Format",37814:"RGBA_ASTC_8x6_Format",37815:"RGBA_ASTC_8x8_Format",37816:"RGBA_ASTC_10x5_Format",37817:"RGBA_ASTC_10x6_Format",37818:"RGBA_ASTC_10x8_Format",37819:"RGBA_ASTC_10x10_Format",37820:"RGBA_ASTC_12x10_Format",37821:"RGBA_ASTC_12x12_Format"},TextureEncodings:{3000:"LinearEncoding",3001:"sRGBEncoding",3002:"RGBEEncoding",3003:"LogLuvEncoding",3004:"RGBM7Encoding",3005:"RGBM16Encoding",3006:"RGBDEncoding",3007:"GammaEncoding",3200:"BasicDepthPacking",3201:"RGBADepthPacking"},CullFaceModes:{0:"CullFaceNone",1:"CullFaceBack",2:"CullFaceFront",3:"CullFaceFrontBack"},FrontFaceDirection:{0:"FrontFaceDirectionCW",1:"FrontFaceDirectionCCW"},ShadowTypes:{0:"BasicShadowMap",1:"PCFShadowMap",2:"PCFSoftShadowMap"},ToneMappings:{0:"NoToneMapping",1:"LinearToneMapping",2:"ReinhardToneMapping",3:"Uncharted2ToneMapping",4:"CineonToneMapping"},LoopModes:{2200:"LoopOnce",2201:"LoopRepeat",2202:"LoopPingPong"},InterpolationModes:{2300:"InterpolateDiscrete",2301:"InterpolateLinear",2302:"InterpolateSmooth"},EndingModes:{2400:"ZeroCurvatureEnding",2401:"ZeroSlopeEnding",2402:"WrapAroundEnding"},DrawModes:{0:"TrianglesDrawMode",1:"TriangleStripDrawMode",2:"TriangleFanDrawMode"}}},function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=this&&this.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r0?n-4:n,u=0;u>16&255,s[c++]=t>>8&255,s[c++]=255&t;2===a&&(t=i[e.charCodeAt(u)]<<2|i[e.charCodeAt(u+1)]>>4,s[c++]=255&t);1===a&&(t=i[e.charCodeAt(u)]<<10|i[e.charCodeAt(u+1)]<<4|i[e.charCodeAt(u+2)]>>2,s[c++]=t>>8&255,s[c++]=255&t);return s},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;as?s:a+16383));1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,c=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function u(e,t,r){for(var n,i=[],o=t;o>>0),e[r]=255&t,t>>>=8}}()}(t.Random||(t.Random={}))},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){"use strict";var n=r(8).Buffer,i=r(63).Transform;function o(e){i.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(6)(o,i),o.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},o.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},o.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var o=this._blockOffset;o0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},function(e,t,r){"use strict";(function(t,n){var i=r(46);e.exports=b;var o,a=r(94);b.ReadableState=g;r(64).EventEmitter;var s=function(e,t){return e.listeners(t).length},c=r(97),h=r(8).Buffer,l=t.Uint8Array||function(){};var u=r(35);u.inherits=r(6);var p=r(181),d=void 0;d=p&&p.debuglog?p.debuglog("stream"):function(){};var f,m=r(182),v=r(98);u.inherits(b,c);var y=["error","close","destroy","pause","resume"];function g(e,t){o=o||r(26),e=e||{};var n=t instanceof o;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(67).StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function b(e){if(o=o||r(26),!(this instanceof b))return new b(e);this._readableState=new g(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function _(e,t,r,n,i){var o,a=e._readableState;null===t?(a.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,T(e)}(e,a)):(i||(o=function(e,t){var r;(function(e){return h.isBuffer(e)||e instanceof l})(t)||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));return r}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===h.prototype||(t=function(e){return h.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):x(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?x(e,a,t,!1):E(e,a)):x(e,a,t,!1))):n||(a.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=w?e=w:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function T(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(S,e):S(e))}function S(e){d("emit readable"),e.emit("readable"),L(e)}function E(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(A,e,t))}function A(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=h.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function O(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(B,t,e))}function B(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function j(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):T(this),null;if(0===(e=M(e,t))&&t.ended)return 0===t.length&&O(this),null;var n,i=t.needReadable;return d("need readable",i),(0===t.length||t.length-e0?R(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&O(this)),null!==n&&this.emit("data",n),n},b.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},b.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,t);var c=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?l:b;function h(t,n){d("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),e.removeListener("close",y),e.removeListener("finish",g),e.removeListener("drain",u),e.removeListener("error",v),e.removeListener("unpipe",h),r.removeListener("end",l),r.removeListener("end",b),r.removeListener("data",m),p=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}function l(){d("onend"),e.end()}o.endEmitted?i.nextTick(c):r.once("end",c),e.on("unpipe",h);var u=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,L(e))}}(r);e.on("drain",u);var p=!1;var f=!1;function m(t){d("ondata"),f=!1,!1!==e.write(t)||f||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==j(o.pipes,e))&&!p&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,f=!0),r.pause())}function v(t){d("onerror",t),b(),e.removeListener("error",v),0===s(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",g),b()}function g(){d("onfinish"),e.removeListener("close",y),b()}function b(){d("unpipe"),r.unpipe(e)}return r.on("data",m),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",v),e.once("close",y),e.once("finish",g),e.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),e},b.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function p(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function d(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function f(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}n(c,i),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,s=0|this._e,c=0|this._f,m=0|this._g,v=0|this._h,y=0;y<16;++y)t[y]=e.readInt32BE(4*y);for(;y<64;++y)t[y]=f(t[y-2])+t[y-7]+d(t[y-15])+t[y-16]|0;for(var g=0;g<64;++g){var b=v+p(s)+h(s,c,m)+a[g]+t[g]|0,_=u(r)+l(r,n,i)|0;v=m,m=c,c=s,s=o+b|0,o=i,i=n,n=r,r=b+_|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0,this._f=c+this._f|0,this._g=m+this._g|0,this._h=v+this._h|0},c.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=c},function(e,t,r){var n=r(6),i=r(30),o=r(8).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function c(){this.init(),this._w=s,i.call(this,128,112)}function h(e,t,r){return r^e&(t^r)}function l(e,t,r){return e&t|r&(e|t)}function u(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function p(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function d(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function f(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function v(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function y(e,t){return e>>>0>>0?1:0}n(c,i),c.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},c.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,c=0|this._fh,g=0|this._gh,b=0|this._hh,_=0|this._al,x=0|this._bl,w=0|this._cl,M=0|this._dl,T=0|this._el,S=0|this._fl,E=0|this._gl,A=0|this._hl,P=0;P<32;P+=2)t[P]=e.readInt32BE(4*P),t[P+1]=e.readInt32BE(4*P+4);for(;P<160;P+=2){var C=t[P-30],L=t[P-30+1],R=d(C,L),O=f(L,C),B=m(C=t[P-4],L=t[P-4+1]),j=v(L,C),k=t[P-14],F=t[P-14+1],z=t[P-32],I=t[P-32+1],D=O+F|0,N=R+k+y(D,O)|0;N=(N=N+B+y(D=D+j|0,j)|0)+z+y(D=D+I|0,I)|0,t[P]=N,t[P+1]=D}for(var U=0;U<160;U+=2){N=t[U],D=t[U+1];var G=l(r,n,i),H=l(_,x,w),V=u(r,_),W=u(_,r),q=p(s,T),X=p(T,s),Y=a[U],K=a[U+1],Z=h(s,c,g),J=h(T,S,E),Q=A+X|0,$=b+q+y(Q,A)|0;$=($=($=$+Z+y(Q=Q+J|0,J)|0)+Y+y(Q=Q+K|0,K)|0)+N+y(Q=Q+D|0,D)|0;var ee=W+H|0,te=V+G+y(ee,W)|0;b=g,A=E,g=c,E=S,c=s,S=T,s=o+$+y(T=M+Q|0,M)|0,o=i,M=w,i=n,w=x,n=r,x=_,r=$+te+y(_=Q+ee|0,Q)|0}this._al=this._al+_|0,this._bl=this._bl+x|0,this._cl=this._cl+w|0,this._dl=this._dl+M|0,this._el=this._el+T|0,this._fl=this._fl+S|0,this._gl=this._gl+E|0,this._hl=this._hl+A|0,this._ah=this._ah+r+y(this._al,_)|0,this._bh=this._bh+n+y(this._bl,x)|0,this._ch=this._ch+i+y(this._cl,w)|0,this._dh=this._dh+o+y(this._dl,M)|0,this._eh=this._eh+s+y(this._el,T)|0,this._fh=this._fh+c+y(this._fl,S)|0,this._gh=this._gh+g+y(this._gl,E)|0,this._hh=this._hh+b+y(this._hl,A)|0},c.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=c},function(e,t,r){"use strict";var n=r(6),i=r(194),o=r(23),a=r(8).Buffer,s=r(103),c=r(68),h=r(69),l=a.alloc(128);function u(e,t){o.call(this,"digest"),"string"==typeof t&&(t=a.from(t));var r="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>r)?t=("rmd160"===e?new c:h(e)).update(t).digest():t.lengthr||o!=o)throw new TypeError("Bad key length")}}).call(this,r(10).Buffer)},function(e,t,r){(function(t){var r;t.browser?r="utf-8":r=parseInt(t.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary";e.exports=r}).call(this,r(20))},function(e,t,r){var n=r(103),i=r(68),o=r(69),a=r(106),s=r(107),c=r(8).Buffer,h=c.alloc(128),l={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function u(e,t,r){var a=function(e){return"rmd160"===e||"ripemd160"===e?function(e){return(new i).update(e).digest()}:"md5"===e?n:function(t){return o(e).update(t).digest()}}(e),s="sha512"===e||"sha384"===e?128:64;t.length>s?t=a(t):t.lengthe;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(c),t.cmp(c)){if(!t.cmp(h))for(;r.mod(l).cmp(u);)r.iadd(d)}else for(;r.mod(o).cmp(p);)r.iadd(d);if(v(f=r.shrn(1))&&v(r)&&y(f)&&y(r)&&a.test(f)&&a.test(r))return r}}},function(e,t,r){var n=r(12),i=r(116);function o(e){this.rand=e||new i.Rand}e.exports=o,o.create=function(e){return new o(e)},o.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(e)>=0);return i},o.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},o.prototype.test=function(e,t,r){var i=e.bitLength(),o=n.mont(e),a=new n(1).toRed(o);t||(t=Math.max(1,i/48|0));for(var s=e.subn(1),c=0;!s.testn(c);c++);for(var h=e.shrn(c),l=s.toRed(o);t>0;t--){var u=this._randrange(new n(2),s);r&&r(u);var p=u.toRed(o).redPow(h);if(0!==p.cmp(a)&&0!==p.cmp(l)){for(var d=1;d0;t--){var l=this._randrange(new n(2),a),u=e.gcd(l);if(0!==u.cmpn(1))return u;var p=l.toRed(i).redPow(c);if(0!==p.cmp(o)&&0!==p.cmp(h)){for(var d=1;d>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(e,t){return"hex"===t?o(e):e}},function(e,t,r){"use strict";var n=r(19).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function a(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?a(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=a,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict";var n=r(19),i=r(37),o=r(118),a=r(18),s=n.sum32,c=n.sum32_4,h=n.sum32_5,l=o.ch32,u=o.maj32,p=o.s0_256,d=o.s1_256,f=o.g0_256,m=o.g1_256,v=i.BlockHash,y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function g(){if(!(this instanceof g))return new g;v.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}n.inherits(g,v),e.exports=g,g.blockSize=512,g.outSize=256,g.hmacStrength=192,g.padLength=64,g.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n>6],i=0==(32&r);if(31==(31&r)){var o=r;for(r=0;128==(128&o);){if(o=e.readUInt8(t),e.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function u(e,t,r){var n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(0==(128&n))return n;var i=127&n;if(i>4)return e.error("length octect is too long");n=0;for(var o=0;o=31)return n.error("Multi-octet tag encoding unsupported");t||(i|=32);return i|=s.tagClassByName[r||"universal"]<<6}(e,t,r,this.reporter);if(n.length<128)return(o=new i(2))[0]=a,o[1]=n.length,this._createEncoderBuffer([o,n]);for(var c=1,h=n.length;h>=256;h>>=8)c++;(o=new i(2+c))[0]=a,o[1]=128|c;h=1+c;for(var l=n.length;l>0;h--,l>>=8)o[h]=255&l;return this._createEncoderBuffer([o,n])},h.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var r=new i(2*e.length),n=0;n=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}var o=0;for(n=0;n=128;a>>=7)o++}var s=new i(o),c=s.length-1;for(n=e.length-1;n>=0;n--){a=e[n];for(s[c--]=127&a;(a>>=7)>0;)s[c--]=128|127&a}return this._createEncoderBuffer(s)},h.prototype._encodeTime=function(e,t){var r,n=new Date(e);return"gentime"===t?r=[l(n.getFullYear()),l(n.getUTCMonth()+1),l(n.getUTCDate()),l(n.getUTCHours()),l(n.getUTCMinutes()),l(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[l(n.getFullYear()%100),l(n.getUTCMonth()+1),l(n.getUTCDate()),l(n.getUTCHours()),l(n.getUTCMinutes()),l(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},h.prototype._encodeNull=function(){return this._createEncoderBuffer("")},h.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!i.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new i(r)}if(i.isBuffer(e)){var n=e.length;0===e.length&&n++;var o=new i(n);return e.copy(o),0===e.length&&(o[0]=0),this._createEncoderBuffer(o)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);n=1;for(var a=e;a>=256;a>>=8)n++;for(a=(o=new Array(n)).length-1;a>=0;a--)o[a]=255&e,e>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new i(o))},h.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},h.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},h.prototype._skipDefault=function(e,t,r){var n,i=this._baseState;if(null===i.default)return!1;var o=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;np))return!1;var f=l.get(e);if(f&&l.get(t))return f==t;var m=-1,v=!0,y=r&s?new n:void 0;for(l.set(e,t),l.set(t,e);++m-1&&e%1==0&&e<=r}},function(e,t){e.exports=function(e,t){return function(r){return e(t(r))}}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4)),a=r(5).ThreeModel,s=(a=r(5).ThreeModel).extend({defaults:function(){return n.extend(a.prototype.defaults.call(this),{rootObject:null,time:0,timeScale:1})},constructThreeObject:function(){var e=new i.AnimationMixer(this.convertThreeTypeModelToThree(this.get("rootObject"),"rootObject"),this.convertFloatModelToThree(this.get("time"),"time"),this.convertFloatModelToThree(this.get("timeScale"),"timeScale"));return Promise.resolve(e)},createPropertiesArrays:function(){a.prototype.createPropertiesArrays.call(this),this.three_properties.push("rootObject"),this.property_converters.rootObject="convertThreeType",this.property_converters.time="convertFloat",this.property_converters.timeScale="convertFloat"}},{model_name:"AnimationMixerModel",serializers:n.extend({rootObject:{deserialize:o.unpackThreeModel}},a.serializers)});e.exports={AnimationMixerModel:s}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4)),a=r(5).ThreeModel,s=(r(24).KeyframeTrackModel,a.extend({defaults:function(){return n.extend(a.prototype.defaults.call(this),{name:null,duration:-1,tracks:[]})},constructThreeObject:function(){var e=new i.AnimationClip(this.get("name"),this.convertFloatModelToThree(this.get("duration"),"duration"),this.convertThreeTypeArrayModelToThree(this.get("tracks"),"tracks"));return Promise.resolve(e)},createPropertiesArrays:function(){a.prototype.createPropertiesArrays.call(this),this.three_nested_properties.push("tracks"),this.props_created_by_three.duration=!0,this.property_converters.name=null,this.property_converters.duration="convertFloat",this.property_converters.tracks="convertThreeTypeArray"}},{model_name:"AnimationClipModel",serializers:n.extend({tracks:{deserialize:o.unpackThreeModel}},a.serializers)}));e.exports={AnimationClipModel:s}},function(e,t,r){var n=r(0),i=function(e,t,r,i,o,a,s){n.Camera.call(this),this.fov=r,this.far=o,this.near=i,this.focus=(i+o)/2,this.left=-e/2,this.right=e/2,this.top=t/2,this.bottom=-t/2,this.aspect=e/t,this.zoom=1,this.view=null,this.cameraO=new n.OrthographicCamera(e/-2,e/2,t/2,t/-2,a,s),this.cameraP=new n.PerspectiveCamera(r,e/t,i,o),this.impersonate=!0,this.toPerspective()};(i.prototype=Object.create(n.Camera.prototype)).constructor=i,Object.defineProperties(i.prototype,{isPerspectiveCamera:{get:function(){if(this.impersonate)return this.inPerspectiveMode}},isOrthographicCamera:{get:function(){if(this.impersonate)return this.inOrthographicMode}}}),i.prototype.toPerspective=function(){this.near=this.cameraP.near,this.far=this.cameraP.far,this.cameraP.aspect=this.aspect,this.cameraP.fov=this.fov/this.zoom,this.cameraP.view=this.view,this.cameraP.updateProjectionMatrix(),this.projectionMatrix=this.cameraP.projectionMatrix,this.inPerspectiveMode=!0,this.inOrthographicMode=!1,this.type="PerspectiveCamera"},i.prototype.toOrthographic=function(){var e=this.fov,t=this.cameraP.aspect,r=Math.tan(e*Math.PI/180/2)*this.focus,n=r*t;r/=this.zoom,n/=this.zoom,this.cameraO.left=-n,this.cameraO.right=n,this.cameraO.top=r,this.cameraO.bottom=-r,this.cameraO.view=this.view,this.cameraO.updateProjectionMatrix(),this.near=this.cameraO.near,this.far=this.cameraO.far,this.projectionMatrix=this.cameraO.projectionMatrix,this.inPerspectiveMode=!1,this.inOrthographicMode=!0,this.type="OrthographicCamera"},i.prototype.copy=function(e){return n.Camera.prototype.copy.call(this,e),this.fov=e.fov,this.far=e.far,this.near=e.near,this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.zoom=e.zoom,this.view=null===e.view?null:Object.assign({},e.view),this.aspect=e.aspect,this.cameraO.copy(e.cameraO),this.cameraP.copy(e.cameraP),this.inOrthographicMode=e.inOrthographicMode,this.inPerspectiveMode=e.inPerspectiveMode,this},i.prototype.setViewOffset=function(e,t,r,n,i,o){this.view={fullWidth:e,fullHeight:t,offsetX:r,offsetY:n,width:i,height:o},this.inPerspectiveMode?(this.aspect=e/t,this.toPerspective()):this.toOrthographic()},i.prototype.clearViewOffset=function(){this.view=null,this.updateProjectionMatrix()},i.prototype.setSize=function(e,t){this.cameraP.aspect=e/t,this.left=-e/2,this.right=e/2,this.top=t/2,this.bottom=-t/2},i.prototype.setFov=function(e){this.fov=e,this.inPerspectiveMode?this.toPerspective():this.toOrthographic()},i.prototype.updateProjectionMatrix=function(){this.inPerspectiveMode?this.toPerspective():(this.toPerspective(),this.toOrthographic())},i.prototype.setLens=function(e,t){void 0===t&&(t=35);var r=.5*t/(e*Math.max(this.cameraP.aspect,1)),i=2*n.Math.RAD2DEG*Math.atan(r);return this.setFov(i),i},i.prototype.setZoom=function(e){this.zoom=e,this.inPerspectiveMode?this.toPerspective():this.toOrthographic()},i.prototype.toFrontView=function(){this.rotation.x=0,this.rotation.y=0,this.rotation.z=0},i.prototype.toBackView=function(){this.rotation.x=0,this.rotation.y=Math.PI,this.rotation.z=0},i.prototype.toLeftView=function(){this.rotation.x=0,this.rotation.y=-Math.PI/2,this.rotation.z=0},i.prototype.toRightView=function(){this.rotation.x=0,this.rotation.y=Math.PI/2,this.rotation.z=0},i.prototype.toTopView=function(){this.rotation.x=-Math.PI/2,this.rotation.y=0,this.rotation.z=0},i.prototype.toBottomView=function(){this.rotation.x=Math.PI/2,this.rotation.y=0,this.rotation.z=0},e.exports={CombinedCamera:i}},function(e,t,r){var n=r(0),i=function(e,t){this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.movementSpeed=1,this.rollSpeed=.05,this.moveVector=new n.Vector3(0,0,0),this.rotationVector=new n.Vector3(0,0,0),this.tmpQuaternion=new n.Quaternion;var r=new n.Vector3,i=new n.Quaternion,o=this;this.mouseStatus=0,this.update=function(e){var t=e*this.movementSpeed,n=e*this.rollSpeed;return this.object.position.addScaledVector(this.moveVector,t),this.tmpQuaternion.set(this.rotationVector.x*n,this.rotationVector.y*n,this.rotationVector.z*n,1).normalize(),this.object.quaternion.multiply(this.tmpQuaternion),this.object.rotation.setFromQuaternion(this.object.quaternion,this.object.rotation.order),(r.distanceToSquared(this.object.position)>1e-6||8*(1-i.dot(this.object.quaternion))>1e-6)&&(this.dispatchEvent(a),r.copy(this.object.position),i.copy(this.object.quaternion),!0)},this.dispose=function(){},this.connectEvents=function(e){e&&(o.domElement=e)};var a={type:"change"};this.update(0)};(i.prototype=Object.create(n.EventDispatcher.prototype)).constructor=i,e.exports={FlyControls:i}},function(e,t,r){var n=r(0),i=function(e,t){var r=this,i={NONE:-1,ROTATE:0,ZOOM:1,PAN:2,TOUCH_ROTATE:3,TOUCH_ZOOM_PAN:4};this.object=e,this.domElement=void 0!==t?t:document,this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.noRoll=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.keys=[65,83,68],this.target=new n.Vector3;var o=new n.Vector3,a=i.NONE,s=i.NONE,c=new n.Vector3,h=new n.Vector3,l=new n.Vector3,u=new n.Vector2,p=new n.Vector2,d=0,f=0,m=new n.Vector2,v=new n.Vector2;this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone();var y={type:"change"},g={type:"start"},b={type:"end"};this.handleResize=function(){if(this.domElement===document)this.screen.left=0,this.screen.top=0,this.screen.width=window.innerWidth,this.screen.height=window.innerHeight;else{var e=this.domElement.getBoundingClientRect(),t=this.domElement.ownerDocument.documentElement;this.screen.left=e.left+window.pageXOffset-t.clientLeft,this.screen.top=e.top+window.pageYOffset-t.clientTop,this.screen.width=e.width,this.screen.height=e.height}};var _=function(){var e=new n.Vector2;return function(t,n){return e.set((t-r.screen.left)/r.screen.width,(n-r.screen.top)/r.screen.height),e}}(),x=function(){var e=new n.Vector3,t=new n.Vector3,i=new n.Vector3;return function(n,o){i.set((n-.5*r.screen.width-r.screen.left)/(.5*r.screen.width),(.5*r.screen.height+r.screen.top-o)/(.5*r.screen.height),0);var a=i.length();return r.noRoll?a1?i.normalize():i.z=Math.sqrt(1-a*a),c.copy(r.object.position).sub(r.target),e.copy(r.object.up).setLength(i.y),e.add(t.copy(r.object.up).cross(c).setLength(i.x)),e.add(c.setLength(i.z)),e}}();function w(e){e.preventDefault()}function M(e){!1!==r.enabled&&(window.removeEventListener("keydown",M),s=a,a===i.NONE&&(e.keyCode!==r.keys[i.ROTATE]||r.noRotate?e.keyCode!==r.keys[i.ZOOM]||r.noZoom?e.keyCode!==r.keys[i.PAN]||r.noPan||(a=i.PAN):a=i.ZOOM:a=i.ROTATE))}function T(e){!1!==r.enabled&&(a=s,window.addEventListener("keydown",M,!1))}function S(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),a===i.NONE&&(a=e.button),a!==i.ROTATE||r.noRotate?a!==i.ZOOM||r.noZoom?a!==i.PAN||r.noPan||(m.copy(_(e.pageX,e.pageY)),v.copy(m)):(u.copy(_(e.pageX,e.pageY)),p.copy(u)):(h.copy(x(e.pageX,e.pageY)),l.copy(h)),document.addEventListener("mousemove",E,!1),document.addEventListener("mouseup",A,!1),r.dispatchEvent(g))}function E(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),a!==i.ROTATE||r.noRotate?a!==i.ZOOM||r.noZoom?a!==i.PAN||r.noPan||v.copy(_(e.pageX,e.pageY)):p.copy(_(e.pageX,e.pageY)):l.copy(x(e.pageX,e.pageY)),r.update())}function A(e){!1!==r.enabled&&(e.preventDefault(),e.stopPropagation(),r.update(),a=i.NONE,document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",A),r.dispatchEvent(b))}function P(e){if(!1!==r.enabled&&!0!==r.noZoom){e.preventDefault(),e.stopPropagation();var t=0;e.wheelDelta?t=e.wheelDelta/40:e.detail&&(t=-e.detail/3),u.y+=.01*t,r.dispatchEvent(g),r.dispatchEvent(b)}}function C(e){if(!1!==r.enabled){switch(e.preventDefault(),e.touches.length){case 1:a=i.TOUCH_ROTATE,h.copy(x(e.touches[0].pageX,e.touches[0].pageY)),l.copy(h);break;case 2:a=i.TOUCH_ZOOM_PAN;var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY;f=d=Math.sqrt(t*t+n*n);var o=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;m.copy(_(o,s)),v.copy(m);break;default:a=i.NONE}r.dispatchEvent(g)}}function L(e){if(!1!==r.enabled)switch(e.preventDefault(),e.stopPropagation(),e.touches.length){case 1:l.copy(x(e.touches[0].pageX,e.touches[0].pageY));break;case 2:var t=e.touches[0].pageX-e.touches[1].pageX,n=e.touches[0].pageY-e.touches[1].pageY;f=Math.sqrt(t*t+n*n);var o=(e.touches[0].pageX+e.touches[1].pageX)/2,s=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(_(o,s));break;default:a=i.NONE}}function R(e){if(!1!==r.enabled){switch(e.touches.length){case 1:l.copy(x(e.touches[0].pageX,e.touches[0].pageY)),h.copy(l);break;case 2:d=f=0;var t=(e.touches[0].pageX+e.touches[1].pageX)/2,n=(e.touches[0].pageY+e.touches[1].pageY)/2;v.copy(_(t,n)),m.copy(v)}a=i.NONE,r.dispatchEvent(b)}}this.rotateCamera=function(){var e=new n.Vector3,t=new n.Quaternion;return function(){var n=Math.acos(h.dot(l)/h.length()/l.length());n&&(e.crossVectors(h,l).normalize(),n*=r.rotateSpeed,t.setFromAxisAngle(e,-n),c.applyQuaternion(t),r.object.up.applyQuaternion(t),l.applyQuaternion(t),r.staticMoving?h.copy(l):(t.setFromAxisAngle(e,n*(r.dynamicDampingFactor-1)),h.applyQuaternion(t)))}}(),this.zoomCamera=function(){if(a===i.TOUCH_ZOOM_PAN){var e=d/f;d=f,c.multiplyScalar(e)}else{1!==(e=1+(p.y-u.y)*r.zoomSpeed)&&e>0&&(c.multiplyScalar(e),r.staticMoving?u.copy(p):u.y+=(p.y-u.y)*this.dynamicDampingFactor)}},this.panCamera=function(){var e=new n.Vector2,t=new n.Vector3,i=new n.Vector3;return function(){e.copy(v).sub(m),e.lengthSq()&&(e.multiplyScalar(c.length()*r.panSpeed),i.copy(c).cross(r.object.up).setLength(e.x),i.add(t.copy(r.object.up).setLength(e.y)),r.object.position.add(i),r.target.add(i),r.staticMoving?m.copy(v):m.add(e.subVectors(v,m).multiplyScalar(r.dynamicDampingFactor)))}}(),this.checkDistances=function(){r.noZoom&&r.noPan||(c.lengthSq()>r.maxDistance*r.maxDistance&&r.object.position.addVectors(r.target,c.setLength(r.maxDistance)),c.lengthSq()1e-6&&(r.dispatchEvent(y),o.copy(r.object.position))},this.reset=function(){a=i.NONE,s=i.NONE,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),c.subVectors(r.object.position,r.target),r.object.lookAt(r.target),r.dispatchEvent(y),o.copy(r.object.position)},this.connectEvents=function(e){e&&(r.domElement=e),r.domElement.addEventListener("contextmenu",w,!1),r.domElement.addEventListener("mousedown",S,!1),r.domElement.addEventListener("mousewheel",P,!1),r.domElement.addEventListener("DOMMouseScroll",P,!1),r.domElement.addEventListener("touchstart",C,!1),r.domElement.addEventListener("touchend",R,!1),r.domElement.addEventListener("touchmove",L,!1),r.domElement.addEventListener("keydown",M,!1),r.domElement.addEventListener("keyup",T,!1)},this.dispose=function(){r.domElement.removeEventListener("contextmenu",w,!1),r.domElement.removeEventListener("mousedown",S,!1),r.domElement.removeEventListener("mousewheel",P,!1),r.domElement.removeEventListener("DOMMouseScroll",P,!1),r.domElement.removeEventListener("touchstart",C,!1),r.domElement.removeEventListener("touchend",R,!1),r.domElement.removeEventListener("touchmove",L,!1),document.removeEventListener("mousemove",E,!1),document.removeEventListener("mouseup",A,!1),r.domElement.removeEventListener("keydown",M,!1),r.domElement.removeEventListener("keyup",T,!1)},this.connectEvents(),this.handleResize(),this.update()};(i.prototype=Object.create(n.EventDispatcher.prototype)).constructor=i,e.exports={TrackballControls:i}},function(e,t,r){var n=r(1),i=r(11),o=r(0),a=r(21).createModel,s=r(373).BufferGeometryModel,c=r(55).BufferAttributeModel,h=r(80).InterleavedBufferAttributeModel,l=r(9).BaseGeometryModel,u=r(13).BaseBufferGeometryModel,p=s.extend({createPropertiesArrays:function(){s.prototype.createPropertiesArrays.call(this),this.property_assigners.attributes="assignAttributesMap"},constructFromRef:function(e,t){var r=new o.BufferGeometry,s=e.initPromise.bind(this),d={};if(e instanceof p&&(s=s.then(i.all(n.map(n.values(e.get("attributes")),function(e){return e.initPromise}))).then(i.all(n.map(n.values(e.get("morphAttributes")),function(e){return e.initPromise}))).then(function(){return e.get("index").then(function(e){return e.initPromise})})),e instanceof u)s=s.then(function(){r.copy(e.obj)});else{if(!(e instanceof l))throw new Error("Invalid reference geometry:",e);s=s.then(function(){r.fromGeometry(e.obj)})}return s.then(function(){return i.all(n.map(n.pairs(r.attributes),function(e){var t=e[1].isInterleavedBufferAttribute?h:c;return a(t,this.widget_manager,e[1]).then(function(t){return[e[0],t]})},this))}).then(function(e){d.attributes=n.object(e)}).then(function(){return i.all(n.map(n.pairs(r.morphAttributes),function(e){var t=e[1].isInterleavedBufferAttribute?h:c;return a(t,this.widget_manager,e[1]).then(function(t){return[e[0],t]},this)}))}).then(function(e){d.morphAttributes=n.object(e)}).then(function(){if(r.index){var e=r.index.isInterleavedBufferAttribute?h:c;return a(e,this.widget_manager,r.index).then(function(e){d.index=e},this)}}).then(function(){return d.name=r.name,t||(d._ref_geometry=null),this.set(d,"pushFromThree"),this.save_changes(),r})},constructThreeObject:function(){var e=this.get("_ref_geometry"),t=this.get("_store_ref");if(e)return this.constructFromRef(e,t);var r=new o.BufferGeometry;return i.resolve(r)},assignAttributesMap:function(e,t,r){var i=e[t],o=i?Object.keys(i).sort():[],a=r?Object.keys(r).sort():[],s=n.difference(a,o),c=n.difference(o,a),h=n.intersection(o,a);c.length>0&&console.warn("Cannot remove buffer geometry attributes:",c),s.forEach(function(t){"index"===t?e.setIndex(r[t]):e.addAttribute(t,r[t])});var l=n.filter(h,function(t){return e.getAttribute(t)!==r[t]});l.length>0&&console.warn("Cannot reassign buffer geometry attribute:",l)}});e.exports={BufferGeometryModel:p}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4),r(5).ThreeModel),a=o.extend({defaults:function(){return n.extend(o.prototype.defaults.call(this),{origin:[0,0,0],direction:[0,0,0]})},constructThreeObject:function(){var e=new i.Ray(this.convertVectorModelToThree(this.get("origin"),"origin"),this.convertVectorModelToThree(this.get("direction"),"direction"));return Promise.resolve(e)},createPropertiesArrays:function(){o.prototype.createPropertiesArrays.call(this),this.property_converters.origin="convertVector",this.property_converters.direction="convertVector",this.property_assigners.origin="assignVector",this.property_assigners.direction="assignVector"}},{model_name:"RayModel",serializers:n.extend({},o.serializers)});e.exports={RayModel:a}},function(e,t,r){var n=r(0),i=r(82).LineGeometry,o=r(57).LineMaterial,a=function(e,t){n.Mesh.call(this),this.type="Line2",this.geometry=void 0!==e?e:new i,this.material=void 0!==t?t:new o({color:16777215*Math.random()})};a.prototype=Object.assign(Object.create(n.Mesh.prototype),{constructor:a,isLine2:!0,onBeforeRender:function(e,t,r,i,o,a){if(o.isLineMaterial){var s=e.getSize();o.resolution=new n.Vector2(s.width,s.height)}},copy:function(e){return this}}),e.exports={Line2:a}},function(e,t,r){var n=r(0),i=r(56).LineSegmentsGeometry,o=r(57).LineMaterial,a=function(e,t){n.Mesh.call(this),this.type="LineSegments2",this.geometry=void 0!==e?e:new i,this.material=void 0!==t?t:new o({color:16777215*Math.random()})};a.prototype=Object.assign(Object.create(n.Mesh.prototype),{constructor:a,isLineSegments2:!0,onBeforeRender:function(e,t,r,i,o,a){if(o.isLineMaterial){var s=e.getSize();o.resolution=new n.Vector2(s.width,s.height)}},copy:function(e){return this}}),e.exports={LineSegments2:a}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4),r(5).ThreeModel),a=o.extend({defaults:function(){return n.extend(o.prototype.defaults.call(this),{})},constructThreeObject:function(){var e=new i.Curve;return Promise.resolve(e)},createPropertiesArrays:function(){o.prototype.createPropertiesArrays.call(this)}},{model_name:"CurveModel",serializers:n.extend({},o.serializers)});e.exports={CurveModel:a}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4),r(5).ThreeModel),a=o.extend({defaults:function(){return n.extend(o.prototype.defaults.call(this),{})},constructThreeObject:function(){var e=new i.Shape;return Promise.resolve(e)},createPropertiesArrays:function(){o.prototype.createPropertiesArrays.call(this)}},{model_name:"ShapeModel",serializers:n.extend({},o.serializers)});e.exports={ShapeModel:a}},function(e,t,r){var n=r(11),i=r(82).LineGeometry,o=r(431),a=r(21),s=o.LineGeometryModel.extend({constructThreeObject:function(){var e=new i;return n.resolve(e)}});a.customModelsLut[i.prototype.constructor.name]="LineGeometry",e.exports={LineGeometryModel:s}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4),r(5).ThreeModel),a=o.extend({defaults:function(){return n.extend(o.prototype.defaults.call(this),{min:[0,0,0],max:[0,0,0]})},constructThreeObject:function(){var e=new i.Box3(this.convertVectorModelToThree(this.get("min"),"min"),this.convertVectorModelToThree(this.get("max"),"max"));return Promise.resolve(e)},createPropertiesArrays:function(){o.prototype.createPropertiesArrays.call(this),this.property_converters.min="convertVector",this.property_converters.max="convertVector",this.property_assigners.min="assignVector",this.property_assigners.max="assignVector"}},{model_name:"Box3Model",serializers:n.extend({},o.serializers)});e.exports={Box3Model:a}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4)),a=r(27).LightModel,s=(r(7).Object3DModel,r(33).LightShadowModel,a.extend({defaults:function(){return n.extend(a.prototype.defaults.call(this),{target:"uninitialized",shadow:"uninitialized",type:"DirectionalLight"})},constructThreeObject:function(){var e=new i.DirectionalLight(this.convertColorModelToThree(this.get("color"),"color"),this.convertFloatModelToThree(this.get("intensity"),"intensity"));return Promise.resolve(e)},createPropertiesArrays:function(){a.prototype.createPropertiesArrays.call(this),this.three_properties.push("target"),this.three_properties.push("shadow"),this.props_created_by_three.type=!0,this.props_created_by_three.rotation=!0,this.props_created_by_three.quaternion=!0,this.props_created_by_three.matrixWorldNeedsUpdate=!0,this.property_converters.target="convertThreeType",this.property_converters.shadow="convertThreeType",this.property_converters.type=null}},{model_name:"DirectionalLightModel",serializers:n.extend({target:{deserialize:o.unpackThreeModel},shadow:{deserialize:o.unpackThreeModel}},a.serializers)}));e.exports={DirectionalLightModel:s}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4),r(27).LightModel),a=o.extend({defaults:function(){return n.extend(o.prototype.defaults.call(this),{groundColor:"#000000",type:"HemisphereLight"})},constructThreeObject:function(){var e=new i.HemisphereLight(this.convertColorModelToThree(this.get("color"),"color"),this.convertColorModelToThree(this.get("groundColor"),"groundColor"),this.convertFloatModelToThree(this.get("intensity"),"intensity"));return Promise.resolve(e)},createPropertiesArrays:function(){o.prototype.createPropertiesArrays.call(this),this.props_created_by_three.type=!0,this.props_created_by_three.rotation=!0,this.props_created_by_three.quaternion=!0,this.props_created_by_three.matrixWorldNeedsUpdate=!0,this.property_converters.groundColor="convertColor",this.property_converters.type=null}},{model_name:"HemisphereLightModel",serializers:n.extend({},o.serializers)});e.exports={HemisphereLightModel:a}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4)),a=r(27).LightModel,s=(r(33).LightShadowModel,a.extend({defaults:function(){return n.extend(a.prototype.defaults.call(this),{power:12.566370614359172,distance:0,decay:1,shadow:"uninitialized",type:"PointLight"})},constructThreeObject:function(){var e=new i.PointLight(this.convertColorModelToThree(this.get("color"),"color"),this.convertFloatModelToThree(this.get("intensity"),"intensity"),this.convertFloatModelToThree(this.get("distance"),"distance"),this.convertFloatModelToThree(this.get("decay"),"decay"));return Promise.resolve(e)},createPropertiesArrays:function(){a.prototype.createPropertiesArrays.call(this),this.three_properties.push("shadow"),this.props_created_by_three.type=!0,this.props_created_by_three.rotation=!0,this.props_created_by_three.quaternion=!0,this.props_created_by_three.matrixWorldNeedsUpdate=!0,this.property_converters.power="convertFloat",this.property_converters.distance="convertFloat",this.property_converters.decay="convertFloat",this.property_converters.shadow="convertThreeType",this.property_converters.type=null}},{model_name:"PointLightModel",serializers:n.extend({shadow:{deserialize:o.unpackThreeModel}},a.serializers)}));e.exports={PointLightModel:s}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4),r(27).LightModel),a=o.extend({defaults:function(){return n.extend(o.prototype.defaults.call(this),{width:10,height:10,type:"RectAreaLight"})},constructThreeObject:function(){var e=new i.RectAreaLight(this.convertColorModelToThree(this.get("color"),"color"),this.convertFloatModelToThree(this.get("intensity"),"intensity"),this.convertFloatModelToThree(this.get("width"),"width"),this.convertFloatModelToThree(this.get("height"),"height"));return Promise.resolve(e)},createPropertiesArrays:function(){o.prototype.createPropertiesArrays.call(this),this.props_created_by_three.type=!0,this.props_created_by_three.rotation=!0,this.props_created_by_three.quaternion=!0,this.props_created_by_three.matrixWorldNeedsUpdate=!0,this.property_converters.width="convertFloat",this.property_converters.height="convertFloat",this.property_converters.type=null}},{model_name:"RectAreaLightModel",serializers:n.extend({},o.serializers)});e.exports={RectAreaLightModel:a}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4)),a=r(27).LightModel,s=(r(7).Object3DModel,r(33).LightShadowModel,a.extend({defaults:function(){return n.extend(a.prototype.defaults.call(this),{target:"uninitialized",distance:0,angle:1.0471975511965976,penumbra:0,decay:1,shadow:"uninitialized",type:"SpotLight"})},constructThreeObject:function(){var e=new i.SpotLight(this.convertColorModelToThree(this.get("color"),"color"),this.convertFloatModelToThree(this.get("intensity"),"intensity"),this.convertFloatModelToThree(this.get("distance"),"distance"),this.convertFloatModelToThree(this.get("angle"),"angle"),this.convertFloatModelToThree(this.get("penumbra"),"penumbra"),this.convertFloatModelToThree(this.get("decay"),"decay"));return Promise.resolve(e)},createPropertiesArrays:function(){a.prototype.createPropertiesArrays.call(this),this.three_properties.push("target"),this.three_properties.push("shadow"),this.props_created_by_three.type=!0,this.props_created_by_three.rotation=!0,this.props_created_by_three.quaternion=!0,this.props_created_by_three.matrixWorldNeedsUpdate=!0,this.property_converters.target="convertThreeType",this.property_converters.distance="convertFloat",this.property_converters.angle="convertFloat",this.property_converters.penumbra="convertFloat",this.property_converters.decay="convertFloat",this.property_converters.shadow="convertThreeType",this.property_converters.type=null}},{model_name:"SpotLightModel",serializers:n.extend({target:{deserialize:o.unpackThreeModel},shadow:{deserialize:o.unpackThreeModel}},a.serializers)}));e.exports={SpotLightModel:s}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4)),a=r(14).MaterialModel,s=(r(15).TextureModel,r(43).CubeTextureModel,a.extend({defaults:function(){return n.extend(a.prototype.defaults.call(this),{alphaMap:null,aoMap:null,aoMapIntensity:1,bumpMap:null,bumpScale:1,color:"#ffffff",combine:"MultiplyOperation",displacementMap:null,displacementScale:1,displacementBias:0,emissive:"#000000",emissiveMap:null,emissiveIntensity:1,envMap:null,lightMap:null,lightMapIntensity:1,map:null,morphNormals:!1,morphTargets:!1,normalMap:null,normalScale:[1,1],reflectivity:1,refractionRatio:.98,shininess:30,skinning:!1,specular:"#111111",specularMap:null,wireframe:!1,wireframeLinewidth:1,wireframeLinecap:"round",wireframeLinejoin:"round",type:"MeshPhongMaterial"})},constructThreeObject:function(){var e=new i.MeshPhongMaterial({alphaMap:this.convertThreeTypeModelToThree(this.get("alphaMap"),"alphaMap"),aoMap:this.convertThreeTypeModelToThree(this.get("aoMap"),"aoMap"),aoMapIntensity:this.convertFloatModelToThree(this.get("aoMapIntensity"),"aoMapIntensity"),bumpMap:this.convertThreeTypeModelToThree(this.get("bumpMap"),"bumpMap"),bumpScale:this.convertFloatModelToThree(this.get("bumpScale"),"bumpScale"),color:this.convertColorModelToThree(this.get("color"),"color"),combine:this.convertEnumModelToThree(this.get("combine"),"combine"),displacementMap:this.convertThreeTypeModelToThree(this.get("displacementMap"),"displacementMap"),displacementScale:this.convertFloatModelToThree(this.get("displacementScale"),"displacementScale"),displacementBias:this.convertFloatModelToThree(this.get("displacementBias"),"displacementBias"),emissive:this.convertColorModelToThree(this.get("emissive"),"emissive"),emissiveMap:this.convertThreeTypeModelToThree(this.get("emissiveMap"),"emissiveMap"),emissiveIntensity:this.convertFloatModelToThree(this.get("emissiveIntensity"),"emissiveIntensity"),envMap:this.convertThreeTypeModelToThree(this.get("envMap"),"envMap"),lightMap:this.convertThreeTypeModelToThree(this.get("lightMap"),"lightMap"),lightMapIntensity:this.convertFloatModelToThree(this.get("lightMapIntensity"),"lightMapIntensity"),map:this.convertThreeTypeModelToThree(this.get("map"),"map"),morphNormals:this.convertBoolModelToThree(this.get("morphNormals"),"morphNormals"),morphTargets:this.convertBoolModelToThree(this.get("morphTargets"),"morphTargets"),normalMap:this.convertThreeTypeModelToThree(this.get("normalMap"),"normalMap"),normalScale:this.convertVectorModelToThree(this.get("normalScale"),"normalScale"),reflectivity:this.convertFloatModelToThree(this.get("reflectivity"),"reflectivity"),refractionRatio:this.convertFloatModelToThree(this.get("refractionRatio"),"refractionRatio"),shininess:this.convertFloatModelToThree(this.get("shininess"),"shininess"),skinning:this.convertBoolModelToThree(this.get("skinning"),"skinning"),specular:this.convertColorModelToThree(this.get("specular"),"specular"),specularMap:this.convertThreeTypeModelToThree(this.get("specularMap"),"specularMap"),wireframe:this.convertBoolModelToThree(this.get("wireframe"),"wireframe"),wireframeLinewidth:this.convertFloatModelToThree(this.get("wireframeLinewidth"),"wireframeLinewidth"),wireframeLinecap:this.get("wireframeLinecap"),wireframeLinejoin:this.get("wireframeLinejoin"),type:this.get("type")});return Promise.resolve(e)},createPropertiesArrays:function(){a.prototype.createPropertiesArrays.call(this),this.three_properties.push("alphaMap"),this.three_properties.push("aoMap"),this.three_properties.push("bumpMap"),this.three_properties.push("displacementMap"),this.three_properties.push("emissiveMap"),this.three_properties.push("envMap"),this.three_properties.push("lightMap"),this.three_properties.push("map"),this.three_properties.push("normalMap"),this.three_properties.push("specularMap"),this.props_created_by_three.type=!0,this.enum_property_types.combine="Operations",this.property_converters.alphaMap="convertThreeType",this.property_converters.aoMap="convertThreeType",this.property_converters.aoMapIntensity="convertFloat",this.property_converters.bumpMap="convertThreeType",this.property_converters.bumpScale="convertFloat",this.property_converters.color="convertColor",this.property_converters.combine="convertEnum",this.property_converters.displacementMap="convertThreeType",this.property_converters.displacementScale="convertFloat",this.property_converters.displacementBias="convertFloat",this.property_converters.emissive="convertColor",this.property_converters.emissiveMap="convertThreeType",this.property_converters.emissiveIntensity="convertFloat",this.property_converters.envMap="convertThreeType",this.property_converters.lightMap="convertThreeType",this.property_converters.lightMapIntensity="convertFloat",this.property_converters.map="convertThreeType",this.property_converters.morphNormals="convertBool",this.property_converters.morphTargets="convertBool",this.property_converters.normalMap="convertThreeType",this.property_converters.normalScale="convertVector",this.property_converters.reflectivity="convertFloat",this.property_converters.refractionRatio="convertFloat",this.property_converters.shininess="convertFloat",this.property_converters.skinning="convertBool",this.property_converters.specular="convertColor",this.property_converters.specularMap="convertThreeType",this.property_converters.wireframe="convertBool",this.property_converters.wireframeLinewidth="convertFloat",this.property_converters.wireframeLinecap=null,this.property_converters.wireframeLinejoin=null,this.property_converters.type=null,this.property_assigners.normalScale="assignVector"}},{model_name:"MeshPhongMaterialModel",serializers:n.extend({alphaMap:{deserialize:o.unpackThreeModel},aoMap:{deserialize:o.unpackThreeModel},bumpMap:{deserialize:o.unpackThreeModel},displacementMap:{deserialize:o.unpackThreeModel},emissiveMap:{deserialize:o.unpackThreeModel},envMap:{deserialize:o.unpackThreeModel},lightMap:{deserialize:o.unpackThreeModel},map:{deserialize:o.unpackThreeModel},normalMap:{deserialize:o.unpackThreeModel},specularMap:{deserialize:o.unpackThreeModel}},a.serializers)}));e.exports={MeshPhongMaterialModel:s}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4)),a=r(14).MaterialModel,s=(r(15).TextureModel,r(43).CubeTextureModel,a.extend({defaults:function(){return n.extend(a.prototype.defaults.call(this),{alphaMap:null,aoMap:null,aoMapIntensity:1,bumpMap:null,bumpScale:1,color:"#ffffff",defines:{STANDARD:""},displacementMap:null,displacementScale:1,displacementBias:0,emissive:"#000000",emissiveMap:null,emissiveIntensity:1,envMap:null,envMapIntensity:1,lightMap:null,lightMapIntensity:1,map:null,metalness:.5,metalnessMap:null,morphTargets:!1,morphNormals:!1,normalMap:null,normalScale:[1,1],refractionRatio:.98,roughness:.5,roughnessMap:null,skinning:!1,wireframe:!1,wireframeLinecap:"round",wireframeLinejoin:"round",wireframeLinewidth:1,type:"MeshStandardMaterial"})},constructThreeObject:function(){var e=new i.MeshStandardMaterial({alphaMap:this.convertThreeTypeModelToThree(this.get("alphaMap"),"alphaMap"),aoMap:this.convertThreeTypeModelToThree(this.get("aoMap"),"aoMap"),aoMapIntensity:this.convertFloatModelToThree(this.get("aoMapIntensity"),"aoMapIntensity"),bumpMap:this.convertThreeTypeModelToThree(this.get("bumpMap"),"bumpMap"),bumpScale:this.convertFloatModelToThree(this.get("bumpScale"),"bumpScale"),color:this.convertColorModelToThree(this.get("color"),"color"),defines:this.get("defines"),displacementMap:this.convertThreeTypeModelToThree(this.get("displacementMap"),"displacementMap"),displacementScale:this.convertFloatModelToThree(this.get("displacementScale"),"displacementScale"),displacementBias:this.convertFloatModelToThree(this.get("displacementBias"),"displacementBias"),emissive:this.convertColorModelToThree(this.get("emissive"),"emissive"),emissiveMap:this.convertThreeTypeModelToThree(this.get("emissiveMap"),"emissiveMap"),emissiveIntensity:this.convertFloatModelToThree(this.get("emissiveIntensity"),"emissiveIntensity"),envMap:this.convertThreeTypeModelToThree(this.get("envMap"),"envMap"),envMapIntensity:this.convertFloatModelToThree(this.get("envMapIntensity"),"envMapIntensity"),lightMap:this.convertThreeTypeModelToThree(this.get("lightMap"),"lightMap"),lightMapIntensity:this.convertFloatModelToThree(this.get("lightMapIntensity"),"lightMapIntensity"),map:this.convertThreeTypeModelToThree(this.get("map"),"map"),metalness:this.convertFloatModelToThree(this.get("metalness"),"metalness"),metalnessMap:this.convertThreeTypeModelToThree(this.get("metalnessMap"),"metalnessMap"),morphTargets:this.convertBoolModelToThree(this.get("morphTargets"),"morphTargets"),morphNormals:this.convertBoolModelToThree(this.get("morphNormals"),"morphNormals"),normalMap:this.convertThreeTypeModelToThree(this.get("normalMap"),"normalMap"),normalScale:this.convertVectorModelToThree(this.get("normalScale"),"normalScale"),refractionRatio:this.convertFloatModelToThree(this.get("refractionRatio"),"refractionRatio"),roughness:this.convertFloatModelToThree(this.get("roughness"),"roughness"),roughnessMap:this.convertThreeTypeModelToThree(this.get("roughnessMap"),"roughnessMap"),skinning:this.convertBoolModelToThree(this.get("skinning"),"skinning"),wireframe:this.convertBoolModelToThree(this.get("wireframe"),"wireframe"),wireframeLinecap:this.get("wireframeLinecap"),wireframeLinejoin:this.get("wireframeLinejoin"),wireframeLinewidth:this.convertFloatModelToThree(this.get("wireframeLinewidth"),"wireframeLinewidth"),type:this.get("type")});return Promise.resolve(e)},createPropertiesArrays:function(){a.prototype.createPropertiesArrays.call(this),this.three_properties.push("alphaMap"),this.three_properties.push("aoMap"),this.three_properties.push("bumpMap"),this.three_properties.push("displacementMap"),this.three_properties.push("emissiveMap"),this.three_properties.push("envMap"),this.three_properties.push("lightMap"),this.three_properties.push("map"),this.three_properties.push("metalnessMap"),this.three_properties.push("normalMap"),this.three_properties.push("roughnessMap"),this.props_created_by_three.type=!0,this.property_converters.alphaMap="convertThreeType",this.property_converters.aoMap="convertThreeType",this.property_converters.aoMapIntensity="convertFloat",this.property_converters.bumpMap="convertThreeType",this.property_converters.bumpScale="convertFloat",this.property_converters.color="convertColor",this.property_converters.defines=null,this.property_converters.displacementMap="convertThreeType",this.property_converters.displacementScale="convertFloat",this.property_converters.displacementBias="convertFloat",this.property_converters.emissive="convertColor",this.property_converters.emissiveMap="convertThreeType",this.property_converters.emissiveIntensity="convertFloat",this.property_converters.envMap="convertThreeType",this.property_converters.envMapIntensity="convertFloat",this.property_converters.lightMap="convertThreeType",this.property_converters.lightMapIntensity="convertFloat",this.property_converters.map="convertThreeType",this.property_converters.metalness="convertFloat",this.property_converters.metalnessMap="convertThreeType",this.property_converters.morphTargets="convertBool",this.property_converters.morphNormals="convertBool",this.property_converters.normalMap="convertThreeType",this.property_converters.normalScale="convertVector",this.property_converters.refractionRatio="convertFloat",this.property_converters.roughness="convertFloat",this.property_converters.roughnessMap="convertThreeType",this.property_converters.skinning="convertBool",this.property_converters.wireframe="convertBool",this.property_converters.wireframeLinecap=null,this.property_converters.wireframeLinejoin=null,this.property_converters.wireframeLinewidth="convertFloat",this.property_converters.type=null,this.property_assigners.defines="assignDict",this.property_assigners.normalScale="assignVector"}},{model_name:"MeshStandardMaterialModel",serializers:n.extend({alphaMap:{deserialize:o.unpackThreeModel},aoMap:{deserialize:o.unpackThreeModel},bumpMap:{deserialize:o.unpackThreeModel},displacementMap:{deserialize:o.unpackThreeModel},emissiveMap:{deserialize:o.unpackThreeModel},envMap:{deserialize:o.unpackThreeModel},lightMap:{deserialize:o.unpackThreeModel},map:{deserialize:o.unpackThreeModel},metalnessMap:{deserialize:o.unpackThreeModel},normalMap:{deserialize:o.unpackThreeModel},roughnessMap:{deserialize:o.unpackThreeModel}},a.serializers)}));e.exports={MeshStandardMaterialModel:s}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4)),a=r(14).MaterialModel,s=(r(15).TextureModel,a.extend({defaults:function(){return n.extend(a.prototype.defaults.call(this),{color:"#ffffff",fog:!1,lights:!1,map:null,rotation:0,sizeAttenuation:!0,type:"SpriteMaterial"})},constructThreeObject:function(){var e=new i.SpriteMaterial({color:this.convertColorModelToThree(this.get("color"),"color"),fog:this.convertBoolModelToThree(this.get("fog"),"fog"),lights:this.convertBoolModelToThree(this.get("lights"),"lights"),map:this.convertThreeTypeModelToThree(this.get("map"),"map"),rotation:this.convertFloatModelToThree(this.get("rotation"),"rotation"),sizeAttenuation:this.convertBoolModelToThree(this.get("sizeAttenuation"),"sizeAttenuation"),type:this.get("type")});return Promise.resolve(e)},createPropertiesArrays:function(){a.prototype.createPropertiesArrays.call(this),this.three_properties.push("map"),this.props_created_by_three.type=!0,this.property_converters.color="convertColor",this.property_converters.fog="convertBool",this.property_converters.lights="convertBool",this.property_converters.map="convertThreeType",this.property_converters.rotation="convertFloat",this.property_converters.sizeAttenuation="convertBool",this.property_converters.type=null}},{model_name:"SpriteMaterialModel",serializers:n.extend({map:{deserialize:o.unpackThreeModel}},a.serializers)}));e.exports={SpriteMaterialModel:s}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4),r(7).Object3DModel),a=o.extend({defaults:function(){return n.extend(o.prototype.defaults.call(this),{type:"Bone"})},constructThreeObject:function(){var e=new i.Bone;return Promise.resolve(e)},createPropertiesArrays:function(){o.prototype.createPropertiesArrays.call(this),this.props_created_by_three.type=!0,this.props_created_by_three.rotation=!0,this.props_created_by_three.quaternion=!0,this.props_created_by_three.matrixWorldNeedsUpdate=!0,this.property_converters.type=null}},{model_name:"BoneModel",serializers:n.extend({},o.serializers)});e.exports={BoneModel:a}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4)),a=r(5).ThreeModel,s=(r(161).BoneModel,a.extend({defaults:function(){return n.extend(a.prototype.defaults.call(this),{bones:[]})},constructThreeObject:function(){var e=new i.Skeleton(this.convertThreeTypeArrayModelToThree(this.get("bones"),"bones"));return Promise.resolve(e)},createPropertiesArrays:function(){a.prototype.createPropertiesArrays.call(this),this.three_nested_properties.push("bones"),this.property_converters.bones="convertThreeTypeArray"}},{model_name:"SkeletonModel",serializers:n.extend({bones:{deserialize:o.unpackThreeModel}},a.serializers)}));e.exports={SkeletonModel:s}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4),r(5).ThreeModel),a=o.extend({defaults:function(){return n.extend(o.prototype.defaults.call(this),{name:"",color:"white",near:1,far:1e3})},constructThreeObject:function(){var e=new i.Fog(this.convertColorModelToThree(this.get("color"),"color"),this.convertFloatModelToThree(this.get("near"),"near"),this.convertFloatModelToThree(this.get("far"),"far"));return Promise.resolve(e)},createPropertiesArrays:function(){o.prototype.createPropertiesArrays.call(this),this.property_converters.name=null,this.property_converters.color="convertColor",this.property_converters.near="convertFloat",this.property_converters.far="convertFloat"}},{model_name:"FogModel",serializers:n.extend({},o.serializers)});e.exports={FogModel:a}},function(e,t,r){var n=r(1),i=r(0),o=(r(2),r(3),r(4),r(5).ThreeModel),a=o.extend({defaults:function(){return n.extend(o.prototype.defaults.call(this),{name:"",color:"white",density:25e-5})},constructThreeObject:function(){var e=new i.FogExp2(this.convertColorModelToThree(this.get("color"),"color"),this.convertFloatModelToThree(this.get("density"),"density"));return Promise.resolve(e)},createPropertiesArrays:function(){o.prototype.createPropertiesArrays.call(this),this.property_converters.name=null,this.property_converters.color="convertColor",this.property_converters.density="convertFloat"}},{model_name:"FogExp2Model",serializers:n.extend({},o.serializers)});e.exports={FogExp2Model:a}},function(e,t,r){var n=r(44).dependencies.three;window.requirejs&&window.requirejs.config({paths:{three:["three","https://unpkg.com/three@"+n+"/build/three.min.js"]}}),e.exports=r(60)},function(e,t,r){var n=[r(167),r(28),r(87),r(5),r(90),r(4),r(21)];for(var i in n)if(n.hasOwnProperty(i)){var o=n[i];for(var a in o)o.hasOwnProperty(a)&&(e.exports[a]=o[a])}},function(e,t,r){var n=r(1),i=r(0),o=r(28),a=o.RenderableView,s=o.RenderableModel,c=r(78).OrbitControls,h=r(21),l=r(4).unpackThreeModel,u=new i.Color("black"),p=a.extend({initialize:function(){a.prototype.initialize.apply(this,arguments),this._resetCameraNeeded=!0,this._rebuildNeeded=!0},render:function(){return this.model.initPromise.bind(this).then(this.doRender)},setupEventListeners:function(){a.prototype.setupEventListeners.call(this);var e=this.model.get("child");this.listenTo(e,"change",this.onChildChanged.bind(this)),e.obj.isObject3D&&this.listenTo(e,"childchange",this.onChildChanged.bind(this))},onChildChanged:function(){this._rebuildNeeded=!0},constructScene:function(){var e,t,r=this.model.get("child").obj;if(this.clearScene(),r.isObject3D)this.debug("render Object3D"),this.scene.add(r.clone());else if(r.isGeometry||r.isBufferGeometry){var n;n=this.model.get("_flat")?new i.MeshPhongMaterial({color:"#ffffff",flatShading:!0}):this.model.get("_wire")||"WireframeGeometry"===r.type?new i.MeshBasicMaterial({color:"#888888",wireframe:!0,flatShading:!0}):new i.MeshLambertMaterial({color:"#ffffff"}),r.isBufferGeometry&&"color"in r.attributes&&(n.vertexColors=i.VertexColors),t=new i.Mesh(r,n),this.scene.add(t)}else if(r.isMaterial)if("SpriteMaterial"===r.type){var o=new i.Sprite(r),a=o.position.distanceTo(this.camera.position),s=r.map.image.width/r.map.image.height;s>=1?o.scale.set(a,a/s,a):o.scale.set(a*s,a,a),this.scene.add(o)}else e=new i.SphereGeometry(15,16,12),t=new i.Mesh(e,r),this.scene.add(t);else if(r.isTexture){e=new i.SphereGeometry(15,16,12);var c=new i.MeshStandardMaterial({map:r});t=new i.Mesh(e,c),this.scene.add(t)}else console.log("Unexpected object in preview, scene will be empty:",r);this._resetCameraNeeded&&(this.resetCamera(),this._resetCameraNeeded=!1),this.scene.add(this.camera),this._rebuildNeeded=!1},resetCamera:function(){var e=h.computeBoundingSphere(this.scene);null===e&&(e=new i.Sphere(new i.Vector3,1)),h.lookAtSphere(this.camera,e.center,e.radius);var t=this.controls[0];t.target.copy(e.center),t.target0.copy(e.center),t.update();var r=2.5*(this.camera.position.z-e.center.z);this.pointLight.position.set(-r,r,r)},clearScene:function(){this.scene.remove.apply(this.scene,this.scene.children.slice())},setupControls:function(){this.debug("setting up controls");var e=new c(this.camera,this.renderer.domElement);e.screenSpacePanning=!1,e.target.set(0,0,0),e.update(),this.controls=[e]},lazyRendererSetup:function(){this.camera=new i.PerspectiveCamera(60,1),this.updateSize(),this.scene=new i.Scene,this.scene.background=u,this.pointLight=new i.PointLight("#ffffff",.5,0,0),this.ambLight=new i.AmbientLight("#ffffff",.5),this.camera.add(this.ambLight),this.camera.add(this.pointLight),this.setupControls(),this.enableControls(),this.renderScene()},renderScene:function(){this.debug("renderScene"),this.isFrozen&&this.unfreeze(),this.renderer.context.isContextLost()?this.freeze():(this._rebuildNeeded&&this.constructScene(),this.scene.ipymodel&&this.scene.ipymodel.trigger("beforeRender",this.scene,this.renderer,this.camera),this.renderer.render(this.scene,this.camera),this.scene.ipymodel&&this.scene.ipymodel.trigger("afterRender",this.scene,this.renderer,this.camera))},updateSize:function(){if(a.prototype.updateSize.call(this),this.camera){var e=this.model.get("_width"),t=this.model.get("_height");this.camera.aspect=e/t,this.camera.updateProjectionMatrix()}}}),d=s.extend({defaults:function(){return n.extend(s.prototype.defaults.call(this),{_model_name:"PreviewModel",_view_name:"PreviewView",_flat:!1,_wire:!1,child:null})},initialize:function(e,t){s.prototype.initialize.apply(this,arguments),this.initPromise=this.get("child").initPromise.bind(this).then(function(){this.setupListeners()})},setupListeners:function(){var e=this.get("child");this.listenTo(e,"change",this.onChildChanged.bind(this)),this.listenTo(e,"childchange",this.onChildChanged.bind(this))},onChildChanged:function(e,t){this.trigger("rerender",this,{})}},{serializers:n.extend({child:{deserialize:l}},s.serializers)});e.exports={PreviewModel:d,PreviewView:p}},function(e,t,r){var n; +/*! + * jQuery JavaScript Library v3.3.1 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2018-01-20T17:24Z + */ +/*! + * jQuery JavaScript Library v3.3.1 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2018-01-20T17:24Z + */ +!function(t,r){"use strict";"object"==typeof e&&"object"==typeof e.exports?e.exports=t.document?r(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return r(e)}:r(t)}("undefined"!=typeof window?window:this,function(r,i){"use strict";var o=[],a=r.document,s=Object.getPrototypeOf,c=o.slice,h=o.concat,l=o.push,u=o.indexOf,p={},d=p.toString,f=p.hasOwnProperty,m=f.toString,v=m.call(Object),y={},g=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},b=function(e){return null!=e&&e===e.window},_={type:!0,src:!0,noModule:!0};function x(e,t,r){var n,i=(t=t||a).createElement("script");if(i.text=e,r)for(n in _)r[n]&&(i[n]=r[n]);t.head.appendChild(i).parentNode.removeChild(i)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?p[d.call(e)]||"object":typeof e}var M=function(e,t){return new M.fn.init(e,t)},T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function S(e){var t=!!e&&"length"in e&&e.length,r=w(e);return!g(e)&&!b(e)&&("array"===r||0===t||"number"==typeof t&&t>0&&t-1 in e)}M.fn=M.prototype={jquery:"3.3.1",constructor:M,length:0,toArray:function(){return c.call(this)},get:function(e){return null==e?c.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=M.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return M.each(this,e)},map:function(e){return this.pushStack(M.map(this,function(t,r){return e.call(t,r,t)}))},slice:function(){return this.pushStack(c.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,r=+e+(e<0?t:0);return this.pushStack(r>=0&&r+~]|"+F+")"+F+"*"),V=new RegExp("="+F+"*([^\\]'\"]*?)"+F+"*\\]","g"),W=new RegExp(D),q=new RegExp("^"+z+"$"),X={ID:new RegExp("^#("+z+")"),CLASS:new RegExp("^\\.("+z+")"),TAG:new RegExp("^("+z+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+D),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")},Y=/^(?:input|select|textarea|button)$/i,K=/^h\d$/i,Z=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Q=/[+~]/,$=new RegExp("\\\\([\\da-f]{1,6}"+F+"?|("+F+")|.)","ig"),ee=function(e,t,r){var n="0x"+t-65536;return n!=n||r?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,re=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},ne=function(){p()},ie=ge(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{O.apply(C=B.call(x.childNodes),x.childNodes),C[x.childNodes.length].nodeType}catch(e){O={apply:C.length?function(e,t){R.apply(e,B.call(t))}:function(e,t){for(var r=e.length,n=0;e[r++]=t[n++];);e.length=r-1}}}function oe(e,t,n,i){var o,s,h,l,u,f,y,g=t&&t.ownerDocument,w=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==w&&9!==w&&11!==w)return n;if(!i&&((t?t.ownerDocument||t:x)!==d&&p(t),t=t||d,m)){if(11!==w&&(u=J.exec(e)))if(o=u[1]){if(9===w){if(!(h=t.getElementById(o)))return n;if(h.id===o)return n.push(h),n}else if(g&&(h=g.getElementById(o))&&b(t,h)&&h.id===o)return n.push(h),n}else{if(u[2])return O.apply(n,t.getElementsByTagName(e)),n;if((o=u[3])&&r.getElementsByClassName&&t.getElementsByClassName)return O.apply(n,t.getElementsByClassName(o)),n}if(r.qsa&&!E[e+" "]&&(!v||!v.test(e))){if(1!==w)g=t,y=e;else if("object"!==t.nodeName.toLowerCase()){for((l=t.getAttribute("id"))?l=l.replace(te,re):t.setAttribute("id",l=_),s=(f=a(e)).length;s--;)f[s]="#"+l+" "+ye(f[s]);y=f.join(","),g=Q.test(e)&&me(t.parentNode)||t}if(y)try{return O.apply(n,g.querySelectorAll(y)),n}catch(e){}finally{l===_&&t.removeAttribute("id")}}}return c(e.replace(U,"$1"),t,n,i)}function ae(){var e=[];return function t(r,i){return e.push(r+" ")>n.cacheLength&&delete t[e.shift()],t[r+" "]=i}}function se(e){return e[_]=!0,e}function ce(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function he(e,t){for(var r=e.split("|"),i=r.length;i--;)n.attrHandle[r[i]]=t}function le(e,t){var r=t&&e,n=r&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(n)return n;if(r)for(;r=r.nextSibling;)if(r===t)return-1;return e?1:-1}function ue(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var r=t.nodeName.toLowerCase();return("input"===r||"button"===r)&&t.type===e}}function de(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function fe(e){return se(function(t){return t=+t,se(function(r,n){for(var i,o=e([],r.length,t),a=o.length;a--;)r[i=o[a]]&&(r[i]=!(n[i]=r[i]))})})}function me(e){return e&&void 0!==e.getElementsByTagName&&e}for(t in r=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:x;return a!==d&&9===a.nodeType&&a.documentElement?(f=(d=a).documentElement,m=!o(d),x!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",ne,!1):i.attachEvent&&i.attachEvent("onunload",ne)),r.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ce(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=Z.test(d.getElementsByClassName),r.getById=ce(function(e){return f.appendChild(e).id=_,!d.getElementsByName||!d.getElementsByName(_).length}),r.getById?(n.filter.ID=function(e){var t=e.replace($,ee);return function(e){return e.getAttribute("id")===t}},n.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var r=t.getElementById(e);return r?[r]:[]}}):(n.filter.ID=function(e){var t=e.replace($,ee);return function(e){var r=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return r&&r.value===t}},n.find.ID=function(e,t){if(void 0!==t.getElementById&&m){var r,n,i,o=t.getElementById(e);if(o){if((r=o.getAttributeNode("id"))&&r.value===e)return[o];for(i=t.getElementsByName(e),n=0;o=i[n++];)if((r=o.getAttributeNode("id"))&&r.value===e)return[o]}return[]}}),n.find.TAG=r.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):r.qsa?t.querySelectorAll(e):void 0}:function(e,t){var r,n=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;r=o[i++];)1===r.nodeType&&n.push(r);return n}return o},n.find.CLASS=r.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&m)return t.getElementsByClassName(e)},y=[],v=[],(r.qsa=Z.test(d.querySelectorAll))&&(ce(function(e){f.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+F+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+F+"*(?:value|"+k+")"),e.querySelectorAll("[id~="+_+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+_+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+F+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),f.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(r.matchesSelector=Z.test(g=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ce(function(e){r.disconnectedMatch=g.call(e,"*"),g.call(e,"[s!='']:x"),y.push("!=",D)}),v=v.length&&new RegExp(v.join("|")),y=y.length&&new RegExp(y.join("|")),t=Z.test(f.compareDocumentPosition),b=t||Z.test(f.contains)?function(e,t){var r=9===e.nodeType?e.documentElement:e,n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(r.contains?r.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},A=t?function(e,t){if(e===t)return u=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!r.sortDetached&&t.compareDocumentPosition(e)===n?e===d||e.ownerDocument===x&&b(x,e)?-1:t===d||t.ownerDocument===x&&b(x,t)?1:l?j(l,e)-j(l,t):0:4&n?-1:1)}:function(e,t){if(e===t)return u=!0,0;var r,n=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===d?-1:t===d?1:i?-1:o?1:l?j(l,e)-j(l,t):0;if(i===o)return le(e,t);for(r=e;r=r.parentNode;)a.unshift(r);for(r=t;r=r.parentNode;)s.unshift(r);for(;a[n]===s[n];)n++;return n?le(a[n],s[n]):a[n]===x?-1:s[n]===x?1:0},d):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),t=t.replace(V,"='$1']"),r.matchesSelector&&m&&!E[t+" "]&&(!y||!y.test(t))&&(!v||!v.test(t)))try{var n=g.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),b(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var i=n.attrHandle[t.toLowerCase()],o=i&&P.call(n.attrHandle,t.toLowerCase())?i(e,t,!m):void 0;return void 0!==o?o:r.attributes||!m?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,re)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,n=[],i=0,o=0;if(u=!r.detectDuplicates,l=!r.sortStable&&e.slice(0),e.sort(A),u){for(;t=e[o++];)t===e[o]&&(i=n.push(o));for(;i--;)e.splice(n[i],1)}return l=null,e},i=oe.getText=function(e){var t,r="",n=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)r+=i(e)}else if(3===o||4===o)return e.nodeValue}else for(;t=e[n++];)r+=i(t);return r},(n=oe.selectors={cacheLength:50,createPseudo:se,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,ee),e[3]=(e[3]||e[4]||e[5]||"").replace($,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,r=!e[6]&&e[2];return X.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":r&&W.test(r)&&(t=a(r,!0))&&(t=r.indexOf(")",r.length-t)-r.length)&&(e[0]=e[0].slice(0,t),e[2]=r.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace($,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=T[e+" "];return t||(t=new RegExp("(^|"+F+")"+e+"("+F+"|$)"))&&T(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,r){return function(n){var i=oe.attr(n,e);return null==i?"!="===t:!t||(i+="","="===t?i===r:"!="===t?i!==r:"^="===t?r&&0===i.indexOf(r):"*="===t?r&&i.indexOf(r)>-1:"$="===t?r&&i.slice(-r.length)===r:"~="===t?(" "+i.replace(N," ")+" ").indexOf(r)>-1:"|="===t&&(i===r||i.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,r,n,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===n&&0===i?function(e){return!!e.parentNode}:function(t,r,c){var h,l,u,p,d,f,m=o!==a?"nextSibling":"previousSibling",v=t.parentNode,y=s&&t.nodeName.toLowerCase(),g=!c&&!s,b=!1;if(v){if(o){for(;m;){for(p=t;p=p[m];)if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;f=m="only"===e&&!f&&"nextSibling"}return!0}if(f=[a?v.firstChild:v.lastChild],a&&g){for(b=(d=(h=(l=(u=(p=v)[_]||(p[_]={}))[p.uniqueID]||(u[p.uniqueID]={}))[e]||[])[0]===w&&h[1])&&h[2],p=d&&v.childNodes[d];p=++d&&p&&p[m]||(b=d=0)||f.pop();)if(1===p.nodeType&&++b&&p===t){l[e]=[w,d,b];break}}else if(g&&(b=d=(h=(l=(u=(p=t)[_]||(p[_]={}))[p.uniqueID]||(u[p.uniqueID]={}))[e]||[])[0]===w&&h[1]),!1===b)for(;(p=++d&&p&&p[m]||(b=d=0)||f.pop())&&((s?p.nodeName.toLowerCase()!==y:1!==p.nodeType)||!++b||(g&&((l=(u=p[_]||(p[_]={}))[p.uniqueID]||(u[p.uniqueID]={}))[e]=[w,b]),p!==t)););return(b-=i)===n||b%n==0&&b/n>=0}}},PSEUDO:function(e,t){var r,i=n.pseudos[e]||n.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[_]?i(t):i.length>1?(r=[e,e,"",t],n.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,r){for(var n,o=i(e,t),a=o.length;a--;)e[n=j(e,o[a])]=!(r[n]=o[a])}):function(e){return i(e,0,r)}):i}},pseudos:{not:se(function(e){var t=[],r=[],n=s(e.replace(U,"$1"));return n[_]?se(function(e,t,r,i){for(var o,a=n(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,n(t,null,o,r),t[0]=null,!r.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace($,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return q.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace($,ee).toLowerCase(),function(t){var r;do{if(r=m?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(r=r.toLowerCase())===e||0===r.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var r=e.location&&e.location.hash;return r&&r.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:de(!1),disabled:de(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!n.pseudos.empty(e)},header:function(e){return K.test(e.nodeName)},input:function(e){return Y.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:fe(function(){return[0]}),last:fe(function(e,t){return[t-1]}),eq:fe(function(e,t,r){return[r<0?r+t:r]}),even:fe(function(e,t){for(var r=0;r=0;)e.push(n);return e}),gt:fe(function(e,t,r){for(var n=r<0?r+t:r;++n1?function(t,r,n){for(var i=e.length;i--;)if(!e[i](t,r,n))return!1;return!0}:e[0]}function _e(e,t,r,n,i){for(var o,a=[],s=0,c=e.length,h=null!=t;s-1&&(o[h]=!(a[h]=u))}}else y=_e(y===a?y.splice(f,y.length):y),i?i(null,a,y,c):O.apply(a,y)})}function we(e){for(var t,r,i,o=e.length,a=n.relative[e[0].type],s=a||n.relative[" "],c=a?1:0,l=ge(function(e){return e===t},s,!0),u=ge(function(e){return j(t,e)>-1},s,!0),p=[function(e,r,n){var i=!a&&(n||r!==h)||((t=r).nodeType?l(e,r,n):u(e,r,n));return t=null,i}];c1&&be(p),c>1&&ye(e.slice(0,c-1).concat({value:" "===e[c-2].type?"*":""})).replace(U,"$1"),r,c0,i=e.length>0,o=function(o,a,s,c,l){var u,f,v,y=0,g="0",b=o&&[],_=[],x=h,M=o||i&&n.find.TAG("*",l),T=w+=null==x?1:Math.random()||.1,S=M.length;for(l&&(h=a===d||a||l);g!==S&&null!=(u=M[g]);g++){if(i&&u){for(f=0,a||u.ownerDocument===d||(p(u),s=!m);v=e[f++];)if(v(u,a||d,s)){c.push(u);break}l&&(w=T)}r&&((u=!v&&u)&&y--,o&&b.push(u))}if(y+=g,r&&g!==y){for(f=0;v=t[f++];)v(b,_,a,s);if(o){if(y>0)for(;g--;)b[g]||_[g]||(_[g]=L.call(c));_=_e(_)}O.apply(c,_),l&&!o&&_.length>0&&y+t.length>1&&oe.uniqueSort(c)}return l&&(w=T,h=x),b};return r?se(o):o}(o,i))).selector=e}return s},c=oe.select=function(e,t,r,i){var o,c,h,l,u,p="function"==typeof e&&e,d=!i&&a(e=p.selector||e);if(r=r||[],1===d.length){if((c=d[0]=d[0].slice(0)).length>2&&"ID"===(h=c[0]).type&&9===t.nodeType&&m&&n.relative[c[1].type]){if(!(t=(n.find.ID(h.matches[0].replace($,ee),t)||[])[0]))return r;p&&(t=t.parentNode),e=e.slice(c.shift().value.length)}for(o=X.needsContext.test(e)?0:c.length;o--&&(h=c[o],!n.relative[l=h.type]);)if((u=n.find[l])&&(i=u(h.matches[0].replace($,ee),Q.test(c[0].type)&&me(t.parentNode)||t))){if(c.splice(o,1),!(e=i.length&&ye(c)))return O.apply(r,i),r;break}}return(p||s(e,d))(i,t,!m,r,!t||Q.test(e)&&me(t.parentNode)||t),r},r.sortStable=_.split("").sort(A).join("")===_,r.detectDuplicates=!!u,p(),r.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ce(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||he("type|href|height|width",function(e,t,r){if(!r)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),r.attributes&&ce(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||he("value",function(e,t,r){if(!r&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||he(k,function(e,t,r){var n;if(!r)return!0===e[t]?t.toLowerCase():(n=e.getAttributeNode(t))&&n.specified?n.value:null}),oe}(r);M.find=E,M.expr=E.selectors,M.expr[":"]=M.expr.pseudos,M.uniqueSort=M.unique=E.uniqueSort,M.text=E.getText,M.isXMLDoc=E.isXML,M.contains=E.contains,M.escapeSelector=E.escape;var A=function(e,t,r){for(var n=[],i=void 0!==r;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&M(e).is(r))break;n.push(e)}return n},P=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r},C=M.expr.match.needsContext;function L(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var R=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function O(e,t,r){return g(t)?M.grep(e,function(e,n){return!!t.call(e,n,e)!==r}):t.nodeType?M.grep(e,function(e){return e===t!==r}):"string"!=typeof t?M.grep(e,function(e){return u.call(t,e)>-1!==r}):M.filter(t,e,r)}M.filter=function(e,t,r){var n=t[0];return r&&(e=":not("+e+")"),1===t.length&&1===n.nodeType?M.find.matchesSelector(n,e)?[n]:[]:M.find.matches(e,M.grep(t,function(e){return 1===e.nodeType}))},M.fn.extend({find:function(e){var t,r,n=this.length,i=this;if("string"!=typeof e)return this.pushStack(M(e).filter(function(){for(t=0;t1?M.uniqueSort(r):r},filter:function(e){return this.pushStack(O(this,e||[],!1))},not:function(e){return this.pushStack(O(this,e||[],!0))},is:function(e){return!!O(this,"string"==typeof e&&C.test(e)?M(e):e||[],!1).length}});var B,j=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(M.fn.init=function(e,t,r){var n,i;if(!e)return this;if(r=r||B,"string"==typeof e){if(!(n="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:j.exec(e))||!n[1]&&t)return!t||t.jquery?(t||r).find(e):this.constructor(t).find(e);if(n[1]){if(t=t instanceof M?t[0]:t,M.merge(this,M.parseHTML(n[1],t&&t.nodeType?t.ownerDocument||t:a,!0)),R.test(n[1])&&M.isPlainObject(t))for(n in t)g(this[n])?this[n](t[n]):this.attr(n,t[n]);return this}return(i=a.getElementById(n[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==r.ready?r.ready(e):e(M):M.makeArray(e,this)}).prototype=M.fn,B=M(a);var k=/^(?:parents|prev(?:Until|All))/,F={children:!0,contents:!0,next:!0,prev:!0};function z(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}M.fn.extend({has:function(e){var t=M(e,this),r=t.length;return this.filter(function(){for(var e=0;e-1:1===r.nodeType&&M.find.matchesSelector(r,e))){o.push(r);break}return this.pushStack(o.length>1?M.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(M(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(M.uniqueSort(M.merge(this.get(),M(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),M.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return A(e,"parentNode")},parentsUntil:function(e,t,r){return A(e,"parentNode",r)},next:function(e){return z(e,"nextSibling")},prev:function(e){return z(e,"previousSibling")},nextAll:function(e){return A(e,"nextSibling")},prevAll:function(e){return A(e,"previousSibling")},nextUntil:function(e,t,r){return A(e,"nextSibling",r)},prevUntil:function(e,t,r){return A(e,"previousSibling",r)},siblings:function(e){return P((e.parentNode||{}).firstChild,e)},children:function(e){return P(e.firstChild)},contents:function(e){return L(e,"iframe")?e.contentDocument:(L(e,"template")&&(e=e.content||e),M.merge([],e.childNodes))}},function(e,t){M.fn[e]=function(r,n){var i=M.map(this,t,r);return"Until"!==e.slice(-5)&&(n=r),n&&"string"==typeof n&&(i=M.filter(n,i)),this.length>1&&(F[e]||M.uniqueSort(i),k.test(e)&&i.reverse()),this.pushStack(i)}});var I=/[^\x20\t\r\n\f]+/g;function D(e){return e}function N(e){throw e}function U(e,t,r,n){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(r):e&&g(i=e.then)?i.call(e,t,r):t.apply(void 0,[e].slice(n))}catch(e){r.apply(void 0,[e])}}M.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return M.each(e.match(I)||[],function(e,r){t[r]=!0}),t}(e):M.extend({},e);var t,r,n,i,o=[],a=[],s=-1,c=function(){for(i=i||e.once,n=t=!0;a.length;s=-1)for(r=a.shift();++s-1;)o.splice(r,1),r<=s&&s--}),this},has:function(e){return e?M.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=r="",this},disabled:function(){return!o},lock:function(){return i=a=[],r||t||(o=r=""),this},locked:function(){return!!i},fireWith:function(e,r){return i||(r=[e,(r=r||[]).slice?r.slice():r],a.push(r),t||c()),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!n}};return h},M.extend({Deferred:function(e){var t=[["notify","progress",M.Callbacks("memory"),M.Callbacks("memory"),2],["resolve","done",M.Callbacks("once memory"),M.Callbacks("once memory"),0,"resolved"],["reject","fail",M.Callbacks("once memory"),M.Callbacks("once memory"),1,"rejected"]],n="pending",i={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return M.Deferred(function(r){M.each(t,function(t,n){var i=g(e[n[4]])&&e[n[4]];o[n[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[n[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(e,n,i){var o=0;function a(e,t,n,i){return function(){var s=this,c=arguments,h=function(){var r,h;if(!(e=o&&(n!==N&&(s=void 0,c=[r]),t.rejectWith(s,c))}};e?l():(M.Deferred.getStackHook&&(l.stackTrace=M.Deferred.getStackHook()),r.setTimeout(l))}}return M.Deferred(function(r){t[0][3].add(a(0,r,g(i)?i:D,r.notifyWith)),t[1][3].add(a(0,r,g(e)?e:D)),t[2][3].add(a(0,r,g(n)?n:N))}).promise()},promise:function(e){return null!=e?M.extend(e,i):i}},o={};return M.each(t,function(e,r){var a=r[2],s=r[5];i[r[1]]=a.add,s&&a.add(function(){n=s},t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),a.add(r[3].fire),o[r[0]]=function(){return o[r[0]+"With"](this===o?void 0:this,arguments),this},o[r[0]+"With"]=a.fireWith}),i.promise(o),e&&e.call(o,o),o},when:function(e){var t=arguments.length,r=t,n=Array(r),i=c.call(arguments),o=M.Deferred(),a=function(e){return function(r){n[e]=this,i[e]=arguments.length>1?c.call(arguments):r,--t||o.resolveWith(n,i)}};if(t<=1&&(U(e,o.done(a(r)).resolve,o.reject,!t),"pending"===o.state()||g(i[r]&&i[r].then)))return o.then();for(;r--;)U(i[r],a(r),o.reject);return o.promise()}});var G=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;M.Deferred.exceptionHook=function(e,t){r.console&&r.console.warn&&e&&G.test(e.name)&&r.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},M.readyException=function(e){r.setTimeout(function(){throw e})};var H=M.Deferred();function V(){a.removeEventListener("DOMContentLoaded",V),r.removeEventListener("load",V),M.ready()}M.fn.ready=function(e){return H.then(e).catch(function(e){M.readyException(e)}),this},M.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--M.readyWait:M.isReady)||(M.isReady=!0,!0!==e&&--M.readyWait>0||H.resolveWith(a,[M]))}}),M.ready.then=H.then,"complete"===a.readyState||"loading"!==a.readyState&&!a.documentElement.doScroll?r.setTimeout(M.ready):(a.addEventListener("DOMContentLoaded",V),r.addEventListener("load",V));var W=function(e,t,r,n,i,o,a){var s=0,c=e.length,h=null==r;if("object"===w(r))for(s in i=!0,r)W(e,t,s,r[s],!0,o,a);else if(void 0!==n&&(i=!0,g(n)||(a=!0),h&&(a?(t.call(e,n),t=null):(h=t,t=function(e,t,r){return h.call(M(e),r)})),t))for(;s1,null,!0)},removeData:function(e){return this.each(function(){$.remove(this,e)})}}),M.extend({queue:function(e,t,r){var n;if(e)return t=(t||"fx")+"queue",n=Q.get(e,t),r&&(!n||Array.isArray(r)?n=Q.access(e,t,M.makeArray(r)):n.push(r)),n||[]},dequeue:function(e,t){t=t||"fx";var r=M.queue(e,t),n=r.length,i=r.shift(),o=M._queueHooks(e,t);"inprogress"===i&&(i=r.shift(),n--),i&&("fx"===t&&r.unshift("inprogress"),delete o.stop,i.call(e,function(){M.dequeue(e,t)},o)),!n&&o&&o.empty.fire()},_queueHooks:function(e,t){var r=t+"queueHooks";return Q.get(e,r)||Q.access(e,r,{empty:M.Callbacks("once memory").add(function(){Q.remove(e,[t+"queue",r])})})}}),M.fn.extend({queue:function(e,t){var r=2;return"string"!=typeof e&&(t=e,e="fx",r--),arguments.length\x20\t\r\n\f]+)/i,fe=/^$|^module$|\/(?:java|ecma)script/i,me={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var r;return r=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&L(e,t)?M.merge([e],r):r}function ye(e,t){for(var r=0,n=e.length;r-1)i&&i.push(o);else if(h=M.contains(o.ownerDocument,o),a=ve(u.appendChild(o),"script"),h&&ye(a),r)for(l=0;o=a[l++];)fe.test(o.type||"")&&r.push(o);return u}!function(){var e=a.createDocumentFragment().appendChild(a.createElement("div")),t=a.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),y.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="",y.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var _e=a.documentElement,xe=/^key/,we=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Me=/^([^.]*)(?:\.(.+)|)/;function Te(){return!0}function Se(){return!1}function Ee(){try{return a.activeElement}catch(e){}}function Ae(e,t,r,n,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof r&&(n=n||r,r=void 0),t)Ae(e,s,r,n,t[s],o);return e}if(null==n&&null==i?(i=r,n=r=void 0):null==i&&("string"==typeof r?(i=n,n=void 0):(i=n,n=r,r=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return M().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=M.guid++)),e.each(function(){M.event.add(this,t,i,n,r)})}M.event={global:{},add:function(e,t,r,n,i){var o,a,s,c,h,l,u,p,d,f,m,v=Q.get(e);if(v)for(r.handler&&(r=(o=r).handler,i=o.selector),i&&M.find.matchesSelector(_e,i),r.guid||(r.guid=M.guid++),(c=v.events)||(c=v.events={}),(a=v.handle)||(a=v.handle=function(t){return void 0!==M&&M.event.triggered!==t.type?M.event.dispatch.apply(e,arguments):void 0}),h=(t=(t||"").match(I)||[""]).length;h--;)d=m=(s=Me.exec(t[h])||[])[1],f=(s[2]||"").split(".").sort(),d&&(u=M.event.special[d]||{},d=(i?u.delegateType:u.bindType)||d,u=M.event.special[d]||{},l=M.extend({type:d,origType:m,data:n,handler:r,guid:r.guid,selector:i,needsContext:i&&M.expr.match.needsContext.test(i),namespace:f.join(".")},o),(p=c[d])||((p=c[d]=[]).delegateCount=0,u.setup&&!1!==u.setup.call(e,n,f,a)||e.addEventListener&&e.addEventListener(d,a)),u.add&&(u.add.call(e,l),l.handler.guid||(l.handler.guid=r.guid)),i?p.splice(p.delegateCount++,0,l):p.push(l),M.event.global[d]=!0)},remove:function(e,t,r,n,i){var o,a,s,c,h,l,u,p,d,f,m,v=Q.hasData(e)&&Q.get(e);if(v&&(c=v.events)){for(h=(t=(t||"").match(I)||[""]).length;h--;)if(d=m=(s=Me.exec(t[h])||[])[1],f=(s[2]||"").split(".").sort(),d){for(u=M.event.special[d]||{},p=c[d=(n?u.delegateType:u.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)l=p[o],!i&&m!==l.origType||r&&r.guid!==l.guid||s&&!s.test(l.namespace)||n&&n!==l.selector&&("**"!==n||!l.selector)||(p.splice(o,1),l.selector&&p.delegateCount--,u.remove&&u.remove.call(e,l));a&&!p.length&&(u.teardown&&!1!==u.teardown.call(e,f,v.handle)||M.removeEvent(e,d,v.handle),delete c[d])}else for(d in c)M.event.remove(e,d+t[h],r,n,!0);M.isEmptyObject(c)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,r,n,i,o,a,s=M.event.fix(e),c=new Array(arguments.length),h=(Q.get(this,"events")||{})[s.type]||[],l=M.event.special[s.type]||{};for(c[0]=s,t=1;t=1))for(;h!==this;h=h.parentNode||this)if(1===h.nodeType&&("click"!==e.type||!0!==h.disabled)){for(o=[],a={},r=0;r-1:M.find(i,this,null,[h]).length),a[i]&&o.push(n);o.length&&s.push({elem:h,handlers:o})}return h=this,c\x20\t\r\n\f]*)[^>]*)\/>/gi,Ce=/\s*$/g;function Oe(e,t){return L(e,"table")&&L(11!==t.nodeType?t:t.firstChild,"tr")&&M(e).children("tbody")[0]||e}function Be(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function je(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function ke(e,t){var r,n,i,o,a,s,c,h;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),h=o.events))for(i in delete a.handle,a.events={},h)for(r=0,n=h[i].length;r1&&"string"==typeof f&&!y.checkClone&&Le.test(f))return e.each(function(i){var o=e.eq(i);m&&(t[0]=f.call(this,i,o.html())),ze(o,t,r,n)});if(p&&(o=(i=be(t,e[0].ownerDocument,!1,e,n)).firstChild,1===i.childNodes.length&&(i=o),o||n)){for(s=(a=M.map(ve(i,"script"),Be)).length;u")},clone:function(e,t,r){var n,i,o,a,s=e.cloneNode(!0),c=M.contains(e.ownerDocument,e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||M.isXMLDoc(e)))for(a=ve(s),n=0,i=(o=ve(e)).length;n0&&ye(a,!c&&ve(e,"script")),s},cleanData:function(e){for(var t,r,n,i=M.event.special,o=0;void 0!==(r=e[o]);o++)if(Z(r)){if(t=r[Q.expando]){if(t.events)for(n in t.events)i[n]?M.event.remove(r,n):M.removeEvent(r,n,t.handle);r[Q.expando]=void 0}r[$.expando]&&(r[$.expando]=void 0)}}}),M.fn.extend({detach:function(e){return Ie(this,e,!0)},remove:function(e){return Ie(this,e)},text:function(e){return W(this,function(e){return void 0===e?M.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return ze(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Oe(this,e).appendChild(e)})},prepend:function(){return ze(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Oe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return ze(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return ze(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(M.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return M.clone(this,e,t)})},html:function(e){return W(this,function(e){var t=this[0]||{},r=0,n=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ce.test(e)&&!me[(de.exec(e)||["",""])[1].toLowerCase()]){e=M.htmlPrefilter(e);try{for(;r=0&&(c+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-c-s-.5))),c}function $e(e,t,r){var n=Ne(e),i=Ge(e,t,n),o="border-box"===M.css(e,"boxSizing",!1,n),a=o;if(De.test(i)){if(!r)return i;i="auto"}return a=a&&(y.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===M.css(e,"display",!1,n))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(i=parseFloat(i)||0)+Qe(e,t,r||(o?"border":"content"),a,n,i)+"px"}function et(e,t,r,n,i){return new et.prototype.init(e,t,r,n,i)}M.extend({cssHooks:{opacity:{get:function(e,t){if(t){var r=Ge(e,"opacity");return""===r?"1":r}}}},cssNumber:{animationIterationCount:!0,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:{},style:function(e,t,r,n){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=K(t),c=We.test(t),h=e.style;if(c||(t=Ze(s)),a=M.cssHooks[t]||M.cssHooks[s],void 0===r)return a&&"get"in a&&void 0!==(i=a.get(e,!1,n))?i:h[t];"string"===(o=typeof r)&&(i=ie.exec(r))&&i[1]&&(r=ce(e,t,i),o="number"),null!=r&&r==r&&("number"===o&&(r+=i&&i[3]||(M.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==r||0!==t.indexOf("background")||(h[t]="inherit"),a&&"set"in a&&void 0===(r=a.set(e,r,n))||(c?h.setProperty(t,r):h[t]=r))}},css:function(e,t,r,n){var i,o,a,s=K(t);return We.test(t)||(t=Ze(s)),(a=M.cssHooks[t]||M.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,r)),void 0===i&&(i=Ge(e,t,n)),"normal"===i&&t in Xe&&(i=Xe[t]),""===r||r?(o=parseFloat(i),!0===r||isFinite(o)?o||0:i):i}}),M.each(["height","width"],function(e,t){M.cssHooks[t]={get:function(e,r,n){if(r)return!Ve.test(M.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?$e(e,t,n):se(e,qe,function(){return $e(e,t,n)})},set:function(e,r,n){var i,o=Ne(e),a="border-box"===M.css(e,"boxSizing",!1,o),s=n&&Qe(e,t,n,a,o);return a&&y.scrollboxSize()===o.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Qe(e,t,"border",!1,o)-.5)),s&&(i=ie.exec(r))&&"px"!==(i[3]||"px")&&(e.style[t]=r,r=M.css(e,t)),Je(0,r,s)}}}),M.cssHooks.marginLeft=He(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Ge(e,"marginLeft"))||e.getBoundingClientRect().left-se(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),M.each({margin:"",padding:"",border:"Width"},function(e,t){M.cssHooks[e+t]={expand:function(r){for(var n=0,i={},o="string"==typeof r?r.split(" "):[r];n<4;n++)i[e+oe[n]+t]=o[n]||o[n-2]||o[0];return i}},"margin"!==e&&(M.cssHooks[e+t].set=Je)}),M.fn.extend({css:function(e,t){return W(this,function(e,t,r){var n,i,o={},a=0;if(Array.isArray(t)){for(n=Ne(e),i=t.length;a1)}}),M.Tween=et,et.prototype={constructor:et,init:function(e,t,r,n,i,o){this.elem=e,this.prop=r,this.easing=i||M.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=n,this.unit=o||(M.cssNumber[r]?"":"px")},cur:function(){var e=et.propHooks[this.prop];return e&&e.get?e.get(this):et.propHooks._default.get(this)},run:function(e){var t,r=et.propHooks[this.prop];return this.options.duration?this.pos=t=M.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),r&&r.set?r.set(this):et.propHooks._default.set(this),this}},et.prototype.init.prototype=et.prototype,et.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=M.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){M.fx.step[e.prop]?M.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[M.cssProps[e.prop]]&&!M.cssHooks[e.prop]?e.elem[e.prop]=e.now:M.style(e.elem,e.prop,e.now+e.unit)}}},et.propHooks.scrollTop=et.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},M.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},M.fx=et.prototype.init,M.fx.step={};var tt,rt,nt=/^(?:toggle|show|hide)$/,it=/queueHooks$/;function ot(){rt&&(!1===a.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(ot):r.setTimeout(ot,M.fx.interval),M.fx.tick())}function at(){return r.setTimeout(function(){tt=void 0}),tt=Date.now()}function st(e,t){var r,n=0,i={height:e};for(t=t?1:0;n<4;n+=2-t)i["margin"+(r=oe[n])]=i["padding"+r]=e;return t&&(i.opacity=i.width=e),i}function ct(e,t,r){for(var n,i=(ht.tweeners[t]||[]).concat(ht.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(e){return this.each(function(){M.removeAttr(this,e)})}}),M.extend({attr:function(e,t,r){var n,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?M.prop(e,t,r):(1===o&&M.isXMLDoc(e)||(i=M.attrHooks[t.toLowerCase()]||(M.expr.match.bool.test(t)?lt:void 0)),void 0!==r?null===r?void M.removeAttr(e,t):i&&"set"in i&&void 0!==(n=i.set(e,r,t))?n:(e.setAttribute(t,r+""),r):i&&"get"in i&&null!==(n=i.get(e,t))?n:null==(n=M.find.attr(e,t))?void 0:n)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&L(e,"input")){var r=e.value;return e.setAttribute("type",t),r&&(e.value=r),t}}}},removeAttr:function(e,t){var r,n=0,i=t&&t.match(I);if(i&&1===e.nodeType)for(;r=i[n++];)e.removeAttribute(r)}}),lt={set:function(e,t,r){return!1===t?M.removeAttr(e,r):e.setAttribute(r,r),r}},M.each(M.expr.match.bool.source.match(/\w+/g),function(e,t){var r=ut[t]||M.find.attr;ut[t]=function(e,t,n){var i,o,a=t.toLowerCase();return n||(o=ut[a],ut[a]=i,i=null!=r(e,t,n)?a:null,ut[a]=o),i}});var pt=/^(?:input|select|textarea|button)$/i,dt=/^(?:a|area)$/i;function ft(e){return(e.match(I)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function vt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(I)||[]}M.fn.extend({prop:function(e,t){return W(this,M.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[M.propFix[e]||e]})}}),M.extend({prop:function(e,t,r){var n,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&M.isXMLDoc(e)||(t=M.propFix[t]||t,i=M.propHooks[t]),void 0!==r?i&&"set"in i&&void 0!==(n=i.set(e,r,t))?n:e[t]=r:i&&"get"in i&&null!==(n=i.get(e,t))?n:e[t]},propHooks:{tabIndex:{get:function(e){var t=M.find.attr(e,"tabindex");return t?parseInt(t,10):pt.test(e.nodeName)||dt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),y.optSelected||(M.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),M.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){M.propFix[this.toLowerCase()]=this}),M.fn.extend({addClass:function(e){var t,r,n,i,o,a,s,c=0;if(g(e))return this.each(function(t){M(this).addClass(e.call(this,t,mt(this)))});if((t=vt(e)).length)for(;r=this[c++];)if(i=mt(r),n=1===r.nodeType&&" "+ft(i)+" "){for(a=0;o=t[a++];)n.indexOf(" "+o+" ")<0&&(n+=o+" ");i!==(s=ft(n))&&r.setAttribute("class",s)}return this},removeClass:function(e){var t,r,n,i,o,a,s,c=0;if(g(e))return this.each(function(t){M(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=vt(e)).length)for(;r=this[c++];)if(i=mt(r),n=1===r.nodeType&&" "+ft(i)+" "){for(a=0;o=t[a++];)for(;n.indexOf(" "+o+" ")>-1;)n=n.replace(" "+o+" "," ");i!==(s=ft(n))&&r.setAttribute("class",s)}return this},toggleClass:function(e,t){var r=typeof e,n="string"===r||Array.isArray(e);return"boolean"==typeof t&&n?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(r){M(this).toggleClass(e.call(this,r,mt(this),t),t)}):this.each(function(){var t,i,o,a;if(n)for(i=0,o=M(this),a=vt(e);t=a[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else void 0!==e&&"boolean"!==r||((t=mt(this))&&Q.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Q.get(this,"__className__")||""))})},hasClass:function(e){var t,r,n=0;for(t=" "+e+" ";r=this[n++];)if(1===r.nodeType&&(" "+ft(mt(r))+" ").indexOf(t)>-1)return!0;return!1}});var yt=/\r/g;M.fn.extend({val:function(e){var t,r,n,i=this[0];return arguments.length?(n=g(e),this.each(function(r){var i;1===this.nodeType&&(null==(i=n?e.call(this,r,M(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=M.map(i,function(e){return null==e?"":e+""})),(t=M.valHooks[this.type]||M.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))})):i?(t=M.valHooks[i.type]||M.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(r=t.get(i,"value"))?r:"string"==typeof(r=i.value)?r.replace(yt,""):null==r?"":r:void 0}}),M.extend({valHooks:{option:{get:function(e){var t=M.find.attr(e,"value");return null!=t?t:ft(M.text(e))}},select:{get:function(e){var t,r,n,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],c=a?o+1:i.length;for(n=o<0?c:a?o:0;n-1)&&(r=!0);return r||(e.selectedIndex=-1),o}}}}),M.each(["radio","checkbox"],function(){M.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=M.inArray(M(e).val(),t)>-1}},y.checkOn||(M.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in r;var gt=/^(?:focusinfocus|focusoutblur)$/,bt=function(e){e.stopPropagation()};M.extend(M.event,{trigger:function(e,t,n,i){var o,s,c,h,l,u,p,d,m=[n||a],v=f.call(e,"type")?e.type:e,y=f.call(e,"namespace")?e.namespace.split("."):[];if(s=d=c=n=n||a,3!==n.nodeType&&8!==n.nodeType&&!gt.test(v+M.event.triggered)&&(v.indexOf(".")>-1&&(v=(y=v.split(".")).shift(),y.sort()),l=v.indexOf(":")<0&&"on"+v,(e=e[M.expando]?e:new M.Event(v,"object"==typeof e&&e)).isTrigger=i?2:3,e.namespace=y.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+y.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:M.makeArray(t,[e]),p=M.event.special[v]||{},i||!p.trigger||!1!==p.trigger.apply(n,t))){if(!i&&!p.noBubble&&!b(n)){for(h=p.delegateType||v,gt.test(h+v)||(s=s.parentNode);s;s=s.parentNode)m.push(s),c=s;c===(n.ownerDocument||a)&&m.push(c.defaultView||c.parentWindow||r)}for(o=0;(s=m[o++])&&!e.isPropagationStopped();)d=s,e.type=o>1?h:p.bindType||v,(u=(Q.get(s,"events")||{})[e.type]&&Q.get(s,"handle"))&&u.apply(s,t),(u=l&&s[l])&&u.apply&&Z(s)&&(e.result=u.apply(s,t),!1===e.result&&e.preventDefault());return e.type=v,i||e.isDefaultPrevented()||p._default&&!1!==p._default.apply(m.pop(),t)||!Z(n)||l&&g(n[v])&&!b(n)&&((c=n[l])&&(n[l]=null),M.event.triggered=v,e.isPropagationStopped()&&d.addEventListener(v,bt),n[v](),e.isPropagationStopped()&&d.removeEventListener(v,bt),M.event.triggered=void 0,c&&(n[l]=c)),e.result}},simulate:function(e,t,r){var n=M.extend(new M.Event,r,{type:e,isSimulated:!0});M.event.trigger(n,null,t)}}),M.fn.extend({trigger:function(e,t){return this.each(function(){M.event.trigger(e,t,this)})},triggerHandler:function(e,t){var r=this[0];if(r)return M.event.trigger(e,t,r,!0)}}),y.focusin||M.each({focus:"focusin",blur:"focusout"},function(e,t){var r=function(e){M.event.simulate(t,e.target,M.event.fix(e))};M.event.special[t]={setup:function(){var n=this.ownerDocument||this,i=Q.access(n,t);i||n.addEventListener(e,r,!0),Q.access(n,t,(i||0)+1)},teardown:function(){var n=this.ownerDocument||this,i=Q.access(n,t)-1;i?Q.access(n,t,i):(n.removeEventListener(e,r,!0),Q.remove(n,t))}}});var _t=r.location,xt=Date.now(),wt=/\?/;M.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new r.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||M.error("Invalid XML: "+e),t};var Mt=/\[\]$/,Tt=/\r?\n/g,St=/^(?:submit|button|image|reset|file)$/i,Et=/^(?:input|select|textarea|keygen)/i;function At(e,t,r,n){var i;if(Array.isArray(t))M.each(t,function(t,i){r||Mt.test(e)?n(e,i):At(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,r,n)});else if(r||"object"!==w(t))n(e,t);else for(i in t)At(e+"["+i+"]",t[i],r,n)}M.param=function(e,t){var r,n=[],i=function(e,t){var r=g(t)?t():t;n[n.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==r?"":r)};if(Array.isArray(e)||e.jquery&&!M.isPlainObject(e))M.each(e,function(){i(this.name,this.value)});else for(r in e)At(r,e[r],t,i);return n.join("&")},M.fn.extend({serialize:function(){return M.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=M.prop(this,"elements");return e?M.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!M(this).is(":disabled")&&Et.test(this.nodeName)&&!St.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var r=M(this).val();return null==r?null:Array.isArray(r)?M.map(r,function(e){return{name:t.name,value:e.replace(Tt,"\r\n")}}):{name:t.name,value:r.replace(Tt,"\r\n")}}).get()}});var Pt=/%20/g,Ct=/#.*$/,Lt=/([?&])_=[^&]*/,Rt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ot=/^(?:GET|HEAD)$/,Bt=/^\/\//,jt={},kt={},Ft="*/".concat("*"),zt=a.createElement("a");function It(e){return function(t,r){"string"!=typeof t&&(r=t,t="*");var n,i=0,o=t.toLowerCase().match(I)||[];if(g(r))for(;n=o[i++];)"+"===n[0]?(n=n.slice(1)||"*",(e[n]=e[n]||[]).unshift(r)):(e[n]=e[n]||[]).push(r)}}function Dt(e,t,r,n){var i={},o=e===kt;function a(s){var c;return i[s]=!0,M.each(e[s]||[],function(e,s){var h=s(t,r,n);return"string"!=typeof h||o||i[h]?o?!(c=h):void 0:(t.dataTypes.unshift(h),a(h),!1)}),c}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Nt(e,t){var r,n,i=M.ajaxSettings.flatOptions||{};for(r in t)void 0!==t[r]&&((i[r]?e:n||(n={}))[r]=t[r]);return n&&M.extend(!0,e,n),e}zt.href=_t.href,M.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:_t.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(_t.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ft,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":M.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Nt(Nt(e,M.ajaxSettings),t):Nt(M.ajaxSettings,e)},ajaxPrefilter:It(jt),ajaxTransport:It(kt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,i,o,s,c,h,l,u,p,d,f=M.ajaxSetup({},t),m=f.context||f,v=f.context&&(m.nodeType||m.jquery)?M(m):M.event,y=M.Deferred(),g=M.Callbacks("once memory"),b=f.statusCode||{},_={},x={},w="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(l){if(!s)for(s={};t=Rt.exec(o);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return l?o:null},setRequestHeader:function(e,t){return null==l&&(e=x[e.toLowerCase()]=x[e.toLowerCase()]||e,_[e]=t),this},overrideMimeType:function(e){return null==l&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)T.always(e[T.status]);else for(t in e)b[t]=[b[t],e[t]];return this},abort:function(e){var t=e||w;return n&&n.abort(t),S(0,t),this}};if(y.promise(T),f.url=((e||f.url||_t.href)+"").replace(Bt,_t.protocol+"//"),f.type=t.method||t.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(I)||[""],null==f.crossDomain){h=a.createElement("a");try{h.href=f.url,h.href=h.href,f.crossDomain=zt.protocol+"//"+zt.host!=h.protocol+"//"+h.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=M.param(f.data,f.traditional)),Dt(jt,f,t,T),l)return T;for(p in(u=M.event&&f.global)&&0==M.active++&&M.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Ot.test(f.type),i=f.url.replace(Ct,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(Pt,"+")):(d=f.url.slice(i.length),f.data&&(f.processData||"string"==typeof f.data)&&(i+=(wt.test(i)?"&":"?")+f.data,delete f.data),!1===f.cache&&(i=i.replace(Lt,"$1"),d=(wt.test(i)?"&":"?")+"_="+xt+++d),f.url=i+d),f.ifModified&&(M.lastModified[i]&&T.setRequestHeader("If-Modified-Since",M.lastModified[i]),M.etag[i]&&T.setRequestHeader("If-None-Match",M.etag[i])),(f.data&&f.hasContent&&!1!==f.contentType||t.contentType)&&T.setRequestHeader("Content-Type",f.contentType),T.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Ft+"; q=0.01":""):f.accepts["*"]),f.headers)T.setRequestHeader(p,f.headers[p]);if(f.beforeSend&&(!1===f.beforeSend.call(m,T,f)||l))return T.abort();if(w="abort",g.add(f.complete),T.done(f.success),T.fail(f.error),n=Dt(kt,f,t,T)){if(T.readyState=1,u&&v.trigger("ajaxSend",[T,f]),l)return T;f.async&&f.timeout>0&&(c=r.setTimeout(function(){T.abort("timeout")},f.timeout));try{l=!1,n.send(_,S)}catch(e){if(l)throw e;S(-1,e)}}else S(-1,"No Transport");function S(e,t,a,s){var h,p,d,_,x,w=t;l||(l=!0,c&&r.clearTimeout(c),n=void 0,o=s||"",T.readyState=e>0?4:0,h=e>=200&&e<300||304===e,a&&(_=function(e,t,r){for(var n,i,o,a,s=e.contents,c=e.dataTypes;"*"===c[0];)c.shift(),void 0===n&&(n=e.mimeType||t.getResponseHeader("Content-Type"));if(n)for(i in s)if(s[i]&&s[i].test(n)){c.unshift(i);break}if(c[0]in r)o=c[0];else{for(i in r){if(!c[0]||e.converters[i+" "+c[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==c[0]&&c.unshift(o),r[o]}(f,T,a)),_=function(e,t,r,n){var i,o,a,s,c,h={},l=e.dataTypes.slice();if(l[1])for(a in e.converters)h[a.toLowerCase()]=e.converters[a];for(o=l.shift();o;)if(e.responseFields[o]&&(r[e.responseFields[o]]=t),!c&&n&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),c=o,o=l.shift())if("*"===o)o=c;else if("*"!==c&&c!==o){if(!(a=h[c+" "+o]||h["* "+o]))for(i in h)if((s=i.split(" "))[1]===o&&(a=h[c+" "+s[0]]||h["* "+s[0]])){!0===a?a=h[i]:!0!==h[i]&&(o=s[0],l.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+c+" to "+o}}}return{state:"success",data:t}}(f,_,T,h),h?(f.ifModified&&((x=T.getResponseHeader("Last-Modified"))&&(M.lastModified[i]=x),(x=T.getResponseHeader("etag"))&&(M.etag[i]=x)),204===e||"HEAD"===f.type?w="nocontent":304===e?w="notmodified":(w=_.state,p=_.data,h=!(d=_.error))):(d=w,!e&&w||(w="error",e<0&&(e=0))),T.status=e,T.statusText=(t||w)+"",h?y.resolveWith(m,[p,w,T]):y.rejectWith(m,[T,w,d]),T.statusCode(b),b=void 0,u&&v.trigger(h?"ajaxSuccess":"ajaxError",[T,f,h?p:d]),g.fireWith(m,[T,w]),u&&(v.trigger("ajaxComplete",[T,f]),--M.active||M.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,r){return M.get(e,t,r,"json")},getScript:function(e,t){return M.get(e,void 0,t,"script")}}),M.each(["get","post"],function(e,t){M[t]=function(e,r,n,i){return g(r)&&(i=i||n,n=r,r=void 0),M.ajax(M.extend({url:e,type:t,dataType:i,data:r,success:n},M.isPlainObject(e)&&e))}}),M._evalUrl=function(e){return M.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},M.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=M(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g(e)?this.each(function(t){M(this).wrapInner(e.call(this,t))}):this.each(function(){var t=M(this),r=t.contents();r.length?r.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(r){M(this).wrapAll(t?e.call(this,r):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){M(this).replaceWith(this.childNodes)}),this}}),M.expr.pseudos.hidden=function(e){return!M.expr.pseudos.visible(e)},M.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},M.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(e){}};var Ut={0:200,1223:204},Gt=M.ajaxSettings.xhr();y.cors=!!Gt&&"withCredentials"in Gt,y.ajax=Gt=!!Gt,M.ajaxTransport(function(e){var t,n;if(y.cors||Gt&&!e.crossDomain)return{send:function(i,o){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];for(a in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);t=function(e){return function(){t&&(t=n=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Ut[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),n=s.onerror=s.ontimeout=t("error"),void 0!==s.onabort?s.onabort=n:s.onreadystatechange=function(){4===s.readyState&&r.setTimeout(function(){t&&n()})},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}}),M.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),M.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return M.globalEval(e),e}}}),M.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),M.ajaxTransport("script",function(e){var t,r;if(e.crossDomain)return{send:function(n,i){t=M("