cube.gl 1.0.20 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +271 -271
- package/dist/basedecoder-B9XUu15s.js +65 -0
- package/dist/basedecoder-B9XUu15s.js.map +1 -0
- package/dist/cubegl.es.js +5 -0
- package/dist/cubegl.es.js.map +1 -0
- package/dist/cubegl.umd.js +4364 -0
- package/dist/cubegl.umd.js.map +1 -0
- package/dist/deflate-Iq6HsZmB.js +11 -0
- package/dist/deflate-Iq6HsZmB.js.map +1 -0
- package/dist/index-C2vPgZcF.js +32287 -0
- package/dist/index-C2vPgZcF.js.map +1 -0
- package/dist/jpeg-BX1FCF4W.js +518 -0
- package/dist/jpeg-BX1FCF4W.js.map +1 -0
- package/dist/lerc-CVqXqWev.js +1032 -0
- package/dist/lerc-CVqXqWev.js.map +1 -0
- package/dist/lzw-BLf4Plu7.js +85 -0
- package/dist/lzw-BLf4Plu7.js.map +1 -0
- package/dist/main-QapQAaGD.js +32 -0
- package/dist/main-QapQAaGD.js.map +1 -0
- package/dist/packbits-B542zsgY.js +25 -0
- package/dist/packbits-B542zsgY.js.map +1 -0
- package/dist/pako.esm-Bx5X36Wo.js +1075 -0
- package/dist/pako.esm-Bx5X36Wo.js.map +1 -0
- package/dist/raw-CzvpuhTi.js +10 -0
- package/dist/raw-CzvpuhTi.js.map +1 -0
- package/dist/webimage-DzzHs4ar.js +30 -0
- package/dist/webimage-DzzHs4ar.js.map +1 -0
- package/dist/zstd-Cdo1cxR9.js +63 -0
- package/dist/zstd-Cdo1cxR9.js.map +1 -0
- package/package.json +71 -66
- package/dist/cubegl.js +0 -215
- package/dist/cubegl.js.map +0 -1
package/dist/cubegl.js
DELETED
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"dKqR":[function(require,module,exports) {
|
|
2
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AmbientLight=gf,exports.AmbientLightProbe=zf,exports.AnimationClip=fd,exports.AnimationLoader=Md,exports.AnimationMixer=ym,exports.AnimationObjectGroup=gm,exports.ArcCurve=Pd,exports.ArrayCamera=ph,exports.ArrowHelper=ag,exports.Audio=Jf,exports.AudioAnalyser=nm,exports.AudioListener=Zf,exports.AudioLoader=Uf,exports.AxesHelper=cg,exports.AxisHelper=cv,exports.BinaryTextureLoader=dv,exports.Bone=Xh,exports.BooleanKeyframeTrack=ad,exports.BoundingBoxHelper=lv,exports.Box2=Am,exports.Box3=Ii,exports.Box3Helper=ng,exports.BoxHelper=eg,exports.BufferAttribute=_r,exports.BufferGeometry=Gr,exports.BufferGeometryLoader=Sf,exports.Camera=_o,exports.CameraHelper=Km,exports.CanvasRenderer=gv,exports.CanvasTexture=xu,exports.CatmullRomCurve3=Fd,exports.CircleBufferGeometry=kp,exports.CircleGeometry=Hp,exports.Clock=jf,exports.ClosedSplineCurve3=ov,exports.Color=hr,exports.ColorKeyframeTrack=cd,exports.CompressedTexture=yu,exports.CompressedTextureLoader=Sd,exports.ConeBufferGeometry=zp,exports.ConeGeometry=Gp,exports.CubeCamera=So,exports.CubeTexture=vc,exports.CubeTextureLoader=Ad,exports.CubicBezierCurve=Yd,exports.CubicBezierCurve3=Zd,exports.CubicInterpolant=id,exports.Curve=Rd,exports.CurvePath=nf,exports.CylinderBufferGeometry=Up,exports.CylinderGeometry=Fp,exports.Cylindrical=Tm,exports.DataTexture=Eo,exports.DataTexture2DArray=yc,exports.DataTexture3D=xc,exports.DataTextureLoader=Td,exports.DepthTexture=_u,exports.DirectionalLight=mf,exports.DirectionalLightHelper=Zm,exports.DirectionalLightShadow=ff,exports.DiscreteInterpolant=od,exports.DodecahedronBufferGeometry=Du,exports.DodecahedronGeometry=Ou,exports.DynamicBufferAttribute=Zg,exports.EdgesGeometry=Bp,exports.EdgesHelper=hv,exports.EllipseCurve=Cd,exports.Euler=ri,exports.EventDispatcher=Pn,exports.ExtrudeBufferGeometry=wp,exports.ExtrudeGeometry=bp,exports.Face3=fr,exports.Face4=Ig,exports.FileLoader=wd,exports.Float32Attribute=iv,exports.Float32BufferAttribute=Lr,exports.Float64Attribute=rv,exports.Float64BufferAttribute=Rr,exports.Fog=_h,exports.FogExp2=xh,exports.Font=Of,exports.FontLoader=Nf,exports.Frustum=Ro,exports.Geometry=ho,exports.GridHelper=jm,exports.Group=dh,exports.HemisphereLight=af,exports.HemisphereLightHelper=Vm,exports.HemisphereLightProbe=Gf,exports.IcosahedronBufferGeometry=Pu,exports.IcosahedronGeometry=Cu,exports.ImageBitmapLoader=Cf,exports.ImageLoader=Ed,exports.ImmediateRenderObject=Pm,exports.InstancedBufferAttribute=Mf,exports.InstancedBufferGeometry=wf,exports.InstancedInterleavedBuffer=_m,exports.InstancedMesh=Kh,exports.Int16Attribute=$g,exports.Int16BufferAttribute=Sr,exports.Int32Attribute=ev,exports.Int32BufferAttribute=Er,exports.Int8Attribute=Jg,exports.Int8BufferAttribute=br,exports.InterleavedBuffer=bh,exports.InterleavedBufferAttribute=Mh,exports.Interpolant=nd,exports.JSONLoader=vv,exports.KeyframeTrack=sd,exports.LOD=kh,exports.LatheBufferGeometry=Op,exports.LatheGeometry=Pp,exports.Layers=oi,exports.LensFlare=xv,exports.Light=sf,exports.LightProbe=xf,exports.LightShadow=cf,exports.Line=ou,exports.Line3=Cm,exports.LineBasicMaterial=$h,exports.LineCurve=Jd,exports.LineCurve3=Qd,exports.LineDashedMaterial=$p,exports.LineLoop=lu,exports.LineSegments=cu,exports.LinearInterpolant=rd,exports.Loader=_d,exports.LoadingManager=yd,exports.Material=gr,exports.MaterialLoader=_f,exports.Matrix3=Bn,exports.Matrix4=ei,exports.Mesh=io,exports.MeshBasicMaterial=vr,exports.MeshDepthMaterial=rh,exports.MeshDistanceMaterial=oh,exports.MeshFaceMaterial=zg,exports.MeshLambertMaterial=Qp,exports.MeshMatcapMaterial=Kp,exports.MeshNormalMaterial=Jp,exports.MeshPhongMaterial=Yp,exports.MeshPhysicalMaterial=Xp,exports.MeshStandardMaterial=qp,exports.MeshToonMaterial=Zp,exports.MultiMaterial=Hg,exports.NumberKeyframeTrack=ld,exports.Object3D=xi,exports.ObjectLoader=Ef,exports.OctahedronBufferGeometry=Ru,exports.OctahedronGeometry=Lu,exports.OrthographicCamera=df,exports.PMREMGenerator=Sg,exports.ParametricBufferGeometry=Mu,exports.ParametricGeometry=wu,exports.Particle=Vg,exports.ParticleBasicMaterial=qg,exports.ParticleSystem=jg,exports.ParticleSystemMaterial=Xg,exports.Path=rf,exports.PerspectiveCamera=bo,exports.Plane=Zi,exports.PlaneBufferGeometry=Io,exports.PlaneGeometry=Do,exports.PlaneHelper=ig,exports.PointCloud=kg,exports.PointCloudMaterial=Wg,exports.PointLight=pf,exports.PointLightHelper=Gm,exports.Points=mu,exports.PointsMaterial=hu,exports.PolarGridHelper=Wm,exports.PolyhedronBufferGeometry=Tu,exports.PolyhedronGeometry=Su,exports.PositionalAudio=em,exports.PropertyBinding=mm,exports.PropertyMixer=im,exports.QuadraticBezierCurve=Kd,exports.QuadraticBezierCurve3=$d,exports.Quaternion=jn,exports.QuaternionKeyframeTrack=ud,exports.QuaternionLinearInterpolant=hd,exports.RawShaderMaterial=Wp,exports.Ray=Wi,exports.Raycaster=bm,exports.RectAreaLight=vf,exports.RingBufferGeometry=Cp,exports.RingGeometry=Rp,exports.Scene=_i,exports.ShaderMaterial=xo,exports.ShadowMaterial=jp,exports.Shape=of,exports.ShapeBufferGeometry=Ip,exports.ShapeGeometry=Dp,exports.ShapePath=Pf,exports.Skeleton=qh,exports.SkeletonHelper=Um,exports.SkinnedMesh=Vh,exports.Sphere=Fi,exports.SphereBufferGeometry=Lp,exports.SphereGeometry=Ap,exports.SphericalHarmonics3=yf,exports.Spline=av,exports.SplineCurve=tf,exports.SplineCurve3=sv,exports.SpotLight=hf,exports.SpotLightHelper=Dm,exports.SpotLightShadow=lf,exports.Sprite=Uh,exports.SpriteMaterial=Sh,exports.StereoCamera=Vf,exports.StringKeyframeTrack=pd,exports.TetrahedronBufferGeometry=Au,exports.TetrahedronGeometry=Eu,exports.TextBufferGeometry=Ep,exports.TextGeometry=Tp,exports.Texture=zn,exports.TextureLoader=Ld,exports.TorusBufferGeometry=Gu,exports.TorusGeometry=Uu,exports.TorusKnotBufferGeometry=Fu,exports.TorusKnotGeometry=Bu,exports.Triangle=sr,exports.TubeBufferGeometry=Nu,exports.TubeGeometry=Iu,exports.Uint16Attribute=tv,exports.Uint16BufferAttribute=Tr,exports.Uint32Attribute=nv,exports.Uint32BufferAttribute=Ar,exports.Uint8Attribute=Qg,exports.Uint8BufferAttribute=wr,exports.Uint8ClampedAttribute=Kg,exports.Uint8ClampedBufferAttribute=Mr,exports.Uniform=xm,exports.Vector2=Nn,exports.Vector3=Xn,exports.Vector4=Hn,exports.VectorKeyframeTrack=dd,exports.Vertex=Yg,exports.VideoTexture=vu,exports.WebGL1Renderer=yh,exports.WebGLCubeRenderTarget=To,exports.WebGLMultisampleRenderTarget=Vn,exports.WebGLRenderTarget=kn,exports.WebGLRenderTargetCube=fv,exports.WebGLRenderer=vh,exports.WebGLUtils=uh,exports.WireframeGeometry=bu,exports.WireframeHelper=uv,exports.XHRLoader=pv,exports.NeverDepth=exports.NearestMipmapNearestFilter=exports.NearestMipmapLinearFilter=exports.NearestMipMapNearestFilter=exports.NearestMipMapLinearFilter=exports.NearestFilter=exports.MultiplyOperation=exports.MultiplyBlending=exports.MixOperation=exports.MirroredRepeatWrapping=exports.MinEquation=exports.MaxEquation=exports.MathUtils=exports.Math=exports.MOUSE=exports.LuminanceFormat=exports.LuminanceAlphaFormat=exports.LoopRepeat=exports.LoopPingPong=exports.LoopOnce=exports.LogLuvEncoding=exports.LoaderUtils=exports.LinearToneMapping=exports.LinearMipmapNearestFilter=exports.LinearMipmapLinearFilter=exports.LinearMipMapNearestFilter=exports.LinearMipMapLinearFilter=exports.LinearFilter=exports.LinearEncoding=exports.LineStrip=exports.LinePieces=exports.LessStencilFunc=exports.LessEqualStencilFunc=exports.LessEqualDepth=exports.LessDepth=exports.KeepStencilOp=exports.InvertStencilOp=exports.InterpolateSmooth=exports.InterpolateLinear=exports.InterpolateDiscrete=exports.IntType=exports.IncrementWrapStencilOp=exports.IncrementStencilOp=exports.ImageUtils=exports.HalfFloatType=exports.GreaterStencilFunc=exports.GreaterEqualStencilFunc=exports.GreaterEqualDepth=exports.GreaterDepth=exports.GeometryUtils=exports.GammaEncoding=exports.FrontSide=exports.FloatType=exports.FlatShading=exports.FaceColors=exports.EquirectangularRefractionMapping=exports.EquirectangularReflectionMapping=exports.EqualStencilFunc=exports.EqualDepth=exports.DynamicReadUsage=exports.DynamicDrawUsage=exports.DynamicCopyUsage=exports.DstColorFactor=exports.DstAlphaFactor=exports.DoubleSide=exports.DepthStencilFormat=exports.DepthFormat=exports.DefaultLoadingManager=exports.DecrementWrapStencilOp=exports.DecrementStencilOp=exports.CustomToneMapping=exports.CustomBlending=exports.CullFaceNone=exports.CullFaceFrontBack=exports.CullFaceFront=exports.CullFaceBack=exports.CubeUVRefractionMapping=exports.CubeUVReflectionMapping=exports.CubeRefractionMapping=exports.CubeReflectionMapping=exports.ClampToEdgeWrapping=exports.CineonToneMapping=exports.Cache=exports.ByteType=exports.CubeGeometry=exports.BoxGeometry=exports.BoxBufferGeometry=exports.BasicShadowMap=exports.BasicDepthPacking=exports.BackSide=exports.AudioContext=exports.AnimationUtils=exports.AlwaysStencilFunc=exports.AlwaysDepth=exports.AlphaFormat=exports.AdditiveBlending=exports.AdditiveAnimationBlendMode=exports.AddOperation=exports.AddEquation=exports.ACESFilmicToneMapping=void 0,exports.UniformsLib=exports.UVMapping=exports.TrianglesDrawMode=exports.TriangleStripDrawMode=exports.TriangleFanDrawMode=exports.TangentSpaceNormalMap=exports.TOUCH=exports.SubtractiveBlending=exports.SubtractEquation=exports.StreamReadUsage=exports.StreamDrawUsage=exports.StreamCopyUsage=exports.StaticReadUsage=exports.StaticDrawUsage=exports.StaticCopyUsage=exports.SrcColorFactor=exports.SrcAlphaSaturateFactor=exports.SrcAlphaFactor=exports.Spherical=exports.SmoothShading=exports.ShortType=exports.ShapeUtils=exports.ShaderLib=exports.ShaderChunk=exports.SceneUtils=exports.SRGB8_ALPHA8_ASTC_8x8_Format=exports.SRGB8_ALPHA8_ASTC_8x6_Format=exports.SRGB8_ALPHA8_ASTC_8x5_Format=exports.SRGB8_ALPHA8_ASTC_6x6_Format=exports.SRGB8_ALPHA8_ASTC_6x5_Format=exports.SRGB8_ALPHA8_ASTC_5x5_Format=exports.SRGB8_ALPHA8_ASTC_5x4_Format=exports.SRGB8_ALPHA8_ASTC_4x4_Format=exports.SRGB8_ALPHA8_ASTC_12x12_Format=exports.SRGB8_ALPHA8_ASTC_12x10_Format=exports.SRGB8_ALPHA8_ASTC_10x8_Format=exports.SRGB8_ALPHA8_ASTC_10x6_Format=exports.SRGB8_ALPHA8_ASTC_10x5_Format=exports.SRGB8_ALPHA8_ASTC_10x10_Format=exports.ReverseSubtractEquation=exports.ReplaceStencilOp=exports.RepeatWrapping=exports.ReinhardToneMapping=exports.RedIntegerFormat=exports.RedFormat=exports.RGIntegerFormat=exports.RGFormat=exports.RGB_S3TC_DXT1_Format=exports.RGB_PVRTC_4BPPV1_Format=exports.RGB_PVRTC_2BPPV1_Format=exports.RGB_ETC2_Format=exports.RGB_ETC1_Format=exports.RGBM7Encoding=exports.RGBM16Encoding=exports.RGBIntegerFormat=exports.RGBFormat=exports.RGBEFormat=exports.RGBEEncoding=exports.RGBDEncoding=exports.RGBA_S3TC_DXT5_Format=exports.RGBA_S3TC_DXT3_Format=exports.RGBA_S3TC_DXT1_Format=exports.RGBA_PVRTC_4BPPV1_Format=exports.RGBA_PVRTC_2BPPV1_Format=exports.RGBA_ETC2_EAC_Format=exports.RGBA_BPTC_Format=exports.RGBA_ASTC_8x8_Format=exports.RGBA_ASTC_8x6_Format=exports.RGBA_ASTC_8x5_Format=exports.RGBA_ASTC_6x6_Format=exports.RGBA_ASTC_6x5_Format=exports.RGBA_ASTC_5x5_Format=exports.RGBA_ASTC_5x4_Format=exports.RGBA_ASTC_4x4_Format=exports.RGBA_ASTC_12x12_Format=exports.RGBA_ASTC_12x10_Format=exports.RGBA_ASTC_10x8_Format=exports.RGBA_ASTC_10x6_Format=exports.RGBA_ASTC_10x5_Format=exports.RGBA_ASTC_10x10_Format=exports.RGBAIntegerFormat=exports.RGBAFormat=exports.RGBADepthPacking=exports.REVISION=exports.PCFSoftShadowMap=exports.PCFShadowMap=exports.OneMinusSrcColorFactor=exports.OneMinusSrcAlphaFactor=exports.OneMinusDstColorFactor=exports.OneMinusDstAlphaFactor=exports.OneFactor=exports.ObjectSpaceNormalMap=exports.NotEqualStencilFunc=exports.NotEqualDepth=exports.NormalBlending=exports.NormalAnimationBlendMode=exports.NoToneMapping=exports.NoColors=exports.NoBlending=exports.NeverStencilFunc=void 0,exports.sRGBEncoding=exports.ZeroStencilOp=exports.ZeroSlopeEnding=exports.ZeroFactor=exports.ZeroCurvatureEnding=exports.WrapAroundEnding=exports.VertexColors=exports.VSMShadowMap=exports.UnsignedShortType=exports.UnsignedShort565Type=exports.UnsignedShort5551Type=exports.UnsignedShort4444Type=exports.UnsignedIntType=exports.UnsignedInt248Type=exports.UnsignedByteType=exports.UniformsUtils=void 0,void 0===Number.EPSILON&&(Number.EPSILON=Math.pow(2,-52)),void 0===Number.isInteger&&(Number.isInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t}),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:t>0?1:+t}),"name"in Function.prototype==!1&&Object.defineProperty(Function.prototype,"name",{get:function(){return this.toString().match(/^\s*function\s*([^\(\s]*)/)[1]}}),void 0===Object.assign&&(Object.assign=function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");const e=Object(t);for(let n=1;n<arguments.length;n++){const t=arguments[n];if(null!=t)for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e});const t="119";exports.REVISION="119";const e={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2};exports.MOUSE=e;const n={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3};exports.TOUCH=n;const i=0;exports.CullFaceNone=i;const r=1;exports.CullFaceBack=r;const o=2;exports.CullFaceFront=o;const s=3;exports.CullFaceFrontBack=3;const a=0;exports.BasicShadowMap=0;const c=1;exports.PCFShadowMap=c;const l=2;exports.PCFSoftShadowMap=l;const h=3;exports.VSMShadowMap=h;const u=0;exports.FrontSide=u;const p=1;exports.BackSide=p;const d=2;exports.DoubleSide=d;const f=1;exports.FlatShading=1;const m=2;exports.SmoothShading=2;const g=0;exports.NoBlending=g;const v=1;exports.NormalBlending=v;const y=2;exports.AdditiveBlending=y;const x=3;exports.SubtractiveBlending=x;const _=4;exports.MultiplyBlending=_;const b=5;exports.CustomBlending=b;const w=100;exports.AddEquation=w;const M=101;exports.SubtractEquation=M;const S=102;exports.ReverseSubtractEquation=S;const T=103;exports.MinEquation=T;const E=104;exports.MaxEquation=E;const A=200;exports.ZeroFactor=A;const L=201;exports.OneFactor=L;const R=202;exports.SrcColorFactor=R;const C=203;exports.OneMinusSrcColorFactor=C;const P=204;exports.SrcAlphaFactor=P;const O=205;exports.OneMinusSrcAlphaFactor=O;const D=206;exports.DstAlphaFactor=D;const I=207;exports.OneMinusDstAlphaFactor=I;const N=208;exports.DstColorFactor=N;const B=209;exports.OneMinusDstColorFactor=B;const F=210;exports.SrcAlphaSaturateFactor=F;const U=0;exports.NeverDepth=U;const G=1;exports.AlwaysDepth=G;const z=2;exports.LessDepth=z;const H=3;exports.LessEqualDepth=H;const k=4;exports.EqualDepth=k;const V=5;exports.GreaterEqualDepth=V;const j=6;exports.GreaterDepth=j;const W=7;exports.NotEqualDepth=W;const q=0;exports.MultiplyOperation=q;const X=1;exports.MixOperation=X;const Y=2;exports.AddOperation=Y;const Z=0;exports.NoToneMapping=Z;const J=1;exports.LinearToneMapping=J;const Q=2;exports.ReinhardToneMapping=Q;const K=3;exports.CineonToneMapping=K;const $=4;exports.ACESFilmicToneMapping=$;const tt=5;exports.CustomToneMapping=tt;const et=300;exports.UVMapping=300;const nt=301;exports.CubeReflectionMapping=nt;const it=302;exports.CubeRefractionMapping=it;const rt=303;exports.EquirectangularReflectionMapping=rt;const ot=304;exports.EquirectangularRefractionMapping=ot;const st=306;exports.CubeUVReflectionMapping=st;const at=307;exports.CubeUVRefractionMapping=at;const ct=1e3;exports.RepeatWrapping=ct;const lt=1001;exports.ClampToEdgeWrapping=lt;const ht=1002;exports.MirroredRepeatWrapping=ht;const ut=1003;exports.NearestFilter=ut;const pt=1004;exports.NearestMipmapNearestFilter=pt;const dt=1004;exports.NearestMipMapNearestFilter=1004;const ft=1005;exports.NearestMipmapLinearFilter=ft;const mt=1005;exports.NearestMipMapLinearFilter=1005;const gt=1006;exports.LinearFilter=gt;const vt=1007;exports.LinearMipmapNearestFilter=vt;const yt=1007;exports.LinearMipMapNearestFilter=1007;const xt=1008;exports.LinearMipmapLinearFilter=xt;const _t=1008;exports.LinearMipMapLinearFilter=1008;const bt=1009;exports.UnsignedByteType=bt;const wt=1010;exports.ByteType=wt;const Mt=1011;exports.ShortType=Mt;const St=1012;exports.UnsignedShortType=St;const Tt=1013;exports.IntType=Tt;const Et=1014;exports.UnsignedIntType=Et;const At=1015;exports.FloatType=At;const Lt=1016;exports.HalfFloatType=Lt;const Rt=1017;exports.UnsignedShort4444Type=Rt;const Ct=1018;exports.UnsignedShort5551Type=Ct;const Pt=1019;exports.UnsignedShort565Type=Pt;const Ot=1020;exports.UnsignedInt248Type=Ot;const Dt=1021;exports.AlphaFormat=Dt;const It=1022;exports.RGBFormat=It;const Nt=1023;exports.RGBAFormat=Nt;const Bt=1024;exports.LuminanceFormat=Bt;const Ft=1025;exports.LuminanceAlphaFormat=Ft;const Ut=Nt;exports.RGBEFormat=Ut;const Gt=1026;exports.DepthFormat=Gt;const zt=1027;exports.DepthStencilFormat=zt;const Ht=1028;exports.RedFormat=Ht;const kt=1029;exports.RedIntegerFormat=kt;const Vt=1030;exports.RGFormat=Vt;const jt=1031;exports.RGIntegerFormat=jt;const Wt=1032;exports.RGBIntegerFormat=Wt;const qt=1033;exports.RGBAIntegerFormat=qt;const Xt=33776;exports.RGB_S3TC_DXT1_Format=Xt;const Yt=33777;exports.RGBA_S3TC_DXT1_Format=Yt;const Zt=33778;exports.RGBA_S3TC_DXT3_Format=Zt;const Jt=33779;exports.RGBA_S3TC_DXT5_Format=Jt;const Qt=35840;exports.RGB_PVRTC_4BPPV1_Format=Qt;const Kt=35841;exports.RGB_PVRTC_2BPPV1_Format=Kt;const $t=35842;exports.RGBA_PVRTC_4BPPV1_Format=$t;const te=35843;exports.RGBA_PVRTC_2BPPV1_Format=te;const ee=36196;exports.RGB_ETC1_Format=ee;const ne=37492;exports.RGB_ETC2_Format=ne;const ie=37496;exports.RGBA_ETC2_EAC_Format=ie;const re=37808;exports.RGBA_ASTC_4x4_Format=re;const oe=37809;exports.RGBA_ASTC_5x4_Format=oe;const se=37810;exports.RGBA_ASTC_5x5_Format=se;const ae=37811;exports.RGBA_ASTC_6x5_Format=ae;const ce=37812;exports.RGBA_ASTC_6x6_Format=ce;const le=37813;exports.RGBA_ASTC_8x5_Format=le;const he=37814;exports.RGBA_ASTC_8x6_Format=he;const ue=37815;exports.RGBA_ASTC_8x8_Format=ue;const pe=37816;exports.RGBA_ASTC_10x5_Format=pe;const de=37817;exports.RGBA_ASTC_10x6_Format=de;const fe=37818;exports.RGBA_ASTC_10x8_Format=fe;const me=37819;exports.RGBA_ASTC_10x10_Format=me;const ge=37820;exports.RGBA_ASTC_12x10_Format=ge;const ve=37821;exports.RGBA_ASTC_12x12_Format=ve;const ye=36492;exports.RGBA_BPTC_Format=ye;const xe=37840;exports.SRGB8_ALPHA8_ASTC_4x4_Format=xe;const _e=37841;exports.SRGB8_ALPHA8_ASTC_5x4_Format=_e;const be=37842;exports.SRGB8_ALPHA8_ASTC_5x5_Format=be;const we=37843;exports.SRGB8_ALPHA8_ASTC_6x5_Format=we;const Me=37844;exports.SRGB8_ALPHA8_ASTC_6x6_Format=Me;const Se=37845;exports.SRGB8_ALPHA8_ASTC_8x5_Format=Se;const Te=37846;exports.SRGB8_ALPHA8_ASTC_8x6_Format=Te;const Ee=37847;exports.SRGB8_ALPHA8_ASTC_8x8_Format=Ee;const Ae=37848;exports.SRGB8_ALPHA8_ASTC_10x5_Format=Ae;const Le=37849;exports.SRGB8_ALPHA8_ASTC_10x6_Format=Le;const Re=37850;exports.SRGB8_ALPHA8_ASTC_10x8_Format=Re;const Ce=37851;exports.SRGB8_ALPHA8_ASTC_10x10_Format=Ce;const Pe=37852;exports.SRGB8_ALPHA8_ASTC_12x10_Format=Pe;const Oe=37853;exports.SRGB8_ALPHA8_ASTC_12x12_Format=Oe;const De=2200;exports.LoopOnce=2200;const Ie=2201;exports.LoopRepeat=Ie;const Ne=2202;exports.LoopPingPong=2202;const Be=2300;exports.InterpolateDiscrete=2300;const Fe=2301;exports.InterpolateLinear=2301;const Ue=2302;exports.InterpolateSmooth=2302;const Ge=2400;exports.ZeroCurvatureEnding=Ge;const ze=2401;exports.ZeroSlopeEnding=2401;const He=2402;exports.WrapAroundEnding=2402;const ke=2500;exports.NormalAnimationBlendMode=ke;const Ve=2501;exports.AdditiveAnimationBlendMode=2501;const je=0;exports.TrianglesDrawMode=0;const We=1;exports.TriangleStripDrawMode=1;const qe=2;exports.TriangleFanDrawMode=2;const Xe=3e3;exports.LinearEncoding=Xe;const Ye=3001;exports.sRGBEncoding=Ye;const Ze=3007;exports.GammaEncoding=Ze;const Je=3002;exports.RGBEEncoding=Je;const Qe=3003;exports.LogLuvEncoding=Qe;const Ke=3004;exports.RGBM7Encoding=Ke;const $e=3005;exports.RGBM16Encoding=$e;const tn=3006;exports.RGBDEncoding=tn;const en=3200;exports.BasicDepthPacking=en;const nn=3201;exports.RGBADepthPacking=nn;const rn=0;exports.TangentSpaceNormalMap=rn;const on=1;exports.ObjectSpaceNormalMap=on;const sn=0;exports.ZeroStencilOp=0;const an=7680;exports.KeepStencilOp=an;const cn=7681;exports.ReplaceStencilOp=7681;const ln=7682;exports.IncrementStencilOp=7682;const hn=7683;exports.DecrementStencilOp=7683;const un=34055;exports.IncrementWrapStencilOp=34055;const pn=34056;exports.DecrementWrapStencilOp=34056;const dn=5386;exports.InvertStencilOp=5386;const fn=512;exports.NeverStencilFunc=512;const mn=513;exports.LessStencilFunc=513;const gn=514;exports.EqualStencilFunc=514;const vn=515;exports.LessEqualStencilFunc=515;const yn=516;exports.GreaterStencilFunc=516;const xn=517;exports.NotEqualStencilFunc=517;const _n=518;exports.GreaterEqualStencilFunc=518;const bn=519;exports.AlwaysStencilFunc=bn;const wn=35044;exports.StaticDrawUsage=wn;const Mn=35048;exports.DynamicDrawUsage=Mn;const Sn=35040;exports.StreamDrawUsage=35040;const Tn=35045;exports.StaticReadUsage=35045;const En=35049;exports.DynamicReadUsage=35049;const An=35041;exports.StreamReadUsage=35041;const Ln=35046;exports.StaticCopyUsage=35046;const Rn=35050;exports.DynamicCopyUsage=35050;const Cn=35042;function Pn(){}exports.StreamCopyUsage=35042,Object.assign(Pn.prototype,{addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});const n=this._listeners;void 0===n[t]&&(n[t]=[]),-1===n[t].indexOf(e)&&n[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;const n=this._listeners;return void 0!==n[t]&&-1!==n[t].indexOf(e)},removeEventListener:function(t,e){if(void 0===this._listeners)return;const n=this._listeners[t];if(void 0!==n){const t=n.indexOf(e);-1!==t&&n.splice(t,1)}},dispatchEvent:function(t){if(void 0===this._listeners)return;const e=this._listeners[t.type];if(void 0!==e){t.target=this;const n=e.slice(0);for(let e=0,i=n.length;e<i;e++)n[e].call(this,t)}}});const On=[];for(let _v=0;_v<256;_v++)On[_v]=(_v<16?"0":"")+_v.toString(16);let Dn=1234567;const In={DEG2RAD:Math.PI/180,RAD2DEG:180/Math.PI,generateUUID:function(){const t=4294967295*Math.random()|0,e=4294967295*Math.random()|0,n=4294967295*Math.random()|0,i=4294967295*Math.random()|0;return(On[255&t]+On[t>>8&255]+On[t>>16&255]+On[t>>24&255]+"-"+On[255&e]+On[e>>8&255]+"-"+On[e>>16&15|64]+On[e>>24&255]+"-"+On[63&n|128]+On[n>>8&255]+"-"+On[n>>16&255]+On[n>>24&255]+On[255&i]+On[i>>8&255]+On[i>>16&255]+On[i>>24&255]).toUpperCase()},clamp:function(t,e,n){return Math.max(e,Math.min(n,t))},euclideanModulo:function(t,e){return(t%e+e)%e},mapLinear:function(t,e,n,i,r){return i+(t-e)*(r-i)/(n-e)},lerp:function(t,e,n){return(1-n)*t+n*e},smoothstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*(3-2*t)},smootherstep:function(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e))*t*t*(t*(6*t-15)+10)},randInt:function(t,e){return t+Math.floor(Math.random()*(e-t+1))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},seededRandom:function(t){return void 0!==t&&(Dn=t%2147483647),((Dn=16807*Dn%2147483647)-1)/2147483646},degToRad:function(t){return t*In.DEG2RAD},radToDeg:function(t){return t*In.RAD2DEG},isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},ceilPowerOfTwo:function(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},floorPowerOfTwo:function(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))},setQuaternionFromProperEuler:function(t,e,n,i,r){const o=Math.cos,s=Math.sin,a=o(n/2),c=s(n/2),l=o((e+i)/2),h=s((e+i)/2),u=o((e-i)/2),p=s((e-i)/2),d=o((i-e)/2),f=s((i-e)/2);switch(r){case"XYX":t.set(a*h,c*u,c*p,a*l);break;case"YZY":t.set(c*p,a*h,c*u,a*l);break;case"ZXZ":t.set(c*u,c*p,a*h,a*l);break;case"XZX":t.set(a*h,c*f,c*d,a*l);break;case"YXY":t.set(c*d,a*h,c*f,a*l);break;case"ZYZ":t.set(c*f,c*d,a*h,a*l);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+r)}}};function Nn(t=0,e=0){this.x=t,this.y=e}function Bn(){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.")}let Fn;exports.MathUtils=exports.Math=In,Object.defineProperties(Nn.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),Object.assign(Nn.prototype,{isVector2:!0,set:function(t,e){return this.x=t,this.y=e,this},setScalar:function(t){return this.x=t,this.y=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y)},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return this.multiplyScalar(1/t)},applyMatrix3:function(t){const e=this.x,n=this.y,i=t.elements;return this.x=i[0]*e+i[3]*n+i[6],this.y=i[1]*e+i[4]*n+i[7],this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this},clampLength:function(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},cross:function(t){return this.x*t.y-this.y*t.x},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)},normalize:function(){return this.divideScalar(this.length()||1)},angle:function(){return Math.atan2(-this.y,-this.x)+Math.PI},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){const e=this.x-t.x,n=this.y-t.y;return e*e+n*n},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector2: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this},rotateAround:function(t,e){const n=Math.cos(e),i=Math.sin(e),r=this.x-t.x,o=this.y-t.y;return this.x=r*n-o*i+t.x,this.y=r*i+o*n+t.y,this},random:function(){return this.x=Math.random(),this.y=Math.random(),this}}),Object.assign(Bn.prototype,{isMatrix3:!0,set:function(t,e,n,i,r,o,s,a,c){const l=this.elements;return l[0]=t,l[1]=i,l[2]=s,l[3]=e,l[4]=r,l[5]=a,l[6]=n,l[7]=o,l[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(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],this},extractBasis:function(t,e,n){return t.setFromMatrix3Column(this,0),e.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this},setFromMatrix4:function(t){const e=t.elements;return this.set(e[0],e[4],e[8],e[1],e[5],e[9],e[2],e[6],e[10]),this},multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){const n=t.elements,i=e.elements,r=this.elements,o=n[0],s=n[3],a=n[6],c=n[1],l=n[4],h=n[7],u=n[2],p=n[5],d=n[8],f=i[0],m=i[3],g=i[6],v=i[1],y=i[4],x=i[7],_=i[2],b=i[5],w=i[8];return r[0]=o*f+s*v+a*_,r[3]=o*m+s*y+a*b,r[6]=o*g+s*x+a*w,r[1]=c*f+l*v+h*_,r[4]=c*m+l*y+h*b,r[7]=c*g+l*x+h*w,r[2]=u*f+p*v+d*_,r[5]=u*m+p*y+d*b,r[8]=u*g+p*x+d*w,this},multiplyScalar:function(t){const e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){const t=this.elements,e=t[0],n=t[1],i=t[2],r=t[3],o=t[4],s=t[5],a=t[6],c=t[7],l=t[8];return e*o*l-e*s*c-n*r*l+n*s*a+i*r*c-i*o*a},getInverse:function(t,e){void 0!==e&&console.warn("THREE.Matrix3: .getInverse() can no longer be configured to throw on degenerate.");const n=t.elements,i=this.elements,r=n[0],o=n[1],s=n[2],a=n[3],c=n[4],l=n[5],h=n[6],u=n[7],p=n[8],d=p*c-l*u,f=l*h-p*a,m=u*a-c*h,g=r*d+o*f+s*m;if(0===g)return this.set(0,0,0,0,0,0,0,0,0);const v=1/g;return i[0]=d*v,i[1]=(s*u-p*o)*v,i[2]=(l*o-s*c)*v,i[3]=f*v,i[4]=(p*r-s*h)*v,i[5]=(s*a-l*r)*v,i[6]=m*v,i[7]=(o*h-u*r)*v,i[8]=(c*r-o*a)*v,this},transpose:function(){let t;const e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){const e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,n,i,r,o,s){const a=Math.cos(r),c=Math.sin(r);this.set(n*a,n*c,-n*(a*o+c*s)+o+t,-i*c,i*a,-i*(-c*o+a*s)+s+e,0,0,1)},scale:function(t,e){const n=this.elements;return n[0]*=t,n[3]*=t,n[6]*=t,n[1]*=e,n[4]*=e,n[7]*=e,this},rotate:function(t){const e=Math.cos(t),n=Math.sin(t),i=this.elements,r=i[0],o=i[3],s=i[6],a=i[1],c=i[4],l=i[7];return i[0]=e*r+n*a,i[3]=e*o+n*c,i[6]=e*s+n*l,i[1]=-n*r+e*a,i[4]=-n*o+e*c,i[7]=-n*s+e*l,this},translate:function(t,e){const n=this.elements;return n[0]+=t*n[2],n[3]+=t*n[5],n[6]+=t*n[8],n[1]+=e*n[2],n[4]+=e*n[5],n[7]+=e*n[8],this},equals:function(t){const e=this.elements,n=t.elements;for(let i=0;i<9;i++)if(e[i]!==n[i])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(let n=0;n<9;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t}});const Un={getDataURL:function(t){if(/^data:/i.test(t.src))return t.src;if("undefined"==typeof HTMLCanvasElement)return t.src;let e;if(t instanceof HTMLCanvasElement)e=t;else{void 0===Fn&&(Fn=document.createElementNS("http://www.w3.org/1999/xhtml","canvas")),Fn.width=t.width,Fn.height=t.height;const n=Fn.getContext("2d");t instanceof ImageData?n.putImageData(t,0,0):n.drawImage(t,0,0,t.width,t.height),e=Fn}return e.width>2048||e.height>2048?e.toDataURL("image/jpeg",.6):e.toDataURL("image/png")}};exports.ImageUtils=Un;let Gn=0;function zn(t,e,n,i,r,o,s,a,c,l){Object.defineProperty(this,"id",{value:Gn++}),this.uuid=In.generateUUID(),this.name="",this.image=void 0!==t?t:zn.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:zn.DEFAULT_MAPPING,this.wrapS=void 0!==n?n:lt,this.wrapT=void 0!==i?i:lt,this.magFilter=void 0!==r?r:gt,this.minFilter=void 0!==o?o:xt,this.anisotropy=void 0!==c?c:1,this.format=void 0!==s?s:Nt,this.internalFormat=null,this.type=void 0!==a?a:bt,this.offset=new Nn(0,0),this.repeat=new Nn(1,1),this.center=new Nn(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Bn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.encoding=void 0!==l?l:Xe,this.version=0,this.onUpdate=null}function Hn(t=0,e=0,n=0,i=1){this.x=t,this.y=e,this.z=n,this.w=i}function kn(t,e,n){this.width=t,this.height=e,this.scissor=new Hn(0,0,t,e),this.scissorTest=!1,this.viewport=new Hn(0,0,t,e),n=n||{},this.texture=new zn(void 0,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.encoding),this.texture.image={},this.texture.image.width=t,this.texture.image.height=e,this.texture.generateMipmaps=void 0!==n.generateMipmaps&&n.generateMipmaps,this.texture.minFilter=void 0!==n.minFilter?n.minFilter:gt,this.depthBuffer=void 0===n.depthBuffer||n.depthBuffer,this.stencilBuffer=void 0===n.stencilBuffer||n.stencilBuffer,this.depthTexture=void 0!==n.depthTexture?n.depthTexture:null}function Vn(t,e,n){kn.call(this,t,e,n),this.samples=4}function jn(t=0,e=0,n=0,i=1){this._x=t,this._y=e,this._z=n,this._w=i}zn.DEFAULT_IMAGE=void 0,zn.DEFAULT_MAPPING=300,zn.prototype=Object.assign(Object.create(Pn.prototype),{constructor:zn,isTexture:!0,updateMatrix:function(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.name=t.name,this.image=t.image,this.mipmaps=t.mipmaps.slice(0),this.mapping=t.mapping,this.wrapS=t.wrapS,this.wrapT=t.wrapT,this.magFilter=t.magFilter,this.minFilter=t.minFilter,this.anisotropy=t.anisotropy,this.format=t.format,this.internalFormat=t.internalFormat,this.type=t.type,this.offset.copy(t.offset),this.repeat.copy(t.repeat),this.center.copy(t.center),this.rotation=t.rotation,this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrix.copy(t.matrix),this.generateMipmaps=t.generateMipmaps,this.premultiplyAlpha=t.premultiplyAlpha,this.flipY=t.flipY,this.unpackAlignment=t.unpackAlignment,this.encoding=t.encoding,this},toJSON:function(t){const e=void 0===t||"string"==typeof t;if(!e&&void 0!==t.textures[this.uuid])return t.textures[this.uuid];const n={metadata:{version:4.5,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,mapping:this.mapping,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,type:this.type,encoding:this.encoding,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};if(void 0!==this.image){const i=this.image;if(void 0===i.uuid&&(i.uuid=In.generateUUID()),!e&&void 0===t.images[i.uuid]){let e;if(Array.isArray(i)){e=[];for(let t=0,n=i.length;t<n;t++)e.push(Un.getDataURL(i[t]))}else e=Un.getDataURL(i);t.images[i.uuid]={uuid:i.uuid,url:e}}n.image=i.uuid}return e||(t.textures[this.uuid]=n),n},dispose:function(){this.dispatchEvent({type:"dispose"})},transformUv:function(t){if(300!==this.mapping)return t;if(t.applyMatrix3(this.matrix),t.x<0||t.x>1)switch(this.wrapS){case ct:t.x=t.x-Math.floor(t.x);break;case lt:t.x=t.x<0?0:1;break;case ht:1===Math.abs(Math.floor(t.x)%2)?t.x=Math.ceil(t.x)-t.x:t.x=t.x-Math.floor(t.x)}if(t.y<0||t.y>1)switch(this.wrapT){case ct:t.y=t.y-Math.floor(t.y);break;case lt:t.y=t.y<0?0:1;break;case ht:1===Math.abs(Math.floor(t.y)%2)?t.y=Math.ceil(t.y)-t.y:t.y=t.y-Math.floor(t.y)}return this.flipY&&(t.y=1-t.y),t}}),Object.defineProperty(zn.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.defineProperties(Hn.prototype,{width:{get:function(){return this.z},set:function(t){this.z=t}},height:{get:function(){return this.w},set:function(t){this.w=t}}}),Object.assign(Hn.prototype,{isVector4:!0,set:function(t,e,n,i){return this.x=t,this.y=e,this.z=n,this.w=i,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){const e=this.x,n=this.y,i=this.z,r=this.w,o=t.elements;return this.x=o[0]*e+o[4]*n+o[8]*i+o[12]*r,this.y=o[1]*e+o[5]*n+o[9]*i+o[13]*r,this.z=o[2]*e+o[6]*n+o[10]*i+o[14]*r,this.w=o[3]*e+o[7]*n+o[11]*i+o[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);const e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){let e,n,i,r;const o=t.elements,s=o[0],a=o[4],c=o[8],l=o[1],h=o[5],u=o[9],p=o[2],d=o[6],f=o[10];if(Math.abs(a-l)<.01&&Math.abs(c-p)<.01&&Math.abs(u-d)<.01){if(Math.abs(a+l)<.1&&Math.abs(c+p)<.1&&Math.abs(u+d)<.1&&Math.abs(s+h+f-3)<.1)return this.set(1,0,0,0),this;e=Math.PI;const t=(s+1)/2,o=(h+1)/2,m=(f+1)/2,g=(a+l)/4,v=(c+p)/4,y=(u+d)/4;return t>o&&t>m?t<.01?(n=0,i=.707106781,r=.707106781):(i=g/(n=Math.sqrt(t)),r=v/n):o>m?o<.01?(n=.707106781,i=0,r=.707106781):(n=g/(i=Math.sqrt(o)),r=y/i):m<.01?(n=.707106781,i=.707106781,r=0):(n=v/(r=Math.sqrt(m)),i=y/r),this.set(n,i,r,e),this}let m=Math.sqrt((d-u)*(d-u)+(c-p)*(c-p)+(l-a)*(l-a));return Math.abs(m)<.001&&(m=1),this.x=(d-u)/m,this.y=(c-p)/m,this.z=(l-a)/m,this.w=Math.acos((s+h+f-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this.w=Math.max(t,Math.min(e,this.w)),this},clampLength:function(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this.w=t.w+(e.w-t.w)*n,this},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector4: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}}),kn.prototype=Object.assign(Object.create(Pn.prototype),{constructor:kn,isWebGLRenderTarget:!0,setSize:function(t,e){this.width===t&&this.height===e||(this.width=t,this.height=e,this.texture.image.width=t,this.texture.image.height=e,this.dispose()),this.viewport.set(0,0,t,e),this.scissor.set(0,0,t,e)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.width=t.width,this.height=t.height,this.viewport.copy(t.viewport),this.texture=t.texture.clone(),this.depthBuffer=t.depthBuffer,this.stencilBuffer=t.stencilBuffer,this.depthTexture=t.depthTexture,this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Vn.prototype=Object.assign(Object.create(kn.prototype),{constructor:Vn,isWebGLMultisampleRenderTarget:!0,copy:function(t){return kn.prototype.copy.call(this,t),this.samples=t.samples,this}}),Object.assign(jn,{slerp:function(t,e,n,i){return n.copy(t).slerp(e,i)},slerpFlat:function(t,e,n,i,r,o,s){let a=n[i+0],c=n[i+1],l=n[i+2],h=n[i+3];const u=r[o+0],p=r[o+1],d=r[o+2],f=r[o+3];if(h!==f||a!==u||c!==p||l!==d){let t=1-s,e=a*u+c*p+l*d+h*f,n=e>=0?1:-1,i=1-e*e;if(i>Number.EPSILON){const r=Math.sqrt(i),o=Math.atan2(r,e*n);t=Math.sin(t*o)/r,s=Math.sin(s*o)/r}const r=s*n;if(a=a*t+u*r,c=c*t+p*r,l=l*t+d*r,h=h*t+f*r,t===1-s){const t=1/Math.sqrt(a*a+c*c+l*l+h*h);a*=t,c*=t,l*=t,h*=t}}t[e]=a,t[e+1]=c,t[e+2]=l,t[e+3]=h},multiplyQuaternionsFlat:function(t,e,n,i,r,o){const s=n[i],a=n[i+1],c=n[i+2],l=n[i+3],h=r[o],u=r[o+1],p=r[o+2],d=r[o+3];return t[e]=s*d+l*h+a*p-c*u,t[e+1]=a*d+l*u+c*h-s*p,t[e+2]=c*d+l*p+s*u-a*h,t[e+3]=l*d-s*h-a*u-c*p,t}}),Object.defineProperties(jn.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},w:{get:function(){return this._w},set:function(t){this._w=t,this._onChangeCallback()}}}),Object.assign(jn.prototype,{isQuaternion:!0,set:function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._w=i,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this._onChangeCallback(),this},setFromEuler:function(t,e){if(!t||!t.isEuler)throw new Error("THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.");const n=t._x,i=t._y,r=t._z,o=t.order,s=Math.cos,a=Math.sin,c=s(n/2),l=s(i/2),h=s(r/2),u=a(n/2),p=a(i/2),d=a(r/2);switch(o){case"XYZ":this._x=u*l*h+c*p*d,this._y=c*p*h-u*l*d,this._z=c*l*d+u*p*h,this._w=c*l*h-u*p*d;break;case"YXZ":this._x=u*l*h+c*p*d,this._y=c*p*h-u*l*d,this._z=c*l*d-u*p*h,this._w=c*l*h+u*p*d;break;case"ZXY":this._x=u*l*h-c*p*d,this._y=c*p*h+u*l*d,this._z=c*l*d+u*p*h,this._w=c*l*h-u*p*d;break;case"ZYX":this._x=u*l*h-c*p*d,this._y=c*p*h+u*l*d,this._z=c*l*d-u*p*h,this._w=c*l*h+u*p*d;break;case"YZX":this._x=u*l*h+c*p*d,this._y=c*p*h+u*l*d,this._z=c*l*d-u*p*h,this._w=c*l*h-u*p*d;break;case"XZY":this._x=u*l*h-c*p*d,this._y=c*p*h-u*l*d,this._z=c*l*d+u*p*h,this._w=c*l*h+u*p*d;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return!1!==e&&this._onChangeCallback(),this},setFromAxisAngle:function(t,e){const n=e/2,i=Math.sin(n);return this._x=t.x*i,this._y=t.y*i,this._z=t.z*i,this._w=Math.cos(n),this._onChangeCallback(),this},setFromRotationMatrix:function(t){const e=t.elements,n=e[0],i=e[4],r=e[8],o=e[1],s=e[5],a=e[9],c=e[2],l=e[6],h=e[10],u=n+s+h;if(u>0){const t=.5/Math.sqrt(u+1);this._w=.25/t,this._x=(l-a)*t,this._y=(r-c)*t,this._z=(o-i)*t}else if(n>s&&n>h){const t=2*Math.sqrt(1+n-s-h);this._w=(l-a)/t,this._x=.25*t,this._y=(i+o)/t,this._z=(r+c)/t}else if(s>h){const t=2*Math.sqrt(1+s-n-h);this._w=(r-c)/t,this._x=(i+o)/t,this._y=.25*t,this._z=(a+l)/t}else{const t=2*Math.sqrt(1+h-n-s);this._w=(o-i)/t,this._x=(r+c)/t,this._y=(a+l)/t,this._z=.25*t}return this._onChangeCallback(),this},setFromUnitVectors:function(t,e){let n=t.dot(e)+1;return n<1e-6?(n=0,Math.abs(t.x)>Math.abs(t.z)?(this._x=-t.y,this._y=t.x,this._z=0,this._w=n):(this._x=0,this._y=-t.z,this._z=t.y,this._w=n)):(this._x=t.y*e.z-t.z*e.y,this._y=t.z*e.x-t.x*e.z,this._z=t.x*e.y-t.y*e.x,this._w=n),this.normalize()},angleTo:function(t){return 2*Math.acos(Math.abs(In.clamp(this.dot(t),-1,1)))},rotateTowards:function(t,e){const n=this.angleTo(t);if(0===n)return this;const i=Math.min(1,e/n);return this.slerp(t,i),this},identity:function(){return this.set(0,0,0,1)},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){let t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this._onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){const n=t._x,i=t._y,r=t._z,o=t._w,s=e._x,a=e._y,c=e._z,l=e._w;return this._x=n*l+o*s+i*c-r*a,this._y=i*l+o*a+r*s-n*c,this._z=r*l+o*c+n*a-i*s,this._w=o*l-n*s-i*a-r*c,this._onChangeCallback(),this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);const n=this._x,i=this._y,r=this._z,o=this._w;let s=o*t._w+n*t._x+i*t._y+r*t._z;if(s<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,s=-s):this.copy(t),s>=1)return this._w=o,this._x=n,this._y=i,this._z=r,this;const a=1-s*s;if(a<=Number.EPSILON){const t=1-e;return this._w=t*o+e*this._w,this._x=t*n+e*this._x,this._y=t*i+e*this._y,this._z=t*r+e*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(a),l=Math.atan2(c,s),h=Math.sin((1-e)*l)/c,u=Math.sin(e*l)/c;return this._w=o*h+this._w*u,this._x=n*h+this._x*u,this._y=i*h+this._y*u,this._z=r*h+this._z*u,this._onChangeCallback(),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},fromBufferAttribute:function(t,e){return this._x=t.getX(e),this._y=t.getY(e),this._z=t.getZ(e),this._w=t.getW(e),this},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}});const Wn=new Xn,qn=new jn;function Xn(t=0,e=0,n=0){this.x=t,this.y=e,this.z=n}Object.assign(Xn.prototype,{isVector3:!0,set:function(t,e,n){return void 0===n&&(n=this.z),this.x=t,this.y=e,this.z=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(t){return t&&t.isEuler||console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),this.applyQuaternion(qn.setFromEuler(t))},applyAxisAngle:function(t,e){return this.applyQuaternion(qn.setFromAxisAngle(t,e))},applyMatrix3:function(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[3]*n+r[6]*i,this.y=r[1]*e+r[4]*n+r[7]*i,this.z=r[2]*e+r[5]*n+r[8]*i,this},applyNormalMatrix:function(t){return this.applyMatrix3(t).normalize()},applyMatrix4:function(t){const e=this.x,n=this.y,i=this.z,r=t.elements,o=1/(r[3]*e+r[7]*n+r[11]*i+r[15]);return this.x=(r[0]*e+r[4]*n+r[8]*i+r[12])*o,this.y=(r[1]*e+r[5]*n+r[9]*i+r[13])*o,this.z=(r[2]*e+r[6]*n+r[10]*i+r[14])*o,this},applyQuaternion:function(t){const e=this.x,n=this.y,i=this.z,r=t.x,o=t.y,s=t.z,a=t.w,c=a*e+o*i-s*n,l=a*n+s*e-r*i,h=a*i+r*n-o*e,u=-r*e-o*n-s*i;return this.x=c*a+u*-r+l*-s-h*-o,this.y=l*a+u*-o+h*-r-c*-s,this.z=h*a+u*-s+c*-o-l*-r,this},project:function(t){return this.applyMatrix4(t.matrixWorldInverse).applyMatrix4(t.projectionMatrix)},unproject:function(t){return this.applyMatrix4(t.projectionMatrixInverse).applyMatrix4(t.matrixWorld)},transformDirection:function(t){const e=this.x,n=this.y,i=this.z,r=t.elements;return this.x=r[0]*e+r[4]*n+r[8]*i,this.y=r[1]*e+r[5]*n+r[9]*i,this.z=r[2]*e+r[6]*n+r[10]*i,this.normalize()},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return this.multiplyScalar(1/t)},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this},clampScalar:function(t,e){return this.x=Math.max(t,Math.min(e,this.x)),this.y=Math.max(t,Math.min(e,this.y)),this.z=Math.max(t,Math.min(e,this.z)),this},clampLength:function(t,e){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(t,Math.min(e,n)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,n){return this.x=t.x+(e.x-t.x)*n,this.y=t.y+(e.y-t.y)*n,this.z=t.z+(e.z-t.z)*n,this},cross:function(t,e){return void 0!==e?(console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e)):this.crossVectors(this,t)},crossVectors:function(t,e){const n=t.x,i=t.y,r=t.z,o=e.x,s=e.y,a=e.z;return this.x=i*a-r*s,this.y=r*o-n*a,this.z=n*s-i*o,this},projectOnVector:function(t){const e=t.lengthSq();if(0===e)return this.set(0,0,0);const n=t.dot(this)/e;return this.copy(t).multiplyScalar(n)},projectOnPlane:function(t){return Wn.copy(this).projectOnVector(t),this.sub(Wn)},reflect:function(t){return this.sub(Wn.copy(t).multiplyScalar(2*this.dot(t)))},angleTo:function(t){const e=Math.sqrt(this.lengthSq()*t.lengthSq());if(0===e)return Math.PI/2;const n=this.dot(t)/e;return Math.acos(In.clamp(n,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){const e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return e*e+n*n+i*i},manhattanDistanceTo:function(t){return Math.abs(this.x-t.x)+Math.abs(this.y-t.y)+Math.abs(this.z-t.z)},setFromSpherical:function(t){return this.setFromSphericalCoords(t.radius,t.phi,t.theta)},setFromSphericalCoords:function(t,e,n){const i=Math.sin(e)*t;return this.x=i*Math.sin(n),this.y=Math.cos(e)*t,this.z=i*Math.cos(n),this},setFromCylindrical:function(t){return this.setFromCylindricalCoords(t.radius,t.theta,t.y)},setFromCylindricalCoords:function(t,e,n){return this.x=t*Math.sin(e),this.y=n,this.z=t*Math.cos(e),this},setFromMatrixPosition:function(t){const e=t.elements;return this.x=e[12],this.y=e[13],this.z=e[14],this},setFromMatrixScale:function(t){const e=this.setFromMatrixColumn(t,0).length(),n=this.setFromMatrixColumn(t,1).length(),i=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=n,this.z=i,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.elements,4*e)},setFromMatrix3Column:function(t,e){return this.fromArray(t.elements,3*e)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromBufferAttribute:function(t,e,n){return void 0!==n&&console.warn("THREE.Vector3: offset has been removed from .fromBufferAttribute()."),this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this},random:function(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}});const Yn=new Xn,Zn=new ei,Jn=new Xn(0,0,0),Qn=new Xn(1,1,1),Kn=new Xn,$n=new Xn,ti=new Xn;function ei(){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.")}Object.assign(ei.prototype,{isMatrix4:!0,set:function(t,e,n,i,r,o,s,a,c,l,h,u,p,d,f,m){const g=this.elements;return g[0]=t,g[4]=e,g[8]=n,g[12]=i,g[1]=r,g[5]=o,g[9]=s,g[13]=a,g[2]=c,g[6]=l,g[10]=h,g[14]=u,g[3]=p,g[7]=d,g[11]=f,g[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},clone:function(){return(new ei).fromArray(this.elements)},copy:function(t){const e=this.elements,n=t.elements;return e[0]=n[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],this},copyPosition:function(t){const e=this.elements,n=t.elements;return e[12]=n[12],e[13]=n[13],e[14]=n[14],this},extractBasis:function(t,e,n){return t.setFromMatrixColumn(this,0),e.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this},makeBasis:function(t,e,n){return this.set(t.x,e.x,n.x,0,t.y,e.y,n.y,0,t.z,e.z,n.z,0,0,0,0,1),this},extractRotation:function(t){const e=this.elements,n=t.elements,i=1/Yn.setFromMatrixColumn(t,0).length(),r=1/Yn.setFromMatrixColumn(t,1).length(),o=1/Yn.setFromMatrixColumn(t,2).length();return e[0]=n[0]*i,e[1]=n[1]*i,e[2]=n[2]*i,e[3]=0,e[4]=n[4]*r,e[5]=n[5]*r,e[6]=n[6]*r,e[7]=0,e[8]=n[8]*o,e[9]=n[9]*o,e[10]=n[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromEuler:function(t){t&&t.isEuler||console.error("THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");const e=this.elements,n=t.x,i=t.y,r=t.z,o=Math.cos(n),s=Math.sin(n),a=Math.cos(i),c=Math.sin(i),l=Math.cos(r),h=Math.sin(r);if("XYZ"===t.order){const t=o*l,n=o*h,i=s*l,r=s*h;e[0]=a*l,e[4]=-a*h,e[8]=c,e[1]=n+i*c,e[5]=t-r*c,e[9]=-s*a,e[2]=r-t*c,e[6]=i+n*c,e[10]=o*a}else if("YXZ"===t.order){const t=a*l,n=a*h,i=c*l,r=c*h;e[0]=t+r*s,e[4]=i*s-n,e[8]=o*c,e[1]=o*h,e[5]=o*l,e[9]=-s,e[2]=n*s-i,e[6]=r+t*s,e[10]=o*a}else if("ZXY"===t.order){const t=a*l,n=a*h,i=c*l,r=c*h;e[0]=t-r*s,e[4]=-o*h,e[8]=i+n*s,e[1]=n+i*s,e[5]=o*l,e[9]=r-t*s,e[2]=-o*c,e[6]=s,e[10]=o*a}else if("ZYX"===t.order){const t=o*l,n=o*h,i=s*l,r=s*h;e[0]=a*l,e[4]=i*c-n,e[8]=t*c+r,e[1]=a*h,e[5]=r*c+t,e[9]=n*c-i,e[2]=-c,e[6]=s*a,e[10]=o*a}else if("YZX"===t.order){const t=o*a,n=o*c,i=s*a,r=s*c;e[0]=a*l,e[4]=r-t*h,e[8]=i*h+n,e[1]=h,e[5]=o*l,e[9]=-s*l,e[2]=-c*l,e[6]=n*h+i,e[10]=t-r*h}else if("XZY"===t.order){const t=o*a,n=o*c,i=s*a,r=s*c;e[0]=a*l,e[4]=-h,e[8]=c*l,e[1]=t*h+r,e[5]=o*l,e[9]=n*h-i,e[2]=i*h-n,e[6]=s*l,e[10]=r*h+t}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},makeRotationFromQuaternion:function(t){return this.compose(Jn,t,Qn)},lookAt:function(t,e,n){const i=this.elements;return ti.subVectors(t,e),0===ti.lengthSq()&&(ti.z=1),ti.normalize(),Kn.crossVectors(n,ti),0===Kn.lengthSq()&&(1===Math.abs(n.z)?ti.x+=1e-4:ti.z+=1e-4,ti.normalize(),Kn.crossVectors(n,ti)),Kn.normalize(),$n.crossVectors(ti,Kn),i[0]=Kn.x,i[4]=$n.x,i[8]=ti.x,i[1]=Kn.y,i[5]=$n.y,i[9]=ti.y,i[2]=Kn.z,i[6]=$n.z,i[10]=ti.z,this},multiply:function(t,e){return void 0!==e?(console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){const n=t.elements,i=e.elements,r=this.elements,o=n[0],s=n[4],a=n[8],c=n[12],l=n[1],h=n[5],u=n[9],p=n[13],d=n[2],f=n[6],m=n[10],g=n[14],v=n[3],y=n[7],x=n[11],_=n[15],b=i[0],w=i[4],M=i[8],S=i[12],T=i[1],E=i[5],A=i[9],L=i[13],R=i[2],C=i[6],P=i[10],O=i[14],D=i[3],I=i[7],N=i[11],B=i[15];return r[0]=o*b+s*T+a*R+c*D,r[4]=o*w+s*E+a*C+c*I,r[8]=o*M+s*A+a*P+c*N,r[12]=o*S+s*L+a*O+c*B,r[1]=l*b+h*T+u*R+p*D,r[5]=l*w+h*E+u*C+p*I,r[9]=l*M+h*A+u*P+p*N,r[13]=l*S+h*L+u*O+p*B,r[2]=d*b+f*T+m*R+g*D,r[6]=d*w+f*E+m*C+g*I,r[10]=d*M+f*A+m*P+g*N,r[14]=d*S+f*L+m*O+g*B,r[3]=v*b+y*T+x*R+_*D,r[7]=v*w+y*E+x*C+_*I,r[11]=v*M+y*A+x*P+_*N,r[15]=v*S+y*L+x*O+_*B,this},multiplyScalar:function(t){const e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},determinant:function(){const t=this.elements,e=t[0],n=t[4],i=t[8],r=t[12],o=t[1],s=t[5],a=t[9],c=t[13],l=t[2],h=t[6],u=t[10],p=t[14];return t[3]*(+r*a*h-i*c*h-r*s*u+n*c*u+i*s*p-n*a*p)+t[7]*(+e*a*p-e*c*u+r*o*u-i*o*p+i*c*l-r*a*l)+t[11]*(+e*c*h-e*s*p-r*o*h+n*o*p+r*s*l-n*c*l)+t[15]*(-i*s*l-e*a*h+e*s*u+i*o*h-n*o*u+n*a*l)},transpose:function(){const t=this.elements;let e;return e=t[1],t[1]=t[4],t[4]=e,e=t[2],t[2]=t[8],t[8]=e,e=t[6],t[6]=t[9],t[9]=e,e=t[3],t[3]=t[12],t[12]=e,e=t[7],t[7]=t[13],t[13]=e,e=t[11],t[11]=t[14],t[14]=e,this},setPosition:function(t,e,n){const i=this.elements;return t.isVector3?(i[12]=t.x,i[13]=t.y,i[14]=t.z):(i[12]=t,i[13]=e,i[14]=n),this},getInverse:function(t,e){void 0!==e&&console.warn("THREE.Matrix4: .getInverse() can no longer be configured to throw on degenerate.");const n=this.elements,i=t.elements,r=i[0],o=i[1],s=i[2],a=i[3],c=i[4],l=i[5],h=i[6],u=i[7],p=i[8],d=i[9],f=i[10],m=i[11],g=i[12],v=i[13],y=i[14],x=i[15],_=d*y*u-v*f*u+v*h*m-l*y*m-d*h*x+l*f*x,b=g*f*u-p*y*u-g*h*m+c*y*m+p*h*x-c*f*x,w=p*v*u-g*d*u+g*l*m-c*v*m-p*l*x+c*d*x,M=g*d*h-p*v*h-g*l*f+c*v*f+p*l*y-c*d*y,S=r*_+o*b+s*w+a*M;if(0===S)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const T=1/S;return n[0]=_*T,n[1]=(v*f*a-d*y*a-v*s*m+o*y*m+d*s*x-o*f*x)*T,n[2]=(l*y*a-v*h*a+v*s*u-o*y*u-l*s*x+o*h*x)*T,n[3]=(d*h*a-l*f*a-d*s*u+o*f*u+l*s*m-o*h*m)*T,n[4]=b*T,n[5]=(p*y*a-g*f*a+g*s*m-r*y*m-p*s*x+r*f*x)*T,n[6]=(g*h*a-c*y*a-g*s*u+r*y*u+c*s*x-r*h*x)*T,n[7]=(c*f*a-p*h*a+p*s*u-r*f*u-c*s*m+r*h*m)*T,n[8]=w*T,n[9]=(g*d*a-p*v*a-g*o*m+r*v*m+p*o*x-r*d*x)*T,n[10]=(c*v*a-g*l*a+g*o*u-r*v*u-c*o*x+r*l*x)*T,n[11]=(p*l*a-c*d*a-p*o*u+r*d*u+c*o*m-r*l*m)*T,n[12]=M*T,n[13]=(p*v*s-g*d*s+g*o*f-r*v*f-p*o*y+r*d*y)*T,n[14]=(g*l*s-c*v*s-g*o*h+r*v*h+c*o*y-r*l*y)*T,n[15]=(c*d*s-p*l*s+p*o*h-r*d*h-c*o*f+r*l*f)*T,this},scale:function(t){const e=this.elements,n=t.x,i=t.y,r=t.z;return e[0]*=n,e[4]*=i,e[8]*=r,e[1]*=n,e[5]*=i,e[9]*=r,e[2]*=n,e[6]*=i,e[10]*=r,e[3]*=n,e[7]*=i,e[11]*=r,this},getMaxScaleOnAxis:function(){const t=this.elements,e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2],n=t[4]*t[4]+t[5]*t[5]+t[6]*t[6],i=t[8]*t[8]+t[9]*t[9]+t[10]*t[10];return Math.sqrt(Math.max(e,n,i))},makeTranslation:function(t,e,n){return this.set(1,0,0,t,0,1,0,e,0,0,1,n,0,0,0,1),this},makeRotationX:function(t){const e=Math.cos(t),n=Math.sin(t);return this.set(1,0,0,0,0,e,-n,0,0,n,e,0,0,0,0,1),this},makeRotationY:function(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,0,n,0,0,1,0,0,-n,0,e,0,0,0,0,1),this},makeRotationZ:function(t){const e=Math.cos(t),n=Math.sin(t);return this.set(e,-n,0,0,n,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){const n=Math.cos(e),i=Math.sin(e),r=1-n,o=t.x,s=t.y,a=t.z,c=r*o,l=r*s;return this.set(c*o+n,c*s-i*a,c*a+i*s,0,c*s+i*a,l*s+n,l*a-i*o,0,c*a-i*s,l*a+i*o,r*a*a+n,0,0,0,0,1),this},makeScale:function(t,e,n){return this.set(t,0,0,0,0,e,0,0,0,0,n,0,0,0,0,1),this},makeShear:function(t,e,n){return this.set(1,e,n,0,t,1,n,0,t,e,1,0,0,0,0,1),this},compose:function(t,e,n){const i=this.elements,r=e._x,o=e._y,s=e._z,a=e._w,c=r+r,l=o+o,h=s+s,u=r*c,p=r*l,d=r*h,f=o*l,m=o*h,g=s*h,v=a*c,y=a*l,x=a*h,_=n.x,b=n.y,w=n.z;return i[0]=(1-(f+g))*_,i[1]=(p+x)*_,i[2]=(d-y)*_,i[3]=0,i[4]=(p-x)*b,i[5]=(1-(u+g))*b,i[6]=(m+v)*b,i[7]=0,i[8]=(d+y)*w,i[9]=(m-v)*w,i[10]=(1-(u+f))*w,i[11]=0,i[12]=t.x,i[13]=t.y,i[14]=t.z,i[15]=1,this},decompose:function(t,e,n){const i=this.elements;let r=Yn.set(i[0],i[1],i[2]).length(),o=Yn.set(i[4],i[5],i[6]).length(),s=Yn.set(i[8],i[9],i[10]).length();this.determinant()<0&&(r=-r),t.x=i[12],t.y=i[13],t.z=i[14],Zn.copy(this);const a=1/r,c=1/o,l=1/s;return Zn.elements[0]*=a,Zn.elements[1]*=a,Zn.elements[2]*=a,Zn.elements[4]*=c,Zn.elements[5]*=c,Zn.elements[6]*=c,Zn.elements[8]*=l,Zn.elements[9]*=l,Zn.elements[10]*=l,e.setFromRotationMatrix(Zn),n.x=r,n.y=o,n.z=s,this},makePerspective:function(t,e,n,i,r,o){void 0===o&&console.warn("THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.");const s=this.elements,a=2*r/(e-t),c=2*r/(n-i),l=(e+t)/(e-t),h=(n+i)/(n-i),u=-(o+r)/(o-r),p=-2*o*r/(o-r);return s[0]=a,s[4]=0,s[8]=l,s[12]=0,s[1]=0,s[5]=c,s[9]=h,s[13]=0,s[2]=0,s[6]=0,s[10]=u,s[14]=p,s[3]=0,s[7]=0,s[11]=-1,s[15]=0,this},makeOrthographic:function(t,e,n,i,r,o){const s=this.elements,a=1/(e-t),c=1/(n-i),l=1/(o-r),h=(e+t)*a,u=(n+i)*c,p=(o+r)*l;return s[0]=2*a,s[4]=0,s[8]=0,s[12]=-h,s[1]=0,s[5]=2*c,s[9]=0,s[13]=-u,s[2]=0,s[6]=0,s[10]=-2*l,s[14]=-p,s[3]=0,s[7]=0,s[11]=0,s[15]=1,this},equals:function(t){const e=this.elements,n=t.elements;for(let i=0;i<16;i++)if(e[i]!==n[i])return!1;return!0},fromArray:function(t,e){void 0===e&&(e=0);for(let n=0;n<16;n++)this.elements[n]=t[n+e];return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);const n=this.elements;return t[e]=n[0],t[e+1]=n[1],t[e+2]=n[2],t[e+3]=n[3],t[e+4]=n[4],t[e+5]=n[5],t[e+6]=n[6],t[e+7]=n[7],t[e+8]=n[8],t[e+9]=n[9],t[e+10]=n[10],t[e+11]=n[11],t[e+12]=n[12],t[e+13]=n[13],t[e+14]=n[14],t[e+15]=n[15],t}});const ni=new ei,ii=new jn;function ri(t=0,e=0,n=0,i=ri.DefaultOrder){this._x=t,this._y=e,this._z=n,this._order=i}function oi(){this.mask=1}ri.RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],ri.DefaultOrder="XYZ",Object.defineProperties(ri.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this._onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this._onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this._onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this._onChangeCallback()}}}),Object.assign(ri.prototype,{isEuler:!0,set:function(t,e,n,i){return this._x=t,this._y=e,this._z=n,this._order=i||this._order,this._onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this._onChangeCallback(),this},setFromRotationMatrix:function(t,e,n){const i=In.clamp,r=t.elements,o=r[0],s=r[4],a=r[8],c=r[1],l=r[5],h=r[9],u=r[2],p=r[6],d=r[10];switch(e=e||this._order){case"XYZ":this._y=Math.asin(i(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-h,d),this._z=Math.atan2(-s,o)):(this._x=Math.atan2(p,l),this._z=0);break;case"YXZ":this._x=Math.asin(-i(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(a,d),this._z=Math.atan2(c,l)):(this._y=Math.atan2(-u,o),this._z=0);break;case"ZXY":this._x=Math.asin(i(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-u,d),this._z=Math.atan2(-s,l)):(this._y=0,this._z=Math.atan2(c,o));break;case"ZYX":this._y=Math.asin(-i(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(p,d),this._z=Math.atan2(c,o)):(this._x=0,this._z=Math.atan2(-s,l));break;case"YZX":this._z=Math.asin(i(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,l),this._y=Math.atan2(-u,o)):(this._x=0,this._y=Math.atan2(a,d));break;case"XZY":this._z=Math.asin(-i(s,-1,1)),Math.abs(s)<.9999999?(this._x=Math.atan2(p,l),this._y=Math.atan2(a,o)):(this._x=Math.atan2(-h,d),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+e)}return this._order=e,!1!==n&&this._onChangeCallback(),this},setFromQuaternion:function(t,e,n){return ni.makeRotationFromQuaternion(t),this.setFromRotationMatrix(ni,e,n)},setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(t){return ii.setFromEuler(this),this.setFromQuaternion(ii,t)},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this._onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new Xn(this._x,this._y,this._z)},_onChange:function(t){return this._onChangeCallback=t,this},_onChangeCallback:function(){}}),Object.assign(oi.prototype,{set:function(t){this.mask=1<<t|0},enable:function(t){this.mask|=1<<t|0},enableAll:function(){this.mask=-1},toggle:function(t){this.mask^=1<<t|0},disable:function(t){this.mask&=~(1<<t|0)},disableAll:function(){this.mask=0},test:function(t){return 0!=(this.mask&t.mask)}});let si=0;const ai=new Xn,ci=new jn,li=new ei,hi=new Xn,ui=new Xn,pi=new Xn,di=new jn,fi=new Xn(1,0,0),mi=new Xn(0,1,0),gi=new Xn(0,0,1),vi={type:"added"},yi={type:"removed"};function xi(){Object.defineProperty(this,"id",{value:si++}),this.uuid=In.generateUUID(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=xi.DefaultUp.clone();const t=new Xn,e=new ri,n=new jn,i=new Xn(1,1,1);e._onChange(function(){n.setFromEuler(e,!1)}),n._onChange(function(){e.setFromQuaternion(n,void 0,!1)}),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:t},rotation:{configurable:!0,enumerable:!0,value:e},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:i},modelViewMatrix:{value:new ei},normalMatrix:{value:new Bn}}),this.matrix=new ei,this.matrixWorld=new ei,this.matrixAutoUpdate=xi.DefaultMatrixAutoUpdate,this.matrixWorldNeedsUpdate=!1,this.layers=new oi,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}}function _i(){xi.call(this),this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.overrideMaterial=null,this.autoUpdate=!0,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}xi.DefaultUp=new Xn(0,1,0),xi.DefaultMatrixAutoUpdate=!0,xi.prototype=Object.assign(Object.create(Pn.prototype),{constructor:xi,isObject3D:!0,onBeforeRender:function(){},onAfterRender:function(){},applyMatrix4:function(t){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(t),this.matrix.decompose(this.position,this.quaternion,this.scale)},applyQuaternion:function(t){return this.quaternion.premultiply(t),this},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(t,e){return ci.setFromAxisAngle(t,e),this.quaternion.multiply(ci),this},rotateOnWorldAxis:function(t,e){return ci.setFromAxisAngle(t,e),this.quaternion.premultiply(ci),this},rotateX:function(t){return this.rotateOnAxis(fi,t)},rotateY:function(t){return this.rotateOnAxis(mi,t)},rotateZ:function(t){return this.rotateOnAxis(gi,t)},translateOnAxis:function(t,e){return ai.copy(t).applyQuaternion(this.quaternion),this.position.add(ai.multiplyScalar(e)),this},translateX:function(t){return this.translateOnAxis(fi,t)},translateY:function(t){return this.translateOnAxis(mi,t)},translateZ:function(t){return this.translateOnAxis(gi,t)},localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(t){return t.applyMatrix4(li.getInverse(this.matrixWorld))},lookAt:function(t,e,n){t.isVector3?hi.copy(t):hi.set(t,e,n);const i=this.parent;this.updateWorldMatrix(!0,!1),ui.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?li.lookAt(ui,hi,this.up):li.lookAt(hi,ui,this.up),this.quaternion.setFromRotationMatrix(li),i&&(li.extractRotation(i.matrixWorld),ci.setFromRotationMatrix(li),this.quaternion.premultiply(ci.inverse()))},add:function(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return t===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",t),this):(t&&t.isObject3D?(null!==t.parent&&t.parent.remove(t),t.parent=this,this.children.push(t),t.dispatchEvent(vi)):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this)},remove:function(t){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.remove(arguments[t]);return this}const e=this.children.indexOf(t);return-1!==e&&(t.parent=null,this.children.splice(e,1),t.dispatchEvent(yi)),this},attach:function(t){return this.updateWorldMatrix(!0,!1),li.getInverse(this.matrixWorld),null!==t.parent&&(t.parent.updateWorldMatrix(!0,!1),li.multiply(t.parent.matrixWorld)),t.applyMatrix4(li),t.updateWorldMatrix(!1,!1),this.add(t),this},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(let n=0,i=this.children.length;n<i;n++){const i=this.children[n].getObjectByProperty(t,e);if(void 0!==i)return i}},getWorldPosition:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldPosition() target is now required"),t=new Xn),this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldQuaternion() target is now required"),t=new jn),this.updateMatrixWorld(!0),this.matrixWorld.decompose(ui,t,pi),t},getWorldScale:function(t){return void 0===t&&(console.warn("THREE.Object3D: .getWorldScale() target is now required"),t=new Xn),this.updateMatrixWorld(!0),this.matrixWorld.decompose(ui,di,t),t},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Object3D: .getWorldDirection() target is now required"),t=new Xn),this.updateMatrixWorld(!0);const e=this.matrixWorld.elements;return t.set(e[8],e[9],e[10]).normalize()},raycast:function(){},traverse:function(t){t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverse(t)},traverseVisible:function(t){if(!1===this.visible)return;t(this);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].traverseVisible(t)},traverseAncestors:function(t){const e=this.parent;null!==e&&(t(e),e.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorldNeedsUpdate=!1,t=!0);const e=this.children;for(let n=0,i=e.length;n<i;n++)e[n].updateMatrixWorld(t)},updateWorldMatrix:function(t,e){const n=this.parent;if(!0===t&&null!==n&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),null===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),!0===e){const t=this.children;for(let e=0,n=t.length;e<n;e++)t[e].updateWorldMatrix(!1,!0)}},toJSON:function(t){const e=void 0===t||"string"==typeof t,n={};e&&(t={geometries:{},materials:{},textures:{},images:{},shapes:{}},n.metadata={version:4.5,type:"Object",generator:"Object3D.toJSON"});const i={};function r(e,n){return void 0===e[n.uuid]&&(e[n.uuid]=n.toJSON(t)),n.uuid}if(i.uuid=this.uuid,i.type=this.type,""!==this.name&&(i.name=this.name),!0===this.castShadow&&(i.castShadow=!0),!0===this.receiveShadow&&(i.receiveShadow=!0),!1===this.visible&&(i.visible=!1),!1===this.frustumCulled&&(i.frustumCulled=!1),0!==this.renderOrder&&(i.renderOrder=this.renderOrder),"{}"!==JSON.stringify(this.userData)&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),!1===this.matrixAutoUpdate&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON()),this.isMesh||this.isLine||this.isPoints){i.geometry=r(t.geometries,this.geometry);const e=this.geometry.parameters;if(void 0!==e&&void 0!==e.shapes){const n=e.shapes;if(Array.isArray(n))for(let e=0,i=n.length;e<i;e++){const i=n[e];r(t.shapes,i)}else r(t.shapes,n)}}if(void 0!==this.material)if(Array.isArray(this.material)){const e=[];for(let n=0,i=this.material.length;n<i;n++)e.push(r(t.materials,this.material[n]));i.material=e}else i.material=r(t.materials,this.material);if(this.children.length>0){i.children=[];for(let e=0;e<this.children.length;e++)i.children.push(this.children[e].toJSON(t).object)}if(e){const e=o(t.geometries),i=o(t.materials),r=o(t.textures),s=o(t.images),a=o(t.shapes);e.length>0&&(n.geometries=e),i.length>0&&(n.materials=i),r.length>0&&(n.textures=r),s.length>0&&(n.images=s),a.length>0&&(n.shapes=a)}return n.object=i,n;function o(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}},clone:function(t){return(new this.constructor).copy(this,t)},copy:function(t,e){if(void 0===e&&(e=!0),this.name=t.name,this.up.copy(t.up),this.position.copy(t.position),this.rotation.order=t.rotation.order,this.quaternion.copy(t.quaternion),this.scale.copy(t.scale),this.matrix.copy(t.matrix),this.matrixWorld.copy(t.matrixWorld),this.matrixAutoUpdate=t.matrixAutoUpdate,this.matrixWorldNeedsUpdate=t.matrixWorldNeedsUpdate,this.layers.mask=t.layers.mask,this.visible=t.visible,this.castShadow=t.castShadow,this.receiveShadow=t.receiveShadow,this.frustumCulled=t.frustumCulled,this.renderOrder=t.renderOrder,this.userData=JSON.parse(JSON.stringify(t.userData)),!0===e)for(let n=0;n<t.children.length;n++){const e=t.children[n];this.add(e.clone())}return this}}),_i.prototype=Object.assign(Object.create(xi.prototype),{constructor:_i,isScene:!0,copy:function(t,e){return xi.prototype.copy.call(this,t,e),null!==t.background&&(this.background=t.background.clone()),null!==t.environment&&(this.environment=t.environment.clone()),null!==t.fog&&(this.fog=t.fog.clone()),null!==t.overrideMaterial&&(this.overrideMaterial=t.overrideMaterial.clone()),this.autoUpdate=t.autoUpdate,this.matrixAutoUpdate=t.matrixAutoUpdate,this},toJSON:function(t){const e=xi.prototype.toJSON.call(this,t);return null!==this.background&&(e.object.background=this.background.toJSON(t)),null!==this.environment&&(e.object.environment=this.environment.toJSON(t)),null!==this.fog&&(e.object.fog=this.fog.toJSON()),e},dispose:function(){this.dispatchEvent({type:"dispose"})}});const bi=[new Xn,new Xn,new Xn,new Xn,new Xn,new Xn,new Xn,new Xn],wi=new Xn,Mi=new Ii,Si=new Xn,Ti=new Xn,Ei=new Xn,Ai=new Xn,Li=new Xn,Ri=new Xn,Ci=new Xn,Pi=new Xn,Oi=new Xn,Di=new Xn;function Ii(t,e){this.min=void 0!==t?t:new Xn(1/0,1/0,1/0),this.max=void 0!==e?e:new Xn(-1/0,-1/0,-1/0)}function Ni(t,e,n,i,r){for(let o=0,s=t.length-3;o<=s;o+=3){Di.fromArray(t,o);const s=r.x*Math.abs(Di.x)+r.y*Math.abs(Di.y)+r.z*Math.abs(Di.z),a=e.dot(Di),c=n.dot(Di),l=i.dot(Di);if(Math.max(-Math.max(a,c,l),Math.min(a,c,l))>s)return!1}return!0}Object.assign(Ii.prototype,{isBox3:!0,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){let e=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,s=-1/0;for(let a=0,c=t.length;a<c;a+=3){const c=t[a],l=t[a+1],h=t[a+2];c<e&&(e=c),l<n&&(n=l),h<i&&(i=h),c>r&&(r=c),l>o&&(o=l),h>s&&(s=h)}return this.min.set(e,n,i),this.max.set(r,o,s),this},setFromBufferAttribute:function(t){let e=1/0,n=1/0,i=1/0,r=-1/0,o=-1/0,s=-1/0;for(let a=0,c=t.count;a<c;a++){const c=t.getX(a),l=t.getY(a),h=t.getZ(a);c<e&&(e=c),l<n&&(n=l),h<i&&(i=h),c>r&&(r=c),l>o&&(o=l),h>s&&(s=h)}return this.min.set(e,n,i),this.max.set(r,o,s),this},setFromPoints:function(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(t,e){const n=wi.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this},setFromObject:function(t){return this.makeEmpty(),this.expandByObject(t)},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box3: .getCenter() target is now required"),t=new Xn),this.isEmpty()?t.set(0,0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box3: .getSize() target is now required"),t=new Xn),this.isEmpty()?t.set(0,0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},expandByObject:function(t){t.updateWorldMatrix(!1,!1);const e=t.geometry;void 0!==e&&(null===e.boundingBox&&e.computeBoundingBox(),Mi.copy(e.boundingBox),Mi.applyMatrix4(t.matrixWorld),this.union(Mi));const n=t.children;for(let i=0,r=n.length;i<r;i++)this.expandByObject(n[i]);return this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .getParameter() target is now required"),e=new Xn),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},intersectsSphere:function(t){return this.clampPoint(t.center,wi),wi.distanceToSquared(t.center)<=t.radius*t.radius},intersectsPlane:function(t){let e,n;return t.normal.x>0?(e=t.normal.x*this.min.x,n=t.normal.x*this.max.x):(e=t.normal.x*this.max.x,n=t.normal.x*this.min.x),t.normal.y>0?(e+=t.normal.y*this.min.y,n+=t.normal.y*this.max.y):(e+=t.normal.y*this.max.y,n+=t.normal.y*this.min.y),t.normal.z>0?(e+=t.normal.z*this.min.z,n+=t.normal.z*this.max.z):(e+=t.normal.z*this.max.z,n+=t.normal.z*this.min.z),e<=-t.constant&&n>=-t.constant},intersectsTriangle:function(t){if(this.isEmpty())return!1;this.getCenter(Ci),Pi.subVectors(this.max,Ci),Si.subVectors(t.a,Ci),Ti.subVectors(t.b,Ci),Ei.subVectors(t.c,Ci),Ai.subVectors(Ti,Si),Li.subVectors(Ei,Ti),Ri.subVectors(Si,Ei);let e=[0,-Ai.z,Ai.y,0,-Li.z,Li.y,0,-Ri.z,Ri.y,Ai.z,0,-Ai.x,Li.z,0,-Li.x,Ri.z,0,-Ri.x,-Ai.y,Ai.x,0,-Li.y,Li.x,0,-Ri.y,Ri.x,0];return!!Ni(e,Si,Ti,Ei,Pi)&&(!!Ni(e=[1,0,0,0,1,0,0,0,1],Si,Ti,Ei,Pi)&&(Oi.crossVectors(Ai,Li),Ni(e=[Oi.x,Oi.y,Oi.z],Si,Ti,Ei,Pi)))},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box3: .clampPoint() target is now required"),e=new Xn),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return wi.copy(t).clamp(this.min,this.max).sub(t).length()},getBoundingSphere:function(t){return void 0===t&&console.error("THREE.Box3: .getBoundingSphere() target is now required"),this.getCenter(t.center),t.radius=.5*this.getSize(wi).length(),t},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this.isEmpty()&&this.makeEmpty(),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(t){return this.isEmpty()?this:(bi[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),bi[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),bi[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),bi[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),bi[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),bi[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),bi[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),bi[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(bi),this)},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});const Bi=new Ii;function Fi(t,e){this.center=void 0!==t?t:new Xn,this.radius=void 0!==e?e:-1}Object.assign(Fi.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(t,e){const n=this.center;void 0!==e?n.copy(e):Bi.setFromPoints(t).getCenter(n);let i=0;for(let r=0,o=t.length;r<o;r++)i=Math.max(i,n.distanceToSquared(t[r]));return this.radius=Math.sqrt(i),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},isEmpty:function(){return this.radius<0},makeEmpty:function(){return this.center.set(0,0,0),this.radius=-1,this},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){const e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,e){const n=this.center.distanceToSquared(t);return void 0===e&&(console.warn("THREE.Sphere: .clampPoint() target is now required"),e=new Xn),e.copy(t),n>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return void 0===t&&(console.warn("THREE.Sphere: .getBoundingBox() target is now required"),t=new Ii),this.isEmpty()?(t.makeEmpty(),t):(t.set(this.center,this.center),t.expandByScalar(this.radius),t)},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}});const Ui=new Xn,Gi=new Xn,zi=new Xn,Hi=new Xn,ki=new Xn,Vi=new Xn,ji=new Xn;function Wi(t,e){this.origin=void 0!==t?t:new Xn,this.direction=void 0!==e?e:new Xn(0,0,-1)}Object.assign(Wi.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return void 0===e&&(console.warn("THREE.Ray: .at() target is now required"),e=new Xn),e.copy(this.direction).multiplyScalar(t).add(this.origin)},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},recast:function(t){return this.origin.copy(this.at(t,Ui)),this},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Ray: .closestPointToPoint() target is now required"),e=new Xn),e.subVectors(t,this.origin);const n=e.dot(this.direction);return n<0?e.copy(this.origin):e.copy(this.direction).multiplyScalar(n).add(this.origin)},distanceToPoint:function(t){return Math.sqrt(this.distanceSqToPoint(t))},distanceSqToPoint:function(t){const e=Ui.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceToSquared(t):(Ui.copy(this.direction).multiplyScalar(e).add(this.origin),Ui.distanceToSquared(t))},distanceSqToSegment:function(t,e,n,i){Gi.copy(t).add(e).multiplyScalar(.5),zi.copy(e).sub(t).normalize(),Hi.copy(this.origin).sub(Gi);const r=.5*t.distanceTo(e),o=-this.direction.dot(zi),s=Hi.dot(this.direction),a=-Hi.dot(zi),c=Hi.lengthSq(),l=Math.abs(1-o*o);let h,u,p,d;if(l>0)if(u=o*s-a,d=r*l,(h=o*a-s)>=0)if(u>=-d)if(u<=d){const t=1/l;p=(h*=t)*(h+o*(u*=t)+2*s)+u*(o*h+u+2*a)+c}else u=r,p=-(h=Math.max(0,-(o*u+s)))*h+u*(u+2*a)+c;else u=-r,p=-(h=Math.max(0,-(o*u+s)))*h+u*(u+2*a)+c;else u<=-d?p=-(h=Math.max(0,-(-o*r+s)))*h+(u=h>0?-r:Math.min(Math.max(-r,-a),r))*(u+2*a)+c:u<=d?(h=0,p=(u=Math.min(Math.max(-r,-a),r))*(u+2*a)+c):p=-(h=Math.max(0,-(o*r+s)))*h+(u=h>0?r:Math.min(Math.max(-r,-a),r))*(u+2*a)+c;else u=o>0?-r:r,p=-(h=Math.max(0,-(o*u+s)))*h+u*(u+2*a)+c;return n&&n.copy(this.direction).multiplyScalar(h).add(this.origin),i&&i.copy(zi).multiplyScalar(u).add(Gi),p},intersectSphere:function(t,e){Ui.subVectors(t.center,this.origin);const n=Ui.dot(this.direction),i=Ui.dot(Ui)-n*n,r=t.radius*t.radius;if(i>r)return null;const o=Math.sqrt(r-i),s=n-o,a=n+o;return s<0&&a<0?null:s<0?this.at(a,e):this.at(s,e)},intersectsSphere:function(t){return this.distanceSqToPoint(t.center)<=t.radius*t.radius},distanceToPlane:function(t){const e=t.normal.dot(this.direction);if(0===e)return 0===t.distanceToPoint(this.origin)?0:null;const n=-(this.origin.dot(t.normal)+t.constant)/e;return n>=0?n:null},intersectPlane:function(t,e){const n=this.distanceToPlane(t);return null===n?null:this.at(n,e)},intersectsPlane:function(t){const e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},intersectBox:function(t,e){let n,i,r,o,s,a;const c=1/this.direction.x,l=1/this.direction.y,h=1/this.direction.z,u=this.origin;return c>=0?(n=(t.min.x-u.x)*c,i=(t.max.x-u.x)*c):(n=(t.max.x-u.x)*c,i=(t.min.x-u.x)*c),l>=0?(r=(t.min.y-u.y)*l,o=(t.max.y-u.y)*l):(r=(t.max.y-u.y)*l,o=(t.min.y-u.y)*l),n>o||r>i?null:((r>n||n!=n)&&(n=r),(o<i||i!=i)&&(i=o),h>=0?(s=(t.min.z-u.z)*h,a=(t.max.z-u.z)*h):(s=(t.max.z-u.z)*h,a=(t.min.z-u.z)*h),n>a||s>i?null:((s>n||n!=n)&&(n=s),(a<i||i!=i)&&(i=a),i<0?null:this.at(n>=0?n:i,e)))},intersectsBox:function(t){return null!==this.intersectBox(t,Ui)},intersectTriangle:function(t,e,n,i,r){ki.subVectors(e,t),Vi.subVectors(n,t),ji.crossVectors(ki,Vi);let o,s=this.direction.dot(ji);if(s>0){if(i)return null;o=1}else{if(!(s<0))return null;o=-1,s=-s}Hi.subVectors(this.origin,t);const a=o*this.direction.dot(Vi.crossVectors(Hi,Vi));if(a<0)return null;const c=o*this.direction.dot(ki.cross(Hi));if(c<0)return null;if(a+c>s)return null;const l=-o*Hi.dot(ji);return l<0?null:this.at(l/s,r)},applyMatrix4:function(t){return this.origin.applyMatrix4(t),this.direction.transformDirection(t),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)}});const qi=new Xn,Xi=new Xn,Yi=new Bn;function Zi(t,e){this.normal=void 0!==t?t:new Xn(1,0,0),this.constant=void 0!==e?e:0}Object.assign(Zi.prototype,{isPlane:!0,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,n,i){return this.normal.set(t,e,n),this.constant=i,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(t,e,n){const i=qi.subVectors(n,e).cross(Xi.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(i,t),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){const t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return void 0===e&&(console.warn("THREE.Plane: .projectPoint() target is now required"),e=new Xn),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:function(t,e){void 0===e&&(console.warn("THREE.Plane: .intersectLine() target is now required"),e=new Xn);const n=t.delta(qi),i=this.normal.dot(n);if(0===i)return 0===this.distanceToPoint(t.start)?e.copy(t.start):void 0;const r=-(t.start.dot(this.normal)+this.constant)/i;return r<0||r>1?void 0:e.copy(n).multiplyScalar(r).add(t.start)},intersectsLine:function(t){const e=this.distanceToPoint(t.start),n=this.distanceToPoint(t.end);return e<0&&n>0||n<0&&e>0},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return void 0===t&&(console.warn("THREE.Plane: .coplanarPoint() target is now required"),t=new Xn),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(t,e){const n=e||Yi.getNormalMatrix(t),i=this.coplanarPoint(qi).applyMatrix4(t),r=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(r),this},translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}});const Ji=new Xn,Qi=new Xn,Ki=new Xn,$i=new Xn,tr=new Xn,er=new Xn,nr=new Xn,ir=new Xn,rr=new Xn,or=new Xn;function sr(t,e,n){this.a=void 0!==t?t:new Xn,this.b=void 0!==e?e:new Xn,this.c=void 0!==n?n:new Xn}Object.assign(sr,{getNormal:function(t,e,n,i){void 0===i&&(console.warn("THREE.Triangle: .getNormal() target is now required"),i=new Xn),i.subVectors(n,e),Ji.subVectors(t,e),i.cross(Ji);const r=i.lengthSq();return r>0?i.multiplyScalar(1/Math.sqrt(r)):i.set(0,0,0)},getBarycoord:function(t,e,n,i,r){Ji.subVectors(i,e),Qi.subVectors(n,e),Ki.subVectors(t,e);const o=Ji.dot(Ji),s=Ji.dot(Qi),a=Ji.dot(Ki),c=Qi.dot(Qi),l=Qi.dot(Ki),h=o*c-s*s;if(void 0===r&&(console.warn("THREE.Triangle: .getBarycoord() target is now required"),r=new Xn),0===h)return r.set(-2,-1,-1);const u=1/h,p=(c*a-s*l)*u,d=(o*l-s*a)*u;return r.set(1-p-d,d,p)},containsPoint:function(t,e,n,i){return sr.getBarycoord(t,e,n,i,$i),$i.x>=0&&$i.y>=0&&$i.x+$i.y<=1},getUV:function(t,e,n,i,r,o,s,a){return this.getBarycoord(t,e,n,i,$i),a.set(0,0),a.addScaledVector(r,$i.x),a.addScaledVector(o,$i.y),a.addScaledVector(s,$i.z),a},isFrontFacing:function(t,e,n,i){return Ji.subVectors(n,e),Qi.subVectors(t,e),Ji.cross(Qi).dot(i)<0}}),Object.assign(sr.prototype,{set:function(t,e,n){return this.a.copy(t),this.b.copy(e),this.c.copy(n),this},setFromPointsAndIndices:function(t,e,n,i){return this.a.copy(t[e]),this.b.copy(t[n]),this.c.copy(t[i]),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},getArea:function(){return Ji.subVectors(this.c,this.b),Qi.subVectors(this.a,this.b),.5*Ji.cross(Qi).length()},getMidpoint:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getMidpoint() target is now required"),t=new Xn),t.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},getNormal:function(t){return sr.getNormal(this.a,this.b,this.c,t)},getPlane:function(t){return void 0===t&&(console.warn("THREE.Triangle: .getPlane() target is now required"),t=new Zi),t.setFromCoplanarPoints(this.a,this.b,this.c)},getBarycoord:function(t,e){return sr.getBarycoord(t,this.a,this.b,this.c,e)},getUV:function(t,e,n,i,r){return sr.getUV(t,this.a,this.b,this.c,e,n,i,r)},containsPoint:function(t){return sr.containsPoint(t,this.a,this.b,this.c)},isFrontFacing:function(t){return sr.isFrontFacing(this.a,this.b,this.c,t)},intersectsBox:function(t){return t.intersectsTriangle(this)},closestPointToPoint:function(t,e){void 0===e&&(console.warn("THREE.Triangle: .closestPointToPoint() target is now required"),e=new Xn);const n=this.a,i=this.b,r=this.c;let o,s;tr.subVectors(i,n),er.subVectors(r,n),ir.subVectors(t,n);const a=tr.dot(ir),c=er.dot(ir);if(a<=0&&c<=0)return e.copy(n);rr.subVectors(t,i);const l=tr.dot(rr),h=er.dot(rr);if(l>=0&&h<=l)return e.copy(i);const u=a*h-l*c;if(u<=0&&a>=0&&l<=0)return o=a/(a-l),e.copy(n).addScaledVector(tr,o);or.subVectors(t,r);const p=tr.dot(or),d=er.dot(or);if(d>=0&&p<=d)return e.copy(r);const f=p*c-a*d;if(f<=0&&c>=0&&d<=0)return s=c/(c-d),e.copy(n).addScaledVector(er,s);const m=l*d-p*h;if(m<=0&&h-l>=0&&p-d>=0)return nr.subVectors(r,i),s=(h-l)/(h-l+(p-d)),e.copy(i).addScaledVector(nr,s);const g=1/(m+f+u);return o=f*g,s=u*g,e.copy(n).addScaledVector(tr,o).addScaledVector(er,s)},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)}});const ar={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},cr={h:0,s:0,l:0},lr={h:0,s:0,l:0};function hr(t,e,n){return void 0===e&&void 0===n?this.set(t):this.setRGB(t,e,n)}function ur(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+6*(e-t)*(2/3-n):t}function pr(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function dr(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}function fr(t,e,n,i,r,o){this.a=t,this.b=e,this.c=n,this.normal=i&&i.isVector3?i:new Xn,this.vertexNormals=Array.isArray(i)?i:[],this.color=r&&r.isColor?r:new hr,this.vertexColors=Array.isArray(r)?r:[],this.materialIndex=void 0!==o?o:0}Object.assign(hr.prototype,{isColor:!0,r:1,g:1,b:1,set:function(t){return t&&t.isColor?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setScalar:function(t){return this.r=t,this.g=t,this.b=t,this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,n){return this.r=t,this.g=e,this.b=n,this},setHSL:function(t,e,n){if(t=In.euclideanModulo(t,1),e=In.clamp(e,0,1),n=In.clamp(n,0,1),0===e)this.r=this.g=this.b=n;else{const i=n<=.5?n*(1+e):n+e-n*e,r=2*n-i;this.r=ur(r,i,t+1/3),this.g=ur(r,i,t),this.b=ur(r,i,t-1/3)}return this},setStyle:function(t){function e(e){void 0!==e&&parseFloat(e)<1&&console.warn("THREE.Color: Alpha component of "+t+" will be ignored.")}let n;if(n=/^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(t)){let t;const i=n[1],r=n[2];switch(i){case"rgb":case"rgba":if(t=/^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r))return this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,e(t[5]),this;if(t=/^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r))return this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,e(t[5]),this;break;case"hsl":case"hsla":if(t=/^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(r)){const n=parseFloat(t[1])/360,i=parseInt(t[2],10)/100,r=parseInt(t[3],10)/100;return e(t[5]),this.setHSL(n,i,r)}}}else if(n=/^\#([A-Fa-f0-9]+)$/.exec(t)){const t=n[1],e=t.length;if(3===e)return this.r=parseInt(t.charAt(0)+t.charAt(0),16)/255,this.g=parseInt(t.charAt(1)+t.charAt(1),16)/255,this.b=parseInt(t.charAt(2)+t.charAt(2),16)/255,this;if(6===e)return this.r=parseInt(t.charAt(0)+t.charAt(1),16)/255,this.g=parseInt(t.charAt(2)+t.charAt(3),16)/255,this.b=parseInt(t.charAt(4)+t.charAt(5),16)/255,this}return t&&t.length>0?this.setColorName(t):this},setColorName:function(t){const e=ar[t];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this},clone:function(){return new this.constructor(this.r,this.g,this.b)},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);const n=e>0?1/e:1;return this.r=Math.pow(t.r,n),this.g=Math.pow(t.g,n),this.b=Math.pow(t.b,n),this},convertGammaToLinear:function(t){return this.copyGammaToLinear(this,t),this},convertLinearToGamma:function(t){return this.copyLinearToGamma(this,t),this},copySRGBToLinear:function(t){return this.r=pr(t.r),this.g=pr(t.g),this.b=pr(t.b),this},copyLinearToSRGB:function(t){return this.r=dr(t.r),this.g=dr(t.g),this.b=dr(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(t){void 0===t&&(console.warn("THREE.Color: .getHSL() target is now required"),t={h:0,s:0,l:0});const e=this.r,n=this.g,i=this.b,r=Math.max(e,n,i),o=Math.min(e,n,i);let s,a;const c=(o+r)/2;if(o===r)s=0,a=0;else{const t=r-o;switch(a=c<=.5?t/(r+o):t/(2-r-o),r){case e:s=(n-i)/t+(n<i?6:0);break;case n:s=(i-e)/t+2;break;case i:s=(e-n)/t+4}s/=6}return t.h=s,t.s=a,t.l=c,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,e,n){return this.getHSL(cr),cr.h+=t,cr.s+=e,cr.l+=n,this.setHSL(cr.h,cr.s,cr.l),this},add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},sub:function(t){return this.r=Math.max(0,this.r-t.r),this.g=Math.max(0,this.g-t.g),this.b=Math.max(0,this.b-t.b),this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},lerpHSL:function(t,e){this.getHSL(cr),t.getHSL(lr);const n=In.lerp(cr.h,lr.h,e),i=In.lerp(cr.s,lr.s,e),r=In.lerp(cr.l,lr.l,e);return this.setHSL(n,i,r),this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t,e){return void 0===e&&(e=0),this.r=t[e],this.g=t[e+1],this.b=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},fromBufferAttribute:function(t,e){return this.r=t.getX(e),this.g=t.getY(e),this.b=t.getZ(e),!0===t.normalized&&(this.r/=255,this.g/=255,this.b/=255),this},toJSON:function(){return this.getHex()}}),hr.NAMES=ar,Object.assign(fr.prototype,{clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.a=t.a,this.b=t.b,this.c=t.c,this.normal.copy(t.normal),this.color.copy(t.color),this.materialIndex=t.materialIndex;for(let e=0,n=t.vertexNormals.length;e<n;e++)this.vertexNormals[e]=t.vertexNormals[e].clone();for(let e=0,n=t.vertexColors.length;e<n;e++)this.vertexColors[e]=t.vertexColors[e].clone();return this}});let mr=0;function gr(){Object.defineProperty(this,"id",{value:mr++}),this.uuid=In.generateUUID(),this.name="",this.type="Material",this.fog=!0,this.blending=v,this.side=u,this.flatShading=!1,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.blendSrc=P,this.blendDst=O,this.blendEquation=w,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=H,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=bn,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=an,this.stencilZFail=an,this.stencilZPass=an,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaTest=0,this.premultipliedAlpha=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0}function vr(t){gr.call(this),this.type="MeshBasicMaterial",this.color=new hr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=q,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.setValues(t)}gr.prototype=Object.assign(Object.create(Pn.prototype),{constructor:gr,isMaterial:!0,onBeforeCompile:function(){},customProgramCacheKey:function(){return this.onBeforeCompile.toString()},setValues:function(t){if(void 0!==t)for(const e in t){const n=t[e];if(void 0===n){console.warn("THREE.Material: '"+e+"' parameter is undefined.");continue}if("shading"===e){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===n;continue}const i=this[e];void 0!==i?i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[e]=n:console.warn("THREE."+this.type+": '"+e+"' is not a property of this material.")}},toJSON:function(t){const e=void 0===t||"string"==typeof t;e&&(t={textures:{},images:{}});const n={metadata:{version:4.5,type:"Material",generator:"Material.toJSON"}};function i(t){const e=[];for(const n in t){const i=t[n];delete i.metadata,e.push(i)}return e}if(n.uuid=this.uuid,n.type=this.type,""!==this.name&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),void 0!==this.roughness&&(n.roughness=this.roughness),void 0!==this.metalness&&(n.metalness=this.metalness),this.sheen&&this.sheen.isColor&&(n.sheen=this.sheen.getHex()),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&1!==this.emissiveIntensity&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),void 0!==this.shininess&&(n.shininess=this.shininess),void 0!==this.clearcoat&&(n.clearcoat=this.clearcoat),void 0!==this.clearcoatRoughness&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(t).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(t).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(t).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(t).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(t).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(t).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(t).uuid),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(t).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(t).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(t).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(t).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(t).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(t).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(t).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(t).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(t).uuid,n.reflectivity=this.reflectivity,n.refractionRatio=this.refractionRatio,void 0!==this.combine&&(n.combine=this.combine),void 0!==this.envMapIntensity&&(n.envMapIntensity=this.envMapIntensity)),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(t).uuid),void 0!==this.size&&(n.size=this.size),void 0!==this.sizeAttenuation&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==v&&(n.blending=this.blending),!0===this.flatShading&&(n.flatShading=this.flatShading),this.side!==u&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),!0===this.transparent&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation&&0!==this.rotation&&(n.rotation=this.rotation),!0===this.polygonOffset&&(n.polygonOffset=!0),0!==this.polygonOffsetFactor&&(n.polygonOffsetFactor=this.polygonOffsetFactor),0!==this.polygonOffsetUnits&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth&&1!==this.linewidth&&(n.linewidth=this.linewidth),void 0!==this.dashSize&&(n.dashSize=this.dashSize),void 0!==this.gapSize&&(n.gapSize=this.gapSize),void 0!==this.scale&&(n.scale=this.scale),!0===this.dithering&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),!0===this.premultipliedAlpha&&(n.premultipliedAlpha=this.premultipliedAlpha),!0===this.wireframe&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),"round"!==this.wireframeLinecap&&(n.wireframeLinecap=this.wireframeLinecap),"round"!==this.wireframeLinejoin&&(n.wireframeLinejoin=this.wireframeLinejoin),!0===this.morphTargets&&(n.morphTargets=!0),!0===this.morphNormals&&(n.morphNormals=!0),!0===this.skinning&&(n.skinning=!0),!1===this.visible&&(n.visible=!1),!1===this.toneMapped&&(n.toneMapped=!1),"{}"!==JSON.stringify(this.userData)&&(n.userData=this.userData),e){const e=i(t.textures),r=i(t.images);e.length>0&&(n.textures=e),r.length>0&&(n.images=r)}return n},clone:function(){return(new this.constructor).copy(this)},copy:function(t){this.name=t.name,this.fog=t.fog,this.blending=t.blending,this.side=t.side,this.flatShading=t.flatShading,this.vertexColors=t.vertexColors,this.opacity=t.opacity,this.transparent=t.transparent,this.blendSrc=t.blendSrc,this.blendDst=t.blendDst,this.blendEquation=t.blendEquation,this.blendSrcAlpha=t.blendSrcAlpha,this.blendDstAlpha=t.blendDstAlpha,this.blendEquationAlpha=t.blendEquationAlpha,this.depthFunc=t.depthFunc,this.depthTest=t.depthTest,this.depthWrite=t.depthWrite,this.stencilWriteMask=t.stencilWriteMask,this.stencilFunc=t.stencilFunc,this.stencilRef=t.stencilRef,this.stencilFuncMask=t.stencilFuncMask,this.stencilFail=t.stencilFail,this.stencilZFail=t.stencilZFail,this.stencilZPass=t.stencilZPass,this.stencilWrite=t.stencilWrite;const e=t.clippingPlanes;let n=null;if(null!==e){const t=e.length;n=new Array(t);for(let i=0;i!==t;++i)n[i]=e[i].clone()}return this.clippingPlanes=n,this.clipIntersection=t.clipIntersection,this.clipShadows=t.clipShadows,this.shadowSide=t.shadowSide,this.colorWrite=t.colorWrite,this.precision=t.precision,this.polygonOffset=t.polygonOffset,this.polygonOffsetFactor=t.polygonOffsetFactor,this.polygonOffsetUnits=t.polygonOffsetUnits,this.dithering=t.dithering,this.alphaTest=t.alphaTest,this.premultipliedAlpha=t.premultipliedAlpha,this.visible=t.visible,this.toneMapped=t.toneMapped,this.userData=JSON.parse(JSON.stringify(t.userData)),this},dispose:function(){this.dispatchEvent({type:"dispose"})}}),Object.defineProperty(gr.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),vr.prototype=Object.create(gr.prototype),vr.prototype.constructor=vr,vr.prototype.isMeshBasicMaterial=!0,vr.prototype.copy=function(t){return gr.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this};const yr=new Xn,xr=new Nn;function _r(t,e,n){if(Array.isArray(t))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.name="",this.array=t,this.itemSize=e,this.count=void 0!==t?t.length/e:0,this.normalized=!0===n,this.usage=wn,this.updateRange={offset:0,count:-1},this.version=0}function br(t,e,n){_r.call(this,new Int8Array(t),e,n)}function wr(t,e,n){_r.call(this,new Uint8Array(t),e,n)}function Mr(t,e,n){_r.call(this,new Uint8ClampedArray(t),e,n)}function Sr(t,e,n){_r.call(this,new Int16Array(t),e,n)}function Tr(t,e,n){_r.call(this,new Uint16Array(t),e,n)}function Er(t,e,n){_r.call(this,new Int32Array(t),e,n)}function Ar(t,e,n){_r.call(this,new Uint32Array(t),e,n)}function Lr(t,e,n){_r.call(this,new Float32Array(t),e,n)}function Rr(t,e,n){_r.call(this,new Float64Array(t),e,n)}function Cr(){this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.uvs2=[],this.groups=[],this.morphTargets={},this.skinWeights=[],this.skinIndices=[],this.boundingBox=null,this.boundingSphere=null,this.verticesNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.uvsNeedUpdate=!1,this.groupsNeedUpdate=!1}function Pr(t){if(0===t.length)return-1/0;let e=t[0];for(let n=1,i=t.length;n<i;++n)t[n]>e&&(e=t[n]);return e}Object.defineProperty(_r.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(_r.prototype,{isBufferAttribute:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.name=t.name,this.array=new t.array.constructor(t.array),this.itemSize=t.itemSize,this.count=t.count,this.normalized=t.normalized,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.itemSize,n*=e.itemSize;for(let i=0,r=this.itemSize;i<r;i++)this.array[t+i]=e.array[n+i];return this},copyArray:function(t){return this.array.set(t),this},copyColorsArray:function(t){const e=this.array;let n=0;for(let i=0,r=t.length;i<r;i++){let r=t[i];void 0===r&&(console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined",i),r=new hr),e[n++]=r.r,e[n++]=r.g,e[n++]=r.b}return this},copyVector2sArray:function(t){const e=this.array;let n=0;for(let i=0,r=t.length;i<r;i++){let r=t[i];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined",i),r=new Nn),e[n++]=r.x,e[n++]=r.y}return this},copyVector3sArray:function(t){const e=this.array;let n=0;for(let i=0,r=t.length;i<r;i++){let r=t[i];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined",i),r=new Xn),e[n++]=r.x,e[n++]=r.y,e[n++]=r.z}return this},copyVector4sArray:function(t){const e=this.array;let n=0;for(let i=0,r=t.length;i<r;i++){let r=t[i];void 0===r&&(console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined",i),r=new Hn),e[n++]=r.x,e[n++]=r.y,e[n++]=r.z,e[n++]=r.w}return this},applyMatrix3:function(t){if(2===this.itemSize)for(let e=0,n=this.count;e<n;e++)xr.fromBufferAttribute(this,e),xr.applyMatrix3(t),this.setXY(e,xr.x,xr.y);else if(3===this.itemSize)for(let e=0,n=this.count;e<n;e++)yr.fromBufferAttribute(this,e),yr.applyMatrix3(t),this.setXYZ(e,yr.x,yr.y,yr.z);return this},applyMatrix4:function(t){for(let e=0,n=this.count;e<n;e++)yr.x=this.getX(e),yr.y=this.getY(e),yr.z=this.getZ(e),yr.applyMatrix4(t),this.setXYZ(e,yr.x,yr.y,yr.z);return this},applyNormalMatrix:function(t){for(let e=0,n=this.count;e<n;e++)yr.x=this.getX(e),yr.y=this.getY(e),yr.z=this.getZ(e),yr.applyNormalMatrix(t),this.setXYZ(e,yr.x,yr.y,yr.z);return this},transformDirection:function(t){for(let e=0,n=this.count;e<n;e++)yr.x=this.getX(e),yr.y=this.getY(e),yr.z=this.getZ(e),yr.transformDirection(t),this.setXYZ(e,yr.x,yr.y,yr.z);return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},getX:function(t){return this.array[t*this.itemSize]},setX:function(t,e){return this.array[t*this.itemSize]=e,this},getY:function(t){return this.array[t*this.itemSize+1]},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},getZ:function(t){return this.array[t*this.itemSize+2]},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},getW:function(t){return this.array[t*this.itemSize+3]},setW:function(t,e){return this.array[t*this.itemSize+3]=e,this},setXY:function(t,e,n){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this},setXYZ:function(t,e,n,i){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this},setXYZW:function(t,e,n,i,r){return t*=this.itemSize,this.array[t+0]=e,this.array[t+1]=n,this.array[t+2]=i,this.array[t+3]=r,this},onUpload:function(t){return this.onUploadCallback=t,this},clone:function(){return new this.constructor(this.array,this.itemSize).copy(this)},toJSON:function(){return{itemSize:this.itemSize,type:this.array.constructor.name,array:Array.prototype.slice.call(this.array),normalized:this.normalized}}}),br.prototype=Object.create(_r.prototype),br.prototype.constructor=br,wr.prototype=Object.create(_r.prototype),wr.prototype.constructor=wr,Mr.prototype=Object.create(_r.prototype),Mr.prototype.constructor=Mr,Sr.prototype=Object.create(_r.prototype),Sr.prototype.constructor=Sr,Tr.prototype=Object.create(_r.prototype),Tr.prototype.constructor=Tr,Er.prototype=Object.create(_r.prototype),Er.prototype.constructor=Er,Ar.prototype=Object.create(_r.prototype),Ar.prototype.constructor=Ar,Lr.prototype=Object.create(_r.prototype),Lr.prototype.constructor=Lr,Rr.prototype=Object.create(_r.prototype),Rr.prototype.constructor=Rr,Object.assign(Cr.prototype,{computeGroups:function(t){const e=[];let n,i,r=void 0;const o=t.faces;for(i=0;i<o.length;i++){const t=o[i];t.materialIndex!==r&&(r=t.materialIndex,void 0!==n&&(n.count=3*i-n.start,e.push(n)),n={start:3*i,materialIndex:r})}void 0!==n&&(n.count=3*i-n.start,e.push(n)),this.groups=e},fromGeometry:function(t){const e=t.faces,n=t.vertices,i=t.faceVertexUvs,r=i[0]&&i[0].length>0,o=i[1]&&i[1].length>0,s=t.morphTargets,a=s.length;let c;if(a>0){c=[];for(let t=0;t<a;t++)c[t]={name:s[t].name,data:[]};this.morphTargets.position=c}const l=t.morphNormals,h=l.length;let u;if(h>0){u=[];for(let t=0;t<h;t++)u[t]={name:l[t].name,data:[]};this.morphTargets.normal=u}const p=t.skinIndices,d=t.skinWeights,f=p.length===n.length,m=d.length===n.length;n.length>0&&0===e.length&&console.error("THREE.DirectGeometry: Faceless geometries are not supported.");for(let g=0;g<e.length;g++){const t=e[g];this.vertices.push(n[t.a],n[t.b],n[t.c]);const v=t.vertexNormals;if(3===v.length)this.normals.push(v[0],v[1],v[2]);else{const e=t.normal;this.normals.push(e,e,e)}const y=t.vertexColors;if(3===y.length)this.colors.push(y[0],y[1],y[2]);else{const e=t.color;this.colors.push(e,e,e)}if(!0===r){const t=i[0][g];void 0!==t?this.uvs.push(t[0],t[1],t[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ",g),this.uvs.push(new Nn,new Nn,new Nn))}if(!0===o){const t=i[1][g];void 0!==t?this.uvs2.push(t[0],t[1],t[2]):(console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ",g),this.uvs2.push(new Nn,new Nn,new Nn))}for(let e=0;e<a;e++){const n=s[e].vertices;c[e].data.push(n[t.a],n[t.b],n[t.c])}for(let e=0;e<h;e++){const t=l[e].vertexNormals[g];u[e].data.push(t.a,t.b,t.c)}f&&this.skinIndices.push(p[t.a],p[t.b],p[t.c]),m&&this.skinWeights.push(d[t.a],d[t.b],d[t.c])}return this.computeGroups(t),this.verticesNeedUpdate=t.verticesNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this}});let Or=1;const Dr=new ei,Ir=new xi,Nr=new Xn,Br=new Ii,Fr=new Ii,Ur=new Xn;function Gr(){Object.defineProperty(this,"id",{value:Or+=2}),this.uuid=In.generateUUID(),this.name="",this.type="BufferGeometry",this.index=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}Gr.prototype=Object.assign(Object.create(Pn.prototype),{constructor:Gr,isBufferGeometry:!0,getIndex:function(){return this.index},setIndex:function(t){Array.isArray(t)?this.index=new(Pr(t)>65535?Ar:Tr)(t,1):this.index=t},getAttribute:function(t){return this.attributes[t]},setAttribute:function(t,e){return this.attributes[t]=e,this},deleteAttribute:function(t){return delete this.attributes[t],this},addGroup:function(t,e,n){this.groups.push({start:t,count:e,materialIndex:void 0!==n?n:0})},clearGroups:function(){this.groups=[]},setDrawRange:function(t,e){this.drawRange.start=t,this.drawRange.count=e},applyMatrix4:function(t){const e=this.attributes.position;void 0!==e&&(e.applyMatrix4(t),e.needsUpdate=!0);const n=this.attributes.normal;if(void 0!==n){const e=(new Bn).getNormalMatrix(t);n.applyNormalMatrix(e),n.needsUpdate=!0}const i=this.attributes.tangent;return void 0!==i&&(i.transformDirection(t),i.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},rotateX:function(t){return Dr.makeRotationX(t),this.applyMatrix4(Dr),this},rotateY:function(t){return Dr.makeRotationY(t),this.applyMatrix4(Dr),this},rotateZ:function(t){return Dr.makeRotationZ(t),this.applyMatrix4(Dr),this},translate:function(t,e,n){return Dr.makeTranslation(t,e,n),this.applyMatrix4(Dr),this},scale:function(t,e,n){return Dr.makeScale(t,e,n),this.applyMatrix4(Dr),this},lookAt:function(t){return Ir.lookAt(t),Ir.updateMatrix(),this.applyMatrix4(Ir.matrix),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(Nr).negate(),this.translate(Nr.x,Nr.y,Nr.z),this},setFromObject:function(t){const e=t.geometry;if(t.isPoints||t.isLine){const t=new Lr(3*e.vertices.length,3),n=new Lr(3*e.colors.length,3);if(this.setAttribute("position",t.copyVector3sArray(e.vertices)),this.setAttribute("color",n.copyColorsArray(e.colors)),e.lineDistances&&e.lineDistances.length===e.vertices.length){const t=new Lr(e.lineDistances.length,1);this.setAttribute("lineDistance",t.copyArray(e.lineDistances))}null!==e.boundingSphere&&(this.boundingSphere=e.boundingSphere.clone()),null!==e.boundingBox&&(this.boundingBox=e.boundingBox.clone())}else t.isMesh&&e&&e.isGeometry&&this.fromGeometry(e);return this},setFromPoints:function(t){const e=[];for(let n=0,i=t.length;n<i;n++){const i=t[n];e.push(i.x,i.y,i.z||0)}return this.setAttribute("position",new Lr(e,3)),this},updateFromObject:function(t){let e=t.geometry;if(t.isMesh){let t=e.__directGeometry;if(!0===e.elementsNeedUpdate&&(t=void 0,e.elementsNeedUpdate=!1),void 0===t)return this.fromGeometry(e);t.verticesNeedUpdate=e.verticesNeedUpdate,t.normalsNeedUpdate=e.normalsNeedUpdate,t.colorsNeedUpdate=e.colorsNeedUpdate,t.uvsNeedUpdate=e.uvsNeedUpdate,t.groupsNeedUpdate=e.groupsNeedUpdate,e.verticesNeedUpdate=!1,e.normalsNeedUpdate=!1,e.colorsNeedUpdate=!1,e.uvsNeedUpdate=!1,e.groupsNeedUpdate=!1,e=t}if(!0===e.verticesNeedUpdate){const t=this.attributes.position;void 0!==t&&(t.copyVector3sArray(e.vertices),t.needsUpdate=!0),e.verticesNeedUpdate=!1}if(!0===e.normalsNeedUpdate){const t=this.attributes.normal;void 0!==t&&(t.copyVector3sArray(e.normals),t.needsUpdate=!0),e.normalsNeedUpdate=!1}if(!0===e.colorsNeedUpdate){const t=this.attributes.color;void 0!==t&&(t.copyColorsArray(e.colors),t.needsUpdate=!0),e.colorsNeedUpdate=!1}if(e.uvsNeedUpdate){const t=this.attributes.uv;void 0!==t&&(t.copyVector2sArray(e.uvs),t.needsUpdate=!0),e.uvsNeedUpdate=!1}if(e.lineDistancesNeedUpdate){const t=this.attributes.lineDistance;void 0!==t&&(t.copyArray(e.lineDistances),t.needsUpdate=!0),e.lineDistancesNeedUpdate=!1}return e.groupsNeedUpdate&&(e.computeGroups(t.geometry),this.groups=e.groups,e.groupsNeedUpdate=!1),this},fromGeometry:function(t){return t.__directGeometry=(new Cr).fromGeometry(t),this.fromDirectGeometry(t.__directGeometry)},fromDirectGeometry:function(t){const e=new Float32Array(3*t.vertices.length);if(this.setAttribute("position",new _r(e,3).copyVector3sArray(t.vertices)),t.normals.length>0){const e=new Float32Array(3*t.normals.length);this.setAttribute("normal",new _r(e,3).copyVector3sArray(t.normals))}if(t.colors.length>0){const e=new Float32Array(3*t.colors.length);this.setAttribute("color",new _r(e,3).copyColorsArray(t.colors))}if(t.uvs.length>0){const e=new Float32Array(2*t.uvs.length);this.setAttribute("uv",new _r(e,2).copyVector2sArray(t.uvs))}if(t.uvs2.length>0){const e=new Float32Array(2*t.uvs2.length);this.setAttribute("uv2",new _r(e,2).copyVector2sArray(t.uvs2))}this.groups=t.groups;for(const n in t.morphTargets){const e=[],i=t.morphTargets[n];for(let t=0,n=i.length;t<n;t++){const n=i[t],r=new Lr(3*n.data.length,3);r.name=n.name,e.push(r.copyVector3sArray(n.data))}this.morphAttributes[n]=e}if(t.skinIndices.length>0){const e=new Lr(4*t.skinIndices.length,4);this.setAttribute("skinIndex",e.copyVector4sArray(t.skinIndices))}if(t.skinWeights.length>0){const e=new Lr(4*t.skinWeights.length,4);this.setAttribute("skinWeight",e.copyVector4sArray(t.skinWeights))}return null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),this},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Ii);const t=this.attributes.position,e=this.morphAttributes.position;if(void 0!==t){if(this.boundingBox.setFromBufferAttribute(t),e)for(let n=0,i=e.length;n<i;n++){const t=e[n];Br.setFromBufferAttribute(t),this.morphTargetsRelative?(Ur.addVectors(this.boundingBox.min,Br.min),this.boundingBox.expandByPoint(Ur),Ur.addVectors(this.boundingBox.max,Br.max),this.boundingBox.expandByPoint(Ur)):(this.boundingBox.expandByPoint(Br.min),this.boundingBox.expandByPoint(Br.max))}}else 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(){null===this.boundingSphere&&(this.boundingSphere=new Fi);const t=this.attributes.position,e=this.morphAttributes.position;if(t){const n=this.boundingSphere.center;if(Br.setFromBufferAttribute(t),e)for(let t=0,r=e.length;t<r;t++){const n=e[t];Fr.setFromBufferAttribute(n),this.morphTargetsRelative?(Ur.addVectors(Br.min,Fr.min),Br.expandByPoint(Ur),Ur.addVectors(Br.max,Fr.max),Br.expandByPoint(Ur)):(Br.expandByPoint(Fr.min),Br.expandByPoint(Fr.max))}Br.getCenter(n);let i=0;for(let e=0,r=t.count;e<r;e++)Ur.fromBufferAttribute(t,e),i=Math.max(i,n.distanceToSquared(Ur));if(e)for(let r=0,o=e.length;r<o;r++){const o=e[r],s=this.morphTargetsRelative;for(let e=0,r=o.count;e<r;e++)Ur.fromBufferAttribute(o,e),s&&(Nr.fromBufferAttribute(t,e),Ur.add(Nr)),i=Math.max(i,n.distanceToSquared(Ur))}this.boundingSphere.radius=Math.sqrt(i),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}},computeFaceNormals:function(){},computeVertexNormals:function(){const t=this.index,e=this.getAttribute("position");if(void 0!==e){let n=this.getAttribute("normal");if(void 0===n)n=new _r(new Float32Array(3*e.count),3),this.setAttribute("normal",n);else for(let t=0,e=n.count;t<e;t++)n.setXYZ(t,0,0,0);const i=new Xn,r=new Xn,o=new Xn,s=new Xn,a=new Xn,c=new Xn,l=new Xn,h=new Xn;if(t)for(let u=0,p=t.count;u<p;u+=3){const p=t.getX(u+0),d=t.getX(u+1),f=t.getX(u+2);i.fromBufferAttribute(e,p),r.fromBufferAttribute(e,d),o.fromBufferAttribute(e,f),l.subVectors(o,r),h.subVectors(i,r),l.cross(h),s.fromBufferAttribute(n,p),a.fromBufferAttribute(n,d),c.fromBufferAttribute(n,f),s.add(l),a.add(l),c.add(l),n.setXYZ(p,s.x,s.y,s.z),n.setXYZ(d,a.x,a.y,a.z),n.setXYZ(f,c.x,c.y,c.z)}else for(let t=0,u=e.count;t<u;t+=3)i.fromBufferAttribute(e,t+0),r.fromBufferAttribute(e,t+1),o.fromBufferAttribute(e,t+2),l.subVectors(o,r),h.subVectors(i,r),l.cross(h),n.setXYZ(t+0,l.x,l.y,l.z),n.setXYZ(t+1,l.x,l.y,l.z),n.setXYZ(t+2,l.x,l.y,l.z);this.normalizeNormals(),n.needsUpdate=!0}},merge:function(t,e){if(!t||!t.isBufferGeometry)return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t);void 0===e&&(e=0,console.warn("THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge."));const n=this.attributes;for(const i in n){if(void 0===t.attributes[i])continue;const r=n[i].array,o=t.attributes[i],s=o.array,a=o.itemSize*e,c=Math.min(s.length,r.length-a);for(let t=0,e=a;t<c;t++,e++)r[e]=s[t]}return this},normalizeNormals:function(){const t=this.attributes.normal;for(let e=0,n=t.count;e<n;e++)Ur.fromBufferAttribute(t,e),Ur.normalize(),t.setXYZ(e,Ur.x,Ur.y,Ur.z)},toNonIndexed:function(){function t(t,e){const n=t.array,i=t.itemSize,r=t.normalized,o=new n.constructor(e.length*i);let s=0,a=0;for(let c=0,l=e.length;c<l;c++){s=e[c]*i;for(let t=0;t<i;t++)o[a++]=n[s++]}return new _r(o,i,r)}if(null===this.index)return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),this;const e=new Gr,n=this.index.array,i=this.attributes;for(const s in i){const r=t(i[s],n);e.setAttribute(s,r)}const r=this.morphAttributes;for(const s in r){const i=[],o=r[s];for(let e=0,r=o.length;e<r;e++){const r=t(o[e],n);i.push(r)}e.morphAttributes[s]=i}e.morphTargetsRelative=this.morphTargetsRelative;const o=this.groups;for(let s=0,a=o.length;s<a;s++){const t=o[s];e.addGroup(t.start,t.count,t.materialIndex)}return e},toJSON:function(){const t={metadata:{version:4.5,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),Object.keys(this.userData).length>0&&(t.userData=this.userData),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}t.data={attributes:{}};const e=this.index;null!==e&&(t.data.index={type:e.array.constructor.name,array:Array.prototype.slice.call(e.array)});const n=this.attributes;for(const a in n){const e=n[a],i=e.toJSON(t.data);""!==e.name&&(i.name=e.name),t.data.attributes[a]=i}const i={};let r=!1;for(const a in this.morphAttributes){const e=this.morphAttributes[a],n=[];for(let i=0,r=e.length;i<r;i++){const r=e[i],o=r.toJSON(t.data);""!==r.name&&(o.name=r.name),n.push(o)}n.length>0&&(i[a]=n,r=!0)}r&&(t.data.morphAttributes=i,t.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(t.data.groups=JSON.parse(JSON.stringify(o)));const s=this.boundingSphere;return null!==s&&(t.data.boundingSphere={center:s.center.toArray(),radius:s.radius}),t},clone:function(){return(new Gr).copy(this)},copy:function(t){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const e={};this.name=t.name;const n=t.index;null!==n&&this.setIndex(n.clone(e));const i=t.attributes;for(const c in i){const t=i[c];this.setAttribute(c,t.clone(e))}const r=t.morphAttributes;for(const c in r){const t=[],n=r[c];for(let i=0,r=n.length;i<r;i++)t.push(n[i].clone(e));this.morphAttributes[c]=t}this.morphTargetsRelative=t.morphTargetsRelative;const o=t.groups;for(let c=0,l=o.length;c<l;c++){const t=o[c];this.addGroup(t.start,t.count,t.materialIndex)}const s=t.boundingBox;null!==s&&(this.boundingBox=s.clone());const a=t.boundingSphere;return null!==a&&(this.boundingSphere=a.clone()),this.drawRange.start=t.drawRange.start,this.drawRange.count=t.drawRange.count,this.userData=t.userData,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});const zr=new ei,Hr=new Wi,kr=new Fi,Vr=new Xn,jr=new Xn,Wr=new Xn,qr=new Xn,Xr=new Xn,Yr=new Xn,Zr=new Xn,Jr=new Xn,Qr=new Xn,Kr=new Nn,$r=new Nn,to=new Nn,eo=new Xn,no=new Xn;function io(t,e){xi.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new Gr,this.material=void 0!==e?e:new vr,this.updateMorphTargets()}function ro(t,e,n,i,r,o,s,a){let c;if(null===(c=e.side===p?i.intersectTriangle(s,o,r,!0,a):i.intersectTriangle(r,o,s,e.side!==d,a)))return null;no.copy(a),no.applyMatrix4(t.matrixWorld);const l=n.ray.origin.distanceTo(no);return l<n.near||l>n.far?null:{distance:l,point:no.clone(),object:t}}function oo(t,e,n,i,r,o,s,a,c,l,h,u){Vr.fromBufferAttribute(r,l),jr.fromBufferAttribute(r,h),Wr.fromBufferAttribute(r,u);const p=t.morphTargetInfluences;if(e.morphTargets&&o&&p){Zr.set(0,0,0),Jr.set(0,0,0),Qr.set(0,0,0);for(let t=0,e=o.length;t<e;t++){const e=p[t],n=o[t];0!==e&&(qr.fromBufferAttribute(n,l),Xr.fromBufferAttribute(n,h),Yr.fromBufferAttribute(n,u),s?(Zr.addScaledVector(qr,e),Jr.addScaledVector(Xr,e),Qr.addScaledVector(Yr,e)):(Zr.addScaledVector(qr.sub(Vr),e),Jr.addScaledVector(Xr.sub(jr),e),Qr.addScaledVector(Yr.sub(Wr),e)))}Vr.add(Zr),jr.add(Jr),Wr.add(Qr)}t.isSkinnedMesh&&(t.boneTransform(l,Vr),t.boneTransform(h,jr),t.boneTransform(u,Wr));const d=ro(t,e,n,i,Vr,jr,Wr,eo);if(d){a&&(Kr.fromBufferAttribute(a,l),$r.fromBufferAttribute(a,h),to.fromBufferAttribute(a,u),d.uv=sr.getUV(eo,Vr,jr,Wr,Kr,$r,to,new Nn)),c&&(Kr.fromBufferAttribute(c,l),$r.fromBufferAttribute(c,h),to.fromBufferAttribute(c,u),d.uv2=sr.getUV(eo,Vr,jr,Wr,Kr,$r,to,new Nn));const t=new fr(l,h,u);sr.getNormal(Vr,jr,Wr,t.normal),d.face=t}return d}io.prototype=Object.assign(Object.create(xi.prototype),{constructor:io,isMesh:!0,copy:function(t){return xi.prototype.copy.call(this,t),void 0!==t.morphTargetInfluences&&(this.morphTargetInfluences=t.morphTargetInfluences.slice()),void 0!==t.morphTargetDictionary&&(this.morphTargetDictionary=Object.assign({},t.morphTargetDictionary)),this.material=t.material,this.geometry=t.geometry,this},updateMorphTargets:function(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e<n;e++){const n=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}}}else{const e=t.morphTargets;void 0!==e&&e.length>0&&console.error("THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.")}},raycast:function(t,e){const n=this.geometry,i=this.material,r=this.matrixWorld;if(void 0===i)return;if(null===n.boundingSphere&&n.computeBoundingSphere(),kr.copy(n.boundingSphere),kr.applyMatrix4(r),!1===t.ray.intersectsSphere(kr))return;if(zr.getInverse(r),Hr.copy(t.ray).applyMatrix4(zr),null!==n.boundingBox&&!1===Hr.intersectsBox(n.boundingBox))return;let o;if(n.isBufferGeometry){const r=n.index,s=n.attributes.position,a=n.morphAttributes.position,c=n.morphTargetsRelative,l=n.attributes.uv,h=n.attributes.uv2,u=n.groups,p=n.drawRange;if(null!==r)if(Array.isArray(i))for(let n=0,d=u.length;n<d;n++){const d=u[n],f=i[d.materialIndex];for(let n=Math.max(d.start,p.start),i=Math.min(d.start+d.count,p.start+p.count);n<i;n+=3){const i=r.getX(n),u=r.getX(n+1),p=r.getX(n+2);(o=oo(this,f,t,Hr,s,a,c,l,h,i,u,p))&&(o.faceIndex=Math.floor(n/3),o.face.materialIndex=d.materialIndex,e.push(o))}}else{for(let n=Math.max(0,p.start),u=Math.min(r.count,p.start+p.count);n<u;n+=3){const u=r.getX(n),p=r.getX(n+1),d=r.getX(n+2);(o=oo(this,i,t,Hr,s,a,c,l,h,u,p,d))&&(o.faceIndex=Math.floor(n/3),e.push(o))}}else if(void 0!==s)if(Array.isArray(i))for(let n=0,d=u.length;n<d;n++){const r=u[n],d=i[r.materialIndex];for(let n=Math.max(r.start,p.start),i=Math.min(r.start+r.count,p.start+p.count);n<i;n+=3){(o=oo(this,d,t,Hr,s,a,c,l,h,n,n+1,n+2))&&(o.faceIndex=Math.floor(n/3),o.face.materialIndex=r.materialIndex,e.push(o))}}else{for(let n=Math.max(0,p.start),r=Math.min(s.count,p.start+p.count);n<r;n+=3){(o=oo(this,i,t,Hr,s,a,c,l,h,n,n+1,n+2))&&(o.faceIndex=Math.floor(n/3),e.push(o))}}}else if(n.isGeometry){const r=Array.isArray(i),s=n.vertices,a=n.faces;let c;const l=n.faceVertexUvs[0];l.length>0&&(c=l);for(let n=0,h=a.length;n<h;n++){const l=a[n],h=r?i[l.materialIndex]:i;if(void 0===h)continue;const u=s[l.a],p=s[l.b],d=s[l.c];if(o=ro(this,h,t,Hr,u,p,d,eo)){if(c&&c[n]){const t=c[n];Kr.copy(t[0]),$r.copy(t[1]),to.copy(t[2]),o.uv=sr.getUV(eo,u,p,d,Kr,$r,to,new Nn)}o.face=l,o.faceIndex=n,e.push(o)}}}}});let so=0;const ao=new ei,co=new xi,lo=new Xn;function ho(){Object.defineProperty(this,"id",{value:so+=2}),this.uuid=In.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.elementsNeedUpdate=!1,this.verticesNeedUpdate=!1,this.uvsNeedUpdate=!1,this.normalsNeedUpdate=!1,this.colorsNeedUpdate=!1,this.lineDistancesNeedUpdate=!1,this.groupsNeedUpdate=!1}ho.prototype=Object.assign(Object.create(Pn.prototype),{constructor:ho,isGeometry:!0,applyMatrix4:function(t){const e=(new Bn).getNormalMatrix(t);for(let n=0,i=this.vertices.length;n<i;n++){this.vertices[n].applyMatrix4(t)}for(let n=0,i=this.faces.length;n<i;n++){const t=this.faces[n];t.normal.applyMatrix3(e).normalize();for(let n=0,i=t.vertexNormals.length;n<i;n++)t.vertexNormals[n].applyMatrix3(e).normalize()}return null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.verticesNeedUpdate=!0,this.normalsNeedUpdate=!0,this},rotateX:function(t){return ao.makeRotationX(t),this.applyMatrix4(ao),this},rotateY:function(t){return ao.makeRotationY(t),this.applyMatrix4(ao),this},rotateZ:function(t){return ao.makeRotationZ(t),this.applyMatrix4(ao),this},translate:function(t,e,n){return ao.makeTranslation(t,e,n),this.applyMatrix4(ao),this},scale:function(t,e,n){return ao.makeScale(t,e,n),this.applyMatrix4(ao),this},lookAt:function(t){return co.lookAt(t),co.updateMatrix(),this.applyMatrix4(co.matrix),this},fromBufferGeometry:function(t){const e=this,n=null!==t.index?t.index:void 0,i=t.attributes;if(void 0===i.position)return console.error("THREE.Geometry.fromBufferGeometry(): Position attribute required for conversion."),this;const r=i.position,o=i.normal,s=i.color,a=i.uv,c=i.uv2;void 0!==c&&(this.faceVertexUvs[1]=[]);for(let u=0;u<r.count;u++)e.vertices.push((new Xn).fromBufferAttribute(r,u)),void 0!==s&&e.colors.push((new hr).fromBufferAttribute(s,u));function l(t,n,i,r){const l=void 0===s?[]:[e.colors[t].clone(),e.colors[n].clone(),e.colors[i].clone()],h=new fr(t,n,i,void 0===o?[]:[(new Xn).fromBufferAttribute(o,t),(new Xn).fromBufferAttribute(o,n),(new Xn).fromBufferAttribute(o,i)],l,r);e.faces.push(h),void 0!==a&&e.faceVertexUvs[0].push([(new Nn).fromBufferAttribute(a,t),(new Nn).fromBufferAttribute(a,n),(new Nn).fromBufferAttribute(a,i)]),void 0!==c&&e.faceVertexUvs[1].push([(new Nn).fromBufferAttribute(c,t),(new Nn).fromBufferAttribute(c,n),(new Nn).fromBufferAttribute(c,i)])}const h=t.groups;if(h.length>0)for(let u=0;u<h.length;u++){const t=h[u],e=t.start;for(let i=e,r=e+t.count;i<r;i+=3)void 0!==n?l(n.getX(i),n.getX(i+1),n.getX(i+2),t.materialIndex):l(i,i+1,i+2,t.materialIndex)}else if(void 0!==n)for(let u=0;u<n.count;u+=3)l(n.getX(u),n.getX(u+1),n.getX(u+2));else for(let u=0;u<r.count;u+=3)l(u,u+1,u+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){return this.computeBoundingBox(),this.boundingBox.getCenter(lo).negate(),this.translate(lo.x,lo.y,lo.z),this},normalize:function(){this.computeBoundingSphere();const t=this.boundingSphere.center,e=this.boundingSphere.radius,n=0===e?1:1/e,i=new ei;return i.set(n,0,0,-n*t.x,0,n,0,-n*t.y,0,0,n,-n*t.z,0,0,0,1),this.applyMatrix4(i),this},computeFaceNormals:function(){const t=new Xn,e=new Xn;for(let n=0,i=this.faces.length;n<i;n++){const i=this.faces[n],r=this.vertices[i.a],o=this.vertices[i.b],s=this.vertices[i.c];t.subVectors(s,o),e.subVectors(r,o),t.cross(e),t.normalize(),i.normal.copy(t)}},computeVertexNormals:function(t){void 0===t&&(t=!0);const e=new Array(this.vertices.length);for(let n=0,i=this.vertices.length;n<i;n++)e[n]=new Xn;if(t){const t=new Xn,n=new Xn;for(let i=0,r=this.faces.length;i<r;i++){const r=this.faces[i],o=this.vertices[r.a],s=this.vertices[r.b],a=this.vertices[r.c];t.subVectors(a,s),n.subVectors(o,s),t.cross(n),e[r.a].add(t),e[r.b].add(t),e[r.c].add(t)}}else{this.computeFaceNormals();for(let t=0,n=this.faces.length;t<n;t++){const n=this.faces[t];e[n.a].add(n.normal),e[n.b].add(n.normal),e[n.c].add(n.normal)}}for(let n=0,i=this.vertices.length;n<i;n++)e[n].normalize();for(let n=0,i=this.faces.length;n<i;n++){const t=this.faces[n],i=t.vertexNormals;3===i.length?(i[0].copy(e[t.a]),i[1].copy(e[t.b]),i[2].copy(e[t.c])):(i[0]=e[t.a].clone(),i[1]=e[t.b].clone(),i[2]=e[t.c].clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeFlatVertexNormals:function(){this.computeFaceNormals();for(let t=0,e=this.faces.length;t<e;t++){const e=this.faces[t],n=e.vertexNormals;3===n.length?(n[0].copy(e.normal),n[1].copy(e.normal),n[2].copy(e.normal)):(n[0]=e.normal.clone(),n[1]=e.normal.clone(),n[2]=e.normal.clone())}this.faces.length>0&&(this.normalsNeedUpdate=!0)},computeMorphNormals:function(){for(let e=0,n=this.faces.length;e<n;e++){const t=this.faces[e];t.__originalFaceNormal?t.__originalFaceNormal.copy(t.normal):t.__originalFaceNormal=t.normal.clone(),t.__originalVertexNormals||(t.__originalVertexNormals=[]);for(let e=0,n=t.vertexNormals.length;e<n;e++)t.__originalVertexNormals[e]?t.__originalVertexNormals[e].copy(t.vertexNormals[e]):t.__originalVertexNormals[e]=t.vertexNormals[e].clone()}const t=new ho;t.faces=this.faces;for(let e=0,n=this.morphTargets.length;e<n;e++){if(!this.morphNormals[e]){this.morphNormals[e]={},this.morphNormals[e].faceNormals=[],this.morphNormals[e].vertexNormals=[];const t=this.morphNormals[e].faceNormals,n=this.morphNormals[e].vertexNormals;for(let e=0,i=this.faces.length;e<i;e++){const e=new Xn,i={a:new Xn,b:new Xn,c:new Xn};t.push(e),n.push(i)}}const n=this.morphNormals[e];t.vertices=this.morphTargets[e].vertices,t.computeFaceNormals(),t.computeVertexNormals();for(let t=0,e=this.faces.length;t<e;t++){const e=this.faces[t],i=n.faceNormals[t],r=n.vertexNormals[t];i.copy(e.normal),r.a.copy(e.vertexNormals[0]),r.b.copy(e.vertexNormals[1]),r.c.copy(e.vertexNormals[2])}}for(let e=0,n=this.faces.length;e<n;e++){const t=this.faces[e];t.normal=t.__originalFaceNormal,t.vertexNormals=t.__originalVertexNormals}},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new Ii),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new Fi),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,n){if(!t||!t.isGeometry)return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t);let i,r=this.vertices.length,o=this.vertices,s=t.vertices,a=this.faces,c=t.faces,l=this.colors,h=t.colors;void 0===n&&(n=0),void 0!==e&&(i=(new Bn).getNormalMatrix(e));for(let u=0,p=s.length;u<p;u++){const t=s[u].clone();void 0!==e&&t.applyMatrix4(e),o.push(t)}for(let u=0,p=h.length;u<p;u++)l.push(h[u].clone());for(let u=0,p=c.length;u<p;u++){let t,e,o,s=c[u],l=s.vertexNormals,h=s.vertexColors;(t=new fr(s.a+r,s.b+r,s.c+r)).normal.copy(s.normal),void 0!==i&&t.normal.applyMatrix3(i).normalize();for(let n=0,r=l.length;n<r;n++)e=l[n].clone(),void 0!==i&&e.applyMatrix3(i).normalize(),t.vertexNormals.push(e);t.color.copy(s.color);for(let n=0,i=h.length;n<i;n++)o=h[n],t.vertexColors.push(o.clone());t.materialIndex=s.materialIndex+n,a.push(t)}for(let u=0,p=t.faceVertexUvs.length;u<p;u++){const e=t.faceVertexUvs[u];void 0===this.faceVertexUvs[u]&&(this.faceVertexUvs[u]=[]);for(let t=0,n=e.length;t<n;t++){const n=e[t],i=[];for(let t=0,e=n.length;t<e;t++)i.push(n[t].clone());this.faceVertexUvs[u].push(i)}}},mergeMesh:function(t){t&&t.isMesh?(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix)):console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t)},mergeVertices:function(){const t={},e=[],n=[],i=Math.pow(10,4);for(let s=0,a=this.vertices.length;s<a;s++){const r=this.vertices[s],o=Math.round(r.x*i)+"_"+Math.round(r.y*i)+"_"+Math.round(r.z*i);void 0===t[o]?(t[o]=s,e.push(this.vertices[s]),n[s]=e.length-1):n[s]=n[t[o]]}const r=[];for(let s=0,a=this.faces.length;s<a;s++){const t=this.faces[s];t.a=n[t.a],t.b=n[t.b],t.c=n[t.c];const e=[t.a,t.b,t.c];for(let n=0;n<3;n++)if(e[n]===e[(n+1)%3]){r.push(s);break}}for(let s=r.length-1;s>=0;s--){const t=r[s];this.faces.splice(t,1);for(let e=0,n=this.faceVertexUvs.length;e<n;e++)this.faceVertexUvs[e].splice(t,1)}const o=this.vertices.length-e.length;return this.vertices=e,o},setFromPoints:function(t){this.vertices=[];for(let e=0,n=t.length;e<n;e++){const n=t[e];this.vertices.push(new Xn(n.x,n.y,n.z||0))}return this},sortFacesByMaterialIndex:function(){const t=this.faces,e=t.length;for(let s=0;s<e;s++)t[s]._id=s;t.sort(function(t,e){return t.materialIndex-e.materialIndex});const n=this.faceVertexUvs[0],i=this.faceVertexUvs[1];let r,o;n&&n.length===e&&(r=[]),i&&i.length===e&&(o=[]);for(let s=0;s<e;s++){const e=t[s]._id;r&&r.push(n[e]),o&&o.push(i[e])}r&&(this.faceVertexUvs[0]=r),o&&(this.faceVertexUvs[1]=o)},toJSON:function(){const t={metadata:{version:4.5,type:"Geometry",generator:"Geometry.toJSON"}};if(t.uuid=this.uuid,t.type=this.type,""!==this.name&&(t.name=this.name),void 0!==this.parameters){const e=this.parameters;for(const n in e)void 0!==e[n]&&(t[n]=e[n]);return t}const e=[];for(let d=0;d<this.vertices.length;d++){const t=this.vertices[d];e.push(t.x,t.y,t.z)}const n=[],i=[],r={},o=[],s={},a=[],c={};for(let d=0;d<this.faces.length;d++){const t=this.faces[d],e=!0,i=!1,r=void 0!==this.faceVertexUvs[0][d],o=t.normal.length()>0,s=t.vertexNormals.length>0,a=1!==t.color.r||1!==t.color.g||1!==t.color.b,c=t.vertexColors.length>0;let f=0;if(f=l(f,0,0),f=l(f,1,e),f=l(f,2,i),f=l(f,3,r),f=l(f,4,o),f=l(f,5,s),f=l(f,6,a),f=l(f,7,c),n.push(f),n.push(t.a,t.b,t.c),n.push(t.materialIndex),r){const t=this.faceVertexUvs[0][d];n.push(p(t[0]),p(t[1]),p(t[2]))}if(o&&n.push(h(t.normal)),s){const e=t.vertexNormals;n.push(h(e[0]),h(e[1]),h(e[2]))}if(a&&n.push(u(t.color)),c){const e=t.vertexColors;n.push(u(e[0]),u(e[1]),u(e[2]))}}function l(t,e,n){return n?t|1<<e:t&~(1<<e)}function h(t){const e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==r[e]?r[e]:(r[e]=i.length/3,i.push(t.x,t.y,t.z),r[e])}function u(t){const e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==s[e]?s[e]:(s[e]=o.length,o.push(t.getHex()),s[e])}function p(t){const e=t.x.toString()+t.y.toString();return void 0!==c[e]?c[e]:(c[e]=a.length/2,a.push(t.x,t.y),c[e])}return t.data={},t.data.vertices=e,t.data.normals=i,o.length>0&&(t.data.colors=o),a.length>0&&(t.data.uvs=[a]),t.data.faces=n,t},clone:function(){return(new ho).copy(this)},copy:function(t){this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingBox=null,this.boundingSphere=null,this.name=t.name;const e=t.vertices;for(let u=0,p=e.length;u<p;u++)this.vertices.push(e[u].clone());const n=t.colors;for(let u=0,p=n.length;u<p;u++)this.colors.push(n[u].clone());const i=t.faces;for(let u=0,p=i.length;u<p;u++)this.faces.push(i[u].clone());for(let u=0,p=t.faceVertexUvs.length;u<p;u++){const e=t.faceVertexUvs[u];void 0===this.faceVertexUvs[u]&&(this.faceVertexUvs[u]=[]);for(let t=0,n=e.length;t<n;t++){const n=e[t],i=[];for(let t=0,e=n.length;t<e;t++){const e=n[t];i.push(e.clone())}this.faceVertexUvs[u].push(i)}}const r=t.morphTargets;for(let u=0,p=r.length;u<p;u++){const t={};if(t.name=r[u].name,void 0!==r[u].vertices){t.vertices=[];for(let e=0,n=r[u].vertices.length;e<n;e++)t.vertices.push(r[u].vertices[e].clone())}if(void 0!==r[u].normals){t.normals=[];for(let e=0,n=r[u].normals.length;e<n;e++)t.normals.push(r[u].normals[e].clone())}this.morphTargets.push(t)}const o=t.morphNormals;for(let u=0,p=o.length;u<p;u++){const t={};if(void 0!==o[u].vertexNormals){t.vertexNormals=[];for(let e=0,n=o[u].vertexNormals.length;e<n;e++){const n=o[u].vertexNormals[e],i={};i.a=n.a.clone(),i.b=n.b.clone(),i.c=n.c.clone(),t.vertexNormals.push(i)}}if(void 0!==o[u].faceNormals){t.faceNormals=[];for(let e=0,n=o[u].faceNormals.length;e<n;e++)t.faceNormals.push(o[u].faceNormals[e].clone())}this.morphNormals.push(t)}const s=t.skinWeights;for(let u=0,p=s.length;u<p;u++)this.skinWeights.push(s[u].clone());const a=t.skinIndices;for(let u=0,p=a.length;u<p;u++)this.skinIndices.push(a[u].clone());const c=t.lineDistances;for(let u=0,p=c.length;u<p;u++)this.lineDistances.push(c[u]);const l=t.boundingBox;null!==l&&(this.boundingBox=l.clone());const h=t.boundingSphere;return null!==h&&(this.boundingSphere=h.clone()),this.elementsNeedUpdate=t.elementsNeedUpdate,this.verticesNeedUpdate=t.verticesNeedUpdate,this.uvsNeedUpdate=t.uvsNeedUpdate,this.normalsNeedUpdate=t.normalsNeedUpdate,this.colorsNeedUpdate=t.colorsNeedUpdate,this.lineDistancesNeedUpdate=t.lineDistancesNeedUpdate,this.groupsNeedUpdate=t.groupsNeedUpdate,this},dispose:function(){this.dispatchEvent({type:"dispose"})}});class uo extends ho{constructor(t,e,n,i,r,o){super(),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:o},this.fromBufferGeometry(new po(t,e,n,i,r,o)),this.mergeVertices()}}exports.CubeGeometry=exports.BoxGeometry=uo;class po extends Gr{constructor(t=1,e=1,n=1,i=1,r=1,o=1){super(),this.type="BoxBufferGeometry",this.parameters={width:t,height:e,depth:n,widthSegments:i,heightSegments:r,depthSegments:o};const s=this;i=Math.floor(i),r=Math.floor(r),o=Math.floor(o);const a=[],c=[],l=[],h=[];let u=0,p=0;function d(t,e,n,i,r,o,d,f,m,g,v){const y=o/m,x=d/g,_=o/2,b=d/2,w=f/2,M=m+1,S=g+1;let T=0,E=0;const A=new Xn;for(let s=0;s<S;s++){const o=s*x-b;for(let a=0;a<M;a++){const u=a*y-_;A[t]=u*i,A[e]=o*r,A[n]=w,c.push(A.x,A.y,A.z),A[t]=0,A[e]=0,A[n]=f>0?1:-1,l.push(A.x,A.y,A.z),h.push(a/m),h.push(1-s/g),T+=1}}for(let s=0;s<g;s++)for(let t=0;t<m;t++){const e=u+t+M*s,n=u+t+M*(s+1),i=u+(t+1)+M*(s+1),r=u+(t+1)+M*s;a.push(e,n,r),a.push(n,i,r),E+=6}s.addGroup(p,E,v),p+=E,u+=T}d("z","y","x",-1,-1,n,e,t,o,r,0),d("z","y","x",1,-1,n,e,-t,o,r,1),d("x","z","y",1,1,t,n,e,i,o,2),d("x","z","y",1,-1,t,n,-e,i,o,3),d("x","y","z",1,-1,t,e,n,i,r,4),d("x","y","z",-1,-1,t,e,-n,i,r,5),this.setIndex(a),this.setAttribute("position",new Lr(c,3)),this.setAttribute("normal",new Lr(l,3)),this.setAttribute("uv",new Lr(h,2))}}function fo(t){const e={};for(const n in t){e[n]={};for(const i in t[n]){const r=t[n][i];r&&(r.isColor||r.isMatrix3||r.isMatrix4||r.isVector2||r.isVector3||r.isVector4||r.isTexture)?e[n][i]=r.clone():Array.isArray(r)?e[n][i]=r.slice():e[n][i]=r}}return e}function mo(t){const e={};for(let n=0;n<t.length;n++){const i=fo(t[n]);for(const t in i)e[t]=i[t]}return e}exports.BoxBufferGeometry=po;const go={clone:fo,merge:mo};exports.UniformsUtils=go;var vo="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",yo="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}";function xo(t){gr.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.vertexShader=vo,this.fragmentShader=yo,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.extensions={derivatives:!1,fragDepth:!1,drawBuffers:!1,shaderTextureLOD:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,void 0!==t&&(void 0!==t.attributes&&console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),this.setValues(t))}function _o(){xi.call(this),this.type="Camera",this.matrixWorldInverse=new ei,this.projectionMatrix=new ei,this.projectionMatrixInverse=new ei}function bo(t,e,n,i){_o.call(this),this.type="PerspectiveCamera",this.fov=void 0!==t?t:50,this.zoom=1,this.near=void 0!==n?n:.1,this.far=void 0!==i?i:2e3,this.focus=10,this.aspect=void 0!==e?e:1,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}xo.prototype=Object.create(gr.prototype),xo.prototype.constructor=xo,xo.prototype.isShaderMaterial=!0,xo.prototype.copy=function(t){return gr.prototype.copy.call(this,t),this.fragmentShader=t.fragmentShader,this.vertexShader=t.vertexShader,this.uniforms=fo(t.uniforms),this.defines=Object.assign({},t.defines),this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.lights=t.lights,this.clipping=t.clipping,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.extensions=Object.assign({},t.extensions),this},xo.prototype.toJSON=function(t){const e=gr.prototype.toJSON.call(this,t);e.uniforms={};for(const i in this.uniforms){const n=this.uniforms[i].value;n&&n.isTexture?e.uniforms[i]={type:"t",value:n.toJSON(t).uuid}:n&&n.isColor?e.uniforms[i]={type:"c",value:n.getHex()}:n&&n.isVector2?e.uniforms[i]={type:"v2",value:n.toArray()}:n&&n.isVector3?e.uniforms[i]={type:"v3",value:n.toArray()}:n&&n.isVector4?e.uniforms[i]={type:"v4",value:n.toArray()}:n&&n.isMatrix3?e.uniforms[i]={type:"m3",value:n.toArray()}:n&&n.isMatrix4?e.uniforms[i]={type:"m4",value:n.toArray()}:e.uniforms[i]={value:n}}Object.keys(this.defines).length>0&&(e.defines=this.defines),e.vertexShader=this.vertexShader,e.fragmentShader=this.fragmentShader;const n={};for(const i in this.extensions)!0===this.extensions[i]&&(n[i]=!0);return Object.keys(n).length>0&&(e.extensions=n),e},_o.prototype=Object.assign(Object.create(xi.prototype),{constructor:_o,isCamera:!0,copy:function(t,e){return xi.prototype.copy.call(this,t,e),this.matrixWorldInverse.copy(t.matrixWorldInverse),this.projectionMatrix.copy(t.projectionMatrix),this.projectionMatrixInverse.copy(t.projectionMatrixInverse),this},getWorldDirection:function(t){void 0===t&&(console.warn("THREE.Camera: .getWorldDirection() target is now required"),t=new Xn),this.updateMatrixWorld(!0);const e=this.matrixWorld.elements;return t.set(-e[8],-e[9],-e[10]).normalize()},updateMatrixWorld:function(t){xi.prototype.updateMatrixWorld.call(this,t),this.matrixWorldInverse.getInverse(this.matrixWorld)},updateWorldMatrix:function(t,e){xi.prototype.updateWorldMatrix.call(this,t,e),this.matrixWorldInverse.getInverse(this.matrixWorld)},clone:function(){return(new this.constructor).copy(this)}}),bo.prototype=Object.assign(Object.create(_o.prototype),{constructor:bo,isPerspectiveCamera:!0,copy:function(t,e){return _o.prototype.copy.call(this,t,e),this.fov=t.fov,this.zoom=t.zoom,this.near=t.near,this.far=t.far,this.focus=t.focus,this.aspect=t.aspect,this.view=null===t.view?null:Object.assign({},t.view),this.filmGauge=t.filmGauge,this.filmOffset=t.filmOffset,this},setFocalLength:function(t){const e=.5*this.getFilmHeight()/t;this.fov=2*In.RAD2DEG*Math.atan(e),this.updateProjectionMatrix()},getFocalLength:function(){const t=Math.tan(.5*In.DEG2RAD*this.fov);return.5*this.getFilmHeight()/t},getEffectiveFOV:function(){return 2*In.RAD2DEG*Math.atan(Math.tan(.5*In.DEG2RAD*this.fov)/this.zoom)},getFilmWidth:function(){return this.filmGauge*Math.min(this.aspect,1)},getFilmHeight:function(){return this.filmGauge/Math.max(this.aspect,1)},setViewOffset:function(t,e,n,i,r,o){this.aspect=t/e,null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){let t=this.near,e=t*Math.tan(.5*In.DEG2RAD*this.fov)/this.zoom,n=2*e,i=this.aspect*n,r=-.5*i,o=this.view;if(null!==this.view&&this.view.enabled){const t=o.fullWidth,s=o.fullHeight;r+=o.offsetX*i/t,e-=o.offsetY*n/s,i*=o.width/t,n*=o.height/s}const s=this.filmOffset;0!==s&&(r+=t*s/this.getFilmWidth()),this.projectionMatrix.makePerspective(r,r+i,e,e-n,t,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){const e=xi.prototype.toJSON.call(this,t);return e.object.fov=this.fov,e.object.zoom=this.zoom,e.object.near=this.near,e.object.far=this.far,e.object.focus=this.focus,e.object.aspect=this.aspect,null!==this.view&&(e.object.view=Object.assign({},this.view)),e.object.filmGauge=this.filmGauge,e.object.filmOffset=this.filmOffset,e}});const wo=90,Mo=1;function So(t,e,n){if(xi.call(this),this.type="CubeCamera",!0!==n.isWebGLCubeRenderTarget)return void console.error("THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.");this.renderTarget=n;const i=new bo(wo,Mo,t,e);i.layers=this.layers,i.up.set(0,-1,0),i.lookAt(new Xn(1,0,0)),this.add(i);const r=new bo(wo,Mo,t,e);r.layers=this.layers,r.up.set(0,-1,0),r.lookAt(new Xn(-1,0,0)),this.add(r);const o=new bo(wo,Mo,t,e);o.layers=this.layers,o.up.set(0,0,1),o.lookAt(new Xn(0,1,0)),this.add(o);const s=new bo(wo,Mo,t,e);s.layers=this.layers,s.up.set(0,0,-1),s.lookAt(new Xn(0,-1,0)),this.add(s);const a=new bo(wo,Mo,t,e);a.layers=this.layers,a.up.set(0,-1,0),a.lookAt(new Xn(0,0,1)),this.add(a);const c=new bo(wo,Mo,t,e);c.layers=this.layers,c.up.set(0,-1,0),c.lookAt(new Xn(0,0,-1)),this.add(c),this.update=function(t,e){null===this.parent&&this.updateMatrixWorld();const l=t.xr.enabled,h=t.getRenderTarget();t.xr.enabled=!1;const u=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,t.setRenderTarget(n,0),t.render(e,i),t.setRenderTarget(n,1),t.render(e,r),t.setRenderTarget(n,2),t.render(e,o),t.setRenderTarget(n,3),t.render(e,s),t.setRenderTarget(n,4),t.render(e,a),n.texture.generateMipmaps=u,t.setRenderTarget(n,5),t.render(e,c),t.setRenderTarget(h),t.xr.enabled=l},this.clear=function(t,e,i,r){const o=t.getRenderTarget();for(let s=0;s<6;s++)t.setRenderTarget(n,s),t.clear(e,i,r);t.setRenderTarget(o)}}function To(t,e,n){Number.isInteger(e)&&(console.warn("THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )"),e=n),kn.call(this,t,t,e)}function Eo(t,e,n,i,r,o,s,a,c,l,h,u){zn.call(this,null,o,s,a,c,l,i,r,h,u),this.image={data:t||null,width:e||1,height:n||1},this.magFilter=void 0!==c?c:ut,this.minFilter=void 0!==l?l:ut,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.needsUpdate=!0}So.prototype=Object.create(xi.prototype),So.prototype.constructor=So,To.prototype=Object.create(kn.prototype),To.prototype.constructor=To,To.prototype.isWebGLCubeRenderTarget=!0,To.prototype.fromEquirectangularTexture=function(t,e){this.texture.type=e.type,this.texture.format=Nt,this.texture.encoding=e.encoding,this.texture.generateMipmaps=e.generateMipmaps,this.texture.minFilter=e.minFilter,this.texture.magFilter=e.magFilter;const n=new _i,i={uniforms:{tEquirect:{value:null}},vertexShader:"\n\n\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t#include <begin_vertex>\n\t\t\t\t#include <project_vertex>\n\n\t\t\t}\n\t\t",fragmentShader:"\n\n\t\t\tuniform sampler2D tEquirect;\n\n\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t}\n\t\t"},r=new xo({name:"CubemapFromEquirect",uniforms:fo(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:p,blending:g});r.uniforms.tEquirect.value=e;const o=new io(new po(5,5,5),r);return n.add(o),new So(1,10,this).update(t,n),o.geometry.dispose(),o.material.dispose(),this},Eo.prototype=Object.create(zn.prototype),Eo.prototype.constructor=Eo,Eo.prototype.isDataTexture=!0;const Ao=new Fi,Lo=new Xn;function Ro(t,e,n,i,r,o){this.planes=[void 0!==t?t:new Zi,void 0!==e?e:new Zi,void 0!==n?n:new Zi,void 0!==i?i:new Zi,void 0!==r?r:new Zi,void 0!==o?o:new Zi]}Object.assign(Ro.prototype,{set:function(t,e,n,i,r,o){const s=this.planes;return s[0].copy(t),s[1].copy(e),s[2].copy(n),s[3].copy(i),s[4].copy(r),s[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){const e=this.planes;for(let n=0;n<6;n++)e[n].copy(t.planes[n]);return this},setFromProjectionMatrix:function(t){const e=this.planes,n=t.elements,i=n[0],r=n[1],o=n[2],s=n[3],a=n[4],c=n[5],l=n[6],h=n[7],u=n[8],p=n[9],d=n[10],f=n[11],m=n[12],g=n[13],v=n[14],y=n[15];return e[0].setComponents(s-i,h-a,f-u,y-m).normalize(),e[1].setComponents(s+i,h+a,f+u,y+m).normalize(),e[2].setComponents(s+r,h+c,f+p,y+g).normalize(),e[3].setComponents(s-r,h-c,f-p,y-g).normalize(),e[4].setComponents(s-o,h-l,f-d,y-v).normalize(),e[5].setComponents(s+o,h+l,f+d,y+v).normalize(),this},intersectsObject:function(t){const e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Ao.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Ao)},intersectsSprite:function(t){return Ao.center.set(0,0,0),Ao.radius=.7071067811865476,Ao.applyMatrix4(t.matrixWorld),this.intersectsSphere(Ao)},intersectsSphere:function(t){const e=this.planes,n=t.center,i=-t.radius;for(let r=0;r<6;r++){if(e[r].distanceToPoint(n)<i)return!1}return!0},intersectsBox:function(t){const e=this.planes;for(let n=0;n<6;n++){const i=e[n];if(Lo.x=i.normal.x>0?t.max.x:t.min.x,Lo.y=i.normal.y>0?t.max.y:t.min.y,Lo.z=i.normal.z>0?t.max.z:t.min.z,i.distanceToPoint(Lo)<0)return!1}return!0},containsPoint:function(t){const e=this.planes;for(let n=0;n<6;n++)if(e[n].distanceToPoint(t)<0)return!1;return!0}});const Co={common:{diffuse:{value:new hr(15658734)},opacity:{value:1},map:{value:null},uvTransform:{value:new Bn},uv2Transform:{value:new Bn},alphaMap:{value:null}},specularmap:{specularMap:{value:null}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},refractionRatio:{value:.98},maxMipLevel:{value:0}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1}},emissivemap:{emissiveMap:{value:null}},bumpmap:{bumpMap:{value:null},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalScale:{value:new Nn(1,1)}},displacementmap:{displacementMap:{value:null},displacementScale:{value:1},displacementBias:{value:0}},roughnessmap:{roughnessMap:{value:null}},metalnessmap:{metalnessMap:{value:null}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new hr(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotShadowMap:{value:[]},spotShadowMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}}},points:{diffuse:{value:new hr(15658734)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Bn}},sprite:{diffuse:{value:new hr(15658734)},opacity:{value:1},center:{value:new Nn(.5,.5)},rotation:{value:0},map:{value:null},alphaMap:{value:null},uvTransform:{value:new Bn}}};function Po(){let t=null,e=!1,n=null,i=null;function r(e,o){n(e,o),i=t.requestAnimationFrame(r)}return{start:function(){!0!==e&&null!==n&&(i=t.requestAnimationFrame(r),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(t){n=t},setContext:function(e){t=e}}}function Oo(t,e){const n=e.isWebGL2,i=new WeakMap;return{get:function(t){return t.isInterleavedBufferAttribute&&(t=t.data),i.get(t)},remove:function(e){e.isInterleavedBufferAttribute&&(e=e.data);const n=i.get(e);n&&(t.deleteBuffer(n.buffer),i.delete(e))},update:function(e,r){e.isInterleavedBufferAttribute&&(e=e.data);const o=i.get(e);void 0===o?i.set(e,function(e,n){const i=e.array,r=e.usage,o=t.createBuffer();t.bindBuffer(n,o),t.bufferData(n,i,r),e.onUploadCallback();let s=5126;return i instanceof Float32Array?s=5126:i instanceof Float64Array?console.warn("THREE.WebGLAttributes: Unsupported data buffer format: Float64Array."):i instanceof Uint16Array?s=5123:i instanceof Int16Array?s=5122:i instanceof Uint32Array?s=5125:i instanceof Int32Array?s=5124:i instanceof Int8Array?s=5120:i instanceof Uint8Array&&(s=5121),{buffer:o,type:s,bytesPerElement:i.BYTES_PER_ELEMENT,version:e.version}}(e,r)):o.version<e.version&&(function(e,i,r){const o=i.array,s=i.updateRange;t.bindBuffer(r,e),-1===s.count?t.bufferSubData(r,0,o):(n?t.bufferSubData(r,s.offset*o.BYTES_PER_ELEMENT,o,s.offset,s.count):t.bufferSubData(r,s.offset*o.BYTES_PER_ELEMENT,o.subarray(s.offset,s.offset+s.count)),s.count=-1)}(o.buffer,e,r),o.version=e.version)}}}function Do(t,e,n,i){ho.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i},this.fromBufferGeometry(new Io(t,e,n,i)),this.mergeVertices()}function Io(t,e,n,i){Gr.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:n,heightSegments:i};const r=(t=t||1)/2,o=(e=e||1)/2,s=Math.floor(n)||1,a=Math.floor(i)||1,c=s+1,l=a+1,h=t/s,u=e/a,p=[],d=[],f=[],m=[];for(let g=0;g<l;g++){const t=g*u-o;for(let e=0;e<c;e++){const n=e*h-r;d.push(n,-t,0),f.push(0,0,1),m.push(e/s),m.push(1-g/a)}}for(let g=0;g<a;g++)for(let t=0;t<s;t++){const e=t+c*g,n=t+c*(g+1),i=t+1+c*(g+1),r=t+1+c*g;p.push(e,n,r),p.push(n,i,r)}this.setIndex(p),this.setAttribute("position",new Lr(d,3)),this.setAttribute("normal",new Lr(f,3)),this.setAttribute("uv",new Lr(m,2))}exports.UniformsLib=Co,Do.prototype=Object.create(ho.prototype),Do.prototype.constructor=Do,Io.prototype=Object.create(Gr.prototype),Io.prototype.constructor=Io;var No="#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif",Bo="#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",Fo="#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif",Uo="#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif",Go="#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",zo="vec3 transformed = vec3( position );",Ho="vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif",ko="vec2 integrateSpecularBRDF( const in float dotNV, const in float roughness ) {\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\treturn vec2( -1.04, 1.04 ) * a004 + r.zw;\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n#else\n\tif( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t}\n\treturn 1.0;\n#endif\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nvec3 F_Schlick_RoughnessDependent( const in vec3 F0, const in float dotNV, const in float roughness ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotNV - 6.98316 ) * dotNV );\n\tvec3 Fr = max( vec3( 1.0 - roughness ), F0 ) - F0;\n\treturn Fr * fresnel + F0;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat G_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + viewDir );\n\tfloat dotNL = saturate( dot( normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nvec3 BRDF_Specular_GGX_Environment( const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\treturn specularColor * brdf.x + brdf.y;\n}\nvoid BRDF_Specular_Multiscattering_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tvec3 F = F_Schlick_RoughnessDependent( specularColor, dotNV, roughness );\n\tvec2 brdf = integrateSpecularBRDF( dotNV, roughness );\n\tvec3 FssEss = F * brdf.x + brdf.y;\n\tfloat Ess = brdf.x + brdf.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie(float roughness, float NoH) {\n\tfloat invAlpha = 1.0 / roughness;\n\tfloat cos2h = NoH * NoH;\n\tfloat sin2h = max(1.0 - cos2h, 0.0078125);\treturn (2.0 + invAlpha) * pow(sin2h, invAlpha * 0.5) / (2.0 * PI);\n}\nfloat V_Neubelt(float NoV, float NoL) {\n\treturn saturate(1.0 / (4.0 * (NoL + NoV - NoL * NoV)));\n}\nvec3 BRDF_Specular_Sheen( const in float roughness, const in vec3 L, const in GeometricContext geometry, vec3 specularColor ) {\n\tvec3 N = geometry.normal;\n\tvec3 V = geometry.viewDir;\n\tvec3 H = normalize( V + L );\n\tfloat dotNH = saturate( dot( N, H ) );\n\treturn specularColor * D_Charlie( roughness, dotNH ) * V_Neubelt( dot(N, V), dot(N, L) );\n}\n#endif",Vo="#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",jo="#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif",Wo="#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif",qo="#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n#endif",Xo="#if NUM_CLIPPING_PLANES > 0\n\tvClipPosition = - mvPosition.xyz;\n#endif",Yo="#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",Zo="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",Jo="#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",Qo="#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",Ko="#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract(sin(sn) * c);\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat max3( vec3 v ) { return max( max( v.x, v.y ), v.z ); }\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}",$o="#ifdef ENVMAP_TYPE_CUBE_UV\n#define cubeUV_maxMipLevel 8.0\n#define cubeUV_minMipLevel 4.0\n#define cubeUV_maxTileSize 256.0\n#define cubeUV_minTileSize 16.0\nfloat getFace(vec3 direction) {\n vec3 absDirection = abs(direction);\n float face = -1.0;\n if (absDirection.x > absDirection.z) {\n if (absDirection.x > absDirection.y)\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if (absDirection.z > absDirection.y)\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n}\nvec2 getUV(vec3 direction, float face) {\n vec2 uv;\n if (face == 0.0) {\n uv = vec2(direction.z, direction.y) / abs(direction.x); } else if (face == 1.0) {\n uv = vec2(-direction.x, -direction.z) / abs(direction.y); } else if (face == 2.0) {\n uv = vec2(-direction.x, direction.y) / abs(direction.z); } else if (face == 3.0) {\n uv = vec2(-direction.z, direction.y) / abs(direction.x); } else if (face == 4.0) {\n uv = vec2(-direction.x, direction.z) / abs(direction.y); } else {\n uv = vec2(direction.x, direction.y) / abs(direction.z); }\n return 0.5 * (uv + 1.0);\n}\nvec3 bilinearCubeUV(sampler2D envMap, vec3 direction, float mipInt) {\n float face = getFace(direction);\n float filterInt = max(cubeUV_minMipLevel - mipInt, 0.0);\n mipInt = max(mipInt, cubeUV_minMipLevel);\n float faceSize = exp2(mipInt);\n float texelSize = 1.0 / (3.0 * cubeUV_maxTileSize);\n vec2 uv = getUV(direction, face) * (faceSize - 1.0);\n vec2 f = fract(uv);\n uv += 0.5 - f;\n if (face > 2.0) {\n uv.y += faceSize;\n face -= 3.0;\n }\n uv.x += face * faceSize;\n if(mipInt < cubeUV_maxMipLevel){\n uv.y += 2.0 * cubeUV_maxTileSize;\n }\n uv.y += filterInt * 2.0 * cubeUV_minTileSize;\n uv.x += 3.0 * max(0.0, cubeUV_maxTileSize - 2.0 * faceSize);\n uv *= texelSize;\n vec3 tl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x += texelSize;\n vec3 tr = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.y += texelSize;\n vec3 br = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n uv.x -= texelSize;\n vec3 bl = envMapTexelToLinear(texture2D(envMap, uv)).rgb;\n vec3 tm = mix(tl, tr, f.x);\n vec3 bm = mix(bl, br, f.x);\n return mix(tm, bm, f.y);\n}\n#define r0 1.0\n#define v0 0.339\n#define m0 -2.0\n#define r1 0.8\n#define v1 0.276\n#define m1 -1.0\n#define r4 0.4\n#define v4 0.046\n#define m4 2.0\n#define r5 0.305\n#define v5 0.016\n#define m5 3.0\n#define r6 0.21\n#define v6 0.0038\n#define m6 4.0\nfloat roughnessToMip(float roughness) {\n float mip = 0.0;\n if (roughness >= r1) {\n mip = (r0 - roughness) * (m1 - m0) / (r0 - r1) + m0;\n } else if (roughness >= r4) {\n mip = (r1 - roughness) * (m4 - m1) / (r1 - r4) + m1;\n } else if (roughness >= r5) {\n mip = (r4 - roughness) * (m5 - m4) / (r4 - r5) + m4;\n } else if (roughness >= r6) {\n mip = (r5 - roughness) * (m6 - m5) / (r5 - r6) + m5;\n } else {\n mip = -2.0 * log2(1.16 * roughness); }\n return mip;\n}\nvec4 textureCubeUV(sampler2D envMap, vec3 sampleDir, float roughness) {\n float mip = clamp(roughnessToMip(roughness), m0, cubeUV_maxMipLevel);\n float mipF = fract(mip);\n float mipInt = floor(mip);\n vec3 color0 = bilinearCubeUV(envMap, sampleDir, mipInt);\n if (mipF == 0.0) {\n return vec4(color0, 1.0);\n } else {\n vec3 color1 = bilinearCubeUV(envMap, sampleDir, mipInt + 1.0);\n return vec4(mix(color0, color1, mipF), 1.0);\n }\n}\n#endif",ts="vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif",es="#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif",ns="#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\n#endif",is="#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif",rs="#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif",os="gl_FragColor = linearToOutputTexel( gl_FragColor );",ss="\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n\tfloat maxComponent = max( max( value.r, value.g ), value.b );\n\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n\tM = ceil( M * 255.0 ) / 255.0;\n\treturn vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\n\tfloat D = max( maxRange / maxRGB, 1.0 );\n\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\n\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\n\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\n\tvec4 vResult;\n\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n\tvResult.w = fract( Le );\n\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\n\treturn vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n\tfloat Le = value.z * 255.0 + value.w;\n\tvec3 Xp_Y_XYZp;\n\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\n\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\n\treturn vec4( max( vRGB, 0.0 ), 1.0 );\n}",as="#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\t\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\treflectVec = normalize( reflectVec );\n\t\tvec2 sampleUV = equirectUv( reflectVec );\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifndef ENVMAP_TYPE_CUBE_UV\n\t\tenvColor = envMapTexelToLinear( envColor );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif",cs="#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform int maxMipLevel;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif",ls="#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif",hs="#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\t\n\t\tvarying vec3 vWorldPosition;\n\t#else\n\t\tvarying vec3 vReflect;\n\t\tuniform float refractionRatio;\n\t#endif\n#endif",us="#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvWorldPosition = worldPosition.xyz;\n\t#else\n\t\tvec3 cameraToVertex;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#endif\n#endif",ps="#ifdef USE_FOG\n\tfogDepth = - mvPosition.z;\n#endif",ds="#ifdef USE_FOG\n\tvarying float fogDepth;\n#endif",fs="#ifdef USE_FOG\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * fogDepth * fogDepth );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, fogDepth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif",ms="#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",gs="#ifdef USE_GRADIENTMAP\n\tuniform sampler2D gradientMap;\n#endif\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\n\tfloat dotNL = dot( normal, lightDirection );\n\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\n\t#ifdef USE_GRADIENTMAP\n\t\treturn texture2D( gradientMap, coord ).rgb;\n\t#else\n\t\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\n\t#endif\n}",vs="#ifdef USE_LIGHTMAP\n\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\treflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n#endif",ys="#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",xs="vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\nvIndirectFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n\tvIndirectBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry );\n#ifdef DOUBLE_SIDED\n\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\n\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry );\n#endif\n#if NUM_POINT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tgetPointDirectLightIrradiance( pointLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tgetSpotDirectLightIrradiance( spotLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_DIR_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tgetDirectionalDirectLightIrradiance( directionalLights[ i ], geometry, directLight );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n\t#pragma unroll_loop_end\n#endif",_s="uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in GeometricContext geometry ) {\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tdirectLight.color = pointLight.color;\n\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\tdirectLight.visible = ( directLight.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight directLight ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( angleCos > spotLight.coneCos ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif",bs="#if defined( USE_ENVMAP )\n\t#ifdef ENVMAP_MODE_REFRACTION\n\t\tuniform float refractionRatio;\n\t#endif\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float roughness, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat sigma = PI * roughness * roughness / ( 1.0 + roughness );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar + log2( sigma );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t vec3 reflectVec = reflect( -viewDir, normal );\n\t\t reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t#else\n\t\t vec3 reflectVec = refract( -viewDir, normal, refractionRatio );\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( roughness, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV = equirectUv( reflectVec );\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#endif\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif",ws="ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;",Ms="varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)",Ss="BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;",Ts="varying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)",Es="PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.specularRoughness = max( roughnessFactor, 0.0525 );material.specularRoughness += geometryRoughness;\nmaterial.specularRoughness = min( material.specularRoughness, 1.0 );\n#ifdef REFLECTIVITY\n\tmaterial.specularColor = mix( vec3( MAXIMUM_SPECULAR_COEFFICIENT * pow2( reflectivity ) ), diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( DEFAULT_SPECULAR_COEFFICIENT ), diffuseColor.rgb, metalnessFactor );\n#endif\n#ifdef CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheen;\n#endif",As="struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat specularRoughness;\n\tvec3 specularColor;\n#ifdef CLEARCOAT\n\tfloat clearcoat;\n\tfloat clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tvec3 sheenColor;\n#endif\n};\n#define MAXIMUM_SPECULAR_COEFFICIENT 0.16\n#define DEFAULT_SPECULAR_COEFFICIENT 0.04\nfloat clearcoatDHRApprox( const in float roughness, const in float dotNL ) {\n\treturn DEFAULT_SPECULAR_COEFFICIENT + ( 1.0 - DEFAULT_SPECULAR_COEFFICIENT ) * ( pow( 1.0 - dotNL, 5.0 ) * pow( 1.0 - roughness, 2.0 ) );\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.specularRoughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNL = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = ccDotNL * directLight.color;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tccIrradiance *= PI;\n\t\t#endif\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t\treflectedLight.directSpecular += ccIrradiance * material.clearcoat * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_Sheen(\n\t\t\tmaterial.specularRoughness,\n\t\t\tdirectLight.direction,\n\t\t\tgeometry,\n\t\t\tmaterial.sheenColor\n\t\t);\n\t#else\n\t\treflectedLight.directSpecular += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Specular_GGX( directLight, geometry.viewDir, geometry.normal, material.specularColor, material.specularRoughness);\n\t#endif\n\treflectedLight.directDiffuse += ( 1.0 - clearcoatDHR ) * irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef CLEARCOAT\n\t\tfloat ccDotNV = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular += clearcoatRadiance * material.clearcoat * BRDF_Specular_GGX_Environment( geometry.viewDir, geometry.clearcoatNormal, vec3( DEFAULT_SPECULAR_COEFFICIENT ), material.clearcoatRoughness );\n\t\tfloat ccDotNL = ccDotNV;\n\t\tfloat clearcoatDHR = material.clearcoat * clearcoatDHRApprox( material.clearcoatRoughness, ccDotNL );\n\t#else\n\t\tfloat clearcoatDHR = 0.0;\n\t#endif\n\tfloat clearcoatInv = 1.0 - clearcoatDHR;\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\tBRDF_Specular_Multiscattering_Environment( geometry, material.specularColor, material.specularRoughness, singleScattering, multiScattering );\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\n\treflectedLight.indirectSpecular += clearcoatInv * radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}",Ls="\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif",Rs="#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getLightProbeIndirectIrradiance( geometry, maxMipLevel );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.normal, material.specularRoughness, maxMipLevel );\n\t#ifdef CLEARCOAT\n\t\tclearcoatRadiance += getLightProbeIndirectRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness, maxMipLevel );\n\t#endif\n#endif",Cs="#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif",Ps="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\n#endif",Os="#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\n\tuniform float logDepthBufFC;\n\tvarying float vFragDepth;\n\tvarying float vIsPerspective;\n#endif",Ds="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvarying float vFragDepth;\n\t\tvarying float vIsPerspective;\n\t#else\n\t\tuniform float logDepthBufFC;\n\t#endif\n#endif",Is="#ifdef USE_LOGDEPTHBUF\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\n\t#else\n\t\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\n\t\t\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\n\t\t\tgl_Position.z *= gl_Position.w;\n\t\t}\n\t#endif\n#endif",Ns="#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif",Bs="#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif",Fs="#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\n#endif\n#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, uv );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\n#endif",Us="#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\n\tuniform mat3 uvTransform;\n#endif\n#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif",Gs="float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.b;\n#endif",zs="#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",Hs="#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n#endif",ks="#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifndef USE_MORPHNORMALS\n\t\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\t\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif",Vs="#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t#endif\n#endif",js="#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t\tbitangent = bitangent * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;",Ws="#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( -vViewPosition, normal, mapN );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif",qs="#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tfloat scale = sign( st1.t * st0.s - st0.t * st1.s );\n\t\tvec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );\n\t\tvec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );\n\t\tvec3 N = normalize( surf_norm );\n\t\tmat3 tsn = mat3( S, T, N );\n\t\tmapN.xy *= ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif",Xs="#ifdef CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif",Ys="#ifdef USE_CLEARCOAT_NORMALMAP\n\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\n\tclearcoatMapN.xy *= clearcoatNormalScale;\n\t#ifdef USE_TANGENT\n\t\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\n\t#else\n\t\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN );\n\t#endif\n#endif",Zs="#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clearcoatMap;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform sampler2D clearcoatRoughnessMap;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform sampler2D clearcoatNormalMap;\n\tuniform vec2 clearcoatNormalScale;\n#endif",Js="vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ));\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w);\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn (( near + viewZ ) * far ) / (( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}",Qs="#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif",Ks="vec4 mvPosition = vec4( transformed, 1.0 );\n#ifdef USE_INSTANCING\n\tmvPosition = instanceMatrix * mvPosition;\n#endif\nmvPosition = modelViewMatrix * mvPosition;\ngl_Position = projectionMatrix * mvPosition;",$s="#ifdef DITHERING\n\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\n#endif",ta="#ifdef DITHERING\n\tvec3 dithering( vec3 color ) {\n\t\tfloat grid_position = rand( gl_FragCoord.xy );\n\t\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\n\t\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\n\t\treturn color + dither_shift_RGB;\n\t}\n#endif",ea="float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.g;\n#endif",na="#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",ia="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif",ra="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif",oa="#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\n\t\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t\tvec4 shadowWorldPosition;\n\t#endif\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n#endif",sa="float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\n\t\tdirectionalLight = directionalLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\n\t\tspotLight = spotLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\n\t\tpointLight = pointLightShadows[ i ];\n\t\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\n\t}\n\t#pragma unroll_loop_end\n\t#endif\n\t#endif\n\treturn shadow;\n}",aa="#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",ca="#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform highp sampler2D boneTexture;\n\t\tuniform int boneTextureSize;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureSize ) );\n\t\t\tfloat y = floor( j / float( boneTextureSize ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureSize );\n\t\t\tfloat dy = 1.0 / float( boneTextureSize );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif",la="#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",ha="#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n\t#ifdef USE_TANGENT\n\t\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#endif\n#endif",ua="float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",pa="#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",da="#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif",fa="#ifndef saturate\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }",ma="#ifdef USE_TRANSMISSIONMAP\n\ttotalTransmission *= texture2D( transmissionMap, vUv ).r;\n#endif",ga="#ifdef USE_TRANSMISSIONMAP\n\tuniform sampler2D transmissionMap;\n#endif",va="#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif",ya="#ifdef USE_UV\n\t#ifdef UVS_VERTEX_ONLY\n\t\tvec2 vUv;\n\t#else\n\t\tvarying vec2 vUv;\n\t#endif\n\tuniform mat3 uvTransform;\n#endif",xa="#ifdef USE_UV\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n#endif",_a="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",ba="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n\tuniform mat3 uv2Transform;\n#endif",wa="#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\n#endif",Ma="#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP )\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif",Sa="uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",Ta="varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}",Ea="#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",Aa="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}",La="#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}",Ra="#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}",Ca="#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}",Pa="#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}",Oa="uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tvec4 texColor = texture2D( tEquirect, sampleUV );\n\tgl_FragColor = mapTexelToLinear( texColor );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}",Da="varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}",Ia="uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",Na="uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}",Ba="uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\n\t\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\n\t\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",Fa="#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}",Ua="uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\n\t#else\n\t\treflectedLight.indirectDiffuse += vIndirectFront;\n\t#endif\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",Ga="#define LAMBERT\nvarying vec3 vLightFront;\nvarying vec3 vIndirectFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n\tvarying vec3 vIndirectBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",za="#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t\tmatcapColor = matcapTexelToLinear( matcapColor );\n\t#else\n\t\tvec4 matcapColor = vec4( 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",Ha="#define MATCAP\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#ifndef FLAT_SHADED\n\t\tvNormal = normalize( transformedNormal );\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}",ka="#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",Va="#define TOON\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",ja="#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <cube_uv_reflection_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",Wa="#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",qa="#define STANDARD\n#ifdef PHYSICAL\n\t#define REFLECTIVITY\n\t#define CLEARCOAT\n\t#define TRANSMISSION\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef TRANSMISSION\n\tuniform float transmission;\n#endif\n#ifdef REFLECTIVITY\n\tuniform float reflectivity;\n#endif\n#ifdef CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheen;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <transmissionmap_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <lights_physical_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#ifdef TRANSMISSION\n\t\tfloat totalTransmission = transmission;\n\t#endif\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <transmissionmap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#ifdef TRANSMISSION\n\t\tdiffuseColor.a *= saturate( 1. - totalTransmission + linearToRelativeLuminance( reflectedLight.directSpecular + reflectedLight.indirectSpecular ) );\n\t#endif\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}",Xa="#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",Ya="#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\n}",Za="#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvarying vec3 vViewPosition;\n#endif\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef USE_TANGENT\n\t\tvarying vec3 vTangent;\n\t\tvarying vec3 vBitangent;\n\t#endif\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}",Ja="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}",Qa="uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}",Ka="uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",$a="#include <common>\n#include <fog_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}",tc="uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}",ec="uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}";const nc={alphamap_fragment:No,alphamap_pars_fragment:Bo,alphatest_fragment:Fo,aomap_fragment:Uo,aomap_pars_fragment:Go,begin_vertex:zo,beginnormal_vertex:Ho,bsdfs:ko,bumpmap_pars_fragment:Vo,clipping_planes_fragment:jo,clipping_planes_pars_fragment:Wo,clipping_planes_pars_vertex:qo,clipping_planes_vertex:Xo,color_fragment:Yo,color_pars_fragment:Zo,color_pars_vertex:Jo,color_vertex:Qo,common:Ko,cube_uv_reflection_fragment:$o,defaultnormal_vertex:ts,displacementmap_pars_vertex:es,displacementmap_vertex:ns,emissivemap_fragment:is,emissivemap_pars_fragment:rs,encodings_fragment:os,encodings_pars_fragment:ss,envmap_fragment:as,envmap_common_pars_fragment:cs,envmap_pars_fragment:ls,envmap_pars_vertex:hs,envmap_physical_pars_fragment:bs,envmap_vertex:us,fog_vertex:ps,fog_pars_vertex:ds,fog_fragment:fs,fog_pars_fragment:ms,gradientmap_pars_fragment:gs,lightmap_fragment:vs,lightmap_pars_fragment:ys,lights_lambert_vertex:xs,lights_pars_begin:_s,lights_toon_fragment:ws,lights_toon_pars_fragment:Ms,lights_phong_fragment:Ss,lights_phong_pars_fragment:Ts,lights_physical_fragment:Es,lights_physical_pars_fragment:As,lights_fragment_begin:Ls,lights_fragment_maps:Rs,lights_fragment_end:Cs,logdepthbuf_fragment:Ps,logdepthbuf_pars_fragment:Os,logdepthbuf_pars_vertex:Ds,logdepthbuf_vertex:Is,map_fragment:Ns,map_pars_fragment:Bs,map_particle_fragment:Fs,map_particle_pars_fragment:Us,metalnessmap_fragment:Gs,metalnessmap_pars_fragment:zs,morphnormal_vertex:Hs,morphtarget_pars_vertex:ks,morphtarget_vertex:Vs,normal_fragment_begin:js,normal_fragment_maps:Ws,normalmap_pars_fragment:qs,clearcoat_normal_fragment_begin:Xs,clearcoat_normal_fragment_maps:Ys,clearcoat_pars_fragment:Zs,packing:Js,premultiplied_alpha_fragment:Qs,project_vertex:Ks,dithering_fragment:$s,dithering_pars_fragment:ta,roughnessmap_fragment:ea,roughnessmap_pars_fragment:na,shadowmap_pars_fragment:ia,shadowmap_pars_vertex:ra,shadowmap_vertex:oa,shadowmask_pars_fragment:sa,skinbase_vertex:aa,skinning_pars_vertex:ca,skinning_vertex:la,skinnormal_vertex:ha,specularmap_fragment:ua,specularmap_pars_fragment:pa,tonemapping_fragment:da,tonemapping_pars_fragment:fa,transmissionmap_fragment:ma,transmissionmap_pars_fragment:ga,uv_pars_fragment:va,uv_pars_vertex:ya,uv_vertex:xa,uv2_pars_fragment:_a,uv2_pars_vertex:ba,uv2_vertex:wa,worldpos_vertex:Ma,background_frag:Sa,background_vert:Ta,cube_frag:Ea,cube_vert:Aa,depth_frag:La,depth_vert:Ra,distanceRGBA_frag:Ca,distanceRGBA_vert:Pa,equirect_frag:Oa,equirect_vert:Da,linedashed_frag:Ia,linedashed_vert:Na,meshbasic_frag:Ba,meshbasic_vert:Fa,meshlambert_frag:Ua,meshlambert_vert:Ga,meshmatcap_frag:za,meshmatcap_vert:Ha,meshtoon_frag:ka,meshtoon_vert:Va,meshphong_frag:ja,meshphong_vert:Wa,meshphysical_frag:qa,meshphysical_vert:Xa,normal_frag:Ya,normal_vert:Za,points_frag:Ja,points_vert:Qa,shadow_frag:Ka,shadow_vert:$a,sprite_frag:tc,sprite_vert:ec};exports.ShaderChunk=nc;const ic={basic:{uniforms:mo([Co.common,Co.specularmap,Co.envmap,Co.aomap,Co.lightmap,Co.fog]),vertexShader:nc.meshbasic_vert,fragmentShader:nc.meshbasic_frag},lambert:{uniforms:mo([Co.common,Co.specularmap,Co.envmap,Co.aomap,Co.lightmap,Co.emissivemap,Co.fog,Co.lights,{emissive:{value:new hr(0)}}]),vertexShader:nc.meshlambert_vert,fragmentShader:nc.meshlambert_frag},phong:{uniforms:mo([Co.common,Co.specularmap,Co.envmap,Co.aomap,Co.lightmap,Co.emissivemap,Co.bumpmap,Co.normalmap,Co.displacementmap,Co.fog,Co.lights,{emissive:{value:new hr(0)},specular:{value:new hr(1118481)},shininess:{value:30}}]),vertexShader:nc.meshphong_vert,fragmentShader:nc.meshphong_frag},standard:{uniforms:mo([Co.common,Co.envmap,Co.aomap,Co.lightmap,Co.emissivemap,Co.bumpmap,Co.normalmap,Co.displacementmap,Co.roughnessmap,Co.metalnessmap,Co.fog,Co.lights,{emissive:{value:new hr(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:nc.meshphysical_vert,fragmentShader:nc.meshphysical_frag},toon:{uniforms:mo([Co.common,Co.aomap,Co.lightmap,Co.emissivemap,Co.bumpmap,Co.normalmap,Co.displacementmap,Co.gradientmap,Co.fog,Co.lights,{emissive:{value:new hr(0)}}]),vertexShader:nc.meshtoon_vert,fragmentShader:nc.meshtoon_frag},matcap:{uniforms:mo([Co.common,Co.bumpmap,Co.normalmap,Co.displacementmap,Co.fog,{matcap:{value:null}}]),vertexShader:nc.meshmatcap_vert,fragmentShader:nc.meshmatcap_frag},points:{uniforms:mo([Co.points,Co.fog]),vertexShader:nc.points_vert,fragmentShader:nc.points_frag},dashed:{uniforms:mo([Co.common,Co.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:nc.linedashed_vert,fragmentShader:nc.linedashed_frag},depth:{uniforms:mo([Co.common,Co.displacementmap]),vertexShader:nc.depth_vert,fragmentShader:nc.depth_frag},normal:{uniforms:mo([Co.common,Co.bumpmap,Co.normalmap,Co.displacementmap,{opacity:{value:1}}]),vertexShader:nc.normal_vert,fragmentShader:nc.normal_frag},sprite:{uniforms:mo([Co.sprite,Co.fog]),vertexShader:nc.sprite_vert,fragmentShader:nc.sprite_frag},background:{uniforms:{uvTransform:{value:new Bn},t2D:{value:null}},vertexShader:nc.background_vert,fragmentShader:nc.background_frag},cube:{uniforms:mo([Co.envmap,{opacity:{value:1}}]),vertexShader:nc.cube_vert,fragmentShader:nc.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:nc.equirect_vert,fragmentShader:nc.equirect_frag},distanceRGBA:{uniforms:mo([Co.common,Co.displacementmap,{referencePosition:{value:new Xn},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:nc.distanceRGBA_vert,fragmentShader:nc.distanceRGBA_frag},shadow:{uniforms:mo([Co.lights,Co.fog,{color:{value:new hr(0)},opacity:{value:1}}]),vertexShader:nc.shadow_vert,fragmentShader:nc.shadow_frag}};function rc(t,e,n,i){const r=new hr(0);let o,s,a=0,c=null,l=0,h=null;function d(t,n){e.buffers.color.setClear(t.r,t.g,t.b,n,i)}return{getClearColor:function(){return r},setClearColor:function(t,e){r.set(t),d(r,a=void 0!==e?e:1)},getClearAlpha:function(){return a},setClearAlpha:function(t){d(r,a=t)},render:function(e,i,f,m){let g=!0===i.isScene?i.background:null;const v=t.xr,y=v.getSession&&v.getSession();if(y&&"additive"===y.environmentBlendMode&&(g=null),null===g?d(r,a):g&&g.isColor&&(d(g,1),m=!0),(t.autoClear||m)&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),g&&(g.isCubeTexture||g.isWebGLCubeRenderTarget||g.mapping===st)){void 0===s&&((s=new io(new po(1,1,1),new xo({name:"BackgroundCubeMaterial",uniforms:fo(ic.cube.uniforms),vertexShader:ic.cube.vertexShader,fragmentShader:ic.cube.fragmentShader,side:p,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),s.geometry.deleteAttribute("uv"),s.onBeforeRender=function(t,e,n){this.matrixWorld.copyPosition(n.matrixWorld)},Object.defineProperty(s.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),n.update(s));const i=g.isWebGLCubeRenderTarget?g.texture:g;s.material.uniforms.envMap.value=i,s.material.uniforms.flipEnvMap.value=i.isCubeTexture?-1:1,c===g&&l===i.version&&h===t.toneMapping||(s.material.needsUpdate=!0,c=g,l=i.version,h=t.toneMapping),e.unshift(s,s.geometry,s.material,0,0,null)}else g&&g.isTexture&&(void 0===o&&((o=new io(new Io(2,2),new xo({name:"BackgroundMaterial",uniforms:fo(ic.background.uniforms),vertexShader:ic.background.vertexShader,fragmentShader:ic.background.fragmentShader,side:u,depthTest:!1,depthWrite:!1,fog:!1}))).geometry.deleteAttribute("normal"),Object.defineProperty(o.material,"map",{get:function(){return this.uniforms.t2D.value}}),n.update(o)),o.material.uniforms.t2D.value=g,!0===g.matrixAutoUpdate&&g.updateMatrix(),o.material.uniforms.uvTransform.value.copy(g.matrix),c===g&&l===g.version&&h===t.toneMapping||(o.material.needsUpdate=!0,c=g,l=g.version,h=t.toneMapping),e.unshift(o,o.geometry,o.material,0,0,null))}}}function oc(t,e,n,i){const r=t.getParameter(34921),o=i.isWebGL2?null:e.get("OES_vertex_array_object"),s=i.isWebGL2||null!==o,a={},c=p(null);let l=c;function h(e){return i.isWebGL2?t.bindVertexArray(e):o.bindVertexArrayOES(e)}function u(e){return i.isWebGL2?t.deleteVertexArray(e):o.deleteVertexArrayOES(e)}function p(t){const e=[],n=[],i=[];for(let o=0;o<r;o++)e[o]=0,n[o]=0,i[o]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:e,enabledAttributes:n,attributeDivisors:i,object:t,attributes:{}}}function d(){const t=l.newAttributes;for(let e=0,n=t.length;e<n;e++)t[e]=0}function f(t){m(t,0)}function m(n,r){const o=l.newAttributes,s=l.enabledAttributes,a=l.attributeDivisors;if(o[n]=1,0===s[n]&&(t.enableVertexAttribArray(n),s[n]=1),a[n]!==r){(i.isWebGL2?t:e.get("ANGLE_instanced_arrays"))[i.isWebGL2?"vertexAttribDivisor":"vertexAttribDivisorANGLE"](n,r),a[n]=r}}function g(){const e=l.newAttributes,n=l.enabledAttributes;for(let i=0,r=n.length;i<r;i++)n[i]!==e[i]&&(t.disableVertexAttribArray(i),n[i]=0)}function v(e,n,r,o,s,a){!0!==i.isWebGL2||5124!==r&&5125!==r?t.vertexAttribPointer(e,n,r,o,s,a):t.vertexAttribIPointer(e,n,r,s,a)}function y(){x(),l!==c&&h((l=c).object)}function x(){c.geometry=null,c.program=null,c.wireframe=!1}return{setup:function(r,c,u,y,x){let _=!1;if(s){const e=function(e,n,r){const s=!0===r.wireframe;let c=a[e.id];void 0===c&&(c={},a[e.id]=c);let l=c[n.id];void 0===l&&(l={},c[n.id]=l);let h=l[s];return void 0===h&&(h=p(i.isWebGL2?t.createVertexArray():o.createVertexArrayOES()),l[s]=h),h}(y,u,c);l!==e&&h((l=e).object),(_=function(t){const e=l.attributes,n=t.attributes;if(Object.keys(e).length!==Object.keys(n).length)return!0;for(const i in n){const t=e[i],r=n[i];if(t.attribute!==r)return!0;if(t.data!==r.data)return!0}return!1}(y))&&function(t){const e={},n=t.attributes;for(const i in n){const t=n[i],r={};r.attribute=t,t.data&&(r.data=t.data),e[i]=r}l.attributes=e}(y)}else{const t=!0===c.wireframe;l.geometry===y.id&&l.program===u.id&&l.wireframe===t||(l.geometry=y.id,l.program=u.id,l.wireframe=t,_=!0)}!0===r.isInstancedMesh&&(_=!0),null!==x&&n.update(x,34963),_&&(function(r,o,s,a){if(!1===i.isWebGL2&&(r.isInstancedMesh||a.isInstancedBufferGeometry)&&null===e.get("ANGLE_instanced_arrays"))return;d();const c=a.attributes,l=s.getAttributes(),h=o.defaultAttributeValues;for(const e in l){const i=l[e];if(i>=0){const o=c[e];if(void 0!==o){const e=o.normalized,r=o.itemSize,s=n.get(o);if(void 0===s)continue;const c=s.buffer,l=s.type,h=s.bytesPerElement;if(o.isInterleavedBufferAttribute){const n=o.data,s=n.stride,u=o.offset;n&&n.isInstancedInterleavedBuffer?(m(i,n.meshPerAttribute),void 0===a._maxInstanceCount&&(a._maxInstanceCount=n.meshPerAttribute*n.count)):f(i),t.bindBuffer(34962,c),v(i,r,l,e,s*h,u*h)}else o.isInstancedBufferAttribute?(m(i,o.meshPerAttribute),void 0===a._maxInstanceCount&&(a._maxInstanceCount=o.meshPerAttribute*o.count)):f(i),t.bindBuffer(34962,c),v(i,r,l,e,0,0)}else if("instanceMatrix"===e){const e=n.get(r.instanceMatrix);if(void 0===e)continue;const o=e.buffer,s=e.type;m(i+0,1),m(i+1,1),m(i+2,1),m(i+3,1),t.bindBuffer(34962,o),t.vertexAttribPointer(i+0,4,s,!1,64,0),t.vertexAttribPointer(i+1,4,s,!1,64,16),t.vertexAttribPointer(i+2,4,s,!1,64,32),t.vertexAttribPointer(i+3,4,s,!1,64,48)}else if(void 0!==h){const n=h[e];if(void 0!==n)switch(n.length){case 2:t.vertexAttrib2fv(i,n);break;case 3:t.vertexAttrib3fv(i,n);break;case 4:t.vertexAttrib4fv(i,n);break;default:t.vertexAttrib1fv(i,n)}}}}g()}(r,c,u,y),null!==x&&t.bindBuffer(34963,n.get(x).buffer))},reset:y,resetDefaultState:x,dispose:function(){y();for(const t in a){const e=a[t];for(const t in e){const n=e[t];for(const t in n)u(n[t].object),delete n[t];delete e[t]}delete a[t]}},releaseStatesOfGeometry:function(t){if(void 0===a[t.id])return;const e=a[t.id];for(const n in e){const t=e[n];for(const e in t)u(t[e].object),delete t[e];delete e[n]}delete a[t.id]},releaseStatesOfProgram:function(t){for(const e in a){const n=a[e];if(void 0===n[t.id])continue;const i=n[t.id];for(const t in i)u(i[t].object),delete i[t];delete n[t.id]}},initAttributes:d,enableAttribute:f,disableUnusedAttributes:g}}function sc(t,e,n,i){const r=i.isWebGL2;let o;this.setMode=function(t){o=t},this.render=function(e,i){t.drawArrays(o,e,i),n.update(i,o,1)},this.renderInstances=function(i,s,a){if(0===a)return;let c,l;if(r)c=t,l="drawArraysInstanced";else if(l="drawArraysInstancedANGLE",null===(c=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");c[l](o,i,s,a),n.update(s,o,a)}}function ac(t,e,n){let i;function r(e){if("highp"===e){if(t.getShaderPrecisionFormat(35633,36338).precision>0&&t.getShaderPrecisionFormat(35632,36338).precision>0)return"highp";e="mediump"}return"mediump"===e&&t.getShaderPrecisionFormat(35633,36337).precision>0&&t.getShaderPrecisionFormat(35632,36337).precision>0?"mediump":"lowp"}const o="undefined"!=typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||"undefined"!=typeof WebGL2ComputeRenderingContext&&t instanceof WebGL2ComputeRenderingContext;let s=void 0!==n.precision?n.precision:"highp";const a=r(s);a!==s&&(console.warn("THREE.WebGLRenderer:",s,"not supported, using",a,"instead."),s=a);const c=!0===n.logarithmicDepthBuffer,l=t.getParameter(34930),h=t.getParameter(35660),u=t.getParameter(3379),p=t.getParameter(34076),d=t.getParameter(34921),f=t.getParameter(36347),m=t.getParameter(36348),g=t.getParameter(36349),v=h>0,y=o||!!e.get("OES_texture_float");return{isWebGL2:o,getMaxAnisotropy:function(){if(void 0!==i)return i;const n=e.get("EXT_texture_filter_anisotropic");return i=null!==n?t.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:r,precision:s,logarithmicDepthBuffer:c,maxTextures:l,maxVertexTextures:h,maxTextureSize:u,maxCubemapSize:p,maxAttributes:d,maxVertexUniforms:f,maxVaryings:m,maxFragmentUniforms:g,vertexTextures:v,floatFragmentTextures:y,floatVertexTextures:v&&y,maxSamples:o?t.getParameter(36183):0}}function cc(){const t=this;let e=null,n=0,i=!1,r=!1;const o=new Zi,s=new Bn,a={value:null,needsUpdate:!1};function c(){a.value!==e&&(a.value=e,a.needsUpdate=n>0),t.numPlanes=n,t.numIntersection=0}function l(e,n,i,r){let c=null!==e?e.length:0,l=null;if(0!==c){if(l=a.value,!0!==r||null===l){const t=i+4*c,r=n.matrixWorldInverse;s.getNormalMatrix(r),(null===l||l.length<t)&&(l=new Float32Array(t));for(let n=0,a=i;n!==c;++n,a+=4)o.copy(e[n]).applyMatrix4(r,s),o.normal.toArray(l,a),l[a+3]=o.constant}a.value=l,a.needsUpdate=!0}return t.numPlanes=c,t.numIntersection=0,l}this.uniform=a,this.numPlanes=0,this.numIntersection=0,this.init=function(t,r,o){const s=0!==t.length||r||0!==n||i;return i=r,e=l(t,o,0),n=t.length,s},this.beginShadows=function(){r=!0,l(null)},this.endShadows=function(){r=!1,c()},this.setState=function(t,o,s,h,u,p){if(!i||null===t||0===t.length||r&&!s)r?l(null):c();else{const i=r?0:n,s=4*i;let c=u.clippingState||null;a.value=c,c=l(t,h,s,p);for(let t=0;t!==s;++t)c[t]=e[t];u.clippingState=c,this.numIntersection=o?this.numPlanes:0,this.numPlanes+=i}}}function lc(t){const e={};return{has:function(n){if(void 0!==e[n])return e[n];let i;switch(n){case"WEBGL_depth_texture":i=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":i=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":i=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":i=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:i=t.getExtension(n)}return e[n]=i,!!i},get:function(t){return this.has(t)||console.warn("THREE.WebGLRenderer: "+t+" extension not supported."),e[t]}}}function hc(t,e,n,i){const r=new WeakMap,o=new WeakMap;function s(t){const a=t.target,c=r.get(a);null!==c.index&&e.remove(c.index);for(const n in c.attributes)e.remove(c.attributes[n]);a.removeEventListener("dispose",s),r.delete(a);const l=o.get(c);l&&(e.remove(l),o.delete(c)),i.releaseStatesOfGeometry(a),!0===a.isInstancedBufferGeometry&&delete a._maxInstanceCount,n.memory.geometries--}function a(t){const n=[],i=t.index,r=t.attributes.position;let s=0;if(null!==i){const t=i.array;s=i.version;for(let e=0,i=t.length;e<i;e+=3){const i=t[e+0],r=t[e+1],o=t[e+2];n.push(i,r,r,o,o,i)}}else{const t=r.array;s=r.version;for(let e=0,i=t.length/3-1;e<i;e+=3){const t=e+0,i=e+1,r=e+2;n.push(t,i,i,r,r,t)}}const a=new(Pr(n)>65535?Ar:Tr)(n,1);a.version=s;const c=o.get(t);c&&e.remove(c),o.set(t,a)}return{get:function(t,e){let i=r.get(e);return i||(e.addEventListener("dispose",s),e.isBufferGeometry?i=e:e.isGeometry&&(void 0===e._bufferGeometry&&(e._bufferGeometry=(new Gr).setFromObject(t)),i=e._bufferGeometry),r.set(e,i),n.memory.geometries++,i)},update:function(t){const n=t.attributes;for(const r in n)e.update(n[r],34962);const i=t.morphAttributes;for(const r in i){const t=i[r];for(let n=0,i=t.length;n<i;n++)e.update(t[n],34962)}},getWireframeAttribute:function(t){const e=o.get(t);if(e){const n=t.index;null!==n&&e.version<n.version&&a(t)}else a(t);return o.get(t)}}}function uc(t,e,n,i){const r=i.isWebGL2;let o,s,a;this.setMode=function(t){o=t},this.setIndex=function(t){s=t.type,a=t.bytesPerElement},this.render=function(e,i){t.drawElements(o,i,s,e*a),n.update(i,o,1)},this.renderInstances=function(i,c,l){if(0===l)return;let h,u;if(r)h=t,u="drawElementsInstanced";else if(u="drawElementsInstancedANGLE",null===(h=e.get("ANGLE_instanced_arrays")))return void console.error("THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");h[u](o,c,s,i*a,l),n.update(c,o,l)}}function pc(t){const e={frame:0,calls:0,triangles:0,points:0,lines:0};return{memory:{geometries:0,textures:0},render:e,programs:null,autoReset:!0,reset:function(){e.frame++,e.calls=0,e.triangles=0,e.points=0,e.lines=0},update:function(t,n,i){switch(e.calls++,n){case 4:e.triangles+=i*(t/3);break;case 1:e.lines+=i*(t/2);break;case 3:e.lines+=i*(t-1);break;case 2:e.lines+=i*t;break;case 0:e.points+=i*t;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",n)}}}}function dc(t,e){return t[0]-e[0]}function fc(t,e){return Math.abs(e[1])-Math.abs(t[1])}function mc(t){const e={},n=new Float32Array(8),i=[];for(let r=0;r<8;r++)i[r]=[r,0];return{update:function(r,o,s,a){const c=r.morphTargetInfluences,l=void 0===c?0:c.length;let h=e[o.id];if(void 0===h){h=[];for(let t=0;t<l;t++)h[t]=[t,0];e[o.id]=h}for(let t=0;t<l;t++){const e=h[t];e[0]=t,e[1]=c[t]}h.sort(fc);for(let t=0;t<8;t++)t<l&&h[t][1]?(i[t][0]=h[t][0],i[t][1]=h[t][1]):(i[t][0]=Number.MAX_SAFE_INTEGER,i[t][1]=0);i.sort(dc);const u=s.morphTargets&&o.morphAttributes.position,p=s.morphNormals&&o.morphAttributes.normal;let d=0;for(let t=0;t<8;t++){const e=i[t],r=e[0],s=e[1];r!==Number.MAX_SAFE_INTEGER&&s?(u&&o.getAttribute("morphTarget"+t)!==u[r]&&o.setAttribute("morphTarget"+t,u[r]),p&&o.getAttribute("morphNormal"+t)!==p[r]&&o.setAttribute("morphNormal"+t,p[r]),n[t]=s,d+=s):(u&&void 0!==o.getAttribute("morphTarget"+t)&&o.deleteAttribute("morphTarget"+t),p&&void 0!==o.getAttribute("morphNormal"+t)&&o.deleteAttribute("morphNormal"+t),n[t]=0)}const f=o.morphTargetsRelative?1:1-d;a.getUniforms().setValue(t,"morphTargetBaseInfluence",f),a.getUniforms().setValue(t,"morphTargetInfluences",n)}}}function gc(t,e,n,i){let r=new WeakMap;return{update:function(t){const o=i.render.frame,s=t.geometry,a=e.get(t,s);return r.get(a)!==o&&(s.isGeometry&&a.updateFromObject(t),e.update(a),r.set(a,o)),t.isInstancedMesh&&n.update(t.instanceMatrix,34962),a},dispose:function(){r=new WeakMap}}}function vc(t,e,n,i,r,o,s,a,c,l){t=void 0!==t?t:[],e=void 0!==e?e:nt,s=void 0!==s?s:It,zn.call(this,t,e,n,i,r,o,s,a,c,l),this.flipY=!1}function yc(t,e,n,i){zn.call(this,null),this.image={data:t||null,width:e||1,height:n||1,depth:i||1},this.magFilter=ut,this.minFilter=ut,this.wrapR=lt,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}function xc(t,e,n,i){zn.call(this,null),this.image={data:t||null,width:e||1,height:n||1,depth:i||1},this.magFilter=ut,this.minFilter=ut,this.wrapR=lt,this.generateMipmaps=!1,this.flipY=!1,this.needsUpdate=!0}exports.ShaderLib=ic,ic.physical={uniforms:mo([ic.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatNormalScale:{value:new Nn(1,1)},clearcoatNormalMap:{value:null},sheen:{value:new hr(0)},transmission:{value:0},transmissionMap:{value:null}}]),vertexShader:nc.meshphysical_vert,fragmentShader:nc.meshphysical_frag},vc.prototype=Object.create(zn.prototype),vc.prototype.constructor=vc,vc.prototype.isCubeTexture=!0,Object.defineProperty(vc.prototype,"images",{get:function(){return this.image},set:function(t){this.image=t}}),yc.prototype=Object.create(zn.prototype),yc.prototype.constructor=yc,yc.prototype.isDataTexture2DArray=!0,xc.prototype=Object.create(zn.prototype),xc.prototype.constructor=xc,xc.prototype.isDataTexture3D=!0;const _c=new zn,bc=new yc,wc=new xc,Mc=new vc,Sc=[],Tc=[],Ec=new Float32Array(16),Ac=new Float32Array(9),Lc=new Float32Array(4);function Rc(t,e,n){const i=t[0];if(i<=0||i>0)return t;let r=e*n,o=Sc[r];if(void 0===o&&(o=new Float32Array(r),Sc[r]=o),0!==e){i.toArray(o,0);for(let i=1,r=0;i!==e;++i)r+=n,t[i].toArray(o,r)}return o}function Cc(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n<i;n++)if(t[n]!==e[n])return!1;return!0}function Pc(t,e){for(let n=0,i=e.length;n<i;n++)t[n]=e[n]}function Oc(t,e){let n=Tc[e];void 0===n&&(n=new Int32Array(e),Tc[e]=n);for(let i=0;i!==e;++i)n[i]=t.allocateTextureUnit();return n}function Dc(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function Ic(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y||(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(Cc(n,e))return;t.uniform2fv(this.addr,e),Pc(n,e)}}function Nc(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z||(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(void 0!==e.r)n[0]===e.r&&n[1]===e.g&&n[2]===e.b||(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(Cc(n,e))return;t.uniform3fv(this.addr,e),Pc(n,e)}}function Bc(t,e){const n=this.cache;if(void 0!==e.x)n[0]===e.x&&n[1]===e.y&&n[2]===e.z&&n[3]===e.w||(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(Cc(n,e))return;t.uniform4fv(this.addr,e),Pc(n,e)}}function Fc(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(Cc(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),Pc(n,e)}else{if(Cc(n,i))return;Lc.set(i),t.uniformMatrix2fv(this.addr,!1,Lc),Pc(n,i)}}function Uc(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(Cc(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),Pc(n,e)}else{if(Cc(n,i))return;Ac.set(i),t.uniformMatrix3fv(this.addr,!1,Ac),Pc(n,i)}}function Gc(t,e){const n=this.cache,i=e.elements;if(void 0===i){if(Cc(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),Pc(n,e)}else{if(Cc(n,i))return;Ec.set(i),t.uniformMatrix4fv(this.addr,!1,Ec),Pc(n,i)}}function zc(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.safeSetTexture2D(e||_c,r)}function Hc(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture2DArray(e||bc,r)}function kc(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.setTexture3D(e||wc,r)}function Vc(t,e,n){const i=this.cache,r=n.allocateTextureUnit();i[0]!==r&&(t.uniform1i(this.addr,r),i[0]=r),n.safeSetTextureCube(e||Mc,r)}function jc(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function Wc(t,e){const n=this.cache;Cc(n,e)||(t.uniform2iv(this.addr,e),Pc(n,e))}function qc(t,e){const n=this.cache;Cc(n,e)||(t.uniform3iv(this.addr,e),Pc(n,e))}function Xc(t,e){const n=this.cache;Cc(n,e)||(t.uniform4iv(this.addr,e),Pc(n,e))}function Yc(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function Zc(t){switch(t){case 5126:return Dc;case 35664:return Ic;case 35665:return Nc;case 35666:return Bc;case 35674:return Fc;case 35675:return Uc;case 35676:return Gc;case 5124:case 35670:return jc;case 35667:case 35671:return Wc;case 35668:case 35672:return qc;case 35669:case 35673:return Xc;case 5125:return Yc;case 35678:case 36198:case 36298:case 36306:case 35682:return zc;case 35679:case 36299:case 36307:return kc;case 35680:case 36300:case 36308:case 36293:return Vc;case 36289:case 36303:case 36311:case 36292:return Hc}}function Jc(t,e){t.uniform1fv(this.addr,e)}function Qc(t,e){t.uniform1iv(this.addr,e)}function Kc(t,e){t.uniform2iv(this.addr,e)}function $c(t,e){t.uniform3iv(this.addr,e)}function tl(t,e){t.uniform4iv(this.addr,e)}function el(t,e){const n=Rc(e,this.size,2);t.uniform2fv(this.addr,n)}function nl(t,e){const n=Rc(e,this.size,3);t.uniform3fv(this.addr,n)}function il(t,e){const n=Rc(e,this.size,4);t.uniform4fv(this.addr,n)}function rl(t,e){const n=Rc(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function ol(t,e){const n=Rc(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function sl(t,e){const n=Rc(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function al(t,e,n){const i=e.length,r=Oc(n,i);t.uniform1iv(this.addr,r);for(let o=0;o!==i;++o)n.safeSetTexture2D(e[o]||_c,r[o])}function cl(t,e,n){const i=e.length,r=Oc(n,i);t.uniform1iv(this.addr,r);for(let o=0;o!==i;++o)n.safeSetTextureCube(e[o]||Mc,r[o])}function ll(t){switch(t){case 5126:return Jc;case 35664:return el;case 35665:return nl;case 35666:return il;case 35674:return rl;case 35675:return ol;case 35676:return sl;case 5124:case 35670:return Qc;case 35667:case 35671:return Kc;case 35668:case 35672:return $c;case 35669:case 35673:return tl;case 35678:case 36198:case 36298:case 36306:case 35682:return al;case 35680:case 36300:case 36308:case 36293:return cl}}function hl(t,e,n){this.id=t,this.addr=n,this.cache=[],this.setValue=Zc(e.type)}function ul(t,e,n){this.id=t,this.addr=n,this.cache=[],this.size=e.size,this.setValue=ll(e.type)}function pl(t){this.id=t,this.seq=[],this.map={}}ul.prototype.updateCache=function(t){let e=this.cache;t instanceof Float32Array&&e.length!==t.length&&(this.cache=new Float32Array(t.length)),Pc(e,t)},pl.prototype.setValue=function(t,e,n){const i=this.seq;for(let r=0,o=i.length;r!==o;++r){const o=i[r];o.setValue(t,e[o.id],n)}};const dl=/([\w\d_]+)(\])?(\[|\.)?/g;function fl(t,e){t.seq.push(e),t.map[e.id]=e}function ml(t,e,n){const i=t.name,r=i.length;for(dl.lastIndex=0;;){const o=dl.exec(i),s=dl.lastIndex;let a=o[1],c="]"===o[2],l=o[3];if(c&&(a|=0),void 0===l||"["===l&&s+2===r){fl(n,void 0===l?new hl(a,t,e):new ul(a,t,e));break}{let t=n.map[a];void 0===t&&fl(n,t=new pl(a)),n=t}}}function gl(t,e){this.seq=[],this.map={};const n=t.getProgramParameter(e,35718);for(let i=0;i<n;++i){const n=t.getActiveUniform(e,i);ml(n,t.getUniformLocation(e,n.name),this)}}function vl(t,e,n){const i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),i}gl.prototype.setValue=function(t,e,n,i){const r=this.map[e];void 0!==r&&r.setValue(t,n,i)},gl.prototype.setOptional=function(t,e,n){const i=e[n];void 0!==i&&this.setValue(t,n,i)},gl.upload=function(t,e,n,i){for(let r=0,o=e.length;r!==o;++r){const o=e[r],s=n[o.id];!1!==s.needsUpdate&&o.setValue(t,s.value,i)}},gl.seqWithValue=function(t,e){const n=[];for(let i=0,r=t.length;i!==r;++i){const r=t[i];r.id in e&&n.push(r)}return n};let yl=0;function xl(t){const e=t.split("\n");for(let n=0;n<e.length;n++)e[n]=n+1+": "+e[n];return e.join("\n")}function _l(t){switch(t){case Xe:return["Linear","( value )"];case Ye:return["sRGB","( value )"];case Je:return["RGBE","( value )"];case Ke:return["RGBM","( value, 7.0 )"];case $e:return["RGBM","( value, 16.0 )"];case tn:return["RGBD","( value, 256.0 )"];case Ze:return["Gamma","( value, float( GAMMA_FACTOR ) )"];case Qe:return["LogLuv","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported encoding:",t),["Linear","( value )"]}}function bl(t,e,n){const i=t.getShaderParameter(e,35713),r=t.getShaderInfoLog(e).trim();return i&&""===r?"":"THREE.WebGLShader: gl.getShaderInfoLog() "+n+"\n"+r+xl(t.getShaderSource(e))}function wl(t,e){const n=_l(e);return"vec4 "+t+"( vec4 value ) { return "+n[0]+"ToLinear"+n[1]+"; }"}function Ml(t,e){const n=_l(e);return"vec4 "+t+"( vec4 value ) { return LinearTo"+n[0]+n[1]+"; }"}function Sl(t,e){let n;switch(e){case J:n="Linear";break;case Q:n="Reinhard";break;case K:n="OptimizedCineon";break;case $:n="ACESFilmic";break;case tt:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}function Tl(t){return[t.extensionDerivatives||t.envMapCubeUV||t.bumpMap||t.tangentSpaceNormalMap||t.clearcoatNormalMap||t.flatShading||"physical"===t.shaderID?"#extension GL_OES_standard_derivatives : enable":"",(t.extensionFragDepth||t.logarithmicDepthBuffer)&&t.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",t.extensionDrawBuffers&&t.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(t.extensionShaderTextureLOD||t.envMap)&&t.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(Ll).join("\n")}function El(t){const e=[];for(const n in t){const i=t[n];!1!==i&&e.push("#define "+n+" "+i)}return e.join("\n")}function Al(t,e){const n={},i=t.getProgramParameter(e,35721);for(let r=0;r<i;r++){const i=t.getActiveAttrib(e,r).name;n[i]=t.getAttribLocation(e,i)}return n}function Ll(t){return""!==t}function Rl(t,e){return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Cl(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const Pl=/^[ \t]*#include +<([\w\d./]+)>/gm;function Ol(t){return t.replace(Pl,Dl)}function Dl(t,e){const n=nc[e];if(void 0===n)throw new Error("Can not resolve #include <"+e+">");return Ol(n)}const Il=/#pragma unroll_loop[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g,Nl=/#pragma unroll_loop_start[\s]+?for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}[\s]+?#pragma unroll_loop_end/g;function Bl(t){return t.replace(Nl,Ul).replace(Il,Fl)}function Fl(t,e,n,i){return console.warn("WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead."),Ul(t,e,n,i)}function Ul(t,e,n,i){let r="";for(let o=parseInt(e);o<parseInt(n);o++)r+=i.replace(/\[ i \]/g,"[ "+o+" ]").replace(/UNROLLED_LOOP_INDEX/g,o);return r}function Gl(t){let e="precision "+t.precision+" float;\nprecision "+t.precision+" int;";return"highp"===t.precision?e+="\n#define HIGH_PRECISION":"mediump"===t.precision?e+="\n#define MEDIUM_PRECISION":"lowp"===t.precision&&(e+="\n#define LOW_PRECISION"),e}function zl(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===c?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===l?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===h&&(e="SHADOWMAP_TYPE_VSM"),e}function Hl(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case nt:case it:e="ENVMAP_TYPE_CUBE";break;case st:case at:e="ENVMAP_TYPE_CUBE_UV";break;case rt:case ot:e="ENVMAP_TYPE_EQUIREC"}return e}function kl(t){let e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case it:case ot:case at:e="ENVMAP_MODE_REFRACTION"}return e}function Vl(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case q:e="ENVMAP_BLENDING_MULTIPLY";break;case X:e="ENVMAP_BLENDING_MIX";break;case Y:e="ENVMAP_BLENDING_ADD"}return e}function jl(t,e,n,i){const r=t.getContext(),o=n.defines;let s=n.vertexShader,a=n.fragmentShader;const c=zl(n),l=Hl(n),h=kl(n),u=Vl(n),p=t.gammaFactor>0?t.gammaFactor:1,d=n.isWebGL2?"":Tl(n),f=El(o),m=r.createProgram();let g,v;n.isRawShaderMaterial?((g=[f].filter(Ll).join("\n")).length>0&&(g+="\n"),(v=[d,f].filter(Ll).join("\n")).length>0&&(v+="\n")):(g=[Gl(n),"#define SHADER_NAME "+n.shaderName,f,n.instancing?"#define USE_INSTANCING":"",n.supportsVertexTextures?"#define VERTEX_TEXTURES":"","#define GAMMA_FACTOR "+p,"#define MAX_BONES "+n.maxBones,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.displacementMap&&n.supportsVertexTextures?"#define USE_DISPLACEMENTMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.useVertexTexture?"#define BONE_TEXTURE":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&!1===n.flatShading?"#define USE_MORPHNORMALS":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_TANGENT","\tattribute vec4 tangent;","#endif","#ifdef USE_COLOR","\tattribute vec3 color;","#endif","#ifdef USE_MORPHTARGETS","\tattribute vec3 morphTarget0;","\tattribute vec3 morphTarget1;","\tattribute vec3 morphTarget2;","\tattribute vec3 morphTarget3;","\t#ifdef USE_MORPHNORMALS","\t\tattribute vec3 morphNormal0;","\t\tattribute vec3 morphNormal1;","\t\tattribute vec3 morphNormal2;","\t\tattribute vec3 morphNormal3;","\t#else","\t\tattribute vec3 morphTarget4;","\t\tattribute vec3 morphTarget5;","\t\tattribute vec3 morphTarget6;","\t\tattribute vec3 morphTarget7;","\t#endif","#endif","#ifdef USE_SKINNING","\tattribute vec4 skinIndex;","\tattribute vec4 skinWeight;","#endif","\n"].filter(Ll).join("\n"),v=[d,Gl(n),"#define SHADER_NAME "+n.shaderName,f,n.alphaTest?"#define ALPHATEST "+n.alphaTest+(n.alphaTest%1?"":".0"):"","#define GAMMA_FACTOR "+p,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+l:"",n.envMap?"#define "+h:"",n.envMap?"#define "+u:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMap&&n.objectSpaceNormalMap?"#define OBJECTSPACE_NORMALMAP":"",n.normalMap&&n.tangentSpaceNormalMap?"#define TANGENTSPACE_NORMALMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.sheen?"#define USE_SHEEN":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.vertexTangents?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexUvs?"#define USE_UV":"",n.uvsVertexOnly?"#define UVS_VERTEX_ONLY":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.physicallyCorrectLights?"#define PHYSICALLY_CORRECT_LIGHTS":"",n.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",n.logarithmicDepthBuffer&&n.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"",(n.extensionShaderTextureLOD||n.envMap)&&n.rendererExtensionShaderTextureLod?"#define TEXTURE_LOD_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==Z?"#define TONE_MAPPING":"",n.toneMapping!==Z?nc.tonemapping_pars_fragment:"",n.toneMapping!==Z?Sl("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",nc.encodings_pars_fragment,n.map?wl("mapTexelToLinear",n.mapEncoding):"",n.matcap?wl("matcapTexelToLinear",n.matcapEncoding):"",n.envMap?wl("envMapTexelToLinear",n.envMapEncoding):"",n.emissiveMap?wl("emissiveMapTexelToLinear",n.emissiveMapEncoding):"",n.lightMap?wl("lightMapTexelToLinear",n.lightMapEncoding):"",Ml("linearToOutputTexel",n.outputEncoding),n.depthPacking?"#define DEPTH_PACKING "+n.depthPacking:"","\n"].filter(Ll).join("\n")),s=Cl(s=Rl(s=Ol(s),n),n),a=Cl(a=Rl(a=Ol(a),n),n),s=Bl(s),a=Bl(a),n.isWebGL2&&!n.isRawShaderMaterial&&(g=["#version 300 es\n","#define attribute in","#define varying out","#define texture2D texture"].join("\n")+"\n"+g,v=["#version 300 es\n","#define varying in","out highp vec4 pc_fragColor;","#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"+v);const y=v+a,x=vl(r,35633,g+s),_=vl(r,35632,y);if(r.attachShader(m,x),r.attachShader(m,_),void 0!==n.index0AttributeName?r.bindAttribLocation(m,0,n.index0AttributeName):!0===n.morphTargets&&r.bindAttribLocation(m,0,"position"),r.linkProgram(m),t.debug.checkShaderErrors){const t=r.getProgramInfoLog(m).trim(),e=r.getShaderInfoLog(x).trim(),n=r.getShaderInfoLog(_).trim();let i=!0,o=!0;if(!1===r.getProgramParameter(m,35714)){i=!1;const e=bl(r,x,"vertex"),n=bl(r,_,"fragment");console.error("THREE.WebGLProgram: shader error: ",r.getError(),"35715",r.getProgramParameter(m,35715),"gl.getProgramInfoLog",t,e,n)}else""!==t?console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()",t):""!==e&&""!==n||(o=!1);o&&(this.diagnostics={runnable:i,programLog:t,vertexShader:{log:e,prefix:g},fragmentShader:{log:n,prefix:v}})}let b,w;return r.deleteShader(x),r.deleteShader(_),this.getUniforms=function(){return void 0===b&&(b=new gl(r,m)),b},this.getAttributes=function(){return void 0===w&&(w=Al(r,m)),w},this.destroy=function(){i.releaseStatesOfProgram(this),r.deleteProgram(m),this.program=void 0},this.name=n.shaderName,this.id=yl++,this.cacheKey=e,this.usedTimes=1,this.program=m,this.vertexShader=x,this.fragmentShader=_,this}function Wl(t,e,n,i){const r=[],o=n.isWebGL2,s=n.logarithmicDepthBuffer,a=n.floatVertexTextures,c=n.maxVertexUniforms,l=n.vertexTextures;let h=n.precision;const u={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"},f=["precision","isWebGL2","supportsVertexTextures","outputEncoding","instancing","map","mapEncoding","matcap","matcapEncoding","envMap","envMapMode","envMapEncoding","envMapCubeUV","lightMap","lightMapEncoding","aoMap","emissiveMap","emissiveMapEncoding","bumpMap","normalMap","objectSpaceNormalMap","tangentSpaceNormalMap","clearcoatMap","clearcoatRoughnessMap","clearcoatNormalMap","displacementMap","specularMap","roughnessMap","metalnessMap","gradientMap","alphaMap","combine","vertexColors","vertexTangents","vertexUvs","uvsVertexOnly","fog","useFog","fogExp2","flatShading","sizeAttenuation","logarithmicDepthBuffer","skinning","maxBones","useVertexTexture","morphTargets","morphNormals","maxMorphTargets","maxMorphNormals","premultipliedAlpha","numDirLights","numPointLights","numSpotLights","numHemiLights","numRectAreaLights","numDirLightShadows","numPointLightShadows","numSpotLightShadows","shadowMapEnabled","shadowMapType","toneMapping","physicallyCorrectLights","alphaTest","doubleSided","flipSided","numClippingPlanes","numClipIntersection","depthPacking","dithering","sheen","transmissionMap"];function m(t){let e;return t?t.isTexture?e=t.encoding:t.isWebGLRenderTarget&&(console.warn("THREE.WebGLPrograms.getTextureEncodingFromMap: don't use render targets as textures. Use their .texture property instead."),e=t.texture.encoding):e=Xe,e}return{getParameters:function(i,r,f,g,v,y,x){const _=g.fog,b=i.isMeshStandardMaterial?g.environment:null,w=i.envMap||b,M=u[i.type],S=x.isSkinnedMesh?function(t){const e=t.skeleton.bones;if(a)return 1024;{const t=c,n=Math.floor((t-20)/4),i=Math.min(n,e.length);return i<e.length?(console.warn("THREE.WebGLRenderer: Skeleton has "+e.length+" bones. This GPU supports "+i+"."),0):i}}(x):0;let T,E;if(null!==i.precision&&(h=n.getMaxPrecision(i.precision))!==i.precision&&console.warn("THREE.WebGLProgram.getParameters:",i.precision,"not supported, using",h,"instead."),M){const t=ic[M];T=t.vertexShader,E=t.fragmentShader}else T=i.vertexShader,E=i.fragmentShader;const A=t.getRenderTarget();return{isWebGL2:o,shaderID:M,shaderName:i.type,vertexShader:T,fragmentShader:E,defines:i.defines,isRawShaderMaterial:i.isRawShaderMaterial,isShaderMaterial:i.isShaderMaterial,precision:h,instancing:!0===x.isInstancedMesh,supportsVertexTextures:l,outputEncoding:null!==A?m(A.texture):t.outputEncoding,map:!!i.map,mapEncoding:m(i.map),matcap:!!i.matcap,matcapEncoding:m(i.matcap),envMap:!!w,envMapMode:w&&w.mapping,envMapEncoding:m(w),envMapCubeUV:!!w&&(w.mapping===st||w.mapping===at),lightMap:!!i.lightMap,lightMapEncoding:m(i.lightMap),aoMap:!!i.aoMap,emissiveMap:!!i.emissiveMap,emissiveMapEncoding:m(i.emissiveMap),bumpMap:!!i.bumpMap,normalMap:!!i.normalMap,objectSpaceNormalMap:i.normalMapType===on,tangentSpaceNormalMap:i.normalMapType===rn,clearcoatMap:!!i.clearcoatMap,clearcoatRoughnessMap:!!i.clearcoatRoughnessMap,clearcoatNormalMap:!!i.clearcoatNormalMap,displacementMap:!!i.displacementMap,roughnessMap:!!i.roughnessMap,metalnessMap:!!i.metalnessMap,specularMap:!!i.specularMap,alphaMap:!!i.alphaMap,gradientMap:!!i.gradientMap,sheen:!!i.sheen,transmissionMap:!!i.transmissionMap,combine:i.combine,vertexTangents:i.normalMap&&i.vertexTangents,vertexColors:i.vertexColors,vertexUvs:!!(i.map||i.bumpMap||i.normalMap||i.specularMap||i.alphaMap||i.emissiveMap||i.roughnessMap||i.metalnessMap||i.clearcoatMap||i.clearcoatRoughnessMap||i.clearcoatNormalMap||i.displacementMap||i.transmissionMap),uvsVertexOnly:!(i.map||i.bumpMap||i.normalMap||i.specularMap||i.alphaMap||i.emissiveMap||i.roughnessMap||i.metalnessMap||i.clearcoatNormalMap||i.transmissionMap||!i.displacementMap),fog:!!_,useFog:i.fog,fogExp2:_&&_.isFogExp2,flatShading:i.flatShading,sizeAttenuation:i.sizeAttenuation,logarithmicDepthBuffer:s,skinning:i.skinning&&S>0,maxBones:S,useVertexTexture:a,morphTargets:i.morphTargets,morphNormals:i.morphNormals,maxMorphTargets:t.maxMorphTargets,maxMorphNormals:t.maxMorphNormals,numDirLights:r.directional.length,numPointLights:r.point.length,numSpotLights:r.spot.length,numRectAreaLights:r.rectArea.length,numHemiLights:r.hemi.length,numDirLightShadows:r.directionalShadowMap.length,numPointLightShadows:r.pointShadowMap.length,numSpotLightShadows:r.spotShadowMap.length,numClippingPlanes:v,numClipIntersection:y,dithering:i.dithering,shadowMapEnabled:t.shadowMap.enabled&&f.length>0,shadowMapType:t.shadowMap.type,toneMapping:i.toneMapped?t.toneMapping:Z,physicallyCorrectLights:t.physicallyCorrectLights,premultipliedAlpha:i.premultipliedAlpha,alphaTest:i.alphaTest,doubleSided:i.side===d,flipSided:i.side===p,depthPacking:void 0!==i.depthPacking&&i.depthPacking,index0AttributeName:i.index0AttributeName,extensionDerivatives:i.extensions&&i.extensions.derivatives,extensionFragDepth:i.extensions&&i.extensions.fragDepth,extensionDrawBuffers:i.extensions&&i.extensions.drawBuffers,extensionShaderTextureLOD:i.extensions&&i.extensions.shaderTextureLOD,rendererExtensionFragDepth:o||null!==e.get("EXT_frag_depth"),rendererExtensionDrawBuffers:o||null!==e.get("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:o||null!==e.get("EXT_shader_texture_lod"),customProgramCacheKey:i.customProgramCacheKey()}},getProgramCacheKey:function(e){const n=[];if(e.shaderID?n.push(e.shaderID):(n.push(e.fragmentShader),n.push(e.vertexShader)),void 0!==e.defines)for(const t in e.defines)n.push(t),n.push(e.defines[t]);if(void 0===e.isRawShaderMaterial){for(let t=0;t<f.length;t++)n.push(e[f[t]]);n.push(t.outputEncoding),n.push(t.gammaFactor)}return n.push(e.customProgramCacheKey),n.join()},getUniforms:function(t){const e=u[t.type];let n;if(e){const t=ic[e];n=go.clone(t.uniforms)}else n=t.uniforms;return n},acquireProgram:function(e,n){let o;for(let t=0,i=r.length;t<i;t++){const e=r[t];if(e.cacheKey===n){++(o=e).usedTimes;break}}return void 0===o&&(o=new jl(t,n,e,i),r.push(o)),o},releaseProgram:function(t){if(0==--t.usedTimes){const e=r.indexOf(t);r[e]=r[r.length-1],r.pop(),t.destroy()}},programs:r}}function ql(){let t=new WeakMap;return{get:function(e){let n=t.get(e);return void 0===n&&(n={},t.set(e,n)),n},remove:function(e){t.delete(e)},update:function(e,n,i){t.get(e)[n]=i},dispose:function(){t=new WeakMap}}}function Xl(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.program!==e.program?t.program.id-e.program.id:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function Yl(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function Zl(t){const e=[];let n=0;const i=[],r=[],o={id:-1};function s(i,r,s,a,c,l){let h=e[n];const u=t.get(s);return void 0===h?(h={id:i.id,object:i,geometry:r,material:s,program:u.program||o,groupOrder:a,renderOrder:i.renderOrder,z:c,group:l},e[n]=h):(h.id=i.id,h.object=i,h.geometry=r,h.material=s,h.program=u.program||o,h.groupOrder=a,h.renderOrder=i.renderOrder,h.z=c,h.group=l),n++,h}return{opaque:i,transparent:r,init:function(){n=0,i.length=0,r.length=0},push:function(t,e,n,o,a,c){const l=s(t,e,n,o,a,c);(!0===n.transparent?r:i).push(l)},unshift:function(t,e,n,o,a,c){const l=s(t,e,n,o,a,c);(!0===n.transparent?r:i).unshift(l)},finish:function(){for(let t=n,i=e.length;t<i;t++){const n=e[t];if(null===n.id)break;n.id=null,n.object=null,n.geometry=null,n.material=null,n.program=null,n.group=null}},sort:function(t,e){i.length>1&&i.sort(t||Xl),r.length>1&&r.sort(e||Yl)}}}function Jl(t){let e=new WeakMap;function n(t){const i=t.target;i.removeEventListener("dispose",n),e.delete(i)}return{get:function(i,r){const o=e.get(i);let s;return void 0===o?(s=new Zl(t),e.set(i,new WeakMap),e.get(i).set(r,s),i.addEventListener("dispose",n)):void 0===(s=o.get(r))&&(s=new Zl(t),o.set(r,s)),s},dispose:function(){e=new WeakMap}}}function Ql(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new Xn,color:new hr};break;case"SpotLight":n={position:new Xn,direction:new Xn,color:new hr,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new Xn,color:new hr,distance:0,decay:0};break;case"HemisphereLight":n={direction:new Xn,skyColor:new hr,groundColor:new hr};break;case"RectAreaLight":n={color:new hr,position:new Xn,halfWidth:new Xn,halfHeight:new Xn}}return t[e.id]=n,n}}}function Kl(){const t={};return{get:function(e){if(void 0!==t[e.id])return t[e.id];let n;switch(e.type){case"DirectionalLight":case"SpotLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Nn};break;case"PointLight":n={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new Nn,shadowCameraNear:1,shadowCameraFar:1e3}}return t[e.id]=n,n}}}let $l=0;function th(t,e){return(e.castShadow?1:0)-(t.castShadow?1:0)}function eh(){const t=new Ql,e=Kl(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotShadow:[],spotShadowMap:[],spotShadowMatrix:[],rectArea:[],point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[]};for(let s=0;s<9;s++)n.probe.push(new Xn);const i=new Xn,r=new ei,o=new ei;return{setup:function(s,a,c){let l=0,h=0,u=0;for(let t=0;t<9;t++)n.probe[t].set(0,0,0);let p=0,d=0,f=0,m=0,g=0,v=0,y=0,x=0;const _=c.matrixWorldInverse;s.sort(th);for(let w=0,M=s.length;w<M;w++){const a=s[w],c=a.color,b=a.intensity,M=a.distance,S=a.shadow&&a.shadow.map?a.shadow.map.texture:null;if(a.isAmbientLight)l+=c.r*b,h+=c.g*b,u+=c.b*b;else if(a.isLightProbe)for(let t=0;t<9;t++)n.probe[t].addScaledVector(a.sh.coefficients[t],b);else if(a.isDirectionalLight){const r=t.get(a);if(r.color.copy(a.color).multiplyScalar(a.intensity),r.direction.setFromMatrixPosition(a.matrixWorld),i.setFromMatrixPosition(a.target.matrixWorld),r.direction.sub(i),r.direction.transformDirection(_),a.castShadow){const t=a.shadow,i=e.get(a);i.shadowBias=t.bias,i.shadowNormalBias=t.normalBias,i.shadowRadius=t.radius,i.shadowMapSize=t.mapSize,n.directionalShadow[p]=i,n.directionalShadowMap[p]=S,n.directionalShadowMatrix[p]=a.shadow.matrix,v++}n.directional[p]=r,p++}else if(a.isSpotLight){const r=t.get(a);if(r.position.setFromMatrixPosition(a.matrixWorld),r.position.applyMatrix4(_),r.color.copy(c).multiplyScalar(b),r.distance=M,r.direction.setFromMatrixPosition(a.matrixWorld),i.setFromMatrixPosition(a.target.matrixWorld),r.direction.sub(i),r.direction.transformDirection(_),r.coneCos=Math.cos(a.angle),r.penumbraCos=Math.cos(a.angle*(1-a.penumbra)),r.decay=a.decay,a.castShadow){const t=a.shadow,i=e.get(a);i.shadowBias=t.bias,i.shadowNormalBias=t.normalBias,i.shadowRadius=t.radius,i.shadowMapSize=t.mapSize,n.spotShadow[f]=i,n.spotShadowMap[f]=S,n.spotShadowMatrix[f]=a.shadow.matrix,x++}n.spot[f]=r,f++}else if(a.isRectAreaLight){const e=t.get(a);e.color.copy(c).multiplyScalar(b),e.position.setFromMatrixPosition(a.matrixWorld),e.position.applyMatrix4(_),o.identity(),r.copy(a.matrixWorld),r.premultiply(_),o.extractRotation(r),e.halfWidth.set(.5*a.width,0,0),e.halfHeight.set(0,.5*a.height,0),e.halfWidth.applyMatrix4(o),e.halfHeight.applyMatrix4(o),n.rectArea[m]=e,m++}else if(a.isPointLight){const i=t.get(a);if(i.position.setFromMatrixPosition(a.matrixWorld),i.position.applyMatrix4(_),i.color.copy(a.color).multiplyScalar(a.intensity),i.distance=a.distance,i.decay=a.decay,a.castShadow){const t=a.shadow,i=e.get(a);i.shadowBias=t.bias,i.shadowNormalBias=t.normalBias,i.shadowRadius=t.radius,i.shadowMapSize=t.mapSize,i.shadowCameraNear=t.camera.near,i.shadowCameraFar=t.camera.far,n.pointShadow[d]=i,n.pointShadowMap[d]=S,n.pointShadowMatrix[d]=a.shadow.matrix,y++}n.point[d]=i,d++}else if(a.isHemisphereLight){const e=t.get(a);e.direction.setFromMatrixPosition(a.matrixWorld),e.direction.transformDirection(_),e.direction.normalize(),e.skyColor.copy(a.color).multiplyScalar(b),e.groundColor.copy(a.groundColor).multiplyScalar(b),n.hemi[g]=e,g++}}n.ambient[0]=l,n.ambient[1]=h,n.ambient[2]=u;const b=n.hash;b.directionalLength===p&&b.pointLength===d&&b.spotLength===f&&b.rectAreaLength===m&&b.hemiLength===g&&b.numDirectionalShadows===v&&b.numPointShadows===y&&b.numSpotShadows===x||(n.directional.length=p,n.spot.length=f,n.rectArea.length=m,n.point.length=d,n.hemi.length=g,n.directionalShadow.length=v,n.directionalShadowMap.length=v,n.pointShadow.length=y,n.pointShadowMap.length=y,n.spotShadow.length=x,n.spotShadowMap.length=x,n.directionalShadowMatrix.length=v,n.pointShadowMatrix.length=y,n.spotShadowMatrix.length=x,b.directionalLength=p,b.pointLength=d,b.spotLength=f,b.rectAreaLength=m,b.hemiLength=g,b.numDirectionalShadows=v,b.numPointShadows=y,b.numSpotShadows=x,n.version=$l++)},state:n}}function nh(){const t=new eh,e=[],n=[];return{init:function(){e.length=0,n.length=0},state:{lightsArray:e,shadowsArray:n,lights:t},setupLights:function(i){t.setup(e,n,i)},pushLight:function(t){e.push(t)},pushShadow:function(t){n.push(t)}}}function ih(){let t=new WeakMap;function e(n){const i=n.target;i.removeEventListener("dispose",e),t.delete(i)}return{get:function(n,i){let r;return!1===t.has(n)?(r=new nh,t.set(n,new WeakMap),t.get(n).set(i,r),n.addEventListener("dispose",e)):!1===t.get(n).has(i)?(r=new nh,t.get(n).set(i,r)):r=t.get(n).get(i),r},dispose:function(){t=new WeakMap}}}function rh(t){gr.call(this),this.type="MeshDepthMaterial",this.depthPacking=en,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.setValues(t)}function oh(t){gr.call(this),this.type="MeshDistanceMaterial",this.referencePosition=new Xn,this.nearDistance=1,this.farDistance=1e3,this.skinning=!1,this.morphTargets=!1,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.fog=!1,this.setValues(t)}rh.prototype=Object.create(gr.prototype),rh.prototype.constructor=rh,rh.prototype.isMeshDepthMaterial=!0,rh.prototype.copy=function(t){return gr.prototype.copy.call(this,t),this.depthPacking=t.depthPacking,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this},oh.prototype=Object.create(gr.prototype),oh.prototype.constructor=oh,oh.prototype.isMeshDistanceMaterial=!0,oh.prototype.copy=function(t){return gr.prototype.copy.call(this,t),this.referencePosition.copy(t.referencePosition),this.nearDistance=t.nearDistance,this.farDistance=t.farDistance,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.map=t.map,this.alphaMap=t.alphaMap,this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this};var sh="uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\n#include <packing>\nvoid main() {\n float mean = 0.0;\n float squared_mean = 0.0;\n\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy ) / resolution ) );\n for ( float i = -1.0; i < 1.0 ; i += SAMPLE_RATE) {\n #ifdef HORIZONAL_PASS\n vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( i, 0.0 ) * radius ) / resolution ) );\n mean += distribution.x;\n squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n #else\n float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, i ) * radius ) / resolution ) );\n mean += depth;\n squared_mean += depth * depth;\n #endif\n }\n mean = mean * HALF_SAMPLE_RATE;\n squared_mean = squared_mean * HALF_SAMPLE_RATE;\n float std_dev = sqrt( squared_mean - mean * mean );\n gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\n}",ah="void main() {\n\tgl_Position = vec4( position, 1.0 );\n}";function ch(t,e,n){let i=new Ro;const r=new Nn,o=new Nn,s=new Hn,a=[],l=[],f={},m={0:p,1:u,2:d},v=new xo({defines:{SAMPLE_RATE:.25,HALF_SAMPLE_RATE:1/8},uniforms:{shadow_pass:{value:null},resolution:{value:new Nn},radius:{value:4}},vertexShader:ah,fragmentShader:sh}),y=v.clone();y.defines.HORIZONAL_PASS=1;const x=new Gr;x.setAttribute("position",new _r(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new io(x,v),b=this;function w(n,i){const r=e.update(_);v.uniforms.shadow_pass.value=n.map.texture,v.uniforms.resolution.value=n.mapSize,v.uniforms.radius.value=n.radius,t.setRenderTarget(n.mapPass),t.clear(),t.renderBufferDirect(i,null,r,v,_,null),y.uniforms.shadow_pass.value=n.mapPass.texture,y.uniforms.resolution.value=n.mapSize,y.uniforms.radius.value=n.radius,t.setRenderTarget(n.map),t.clear(),t.renderBufferDirect(i,null,r,y,_,null)}function M(t,e,n){const i=t<<0|e<<1|n<<2;let r=a[i];return void 0===r&&(r=new rh({depthPacking:nn,morphTargets:t,skinning:e}),a[i]=r),r}function S(t,e,n){const i=t<<0|e<<1|n<<2;let r=l[i];return void 0===r&&(r=new oh({morphTargets:t,skinning:e}),l[i]=r),r}function T(e,n,i,r,o,s,a){let c=null,l=M,u=e.customDepthMaterial;if(!0===r.isPointLight&&(l=S,u=e.customDistanceMaterial),void 0===u){let t=!1;!0===i.morphTargets&&(t=n.morphAttributes&&n.morphAttributes.position&&n.morphAttributes.position.length>0);let r=!1;!0===e.isSkinnedMesh&&(!0===i.skinning?r=!0:console.warn("THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:",e)),c=l(t,r,!0===e.isInstancedMesh)}else c=u;if(t.localClippingEnabled&&!0===i.clipShadows&&0!==i.clippingPlanes.length){const t=c.uuid,e=i.uuid;let n=f[t];void 0===n&&(n={},f[t]=n);let r=n[e];void 0===r&&(r=c.clone(),n[e]=r),c=r}return c.visible=i.visible,c.wireframe=i.wireframe,c.side=a===h?null!==i.shadowSide?i.shadowSide:i.side:null!==i.shadowSide?i.shadowSide:m[i.side],c.clipShadows=i.clipShadows,c.clippingPlanes=i.clippingPlanes,c.clipIntersection=i.clipIntersection,c.wireframeLinewidth=i.wireframeLinewidth,c.linewidth=i.linewidth,!0===r.isPointLight&&!0===c.isMeshDistanceMaterial&&(c.referencePosition.setFromMatrixPosition(r.matrixWorld),c.nearDistance=o,c.farDistance=s),c}function E(n,r,o,s,a){if(!1===n.visible)return;if(n.layers.test(r.layers)&&(n.isMesh||n.isLine||n.isPoints)&&(n.castShadow||n.receiveShadow&&a===h)&&(!n.frustumCulled||i.intersectsObject(n))){n.modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,n.matrixWorld);const i=e.update(n),r=n.material;if(Array.isArray(r)){const e=i.groups;for(let c=0,l=e.length;c<l;c++){const l=e[c],h=r[l.materialIndex];if(h&&h.visible){const e=T(n,i,h,s,o.near,o.far,a);t.renderBufferDirect(o,null,i,e,n,l)}}}else if(r.visible){const e=T(n,i,r,s,o.near,o.far,a);t.renderBufferDirect(o,null,i,e,n,null)}}const c=n.children;for(let t=0,e=c.length;t<e;t++)E(c[t],r,o,s,a)}this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=c,this.render=function(e,a,c){if(!1===b.enabled)return;if(!1===b.autoUpdate&&!1===b.needsUpdate)return;if(0===e.length)return;const l=t.getRenderTarget(),u=t.getActiveCubeFace(),p=t.getActiveMipmapLevel(),d=t.state;d.setBlending(g),d.buffers.color.setClear(1,1,1,1),d.buffers.depth.setTest(!0),d.setScissorTest(!1);for(let f=0,m=e.length;f<m;f++){const l=e[f],u=l.shadow;if(!1===u.autoUpdate&&!1===u.needsUpdate)continue;if(void 0===u){console.warn("THREE.WebGLShadowMap:",l,"has no shadow.");continue}r.copy(u.mapSize);const p=u.getFrameExtents();if(r.multiply(p),o.copy(u.mapSize),(r.x>n||r.y>n)&&(r.x>n&&(o.x=Math.floor(n/p.x),r.x=o.x*p.x,u.mapSize.x=o.x),r.y>n&&(o.y=Math.floor(n/p.y),r.y=o.y*p.y,u.mapSize.y=o.y)),null===u.map&&!u.isPointLightShadow&&this.type===h){const t={minFilter:gt,magFilter:gt,format:Nt,stencilBuffer:!1};u.map=new kn(r.x,r.y,t),u.map.texture.name=l.name+".shadowMap",u.mapPass=new kn(r.x,r.y,t),u.camera.updateProjectionMatrix()}if(null===u.map){const t={minFilter:ut,magFilter:ut,format:Nt,stencilBuffer:!1};u.map=new kn(r.x,r.y,t),u.map.texture.name=l.name+".shadowMap",u.camera.updateProjectionMatrix()}t.setRenderTarget(u.map),t.clear();const m=u.getViewportCount();for(let t=0;t<m;t++){const e=u.getViewport(t);s.set(o.x*e.x,o.y*e.y,o.x*e.z,o.y*e.w),d.viewport(s),u.updateMatrices(l,t),i=u.getFrustum(),E(a,c,u.camera,l,this.type)}u.isPointLightShadow||this.type!==h||w(u,c),u.needsUpdate=!1}b.needsUpdate=!1,t.setRenderTarget(l,u,p)}}function lh(t,e,n){const s=n.isWebGL2;const a=new function(){let e=!1;const n=new Hn;let i=null;const r=new Hn(0,0,0,0);return{setMask:function(n){i===n||e||(t.colorMask(n,n,n,n),i=n)},setLocked:function(t){e=t},setClear:function(e,i,o,s,a){!0===a&&(e*=s,i*=s,o*=s),n.set(e,i,o,s),!1===r.equals(n)&&(t.clearColor(e,i,o,s),r.copy(n))},reset:function(){e=!1,i=null,r.set(-1,0,0,0)}}},c=new function(){let e=!1,n=null,i=null,r=null;return{setTest:function(t){t?ft(2929):mt(2929)},setMask:function(i){n===i||e||(t.depthMask(i),n=i)},setFunc:function(e){if(i!==e){if(e)switch(e){case U:t.depthFunc(512);break;case G:t.depthFunc(519);break;case z:t.depthFunc(513);break;case H:t.depthFunc(515);break;case k:t.depthFunc(514);break;case V:t.depthFunc(518);break;case j:t.depthFunc(516);break;case W:t.depthFunc(517);break;default:t.depthFunc(515)}else t.depthFunc(515);i=e}},setLocked:function(t){e=t},setClear:function(e){r!==e&&(t.clearDepth(e),r=e)},reset:function(){e=!1,n=null,i=null,r=null}}},l=new function(){let e=!1,n=null,i=null,r=null,o=null,s=null,a=null,c=null,l=null;return{setTest:function(t){e||(t?ft(2960):mt(2960))},setMask:function(i){n===i||e||(t.stencilMask(i),n=i)},setFunc:function(e,n,s){i===e&&r===n&&o===s||(t.stencilFunc(e,n,s),i=e,r=n,o=s)},setOp:function(e,n,i){s===e&&a===n&&c===i||(t.stencilOp(e,n,i),s=e,a=n,c=i)},setLocked:function(t){e=t},setClear:function(e){l!==e&&(t.clearStencil(e),l=e)},reset:function(){e=!1,n=null,i=null,r=null,o=null,s=null,a=null,c=null,l=null}}};let h={},u=null,f=null,m=null,q=null,X=null,Y=null,Z=null,J=null,Q=null,K=!1,$=null,tt=null,et=null,nt=null,it=null;const rt=t.getParameter(35661);let ot=!1,st=0;const at=t.getParameter(7938);-1!==at.indexOf("WebGL")?(st=parseFloat(/^WebGL\ ([0-9])/.exec(at)[1]),ot=st>=1):-1!==at.indexOf("OpenGL ES")&&(st=parseFloat(/^OpenGL\ ES\ ([0-9])/.exec(at)[1]),ot=st>=2);let ct=null,lt={};const ht=new Hn,ut=new Hn;function pt(e,n,i){const r=new Uint8Array(4),o=t.createTexture();t.bindTexture(e,o),t.texParameteri(e,10241,9728),t.texParameteri(e,10240,9728);for(let s=0;s<i;s++)t.texImage2D(n+s,0,6408,1,1,0,6408,5121,r);return o}const dt={};function ft(e){!0!==h[e]&&(t.enable(e),h[e]=!0)}function mt(e){!1!==h[e]&&(t.disable(e),h[e]=!1)}dt[3553]=pt(3553,3553,1),dt[34067]=pt(34067,34069,6),a.setClear(0,0,0,1),c.setClear(1),l.setClear(0),ft(2929),c.setFunc(H),xt(!1),_t(r),ft(2884),yt(g);const gt={[w]:32774,[M]:32778,[S]:32779};if(s)gt[T]=32775,gt[E]=32776;else{const t=e.get("EXT_blend_minmax");null!==t&&(gt[T]=t.MIN_EXT,gt[E]=t.MAX_EXT)}const vt={[A]:0,[L]:1,[R]:768,[P]:770,[F]:776,[N]:774,[D]:772,[C]:769,[O]:771,[B]:775,[I]:773};function yt(e,n,i,r,o,s,a,c){if(e!==g){if(f||(ft(3042),f=!0),e===b)o=o||n,s=s||i,a=a||r,n===q&&o===Z||(t.blendEquationSeparate(gt[n],gt[o]),q=n,Z=o),i===X&&r===Y&&s===J&&a===Q||(t.blendFuncSeparate(vt[i],vt[r],vt[s],vt[a]),X=i,Y=r,J=s,Q=a),m=e,K=null;else if(e!==m||c!==K){if(q===w&&Z===w||(t.blendEquation(32774),q=w,Z=w),c)switch(e){case v:t.blendFuncSeparate(1,771,1,771);break;case y:t.blendFunc(1,1);break;case x:t.blendFuncSeparate(0,0,769,771);break;case _:t.blendFuncSeparate(0,768,0,770);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}else switch(e){case v:t.blendFuncSeparate(770,771,1,771);break;case y:t.blendFunc(770,1);break;case x:t.blendFunc(0,769);break;case _:t.blendFunc(0,768);break;default:console.error("THREE.WebGLState: Invalid blending: ",e)}X=null,Y=null,J=null,Q=null,m=e,K=c}}else f&&(mt(3042),f=!1)}function xt(e){$!==e&&(e?t.frontFace(2304):t.frontFace(2305),$=e)}function _t(e){e!==i?(ft(2884),e!==tt&&(e===r?t.cullFace(1029):e===o?t.cullFace(1028):t.cullFace(1032))):mt(2884),tt=e}function bt(e,n,i){e?(ft(32823),nt===n&&it===i||(t.polygonOffset(n,i),nt=n,it=i)):mt(32823)}function wt(e){void 0===e&&(e=33984+rt-1),ct!==e&&(t.activeTexture(e),ct=e)}return{buffers:{color:a,depth:c,stencil:l},enable:ft,disable:mt,useProgram:function(e){return u!==e&&(t.useProgram(e),u=e,!0)},setBlending:yt,setMaterial:function(t,e){t.side===d?mt(2884):ft(2884);let n=t.side===p;e&&(n=!n),xt(n),t.blending===v&&!1===t.transparent?yt(g):yt(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha,t.premultipliedAlpha),c.setFunc(t.depthFunc),c.setTest(t.depthTest),c.setMask(t.depthWrite),a.setMask(t.colorWrite);const i=t.stencilWrite;l.setTest(i),i&&(l.setMask(t.stencilWriteMask),l.setFunc(t.stencilFunc,t.stencilRef,t.stencilFuncMask),l.setOp(t.stencilFail,t.stencilZFail,t.stencilZPass)),bt(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)},setFlipSided:xt,setCullFace:_t,setLineWidth:function(e){e!==et&&(ot&&t.lineWidth(e),et=e)},setPolygonOffset:bt,setScissorTest:function(t){t?ft(3089):mt(3089)},activeTexture:wt,bindTexture:function(e,n){null===ct&&wt();let i=lt[ct];void 0===i&&(i={type:void 0,texture:void 0},lt[ct]=i),i.type===e&&i.texture===n||(t.bindTexture(e,n||dt[e]),i.type=e,i.texture=n)},unbindTexture:function(){const e=lt[ct];void 0!==e&&void 0!==e.type&&(t.bindTexture(e.type,null),e.type=void 0,e.texture=void 0)},compressedTexImage2D:function(){try{t.compressedTexImage2D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage2D:function(){try{t.texImage2D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},texImage3D:function(){try{t.texImage3D.apply(t,arguments)}catch(e){console.error("THREE.WebGLState:",e)}},scissor:function(e){!1===ht.equals(e)&&(t.scissor(e.x,e.y,e.z,e.w),ht.copy(e))},viewport:function(e){!1===ut.equals(e)&&(t.viewport(e.x,e.y,e.z,e.w),ut.copy(e))},reset:function(){h={},ct=null,lt={},u=null,m=null,$=null,tt=null,a.reset(),c.reset(),l.reset()}}}function hh(t,e,n,i,r,o,s){const a=r.isWebGL2,c=r.maxTextures,l=r.maxCubemapSize,h=r.maxTextureSize,u=r.maxSamples,p=new WeakMap;let d,f=!1;try{f="undefined"!=typeof OffscreenCanvas&&null!==new OffscreenCanvas(1,1).getContext("2d")}catch(G){}function m(t,e){return f?new OffscreenCanvas(t,e):document.createElementNS("http://www.w3.org/1999/xhtml","canvas")}function g(t,e,n,i){let r=1;if((t.width>i||t.height>i)&&(r=i/Math.max(t.width,t.height)),r<1||!0===e){if("undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement||"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap){const i=e?In.floorPowerOfTwo:Math.floor,o=i(r*t.width),s=i(r*t.height);void 0===d&&(d=m(o,s));const a=n?m(o,s):d;return a.width=o,a.height=s,a.getContext("2d").drawImage(t,0,0,o,s),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+t.width+"x"+t.height+") to ("+o+"x"+s+")."),a}return"data"in t&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+t.width+"x"+t.height+")."),t}return t}function v(t){return In.isPowerOfTwo(t.width)&&In.isPowerOfTwo(t.height)}function y(t,e){return t.generateMipmaps&&e&&t.minFilter!==ut&&t.minFilter!==gt}function x(e,n,r,o){t.generateMipmap(e),i.get(n).__maxMipLevel=Math.log(Math.max(r,o))*Math.LOG2E}function _(n,i,r){if(!1===a)return i;if(null!==n){if(void 0!==t[n])return t[n];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+n+"'")}let o=i;return 6403===i&&(5126===r&&(o=33326),5131===r&&(o=33325),5121===r&&(o=33321)),6407===i&&(5126===r&&(o=34837),5131===r&&(o=34843),5121===r&&(o=32849)),6408===i&&(5126===r&&(o=34836),5131===r&&(o=34842),5121===r&&(o=32856)),33325!==o&&33326!==o&&34842!==o&&34836!==o||e.get("EXT_color_buffer_float"),o}function b(t){return t===ut||t===pt||t===ft?9728:9729}function w(e){const n=e.target;n.removeEventListener("dispose",w),function(e){const n=i.get(e);if(void 0===n.__webglInit)return;t.deleteTexture(n.__webglTexture),i.remove(e)}(n),n.isVideoTexture&&p.delete(n),s.memory.textures--}function M(e){const n=e.target;n.removeEventListener("dispose",M),function(e){const n=i.get(e),r=i.get(e.texture);if(!e)return;void 0!==r.__webglTexture&&t.deleteTexture(r.__webglTexture);e.depthTexture&&e.depthTexture.dispose();if(e.isWebGLCubeRenderTarget)for(let i=0;i<6;i++)t.deleteFramebuffer(n.__webglFramebuffer[i]),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer[i]);else t.deleteFramebuffer(n.__webglFramebuffer),n.__webglDepthbuffer&&t.deleteRenderbuffer(n.__webglDepthbuffer),n.__webglMultisampledFramebuffer&&t.deleteFramebuffer(n.__webglMultisampledFramebuffer),n.__webglColorRenderbuffer&&t.deleteRenderbuffer(n.__webglColorRenderbuffer),n.__webglDepthRenderbuffer&&t.deleteRenderbuffer(n.__webglDepthRenderbuffer);i.remove(e.texture),i.remove(e)}(n),s.memory.textures--}let S=0;function T(t,e){const r=i.get(t);if(t.isVideoTexture&&function(t){const e=s.render.frame;p.get(t)!==e&&(p.set(t,e),t.update())}(t),t.version>0&&r.__version!==t.version){const n=t.image;if(void 0===n)console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined");else{if(!1!==n.complete)return void O(r,t,e);console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete")}}n.activeTexture(33984+e),n.bindTexture(3553,r.__webglTexture)}function E(e,r){if(6!==e.image.length)return;const s=i.get(e);if(e.version>0&&s.__version!==e.version){P(s,e),n.activeTexture(33984+r),n.bindTexture(34067,s.__webglTexture),t.pixelStorei(37440,e.flipY);const i=e&&(e.isCompressedTexture||e.image[0].isCompressedTexture),c=e.image[0]&&e.image[0].isDataTexture,h=[];for(let t=0;t<6;t++)h[t]=i||c?c?e.image[t].image:e.image[t]:g(e.image[t],!1,!0,l);const u=h[0],p=v(u)||a,d=o.convert(e.format),f=o.convert(e.type),m=_(e.internalFormat,d,f);let b;if(C(34067,e,p),i){for(let t=0;t<6;t++){b=h[t].mipmaps;for(let i=0;i<b.length;i++){const r=b[i];e.format!==Nt&&e.format!==It?null!==d?n.compressedTexImage2D(34069+t,i,m,r.width,r.height,0,r.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):n.texImage2D(34069+t,i,m,r.width,r.height,0,d,f,r.data)}}s.__maxMipLevel=b.length-1}else{b=e.mipmaps;for(let t=0;t<6;t++)if(c){n.texImage2D(34069+t,0,m,h[t].width,h[t].height,0,d,f,h[t].data);for(let e=0;e<b.length;e++){const i=b[e].image[t].image;n.texImage2D(34069+t,e+1,m,i.width,i.height,0,d,f,i.data)}}else{n.texImage2D(34069+t,0,m,d,f,h[t]);for(let e=0;e<b.length;e++){const i=b[e];n.texImage2D(34069+t,e+1,m,d,f,i.image[t])}}s.__maxMipLevel=b.length}y(e,p)&&x(34067,e,u.width,u.height),s.__version=e.version,e.onUpdate&&e.onUpdate(e)}else n.activeTexture(33984+r),n.bindTexture(34067,s.__webglTexture)}function A(t,e){n.activeTexture(33984+e),n.bindTexture(34067,i.get(t).__webglTexture)}const L={[ct]:10497,[lt]:33071,[ht]:33648},R={[ut]:9728,[pt]:9984,[ft]:9986,[gt]:9729,[vt]:9985,[xt]:9987};function C(n,o,s){s?(t.texParameteri(n,10242,L[o.wrapS]),t.texParameteri(n,10243,L[o.wrapT]),32879!==n&&35866!==n||t.texParameteri(n,32882,L[o.wrapR]),t.texParameteri(n,10240,R[o.magFilter]),t.texParameteri(n,10241,R[o.minFilter])):(t.texParameteri(n,10242,33071),t.texParameteri(n,10243,33071),32879!==n&&35866!==n||t.texParameteri(n,32882,33071),o.wrapS===lt&&o.wrapT===lt||console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),t.texParameteri(n,10240,b(o.magFilter)),t.texParameteri(n,10241,b(o.minFilter)),o.minFilter!==ut&&o.minFilter!==gt&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter."));const c=e.get("EXT_texture_filter_anisotropic");if(c){if(o.type===At&&null===e.get("OES_texture_float_linear"))return;if(o.type===Lt&&null===(a||e.get("OES_texture_half_float_linear")))return;(o.anisotropy>1||i.get(o).__currentAnisotropy)&&(t.texParameterf(n,c.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(o.anisotropy,r.getMaxAnisotropy())),i.get(o).__currentAnisotropy=o.anisotropy)}}function P(e,n){void 0===e.__webglInit&&(e.__webglInit=!0,n.addEventListener("dispose",w),e.__webglTexture=t.createTexture(),s.memory.textures++)}function O(e,i,r){let s=3553;i.isDataTexture2DArray&&(s=35866),i.isDataTexture3D&&(s=32879),P(e,i),n.activeTexture(33984+r),n.bindTexture(s,e.__webglTexture),t.pixelStorei(37440,i.flipY),t.pixelStorei(37441,i.premultiplyAlpha),t.pixelStorei(3317,i.unpackAlignment);const c=function(t){return!a&&(t.wrapS!==lt||t.wrapT!==lt||t.minFilter!==ut&&t.minFilter!==gt)}(i)&&!1===v(i.image),l=g(i.image,c,!1,h),u=v(l)||a,p=o.convert(i.format);let d,f=o.convert(i.type),m=_(i.internalFormat,p,f);C(s,i,u);const b=i.mipmaps;if(i.isDepthTexture)m=6402,a?m=i.type===At?36012:i.type===Et?33190:i.type===Ot?35056:33189:i.type===At&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),i.format===Gt&&6402===m&&i.type!==St&&i.type!==Et&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),i.type=St,f=o.convert(i.type)),i.format===zt&&6402===m&&(m=34041,i.type!==Ot&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),i.type=Ot,f=o.convert(i.type))),n.texImage2D(3553,0,m,l.width,l.height,0,p,f,null);else if(i.isDataTexture)if(b.length>0&&u){for(let t=0,e=b.length;t<e;t++)d=b[t],n.texImage2D(3553,t,m,d.width,d.height,0,p,f,d.data);i.generateMipmaps=!1,e.__maxMipLevel=b.length-1}else n.texImage2D(3553,0,m,l.width,l.height,0,p,f,l.data),e.__maxMipLevel=0;else if(i.isCompressedTexture){for(let t=0,e=b.length;t<e;t++)d=b[t],i.format!==Nt&&i.format!==It?null!==p?n.compressedTexImage2D(3553,t,m,d.width,d.height,0,d.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):n.texImage2D(3553,t,m,d.width,d.height,0,p,f,d.data);e.__maxMipLevel=b.length-1}else if(i.isDataTexture2DArray)n.texImage3D(35866,0,m,l.width,l.height,l.depth,0,p,f,l.data),e.__maxMipLevel=0;else if(i.isDataTexture3D)n.texImage3D(32879,0,m,l.width,l.height,l.depth,0,p,f,l.data),e.__maxMipLevel=0;else if(b.length>0&&u){for(let t=0,e=b.length;t<e;t++)d=b[t],n.texImage2D(3553,t,m,p,f,d);i.generateMipmaps=!1,e.__maxMipLevel=b.length-1}else n.texImage2D(3553,0,m,p,f,l),e.__maxMipLevel=0;y(i,u)&&x(s,i,l.width,l.height),e.__version=i.version,i.onUpdate&&i.onUpdate(i)}function D(e,r,s,a){const c=o.convert(r.texture.format),l=o.convert(r.texture.type),h=_(r.texture.internalFormat,c,l);n.texImage2D(a,0,h,r.width,r.height,0,c,l,null),t.bindFramebuffer(36160,e),t.framebufferTexture2D(36160,s,a,i.get(r.texture).__webglTexture,0),t.bindFramebuffer(36160,null)}function I(e,n,i){if(t.bindRenderbuffer(36161,e),n.depthBuffer&&!n.stencilBuffer){let r=33189;if(i){const e=n.depthTexture;e&&e.isDepthTexture&&(e.type===At?r=36012:e.type===Et&&(r=33190));const i=B(n);t.renderbufferStorageMultisample(36161,i,r,n.width,n.height)}else t.renderbufferStorage(36161,r,n.width,n.height);t.framebufferRenderbuffer(36160,36096,36161,e)}else if(n.depthBuffer&&n.stencilBuffer){if(i){const e=B(n);t.renderbufferStorageMultisample(36161,e,35056,n.width,n.height)}else t.renderbufferStorage(36161,34041,n.width,n.height);t.framebufferRenderbuffer(36160,33306,36161,e)}else{const e=o.convert(n.texture.format),r=o.convert(n.texture.type),s=_(n.texture.internalFormat,e,r);if(i){const e=B(n);t.renderbufferStorageMultisample(36161,e,s,n.width,n.height)}else t.renderbufferStorage(36161,s,n.width,n.height)}t.bindRenderbuffer(36161,null)}function N(e){const n=i.get(e),r=!0===e.isWebGLCubeRenderTarget;if(e.depthTexture){if(r)throw new Error("target.depthTexture not supported in Cube render targets");!function(e,n){if(n&&n.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(36160,e),!n.depthTexture||!n.depthTexture.isDepthTexture)throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");i.get(n.depthTexture).__webglTexture&&n.depthTexture.image.width===n.width&&n.depthTexture.image.height===n.height||(n.depthTexture.image.width=n.width,n.depthTexture.image.height=n.height,n.depthTexture.needsUpdate=!0),T(n.depthTexture,0);const r=i.get(n.depthTexture).__webglTexture;if(n.depthTexture.format===Gt)t.framebufferTexture2D(36160,36096,3553,r,0);else{if(n.depthTexture.format!==zt)throw new Error("Unknown depthTexture format");t.framebufferTexture2D(36160,33306,3553,r,0)}}(n.__webglFramebuffer,e)}else if(r){n.__webglDepthbuffer=[];for(let i=0;i<6;i++)t.bindFramebuffer(36160,n.__webglFramebuffer[i]),n.__webglDepthbuffer[i]=t.createRenderbuffer(),I(n.__webglDepthbuffer[i],e,!1)}else t.bindFramebuffer(36160,n.__webglFramebuffer),n.__webglDepthbuffer=t.createRenderbuffer(),I(n.__webglDepthbuffer,e,!1);t.bindFramebuffer(36160,null)}function B(t){return a&&t.isWebGLMultisampleRenderTarget?Math.min(u,t.samples):0}let F=!1,U=!1;this.allocateTextureUnit=function(){const t=S;return t>=c&&console.warn("THREE.WebGLTextures: Trying to use "+t+" texture units while this GPU supports only "+c),S+=1,t},this.resetTextureUnits=function(){S=0},this.setTexture2D=T,this.setTexture2DArray=function(t,e){const r=i.get(t);t.version>0&&r.__version!==t.version?O(r,t,e):(n.activeTexture(33984+e),n.bindTexture(35866,r.__webglTexture))},this.setTexture3D=function(t,e){const r=i.get(t);t.version>0&&r.__version!==t.version?O(r,t,e):(n.activeTexture(33984+e),n.bindTexture(32879,r.__webglTexture))},this.setTextureCube=E,this.setTextureCubeDynamic=A,this.setupRenderTarget=function(e){const r=i.get(e),c=i.get(e.texture);e.addEventListener("dispose",M),c.__webglTexture=t.createTexture(),s.memory.textures++;const l=!0===e.isWebGLCubeRenderTarget,h=!0===e.isWebGLMultisampleRenderTarget,u=v(e)||a;if(!a||e.texture.format!==It||e.texture.type!==At&&e.texture.type!==Lt||(e.texture.format=Nt,console.warn("THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.")),l){r.__webglFramebuffer=[];for(let e=0;e<6;e++)r.__webglFramebuffer[e]=t.createFramebuffer()}else if(r.__webglFramebuffer=t.createFramebuffer(),h)if(a){r.__webglMultisampledFramebuffer=t.createFramebuffer(),r.__webglColorRenderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,r.__webglColorRenderbuffer);const n=o.convert(e.texture.format),i=o.convert(e.texture.type),s=_(e.texture.internalFormat,n,i),a=B(e);t.renderbufferStorageMultisample(36161,a,s,e.width,e.height),t.bindFramebuffer(36160,r.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(36160,36064,36161,r.__webglColorRenderbuffer),t.bindRenderbuffer(36161,null),e.depthBuffer&&(r.__webglDepthRenderbuffer=t.createRenderbuffer(),I(r.__webglDepthRenderbuffer,e,!0)),t.bindFramebuffer(36160,null)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.");if(l){n.bindTexture(34067,c.__webglTexture),C(34067,e.texture,u);for(let t=0;t<6;t++)D(r.__webglFramebuffer[t],e,36064,34069+t);y(e.texture,u)&&x(34067,e.texture,e.width,e.height),n.bindTexture(34067,null)}else n.bindTexture(3553,c.__webglTexture),C(3553,e.texture,u),D(r.__webglFramebuffer,e,36064,3553),y(e.texture,u)&&x(3553,e.texture,e.width,e.height),n.bindTexture(3553,null);e.depthBuffer&&N(e)},this.updateRenderTargetMipmap=function(t){const e=t.texture;if(y(e,v(t)||a)){const r=t.isWebGLCubeRenderTarget?34067:3553,o=i.get(e).__webglTexture;n.bindTexture(r,o),x(r,e,t.width,t.height),n.bindTexture(r,null)}},this.updateMultisampleRenderTarget=function(e){if(e.isWebGLMultisampleRenderTarget)if(a){const n=i.get(e);t.bindFramebuffer(36008,n.__webglMultisampledFramebuffer),t.bindFramebuffer(36009,n.__webglFramebuffer);const r=e.width,o=e.height;let s=16384;e.depthBuffer&&(s|=256),e.stencilBuffer&&(s|=1024),t.blitFramebuffer(0,0,r,o,0,0,r,o,s,9728),t.bindFramebuffer(36160,n.__webglMultisampledFramebuffer)}else console.warn("THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.")},this.safeSetTexture2D=function(t,e){t&&t.isWebGLRenderTarget&&(!1===F&&(console.warn("THREE.WebGLTextures.safeSetTexture2D: don't use render targets as textures. Use their .texture property instead."),F=!0),t=t.texture),T(t,e)},this.safeSetTextureCube=function(t,e){t&&t.isWebGLCubeRenderTarget&&(!1===U&&(console.warn("THREE.WebGLTextures.safeSetTextureCube: don't use cube render targets as textures. Use their .texture property instead."),U=!0),t=t.texture),t&&t.isCubeTexture||Array.isArray(t.image)&&6===t.image.length?E(t,e):A(t,e)}}function uh(t,e,n){const i=n.isWebGL2;return{convert:function(t){let n;if(t===bt)return 5121;if(t===Rt)return 32819;if(t===Ct)return 32820;if(t===Pt)return 33635;if(t===wt)return 5120;if(t===Mt)return 5122;if(t===St)return 5123;if(t===Tt)return 5124;if(t===Et)return 5125;if(t===At)return 5126;if(t===Lt)return i?5131:null!==(n=e.get("OES_texture_half_float"))?n.HALF_FLOAT_OES:null;if(t===Dt)return 6406;if(t===It)return 6407;if(t===Nt)return 6408;if(t===Bt)return 6409;if(t===Ft)return 6410;if(t===Gt)return 6402;if(t===zt)return 34041;if(t===Ht)return 6403;if(t===kt)return 36244;if(t===Vt)return 33319;if(t===jt)return 33320;if(t===Wt)return 36248;if(t===qt)return 36249;if(t===Xt||t===Yt||t===Zt||t===Jt){if(null===(n=e.get("WEBGL_compressed_texture_s3tc")))return null;if(t===Xt)return n.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===Yt)return n.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===Zt)return n.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===Jt)return n.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(t===Qt||t===Kt||t===$t||t===te){if(null===(n=e.get("WEBGL_compressed_texture_pvrtc")))return null;if(t===Qt)return n.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===Kt)return n.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===$t)return n.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===te)return n.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(t===ee)return null!==(n=e.get("WEBGL_compressed_texture_etc1"))?n.COMPRESSED_RGB_ETC1_WEBGL:null;if((t===ne||t===ie)&&null!==(n=e.get("WEBGL_compressed_texture_etc"))){if(t===ne)return n.COMPRESSED_RGB8_ETC2;if(t===ie)return n.COMPRESSED_RGBA8_ETC2_EAC}return t===re||t===oe||t===se||t===ae||t===ce||t===le||t===he||t===ue||t===pe||t===de||t===fe||t===me||t===ge||t===ve||t===xe||t===_e||t===be||t===we||t===Me||t===Se||t===Te||t===Ee||t===Ae||t===Le||t===Re||t===Ce||t===Pe||t===Oe?null!==(n=e.get("WEBGL_compressed_texture_astc"))?t:null:t===ye?null!==(n=e.get("EXT_texture_compression_bptc"))?t:null:t===Ot?i?34042:null!==(n=e.get("WEBGL_depth_texture"))?n.UNSIGNED_INT_24_8_WEBGL:null:void 0}}}function ph(t){bo.call(this),this.cameras=t||[]}function dh(){xi.call(this),this.type="Group"}function fh(){this._targetRay=null,this._grip=null,this._hand=null}function mh(t,e){const n=this;let i=null,r=1,o=null,s="local-floor",a=null;const c=[],l=new Map,h=new bo;h.layers.enable(1),h.viewport=new Hn;const u=new bo;u.layers.enable(2),u.viewport=new Hn;const p=[h,u],d=new ph;d.layers.enable(1),d.layers.enable(2);let f=null,m=null;function g(t){const e=l.get(t.inputSource);e&&e.dispatchEvent({type:t.type})}function v(){l.forEach(function(t,e){t.disconnect(e)}),l.clear(),t.setFramebuffer(null),t.setRenderTarget(t.getRenderTarget()),S.stop(),n.isPresenting=!1,n.dispatchEvent({type:"sessionend"})}function y(t){o=t,S.setContext(i),S.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}function x(t){const e=i.inputSources;for(let n=0;n<c.length;n++)l.set(e[n],c[n]);for(let n=0;n<t.removed.length;n++){const e=t.removed[n],i=l.get(e);i&&(i.dispatchEvent({type:"disconnected",data:e}),l.delete(e))}for(let n=0;n<t.added.length;n++){const e=t.added[n],i=l.get(e);i&&i.dispatchEvent({type:"connected",data:e})}}this.enabled=!1,this.isPresenting=!1,this.getController=function(t){let e=c[t];return void 0===e&&(e=new fh,c[t]=e),e.getTargetRaySpace()},this.getControllerGrip=function(t){let e=c[t];return void 0===e&&(e=new fh,c[t]=e),e.getGripSpace()},this.getHand=function(t){let e=c[t];return void 0===e&&(e=new fh,c[t]=e),e.getHandSpace()},this.setFramebufferScaleFactor=function(t){r=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(t){s=t,!0===n.isPresenting&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return o},this.getSession=function(){return i},this.setSession=function(t){if(null!==(i=t)){i.addEventListener("select",g),i.addEventListener("selectstart",g),i.addEventListener("selectend",g),i.addEventListener("squeeze",g),i.addEventListener("squeezestart",g),i.addEventListener("squeezeend",g),i.addEventListener("end",v);const t=e.getContextAttributes();!0!==t.xrCompatible&&e.makeXRCompatible();const n={antialias:t.antialias,alpha:t.alpha,depth:t.depth,stencil:t.stencil,framebufferScaleFactor:r},o=new XRWebGLLayer(i,e,n);i.updateRenderState({baseLayer:o}),i.requestReferenceSpace(s).then(y),i.addEventListener("inputsourceschange",x)}};const _=new Xn,b=new Xn;function w(t,e){null===e?t.matrixWorld.copy(t.matrix):t.matrixWorld.multiplyMatrices(e.matrixWorld,t.matrix),t.matrixWorldInverse.getInverse(t.matrixWorld)}this.getCamera=function(t){d.near=u.near=h.near=t.near,d.far=u.far=h.far=t.far,f===d.near&&m===d.far||(i.updateRenderState({depthNear:d.near,depthFar:d.far}),f=d.near,m=d.far);const e=t.parent,n=d.cameras;w(d,e);for(let i=0;i<n.length;i++)w(n[i],e);t.matrixWorld.copy(d.matrixWorld);const r=t.children;for(let i=0,o=r.length;i<o;i++)r[i].updateMatrixWorld(!0);return 2===n.length?function(t,e,n){_.setFromMatrixPosition(e.matrixWorld),b.setFromMatrixPosition(n.matrixWorld);const i=_.distanceTo(b),r=e.projectionMatrix.elements,o=n.projectionMatrix.elements,s=r[14]/(r[10]-1),a=r[14]/(r[10]+1),c=(r[9]+1)/r[5],l=(r[9]-1)/r[5],h=(r[8]-1)/r[0],u=(o[8]+1)/o[0],p=s*h,d=s*u,f=i/(-h+u),m=f*-h;e.matrixWorld.decompose(t.position,t.quaternion,t.scale),t.translateX(m),t.translateZ(f),t.matrixWorld.compose(t.position,t.quaternion,t.scale),t.matrixWorldInverse.getInverse(t.matrixWorld);const g=s+f,v=a+f,y=p-m,x=d+(i-m),w=c*a/v*g,M=l*a/v*g;t.projectionMatrix.makePerspective(y,x,w,M,g,v)}(d,h,u):d.projectionMatrix.copy(h.projectionMatrix),d};let M=null;const S=new Po;S.setAnimationLoop(function(e,n){if(null!==(a=n.getViewerPose(o))){const e=a.views,n=i.renderState.baseLayer;t.setFramebuffer(n.framebuffer);let r=!1;e.length!==d.cameras.length&&(d.cameras.length=0,r=!0);for(let t=0;t<e.length;t++){const i=e[t],o=n.getViewport(i),s=p[t];s.matrix.fromArray(i.transform.matrix),s.projectionMatrix.fromArray(i.projectionMatrix),s.viewport.set(o.x,o.y,o.width,o.height),0===t&&d.matrix.copy(s.matrix),!0===r&&d.cameras.push(s)}}const r=i.inputSources;for(let t=0;t<c.length;t++){const e=c[t],i=r[t];e.update(i,n,o)}M&&M(e,n)}),this.setAnimationLoop=function(t){M=t},this.dispose=function(){}}function gh(t){function e(e,n,i){e.opacity.value=n.opacity,n.color&&e.diffuse.value.copy(n.color),n.emissive&&e.emissive.value.copy(n.emissive).multiplyScalar(n.emissiveIntensity),n.map&&(e.map.value=n.map),n.alphaMap&&(e.alphaMap.value=n.alphaMap),n.specularMap&&(e.specularMap.value=n.specularMap);const r=n.envMap||i;if(r){e.envMap.value=r,e.flipEnvMap.value=r.isCubeTexture?-1:1,e.reflectivity.value=n.reflectivity,e.refractionRatio.value=n.refractionRatio;var o=t.get(r).__maxMipLevel;void 0!==o&&(e.maxMipLevel.value=o)}let s,a;n.lightMap&&(e.lightMap.value=n.lightMap,e.lightMapIntensity.value=n.lightMapIntensity),n.aoMap&&(e.aoMap.value=n.aoMap,e.aoMapIntensity.value=n.aoMapIntensity),n.map?s=n.map:n.specularMap?s=n.specularMap:n.displacementMap?s=n.displacementMap:n.normalMap?s=n.normalMap:n.bumpMap?s=n.bumpMap:n.roughnessMap?s=n.roughnessMap:n.metalnessMap?s=n.metalnessMap:n.alphaMap?s=n.alphaMap:n.emissiveMap&&(s=n.emissiveMap),void 0!==s&&(s.isWebGLRenderTarget&&(s=s.texture),!0===s.matrixAutoUpdate&&s.updateMatrix(),e.uvTransform.value.copy(s.matrix)),n.aoMap?a=n.aoMap:n.lightMap&&(a=n.lightMap),void 0!==a&&(a.isWebGLRenderTarget&&(a=a.texture),!0===a.matrixAutoUpdate&&a.updateMatrix(),e.uv2Transform.value.copy(a.matrix))}function n(t,e,n){t.roughness.value=e.roughness,t.metalness.value=e.metalness,e.roughnessMap&&(t.roughnessMap.value=e.roughnessMap),e.metalnessMap&&(t.metalnessMap.value=e.metalnessMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===p&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===p&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),(e.envMap||n)&&(t.envMapIntensity.value=e.envMapIntensity)}return{refreshFogUniforms:function(t,e){t.fogColor.value.copy(e.color),e.isFog?(t.fogNear.value=e.near,t.fogFar.value=e.far):e.isFogExp2&&(t.fogDensity.value=e.density)},refreshMaterialUniforms:function(t,i,r,o,s){i.isMeshBasicMaterial?e(t,i):i.isMeshLambertMaterial?(e(t,i),function(t,e){e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap)}(t,i)):i.isMeshToonMaterial?(e(t,i),function(t,e){e.gradientMap&&(t.gradientMap.value=e.gradientMap),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===p&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===p&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,i)):i.isMeshPhongMaterial?(e(t,i),function(t,e){t.specular.value.copy(e.specular),t.shininess.value=Math.max(e.shininess,1e-4),e.emissiveMap&&(t.emissiveMap.value=e.emissiveMap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===p&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===p&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,i)):i.isMeshStandardMaterial?(e(t,i,r),i.isMeshPhysicalMaterial?function(t,e,i){n(t,e,i),t.reflectivity.value=e.reflectivity,t.clearcoat.value=e.clearcoat,t.clearcoatRoughness.value=e.clearcoatRoughness,e.sheen&&t.sheen.value.copy(e.sheen),e.clearcoatMap&&(t.clearcoatMap.value=e.clearcoatMap),e.clearcoatRoughnessMap&&(t.clearcoatRoughnessMap.value=e.clearcoatRoughnessMap),e.clearcoatNormalMap&&(t.clearcoatNormalScale.value.copy(e.clearcoatNormalScale),t.clearcoatNormalMap.value=e.clearcoatNormalMap,e.side===p&&t.clearcoatNormalScale.value.negate()),t.transmission.value=e.transmission,e.transmissionMap&&(t.transmissionMap.value=e.transmissionMap)}(t,i,r):n(t,i,r)):i.isMeshMatcapMaterial?(e(t,i),function(t,e){e.matcap&&(t.matcap.value=e.matcap),e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===p&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===p&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,i)):i.isMeshDepthMaterial?(e(t,i),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,i)):i.isMeshDistanceMaterial?(e(t,i),function(t,e){e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias),t.referencePosition.value.copy(e.referencePosition),t.nearDistance.value=e.nearDistance,t.farDistance.value=e.farDistance}(t,i)):i.isMeshNormalMaterial?(e(t,i),function(t,e){e.bumpMap&&(t.bumpMap.value=e.bumpMap,t.bumpScale.value=e.bumpScale,e.side===p&&(t.bumpScale.value*=-1)),e.normalMap&&(t.normalMap.value=e.normalMap,t.normalScale.value.copy(e.normalScale),e.side===p&&t.normalScale.value.negate()),e.displacementMap&&(t.displacementMap.value=e.displacementMap,t.displacementScale.value=e.displacementScale,t.displacementBias.value=e.displacementBias)}(t,i)):i.isLineBasicMaterial?(function(t,e){t.diffuse.value.copy(e.color),t.opacity.value=e.opacity}(t,i),i.isLineDashedMaterial&&function(t,e){t.dashSize.value=e.dashSize,t.totalSize.value=e.dashSize+e.gapSize,t.scale.value=e.scale}(t,i)):i.isPointsMaterial?function(t,e,n,i){let r;t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.size.value=e.size*n,t.scale.value=.5*i,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.map?r=e.map:e.alphaMap&&(r=e.alphaMap),void 0!==r&&(!0===r.matrixAutoUpdate&&r.updateMatrix(),t.uvTransform.value.copy(r.matrix))}(t,i,o,s):i.isSpriteMaterial?function(t,e){let n;t.diffuse.value.copy(e.color),t.opacity.value=e.opacity,t.rotation.value=e.rotation,e.map&&(t.map.value=e.map),e.alphaMap&&(t.alphaMap.value=e.alphaMap),e.map?n=e.map:e.alphaMap&&(n=e.alphaMap),void 0!==n&&(!0===n.matrixAutoUpdate&&n.updateMatrix(),t.uvTransform.value.copy(n.matrix))}(t,i):i.isShadowMaterial?(t.color.value.copy(i.color),t.opacity.value=i.opacity):i.isShaderMaterial&&(i.uniformsNeedUpdate=!1)}}}function vh(t){const e=void 0!==(t=t||{}).canvas?t.canvas:document.createElementNS("http://www.w3.org/1999/xhtml","canvas"),n=void 0!==t.context?t.context:null,i=void 0!==t.alpha&&t.alpha,r=void 0===t.depth||t.depth,o=void 0===t.stencil||t.stencil,s=void 0!==t.antialias&&t.antialias,a=void 0===t.premultipliedAlpha||t.premultipliedAlpha,c=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,l=void 0!==t.powerPreference?t.powerPreference:"default",h=void 0!==t.failIfMajorPerformanceCaveat&&t.failIfMajorPerformanceCaveat;let u=null,p=null;this.domElement=e,this.debug={checkShaderErrors:!0},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.gammaFactor=2,this.outputEncoding=Xe,this.physicallyCorrectLights=!1,this.toneMapping=Z,this.toneMappingExposure=1,this.maxMorphTargets=8,this.maxMorphNormals=4;const d=this;let f=!1,m=null,g=0,v=0,y=null,x=null,_=-1,b=null,w=null;const M=new Hn,S=new Hn;let T=null,E=e.width,A=e.height,L=1,R=null,C=null;const P=new Hn(0,0,E,A),O=new Hn(0,0,E,A);let D=!1;const I=new Ro,N=new cc;let B=!1,F=!1;const U=new ei,G=new Xn,z={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function H(){return null===y?L:1}let k,V,j,W,q,X,Y,J,Q,K,$,tt,et,nt,it,rt,ot,st,at,ct=n;function lt(t,n){for(let i=0;i<t.length;i++){const r=t[i],o=e.getContext(r,n);if(null!==o)return o}return null}try{const t={alpha:i,depth:r,stencil:o,antialias:s,premultipliedAlpha:a,preserveDrawingBuffer:c,powerPreference:l,failIfMajorPerformanceCaveat:h};if(e.addEventListener("webglcontextlost",dt,!1),e.addEventListener("webglcontextrestored",ft,!1),null===ct){const e=["webgl2","webgl","experimental-webgl"];if(!0===d.isWebGL1Renderer&&e.shift(),null===(ct=lt(e,t)))throw lt(e)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}void 0===ct.getShaderPrecisionFormat&&(ct.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}})}catch(St){throw console.error("THREE.WebGLRenderer: "+St.message),St}function ht(){k=new lc(ct),!1===(V=new ac(ct,k,t)).isWebGL2&&(k.get("WEBGL_depth_texture"),k.get("OES_texture_float"),k.get("OES_texture_half_float"),k.get("OES_texture_half_float_linear"),k.get("OES_standard_derivatives"),k.get("OES_element_index_uint"),k.get("OES_vertex_array_object"),k.get("ANGLE_instanced_arrays")),k.get("OES_texture_float_linear"),st=new uh(ct,k,V),(j=new lh(ct,k,V)).scissor(S.copy(O).multiplyScalar(L).floor()),j.viewport(M.copy(P).multiplyScalar(L).floor()),W=new pc(ct),q=new ql,X=new hh(ct,k,j,q,V,st,W),Y=new Oo(ct,V),at=new oc(ct,k,Y,V),J=new hc(ct,Y,W,at),Q=new gc(ct,J,Y,W),it=new mc(ct),K=new Wl(d,k,V,at),$=new gh(q),tt=new Jl(q),et=new ih,nt=new rc(d,j,Q,a),rt=new sc(ct,k,W,V),ot=new uc(ct,k,W,V),W.programs=K.programs,d.capabilities=V,d.extensions=k,d.properties=q,d.renderLists=tt,d.state=j,d.info=W}ht();const ut=new mh(d,ct);this.xr=ut;const pt=new ch(d,Q,V.maxTextureSize);function dt(t){t.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),f=!0}function ft(){console.log("THREE.WebGLRenderer: Context Restored."),f=!1,ht()}function mt(t){const e=t.target;e.removeEventListener("dispose",mt),function(t){gt(t),q.remove(t)}(e)}function gt(t){const e=q.get(t).program;void 0!==e&&K.releaseProgram(e)}this.shadowMap=pt,this.getContext=function(){return ct},this.getContextAttributes=function(){return ct.getContextAttributes()},this.forceContextLoss=function(){const t=k.get("WEBGL_lose_context");t&&t.loseContext()},this.forceContextRestore=function(){const t=k.get("WEBGL_lose_context");t&&t.restoreContext()},this.getPixelRatio=function(){return L},this.setPixelRatio=function(t){void 0!==t&&(L=t,this.setSize(E,A,!1))},this.getSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getsize() now requires a Vector2 as an argument"),t=new Nn),t.set(E,A)},this.setSize=function(t,n,i){ut.isPresenting?console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting."):(E=t,A=n,e.width=Math.floor(t*L),e.height=Math.floor(n*L),!1!==i&&(e.style.width=t+"px",e.style.height=n+"px"),this.setViewport(0,0,t,n))},this.getDrawingBufferSize=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getdrawingBufferSize() now requires a Vector2 as an argument"),t=new Nn),t.set(E*L,A*L).floor()},this.setDrawingBufferSize=function(t,n,i){E=t,A=n,L=i,e.width=Math.floor(t*i),e.height=Math.floor(n*i),this.setViewport(0,0,t,n)},this.getCurrentViewport=function(t){return void 0===t&&(console.warn("WebGLRenderer: .getCurrentViewport() now requires a Vector4 as an argument"),t=new Hn),t.copy(M)},this.getViewport=function(t){return t.copy(P)},this.setViewport=function(t,e,n,i){t.isVector4?P.set(t.x,t.y,t.z,t.w):P.set(t,e,n,i),j.viewport(M.copy(P).multiplyScalar(L).floor())},this.getScissor=function(t){return t.copy(O)},this.setScissor=function(t,e,n,i){t.isVector4?O.set(t.x,t.y,t.z,t.w):O.set(t,e,n,i),j.scissor(S.copy(O).multiplyScalar(L).floor())},this.getScissorTest=function(){return D},this.setScissorTest=function(t){j.setScissorTest(D=t)},this.setOpaqueSort=function(t){R=t},this.setTransparentSort=function(t){C=t},this.getClearColor=function(){return nt.getClearColor()},this.setClearColor=function(){nt.setClearColor.apply(nt,arguments)},this.getClearAlpha=function(){return nt.getClearAlpha()},this.setClearAlpha=function(){nt.setClearAlpha.apply(nt,arguments)},this.clear=function(t,e,n){let i=0;(void 0===t||t)&&(i|=16384),(void 0===e||e)&&(i|=256),(void 0===n||n)&&(i|=1024),ct.clear(i)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){e.removeEventListener("webglcontextlost",dt,!1),e.removeEventListener("webglcontextrestored",ft,!1),tt.dispose(),et.dispose(),q.dispose(),Q.dispose(),at.dispose(),ut.dispose(),yt.stop()},this.renderBufferImmediate=function(t,e){at.initAttributes();const n=q.get(t);t.hasPositions&&!n.position&&(n.position=ct.createBuffer()),t.hasNormals&&!n.normal&&(n.normal=ct.createBuffer()),t.hasUvs&&!n.uv&&(n.uv=ct.createBuffer()),t.hasColors&&!n.color&&(n.color=ct.createBuffer());const i=e.getAttributes();t.hasPositions&&(ct.bindBuffer(34962,n.position),ct.bufferData(34962,t.positionArray,35048),at.enableAttribute(i.position),ct.vertexAttribPointer(i.position,3,5126,!1,0,0)),t.hasNormals&&(ct.bindBuffer(34962,n.normal),ct.bufferData(34962,t.normalArray,35048),at.enableAttribute(i.normal),ct.vertexAttribPointer(i.normal,3,5126,!1,0,0)),t.hasUvs&&(ct.bindBuffer(34962,n.uv),ct.bufferData(34962,t.uvArray,35048),at.enableAttribute(i.uv),ct.vertexAttribPointer(i.uv,2,5126,!1,0,0)),t.hasColors&&(ct.bindBuffer(34962,n.color),ct.bufferData(34962,t.colorArray,35048),at.enableAttribute(i.color),ct.vertexAttribPointer(i.color,3,5126,!1,0,0)),at.disableUnusedAttributes(),ct.drawArrays(4,0,t.count),t.count=0},this.renderBufferDirect=function(t,e,n,i,r,o){null===e&&(e=z);const s=r.isMesh&&r.matrixWorld.determinant()<0,a=Mt(t,e,i,r);j.setMaterial(i,s);let c=n.index;const l=n.attributes.position;if(null===c){if(void 0===l||0===l.count)return}else if(0===c.count)return;let h,u=1;!0===i.wireframe&&(c=J.getWireframeAttribute(n),u=2),(i.morphTargets||i.morphNormals)&&it.update(r,n,i,a),at.setup(r,i,a,n,c);let p=rt;null!==c&&(h=Y.get(c),(p=ot).setIndex(h));const d=null!==c?c.count:l.count,f=n.drawRange.start*u,m=n.drawRange.count*u,g=null!==o?o.start*u:0,v=null!==o?o.count*u:1/0,y=Math.max(f,g),x=Math.min(d,f+m,g+v)-1,_=Math.max(0,x-y+1);if(0!==_){if(r.isMesh)!0===i.wireframe?(j.setLineWidth(i.wireframeLinewidth*H()),p.setMode(1)):p.setMode(4);else if(r.isLine){let t=i.linewidth;void 0===t&&(t=1),j.setLineWidth(t*H()),r.isLineSegments?p.setMode(1):r.isLineLoop?p.setMode(2):p.setMode(3)}else r.isPoints?p.setMode(0):r.isSprite&&p.setMode(4);if(r.isInstancedMesh)p.renderInstances(y,_,r.count);else if(n.isInstancedBufferGeometry){const t=Math.min(n.instanceCount,n._maxInstanceCount);p.renderInstances(y,_,t)}else p.render(y,_)}},this.compile=function(t,e){(p=et.get(t,e)).init(),t.traverse(function(t){t.isLight&&(p.pushLight(t),t.castShadow&&p.pushShadow(t))}),p.setupLights(e);const n=new WeakMap;t.traverse(function(e){let i=e.material;if(i)if(Array.isArray(i))for(let r=0;r<i.length;r++){let o=i[r];!1===n.has(o)&&(wt(o,t,e),n.set(o))}else!1===n.has(i)&&(wt(i,t,e),n.set(i))})};let vt=null;const yt=new Po;function xt(t,e,n){const i=!0===e.isScene?e.overrideMaterial:null;for(let r=0,o=t.length;r<o;r++){const o=t[r],s=o.object,a=o.geometry,c=null===i?o.material:i,l=o.group;if(n.isArrayCamera){w=n;const t=n.cameras;for(let n=0,i=t.length;n<i;n++){const i=t[n];s.layers.test(i.layers)&&(j.viewport(M.copy(i.viewport)),p.setupLights(i),_t(s,e,i,a,c,l))}}else w=null,_t(s,e,n,a,c,l)}}function _t(t,e,n,i,r,o){if(t.onBeforeRender(d,e,n,i,r,o),p=et.get(e,w||n),t.modelViewMatrix.multiplyMatrices(n.matrixWorldInverse,t.matrixWorld),t.normalMatrix.getNormalMatrix(t.modelViewMatrix),t.isImmediateRenderObject){const i=Mt(n,e,r,t);j.setMaterial(r),at.reset(),function(t,e){t.render(function(t){d.renderBufferImmediate(t,e)})}(t,i)}else d.renderBufferDirect(n,e,i,r,t,o);t.onAfterRender(d,e,n,i,r,o),p=et.get(e,w||n)}function wt(t,e,n){!0!==e.isScene&&(e=z);const i=q.get(t),r=p.state.lights,o=p.state.shadowsArray,s=r.state.version,a=K.getParameters(t,r.state,o,e,N.numPlanes,N.numIntersection,n),c=K.getProgramCacheKey(a);let l=i.program,h=!0;if(void 0===l)t.addEventListener("dispose",mt);else if(l.cacheKey!==c)gt(t);else if(i.lightsStateVersion!==s)i.lightsStateVersion=s,h=!1;else{if(void 0!==a.shaderID)return;h=!1}h&&(a.uniforms=K.getUniforms(t,a),t.onBeforeCompile(a,d),l=K.acquireProgram(a,c),i.program=l,i.uniforms=a.uniforms,i.outputEncoding=a.outputEncoding);const u=l.getAttributes();if(t.morphTargets){t.numSupportedMorphTargets=0;for(let e=0;e<d.maxMorphTargets;e++)u["morphTarget"+e]>=0&&t.numSupportedMorphTargets++}if(t.morphNormals){t.numSupportedMorphNormals=0;for(let e=0;e<d.maxMorphNormals;e++)u["morphNormal"+e]>=0&&t.numSupportedMorphNormals++}const f=i.uniforms;(t.isShaderMaterial||t.isRawShaderMaterial)&&!0!==t.clipping||(i.numClippingPlanes=N.numPlanes,i.numIntersection=N.numIntersection,f.clippingPlanes=N.uniform),i.environment=t.isMeshStandardMaterial?e.environment:null,i.fog=e.fog,i.needsLights=function(t){return t.isMeshLambertMaterial||t.isMeshToonMaterial||t.isMeshPhongMaterial||t.isMeshStandardMaterial||t.isShadowMaterial||t.isShaderMaterial&&!0===t.lights}(t),i.lightsStateVersion=s,i.needsLights&&(f.ambientLightColor.value=r.state.ambient,f.lightProbe.value=r.state.probe,f.directionalLights.value=r.state.directional,f.directionalLightShadows.value=r.state.directionalShadow,f.spotLights.value=r.state.spot,f.spotLightShadows.value=r.state.spotShadow,f.rectAreaLights.value=r.state.rectArea,f.pointLights.value=r.state.point,f.pointLightShadows.value=r.state.pointShadow,f.hemisphereLights.value=r.state.hemi,f.directionalShadowMap.value=r.state.directionalShadowMap,f.directionalShadowMatrix.value=r.state.directionalShadowMatrix,f.spotShadowMap.value=r.state.spotShadowMap,f.spotShadowMatrix.value=r.state.spotShadowMatrix,f.pointShadowMap.value=r.state.pointShadowMap,f.pointShadowMatrix.value=r.state.pointShadowMatrix);const m=i.program.getUniforms(),g=gl.seqWithValue(m.seq,f);i.uniformsList=g}function Mt(t,e,n,i){!0!==e.isScene&&(e=z),X.resetTextureUnits();const r=e.fog,o=n.isMeshStandardMaterial?e.environment:null,s=null===y?d.outputEncoding:y.texture.encoding,a=q.get(n),c=p.state.lights;if(!0===B&&(!0===F||t!==b)){const e=t===b&&n.id===_;N.setState(n.clippingPlanes,n.clipIntersection,n.clipShadows,t,a,e)}n.version===a.__version?void 0===a.program?wt(n,e,i):n.fog&&a.fog!==r?wt(n,e,i):a.environment!==o?wt(n,e,i):a.needsLights&&a.lightsStateVersion!==c.state.version?wt(n,e,i):void 0===a.numClippingPlanes||a.numClippingPlanes===N.numPlanes&&a.numIntersection===N.numIntersection?a.outputEncoding!==s&&wt(n,e,i):wt(n,e,i):(wt(n,e,i),a.__version=n.version);let l=!1,h=!1,u=!1;const f=a.program,m=f.getUniforms(),g=a.uniforms;if(j.useProgram(f.program)&&(l=!0,h=!0,u=!0),n.id!==_&&(_=n.id,h=!0),l||b!==t){if(m.setValue(ct,"projectionMatrix",t.projectionMatrix),V.logarithmicDepthBuffer&&m.setValue(ct,"logDepthBufFC",2/(Math.log(t.far+1)/Math.LN2)),b!==t&&(b=t,h=!0,u=!0),n.isShaderMaterial||n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshStandardMaterial||n.envMap){const e=m.map.cameraPosition;void 0!==e&&e.setValue(ct,G.setFromMatrixPosition(t.matrixWorld))}(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial)&&m.setValue(ct,"isOrthographic",!0===t.isOrthographicCamera),(n.isMeshPhongMaterial||n.isMeshToonMaterial||n.isMeshLambertMaterial||n.isMeshBasicMaterial||n.isMeshStandardMaterial||n.isShaderMaterial||n.isShadowMaterial||n.skinning)&&m.setValue(ct,"viewMatrix",t.matrixWorldInverse)}if(n.skinning){m.setOptional(ct,i,"bindMatrix"),m.setOptional(ct,i,"bindMatrixInverse");const t=i.skeleton;if(t){const e=t.bones;if(V.floatVertexTextures){if(void 0===t.boneTexture){let n=Math.sqrt(4*e.length);n=In.ceilPowerOfTwo(n),n=Math.max(n,4);const i=new Float32Array(n*n*4);i.set(t.boneMatrices);const r=new Eo(i,n,n,Nt,At);t.boneMatrices=i,t.boneTexture=r,t.boneTextureSize=n}m.setValue(ct,"boneTexture",t.boneTexture,X),m.setValue(ct,"boneTextureSize",t.boneTextureSize)}else m.setOptional(ct,t,"boneMatrices")}}var v,x;return(h||a.receiveShadow!==i.receiveShadow)&&(a.receiveShadow=i.receiveShadow,m.setValue(ct,"receiveShadow",i.receiveShadow)),h&&(m.setValue(ct,"toneMappingExposure",d.toneMappingExposure),a.needsLights&&(x=u,(v=g).ambientLightColor.needsUpdate=x,v.lightProbe.needsUpdate=x,v.directionalLights.needsUpdate=x,v.directionalLightShadows.needsUpdate=x,v.pointLights.needsUpdate=x,v.pointLightShadows.needsUpdate=x,v.spotLights.needsUpdate=x,v.spotLightShadows.needsUpdate=x,v.rectAreaLights.needsUpdate=x,v.hemisphereLights.needsUpdate=x),r&&n.fog&&$.refreshFogUniforms(g,r),$.refreshMaterialUniforms(g,n,o,L,A),void 0!==g.ltc_1&&(g.ltc_1.value=Co.LTC_1),void 0!==g.ltc_2&&(g.ltc_2.value=Co.LTC_2),gl.upload(ct,a.uniformsList,g,X)),n.isShaderMaterial&&!0===n.uniformsNeedUpdate&&(gl.upload(ct,a.uniformsList,g,X),n.uniformsNeedUpdate=!1),n.isSpriteMaterial&&m.setValue(ct,"center",i.center),m.setValue(ct,"modelViewMatrix",i.modelViewMatrix),m.setValue(ct,"normalMatrix",i.normalMatrix),m.setValue(ct,"modelMatrix",i.matrixWorld),f}yt.setAnimationLoop(function(t){ut.isPresenting||vt&&vt(t)}),"undefined"!=typeof window&&yt.setContext(window),this.setAnimationLoop=function(t){vt=t,ut.setAnimationLoop(t),null===t?yt.stop():yt.start()},this.render=function(t,e){let n,i;if(void 0!==arguments[2]&&(console.warn("THREE.WebGLRenderer.render(): the renderTarget argument has been removed. Use .setRenderTarget() instead."),n=arguments[2]),void 0!==arguments[3]&&(console.warn("THREE.WebGLRenderer.render(): the forceClear argument has been removed. Use .clear() instead."),i=arguments[3]),void 0!==e&&!0!==e.isCamera)return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");if(!0===f)return;at.resetDefaultState(),_=-1,b=null,!0===t.autoUpdate&&t.updateMatrixWorld(),null===e.parent&&e.updateMatrixWorld(),!0===ut.enabled&&!0===ut.isPresenting&&(e=ut.getCamera(e)),!0===t.isScene&&t.onBeforeRender(d,t,e,n||y),(p=et.get(t,e)).init(),U.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),I.setFromProjectionMatrix(U),F=this.localClippingEnabled,B=N.init(this.clippingPlanes,F,e),(u=tt.get(t,e)).init(),function t(e,n,i,r){if(!1===e.visible)return;const o=e.layers.test(n.layers);if(o)if(e.isGroup)i=e.renderOrder;else if(e.isLOD)!0===e.autoUpdate&&e.update(n);else if(e.isLight)p.pushLight(e),e.castShadow&&p.pushShadow(e);else if(e.isSprite){if(!e.frustumCulled||I.intersectsSprite(e)){r&&G.setFromMatrixPosition(e.matrixWorld).applyMatrix4(U);const t=Q.update(e),n=e.material;n.visible&&u.push(e,t,n,i,G.z,null)}}else if(e.isImmediateRenderObject)r&&G.setFromMatrixPosition(e.matrixWorld).applyMatrix4(U),u.push(e,null,e.material,i,G.z,null);else if((e.isMesh||e.isLine||e.isPoints)&&(e.isSkinnedMesh&&e.skeleton.frame!==W.render.frame&&(e.skeleton.update(),e.skeleton.frame=W.render.frame),!e.frustumCulled||I.intersectsObject(e))){r&&G.setFromMatrixPosition(e.matrixWorld).applyMatrix4(U);const t=Q.update(e),n=e.material;if(Array.isArray(n)){const r=t.groups;for(let o=0,s=r.length;o<s;o++){const s=r[o],a=n[s.materialIndex];a&&a.visible&&u.push(e,t,a,i,G.z,s)}}else n.visible&&u.push(e,t,n,i,G.z,null)}const s=e.children;for(let a=0,c=s.length;a<c;a++)t(s[a],n,i,r)}(t,e,0,d.sortObjects),u.finish(),!0===d.sortObjects&&u.sort(R,C),!0===B&&N.beginShadows();const r=p.state.shadowsArray;pt.render(r,t,e),p.setupLights(e),!0===B&&N.endShadows(),!0===this.info.autoReset&&this.info.reset(),void 0!==n&&this.setRenderTarget(n),nt.render(u,t,e,i);const o=u.opaque,s=u.transparent;o.length>0&&xt(o,t,e),s.length>0&&xt(s,t,e),!0===t.isScene&&t.onAfterRender(d,t,e),null!==y&&(X.updateRenderTargetMipmap(y),X.updateMultisampleRenderTarget(y)),j.buffers.depth.setTest(!0),j.buffers.depth.setMask(!0),j.buffers.color.setMask(!0),j.setPolygonOffset(!1),u=null,p=null},this.setFramebuffer=function(t){m!==t&&null===y&&ct.bindFramebuffer(36160,t),m=t},this.getActiveCubeFace=function(){return g},this.getActiveMipmapLevel=function(){return v},this.getRenderTarget=function(){return y},this.setRenderTarget=function(t,e,n){y=t,g=e,v=n,t&&void 0===q.get(t).__webglFramebuffer&&X.setupRenderTarget(t);let i=m,r=!1;if(t){const n=q.get(t).__webglFramebuffer;t.isWebGLCubeRenderTarget?(i=n[e||0],r=!0):i=t.isWebGLMultisampleRenderTarget?q.get(t).__webglMultisampledFramebuffer:n,M.copy(t.viewport),S.copy(t.scissor),T=t.scissorTest}else M.copy(P).multiplyScalar(L).floor(),S.copy(O).multiplyScalar(L).floor(),T=D;if(x!==i&&(ct.bindFramebuffer(36160,i),x=i),j.viewport(M),j.scissor(S),j.setScissorTest(T),r){const i=q.get(t.texture);ct.framebufferTexture2D(36160,36064,34069+(e||0),i.__webglTexture,n||0)}},this.readRenderTargetPixels=function(t,e,n,i,r,o,s){if(!t||!t.isWebGLRenderTarget)return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let a=q.get(t).__webglFramebuffer;if(t.isWebGLCubeRenderTarget&&void 0!==s&&(a=a[s]),a){let s=!1;a!==x&&(ct.bindFramebuffer(36160,a),s=!0);try{const a=t.texture,c=a.format,l=a.type;if(c!==Nt&&st.convert(c)!==ct.getParameter(35739))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");if(!(l===bt||st.convert(l)===ct.getParameter(35738)||l===At&&(V.isWebGL2||k.get("OES_texture_float")||k.get("WEBGL_color_buffer_float"))||l===Lt&&(V.isWebGL2?k.get("EXT_color_buffer_float"):k.get("EXT_color_buffer_half_float"))))return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");36053===ct.checkFramebufferStatus(36160)?e>=0&&e<=t.width-i&&n>=0&&n<=t.height-r&&ct.readPixels(e,n,i,r,st.convert(c),st.convert(l),o):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")}finally{s&&ct.bindFramebuffer(36160,x)}}},this.copyFramebufferToTexture=function(t,e,n){void 0===n&&(n=0);const i=Math.pow(2,-n),r=Math.floor(e.image.width*i),o=Math.floor(e.image.height*i),s=st.convert(e.format);X.setTexture2D(e,0),ct.copyTexImage2D(3553,n,s,t.x,t.y,r,o,0),j.unbindTexture()},this.copyTextureToTexture=function(t,e,n,i){void 0===i&&(i=0);const r=e.image.width,o=e.image.height,s=st.convert(n.format),a=st.convert(n.type);X.setTexture2D(n,0),ct.pixelStorei(37440,n.flipY),ct.pixelStorei(37441,n.premultiplyAlpha),ct.pixelStorei(3317,n.unpackAlignment),e.isDataTexture?ct.texSubImage2D(3553,i,t.x,t.y,r,o,s,a,e.image.data):e.isCompressedTexture?ct.compressedTexSubImage2D(3553,i,t.x,t.y,e.mipmaps[0].width,e.mipmaps[0].height,s,e.mipmaps[0].data):ct.texSubImage2D(3553,i,t.x,t.y,s,a,e.image),0===i&&n.generateMipmaps&&ct.generateMipmap(3553),j.unbindTexture()},this.initTexture=function(t){X.setTexture2D(t,0),j.unbindTexture()},"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}function yh(t){vh.call(this,t)}function xh(t,e){this.name="",this.color=new hr(t),this.density=void 0!==e?e:25e-5}function _h(t,e,n){this.name="",this.color=new hr(t),this.near=void 0!==e?e:1,this.far=void 0!==n?n:1e3}function bh(t,e){this.array=t,this.stride=e,this.count=void 0!==t?t.length/e:0,this.usage=wn,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=In.generateUUID()}ph.prototype=Object.assign(Object.create(bo.prototype),{constructor:ph,isArrayCamera:!0}),dh.prototype=Object.assign(Object.create(xi.prototype),{constructor:dh,isGroup:!0}),Object.assign(fh.prototype,{constructor:fh,getHandSpace:function(){if(null===this._hand&&(this._hand=new dh,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints=[],this._hand.inputState={pinching:!1},window.XRHand))for(let t=0;t<=window.XRHand.LITTLE_PHALANX_TIP;t++){let t=new dh;t.matrixAutoUpdate=!1,t.visible=!1,this._hand.joints.push(t),this._hand.add(t)}return this._hand},getTargetRaySpace:function(){return null===this._targetRay&&(this._targetRay=new dh,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1),this._targetRay},getGripSpace:function(){return null===this._grip&&(this._grip=new dh,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1),this._grip},dispatchEvent:function(t){return null!==this._targetRay&&this._targetRay.dispatchEvent(t),null!==this._grip&&this._grip.dispatchEvent(t),null!==this._hand&&this._hand.dispatchEvent(t),this},disconnect:function(t){return this.dispatchEvent({type:"disconnected",data:t}),null!==this._targetRay&&(this._targetRay.visible=!1),null!==this._grip&&(this._grip.visible=!1),null!==this._hand&&(this._hand.visible=!1),this},update:function(t,e,n){let i=null,r=null,o=null;const s=this._targetRay,a=this._grip,c=this._hand;if(t)if(t.hand){o=!0;for(let i=0;i<=window.XRHand.LITTLE_PHALANX_TIP;i++)if(t.hand[i]){let r=e.getJointPose(t.hand[i],n);const o=c.joints[i];null!==r&&(o.matrix.fromArray(r.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.jointRadius=r.radius),o.visible=null!==r;const s=c.joints[window.XRHand.INDEX_PHALANX_TIP],a=c.joints[window.XRHand.THUMB_PHALANX_TIP],l=s.position.distanceTo(a.position),h=.02,u=.005;c.inputState.pinching&&l>h+u?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:t.handedness,target:this})):!c.inputState.pinching&&l<=h-u&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:t.handedness,target:this}))}}else null!==s&&null!==(i=e.getPose(t.targetRaySpace,n))&&(s.matrix.fromArray(i.transform.matrix),s.matrix.decompose(s.position,s.rotation,s.scale)),null!==a&&t.gripSpace&&null!==(r=e.getPose(t.gripSpace,n))&&(a.matrix.fromArray(r.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale));return null!==s&&(s.visible=null!==i),null!==a&&(a.visible=null!==r),null!==c&&(c.visible=null!==o),this}}),Object.assign(mh.prototype,Pn.prototype),yh.prototype=Object.assign(Object.create(vh.prototype),{constructor:yh,isWebGL1Renderer:!0}),Object.assign(xh.prototype,{isFogExp2:!0,clone:function(){return new xh(this.color,this.density)},toJSON:function(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}),Object.assign(_h.prototype,{isFog:!0,clone:function(){return new _h(this.color,this.near,this.far)},toJSON:function(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}),Object.defineProperty(bh.prototype,"needsUpdate",{set:function(t){!0===t&&this.version++}}),Object.assign(bh.prototype,{isInterleavedBuffer:!0,onUploadCallback:function(){},setUsage:function(t){return this.usage=t,this},copy:function(t){return this.array=new t.array.constructor(t.array),this.count=t.count,this.stride=t.stride,this.usage=t.usage,this},copyAt:function(t,e,n){t*=this.stride,n*=e.stride;for(let i=0,r=this.stride;i<r;i++)this.array[t+i]=e.array[n+i];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},clone:function(t){void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=In.generateUUID()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const e=new bh(new this.array.constructor(t.arrayBuffers[this.array.buffer._uuid]),this.stride);return e.setUsage(this.usage),e},onUpload:function(t){return this.onUploadCallback=t,this},toJSON:function(t){return void 0===t.arrayBuffers&&(t.arrayBuffers={}),void 0===this.array.buffer._uuid&&(this.array.buffer._uuid=In.generateUUID()),void 0===t.arrayBuffers[this.array.buffer._uuid]&&(t.arrayBuffers[this.array.buffer._uuid]=Array.prototype.slice.call(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}});const wh=new Xn;function Mh(t,e,n,i){this.name="",this.data=t,this.itemSize=e,this.offset=n,this.normalized=!0===i}function Sh(t){gr.call(this),this.type="SpriteMaterial",this.color=new hr(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.setValues(t)}let Th;Object.defineProperties(Mh.prototype,{count:{get:function(){return this.data.count}},array:{get:function(){return this.data.array}},needsUpdate:{set:function(t){this.data.needsUpdate=t}}}),Object.assign(Mh.prototype,{isInterleavedBufferAttribute:!0,applyMatrix4:function(t){for(let e=0,n=this.data.count;e<n;e++)wh.x=this.getX(e),wh.y=this.getY(e),wh.z=this.getZ(e),wh.applyMatrix4(t),this.setXYZ(e,wh.x,wh.y,wh.z);return this},setX:function(t,e){return this.data.array[t*this.data.stride+this.offset]=e,this},setY:function(t,e){return this.data.array[t*this.data.stride+this.offset+1]=e,this},setZ:function(t,e){return this.data.array[t*this.data.stride+this.offset+2]=e,this},setW:function(t,e){return this.data.array[t*this.data.stride+this.offset+3]=e,this},getX:function(t){return this.data.array[t*this.data.stride+this.offset]},getY:function(t){return this.data.array[t*this.data.stride+this.offset+1]},getZ:function(t){return this.data.array[t*this.data.stride+this.offset+2]},getW:function(t){return this.data.array[t*this.data.stride+this.offset+3]},setXY:function(t,e,n){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this},setXYZ:function(t,e,n,i){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this},setXYZW:function(t,e,n,i,r){return t=t*this.data.stride+this.offset,this.data.array[t+0]=e,this.data.array[t+1]=n,this.data.array[t+2]=i,this.data.array[t+3]=r,this},clone:function(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return new _r(new this.array.constructor(t),this.itemSize,this.normalized)}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.clone(t)),new Mh(t.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)},toJSON:function(t){if(void 0===t){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.");const t=[];for(let e=0;e<this.count;e++){const n=e*this.data.stride+this.offset;for(let e=0;e<this.itemSize;e++)t.push(this.data.array[n+e])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}return void 0===t.interleavedBuffers&&(t.interleavedBuffers={}),void 0===t.interleavedBuffers[this.data.uuid]&&(t.interleavedBuffers[this.data.uuid]=this.data.toJSON(t)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}),Sh.prototype=Object.create(gr.prototype),Sh.prototype.constructor=Sh,Sh.prototype.isSpriteMaterial=!0,Sh.prototype.copy=function(t){return gr.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.rotation=t.rotation,this.sizeAttenuation=t.sizeAttenuation,this};const Eh=new Xn,Ah=new Xn,Lh=new Xn,Rh=new Nn,Ch=new Nn,Ph=new ei,Oh=new Xn,Dh=new Xn,Ih=new Xn,Nh=new Nn,Bh=new Nn,Fh=new Nn;function Uh(t){if(xi.call(this),this.type="Sprite",void 0===Th){Th=new Gr;const t=new bh(new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),5);Th.setIndex([0,1,2,0,2,3]),Th.setAttribute("position",new Mh(t,3,0,!1)),Th.setAttribute("uv",new Mh(t,2,3,!1))}this.geometry=Th,this.material=void 0!==t?t:new Sh,this.center=new Nn(.5,.5)}function Gh(t,e,n,i,r,o){Rh.subVectors(t,n).addScalar(.5).multiply(i),void 0!==r?(Ch.x=o*Rh.x-r*Rh.y,Ch.y=r*Rh.x+o*Rh.y):Ch.copy(Rh),t.copy(e),t.x+=Ch.x,t.y+=Ch.y,t.applyMatrix4(Ph)}Uh.prototype=Object.assign(Object.create(xi.prototype),{constructor:Uh,isSprite:!0,raycast:function(t,e){null===t.camera&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),Ah.setFromMatrixScale(this.matrixWorld),Ph.copy(t.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(t.camera.matrixWorldInverse,this.matrixWorld),Lh.setFromMatrixPosition(this.modelViewMatrix),t.camera.isPerspectiveCamera&&!1===this.material.sizeAttenuation&&Ah.multiplyScalar(-Lh.z);const n=this.material.rotation;let i,r;0!==n&&(r=Math.cos(n),i=Math.sin(n));const o=this.center;Gh(Oh.set(-.5,-.5,0),Lh,o,Ah,i,r),Gh(Dh.set(.5,-.5,0),Lh,o,Ah,i,r),Gh(Ih.set(.5,.5,0),Lh,o,Ah,i,r),Nh.set(0,0),Bh.set(1,0),Fh.set(1,1);let s=t.ray.intersectTriangle(Oh,Dh,Ih,!1,Eh);if(null===s&&(Gh(Dh.set(-.5,.5,0),Lh,o,Ah,i,r),Bh.set(0,1),null===(s=t.ray.intersectTriangle(Oh,Ih,Dh,!1,Eh))))return;const a=t.ray.origin.distanceTo(Eh);a<t.near||a>t.far||e.push({distance:a,point:Eh.clone(),uv:sr.getUV(Eh,Oh,Dh,Ih,Nh,Bh,Fh,new Nn),face:null,object:this})},copy:function(t){return xi.prototype.copy.call(this,t),void 0!==t.center&&this.center.copy(t.center),this.material=t.material,this}});const zh=new Xn,Hh=new Xn;function kh(){xi.call(this),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}function Vh(t,e){t&&t.isGeometry&&console.error("THREE.SkinnedMesh no longer supports THREE.Geometry. Use THREE.BufferGeometry instead."),io.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new ei,this.bindMatrixInverse=new ei}kh.prototype=Object.assign(Object.create(xi.prototype),{constructor:kh,isLOD:!0,copy:function(t){xi.prototype.copy.call(this,t,!1);const e=t.levels;for(let n=0,i=e.length;n<i;n++){const t=e[n];this.addLevel(t.object.clone(),t.distance)}return this.autoUpdate=t.autoUpdate,this},addLevel:function(t,e){void 0===e&&(e=0),e=Math.abs(e);const n=this.levels;let i;for(i=0;i<n.length&&!(e<n[i].distance);i++);return n.splice(i,0,{distance:e,object:t}),this.add(t),this},getCurrentLevel:function(){return this._currentLevel},getObjectForDistance:function(t){const e=this.levels;if(e.length>0){let n,i;for(n=1,i=e.length;n<i&&!(t<e[n].distance);n++);return e[n-1].object}return null},raycast:function(t,e){if(this.levels.length>0){zh.setFromMatrixPosition(this.matrixWorld);const n=t.ray.origin.distanceTo(zh);this.getObjectForDistance(n).raycast(t,e)}},update:function(t){const e=this.levels;if(e.length>1){zh.setFromMatrixPosition(t.matrixWorld),Hh.setFromMatrixPosition(this.matrixWorld);const n=zh.distanceTo(Hh)/t.zoom;let i,r;for(e[0].object.visible=!0,i=1,r=e.length;i<r&&n>=e[i].distance;i++)e[i-1].object.visible=!1,e[i].object.visible=!0;for(this._currentLevel=i-1;i<r;i++)e[i].object.visible=!1}},toJSON:function(t){const e=xi.prototype.toJSON.call(this,t);!1===this.autoUpdate&&(e.object.autoUpdate=!1),e.object.levels=[];const n=this.levels;for(let i=0,r=n.length;i<r;i++){const t=n[i];e.object.levels.push({object:t.object.uuid,distance:t.distance})}return e}}),Vh.prototype=Object.assign(Object.create(io.prototype),{constructor:Vh,isSkinnedMesh:!0,copy:function(t){return io.prototype.copy.call(this,t),this.bindMode=t.bindMode,this.bindMatrix.copy(t.bindMatrix),this.bindMatrixInverse.copy(t.bindMatrixInverse),this.skeleton=t.skeleton,this},bind:function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},pose:function(){this.skeleton.pose()},normalizeSkinWeights:function(){const t=new Hn,e=this.geometry.attributes.skinWeight;for(let n=0,i=e.count;n<i;n++){t.x=e.getX(n),t.y=e.getY(n),t.z=e.getZ(n),t.w=e.getW(n);const i=1/t.manhattanLength();i!==1/0?t.multiplyScalar(i):t.set(1,0,0,0),e.setXYZW(n,t.x,t.y,t.z,t.w)}},updateMatrixWorld:function(t){io.prototype.updateMatrixWorld.call(this,t),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)},boneTransform:function(){const t=new Xn,e=new Hn,n=new Hn,i=new Xn,r=new ei;return function(o,s){const a=this.skeleton,c=this.geometry;e.fromBufferAttribute(c.attributes.skinIndex,o),n.fromBufferAttribute(c.attributes.skinWeight,o),t.fromBufferAttribute(c.attributes.position,o).applyMatrix4(this.bindMatrix),s.set(0,0,0);for(let l=0;l<4;l++){const o=n.getComponent(l);if(0!==o){const n=e.getComponent(l);r.multiplyMatrices(a.bones[n].matrixWorld,a.boneInverses[n]),s.addScaledVector(i.copy(t).applyMatrix4(r),o)}}return s.applyMatrix4(this.bindMatrixInverse)}}()});const jh=new ei,Wh=new ei;function qh(t,e){if(t=t||[],this.bones=t.slice(0),this.boneMatrices=new Float32Array(16*this.bones.length),this.frame=-1,void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else{console.warn("THREE.Skeleton boneInverses is the wrong length."),this.boneInverses=[];for(let t=0,e=this.bones.length;t<e;t++)this.boneInverses.push(new ei)}}function Xh(){xi.call(this),this.type="Bone"}Object.assign(qh.prototype,{calculateInverses:function(){this.boneInverses=[];for(let t=0,e=this.bones.length;t<e;t++){const e=new ei;this.bones[t]&&e.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(e)}},pose:function(){for(let t=0,e=this.bones.length;t<e;t++){const e=this.bones[t];e&&e.matrixWorld.getInverse(this.boneInverses[t])}for(let t=0,e=this.bones.length;t<e;t++){const e=this.bones[t];e&&(e.parent&&e.parent.isBone?(e.matrix.getInverse(e.parent.matrixWorld),e.matrix.multiply(e.matrixWorld)):e.matrix.copy(e.matrixWorld),e.matrix.decompose(e.position,e.quaternion,e.scale))}},update:function(){const t=this.bones,e=this.boneInverses,n=this.boneMatrices,i=this.boneTexture;for(let r=0,o=t.length;r<o;r++){const i=t[r]?t[r].matrixWorld:Wh;jh.multiplyMatrices(i,e[r]),jh.toArray(n,16*r)}void 0!==i&&(i.needsUpdate=!0)},clone:function(){return new qh(this.bones,this.boneInverses)},getBoneByName:function(t){for(let e=0,n=this.bones.length;e<n;e++){const n=this.bones[e];if(n.name===t)return n}},dispose:function(){this.boneTexture&&(this.boneTexture.dispose(),this.boneTexture=void 0)}}),Xh.prototype=Object.assign(Object.create(xi.prototype),{constructor:Xh,isBone:!0});const Yh=new ei,Zh=new ei,Jh=[],Qh=new io;function Kh(t,e,n){io.call(this,t,e),this.instanceMatrix=new _r(new Float32Array(16*n),16),this.count=n,this.frustumCulled=!1}function $h(t){gr.call(this),this.type="LineBasicMaterial",this.color=new hr(16777215),this.linewidth=1,this.linecap="round",this.linejoin="round",this.morphTargets=!1,this.setValues(t)}Kh.prototype=Object.assign(Object.create(io.prototype),{constructor:Kh,isInstancedMesh:!0,copy:function(t){return io.prototype.copy.call(this,t),this.instanceMatrix.copy(t.instanceMatrix),this.count=t.count,this},getMatrixAt:function(t,e){e.fromArray(this.instanceMatrix.array,16*t)},raycast:function(t,e){const n=this.matrixWorld,i=this.count;if(Qh.geometry=this.geometry,Qh.material=this.material,void 0!==Qh.material)for(let r=0;r<i;r++){this.getMatrixAt(r,Yh),Zh.multiplyMatrices(n,Yh),Qh.matrixWorld=Zh,Qh.raycast(t,Jh);for(let t=0,n=Jh.length;t<n;t++){const n=Jh[t];n.instanceId=r,n.object=this,e.push(n)}Jh.length=0}},setMatrixAt:function(t,e){e.toArray(this.instanceMatrix.array,16*t)},updateMorphTargets:function(){}}),$h.prototype=Object.create(gr.prototype),$h.prototype.constructor=$h,$h.prototype.isLineBasicMaterial=!0,$h.prototype.copy=function(t){return gr.prototype.copy.call(this,t),this.color.copy(t.color),this.linewidth=t.linewidth,this.linecap=t.linecap,this.linejoin=t.linejoin,this.morphTargets=t.morphTargets,this};const tu=new Xn,eu=new Xn,nu=new ei,iu=new Wi,ru=new Fi;function ou(t,e,n){1===n&&console.error("THREE.Line: parameter THREE.LinePieces no longer supported. Use THREE.LineSegments instead."),xi.call(this),this.type="Line",this.geometry=void 0!==t?t:new Gr,this.material=void 0!==e?e:new $h,this.updateMorphTargets()}ou.prototype=Object.assign(Object.create(xi.prototype),{constructor:ou,isLine:!0,copy:function(t){return xi.prototype.copy.call(this,t),this.material=t.material,this.geometry=t.geometry,this},computeLineDistances:function(){const t=this.geometry;if(t.isBufferGeometry)if(null===t.index){const e=t.attributes.position,n=[0];for(let t=1,i=e.count;t<i;t++)tu.fromBufferAttribute(e,t-1),eu.fromBufferAttribute(e,t),n[t]=n[t-1],n[t]+=tu.distanceTo(eu);t.setAttribute("lineDistance",new Lr(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){const e=t.vertices,n=t.lineDistances;n[0]=0;for(let t=1,i=e.length;t<i;t++)n[t]=n[t-1],n[t]+=e[t-1].distanceTo(e[t])}return this},raycast:function(t,e){const n=this.geometry,i=this.matrixWorld,r=t.params.Line.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),ru.copy(n.boundingSphere),ru.applyMatrix4(i),ru.radius+=r,!1===t.ray.intersectsSphere(ru))return;nu.getInverse(i),iu.copy(t.ray).applyMatrix4(nu);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o,a=new Xn,c=new Xn,l=new Xn,h=new Xn,u=this&&this.isLineSegments?2:1;if(n.isBufferGeometry){const i=n.index,r=n.attributes.position.array;if(null!==i){const n=i.array;for(let i=0,o=n.length-1;i<o;i+=u){const o=n[i],u=n[i+1];if(a.fromArray(r,3*o),c.fromArray(r,3*u),iu.distanceSqToSegment(a,c,h,l)>s)continue;h.applyMatrix4(this.matrixWorld);const p=t.ray.origin.distanceTo(h);p<t.near||p>t.far||e.push({distance:p,point:l.clone().applyMatrix4(this.matrixWorld),index:i,face:null,faceIndex:null,object:this})}}else for(let n=0,o=r.length/3-1;n<o;n+=u){if(a.fromArray(r,3*n),c.fromArray(r,3*n+3),iu.distanceSqToSegment(a,c,h,l)>s)continue;h.applyMatrix4(this.matrixWorld);const i=t.ray.origin.distanceTo(h);i<t.near||i>t.far||e.push({distance:i,point:l.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}else if(n.isGeometry){const i=n.vertices,r=i.length;for(let n=0;n<r-1;n+=u){if(iu.distanceSqToSegment(i[n],i[n+1],h,l)>s)continue;h.applyMatrix4(this.matrixWorld);const r=t.ray.origin.distanceTo(h);r<t.near||r>t.far||e.push({distance:r,point:l.clone().applyMatrix4(this.matrixWorld),index:n,face:null,faceIndex:null,object:this})}}},updateMorphTargets:function(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e<n;e++){const n=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}}}else{const e=t.morphTargets;void 0!==e&&e.length>0&&console.error("THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}});const su=new Xn,au=new Xn;function cu(t,e){ou.call(this,t,e),this.type="LineSegments"}function lu(t,e){ou.call(this,t,e),this.type="LineLoop"}function hu(t){gr.call(this),this.type="PointsMaterial",this.color=new hr(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.morphTargets=!1,this.setValues(t)}cu.prototype=Object.assign(Object.create(ou.prototype),{constructor:cu,isLineSegments:!0,computeLineDistances:function(){const t=this.geometry;if(t.isBufferGeometry)if(null===t.index){const e=t.attributes.position,n=[];for(let t=0,i=e.count;t<i;t+=2)su.fromBufferAttribute(e,t),au.fromBufferAttribute(e,t+1),n[t]=0===t?0:n[t-1],n[t+1]=n[t]+su.distanceTo(au);t.setAttribute("lineDistance",new Lr(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");else if(t.isGeometry){const e=t.vertices,n=t.lineDistances;for(let t=0,i=e.length;t<i;t+=2)su.copy(e[t]),au.copy(e[t+1]),n[t]=0===t?0:n[t-1],n[t+1]=n[t]+su.distanceTo(au)}return this}}),lu.prototype=Object.assign(Object.create(ou.prototype),{constructor:lu,isLineLoop:!0}),hu.prototype=Object.create(gr.prototype),hu.prototype.constructor=hu,hu.prototype.isPointsMaterial=!0,hu.prototype.copy=function(t){return gr.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.alphaMap=t.alphaMap,this.size=t.size,this.sizeAttenuation=t.sizeAttenuation,this.morphTargets=t.morphTargets,this};const uu=new ei,pu=new Wi,du=new Fi,fu=new Xn;function mu(t,e){xi.call(this),this.type="Points",this.geometry=void 0!==t?t:new Gr,this.material=void 0!==e?e:new hu,this.updateMorphTargets()}function gu(t,e,n,i,r,o,s){const a=pu.distanceSqToPoint(t);if(a<n){const n=new Xn;pu.closestPointToPoint(t,n),n.applyMatrix4(i);const c=r.ray.origin.distanceTo(n);if(c<r.near||c>r.far)return;o.push({distance:c,distanceToRay:Math.sqrt(a),point:n,index:e,face:null,object:s})}}function vu(t,e,n,i,r,o,s,a,c){zn.call(this,t,e,n,i,r,o,s,a,c),this.format=void 0!==s?s:It,this.minFilter=void 0!==o?o:gt,this.magFilter=void 0!==r?r:gt,this.generateMipmaps=!1;const l=this;"requestVideoFrameCallback"in t&&t.requestVideoFrameCallback(function e(){l.needsUpdate=!0,t.requestVideoFrameCallback(e)})}function yu(t,e,n,i,r,o,s,a,c,l,h,u){zn.call(this,null,o,s,a,c,l,i,r,h,u),this.image={width:e,height:n},this.mipmaps=t,this.flipY=!1,this.generateMipmaps=!1}function xu(t,e,n,i,r,o,s,a,c){zn.call(this,t,e,n,i,r,o,s,a,c),this.needsUpdate=!0}function _u(t,e,n,i,r,o,s,a,c,l){if((l=void 0!==l?l:Gt)!==Gt&&l!==zt)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");void 0===n&&l===Gt&&(n=St),void 0===n&&l===zt&&(n=Ot),zn.call(this,null,i,r,o,s,a,l,n,c),this.image={width:t,height:e},this.magFilter=void 0!==s?s:ut,this.minFilter=void 0!==a?a:ut,this.flipY=!1,this.generateMipmaps=!1}function bu(t){Gr.call(this),this.type="WireframeGeometry";const e=[],n=[0,0],i={},r=["a","b","c"];if(t&&t.isGeometry){const o=t.faces;for(let t=0,e=o.length;t<e;t++){const e=o[t];for(let t=0;t<3;t++){const o=e[r[t]],s=e[r[(t+1)%3]];n[0]=Math.min(o,s),n[1]=Math.max(o,s);const a=n[0]+","+n[1];void 0===i[a]&&(i[a]={index1:n[0],index2:n[1]})}}for(const n in i){const r=i[n];let o=t.vertices[r.index1];e.push(o.x,o.y,o.z),o=t.vertices[r.index2],e.push(o.x,o.y,o.z)}}else if(t&&t.isBufferGeometry){let r=new Xn;if(null!==t.index){const o=t.attributes.position,s=t.index;let a=t.groups;0===a.length&&(a=[{start:0,count:s.count,materialIndex:0}]);for(let t=0,e=a.length;t<e;++t){const e=a[t],r=e.start;for(let t=r,o=r+e.count;t<o;t+=3)for(let e=0;e<3;e++){const r=s.getX(t+e),o=s.getX(t+(e+1)%3);n[0]=Math.min(r,o),n[1]=Math.max(r,o);const a=n[0]+","+n[1];void 0===i[a]&&(i[a]={index1:n[0],index2:n[1]})}}for(const t in i){const n=i[t];r.fromBufferAttribute(o,n.index1),e.push(r.x,r.y,r.z),r.fromBufferAttribute(o,n.index2),e.push(r.x,r.y,r.z)}}else{const n=t.attributes.position;for(let t=0,i=n.count/3;t<i;t++)for(let o=0;o<3;o++){const i=3*t+o;r.fromBufferAttribute(n,i),e.push(r.x,r.y,r.z);const s=3*t+(o+1)%3;r.fromBufferAttribute(n,s),e.push(r.x,r.y,r.z)}}}this.setAttribute("position",new Lr(e,3))}function wu(t,e,n){ho.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:n},this.fromBufferGeometry(new Mu(t,e,n)),this.mergeVertices()}function Mu(t,e,n){Gr.call(this),this.type="ParametricBufferGeometry",this.parameters={func:t,slices:e,stacks:n};const i=[],r=[],o=[],s=[],a=new Xn,c=new Xn,l=new Xn,h=new Xn,u=new Xn;t.length<3&&console.error("THREE.ParametricGeometry: Function must now modify a Vector3 as third parameter.");const p=e+1;for(let d=0;d<=n;d++){const i=d/n;for(let n=0;n<=e;n++){const p=n/e;t(p,i,c),r.push(c.x,c.y,c.z),p-1e-5>=0?(t(p-1e-5,i,l),h.subVectors(c,l)):(t(p+1e-5,i,l),h.subVectors(l,c)),i-1e-5>=0?(t(p,i-1e-5,l),u.subVectors(c,l)):(t(p,i+1e-5,l),u.subVectors(l,c)),a.crossVectors(h,u).normalize(),o.push(a.x,a.y,a.z),s.push(p,i)}}for(let d=0;d<n;d++)for(let t=0;t<e;t++){const e=d*p+t,n=d*p+t+1,r=(d+1)*p+t+1,o=(d+1)*p+t;i.push(e,n,o),i.push(n,r,o)}this.setIndex(i),this.setAttribute("position",new Lr(r,3)),this.setAttribute("normal",new Lr(o,3)),this.setAttribute("uv",new Lr(s,2))}function Su(t,e,n,i){ho.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i},this.fromBufferGeometry(new Tu(t,e,n,i)),this.mergeVertices()}function Tu(t,e,n,i){Gr.call(this),this.type="PolyhedronBufferGeometry",this.parameters={vertices:t,indices:e,radius:n,detail:i},n=n||1;const r=[],o=[];function s(t,e,n,i){const r=Math.pow(2,i),o=[];for(let s=0;s<=r;s++){o[s]=[];const i=t.clone().lerp(n,s/r),a=e.clone().lerp(n,s/r),c=r-s;for(let t=0;t<=c;t++)o[s][t]=0===t&&s===r?i:i.clone().lerp(a,t/c)}for(let s=0;s<r;s++)for(let t=0;t<2*(r-s)-1;t++){const e=Math.floor(t/2);t%2==0?(a(o[s][e+1]),a(o[s+1][e]),a(o[s][e])):(a(o[s][e+1]),a(o[s+1][e+1]),a(o[s+1][e]))}}function a(t){r.push(t.x,t.y,t.z)}function c(e,n){const i=3*e;n.x=t[i+0],n.y=t[i+1],n.z=t[i+2]}function l(t,e,n,i){i<0&&1===t.x&&(o[e]=t.x-1),0===n.x&&0===n.z&&(o[e]=i/2/Math.PI+.5)}function h(t){return Math.atan2(t.z,-t.x)}!function(t){const n=new Xn,i=new Xn,r=new Xn;for(let o=0;o<e.length;o+=3)c(e[o+0],n),c(e[o+1],i),c(e[o+2],r),s(n,i,r,t)}(i=i||0),function(t){const e=new Xn;for(let n=0;n<r.length;n+=3)e.x=r[n+0],e.y=r[n+1],e.z=r[n+2],e.normalize().multiplyScalar(t),r[n+0]=e.x,r[n+1]=e.y,r[n+2]=e.z}(n),function(){const t=new Xn;for(let n=0;n<r.length;n+=3){t.x=r[n+0],t.y=r[n+1],t.z=r[n+2];const i=h(t)/2/Math.PI+.5,s=(e=t,Math.atan2(-e.y,Math.sqrt(e.x*e.x+e.z*e.z))/Math.PI+.5);o.push(i,1-s)}var e;(function(){const t=new Xn,e=new Xn,n=new Xn,i=new Xn,s=new Nn,a=new Nn,c=new Nn;for(let u=0,p=0;u<r.length;u+=9,p+=6){t.set(r[u+0],r[u+1],r[u+2]),e.set(r[u+3],r[u+4],r[u+5]),n.set(r[u+6],r[u+7],r[u+8]),s.set(o[p+0],o[p+1]),a.set(o[p+2],o[p+3]),c.set(o[p+4],o[p+5]),i.copy(t).add(e).add(n).divideScalar(3);const d=h(i);l(s,p+0,t,d),l(a,p+2,e,d),l(c,p+4,n,d)}})(),function(){for(let t=0;t<o.length;t+=6){const e=o[t+0],n=o[t+2],i=o[t+4],r=Math.max(e,n,i),s=Math.min(e,n,i);r>.9&&s<.1&&(e<.2&&(o[t+0]+=1),n<.2&&(o[t+2]+=1),i<.2&&(o[t+4]+=1))}}()}(),this.setAttribute("position",new Lr(r,3)),this.setAttribute("normal",new Lr(r.slice(),3)),this.setAttribute("uv",new Lr(o,2)),0===i?this.computeVertexNormals():this.normalizeNormals()}function Eu(t,e){ho.call(this),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Au(t,e)),this.mergeVertices()}function Au(t,e){Tu.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Lu(t,e){ho.call(this),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Ru(t,e)),this.mergeVertices()}function Ru(t,e){Tu.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Cu(t,e){ho.call(this),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Pu(t,e)),this.mergeVertices()}function Pu(t,e){const n=(1+Math.sqrt(5))/2,i=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1];Tu.call(this,i,[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Ou(t,e){ho.call(this),this.type="DodecahedronGeometry",this.parameters={radius:t,detail:e},this.fromBufferGeometry(new Du(t,e)),this.mergeVertices()}function Du(t,e){const n=(1+Math.sqrt(5))/2,i=1/n,r=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-i,-n,0,-i,n,0,i,-n,0,i,n,-i,-n,0,-i,n,0,i,-n,0,i,n,0,-n,0,-i,n,0,-i,-n,0,i,n,0,i];Tu.call(this,r,[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e),this.type="DodecahedronBufferGeometry",this.parameters={radius:t,detail:e}}function Iu(t,e,n,i,r,o){ho.call(this),this.type="TubeGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r},void 0!==o&&console.warn("THREE.TubeGeometry: taper has been removed.");const s=new Nu(t,e,n,i,r);this.tangents=s.tangents,this.normals=s.normals,this.binormals=s.binormals,this.fromBufferGeometry(s),this.mergeVertices()}function Nu(t,e,n,i,r){Gr.call(this),this.type="TubeBufferGeometry",this.parameters={path:t,tubularSegments:e,radius:n,radialSegments:i,closed:r},e=e||64,n=n||1,i=i||8,r=r||!1;const o=t.computeFrenetFrames(e,r);this.tangents=o.tangents,this.normals=o.normals,this.binormals=o.binormals;const s=new Xn,a=new Xn,c=new Nn;let l=new Xn;const h=[],u=[],p=[],d=[];function f(r){l=t.getPointAt(r/e,l);const c=o.normals[r],p=o.binormals[r];for(let t=0;t<=i;t++){const e=t/i*Math.PI*2,r=Math.sin(e),o=-Math.cos(e);a.x=o*c.x+r*p.x,a.y=o*c.y+r*p.y,a.z=o*c.z+r*p.z,a.normalize(),u.push(a.x,a.y,a.z),s.x=l.x+n*a.x,s.y=l.y+n*a.y,s.z=l.z+n*a.z,h.push(s.x,s.y,s.z)}}!function(){for(let t=0;t<e;t++)f(t);f(!1===r?e:0),function(){for(let t=0;t<=e;t++)for(let n=0;n<=i;n++)c.x=t/e,c.y=n/i,p.push(c.x,c.y)}(),function(){for(let t=1;t<=e;t++)for(let e=1;e<=i;e++){const n=(i+1)*(t-1)+(e-1),r=(i+1)*t+(e-1),o=(i+1)*t+e,s=(i+1)*(t-1)+e;d.push(n,r,s),d.push(r,o,s)}}()}(),this.setIndex(d),this.setAttribute("position",new Lr(h,3)),this.setAttribute("normal",new Lr(u,3)),this.setAttribute("uv",new Lr(p,2))}function Bu(t,e,n,i,r,o,s){ho.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:i,p:r,q:o},void 0!==s&&console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),this.fromBufferGeometry(new Fu(t,e,n,i,r,o)),this.mergeVertices()}function Fu(t,e,n,i,r,o){Gr.call(this),this.type="TorusKnotBufferGeometry",this.parameters={radius:t,tube:e,tubularSegments:n,radialSegments:i,p:r,q:o},t=t||1,e=e||.4,n=Math.floor(n)||64,i=Math.floor(i)||8,r=r||2,o=o||3;const s=[],a=[],c=[],l=[],h=new Xn,u=new Xn,p=new Xn,d=new Xn,f=new Xn,m=new Xn,g=new Xn;for(let y=0;y<=n;++y){const s=y/n*r*Math.PI*2;v(s,r,o,t,p),v(s+.01,r,o,t,d),m.subVectors(d,p),g.addVectors(d,p),f.crossVectors(m,g),g.crossVectors(f,m),f.normalize(),g.normalize();for(let t=0;t<=i;++t){const r=t/i*Math.PI*2,o=-e*Math.cos(r),s=e*Math.sin(r);h.x=p.x+(o*g.x+s*f.x),h.y=p.y+(o*g.y+s*f.y),h.z=p.z+(o*g.z+s*f.z),a.push(h.x,h.y,h.z),u.subVectors(h,p).normalize(),c.push(u.x,u.y,u.z),l.push(y/n),l.push(t/i)}}for(let y=1;y<=n;y++)for(let t=1;t<=i;t++){const e=(i+1)*(y-1)+(t-1),n=(i+1)*y+(t-1),r=(i+1)*y+t,o=(i+1)*(y-1)+t;s.push(e,n,o),s.push(n,r,o)}function v(t,e,n,i,r){const o=Math.cos(t),s=Math.sin(t),a=n/e*t,c=Math.cos(a);r.x=i*(2+c)*.5*o,r.y=i*(2+c)*s*.5,r.z=i*Math.sin(a)*.5}this.setIndex(s),this.setAttribute("position",new Lr(a,3)),this.setAttribute("normal",new Lr(c,3)),this.setAttribute("uv",new Lr(l,2))}function Uu(t,e,n,i,r){ho.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:i,arc:r},this.fromBufferGeometry(new Gu(t,e,n,i,r)),this.mergeVertices()}function Gu(t,e,n,i,r){Gr.call(this),this.type="TorusBufferGeometry",this.parameters={radius:t,tube:e,radialSegments:n,tubularSegments:i,arc:r},t=t||1,e=e||.4,n=Math.floor(n)||8,i=Math.floor(i)||6,r=r||2*Math.PI;const o=[],s=[],a=[],c=[],l=new Xn,h=new Xn,u=new Xn;for(let p=0;p<=n;p++)for(let o=0;o<=i;o++){const d=o/i*r,f=p/n*Math.PI*2;h.x=(t+e*Math.cos(f))*Math.cos(d),h.y=(t+e*Math.cos(f))*Math.sin(d),h.z=e*Math.sin(f),s.push(h.x,h.y,h.z),l.x=t*Math.cos(d),l.y=t*Math.sin(d),u.subVectors(h,l).normalize(),a.push(u.x,u.y,u.z),c.push(o/i),c.push(p/n)}for(let p=1;p<=n;p++)for(let t=1;t<=i;t++){const e=(i+1)*p+t-1,n=(i+1)*(p-1)+t-1,r=(i+1)*(p-1)+t,s=(i+1)*p+t;o.push(e,n,s),o.push(n,r,s)}this.setIndex(o),this.setAttribute("position",new Lr(s,3)),this.setAttribute("normal",new Lr(a,3)),this.setAttribute("uv",new Lr(c,2))}mu.prototype=Object.assign(Object.create(xi.prototype),{constructor:mu,isPoints:!0,copy:function(t){return xi.prototype.copy.call(this,t),this.material=t.material,this.geometry=t.geometry,this},raycast:function(t,e){const n=this.geometry,i=this.matrixWorld,r=t.params.Points.threshold;if(null===n.boundingSphere&&n.computeBoundingSphere(),du.copy(n.boundingSphere),du.applyMatrix4(i),du.radius+=r,!1===t.ray.intersectsSphere(du))return;uu.getInverse(i),pu.copy(t.ray).applyMatrix4(uu);const o=r/((this.scale.x+this.scale.y+this.scale.z)/3),s=o*o;if(n.isBufferGeometry){const r=n.index,o=n.attributes.position.array;if(null!==r){const n=r.array;for(let r=0,a=n.length;r<a;r++){const a=n[r];fu.fromArray(o,3*a),gu(fu,a,s,i,t,e,this)}}else for(let n=0,a=o.length/3;n<a;n++)fu.fromArray(o,3*n),gu(fu,n,s,i,t,e,this)}else{const r=n.vertices;for(let n=0,o=r.length;n<o;n++)gu(r[n],n,s,i,t,e,this)}},updateMorphTargets:function(){const t=this.geometry;if(t.isBufferGeometry){const e=t.morphAttributes,n=Object.keys(e);if(n.length>0){const t=e[n[0]];if(void 0!==t){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let e=0,n=t.length;e<n;e++){const n=t[e].name||String(e);this.morphTargetInfluences.push(0),this.morphTargetDictionary[n]=e}}}}else{const e=t.morphTargets;void 0!==e&&e.length>0&&console.error("THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.")}}}),vu.prototype=Object.assign(Object.create(zn.prototype),{constructor:vu,isVideoTexture:!0,update:function(){const t=this.image;!1==="requestVideoFrameCallback"in t&&t.readyState>=t.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}),yu.prototype=Object.create(zn.prototype),yu.prototype.constructor=yu,yu.prototype.isCompressedTexture=!0,xu.prototype=Object.create(zn.prototype),xu.prototype.constructor=xu,xu.prototype.isCanvasTexture=!0,_u.prototype=Object.create(zn.prototype),_u.prototype.constructor=_u,_u.prototype.isDepthTexture=!0,bu.prototype=Object.create(Gr.prototype),bu.prototype.constructor=bu,wu.prototype=Object.create(ho.prototype),wu.prototype.constructor=wu,Mu.prototype=Object.create(Gr.prototype),Mu.prototype.constructor=Mu,Su.prototype=Object.create(ho.prototype),Su.prototype.constructor=Su,Tu.prototype=Object.create(Gr.prototype),Tu.prototype.constructor=Tu,Eu.prototype=Object.create(ho.prototype),Eu.prototype.constructor=Eu,Au.prototype=Object.create(Tu.prototype),Au.prototype.constructor=Au,Lu.prototype=Object.create(ho.prototype),Lu.prototype.constructor=Lu,Ru.prototype=Object.create(Tu.prototype),Ru.prototype.constructor=Ru,Cu.prototype=Object.create(ho.prototype),Cu.prototype.constructor=Cu,Pu.prototype=Object.create(Tu.prototype),Pu.prototype.constructor=Pu,Ou.prototype=Object.create(ho.prototype),Ou.prototype.constructor=Ou,Du.prototype=Object.create(Tu.prototype),Du.prototype.constructor=Du,Iu.prototype=Object.create(ho.prototype),Iu.prototype.constructor=Iu,Nu.prototype=Object.create(Gr.prototype),Nu.prototype.constructor=Nu,Nu.prototype.toJSON=function(){const t=Gr.prototype.toJSON.call(this);return t.path=this.parameters.path.toJSON(),t},Bu.prototype=Object.create(ho.prototype),Bu.prototype.constructor=Bu,Fu.prototype=Object.create(Gr.prototype),Fu.prototype.constructor=Fu,Uu.prototype=Object.create(ho.prototype),Uu.prototype.constructor=Uu,Gu.prototype=Object.create(Gr.prototype),Gu.prototype.constructor=Gu;const zu={triangulate:function(t,e,n){n=n||2;let i,r,o,s,a,c,l,h=e&&e.length,u=h?e[0]*n:t.length,p=Hu(t,0,u,n,!0),d=[];if(!p||p.next===p.prev)return d;if(h&&(p=Yu(t,e,p,n)),t.length>80*n){i=o=t[0],r=s=t[1];for(let e=n;e<u;e+=n)(a=t[e])<i&&(i=a),(c=t[e+1])<r&&(r=c),a>o&&(o=a),c>s&&(s=c);l=0!==(l=Math.max(o-i,s-r))?1/l:0}return Vu(p,d,n,i,r,l),d}};function Hu(t,e,n,i,r){let o,s;if(r===vp(t,e,n,i)>0)for(o=e;o<n;o+=i)s=fp(o,t[o],t[o+1],s);else for(o=n-i;o>=e;o-=i)s=fp(o,t[o],t[o+1],s);return s&&sp(s,s.next)&&(mp(s),s=s.next),s}function ku(t,e){if(!t)return t;e||(e=t);let n,i=t;do{if(n=!1,i.steiner||!sp(i,i.next)&&0!==op(i.prev,i,i.next))i=i.next;else{if(mp(i),(i=e=i.prev)===i.next)break;n=!0}}while(n||i!==e);return e}function Vu(t,e,n,i,r,o,s){if(!t)return;!s&&o&&$u(t,i,r,o);let a,c,l=t;for(;t.prev!==t.next;)if(a=t.prev,c=t.next,o?Wu(t,i,r,o):ju(t))e.push(a.i/n),e.push(t.i/n),e.push(c.i/n),mp(t),t=c.next,l=c.next;else if((t=c)===l){s?1===s?Vu(t=qu(ku(t),e,n),e,n,i,r,o,2):2===s&&Xu(t,e,n,i,r,o):Vu(ku(t),e,n,i,r,o,1);break}}function ju(t){let e=t.prev,n=t,i=t.next;if(op(e,n,i)>=0)return!1;let r=t.next.next;for(;r!==t.prev;){if(ip(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&op(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Wu(t,e,n,i){let r=t.prev,o=t,s=t.next;if(op(r,o,s)>=0)return!1;let a=r.x<o.x?r.x<s.x?r.x:s.x:o.x<s.x?o.x:s.x,c=r.y<o.y?r.y<s.y?r.y:s.y:o.y<s.y?o.y:s.y,l=r.x>o.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,h=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,u=ep(a,c,e,n,i),p=ep(l,h,e,n,i),d=t.prevZ,f=t.nextZ;for(;d&&d.z>=u&&f&&f.z<=p;){if(d!==t.prev&&d!==t.next&&ip(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&op(d.prev,d,d.next)>=0)return!1;if(d=d.prevZ,f!==t.prev&&f!==t.next&&ip(r.x,r.y,o.x,o.y,s.x,s.y,f.x,f.y)&&op(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;d&&d.z>=u;){if(d!==t.prev&&d!==t.next&&ip(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&op(d.prev,d,d.next)>=0)return!1;d=d.prevZ}for(;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&ip(r.x,r.y,o.x,o.y,s.x,s.y,f.x,f.y)&&op(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function qu(t,e,n){let i=t;do{let r=i.prev,o=i.next.next;!sp(r,o)&&ap(r,i,i.next,o)&&up(r,o)&&up(o,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(o.i/n),mp(i),mp(i.next),i=t=o),i=i.next}while(i!==t);return ku(i)}function Xu(t,e,n,i,r,o){let s=t;do{let t=s.next.next;for(;t!==s.prev;){if(s.i!==t.i&&rp(s,t)){let a=dp(s,t);return s=ku(s,s.next),a=ku(a,a.next),Vu(s,e,n,i,r,o),void Vu(a,e,n,i,r,o)}t=t.next}s=s.next}while(s!==t)}function Yu(t,e,n,i){let r,o,s,a,c,l=[];for(r=0,o=e.length;r<o;r++)(c=Hu(t,s=e[r]*i,a=r<o-1?e[r+1]*i:t.length,i,!1))===c.next&&(c.steiner=!0),l.push(np(c));for(l.sort(Zu),r=0;r<l.length;r++)Ju(l[r],n),n=ku(n,n.next);return n}function Zu(t,e){return t.x-e.x}function Ju(t,e){if(e=Qu(t,e)){const n=dp(e,t);ku(e,e.next),ku(n,n.next)}}function Qu(t,e){let n,i=e,r=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){let t=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=r&&t>s){if(s=t,t===r){if(o===i.y)return i;if(o===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!n)return null;if(r===s)return n;let a,c=n,l=n.x,h=n.y,u=1/0;i=n;do{r>=i.x&&i.x>=l&&r!==i.x&&ip(o<h?r:s,o,l,h,o<h?s:r,o,i.x,i.y)&&(a=Math.abs(o-i.y)/(r-i.x),up(i,t)&&(a<u||a===u&&(i.x>n.x||i.x===n.x&&Ku(n,i)))&&(n=i,u=a)),i=i.next}while(i!==c);return n}function Ku(t,e){return op(t.prev,t,e.prev)<0&&op(e.next,t,t.next)<0}function $u(t,e,n,i){let r=t;do{null===r.z&&(r.z=ep(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,tp(r)}function tp(t){let e,n,i,r,o,s,a,c,l=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,i=n,a=0,e=0;e<l&&(a++,i=i.nextZ);e++);for(c=l;a>0||c>0&&i;)0!==a&&(0===c||!i||n.z<=i.z)?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,c--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}o.nextZ=null,l*=2}while(s>1);return t}function ep(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function np(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function ip(t,e,n,i,r,o,s,a){return(r-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(i-a)-(n-s)*(e-a)>=0&&(n-s)*(o-a)-(r-s)*(i-a)>=0}function rp(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!hp(t,e)&&(up(t,e)&&up(e,t)&&pp(t,e)&&(op(t.prev,t,e.prev)||op(t,e.prev,e))||sp(t,e)&&op(t.prev,t,t.next)>0&&op(e.prev,e,e.next)>0)}function op(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function sp(t,e){return t.x===e.x&&t.y===e.y}function ap(t,e,n,i){const r=lp(op(t,e,n)),o=lp(op(t,e,i)),s=lp(op(n,i,t)),a=lp(op(n,i,e));return r!==o&&s!==a||(!(0!==r||!cp(t,n,e))||(!(0!==o||!cp(t,i,e))||(!(0!==s||!cp(n,t,i))||!(0!==a||!cp(n,e,i)))))}function cp(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function lp(t){return t>0?1:t<0?-1:0}function hp(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&ap(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function up(t,e){return op(t.prev,t,t.next)<0?op(t,e,t.next)>=0&&op(t,t.prev,e)>=0:op(t,e,t.prev)<0||op(t,t.next,e)<0}function pp(t,e){let n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}function dp(t,e){let n=new gp(t.i,t.x,t.y),i=new gp(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function fp(t,e,n,i){const r=new gp(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function mp(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function gp(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function vp(t,e,n,i){let r=0;for(let o=e,s=n-i;o<n;o+=i)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}const yp={area:function(t){const e=t.length;let n=0;for(let i=e-1,r=0;r<e;i=r++)n+=t[i].x*t[r].y-t[r].x*t[i].y;return.5*n},isClockWise:function(t){return yp.area(t)<0},triangulateShape:function(t,e){const n=[],i=[],r=[];xp(t),_p(n,t);let o=t.length;e.forEach(xp);for(let a=0;a<e.length;a++)i.push(o),o+=e[a].length,_p(n,e[a]);const s=zu.triangulate(n,i);for(let a=0;a<s.length;a+=3)r.push(s.slice(a,a+3));return r}};function xp(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function _p(t,e){for(let n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}function bp(t,e){ho.call(this),this.type="ExtrudeGeometry",this.parameters={shapes:t,options:e},this.fromBufferGeometry(new wp(t,e)),this.mergeVertices()}function wp(t,e){Gr.call(this),this.type="ExtrudeBufferGeometry",this.parameters={shapes:t,options:e},t=Array.isArray(t)?t:[t];const n=this,i=[],r=[];for(let s=0,a=t.length;s<a;s++){o(t[s])}function o(t){const o=[],s=void 0!==e.curveSegments?e.curveSegments:12,a=void 0!==e.steps?e.steps:1;let c=void 0!==e.depth?e.depth:100,l=void 0===e.bevelEnabled||e.bevelEnabled,h=void 0!==e.bevelThickness?e.bevelThickness:6,u=void 0!==e.bevelSize?e.bevelSize:h-2,p=void 0!==e.bevelOffset?e.bevelOffset:0,d=void 0!==e.bevelSegments?e.bevelSegments:3;const f=e.extrudePath,m=void 0!==e.UVGenerator?e.UVGenerator:Mp;void 0!==e.amount&&(console.warn("THREE.ExtrudeBufferGeometry: amount has been renamed to depth."),c=e.amount);let g,v,y,x,_,b=!1;f&&(g=f.getSpacedPoints(a),b=!0,l=!1,v=f.computeFrenetFrames(a,!1),y=new Xn,x=new Xn,_=new Xn),l||(d=0,h=0,u=0,p=0);const w=t.extractPoints(s);let M=w.shape;const S=w.holes;if(!yp.isClockWise(M)){M=M.reverse();for(let t=0,e=S.length;t<e;t++){const e=S[t];yp.isClockWise(e)&&(S[t]=e.reverse())}}const T=yp.triangulateShape(M,S),E=M;for(let e=0,n=S.length;e<n;e++){const t=S[e];M=M.concat(t)}function A(t,e,n){return e||console.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(n).add(t)}const L=M.length,R=T.length;function C(t,e,n){let i,r,o;const s=t.x-e.x,a=t.y-e.y,c=n.x-t.x,l=n.y-t.y,h=s*s+a*a,u=s*l-a*c;if(Math.abs(u)>Number.EPSILON){const u=Math.sqrt(h),p=Math.sqrt(c*c+l*l),d=e.x-a/u,f=e.y+s/u,m=((n.x-l/p-d)*l-(n.y+c/p-f)*c)/(s*l-a*c),g=(i=d+s*m-t.x)*i+(r=f+a*m-t.y)*r;if(g<=2)return new Nn(i,r);o=Math.sqrt(g/2)}else{let t=!1;s>Number.EPSILON?c>Number.EPSILON&&(t=!0):s<-Number.EPSILON?c<-Number.EPSILON&&(t=!0):Math.sign(a)===Math.sign(l)&&(t=!0),t?(i=-a,r=s,o=Math.sqrt(h)):(i=s,r=a,o=Math.sqrt(h/2))}return new Nn(i/o,r/o)}const P=[];for(let e=0,n=E.length,i=n-1,r=e+1;e<n;e++,i++,r++)i===n&&(i=0),r===n&&(r=0),P[e]=C(E[e],E[i],E[r]);const O=[];let D,I=P.concat();for(let e=0,n=S.length;e<n;e++){const t=S[e];D=[];for(let e=0,n=t.length,i=n-1,r=e+1;e<n;e++,i++,r++)i===n&&(i=0),r===n&&(r=0),D[e]=C(t[e],t[i],t[r]);O.push(D),I=I.concat(D)}for(let e=0;e<d;e++){const t=e/d,n=h*Math.cos(t*Math.PI/2),i=u*Math.sin(t*Math.PI/2)+p;for(let e=0,r=E.length;e<r;e++){const t=A(E[e],P[e],i);F(t.x,t.y,-n)}for(let e=0,r=S.length;e<r;e++){const t=S[e];D=O[e];for(let e=0,r=t.length;e<r;e++){const r=A(t[e],D[e],i);F(r.x,r.y,-n)}}}const N=u+p;for(let e=0;e<L;e++){const t=l?A(M[e],I[e],N):M[e];b?(x.copy(v.normals[0]).multiplyScalar(t.x),y.copy(v.binormals[0]).multiplyScalar(t.y),_.copy(g[0]).add(x).add(y),F(_.x,_.y,_.z)):F(t.x,t.y,0)}for(let e=1;e<=a;e++)for(let t=0;t<L;t++){const n=l?A(M[t],I[t],N):M[t];b?(x.copy(v.normals[e]).multiplyScalar(n.x),y.copy(v.binormals[e]).multiplyScalar(n.y),_.copy(g[e]).add(x).add(y),F(_.x,_.y,_.z)):F(n.x,n.y,c/a*e)}for(let e=d-1;e>=0;e--){const t=e/d,n=h*Math.cos(t*Math.PI/2),i=u*Math.sin(t*Math.PI/2)+p;for(let e=0,r=E.length;e<r;e++){const t=A(E[e],P[e],i);F(t.x,t.y,c+n)}for(let e=0,r=S.length;e<r;e++){const t=S[e];D=O[e];for(let e=0,r=t.length;e<r;e++){const r=A(t[e],D[e],i);b?F(r.x,r.y+g[a-1].y,g[a-1].x+n):F(r.x,r.y,c+n)}}}function B(t,e){let n=t.length;for(;--n>=0;){const i=n;let r=n-1;r<0&&(r=t.length-1);for(let t=0,n=a+2*d;t<n;t++){const n=L*t,o=L*(t+1);G(e+i+n,e+r+n,e+r+o,e+i+o)}}}function F(t,e,n){o.push(t),o.push(e),o.push(n)}function U(t,e,r){z(t),z(e),z(r);const o=i.length/3,s=m.generateTopUV(n,i,o-3,o-2,o-1);H(s[0]),H(s[1]),H(s[2])}function G(t,e,r,o){z(t),z(e),z(o),z(e),z(r),z(o);const s=i.length/3,a=m.generateSideWallUV(n,i,s-6,s-3,s-2,s-1);H(a[0]),H(a[1]),H(a[3]),H(a[1]),H(a[2]),H(a[3])}function z(t){i.push(o[3*t+0]),i.push(o[3*t+1]),i.push(o[3*t+2])}function H(t){r.push(t.x),r.push(t.y)}!function(){const t=i.length/3;if(l){let t=0,e=L*t;for(let n=0;n<R;n++){const t=T[n];U(t[2]+e,t[1]+e,t[0]+e)}e=L*(t=a+2*d);for(let n=0;n<R;n++){const t=T[n];U(t[0]+e,t[1]+e,t[2]+e)}}else{for(let t=0;t<R;t++){const e=T[t];U(e[2],e[1],e[0])}for(let t=0;t<R;t++){const e=T[t];U(e[0]+L*a,e[1]+L*a,e[2]+L*a)}}n.addGroup(t,i.length/3-t,0)}(),function(){const t=i.length/3;let e=0;B(E,e),e+=E.length;for(let n=0,i=S.length;n<i;n++){const t=S[n];B(t,e),e+=t.length}n.addGroup(t,i.length/3-t,1)}()}this.setAttribute("position",new Lr(i,3)),this.setAttribute("uv",new Lr(r,2)),this.computeVertexNormals()}exports.ShapeUtils=yp,bp.prototype=Object.create(ho.prototype),bp.prototype.constructor=bp,bp.prototype.toJSON=function(){const t=ho.prototype.toJSON.call(this);return Sp(this.parameters.shapes,this.parameters.options,t)},wp.prototype=Object.create(Gr.prototype),wp.prototype.constructor=wp,wp.prototype.toJSON=function(){const t=Gr.prototype.toJSON.call(this);return Sp(this.parameters.shapes,this.parameters.options,t)};const Mp={generateTopUV:function(t,e,n,i,r){const o=e[3*n],s=e[3*n+1],a=e[3*i],c=e[3*i+1],l=e[3*r],h=e[3*r+1];return[new Nn(o,s),new Nn(a,c),new Nn(l,h)]},generateSideWallUV:function(t,e,n,i,r,o){const s=e[3*n],a=e[3*n+1],c=e[3*n+2],l=e[3*i],h=e[3*i+1],u=e[3*i+2],p=e[3*r],d=e[3*r+1],f=e[3*r+2],m=e[3*o],g=e[3*o+1],v=e[3*o+2];return Math.abs(a-h)<.01?[new Nn(s,1-c),new Nn(l,1-u),new Nn(p,1-f),new Nn(m,1-v)]:[new Nn(a,1-c),new Nn(h,1-u),new Nn(d,1-f),new Nn(g,1-v)]}};function Sp(t,e,n){if(n.shapes=[],Array.isArray(t))for(let i=0,r=t.length;i<r;i++){const e=t[i];n.shapes.push(e.uuid)}else n.shapes.push(t.uuid);return void 0!==e.extrudePath&&(n.options.extrudePath=e.extrudePath.toJSON()),n}function Tp(t,e){ho.call(this),this.type="TextGeometry",this.parameters={text:t,parameters:e},this.fromBufferGeometry(new Ep(t,e)),this.mergeVertices()}function Ep(t,e){const n=(e=e||{}).font;if(!n||!n.isFont)return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),new ho;const i=n.generateShapes(t,e.size);e.depth=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),wp.call(this,i,e),this.type="TextBufferGeometry"}function Ap(t,e,n,i,r,o,s){ho.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:o,thetaLength:s},this.fromBufferGeometry(new Lp(t,e,n,i,r,o,s)),this.mergeVertices()}function Lp(t,e,n,i,r,o,s){Gr.call(this),this.type="SphereBufferGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:n,phiStart:i,phiLength:r,thetaStart:o,thetaLength:s},t=t||1,e=Math.max(3,Math.floor(e)||8),n=Math.max(2,Math.floor(n)||6),i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI,o=void 0!==o?o:0,s=void 0!==s?s:Math.PI;const a=Math.min(o+s,Math.PI);let c=0;const l=[],h=new Xn,u=new Xn,p=[],d=[],f=[],m=[];for(let g=0;g<=n;g++){const p=[],v=g/n;let y=0;0==g&&0==o?y=.5/e:g==n&&a==Math.PI&&(y=-.5/e);for(let n=0;n<=e;n++){const a=n/e;h.x=-t*Math.cos(i+a*r)*Math.sin(o+v*s),h.y=t*Math.cos(o+v*s),h.z=t*Math.sin(i+a*r)*Math.sin(o+v*s),d.push(h.x,h.y,h.z),u.copy(h).normalize(),f.push(u.x,u.y,u.z),m.push(a+y,1-v),p.push(c++)}l.push(p)}for(let g=0;g<n;g++)for(let t=0;t<e;t++){const e=l[g][t+1],i=l[g][t],r=l[g+1][t],s=l[g+1][t+1];(0!==g||o>0)&&p.push(e,i,s),(g!==n-1||a<Math.PI)&&p.push(i,r,s)}this.setIndex(p),this.setAttribute("position",new Lr(d,3)),this.setAttribute("normal",new Lr(f,3)),this.setAttribute("uv",new Lr(m,2))}function Rp(t,e,n,i,r,o){ho.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:o},this.fromBufferGeometry(new Cp(t,e,n,i,r,o)),this.mergeVertices()}function Cp(t,e,n,i,r,o){Gr.call(this),this.type="RingBufferGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:n,phiSegments:i,thetaStart:r,thetaLength:o},t=t||.5,e=e||1,r=void 0!==r?r:0,o=void 0!==o?o:2*Math.PI,n=void 0!==n?Math.max(3,n):8;const s=[],a=[],c=[],l=[];let h=t;const u=(e-t)/(i=void 0!==i?Math.max(1,i):1),p=new Xn,d=new Nn;for(let f=0;f<=i;f++){for(let t=0;t<=n;t++){const i=r+t/n*o;p.x=h*Math.cos(i),p.y=h*Math.sin(i),a.push(p.x,p.y,p.z),c.push(0,0,1),d.x=(p.x/e+1)/2,d.y=(p.y/e+1)/2,l.push(d.x,d.y)}h+=u}for(let f=0;f<i;f++){const t=f*(n+1);for(let e=0;e<n;e++){const i=e+t,r=i,o=i+n+1,a=i+n+2,c=i+1;s.push(r,o,c),s.push(o,a,c)}}this.setIndex(s),this.setAttribute("position",new Lr(a,3)),this.setAttribute("normal",new Lr(c,3)),this.setAttribute("uv",new Lr(l,2))}function Pp(t,e,n,i){ho.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},this.fromBufferGeometry(new Op(t,e,n,i)),this.mergeVertices()}function Op(t,e,n,i){Gr.call(this),this.type="LatheBufferGeometry",this.parameters={points:t,segments:e,phiStart:n,phiLength:i},e=Math.floor(e)||12,n=n||0,i=i||2*Math.PI,i=In.clamp(i,0,2*Math.PI);const r=[],o=[],s=[],a=1/e,c=new Xn,l=new Nn;for(let h=0;h<=e;h++){const r=n+h*a*i,u=Math.sin(r),p=Math.cos(r);for(let n=0;n<=t.length-1;n++)c.x=t[n].x*u,c.y=t[n].y,c.z=t[n].x*p,o.push(c.x,c.y,c.z),l.x=h/e,l.y=n/(t.length-1),s.push(l.x,l.y)}for(let h=0;h<e;h++)for(let e=0;e<t.length-1;e++){const n=e+h*t.length,i=n,o=n+t.length,s=n+t.length+1,a=n+1;r.push(i,o,a),r.push(o,s,a)}if(this.setIndex(r),this.setAttribute("position",new Lr(o,3)),this.setAttribute("uv",new Lr(s,2)),this.computeVertexNormals(),i===2*Math.PI){const n=this.attributes.normal.array,i=new Xn,r=new Xn,o=new Xn,s=e*t.length*3;for(let e=0,a=0;e<t.length;e++,a+=3)i.x=n[a+0],i.y=n[a+1],i.z=n[a+2],r.x=n[s+a+0],r.y=n[s+a+1],r.z=n[s+a+2],o.addVectors(i,r).normalize(),n[a+0]=n[s+a+0]=o.x,n[a+1]=n[s+a+1]=o.y,n[a+2]=n[s+a+2]=o.z}}function Dp(t,e){ho.call(this),this.type="ShapeGeometry","object"==typeof e&&(console.warn("THREE.ShapeGeometry: Options parameter has been removed."),e=e.curveSegments),this.parameters={shapes:t,curveSegments:e},this.fromBufferGeometry(new Ip(t,e)),this.mergeVertices()}function Ip(t,e){Gr.call(this),this.type="ShapeBufferGeometry",this.parameters={shapes:t,curveSegments:e},e=e||12;const n=[],i=[],r=[],o=[];let s=0,a=0;if(!1===Array.isArray(t))c(t);else for(let l=0;l<t.length;l++)c(t[l]),this.addGroup(s,a,l),s+=a,a=0;function c(t){const s=i.length/3,c=t.extractPoints(e);let l=c.shape;const h=c.holes;!1===yp.isClockWise(l)&&(l=l.reverse());for(let e=0,n=h.length;e<n;e++){const t=h[e];!0===yp.isClockWise(t)&&(h[e]=t.reverse())}const u=yp.triangulateShape(l,h);for(let e=0,n=h.length;e<n;e++){const t=h[e];l=l.concat(t)}for(let e=0,n=l.length;e<n;e++){const t=l[e];i.push(t.x,t.y,0),r.push(0,0,1),o.push(t.x,t.y)}for(let e=0,i=u.length;e<i;e++){const t=u[e],i=t[0]+s,r=t[1]+s,o=t[2]+s;n.push(i,r,o),a+=3}}this.setIndex(n),this.setAttribute("position",new Lr(i,3)),this.setAttribute("normal",new Lr(r,3)),this.setAttribute("uv",new Lr(o,2))}function Np(t,e){if(e.shapes=[],Array.isArray(t))for(let n=0,i=t.length;n<i;n++){const i=t[n];e.shapes.push(i.uuid)}else e.shapes.push(t.uuid);return e}function Bp(t,e){Gr.call(this),this.type="EdgesGeometry",this.parameters={thresholdAngle:e},e=void 0!==e?e:1;const n=[],i=Math.cos(In.DEG2RAD*e),r=[0,0],o={};let s,a,c;const l=["a","b","c"];let h;t.isBufferGeometry?(h=new ho).fromBufferGeometry(t):h=t.clone(),h.mergeVertices(),h.computeFaceNormals();const u=h.vertices,p=h.faces;for(let d=0,f=p.length;d<f;d++){const t=p[d];for(let e=0;e<3;e++)s=t[l[e]],a=t[l[(e+1)%3]],r[0]=Math.min(s,a),r[1]=Math.max(s,a),void 0===o[c=r[0]+","+r[1]]?o[c]={index1:r[0],index2:r[1],face1:d,face2:void 0}:o[c].face2=d}for(c in o){const t=o[c];if(void 0===t.face2||p[t.face1].normal.dot(p[t.face2].normal)<=i){let e=u[t.index1];n.push(e.x,e.y,e.z),e=u[t.index2],n.push(e.x,e.y,e.z)}}this.setAttribute("position",new Lr(n,3))}function Fp(t,e,n,i,r,o,s,a){ho.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:o,thetaStart:s,thetaLength:a},this.fromBufferGeometry(new Up(t,e,n,i,r,o,s,a)),this.mergeVertices()}function Up(t,e,n,i,r,o,s,a){Gr.call(this),this.type="CylinderBufferGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:n,radialSegments:i,heightSegments:r,openEnded:o,thetaStart:s,thetaLength:a};const c=this;t=void 0!==t?t:1,e=void 0!==e?e:1,n=n||1,i=Math.floor(i)||8,r=Math.floor(r)||1,o=void 0!==o&&o,s=void 0!==s?s:0,a=void 0!==a?a:2*Math.PI;const l=[],h=[],u=[],p=[];let d=0;const f=[],m=n/2;let g=0;function v(n){let r,o;const f=new Nn,v=new Xn;let y=0;const x=!0===n?t:e,_=!0===n?1:-1;r=d;for(let t=1;t<=i;t++)h.push(0,m*_,0),u.push(0,_,0),p.push(.5,.5),d++;o=d;for(let t=0;t<=i;t++){const e=t/i*a+s,n=Math.cos(e),r=Math.sin(e);v.x=x*r,v.y=m*_,v.z=x*n,h.push(v.x,v.y,v.z),u.push(0,_,0),f.x=.5*n+.5,f.y=.5*r*_+.5,p.push(f.x,f.y),d++}for(let t=0;t<i;t++){const e=r+t,i=o+t;!0===n?l.push(i,i+1,e):l.push(i+1,i,e),y+=3}c.addGroup(g,y,!0===n?1:2),g+=y}!function(){const o=new Xn,v=new Xn;let y=0;const x=(e-t)/n;for(let c=0;c<=r;c++){const l=[],g=c/r,y=g*(e-t)+t;for(let t=0;t<=i;t++){const e=t/i,r=e*a+s,c=Math.sin(r),f=Math.cos(r);v.x=y*c,v.y=-g*n+m,v.z=y*f,h.push(v.x,v.y,v.z),o.set(c,x,f).normalize(),u.push(o.x,o.y,o.z),p.push(e,1-g),l.push(d++)}f.push(l)}for(let t=0;t<i;t++)for(let e=0;e<r;e++){const n=f[e][t],i=f[e+1][t],r=f[e+1][t+1],o=f[e][t+1];l.push(n,i,o),l.push(i,r,o),y+=6}c.addGroup(g,y,0),g+=y}(),!1===o&&(t>0&&v(!0),e>0&&v(!1)),this.setIndex(l),this.setAttribute("position",new Lr(h,3)),this.setAttribute("normal",new Lr(u,3)),this.setAttribute("uv",new Lr(p,2))}function Gp(t,e,n,i,r,o,s){Fp.call(this,0,t,e,n,i,r,o,s),this.type="ConeGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:o,thetaLength:s}}function zp(t,e,n,i,r,o,s){Up.call(this,0,t,e,n,i,r,o,s),this.type="ConeBufferGeometry",this.parameters={radius:t,height:e,radialSegments:n,heightSegments:i,openEnded:r,thetaStart:o,thetaLength:s}}function Hp(t,e,n,i){ho.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},this.fromBufferGeometry(new kp(t,e,n,i)),this.mergeVertices()}function kp(t,e,n,i){Gr.call(this),this.type="CircleBufferGeometry",this.parameters={radius:t,segments:e,thetaStart:n,thetaLength:i},t=t||1,e=void 0!==e?Math.max(3,e):8,n=void 0!==n?n:0,i=void 0!==i?i:2*Math.PI;const r=[],o=[],s=[],a=[],c=new Xn,l=new Nn;o.push(0,0,0),s.push(0,0,1),a.push(.5,.5);for(let h=0,u=3;h<=e;h++,u+=3){const r=n+h/e*i;c.x=t*Math.cos(r),c.y=t*Math.sin(r),o.push(c.x,c.y,c.z),s.push(0,0,1),l.x=(o[u]/t+1)/2,l.y=(o[u+1]/t+1)/2,a.push(l.x,l.y)}for(let h=1;h<=e;h++)r.push(h,h+1,0);this.setIndex(r),this.setAttribute("position",new Lr(o,3)),this.setAttribute("normal",new Lr(s,3)),this.setAttribute("uv",new Lr(a,2))}Tp.prototype=Object.create(ho.prototype),Tp.prototype.constructor=Tp,Ep.prototype=Object.create(wp.prototype),Ep.prototype.constructor=Ep,Ap.prototype=Object.create(ho.prototype),Ap.prototype.constructor=Ap,Lp.prototype=Object.create(Gr.prototype),Lp.prototype.constructor=Lp,Rp.prototype=Object.create(ho.prototype),Rp.prototype.constructor=Rp,Cp.prototype=Object.create(Gr.prototype),Cp.prototype.constructor=Cp,Pp.prototype=Object.create(ho.prototype),Pp.prototype.constructor=Pp,Op.prototype=Object.create(Gr.prototype),Op.prototype.constructor=Op,Dp.prototype=Object.create(ho.prototype),Dp.prototype.constructor=Dp,Dp.prototype.toJSON=function(){const t=ho.prototype.toJSON.call(this);return Np(this.parameters.shapes,t)},Ip.prototype=Object.create(Gr.prototype),Ip.prototype.constructor=Ip,Ip.prototype.toJSON=function(){const t=Gr.prototype.toJSON.call(this);return Np(this.parameters.shapes,t)},Bp.prototype=Object.create(Gr.prototype),Bp.prototype.constructor=Bp,Fp.prototype=Object.create(ho.prototype),Fp.prototype.constructor=Fp,Up.prototype=Object.create(Gr.prototype),Up.prototype.constructor=Up,Gp.prototype=Object.create(Fp.prototype),Gp.prototype.constructor=Gp,zp.prototype=Object.create(Up.prototype),zp.prototype.constructor=zp,Hp.prototype=Object.create(ho.prototype),Hp.prototype.constructor=Hp,kp.prototype=Object.create(Gr.prototype),kp.prototype.constructor=kp;var Vp=Object.freeze({__proto__:null,WireframeGeometry:bu,ParametricGeometry:wu,ParametricBufferGeometry:Mu,TetrahedronGeometry:Eu,TetrahedronBufferGeometry:Au,OctahedronGeometry:Lu,OctahedronBufferGeometry:Ru,IcosahedronGeometry:Cu,IcosahedronBufferGeometry:Pu,DodecahedronGeometry:Ou,DodecahedronBufferGeometry:Du,PolyhedronGeometry:Su,PolyhedronBufferGeometry:Tu,TubeGeometry:Iu,TubeBufferGeometry:Nu,TorusKnotGeometry:Bu,TorusKnotBufferGeometry:Fu,TorusGeometry:Uu,TorusBufferGeometry:Gu,TextGeometry:Tp,TextBufferGeometry:Ep,SphereGeometry:Ap,SphereBufferGeometry:Lp,RingGeometry:Rp,RingBufferGeometry:Cp,PlaneGeometry:Do,PlaneBufferGeometry:Io,LatheGeometry:Pp,LatheBufferGeometry:Op,ShapeGeometry:Dp,ShapeBufferGeometry:Ip,ExtrudeGeometry:bp,ExtrudeBufferGeometry:wp,EdgesGeometry:Bp,ConeGeometry:Gp,ConeBufferGeometry:zp,CylinderGeometry:Fp,CylinderBufferGeometry:Up,CircleGeometry:Hp,CircleBufferGeometry:kp,BoxGeometry:uo,BoxBufferGeometry:po});function jp(t){gr.call(this),this.type="ShadowMaterial",this.color=new hr(0),this.transparent=!0,this.setValues(t)}function Wp(t){xo.call(this,t),this.type="RawShaderMaterial"}function qp(t){gr.call(this),this.defines={STANDARD:""},this.type="MeshStandardMaterial",this.color=new hr(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new hr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=rn,this.normalScale=new Nn(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.vertexTangents=!1,this.setValues(t)}function Xp(t){qp.call(this),this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.clearcoat=0,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new Nn(1,1),this.clearcoatNormalMap=null,this.reflectivity=.5,this.sheen=null,this.transmission=0,this.transmissionMap=null,this.setValues(t)}function Yp(t){gr.call(this),this.type="MeshPhongMaterial",this.color=new hr(16777215),this.specular=new hr(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new hr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=rn,this.normalScale=new Nn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=q,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Zp(t){gr.call(this),this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new hr(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new hr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=rn,this.normalScale=new Nn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Jp(t){gr.call(this),this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=rn,this.normalScale=new Nn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Qp(t){gr.call(this),this.type="MeshLambertMaterial",this.color=new hr(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new hr(0),this.emissiveIntensity=1,this.emissiveMap=null,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=q,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function Kp(t){gr.call(this),this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new hr(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=rn,this.normalScale=new Nn(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.skinning=!1,this.morphTargets=!1,this.morphNormals=!1,this.setValues(t)}function $p(t){$h.call(this),this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(t)}jp.prototype=Object.create(gr.prototype),jp.prototype.constructor=jp,jp.prototype.isShadowMaterial=!0,jp.prototype.copy=function(t){return gr.prototype.copy.call(this,t),this.color.copy(t.color),this},Wp.prototype=Object.create(xo.prototype),Wp.prototype.constructor=Wp,Wp.prototype.isRawShaderMaterial=!0,qp.prototype=Object.create(gr.prototype),qp.prototype.constructor=qp,qp.prototype.isMeshStandardMaterial=!0,qp.prototype.copy=function(t){return gr.prototype.copy.call(this,t),this.defines={STANDARD:""},this.color.copy(t.color),this.roughness=t.roughness,this.metalness=t.metalness,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.roughnessMap=t.roughnessMap,this.metalnessMap=t.metalnessMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.envMapIntensity=t.envMapIntensity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this.vertexTangents=t.vertexTangents,this},Xp.prototype=Object.create(qp.prototype),Xp.prototype.constructor=Xp,Xp.prototype.isMeshPhysicalMaterial=!0,Xp.prototype.copy=function(t){return qp.prototype.copy.call(this,t),this.defines={STANDARD:"",PHYSICAL:""},this.clearcoat=t.clearcoat,this.clearcoatMap=t.clearcoatMap,this.clearcoatRoughness=t.clearcoatRoughness,this.clearcoatRoughnessMap=t.clearcoatRoughnessMap,this.clearcoatNormalMap=t.clearcoatNormalMap,this.clearcoatNormalScale.copy(t.clearcoatNormalScale),this.reflectivity=t.reflectivity,t.sheen?this.sheen=(this.sheen||new hr).copy(t.sheen):this.sheen=null,this.transmission=t.transmission,this.transmissionMap=t.transmissionMap,this},Yp.prototype=Object.create(gr.prototype),Yp.prototype.constructor=Yp,Yp.prototype.isMeshPhongMaterial=!0,Yp.prototype.copy=function(t){return gr.prototype.copy.call(this,t),this.color.copy(t.color),this.specular.copy(t.specular),this.shininess=t.shininess,this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Zp.prototype=Object.create(gr.prototype),Zp.prototype.constructor=Zp,Zp.prototype.isMeshToonMaterial=!0,Zp.prototype.copy=function(t){return gr.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.gradientMap=t.gradientMap,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Jp.prototype=Object.create(gr.prototype),Jp.prototype.constructor=Jp,Jp.prototype.isMeshNormalMaterial=!0,Jp.prototype.copy=function(t){return gr.prototype.copy.call(this,t),this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Qp.prototype=Object.create(gr.prototype),Qp.prototype.constructor=Qp,Qp.prototype.isMeshLambertMaterial=!0,Qp.prototype.copy=function(t){return gr.prototype.copy.call(this,t),this.color.copy(t.color),this.map=t.map,this.lightMap=t.lightMap,this.lightMapIntensity=t.lightMapIntensity,this.aoMap=t.aoMap,this.aoMapIntensity=t.aoMapIntensity,this.emissive.copy(t.emissive),this.emissiveMap=t.emissiveMap,this.emissiveIntensity=t.emissiveIntensity,this.specularMap=t.specularMap,this.alphaMap=t.alphaMap,this.envMap=t.envMap,this.combine=t.combine,this.reflectivity=t.reflectivity,this.refractionRatio=t.refractionRatio,this.wireframe=t.wireframe,this.wireframeLinewidth=t.wireframeLinewidth,this.wireframeLinecap=t.wireframeLinecap,this.wireframeLinejoin=t.wireframeLinejoin,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},Kp.prototype=Object.create(gr.prototype),Kp.prototype.constructor=Kp,Kp.prototype.isMeshMatcapMaterial=!0,Kp.prototype.copy=function(t){return gr.prototype.copy.call(this,t),this.defines={MATCAP:""},this.color.copy(t.color),this.matcap=t.matcap,this.map=t.map,this.bumpMap=t.bumpMap,this.bumpScale=t.bumpScale,this.normalMap=t.normalMap,this.normalMapType=t.normalMapType,this.normalScale.copy(t.normalScale),this.displacementMap=t.displacementMap,this.displacementScale=t.displacementScale,this.displacementBias=t.displacementBias,this.alphaMap=t.alphaMap,this.skinning=t.skinning,this.morphTargets=t.morphTargets,this.morphNormals=t.morphNormals,this},$p.prototype=Object.create($h.prototype),$p.prototype.constructor=$p,$p.prototype.isLineDashedMaterial=!0,$p.prototype.copy=function(t){return $h.prototype.copy.call(this,t),this.scale=t.scale,this.dashSize=t.dashSize,this.gapSize=t.gapSize,this};var td=Object.freeze({__proto__:null,ShadowMaterial:jp,SpriteMaterial:Sh,RawShaderMaterial:Wp,ShaderMaterial:xo,PointsMaterial:hu,MeshPhysicalMaterial:Xp,MeshStandardMaterial:qp,MeshPhongMaterial:Yp,MeshToonMaterial:Zp,MeshNormalMaterial:Jp,MeshLambertMaterial:Qp,MeshDepthMaterial:rh,MeshDistanceMaterial:oh,MeshBasicMaterial:vr,MeshMatcapMaterial:Kp,LineDashedMaterial:$p,LineBasicMaterial:$h,Material:gr});const ed={arraySlice:function(t,e,n){return ed.isTypedArray(t)?new t.constructor(t.subarray(e,void 0!==n?n:t.length)):t.slice(e,n)},convertArray:function(t,e,n){return!t||!n&&t.constructor===e?t:"number"==typeof e.BYTES_PER_ELEMENT?new e(t):Array.prototype.slice.call(t)},isTypedArray:function(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)},getKeyframeOrder:function(t){const e=t.length,n=new Array(e);for(let i=0;i!==e;++i)n[i]=i;return n.sort(function(e,n){return t[e]-t[n]}),n},sortedArray:function(t,e,n){const i=t.length,r=new t.constructor(i);for(let o=0,s=0;s!==i;++o){const i=n[o]*e;for(let n=0;n!==e;++n)r[s++]=t[i+n]}return r},flattenJSON:function(t,e,n,i){let r=1,o=t[0];for(;void 0!==o&&void 0===o[i];)o=t[r++];if(void 0===o)return;let s=o[i];if(void 0!==s)if(Array.isArray(s))do{void 0!==(s=o[i])&&(e.push(o.time),n.push.apply(n,s)),o=t[r++]}while(void 0!==o);else if(void 0!==s.toArray)do{void 0!==(s=o[i])&&(e.push(o.time),s.toArray(n,n.length)),o=t[r++]}while(void 0!==o);else do{void 0!==(s=o[i])&&(e.push(o.time),n.push(s)),o=t[r++]}while(void 0!==o)},subclip:function(t,e,n,i,r){r=r||30;const o=t.clone();o.name=e;const s=[];for(let c=0;c<o.tracks.length;++c){const t=o.tracks[c],e=t.getValueSize(),a=[],l=[];for(let o=0;o<t.times.length;++o){const s=t.times[o]*r;if(!(s<n||s>=i)){a.push(t.times[o]);for(let n=0;n<e;++n)l.push(t.values[o*e+n])}}0!==a.length&&(t.times=ed.convertArray(a,t.times.constructor),t.values=ed.convertArray(l,t.values.constructor),s.push(t))}o.tracks=s;let a=1/0;for(let c=0;c<o.tracks.length;++c)a>o.tracks[c].times[0]&&(a=o.tracks[c].times[0]);for(let c=0;c<o.tracks.length;++c)o.tracks[c].shift(-1*a);return o.resetDuration(),o},makeClipAdditive:function(t,e,n,i){void 0===e&&(e=0),void 0===n&&(n=t),(void 0===i||i<=0)&&(i=30);const r=t.tracks.length,o=e/i;for(let s=0;s<r;++s){const e=n.tracks[s],i=e.ValueTypeName;if("bool"===i||"string"===i)continue;const r=t.tracks.find(function(t){return t.name===e.name&&t.ValueTypeName===i});if(void 0===r)continue;const a=e.getValueSize(),c=e.times.length-1;let l;if(o<=e.times[0])l=ed.arraySlice(e.values,0,e.valueSize);else if(o>=e.times[c]){const t=c*a;l=ed.arraySlice(e.values,t)}else{const t=e.createInterpolant();t.evaluate(o),l=t.resultBuffer}if("quaternion"===i){new jn(l[0],l[1],l[2],l[3]).normalize().conjugate().toArray(l)}const h=r.times.length;for(let t=0;t<h;++t){const e=t*a;if("quaternion"===i)jn.multiplyQuaternionsFlat(r.values,e,l,0,r.values,e);else for(let t=0;t<a;++t)r.values[e+t]-=l[t]}}return t.blendMode=2501,t}};function nd(t,e,n,i){this.parameterPositions=t,this._cachedIndex=0,this.resultBuffer=void 0!==i?i:new e.constructor(n),this.sampleValues=e,this.valueSize=n}function id(t,e,n,i){nd.call(this,t,e,n,i),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0}function rd(t,e,n,i){nd.call(this,t,e,n,i)}function od(t,e,n,i){nd.call(this,t,e,n,i)}function sd(t,e,n,i){if(void 0===t)throw new Error("THREE.KeyframeTrack: track name is undefined");if(void 0===e||0===e.length)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+t);this.name=t,this.times=ed.convertArray(e,this.TimeBufferType),this.values=ed.convertArray(n,this.ValueBufferType),this.setInterpolation(i||this.DefaultInterpolation)}function ad(t,e,n){sd.call(this,t,e,n)}function cd(t,e,n,i){sd.call(this,t,e,n,i)}function ld(t,e,n,i){sd.call(this,t,e,n,i)}function hd(t,e,n,i){nd.call(this,t,e,n,i)}function ud(t,e,n,i){sd.call(this,t,e,n,i)}function pd(t,e,n,i){sd.call(this,t,e,n,i)}function dd(t,e,n,i){sd.call(this,t,e,n,i)}function fd(t,e,n,i){this.name=t,this.tracks=n,this.duration=void 0!==e?e:-1,this.blendMode=void 0!==i?i:ke,this.uuid=In.generateUUID(),this.duration<0&&this.resetDuration()}function md(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return ld;case"vector":case"vector2":case"vector3":case"vector4":return dd;case"color":return cd;case"quaternion":return ud;case"bool":case"boolean":return ad;case"string":return pd}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}function gd(t){if(void 0===t.type)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=md(t.type);if(void 0===t.times){const e=[],n=[];ed.flattenJSON(t.keys,e,n,"value"),t.times=e,t.values=n}return void 0!==e.parse?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}exports.AnimationUtils=ed,Object.assign(nd.prototype,{evaluate:function(t){let e=this.parameterPositions,n=this._cachedIndex,i=e[n],r=e[n-1];t:{e:{let o;n:{i:if(!(t<i)){for(let o=n+2;;){if(void 0===i){if(t<r)break i;return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,t,r)}if(n===o)break;if(r=i,t<(i=e[++n]))break e}o=e.length;break n}if(t>=r)break t;{const s=e[1];t<s&&(n=2,r=s);for(let o=n-2;;){if(void 0===r)return this._cachedIndex=0,this.beforeStart_(0,t,i);if(n===o)break;if(i=r,t>=(r=e[--n-1]))break e}o=n,n=0}}for(;n<o;){const i=n+o>>>1;t<e[i]?o=i:n=i+1}if(i=e[n],void 0===(r=e[n-1]))return this._cachedIndex=0,this.beforeStart_(0,t,i);if(void 0===i)return n=e.length,this._cachedIndex=n,this.afterEnd_(n-1,r,t)}this._cachedIndex=n,this.intervalChanged_(n,r,i)}return this.interpolate_(n,r,t,i)},settings:null,DefaultSettings_:{},getSettings_:function(){return this.settings||this.DefaultSettings_},copySampleValue_:function(t){const e=this.resultBuffer,n=this.sampleValues,i=this.valueSize,r=t*i;for(let o=0;o!==i;++o)e[o]=n[r+o];return e},interpolate_:function(){throw new Error("call to abstract method")},intervalChanged_:function(){}}),Object.assign(nd.prototype,{beforeStart_:nd.prototype.copySampleValue_,afterEnd_:nd.prototype.copySampleValue_}),id.prototype=Object.assign(Object.create(nd.prototype),{constructor:id,DefaultSettings_:{endingStart:Ge,endingEnd:Ge},intervalChanged_:function(t,e,n){let i=this.parameterPositions,r=t-2,o=t+1,s=i[r],a=i[o];if(void 0===s)switch(this.getSettings_().endingStart){case 2401:r=t,s=2*e-n;break;case 2402:s=e+i[r=i.length-2]-i[r+1];break;default:r=t,s=n}if(void 0===a)switch(this.getSettings_().endingEnd){case 2401:o=t,a=2*n-e;break;case 2402:o=1,a=n+i[1]-i[0];break;default:o=t-1,a=e}const c=.5*(n-e),l=this.valueSize;this._weightPrev=c/(e-s),this._weightNext=c/(a-n),this._offsetPrev=r*l,this._offsetNext=o*l},interpolate_:function(t,e,n,i){const r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,c=a-s,l=this._offsetPrev,h=this._offsetNext,u=this._weightPrev,p=this._weightNext,d=(n-e)/(i-e),f=d*d,m=f*d,g=-u*m+2*u*f-u*d,v=(1+u)*m+(-1.5-2*u)*f+(-.5+u)*d+1,y=(-1-p)*m+(1.5+p)*f+.5*d,x=p*m-p*f;for(let _=0;_!==s;++_)r[_]=g*o[l+_]+v*o[c+_]+y*o[a+_]+x*o[h+_];return r}}),rd.prototype=Object.assign(Object.create(nd.prototype),{constructor:rd,interpolate_:function(t,e,n,i){const r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=t*s,c=a-s,l=(n-e)/(i-e),h=1-l;for(let u=0;u!==s;++u)r[u]=o[c+u]*h+o[a+u]*l;return r}}),od.prototype=Object.assign(Object.create(nd.prototype),{constructor:od,interpolate_:function(t){return this.copySampleValue_(t-1)}}),Object.assign(sd,{toJSON:function(t){const e=t.constructor;let n;if(void 0!==e.toJSON)n=e.toJSON(t);else{n={name:t.name,times:ed.convertArray(t.times,Array),values:ed.convertArray(t.values,Array)};const e=t.getInterpolation();e!==t.DefaultInterpolation&&(n.interpolation=e)}return n.type=t.ValueTypeName,n}}),Object.assign(sd.prototype,{constructor:sd,TimeBufferType:Float32Array,ValueBufferType:Float32Array,DefaultInterpolation:2301,InterpolantFactoryMethodDiscrete:function(t){return new od(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodLinear:function(t){return new rd(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:function(t){return new id(this.times,this.values,this.getValueSize(),t)},setInterpolation:function(t){let e;switch(t){case 2300:e=this.InterpolantFactoryMethodDiscrete;break;case 2301:e=this.InterpolantFactoryMethodLinear;break;case 2302:e=this.InterpolantFactoryMethodSmooth}if(void 0===e){const e="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(void 0===this.createInterpolant){if(t===this.DefaultInterpolation)throw new Error(e);this.setInterpolation(this.DefaultInterpolation)}return console.warn("THREE.KeyframeTrack:",e),this}return this.createInterpolant=e,this},getInterpolation:function(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return 2300;case this.InterpolantFactoryMethodLinear:return 2301;case this.InterpolantFactoryMethodSmooth:return 2302}},getValueSize:function(){return this.values.length/this.times.length},shift:function(t){if(0!==t){const e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]+=t}return this},scale:function(t){if(1!==t){const e=this.times;for(let n=0,i=e.length;n!==i;++n)e[n]*=t}return this},trim:function(t,e){const n=this.times,i=n.length;let r=0,o=i-1;for(;r!==i&&n[r]<t;)++r;for(;-1!==o&&n[o]>e;)--o;if(++o,0!==r||o!==i){r>=o&&(r=(o=Math.max(o,1))-1);const t=this.getValueSize();this.times=ed.arraySlice(n,r,o),this.values=ed.arraySlice(this.values,r*t,o*t)}return this},validate:function(){let t=!0;const e=this.getValueSize();e-Math.floor(e)!=0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),t=!1);const n=this.times,i=this.values,r=n.length;0===r&&(console.error("THREE.KeyframeTrack: Track is empty.",this),t=!1);let o=null;for(let s=0;s!==r;s++){const e=n[s];if("number"==typeof e&&isNaN(e)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,s,e),t=!1;break}if(null!==o&&o>e){console.error("THREE.KeyframeTrack: Out of order keys.",this,s,e,o),t=!1;break}o=e}if(void 0!==i&&ed.isTypedArray(i))for(let s=0,a=i.length;s!==a;++s){const e=i[s];if(isNaN(e)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,s,e),t=!1;break}}return t},optimize:function(){const t=ed.arraySlice(this.times),e=ed.arraySlice(this.values),n=this.getValueSize(),i=2302===this.getInterpolation(),r=t.length-1;let o=1;for(let s=1;s<r;++s){let r=!1;const a=t[s];if(a!==t[s+1]&&(1!==s||a!==a[0]))if(i)r=!0;else{const t=s*n,i=t-n,o=t+n;for(let s=0;s!==n;++s){const n=e[t+s];if(n!==e[i+s]||n!==e[o+s]){r=!0;break}}}if(r){if(s!==o){t[o]=t[s];const i=s*n,r=o*n;for(let t=0;t!==n;++t)e[r+t]=e[i+t]}++o}}if(r>0){t[o]=t[r];for(let t=r*n,i=o*n,s=0;s!==n;++s)e[i+s]=e[t+s];++o}return o!==t.length?(this.times=ed.arraySlice(t,0,o),this.values=ed.arraySlice(e,0,o*n)):(this.times=t,this.values=e),this},clone:function(){const t=ed.arraySlice(this.times,0),e=ed.arraySlice(this.values,0),n=new(0,this.constructor)(this.name,t,e);return n.createInterpolant=this.createInterpolant,n}}),ad.prototype=Object.assign(Object.create(sd.prototype),{constructor:ad,ValueTypeName:"bool",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),cd.prototype=Object.assign(Object.create(sd.prototype),{constructor:cd,ValueTypeName:"color"}),ld.prototype=Object.assign(Object.create(sd.prototype),{constructor:ld,ValueTypeName:"number"}),hd.prototype=Object.assign(Object.create(nd.prototype),{constructor:hd,interpolate_:function(t,e,n,i){const r=this.resultBuffer,o=this.sampleValues,s=this.valueSize,a=(n-e)/(i-e);let c=t*s;for(let l=c+s;c!==l;c+=4)jn.slerpFlat(r,0,o,c-s,o,c,a);return r}}),ud.prototype=Object.assign(Object.create(sd.prototype),{constructor:ud,ValueTypeName:"quaternion",DefaultInterpolation:2301,InterpolantFactoryMethodLinear:function(t){return new hd(this.times,this.values,this.getValueSize(),t)},InterpolantFactoryMethodSmooth:void 0}),pd.prototype=Object.assign(Object.create(sd.prototype),{constructor:pd,ValueTypeName:"string",ValueBufferType:Array,DefaultInterpolation:2300,InterpolantFactoryMethodLinear:void 0,InterpolantFactoryMethodSmooth:void 0}),dd.prototype=Object.assign(Object.create(sd.prototype),{constructor:dd,ValueTypeName:"vector"}),Object.assign(fd,{parse:function(t){const e=[],n=t.tracks,i=1/(t.fps||1);for(let r=0,o=n.length;r!==o;++r)e.push(gd(n[r]).scale(i));return new fd(t.name,t.duration,e,t.blendMode)},toJSON:function(t){const e=[],n=t.tracks,i={name:t.name,duration:t.duration,tracks:e,uuid:t.uuid,blendMode:t.blendMode};for(let r=0,o=n.length;r!==o;++r)e.push(sd.toJSON(n[r]));return i},CreateFromMorphTargetSequence:function(t,e,n,i){const r=e.length,o=[];for(let s=0;s<r;s++){let t=[],a=[];t.push((s+r-1)%r,s,(s+1)%r),a.push(0,1,0);const c=ed.getKeyframeOrder(t);t=ed.sortedArray(t,1,c),a=ed.sortedArray(a,1,c),i||0!==t[0]||(t.push(r),a.push(a[0])),o.push(new ld(".morphTargetInfluences["+e[s].name+"]",t,a).scale(1/n))}return new fd(t,-1,o)},findByName:function(t,e){let n=t;if(!Array.isArray(t)){const e=t;n=e.geometry&&e.geometry.animations||e.animations}for(let i=0;i<n.length;i++)if(n[i].name===e)return n[i];return null},CreateClipsFromMorphTargetSequences:function(t,e,n){const i={},r=/^([\w-]*?)([\d]+)$/;for(let s=0,a=t.length;s<a;s++){const e=t[s],n=e.name.match(r);if(n&&n.length>1){const t=n[1];let r=i[t];r||(i[t]=r=[]),r.push(e)}}const o=[];for(const s in i)o.push(fd.CreateFromMorphTargetSequence(s,i[s],e,n));return o},parseAnimation:function(t,e){if(!t)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(t,e,n,i,r){if(0!==n.length){const o=[],s=[];ed.flattenJSON(n,o,s,i),0!==o.length&&r.push(new t(e,o,s))}},i=[],r=t.name||"default",o=t.fps||30,s=t.blendMode;let a=t.length||-1;const c=t.hierarchy||[];for(let l=0;l<c.length;l++){const t=c[l].keys;if(t&&0!==t.length)if(t[0].morphTargets){const e={};let n;for(n=0;n<t.length;n++)if(t[n].morphTargets)for(let i=0;i<t[n].morphTargets.length;i++)e[t[n].morphTargets[i]]=-1;for(const r in e){const e=[],o=[];for(let i=0;i!==t[n].morphTargets.length;++i){const i=t[n];e.push(i.time),o.push(i.morphTarget===r?1:0)}i.push(new ld(".morphTargetInfluence["+r+"]",e,o))}a=e.length*(o||1)}else{const r=".bones["+e[l].name+"]";n(dd,r+".position",t,"pos",i),n(ud,r+".quaternion",t,"rot",i),n(dd,r+".scale",t,"scl",i)}}return 0===i.length?null:new fd(r,a,i,s)}}),Object.assign(fd.prototype,{resetDuration:function(){let t=0;for(let e=0,n=this.tracks.length;e!==n;++e){const n=this.tracks[e];t=Math.max(t,n.times[n.times.length-1])}return this.duration=t,this},trim:function(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].trim(0,this.duration);return this},validate:function(){let t=!0;for(let e=0;e<this.tracks.length;e++)t=t&&this.tracks[e].validate();return t},optimize:function(){for(let t=0;t<this.tracks.length;t++)this.tracks[t].optimize();return this},clone:function(){const t=[];for(let e=0;e<this.tracks.length;e++)t.push(this.tracks[e].clone());return new fd(this.name,this.duration,t,this.blendMode)}});const vd={enabled:!1,files:{},add:function(t,e){!1!==this.enabled&&(this.files[t]=e)},get:function(t){if(!1!==this.enabled)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};function yd(t,e,n){const i=this;let r=!1,o=0,s=0,a=void 0;const c=[];this.onStart=void 0,this.onLoad=t,this.onProgress=e,this.onError=n,this.itemStart=function(t){s++,!1===r&&void 0!==i.onStart&&i.onStart(t,o,s),r=!0},this.itemEnd=function(t){o++,void 0!==i.onProgress&&i.onProgress(t,o,s),o===s&&(r=!1,void 0!==i.onLoad&&i.onLoad())},this.itemError=function(t){void 0!==i.onError&&i.onError(t)},this.resolveURL=function(t){return a?a(t):t},this.setURLModifier=function(t){return a=t,this},this.addHandler=function(t,e){return c.push(t,e),this},this.removeHandler=function(t){const e=c.indexOf(t);return-1!==e&&c.splice(e,2),this},this.getHandler=function(t){for(let e=0,n=c.length;e<n;e+=2){const n=c[e],i=c[e+1];if(n.global&&(n.lastIndex=0),n.test(t))return i}return null}}exports.Cache=vd;const xd=new yd;function _d(t){this.manager=void 0!==t?t:xd,this.crossOrigin="anonymous",this.path="",this.resourcePath="",this.requestHeader={}}exports.DefaultLoadingManager=xd,Object.assign(_d.prototype,{load:function(){},loadAsync:function(t,e){const n=this;return new Promise(function(i,r){n.load(t,i,e,r)})},parse:function(){},setCrossOrigin:function(t){return this.crossOrigin=t,this},setPath:function(t){return this.path=t,this},setResourcePath:function(t){return this.resourcePath=t,this},setRequestHeader:function(t){return this.requestHeader=t,this}});const bd={};function wd(t){_d.call(this,t)}function Md(t){_d.call(this,t)}function Sd(t){_d.call(this,t)}function Td(t){_d.call(this,t)}function Ed(t){_d.call(this,t)}function Ad(t){_d.call(this,t)}function Ld(t){_d.call(this,t)}function Rd(){this.type="Curve",this.arcLengthDivisions=200}function Cd(t,e,n,i,r,o,s,a){Rd.call(this),this.type="EllipseCurve",this.aX=t||0,this.aY=e||0,this.xRadius=n||1,this.yRadius=i||1,this.aStartAngle=r||0,this.aEndAngle=o||2*Math.PI,this.aClockwise=s||!1,this.aRotation=a||0}function Pd(t,e,n,i,r,o){Cd.call(this,t,e,n,n,i,r,o),this.type="ArcCurve"}function Od(){let t=0,e=0,n=0,i=0;function r(r,o,s,a){t=r,e=s,n=-3*r+3*o-2*s-a,i=2*r-2*o+s+a}return{initCatmullRom:function(t,e,n,i,o){r(e,n,o*(n-t),o*(i-e))},initNonuniformCatmullRom:function(t,e,n,i,o,s,a){let c=(e-t)/o-(n-t)/(o+s)+(n-e)/s,l=(n-e)/s-(i-e)/(s+a)+(i-n)/a;r(e,n,c*=s,l*=s)},calc:function(r){const o=r*r;return t+e*r+n*o+i*(o*r)}}}wd.prototype=Object.assign(Object.create(_d.prototype),{constructor:wd,load:function(t,e,n,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,o=vd.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout(function(){e&&e(o),r.manager.itemEnd(t)},0),o;if(void 0!==bd[t])return void bd[t].push({onLoad:e,onProgress:n,onError:i});const s=t.match(/^data:(.*?)(;base64)?,(.*)$/);let a;if(s){const n=s[1],o=!!s[2];let a=s[3];a=decodeURIComponent(a),o&&(a=atob(a));try{let o;const s=(this.responseType||"").toLowerCase();switch(s){case"arraybuffer":case"blob":const t=new Uint8Array(a.length);for(let n=0;n<a.length;n++)t[n]=a.charCodeAt(n);o="blob"===s?new Blob([t.buffer],{type:n}):t.buffer;break;case"document":const e=new DOMParser;o=e.parseFromString(a,n);break;case"json":o=JSON.parse(a);break;default:o=a}setTimeout(function(){e&&e(o),r.manager.itemEnd(t)},0)}catch(c){setTimeout(function(){i&&i(c),r.manager.itemError(t),r.manager.itemEnd(t)},0)}}else{bd[t]=[],bd[t].push({onLoad:e,onProgress:n,onError:i}),(a=new XMLHttpRequest).open("GET",t,!0),a.addEventListener("load",function(e){const n=this.response,i=bd[t];if(delete bd[t],200===this.status||0===this.status){0===this.status&&console.warn("THREE.FileLoader: HTTP Status 0 received."),vd.add(t,n);for(let t=0,e=i.length;t<e;t++){const e=i[t];e.onLoad&&e.onLoad(n)}r.manager.itemEnd(t)}else{for(let t=0,n=i.length;t<n;t++){const n=i[t];n.onError&&n.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)}},!1),a.addEventListener("progress",function(e){const n=bd[t];for(let t=0,i=n.length;t<i;t++){const i=n[t];i.onProgress&&i.onProgress(e)}},!1),a.addEventListener("error",function(e){const n=bd[t];delete bd[t];for(let t=0,i=n.length;t<i;t++){const i=n[t];i.onError&&i.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)},!1),a.addEventListener("abort",function(e){const n=bd[t];delete bd[t];for(let t=0,i=n.length;t<i;t++){const i=n[t];i.onError&&i.onError(e)}r.manager.itemError(t),r.manager.itemEnd(t)},!1),void 0!==this.responseType&&(a.responseType=this.responseType),void 0!==this.withCredentials&&(a.withCredentials=this.withCredentials),a.overrideMimeType&&a.overrideMimeType(void 0!==this.mimeType?this.mimeType:"text/plain");for(const t in this.requestHeader)a.setRequestHeader(t,this.requestHeader[t]);a.send(null)}return r.manager.itemStart(t),a},setResponseType:function(t){return this.responseType=t,this},setWithCredentials:function(t){return this.withCredentials=t,this},setMimeType:function(t){return this.mimeType=t,this}}),Md.prototype=Object.assign(Object.create(_d.prototype),{constructor:Md,load:function(t,e,n,i){const r=this,o=new wd(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.load(t,function(n){try{e(r.parse(JSON.parse(n)))}catch(o){i?i(o):console.error(o),r.manager.itemError(t)}},n,i)},parse:function(t){const e=[];for(let n=0;n<t.length;n++){const i=fd.parse(t[n]);e.push(i)}return e}}),Sd.prototype=Object.assign(Object.create(_d.prototype),{constructor:Sd,load:function(t,e,n,i){const r=this,o=[],s=new yu;s.image=o;const a=new wd(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader);let c=0;function l(l){a.load(t[l],function(t){const n=r.parse(t,!0);o[l]={width:n.width,height:n.height,format:n.format,mipmaps:n.mipmaps},6===(c+=1)&&(1===n.mipmapCount&&(s.minFilter=gt),s.format=n.format,s.needsUpdate=!0,e&&e(s))},n,i)}if(Array.isArray(t))for(let h=0,u=t.length;h<u;++h)l(h);else a.load(t,function(t){const n=r.parse(t,!0);if(n.isCubemap){const t=n.mipmaps.length/n.mipmapCount;for(let e=0;e<t;e++){o[e]={mipmaps:[]};for(let t=0;t<n.mipmapCount;t++)o[e].mipmaps.push(n.mipmaps[e*n.mipmapCount+t]),o[e].format=n.format,o[e].width=n.width,o[e].height=n.height}}else s.image.width=n.width,s.image.height=n.height,s.mipmaps=n.mipmaps;1===n.mipmapCount&&(s.minFilter=gt),s.format=n.format,s.needsUpdate=!0,e&&e(s)},n,i);return s}}),Td.prototype=Object.assign(Object.create(_d.prototype),{constructor:Td,load:function(t,e,n,i){const r=this,o=new Eo,s=new wd(this.manager);return s.setResponseType("arraybuffer"),s.setRequestHeader(this.requestHeader),s.setPath(this.path),s.load(t,function(t){const n=r.parse(t);n&&(void 0!==n.image?o.image=n.image:void 0!==n.data&&(o.image.width=n.width,o.image.height=n.height,o.image.data=n.data),o.wrapS=void 0!==n.wrapS?n.wrapS:lt,o.wrapT=void 0!==n.wrapT?n.wrapT:lt,o.magFilter=void 0!==n.magFilter?n.magFilter:gt,o.minFilter=void 0!==n.minFilter?n.minFilter:gt,o.anisotropy=void 0!==n.anisotropy?n.anisotropy:1,void 0!==n.format&&(o.format=n.format),void 0!==n.type&&(o.type=n.type),void 0!==n.mipmaps&&(o.mipmaps=n.mipmaps,o.minFilter=xt),1===n.mipmapCount&&(o.minFilter=gt),o.needsUpdate=!0,e&&e(o,n))},n,i),o}}),Ed.prototype=Object.assign(Object.create(_d.prototype),{constructor:Ed,load:function(t,e,n,i){void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,o=vd.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout(function(){e&&e(o),r.manager.itemEnd(t)},0),o;const s=document.createElementNS("http://www.w3.org/1999/xhtml","img");function a(){s.removeEventListener("load",a,!1),s.removeEventListener("error",c,!1),vd.add(t,this),e&&e(this),r.manager.itemEnd(t)}function c(e){s.removeEventListener("load",a,!1),s.removeEventListener("error",c,!1),i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)}return s.addEventListener("load",a,!1),s.addEventListener("error",c,!1),"data:"!==t.substr(0,5)&&void 0!==this.crossOrigin&&(s.crossOrigin=this.crossOrigin),r.manager.itemStart(t),s.src=t,s}}),Ad.prototype=Object.assign(Object.create(_d.prototype),{constructor:Ad,load:function(t,e,n,i){const r=new vc,o=new Ed(this.manager);o.setCrossOrigin(this.crossOrigin),o.setPath(this.path);let s=0;function a(n){o.load(t[n],function(t){r.images[n]=t,6===++s&&(r.needsUpdate=!0,e&&e(r))},void 0,i)}for(let c=0;c<t.length;++c)a(c);return r}}),Ld.prototype=Object.assign(Object.create(_d.prototype),{constructor:Ld,load:function(t,e,n,i){const r=new zn,o=new Ed(this.manager);return o.setCrossOrigin(this.crossOrigin),o.setPath(this.path),o.load(t,function(n){r.image=n;const i=t.search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/);r.format=i?It:Nt,r.needsUpdate=!0,void 0!==e&&e(r)},n,i),r}}),Object.assign(Rd.prototype,{getPoint:function(){return console.warn("THREE.Curve: .getPoint() not implemented."),null},getPointAt:function(t,e){const n=this.getUtoTmapping(t);return this.getPoint(n,e)},getPoints:function(t){void 0===t&&(t=5);const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return e},getSpacedPoints:function(t){void 0===t&&(t=5);const e=[];for(let n=0;n<=t;n++)e.push(this.getPointAt(n/t));return e},getLength:function(){const t=this.getLengths();return t[t.length-1]},getLengths:function(t){if(void 0===t&&(t=this.arcLengthDivisions),this.cacheArcLengths&&this.cacheArcLengths.length===t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const e=[];let n,i=this.getPoint(0),r=0;e.push(0);for(let o=1;o<=t;o++)r+=(n=this.getPoint(o/t)).distanceTo(i),e.push(r),i=n;return this.cacheArcLengths=e,e},updateArcLengths:function(){this.needsUpdate=!0,this.getLengths()},getUtoTmapping:function(t,e){const n=this.getLengths();let i,r=0,o=n.length;i=e||t*n[o-1];let s,a=0,c=o-1;for(;a<=c;)if((s=n[r=Math.floor(a+(c-a)/2)]-i)<0)a=r+1;else{if(!(s>0)){c=r;break}c=r-1}if(n[r=c]===i)return r/(o-1);const l=n[r];return(r+(i-l)/(n[r+1]-l))/(o-1)},getTangent:function(t,e){let n=t-1e-4,i=t+1e-4;n<0&&(n=0),i>1&&(i=1);const r=this.getPoint(n),o=this.getPoint(i),s=e||(r.isVector2?new Nn:new Xn);return s.copy(o).sub(r).normalize(),s},getTangentAt:function(t,e){const n=this.getUtoTmapping(t);return this.getTangent(n,e)},computeFrenetFrames:function(t,e){const n=new Xn,i=[],r=[],o=[],s=new Xn,a=new ei;for(let p=0;p<=t;p++){const e=p/t;i[p]=this.getTangentAt(e,new Xn),i[p].normalize()}r[0]=new Xn,o[0]=new Xn;let c=Number.MAX_VALUE;const l=Math.abs(i[0].x),h=Math.abs(i[0].y),u=Math.abs(i[0].z);l<=c&&(c=l,n.set(1,0,0)),h<=c&&(c=h,n.set(0,1,0)),u<=c&&n.set(0,0,1),s.crossVectors(i[0],n).normalize(),r[0].crossVectors(i[0],s),o[0].crossVectors(i[0],r[0]);for(let p=1;p<=t;p++){if(r[p]=r[p-1].clone(),o[p]=o[p-1].clone(),s.crossVectors(i[p-1],i[p]),s.length()>Number.EPSILON){s.normalize();const t=Math.acos(In.clamp(i[p-1].dot(i[p]),-1,1));r[p].applyMatrix4(a.makeRotationAxis(s,t))}o[p].crossVectors(i[p],r[p])}if(!0===e){let e=Math.acos(In.clamp(r[0].dot(r[t]),-1,1));e/=t,i[0].dot(s.crossVectors(r[0],r[t]))>0&&(e=-e);for(let n=1;n<=t;n++)r[n].applyMatrix4(a.makeRotationAxis(i[n],e*n)),o[n].crossVectors(i[n],r[n])}return{tangents:i,normals:r,binormals:o}},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this},toJSON:function(){const t={metadata:{version:4.5,type:"Curve",generator:"Curve.toJSON"}};return t.arcLengthDivisions=this.arcLengthDivisions,t.type=this.type,t},fromJSON:function(t){return this.arcLengthDivisions=t.arcLengthDivisions,this}}),Cd.prototype=Object.create(Rd.prototype),Cd.prototype.constructor=Cd,Cd.prototype.isEllipseCurve=!0,Cd.prototype.getPoint=function(t,e){const n=e||new Nn,i=2*Math.PI;let r=this.aEndAngle-this.aStartAngle;const o=Math.abs(r)<Number.EPSILON;for(;r<0;)r+=i;for(;r>i;)r-=i;r<Number.EPSILON&&(r=o?0:i),!0!==this.aClockwise||o||(r===i?r=-i:r-=i);const s=this.aStartAngle+t*r;let a=this.aX+this.xRadius*Math.cos(s),c=this.aY+this.yRadius*Math.sin(s);if(0!==this.aRotation){const t=Math.cos(this.aRotation),e=Math.sin(this.aRotation),n=a-this.aX,i=c-this.aY;a=n*t-i*e+this.aX,c=n*e+i*t+this.aY}return n.set(a,c)},Cd.prototype.copy=function(t){return Rd.prototype.copy.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},Cd.prototype.toJSON=function(){const t=Rd.prototype.toJSON.call(this);return t.aX=this.aX,t.aY=this.aY,t.xRadius=this.xRadius,t.yRadius=this.yRadius,t.aStartAngle=this.aStartAngle,t.aEndAngle=this.aEndAngle,t.aClockwise=this.aClockwise,t.aRotation=this.aRotation,t},Cd.prototype.fromJSON=function(t){return Rd.prototype.fromJSON.call(this,t),this.aX=t.aX,this.aY=t.aY,this.xRadius=t.xRadius,this.yRadius=t.yRadius,this.aStartAngle=t.aStartAngle,this.aEndAngle=t.aEndAngle,this.aClockwise=t.aClockwise,this.aRotation=t.aRotation,this},Pd.prototype=Object.create(Cd.prototype),Pd.prototype.constructor=Pd,Pd.prototype.isArcCurve=!0;const Dd=new Xn,Id=new Od,Nd=new Od,Bd=new Od;function Fd(t,e,n,i){Rd.call(this),this.type="CatmullRomCurve3",this.points=t||[],this.closed=e||!1,this.curveType=n||"centripetal",this.tension=void 0!==i?i:.5}function Ud(t,e,n,i,r){const o=.5*(i-e),s=.5*(r-n),a=t*t;return(2*n-2*i+o+s)*(t*a)+(-3*n+3*i-2*o-s)*a+o*t+n}function Gd(t,e){const n=1-t;return n*n*e}function zd(t,e){return 2*(1-t)*t*e}function Hd(t,e){return t*t*e}function kd(t,e,n,i){return Gd(t,e)+zd(t,n)+Hd(t,i)}function Vd(t,e){const n=1-t;return n*n*n*e}function jd(t,e){const n=1-t;return 3*n*n*t*e}function Wd(t,e){return 3*(1-t)*t*t*e}function qd(t,e){return t*t*t*e}function Xd(t,e,n,i,r){return Vd(t,e)+jd(t,n)+Wd(t,i)+qd(t,r)}function Yd(t,e,n,i){Rd.call(this),this.type="CubicBezierCurve",this.v0=t||new Nn,this.v1=e||new Nn,this.v2=n||new Nn,this.v3=i||new Nn}function Zd(t,e,n,i){Rd.call(this),this.type="CubicBezierCurve3",this.v0=t||new Xn,this.v1=e||new Xn,this.v2=n||new Xn,this.v3=i||new Xn}function Jd(t,e){Rd.call(this),this.type="LineCurve",this.v1=t||new Nn,this.v2=e||new Nn}function Qd(t,e){Rd.call(this),this.type="LineCurve3",this.v1=t||new Xn,this.v2=e||new Xn}function Kd(t,e,n){Rd.call(this),this.type="QuadraticBezierCurve",this.v0=t||new Nn,this.v1=e||new Nn,this.v2=n||new Nn}function $d(t,e,n){Rd.call(this),this.type="QuadraticBezierCurve3",this.v0=t||new Xn,this.v1=e||new Xn,this.v2=n||new Xn}function tf(t){Rd.call(this),this.type="SplineCurve",this.points=t||[]}Fd.prototype=Object.create(Rd.prototype),Fd.prototype.constructor=Fd,Fd.prototype.isCatmullRomCurve3=!0,Fd.prototype.getPoint=function(t,e){const n=e||new Xn,i=this.points,r=i.length,o=(r-(this.closed?0:1))*t;let s,a,c,l,h=Math.floor(o),u=o-h;if(this.closed?h+=h>0?0:(Math.floor(Math.abs(h)/r)+1)*r:0===u&&h===r-1&&(h=r-2,u=1),this.closed||h>0?s=i[(h-1)%r]:(Dd.subVectors(i[0],i[1]).add(i[0]),s=Dd),a=i[h%r],c=i[(h+1)%r],this.closed||h+2<r?l=i[(h+2)%r]:(Dd.subVectors(i[r-1],i[r-2]).add(i[r-1]),l=Dd),"centripetal"===this.curveType||"chordal"===this.curveType){const t="chordal"===this.curveType?.5:.25;let e=Math.pow(s.distanceToSquared(a),t),n=Math.pow(a.distanceToSquared(c),t),i=Math.pow(c.distanceToSquared(l),t);n<1e-4&&(n=1),e<1e-4&&(e=n),i<1e-4&&(i=n),Id.initNonuniformCatmullRom(s.x,a.x,c.x,l.x,e,n,i),Nd.initNonuniformCatmullRom(s.y,a.y,c.y,l.y,e,n,i),Bd.initNonuniformCatmullRom(s.z,a.z,c.z,l.z,e,n,i)}else"catmullrom"===this.curveType&&(Id.initCatmullRom(s.x,a.x,c.x,l.x,this.tension),Nd.initCatmullRom(s.y,a.y,c.y,l.y,this.tension),Bd.initCatmullRom(s.z,a.z,c.z,l.z,this.tension));return n.set(Id.calc(u),Nd.calc(u),Bd.calc(u)),n},Fd.prototype.copy=function(t){Rd.prototype.copy.call(this,t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},Fd.prototype.toJSON=function(){const t=Rd.prototype.toJSON.call(this);t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}return t.closed=this.closed,t.curveType=this.curveType,t.tension=this.tension,t},Fd.prototype.fromJSON=function(t){Rd.prototype.fromJSON.call(this,t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new Xn).fromArray(n))}return this.closed=t.closed,this.curveType=t.curveType,this.tension=t.tension,this},Yd.prototype=Object.create(Rd.prototype),Yd.prototype.constructor=Yd,Yd.prototype.isCubicBezierCurve=!0,Yd.prototype.getPoint=function(t,e){const n=e||new Nn,i=this.v0,r=this.v1,o=this.v2,s=this.v3;return n.set(Xd(t,i.x,r.x,o.x,s.x),Xd(t,i.y,r.y,o.y,s.y)),n},Yd.prototype.copy=function(t){return Rd.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},Yd.prototype.toJSON=function(){const t=Rd.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Yd.prototype.fromJSON=function(t){return Rd.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},Zd.prototype=Object.create(Rd.prototype),Zd.prototype.constructor=Zd,Zd.prototype.isCubicBezierCurve3=!0,Zd.prototype.getPoint=function(t,e){const n=e||new Xn,i=this.v0,r=this.v1,o=this.v2,s=this.v3;return n.set(Xd(t,i.x,r.x,o.x,s.x),Xd(t,i.y,r.y,o.y,s.y),Xd(t,i.z,r.z,o.z,s.z)),n},Zd.prototype.copy=function(t){return Rd.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this.v3.copy(t.v3),this},Zd.prototype.toJSON=function(){const t=Rd.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t.v3=this.v3.toArray(),t},Zd.prototype.fromJSON=function(t){return Rd.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this.v3.fromArray(t.v3),this},Jd.prototype=Object.create(Rd.prototype),Jd.prototype.constructor=Jd,Jd.prototype.isLineCurve=!0,Jd.prototype.getPoint=function(t,e){const n=e||new Nn;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Jd.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Jd.prototype.getTangent=function(t,e){const n=e||new Nn;return n.copy(this.v2).sub(this.v1).normalize(),n},Jd.prototype.copy=function(t){return Rd.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Jd.prototype.toJSON=function(){const t=Rd.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Jd.prototype.fromJSON=function(t){return Rd.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Qd.prototype=Object.create(Rd.prototype),Qd.prototype.constructor=Qd,Qd.prototype.isLineCurve3=!0,Qd.prototype.getPoint=function(t,e){const n=e||new Xn;return 1===t?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(t).add(this.v1)),n},Qd.prototype.getPointAt=function(t,e){return this.getPoint(t,e)},Qd.prototype.copy=function(t){return Rd.prototype.copy.call(this,t),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Qd.prototype.toJSON=function(){const t=Rd.prototype.toJSON.call(this);return t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Qd.prototype.fromJSON=function(t){return Rd.prototype.fromJSON.call(this,t),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},Kd.prototype=Object.create(Rd.prototype),Kd.prototype.constructor=Kd,Kd.prototype.isQuadraticBezierCurve=!0,Kd.prototype.getPoint=function(t,e){const n=e||new Nn,i=this.v0,r=this.v1,o=this.v2;return n.set(kd(t,i.x,r.x,o.x),kd(t,i.y,r.y,o.y)),n},Kd.prototype.copy=function(t){return Rd.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},Kd.prototype.toJSON=function(){const t=Rd.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},Kd.prototype.fromJSON=function(t){return Rd.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},$d.prototype=Object.create(Rd.prototype),$d.prototype.constructor=$d,$d.prototype.isQuadraticBezierCurve3=!0,$d.prototype.getPoint=function(t,e){const n=e||new Xn,i=this.v0,r=this.v1,o=this.v2;return n.set(kd(t,i.x,r.x,o.x),kd(t,i.y,r.y,o.y),kd(t,i.z,r.z,o.z)),n},$d.prototype.copy=function(t){return Rd.prototype.copy.call(this,t),this.v0.copy(t.v0),this.v1.copy(t.v1),this.v2.copy(t.v2),this},$d.prototype.toJSON=function(){const t=Rd.prototype.toJSON.call(this);return t.v0=this.v0.toArray(),t.v1=this.v1.toArray(),t.v2=this.v2.toArray(),t},$d.prototype.fromJSON=function(t){return Rd.prototype.fromJSON.call(this,t),this.v0.fromArray(t.v0),this.v1.fromArray(t.v1),this.v2.fromArray(t.v2),this},tf.prototype=Object.create(Rd.prototype),tf.prototype.constructor=tf,tf.prototype.isSplineCurve=!0,tf.prototype.getPoint=function(t,e){const n=e||new Nn,i=this.points,r=(i.length-1)*t,o=Math.floor(r),s=r-o,a=i[0===o?o:o-1],c=i[o],l=i[o>i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return n.set(Ud(s,a.x,c.x,l.x,h.x),Ud(s,a.y,c.y,l.y,h.y)),n},tf.prototype.copy=function(t){Rd.prototype.copy.call(this,t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push(n.clone())}return this},tf.prototype.toJSON=function(){const t=Rd.prototype.toJSON.call(this);t.points=[];for(let e=0,n=this.points.length;e<n;e++){const n=this.points[e];t.points.push(n.toArray())}return t},tf.prototype.fromJSON=function(t){Rd.prototype.fromJSON.call(this,t),this.points=[];for(let e=0,n=t.points.length;e<n;e++){const n=t.points[e];this.points.push((new Nn).fromArray(n))}return this};var ef=Object.freeze({__proto__:null,ArcCurve:Pd,CatmullRomCurve3:Fd,CubicBezierCurve:Yd,CubicBezierCurve3:Zd,EllipseCurve:Cd,LineCurve:Jd,LineCurve3:Qd,QuadraticBezierCurve:Kd,QuadraticBezierCurve3:$d,SplineCurve:tf});function nf(){Rd.call(this),this.type="CurvePath",this.curves=[],this.autoClose=!1}function rf(t){nf.call(this),this.type="Path",this.currentPoint=new Nn,t&&this.setFromPoints(t)}function of(t){rf.call(this,t),this.uuid=In.generateUUID(),this.type="Shape",this.holes=[]}function sf(t,e){xi.call(this),this.type="Light",this.color=new hr(t),this.intensity=void 0!==e?e:1,this.receiveShadow=void 0}function af(t,e,n){sf.call(this,t,n),this.type="HemisphereLight",this.castShadow=void 0,this.position.copy(xi.DefaultUp),this.updateMatrix(),this.groundColor=new hr(e)}function cf(t){this.camera=t,this.bias=0,this.normalBias=0,this.radius=1,this.mapSize=new Nn(512,512),this.map=null,this.mapPass=null,this.matrix=new ei,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new Ro,this._frameExtents=new Nn(1,1),this._viewportCount=1,this._viewports=[new Hn(0,0,1,1)]}function lf(){cf.call(this,new bo(50,1,.5,500))}function hf(t,e,n,i,r,o){sf.call(this,t,e),this.type="SpotLight",this.position.copy(xi.DefaultUp),this.updateMatrix(),this.target=new xi,Object.defineProperty(this,"power",{get:function(){return this.intensity*Math.PI},set:function(t){this.intensity=t/Math.PI}}),this.distance=void 0!==n?n:0,this.angle=void 0!==i?i:Math.PI/3,this.penumbra=void 0!==r?r:0,this.decay=void 0!==o?o:1,this.shadow=new lf}function uf(){cf.call(this,new bo(90,1,.5,500)),this._frameExtents=new Nn(4,2),this._viewportCount=6,this._viewports=[new Hn(2,1,1,1),new Hn(0,1,1,1),new Hn(3,1,1,1),new Hn(1,1,1,1),new Hn(3,0,1,1),new Hn(1,0,1,1)],this._cubeDirections=[new Xn(1,0,0),new Xn(-1,0,0),new Xn(0,0,1),new Xn(0,0,-1),new Xn(0,1,0),new Xn(0,-1,0)],this._cubeUps=[new Xn(0,1,0),new Xn(0,1,0),new Xn(0,1,0),new Xn(0,1,0),new Xn(0,0,1),new Xn(0,0,-1)]}function pf(t,e,n,i){sf.call(this,t,e),this.type="PointLight",Object.defineProperty(this,"power",{get:function(){return 4*this.intensity*Math.PI},set:function(t){this.intensity=t/(4*Math.PI)}}),this.distance=void 0!==n?n:0,this.decay=void 0!==i?i:1,this.shadow=new uf}function df(t,e,n,i,r,o){_o.call(this),this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=void 0!==t?t:-1,this.right=void 0!==e?e:1,this.top=void 0!==n?n:1,this.bottom=void 0!==i?i:-1,this.near=void 0!==r?r:.1,this.far=void 0!==o?o:2e3,this.updateProjectionMatrix()}function ff(){cf.call(this,new df(-5,5,5,-5,.5,500))}function mf(t,e){sf.call(this,t,e),this.type="DirectionalLight",this.position.copy(xi.DefaultUp),this.updateMatrix(),this.target=new xi,this.shadow=new ff}function gf(t,e){sf.call(this,t,e),this.type="AmbientLight",this.castShadow=void 0}function vf(t,e,n,i){sf.call(this,t,e),this.type="RectAreaLight",this.width=void 0!==n?n:10,this.height=void 0!==i?i:10}function yf(){this.coefficients=[];for(let t=0;t<9;t++)this.coefficients.push(new Xn)}function xf(t,e){sf.call(this,void 0,e),this.type="LightProbe",this.sh=void 0!==t?t:new yf}function _f(t){_d.call(this,t),this.textures={}}nf.prototype=Object.assign(Object.create(Rd.prototype),{constructor:nf,add:function(t){this.curves.push(t)},closePath:function(){const t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new Jd(e,t))},getPoint:function(t){const e=t*this.getLength(),n=this.getCurveLengths();let i=0;for(;i<n.length;){if(n[i]>=e){const t=n[i]-e,r=this.curves[i],o=r.getLength(),s=0===o?0:1-t/o;return r.getPointAt(s)}i++}return null},getLength:function(){const t=this.getCurveLengths();return t[t.length-1]},updateArcLengths:function(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()},getCurveLengths:function(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const t=[];let e=0;for(let n=0,i=this.curves.length;n<i;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t,t},getSpacedPoints:function(t){void 0===t&&(t=40);const e=[];for(let n=0;n<=t;n++)e.push(this.getPoint(n/t));return this.autoClose&&e.push(e[0]),e},getPoints:function(t){t=t||12;const e=[];let n;for(let i=0,r=this.curves;i<r.length;i++){const o=r[i],s=o&&o.isEllipseCurve?2*t:o&&(o.isLineCurve||o.isLineCurve3)?1:o&&o.isSplineCurve?t*o.points.length:t,a=o.getPoints(s);for(let t=0;t<a.length;t++){const i=a[t];n&&n.equals(i)||(e.push(i),n=i)}}return this.autoClose&&e.length>1&&!e[e.length-1].equals(e[0])&&e.push(e[0]),e},copy:function(t){Rd.prototype.copy.call(this,t),this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push(n.clone())}return this.autoClose=t.autoClose,this},toJSON:function(){const t=Rd.prototype.toJSON.call(this);t.autoClose=this.autoClose,t.curves=[];for(let e=0,n=this.curves.length;e<n;e++){const n=this.curves[e];t.curves.push(n.toJSON())}return t},fromJSON:function(t){Rd.prototype.fromJSON.call(this,t),this.autoClose=t.autoClose,this.curves=[];for(let e=0,n=t.curves.length;e<n;e++){const n=t.curves[e];this.curves.push((new ef[n.type]).fromJSON(n))}return this}}),rf.prototype=Object.assign(Object.create(nf.prototype),{constructor:rf,setFromPoints:function(t){this.moveTo(t[0].x,t[0].y);for(let e=1,n=t.length;e<n;e++)this.lineTo(t[e].x,t[e].y);return this},moveTo:function(t,e){return this.currentPoint.set(t,e),this},lineTo:function(t,e){const n=new Jd(this.currentPoint.clone(),new Nn(t,e));return this.curves.push(n),this.currentPoint.set(t,e),this},quadraticCurveTo:function(t,e,n,i){const r=new Kd(this.currentPoint.clone(),new Nn(t,e),new Nn(n,i));return this.curves.push(r),this.currentPoint.set(n,i),this},bezierCurveTo:function(t,e,n,i,r,o){const s=new Yd(this.currentPoint.clone(),new Nn(t,e),new Nn(n,i),new Nn(r,o));return this.curves.push(s),this.currentPoint.set(r,o),this},splineThru:function(t){const e=new tf([this.currentPoint.clone()].concat(t));return this.curves.push(e),this.currentPoint.copy(t[t.length-1]),this},arc:function(t,e,n,i,r,o){const s=this.currentPoint.x,a=this.currentPoint.y;return this.absarc(t+s,e+a,n,i,r,o),this},absarc:function(t,e,n,i,r,o){return this.absellipse(t,e,n,n,i,r,o),this},ellipse:function(t,e,n,i,r,o,s,a){const c=this.currentPoint.x,l=this.currentPoint.y;return this.absellipse(t+c,e+l,n,i,r,o,s,a),this},absellipse:function(t,e,n,i,r,o,s,a){const c=new Cd(t,e,n,i,r,o,s,a);if(this.curves.length>0){const t=c.getPoint(0);t.equals(this.currentPoint)||this.lineTo(t.x,t.y)}this.curves.push(c);const l=c.getPoint(1);return this.currentPoint.copy(l),this},copy:function(t){return nf.prototype.copy.call(this,t),this.currentPoint.copy(t.currentPoint),this},toJSON:function(){const t=nf.prototype.toJSON.call(this);return t.currentPoint=this.currentPoint.toArray(),t},fromJSON:function(t){return nf.prototype.fromJSON.call(this,t),this.currentPoint.fromArray(t.currentPoint),this}}),of.prototype=Object.assign(Object.create(rf.prototype),{constructor:of,getPointsHoles:function(t){const e=[];for(let n=0,i=this.holes.length;n<i;n++)e[n]=this.holes[n].getPoints(t);return e},extractPoints:function(t){return{shape:this.getPoints(t),holes:this.getPointsHoles(t)}},copy:function(t){rf.prototype.copy.call(this,t),this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push(n.clone())}return this},toJSON:function(){const t=rf.prototype.toJSON.call(this);t.uuid=this.uuid,t.holes=[];for(let e=0,n=this.holes.length;e<n;e++){const n=this.holes[e];t.holes.push(n.toJSON())}return t},fromJSON:function(t){rf.prototype.fromJSON.call(this,t),this.uuid=t.uuid,this.holes=[];for(let e=0,n=t.holes.length;e<n;e++){const n=t.holes[e];this.holes.push((new rf).fromJSON(n))}return this}}),sf.prototype=Object.assign(Object.create(xi.prototype),{constructor:sf,isLight:!0,copy:function(t){return xi.prototype.copy.call(this,t),this.color.copy(t.color),this.intensity=t.intensity,this},toJSON:function(t){const e=xi.prototype.toJSON.call(this,t);return e.object.color=this.color.getHex(),e.object.intensity=this.intensity,void 0!==this.groundColor&&(e.object.groundColor=this.groundColor.getHex()),void 0!==this.distance&&(e.object.distance=this.distance),void 0!==this.angle&&(e.object.angle=this.angle),void 0!==this.decay&&(e.object.decay=this.decay),void 0!==this.penumbra&&(e.object.penumbra=this.penumbra),void 0!==this.shadow&&(e.object.shadow=this.shadow.toJSON()),e}}),af.prototype=Object.assign(Object.create(sf.prototype),{constructor:af,isHemisphereLight:!0,copy:function(t){return sf.prototype.copy.call(this,t),this.groundColor.copy(t.groundColor),this}}),Object.assign(cf.prototype,{_projScreenMatrix:new ei,_lightPositionWorld:new Xn,_lookTarget:new Xn,getViewportCount:function(){return this._viewportCount},getFrustum:function(){return this._frustum},updateMatrices:function(t){const e=this.camera,n=this.matrix,i=this._projScreenMatrix,r=this._lookTarget,o=this._lightPositionWorld;o.setFromMatrixPosition(t.matrixWorld),e.position.copy(o),r.setFromMatrixPosition(t.target.matrixWorld),e.lookAt(r),e.updateMatrixWorld(),i.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),this._frustum.setFromProjectionMatrix(i),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(e.projectionMatrix),n.multiply(e.matrixWorldInverse)},getViewport:function(t){return this._viewports[t]},getFrameExtents:function(){return this._frameExtents},copy:function(t){return this.camera=t.camera.clone(),this.bias=t.bias,this.radius=t.radius,this.mapSize.copy(t.mapSize),this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){const t={};return 0!==this.bias&&(t.bias=this.bias),0!==this.normalBias&&(t.normalBias=this.normalBias),1!==this.radius&&(t.radius=this.radius),512===this.mapSize.x&&512===this.mapSize.y||(t.mapSize=this.mapSize.toArray()),t.camera=this.camera.toJSON(!1).object,delete t.camera.matrix,t}}),lf.prototype=Object.assign(Object.create(cf.prototype),{constructor:lf,isSpotLightShadow:!0,updateMatrices:function(t){const e=this.camera,n=2*In.RAD2DEG*t.angle,i=this.mapSize.width/this.mapSize.height,r=t.distance||e.far;n===e.fov&&i===e.aspect&&r===e.far||(e.fov=n,e.aspect=i,e.far=r,e.updateProjectionMatrix()),cf.prototype.updateMatrices.call(this,t)}}),hf.prototype=Object.assign(Object.create(sf.prototype),{constructor:hf,isSpotLight:!0,copy:function(t){return sf.prototype.copy.call(this,t),this.distance=t.distance,this.angle=t.angle,this.penumbra=t.penumbra,this.decay=t.decay,this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),uf.prototype=Object.assign(Object.create(cf.prototype),{constructor:uf,isPointLightShadow:!0,updateMatrices:function(t,e){void 0===e&&(e=0);const n=this.camera,i=this.matrix,r=this._lightPositionWorld,o=this._lookTarget,s=this._projScreenMatrix;r.setFromMatrixPosition(t.matrixWorld),n.position.copy(r),o.copy(n.position),o.add(this._cubeDirections[e]),n.up.copy(this._cubeUps[e]),n.lookAt(o),n.updateMatrixWorld(),i.makeTranslation(-r.x,-r.y,-r.z),s.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(s)}}),pf.prototype=Object.assign(Object.create(sf.prototype),{constructor:pf,isPointLight:!0,copy:function(t){return sf.prototype.copy.call(this,t),this.distance=t.distance,this.decay=t.decay,this.shadow=t.shadow.clone(),this}}),df.prototype=Object.assign(Object.create(_o.prototype),{constructor:df,isOrthographicCamera:!0,copy:function(t,e){return _o.prototype.copy.call(this,t,e),this.left=t.left,this.right=t.right,this.top=t.top,this.bottom=t.bottom,this.near=t.near,this.far=t.far,this.zoom=t.zoom,this.view=null===t.view?null:Object.assign({},t.view),this},setViewOffset:function(t,e,n,i,r,o){null===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=e,this.view.offsetX=n,this.view.offsetY=i,this.view.width=r,this.view.height=o,this.updateProjectionMatrix()},clearViewOffset:function(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()},updateProjectionMatrix:function(){const t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let r=n-t,o=n+t,s=i+e,a=i-e;if(null!==this.view&&this.view.enabled){const t=(this.right-this.left)/this.view.fullWidth/this.zoom,e=(this.top-this.bottom)/this.view.fullHeight/this.zoom;o=(r+=t*this.view.offsetX)+t*this.view.width,a=(s-=e*this.view.offsetY)-e*this.view.height}this.projectionMatrix.makeOrthographic(r,o,s,a,this.near,this.far),this.projectionMatrixInverse.getInverse(this.projectionMatrix)},toJSON:function(t){const e=xi.prototype.toJSON.call(this,t);return e.object.zoom=this.zoom,e.object.left=this.left,e.object.right=this.right,e.object.top=this.top,e.object.bottom=this.bottom,e.object.near=this.near,e.object.far=this.far,null!==this.view&&(e.object.view=Object.assign({},this.view)),e}}),ff.prototype=Object.assign(Object.create(cf.prototype),{constructor:ff,isDirectionalLightShadow:!0,updateMatrices:function(t){cf.prototype.updateMatrices.call(this,t)}}),mf.prototype=Object.assign(Object.create(sf.prototype),{constructor:mf,isDirectionalLight:!0,copy:function(t){return sf.prototype.copy.call(this,t),this.target=t.target.clone(),this.shadow=t.shadow.clone(),this}}),gf.prototype=Object.assign(Object.create(sf.prototype),{constructor:gf,isAmbientLight:!0}),vf.prototype=Object.assign(Object.create(sf.prototype),{constructor:vf,isRectAreaLight:!0,copy:function(t){return sf.prototype.copy.call(this,t),this.width=t.width,this.height=t.height,this},toJSON:function(t){const e=sf.prototype.toJSON.call(this,t);return e.object.width=this.width,e.object.height=this.height,e}}),Object.assign(yf.prototype,{isSphericalHarmonics3:!0,set:function(t){for(let e=0;e<9;e++)this.coefficients[e].copy(t[e]);return this},zero:function(){for(let t=0;t<9;t++)this.coefficients[t].set(0,0,0);return this},getAt:function(t,e){const n=t.x,i=t.y,r=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.282095),e.addScaledVector(o[1],.488603*i),e.addScaledVector(o[2],.488603*r),e.addScaledVector(o[3],.488603*n),e.addScaledVector(o[4],n*i*1.092548),e.addScaledVector(o[5],i*r*1.092548),e.addScaledVector(o[6],.315392*(3*r*r-1)),e.addScaledVector(o[7],n*r*1.092548),e.addScaledVector(o[8],.546274*(n*n-i*i)),e},getIrradianceAt:function(t,e){const n=t.x,i=t.y,r=t.z,o=this.coefficients;return e.copy(o[0]).multiplyScalar(.886227),e.addScaledVector(o[1],1.023328*i),e.addScaledVector(o[2],1.023328*r),e.addScaledVector(o[3],1.023328*n),e.addScaledVector(o[4],.858086*n*i),e.addScaledVector(o[5],.858086*i*r),e.addScaledVector(o[6],.743125*r*r-.247708),e.addScaledVector(o[7],.858086*n*r),e.addScaledVector(o[8],.429043*(n*n-i*i)),e},add:function(t){for(let e=0;e<9;e++)this.coefficients[e].add(t.coefficients[e]);return this},addScaledSH:function(t,e){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(t.coefficients[n],e);return this},scale:function(t){for(let e=0;e<9;e++)this.coefficients[e].multiplyScalar(t);return this},lerp:function(t,e){for(let n=0;n<9;n++)this.coefficients[n].lerp(t.coefficients[n],e);return this},equals:function(t){for(let e=0;e<9;e++)if(!this.coefficients[e].equals(t.coefficients[e]))return!1;return!0},copy:function(t){return this.set(t.coefficients)},clone:function(){return(new this.constructor).copy(this)},fromArray:function(t,e){void 0===e&&(e=0);const n=this.coefficients;for(let i=0;i<9;i++)n[i].fromArray(t,e+3*i);return this},toArray:function(t,e){void 0===t&&(t=[]),void 0===e&&(e=0);const n=this.coefficients;for(let i=0;i<9;i++)n[i].toArray(t,e+3*i);return t}}),Object.assign(yf,{getBasisAt:function(t,e){const n=t.x,i=t.y,r=t.z;e[0]=.282095,e[1]=.488603*i,e[2]=.488603*r,e[3]=.488603*n,e[4]=1.092548*n*i,e[5]=1.092548*i*r,e[6]=.315392*(3*r*r-1),e[7]=1.092548*n*r,e[8]=.546274*(n*n-i*i)}}),xf.prototype=Object.assign(Object.create(sf.prototype),{constructor:xf,isLightProbe:!0,copy:function(t){return sf.prototype.copy.call(this,t),this.sh.copy(t.sh),this},fromJSON:function(t){return this.intensity=t.intensity,this.sh.fromArray(t.sh),this},toJSON:function(t){const e=sf.prototype.toJSON.call(this,t);return e.object.sh=this.sh.toArray(),e}}),_f.prototype=Object.assign(Object.create(_d.prototype),{constructor:_f,load:function(t,e,n,i){const r=this,o=new wd(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.load(t,function(n){try{e(r.parse(JSON.parse(n)))}catch(o){i?i(o):console.error(o),r.manager.itemError(t)}},n,i)},parse:function(t){const e=this.textures;function n(t){return void 0===e[t]&&console.warn("THREE.MaterialLoader: Undefined texture",t),e[t]}const i=new td[t.type];if(void 0!==t.uuid&&(i.uuid=t.uuid),void 0!==t.name&&(i.name=t.name),void 0!==t.color&&i.color.setHex(t.color),void 0!==t.roughness&&(i.roughness=t.roughness),void 0!==t.metalness&&(i.metalness=t.metalness),void 0!==t.sheen&&(i.sheen=(new hr).setHex(t.sheen)),void 0!==t.emissive&&i.emissive.setHex(t.emissive),void 0!==t.specular&&i.specular.setHex(t.specular),void 0!==t.shininess&&(i.shininess=t.shininess),void 0!==t.clearcoat&&(i.clearcoat=t.clearcoat),void 0!==t.clearcoatRoughness&&(i.clearcoatRoughness=t.clearcoatRoughness),void 0!==t.fog&&(i.fog=t.fog),void 0!==t.flatShading&&(i.flatShading=t.flatShading),void 0!==t.blending&&(i.blending=t.blending),void 0!==t.combine&&(i.combine=t.combine),void 0!==t.side&&(i.side=t.side),void 0!==t.opacity&&(i.opacity=t.opacity),void 0!==t.transparent&&(i.transparent=t.transparent),void 0!==t.alphaTest&&(i.alphaTest=t.alphaTest),void 0!==t.depthTest&&(i.depthTest=t.depthTest),void 0!==t.depthWrite&&(i.depthWrite=t.depthWrite),void 0!==t.colorWrite&&(i.colorWrite=t.colorWrite),void 0!==t.stencilWrite&&(i.stencilWrite=t.stencilWrite),void 0!==t.stencilWriteMask&&(i.stencilWriteMask=t.stencilWriteMask),void 0!==t.stencilFunc&&(i.stencilFunc=t.stencilFunc),void 0!==t.stencilRef&&(i.stencilRef=t.stencilRef),void 0!==t.stencilFuncMask&&(i.stencilFuncMask=t.stencilFuncMask),void 0!==t.stencilFail&&(i.stencilFail=t.stencilFail),void 0!==t.stencilZFail&&(i.stencilZFail=t.stencilZFail),void 0!==t.stencilZPass&&(i.stencilZPass=t.stencilZPass),void 0!==t.wireframe&&(i.wireframe=t.wireframe),void 0!==t.wireframeLinewidth&&(i.wireframeLinewidth=t.wireframeLinewidth),void 0!==t.wireframeLinecap&&(i.wireframeLinecap=t.wireframeLinecap),void 0!==t.wireframeLinejoin&&(i.wireframeLinejoin=t.wireframeLinejoin),void 0!==t.rotation&&(i.rotation=t.rotation),1!==t.linewidth&&(i.linewidth=t.linewidth),void 0!==t.dashSize&&(i.dashSize=t.dashSize),void 0!==t.gapSize&&(i.gapSize=t.gapSize),void 0!==t.scale&&(i.scale=t.scale),void 0!==t.polygonOffset&&(i.polygonOffset=t.polygonOffset),void 0!==t.polygonOffsetFactor&&(i.polygonOffsetFactor=t.polygonOffsetFactor),void 0!==t.polygonOffsetUnits&&(i.polygonOffsetUnits=t.polygonOffsetUnits),void 0!==t.skinning&&(i.skinning=t.skinning),void 0!==t.morphTargets&&(i.morphTargets=t.morphTargets),void 0!==t.morphNormals&&(i.morphNormals=t.morphNormals),void 0!==t.dithering&&(i.dithering=t.dithering),void 0!==t.vertexTangents&&(i.vertexTangents=t.vertexTangents),void 0!==t.visible&&(i.visible=t.visible),void 0!==t.toneMapped&&(i.toneMapped=t.toneMapped),void 0!==t.userData&&(i.userData=t.userData),void 0!==t.vertexColors&&("number"==typeof t.vertexColors?i.vertexColors=t.vertexColors>0:i.vertexColors=t.vertexColors),void 0!==t.uniforms)for(const r in t.uniforms){const e=t.uniforms[r];switch(i.uniforms[r]={},e.type){case"t":i.uniforms[r].value=n(e.value);break;case"c":i.uniforms[r].value=(new hr).setHex(e.value);break;case"v2":i.uniforms[r].value=(new Nn).fromArray(e.value);break;case"v3":i.uniforms[r].value=(new Xn).fromArray(e.value);break;case"v4":i.uniforms[r].value=(new Hn).fromArray(e.value);break;case"m3":i.uniforms[r].value=(new Bn).fromArray(e.value);case"m4":i.uniforms[r].value=(new ei).fromArray(e.value);break;default:i.uniforms[r].value=e.value}}if(void 0!==t.defines&&(i.defines=t.defines),void 0!==t.vertexShader&&(i.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(i.fragmentShader=t.fragmentShader),void 0!==t.extensions)for(const r in t.extensions)i.extensions[r]=t.extensions[r];if(void 0!==t.shading&&(i.flatShading=1===t.shading),void 0!==t.size&&(i.size=t.size),void 0!==t.sizeAttenuation&&(i.sizeAttenuation=t.sizeAttenuation),void 0!==t.map&&(i.map=n(t.map)),void 0!==t.matcap&&(i.matcap=n(t.matcap)),void 0!==t.alphaMap&&(i.alphaMap=n(t.alphaMap)),void 0!==t.bumpMap&&(i.bumpMap=n(t.bumpMap)),void 0!==t.bumpScale&&(i.bumpScale=t.bumpScale),void 0!==t.normalMap&&(i.normalMap=n(t.normalMap)),void 0!==t.normalMapType&&(i.normalMapType=t.normalMapType),void 0!==t.normalScale){let e=t.normalScale;!1===Array.isArray(e)&&(e=[e,e]),i.normalScale=(new Nn).fromArray(e)}return void 0!==t.displacementMap&&(i.displacementMap=n(t.displacementMap)),void 0!==t.displacementScale&&(i.displacementScale=t.displacementScale),void 0!==t.displacementBias&&(i.displacementBias=t.displacementBias),void 0!==t.roughnessMap&&(i.roughnessMap=n(t.roughnessMap)),void 0!==t.metalnessMap&&(i.metalnessMap=n(t.metalnessMap)),void 0!==t.emissiveMap&&(i.emissiveMap=n(t.emissiveMap)),void 0!==t.emissiveIntensity&&(i.emissiveIntensity=t.emissiveIntensity),void 0!==t.specularMap&&(i.specularMap=n(t.specularMap)),void 0!==t.envMap&&(i.envMap=n(t.envMap)),void 0!==t.envMapIntensity&&(i.envMapIntensity=t.envMapIntensity),void 0!==t.reflectivity&&(i.reflectivity=t.reflectivity),void 0!==t.refractionRatio&&(i.refractionRatio=t.refractionRatio),void 0!==t.lightMap&&(i.lightMap=n(t.lightMap)),void 0!==t.lightMapIntensity&&(i.lightMapIntensity=t.lightMapIntensity),void 0!==t.aoMap&&(i.aoMap=n(t.aoMap)),void 0!==t.aoMapIntensity&&(i.aoMapIntensity=t.aoMapIntensity),void 0!==t.gradientMap&&(i.gradientMap=n(t.gradientMap)),void 0!==t.clearcoatMap&&(i.clearcoatMap=n(t.clearcoatMap)),void 0!==t.clearcoatRoughnessMap&&(i.clearcoatRoughnessMap=n(t.clearcoatRoughnessMap)),void 0!==t.clearcoatNormalMap&&(i.clearcoatNormalMap=n(t.clearcoatNormalMap)),void 0!==t.clearcoatNormalScale&&(i.clearcoatNormalScale=(new Nn).fromArray(t.clearcoatNormalScale)),void 0!==t.transmission&&(i.transmission=t.transmission),void 0!==t.transmissionMap&&(i.transmissionMap=n(t.transmissionMap)),i},setTextures:function(t){return this.textures=t,this}});const bf={decodeText:function(t){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(t);let e="";for(let i=0,r=t.length;i<r;i++)e+=String.fromCharCode(t[i]);try{return decodeURIComponent(escape(e))}catch(n){return e}},extractUrlBase:function(t){const e=t.lastIndexOf("/");return-1===e?"./":t.substr(0,e+1)}};function wf(){Gr.call(this),this.type="InstancedBufferGeometry",this.instanceCount=1/0}function Mf(t,e,n,i){"number"==typeof n&&(i=n,n=!1,console.error("THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.")),_r.call(this,t,e,n),this.meshPerAttribute=i||1}function Sf(t){_d.call(this,t)}exports.LoaderUtils=bf,wf.prototype=Object.assign(Object.create(Gr.prototype),{constructor:wf,isInstancedBufferGeometry:!0,copy:function(t){return Gr.prototype.copy.call(this,t),this.instanceCount=t.instanceCount,this},clone:function(){return(new this.constructor).copy(this)},toJSON:function(){const t=Gr.prototype.toJSON.call(this);return t.instanceCount=this.instanceCount,t.isInstancedBufferGeometry=!0,t}}),Mf.prototype=Object.assign(Object.create(_r.prototype),{constructor:Mf,isInstancedBufferAttribute:!0,copy:function(t){return _r.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},toJSON:function(){const t=_r.prototype.toJSON.call(this);return t.meshPerAttribute=this.meshPerAttribute,t.isInstancedBufferAttribute=!0,t}}),Sf.prototype=Object.assign(Object.create(_d.prototype),{constructor:Sf,load:function(t,e,n,i){const r=this,o=new wd(r.manager);o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.load(t,function(n){try{e(r.parse(JSON.parse(n)))}catch(o){i?i(o):console.error(o),r.manager.itemError(t)}},n,i)},parse:function(t){const e={},n={};function i(t,i){if(void 0!==e[i])return e[i];const r=t.interleavedBuffers[i],o=function(t,e){if(void 0!==n[e])return n[e];const i=t.arrayBuffers[e],r=new Uint32Array(i).buffer;return n[e]=r,r}(t,r.buffer),s=new bh(new Tf[r.type](o),r.stride);return s.uuid=r.uuid,e[i]=s,s}const r=t.isInstancedBufferGeometry?new wf:new Gr,o=t.data.index;if(void 0!==o){const t=new Tf[o.type](o.array);r.setIndex(new _r(t,1))}const s=t.data.attributes;for(const h in s){const e=s[h];let n;if(e.isInterleavedBufferAttribute){n=new Mh(i(t.data,e.data),e.itemSize,e.offset,e.normalized)}else{const t=new Tf[e.type](e.array);n=new(e.isInstancedBufferAttribute?Mf:_r)(t,e.itemSize,e.normalized)}void 0!==e.name&&(n.name=e.name),r.setAttribute(h,n)}const a=t.data.morphAttributes;if(a)for(const h in a){const e=a[h],n=[];for(let r=0,o=e.length;r<o;r++){const o=e[r];let s;if(o.isInterleavedBufferAttribute){s=new Mh(i(t.data,o.data),o.itemSize,o.offset,o.normalized)}else{s=new _r(new Tf[o.type](o.array),o.itemSize,o.normalized)}void 0!==o.name&&(s.name=o.name),n.push(s)}r.morphAttributes[h]=n}t.data.morphTargetsRelative&&(r.morphTargetsRelative=!0);const c=t.data.groups||t.data.drawcalls||t.data.offsets;if(void 0!==c)for(let h=0,u=c.length;h!==u;++h){const t=c[h];r.addGroup(t.start,t.count,t.materialIndex)}const l=t.data.boundingSphere;if(void 0!==l){const t=new Xn;void 0!==l.center&&t.fromArray(l.center),r.boundingSphere=new Fi(t,l.radius)}return t.name&&(r.name=t.name),t.userData&&(r.userData=t.userData),r}});const Tf={Int8Array:Int8Array,Uint8Array:Uint8Array,Uint8ClampedArray:"undefined"!=typeof Uint8ClampedArray?Uint8ClampedArray:Uint8Array,Int16Array:Int16Array,Uint16Array:Uint16Array,Int32Array:Int32Array,Uint32Array:Uint32Array,Float32Array:Float32Array,Float64Array:Float64Array};function Ef(t){_d.call(this,t)}Ef.prototype=Object.assign(Object.create(_d.prototype),{constructor:Ef,load:function(t,e,n,i){const r=this,o=""===this.path?bf.extractUrlBase(t):this.path;this.resourcePath=this.resourcePath||o;const s=new wd(r.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.load(t,function(n){let o=null;try{o=JSON.parse(n)}catch(a){return void 0!==i&&i(a),void console.error("THREE:ObjectLoader: Can't parse "+t+".",a.message)}const s=o.metadata;void 0!==s&&void 0!==s.type&&"geometry"!==s.type.toLowerCase()?r.parse(o,e):console.error("THREE.ObjectLoader: Can't load "+t)},n,i)},parse:function(t,e){const n=this.parseShape(t.shapes),i=this.parseGeometries(t.geometries,n),r=this.parseImages(t.images,function(){void 0!==e&&e(a)}),o=this.parseTextures(t.textures,r),s=this.parseMaterials(t.materials,o),a=this.parseObject(t.object,i,s);return t.animations&&(a.animations=this.parseAnimations(t.animations)),void 0!==t.images&&0!==t.images.length||void 0!==e&&e(a),a},parseShape:function(t){const e={};if(void 0!==t)for(let n=0,i=t.length;n<i;n++){const i=(new of).fromJSON(t[n]);e[i.uuid]=i}return e},parseGeometries:function(t,e){const n={};let i;if(void 0!==t){const r=new Sf;for(let o=0,s=t.length;o<s;o++){let s;const a=t[o];switch(a.type){case"PlaneGeometry":case"PlaneBufferGeometry":s=new Vp[a.type](a.width,a.height,a.widthSegments,a.heightSegments);break;case"BoxGeometry":case"BoxBufferGeometry":case"CubeGeometry":s=new Vp[a.type](a.width,a.height,a.depth,a.widthSegments,a.heightSegments,a.depthSegments);break;case"CircleGeometry":case"CircleBufferGeometry":s=new Vp[a.type](a.radius,a.segments,a.thetaStart,a.thetaLength);break;case"CylinderGeometry":case"CylinderBufferGeometry":s=new Vp[a.type](a.radiusTop,a.radiusBottom,a.height,a.radialSegments,a.heightSegments,a.openEnded,a.thetaStart,a.thetaLength);break;case"ConeGeometry":case"ConeBufferGeometry":s=new Vp[a.type](a.radius,a.height,a.radialSegments,a.heightSegments,a.openEnded,a.thetaStart,a.thetaLength);break;case"SphereGeometry":case"SphereBufferGeometry":s=new Vp[a.type](a.radius,a.widthSegments,a.heightSegments,a.phiStart,a.phiLength,a.thetaStart,a.thetaLength);break;case"DodecahedronGeometry":case"DodecahedronBufferGeometry":case"IcosahedronGeometry":case"IcosahedronBufferGeometry":case"OctahedronGeometry":case"OctahedronBufferGeometry":case"TetrahedronGeometry":case"TetrahedronBufferGeometry":s=new Vp[a.type](a.radius,a.detail);break;case"RingGeometry":case"RingBufferGeometry":s=new Vp[a.type](a.innerRadius,a.outerRadius,a.thetaSegments,a.phiSegments,a.thetaStart,a.thetaLength);break;case"TorusGeometry":case"TorusBufferGeometry":s=new Vp[a.type](a.radius,a.tube,a.radialSegments,a.tubularSegments,a.arc);break;case"TorusKnotGeometry":case"TorusKnotBufferGeometry":s=new Vp[a.type](a.radius,a.tube,a.tubularSegments,a.radialSegments,a.p,a.q);break;case"TubeGeometry":case"TubeBufferGeometry":s=new Vp[a.type]((new ef[a.path.type]).fromJSON(a.path),a.tubularSegments,a.radius,a.radialSegments,a.closed);break;case"LatheGeometry":case"LatheBufferGeometry":s=new Vp[a.type](a.points,a.segments,a.phiStart,a.phiLength);break;case"PolyhedronGeometry":case"PolyhedronBufferGeometry":s=new Vp[a.type](a.vertices,a.indices,a.radius,a.details);break;case"ShapeGeometry":case"ShapeBufferGeometry":i=[];for(let n=0,r=a.shapes.length;n<r;n++){const t=e[a.shapes[n]];i.push(t)}s=new Vp[a.type](i,a.curveSegments);break;case"ExtrudeGeometry":case"ExtrudeBufferGeometry":i=[];for(let n=0,r=a.shapes.length;n<r;n++){const t=e[a.shapes[n]];i.push(t)}const t=a.options.extrudePath;void 0!==t&&(a.options.extrudePath=(new ef[t.type]).fromJSON(t)),s=new Vp[a.type](i,a.options);break;case"BufferGeometry":case"InstancedBufferGeometry":s=r.parse(a);break;case"Geometry":console.error('THREE.ObjectLoader: Loading "Geometry" is not supported anymore.');break;default:console.warn('THREE.ObjectLoader: Unsupported geometry type "'+a.type+'"');continue}s.uuid=a.uuid,void 0!==a.name&&(s.name=a.name),!0===s.isBufferGeometry&&void 0!==a.userData&&(s.userData=a.userData),n[a.uuid]=s}}return n},parseMaterials:function(t,e){const n={},i={};if(void 0!==t){const r=new _f;r.setTextures(e);for(let e=0,o=t.length;e<o;e++){const o=t[e];if("MultiMaterial"===o.type){const t=[];for(let e=0;e<o.materials.length;e++){const i=o.materials[e];void 0===n[i.uuid]&&(n[i.uuid]=r.parse(i)),t.push(n[i.uuid])}i[o.uuid]=t}else void 0===n[o.uuid]&&(n[o.uuid]=r.parse(o)),i[o.uuid]=n[o.uuid]}}return i},parseAnimations:function(t){const e=[];for(let n=0;n<t.length;n++){const i=t[n],r=fd.parse(i);void 0!==i.uuid&&(r.uuid=i.uuid),e.push(r)}return e},parseImages:function(t,e){const n=this,i={};let r;function o(t){return n.manager.itemStart(t),r.load(t,function(){n.manager.itemEnd(t)},void 0,function(){n.manager.itemError(t),n.manager.itemEnd(t)})}if(void 0!==t&&t.length>0){const s=new yd(e);(r=new Ed(s)).setCrossOrigin(this.crossOrigin);for(let e=0,r=t.length;e<r;e++){const r=t[e],s=r.url;if(Array.isArray(s)){i[r.uuid]=[];for(let t=0,e=s.length;t<e;t++){const e=s[t],a=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(e)?e:n.resourcePath+e;i[r.uuid].push(o(a))}}else{const t=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(r.url)?r.url:n.resourcePath+r.url;i[r.uuid]=o(t)}}}return i},parseTextures:function(t,e){function n(t,e){return"number"==typeof t?t:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",t),e[t])}const i={};if(void 0!==t)for(let r=0,o=t.length;r<o;r++){const o=t[r];let s;void 0===o.image&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),void 0===e[o.image]&&console.warn("THREE.ObjectLoader: Undefined image",o.image),(s=Array.isArray(e[o.image])?new vc(e[o.image]):new zn(e[o.image])).needsUpdate=!0,s.uuid=o.uuid,void 0!==o.name&&(s.name=o.name),void 0!==o.mapping&&(s.mapping=n(o.mapping,Af)),void 0!==o.offset&&s.offset.fromArray(o.offset),void 0!==o.repeat&&s.repeat.fromArray(o.repeat),void 0!==o.center&&s.center.fromArray(o.center),void 0!==o.rotation&&(s.rotation=o.rotation),void 0!==o.wrap&&(s.wrapS=n(o.wrap[0],Lf),s.wrapT=n(o.wrap[1],Lf)),void 0!==o.format&&(s.format=o.format),void 0!==o.type&&(s.type=o.type),void 0!==o.encoding&&(s.encoding=o.encoding),void 0!==o.minFilter&&(s.minFilter=n(o.minFilter,Rf)),void 0!==o.magFilter&&(s.magFilter=n(o.magFilter,Rf)),void 0!==o.anisotropy&&(s.anisotropy=o.anisotropy),void 0!==o.flipY&&(s.flipY=o.flipY),void 0!==o.premultiplyAlpha&&(s.premultiplyAlpha=o.premultiplyAlpha),void 0!==o.unpackAlignment&&(s.unpackAlignment=o.unpackAlignment),i[o.uuid]=s}return i},parseObject:function(t,e,n){let i,r,o;function s(t){return void 0===e[t]&&console.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]}function a(t){if(void 0!==t){if(Array.isArray(t)){const e=[];for(let i=0,r=t.length;i<r;i++){const r=t[i];void 0===n[r]&&console.warn("THREE.ObjectLoader: Undefined material",r),e.push(n[r])}return e}return void 0===n[t]&&console.warn("THREE.ObjectLoader: Undefined material",t),n[t]}}switch(t.type){case"Scene":i=new _i,void 0!==t.background&&Number.isInteger(t.background)&&(i.background=new hr(t.background)),void 0!==t.fog&&("Fog"===t.fog.type?i.fog=new _h(t.fog.color,t.fog.near,t.fog.far):"FogExp2"===t.fog.type&&(i.fog=new xh(t.fog.color,t.fog.density)));break;case"PerspectiveCamera":i=new bo(t.fov,t.aspect,t.near,t.far),void 0!==t.focus&&(i.focus=t.focus),void 0!==t.zoom&&(i.zoom=t.zoom),void 0!==t.filmGauge&&(i.filmGauge=t.filmGauge),void 0!==t.filmOffset&&(i.filmOffset=t.filmOffset),void 0!==t.view&&(i.view=Object.assign({},t.view));break;case"OrthographicCamera":i=new df(t.left,t.right,t.top,t.bottom,t.near,t.far),void 0!==t.zoom&&(i.zoom=t.zoom),void 0!==t.view&&(i.view=Object.assign({},t.view));break;case"AmbientLight":i=new gf(t.color,t.intensity);break;case"DirectionalLight":i=new mf(t.color,t.intensity);break;case"PointLight":i=new pf(t.color,t.intensity,t.distance,t.decay);break;case"RectAreaLight":i=new vf(t.color,t.intensity,t.width,t.height);break;case"SpotLight":i=new hf(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);break;case"HemisphereLight":i=new af(t.color,t.groundColor,t.intensity);break;case"LightProbe":i=(new xf).fromJSON(t);break;case"SkinnedMesh":console.warn("THREE.ObjectLoader.parseObject() does not support SkinnedMesh yet.");case"Mesh":i=new io(r=s(t.geometry),o=a(t.material));break;case"InstancedMesh":r=s(t.geometry),o=a(t.material);const e=t.count,n=t.instanceMatrix;(i=new Kh(r,o,e)).instanceMatrix=new _r(new Float32Array(n.array),16);break;case"LOD":i=new kh;break;case"Line":i=new ou(s(t.geometry),a(t.material),t.mode);break;case"LineLoop":i=new lu(s(t.geometry),a(t.material));break;case"LineSegments":i=new cu(s(t.geometry),a(t.material));break;case"PointCloud":case"Points":i=new mu(s(t.geometry),a(t.material));break;case"Sprite":i=new Uh(a(t.material));break;case"Group":i=new dh;break;default:i=new xi}if(i.uuid=t.uuid,void 0!==t.name&&(i.name=t.name),void 0!==t.matrix?(i.matrix.fromArray(t.matrix),void 0!==t.matrixAutoUpdate&&(i.matrixAutoUpdate=t.matrixAutoUpdate),i.matrixAutoUpdate&&i.matrix.decompose(i.position,i.quaternion,i.scale)):(void 0!==t.position&&i.position.fromArray(t.position),void 0!==t.rotation&&i.rotation.fromArray(t.rotation),void 0!==t.quaternion&&i.quaternion.fromArray(t.quaternion),void 0!==t.scale&&i.scale.fromArray(t.scale)),void 0!==t.castShadow&&(i.castShadow=t.castShadow),void 0!==t.receiveShadow&&(i.receiveShadow=t.receiveShadow),t.shadow&&(void 0!==t.shadow.bias&&(i.shadow.bias=t.shadow.bias),void 0!==t.shadow.normalBias&&(i.shadow.normalBias=t.shadow.normalBias),void 0!==t.shadow.radius&&(i.shadow.radius=t.shadow.radius),void 0!==t.shadow.mapSize&&i.shadow.mapSize.fromArray(t.shadow.mapSize),void 0!==t.shadow.camera&&(i.shadow.camera=this.parseObject(t.shadow.camera))),void 0!==t.visible&&(i.visible=t.visible),void 0!==t.frustumCulled&&(i.frustumCulled=t.frustumCulled),void 0!==t.renderOrder&&(i.renderOrder=t.renderOrder),void 0!==t.userData&&(i.userData=t.userData),void 0!==t.layers&&(i.layers.mask=t.layers),void 0!==t.children){const r=t.children;for(let t=0;t<r.length;t++)i.add(this.parseObject(r[t],e,n))}if("LOD"===t.type){void 0!==t.autoUpdate&&(i.autoUpdate=t.autoUpdate);const e=t.levels;for(let t=0;t<e.length;t++){const n=e[t],r=i.getObjectByProperty("uuid",n.object);void 0!==r&&i.addLevel(r,n.distance)}}return i}});const Af={UVMapping:300,CubeReflectionMapping:nt,CubeRefractionMapping:it,EquirectangularReflectionMapping:rt,EquirectangularRefractionMapping:ot,CubeUVReflectionMapping:st,CubeUVRefractionMapping:at},Lf={RepeatWrapping:ct,ClampToEdgeWrapping:lt,MirroredRepeatWrapping:ht},Rf={NearestFilter:ut,NearestMipmapNearestFilter:pt,NearestMipmapLinearFilter:ft,LinearFilter:gt,LinearMipmapNearestFilter:vt,LinearMipmapLinearFilter:xt};function Cf(t){"undefined"==typeof createImageBitmap&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),"undefined"==typeof fetch&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),_d.call(this,t),this.options={premultiplyAlpha:"none"}}function Pf(){this.type="ShapePath",this.color=new hr,this.subPaths=[],this.currentPath=null}function Of(t){this.type="Font",this.data=t}function Df(t,e,n){const i=Array.from?Array.from(t):String(t).split(""),r=e/n.resolution,o=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*r,s=[];let a=0,c=0;for(let l=0;l<i.length;l++){const t=i[l];if("\n"===t)a=0,c-=o;else{const e=If(t,r,a,c,n);a+=e.offsetX,s.push(e.path)}}return s}function If(t,e,n,i,r){const o=r.glyphs[t]||r.glyphs["?"];if(!o)return void console.error('THREE.Font: character "'+t+'" does not exists in font family '+r.familyName+".");const s=new Pf;let a,c,l,h,u,p,d,f;if(o.o){const t=o._cachedOutline||(o._cachedOutline=o.o.split(" "));for(let r=0,o=t.length;r<o;){switch(t[r++]){case"m":a=t[r++]*e+n,c=t[r++]*e+i,s.moveTo(a,c);break;case"l":a=t[r++]*e+n,c=t[r++]*e+i,s.lineTo(a,c);break;case"q":l=t[r++]*e+n,h=t[r++]*e+i,u=t[r++]*e+n,p=t[r++]*e+i,s.quadraticCurveTo(u,p,l,h);break;case"b":l=t[r++]*e+n,h=t[r++]*e+i,u=t[r++]*e+n,p=t[r++]*e+i,d=t[r++]*e+n,f=t[r++]*e+i,s.bezierCurveTo(u,p,d,f,l,h)}}}return{offsetX:o.ha*e,path:s}}function Nf(t){_d.call(this,t)}let Bf;Cf.prototype=Object.assign(Object.create(_d.prototype),{constructor:Cf,isImageBitmapLoader:!0,setOptions:function(t){return this.options=t,this},load:function(t,e,n,i){void 0===t&&(t=""),void 0!==this.path&&(t=this.path+t),t=this.manager.resolveURL(t);const r=this,o=vd.get(t);if(void 0!==o)return r.manager.itemStart(t),setTimeout(function(){e&&e(o),r.manager.itemEnd(t)},0),o;fetch(t).then(function(t){return t.blob()}).then(function(t){return createImageBitmap(t,r.options)}).then(function(n){vd.add(t,n),e&&e(n),r.manager.itemEnd(t)}).catch(function(e){i&&i(e),r.manager.itemError(t),r.manager.itemEnd(t)}),r.manager.itemStart(t)}}),Object.assign(Pf.prototype,{moveTo:function(t,e){return this.currentPath=new rf,this.subPaths.push(this.currentPath),this.currentPath.moveTo(t,e),this},lineTo:function(t,e){return this.currentPath.lineTo(t,e),this},quadraticCurveTo:function(t,e,n,i){return this.currentPath.quadraticCurveTo(t,e,n,i),this},bezierCurveTo:function(t,e,n,i,r,o){return this.currentPath.bezierCurveTo(t,e,n,i,r,o),this},splineThru:function(t){return this.currentPath.splineThru(t),this},toShapes:function(t,e){function n(t){const e=[];for(let n=0,i=t.length;n<i;n++){const i=t[n],r=new of;r.curves=i.curves,e.push(r)}return e}function i(t,e){const n=e.length;let i=!1;for(let r=n-1,o=0;o<n;r=o++){let n=e[r],s=e[o],a=s.x-n.x,c=s.y-n.y;if(Math.abs(c)>Number.EPSILON){if(c<0&&(n=e[o],a=-a,s=e[r],c=-c),t.y<n.y||t.y>s.y)continue;if(t.y===n.y){if(t.x===n.x)return!0}else{const e=c*(t.x-n.x)-a*(t.y-n.y);if(0===e)return!0;if(e<0)continue;i=!i}}else{if(t.y!==n.y)continue;if(s.x<=t.x&&t.x<=n.x||n.x<=t.x&&t.x<=s.x)return!0}}return i}const r=yp.isClockWise,o=this.subPaths;if(0===o.length)return[];if(!0===e)return n(o);let s,a,c,l=[];if(1===o.length)return a=o[0],(c=new of).curves=a.curves,l.push(c),l;let h=!r(o[0].getPoints());h=t?!h:h;const u=[],p=[];let d,f,m=[],g=0;p[g]=void 0,m[g]=[];for(let v=0,y=o.length;v<y;v++)s=r(d=(a=o[v]).getPoints()),(s=t?!s:s)?(!h&&p[g]&&g++,p[g]={s:new of,p:d},p[g].s.curves=a.curves,h&&g++,m[g]=[]):m[g].push({h:a,p:d[0]});if(!p[0])return n(o);if(p.length>1){let t=!1;const e=[];for(let n=0,i=p.length;n<i;n++)u[n]=[];for(let n=0,r=p.length;n<r;n++){const r=m[n];for(let o=0;o<r.length;o++){const s=r[o];let a=!0;for(let r=0;r<p.length;r++)i(s.p,p[r].p)&&(n!==r&&e.push({froms:n,tos:r,hole:o}),a?(a=!1,u[r].push(s)):t=!0);a&&u[n].push(s)}}e.length>0&&(t||(m=u))}for(let v=0,y=p.length;v<y;v++){c=p[v].s,l.push(c);for(let t=0,e=(f=m[v]).length;t<e;t++)c.holes.push(f[t].h)}return l}}),Object.assign(Of.prototype,{isFont:!0,generateShapes:function(t,e){void 0===e&&(e=100);const n=[],i=Df(t,e,this.data);for(let r=0,o=i.length;r<o;r++)Array.prototype.push.apply(n,i[r].toShapes());return n}}),Nf.prototype=Object.assign(Object.create(_d.prototype),{constructor:Nf,load:function(t,e,n,i){const r=this,o=new wd(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.load(t,function(t){let n;try{n=JSON.parse(t)}catch(o){console.warn("THREE.FontLoader: typeface.js support is being deprecated. Use typeface.json instead."),n=JSON.parse(t.substring(65,t.length-2))}const i=r.parse(n);e&&e(i)},n,i)},parse:function(t){return new Of(t)}});const Ff={getContext:function(){return void 0===Bf&&(Bf=new(window.AudioContext||window.webkitAudioContext)),Bf},setContext:function(t){Bf=t}};function Uf(t){_d.call(this,t)}function Gf(t,e,n){xf.call(this,void 0,n);const i=(new hr).set(t),r=(new hr).set(e),o=new Xn(i.r,i.g,i.b),s=new Xn(r.r,r.g,r.b),a=Math.sqrt(Math.PI),c=a*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(s).multiplyScalar(a),this.sh.coefficients[1].copy(o).sub(s).multiplyScalar(c)}function zf(t,e){xf.call(this,void 0,e);const n=(new hr).set(t);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}exports.AudioContext=Ff,Uf.prototype=Object.assign(Object.create(_d.prototype),{constructor:Uf,load:function(t,e,n,i){const r=this,o=new wd(r.manager);o.setResponseType("arraybuffer"),o.setPath(r.path),o.setRequestHeader(r.requestHeader),o.load(t,function(n){try{const s=n.slice(0);Ff.getContext().decodeAudioData(s,function(t){e(t)})}catch(o){i?i(o):console.error(o),r.manager.itemError(t)}},n,i)}}),Gf.prototype=Object.assign(Object.create(xf.prototype),{constructor:Gf,isHemisphereLightProbe:!0,copy:function(t){return xf.prototype.copy.call(this,t),this},toJSON:function(t){return xf.prototype.toJSON.call(this,t)}}),zf.prototype=Object.assign(Object.create(xf.prototype),{constructor:zf,isAmbientLightProbe:!0,copy:function(t){return xf.prototype.copy.call(this,t),this},toJSON:function(t){return xf.prototype.toJSON.call(this,t)}});const Hf=new ei,kf=new ei;function Vf(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new bo,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new bo,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}function jf(t){this.autoStart=void 0===t||t,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}Object.assign(Vf.prototype,{update:function(t){const e=this._cache;if(e.focus!==t.focus||e.fov!==t.fov||e.aspect!==t.aspect*this.aspect||e.near!==t.near||e.far!==t.far||e.zoom!==t.zoom||e.eyeSep!==this.eyeSep){e.focus=t.focus,e.fov=t.fov,e.aspect=t.aspect*this.aspect,e.near=t.near,e.far=t.far,e.zoom=t.zoom,e.eyeSep=this.eyeSep;const n=t.projectionMatrix.clone(),i=e.eyeSep/2,r=i*e.near/e.focus,o=e.near*Math.tan(In.DEG2RAD*e.fov*.5)/e.zoom;let s,a;kf.elements[12]=-i,Hf.elements[12]=i,s=-o*e.aspect+r,a=o*e.aspect+r,n.elements[0]=2*e.near/(a-s),n.elements[8]=(a+s)/(a-s),this.cameraL.projectionMatrix.copy(n),s=-o*e.aspect-r,a=o*e.aspect-r,n.elements[0]=2*e.near/(a-s),n.elements[8]=(a+s)/(a-s),this.cameraR.projectionMatrix.copy(n)}this.cameraL.matrixWorld.copy(t.matrixWorld).multiply(kf),this.cameraR.matrixWorld.copy(t.matrixWorld).multiply(Hf)}}),Object.assign(jf.prototype,{start:function(){this.startTime=("undefined"==typeof performance?Date:performance).now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1,this.autoStart=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){let t=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const e=("undefined"==typeof performance?Date:performance).now();t=(e-this.oldTime)/1e3,this.oldTime=e,this.elapsedTime+=t}return t}});const Wf=new Xn,qf=new jn,Xf=new Xn,Yf=new Xn;function Zf(){xi.call(this),this.type="AudioListener",this.context=Ff.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new jf}function Jf(t){xi.call(this),this.type="Audio",this.listener=t,this.context=t.context,this.gain=this.context.createGain(),this.gain.connect(t.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.sourceType="empty",this._startedAt=0,this._progress=0,this.filters=[]}Zf.prototype=Object.assign(Object.create(xi.prototype),{constructor:Zf,getInput:function(){return this.gain},removeFilter:function(){return null!==this.filter&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this},getFilter:function(){return this.filter},setFilter:function(t){return null!==this.filter?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=t,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this},getMasterVolume:function(){return this.gain.gain.value},setMasterVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this},updateMatrixWorld:function(t){xi.prototype.updateMatrixWorld.call(this,t);const e=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Wf,qf,Xf),Yf.set(0,0,-1).applyQuaternion(qf),e.positionX){const t=this.context.currentTime+this.timeDelta;e.positionX.linearRampToValueAtTime(Wf.x,t),e.positionY.linearRampToValueAtTime(Wf.y,t),e.positionZ.linearRampToValueAtTime(Wf.z,t),e.forwardX.linearRampToValueAtTime(Yf.x,t),e.forwardY.linearRampToValueAtTime(Yf.y,t),e.forwardZ.linearRampToValueAtTime(Yf.z,t),e.upX.linearRampToValueAtTime(n.x,t),e.upY.linearRampToValueAtTime(n.y,t),e.upZ.linearRampToValueAtTime(n.z,t)}else e.setPosition(Wf.x,Wf.y,Wf.z),e.setOrientation(Yf.x,Yf.y,Yf.z,n.x,n.y,n.z)}}),Jf.prototype=Object.assign(Object.create(xi.prototype),{constructor:Jf,getOutput:function(){return this.gain},setNodeSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=t,this.connect(),this},setMediaElementSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(t),this.connect(),this},setMediaStreamSource:function(t){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(t),this.connect(),this},setBuffer:function(t){return this.buffer=t,this.sourceType="buffer",this.autoplay&&this.play(),this},play:function(t){if(void 0===t&&(t=0),!0===this.isPlaying)return void console.warn("THREE.Audio: Audio is already playing.");if(!1===this.hasPlaybackControl)return void console.warn("THREE.Audio: this Audio has no playback control.");this._startedAt=this.context.currentTime+t;const e=this.context.createBufferSource();return e.buffer=this.buffer,e.loop=this.loop,e.loopStart=this.loopStart,e.loopEnd=this.loopEnd,e.onended=this.onEnded.bind(this),e.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=e,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()},pause:function(){if(!1!==this.hasPlaybackControl)return!0===this.isPlaying&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,!0===this.loop&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this;console.warn("THREE.Audio: this Audio has no playback control.")},stop:function(){if(!1!==this.hasPlaybackControl)return this._progress=0,this.source.stop(),this.source.onended=null,this.isPlaying=!1,this;console.warn("THREE.Audio: this Audio has no playback control.")},connect:function(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].connect(this.filters[t]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this},disconnect:function(){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let t=1,e=this.filters.length;t<e;t++)this.filters[t-1].disconnect(this.filters[t]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this},getFilters:function(){return this.filters},setFilters:function(t){return t||(t=[]),!0===this.isPlaying?(this.disconnect(),this.filters=t,this.connect()):this.filters=t,this},setDetune:function(t){if(this.detune=t,void 0!==this.source.detune)return!0===this.isPlaying&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this},getDetune:function(){return this.detune},getFilter:function(){return this.getFilters()[0]},setFilter:function(t){return this.setFilters(t?[t]:[])},setPlaybackRate:function(t){if(!1!==this.hasPlaybackControl)return this.playbackRate=t,!0===this.isPlaying&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this;console.warn("THREE.Audio: this Audio has no playback control.")},getPlaybackRate:function(){return this.playbackRate},onEnded:function(){this.isPlaying=!1},getLoop:function(){return!1===this.hasPlaybackControl?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop},setLoop:function(t){if(!1!==this.hasPlaybackControl)return this.loop=t,!0===this.isPlaying&&(this.source.loop=this.loop),this;console.warn("THREE.Audio: this Audio has no playback control.")},setLoopStart:function(t){return this.loopStart=t,this},setLoopEnd:function(t){return this.loopEnd=t,this},getVolume:function(){return this.gain.gain.value},setVolume:function(t){return this.gain.gain.setTargetAtTime(t,this.context.currentTime,.01),this}});const Qf=new Xn,Kf=new jn,$f=new Xn,tm=new Xn;function em(t){Jf.call(this,t),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}function nm(t,e){this.analyser=t.context.createAnalyser(),this.analyser.fftSize=void 0!==e?e:2048,this.data=new Uint8Array(this.analyser.frequencyBinCount),t.getOutput().connect(this.analyser)}function im(t,e,n){let i,r,o;switch(this.binding=t,this.valueSize=n,e){case"quaternion":i=this._slerp,r=this._slerpAdditive,o=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(6*n),this._workIndex=5;break;case"string":case"bool":i=this._select,r=this._select,o=this._setAdditiveIdentityOther,this.buffer=new Array(5*n);break;default:i=this._lerp,r=this._lerpAdditive,o=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(5*n)}this._mixBufferRegion=i,this._mixBufferRegionAdditive=r,this._setIdentity=o,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}em.prototype=Object.assign(Object.create(Jf.prototype),{constructor:em,getOutput:function(){return this.panner},getRefDistance:function(){return this.panner.refDistance},setRefDistance:function(t){return this.panner.refDistance=t,this},getRolloffFactor:function(){return this.panner.rolloffFactor},setRolloffFactor:function(t){return this.panner.rolloffFactor=t,this},getDistanceModel:function(){return this.panner.distanceModel},setDistanceModel:function(t){return this.panner.distanceModel=t,this},getMaxDistance:function(){return this.panner.maxDistance},setMaxDistance:function(t){return this.panner.maxDistance=t,this},setDirectionalCone:function(t,e,n){return this.panner.coneInnerAngle=t,this.panner.coneOuterAngle=e,this.panner.coneOuterGain=n,this},updateMatrixWorld:function(t){if(xi.prototype.updateMatrixWorld.call(this,t),!0===this.hasPlaybackControl&&!1===this.isPlaying)return;this.matrixWorld.decompose(Qf,Kf,$f),tm.set(0,0,1).applyQuaternion(Kf);const e=this.panner;if(e.positionX){const t=this.context.currentTime+this.listener.timeDelta;e.positionX.linearRampToValueAtTime(Qf.x,t),e.positionY.linearRampToValueAtTime(Qf.y,t),e.positionZ.linearRampToValueAtTime(Qf.z,t),e.orientationX.linearRampToValueAtTime(tm.x,t),e.orientationY.linearRampToValueAtTime(tm.y,t),e.orientationZ.linearRampToValueAtTime(tm.z,t)}else e.setPosition(Qf.x,Qf.y,Qf.z),e.setOrientation(tm.x,tm.y,tm.z)}}),Object.assign(nm.prototype,{getFrequencyData:function(){return this.analyser.getByteFrequencyData(this.data),this.data},getAverageFrequency:function(){let t=0;const e=this.getFrequencyData();for(let n=0;n<e.length;n++)t+=e[n];return t/e.length}}),Object.assign(im.prototype,{accumulate:function(t,e){const n=this.buffer,i=this.valueSize,r=t*i+i;let o=this.cumulativeWeight;if(0===o){for(let t=0;t!==i;++t)n[r+t]=n[t];o=e}else{const t=e/(o+=e);this._mixBufferRegion(n,r,0,t,i)}this.cumulativeWeight=o},accumulateAdditive:function(t){const e=this.buffer,n=this.valueSize,i=n*this._addIndex;0===this.cumulativeWeightAdditive&&this._setIdentity(),this._mixBufferRegionAdditive(e,i,0,t,n),this.cumulativeWeightAdditive+=t},apply:function(t){const e=this.valueSize,n=this.buffer,i=t*e+e,r=this.cumulativeWeight,o=this.cumulativeWeightAdditive,s=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,r<1){const t=e*this._origIndex;this._mixBufferRegion(n,i,t,1-r,e)}o>0&&this._mixBufferRegionAdditive(n,i,this._addIndex*e,1,e);for(let a=e,c=e+e;a!==c;++a)if(n[a]!==n[a+e]){s.setValue(n,i);break}},saveOriginalState:function(){const t=this.binding,e=this.buffer,n=this.valueSize,i=n*this._origIndex;t.getValue(e,i);for(let r=n,o=i;r!==o;++r)e[r]=e[i+r%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0},restoreOriginalState:function(){const t=3*this.valueSize;this.binding.setValue(this.buffer,t)},_setAdditiveIdentityNumeric:function(){const t=this._addIndex*this.valueSize,e=t+this.valueSize;for(let n=t;n<e;n++)this.buffer[n]=0},_setAdditiveIdentityQuaternion:function(){this._setAdditiveIdentityNumeric(),this.buffer[4*this._addIndex+3]=1},_setAdditiveIdentityOther:function(){const t=this._origIndex*this.valueSize,e=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[e+n]=this.buffer[t+n]},_select:function(t,e,n,i,r){if(i>=.5)for(let o=0;o!==r;++o)t[e+o]=t[n+o]},_slerp:function(t,e,n,i){jn.slerpFlat(t,e,t,e,t,n,i)},_slerpAdditive:function(t,e,n,i,r){const o=this._workIndex*r;jn.multiplyQuaternionsFlat(t,o,t,e,t,n),jn.slerpFlat(t,e,t,e,t,o,i)},_lerp:function(t,e,n,i,r){const o=1-i;for(let s=0;s!==r;++s){const r=e+s;t[r]=t[r]*o+t[n+s]*i}},_lerpAdditive:function(t,e,n,i,r){for(let o=0;o!==r;++o){const r=e+o;t[r]=t[r]+t[n+o]*i}}});const rm="\\[\\]\\.:\\/",om=new RegExp("[\\[\\]\\.:\\/]","g"),sm="[^\\[\\]\\.:\\/]",am="[^"+"\\[\\]\\.:\\/".replace("\\.","")+"]",cm=/((?:WC+[\/:])*)/.source.replace("WC",sm),lm=/(WCOD+)?/.source.replace("WCOD",am),hm=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",sm),um=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",sm),pm=new RegExp("^"+cm+lm+hm+um+"$"),dm=["material","materials","bones"];function fm(t,e,n){const i=n||mm.parseTrackName(e);this._targetGroup=t,this._bindings=t.subscribe_(e,i)}function mm(t,e,n){this.path=e,this.parsedPath=n||mm.parseTrackName(e),this.node=mm.findNode(t,this.parsedPath.nodeName)||t,this.rootNode=t}function gm(){this.uuid=In.generateUUID(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const t={};this._indicesByUUID=t;for(let n=0,i=arguments.length;n!==i;++n)t[arguments[n].uuid]=n;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const e=this;this.stats={objects:{get total(){return e._objects.length},get inUse(){return this.total-e.nCachedObjects_}},get bindingsPerObject(){return e._bindings.length}}}function vm(t,e,n,i){this._mixer=t,this._clip=e,this._localRoot=n||null,this.blendMode=i||e.blendMode;const r=e.tracks,o=r.length,s=new Array(o),a={endingStart:Ge,endingEnd:Ge};for(let c=0;c!==o;++c){const t=r[c].createInterpolant(null);s[c]=t,t.settings=a}this._interpolantSettings=a,this._interpolants=s,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=Ie,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 ym(t){this._root=t,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}function xm(t){"string"==typeof t&&(console.warn("THREE.Uniform: Type parameter is no longer needed."),t=arguments[1]),this.value=t}function _m(t,e,n){bh.call(this,t,e),this.meshPerAttribute=n||1}function bm(t,e,n,i){this.ray=new Wi(t,e),this.near=n||0,this.far=i||1/0,this.camera=null,this.layers=new oi,this.params={Mesh:{},Line:{threshold:1},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 wm(t,e){return t.distance-e.distance}function Mm(t,e,n,i){if(t.layers.test(e.layers)&&t.raycast(e,n),!0===i){const i=t.children;for(let t=0,r=i.length;t<r;t++)Mm(i[t],e,n,!0)}}Object.assign(fm.prototype,{getValue:function(t,e){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];void 0!==i&&i.getValue(t,e)},setValue:function(t,e){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,r=n.length;i!==r;++i)n[i].setValue(t,e)},bind:function(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].bind()},unbind:function(){const t=this._bindings;for(let e=this._targetGroup.nCachedObjects_,n=t.length;e!==n;++e)t[e].unbind()}}),Object.assign(mm,{Composite:fm,create:function(t,e,n){return t&&t.isAnimationObjectGroup?new mm.Composite(t,e,n):new mm(t,e,n)},sanitizeNodeName:function(t){return t.replace(/\s/g,"_").replace(om,"")},parseTrackName:function(t){const e=pm.exec(t);if(!e)throw new Error("PropertyBinding: Cannot parse trackName: "+t);const n={nodeName:e[2],objectName:e[3],objectIndex:e[4],propertyName:e[5],propertyIndex:e[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(void 0!==i&&-1!==i){const t=n.nodeName.substring(i+1);-1!==dm.indexOf(t)&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=t)}if(null===n.propertyName||0===n.propertyName.length)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+t);return n},findNode:function(t,e){if(!e||""===e||"."===e||-1===e||e===t.name||e===t.uuid)return t;if(t.skeleton){const n=t.skeleton.getBoneByName(e);if(void 0!==n)return n}if(t.children){const n=function(t){for(let i=0;i<t.length;i++){const r=t[i];if(r.name===e||r.uuid===e)return r;const o=n(r.children);if(o)return o}return null},i=n(t.children);if(i)return i}return null}}),Object.assign(mm.prototype,{_getValue_unavailable:function(){},_setValue_unavailable:function(){},BindingType:{Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3},Versioning:{None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2},GetterByBindingType:[function(t,e){t[e]=this.node[this.propertyName]},function(t,e){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)t[e++]=n[i]},function(t,e){t[e]=this.resolvedProperty[this.propertyIndex]},function(t,e){this.resolvedProperty.toArray(t,e)}],SetterByBindingTypeAndVersioning:[[function(t,e){this.targetObject[this.propertyName]=t[e]},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.targetObject[this.propertyName]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=t[e++]},function(t,e){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.needsUpdate=!0},function(t,e){const n=this.resolvedProperty;for(let i=0,r=n.length;i!==r;++i)n[i]=t[e++];this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty[this.propertyIndex]=t[e]},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty[this.propertyIndex]=t[e],this.targetObject.matrixWorldNeedsUpdate=!0}],[function(t,e){this.resolvedProperty.fromArray(t,e)},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.needsUpdate=!0},function(t,e){this.resolvedProperty.fromArray(t,e),this.targetObject.matrixWorldNeedsUpdate=!0}]],getValue:function(t,e){this.bind(),this.getValue(t,e)},setValue:function(t,e){this.bind(),this.setValue(t,e)},bind:function(){let t=this.node,e=this.parsedPath,n=e.objectName,i=e.propertyName,r=e.propertyIndex;if(t||(t=mm.findNode(this.rootNode,e.nodeName)||this.rootNode,this.node=t),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!t)return void console.error("THREE.PropertyBinding: Trying to update node for track: "+this.path+" but it wasn't found.");if(n){let i=e.objectIndex;switch(n){case"materials":if(!t.material)return void console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);if(!t.material.materials)return void console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);t=t.material.materials;break;case"bones":if(!t.skeleton)return void console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);t=t.skeleton.bones;for(let e=0;e<t.length;e++)if(t[e].name===i){i=e;break}break;default:if(void 0===t[n])return void console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);t=t[n]}if(void 0!==i){if(void 0===t[i])return void console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,t);t=t[i]}}const o=t[i];if(void 0===o){const n=e.nodeName;return void console.error("THREE.PropertyBinding: Trying to update property for track: "+n+"."+i+" but it wasn't found.",t)}let s=this.Versioning.None;this.targetObject=t,void 0!==t.needsUpdate?s=this.Versioning.NeedsUpdate:void 0!==t.matrixWorldNeedsUpdate&&(s=this.Versioning.MatrixWorldNeedsUpdate);let a=this.BindingType.Direct;if(void 0!==r){if("morphTargetInfluences"===i){if(!t.geometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);if(!t.geometry.isBufferGeometry)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.",this);if(!t.geometry.morphAttributes)return void console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);void 0!==t.morphTargetDictionary[r]&&(r=t.morphTargetDictionary[r])}a=this.BindingType.ArrayElement,this.resolvedProperty=o,this.propertyIndex=r}else void 0!==o.fromArray&&void 0!==o.toArray?(a=this.BindingType.HasFromToArray,this.resolvedProperty=o):Array.isArray(o)?(a=this.BindingType.EntireArray,this.resolvedProperty=o):this.propertyName=i;this.getValue=this.GetterByBindingType[a],this.setValue=this.SetterByBindingTypeAndVersioning[a][s]},unbind:function(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}),Object.assign(mm.prototype,{_getValue_unbound:mm.prototype.getValue,_setValue_unbound:mm.prototype.setValue}),Object.assign(gm.prototype,{isAnimationObjectGroup:!0,add:function(){const t=this._objects,e=this._indicesByUUID,n=this._paths,i=this._parsedPaths,r=this._bindings,o=r.length;let s=void 0,a=t.length,c=this.nCachedObjects_;for(let l=0,h=arguments.length;l!==h;++l){const h=arguments[l],u=h.uuid;let p=e[u];if(void 0===p){p=a++,e[u]=p,t.push(h);for(let t=0,e=o;t!==e;++t)r[t].push(new mm(h,n[t],i[t]))}else if(p<c){s=t[p];const a=--c,l=t[a];e[l.uuid]=p,t[p]=l,e[u]=a,t[a]=h;for(let t=0,e=o;t!==e;++t){const e=r[t],o=e[a];let s=e[p];e[p]=o,void 0===s&&(s=new mm(h,n[t],i[t])),e[a]=s}}else t[p]!==s&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=c},remove:function(){const t=this._objects,e=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_;for(let o=0,s=arguments.length;o!==s;++o){const s=arguments[o],a=s.uuid,c=e[a];if(void 0!==c&&c>=r){const o=r++,l=t[o];e[l.uuid]=c,t[c]=l,e[a]=o,t[o]=s;for(let t=0,e=i;t!==e;++t){const e=n[t],i=e[o],r=e[c];e[c]=i,e[o]=r}}}this.nCachedObjects_=r},uncache:function(){const t=this._objects,e=this._indicesByUUID,n=this._bindings,i=n.length;let r=this.nCachedObjects_,o=t.length;for(let s=0,a=arguments.length;s!==a;++s){const a=arguments[s].uuid,c=e[a];if(void 0!==c)if(delete e[a],c<r){const s=--r,a=t[s],l=--o,h=t[l];e[a.uuid]=c,t[c]=a,e[h.uuid]=s,t[s]=h,t.pop();for(let t=0,e=i;t!==e;++t){const e=n[t],i=e[s],r=e[l];e[c]=i,e[s]=r,e.pop()}}else{const r=--o,s=t[r];e[s.uuid]=c,t[c]=s,t.pop();for(let t=0,e=i;t!==e;++t){const e=n[t];e[c]=e[r],e.pop()}}}this.nCachedObjects_=r},subscribe_:function(t,e){let n=this._bindingsIndicesByPath,i=n[t],r=this._bindings;if(void 0!==i)return r[i];const o=this._paths,s=this._parsedPaths,a=this._objects,c=a.length,l=this.nCachedObjects_,h=new Array(c);i=r.length,n[t]=i,o.push(t),s.push(e),r.push(h);for(let u=l,p=a.length;u!==p;++u){const n=a[u];h[u]=new mm(n,t,e)}return h},unsubscribe_:function(t){const e=this._bindingsIndicesByPath,n=e[t];if(void 0!==n){const i=this._paths,r=this._parsedPaths,o=this._bindings,s=o.length-1,a=o[s];e[t[s]]=n,o[n]=a,o.pop(),r[n]=r[s],r.pop(),i[n]=i[s],i.pop()}}}),Object.assign(vm.prototype,{play:function(){return this._mixer._activateAction(this),this},stop:function(){return this._mixer._deactivateAction(this),this.reset()},reset:function(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()},isRunning:function(){return this.enabled&&!this.paused&&0!==this.timeScale&&null===this._startTime&&this._mixer._isActiveAction(this)},isScheduled:function(){return this._mixer._isActiveAction(this)},startAt:function(t){return this._startTime=t,this},setLoop:function(t,e){return this.loop=t,this.repetitions=e,this},setEffectiveWeight:function(t){return this.weight=t,this._effectiveWeight=this.enabled?t:0,this.stopFading()},getEffectiveWeight:function(){return this._effectiveWeight},fadeIn:function(t){return this._scheduleFading(t,0,1)},fadeOut:function(t){return this._scheduleFading(t,1,0)},crossFadeFrom:function(t,e,n){if(t.fadeOut(e),this.fadeIn(e),n){const n=this._clip.duration,i=t._clip.duration,r=i/n,o=n/i;t.warp(1,r,e),this.warp(o,1,e)}return this},crossFadeTo:function(t,e,n){return t.crossFadeFrom(this,e,n)},stopFading:function(){let t=this._weightInterpolant;return null!==t&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},setEffectiveTimeScale:function(t){return this.timeScale=t,this._effectiveTimeScale=this.paused?0:t,this.stopWarping()},getEffectiveTimeScale:function(){return this._effectiveTimeScale},setDuration:function(t){return this.timeScale=this._clip.duration/t,this.stopWarping()},syncWith:function(t){return this.time=t.time,this.timeScale=t.timeScale,this.stopWarping()},halt:function(t){return this.warp(this._effectiveTimeScale,0,t)},warp:function(t,e,n){const i=this._mixer,r=i.time,o=this.timeScale;let s=this._timeScaleInterpolant;null===s&&(s=i._lendControlInterpolant(),this._timeScaleInterpolant=s);const a=s.parameterPositions,c=s.sampleValues;return a[0]=r,a[1]=r+n,c[0]=t/o,c[1]=e/o,this},stopWarping:function(){let t=this._timeScaleInterpolant;return null!==t&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(t)),this},getMixer:function(){return this._mixer},getClip:function(){return this._clip},getRoot:function(){return this._localRoot||this._mixer._root},_update:function(t,e,n,i){if(!this.enabled)return void this._updateWeight(t);const r=this._startTime;if(null!==r){const i=(t-r)*n;if(i<0||0===n)return;this._startTime=null,e=n*i}e*=this._updateTimeScale(t);const o=this._updateTime(e),s=this._updateWeight(t);if(s>0){const t=this._interpolants,e=this._propertyBindings;switch(this.blendMode){case 2501:for(let n=0,i=t.length;n!==i;++n)t[n].evaluate(o),e[n].accumulateAdditive(s);break;case ke:default:for(let n=0,r=t.length;n!==r;++n)t[n].evaluate(o),e[n].accumulate(i,s)}}},_updateWeight:function(t){let e=0;if(this.enabled){e=this.weight;const n=this._weightInterpolant;if(null!==n){const i=n.evaluate(t)[0];e*=i,t>n.parameterPositions[1]&&(this.stopFading(),0===i&&(this.enabled=!1))}}return this._effectiveWeight=e,e},_updateTimeScale:function(t){let e=0;if(!this.paused){e=this.timeScale;const n=this._timeScaleInterpolant;if(null!==n){e*=n.evaluate(t)[0],t>n.parameterPositions[1]&&(this.stopWarping(),0===e?this.paused=!0:this.timeScale=e)}}return this._effectiveTimeScale=e,e},_updateTime:function(t){const e=this._clip.duration,n=this.loop;let i=this.time+t,r=this._loopCount;const o=2202===n;if(0===t)return-1===r?i:o&&1==(1&r)?e-i:i;if(2200===n){-1===r&&(this._loopCount=0,this._setEndings(!0,!0,!1));t:{if(i>=e)i=e;else{if(!(i<0)){this.time=i;break t}i=0}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t<0?-1:1})}}else{if(-1===r&&(t>=0?(r=0,this._setEndings(!0,0===this.repetitions,o)):this._setEndings(0===this.repetitions,!0,o)),i>=e||i<0){const n=Math.floor(i/e);i-=e*n,r+=Math.abs(n);const s=this.repetitions-r;if(s<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=t>0?e:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:t>0?1:-1});else{if(1===s){const e=t<0;this._setEndings(e,!e,o)}else this._setEndings(!1,!1,o);this._loopCount=r,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:n})}}else this.time=i;if(o&&1==(1&r))return e-i}return i},_setEndings:function(t,e,n){const i=this._interpolantSettings;n?(i.endingStart=2401,i.endingEnd=2401):(i.endingStart=t?this.zeroSlopeAtStart?2401:Ge:2402,i.endingEnd=e?this.zeroSlopeAtEnd?2401:Ge:2402)},_scheduleFading:function(t,e,n){const i=this._mixer,r=i.time;let o=this._weightInterpolant;null===o&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);const s=o.parameterPositions,a=o.sampleValues;return s[0]=r,a[0]=e,s[1]=r+t,a[1]=n,this}}),ym.prototype=Object.assign(Object.create(Pn.prototype),{constructor:ym,_bindAction:function(t,e){const n=t._localRoot||this._root,i=t._clip.tracks,r=i.length,o=t._propertyBindings,s=t._interpolants,a=n.uuid,c=this._bindingsByRootAndName;let l=c[a];void 0===l&&(l={},c[a]=l);for(let h=0;h!==r;++h){const t=i[h],r=t.name;let c=l[r];if(void 0!==c)o[h]=c;else{if(void 0!==(c=o[h])){null===c._cacheIndex&&(++c.referenceCount,this._addInactiveBinding(c,a,r));continue}const i=e&&e._propertyBindings[h].binding.parsedPath;++(c=new im(mm.create(n,r,i),t.ValueTypeName,t.getValueSize())).referenceCount,this._addInactiveBinding(c,a,r),o[h]=c}s[h].resultBuffer=c.buffer}},_activateAction:function(t){if(!this._isActiveAction(t)){if(null===t._cacheIndex){const e=(t._localRoot||this._root).uuid,n=t._clip.uuid,i=this._actionsByClip[n];this._bindAction(t,i&&i.knownActions[0]),this._addInactiveAction(t,n,e)}const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0==n.useCount++&&(this._lendBinding(n),n.saveOriginalState())}this._lendAction(t)}},_deactivateAction:function(t){if(this._isActiveAction(t)){const e=t._propertyBindings;for(let t=0,n=e.length;t!==n;++t){const n=e[t];0==--n.useCount&&(n.restoreOriginalState(),this._takeBackBinding(n))}this._takeBackAction(t)}},_initMemoryManager:function(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const t=this;this.stats={actions:{get total(){return t._actions.length},get inUse(){return t._nActiveActions}},bindings:{get total(){return t._bindings.length},get inUse(){return t._nActiveBindings}},controlInterpolants:{get total(){return t._controlInterpolants.length},get inUse(){return t._nActiveControlInterpolants}}}},_isActiveAction:function(t){const e=t._cacheIndex;return null!==e&&e<this._nActiveActions},_addInactiveAction:function(t,e,n){const i=this._actions,r=this._actionsByClip;let o=r[e];if(void 0===o)o={knownActions:[t],actionByRoot:{}},t._byClipCacheIndex=0,r[e]=o;else{const e=o.knownActions;t._byClipCacheIndex=e.length,e.push(t)}t._cacheIndex=i.length,i.push(t),o.actionByRoot[n]=t},_removeInactiveAction:function(t){const e=this._actions,n=e[e.length-1],i=t._cacheIndex;n._cacheIndex=i,e[i]=n,e.pop(),t._cacheIndex=null;const r=t._clip.uuid,o=this._actionsByClip,s=o[r],a=s.knownActions,c=a[a.length-1],l=t._byClipCacheIndex;c._byClipCacheIndex=l,a[l]=c,a.pop(),t._byClipCacheIndex=null,delete s.actionByRoot[(t._localRoot||this._root).uuid],0===a.length&&delete o[r],this._removeInactiveBindingsForAction(t)},_removeInactiveBindingsForAction:function(t){const e=t._propertyBindings;for(let n=0,i=e.length;n!==i;++n){const t=e[n];0==--t.referenceCount&&this._removeInactiveBinding(t)}},_lendAction:function(t){const e=this._actions,n=t._cacheIndex,i=this._nActiveActions++,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_takeBackAction:function(t){const e=this._actions,n=t._cacheIndex,i=--this._nActiveActions,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_addInactiveBinding:function(t,e,n){const i=this._bindingsByRootAndName,r=this._bindings;let o=i[e];void 0===o&&(o={},i[e]=o),o[n]=t,t._cacheIndex=r.length,r.push(t)},_removeInactiveBinding:function(t){const e=this._bindings,n=t.binding,i=n.rootNode.uuid,r=n.path,o=this._bindingsByRootAndName,s=o[i],a=e[e.length-1],c=t._cacheIndex;a._cacheIndex=c,e[c]=a,e.pop(),delete s[r],0===Object.keys(s).length&&delete o[i]},_lendBinding:function(t){const e=this._bindings,n=t._cacheIndex,i=this._nActiveBindings++,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_takeBackBinding:function(t){const e=this._bindings,n=t._cacheIndex,i=--this._nActiveBindings,r=e[i];t._cacheIndex=i,e[i]=t,r._cacheIndex=n,e[n]=r},_lendControlInterpolant:function(){const t=this._controlInterpolants,e=this._nActiveControlInterpolants++;let n=t[e];return void 0===n&&((n=new rd(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer)).__cacheIndex=e,t[e]=n),n},_takeBackControlInterpolant:function(t){const e=this._controlInterpolants,n=t.__cacheIndex,i=--this._nActiveControlInterpolants,r=e[i];t.__cacheIndex=i,e[i]=t,r.__cacheIndex=n,e[n]=r},_controlInterpolantsResultBuffer:new Float32Array(1),clipAction:function(t,e,n){const i=e||this._root,r=i.uuid;let o="string"==typeof t?fd.findByName(i,t):t;const s=null!==o?o.uuid:t;let a=this._actionsByClip[s],c=null;if(void 0===n&&(n=null!==o?o.blendMode:ke),void 0!==a){const t=a.actionByRoot[r];if(void 0!==t&&t.blendMode===n)return t;c=a.knownActions[0],null===o&&(o=c._clip)}if(null===o)return null;const l=new vm(this,o,e,n);return this._bindAction(l,c),this._addInactiveAction(l,s,r),l},existingAction:function(t,e){const n=e||this._root,i=n.uuid,r="string"==typeof t?fd.findByName(n,t):t,o=r?r.uuid:t,s=this._actionsByClip[o];return void 0!==s&&s.actionByRoot[i]||null},stopAllAction:function(){const t=this._actions;for(let e=this._nActiveActions-1;e>=0;--e)t[e].stop();return this},update:function(t){t*=this.timeScale;const e=this._actions,n=this._nActiveActions,i=this.time+=t,r=Math.sign(t),o=this._accuIndex^=1;for(let c=0;c!==n;++c){e[c]._update(i,t,r,o)}const s=this._bindings,a=this._nActiveBindings;for(let c=0;c!==a;++c)s[c].apply(o);return this},setTime:function(t){this.time=0;for(let e=0;e<this._actions.length;e++)this._actions[e].time=0;return this.update(t)},getRoot:function(){return this._root},uncacheClip:function(t){const e=this._actions,n=t.uuid,i=this._actionsByClip,r=i[n];if(void 0!==r){const t=r.knownActions;for(let n=0,i=t.length;n!==i;++n){const i=t[n];this._deactivateAction(i);const r=i._cacheIndex,o=e[e.length-1];i._cacheIndex=null,i._byClipCacheIndex=null,o._cacheIndex=r,e[r]=o,e.pop(),this._removeInactiveBindingsForAction(i)}delete i[n]}},uncacheRoot:function(t){const e=t.uuid,n=this._actionsByClip;for(const r in n){const t=n[r].actionByRoot[e];void 0!==t&&(this._deactivateAction(t),this._removeInactiveAction(t))}const i=this._bindingsByRootAndName[e];if(void 0!==i)for(const r in i){const t=i[r];t.restoreOriginalState(),this._removeInactiveBinding(t)}},uncacheAction:function(t,e){const n=this.existingAction(t,e);null!==n&&(this._deactivateAction(n),this._removeInactiveAction(n))}}),xm.prototype.clone=function(){return new xm(void 0===this.value.clone?this.value:this.value.clone())},_m.prototype=Object.assign(Object.create(bh.prototype),{constructor:_m,isInstancedInterleavedBuffer:!0,copy:function(t){return bh.prototype.copy.call(this,t),this.meshPerAttribute=t.meshPerAttribute,this},clone:function(t){const e=bh.prototype.clone.call(this,t);return e.meshPerAttribute=this.meshPerAttribute,e},toJSON:function(t){const e=bh.prototype.toJSON.call(this,t);return e.isInstancedInterleavedBuffer=!0,e.meshPerAttribute=this.meshPerAttribute,e}}),Object.assign(bm.prototype,{set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e&&e.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(this.ray.origin).normalize(),this.camera=e):e&&e.isOrthographicCamera?(this.ray.origin.set(t.x,t.y,(e.near+e.far)/(e.near-e.far)).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld),this.camera=e):console.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,e,n){const i=n||[];return Mm(t,this,i,e),i.sort(wm),i},intersectObjects:function(t,e,n){const i=n||[];if(!1===Array.isArray(t))return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(let r=0,o=t.length;r<o;r++)Mm(t[r],this,i,e);return i.sort(wm),i}});class Sm{constructor(t=1,e=0,n=0){return this.radius=t,this.phi=e,this.theta=n,this}set(t,e,n){return this.radius=t,this.phi=e,this.theta=n,this}clone(){return(new this.constructor).copy(this)}copy(t){return this.radius=t.radius,this.phi=t.phi,this.theta=t.theta,this}makeSafe(){return this.phi=Math.max(1e-6,Math.min(Math.PI-1e-6,this.phi)),this}setFromVector3(t){return this.setFromCartesianCoords(t.x,t.y,t.z)}setFromCartesianCoords(t,e,n){return this.radius=Math.sqrt(t*t+e*e+n*n),0===this.radius?(this.theta=0,this.phi=0):(this.theta=Math.atan2(t,n),this.phi=Math.acos(In.clamp(e/this.radius,-1,1))),this}}function Tm(t,e,n){return this.radius=void 0!==t?t:1,this.theta=void 0!==e?e:0,this.y=void 0!==n?n:0,this}exports.Spherical=Sm,Object.assign(Tm.prototype,{set:function(t,e,n){return this.radius=t,this.theta=e,this.y=n,this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.radius=t.radius,this.theta=t.theta,this.y=t.y,this},setFromVector3:function(t){return this.setFromCartesianCoords(t.x,t.y,t.z)},setFromCartesianCoords:function(t,e,n){return this.radius=Math.sqrt(t*t+n*n),this.theta=Math.atan2(t,n),this.y=e,this}});const Em=new Nn;function Am(t,e){this.min=void 0!==t?t:new Nn(1/0,1/0),this.max=void 0!==e?e:new Nn(-1/0,-1/0)}Object.assign(Am.prototype,{set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(let e=0,n=t.length;e<n;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(t,e){const n=Em.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(n),this.max.copy(t).add(n),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},getCenter:function(t){return void 0===t&&(console.warn("THREE.Box2: .getCenter() target is now required"),t=new Nn),this.isEmpty()?t.set(0,0):t.addVectors(this.min,this.max).multiplyScalar(.5)},getSize:function(t){return void 0===t&&(console.warn("THREE.Box2: .getSize() target is now required"),t=new Nn),this.isEmpty()?t.set(0,0):t.subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .getParameter() target is now required"),e=new Nn),e.set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,e){return void 0===e&&(console.warn("THREE.Box2: .clampPoint() target is now required"),e=new Nn),e.copy(t).clamp(this.min,this.max)},distanceToPoint:function(t){return Em.copy(t).clamp(this.min,this.max).sub(t).length()},intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)}});const Lm=new Xn,Rm=new Xn;function Cm(t,e){this.start=void 0!==t?t:new Xn,this.end=void 0!==e?e:new Xn}function Pm(t){xi.call(this),this.material=t,this.render=function(){},this.hasPositions=!1,this.hasNormals=!1,this.hasColors=!1,this.hasUvs=!1,this.positionArray=null,this.normalArray=null,this.colorArray=null,this.uvArray=null,this.count=0}Object.assign(Cm.prototype,{set:function(t,e){return this.start.copy(t),this.end.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},getCenter:function(t){return void 0===t&&(console.warn("THREE.Line3: .getCenter() target is now required"),t=new Xn),t.addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return void 0===t&&(console.warn("THREE.Line3: .delta() target is now required"),t=new Xn),t.subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){return void 0===e&&(console.warn("THREE.Line3: .at() target is now required"),e=new Xn),this.delta(e).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(t,e){Lm.subVectors(t,this.start),Rm.subVectors(this.end,this.start);const n=Rm.dot(Rm);let i=Rm.dot(Lm)/n;return e&&(i=In.clamp(i,0,1)),i},closestPointToPoint:function(t,e,n){const i=this.closestPointToPointParameter(t,e);return void 0===n&&(console.warn("THREE.Line3: .closestPointToPoint() target is now required"),n=new Xn),this.delta(n).multiplyScalar(i).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)}}),Pm.prototype=Object.create(xi.prototype),Pm.prototype.constructor=Pm,Pm.prototype.isImmediateRenderObject=!0;const Om=new Xn;function Dm(t,e){xi.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=e;const n=new Gr,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,s=1,a=32;o<a;o++,s++){const t=o/a*Math.PI*2,e=s/a*Math.PI*2;i.push(Math.cos(t),Math.sin(t),1,Math.cos(e),Math.sin(e),1)}n.setAttribute("position",new Lr(i,3));const r=new $h({fog:!1,toneMapped:!1});this.cone=new cu(n,r),this.add(this.cone),this.update()}Dm.prototype=Object.create(xi.prototype),Dm.prototype.constructor=Dm,Dm.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},Dm.prototype.update=function(){this.light.updateMatrixWorld();const t=this.light.distance?this.light.distance:1e3,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),Om.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(Om),void 0!==this.color?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)};const Im=new Xn,Nm=new ei,Bm=new ei;function Fm(t){const e=[];t&&t.isBone&&e.push(t);for(let n=0;n<t.children.length;n++)e.push.apply(e,Fm(t.children[n]));return e}function Um(t){const e=Fm(t),n=new Gr,i=[],r=[],o=new hr(0,0,1),s=new hr(0,1,0);for(let c=0;c<e.length;c++){const t=e[c];t.parent&&t.parent.isBone&&(i.push(0,0,0),i.push(0,0,0),r.push(o.r,o.g,o.b),r.push(s.r,s.g,s.b))}n.setAttribute("position",new Lr(i,3)),n.setAttribute("color",new Lr(r,3));const a=new $h({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});cu.call(this,n,a),this.type="SkeletonHelper",this.root=t,this.bones=e,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1}function Gm(t,e,n){this.light=t,this.light.updateMatrixWorld(),this.color=n;const i=new Lp(e,4,2),r=new vr({wireframe:!0,fog:!1,toneMapped:!1});io.call(this,i,r),this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}Um.prototype=Object.create(cu.prototype),Um.prototype.constructor=Um,Um.prototype.isSkeletonHelper=!0,Um.prototype.updateMatrixWorld=function(t){const e=this.bones,n=this.geometry,i=n.getAttribute("position");Bm.getInverse(this.root.matrixWorld);for(let r=0,o=0;r<e.length;r++){const t=e[r];t.parent&&t.parent.isBone&&(Nm.multiplyMatrices(Bm,t.matrixWorld),Im.setFromMatrixPosition(Nm),i.setXYZ(o,Im.x,Im.y,Im.z),Nm.multiplyMatrices(Bm,t.parent.matrixWorld),Im.setFromMatrixPosition(Nm),i.setXYZ(o+1,Im.x,Im.y,Im.z),o+=2)}n.getAttribute("position").needsUpdate=!0,xi.prototype.updateMatrixWorld.call(this,t)},Gm.prototype=Object.create(io.prototype),Gm.prototype.constructor=Gm,Gm.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},Gm.prototype.update=function(){void 0!==this.color?this.material.color.set(this.color):this.material.color.copy(this.light.color)};const zm=new Xn,Hm=new hr,km=new hr;function Vm(t,e,n){xi.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n;const i=new Ru(e);i.rotateY(.5*Math.PI),this.material=new vr({wireframe:!0,fog:!1,toneMapped:!1}),void 0===this.color&&(this.material.vertexColors=!0);const r=i.getAttribute("position"),o=new Float32Array(3*r.count);i.setAttribute("color",new _r(o,3)),this.add(new io(i,this.material)),this.update()}function jm(t,e,n,i){t=t||10,e=e||10,n=new hr(void 0!==n?n:4473924),i=new hr(void 0!==i?i:8947848);const r=e/2,o=t/e,s=t/2,a=[],c=[];for(let u=0,p=0,d=-s;u<=e;u++,d+=o){a.push(-s,0,d,s,0,d),a.push(d,0,-s,d,0,s);const t=u===r?n:i;t.toArray(c,p),p+=3,t.toArray(c,p),p+=3,t.toArray(c,p),p+=3,t.toArray(c,p),p+=3}const l=new Gr;l.setAttribute("position",new Lr(a,3)),l.setAttribute("color",new Lr(c,3));const h=new $h({vertexColors:!0,toneMapped:!1});cu.call(this,l,h),this.type="GridHelper"}function Wm(t,e,n,i,r,o){t=t||10,e=e||16,n=n||8,i=i||64,r=new hr(void 0!==r?r:4473924),o=new hr(void 0!==o?o:8947848);const s=[],a=[];for(let h=0;h<=e;h++){const n=h/e*(2*Math.PI),i=Math.sin(n)*t,c=Math.cos(n)*t;s.push(0,0,0),s.push(i,0,c);const l=1&h?r:o;a.push(l.r,l.g,l.b),a.push(l.r,l.g,l.b)}for(let h=0;h<=n;h++){const e=1&h?r:o,c=t-t/n*h;for(let t=0;t<i;t++){let n=t/i*(2*Math.PI),r=Math.sin(n)*c,o=Math.cos(n)*c;s.push(r,0,o),a.push(e.r,e.g,e.b),n=(t+1)/i*(2*Math.PI),r=Math.sin(n)*c,o=Math.cos(n)*c,s.push(r,0,o),a.push(e.r,e.g,e.b)}}const c=new Gr;c.setAttribute("position",new Lr(s,3)),c.setAttribute("color",new Lr(a,3));const l=new $h({vertexColors:!0,toneMapped:!1});cu.call(this,c,l),this.type="PolarGridHelper"}Vm.prototype=Object.create(xi.prototype),Vm.prototype.constructor=Vm,Vm.prototype.dispose=function(){this.children[0].geometry.dispose(),this.children[0].material.dispose()},Vm.prototype.update=function(){const t=this.children[0];if(void 0!==this.color)this.material.color.set(this.color);else{const e=t.geometry.getAttribute("color");Hm.copy(this.light.color),km.copy(this.light.groundColor);for(let t=0,n=e.count;t<n;t++){const i=t<n/2?Hm:km;e.setXYZ(t,i.r,i.g,i.b)}e.needsUpdate=!0}t.lookAt(zm.setFromMatrixPosition(this.light.matrixWorld).negate())},jm.prototype=Object.create(cu.prototype),jm.prototype.constructor=jm,Wm.prototype=Object.create(cu.prototype),Wm.prototype.constructor=Wm;const qm=new Xn,Xm=new Xn,Ym=new Xn;function Zm(t,e,n){xi.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,void 0===e&&(e=1);let i=new Gr;i.setAttribute("position",new Lr([-e,e,0,e,e,0,e,-e,0,-e,-e,0,-e,e,0],3));const r=new $h({fog:!1,toneMapped:!1});this.lightPlane=new ou(i,r),this.add(this.lightPlane),(i=new Gr).setAttribute("position",new Lr([0,0,0,0,0,1],3)),this.targetLine=new ou(i,r),this.add(this.targetLine),this.update()}Zm.prototype=Object.create(xi.prototype),Zm.prototype.constructor=Zm,Zm.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},Zm.prototype.update=function(){qm.setFromMatrixPosition(this.light.matrixWorld),Xm.setFromMatrixPosition(this.light.target.matrixWorld),Ym.subVectors(Xm,qm),this.lightPlane.lookAt(Xm),void 0!==this.color?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Xm),this.targetLine.scale.z=Ym.length()};const Jm=new Xn,Qm=new _o;function Km(t){const e=new Gr,n=new $h({color:16777215,vertexColors:!0,toneMapped:!1}),i=[],r=[],o={},s=new hr(16755200),a=new hr(16711680),c=new hr(43775),l=new hr(16777215),h=new hr(3355443);function u(t,e,n){p(t,n),p(e,n)}function p(t,e){i.push(0,0,0),r.push(e.r,e.g,e.b),void 0===o[t]&&(o[t]=[]),o[t].push(i.length/3-1)}u("n1","n2",s),u("n2","n4",s),u("n4","n3",s),u("n3","n1",s),u("f1","f2",s),u("f2","f4",s),u("f4","f3",s),u("f3","f1",s),u("n1","f1",s),u("n2","f2",s),u("n3","f3",s),u("n4","f4",s),u("p","n1",a),u("p","n2",a),u("p","n3",a),u("p","n4",a),u("u1","u2",c),u("u2","u3",c),u("u3","u1",c),u("c","t",l),u("p","c",h),u("cn1","cn2",h),u("cn3","cn4",h),u("cf1","cf2",h),u("cf3","cf4",h),e.setAttribute("position",new Lr(i,3)),e.setAttribute("color",new Lr(r,3)),cu.call(this,e,n),this.type="CameraHelper",this.camera=t,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=o,this.update()}function $m(t,e,n,i,r,o,s){Jm.set(r,o,s).unproject(i);const a=e[t];if(void 0!==a){const t=n.getAttribute("position");for(let e=0,n=a.length;e<n;e++)t.setXYZ(a[e],Jm.x,Jm.y,Jm.z)}}Km.prototype=Object.create(cu.prototype),Km.prototype.constructor=Km,Km.prototype.update=function(){const t=this.geometry,e=this.pointMap;Qm.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),$m("c",e,t,Qm,0,0,-1),$m("t",e,t,Qm,0,0,1),$m("n1",e,t,Qm,-1,-1,-1),$m("n2",e,t,Qm,1,-1,-1),$m("n3",e,t,Qm,-1,1,-1),$m("n4",e,t,Qm,1,1,-1),$m("f1",e,t,Qm,-1,-1,1),$m("f2",e,t,Qm,1,-1,1),$m("f3",e,t,Qm,-1,1,1),$m("f4",e,t,Qm,1,1,1),$m("u1",e,t,Qm,.7,1.1,-1),$m("u2",e,t,Qm,-.7,1.1,-1),$m("u3",e,t,Qm,0,2,-1),$m("cf1",e,t,Qm,-1,0,1),$m("cf2",e,t,Qm,1,0,1),$m("cf3",e,t,Qm,0,-1,1),$m("cf4",e,t,Qm,0,1,1),$m("cn1",e,t,Qm,-1,0,-1),$m("cn2",e,t,Qm,1,0,-1),$m("cn3",e,t,Qm,0,-1,-1),$m("cn4",e,t,Qm,0,1,-1),t.getAttribute("position").needsUpdate=!0};const tg=new Ii;function eg(t,e){this.object=t,void 0===e&&(e=16776960);const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Float32Array(24),r=new Gr;r.setIndex(new _r(n,1)),r.setAttribute("position",new _r(i,3)),cu.call(this,r,new $h({color:e,toneMapped:!1})),this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}function ng(t,e){this.type="Box3Helper",this.box=t,void 0===e&&(e=16776960);const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),i=new Gr;i.setIndex(new _r(n,1)),i.setAttribute("position",new Lr([1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],3)),cu.call(this,i,new $h({color:e,toneMapped:!1})),this.type="Box3Helper",this.geometry.computeBoundingSphere()}function ig(t,e,n){this.plane=t,this.size=void 0===e?1:e;const i=void 0!==n?n:16776960,r=new Gr;r.setAttribute("position",new Lr([1,-1,1,-1,1,1,-1,-1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,0,0,1,0,0,0],3)),r.computeBoundingSphere(),ou.call(this,r,new $h({color:i,toneMapped:!1})),this.type="PlaneHelper";const o=new Gr;o.setAttribute("position",new Lr([1,1,1,-1,1,1,-1,-1,1,1,1,1,-1,-1,1,1,-1,1],3)),o.computeBoundingSphere(),this.add(new io(o,new vr({color:i,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}eg.prototype=Object.create(cu.prototype),eg.prototype.constructor=eg,eg.prototype.update=function(t){if(void 0!==t&&console.warn("THREE.BoxHelper: .update() has no longer arguments."),void 0!==this.object&&tg.setFromObject(this.object),tg.isEmpty())return;const e=tg.min,n=tg.max,i=this.geometry.attributes.position,r=i.array;r[0]=n.x,r[1]=n.y,r[2]=n.z,r[3]=e.x,r[4]=n.y,r[5]=n.z,r[6]=e.x,r[7]=e.y,r[8]=n.z,r[9]=n.x,r[10]=e.y,r[11]=n.z,r[12]=n.x,r[13]=n.y,r[14]=e.z,r[15]=e.x,r[16]=n.y,r[17]=e.z,r[18]=e.x,r[19]=e.y,r[20]=e.z,r[21]=n.x,r[22]=e.y,r[23]=e.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()},eg.prototype.setFromObject=function(t){return this.object=t,this.update(),this},eg.prototype.copy=function(t){return cu.prototype.copy.call(this,t),this.object=t.object,this},ng.prototype=Object.create(cu.prototype),ng.prototype.constructor=ng,ng.prototype.updateMatrixWorld=function(t){const e=this.box;e.isEmpty()||(e.getCenter(this.position),e.getSize(this.scale),this.scale.multiplyScalar(.5),xi.prototype.updateMatrixWorld.call(this,t))},ig.prototype=Object.create(ou.prototype),ig.prototype.constructor=ig,ig.prototype.updateMatrixWorld=function(t){let e=-this.plane.constant;Math.abs(e)<1e-8&&(e=1e-8),this.scale.set(.5*this.size,.5*this.size,e),this.children[0].material.side=e<0?p:u,this.lookAt(this.plane.normal),xi.prototype.updateMatrixWorld.call(this,t)};const rg=new Xn;let og,sg;function ag(t,e,n,i,r,o){xi.call(this),this.type="ArrowHelper",void 0===t&&(t=new Xn(0,0,1)),void 0===e&&(e=new Xn(0,0,0)),void 0===n&&(n=1),void 0===i&&(i=16776960),void 0===r&&(r=.2*n),void 0===o&&(o=.2*r),void 0===og&&((og=new Gr).setAttribute("position",new Lr([0,0,0,0,1,0],3)),(sg=new Up(0,.5,1,5,1)).translate(0,-.5,0)),this.position.copy(e),this.line=new ou(og,new $h({color:i,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new io(sg,new vr({color:i,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(n,r,o)}function cg(t){const e=[0,0,0,t=t||1,0,0,0,0,0,0,t,0,0,0,0,0,0,t],n=new Gr;n.setAttribute("position",new Lr(e,3)),n.setAttribute("color",new Lr([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],3));const i=new $h({vertexColors:!0,toneMapped:!1});cu.call(this,n,i),this.type="AxesHelper"}ag.prototype=Object.create(xi.prototype),ag.prototype.constructor=ag,ag.prototype.setDirection=function(t){if(t.y>.99999)this.quaternion.set(0,0,0,1);else if(t.y<-.99999)this.quaternion.set(1,0,0,0);else{rg.set(t.z,0,-t.x).normalize();const e=Math.acos(t.y);this.quaternion.setFromAxisAngle(rg,e)}},ag.prototype.setLength=function(t,e,n){void 0===e&&(e=.2*t),void 0===n&&(n=.2*e),this.line.scale.set(1,Math.max(1e-4,t-e),1),this.line.updateMatrix(),this.cone.scale.set(n,e,n),this.cone.position.y=t,this.cone.updateMatrix()},ag.prototype.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},ag.prototype.copy=function(t){return xi.prototype.copy.call(this,t,!1),this.line.copy(t.line),this.cone.copy(t.cone),this},cg.prototype=Object.create(cu.prototype),cg.prototype.constructor=cg;const lg=4,hg=8,ug=Math.pow(2,hg),pg=[.125,.215,.35,.446,.526,.582],dg=hg-lg+1+pg.length,fg=20,mg={[Xe]:0,[Ye]:1,[Je]:2,[Ke]:3,[$e]:4,[tn]:5,[Ze]:6},gg=new df,{_lodPlanes:vg,_sizeLods:yg,_sigmas:xg}=Eg();let _g=null;const bg=(1+Math.sqrt(5))/2,wg=1/bg,Mg=[new Xn(1,1,1),new Xn(-1,1,1),new Xn(1,1,-1),new Xn(-1,1,-1),new Xn(0,bg,wg),new Xn(0,bg,-wg),new Xn(wg,0,bg),new Xn(-wg,0,bg),new Xn(bg,wg,0),new Xn(-bg,wg,0)];function Sg(t){this._renderer=t,this._pingPongRenderTarget=null,this._blurMaterial=Rg(fg),this._equirectShader=null,this._cubemapShader=null,this._compileMaterial(this._blurMaterial)}function Tg(t){return void 0!==t&&t.type===bt&&(t.encoding===Xe||t.encoding===Ye||t.encoding===Ze)}function Eg(){const t=[],e=[],n=[];let i=hg;for(let r=0;r<dg;r++){const o=Math.pow(2,i);e.push(o);let s=1/o;r>hg-lg?s=pg[r-hg+lg-1]:0==r&&(s=0),n.push(s);const a=1/(o-1),c=-a/2,l=1+a/2,h=[c,c,l,c,l,l,c,c,l,l,c,l],u=6,p=6,d=3,f=2,m=1,g=new Float32Array(d*p*u),v=new Float32Array(f*p*u),y=new Float32Array(m*p*u);for(let t=0;t<u;t++){const e=t%3*2/3-1,n=t>2?0:-1,i=[e,n,0,e+2/3,n,0,e+2/3,n+1,0,e,n,0,e+2/3,n+1,0,e,n+1,0];g.set(i,d*p*t),v.set(h,f*p*t);const r=[t,t,t,t,t,t];y.set(r,m*p*t)}const x=new Gr;x.setAttribute("position",new _r(g,d)),x.setAttribute("uv",new _r(v,f)),x.setAttribute("faceIndex",new _r(y,m)),t.push(x),i>lg&&i--}return{_lodPlanes:t,_sizeLods:e,_sigmas:n}}function Ag(t){const e=new kn(3*ug,3*ug,t);return e.texture.mapping=st,e.texture.name="PMREM.cubeUv",e.scissorTest=!0,e}function Lg(t,e,n,i,r){t.viewport.set(e,n,i,r),t.scissor.set(e,n,i,r)}function Rg(t){return new Wp({name:"SphericalGaussianBlur",defines:{n:t},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:new Float32Array(t)},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:new Xn(0,1,0)},inputEncoding:{value:mg[Xe]},outputEncoding:{value:mg[Xe]}},vertexShader:Og(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t${Dg()}\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t`,blending:g,depthTest:!1,depthWrite:!1})}function Cg(){return new Wp({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},texelSize:{value:new Nn(1,1)},inputEncoding:{value:mg[Xe]},outputEncoding:{value:mg[Xe]}},vertexShader:Og(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t${Dg()}\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t`,blending:g,depthTest:!1,depthWrite:!1})}function Pg(){return new Wp({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},inputEncoding:{value:mg[Xe]},outputEncoding:{value:mg[Xe]}},vertexShader:Og(),fragmentShader:`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t${Dg()}\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t`,blending:g,depthTest:!1,depthWrite:!1})}function Og(){return"\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t"}function Dg(){return"\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t"}function Ig(t,e,n,i,r,o,s){return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new fr(t,e,n,r,o,s)}Sg.prototype={constructor:Sg,fromScene:function(t,e=0,n=.1,i=100){_g=this._renderer.getRenderTarget();const r=this._allocateTargets();return this._sceneToCubeUV(t,n,i,r),e>0&&this._blur(r,0,0,e),this._applyPMREM(r),this._cleanup(r),r},fromEquirectangular:function(t){return this._fromTexture(t)},fromCubemap:function(t){return this._fromTexture(t)},compileCubemapShader:function(){null===this._cubemapShader&&(this._cubemapShader=Pg(),this._compileMaterial(this._cubemapShader))},compileEquirectangularShader:function(){null===this._equirectShader&&(this._equirectShader=Cg(),this._compileMaterial(this._equirectShader))},dispose:function(){this._blurMaterial.dispose(),null!==this._cubemapShader&&this._cubemapShader.dispose(),null!==this._equirectShader&&this._equirectShader.dispose();for(let t=0;t<vg.length;t++)vg[t].dispose()},_cleanup:function(t){this._pingPongRenderTarget.dispose(),this._renderer.setRenderTarget(_g),t.scissorTest=!1,Lg(t,0,0,t.width,t.height)},_fromTexture:function(t){_g=this._renderer.getRenderTarget();const e=this._allocateTargets(t);return this._textureToCubeUV(t,e),this._applyPMREM(e),this._cleanup(e),e},_allocateTargets:function(t){const e={magFilter:ut,minFilter:ut,generateMipmaps:!1,type:bt,format:Ut,encoding:Tg(t)?t.encoding:Je,depthBuffer:!1,stencilBuffer:!1},n=Ag(e);return n.depthBuffer=!t,this._pingPongRenderTarget=Ag(e),n},_compileMaterial:function(t){const e=new io(vg[0],t);this._renderer.compile(e,gg)},_sceneToCubeUV:function(t,e,n,i){const r=new bo(90,1,e,n),o=[1,-1,1,1,1,1],s=[1,1,1,-1,-1,-1],a=this._renderer,c=a.outputEncoding,l=a.toneMapping,h=a.getClearColor(),u=a.getClearAlpha();a.toneMapping=Z,a.outputEncoding=Xe;let p=t.background;if(p&&p.isColor){p.convertSRGBToLinear();const e=Math.max(p.r,p.g,p.b),n=Math.min(Math.max(Math.ceil(Math.log2(e)),-128),127);p=p.multiplyScalar(Math.pow(2,-n));const i=(n+128)/255;a.setClearColor(p,i),t.background=null}for(let d=0;d<6;d++){const e=d%3;0==e?(r.up.set(0,o[d],0),r.lookAt(s[d],0,0)):1==e?(r.up.set(0,0,o[d]),r.lookAt(0,s[d],0)):(r.up.set(0,o[d],0),r.lookAt(0,0,s[d])),Lg(i,e*ug,d>2?ug:0,ug,ug),a.setRenderTarget(i),a.render(t,r)}a.toneMapping=l,a.outputEncoding=c,a.setClearColor(h,u)},_textureToCubeUV:function(t,e){const n=this._renderer;t.isCubeTexture?null==this._cubemapShader&&(this._cubemapShader=Pg()):null==this._equirectShader&&(this._equirectShader=Cg());const i=t.isCubeTexture?this._cubemapShader:this._equirectShader,r=new io(vg[0],i),o=i.uniforms;o.envMap.value=t,t.isCubeTexture||o.texelSize.value.set(1/t.image.width,1/t.image.height),o.inputEncoding.value=mg[t.encoding],o.outputEncoding.value=mg[e.texture.encoding],Lg(e,0,0,3*ug,2*ug),n.setRenderTarget(e),n.render(r,gg)},_applyPMREM:function(t){const e=this._renderer,n=e.autoClear;e.autoClear=!1;for(let i=1;i<dg;i++){const e=Math.sqrt(xg[i]*xg[i]-xg[i-1]*xg[i-1]),n=Mg[(i-1)%Mg.length];this._blur(t,i-1,i,e,n)}e.autoClear=n},_blur:function(t,e,n,i,r){const o=this._pingPongRenderTarget;this._halfBlur(t,o,e,n,i,"latitudinal",r),this._halfBlur(o,t,n,n,i,"longitudinal",r)},_halfBlur:function(t,e,n,i,r,o,s){const a=this._renderer,c=this._blurMaterial;"latitudinal"!==o&&"longitudinal"!==o&&console.error("blur direction must be either latitudinal or longitudinal!");const l=new io(vg[i],c),h=c.uniforms,u=yg[n]-1,p=isFinite(r)?Math.PI/(2*u):2*Math.PI/(2*fg-1),d=r/p,f=isFinite(r)?1+Math.floor(3*d):fg;f>fg&&console.warn(`sigmaRadians, ${r}, is too large and will clip, as it requested ${f} samples when the maximum is set to ${fg}`);const m=[];let g=0;for(let y=0;y<fg;++y){const t=y/d,e=Math.exp(-t*t/2);m.push(e),0==y?g+=e:y<f&&(g+=2*e)}for(let y=0;y<m.length;y++)m[y]=m[y]/g;h.envMap.value=t.texture,h.samples.value=f,h.weights.value=m,h.latitudinal.value="latitudinal"===o,s&&(h.poleAxis.value=s),h.dTheta.value=p,h.mipInt.value=hg-n,h.inputEncoding.value=mg[t.texture.encoding],h.outputEncoding.value=mg[t.texture.encoding];const v=yg[i];Lg(e,3*Math.max(0,ug-2*v),(0===i?0:2*ug)+2*v*(i>hg-lg?i-hg+lg:0),3*v,2*v),a.setRenderTarget(e),a.render(l,gg)}};const Ng=0;exports.LineStrip=0;const Bg=1;exports.LinePieces=1;const Fg=0;exports.NoColors=0;const Ug=1;exports.FaceColors=1;const Gg=2;function zg(t){return console.warn("THREE.MeshFaceMaterial has been removed. Use an Array instead."),t}function Hg(t){return void 0===t&&(t=[]),console.warn("THREE.MultiMaterial has been removed. Use an Array instead."),t.isMultiMaterial=!0,t.materials=t,t.clone=function(){return t.slice()},t}function kg(t,e){return console.warn("THREE.PointCloud has been renamed to THREE.Points."),new mu(t,e)}function Vg(t){return console.warn("THREE.Particle has been renamed to THREE.Sprite."),new Uh(t)}function jg(t,e){return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),new mu(t,e)}function Wg(t){return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),new hu(t)}function qg(t){return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),new hu(t)}function Xg(t){return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),new hu(t)}function Yg(t,e,n){return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),new Xn(t,e,n)}function Zg(t,e){return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead."),new _r(t,e).setUsage(Mn)}function Jg(t,e){return console.warn("THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead."),new br(t,e)}function Qg(t,e){return console.warn("THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead."),new wr(t,e)}function Kg(t,e){return console.warn("THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead."),new Mr(t,e)}function $g(t,e){return console.warn("THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead."),new Sr(t,e)}function tv(t,e){return console.warn("THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead."),new Tr(t,e)}function ev(t,e){return console.warn("THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead."),new Er(t,e)}function nv(t,e){return console.warn("THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead."),new Ar(t,e)}function iv(t,e){return console.warn("THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead."),new Lr(t,e)}function rv(t,e){return console.warn("THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead."),new Rr(t,e)}function ov(t){console.warn("THREE.ClosedSplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Fd.call(this,t),this.type="catmullrom",this.closed=!0}function sv(t){console.warn("THREE.SplineCurve3 has been deprecated. Use THREE.CatmullRomCurve3 instead."),Fd.call(this,t),this.type="catmullrom"}function av(t){console.warn("THREE.Spline has been removed. Use THREE.CatmullRomCurve3 instead."),Fd.call(this,t),this.type="catmullrom"}function cv(t){return console.warn("THREE.AxisHelper has been renamed to THREE.AxesHelper."),new cg(t)}function lv(t,e){return console.warn("THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead."),new eg(t,e)}function hv(t,e){return console.warn("THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead."),new cu(new Bp(t.geometry),new $h({color:void 0!==e?e:16777215}))}function uv(t,e){return console.warn("THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead."),new cu(new bu(t.geometry),new $h({color:void 0!==e?e:16777215}))}function pv(t){return console.warn("THREE.XHRLoader has been renamed to THREE.FileLoader."),new wd(t)}function dv(t){return console.warn("THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader."),new Td(t)}function fv(t,e,n){return console.warn("THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options )."),new To(t,n)}exports.VertexColors=2,Rd.create=function(t,e){return console.log("THREE.Curve.create() has been deprecated"),t.prototype=Object.create(Rd.prototype),t.prototype.constructor=t,t.prototype.getPoint=e,t},Object.assign(nf.prototype,{createPointsGeometry:function(t){console.warn("THREE.CurvePath: .createPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");const e=this.getPoints(t);return this.createGeometry(e)},createSpacedPointsGeometry:function(t){console.warn("THREE.CurvePath: .createSpacedPointsGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");const e=this.getSpacedPoints(t);return this.createGeometry(e)},createGeometry:function(t){console.warn("THREE.CurvePath: .createGeometry() has been removed. Use new THREE.Geometry().setFromPoints( points ) instead.");const e=new ho;for(let n=0,i=t.length;n<i;n++){const i=t[n];e.vertices.push(new Xn(i.x,i.y,i.z||0))}return e}}),Object.assign(rf.prototype,{fromPoints:function(t){return console.warn("THREE.Path: .fromPoints() has been renamed to .setFromPoints()."),this.setFromPoints(t)}}),ov.prototype=Object.create(Fd.prototype),sv.prototype=Object.create(Fd.prototype),av.prototype=Object.create(Fd.prototype),Object.assign(av.prototype,{initFromArray:function(){console.error("THREE.Spline: .initFromArray() has been removed.")},getControlPointsArray:function(){console.error("THREE.Spline: .getControlPointsArray() has been removed.")},reparametrizeByArcLength:function(){console.error("THREE.Spline: .reparametrizeByArcLength() has been removed.")}}),jm.prototype.setColors=function(){console.error("THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.")},Um.prototype.update=function(){console.error("THREE.SkeletonHelper: update() no longer needs to be called.")},Object.assign(_d.prototype,{extractUrlBase:function(t){return console.warn("THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead."),bf.extractUrlBase(t)}}),_d.Handlers={add:function(){console.error("THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.")},get:function(){console.error("THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.")}},Object.assign(Ef.prototype,{setTexturePath:function(t){return console.warn("THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath()."),this.setResourcePath(t)}}),Object.assign(Am.prototype,{center:function(t){return console.warn("THREE.Box2: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},size:function(t){return console.warn("THREE.Box2: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(Ii.prototype,{center:function(t){return console.warn("THREE.Box3: .center() has been renamed to .getCenter()."),this.getCenter(t)},empty:function(){return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),this.isEmpty()},isIntersectionBox:function(t){return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionSphere:function(t){return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)},size:function(t){return console.warn("THREE.Box3: .size() has been renamed to .getSize()."),this.getSize(t)}}),Object.assign(Fi.prototype,{empty:function(){return console.warn("THREE.Sphere: .empty() has been renamed to .isEmpty()."),this.isEmpty()}}),Ro.prototype.setFromMatrix=function(t){return console.warn("THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix()."),this.setFromProjectionMatrix(t)},Cm.prototype.center=function(t){return console.warn("THREE.Line3: .center() has been renamed to .getCenter()."),this.getCenter(t)},Object.assign(In,{random16:function(){return console.warn("THREE.Math: .random16() has been deprecated. Use Math.random() instead."),Math.random()},nearestPowerOfTwo:function(t){return console.warn("THREE.Math: .nearestPowerOfTwo() has been renamed to .floorPowerOfTwo()."),In.floorPowerOfTwo(t)},nextPowerOfTwo:function(t){return console.warn("THREE.Math: .nextPowerOfTwo() has been renamed to .ceilPowerOfTwo()."),In.ceilPowerOfTwo(t)}}),Object.assign(Bn.prototype,{flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},multiplyVector3:function(t){return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(){console.error("THREE.Matrix3: .multiplyVector3Array() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},applyToVector3Array:function(){console.error("THREE.Matrix3: .applyToVector3Array() has been removed.")}}),Object.assign(ei.prototype,{extractPosition:function(t){return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},flattenToArrayOffset:function(t,e){return console.warn("THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead."),this.toArray(t,e)},getPosition:function(){return console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),(new Xn).setFromMatrixColumn(this,3)},setRotationFromQuaternion:function(t){return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},multiplyToArray:function(){console.warn("THREE.Matrix4: .multiplyToArray() has been removed.")},multiplyVector3:function(t){return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector4:function(t){return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(){console.error("THREE.Matrix4: .multiplyVector3Array() has been removed.")},rotateAxis:function(t){console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},translate:function(){console.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(){console.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(){console.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(){console.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(){console.error("THREE.Matrix4: .rotateByAxis() has been removed.")},applyToBufferAttribute:function(t){return console.warn("THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},applyToVector3Array:function(){console.error("THREE.Matrix4: .applyToVector3Array() has been removed.")},makeFrustum:function(t,e,n,i,r,o){return console.warn("THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead."),this.makePerspective(t,e,i,n,r,o)}}),Zi.prototype.isIntersectionLine=function(t){return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),this.intersectsLine(t)},jn.prototype.multiplyVector3=function(t){return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},Object.assign(Wi.prototype,{isIntersectionBox:function(t){return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),this.intersectsBox(t)},isIntersectionPlane:function(t){return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),this.intersectsPlane(t)},isIntersectionSphere:function(t){return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),this.intersectsSphere(t)}}),Object.assign(sr.prototype,{area:function(){return console.warn("THREE.Triangle: .area() has been renamed to .getArea()."),this.getArea()},barycoordFromPoint:function(t,e){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),this.getBarycoord(t,e)},midpoint:function(t){return console.warn("THREE.Triangle: .midpoint() has been renamed to .getMidpoint()."),this.getMidpoint(t)},normal:function(t){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),this.getNormal(t)},plane:function(t){return console.warn("THREE.Triangle: .plane() has been renamed to .getPlane()."),this.getPlane(t)}}),Object.assign(sr,{barycoordFromPoint:function(t,e,n,i,r){return console.warn("THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord()."),sr.getBarycoord(t,e,n,i,r)},normal:function(t,e,n,i){return console.warn("THREE.Triangle: .normal() has been renamed to .getNormal()."),sr.getNormal(t,e,n,i)}}),Object.assign(of.prototype,{extractAllPoints:function(t){return console.warn("THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead."),this.extractPoints(t)},extrude:function(t){return console.warn("THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead."),new bp(this,t)},makeGeometry:function(t){return console.warn("THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead."),new Dp(this,t)}}),Object.assign(Nn.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Xn.prototype,{setEulerFromRotationMatrix:function(){console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(){console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(e,t)},applyProjection:function(t){return console.warn("THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead."),this.applyMatrix4(t)},fromAttribute:function(t,e,n){return console.warn("THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},distanceToManhattan:function(t){return console.warn("THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo()."),this.manhattanDistanceTo(t)},lengthManhattan:function(){return console.warn("THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(Hn.prototype,{fromAttribute:function(t,e,n){return console.warn("THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute()."),this.fromBufferAttribute(t,e,n)},lengthManhattan:function(){return console.warn("THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength()."),this.manhattanLength()}}),Object.assign(ho.prototype,{computeTangents:function(){console.error("THREE.Geometry: .computeTangents() has been removed.")},computeLineDistances:function(){console.error("THREE.Geometry: .computeLineDistances() has been removed. Use THREE.Line.computeLineDistances() instead.")},applyMatrix:function(t){return console.warn("THREE.Geometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.assign(xi.prototype,{getChildByName:function(t){return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},renderDepth:function(){console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")},translate:function(t,e){return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},getWorldRotation:function(){console.error("THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.")},applyMatrix:function(t){return console.warn("THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(xi.prototype,{eulerOrder:{get:function(){return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order},set:function(t){console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),this.rotation.order=t}},useQuaternion:{get:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set:function(){console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")}}}),Object.assign(io.prototype,{setDrawMode:function(){console.error("THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}),Object.defineProperties(io.prototype,{drawMode:{get:function(){return console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode."),0},set:function(){console.error("THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.")}}}),Object.defineProperties(kh.prototype,{objects:{get:function(){return console.warn("THREE.LOD: .objects has been renamed to .levels."),this.levels}}}),Object.defineProperty(qh.prototype,"useVertexTexture",{get:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")},set:function(){console.warn("THREE.Skeleton: useVertexTexture has been removed.")}}),Vh.prototype.initBones=function(){console.error("THREE.SkinnedMesh: initBones() has been removed.")},Object.defineProperty(Rd.prototype,"__arcLengthDivisions",{get:function(){return console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions},set:function(t){console.warn("THREE.Curve: .__arcLengthDivisions is now .arcLengthDivisions."),this.arcLengthDivisions=t}}),bo.prototype.setLens=function(t,e){console.warn("THREE.PerspectiveCamera.setLens is deprecated. Use .setFocalLength and .filmGauge for a photographic setup."),void 0!==e&&(this.filmGauge=e),this.setFocalLength(t)},Object.defineProperties(sf.prototype,{onlyShadow:{set:function(){console.warn("THREE.Light: .onlyShadow has been removed.")}},shadowCameraFov:{set:function(t){console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),this.shadow.camera.fov=t}},shadowCameraLeft:{set:function(t){console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),this.shadow.camera.left=t}},shadowCameraRight:{set:function(t){console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),this.shadow.camera.right=t}},shadowCameraTop:{set:function(t){console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),this.shadow.camera.top=t}},shadowCameraBottom:{set:function(t){console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),this.shadow.camera.bottom=t}},shadowCameraNear:{set:function(t){console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),this.shadow.camera.near=t}},shadowCameraFar:{set:function(t){console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),this.shadow.camera.far=t}},shadowCameraVisible:{set:function(){console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")}},shadowBias:{set:function(t){console.warn("THREE.Light: .shadowBias is now .shadow.bias."),this.shadow.bias=t}},shadowDarkness:{set:function(){console.warn("THREE.Light: .shadowDarkness has been removed.")}},shadowMapWidth:{set:function(t){console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),this.shadow.mapSize.width=t}},shadowMapHeight:{set:function(t){console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),this.shadow.mapSize.height=t}}}),Object.defineProperties(_r.prototype,{length:{get:function(){return console.warn("THREE.BufferAttribute: .length has been deprecated. Use .count instead."),this.array.length}},dynamic:{get:function(){return console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.usage===Mn},set:function(){console.warn("THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead."),this.setUsage(Mn)}}}),Object.assign(_r.prototype,{setDynamic:function(t){return console.warn("THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?Mn:wn),this},copyIndicesArray:function(){console.error("THREE.BufferAttribute: .copyIndicesArray() has been removed.")},setArray:function(){console.error("THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(Gr.prototype,{addIndex:function(t){console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),this.setIndex(t)},addAttribute:function(t,e){return console.warn("THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute()."),e&&e.isBufferAttribute||e&&e.isInterleavedBufferAttribute?"index"===t?(console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),this.setIndex(e),this):this.setAttribute(t,e):(console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.setAttribute(t,new _r(arguments[1],arguments[2])))},addDrawCall:function(t,e,n){void 0!==n&&console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),this.addGroup(t,e)},clearDrawCalls:function(){console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),this.clearGroups()},computeTangents:function(){console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")},computeOffsets:function(){console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")},removeAttribute:function(t){return console.warn("THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute()."),this.deleteAttribute(t)},applyMatrix:function(t){return console.warn("THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4()."),this.applyMatrix4(t)}}),Object.defineProperties(Gr.prototype,{drawcalls:{get:function(){return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),this.groups}},offsets:{get:function(){return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),this.groups}}}),Object.defineProperties(wf.prototype,{maxInstancedCount:{get:function(){return console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount},set:function(t){console.warn("THREE.InstancedBufferGeometry: .maxInstancedCount has been renamed to .instanceCount."),this.instanceCount=t}}}),Object.defineProperties(bm.prototype,{linePrecision:{get:function(){return console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold},set:function(t){console.warn("THREE.Raycaster: .linePrecision has been deprecated. Use .params.Line.threshold instead."),this.params.Line.threshold=t}}}),Object.defineProperties(bh.prototype,{dynamic:{get:function(){return console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.usage===Mn},set:function(t){console.warn("THREE.InterleavedBuffer: .length has been deprecated. Use .usage instead."),this.setUsage(t)}}}),Object.assign(bh.prototype,{setDynamic:function(t){return console.warn("THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead."),this.setUsage(!0===t?Mn:wn),this},setArray:function(){console.error("THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers")}}),Object.assign(wp.prototype,{getArrays:function(){console.error("THREE.ExtrudeBufferGeometry: .getArrays() has been removed.")},addShapeList:function(){console.error("THREE.ExtrudeBufferGeometry: .addShapeList() has been removed.")},addShape:function(){console.error("THREE.ExtrudeBufferGeometry: .addShape() has been removed.")}}),Object.defineProperties(xm.prototype,{dynamic:{set:function(){console.warn("THREE.Uniform: .dynamic has been removed. Use object.onBeforeRender() instead.")}},onUpdate:{value:function(){return console.warn("THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead."),this}}}),Object.defineProperties(gr.prototype,{wrapAround:{get:function(){console.warn("THREE.Material: .wrapAround has been removed.")},set:function(){console.warn("THREE.Material: .wrapAround has been removed.")}},overdraw:{get:function(){console.warn("THREE.Material: .overdraw has been removed.")},set:function(){console.warn("THREE.Material: .overdraw has been removed.")}},wrapRGB:{get:function(){return console.warn("THREE.Material: .wrapRGB has been removed."),new hr}},shading:{get:function(){console.error("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead.")},set:function(t){console.warn("THREE."+this.type+": .shading has been removed. Use the boolean .flatShading instead."),this.flatShading=1===t}},stencilMask:{get:function(){return console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask},set:function(t){console.warn("THREE."+this.type+": .stencilMask has been removed. Use .stencilFuncMask instead."),this.stencilFuncMask=t}}}),Object.defineProperties(Yp.prototype,{metal:{get:function(){return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),!1},set:function(){console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")}}}),Object.defineProperties(Xp.prototype,{transparency:{get:function(){return console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission},set:function(t){console.warn("THREE.MeshPhysicalMaterial: .transparency has been renamed to .transmission."),this.transmission=t}}}),Object.defineProperties(xo.prototype,{derivatives:{get:function(){return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives},set:function(t){console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),this.extensions.derivatives=t}}}),Object.assign(vh.prototype,{clearTarget:function(t,e,n,i){console.warn("THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead."),this.setRenderTarget(t),this.clear(e,n,i)},animate:function(t){console.warn("THREE.WebGLRenderer: .animate() is now .setAnimationLoop()."),this.setAnimationLoop(t)},getCurrentRenderTarget:function(){return console.warn("THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget()."),this.getRenderTarget()},getMaxAnisotropy:function(){return console.warn("THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy()."),this.capabilities.getMaxAnisotropy()},getPrecision:function(){return console.warn("THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision."),this.capabilities.precision},resetGLState:function(){return console.warn("THREE.WebGLRenderer: .resetGLState() is now .state.reset()."),this.state.reset()},supportsFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),this.extensions.get("OES_texture_float")},supportsHalfFloatTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),this.extensions.get("OES_texture_half_float")},supportsStandardDerivatives:function(){return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),this.extensions.get("OES_standard_derivatives")},supportsCompressedTextureS3TC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),this.extensions.get("WEBGL_compressed_texture_s3tc")},supportsCompressedTexturePVRTC:function(){return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),this.extensions.get("WEBGL_compressed_texture_pvrtc")},supportsBlendMinMax:function(){return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),this.extensions.get("EXT_blend_minmax")},supportsVertexTextures:function(){return console.warn("THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures."),this.capabilities.vertexTextures},supportsInstancedArrays:function(){return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),this.extensions.get("ANGLE_instanced_arrays")},enableScissorTest:function(t){console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),this.setScissorTest(t)},initMaterial:function(){console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},addPrePlugin:function(){console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},addPostPlugin:function(){console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},updateShadowMap:function(){console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")},setFaceCulling:function(){console.warn("THREE.WebGLRenderer: .setFaceCulling() has been removed.")},allocTextureUnit:function(){console.warn("THREE.WebGLRenderer: .allocTextureUnit() has been removed.")},setTexture:function(){console.warn("THREE.WebGLRenderer: .setTexture() has been removed.")},setTexture2D:function(){console.warn("THREE.WebGLRenderer: .setTexture2D() has been removed.")},setTextureCube:function(){console.warn("THREE.WebGLRenderer: .setTextureCube() has been removed.")},getActiveMipMapLevel:function(){return console.warn("THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel()."),this.getActiveMipmapLevel()}}),Object.defineProperties(vh.prototype,{shadowMapEnabled:{get:function(){return this.shadowMap.enabled},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),this.shadowMap.enabled=t}},shadowMapType:{get:function(){return this.shadowMap.type},set:function(t){console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),this.shadowMap.type=t}},shadowMapCullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.")}},context:{get:function(){return console.warn("THREE.WebGLRenderer: .context has been removed. Use .getContext() instead."),this.getContext()}},vr:{get:function(){return console.warn("THREE.WebGLRenderer: .vr has been renamed to .xr"),this.xr}},gammaInput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead."),!1},set:function(){console.warn("THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.")}},gammaOutput:{get:function(){return console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),!1},set:function(t){console.warn("THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead."),this.outputEncoding=!0===t?Ye:Xe}},toneMappingWhitePoint:{get:function(){return console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed."),1},set:function(){console.warn("THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.")}}}),Object.defineProperties(ch.prototype,{cullFace:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.")}},renderReverseSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.")}},renderSingleSided:{get:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")},set:function(){console.warn("THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.")}}}),Object.defineProperties(kn.prototype,{wrapS:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),this.texture.wrapS=t}},wrapT:{get:function(){return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT},set:function(t){console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),this.texture.wrapT=t}},magFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),this.texture.magFilter=t}},minFilter:{get:function(){return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter},set:function(t){console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),this.texture.minFilter=t}},anisotropy:{get:function(){return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy},set:function(t){console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),this.texture.anisotropy=t}},offset:{get:function(){return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset},set:function(t){console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),this.texture.offset=t}},repeat:{get:function(){return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat},set:function(t){console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),this.texture.repeat=t}},format:{get:function(){return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format},set:function(t){console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),this.texture.format=t}},type:{get:function(){return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type},set:function(t){console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),this.texture.type=t}},generateMipmaps:{get:function(){return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps},set:function(t){console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),this.texture.generateMipmaps=t}}}),Object.defineProperties(Jf.prototype,{load:{value:function(t){console.warn("THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.");const e=this;return(new Uf).load(t,function(t){e.setBuffer(t)}),this}},startTime:{set:function(){console.warn("THREE.Audio: .startTime is now .play( delay ).")}}}),nm.prototype.getData=function(){return console.warn("THREE.AudioAnalyser: .getData() is now .getFrequencyData()."),this.getFrequencyData()},So.prototype.updateCubeMap=function(t,e){return console.warn("THREE.CubeCamera: .updateCubeMap() is now .update()."),this.update(t,e)};const mv={merge:function(t,e,n){let i;console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),e.isMesh&&(e.matrixAutoUpdate&&e.updateMatrix(),i=e.matrix,e=e.geometry),t.merge(e,i,n)},center:function(t){return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}};function gv(){console.error("THREE.CanvasRenderer has been removed")}function vv(){console.error("THREE.JSONLoader has been removed.")}exports.GeometryUtils=mv,Un.crossOrigin=void 0,Un.loadTexture=function(t,e,n,i){console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");const r=new Ld;r.setCrossOrigin(this.crossOrigin);const o=r.load(t,n,void 0,i);return e&&(o.mapping=e),o},Un.loadTextureCube=function(t,e,n,i){console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");const r=new Ad;r.setCrossOrigin(this.crossOrigin);const o=r.load(t,n,void 0,i);return e&&(o.mapping=e),o},Un.loadCompressedTexture=function(){console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},Un.loadCompressedTextureCube=function(){console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")};const yv={createMultiMaterialObject:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},detach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")},attach:function(){console.error("THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js")}};function xv(){console.error("THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js")}exports.SceneUtils=yv,"undefined"!=typeof __THREE_DEVTOOLS__&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"119"}}));
|
|
3
|
-
},{}],"xTGv":[function(require,module,exports) {
|
|
4
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MapControls=exports.OrbitControls=void 0;var e=require("../../../build/three.module.js"),t=function(t,o){var n,a,i,r,c,s;void 0===o&&console.warn('THREE.OrbitControls: The second parameter "domElement" is now mandatory.'),o===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.object=t,this.domElement=o,this.enabled=!0,this.target=new e.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.autoRotate=!1,this.autoRotateSpeed=2,this.enableKeys=!0,this.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40},this.mouseButtons={LEFT:e.MOUSE.ROTATE,MIDDLE:e.MOUSE.DOLLY,RIGHT:e.MOUSE.PAN},this.touches={ONE:e.TOUCH.ROTATE,TWO:e.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=function(){return E.phi},this.getAzimuthalAngle=function(){return E.theta},this.saveState=function(){u.target0.copy(u.target),u.position0.copy(u.object.position),u.zoom0=u.object.zoom},this.reset=function(){u.target.copy(u.target0),u.object.position.copy(u.position0),u.object.zoom=u.zoom0,u.object.updateProjectionMatrix(),u.dispatchEvent(m),u.update(),d=p.NONE},this.update=(n=new e.Vector3,a=(new e.Quaternion).setFromUnitVectors(t.up,new e.Vector3(0,1,0)),i=a.clone().inverse(),r=new e.Vector3,c=new e.Quaternion,s=2*Math.PI,function(){var e=u.object.position;n.copy(e).sub(u.target),n.applyQuaternion(a),E.setFromVector3(n),u.autoRotate&&d===p.NONE&&R(2*Math.PI/60/60*u.autoRotateSpeed),u.enableDamping?(E.theta+=O.theta*u.dampingFactor,E.phi+=O.phi*u.dampingFactor):(E.theta+=O.theta,E.phi+=O.phi);var t=u.minAzimuthAngle,o=u.maxAzimuthAngle;return isFinite(t)&&isFinite(o)&&(t<-Math.PI?t+=s:t>Math.PI&&(t-=s),o<-Math.PI?o+=s:o>Math.PI&&(o-=s),E.theta=t<o?Math.max(t,Math.min(o,E.theta)):E.theta>(t+o)/2?Math.max(t,E.theta):Math.min(o,E.theta)),E.phi=Math.max(u.minPolarAngle,Math.min(u.maxPolarAngle,E.phi)),E.makeSafe(),E.radius*=f,E.radius=Math.max(u.minDistance,Math.min(u.maxDistance,E.radius)),!0===u.enableDamping?u.target.addScaledVector(g,u.dampingFactor):u.target.add(g),n.setFromSpherical(E),n.applyQuaternion(i),e.copy(u.target).add(n),u.object.lookAt(u.target),!0===u.enableDamping?(O.theta*=1-u.dampingFactor,O.phi*=1-u.dampingFactor,g.multiplyScalar(1-u.dampingFactor)):(O.set(0,0,0),g.set(0,0,0)),f=1,!!(v||r.distanceToSquared(u.object.position)>b||8*(1-c.dot(u.object.quaternion))>b)&&(u.dispatchEvent(m),r.copy(u.object.position),c.copy(u.object.quaternion),v=!1,!0)}),this.dispose=function(){u.domElement.removeEventListener("contextmenu",te,!1),u.domElement.removeEventListener("mousedown",G,!1),u.domElement.removeEventListener("wheel",q,!1),u.domElement.removeEventListener("touchstart",J,!1),u.domElement.removeEventListener("touchend",ee,!1),u.domElement.removeEventListener("touchmove",$,!1),u.domElement.ownerDocument.removeEventListener("mousemove",K,!1),u.domElement.ownerDocument.removeEventListener("mouseup",W,!1),u.domElement.removeEventListener("keydown",Q,!1)};var u=this,m={type:"change"},l={type:"start"},h={type:"end"},p={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},d=p.NONE,b=1e-6,E=new e.Spherical,O=new e.Spherical,f=1,g=new e.Vector3,v=!1,T=new e.Vector2,y=new e.Vector2,P=new e.Vector2,L=new e.Vector2,A=new e.Vector2,N=new e.Vector2,w=new e.Vector2,M=new e.Vector2,j=new e.Vector2;function D(){return Math.pow(.95,u.zoomSpeed)}function R(e){O.theta-=e}function S(e){O.phi-=e}var k,C=(k=new e.Vector3,function(e,t){k.setFromMatrixColumn(t,0),k.multiplyScalar(-e),g.add(k)}),Y=function(){var t=new e.Vector3;return function(e,o){!0===u.screenSpacePanning?t.setFromMatrixColumn(o,1):(t.setFromMatrixColumn(o,0),t.crossVectors(u.object.up,t)),t.multiplyScalar(e),g.add(t)}}(),x=function(){var t=new e.Vector3;return function(e,o){var n=u.domElement;if(u.object.isPerspectiveCamera){var a=u.object.position;t.copy(a).sub(u.target);var i=t.length();i*=Math.tan(u.object.fov/2*Math.PI/180),C(2*e*i/n.clientHeight,u.object.matrix),Y(2*o*i/n.clientHeight,u.object.matrix)}else u.object.isOrthographicCamera?(C(e*(u.object.right-u.object.left)/u.object.zoom/n.clientWidth,u.object.matrix),Y(o*(u.object.top-u.object.bottom)/u.object.zoom/n.clientHeight,u.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),u.enablePan=!1)}}();function H(e){u.object.isPerspectiveCamera?f/=e:u.object.isOrthographicCamera?(u.object.zoom=Math.max(u.minZoom,Math.min(u.maxZoom,u.object.zoom*e)),u.object.updateProjectionMatrix(),v=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),u.enableZoom=!1)}function U(e){u.object.isPerspectiveCamera?f*=e:u.object.isOrthographicCamera?(u.object.zoom=Math.max(u.minZoom,Math.min(u.maxZoom,u.object.zoom/e)),u.object.updateProjectionMatrix(),v=!0):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),u.enableZoom=!1)}function V(e){T.set(e.clientX,e.clientY)}function I(e){L.set(e.clientX,e.clientY)}function _(e){if(1==e.touches.length)T.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),o=.5*(e.touches[0].pageY+e.touches[1].pageY);T.set(t,o)}}function z(e){if(1==e.touches.length)L.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),o=.5*(e.touches[0].pageY+e.touches[1].pageY);L.set(t,o)}}function X(e){var t=e.touches[0].pageX-e.touches[1].pageX,o=e.touches[0].pageY-e.touches[1].pageY,n=Math.sqrt(t*t+o*o);w.set(0,n)}function F(e){if(1==e.touches.length)y.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),o=.5*(e.touches[0].pageY+e.touches[1].pageY);y.set(t,o)}P.subVectors(y,T).multiplyScalar(u.rotateSpeed);var n=u.domElement;R(2*Math.PI*P.x/n.clientHeight),S(2*Math.PI*P.y/n.clientHeight),T.copy(y)}function Z(e){if(1==e.touches.length)A.set(e.touches[0].pageX,e.touches[0].pageY);else{var t=.5*(e.touches[0].pageX+e.touches[1].pageX),o=.5*(e.touches[0].pageY+e.touches[1].pageY);A.set(t,o)}N.subVectors(A,L).multiplyScalar(u.panSpeed),x(N.x,N.y),L.copy(A)}function B(e){var t=e.touches[0].pageX-e.touches[1].pageX,o=e.touches[0].pageY-e.touches[1].pageY,n=Math.sqrt(t*t+o*o);M.set(0,n),j.set(0,Math.pow(M.y/w.y,u.zoomSpeed)),H(j.y),w.copy(M)}function G(t){if(!1!==u.enabled){var o;switch(t.preventDefault(),u.domElement.focus?u.domElement.focus():window.focus(),t.button){case 0:o=u.mouseButtons.LEFT;break;case 1:o=u.mouseButtons.MIDDLE;break;case 2:o=u.mouseButtons.RIGHT;break;default:o=-1}switch(o){case e.MOUSE.DOLLY:if(!1===u.enableZoom)return;!function(e){w.set(e.clientX,e.clientY)}(t),d=p.DOLLY;break;case e.MOUSE.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===u.enablePan)return;I(t),d=p.PAN}else{if(!1===u.enableRotate)return;V(t),d=p.ROTATE}break;case e.MOUSE.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===u.enableRotate)return;V(t),d=p.ROTATE}else{if(!1===u.enablePan)return;I(t),d=p.PAN}break;default:d=p.NONE}d!==p.NONE&&(u.domElement.ownerDocument.addEventListener("mousemove",K,!1),u.domElement.ownerDocument.addEventListener("mouseup",W,!1),u.dispatchEvent(l))}}function K(e){if(!1!==u.enabled)switch(e.preventDefault(),d){case p.ROTATE:if(!1===u.enableRotate)return;!function(e){y.set(e.clientX,e.clientY),P.subVectors(y,T).multiplyScalar(u.rotateSpeed);var t=u.domElement;R(2*Math.PI*P.x/t.clientHeight),S(2*Math.PI*P.y/t.clientHeight),T.copy(y),u.update()}(e);break;case p.DOLLY:if(!1===u.enableZoom)return;!function(e){M.set(e.clientX,e.clientY),j.subVectors(M,w),j.y>0?H(D()):j.y<0&&U(D()),w.copy(M),u.update()}(e);break;case p.PAN:if(!1===u.enablePan)return;!function(e){A.set(e.clientX,e.clientY),N.subVectors(A,L).multiplyScalar(u.panSpeed),x(N.x,N.y),L.copy(A),u.update()}(e)}}function W(e){!1!==u.enabled&&(u.domElement.ownerDocument.removeEventListener("mousemove",K,!1),u.domElement.ownerDocument.removeEventListener("mouseup",W,!1),u.dispatchEvent(h),d=p.NONE)}function q(e){!1===u.enabled||!1===u.enableZoom||d!==p.NONE&&d!==p.ROTATE||(e.preventDefault(),e.stopPropagation(),u.dispatchEvent(l),function(e){e.deltaY<0?U(D()):e.deltaY>0&&H(D()),u.update()}(e),u.dispatchEvent(h))}function Q(e){!1!==u.enabled&&!1!==u.enableKeys&&!1!==u.enablePan&&function(e){var t=!1;switch(e.keyCode){case u.keys.UP:x(0,u.keyPanSpeed),t=!0;break;case u.keys.BOTTOM:x(0,-u.keyPanSpeed),t=!0;break;case u.keys.LEFT:x(u.keyPanSpeed,0),t=!0;break;case u.keys.RIGHT:x(-u.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),u.update())}(e)}function J(t){if(!1!==u.enabled){switch(t.preventDefault(),t.touches.length){case 1:switch(u.touches.ONE){case e.TOUCH.ROTATE:if(!1===u.enableRotate)return;_(t),d=p.TOUCH_ROTATE;break;case e.TOUCH.PAN:if(!1===u.enablePan)return;z(t),d=p.TOUCH_PAN;break;default:d=p.NONE}break;case 2:switch(u.touches.TWO){case e.TOUCH.DOLLY_PAN:if(!1===u.enableZoom&&!1===u.enablePan)return;!function(e){u.enableZoom&&X(e),u.enablePan&&z(e)}(t),d=p.TOUCH_DOLLY_PAN;break;case e.TOUCH.DOLLY_ROTATE:if(!1===u.enableZoom&&!1===u.enableRotate)return;!function(e){u.enableZoom&&X(e),u.enableRotate&&_(e)}(t),d=p.TOUCH_DOLLY_ROTATE;break;default:d=p.NONE}break;default:d=p.NONE}d!==p.NONE&&u.dispatchEvent(l)}}function $(e){if(!1!==u.enabled)switch(e.preventDefault(),e.stopPropagation(),d){case p.TOUCH_ROTATE:if(!1===u.enableRotate)return;F(e),u.update();break;case p.TOUCH_PAN:if(!1===u.enablePan)return;Z(e),u.update();break;case p.TOUCH_DOLLY_PAN:if(!1===u.enableZoom&&!1===u.enablePan)return;!function(e){u.enableZoom&&B(e),u.enablePan&&Z(e)}(e),u.update();break;case p.TOUCH_DOLLY_ROTATE:if(!1===u.enableZoom&&!1===u.enableRotate)return;!function(e){u.enableZoom&&B(e),u.enableRotate&&F(e)}(e),u.update();break;default:d=p.NONE}}function ee(e){!1!==u.enabled&&(u.dispatchEvent(h),d=p.NONE)}function te(e){!1!==u.enabled&&e.preventDefault()}u.domElement.addEventListener("contextmenu",te,!1),u.domElement.addEventListener("mousedown",G,!1),u.domElement.addEventListener("wheel",q,!1),u.domElement.addEventListener("touchstart",J,!1),u.domElement.addEventListener("touchend",ee,!1),u.domElement.addEventListener("touchmove",$,!1),u.domElement.addEventListener("keydown",Q,!1),-1===u.domElement.tabIndex&&(u.domElement.tabIndex=0),this.update()};exports.OrbitControls=t,t.prototype=Object.create(e.EventDispatcher.prototype),t.prototype.constructor=t;var o=function(o,n){t.call(this,o,n),this.screenSpacePanning=!1,this.mouseButtons.LEFT=e.MOUSE.PAN,this.mouseButtons.RIGHT=e.MOUSE.ROTATE,this.touches.ONE=e.TOUCH.PAN,this.touches.TWO=e.TOUCH.DOLLY_ROTATE};exports.MapControls=o,o.prototype=Object.create(e.EventDispatcher.prototype),o.prototype.constructor=o;
|
|
5
|
-
},{"../../../build/three.module.js":"dKqR"}],"Ndw0":[function(require,module,exports) {
|
|
6
|
-
"use strict";function e(){return{scale:15,center:{latitude:52.460562,longitude:-1.772472},background:"222222",camera:{name:"Main-Camera",type:"Perspective",container:"window",near:1,far:3e3,position:{x:0,y:0,z:0}},renderer:{antialias:!0,shadowMap:{enabled:!1}},controls:{type:"Map",rotateSpeed:.7,damping:{enabled:!0,factor:.25},screenSpacePanning:!0,limitUnderground:!1,autoRotate:{enabled:!1,speed:1},minDistance:1,maxDistance:800},lights:[{name:"enviorment",type:"Ambient",color:"fafafa",opacity:.35},{name:"front-left",type:"Point",color:"fafafa",opacity:.4,shadow:!1,position:{x:200,y:90,z:40}},{name:"front-right",type:"Point",color:"fafafa",opacity:.4,shadow:!1,position:{x:200,y:90,z:-40}},{name:"back-left",type:"Point",color:"fafafa",opacity:.4,shadow:!0,position:{x:-200,y:90,z:-40}},{name:"back-right",type:"Point",color:"fafafa",opacity:.4,shadow:!1,position:{x:-200,y:90,z:-40}}],fog:{enabled:!0,color:"262E4F",near:50,far:150},interaction:{enable:!1,select:!1,hover:!1},debug:!1,lab:{wasm:!1}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.DefaultConfig=e;
|
|
7
|
-
},{}],"eCSS":[function(require,module,exports) {
|
|
8
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=function(){var t=0,l=document.createElement("div");function n(e){return l.appendChild(e.dom),e}function a(e){for(var n=0;n<l.children.length;n++)l.children[n].style.display=n===e?"block":"none";t=e}l.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",l.addEventListener("click",function(e){e.preventDefault(),a(++t%l.children.length)},!1);var i=(performance||Date).now(),o=i,r=0,f=n(new e.Panel("FPS","#0ff","#002")),d=n(new e.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=n(new e.Panel("MB","#f08","#201"));return a(0),{REVISION:16,dom:l,addPanel:n,showPanel:a,begin:function(){i=(performance||Date).now()},end:function(){r++;var e=(performance||Date).now();if(d.update(e-i,200),e>=o+1e3&&(f.update(1e3*r/(e-o),100),o=e,r=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){i=this.end()},domElement:l,setMode:a}};e.Panel=function(e,t,l){var n=1/0,a=0,i=Math.round,o=i(window.devicePixelRatio||1),r=80*o,f=48*o,d=3*o,c=2*o,p=3*o,s=15*o,u=74*o,m=30*o,h=document.createElement("canvas");h.width=r,h.height=f,h.style.cssText="width:80px;height:48px";var v=h.getContext("2d");return v.font="bold "+9*o+"px Helvetica,Arial,sans-serif",v.textBaseline="top",v.fillStyle=l,v.fillRect(0,0,r,f),v.fillStyle=t,v.fillText(e,d,c),v.fillRect(p,s,u,m),v.fillStyle=l,v.globalAlpha=.9,v.fillRect(p,s,u,m),{dom:h,update:function(f,x){n=Math.min(n,f),a=Math.max(a,f),v.fillStyle=l,v.globalAlpha=1,v.fillRect(0,0,r,s),v.fillStyle=t,v.fillText(i(f)+" "+e+" ("+i(n)+"-"+i(a)+")",d,c),v.drawImage(h,p+o,s,u-o,m,p,s,u-o,m),v.fillRect(p+u-o,s,o,m),v.fillStyle=l,v.globalAlpha=.9,v.fillRect(p+u-o,s,o,i((1-f/x)*m))}}};var t=e;exports.default=t;
|
|
9
|
-
},{}],"oANd":[function(require,module,exports) {
|
|
10
|
-
"use strict";var r=function(r){return e(r)&&!t(r)};function e(r){return!!r&&"object"==typeof r}function t(r){var e=Object.prototype.toString.call(r);return"[object RegExp]"===e||"[object Date]"===e||c(r)}var n="function"==typeof Symbol&&Symbol.for,o=n?Symbol.for("react.element"):60103;function c(r){return r.$$typeof===o}function u(r){return Array.isArray(r)?[]:{}}function a(r,e){return!1!==e.clone&&e.isMergeableObject(r)?g(u(r),r,e):r}function i(r,e,t){return r.concat(e).map(function(r){return a(r,t)})}function f(r,e){if(!e.customMerge)return g;var t=e.customMerge(r);return"function"==typeof t?t:g}function y(r){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r).filter(function(e){return r.propertyIsEnumerable(e)}):[]}function b(r){return Object.keys(r).concat(y(r))}function l(r,e){try{return e in r}catch(t){return!1}}function s(r,e){return l(r,e)&&!(Object.hasOwnProperty.call(r,e)&&Object.propertyIsEnumerable.call(r,e))}function p(r,e,t){var n={};return t.isMergeableObject(r)&&b(r).forEach(function(e){n[e]=a(r[e],t)}),b(e).forEach(function(o){s(r,o)||(l(r,o)&&t.isMergeableObject(e[o])?n[o]=f(o,t)(r[o],e[o],t):n[o]=a(e[o],t))}),n}function g(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||i,n.isMergeableObject=n.isMergeableObject||r,n.cloneUnlessOtherwiseSpecified=a;var o=Array.isArray(t);return o===Array.isArray(e)?o?n.arrayMerge(e,t,n):p(e,t,n):a(t,n)}g.all=function(r,e){if(!Array.isArray(r))throw new Error("first argument should be an array");return r.reduce(function(r,t){return g(r,t,e)},{})};var O=g;module.exports=O;
|
|
11
|
-
},{}],"pobe":[function(require,module,exports) {
|
|
12
|
-
"use strict";function e(e){return JSON.parse(JSON.stringify(e))}Object.defineProperty(exports,"__esModule",{value:!0}),exports.Clone=e;
|
|
13
|
-
},{}],"evwZ":[function(require,module,exports) {
|
|
14
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Listener=void 0;var t=e(require("deepmerge"));function e(t){return t&&t.__esModule?t:{default:t}}const s={select:!0,hover:!1};class i{constructor(e,i={}){this.options=(0,t.default)(s,i),this.container=e,this.isDrag=!0,this.Init()}Init(){this.options.enable&&(this.options.select&&(this.container.addEventListener("touchstart",()=>{this.isDrag=!1,setTimeout(()=>{this.isDrag=!0},200)},!1),this.container.addEventListener("touchend",t=>{this.isDrag||this.Select(t)},!1),this.container.addEventListener("mousedown",()=>{this.isDrag=!1,setTimeout(()=>{this.isDrag=!0},100)},!1),this.container.addEventListener("mouseup",t=>{this.isDrag||this.Select(t)},!1)),this.options.hover&&this.container.addEventListener("mousemove",t=>{this.Hover(t)},!1))}Select(t){const e=new CustomEvent("cube-select",{detail:{ux:t}});this.container.dispatchEvent(e)}Hover(t){const e=new CustomEvent("cube-hover",{detail:{ux:t}});this.container.dispatchEvent(e)}}exports.Listener=i;
|
|
15
|
-
},{"deepmerge":"oANd"}],"FTrY":[function(require,module,exports) {
|
|
16
|
-
const B={MAP_SCALE:1,CENTER:{},BBOX:{}};window.CUBE_GLOBAL=B;
|
|
17
|
-
},{}],"pBGv":[function(require,module,exports) {
|
|
18
|
-
|
|
19
|
-
var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(n){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(n){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}function m(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new m(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};
|
|
20
|
-
},{}],"MxHY":[function(require,module,exports) {
|
|
21
|
-
var process = require("process");
|
|
22
|
-
var t,e=require("process");Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var n=t="undefined"==typeof self&&void 0!==e&&e.hrtime?function(){var t=e.hrtime();return 1e3*t[0]+t[1]/1e6}:"undefined"!=typeof self&&void 0!==self.performance&&void 0!==self.performance.now?self.performance.now.bind(self.performance):void 0!==Date.now?Date.now:function(){return(new Date).getTime()},i=function(){function t(){this._tweens={},this._tweensAddedDuringUpdate={}}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(e){return t._tweens[e]})},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(t){this._tweens[t.getId()]=t,this._tweensAddedDuringUpdate[t.getId()]=t},t.prototype.remove=function(t){delete this._tweens[t.getId()],delete this._tweensAddedDuringUpdate[t.getId()]},t.prototype.update=function(t,e){var i=Object.keys(this._tweens);if(0===i.length)return!1;for(t=void 0!==t?t:n();i.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<i.length;r++){var s=this._tweens[i[r]];s&&!1===s.update(t)&&!e&&delete this._tweens[i[r]]}i=Object.keys(this._tweensAddedDuringUpdate)}return!0},t}(),r={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-r.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*r.Bounce.In(2*t):.5*r.Bounce.Out(2*t-1)+.5}}},s={Linear:function(t,e){var n=t.length-1,i=n*e,r=Math.floor(i),o=s.Utils.Linear;return e<0?o(t[0],t[1],i):e>1?o(t[n],t[n-1],n-i):o(t[r],t[r+1>n?n:r+1],i-r)},Bezier:function(t,e){for(var n=0,i=t.length-1,r=Math.pow,o=s.Utils.Bernstein,a=0;a<=i;a++)n+=r(1-e,i-a)*r(e,a)*t[a]*o(i,a);return n},CatmullRom:function(t,e){var n=t.length-1,i=n*e,r=Math.floor(i),o=s.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(r=Math.floor(i=n*(1+e))),o(t[(r-1+n)%n],t[r],t[(r+1)%n],t[(r+2)%n],i-r)):e<0?t[0]-(o(t[0],t[0],t[1],t[1],-i)-t[0]):e>1?t[n]-(o(t[n],t[n],t[n-1],t[n-1],i-n)-t[n]):o(t[r?r-1:0],t[r],t[n<r+1?n:r+1],t[n<r+2?n:r+2],i-r)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=s.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:function(){var t=[1];return function(e){var n=1;if(t[e])return t[e];for(var i=e;i>1;i--)n*=i;return t[e]=n,n}}(),CatmullRom:function(t,e,n,i,r){var s=.5*(n-t),o=.5*(i-e),a=r*r;return(2*e-2*n+s+o)*(r*a)+(-3*e+3*n-2*s-o)*a+s*r+e}}},o=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),a=function(){function t(t,e){void 0===e&&(e=_),this._object=t,this._group=e,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=_.Easing.Linear.None,this._interpolationFunction=_.Interpolation.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=_.nextId(),this._isChainStopped=!1}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.to=function(t,e){for(var n in t)this._valuesEnd[n]=t[n];return void 0!==e&&(this._duration=e),this},t.prototype.duration=function(t){return this._duration=t,this},t.prototype.start=function(t){if(this._isPlaying)return this;if(this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var e in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e];return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=void 0!==t?"string"==typeof t?_.now()+parseFloat(t):t:_.now(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},t.prototype._setupProperties=function(t,e,n,i){for(var r in n){var s=t[r],o=Array.isArray(s),a=o?"array":typeof s,u=!o&&Array.isArray(n[r]);if("undefined"!==a&&"function"!==a){if(u){var h=n[r];if(0===h.length)continue;h=h.map(this._handleRelativeValue.bind(this,s)),n[r]=[s].concat(h)}if("object"!==a&&!o||!s||u)void 0===e[r]&&(e[r]=s),o||(e[r]*=1),i[r]=u?n[r].slice().reverse():e[r]||0;else{for(var p in e[r]=o?[]:{},s)e[r][p]=s[p];i[r]=o?[]:{},this._setupProperties(s,e[r],n[r],i[r])}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this.update(1/0),this},t.prototype.pause=function(t){return this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=void 0===t?_.now():t,this._group.remove(this),this)},t.prototype.resume=function(t){return this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=(void 0===t?_.now():t)-this._pauseStart,this._pauseStart=0,this._group.add(this),this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},t.prototype.group=function(t){return this._group=t,this},t.prototype.delay=function(t){return this._delayTime=t,this},t.prototype.repeat=function(t){return this._initialRepeat=t,this._repeat=t,this},t.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},t.prototype.yoyo=function(t){return this._yoyo=t,this},t.prototype.easing=function(t){return this._easingFunction=t,this},t.prototype.interpolation=function(t){return this._interpolationFunction=t,this},t.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},t.prototype.onStart=function(t){return this._onStartCallback=t,this},t.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},t.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},t.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},t.prototype.onStop=function(t){return this._onStopCallback=t,this},t.prototype.update=function(t){var e,n;if(t>this._startTime+this._duration&&!this._isPlaying)return!1;if(this.isPlaying||this.start(t),t<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),n=(t-this._startTime)/this._duration,n=0===this._duration||n>1?1:n;var i=this._easingFunction(n);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,i),this._onUpdateCallback&&this._onUpdateCallback(this._object,n),1===n){if(this._repeat>0){for(e in isFinite(this._repeat)&&this._repeat--,this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[e]||(this._valuesStartRepeat[e]=this._valuesStartRepeat[e]+parseFloat(this._valuesEnd[e])),this._yoyo&&this._swapEndStartRepeatValues(e),this._valuesStart[e]=this._valuesStartRepeat[e];return this._yoyo&&(this._reversed=!this._reversed),void 0!==this._repeatDelayTime?this._startTime=t+this._repeatDelayTime:this._startTime=t+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var r=0,s=this._chainedTweens.length;r<s;r++)this._chainedTweens[r].start(this._startTime+this._duration);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(t,e,n,i){for(var r in n)if(void 0!==e[r]){var s=e[r]||0,o=n[r],a=Array.isArray(t[r]),u=Array.isArray(o);!a&&u?t[r]=this._interpolationFunction(o,i):"object"==typeof o&&o?this._updateProperties(t[r],s,o,i):"number"==typeof(o=this._handleRelativeValue(s,o))&&(t[r]=s+(o-s)*i)}},t.prototype._handleRelativeValue=function(t,e){return"string"!=typeof e?e:"+"===e.charAt(0)||"-"===e.charAt(0)?t+parseFloat(e):parseFloat(e)},t.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t];"string"==typeof this._valuesEnd[t]?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(this._valuesEnd[t]):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=e},t}(),u="18.6.0",h=function(){var t=function(e,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(e,n)};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),p=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.version=u,e.now=n,e.Group=i,e.Easing=r,e.Interpolation=s,e.nextId=o.nextId,e.Tween=a,e}return h(e,t),e}(i),_=new p,c=_;exports.default=c;
|
|
23
|
-
},{"process":"pBGv"}],"oe7K":[function(require,module,exports) {
|
|
24
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Layer=void 0;var e=t(require("three"));function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function t(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var i={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var l=a?Object.getOwnPropertyDescriptor(e,n):null;l&&(l.get||l.set)?Object.defineProperty(i,n,l):i[n]=e[n]}return i.default=e,t&&t.set(e,i),i}class i{constructor(r){this.layer=new e.Group,this.layer.name=r}Layer(){return this.layer}Add(e){return this.layer.add(e),this.layer}Delete(e){return e?(e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose(),this.layer.remove(e),this.layer):this.layer}Clear(){if(this.layer.children.length<1)return this.layer;for(let e=0;e<this.layer.children.length;e++){const r=this.layer.children[e];r.geometry&&r.geometry.dispose(),r.material&&r.material.dispose()}return this.layer.children=[],this.layer}Find(e){return this.layer.getObjectByName(e)}}exports.Layer=i;
|
|
25
|
-
},{"three":"dKqR"}],"rji6":[function(require,module,exports) {
|
|
26
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AnimationEngine=void 0;var e=a(require("@tweenjs/tween.js")),t=require("../layers/Layer");function a(e){return e&&e.__esModule?e:{default:e}}class i{constructor(e){this.ins=e,this.allTween=[],this.allCircular=[],this.allDash=[],this.aniGroup=new t.Layer("_animation")}Register(e){"ins_tween"===e.type&&"tween"===e.type&&(this.allTween.push(e),this.aniGroup.Add(e.object)),"circular"===e.type&&(this.allCircular.push({object:e.object,radius:e.radius,height:e.height,angle:e.angle}),this.aniGroup.Add(e.object)),"dashline"===e.type&&(this.allDash.push({object:e.object,distance:e.distance,speedStep:e.speedStep}),this.aniGroup.Add(e.object)),this.ins.Add(this.aniGroup.Layer())}Clear(){for(let e=0;e<this.allTween.length;e++)this.allTween[e].Destroy();this.allTween=[],this.allCircular=[],this.aniGroup.Clear(),this.ins.Delete(this.aniGroup)}CleanTween(){if(this.allTween.length<1)return;const e=[];for(let t=0;t<this.allTween.length;t++)this.allTween[t]&&this.allTween[t].options.haveEnd&&!1===this.allTween[t].tween._isPlaying&&e.push(t);for(let t=0;t<e.length;t++)this.allTween[t].Destroy(),this.allTween.splice(e,1)}Update(){if(this.allCircular.length>0&&this.allCircular.forEach(e=>{if(e){e.angle+=.005;const t=e.radius*Math.sin(e.angle),a=e.radius*Math.cos(e.angle);e.object.position.set(t,e.height,a)}}),e.default.update(),this.allDash.length>0)for(let e=0;e<this.allDash.length;e++){const t=this.allDash[e];parseInt(t.object.material.dashSize)>parseInt(t.distance)?(t.object.material.dashSize=0,t.object.material.opacity=1):(t.object.material.dashSize+=t.speedStep,t.object.material.opacity=t.object.material.opacity>0?t.object.material.opacity-.002:0)}}}exports.AnimationEngine=i;
|
|
27
|
-
},{"@tweenjs/tween.js":"MxHY","../layers/Layer":"oe7K"}],"tKb1":[function(require,module,exports) {
|
|
28
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GPSToTile=o,exports.TileToGPS=h,exports.Coordinate=void 0;class t{constructor(t,s){"GPS"===t&&(this.world={},this.gps=new e(s.latitude,s.longitude,s.altitude||0)),"World"===t&&(this.gps={},this.world=new i(s.x,s.y,s.z)),this.tile={x:0,y:0,centerOffset:{x:0,y:0}},this.type=t,this.center=window.CUBE_GLOBAL.CENTER,this.scale=window.CUBE_GLOBAL.MAP_SCALE}ComputeWorldCoordinate(){const t=s(this.gps.latitude,this.gps.longitude),e=s(this.center.latitude,this.center.longitude);return this.world.x=(e.x-t.x)*this.scale,this.world.z=(e.y-t.y)*this.scale,this.world.y=this.gps.altitude,this}ComputeTileCoordinate(t){const e=o(this.gps.latitude,this.gps.longitude,t);return this.tile.x=e.x,this.tile.y=e.y,this.tile.centerOffset.x=e.offsetX,this.tile.centerOffset.y=e.offsetY,this}ReverseTileToGPS(t){if(this.tile.x)return h(this.tile.x,this.tile.y,t)}}exports.Coordinate=t;class e{constructor(t,e,i){this.latitude=t,this.longitude=e,this.altitude=i}}class i{constructor(t,e,i){this.x=t,this.y=e,this.z=i}}function s(t,e){if(window.CUBE_GLOBAL.WASM){return{x:window.CUBE_GLOBAL.WASMCAL.MercatorX(t),y:window.CUBE_GLOBAL.WASMCAL.MercatorX(e)}}{const i={x:0,y:0},s=6378.137;i.x=e*Math.PI/180*s;const o=t*Math.PI/180;return i.y=s/2*Math.log((1+Math.sin(o))/(1-Math.sin(o))),i}}function o(t,e,i){const s=(e+180)/360*Math.pow(2,i),o=(1-Math.log(Math.tan(t*Math.PI/180)+1/Math.cos(t*Math.PI/180))/Math.PI)/2*Math.pow(2,i);return{x:Math.floor(s),y:Math.floor(o),offsetX:Math.floor(s)-s,offsetY:Math.floor(o)-o}}function h(t,e,i){const s=Math.PI-2*Math.PI*e/Math.pow(2,i);return{latitude:180/Math.PI*Math.atan(.5*(Math.exp(s)-Math.exp(-s))),longitude:t/Math.pow(2,i)*360-180,altitude:0}}
|
|
29
|
-
},{}],"PPrL":[function(require,module,exports) {
|
|
30
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Animation=void 0;var t=n(require("@tweenjs/tween.js")),e=require("../coordinate/Coordinate"),s=n(require("deepmerge")),i=require("three");function n(t){return t&&t.__esModule?t:{default:t}}const o={startNow:!0,delay:0,haveEnd:!0,repeat:!1};class r{constructor(t,e,i,n={}){this.name=t,this.object=e,this.type=i,this.state=0,this.angle=0,this.tween=null,this.distance=null,this.options=(0,s.default)(o,n)}GPSPath(s,n){this.type="tween";const o=new i.Vector3([],[],[]);for(let t=0;t<s.length;t++){const i=s[t],n=new e.Coordinate("GPS",i).ComputeWorldCoordinate();o.x.push(-n.world.x),o.y.push(n.world.y),o.z.push(n.world.z)}return this.tween=new t.default.Tween(this.object.position).to(o,n).easing(t.default.Easing.Linear.None),this.options.startNow&&this.Play(),this.options.repeat&&this.Loop(),this}MoveTo(e,s,n={}){this.type="ins_tween";let o=new i.Vector3([],[],[]);if(Array.isArray(e))for(let t=0;t<e.length;t++){const s=e[t];o.x.push(s.x),o.y.push(s.y),o.z.push(s.z)}else o=e;const r=n.easing||"linear"===n.easing?t.default.Easing.Linear.None:t.default.Easing.Quadratic.Out;return this.tween=new t.default.Tween(this.object.position).to(o,s).easing(r),this.Play(),this}DashLine(t){return this.type="dashline",this.distance=t,this.speedStep=t/400,this}Circular(t=5,e=5){return this.type="circular",this.radius=t,this.height=e,this.options.startNow&&this.Play(),this.options.repeat&&this.Loop(),this}Destroy(){this.tween&&this.tween.stop()}Play(){this.tween&&(0!==this.options.delay?setTimeout(()=>{this.tween.start()},this.options.delay):this.tween.start()),this.state=1}Stop(){this.state=0}Pause(){this.state=2}Loop(){this.tween&&this.tween.repeat(1/0),this.state=99}}exports.Animation=r;
|
|
31
|
-
},{"@tweenjs/tween.js":"MxHY","../coordinate/Coordinate":"tKb1","deepmerge":"oANd","three":"dKqR"}],"ChiN":[function(require,module,exports) {
|
|
32
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Action=void 0;var e=require("../animation/AnimationEngine"),t=require("../animation/Animation"),n=require("../coordinate/Coordinate"),o=r(require("three"));function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function r(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var s=o?Object.getOwnPropertyDescriptor(e,r):null;s&&(s.get||s.set)?Object.defineProperty(n,r,s):n[r]=e[r]}return n.default=e,t&&t.set(e,n),n}class s{constructor(t){this.ins=t,this.ins.AniEngine||this.ins.SetAniEngine(new e.AnimationEngine(t))}FocusOn(e,t={}){if(!e)return;e.geometry&&!e.geometry.boundingSphere&&e.geometry.computeBoundingSphere();let n=e.geometry.boundingSphere.center!=={x:0,y:0,z:0}?e.geometry.boundingSphere.center:e.position;n=n||e.position,this.FlyTo(n,t.duration)}FlyToGPS(e,t={}){let i=new n.Coordinate("GPS",e).ComputeWorldCoordinate();i=new o.Vector3(-i.world.x,i.world.y,i.world.z),this.FlyTo(i,t.duration)}FlyTo(e,n){this.ins.controls.target=e.clone();const o=n||800,i=e.clone();i.x=i.x+.5*this.ins.scale,i.y=this.ins.camera.position.y,i.z=i.z+.5*this.ins.scale;const r=new t.Animation("_moveTo",this.ins.camera).MoveTo(i,o);this.ins.AniEngine.Register(r)}}exports.Action=s;
|
|
33
|
-
},{"../animation/AnimationEngine":"rji6","../animation/Animation":"PPrL","../coordinate/Coordinate":"tKb1","three":"dKqR"}],"UC1P":[function(require,module,exports) {
|
|
34
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.OBJExporter=void 0;var t=r(require("three"));function e(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return e=function(){return t},t}function r(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var r=e();if(r&&r.has(t))return r.get(t);var o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var f=n?Object.getOwnPropertyDescriptor(t,i):null;f&&(f.get||f.set)?Object.defineProperty(o,i,f):o[i]=t[i]}return o.default=t,r&&r.set(t,o),o}class o{parse(e){let r="",o=0,n=0,i=0;const f=new t.Vector3,u=new t.Color,l=new t.Vector3,a=new t.Vector2,c=[];return e.traverse(function(e){!0===e.isMesh&&function(e){let u=0,s=0,p=0;const y=e.geometry,m=new t.Matrix3;if(!0!==y.isBufferGeometry)throw new Error("THREE.OBJExporter: Geometry is not of type THREE.BufferGeometry.");const g=y.getAttribute("position"),x=y.getAttribute("normal"),v=y.getAttribute("uv"),E=y.getIndex();if(r+="o "+e.name+"\n",e.material&&e.material.name&&(r+="usemtl "+e.material.name+"\n"),void 0!==g)for(let t=0,o=g.count;t<o;t++,u++)f.x=g.getX(t),f.y=g.getY(t),f.z=g.getZ(t),f.applyMatrix4(e.matrixWorld),r+="v "+f.x+" "+f.y+" "+f.z+"\n";if(void 0!==v)for(let t=0,o=v.count;t<o;t++,p++)a.x=v.getX(t),a.y=v.getY(t),r+="vt "+a.x+" "+a.y+"\n";if(void 0!==x){m.getNormalMatrix(e.matrixWorld);for(let t=0,e=x.count;t<e;t++,s++)l.x=x.getX(t),l.y=x.getY(t),l.z=x.getZ(t),l.applyMatrix3(m).normalize(),r+="vn "+l.x+" "+l.y+" "+l.z+"\n"}if(null!==E)for(let t=0,f=E.count;t<f;t+=3){for(let e=0;e<3;e++){const r=E.getX(t+e)+1;c[e]=o+r+(x||v?"/"+(v?n+r:"")+(x?"/"+(i+r):""):"")}r+="f "+c.join(" ")+"\n"}else for(let t=0,f=g.count;t<f;t+=3){for(let e=0;e<3;e++){const r=t+e+1;c[e]=o+r+(x||v?"/"+(v?n+r:"")+(x?"/"+(i+r):""):"")}r+="f "+c.join(" ")+"\n"}o+=u,n+=p,i+=s}(e),!0===e.isLine&&function(t){let e=0;const n=t.geometry,i=t.type;if(!0!==n.isBufferGeometry)throw new Error("THREE.OBJExporter: Geometry is not of type THREE.BufferGeometry.");const u=n.getAttribute("position");if(r+="o "+t.name+"\n",void 0!==u)for(let o=0,l=u.count;o<l;o++,e++)f.x=u.getX(o),f.y=u.getY(o),f.z=u.getZ(o),f.applyMatrix4(t.matrixWorld),r+="v "+f.x+" "+f.y+" "+f.z+"\n";if("Line"===i){r+="l ";for(let t=1,e=u.count;t<=e;t++)r+=o+t+" ";r+="\n"}if("LineSegments"===i)for(let f=1,l=f+1,a=u.count;f<a;l=(f+=2)+1)r+="l "+(o+f)+" "+(o+l)+"\n";o+=e}(e),!0===e.isPoints&&function(t){let e=0;const n=t.geometry;if(!0!==n.isBufferGeometry)throw new Error("THREE.OBJExporter: Geometry is not of type THREE.BufferGeometry.");const i=n.getAttribute("position"),l=n.getAttribute("color");if(r+="o "+t.name+"\n",void 0!==i)for(let o=0,a=i.count;o<a;o++,e++)f.fromBufferAttribute(i,o),f.applyMatrix4(t.matrixWorld),r+="v "+f.x+" "+f.y+" "+f.z,void 0!==l&&(u.fromBufferAttribute(l,o),r+=" "+u.r+" "+u.g+" "+u.b),r+="\n";r+="p ";for(let f=1,u=i.count;f<=u;f++)r+=o+f+" ";r+="\n",o+=e}(e)}),r}}exports.OBJExporter=o;
|
|
35
|
-
},{"three":"dKqR"}],"FheM":[function(require,module,exports) {
|
|
36
|
-
var t=null;function e(){return t||(t=n()),t}function n(){try{throw new Error}catch(e){var t=(""+e.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(t)return r(t[0])}return"/"}function r(t){return(""+t).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)\/[^/]+$/,"$1")+"/"}exports.getBundleURL=e,exports.getBaseURL=r;
|
|
37
|
-
},{}],"TUK3":[function(require,module,exports) {
|
|
38
|
-
var r=require("./bundle-url").getBundleURL;function e(r){Array.isArray(r)||(r=[r]);var e=r[r.length-1];try{return Promise.resolve(require(e))}catch(n){if("MODULE_NOT_FOUND"===n.code)return new s(function(n,i){t(r.slice(0,-1)).then(function(){return require(e)}).then(n,i)});throw n}}function t(r){return Promise.all(r.map(u))}var n={};function i(r,e){n[r]=e}module.exports=exports=e,exports.load=t,exports.register=i;var o={};function u(e){var t;if(Array.isArray(e)&&(t=e[1],e=e[0]),o[e])return o[e];var i=(e.substring(e.lastIndexOf(".")+1,e.length)||e).toLowerCase(),u=n[i];return u?o[e]=u(r()+e).then(function(r){return r&&module.bundle.register(t,r),r}).catch(function(r){throw delete o[e],r}):void 0}function s(r){this.executor=r,this.promise=null}s.prototype.then=function(r,e){return null===this.promise&&(this.promise=new Promise(this.executor)),this.promise.then(r,e)},s.prototype.catch=function(r){return null===this.promise&&(this.promise=new Promise(this.executor)),this.promise.catch(r)};
|
|
39
|
-
},{"./bundle-url":"FheM"}],"Bo3y":[function(require,module,exports) {
|
|
40
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Space=void 0;var e=d(require("three")),t=require("three/examples/jsm/controls/OrbitControls.js"),i=require("./static/Config.js"),n=h(require("three/examples/jsm/libs/stats.module.js")),r=h(require("deepmerge")),s=require("./utils/Clone"),o=require("./Listener.js");require("./static/Global");var a=require("./action/Action.js"),c=require("./exporter/obj");function h(e){return e&&e.__esModule?e:{default:e}}function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function d(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var i={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var s=n?Object.getOwnPropertyDescriptor(e,r):null;s&&(s.get||s.set)?Object.defineProperty(i,r,s):i[r]=e[r]}return i.default=e,t&&t.set(e,i),i}class p{constructor(c,h={}){if(this.three=e,this.container=c,!h.center||!h.scale)return void console.error("Center and scale is essential");window.CUBE_GLOBAL.CENTER=h.center?(0,s.Clone)(h.center):window.CUBE_GLOBAL.CENTER,window.CUBE_GLOBAL.MAP_SCALE=h.scale?h.scale:window.CUBE_GLOBAL.MAP_SCALE;const l=(0,i.DefaultConfig)(),d=h?(0,r.default)(l,h):l;this.options=d,d.lab.wasm&&this.InitWASM(),this.scale=window.CUBE_GLOBAL.MAP_SCALE,this.center=d.center,this.clock=new e.Clock,this.camera=new e.PerspectiveCamera(25,window.clientWidth/window.clientHeight,d.camera.near,d.camera.far),this.camera.position.set(d.camera.position.x,d.camera.position.y,d.camera.position.z),this.camera.name=d.camera.name?d.camera.name:"Main-Camera",this.scene=new e.Scene,this.scene.background=new e.Color(parseInt("0x"+d.background)),d.fog.enabled&&(this.scene.fog=new e.Fog(parseInt("0x"+d.fog.color),d.fog.near,d.fog.far)),this.LoadLights(d.lights),this.raycaster=new e.Raycaster,this.renderer=new e.WebGLRenderer({antialias:!0}),this.renderer.shadowMap.enabled=!1,this.renderer.setPixelRatio(window.devicePixelRatio),this.renderer.setSize(window.innerWidth,window.innerHeight),this.container.appendChild(this.renderer.domElement),this.controls=new t.MapControls(this.camera,this.renderer.domElement),this.controls.rotateSpeed=d.controls.rotateSpeed||.7,this.controls.enableDamping=d.controls.damping.enabled||!0,this.controls.dampingFactor=d.controls.damping.factor||.25,this.controls.minDistance=d.controls.minDistance||10,this.controls.maxDistance=d.controls.maxDistance||1e3,this.controls.autoRotate=d.controls.autoRotate.enabled||!1,this.controls.autoRotateSpeed=d.controls.autoRotate.speed||1,this.controls.update(),this.hasLookAt=!1,this.lookats=[],d.debug&&(this.stats=new n.default,this.container.appendChild(this.stats.dom)),this.WindowResize(),window.addEventListener("resize",()=>{this.WindowResize(window)},!1),this.listener=new o.Listener(this.container,d.interaction),d.interaction.enable&&(this.Action=new a.Action(this))}Add(e,t){return t||(t=this.scene),"string"==typeof t&&(t=(t=this.Find(t))||this.scene),t.add(e),e}Delete(e,t){return!!e&&(t||(t=this.scene),e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose(),t.remove(e),!0)}AddLayer(t){const i=new e.Group;return i.name=t,this.scene.add(i),i}DeleteLayer(e){const t=this.Find(e);for(let i=0;i<t.children.length;i++){const e=t.children[i];this.Delete(e,t)}this.scene.remove(t)}Find(e,t){return t=t||this.scene,"string"==typeof e?t.getObjectByName(e):"number"==typeof e?t.getObjectById(e):"object"==typeof e&&"Mesh"===e.type?e:void 0}SetLookAt(e){this.lookats.push(e),this.lookats.length>0&&(this.hasLookAt=!0)}RemoveLookAt(e){const t=[];for(let i=0;i<this.lookats.length;i++){this.lookats[i]===e&&t.push(i)}for(let i=0;i<t.length;i++)this.lookats.splice(t[i],1)}Runtime(){this.delta=this.clock.getDelta(),this.time+=this.delta,this.renderer.render(this.scene,this.camera),this.controls.update(),this.AniEngine&&this.AniEngine.Update(),this.ShaderEngine&&this.ShaderEngine.Update(),this.hasLookAt&&this.lookats.forEach(e=>{e&&e.lookAt(this.camera.position)}),this.options.debug&&this.stats.update()}GetAniEngine(){return this.AniEngine}SetAniEngine(e){this.AniEngine?console.warn("Animation Engine has already existed"):this.AniEngine=e}GetShaderEngine(){return this.ShaderEngine}SetShaderEngine(e){this.ShaderEngine?console.e("Shader Engine has existed."):this.ShaderEngine=e}LoadLights(t){t.forEach(t=>{let i;"Ambient"===t.type?i=new e.AmbientLight(new e.Color(parseInt("0x"+t.color)),t.opacity):"Point"===t.type&&(i=new e.PointLight(new e.Color(parseInt("0x"+t.color)),t.opacity)).position.set(t.position.x,t.position.y,t.position.z),i.castShadow=!1,i.name=t.name,this.scene.add(i)})}isViewable(){return this.camera.position.y<6*this.scale&&this.camera.position.x<6*this.scale}WindowResize(){this.camera.aspect=window.innerWidth/window.innerHeight,this.camera.updateProjectionMatrix(),this.renderer.setSize(window.innerWidth,window.innerHeight)}async InitWASM(){window.CUBE_GLOBAL.WASMCAL=await require("_bundle_loader")(require.resolve("./wasm/main.wasm")),window.CUBE_GLOBAL.WASM=!0}Ray(e,t){t&&"GeoLayer"===t.CUBE_TYPE&&t.CUBE_COLLIDER.enabled&&(t=t.CUBE_COLLIDER.colliders),t&&"GeoLayer"===t.CUBE_TYPE&&!t.CUBE_COLLIDER.enable&&(t=t.children[0]),t&&"string"==typeof t&&(t=this.Find(t)),t=t?t.children:this.scene.children;const i=e.detail.ux,n={x:i.clientX/this.container.clientWidth*2-1,y:-i.clientY/this.container.clientHeight*2+1};this.raycaster.setFromCamera(n,this.camera);const r=this.raycaster.intersectObjects(t);return r.length>0?r[0].object:null}exportOBJ(e){return(new c.OBJExporter).parse(e)}}exports.Space=p;
|
|
41
|
-
},{"three":"dKqR","three/examples/jsm/controls/OrbitControls.js":"xTGv","./static/Config.js":"Ndw0","three/examples/jsm/libs/stats.module.js":"eCSS","deepmerge":"oANd","./utils/Clone":"pobe","./Listener.js":"evwZ","./static/Global":"FTrY","./action/Action.js":"ChiN","./exporter/obj":"UC1P","_bundle_loader":"TUK3","./wasm/main.wasm":[["main.e217a7bd.wasm","vOG2"],"vOG2"]}],"JmJg":[function(require,module,exports) {
|
|
42
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.helvetiker=void 0;const l={glyphs:{"ο":{x_min:0,x_max:764,ha:863,o:"m 380 -25 q 105 87 211 -25 q 0 372 0 200 q 104 660 0 545 q 380 775 209 775 q 658 659 552 775 q 764 372 764 544 q 658 87 764 200 q 380 -25 552 -25 m 379 142 q 515 216 466 142 q 557 373 557 280 q 515 530 557 465 q 379 607 466 607 q 245 530 294 607 q 204 373 204 465 q 245 218 204 283 q 379 142 294 142 "},S:{x_min:0,x_max:826,ha:915,o:"m 826 306 q 701 55 826 148 q 423 -29 587 -29 q 138 60 255 -29 q 0 318 13 154 l 208 318 q 288 192 216 238 q 437 152 352 152 q 559 181 506 152 q 623 282 623 217 q 466 411 623 372 q 176 487 197 478 q 18 719 18 557 q 136 958 18 869 q 399 1040 244 1040 q 670 956 561 1040 q 791 713 791 864 l 591 713 q 526 826 583 786 q 393 866 469 866 q 277 838 326 866 q 218 742 218 804 q 374 617 218 655 q 667 542 646 552 q 826 306 826 471 "},"¦":{x_min:0,x_max:143,ha:240,o:"m 143 462 l 0 462 l 0 984 l 143 984 l 143 462 m 143 -242 l 0 -242 l 0 280 l 143 280 l 143 -242 "},"/":{x_min:196.109375,x_max:632.5625,ha:828,o:"m 632 1040 l 289 -128 l 196 -128 l 538 1040 l 632 1040 "},"Τ":{x_min:-.609375,x_max:808,ha:878,o:"m 808 831 l 508 831 l 508 0 l 298 0 l 298 831 l 0 831 l 0 1013 l 808 1013 l 808 831 "},y:{x_min:0,x_max:738.890625,ha:828,o:"m 738 749 l 444 -107 q 361 -238 413 -199 q 213 -277 308 -277 q 156 -275 176 -277 q 120 -271 131 -271 l 120 -110 q 147 -113 134 -111 q 179 -116 161 -116 q 247 -91 226 -116 q 269 -17 269 -67 q 206 173 269 -4 q 84 515 162 301 q 0 749 41 632 l 218 749 l 376 207 l 529 749 l 738 749 "},"Π":{x_min:0,x_max:809,ha:922,o:"m 809 0 l 598 0 l 598 836 l 208 836 l 208 0 l 0 0 l 0 1012 l 809 1012 l 809 0 "},"ΐ":{x_min:-162,x_max:364,ha:364,o:"m 364 810 l 235 810 l 235 952 l 364 952 l 364 810 m 301 1064 l 86 810 l -12 810 l 123 1064 l 301 1064 m -33 810 l -162 810 l -162 952 l -33 952 l -33 810 m 200 0 l 0 0 l 0 748 l 200 748 l 200 0 "},g:{x_min:0,x_max:724,ha:839,o:"m 724 48 q 637 -223 724 -142 q 357 -304 551 -304 q 140 -253 226 -304 q 23 -72 36 -192 l 243 -72 q 290 -127 255 -110 q 368 -144 324 -144 q 504 -82 470 -144 q 530 71 530 -38 l 530 105 q 441 25 496 51 q 319 0 386 0 q 79 115 166 0 q 0 377 0 219 q 77 647 0 534 q 317 775 166 775 q 534 656 456 775 l 534 748 l 724 748 l 724 48 m 368 167 q 492 237 447 167 q 530 382 530 297 q 490 529 530 466 q 364 603 444 603 q 240 532 284 603 q 201 386 201 471 q 240 239 201 300 q 368 167 286 167 "},"²":{x_min:0,x_max:463,ha:560,o:"m 463 791 q 365 627 463 706 q 151 483 258 555 l 455 483 l 455 382 l 0 382 q 84 565 0 488 q 244 672 97 576 q 331 784 331 727 q 299 850 331 824 q 228 876 268 876 q 159 848 187 876 q 132 762 132 820 l 10 762 q 78 924 10 866 q 228 976 137 976 q 392 925 322 976 q 463 791 463 874 "},"–":{x_min:0,x_max:704.171875,ha:801,o:"m 704 297 l 0 297 l 0 450 l 704 450 l 704 297 "},"Κ":{x_min:0,x_max:899.671875,ha:969,o:"m 899 0 l 646 0 l 316 462 l 208 355 l 208 0 l 0 0 l 0 1013 l 208 1013 l 208 596 l 603 1013 l 863 1013 l 460 603 l 899 0 "},"ƒ":{x_min:-46,x_max:440,ha:525,o:"m 440 609 l 316 609 l 149 -277 l -46 -277 l 121 609 l 14 609 l 14 749 l 121 749 q 159 949 121 894 q 344 1019 208 1019 l 440 1015 l 440 855 l 377 855 q 326 841 338 855 q 314 797 314 827 q 314 773 314 786 q 314 749 314 761 l 440 749 l 440 609 "},e:{x_min:0,x_max:708,ha:808,o:"m 708 321 l 207 321 q 254 186 207 236 q 362 141 298 141 q 501 227 453 141 l 700 227 q 566 36 662 104 q 362 -26 477 -26 q 112 72 213 -26 q 0 369 0 182 q 95 683 0 573 q 358 793 191 793 q 619 677 531 793 q 708 321 708 561 m 501 453 q 460 571 501 531 q 353 612 420 612 q 247 570 287 612 q 207 453 207 529 l 501 453 "},"ό":{x_min:0,x_max:764,ha:863,o:"m 380 -25 q 105 87 211 -25 q 0 372 0 200 q 104 660 0 545 q 380 775 209 775 q 658 659 552 775 q 764 372 764 544 q 658 87 764 200 q 380 -25 552 -25 m 379 142 q 515 216 466 142 q 557 373 557 280 q 515 530 557 465 q 379 607 466 607 q 245 530 294 607 q 204 373 204 465 q 245 218 204 283 q 379 142 294 142 m 593 1039 l 391 823 l 293 823 l 415 1039 l 593 1039 "},J:{x_min:0,x_max:649,ha:760,o:"m 649 294 q 573 48 649 125 q 327 -29 497 -29 q 61 82 136 -29 q 0 375 0 173 l 200 375 l 199 309 q 219 194 199 230 q 321 145 249 145 q 418 193 390 145 q 441 307 441 232 l 441 1013 l 649 1013 l 649 294 "},"»":{x_min:-.234375,x_max:526,ha:624,o:"m 526 286 l 297 87 l 296 250 l 437 373 l 297 495 l 297 660 l 526 461 l 526 286 m 229 286 l 0 87 l 0 250 l 140 373 l 0 495 l 0 660 l 229 461 l 229 286 "},"©":{x_min:3,x_max:1007,ha:1104,o:"m 507 -6 q 129 153 269 -6 q 3 506 3 298 q 127 857 3 713 q 502 1017 266 1017 q 880 855 740 1017 q 1007 502 1007 711 q 882 152 1007 295 q 507 -6 743 -6 m 502 934 q 184 800 302 934 q 79 505 79 680 q 184 210 79 331 q 501 76 302 76 q 819 210 701 76 q 925 507 925 331 q 820 800 925 682 q 502 934 704 934 m 758 410 q 676 255 748 313 q 506 197 605 197 q 298 291 374 197 q 229 499 229 377 q 297 713 229 624 q 494 811 372 811 q 666 760 593 811 q 752 616 739 710 l 621 616 q 587 688 621 658 q 509 719 554 719 q 404 658 441 719 q 368 511 368 598 q 403 362 368 427 q 498 298 438 298 q 624 410 606 298 l 758 410 "},"ώ":{x_min:0,x_max:945,ha:1051,o:"m 566 528 l 372 528 l 372 323 q 372 298 372 311 q 373 271 372 285 q 360 183 373 211 q 292 142 342 142 q 219 222 243 142 q 203 365 203 279 q 241 565 203 461 q 334 748 273 650 l 130 748 q 36 552 68 650 q 0 337 0 444 q 69 96 0 204 q 276 -29 149 -29 q 390 0 337 -29 q 470 78 444 28 q 551 0 495 30 q 668 -29 608 -29 q 874 96 793 -29 q 945 337 945 205 q 910 547 945 444 q 814 748 876 650 l 610 748 q 703 565 671 650 q 742 365 742 462 q 718 189 742 237 q 651 142 694 142 q 577 190 597 142 q 565 289 565 221 l 565 323 l 566 528 m 718 1039 l 516 823 l 417 823 l 540 1039 l 718 1039 "},"^":{x_min:197.21875,x_max:630.5625,ha:828,o:"m 630 836 l 536 836 l 413 987 l 294 836 l 197 836 l 331 1090 l 493 1090 l 630 836 "},"«":{x_min:0,x_max:526.546875,ha:624,o:"m 526 87 l 297 286 l 297 461 l 526 660 l 526 495 l 385 373 l 526 250 l 526 87 m 229 87 l 0 286 l 0 461 l 229 660 l 229 495 l 88 373 l 229 250 l 229 87 "},D:{x_min:0,x_max:864,ha:968,o:"m 400 1013 q 736 874 608 1013 q 864 523 864 735 q 717 146 864 293 q 340 0 570 0 l 0 0 l 0 1013 l 400 1013 m 398 837 l 206 837 l 206 182 l 372 182 q 584 276 507 182 q 657 504 657 365 q 594 727 657 632 q 398 837 522 837 "},"∙":{x_min:0,x_max:207,ha:304,o:"m 207 528 l 0 528 l 0 735 l 207 735 l 207 528 "},"ÿ":{x_min:0,x_max:47,ha:125,o:"m 47 3 q 37 -7 47 -7 q 28 0 30 -7 q 39 -4 32 -4 q 45 3 45 -1 l 37 0 q 28 9 28 0 q 39 19 28 19 l 47 16 l 47 19 l 47 3 m 37 1 q 44 8 44 1 q 37 16 44 16 q 30 8 30 16 q 37 1 30 1 m 26 1 l 23 22 l 14 0 l 3 22 l 3 3 l 0 25 l 13 1 l 22 25 l 26 1 "},w:{x_min:0,x_max:1056.953125,ha:1150,o:"m 1056 749 l 848 0 l 647 0 l 527 536 l 412 0 l 211 0 l 0 749 l 202 749 l 325 226 l 429 748 l 633 748 l 740 229 l 864 749 l 1056 749 "},$:{x_min:0,x_max:704,ha:800,o:"m 682 693 l 495 693 q 468 782 491 749 q 391 831 441 824 l 391 579 q 633 462 562 534 q 704 259 704 389 q 616 57 704 136 q 391 -22 528 -22 l 391 -156 l 308 -156 l 308 -22 q 76 69 152 -7 q 0 300 0 147 l 183 300 q 215 191 190 230 q 308 128 245 143 l 308 414 q 84 505 157 432 q 12 700 12 578 q 89 902 12 824 q 308 981 166 981 l 308 1069 l 391 1069 l 391 981 q 595 905 521 981 q 682 693 670 829 m 308 599 l 308 831 q 228 796 256 831 q 200 712 200 762 q 225 642 200 668 q 308 599 251 617 m 391 128 q 476 174 449 140 q 504 258 504 207 q 391 388 504 354 l 391 128 "},"\\":{x_min:-.03125,x_max:434.765625,ha:532,o:"m 434 -128 l 341 -128 l 0 1039 l 91 1040 l 434 -128 "},"µ":{x_min:0,x_max:647,ha:754,o:"m 647 0 l 478 0 l 478 68 q 412 9 448 30 q 330 -11 375 -11 q 261 3 296 -11 q 199 43 226 18 l 199 -277 l 0 -277 l 0 749 l 199 749 l 199 358 q 216 221 199 267 q 322 151 244 151 q 435 240 410 151 q 448 401 448 283 l 448 749 l 647 749 l 647 0 "},"Ι":{x_min:42,x_max:250,ha:413,o:"m 250 0 l 42 0 l 42 1013 l 250 1013 l 250 0 "},"Ύ":{x_min:0,x_max:1211.15625,ha:1289,o:"m 1211 1012 l 907 376 l 907 0 l 697 0 l 697 376 l 374 1012 l 583 1012 l 802 576 l 1001 1012 l 1211 1012 m 313 1035 l 98 780 l 0 780 l 136 1035 l 313 1035 "},"’":{x_min:0,x_max:192,ha:289,o:"m 192 834 q 137 692 192 751 q 0 626 83 634 l 0 697 q 101 831 101 723 l 0 831 l 0 1013 l 192 1013 l 192 834 "},"Ν":{x_min:0,x_max:833,ha:946,o:"m 833 0 l 617 0 l 206 696 l 206 0 l 0 0 l 0 1013 l 216 1013 l 629 315 l 629 1013 l 833 1013 l 833 0 "},"-":{x_min:27.78125,x_max:413.890625,ha:525,o:"m 413 279 l 27 279 l 27 468 l 413 468 l 413 279 "},Q:{x_min:0,x_max:995.59375,ha:1096,o:"m 995 49 l 885 -70 l 762 42 q 641 -12 709 4 q 497 -29 572 -29 q 135 123 271 -29 q 0 504 0 276 q 131 881 0 731 q 497 1040 270 1040 q 859 883 719 1040 q 994 506 994 731 q 966 321 994 413 q 884 152 938 229 l 995 49 m 730 299 q 767 395 755 344 q 779 504 779 446 q 713 743 779 644 q 505 857 638 857 q 284 745 366 857 q 210 501 210 644 q 279 265 210 361 q 492 157 357 157 q 615 181 557 157 l 508 287 l 620 405 l 730 299 "},"ς":{x_min:0,x_max:731.78125,ha:768,o:"m 731 448 l 547 448 q 485 571 531 533 q 369 610 440 610 q 245 537 292 610 q 204 394 204 473 q 322 186 204 238 q 540 133 430 159 q 659 -15 659 98 q 643 -141 659 -80 q 595 -278 627 -202 l 423 -278 q 458 -186 448 -215 q 474 -88 474 -133 q 352 0 474 -27 q 123 80 181 38 q 0 382 0 170 q 98 660 0 549 q 367 777 202 777 q 622 683 513 777 q 731 448 731 589 "},M:{x_min:0,x_max:1019,ha:1135,o:"m 1019 0 l 823 0 l 823 819 l 618 0 l 402 0 l 194 818 l 194 0 l 0 0 l 0 1013 l 309 1012 l 510 241 l 707 1013 l 1019 1013 l 1019 0 "},"Ψ":{x_min:0,x_max:995,ha:1085,o:"m 995 698 q 924 340 995 437 q 590 200 841 227 l 590 0 l 404 0 l 404 200 q 70 340 152 227 q 0 698 0 437 l 0 1013 l 188 1013 l 188 694 q 212 472 188 525 q 404 383 254 383 l 404 1013 l 590 1013 l 590 383 q 781 472 740 383 q 807 694 807 525 l 807 1013 l 995 1013 l 995 698 "},C:{x_min:0,x_max:970.828125,ha:1043,o:"m 970 345 q 802 70 933 169 q 490 -29 672 -29 q 130 130 268 -29 q 0 506 0 281 q 134 885 0 737 q 502 1040 275 1040 q 802 939 668 1040 q 965 679 936 838 l 745 679 q 649 809 716 761 q 495 857 582 857 q 283 747 361 857 q 214 508 214 648 q 282 267 214 367 q 493 154 359 154 q 651 204 584 154 q 752 345 718 255 l 970 345 "},"!":{x_min:0,x_max:204,ha:307,o:"m 204 739 q 182 515 204 686 q 152 282 167 398 l 52 282 q 13 589 27 473 q 0 739 0 704 l 0 1013 l 204 1013 l 204 739 m 204 0 l 0 0 l 0 203 l 204 203 l 204 0 "},"{":{x_min:0,x_max:501.390625,ha:599,o:"m 501 -285 q 229 -209 301 -285 q 176 -35 176 -155 q 182 47 176 -8 q 189 126 189 103 q 156 245 189 209 q 0 294 112 294 l 0 438 q 154 485 111 438 q 189 603 189 522 q 186 666 189 636 q 176 783 176 772 q 231 945 176 894 q 501 1015 306 1015 l 501 872 q 370 833 408 872 q 340 737 340 801 q 342 677 340 705 q 353 569 353 579 q 326 451 353 496 q 207 366 291 393 q 327 289 294 346 q 353 164 353 246 q 348 79 353 132 q 344 17 344 26 q 372 -95 344 -58 q 501 -141 408 -141 l 501 -285 "},X:{x_min:0,x_max:894.453125,ha:999,o:"m 894 0 l 654 0 l 445 351 l 238 0 l 0 0 l 316 516 l 0 1013 l 238 1013 l 445 659 l 652 1013 l 894 1013 l 577 519 l 894 0 "},"#":{x_min:0,x_max:1019.453125,ha:1117,o:"m 1019 722 l 969 582 l 776 581 l 717 417 l 919 417 l 868 279 l 668 278 l 566 -6 l 413 -5 l 516 279 l 348 279 l 247 -6 l 94 -6 l 196 278 l 0 279 l 49 417 l 245 417 l 304 581 l 98 582 l 150 722 l 354 721 l 455 1006 l 606 1006 l 507 721 l 673 722 l 776 1006 l 927 1006 l 826 721 l 1019 722 m 627 581 l 454 581 l 394 417 l 567 417 l 627 581 "},"ι":{x_min:42,x_max:242,ha:389,o:"m 242 0 l 42 0 l 42 749 l 242 749 l 242 0 "},"Ά":{x_min:0,x_max:995.828125,ha:1072,o:"m 313 1035 l 98 780 l 0 780 l 136 1035 l 313 1035 m 995 0 l 776 0 l 708 208 l 315 208 l 247 0 l 29 0 l 390 1012 l 629 1012 l 995 0 m 652 376 l 509 809 l 369 376 l 652 376 "},")":{x_min:0,x_max:389,ha:486,o:"m 389 357 q 319 14 389 187 q 145 -293 259 -134 l 0 -293 q 139 22 90 -142 q 189 358 189 187 q 139 689 189 525 q 0 1013 90 853 l 145 1013 q 319 703 258 857 q 389 357 389 528 "},"ε":{x_min:16.671875,x_max:652.78125,ha:742,o:"m 652 259 q 565 49 652 123 q 340 -25 479 -25 q 102 39 188 -25 q 16 197 16 104 q 45 299 16 249 q 134 390 75 348 q 58 456 86 419 q 25 552 25 502 q 120 717 25 653 q 322 776 208 776 q 537 710 456 776 q 625 508 625 639 l 445 508 q 415 585 445 563 q 327 608 386 608 q 254 590 293 608 q 215 544 215 573 q 252 469 215 490 q 336 453 280 453 q 369 455 347 453 q 400 456 391 456 l 400 308 l 329 308 q 247 291 280 308 q 204 223 204 269 q 255 154 204 172 q 345 143 286 143 q 426 174 398 143 q 454 259 454 206 l 652 259 "},"Δ":{x_min:0,x_max:981.953125,ha:1057,o:"m 981 0 l 0 0 l 386 1013 l 594 1013 l 981 0 m 715 175 l 490 765 l 266 175 l 715 175 "},"}":{x_min:0,x_max:500,ha:597,o:"m 500 294 q 348 246 390 294 q 315 128 315 209 q 320 42 315 101 q 326 -48 326 -17 q 270 -214 326 -161 q 0 -285 196 -285 l 0 -141 q 126 -97 90 -141 q 154 8 154 -64 q 150 91 154 37 q 146 157 146 145 q 172 281 146 235 q 294 366 206 339 q 173 451 208 390 q 146 576 146 500 q 150 655 146 603 q 154 731 154 708 q 126 831 154 799 q 0 872 90 872 l 0 1015 q 270 944 196 1015 q 326 777 326 891 q 322 707 326 747 q 313 593 313 612 q 347 482 313 518 q 500 438 390 438 l 500 294 "},"‰":{x_min:0,x_max:1681,ha:1775,o:"m 861 484 q 1048 404 979 484 q 1111 228 1111 332 q 1048 51 1111 123 q 859 -29 979 -29 q 672 50 740 -29 q 610 227 610 122 q 672 403 610 331 q 861 484 741 484 m 861 120 q 939 151 911 120 q 967 226 967 183 q 942 299 967 270 q 861 333 912 333 q 783 301 811 333 q 756 226 756 269 q 783 151 756 182 q 861 120 810 120 m 904 984 l 316 -28 l 205 -29 l 793 983 l 904 984 m 250 984 q 436 904 366 984 q 499 730 499 832 q 436 552 499 626 q 248 472 366 472 q 62 552 132 472 q 0 728 0 624 q 62 903 0 831 q 250 984 132 984 m 249 835 q 169 801 198 835 q 140 725 140 768 q 167 652 140 683 q 247 621 195 621 q 327 654 298 621 q 357 730 357 687 q 329 803 357 772 q 249 835 301 835 m 1430 484 q 1618 404 1548 484 q 1681 228 1681 332 q 1618 51 1681 123 q 1429 -29 1548 -29 q 1241 50 1309 -29 q 1179 227 1179 122 q 1241 403 1179 331 q 1430 484 1311 484 m 1431 120 q 1509 151 1481 120 q 1537 226 1537 183 q 1511 299 1537 270 q 1431 333 1482 333 q 1352 301 1380 333 q 1325 226 1325 269 q 1352 151 1325 182 q 1431 120 1379 120 "},a:{x_min:0,x_max:700,ha:786,o:"m 700 0 l 488 0 q 465 93 469 45 q 365 5 427 37 q 233 -26 303 -26 q 65 37 130 -26 q 0 205 0 101 q 120 409 0 355 q 343 452 168 431 q 465 522 465 468 q 424 588 465 565 q 337 611 384 611 q 250 581 285 611 q 215 503 215 552 l 26 503 q 113 707 26 633 q 328 775 194 775 q 538 723 444 775 q 657 554 657 659 l 657 137 q 666 73 657 101 q 700 33 675 45 l 700 0 m 465 297 l 465 367 q 299 322 358 340 q 193 217 193 287 q 223 150 193 174 q 298 127 254 127 q 417 175 370 127 q 465 297 465 224 "},"—":{x_min:0,x_max:941.671875,ha:1039,o:"m 941 297 l 0 297 l 0 450 l 941 450 l 941 297 "},"=":{x_min:29.171875,x_max:798.609375,ha:828,o:"m 798 502 l 29 502 l 29 635 l 798 635 l 798 502 m 798 204 l 29 204 l 29 339 l 798 339 l 798 204 "},N:{x_min:0,x_max:833,ha:949,o:"m 833 0 l 617 0 l 206 695 l 206 0 l 0 0 l 0 1013 l 216 1013 l 629 315 l 629 1013 l 833 1013 l 833 0 "},"ρ":{x_min:0,x_max:722,ha:810,o:"m 364 -17 q 271 0 313 -17 q 194 48 230 16 l 194 -278 l 0 -278 l 0 370 q 87 656 0 548 q 358 775 183 775 q 626 655 524 775 q 722 372 722 541 q 621 95 722 208 q 364 -17 520 -17 m 360 607 q 237 529 280 607 q 201 377 201 463 q 234 229 201 292 q 355 147 277 147 q 467 210 419 147 q 515 374 515 273 q 471 537 515 468 q 360 607 428 607 "},2:{x_min:64,x_max:764,ha:828,o:"m 764 685 q 675 452 764 541 q 484 325 637 415 q 307 168 357 250 l 754 168 l 754 0 l 64 0 q 193 301 64 175 q 433 480 202 311 q 564 673 564 576 q 519 780 564 737 q 416 824 475 824 q 318 780 358 824 q 262 633 270 730 l 80 633 q 184 903 80 807 q 415 988 276 988 q 654 907 552 988 q 764 685 764 819 "},"¯":{x_min:0,x_max:775,ha:771,o:"m 775 958 l 0 958 l 0 1111 l 775 1111 l 775 958 "},Z:{x_min:0,x_max:804.171875,ha:906,o:"m 804 836 l 251 182 l 793 182 l 793 0 l 0 0 l 0 176 l 551 830 l 11 830 l 11 1013 l 804 1013 l 804 836 "},u:{x_min:0,x_max:668,ha:782,o:"m 668 0 l 474 0 l 474 89 q 363 9 425 37 q 233 -19 301 -19 q 61 53 123 -19 q 0 239 0 126 l 0 749 l 199 749 l 199 296 q 225 193 199 233 q 316 146 257 146 q 424 193 380 146 q 469 304 469 240 l 469 749 l 668 749 l 668 0 "},k:{x_min:0,x_max:688.890625,ha:771,o:"m 688 0 l 450 0 l 270 316 l 196 237 l 196 0 l 0 0 l 0 1013 l 196 1013 l 196 483 l 433 748 l 675 748 l 413 469 l 688 0 "},"Η":{x_min:0,x_max:837,ha:950,o:"m 837 0 l 627 0 l 627 450 l 210 450 l 210 0 l 0 0 l 0 1013 l 210 1013 l 210 635 l 627 635 l 627 1013 l 837 1013 l 837 0 "},"Α":{x_min:0,x_max:966.671875,ha:1043,o:"m 966 0 l 747 0 l 679 208 l 286 208 l 218 0 l 0 0 l 361 1013 l 600 1013 l 966 0 m 623 376 l 480 809 l 340 376 l 623 376 "},s:{x_min:0,x_max:681,ha:775,o:"m 681 229 q 568 33 681 105 q 340 -29 471 -29 q 107 39 202 -29 q 0 245 0 114 l 201 245 q 252 155 201 189 q 358 128 295 128 q 436 144 401 128 q 482 205 482 166 q 363 284 482 255 q 143 348 181 329 q 25 533 25 408 q 129 716 25 647 q 340 778 220 778 q 554 710 465 778 q 658 522 643 643 l 463 522 q 419 596 458 570 q 327 622 380 622 q 255 606 290 622 q 221 556 221 590 q 339 473 221 506 q 561 404 528 420 q 681 229 681 344 "},B:{x_min:0,x_max:835,ha:938,o:"m 674 547 q 791 450 747 518 q 835 304 835 383 q 718 75 835 158 q 461 0 612 0 l 0 0 l 0 1013 l 477 1013 q 697 951 609 1013 q 797 754 797 880 q 765 630 797 686 q 674 547 734 575 m 438 621 q 538 646 495 621 q 590 730 590 676 q 537 814 590 785 q 436 838 494 838 l 199 838 l 199 621 l 438 621 m 445 182 q 561 211 513 182 q 618 311 618 247 q 565 410 618 375 q 444 446 512 446 l 199 446 l 199 182 l 445 182 "},"…":{x_min:0,x_max:819,ha:963,o:"m 206 0 l 0 0 l 0 207 l 206 207 l 206 0 m 512 0 l 306 0 l 306 207 l 512 207 l 512 0 m 819 0 l 613 0 l 613 207 l 819 207 l 819 0 "},"?":{x_min:1,x_max:687,ha:785,o:"m 687 734 q 621 563 687 634 q 501 454 560 508 q 436 293 436 386 l 251 293 l 251 391 q 363 557 251 462 q 476 724 476 653 q 432 827 476 788 q 332 866 389 866 q 238 827 275 866 q 195 699 195 781 l 1 699 q 110 955 1 861 q 352 1040 210 1040 q 582 963 489 1040 q 687 734 687 878 m 446 0 l 243 0 l 243 203 l 446 203 l 446 0 "},H:{x_min:0,x_max:838,ha:953,o:"m 838 0 l 628 0 l 628 450 l 210 450 l 210 0 l 0 0 l 0 1013 l 210 1013 l 210 635 l 628 635 l 628 1013 l 838 1013 l 838 0 "},"ν":{x_min:0,x_max:740.28125,ha:828,o:"m 740 749 l 473 0 l 266 0 l 0 749 l 222 749 l 373 211 l 529 749 l 740 749 "},c:{x_min:0,x_max:751.390625,ha:828,o:"m 751 282 q 625 58 725 142 q 384 -26 526 -26 q 107 84 215 -26 q 0 366 0 195 q 98 651 0 536 q 370 774 204 774 q 616 700 518 774 q 751 486 715 626 l 536 486 q 477 570 516 538 q 380 607 434 607 q 248 533 298 607 q 204 378 204 466 q 242 219 204 285 q 377 139 290 139 q 483 179 438 139 q 543 282 527 220 l 751 282 "},"¶":{x_min:0,x_max:566.671875,ha:678,o:"m 21 892 l 52 892 l 98 761 l 145 892 l 176 892 l 178 741 l 157 741 l 157 867 l 108 741 l 88 741 l 40 871 l 40 741 l 21 741 l 21 892 m 308 854 l 308 731 q 252 691 308 691 q 227 691 240 691 q 207 696 213 695 l 207 712 l 253 706 q 288 733 288 706 l 288 763 q 244 741 279 741 q 193 797 193 741 q 261 860 193 860 q 287 860 273 860 q 308 854 302 855 m 288 842 l 263 843 q 213 796 213 843 q 248 756 213 756 q 288 796 288 756 l 288 842 m 566 988 l 502 988 l 502 -1 l 439 -1 l 439 988 l 317 988 l 317 -1 l 252 -1 l 252 602 q 81 653 155 602 q 0 805 0 711 q 101 989 0 918 q 309 1053 194 1053 l 566 1053 l 566 988 "},"β":{x_min:0,x_max:703,ha:789,o:"m 510 539 q 651 429 600 501 q 703 262 703 357 q 617 53 703 136 q 404 -29 532 -29 q 199 51 279 -29 l 199 -278 l 0 -278 l 0 627 q 77 911 0 812 q 343 1021 163 1021 q 551 957 464 1021 q 649 769 649 886 q 613 638 649 697 q 510 539 577 579 m 344 136 q 452 181 408 136 q 497 291 497 227 q 435 409 497 369 q 299 444 381 444 l 299 600 q 407 634 363 600 q 452 731 452 669 q 417 820 452 784 q 329 857 382 857 q 217 775 246 857 q 199 622 199 725 l 199 393 q 221 226 199 284 q 344 136 254 136 "},"Μ":{x_min:0,x_max:1019,ha:1132,o:"m 1019 0 l 823 0 l 823 818 l 617 0 l 402 0 l 194 818 l 194 0 l 0 0 l 0 1013 l 309 1013 l 509 241 l 708 1013 l 1019 1013 l 1019 0 "},"Ό":{x_min:.15625,x_max:1174,ha:1271,o:"m 676 -29 q 312 127 451 -29 q 179 505 179 277 q 311 883 179 733 q 676 1040 449 1040 q 1040 883 901 1040 q 1174 505 1174 733 q 1041 127 1174 277 q 676 -29 903 -29 m 676 154 q 890 266 811 154 q 961 506 961 366 q 891 745 961 648 q 676 857 812 857 q 462 747 541 857 q 392 506 392 648 q 461 266 392 365 q 676 154 540 154 m 314 1034 l 98 779 l 0 779 l 136 1034 l 314 1034 "},"Ή":{x_min:0,x_max:1248,ha:1361,o:"m 1248 0 l 1038 0 l 1038 450 l 621 450 l 621 0 l 411 0 l 411 1012 l 621 1012 l 621 635 l 1038 635 l 1038 1012 l 1248 1012 l 1248 0 m 313 1035 l 98 780 l 0 780 l 136 1035 l 313 1035 "},"•":{x_min:-27.78125,x_max:691.671875,ha:775,o:"m 691 508 q 588 252 691 358 q 331 147 486 147 q 77 251 183 147 q -27 508 -27 355 q 75 761 -27 655 q 331 868 179 868 q 585 763 479 868 q 691 508 691 658 "},"¥":{x_min:0,x_max:836,ha:931,o:"m 195 625 l 0 1013 l 208 1013 l 427 576 l 626 1013 l 836 1013 l 650 625 l 777 625 l 777 472 l 578 472 l 538 389 l 777 389 l 777 236 l 532 236 l 532 0 l 322 0 l 322 236 l 79 236 l 79 389 l 315 389 l 273 472 l 79 472 l 79 625 l 195 625 "},"(":{x_min:0,x_max:388.890625,ha:486,o:"m 388 -293 l 243 -293 q 70 14 130 -134 q 0 357 0 189 q 69 703 0 526 q 243 1013 129 856 l 388 1013 q 248 695 297 860 q 200 358 200 530 q 248 24 200 187 q 388 -293 297 -138 "},U:{x_min:0,x_max:813,ha:926,o:"m 813 362 q 697 79 813 187 q 405 -29 582 -29 q 114 78 229 -29 q 0 362 0 186 l 0 1013 l 210 1013 l 210 387 q 260 226 210 291 q 408 154 315 154 q 554 226 500 154 q 603 387 603 291 l 603 1013 l 813 1013 l 813 362 "},"γ":{x_min:.0625,x_max:729.234375,ha:815,o:"m 729 749 l 457 37 l 457 -278 l 257 -278 l 257 37 q 218 155 243 95 q 170 275 194 215 l 0 749 l 207 749 l 363 284 l 522 749 l 729 749 "},"α":{x_min:-1,x_max:722,ha:835,o:"m 722 0 l 531 0 l 530 101 q 433 8 491 41 q 304 -25 375 -25 q 72 104 157 -25 q -1 372 -1 216 q 72 643 -1 530 q 308 775 158 775 q 433 744 375 775 q 528 656 491 713 l 528 749 l 722 749 l 722 0 m 361 601 q 233 527 277 601 q 196 375 196 464 q 232 224 196 288 q 358 144 277 144 q 487 217 441 144 q 528 370 528 281 q 489 523 528 457 q 361 601 443 601 "},F:{x_min:0,x_max:706.953125,ha:778,o:"m 706 837 l 206 837 l 206 606 l 645 606 l 645 431 l 206 431 l 206 0 l 0 0 l 0 1013 l 706 1013 l 706 837 "},"":{x_min:0,x_max:704.171875,ha:801,o:"m 704 297 l 0 297 l 0 450 l 704 450 l 704 297 "},":":{x_min:0,x_max:207,ha:304,o:"m 207 528 l 0 528 l 0 735 l 207 735 l 207 528 m 207 0 l 0 0 l 0 207 l 207 207 l 207 0 "},"Χ":{x_min:0,x_max:894.453125,ha:978,o:"m 894 0 l 654 0 l 445 351 l 238 0 l 0 0 l 316 516 l 0 1013 l 238 1013 l 445 660 l 652 1013 l 894 1013 l 577 519 l 894 0 "},"*":{x_min:115,x_max:713,ha:828,o:"m 713 740 l 518 688 l 651 525 l 531 438 l 412 612 l 290 439 l 173 523 l 308 688 l 115 741 l 159 880 l 342 816 l 343 1013 l 482 1013 l 481 816 l 664 880 l 713 740 "},"†":{x_min:0,x_max:809,ha:894,o:"m 509 804 l 809 804 l 809 621 l 509 621 l 509 0 l 299 0 l 299 621 l 0 621 l 0 804 l 299 804 l 299 1011 l 509 1011 l 509 804 "},"°":{x_min:-1,x_max:363,ha:460,o:"m 181 808 q 46 862 94 808 q -1 992 -1 917 q 44 1118 -1 1066 q 181 1175 96 1175 q 317 1118 265 1175 q 363 991 363 1066 q 315 862 363 917 q 181 808 267 808 m 181 908 q 240 933 218 908 q 263 992 263 958 q 242 1051 263 1027 q 181 1075 221 1075 q 120 1050 142 1075 q 99 991 99 1026 q 120 933 99 958 q 181 908 142 908 "},V:{x_min:0,x_max:895.828125,ha:997,o:"m 895 1013 l 550 0 l 347 0 l 0 1013 l 231 1013 l 447 256 l 666 1013 l 895 1013 "},"Ξ":{x_min:0,x_max:751.390625,ha:800,o:"m 733 826 l 5 826 l 5 1012 l 733 1012 l 733 826 m 681 432 l 65 432 l 65 617 l 681 617 l 681 432 m 751 0 l 0 0 l 0 183 l 751 183 l 751 0 "}," ":{x_min:0,x_max:0,ha:853},"Ϋ":{x_min:-.21875,x_max:836.171875,ha:914,o:"m 610 1046 l 454 1046 l 454 1215 l 610 1215 l 610 1046 m 369 1046 l 212 1046 l 212 1215 l 369 1215 l 369 1046 m 836 1012 l 532 376 l 532 0 l 322 0 l 322 376 l 0 1012 l 208 1012 l 427 576 l 626 1012 l 836 1012 "},0:{x_min:51,x_max:779,ha:828,o:"m 415 -26 q 142 129 242 -26 q 51 476 51 271 q 141 825 51 683 q 415 984 242 984 q 687 825 585 984 q 779 476 779 682 q 688 131 779 271 q 415 -26 587 -26 m 415 137 q 529 242 485 137 q 568 477 568 338 q 530 713 568 619 q 415 821 488 821 q 303 718 344 821 q 262 477 262 616 q 301 237 262 337 q 415 137 341 137 "},"”":{x_min:0,x_max:469,ha:567,o:"m 192 834 q 137 692 192 751 q 0 626 83 634 l 0 697 q 101 831 101 723 l 0 831 l 0 1013 l 192 1013 l 192 834 m 469 834 q 414 692 469 751 q 277 626 360 634 l 277 697 q 379 831 379 723 l 277 831 l 277 1013 l 469 1013 l 469 834 "},"@":{x_min:0,x_max:1276,ha:1374,o:"m 1115 -52 q 895 -170 1015 -130 q 647 -211 776 -211 q 158 -34 334 -211 q 0 360 0 123 q 179 810 0 621 q 698 1019 377 1019 q 1138 859 981 1019 q 1276 514 1276 720 q 1173 210 1276 335 q 884 75 1062 75 q 784 90 810 75 q 737 186 749 112 q 647 104 698 133 q 532 75 596 75 q 360 144 420 75 q 308 308 308 205 q 398 568 308 451 q 638 696 497 696 q 731 671 690 696 q 805 604 772 647 l 840 673 l 964 673 q 886 373 915 490 q 856 239 856 257 q 876 201 856 214 q 920 188 895 188 q 1084 284 1019 188 q 1150 511 1150 380 q 1051 779 1150 672 q 715 905 934 905 q 272 734 439 905 q 121 363 121 580 q 250 41 121 170 q 647 -103 394 -103 q 863 -67 751 -103 q 1061 26 975 -32 l 1115 -52 m 769 483 q 770 500 770 489 q 733 567 770 539 q 651 596 695 596 q 508 504 566 596 q 457 322 457 422 q 483 215 457 256 q 561 175 509 175 q 671 221 625 175 q 733 333 718 268 l 769 483 "},"Ί":{x_min:0,x_max:619,ha:732,o:"m 313 1035 l 98 780 l 0 780 l 136 1035 l 313 1035 m 619 0 l 411 0 l 411 1012 l 619 1012 l 619 0 "},i:{x_min:14,x_max:214,ha:326,o:"m 214 830 l 14 830 l 14 1013 l 214 1013 l 214 830 m 214 0 l 14 0 l 14 748 l 214 748 l 214 0 "},"Β":{x_min:0,x_max:835,ha:961,o:"m 675 547 q 791 450 747 518 q 835 304 835 383 q 718 75 835 158 q 461 0 612 0 l 0 0 l 0 1013 l 477 1013 q 697 951 609 1013 q 797 754 797 880 q 766 630 797 686 q 675 547 734 575 m 439 621 q 539 646 496 621 q 590 730 590 676 q 537 814 590 785 q 436 838 494 838 l 199 838 l 199 621 l 439 621 m 445 182 q 561 211 513 182 q 618 311 618 247 q 565 410 618 375 q 444 446 512 446 l 199 446 l 199 182 l 445 182 "},"υ":{x_min:0,x_max:656,ha:767,o:"m 656 416 q 568 55 656 145 q 326 -25 490 -25 q 59 97 137 -25 q 0 369 0 191 l 0 749 l 200 749 l 200 369 q 216 222 200 268 q 326 142 245 142 q 440 247 411 142 q 456 422 456 304 l 456 749 l 656 749 l 656 416 "},"]":{x_min:0,x_max:349,ha:446,o:"m 349 -300 l 0 -300 l 0 -154 l 163 -154 l 163 866 l 0 866 l 0 1013 l 349 1013 l 349 -300 "},m:{x_min:0,x_max:1065,ha:1174,o:"m 1065 0 l 866 0 l 866 483 q 836 564 866 532 q 759 596 807 596 q 663 555 700 596 q 627 454 627 514 l 627 0 l 433 0 l 433 481 q 403 563 433 531 q 323 596 374 596 q 231 554 265 596 q 197 453 197 513 l 197 0 l 0 0 l 0 748 l 189 748 l 189 665 q 279 745 226 715 q 392 775 333 775 q 509 744 455 775 q 606 659 563 713 q 695 744 640 713 q 814 775 749 775 q 992 702 920 775 q 1065 523 1065 630 l 1065 0 "},"χ":{x_min:0,x_max:759.71875,ha:847,o:"m 759 -299 l 548 -299 l 379 66 l 215 -299 l 0 -299 l 261 233 l 13 749 l 230 749 l 379 400 l 527 749 l 738 749 l 500 238 l 759 -299 "},8:{x_min:57,x_max:770,ha:828,o:"m 625 516 q 733 416 697 477 q 770 284 770 355 q 675 69 770 161 q 415 -29 574 -29 q 145 65 244 -29 q 57 273 57 150 q 93 413 57 350 q 204 516 130 477 q 112 609 142 556 q 83 718 83 662 q 177 905 83 824 q 414 986 272 986 q 650 904 555 986 q 745 715 745 822 q 716 608 745 658 q 625 516 688 558 m 414 590 q 516 624 479 590 q 553 706 553 659 q 516 791 553 755 q 414 828 480 828 q 311 792 348 828 q 275 706 275 757 q 310 624 275 658 q 414 590 345 590 m 413 135 q 527 179 487 135 q 564 279 564 218 q 525 386 564 341 q 411 436 482 436 q 298 387 341 436 q 261 282 261 344 q 300 178 261 222 q 413 135 340 135 "},"ί":{x_min:42,x_max:371.171875,ha:389,o:"m 242 0 l 42 0 l 42 748 l 242 748 l 242 0 m 371 1039 l 169 823 l 71 823 l 193 1039 l 371 1039 "},"Ζ":{x_min:0,x_max:804.171875,ha:886,o:"m 804 835 l 251 182 l 793 182 l 793 0 l 0 0 l 0 176 l 551 829 l 11 829 l 11 1012 l 804 1012 l 804 835 "},R:{x_min:0,x_max:836.109375,ha:947,o:"m 836 0 l 608 0 q 588 53 596 20 q 581 144 581 86 q 581 179 581 162 q 581 215 581 197 q 553 345 581 306 q 428 393 518 393 l 208 393 l 208 0 l 0 0 l 0 1013 l 491 1013 q 720 944 630 1013 q 819 734 819 869 q 778 584 819 654 q 664 485 738 513 q 757 415 727 463 q 794 231 794 358 l 794 170 q 800 84 794 116 q 836 31 806 51 l 836 0 m 462 838 l 208 838 l 208 572 l 452 572 q 562 604 517 572 q 612 704 612 640 q 568 801 612 765 q 462 838 525 838 "},o:{x_min:0,x_max:764,ha:871,o:"m 380 -26 q 105 86 211 -26 q 0 371 0 199 q 104 660 0 545 q 380 775 209 775 q 658 659 552 775 q 764 371 764 544 q 658 86 764 199 q 380 -26 552 -26 m 379 141 q 515 216 466 141 q 557 373 557 280 q 515 530 557 465 q 379 607 466 607 q 245 530 294 607 q 204 373 204 465 q 245 217 204 282 q 379 141 294 141 "},5:{x_min:59,x_max:767,ha:828,o:"m 767 319 q 644 59 767 158 q 382 -29 533 -29 q 158 43 247 -29 q 59 264 59 123 l 252 264 q 295 165 252 201 q 400 129 339 129 q 512 172 466 129 q 564 308 564 220 q 514 437 564 387 q 398 488 464 488 q 329 472 361 488 q 271 420 297 456 l 93 428 l 157 958 l 722 958 l 722 790 l 295 790 l 271 593 q 348 635 306 621 q 431 649 389 649 q 663 551 560 649 q 767 319 767 453 "},7:{x_min:65.28125,x_max:762.5,ha:828,o:"m 762 808 q 521 435 604 626 q 409 0 438 244 l 205 0 q 313 422 227 234 q 548 789 387 583 l 65 789 l 65 958 l 762 958 l 762 808 "},K:{x_min:0,x_max:900,ha:996,o:"m 900 0 l 647 0 l 316 462 l 208 355 l 208 0 l 0 0 l 0 1013 l 208 1013 l 208 595 l 604 1013 l 863 1013 l 461 603 l 900 0 "},",":{x_min:0,x_max:206,ha:303,o:"m 206 5 q 150 -151 206 -88 q 0 -238 94 -213 l 0 -159 q 84 -100 56 -137 q 111 -2 111 -62 l 0 -2 l 0 205 l 206 205 l 206 5 "},d:{x_min:0,x_max:722,ha:836,o:"m 722 0 l 530 0 l 530 101 q 303 -26 449 -26 q 72 103 155 -26 q 0 373 0 214 q 72 642 0 528 q 305 775 156 775 q 433 743 373 775 q 530 656 492 712 l 530 1013 l 722 1013 l 722 0 m 361 600 q 234 523 280 600 q 196 372 196 458 q 233 220 196 286 q 358 143 278 143 q 489 216 442 143 q 530 369 530 280 q 491 522 530 456 q 361 600 443 600 "},"¨":{x_min:212,x_max:609,ha:933,o:"m 609 1046 l 453 1046 l 453 1216 l 609 1216 l 609 1046 m 369 1046 l 212 1046 l 212 1216 l 369 1216 l 369 1046 "},E:{x_min:0,x_max:761.109375,ha:824,o:"m 761 0 l 0 0 l 0 1013 l 734 1013 l 734 837 l 206 837 l 206 621 l 690 621 l 690 446 l 206 446 l 206 186 l 761 186 l 761 0 "},Y:{x_min:0,x_max:836,ha:931,o:"m 836 1013 l 532 376 l 532 0 l 322 0 l 322 376 l 0 1013 l 208 1013 l 427 576 l 626 1013 l 836 1013 "},'"':{x_min:0,x_max:357,ha:454,o:"m 357 604 l 225 604 l 225 988 l 357 988 l 357 604 m 132 604 l 0 604 l 0 988 l 132 988 l 132 604 "},"‹":{x_min:35.984375,x_max:791.671875,ha:828,o:"m 791 17 l 36 352 l 35 487 l 791 823 l 791 672 l 229 421 l 791 168 l 791 17 "},"„":{x_min:0,x_max:483,ha:588,o:"m 206 5 q 150 -151 206 -88 q 0 -238 94 -213 l 0 -159 q 84 -100 56 -137 q 111 -2 111 -62 l 0 -2 l 0 205 l 206 205 l 206 5 m 483 5 q 427 -151 483 -88 q 277 -238 371 -213 l 277 -159 q 361 -100 334 -137 q 388 -2 388 -62 l 277 -2 l 277 205 l 483 205 l 483 5 "},"δ":{x_min:6,x_max:732,ha:835,o:"m 732 352 q 630 76 732 177 q 354 -25 529 -25 q 101 74 197 -25 q 6 333 6 174 q 89 581 6 480 q 323 690 178 690 q 66 864 201 787 l 66 1013 l 669 1013 l 669 856 l 348 856 q 532 729 461 789 q 673 566 625 651 q 732 352 732 465 m 419 551 q 259 496 321 551 q 198 344 198 441 q 238 208 198 267 q 357 140 283 140 q 484 203 437 140 q 526 344 526 260 q 499 466 526 410 q 419 551 473 521 "},"έ":{x_min:16.671875,x_max:652.78125,ha:742,o:"m 652 259 q 565 49 652 123 q 340 -25 479 -25 q 102 39 188 -25 q 16 197 16 104 q 45 299 16 250 q 134 390 75 348 q 58 456 86 419 q 25 552 25 502 q 120 717 25 653 q 322 776 208 776 q 537 710 456 776 q 625 508 625 639 l 445 508 q 415 585 445 563 q 327 608 386 608 q 254 590 293 608 q 215 544 215 573 q 252 469 215 490 q 336 453 280 453 q 369 455 347 453 q 400 456 391 456 l 400 308 l 329 308 q 247 291 280 308 q 204 223 204 269 q 255 154 204 172 q 345 143 286 143 q 426 174 398 143 q 454 259 454 206 l 652 259 m 579 1039 l 377 823 l 279 823 l 401 1039 l 579 1039 "},"ω":{x_min:0,x_max:945,ha:1051,o:"m 565 323 l 565 289 q 577 190 565 221 q 651 142 597 142 q 718 189 694 142 q 742 365 742 237 q 703 565 742 462 q 610 749 671 650 l 814 749 q 910 547 876 650 q 945 337 945 444 q 874 96 945 205 q 668 -29 793 -29 q 551 0 608 -29 q 470 78 495 30 q 390 0 444 28 q 276 -29 337 -29 q 69 96 149 -29 q 0 337 0 204 q 36 553 0 444 q 130 749 68 650 l 334 749 q 241 565 273 650 q 203 365 203 461 q 219 222 203 279 q 292 142 243 142 q 360 183 342 142 q 373 271 373 211 q 372 298 372 285 q 372 323 372 311 l 372 528 l 566 528 l 565 323 "},"´":{x_min:0,x_max:132,ha:299,o:"m 132 604 l 0 604 l 0 988 l 132 988 l 132 604 "},"±":{x_min:29,x_max:798,ha:828,o:"m 798 480 l 484 480 l 484 254 l 344 254 l 344 480 l 29 480 l 29 615 l 344 615 l 344 842 l 484 842 l 484 615 l 798 615 l 798 480 m 798 0 l 29 0 l 29 136 l 798 136 l 798 0 "},"|":{x_min:0,x_max:143,ha:240,o:"m 143 462 l 0 462 l 0 984 l 143 984 l 143 462 m 143 -242 l 0 -242 l 0 280 l 143 280 l 143 -242 "},"ϋ":{x_min:0,x_max:656,ha:767,o:"m 535 810 l 406 810 l 406 952 l 535 952 l 535 810 m 271 810 l 142 810 l 142 952 l 271 952 l 271 810 m 656 417 q 568 55 656 146 q 326 -25 490 -25 q 59 97 137 -25 q 0 369 0 192 l 0 748 l 200 748 l 200 369 q 216 222 200 268 q 326 142 245 142 q 440 247 411 142 q 456 422 456 304 l 456 748 l 656 748 l 656 417 "},"§":{x_min:0,x_max:633,ha:731,o:"m 633 469 q 601 356 633 406 q 512 274 569 305 q 570 197 548 242 q 593 105 593 152 q 501 -76 593 -5 q 301 -142 416 -142 q 122 -82 193 -142 q 43 108 43 -15 l 212 108 q 251 27 220 53 q 321 1 283 1 q 389 23 360 1 q 419 83 419 46 q 310 194 419 139 q 108 297 111 295 q 0 476 0 372 q 33 584 0 537 q 120 659 62 626 q 72 720 91 686 q 53 790 53 755 q 133 978 53 908 q 312 1042 207 1042 q 483 984 412 1042 q 574 807 562 921 l 409 807 q 379 875 409 851 q 307 900 349 900 q 244 881 270 900 q 218 829 218 862 q 324 731 218 781 q 524 636 506 647 q 633 469 633 565 m 419 334 q 473 411 473 372 q 451 459 473 436 q 390 502 430 481 l 209 595 q 167 557 182 577 q 153 520 153 537 q 187 461 153 491 q 263 413 212 440 l 419 334 "},b:{x_min:0,x_max:722,ha:822,o:"m 416 -26 q 289 6 346 -26 q 192 101 232 39 l 192 0 l 0 0 l 0 1013 l 192 1013 l 192 656 q 286 743 226 712 q 415 775 346 775 q 649 644 564 775 q 722 374 722 533 q 649 106 722 218 q 416 -26 565 -26 m 361 600 q 232 524 279 600 q 192 371 192 459 q 229 221 192 284 q 357 145 275 145 q 487 221 441 145 q 526 374 526 285 q 488 523 526 460 q 361 600 442 600 "},q:{x_min:0,x_max:722,ha:833,o:"m 722 -298 l 530 -298 l 530 97 q 306 -25 449 -25 q 73 104 159 -25 q 0 372 0 216 q 72 643 0 529 q 305 775 156 775 q 430 742 371 775 q 530 654 488 709 l 530 750 l 722 750 l 722 -298 m 360 601 q 234 527 278 601 q 197 378 197 466 q 233 225 197 291 q 357 144 277 144 q 488 217 441 144 q 530 370 530 282 q 491 523 530 459 q 360 601 443 601 "},"Ω":{x_min:-.03125,x_max:1008.53125,ha:1108,o:"m 1008 0 l 589 0 l 589 199 q 717 368 670 265 q 764 580 764 471 q 698 778 764 706 q 504 855 629 855 q 311 773 380 855 q 243 563 243 691 q 289 360 243 458 q 419 199 336 262 l 419 0 l 0 0 l 0 176 l 202 176 q 77 355 123 251 q 32 569 32 459 q 165 908 32 776 q 505 1040 298 1040 q 844 912 711 1040 q 977 578 977 785 q 931 362 977 467 q 805 176 886 256 l 1008 176 l 1008 0 "},"ύ":{x_min:0,x_max:656,ha:767,o:"m 656 417 q 568 55 656 146 q 326 -25 490 -25 q 59 97 137 -25 q 0 369 0 192 l 0 748 l 200 748 l 201 369 q 218 222 201 269 q 326 142 245 142 q 440 247 411 142 q 456 422 456 304 l 456 748 l 656 748 l 656 417 m 579 1039 l 378 823 l 279 823 l 401 1039 l 579 1039 "},z:{x_min:0,x_max:663.890625,ha:753,o:"m 663 0 l 0 0 l 0 154 l 411 591 l 25 591 l 25 749 l 650 749 l 650 584 l 245 165 l 663 165 l 663 0 "},"™":{x_min:0,x_max:951,ha:1063,o:"m 405 921 l 255 921 l 255 506 l 149 506 l 149 921 l 0 921 l 0 1013 l 405 1013 l 405 921 m 951 506 l 852 506 l 852 916 l 750 506 l 643 506 l 539 915 l 539 506 l 442 506 l 442 1013 l 595 1012 l 695 625 l 794 1013 l 951 1013 l 951 506 "},"ή":{x_min:0,x_max:669,ha:779,o:"m 669 -278 l 469 -278 l 469 390 q 448 526 469 473 q 348 606 417 606 q 244 553 288 606 q 201 441 201 501 l 201 0 l 0 0 l 0 749 l 201 749 l 201 665 q 301 744 244 715 q 423 774 359 774 q 606 685 538 774 q 669 484 669 603 l 669 -278 m 495 1039 l 293 823 l 195 823 l 317 1039 l 495 1039 "},"Θ":{x_min:0,x_max:993,ha:1092,o:"m 497 -29 q 133 127 272 -29 q 0 505 0 277 q 133 883 0 733 q 497 1040 272 1040 q 861 883 722 1040 q 993 505 993 733 q 861 127 993 277 q 497 -29 722 -29 m 497 154 q 711 266 631 154 q 782 506 782 367 q 712 746 782 648 q 497 858 634 858 q 281 746 361 858 q 211 506 211 648 q 280 266 211 365 q 497 154 359 154 m 676 430 l 316 430 l 316 593 l 676 593 l 676 430 "},"®":{x_min:3,x_max:1007,ha:1104,o:"m 507 -6 q 129 153 269 -6 q 3 506 3 298 q 127 857 3 713 q 502 1017 266 1017 q 880 855 740 1017 q 1007 502 1007 711 q 882 152 1007 295 q 507 -6 743 -6 m 502 934 q 184 800 302 934 q 79 505 79 680 q 184 210 79 331 q 501 76 302 76 q 819 210 701 76 q 925 507 925 331 q 820 800 925 682 q 502 934 704 934 m 782 190 l 639 190 q 627 225 632 202 q 623 285 623 248 l 623 326 q 603 411 623 384 q 527 439 584 439 l 388 439 l 388 190 l 257 190 l 257 829 l 566 829 q 709 787 654 829 q 772 654 772 740 q 746 559 772 604 q 675 497 720 514 q 735 451 714 483 q 756 341 756 419 l 756 299 q 760 244 756 265 q 782 212 764 223 l 782 190 m 546 718 l 388 718 l 388 552 l 541 552 q 612 572 584 552 q 641 635 641 593 q 614 695 641 672 q 546 718 587 718 "},"~":{x_min:0,x_max:851,ha:949,o:"m 851 968 q 795 750 851 831 q 599 656 730 656 q 406 744 506 656 q 259 832 305 832 q 162 775 193 832 q 139 656 139 730 l 0 656 q 58 871 0 787 q 251 968 124 968 q 442 879 341 968 q 596 791 544 791 q 691 849 663 791 q 712 968 712 892 l 851 968 "},"Ε":{x_min:0,x_max:761.546875,ha:824,o:"m 761 0 l 0 0 l 0 1012 l 735 1012 l 735 836 l 206 836 l 206 621 l 690 621 l 690 446 l 206 446 l 206 186 l 761 186 l 761 0 "},"³":{x_min:0,x_max:467,ha:564,o:"m 467 555 q 393 413 467 466 q 229 365 325 365 q 70 413 134 365 q 0 565 0 467 l 123 565 q 163 484 131 512 q 229 461 190 461 q 299 486 269 461 q 329 553 329 512 q 281 627 329 607 q 187 641 248 641 l 187 722 q 268 737 237 722 q 312 804 312 758 q 285 859 312 837 q 224 882 259 882 q 165 858 189 882 q 135 783 140 834 l 12 783 q 86 930 20 878 q 230 976 145 976 q 379 931 314 976 q 444 813 444 887 q 423 744 444 773 q 365 695 402 716 q 439 640 412 676 q 467 555 467 605 "},"[":{x_min:0,x_max:347.21875,ha:444,o:"m 347 -300 l 0 -300 l 0 1013 l 347 1013 l 347 866 l 188 866 l 188 -154 l 347 -154 l 347 -300 "},L:{x_min:0,x_max:704.171875,ha:763,o:"m 704 0 l 0 0 l 0 1013 l 208 1013 l 208 186 l 704 186 l 704 0 "},"σ":{x_min:0,x_max:851.3125,ha:940,o:"m 851 594 l 712 594 q 761 369 761 485 q 658 83 761 191 q 379 -25 555 -25 q 104 87 208 -25 q 0 372 0 200 q 103 659 0 544 q 378 775 207 775 q 464 762 407 775 q 549 750 521 750 l 851 750 l 851 594 m 379 142 q 515 216 466 142 q 557 373 557 280 q 515 530 557 465 q 379 608 465 608 q 244 530 293 608 q 203 373 203 465 q 244 218 203 283 q 379 142 293 142 "},"ζ":{x_min:0,x_max:622,ha:701,o:"m 622 -32 q 604 -158 622 -98 q 551 -278 587 -218 l 373 -278 q 426 -180 406 -229 q 446 -80 446 -131 q 421 -22 446 -37 q 354 -8 397 -8 q 316 -9 341 -8 q 280 -11 291 -11 q 75 69 150 -11 q 0 283 0 150 q 87 596 0 437 q 291 856 162 730 l 47 856 l 47 1013 l 592 1013 l 592 904 q 317 660 422 800 q 197 318 197 497 q 306 141 197 169 q 510 123 408 131 q 622 -32 622 102 "},"θ":{x_min:0,x_max:714,ha:817,o:"m 357 1022 q 633 833 534 1022 q 714 486 714 679 q 634 148 714 288 q 354 -25 536 -25 q 79 147 175 -25 q 0 481 0 288 q 79 831 0 679 q 357 1022 177 1022 m 510 590 q 475 763 510 687 q 351 862 430 862 q 233 763 272 862 q 204 590 204 689 l 510 590 m 510 440 l 204 440 q 233 251 204 337 q 355 131 274 131 q 478 248 434 131 q 510 440 510 337 "},"Ο":{x_min:0,x_max:995,ha:1092,o:"m 497 -29 q 133 127 272 -29 q 0 505 0 277 q 132 883 0 733 q 497 1040 270 1040 q 861 883 722 1040 q 995 505 995 733 q 862 127 995 277 q 497 -29 724 -29 m 497 154 q 711 266 632 154 q 781 506 781 365 q 711 745 781 647 q 497 857 632 857 q 283 747 361 857 q 213 506 213 647 q 282 266 213 365 q 497 154 361 154 "},"Γ":{x_min:0,x_max:703.84375,ha:742,o:"m 703 836 l 208 836 l 208 0 l 0 0 l 0 1012 l 703 1012 l 703 836 "}," ":{x_min:0,x_max:0,ha:375},"%":{x_min:0,x_max:1111,ha:1213,o:"m 861 484 q 1048 404 979 484 q 1111 228 1111 332 q 1048 51 1111 123 q 859 -29 979 -29 q 672 50 740 -29 q 610 227 610 122 q 672 403 610 331 q 861 484 741 484 m 861 120 q 939 151 911 120 q 967 226 967 183 q 942 299 967 270 q 861 333 912 333 q 783 301 811 333 q 756 226 756 269 q 783 151 756 182 q 861 120 810 120 m 904 984 l 316 -28 l 205 -29 l 793 983 l 904 984 m 250 984 q 436 904 366 984 q 499 730 499 832 q 436 552 499 626 q 248 472 366 472 q 62 552 132 472 q 0 728 0 624 q 62 903 0 831 q 250 984 132 984 m 249 835 q 169 801 198 835 q 140 725 140 768 q 167 652 140 683 q 247 621 195 621 q 327 654 298 621 q 357 730 357 687 q 329 803 357 772 q 249 835 301 835 "},P:{x_min:0,x_max:771,ha:838,o:"m 208 361 l 208 0 l 0 0 l 0 1013 l 450 1013 q 682 919 593 1013 q 771 682 771 826 q 687 452 771 544 q 466 361 604 361 l 208 361 m 421 837 l 208 837 l 208 544 l 410 544 q 525 579 480 544 q 571 683 571 615 q 527 792 571 747 q 421 837 484 837 "},"Έ":{x_min:0,x_max:1172.546875,ha:1235,o:"m 1172 0 l 411 0 l 411 1012 l 1146 1012 l 1146 836 l 617 836 l 617 621 l 1101 621 l 1101 446 l 617 446 l 617 186 l 1172 186 l 1172 0 m 313 1035 l 98 780 l 0 780 l 136 1035 l 313 1035 "},"Ώ":{x_min:.4375,x_max:1189.546875,ha:1289,o:"m 1189 0 l 770 0 l 770 199 q 897 369 849 263 q 945 580 945 474 q 879 778 945 706 q 685 855 810 855 q 492 773 561 855 q 424 563 424 691 q 470 360 424 458 q 600 199 517 262 l 600 0 l 180 0 l 180 176 l 383 176 q 258 355 304 251 q 213 569 213 459 q 346 908 213 776 q 686 1040 479 1040 q 1025 912 892 1040 q 1158 578 1158 785 q 1112 362 1158 467 q 986 176 1067 256 l 1189 176 l 1189 0 m 314 1092 l 99 837 l 0 837 l 136 1092 l 314 1092 "},_:{x_min:61.109375,x_max:766.671875,ha:828,o:"m 766 -333 l 61 -333 l 61 -190 l 766 -190 l 766 -333 "},"Ϊ":{x_min:-56,x_max:342,ha:503,o:"m 342 1046 l 186 1046 l 186 1215 l 342 1215 l 342 1046 m 101 1046 l -56 1046 l -56 1215 l 101 1215 l 101 1046 m 249 0 l 41 0 l 41 1012 l 249 1012 l 249 0 "},"+":{x_min:43,x_max:784,ha:828,o:"m 784 353 l 483 353 l 483 0 l 343 0 l 343 353 l 43 353 l 43 489 l 343 489 l 343 840 l 483 840 l 483 489 l 784 489 l 784 353 "},"½":{x_min:0,x_max:1090,ha:1188,o:"m 1090 380 q 992 230 1090 301 q 779 101 886 165 q 822 94 784 95 q 924 93 859 93 l 951 93 l 973 93 l 992 93 l 1009 93 q 1046 93 1027 93 q 1085 93 1066 93 l 1085 0 l 650 0 l 654 38 q 815 233 665 137 q 965 376 965 330 q 936 436 965 412 q 869 461 908 461 q 806 435 831 461 q 774 354 780 409 l 659 354 q 724 505 659 451 q 870 554 783 554 q 1024 506 958 554 q 1090 380 1090 459 m 868 998 l 268 -28 l 154 -27 l 757 999 l 868 998 m 272 422 l 147 422 l 147 799 l 0 799 l 0 875 q 126 900 91 875 q 170 973 162 926 l 272 973 l 272 422 "},"Ρ":{x_min:0,x_max:771,ha:838,o:"m 208 361 l 208 0 l 0 0 l 0 1012 l 450 1012 q 682 919 593 1012 q 771 681 771 826 q 687 452 771 544 q 466 361 604 361 l 208 361 m 422 836 l 209 836 l 209 544 l 410 544 q 525 579 480 544 q 571 683 571 614 q 527 791 571 747 q 422 836 484 836 "},"'":{x_min:0,x_max:192,ha:289,o:"m 192 834 q 137 692 192 751 q 0 626 82 632 l 0 697 q 101 830 101 726 l 0 830 l 0 1013 l 192 1013 l 192 834 "},"ª":{x_min:0,x_max:350,ha:393,o:"m 350 625 l 245 625 q 237 648 241 636 q 233 672 233 661 q 117 611 192 611 q 33 643 66 611 q 0 727 0 675 q 116 846 0 828 q 233 886 233 864 q 211 919 233 907 q 168 931 190 931 q 108 877 108 931 l 14 877 q 56 977 14 942 q 165 1013 98 1013 q 270 987 224 1013 q 329 903 329 955 l 329 694 q 332 661 329 675 q 350 641 336 648 l 350 625 m 233 774 l 233 809 q 151 786 180 796 q 97 733 97 768 q 111 700 97 712 q 149 689 126 689 q 210 713 187 689 q 233 774 233 737 "},"΅":{x_min:57,x_max:584,ha:753,o:"m 584 810 l 455 810 l 455 952 l 584 952 l 584 810 m 521 1064 l 305 810 l 207 810 l 343 1064 l 521 1064 m 186 810 l 57 810 l 57 952 l 186 952 l 186 810 "},T:{x_min:0,x_max:809,ha:894,o:"m 809 831 l 509 831 l 509 0 l 299 0 l 299 831 l 0 831 l 0 1013 l 809 1013 l 809 831 "},"Φ":{x_min:0,x_max:949,ha:1032,o:"m 566 0 l 385 0 l 385 121 q 111 230 222 121 q 0 508 0 340 q 112 775 0 669 q 385 892 219 875 l 385 1013 l 566 1013 l 566 892 q 836 776 732 875 q 949 507 949 671 q 838 231 949 341 q 566 121 728 121 l 566 0 m 566 285 q 701 352 650 285 q 753 508 753 419 q 703 658 753 597 q 566 729 653 720 l 566 285 m 385 285 l 385 729 q 245 661 297 717 q 193 516 193 604 q 246 356 193 427 q 385 285 300 285 "},j:{x_min:-45.828125,x_max:242,ha:361,o:"m 242 830 l 42 830 l 42 1013 l 242 1013 l 242 830 m 242 -119 q 180 -267 242 -221 q 20 -308 127 -308 l -45 -308 l -45 -140 l -24 -140 q 25 -130 8 -140 q 42 -88 42 -120 l 42 748 l 242 748 l 242 -119 "},"Σ":{x_min:0,x_max:772.21875,ha:849,o:"m 772 0 l 0 0 l 0 140 l 368 526 l 18 862 l 18 1012 l 740 1012 l 740 836 l 315 836 l 619 523 l 298 175 l 772 175 l 772 0 "},1:{x_min:197.609375,x_max:628,ha:828,o:"m 628 0 l 434 0 l 434 674 l 197 674 l 197 810 q 373 837 318 810 q 468 984 450 876 l 628 984 l 628 0 "},"›":{x_min:36.109375,x_max:792,ha:828,o:"m 792 352 l 36 17 l 36 168 l 594 420 l 36 672 l 36 823 l 792 487 l 792 352 "},"<":{x_min:35.984375,x_max:791.671875,ha:828,o:"m 791 17 l 36 352 l 35 487 l 791 823 l 791 672 l 229 421 l 791 168 l 791 17 "},"£":{x_min:0,x_max:716.546875,ha:814,o:"m 716 38 q 603 -9 658 5 q 502 -24 548 -24 q 398 -10 451 -24 q 239 25 266 25 q 161 12 200 25 q 77 -29 122 0 l 0 113 q 110 211 81 174 q 151 315 151 259 q 117 440 151 365 l 0 440 l 0 515 l 73 515 q 35 610 52 560 q 15 710 15 671 q 119 910 15 831 q 349 984 216 984 q 570 910 480 984 q 693 668 674 826 l 501 668 q 455 791 501 746 q 353 830 414 830 q 256 795 298 830 q 215 705 215 760 q 249 583 215 655 q 283 515 266 548 l 479 515 l 479 440 l 309 440 q 316 394 313 413 q 319 355 319 374 q 287 241 319 291 q 188 135 263 205 q 262 160 225 152 q 332 168 298 168 q 455 151 368 168 q 523 143 500 143 q 588 152 558 143 q 654 189 617 162 l 716 38 "},t:{x_min:0,x_max:412,ha:511,o:"m 412 -6 q 349 -8 391 -6 q 287 -11 307 -11 q 137 38 177 -11 q 97 203 97 87 l 97 609 l 0 609 l 0 749 l 97 749 l 97 951 l 297 951 l 297 749 l 412 749 l 412 609 l 297 609 l 297 191 q 315 152 297 162 q 366 143 334 143 q 389 143 378 143 q 412 143 400 143 l 412 -6 "},"¬":{x_min:0,x_max:704,ha:801,o:"m 704 93 l 551 93 l 551 297 l 0 297 l 0 450 l 704 450 l 704 93 "},"λ":{x_min:0,x_max:701.390625,ha:775,o:"m 701 0 l 491 0 l 345 444 l 195 0 l 0 0 l 238 697 l 131 1013 l 334 1013 l 701 0 "},W:{x_min:0,x_max:1291.671875,ha:1399,o:"m 1291 1013 l 1002 0 l 802 0 l 645 777 l 490 0 l 288 0 l 0 1013 l 215 1013 l 388 298 l 534 1012 l 757 1013 l 904 299 l 1076 1013 l 1291 1013 "},">":{x_min:36.109375,x_max:792,ha:828,o:"m 792 352 l 36 17 l 36 168 l 594 420 l 36 672 l 36 823 l 792 487 l 792 352 "},v:{x_min:0,x_max:740.28125,ha:828,o:"m 740 749 l 473 0 l 266 0 l 0 749 l 222 749 l 373 211 l 529 749 l 740 749 "},"τ":{x_min:.28125,x_max:618.734375,ha:699,o:"m 618 593 l 409 593 l 409 0 l 210 0 l 210 593 l 0 593 l 0 749 l 618 749 l 618 593 "},"ξ":{x_min:0,x_max:640,ha:715,o:"m 640 -14 q 619 -157 640 -84 q 563 -299 599 -230 l 399 -299 q 442 -194 433 -223 q 468 -85 468 -126 q 440 -25 468 -41 q 368 -10 412 -10 q 333 -11 355 -10 q 302 -13 311 -13 q 91 60 179 -13 q 0 259 0 138 q 56 426 0 354 q 201 530 109 493 q 106 594 144 553 q 65 699 65 642 q 94 787 65 747 q 169 856 123 828 l 22 856 l 22 1013 l 597 1013 l 597 856 l 497 857 q 345 840 398 857 q 257 736 257 812 q 366 614 257 642 q 552 602 416 602 l 552 446 l 513 446 q 313 425 379 446 q 199 284 199 389 q 312 162 199 184 q 524 136 418 148 q 640 -14 640 105 "},"&":{x_min:-1,x_max:910.109375,ha:1007,o:"m 910 -1 l 676 -1 l 607 83 q 291 -47 439 -47 q 50 100 135 -47 q -1 273 -1 190 q 51 431 -1 357 q 218 568 104 505 q 151 661 169 629 q 120 769 120 717 q 201 951 120 885 q 382 1013 276 1013 q 555 957 485 1013 q 635 789 635 894 q 584 644 635 709 q 468 539 548 597 l 615 359 q 664 527 654 440 l 844 527 q 725 223 824 359 l 910 -1 m 461 787 q 436 848 461 826 q 381 870 412 870 q 325 849 349 870 q 301 792 301 829 q 324 719 301 757 q 372 660 335 703 q 430 714 405 680 q 461 787 461 753 m 500 214 l 318 441 q 198 286 198 363 q 225 204 198 248 q 347 135 268 135 q 425 153 388 135 q 500 214 462 172 "},"Λ":{x_min:0,x_max:894.453125,ha:974,o:"m 894 0 l 666 0 l 447 757 l 225 0 l 0 0 l 344 1013 l 547 1013 l 894 0 "},I:{x_min:41,x_max:249,ha:365,o:"m 249 0 l 41 0 l 41 1013 l 249 1013 l 249 0 "},G:{x_min:0,x_max:971,ha:1057,o:"m 971 -1 l 829 -1 l 805 118 q 479 -29 670 -29 q 126 133 261 -29 q 0 509 0 286 q 130 884 0 737 q 493 1040 268 1040 q 790 948 659 1040 q 961 698 920 857 l 736 698 q 643 813 709 769 q 500 857 578 857 q 285 746 364 857 q 213 504 213 644 q 285 263 213 361 q 505 154 365 154 q 667 217 598 154 q 761 374 736 280 l 548 374 l 548 548 l 971 548 l 971 -1 "},"ΰ":{x_min:0,x_max:655,ha:767,o:"m 583 810 l 454 810 l 454 952 l 583 952 l 583 810 m 186 810 l 57 809 l 57 952 l 186 952 l 186 810 m 516 1039 l 315 823 l 216 823 l 338 1039 l 516 1039 m 655 417 q 567 55 655 146 q 326 -25 489 -25 q 59 97 137 -25 q 0 369 0 192 l 0 748 l 200 748 l 201 369 q 218 222 201 269 q 326 142 245 142 q 439 247 410 142 q 455 422 455 304 l 455 748 l 655 748 l 655 417 "},"`":{x_min:0,x_max:190,ha:288,o:"m 190 654 l 0 654 l 0 830 q 55 970 0 909 q 190 1040 110 1031 l 190 969 q 111 922 134 952 q 88 836 88 892 l 190 836 l 190 654 "},"·":{x_min:0,x_max:207,ha:304,o:"m 207 528 l 0 528 l 0 735 l 207 735 l 207 528 "},"Υ":{x_min:-.21875,x_max:836.171875,ha:914,o:"m 836 1013 l 532 376 l 532 0 l 322 0 l 322 376 l 0 1013 l 208 1013 l 427 576 l 626 1013 l 836 1013 "},r:{x_min:0,x_max:431.9375,ha:513,o:"m 431 564 q 269 536 320 564 q 200 395 200 498 l 200 0 l 0 0 l 0 748 l 183 748 l 183 618 q 285 731 224 694 q 431 768 345 768 l 431 564 "},x:{x_min:0,x_max:738.890625,ha:826,o:"m 738 0 l 504 0 l 366 238 l 230 0 l 0 0 l 252 382 l 11 749 l 238 749 l 372 522 l 502 749 l 725 749 l 488 384 l 738 0 "},"μ":{x_min:0,x_max:647,ha:754,o:"m 647 0 l 477 0 l 477 68 q 411 9 448 30 q 330 -11 374 -11 q 261 3 295 -11 q 199 43 226 18 l 199 -278 l 0 -278 l 0 749 l 199 749 l 199 358 q 216 222 199 268 q 322 152 244 152 q 435 240 410 152 q 448 401 448 283 l 448 749 l 647 749 l 647 0 "},h:{x_min:0,x_max:669,ha:782,o:"m 669 0 l 469 0 l 469 390 q 449 526 469 472 q 353 607 420 607 q 248 554 295 607 q 201 441 201 501 l 201 0 l 0 0 l 0 1013 l 201 1013 l 201 665 q 303 743 245 715 q 425 772 362 772 q 609 684 542 772 q 669 484 669 605 l 669 0 "},".":{x_min:0,x_max:206,ha:303,o:"m 206 0 l 0 0 l 0 207 l 206 207 l 206 0 "},"φ":{x_min:-1,x_max:921,ha:990,o:"m 542 -278 l 367 -278 l 367 -22 q 99 92 200 -22 q -1 376 -1 206 q 72 627 -1 520 q 288 769 151 742 l 288 581 q 222 495 243 550 q 202 378 202 439 q 240 228 202 291 q 367 145 285 157 l 367 776 l 515 776 q 807 667 694 776 q 921 379 921 558 q 815 93 921 209 q 542 -22 709 -22 l 542 -278 m 542 145 q 672 225 625 145 q 713 381 713 291 q 671 536 713 470 q 542 611 624 611 l 542 145 "},";":{x_min:0,x_max:208,ha:306,o:"m 208 528 l 0 528 l 0 735 l 208 735 l 208 528 m 208 6 q 152 -151 208 -89 q 0 -238 96 -212 l 0 -158 q 87 -100 61 -136 q 113 0 113 -65 l 0 0 l 0 207 l 208 207 l 208 6 "},f:{x_min:0,x_max:424,ha:525,o:"m 424 609 l 300 609 l 300 0 l 107 0 l 107 609 l 0 609 l 0 749 l 107 749 q 145 949 107 894 q 328 1019 193 1019 l 424 1015 l 424 855 l 362 855 q 312 841 324 855 q 300 797 300 827 q 300 773 300 786 q 300 749 300 761 l 424 749 l 424 609 "},"“":{x_min:0,x_max:468,ha:567,o:"m 190 631 l 0 631 l 0 807 q 55 947 0 885 q 190 1017 110 1010 l 190 947 q 88 813 88 921 l 190 813 l 190 631 m 468 631 l 278 631 l 278 807 q 333 947 278 885 q 468 1017 388 1010 l 468 947 q 366 813 366 921 l 468 813 l 468 631 "},A:{x_min:0,x_max:966.671875,ha:1069,o:"m 966 0 l 747 0 l 679 208 l 286 208 l 218 0 l 0 0 l 361 1013 l 600 1013 l 966 0 m 623 376 l 480 810 l 340 376 l 623 376 "},6:{x_min:57,x_max:771,ha:828,o:"m 744 734 l 544 734 q 500 802 533 776 q 425 828 466 828 q 315 769 359 828 q 264 571 264 701 q 451 638 343 638 q 691 537 602 638 q 771 315 771 449 q 683 79 771 176 q 420 -29 586 -29 q 134 123 227 -29 q 57 455 57 250 q 184 865 57 721 q 452 988 293 988 q 657 916 570 988 q 744 734 744 845 m 426 128 q 538 178 498 128 q 578 300 578 229 q 538 422 578 372 q 415 479 493 479 q 303 430 342 479 q 264 313 264 381 q 308 184 264 240 q 426 128 352 128 "},"‘":{x_min:0,x_max:190,ha:289,o:"m 190 631 l 0 631 l 0 807 q 55 947 0 885 q 190 1017 110 1010 l 190 947 q 88 813 88 921 l 190 813 l 190 631 "},"ϊ":{x_min:-55,x_max:337,ha:389,o:"m 337 810 l 208 810 l 208 952 l 337 952 l 337 810 m 74 810 l -55 810 l -55 952 l 74 952 l 74 810 m 242 0 l 42 0 l 42 748 l 242 748 l 242 0 "},"π":{x_min:.5,x_max:838.890625,ha:938,o:"m 838 593 l 750 593 l 750 0 l 549 0 l 549 593 l 287 593 l 287 0 l 88 0 l 88 593 l 0 593 l 0 749 l 838 749 l 838 593 "},"ά":{x_min:-1,x_max:722,ha:835,o:"m 722 0 l 531 0 l 530 101 q 433 8 491 41 q 304 -25 375 -25 q 72 104 157 -25 q -1 372 -1 216 q 72 643 -1 530 q 308 775 158 775 q 433 744 375 775 q 528 656 491 713 l 528 749 l 722 749 l 722 0 m 361 601 q 233 527 277 601 q 196 375 196 464 q 232 224 196 288 q 358 144 277 144 q 487 217 441 144 q 528 370 528 281 q 489 523 528 457 q 361 601 443 601 m 579 1039 l 377 823 l 279 823 l 401 1039 l 579 1039 "},O:{x_min:0,x_max:994,ha:1094,o:"m 497 -29 q 133 127 272 -29 q 0 505 0 277 q 131 883 0 733 q 497 1040 270 1040 q 860 883 721 1040 q 994 505 994 733 q 862 127 994 277 q 497 -29 723 -29 m 497 154 q 710 266 631 154 q 780 506 780 365 q 710 745 780 647 q 497 857 631 857 q 283 747 361 857 q 213 506 213 647 q 282 266 213 365 q 497 154 361 154 "},n:{x_min:0,x_max:669,ha:782,o:"m 669 0 l 469 0 l 469 452 q 442 553 469 513 q 352 601 412 601 q 245 553 290 601 q 200 441 200 505 l 200 0 l 0 0 l 0 748 l 194 748 l 194 659 q 289 744 230 713 q 416 775 349 775 q 600 700 531 775 q 669 509 669 626 l 669 0 "},3:{x_min:61,x_max:767,ha:828,o:"m 767 290 q 653 51 767 143 q 402 -32 548 -32 q 168 48 262 -32 q 61 300 61 140 l 250 300 q 298 173 250 219 q 405 132 343 132 q 514 169 471 132 q 563 282 563 211 q 491 405 563 369 q 343 432 439 432 l 343 568 q 472 592 425 568 q 534 701 534 626 q 493 793 534 758 q 398 829 453 829 q 306 789 344 829 q 268 669 268 749 l 80 669 q 182 909 80 823 q 410 986 274 986 q 633 916 540 986 q 735 719 735 840 q 703 608 735 656 q 615 522 672 561 q 727 427 687 486 q 767 290 767 369 "},9:{x_min:58,x_max:769,ha:828,o:"m 769 492 q 646 90 769 232 q 384 -33 539 -33 q 187 35 271 -33 q 83 224 98 107 l 282 224 q 323 154 286 182 q 404 127 359 127 q 513 182 471 127 q 563 384 563 248 q 475 335 532 355 q 372 315 418 315 q 137 416 224 315 q 58 642 58 507 q 144 877 58 781 q 407 984 239 984 q 694 827 602 984 q 769 492 769 699 m 416 476 q 525 521 488 476 q 563 632 563 566 q 521 764 563 709 q 403 826 474 826 q 297 773 337 826 q 258 649 258 720 q 295 530 258 577 q 416 476 339 476 "},l:{x_min:41,x_max:240,ha:363,o:"m 240 0 l 41 0 l 41 1013 l 240 1013 l 240 0 "},"¤":{x_min:40.265625,x_max:727.203125,ha:825,o:"m 727 792 l 594 659 q 620 552 620 609 q 598 459 620 504 l 725 331 l 620 224 l 491 352 q 382 331 443 331 q 273 352 322 331 l 144 224 l 40 330 l 167 459 q 147 552 147 501 q 172 658 147 608 l 40 794 l 147 898 l 283 759 q 383 776 330 776 q 482 759 434 776 l 620 898 l 727 792 m 383 644 q 308 617 334 644 q 283 551 283 590 q 309 489 283 517 q 381 462 335 462 q 456 488 430 462 q 482 554 482 515 q 455 616 482 588 q 383 644 429 644 "},"κ":{x_min:0,x_max:691.84375,ha:779,o:"m 691 0 l 479 0 l 284 343 l 196 252 l 196 0 l 0 0 l 0 749 l 196 749 l 196 490 l 440 749 l 677 749 l 416 479 l 691 0 "},4:{x_min:53,x_max:775.21875,ha:828,o:"m 775 213 l 660 213 l 660 0 l 470 0 l 470 213 l 53 213 l 53 384 l 416 958 l 660 958 l 660 370 l 775 370 l 775 213 m 474 364 l 474 786 l 204 363 l 474 364 "},p:{x_min:0,x_max:722,ha:824,o:"m 415 -26 q 287 4 346 -26 q 192 92 228 34 l 192 -298 l 0 -298 l 0 750 l 192 750 l 192 647 q 289 740 230 706 q 416 775 347 775 q 649 645 566 775 q 722 375 722 534 q 649 106 722 218 q 415 -26 564 -26 m 363 603 q 232 529 278 603 q 192 375 192 465 q 230 222 192 286 q 360 146 276 146 q 487 221 441 146 q 526 371 526 285 q 488 523 526 458 q 363 603 443 603 "},"‡":{x_min:0,x_max:809,ha:894,o:"m 299 621 l 0 621 l 0 804 l 299 804 l 299 1011 l 509 1011 l 509 804 l 809 804 l 809 621 l 509 621 l 509 387 l 809 387 l 809 205 l 509 205 l 509 0 l 299 0 l 299 205 l 0 205 l 0 387 l 299 387 l 299 621 "},"ψ":{x_min:0,x_max:875,ha:979,o:"m 522 142 q 657 274 620 163 q 671 352 671 316 l 671 748 l 875 748 l 875 402 q 806 134 875 240 q 525 -22 719 -1 l 525 -278 l 349 -278 l 349 -22 q 65 135 152 -1 q 0 402 0 238 l 0 748 l 204 748 l 204 352 q 231 240 204 295 q 353 142 272 159 l 353 922 l 524 922 l 522 142 "},"η":{x_min:0,x_max:669,ha:779,o:"m 669 -278 l 469 -278 l 469 390 q 448 526 469 473 q 348 606 417 606 q 244 553 288 606 q 201 441 201 501 l 201 0 l 0 0 l 0 749 l 201 749 l 201 665 q 301 744 244 715 q 423 774 359 774 q 606 685 538 774 q 669 484 669 603 l 669 -278 "}},cssFontWeight:"bold",ascender:1216,underlinePosition:-100,cssFontStyle:"normal",boundingBox:{yMin:-333,xMin:-162,yMax:1216,xMax:1681},resolution:1e3,original_font_information:{postscript_name:"Helvetiker-Bold",version_string:"Version 1.00 2004 initial release",vendor_url:"http://www.magenta.gr",full_font_name:"Helvetiker Bold",font_family_name:"Helvetiker",copyright:"Copyright (c) Magenta ltd, 2004.",description:"",trademark:"",designer:"",designer_url:"",unique_font_identifier:"Magenta ltd:Helvetiker Bold:22-10-104",license_url:"http://www.ellak.gr/fonts/MgOpen/license.html",license_description:'Copyright (c) 2004 by MAGENTA Ltd. All Rights Reserved.\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy of the fonts accompanying this license ("Fonts") and associated documentation files (the "Font Software"), to reproduce and distribute the Font Software, including without limitation the rights to use, copy, merge, publish, distribute, and/or sell copies of the Font Software, and to permit persons to whom the Font Software is furnished to do so, subject to the following conditions: \r\n\r\nThe above copyright and this permission notice shall be included in all copies of one or more of the Font Software typefaces.\r\n\r\nThe Font Software may be modified, altered, or added to, and in particular the designs of glyphs or characters in the Fonts may be modified and additional glyphs or characters may be added to the Fonts, only if the fonts are renamed to names not containing the word "MgOpen", or if the modifications are accepted for inclusion in the Font Software itself by the each appointed Administrator.\r\n\r\nThis License becomes null and void to the extent applicable to Fonts or Font Software that has been modified and is distributed under the "MgOpen" name.\r\n\r\nThe Font Software may be sold as part of a larger software package but no copy of one or more of the Font Software typefaces may be sold by itself. \r\n\r\nTHE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL MAGENTA OR PERSONS OR BODIES IN CHARGE OF ADMINISTRATION AND MAINTENANCE OF THE FONT SOFTWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.',manufacturer_name:"Magenta ltd",font_sub_family_name:"Bold"},descender:-334,familyName:"Helvetiker",lineHeight:1549,underlineThickness:50};exports.helvetiker=l;
|
|
43
|
-
},{}],"E9Yg":[function(require,module,exports) {
|
|
44
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=o(require("three")),r=require("./assets/font");function t(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return t=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=t();if(r&&r.has(e))return r.get(e);var o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var i=n?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(o,a,i):o[a]=e[a]}return o.default=e,r&&r.set(e,o),o}class n{constructor(e){this.type=e}Basic(r={color:16711680}){return new e.MeshPhongMaterial(r)}Point(r={size:4,color:16711680,sizeAttenuation:!1}){return new e.PointsMaterial(r)}Text(r={color:16711680}){return new e.MeshBasicMaterial(r)}TextFont(t){return(new e.FontLoader).parse(t||r.helvetiker)}Terrain(r={color:16448250,side:e.DoubleSide,wireframe:!0}){return new e.MeshPhongMaterial(r)}Ground(r={transparent:!1,opacity:1,color:1316901,specular:1514284,reflectivity:0}){return new e.MeshPhongMaterial(r)}GeoMap(r={transparent:!1,opacity:1,color:3027778,specular:3685713,reflectivity:.6}){return new e.MeshPhongMaterial(r)}GeoBuilding(r={color:7898290,specular:16448250,reflectivity:.6}){return new e.MeshPhongMaterial(r)}GeoBorder(r={color:4841215}){return new e.LineBasicMaterial(r)}GeoRoad(r={color:1787526}){return new e.LineBasicMaterial(r)}GeoRoadAnimation(r={color:16750848}){return new e.LineDashedMaterial(r)}GeoWater(r,t,o=!0){const n={textureWidth:.5,textureHeight:.5,waterNormals:a(t),alpha:1,sunColor:14543871,waterColor:7909375,distortionScale:2};return n.fog=o,n.sunDirection=r?r.position.clone().normalize():new e.Vector3(0,0,0),n}}function a(r){if(r)return(new e.TextureLoader).load(r,function(r){r.wrapS=r.wrapT=e.RepeatWrapping})}exports.default=n;
|
|
45
|
-
},{"three":"dKqR","./assets/font":"JmJg"}],"MwKH":[function(require,module,exports) {
|
|
46
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Shapes=void 0;var e=i(require("three")),t=o(require("../materials/CUBE_Material"));function o(e){return e&&e.__esModule?e:{default:e}}function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function i(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var s=i?Object.getOwnPropertyDescriptor(e,n):null;s&&(s.get||s.set)?Object.defineProperty(o,n,s):o[n]=e[n]}return o.default=e,t&&t.set(e,o),o}class n{constructor(t="shape",o=new e.Vector3(0,0,0)){this.name=t,this.position=o,this.position.x=-this.position.x}Box(o=1,r=65280){const i=new e.BoxBufferGeometry(o,o,o),n=(new t.default).Basic({color:r}),s=new e.Mesh(i,n);return s.position.set(this.position.x,this.position.y,this.position.z),s}Sphere(o=1,r=16737792){o=parseInt(o);const i=new e.SphereBufferGeometry(o/2,o/2*32,o/2*32),n=(new t.default).Basic({color:r}),s=new e.Mesh(i,n);return s.position.set(this.position.x,this.position.y,this.position.z),s}Cylinder(o=1,r=16737792){const i=new e.CylinderBufferGeometry(o/4,o/4,o,32*o),n=(new t.default).Basic({color:r}),s=new e.Mesh(i,n);return s.position.set(this.position.x,this.position.y,this.position.z),s}}exports.Shapes=n;
|
|
47
|
-
},{"three":"dKqR","../materials/CUBE_Material":"E9Yg"}],"jlY8":[function(require,module,exports) {
|
|
48
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.areaConversion=exports.timeConversion=exports.distanceConversion=exports.altitudeKeys=exports.latitudeKeys=exports.longitudeKeys=exports.MAXLON=exports.MINLON=exports.MAXLAT=exports.MINLAT=exports.earthRadius=exports.sexagesimalPattern=void 0;var e=/^([0-9]{1,3})°\s*([0-9]{1,3}(?:\.(?:[0-9]{1,}))?)['′]\s*(([0-9]{1,3}(\.([0-9]{1,}))?)["″]\s*)?([NEOSW]?)$/;exports.sexagesimalPattern=e;var t=6378137;exports.earthRadius=t;var s=-90;exports.MINLAT=s;var r=90;exports.MAXLAT=r;var o=-180;exports.MINLON=o;var a=180;exports.MAXLON=a;var i=["lng","lon","longitude",0];exports.longitudeKeys=i;var n=["lat","latitude",1];exports.latitudeKeys=n;var x=["alt","altitude","elevation","elev",2];exports.altitudeKeys=x;var p={m:1,km:.001,cm:100,mm:1e3,mi:1/1609.344,sm:1/1852.216,ft:100/30.48,in:100/2.54,yd:1/.9144};exports.distanceConversion=p;var v={m:60,h:3600,d:86400};exports.timeConversion=v;var d={m2:1,km2:1e-6,ha:1e-4,a:.01,ft2:10.763911,yd2:1.19599,in2:1550.0031};exports.areaConversion=d,d.sqm=d.m2,d.sqkm=d.km2,d.sqft=d.ft2,d.sqyd=d.yd2,d.sqin=d.in2;
|
|
49
|
-
},{}],"ccg9":[function(require,module,exports) {
|
|
50
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=function(e,o){return o.reduce(function(o,r){if(null==e)throw new Error("'".concat(e,"' is no valid coordinate."));return Object.prototype.hasOwnProperty.call(e,r)&&void 0!==r&&void 0===o?(o=r,r):o},void 0)},o=e;exports.default=o;
|
|
51
|
-
},{}],"yI2J":[function(require,module,exports) {
|
|
52
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=function(e){var t=e.toString().trim();return!isNaN(parseFloat(t))&&parseFloat(t)===Number(t)},t=e;exports.default=t;
|
|
53
|
-
},{}],"aMjX":[function(require,module,exports) {
|
|
54
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./constants"),t=function(t){return e.sexagesimalPattern.test(t.toString().trim())},r=t;exports.default=r;
|
|
55
|
-
},{"./constants":"jlY8"}],"lIpD":[function(require,module,exports) {
|
|
56
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./constants"),r=function(r){var t=new RegExp(e.sexagesimalPattern).exec(r);if(null==t)throw new Error("Given value is not in sexagesimal format");var a=Number(t[2])/60||0,s=Number(t[4])/3600||0,n=parseFloat(t[1])+a+s;return["S","W"].includes(t[7])?-n:n},t=r;exports.default=t;
|
|
57
|
-
},{"./constants":"jlY8"}],"zoZX":[function(require,module,exports) {
|
|
58
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./constants"),t=r(require("./getCoordinateKey"));function r(e){return e&&e.__esModule?e:{default:e}}function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){o(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var i=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{longitude:e.longitudeKeys,latitude:e.latitudeKeys,altitude:e.altitudeKeys},o=(0,t.default)(r,n.longitude),i=(0,t.default)(r,n.latitude),l=(0,t.default)(r,n.altitude);return u({latitude:i,longitude:o},l?{altitude:l}:{})},l=i;exports.default=l;
|
|
59
|
-
},{"./constants":"jlY8","./getCoordinateKey":"ccg9"}],"aCxN":[function(require,module,exports) {
|
|
60
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("./isDecimal")),r=u(require("./isSexagesimal")),t=u(require("./sexagesimalToDecimal")),a=require("./constants");function u(e){return e&&e.__esModule?e:{default:e}}var i=function u(i){return(0,e.default)(i)?!(parseFloat(i)>a.MAXLAT||i<a.MINLAT):!!(0,r.default)(i)&&u((0,t.default)(i))},s=i;exports.default=s;
|
|
61
|
-
},{"./isDecimal":"yI2J","./isSexagesimal":"aMjX","./sexagesimalToDecimal":"lIpD","./constants":"jlY8"}],"R2kM":[function(require,module,exports) {
|
|
62
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("./isDecimal")),r=u(require("./isSexagesimal")),t=u(require("./sexagesimalToDecimal")),a=require("./constants");function u(e){return e&&e.__esModule?e:{default:e}}var i=function u(i){return(0,e.default)(i)?!(parseFloat(i)>a.MAXLON||i<a.MINLON):!!(0,r.default)(i)&&u((0,t.default)(i))},s=i;exports.default=s;
|
|
63
|
-
},{"./isDecimal":"yI2J","./isSexagesimal":"aMjX","./sexagesimalToDecimal":"lIpD","./constants":"jlY8"}],"xeC1":[function(require,module,exports) {
|
|
64
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("./getCoordinateKeys")),t=u(require("./isValidLatitude")),r=u(require("./isValidLongitude"));function u(e){return e&&e.__esModule?e:{default:e}}var i=function(u){var i=(0,e.default)(u),d=i.latitude,a=i.longitude;if(Array.isArray(u)&&u.length>=2)return(0,r.default)(u[0])&&(0,t.default)(u[1]);if(void 0===d||void 0===a)return!1;var o=u[a],l=u[d];return void 0!==l&&void 0!==o&&(!1!==(0,t.default)(l)&&!1!==(0,r.default)(o))},d=i;exports.default=d;
|
|
65
|
-
},{"./getCoordinateKeys":"zoZX","./isValidLatitude":"aCxN","./isValidLongitude":"R2kM"}],"Q1cK":[function(require,module,exports) {
|
|
66
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("./isDecimal")),r=u(require("./isSexagesimal")),t=u(require("./sexagesimalToDecimal")),i=u(require("./isValidCoordinate")),n=u(require("./getCoordinateKeys"));function u(e){return e&&e.__esModule?e:{default:e}}function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,i)}return t}function a(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?o(Object(t),!0).forEach(function(r){l(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function l(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var c=function u(o){if((0,e.default)(o))return Number(o);if((0,r.default)(o))return(0,t.default)(o);if((0,i.default)(o)){var c=(0,n.default)(o);return Array.isArray(o)?o.map(function(e,r){return[0,1].includes(r)?u(e):e}):a(a(a({},o),c.latitude&&l({},c.latitude,u(o[c.latitude]))),c.longitude&&l({},c.longitude,u(o[c.longitude])))}return Array.isArray(o)?o.map(function(e){return(0,i.default)(e)?u(e):e}):o},f=c;exports.default=f;
|
|
67
|
-
},{"./isDecimal":"yI2J","./isSexagesimal":"aMjX","./sexagesimalToDecimal":"lIpD","./isValidCoordinate":"xeC1","./getCoordinateKeys":"zoZX"}],"FBtr":[function(require,module,exports) {
|
|
68
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./constants"),t=u(require("./getCoordinateKey")),r=u(require("./toDecimal"));function u(e){return e&&e.__esModule?e:{default:e}}var a=function(u,a){var o=(0,t.default)(u,e.latitudeKeys);if(null!=o){var i=u[o];return!0===a?i:(0,r.default)(i)}},o=a;exports.default=o;
|
|
69
|
-
},{"./constants":"jlY8","./getCoordinateKey":"ccg9","./toDecimal":"Q1cK"}],"Ky3J":[function(require,module,exports) {
|
|
70
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./constants"),t=u(require("./getCoordinateKey")),r=u(require("./toDecimal"));function u(e){return e&&e.__esModule?e:{default:e}}var o=function(u,o){var a=(0,t.default)(u,e.longitudeKeys);if(null!=a){var i=u[a];return!0===o?i:(0,r.default)(i)}},a=o;exports.default=a;
|
|
71
|
-
},{"./constants":"jlY8","./getCoordinateKey":"ccg9","./toDecimal":"Q1cK"}],"xS1n":[function(require,module,exports) {
|
|
72
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=function(e){return e*Math.PI/180},t=e;exports.default=t;
|
|
73
|
-
},{}],"rpzX":[function(require,module,exports) {
|
|
74
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=function(e){return 180*e/Math.PI},t=e;exports.default=t;
|
|
75
|
-
},{}],"v8Ow":[function(require,module,exports) {
|
|
76
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=i(require("./getLatitude")),e=i(require("./getLongitude")),a=i(require("./toRad")),u=i(require("./toDeg")),r=require("./constants");function i(t){return t&&t.__esModule?t:{default:t}}var d=function(i,d,s){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6371e3,o=(0,t.default)(i),M=(0,e.default)(i),h=d/n,l=(0,a.default)(s),f=(0,a.default)(o),c=(0,a.default)(M),g=Math.asin(Math.sin(f)*Math.cos(h)+Math.cos(f)*Math.sin(h)*Math.cos(l)),v=c+Math.atan2(Math.sin(l)*Math.sin(h)*Math.cos(f),Math.cos(h)-Math.sin(f)*Math.sin(g)),q=(0,u.default)(v);return(q<r.MINLON||q>r.MAXLON)&&(v=(v+3*Math.PI)%(2*Math.PI)-Math.PI,q=(0,u.default)(v)),{latitude:(0,u.default)(g),longitude:q}},s=d;exports.default=s;
|
|
77
|
-
},{"./getLatitude":"FBtr","./getLongitude":"Ky3J","./toRad":"xS1n","./toDeg":"rpzX","./constants":"jlY8"}],"eEF1":[function(require,module,exports) {
|
|
78
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./constants"),r=function(r){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",t=e.areaConversion[o];if(t)return r*t;throw new Error("Invalid unit used for area conversion.")},o=r;exports.default=o;
|
|
79
|
-
},{"./constants":"jlY8"}],"S4Zm":[function(require,module,exports) {
|
|
80
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./constants"),r=function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"m",n=e.distanceConversion[t];if(n)return r*n;throw new Error("Invalid unit used for distance conversion.")},t=r;exports.default=t;
|
|
81
|
-
},{"./constants":"jlY8"}],"CyES":[function(require,module,exports) {
|
|
82
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=require("./constants"),t=function(t){switch(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"kmh"){case"kmh":return t*e.timeConversion.h*e.distanceConversion.km;case"mph":return t*e.timeConversion.h*e.distanceConversion.mi;default:return t}},n=t;exports.default=n;
|
|
83
|
-
},{"./constants":"jlY8"}],"xKEX":[function(require,module,exports) {
|
|
84
|
-
"use strict";function t(t,n){return a(t)||o(t,n)||e(t,n)||r()}function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function e(t,r){if(t){if("string"==typeof t)return n(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?n(t,r):void 0}}function n(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function o(t,r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],n=!0,o=!1,a=void 0;try{for(var i,u=t[Symbol.iterator]();!(n=(i=u.next()).done)&&(e.push(i.value),!r||e.length!==r);n=!0);}catch(l){o=!0,a=l}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return e}}function a(t){if(Array.isArray(t))return t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var i=function(t){var r=Math.pow(10,12);return Math.round(t*r)/r},u=function(r){var e=t(r.toString().split("."),2),n=e[0],o=e[1],a=Math.abs(Number(n)),u=i(60*Number("0."+(o||0))),l=Math.floor(u),f=i(60*(u%l||0));return a+"° "+Number(l.toFixed(6)).toString().split(".").map(function(t,r){return 0===r?t.padStart(2,"0"):t}).join(".")+"' "+Number(f.toFixed(4)).toString().split(".").map(function(t,r){return 0===r?t.padStart(2,"0"):t}).join(".")+'"'},l=u;exports.default=l;
|
|
85
|
-
},{}],"gXD1":[function(require,module,exports) {
|
|
86
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=function(e){return e>1?1:e<-1?-1:e},t=e;exports.default=t;
|
|
87
|
-
},{}],"cuTy":[function(require,module,exports) {
|
|
88
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=d(require("./getLatitude")),t=d(require("./getLongitude")),a=d(require("./toRad")),u=d(require("./robustAcos")),r=require("./constants");function d(e){return e&&e.__esModule?e:{default:e}}var o=function(d,o){var s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;s=void 0===s||isNaN(s)?1:s;var i=(0,e.default)(d),l=(0,t.default)(d),f=(0,e.default)(o),n=(0,t.default)(o),c=Math.acos((0,u.default)(Math.sin((0,a.default)(f))*Math.sin((0,a.default)(i))+Math.cos((0,a.default)(f))*Math.cos((0,a.default)(i))*Math.cos((0,a.default)(l)-(0,a.default)(n))))*r.earthRadius;return Math.round(c/s)*s},s=o;exports.default=s;
|
|
89
|
-
},{"./getLatitude":"FBtr","./getLongitude":"Ky3J","./toRad":"xS1n","./robustAcos":"gXD1","./constants":"jlY8"}],"WCbC":[function(require,module,exports) {
|
|
90
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./getDistance"));function t(e){return e&&e.__esModule?e:{default:e}}var r=function(t,r){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.default;return u="function"==typeof u?u:e.default,r.slice().sort(function(e,r){return u(t,e)-u(t,r)})},u=r;exports.default=u;
|
|
91
|
-
},{"./getDistance":"cuTy"}],"PcPn":[function(require,module,exports) {
|
|
92
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("./orderByDistance"));function r(e){return e&&e.__esModule?e:{default:e}}var t=function(r,t){return(0,e.default)(r,t)[0]},u=t;exports.default=u;
|
|
93
|
-
},{"./orderByDistance":"WCbC"}],"c7qe":[function(require,module,exports) {
|
|
94
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("./toRad")),t=u(require("./getLatitude")),r=u(require("./getLongitude")),a=require("./constants");function u(e){return e&&e.__esModule?e:{default:e}}var l=function(u){var l=0;if(u.length>2){for(var d,n,i,f=0;f<u.length;f++){f===u.length-2?(d=u.length-2,n=u.length-1,i=0):f===u.length-1?(d=u.length-1,n=0,i=1):(d=f,n=f+1,i=f+2);var o=(0,r.default)(u[d]),s=(0,t.default)(u[n]),h=(0,r.default)(u[i]);l+=((0,e.default)(h)-(0,e.default)(o))*Math.sin((0,e.default)(s))}l=l*a.earthRadius*a.earthRadius/2}return Math.abs(l)},d=l;exports.default=d;
|
|
95
|
-
},{"./toRad":"xS1n","./getLatitude":"FBtr","./getLongitude":"Ky3J","./constants":"jlY8"}],"UQmM":[function(require,module,exports) {
|
|
96
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=a(require("./getLatitude")),t=a(require("./getLongitude"));function a(e){return e&&e.__esModule?e:{default:e}}var n=function(a){if(!1===Array.isArray(a)||0===a.length)throw new Error("No points were given.");return a.reduce(function(a,n){var r=(0,e.default)(n),i=(0,t.default)(n);return{maxLat:Math.max(r,a.maxLat),minLat:Math.min(r,a.minLat),maxLng:Math.max(i,a.maxLng),minLng:Math.min(i,a.minLng)}},{maxLat:-1/0,minLat:1/0,maxLng:-1/0,minLng:1/0})},r=n;exports.default=r;
|
|
97
|
-
},{"./getLatitude":"FBtr","./getLongitude":"Ky3J"}],"ig9f":[function(require,module,exports) {
|
|
98
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("./getLatitude")),t=r(require("./getLongitude")),a=r(require("./toRad")),u=r(require("./toDeg")),d=require("./constants");function r(e){return e&&e.__esModule?e:{default:e}}var l=function(r,l){var i,f,o=(0,e.default)(r),n=(0,t.default)(r),s=(0,a.default)(o),M=(0,a.default)(n),h=l/d.earthRadius,c=s-h,g=s+h,v=(0,a.default)(d.MAXLAT),L=(0,a.default)(d.MINLAT),q=(0,a.default)(d.MAXLON),p=(0,a.default)(d.MINLON);if(c>L&&g<v){var x=Math.asin(Math.sin(h)/Math.cos(s));(i=M-x)<p&&(i+=2*Math.PI),(f=M+x)>q&&(f-=2*Math.PI)}else c=Math.max(c,L),g=Math.min(g,v),i=p,f=q;return[{latitude:(0,u.default)(c),longitude:(0,u.default)(i)},{latitude:(0,u.default)(g),longitude:(0,u.default)(f)}]},i=l;exports.default=i;
|
|
99
|
-
},{"./getLatitude":"FBtr","./getLongitude":"Ky3J","./toRad":"xS1n","./toDeg":"rpzX","./constants":"jlY8"}],"n6yb":[function(require,module,exports) {
|
|
100
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=u(require("./getLatitude")),e=u(require("./getLongitude")),r=u(require("./toRad")),a=u(require("./toDeg"));function u(t){return t&&t.__esModule?t:{default:t}}var d=function(u){if(!1===Array.isArray(u)||0===u.length)return!1;var d=u.length,n=u.reduce(function(a,u){var d=(0,r.default)((0,t.default)(u)),n=(0,r.default)((0,e.default)(u));return{X:a.X+Math.cos(d)*Math.cos(n),Y:a.Y+Math.cos(d)*Math.sin(n),Z:a.Z+Math.sin(d)}},{X:0,Y:0,Z:0}),i=n.X/d,o=n.Y/d,l=n.Z/d;return{longitude:(0,a.default)(Math.atan2(o,i)),latitude:(0,a.default)(Math.atan2(l,Math.sqrt(i*i+o*o)))}},n=d;exports.default=n;
|
|
101
|
-
},{"./getLatitude":"FBtr","./getLongitude":"Ky3J","./toRad":"xS1n","./toDeg":"rpzX"}],"j2PW":[function(require,module,exports) {
|
|
102
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./getBounds"));function t(e){return e&&e.__esModule?e:{default:e}}var a=function(t){var a=(0,e.default)(t),r=a.minLat+(a.maxLat-a.minLat)/2,n=a.minLng+(a.maxLng-a.minLng)/2;return{latitude:parseFloat(r.toFixed(6)),longitude:parseFloat(n.toFixed(6))}},r=a;exports.default=r;
|
|
103
|
-
},{"./getBounds":"UQmM"}],"vf1Y":[function(require,module,exports) {
|
|
104
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=r(require("./getLatitude")),e=r(require("./getLongitude")),a=r(require("./toRad")),u=r(require("./toDeg"));function r(t){return t&&t.__esModule?t:{default:t}}var d=function(r,d){var l=(0,a.default)((0,e.default)(d))-(0,a.default)((0,e.default)(r)),f=Math.log(Math.tan((0,a.default)((0,t.default)(d))/2+Math.PI/4)/Math.tan((0,a.default)((0,t.default)(r))/2+Math.PI/4));return Math.abs(l)>Math.PI&&(l=l>0?-1*(2*Math.PI-l):2*Math.PI+l),((0,u.default)(Math.atan2(l,f))+360)%360},l=d;exports.default=l;
|
|
105
|
-
},{"./getLatitude":"FBtr","./getLongitude":"Ky3J","./toRad":"xS1n","./toDeg":"rpzX"}],"a1Nb":[function(require,module,exports) {
|
|
106
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("./getRhumbLineBearing"));function r(e){return e&&e.__esModule?e:{default:e}}var t=function(r,t){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.default,n="function"==typeof u?u(r,t):(0,e.default)(r,t);if(isNaN(n))throw new Error("Could not calculate bearing for given points. Check your bearing function");switch(Math.round(n/22.5)){case 1:return"NNE";case 2:return"NE";case 3:return"ENE";case 4:return"E";case 5:return"ESE";case 6:return"SE";case 7:return"SSE";case 8:return"S";case 9:return"SSW";case 10:return"SW";case 11:return"WSW";case 12:return"W";case 13:return"WNW";case 14:return"NW";case 15:return"NNW";default:return"N"}},u=t;exports.default=u;
|
|
107
|
-
},{"./getRhumbLineBearing":"vf1Y"}],"Wbd9":[function(require,module,exports) {
|
|
108
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=a(require("./getDistance")),t=a(require("./robustAcos"));function a(e){return e&&e.__esModule?e:{default:e}}var u=function(a,u,r){var o=(0,e.default)(u,a),s=(0,e.default)(a,r),d=(0,e.default)(u,r),f=Math.acos((0,t.default)((o*o+d*d-s*s)/(2*o*d))),l=Math.acos((0,t.default)((s*s+d*d-o*o)/(2*s*d)));return f>Math.PI/2?o:l>Math.PI/2?s:Math.sin(f)*o},r=u;exports.default=r;
|
|
109
|
-
},{"./getDistance":"cuTy","./robustAcos":"gXD1"}],"wuSB":[function(require,module,exports) {
|
|
110
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=d(require("./getLatitude")),t=d(require("./getLongitude")),a=d(require("./toRad")),u=d(require("./toDeg"));function d(e){return e&&e.__esModule?e:{default:e}}var r=function(d,r){var f=(0,e.default)(r),l=(0,t.default)(r),o=(0,e.default)(d),i=(0,t.default)(d);return((0,u.default)(Math.atan2(Math.sin((0,a.default)(l)-(0,a.default)(i))*Math.cos((0,a.default)(f)),Math.cos((0,a.default)(o))*Math.sin((0,a.default)(f))-Math.sin((0,a.default)(o))*Math.cos((0,a.default)(f))*Math.cos((0,a.default)(l)-(0,a.default)(i))))+360)%360},f=r;exports.default=f;
|
|
111
|
-
},{"./getLatitude":"FBtr","./getLongitude":"Ky3J","./toRad":"xS1n","./toDeg":"rpzX"}],"tTow":[function(require,module,exports) {
|
|
112
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e(require("./getDistance"));function e(t){return t&&t.__esModule?t:{default:t}}function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var n=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.default;return e.reduce(function(t,e){return"object"===o(t)&&null!==t.last&&(t.distance+=n(e,t.last)),t.last=e,t},{last:null,distance:0}).distance},r=n;exports.default=r;
|
|
113
|
-
},{"./getDistance":"cuTy"}],"Dr8Z":[function(require,module,exports) {
|
|
114
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=u(require("./getLatitude")),a=u(require("./getLongitude")),e=u(require("./toRad")),r=require("./constants");function u(t){return t&&t.__esModule?t:{default:t}}var d=function(u,d){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;i=void 0===i||isNaN(i)?1:i;var s,n,o,h,l,M,f,v=(0,t.default)(u),c=(0,a.default)(u),p=(0,t.default)(d),N=(0,a.default)(d),q=6356752.314245,g=(0,e.default)(N-c),_=Math.atan(.9966471893352525*Math.tan((0,e.default)(parseFloat(v)))),x=Math.atan(.9966471893352525*Math.tan((0,e.default)(parseFloat(p)))),R=Math.sin(_),b=Math.cos(_),F=Math.sin(x),L=Math.cos(x),j=g,w=100;do{var y=Math.sin(j),O=Math.cos(j);if(0===(M=Math.sqrt(L*y*(L*y)+(b*F-R*L*O)*(b*F-R*L*O))))return 0;s=R*F+b*L*O,n=Math.atan2(M,s),l=s-2*R*F/(h=1-(o=b*L*y/M)*o),isNaN(l)&&(l=0);var P=1/298.257223563/16*h*(4+1/298.257223563*(4-3*h));f=j,j=g+1/298.257223563*(1-P)*o*(n+P*M*(l+P*s*(2*l*l-1)))}while(Math.abs(j-f)>1e-12&&--w>0);if(0===w)return NaN;var k=h*(r.earthRadius*r.earthRadius-q*q)/(q*q),m=k/1024*(256+k*(k*(74-47*k)-128)),z=q*(1+k/16384*(4096+k*(k*(320-175*k)-768)))*(n-m*M*(l+m/4*(s*(2*l*l-1)-m/6*l*(4*M*M-3)*(4*l*l-3))));return Math.round(z/i)*i},i=d;exports.default=i;
|
|
115
|
-
},{"./getLatitude":"FBtr","./getLongitude":"Ky3J","./toRad":"xS1n","./constants":"jlY8"}],"rueG":[function(require,module,exports) {
|
|
116
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=function(t){return/^NNE|NE|NNW|N$/.test(t)?"N":/^ENE|E|ESE|SE$/.test(t)?"E":/^SSE|S|SSW|SW$/.test(t)?"S":/^WSW|W|WNW|NW$/.test(t)?"W":void 0},e=t;exports.default=e;
|
|
117
|
-
},{}],"yfXH":[function(require,module,exports) {
|
|
118
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./getDistance"));function t(e){return e&&e.__esModule?e:{default:e}}var r=function(t,r){return(arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.default)(t,r)/(Number(r.time)-Number(t.time))*1e3},u=r;exports.default=u;
|
|
119
|
-
},{"./getDistance":"cuTy"}],"jA0N":[function(require,module,exports) {
|
|
120
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./getDistance"));function t(e){return e&&e.__esModule?e:{default:e}}var u=function(t,u,r){return(0,e.default)(u,t)+(0,e.default)(t,r)===(0,e.default)(u,r)},r=u;exports.default=r;
|
|
121
|
-
},{"./getDistance":"cuTy"}],"xg0d":[function(require,module,exports) {
|
|
122
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=u(require("./getLatitude")),t=u(require("./getLongitude"));function u(e){return e&&e.__esModule?e:{default:e}}var d=function(u,d){for(var a=!1,f=d.length,l=-1,r=f-1;++l<f;r=l)((0,t.default)(d[l])<=(0,t.default)(u)&&(0,t.default)(u)<(0,t.default)(d[r])||(0,t.default)(d[r])<=(0,t.default)(u)&&(0,t.default)(u)<(0,t.default)(d[l]))&&(0,e.default)(u)<((0,e.default)(d[r])-(0,e.default)(d[l]))*((0,t.default)(u)-(0,t.default)(d[l]))/((0,t.default)(d[r])-(0,t.default)(d[l]))+(0,e.default)(d[l])&&(a=!a);return a},a=d;exports.default=a;
|
|
123
|
-
},{"./getLatitude":"FBtr","./getLongitude":"Ky3J"}],"UfZW":[function(require,module,exports) {
|
|
124
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./getDistanceFromLine"));function t(e){return e&&e.__esModule?e:{default:e}}var r=function(t,r,u,o){return(0,e.default)(t,r,u)<o},u=r;exports.default=u;
|
|
125
|
-
},{"./getDistanceFromLine":"Wbd9"}],"q0et":[function(require,module,exports) {
|
|
126
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=t(require("./getDistance"));function t(e){return e&&e.__esModule?e:{default:e}}var r=function(t,r,u){return(0,e.default)(t,r)<u},u=r;exports.default=u;
|
|
127
|
-
},{"./getDistance":"cuTy"}],"vMda":[function(require,module,exports) {
|
|
128
|
-
"use strict";function t(t,n){return i(t)||o(t,n)||e(t,n)||r()}function r(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function e(t,r){if(t){if("string"==typeof t)return n(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?n(t,r):void 0}}function n(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function o(t,r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t)){var e=[],n=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(n=(a=u.next()).done)&&(e.push(a.value),!r||e.length!==r);n=!0);}catch(l){o=!0,i=l}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return e}}function i(t){if(Array.isArray(t))return t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var a=function(r){if(!r.startsWith("POLYGON"))throw new Error("Invalid wkt.");return r.slice(r.indexOf("(")+2,r.indexOf(")")).split(", ").map(function(r){var e=t(r.split(" "),2),n=e[0],o=e[1];return{longitude:parseFloat(n),latitude:parseFloat(o)}})},u=a;exports.default=u;
|
|
129
|
-
},{}],"BnnT":[function(require,module,exports) {
|
|
130
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e={computeDestinationPoint:!0,convertArea:!0,convertDistance:!0,convertSpeed:!0,decimalToSexagesimal:!0,findNearest:!0,getAreaOfPolygon:!0,getBounds:!0,getBoundsOfDistance:!0,getCenter:!0,getCenterOfBounds:!0,getCompassDirection:!0,getCoordinateKey:!0,getCoordinateKeys:!0,getDistance:!0,getDistanceFromLine:!0,getGreatCircleBearing:!0,getLatitude:!0,getLongitude:!0,getPathLength:!0,getPreciseDistance:!0,getRhumbLineBearing:!0,getRoughCompassDirection:!0,getSpeed:!0,isDecimal:!0,isPointInLine:!0,isPointInPolygon:!0,isPointNearLine:!0,isPointWithinRadius:!0,isSexagesimal:!0,isValidCoordinate:!0,isValidLatitude:!0,isValidLongitude:!0,orderByDistance:!0,sexagesimalToDecimal:!0,toDecimal:!0,toRad:!0,toDeg:!0,wktToPolygon:!0};Object.defineProperty(exports,"computeDestinationPoint",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(exports,"convertArea",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(exports,"convertDistance",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(exports,"convertSpeed",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(exports,"decimalToSexagesimal",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(exports,"findNearest",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(exports,"getAreaOfPolygon",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(exports,"getBounds",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(exports,"getBoundsOfDistance",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(exports,"getCenter",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(exports,"getCenterOfBounds",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(exports,"getCompassDirection",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(exports,"getCoordinateKey",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(exports,"getCoordinateKeys",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(exports,"getDistance",{enumerable:!0,get:function(){return b.default}}),Object.defineProperty(exports,"getDistanceFromLine",{enumerable:!0,get:function(){return m.default}}),Object.defineProperty(exports,"getGreatCircleBearing",{enumerable:!0,get:function(){return P.default}}),Object.defineProperty(exports,"getLatitude",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(exports,"getLongitude",{enumerable:!0,get:function(){return O.default}}),Object.defineProperty(exports,"getPathLength",{enumerable:!0,get:function(){return x.default}}),Object.defineProperty(exports,"getPreciseDistance",{enumerable:!0,get:function(){return j.default}}),Object.defineProperty(exports,"getRhumbLineBearing",{enumerable:!0,get:function(){return q.default}}),Object.defineProperty(exports,"getRoughCompassDirection",{enumerable:!0,get:function(){return D.default}}),Object.defineProperty(exports,"getSpeed",{enumerable:!0,get:function(){return L.default}}),Object.defineProperty(exports,"isDecimal",{enumerable:!0,get:function(){return C.default}}),Object.defineProperty(exports,"isPointInLine",{enumerable:!0,get:function(){return B.default}}),Object.defineProperty(exports,"isPointInPolygon",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(exports,"isPointNearLine",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(exports,"isPointWithinRadius",{enumerable:!0,get:function(){return R.default}}),Object.defineProperty(exports,"isSexagesimal",{enumerable:!0,get:function(){return S.default}}),Object.defineProperty(exports,"isValidCoordinate",{enumerable:!0,get:function(){return T.default}}),Object.defineProperty(exports,"isValidLatitude",{enumerable:!0,get:function(){return V.default}}),Object.defineProperty(exports,"isValidLongitude",{enumerable:!0,get:function(){return A.default}}),Object.defineProperty(exports,"orderByDistance",{enumerable:!0,get:function(){return I.default}}),Object.defineProperty(exports,"sexagesimalToDecimal",{enumerable:!0,get:function(){return K.default}}),Object.defineProperty(exports,"toDecimal",{enumerable:!0,get:function(){return N.default}}),Object.defineProperty(exports,"toRad",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(exports,"toDeg",{enumerable:!0,get:function(){return k.default}}),Object.defineProperty(exports,"wktToPolygon",{enumerable:!0,get:function(){return w.default}});var t=G(require("./computeDestinationPoint")),r=G(require("./convertArea")),n=G(require("./convertDistance")),i=G(require("./convertSpeed")),o=G(require("./decimalToSexagesimal")),u=G(require("./findNearest")),a=G(require("./getAreaOfPolygon")),d=G(require("./getBounds")),c=G(require("./getBoundsOfDistance")),s=G(require("./getCenter")),f=G(require("./getCenterOfBounds")),g=G(require("./getCompassDirection")),l=G(require("./getCoordinateKey")),p=G(require("./getCoordinateKeys")),b=G(require("./getDistance")),m=G(require("./getDistanceFromLine")),P=G(require("./getGreatCircleBearing")),y=G(require("./getLatitude")),O=G(require("./getLongitude")),x=G(require("./getPathLength")),j=G(require("./getPreciseDistance")),q=G(require("./getRhumbLineBearing")),D=G(require("./getRoughCompassDirection")),L=G(require("./getSpeed")),C=G(require("./isDecimal")),B=G(require("./isPointInLine")),h=G(require("./isPointInPolygon")),v=G(require("./isPointNearLine")),R=G(require("./isPointWithinRadius")),S=G(require("./isSexagesimal")),T=G(require("./isValidCoordinate")),V=G(require("./isValidLatitude")),A=G(require("./isValidLongitude")),I=G(require("./orderByDistance")),K=G(require("./sexagesimalToDecimal")),N=G(require("./toDecimal")),_=G(require("./toRad")),k=G(require("./toDeg")),w=G(require("./wktToPolygon")),F=require("./constants");function G(e){return e&&e.__esModule?e:{default:e}}Object.keys(F).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return F[t]}}))});
|
|
131
|
-
},{"./computeDestinationPoint":"v8Ow","./convertArea":"eEF1","./convertDistance":"S4Zm","./convertSpeed":"CyES","./decimalToSexagesimal":"xKEX","./findNearest":"PcPn","./getAreaOfPolygon":"c7qe","./getBounds":"UQmM","./getBoundsOfDistance":"ig9f","./getCenter":"n6yb","./getCenterOfBounds":"j2PW","./getCompassDirection":"a1Nb","./getCoordinateKey":"ccg9","./getCoordinateKeys":"zoZX","./getDistance":"cuTy","./getDistanceFromLine":"Wbd9","./getGreatCircleBearing":"wuSB","./getLatitude":"FBtr","./getLongitude":"Ky3J","./getPathLength":"tTow","./getPreciseDistance":"Dr8Z","./getRhumbLineBearing":"vf1Y","./getRoughCompassDirection":"rueG","./getSpeed":"yfXH","./isDecimal":"yI2J","./isPointInLine":"jA0N","./isPointInPolygon":"xg0d","./isPointNearLine":"UfZW","./isPointWithinRadius":"q0et","./isSexagesimal":"aMjX","./isValidCoordinate":"xeC1","./isValidLatitude":"aCxN","./isValidLongitude":"R2kM","./orderByDistance":"WCbC","./sexagesimalToDecimal":"lIpD","./toDecimal":"Q1cK","./toRad":"xS1n","./toDeg":"rpzX","./wktToPolygon":"vMda","./constants":"jlY8"}],"JMpY":[function(require,module,exports) {
|
|
132
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Data=exports.default=void 0;var e=a(require("three")),t=require("geolib"),o=require("../coordinate/Coordinate"),r=n(require("../materials/CUBE_Material"));function n(e){return e&&e.__esModule?e:{default:e}}function i(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return i=function(){return e},e}function a(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=i();if(t&&t.has(e))return t.get(e);var o={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var a=r?Object.getOwnPropertyDescriptor(e,n):null;a&&(a.get||a.set)?Object.defineProperty(o,n,a):o[n]=e[n]}return o.default=e,t&&t.set(e,o),o}const s=new e.Vector3(1,0,0);class d{constructor(e){this.name=e,this._SCALE=window.CUBE_GLOBAL.MAP_SCALE,this._HEIGHT_SCALE=1*this._SCALE,this._SEGMENTS=16*this._SCALE}Sphere(t,r=1,n=2,i=0,a=16737792,s){const d=new o.Coordinate("GPS",t).ComputeWorldCoordinate(),l=new e.SphereBufferGeometry(3*n,r*n,r*n),u=s||new e.MeshBasicMaterial({color:a}),w=new e.Mesh(l,u),c=d.world.y+i;return w.position.set(-d.world.x,c,d.world.z),w.name=this.name,w}Bar(t,r=1,n=.5,i=0,a=16737792,d){const l=this._HEIGHT_SCALE*r;n*=this._SCALE;const u=new o.Coordinate("GPS",t).ComputeWorldCoordinate(),w=new e.BoxBufferGeometry(n,n,l,this._SEGMENTS),c=d||new e.MeshPhongMaterial({color:a}),C=new e.Mesh(w,c);C.rotateOnAxis(s,e.Math.degToRad(90));const h=u.world.y+i;return C.position.set(-u.world.x,h+l/2,u.world.z),C.name=this.name,C}Cylinder(t,r=1,n=.5,i=0,a=16737792,s){const d=this._HEIGHT_SCALE*r;n*=this._SCALE;const l=new o.Coordinate("GPS",t).ComputeWorldCoordinate(),u=new e.CylinderBufferGeometry(n,n,d,this._SEGMENTS),w=s||new e.MeshPhongMaterial({color:a}),c=new e.Mesh(u,w),C=l.world.y+i;return c.position.set(-l.world.x,C+d/2,l.world.z),c.name=this.name,c}Arc(r,n,i=5,a=0,s=16737792,d){i*=this._SCALE;const l=new o.Coordinate("GPS",r).ComputeWorldCoordinate(),u=new o.Coordinate("GPS",n).ComputeWorldCoordinate(),w=new o.Coordinate("GPS",(0,t.getCenter)([r,n])).ComputeWorldCoordinate(),c=new e.CatmullRomCurve3([new e.Vector3(-l.world.x,l.world.y+a,l.world.z),new e.Vector3(-w.world.x,i+a,w.world.z),new e.Vector3(-u.world.x,l.world.y+a,u.world.z)],!1,"catmullrom").getPoints(50),C=(new e.BufferGeometry).setFromPoints(c);C.computeBoundingSphere(),C.boundingSphere.center=new e.Vector3(w.world.x,0,w.world.z);const h=d||new e.LineBasicMaterial({color:s,linewidth:1}),p=new e.Line(C,h);return p.name=this.name,p}Text(t,n,i=30,a,s=.1,d,l){const u=(new r.default).TextFont(d||void 0),w=new o.Coordinate("GPS",t).ComputeWorldCoordinate(),c=new e.TextBufferGeometry(n,{font:u,size:i,height:s,curveSegments:parseInt(i/6)});c.center();const C=a||16711680,h=new e.Mesh(c,l||(new r.default).Text({color:C}));return h.position.set(-w.world.x,w.world.y,w.world.z),h.name=this.name,h}}exports.Data=exports.default=d;
|
|
133
|
-
},{"three":"dKqR","geolib":"BnnT","../coordinate/Coordinate":"tKb1","../materials/CUBE_Material":"E9Yg"}],"Gsmc":[function(require,module,exports) {
|
|
134
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;class e{constructor(e,t,r){this.name=e,this.vertex=t,this.fragment=r}GetVertex(){return this.vertex}GetFragment(){return this.fragment}}exports.default=e;
|
|
135
|
-
},{}],"WGXU":[function(require,module,exports) {
|
|
136
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var t=e(require("../PS_Shader"));function e(t){return t&&t.__esModule?t:{default:t}}const o="\n uniform sampler2D heightMap;\n uniform float heightRatio;\n uniform float heightColor;\n varying vec2 vUv;\n varying float hValue;\n varying float hColor;\n void main() {\n vUv = uv;\n vec3 pos = position;\n hValue = texture2D(heightMap, vUv).r;\n pos.y = hValue * heightRatio;\n hColor = heightColor;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(pos,1.0);\n }\n",n="\n varying float hValue;\n varying float hColor;\n\n // honestly stolen from https://www.shadertoy.com/view/4dsSzr\n vec3 heatmapGradient(float t) {\n return clamp((pow(t, 1.5) * 0.8 + 0.2) * vec3(smoothstep(0.0, 0.35, t) + t * 0.5, smoothstep(0.5, 1.0, t), max(1.0 - t * 1.7, t * 7.0 - 6.0)), 0.0, 1.0);\n }\n\n void main() {\n float v = abs(hValue - 1.);\n gl_FragColor = vec4(heatmapGradient(hValue * hColor), 1. - v * v) ;\n }\n";class r extends t.default{constructor(t){super(t)}GetVertex(){return o}GetFragment(){return n}}exports.default=r;
|
|
137
|
-
},{"../PS_Shader":"Gsmc"}],"gy7o":[function(require,module,exports) {
|
|
138
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Datasets=void 0;var e=s(require("three")),t=i(require("./Data")),r=i(require("../shader/assets/CS_Heatmap")),a=i(require("../materials/CUBE_Material")),o=require("../coordinate/Coordinate"),n=require("../layers/Layer");function i(e){return e&&e.__esModule?e:{default:e}}function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var n=a?Object.getOwnPropertyDescriptor(e,o):null;n&&(n.get||n.set)?Object.defineProperty(r,o,n):r[o]=e[o]}return r.default=e,t&&t.set(e,r),r}class d extends t.default{constructor(e,t){super(),this.name=e,this.data=t,this.mat_point=(new a.default).Point(),this.center=window.CUBE_GLOBAL.CENTER,this.scale=window.CUBE_GLOBAL.MAP_SCALE,this.layer=new n.Layer(e)}PointCloud(){for(let t=0;t<this.data.length;t++){const r=new o.Coordinate("GPS",this.data[t].location).ComputeWorldCoordinate(),a=new e.Geometry;a.vertices.push(new e.Vector3(0,0,0));const n=new e.Points(a,this.mat_point);n.position.set(r.world.x,r.world.y,r.world.z),this.layer.Add(n)}return this.layer.Layer()}Heatmap(t=60,a=2.5){t*=this.scale,a*=this.scale;const n=new r.default,i=[];for(let e=0;e<this.data.length;e++){const t=new o.Coordinate("GPS",this.data[e].location).ComputeWorldCoordinate();i.push({x:t.world.x,y:t.world.z,val:this.data[e].val})}const l=u(i,t,a),s=new e.PlaneBufferGeometry(t,t,1e3,1e3);s.rotateX(-Math.PI/2);const d=new e.Mesh(s,new e.ShaderMaterial({uniforms:{heightMap:{value:l},heightRatio:{value:Math.floor(t/10)},heightColor:{value:1}},vertexShader:n.GetVertex(),fragmentShader:n.GetFragment(),transparent:!0,opacity:.95}));return this.layer.Add(d),this.layer.Layer()}}function u(t=[],r=256,a=50){const o=document.createElement("canvas");o.width=r,o.height=r;const n=o.getContext("2d");n.fillStyle="black",n.fillRect(0,0,r,r);for(let e=0;e<t.length;e++){const o=t[e],i=r/2-o.x,l=r/2+o.y,s=n.createRadialGradient(i,l,1,i,l,a),d=o.val;s.addColorStop(0,"rgb("+d+","+d+","+d+")"),s.addColorStop(1,"transparent"),n.fillStyle=s,n.fillRect(0,0,r,r)}return new e.CanvasTexture(o)}exports.Datasets=d;
|
|
139
|
-
},{"three":"dKqR","./Data":"JMpY","../shader/assets/CS_Heatmap":"WGXU","../materials/CUBE_Material":"E9Yg","../coordinate/Coordinate":"tKb1","../layers/Layer":"oe7K"}],"hLzV":[function(require,module,exports) {
|
|
140
|
-
var define;
|
|
141
|
-
var e;parcelRequire=function(t,r,n,i){var o,a="function"==typeof parcelRequire&&parcelRequire,s="function"==typeof require&&require;function u(e,n){if(!r[e]){if(!t[e]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(e,!0);if(a)return a(e,!0);if(s&&"string"==typeof e)return s(e);var o=new Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}f.resolve=function(r){return t[e][1][r]||r},f.cache={};var l=r[e]=new u.Module(e);t[e][0].call(l.exports,f,l,l.exports,this)}return r[e].exports;function f(e){return u(f.resolve(e))}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=t,u.cache=r,u.parent=a,u.register=function(e,r){t[e]=[function(e,t){t.exports=r},{}]};for(var l=0;l<n.length;l++)try{u(n[l])}catch(t){o||(o=t)}if(n.length){var f=u(n[n.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=f:"function"==typeof e&&e.amd?e(function(){return f}):this[i]=f}if(parcelRequire=u,o)throw o;return u}({N3qF:[function(e,t,r){var n=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(e,t,r,n){var i=t&&t.prototype instanceof b?t:b,o=Object.create(i.prototype),a=new O(n||[]);return o._invoke=function(e,t,r){var n=f;return function(i,o){if(n===h)throw new Error("Generator is already running");if(n===d){if("throw"===i)throw o;return P()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===p)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=d,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=h;var u=l(e,t,r);if("normal"===u.type){if(n=r.done?d:c,u.arg===p)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n=d,r.method="throw",r.arg=u.arg)}}}(e,r,a),o}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(n){return{type:"throw",arg:n}}}e.wrap=u;var f="suspendedStart",c="suspendedYield",h="executing",d="completed",p={};function b(){}function y(){}function g(){}var m={};m[o]=function(){return this};var v=Object.getPrototypeOf,w=v&&v(v(C([])));w&&w!==r&&n.call(w,o)&&(m=w);var _=g.prototype=b.prototype=Object.create(m);function k(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function S(e,t){var r;this._invoke=function(i,o){function a(){return new t(function(r,a){!function r(i,o,a,s){var u=l(e[i],e,o);if("throw"!==u.type){var f=u.arg,c=f.value;return c&&"object"==typeof c&&n.call(c,"__await")?t.resolve(c.__await).then(function(e){r("next",e,a,s)},function(e){r("throw",e,a,s)}):t.resolve(c).then(function(e){f.value=e,a(f)},function(e){return r("throw",e,a,s)})}s(u.arg)}(i,o,r,a)})}return r=r?r.then(a,a):a()}}function x(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,x(e,r),"throw"===r.method))return p;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var i=l(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,p;var o=i.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,p):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,p)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function T(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function C(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:P}}function P(){return{value:t,done:!0}}return y.prototype=_.constructor=g,g.constructor=y,g[s]=y.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,s in e||(e[s]="GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},k(S.prototype),S.prototype[a]=function(){return this},e.AsyncIterator=S,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new S(u(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then(function(e){return e.done?e.value:a.next()})},k(_),_[s]="Generator",_[o]=function(){return this},_.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=C,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(T),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,p):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),T(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;T(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),p}},e}("object"==typeof t?t.exports:{});try{regeneratorRuntime=n}catch(i){Function("r","regeneratorRuntime = r")(n)}},{}],PMvg:[function(e,t,r){t.exports=e("regenerator-runtime")},{"regenerator-runtime":"N3qF"}],IxO8:[function(e,t,r){t.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},{}],OUZ9:[function(e,t,r){t.exports=function(e){if(Array.isArray(e))return e}},{}],vKPt:[function(e,t,r){t.exports=function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(u){i=!0,o=u}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}}},{}],Rom6:[function(e,t,r){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}},{}],HETk:[function(e,t,r){var n=e("./arrayWithHoles"),i=e("./iterableToArrayLimit"),o=e("./nonIterableRest");t.exports=function(e,t){return n(e)||i(e,t)||o()}},{"./arrayWithHoles":"OUZ9","./iterableToArrayLimit":"vKPt","./nonIterableRest":"Rom6"}],agGE:[function(e,t,r){function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(l){return void r(l)}s.done?t(u):Promise.resolve(u).then(n,i)}t.exports=function(e){return function(){var t=this,r=arguments;return new Promise(function(i,o){var a=e.apply(t,r);function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)})}}},{}],P8NW:[function(e,t,r){function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}t.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},{}],b9XL:[function(e,t,r){function n(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=n=function(e){return typeof e}:t.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}t.exports=n},{}],E7HD:[function(e,t,r){t.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},{}],pxk2:[function(e,t,r){var n=e("../helpers/typeof"),i=e("./assertThisInitialized");t.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?i(e):t}},{"../helpers/typeof":"b9XL","./assertThisInitialized":"E7HD"}],UJE0:[function(e,t,r){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(e)}t.exports=n},{}],AkAO:[function(e,t,r){function n(e,r){return t.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(e,r)}t.exports=n},{}],d4H2:[function(e,t,r){var n=e("./setPrototypeOf");t.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)}},{"./setPrototypeOf":"AkAO"}],vNP7:[function(e,t,r){t.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}},{}],dJhE:[function(e,t,r){var n=e("./setPrototypeOf");function i(e,r,o){return function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(n){return!1}}()?t.exports=i=Reflect.construct:t.exports=i=function(e,t,r){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return r&&n(o,r.prototype),o},i.apply(null,arguments)}t.exports=i},{"./setPrototypeOf":"AkAO"}],ozpi:[function(e,t,r){var n=e("./getPrototypeOf"),i=e("./setPrototypeOf"),o=e("./isNativeFunction"),a=e("./construct");function s(e){var r="function"==typeof Map?new Map:void 0;return t.exports=s=function(e){if(null===e||!o(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return a(e,arguments,n(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i(t,e)},s(e)}t.exports=s},{"./getPrototypeOf":"UJE0","./setPrototypeOf":"AkAO","./isNativeFunction":"vNP7","./construct":"dJhE"}],fcMS:[function(e,t,r){t.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},{}],rDCW:[function(e,t,r){},{}],FRpO:[function(e,t,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}t.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function f(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,o,a;if(l(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=f(e))>0&&a.length>i&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=a.length,function(e){console&&console.warn&&console.warn(e)}(s)}return e}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):b(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function b(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return f(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var l=u.length,f=b(u,l);for(r=0;r<l;++r)o(f[r],this,t)}return!0},s.prototype.addListener=function(e,t){return c(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return c(this,e,t,!0)},s.prototype.once=function(e,t){return l(t),this.on(e,h(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,h(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,n,i,o,a;if(l(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return d(this,e,!0)},s.prototype.rawListeners=function(e){return d(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],ExO1:[function(e,t,r){t.exports=e("events").EventEmitter},{events:"FRpO"}],yh9p:[function(e,t,r){"use strict";r.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},r.toByteArray=function(e){var t,r,n=l(e),a=n[0],s=n[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),f=0,c=s>0?a-4:a;for(r=0;r<c;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],u[f++]=t>>16&255,u[f++]=t>>8&255,u[f++]=255&t;return 2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[f++]=255&t),1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[f++]=t>>8&255,u[f++]=255&t),u},r.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;a<s;a+=16383)o.push(c(e,a,a+16383>s?s:a+16383));return 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]+"=")),o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)n[s]=a[s],i[a.charCodeAt(s)]=s;function l(e){var t=e.length;if(t%4>0)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 f(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function c(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(f(n));return i.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],JgNJ:[function(e,t,r){r.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,l=u>>1,f=-7,c=r?i-1:0,h=r?-1:1,d=e[t+c];for(c+=h,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=256*o+e[t+c],c+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+c],c+=h,f-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=l}return(d?-1:1)*a*Math.pow(2,o-n)},r.write=function(e,t,r,n,i,o){var a,s,u,l=8*o-i-1,f=(1<<l)-1,c=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+c>=1?h/u:h*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=f?(s=0,a=f):a+c>=1?(s=(t*u-1)*Math.pow(2,i),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;e[r+d]=255&a,d+=p,a/=256,l-=8);e[r+d-p]|=128*b}},{}],REa7:[function(e,t,r){var n={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},{}],dskh:[function(e,t,r){arguments[3];var n=arguments[3],i=e("base64-js"),o=e("ieee754"),a=e("isarray");function s(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,r){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return h(this,e)}return f(this,e,t,r)}function f(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=d(e,t),e}(e,t,r,n):"string"==typeof t?function(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!l.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|y(t,r),i=(e=u(e,n)).write(t,r);return i!==n&&(e=e.slice(0,i)),e}(e,t,r):p(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function h(e,t){if(c(t),e=u(e,t<0?0:0|b(t)),!l.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function d(e,t){var r=t.length<0?0:0|b(t.length);e=u(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function p(e,t){if(l.isBuffer(t)){var r=0|b(t.length);return 0===(e=u(e,r)).length?e:(t.copy(e,0,0,r),e)}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||function(e){return e!=e}(t.length)?u(e,0):d(e,t);if("Buffer"===t.type&&a(t.data))return d(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function b(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function y(e,t){if(l.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 W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(e).length;default:if(n)return W(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(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=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t)return t&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){var o,a=1,s=e.length,u=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,u/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=r;o<s;o++)if(l(e,o)===l(t,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*a}else-1!==f&&(o-=o-f),f=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){for(var c=!0,h=0;h<u;h++)if(l(e,o+h)!==l(t,h)){c=!1;break}if(c)return o}return-1}function w(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(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<n;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[r+a]=s}return a}function _(e,t,r,n){return z(W(t,e.length-r),e,r,n)}function k(e,t,r,n){return z(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function S(e,t,r,n){return k(e,t,r,n)}function x(e,t,r,n){return z(q(t),e,r,n)}function E(e,t,r,n){return z(function(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(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?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function O(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,u,l=e[i],f=null,c=l>239?4:l>223?3:l>191?2:1;if(i+c<=r)switch(c){case 1:l<128&&(f=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(f=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,c=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=c}return function(e){var t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=C));return r}(n)}r.Buffer=l,r.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},r.INSPECT_MAX_BYTES=50,l.TYPED_ARRAY_SUPPORT=void 0!==n.TYPED_ARRAY_SUPPORT?n.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(i){return!1}}(),r.kMaxLength=s(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,r){return f(null,e,t,r)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,r){return function(e,t,r,n){return c(t),t<=0?u(e,t):void 0!==r?"string"==typeof n?u(e,t).fill(r,n):u(e,t).fill(r):u(e,t)}(null,e,t,r)},l.allocUnsafe=function(e){return h(null,e)},l.allocUnsafeSlow=function(e){return h(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!a(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=l.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(!l.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},l.byteLength=y,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)g(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?O(this,0,e):function(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.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 A(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return P(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return T(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",t=r.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},l.prototype.compare=function(e,t,r,n,i){if(!l.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(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(n,i),f=e.slice(t,r),c=0;c<s;++c)if(u[c]!==f[c]){o=u[c],a=f[c];break}return o<a?-1:a<o?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},l.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(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 w(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":return k(this,e,t,r);case"latin1":case"binary":return S(this,e,t,r);case"base64":return x(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function P(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function R(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function A(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=G(e[o]);return i}function M(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function j(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function I(e,t,r,n,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function L(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function D(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function U(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 N(e,t,r,n,i){return i||U(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function B(e,t,r,n,i){return i||U(e,0,r,8),o.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),l.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=l.prototype;else{var i=t-e;r=new l(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},l.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||j(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},l.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||j(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},l.prototype.readUInt8=function(e,t){return t||j(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||j(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||j(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return t||j(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return t||j(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||j(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||j(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},l.prototype.readInt8=function(e,t){return t||j(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){t||j(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){t||j(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return t||j(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return t||j(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return t||j(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||j(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||j(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||j(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||I(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},l.prototype.writeUIntBE=function(e,t,r,n){e=+e,t|=0,r|=0,n||I(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},l.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):D(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);I(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},l.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);I(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},l.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):L(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):L(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):D(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},l.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<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},l.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var a=l.isBuffer(e)?e:W(new l(e,n).toString()),s=a.length;for(o=0;o<r-t;++o)this[o+t]=a[o%s]}return this};var F=/[^+\/0-9A-Za-z-_]/g;function G(e){return e<16?"0"+e.toString(16):e.toString(16)}function W(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&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 q(e){return i.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}},{"base64-js":"yh9p",ieee754:"JgNJ",isarray:"REa7",buffer:"dskh"}],VCcH:[function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){o(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var s=e("buffer").Buffer,u=e("util").inspect,l=u&&u.custom||"inspect";function f(e,t,r){s.prototype.copy.call(e,t,r)}t.exports=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.head=null,this.tail=null,this.length=0}return function(e,t,r){t&&a(e.prototype,t),r&&a(e,r)}(e,[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t=s.allocUnsafe(e>>>0),r=this.head,n=0;r;)f(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return u(this,i({},t,{depth:0,customInspect:!1}))}}]),e}()},{buffer:"dskh",util:"rDCW"}],pBGv:[function(e,t,r){var n,i,o=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(o){try{return n.call(null,e,0)}catch(o){return n.call(this,e,0)}}}function l(e){if(i===clearTimeout)return clearTimeout(e);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch(o){try{return i.call(null,e)}catch(o){return i.call(this,e)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(o){n=a}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(o){i=s}}();var f,c=[],h=!1,d=-1;function p(){h&&f&&(h=!1,f.length?c=f.concat(c):d=-1,c.length&&b())}function b(){if(!h){var e=u(p);h=!0;for(var t=c.length;t;){for(f=c,c=[];++d<t;)f&&f[d].run();d=-1,t=c.length}f=null,h=!1,l(e)}}function y(e,t){this.fun=e,this.array=t}function g(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new y(e,t)),1!==c.length||h||u(b)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],GRUB:[function(e,t,r){e("process");var n=e("process");function i(e,t){a(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function a(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,s=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return s||u?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(a,this,e)):n.nextTick(a,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(o,r),t(e)):n.nextTick(o,r)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},{process:"pBGv"}],Yj9o:[function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i={};function o(e,t,r){r||(r=Error);var n=function(e){function r(r,n,i){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,i)}(r,n))||this}return function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(r,e),r}(r);n.prototype.name=r.name,n.prototype.code=e,i[e]=n}function a(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}o("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),o("ERR_INVALID_ARG_TYPE",function(e,t,r){var i,o;if("string"==typeof t&&function(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}(t,"not ")?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))o="The ".concat(e," ").concat(i," ").concat(a(t,"type"));else{var s=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";o='The "'.concat(e,'" ').concat(s," ").concat(i," ").concat(a(t,"type"))}return o+". Received type ".concat(n(r))},TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=i},{}],TWVJ:[function(e,t,r){"use strict";var n=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},{"../../../errors":"Yj9o"}],Bm0n:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},{}],yM1o:[function(e,t,r){arguments[3];var n=arguments[3];function i(e){try{if(!n.localStorage)return!1}catch(r){return!1}var t=n.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},{}],WSyY:[function(e,t,r){arguments[3],e("process");var n,i=arguments[3],o=e("process");function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}t.exports=T,T.WritableState=E;var s={deprecate:e("util-deprecate")},u=e("./internal/streams/stream"),l=e("buffer").Buffer,f=i.Uint8Array||function(){};var c,h=e("./internal/streams/destroy"),d=e("./internal/streams/state").getHighWaterMark,p=e("../errors").codes,b=p.ERR_INVALID_ARG_TYPE,y=p.ERR_METHOD_NOT_IMPLEMENTED,g=p.ERR_MULTIPLE_CALLBACK,m=p.ERR_STREAM_CANNOT_PIPE,v=p.ERR_STREAM_DESTROYED,w=p.ERR_STREAM_NULL_VALUES,_=p.ERR_STREAM_WRITE_AFTER_END,k=p.ERR_UNKNOWN_ENCODING,S=h.errorOrDestroy;function x(){}function E(t,r,i){n=n||e("./_stream_duplex"),t=t||{},"boolean"!=typeof i&&(i=r instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=d(this,t,"writableHighWaterMark",i),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===t.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){A(r,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function T(t){var r=this instanceof(n=n||e("./_stream_duplex"));if(!r&&!c.call(T,this))return new T(t);this._writableState=new E(t,this,r),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),u.call(this)}function O(e,t){var r=new _;S(e,r),o.nextTick(t,r)}function C(e,t,r,n){var i;return null===r?i=new w:"string"==typeof r||t.objectMode||(i=new b("chunk",["string","Buffer"],r)),!i||(S(e,i),o.nextTick(n,i),!1)}function P(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,r)),t}function R(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new v("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function A(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new g;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(U,e,t),e._writableState.errorEmitted=!0,S(e,n)):(i(n),e._writableState.errorEmitted=!0,S(e,n),U(e,t))}(e,r,n,t,i);else{var a=I(r)||e.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||j(e,r),n?o.nextTick(M,e,r,a,i):M(e,r,a,i)}}function M(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),U(e,t)}function j(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,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,R(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 l=r.chunk,f=r.encoding,c=r.callback;if(R(e,t,!1,t.objectMode?1:l.length,l,f,c),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function I(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function L(e,t){e._final(function(r){t.pendingcb--,r&&S(e,r),t.prefinished=!0,e.emit("prefinish"),U(e,t)})}function D(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,o.nextTick(L,e,t)))}function U(e,t){var r=I(t);if(r&&(D(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function N(e,t,r){t.ending=!0,U(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}e("inherits")(T,u),E.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(E.prototype,"buffer",{get:s.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(n){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(c=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(e){return!!c.call(this,e)||this===T&&e&&e._writableState instanceof E}})):c=function(e){return e instanceof this},T.prototype.pipe=function(){S(this,new m)},T.prototype.write=function(e,t,r){var n=this._writableState,i=!1,o=!n.objectMode&&function(e){return l.isBuffer(e)||e instanceof f}(e);return o&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(r=t,t=null),o?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=x),n.ending?O(this,r):(o||C(this,n,e,r))&&(n.pendingcb++,i=function(e,t,r,n,i,o){if(!r){var a=P(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else R(e,t,!1,s,n,i,o);return u}(this,n,o,e,t,r)),i},T.prototype.cork=function(){this._writableState.corked++},T.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||j(this,e))},T.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new k(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(e,t,r){r(new y("_write()"))},T.prototype._writev=null,T.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||N(this,n,r),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),T.prototype.destroy=h.destroy,T.prototype._undestroy=h.undestroy,T.prototype._destroy=function(e,t){t(e)}},{"util-deprecate":"yM1o","./internal/streams/stream":"ExO1",buffer:"dskh","./internal/streams/destroy":"GRUB","./internal/streams/state":"TWVJ","../errors":"Yj9o",inherits:"Bm0n","./_stream_duplex":"Hba0",process:"pBGv"}],Hba0:[function(e,t,r){e("process");var n=e("process"),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=f;var o=e("./_stream_readable"),a=e("./_stream_writable");e("inherits")(f,o);for(var s=i(a.prototype),u=0;u<s.length;u++){var l=s[u];f.prototype[l]||(f.prototype[l]=a.prototype[l])}function f(e){if(!(this instanceof f))return new f(e);o.call(this,e),a.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||n.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(f.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(f.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(f.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(f.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},{"./_stream_readable":"DHrQ","./_stream_writable":"WSyY",inherits:"Bm0n",process:"pBGv"}],Wugr:[function(e,t,r){var n=e("buffer"),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?t.exports=n:(o(n,r),r.Buffer=a),a.prototype=Object.create(i.prototype),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)}},{buffer:"dskh"}],z0rv:[function(e,t,r){"use strict";var n=e("safe-buffer").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=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}function a(e){var t;switch(this.encoding=o(e),this.encoding){case"utf16le":this.text=l,this.end=f,t=4;break;case"utf8":this.fillLast=u,t=4;break;case"base64":this.text=c,this.end=h,t=3;break;default:return this.write=d,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(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 l(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 f(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 c(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 h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}r.StringDecoder=a,a.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<e.length?t?t+this.text(e,r):this.text(e,r):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},a.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):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)},a.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}},{"safe-buffer":"Wugr"}],mrEY:[function(e,t,r){"use strict";var n=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var a=r.readable||!1!==r.readable&&t.readable,s=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||f()},l=t._writableState&&t._writableState.finished,f=function(){s=!1,l=!0,a||o.call(t)},c=t._readableState&&t._readableState.endEmitted,h=function(){a=!1,c=!0,s||o.call(t)},d=function(e){o.call(t,e)},p=function(){var e;return a&&!c?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):s&&!l?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},b=function(){t.req.on("finish",f)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",f),t.on("abort",p),t.req?b():t.on("request",b)):s&&!t._writableState&&(t.on("end",u),t.on("close",u)),t.on("end",h),t.on("finish",f),!1!==r.error&&t.on("error",d),t.on("close",p),function(){t.removeListener("complete",f),t.removeListener("abort",p),t.removeListener("request",b),t.req&&t.req.removeListener("finish",f),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",f),t.removeListener("end",h),t.removeListener("error",d),t.removeListener("close",p)}}},{"../../../errors":"Yj9o"}],AOGM:[function(e,t,r){e("process");var n,i=e("process");function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=e("./end-of-stream"),s=Symbol("lastResolve"),u=Symbol("lastReject"),l=Symbol("error"),f=Symbol("ended"),c=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function p(e,t){return{value:e,done:t}}function b(e){var t=e[s];if(null!==t){var r=e[d].read();null!==r&&(e[c]=null,e[s]=null,e[u]=null,t(p(r,!1)))}}function y(e){i.nextTick(b,e)}var g=Object.getPrototypeOf(function(){}),m=Object.setPrototypeOf((o(n={get stream(){return this[d]},next:function(){var e=this,t=this[l];if(null!==t)return Promise.reject(t);if(this[f])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise(function(t,r){i.nextTick(function(){e[l]?r(e[l]):t(p(void 0,!0))})});var r,n=this[c];if(n)r=new Promise(function(e,t){return function(r,n){e.then(function(){t[f]?r(p(void 0,!0)):t[h](r,n)},n)}}(n,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(p(o,!1));r=new Promise(this[h])}return this[c]=r,r}},Symbol.asyncIterator,function(){return this}),o(n,"return",function(){var e=this;return new Promise(function(t,r){e[d].destroy(null,function(e){e?r(e):t(p(void 0,!0))})})}),n),g);t.exports=function(e){var t,r=Object.create(m,(o(t={},d,{value:e,writable:!0}),o(t,s,{value:null,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,l,{value:null,writable:!0}),o(t,f,{value:e._readableState.endEmitted,writable:!0}),o(t,h,{value:function(e,t){var n=r[d].read();n?(r[c]=null,r[s]=null,r[u]=null,e(p(n,!1))):(r[s]=e,r[u]=t)},writable:!0}),t));return r[c]=null,a(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];return null!==t&&(r[c]=null,r[s]=null,r[u]=null,t(e)),void(r[l]=e)}var n=r[s];null!==n&&(r[c]=null,r[s]=null,r[u]=null,n(p(void 0,!0))),r[f]=!0}),e.on("readable",y.bind(null,r)),r}},{"./end-of-stream":"mrEY",process:"pBGv"}],Rr4m:[function(e,t,r){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],DHrQ:[function(e,t,r){arguments[3],e("process");var n,i=arguments[3],o=e("process");t.exports=T,T.ReadableState=E;e("events").EventEmitter;var a=function(e,t){return e.listeners(t).length},s=e("./internal/streams/stream"),u=e("buffer").Buffer,l=i.Uint8Array||function(){};var f,c=e("util");f=c&&c.debuglog?c.debuglog("stream"):function(){};var h,d,p,b=e("./internal/streams/buffer_list"),y=e("./internal/streams/destroy"),g=e("./internal/streams/state").getHighWaterMark,m=e("../errors").codes,v=m.ERR_INVALID_ARG_TYPE,w=m.ERR_STREAM_PUSH_AFTER_EOF,_=m.ERR_METHOD_NOT_IMPLEMENTED,k=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;e("inherits")(T,s);var S=y.errorOrDestroy,x=["error","close","destroy","pause","resume"];function E(t,r,i){n=n||e("./_stream_duplex"),t=t||{},"boolean"!=typeof i&&(i=r instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",i),this.buffer=new b,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.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(h||(h=e("string_decoder/").StringDecoder),this.decoder=new h(t.encoding),this.encoding=t.encoding)}function T(t){if(n=n||e("./_stream_duplex"),!(this instanceof T))return new T(t);var r=this instanceof n;this._readableState=new E(t,this,r),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function O(e,t,r,n,i){f("readableAddChunk",t);var o,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(f("onEofChunk"),!t.ended){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.sync?A(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,M(e)))}}(e,a);else if(i||(o=function(e,t){var r;return function(e){return u.isBuffer(e)||e instanceof a}(t)||"string"==typeof t||void 0===t||e.objectMode||(r=new v("chunk",["string","Buffer","Uint8Array"],t)),r}(a,t)),o)S(e,o);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)a.endEmitted?S(e,new k):C(e,a,t,!0);else if(a.ended)S(e,new w);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?C(e,a,t,!1):j(e,a)):C(e,a,t,!1)}else n||(a.reading=!1,j(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function C(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&A(e)),j(e,t)}Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),T.prototype.destroy=y.destroy,T.prototype._undestroy=y.undestroy,T.prototype._destroy=function(e,t){t(e)},T.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=u.from(e,t),t=""),r=!0),O(this,e,t,!1,r)},T.prototype.unshift=function(e){return O(this,e,null,!0,!1)},T.prototype.isPaused=function(){return!1===this._readableState.flowing},T.prototype.setEncoding=function(t){h||(h=e("string_decoder/").StringDecoder);var r=new h(t);this._readableState.decoder=r,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=r.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var P=1073741824;function R(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=P?e=P:(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 A(e){var t=e._readableState;f("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(f("emitReadable",t.flowing),t.emittedReadable=!0,o.nextTick(M,e))}function M(e){var t=e._readableState;f("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,N(e)}function j(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(I,e,t))}function I(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(f("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function L(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function D(e){f("readable nexttick read 0"),e.read(0)}function U(e,t){f("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),N(e),t.flowing&&!t.reading&&e.read(0)}function N(e){var t=e._readableState;for(f("flow",t.flowing);t.flowing&&null!==e.read(););}function B(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function F(e){var t=e._readableState;f("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,o.nextTick(G,t,e))}function G(e,t){if(f("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function W(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}T.prototype.read=function(e){f("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return f("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?F(this):A(this),null;if(0===(e=R(e,t))&&t.ended)return 0===t.length&&F(this),null;var n,i=t.needReadable;return f("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&f("length less than watermark",i=!0),t.ended||t.reading?f("reading or ended",i=!1):i&&(f("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=R(r,t))),null===(n=e>0?B(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&F(this)),null!==n&&this.emit("data",n),n},T.prototype._read=function(e){S(this,new _("_read()"))},T.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,f("pipe count=%d opts=%j",n.pipesCount,t);var i=t&&!1===t.end||e===o.stdout||e===o.stderr?b:s;function s(){f("onend"),e.end()}n.endEmitted?o.nextTick(i):r.once("end",i),e.on("unpipe",function t(i,o){f("onunpipe"),i===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,f("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",u),e.removeListener("error",h),e.removeListener("unpipe",t),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",c),l=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||u())});var u=function(e){return function(){var t=e._readableState;f("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,N(e))}}(r);e.on("drain",u);var l=!1;function c(t){f("ondata");var i=e.write(t);f("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==W(n.pipes,e))&&!l&&(f("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){f("onerror",t),b(),e.removeListener("error",h),0===a(e,"error")&&S(e,t)}function d(){e.removeListener("finish",p),b()}function p(){f("onfinish"),e.removeListener("close",d),b()}function b(){f("unpipe"),r.unpipe(e)}return r.on("data",c),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",d),e.once("finish",p),e.emit("pipe",r),n.flowing||(f("pipe resume"),r.resume()),e},T.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<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=W(t.pipes,e);return-1===a?this:(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)},T.prototype.on=function(e,t){var r=s.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,f("on readable",n.length,n.reading),n.length?A(this):n.reading||o.nextTick(D,this))),r},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&o.nextTick(L,this),r},T.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||o.nextTick(L,this),t},T.prototype.resume=function(){var e=this._readableState;return e.flowing||(f("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(U,e,t))}(this,e)),e.paused=!1,this},T.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},T.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(f("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){f("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<x.length;o++)e.on(x[o],this.emit.bind(this,x[o]));return this._read=function(t){f("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(T.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=e("./internal/streams/async_iterator")),d(this)}),Object.defineProperty(T.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(T.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(T.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),T._fromList=B,Object.defineProperty(T.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(T.from=function(t,r){return void 0===p&&(p=e("./internal/streams/from")),p(T,t,r)})},{events:"FRpO","./internal/streams/stream":"ExO1",buffer:"dskh",util:"rDCW","./internal/streams/buffer_list":"VCcH","./internal/streams/destroy":"GRUB","./internal/streams/state":"TWVJ","../errors":"Yj9o",inherits:"Bm0n","./_stream_duplex":"Hba0","string_decoder/":"z0rv","./internal/streams/async_iterator":"AOGM","./internal/streams/from":"Rr4m",process:"pBGv"}],tlBz:[function(e,t,r){"use strict";t.exports=f;var n=e("../errors").codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=e("./_stream_duplex");function l(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function f(e){if(!(this instanceof f))return new f(e);u.call(this,e),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",c)}function c(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush(function(t,r){h(e,t,r)})}function h(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new a;return e.push(null)}e("inherits")(f,u),f.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},f.prototype._transform=function(e,t,r){r(new i("_transform()"))},f.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},f.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},f.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,function(e){t(e)})}},{"../errors":"Yj9o","./_stream_duplex":"Hba0",inherits:"Bm0n"}],nwyA:[function(e,t,r){"use strict";t.exports=i;var n=e("./_stream_transform");function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}e("inherits")(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":"tlBz",inherits:"Bm0n"}],AJFC:[function(e,t,r){"use strict";var n;var i=e("../../../errors").codes,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function u(t,r,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var s=!1;t.on("close",function(){s=!0}),void 0===n&&(n=e("./end-of-stream")),n(t,{readable:r,writable:i},function(e){if(e)return o(e);s=!0,o()});var u=!1;return function(e){if(!s&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new a("pipe"))}}function l(e){e()}function f(e,t){return e.pipe(t)}function c(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}t.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=c(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var a=t.map(function(e,r){var o=r<t.length-1;return u(e,o,r>0,function(e){n||(n=e),e&&a.forEach(l),o||(a.forEach(l),i(n))})});return t.reduce(f)}},{"../../../errors":"Yj9o","./end-of-stream":"mrEY"}],tzeh:[function(e,t,r){(r=t.exports=e("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js"),r.finished=e("./lib/internal/streams/end-of-stream.js"),r.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_readable.js":"DHrQ","./lib/_stream_writable.js":"WSyY","./lib/_stream_duplex.js":"Hba0","./lib/_stream_transform.js":"tlBz","./lib/_stream_passthrough.js":"nwyA","./lib/internal/streams/end-of-stream.js":"mrEY","./lib/internal/streams/pipeline.js":"AJFC"}],vexR:[function(e,t,r){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],tcrG:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],gfUn:[function(e,t,r){e("process");var n=e("process"),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},o=/%[sdj%]/g;r.format=function(e){if(!v(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(u(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,a=String(e).replace(o,function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return e}}),s=n[r];r<i;s=n[++r])g(s)||!k(s)?a+=" "+s:a+=" "+u(s);return a},r.deprecate=function(e,t){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return r.deprecate(e,t).apply(this,arguments)};var i=!1;return function(){if(!i){if(n.throwDeprecation)throw new Error(t);n.traceDeprecation?console.trace(t):console.error(t),i=!0}return e.apply(this,arguments)}};var a,s={};function u(e,t){var n={seen:[],stylize:f};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(t)?n.showHidden=t:t&&r._extend(n,t),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),c(n,e,n.depth)}function l(e,t){var r=u.styles[t];return r?"["+u.colors[r][0]+"m"+e+"["+u.colors[r][1]+"m":e}function f(e,t){return e}function c(e,t,n){if(e.customInspect&&t&&E(t.inspect)&&t.inspect!==r.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(n,e);return v(i)||(i=c(e,i,n)),i}var o=h(e,t);if(o)return o;var a=Object.keys(t),s=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(t)),x(t)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return d(t);if(0===a.length){if(E(t)){var u=t.name?": "+t.name:"";return e.stylize("[Function"+u+"]","special")}if(_(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(S(t))return e.stylize(Date.prototype.toString.call(t),"date");if(x(t))return d(t)}var l,f="",y=!1,g=["{","}"];return b(t)&&(y=!0,g=["[","]"]),E(t)&&(f=" [Function"+(t.name?": "+t.name:"")+"]"),_(t)&&(f=" "+RegExp.prototype.toString.call(t)),S(t)&&(f=" "+Date.prototype.toUTCString.call(t)),x(t)&&(f=" "+d(t)),0!==a.length||y&&0!=t.length?n<0?_(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),l=y?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a<s;++a)P(t,String(a))?o.push(p(e,t,r,n,String(a),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(p(e,t,r,n,i,!0))}),o}(e,t,n,s,a):a.map(function(r){return p(e,t,n,s,r,y)}),e.seen.pop(),function(e,t,r){return e.reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(l,f,g)):g[0]+f+g[1]}function h(e,t){if(w(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return m(t)?e.stylize(""+t,"number"):y(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),P(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=g(r)?c(e,u.value,null):c(e,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),w(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function b(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function g(e){return null===e}function m(e){return"number"==typeof e}function v(e){return"string"==typeof e}function w(e){return void 0===e}function _(e){return k(e)&&"[object RegExp]"===T(e)}function k(e){return"object"==typeof e&&null!==e}function S(e){return k(e)&&"[object Date]"===T(e)}function x(e){return k(e)&&("[object Error]"===T(e)||e instanceof Error)}function E(e){return"function"==typeof e}function T(e){return Object.prototype.toString.call(e)}function O(e){return e<10?"0"+e.toString(10):e.toString(10)}r.debuglog=function(e){if(w(a)&&(a=""),e=e.toUpperCase(),!s[e])if(new RegExp("\\b"+e+"\\b","i").test(a)){var t=n.pid;s[e]=function(){var n=r.format.apply(r,arguments);console.error("%s %d: %s",e,t,n)}}else s[e]=function(){};return s[e]},r.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},r.isArray=b,r.isBoolean=y,r.isNull=g,r.isNullOrUndefined=function(e){return null==e},r.isNumber=m,r.isString=v,r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=w,r.isRegExp=_,r.isObject=k,r.isDate=S,r.isError=x,r.isFunction=E,r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e("./support/isBuffer");var C=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.log=function(){var e,t;console.log("%s - %s",(e=new Date,t=[O(e.getHours()),O(e.getMinutes()),O(e.getSeconds())].join(":"),[e.getDate(),C[e.getMonth()],t].join(" ")),r.format.apply(r,arguments))},r.inherits=e("inherits"),r._extend=function(e,t){if(!t||!k(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var R="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function A(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}r.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(R&&e[R]){var t;if("function"!=typeof(t=e[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise(function(e,n){t=e,r=n}),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push(function(e,n){e?r(e):t(n)});try{e.apply(this,i)}catch(l){r(l)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),R&&Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,i(e))},r.promisify.custom=R,r.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var i=t.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};e.apply(this,t).then(function(e){n.nextTick(a,null,e)},function(e){n.nextTick(A,e,a)})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,i(e)),t}},{"./support/isBuffer":"vexR",inherits:"tcrG",process:"pBGv"}],m2P9:[function(e,t,r){e("process");var n=e("process"),i=e("readable-stream").Transform,o=e("util").inherits;function a(e){i.call(this,e),this._destroyed=!1}function s(e,t,r){r(null,e)}function u(e){return function(t,r,n){return"function"==typeof t&&(n=r,r=t,t={}),"function"!=typeof r&&(r=s),"function"!=typeof n&&(n=null),e(t,r,n)}}o(a,i),a.prototype.destroy=function(e){if(!this._destroyed){this._destroyed=!0;var t=this;n.nextTick(function(){e&&t.emit("error",e),t.emit("close")})}},t.exports=u(function(e,t,r){var n=new a(e);return n._transform=t,r&&(n._flush=r),n}),t.exports.ctor=u(function(e,t,r){function n(t){if(!(this instanceof n))return new n(t);this.options=Object.assign({},e,t),a.call(this,this.options)}return o(n,a),n.prototype._transform=t,r&&(n.prototype._flush=r),n}),t.exports.obj=u(function(e,t,r){var n=new a(Object.assign({objectMode:!0,highWaterMark:16},e));return n._transform=t,r&&(n._flush=r),n})},{"readable-stream":"tzeh",util:"gfUn",process:"pBGv"}],JO74:[function(e,t,r){function n(e,t){"use strict";var r=(t=t||{}).pos||0,i="<",o="<".charCodeAt(0),a=">",s=">".charCodeAt(0),u="-".charCodeAt(0),l="/".charCodeAt(0),f="!".charCodeAt(0),c="'".charCodeAt(0),h='"'.charCodeAt(0);function d(){for(var t=[];e[r];)if(e.charCodeAt(r)==o){if(e.charCodeAt(r+1)===l)return(r=e.indexOf(a,r))+1&&(r+=1),t;if(e.charCodeAt(r+1)===f){if(e.charCodeAt(r+2)==u){for(;-1!==r&&(e.charCodeAt(r)!==s||e.charCodeAt(r-1)!=u||e.charCodeAt(r-2)!=u||-1==r);)r=e.indexOf(a,r+1);-1===r&&(r=e.length)}else for(r+=2;e.charCodeAt(r)!==s&&e[r];)r++;r++;continue}var n=m();t.push(n)}else{var i=p();i.trim().length>0&&t.push(i),r++}return t}function p(){var t=r;return-2==(r=e.indexOf(i,r)-1)&&(r=e.length),e.slice(t,r+1)}var b="\n\t>/= ";function y(){for(var t=r;-1===b.indexOf(e[r])&&e[r];)r++;return e.slice(t,r)}var g=t.noChildNodes||["img","br","input","meta","link"];function m(){r++;const t=y(),n={};let i=[];for(;e.charCodeAt(r)!==s&&e[r];){var o=e.charCodeAt(r);if(o>64&&o<91||o>96&&o<123){for(var a=y(),u=e.charCodeAt(r);u&&u!==c&&u!==h&&!(u>64&&u<91||u>96&&u<123)&&u!==s;)r++,u=e.charCodeAt(r);if(u===c||u===h){var f=v();if(-1===r)return{tagName:t,attributes:n,children:i}}else f=null,r--;n[a]=f}r++}if(e.charCodeAt(r-1)!==l)if("script"==t){var p=r+1;r=e.indexOf("<\/script>",r),i=[e.slice(p,r-1)],r+=9}else"style"==t?(p=r+1,r=e.indexOf("</style>",r),i=[e.slice(p,r-1)],r+=8):-1==g.indexOf(t)&&(r++,i=d());else r++;return{tagName:t,attributes:n,children:i}}function v(){var t=e[r],n=++r;return r=e.indexOf(t,n),e.slice(n,r)}var w,_=null;if(void 0!==t.attrValue)for(t.attrName=t.attrName||"id",_=[];-1!==(void 0,w=new RegExp("\\s"+t.attrName+"\\s*=['\"]"+t.attrValue+"['\"]").exec(e),r=w?w.index:-1);)-1!==(r=e.lastIndexOf("<",r))&&_.push(m()),e=e.substr(r),r=0;else _=t.parseNode?m():d();return t.filter&&(_=n.filter(_,t.filter)),t.setPos&&(_.pos=r),_}n.simplify=function(e){var t={};if(!e.length)return"";if(1===e.length&&"string"==typeof e[0])return e[0];for(var r in e.forEach(function(e){if("object"==typeof e){t[e.tagName]||(t[e.tagName]=[]);var r=n.simplify(e.children||[]);t[e.tagName].push(r),e.attributes&&(r._attributes=e.attributes)}}),t)1==t[r].length&&(t[r]=t[r][0]);return t},n.filter=function(e,t){var r=[];return e.forEach(function(e){if("object"==typeof e&&t(e)&&r.push(e),e.children){var i=n.filter(e.children,t);r=r.concat(i)}}),r},n.stringify=function(e){var t="";function r(e){if(e)for(var r=0;r<e.length;r++)"string"==typeof e[r]?t+=e[r].trim():n(e[r])}function n(e){for(var n in t+="<"+e.tagName,e.attributes)null===e.attributes[n]?t+=" "+n:-1===e.attributes[n].indexOf('"')?t+=" "+n+'="'+e.attributes[n].trim()+'"':t+=" "+n+"='"+e.attributes[n].trim()+"'";t+=">",r(e.children),t+="</"+e.tagName+">"}return r(e),t},n.toContentString=function(e){if(Array.isArray(e)){var t="";return e.forEach(function(e){t=(t+=" "+n.toContentString(e)).trim()}),t}return"object"==typeof e?n.toContentString(e.children):" "+e},n.getElementById=function(e,t,r){var i=n(e,{attrValue:t});return r?n.simplify(i):i[0]},n.getElementsByClassName=function(e,t,r){const i=n(e,{attrName:"class",attrValue:"[a-zA-Z0-9-s ]*"+t+"[a-zA-Z0-9-s ]*"});return r?n.simplify(i):i},n.parseStream=function(t,r){if("string"==typeof r&&(r=r.length+2),"string"==typeof t){var i=e("fs");t=i.createReadStream(t,{start:r}),r=0}var o=r,a="";return t.on("data",function(e){a+=e;for(var r=0;;){if(!(o=a.indexOf("<",o)+1))return void(o=r);if("/"!==a[o+1]){var i=n(a,{pos:o-1,parseNode:!0,setPos:!0});if((o=i.pos)>a.length-1||o<r)return a=a.slice(r),o=0,void(r=0);t.emit("xml",i),r=o}else o+=1,r=pos}}),t.on("end",function(){console.log("end")}),t},n.transformStream=function(t){const r=e("through2");"string"==typeof t&&(t=t.length+2);var i=t||0,o="";return r({readableObjectMode:!0},function(e,t,r){o+=e;for(var a=0;;){if(!(i=o.indexOf("<",i)+1))return i=a,r();if("/"!==o[i+1]){var s=n(o,{pos:i-1,parseNode:!0,setPos:!0});if((i=s.pos)>o.length-1||i<a)return o=o.slice(a),i=0,a=0,r();this.push(s),a=i}else i+=1,a=pos}r()})},"object"==typeof t&&(t.exports=n,n.xml=n)},{fs:"rDCW",through2:"m2P9"}],j27V:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.geoKeys=r.geoKeyNames=r.ExtraSamplesValues=r.photometricInterpretations=r.fieldTypes=r.fieldTypeNames=r.arrayFields=r.fieldTagTypes=r.fieldTags=r.fieldTagNames=void 0;var n={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams"};r.fieldTagNames=n;var i={};for(var o in r.fieldTags=i,n)n.hasOwnProperty(o)&&(i[n[o]]=parseInt(o,10));r.fieldTagTypes={256:"SHORT",257:"SHORT",258:"SHORT",259:"SHORT",262:"SHORT",273:"LONG",274:"SHORT",277:"SHORT",278:"LONG",279:"LONG",282:"RATIONAL",283:"RATIONAL",284:"SHORT",286:"SHORT",287:"RATIONAL",296:"SHORT",305:"ASCII",306:"ASCII",338:"SHORT",339:"SHORT",513:"LONG",514:"LONG",1024:"SHORT",1025:"SHORT",2048:"SHORT",2049:"ASCII",33550:"DOUBLE",33922:"DOUBLE",34665:"LONG",34735:"SHORT",34737:"ASCII",42113:"ASCII"};var a=[i.BitsPerSample,i.ExtraSamples,i.SampleFormat,i.StripByteCounts,i.StripOffsets,i.StripRowCounts,i.TileByteCounts,i.TileOffsets];r.arrayFields=a;var s={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"};r.fieldTypeNames=s;var u={};for(var l in r.fieldTypes=u,s)s.hasOwnProperty(l)&&(u[s[l]]=parseInt(l,10));r.photometricInterpretations={WhiteIsZero:0,BlackIsZero:1,RGB:2,Palette:3,TransparencyMask:4,CMYK:5,YCbCr:6,CIELab:8,ICCLab:9};r.ExtraSamplesValues={Unspecified:0,Assocalpha:1,Unassalpha:2};var f={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"};r.geoKeyNames=f;var c={};for(var h in r.geoKeys=c,f)f.hasOwnProperty(h)&&(c[f[h]]=parseInt(h,10))},{}],fpBl:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.fromWhiteIsZero=function(e,t){for(var r,n=e.width,i=e.height,o=new Uint8Array(n*i*3),a=0,s=0;a<e.length;++a,s+=3)r=256-e[a]/t*256,o[s]=r,o[s+1]=r,o[s+2]=r;return o},r.fromBlackIsZero=function(e,t){for(var r,n=e.width,i=e.height,o=new Uint8Array(n*i*3),a=0,s=0;a<e.length;++a,s+=3)r=e[a]/t*256,o[s]=r,o[s+1]=r,o[s+2]=r;return o},r.fromPalette=function(e,t){for(var r=e.width,n=e.height,i=new Uint8Array(r*n*3),o=t.length/3,a=t.length/3*2,s=0,u=0;s<e.length;++s,u+=3){var l=e[s];i[u]=t[l]/65536*256,i[u+1]=t[l+o]/65536*256,i[u+2]=t[l+a]/65536*256}return i},r.fromCMYK=function(e){for(var t=e.width,r=e.height,n=new Uint8Array(t*r*3),i=0,o=0;i<e.length;i+=4,o+=3){var a=e[i],s=e[i+1],u=e[i+2],l=e[i+3];n[o]=(255-a)/256*255*((255-l)/256),n[o+1]=(255-s)/256*255*((255-l)/256),n[o+2]=(255-u)/256*255*((255-l)/256)}return n},r.fromYCbCr=function(e){for(var t=e.width,r=e.height,n=new Uint8ClampedArray(t*r*3),i=0,o=0;i<e.length;i+=3,o+=3){var a=e[i],s=e[i+1],u=e[i+2];n[o]=a+1.402*(u-128),n[o+1]=a-.34414*(s-128)-.71414*(u-128),n[o+2]=a+1.772*(s-128)}return n},r.fromCIELab=function(e){for(var t=e.width,r=e.height,a=new Uint8Array(t*r*3),s=0,u=0;s<e.length;s+=3,u+=3){var l=(e[s+0]+16)/116,f=(e[s+1]<<24>>24)/500+l,c=l-(e[s+2]<<24>>24)/200,h=void 0,d=void 0,p=void 0;d=-.9689*(f=n*(f*f*f>.008856?f*f*f:(f-16/116)/7.787))+1.8758*(l=i*(l*l*l>.008856?l*l*l:(l-16/116)/7.787))+.0415*(c=o*(c*c*c>.008856?c*c*c:(c-16/116)/7.787)),p=.0557*f+-.204*l+1.057*c,h=(h=3.2406*f+-1.5372*l+-.4986*c)>.0031308?1.055*Math.pow(h,1/2.4)-.055:12.92*h,d=d>.0031308?1.055*Math.pow(d,1/2.4)-.055:12.92*d,p=p>.0031308?1.055*Math.pow(p,1/2.4)-.055:12.92*p,a[u]=255*Math.max(0,Math.min(1,h)),a[u+1]=255*Math.max(0,Math.min(1,d)),a[u+2]=255*Math.max(0,Math.min(1,p))}return a};var n=.95047,i=1,o=1.08883},{}],IKSA:[function(e,t,r){"use strict";function n(e,t){var r=e.length-t,n=0;do{for(var i=t;i>0;i--)e[n+t]+=e[n],n++;r-=t}while(r>0)}function i(e,t,r){for(var n=0,i=e.length,o=i/r;i>t;){for(var a=t;a>0;--a)e[n+t]+=e[n],++n;i-=t}for(var s=e.slice(),u=0;u<o;++u)for(var l=0;l<r;++l)e[r*u+l]=s[(r-l-1)*o+u]}Object.defineProperty(r,"__esModule",{value:!0}),r.applyPredictor=function(e,t,r,o,a,s){if(!t||1===t)return e;for(var u=0;u<a.length;++u){if(a[u]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(a[u]!==a[0])throw new Error("When decoding with predictor, all samples must have the same size.")}for(var l=a[0]/8,f=2===s?1:a.length,c=0;c<o&&!(c*f*r*l>=e.byteLength);++c){var h=void 0;if(2===t){switch(a[0]){case 8:h=new Uint8Array(e,c*f*r*l,f*r*l);break;case 16:h=new Uint16Array(e,c*f*r*l,f*r*l/2);break;case 32:h=new Uint32Array(e,c*f*r*l,f*r*l/4);break;default:throw new Error("Predictor 2 not allowed with ".concat(a[0]," bits per sample."))}n(h,f)}else 3===t&&i(h=new Uint8Array(e,c*f*r*l,f*r*l),f,l)}return e}},{}],FJDe:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=a(e("@babel/runtime/helpers/classCallCheck")),i=a(e("@babel/runtime/helpers/createClass")),o=e("../predictor");function a(e){return e&&e.__esModule?e:{default:e}}var s=function(){function e(){(0,n.default)(this,e)}return(0,i.default)(e,[{key:"decode",value:function(e,t){var r=this.decodeBlock(t),n=e.Predictor||1;if(1!==n){var i=!e.StripOffsets,a=i?e.TileWidth:e.ImageWidth,s=i?e.TileLength:e.RowsPerStrip||e.ImageLength;return(0,o.applyPredictor)(r,n,a,s,e.BitsPerSample,e.PlanarConfiguration)}return r}}]),e}();r.default=s},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","../predictor":"IKSA"}],V9bQ:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=u(e("@babel/runtime/helpers/classCallCheck")),i=u(e("@babel/runtime/helpers/createClass")),o=u(e("@babel/runtime/helpers/possibleConstructorReturn")),a=u(e("@babel/runtime/helpers/getPrototypeOf")),s=u(e("@babel/runtime/helpers/inherits"));function u(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(){return(0,n.default)(this,t),(0,o.default)(this,(0,a.default)(t).apply(this,arguments))}return(0,s.default)(t,e),(0,i.default)(t,[{key:"decodeBlock",value:function(e){return e}}]),t}(u(e("./basedecoder")).default);r.default=l},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","@babel/runtime/helpers/inherits":"d4H2","./basedecoder":"FJDe"}],tcId:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=l(e("@babel/runtime/helpers/classCallCheck")),i=l(e("@babel/runtime/helpers/createClass")),o=l(e("@babel/runtime/helpers/possibleConstructorReturn")),a=l(e("@babel/runtime/helpers/getPrototypeOf")),s=l(e("@babel/runtime/helpers/inherits")),u=l(e("./basedecoder"));function l(e){return e&&e.__esModule?e:{default:e}}var f=9,c=256,h=257,d=12;function p(e,t){for(var r=t.length-1;r>=0;r--)e.push(t[r]);return e}function b(e){for(var t=new Uint16Array(4093),r=new Uint8Array(4093),n=0;n<=257;n++)t[n]=4096,r[n]=n;var i=258,o=f,a=0;function s(){i=258,o=f}function u(e){var t=function(e,t,r){var n=t%8,i=Math.floor(t/8),o=8-n,a=t+r-8*(i+1),s=8*(i+2)-(t+r),u=8*(i+2)-t;if(s=Math.max(0,s),i>=e.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),h;var l=e[i]&Math.pow(2,8-n)-1,f=l<<=r-o;if(i+1<e.length){var c=e[i+1]>>>s;f+=c<<=Math.max(0,r-u)}if(a>8&&i+2<e.length){var d=8*(i+3)-(t+r);f+=e[i+2]>>>d}return f}(e,a,o);return a+=o,t}function l(e,n){return r[i]=n,t[i]=e,++i-1}function b(e){for(var n=[],i=e;4096!==i;i=t[i])n.push(r[i]);return n}var y=[];s();for(var g,m=new Uint8Array(e),v=u(m);v!==h;){if(v===c){for(s(),v=u(m);v===c;)v=u(m);if(v===h)break;if(v>c)throw new Error("corrupted code at scanline ".concat(v));p(y,b(v)),g=v}else if(v<i){var w=b(v);p(y,w),l(g,w[w.length-1]),g=v}else{var _=b(g);if(!_)throw new Error("Bogus entry. Not in dictionary, ".concat(g," / ").concat(i,", position: ").concat(a));p(y,_),y.push(_[_.length-1]),l(g,_[_.length-1]),g=v}i+1>=Math.pow(2,o)&&(o===d?g=void 0:o++),v=u(m)}return new Uint8Array(y)}var y=function(e){function t(){return(0,n.default)(this,t),(0,o.default)(this,(0,a.default)(t).apply(this,arguments))}return(0,s.default)(t,e),(0,i.default)(t,[{key:"decodeBlock",value:function(e){return b(e).buffer}}]),t}(u.default);r.default=y},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","@babel/runtime/helpers/inherits":"d4H2","./basedecoder":"FJDe"}],J7kk:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=f(e("@babel/runtime/helpers/possibleConstructorReturn")),i=f(e("@babel/runtime/helpers/getPrototypeOf")),o=f(e("@babel/runtime/helpers/inherits")),a=f(e("@babel/runtime/helpers/classCallCheck")),s=f(e("@babel/runtime/helpers/createClass")),u=f(e("@babel/runtime/helpers/typeof")),l=f(e("./basedecoder"));function f(e){return e&&e.__esModule?e:{default:e}}var c=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),h=4017,d=799,p=3406,b=2276,y=1567,g=3784,m=5793,v=2896;function w(e,t){for(var r=0,n=[],i=16;i>0&&!e[i-1];)--i;n.push({children:[],index:0});for(var o,a=n[0],s=0;s<i;s++){for(var u=0;u<e[s];u++){for((a=n.pop()).children[a.index]=t[r];a.index>0;)a=n.pop();for(a.index++,n.push(a);n.length<=s;)n.push(o={children:[],index:0}),a.children[a.index]=o.children,a=o;r++}s+1<i&&(n.push(o={children:[],index:0}),a.children[a.index]=o.children,a=o)}return n[0].children}function _(e,t,r,n,i,o,a,s,l){var f=r.mcusPerLine,h=r.progressive,d=t,p=t,b=0,y=0;function g(){if(y>0)return b>>--y&1;if(255===(b=e[p++])){var t=e[p++];if(t)throw new Error("unexpected marker: ".concat((b<<8|t).toString(16)))}return y=7,b>>>7}function m(e){for(var t,r=e;null!==(t=g());){if("number"==typeof(r=r[t]))return r;if("object"!==(0,u.default)(r))throw new Error("invalid huffman sequence")}return null}function v(e){for(var t=e,r=0;t>0;){var n=g();if(null===n)return;r=r<<1|n,--t}return r}function w(e){var t=v(e);return t>=1<<e-1?t:t+(-1<<e)+1}var _,k=0,S=0;function x(e,t,r,n,i){var o=r%f,a=(r/f|0)*e.v+n,s=o*e.h+i;t(e,e.blocks[a][s])}function E(e,t,r){var n=r/e.blocksPerLine|0,i=r%e.blocksPerLine;t(e,e.blocks[n][i])}var T,O,C,P,R,A,M=n.length;A=h?0===o?0===s?function(e,t){var r=m(e.huffmanTableDC),n=0===r?0:w(r)<<l;e.pred+=n,t[0]=e.pred}:function(e,t){t[0]|=g()<<l}:0===s?function(e,t){if(k>0)k--;else for(var r=o,n=a;r<=n;){var i=m(e.huffmanTableAC),s=15&i,u=i>>4;if(0===s){if(u<15){k=v(u)+(1<<u)-1;break}r+=16}else t[c[r+=u]]=w(s)*(1<<l),r++}}:function(e,t){for(var r=o,n=a,i=0;r<=n;){var s=c[r],u=t[s]<0?-1:1;switch(S){case 0:var f=m(e.huffmanTableAC),h=15&f;if(i=f>>4,0===h)i<15?(k=v(i)+(1<<i),S=4):(i=16,S=1);else{if(1!==h)throw new Error("invalid ACn encoding");_=w(h),S=i?2:3}continue;case 1:case 2:t[s]?t[s]+=(g()<<l)*u:0==--i&&(S=2===S?3:0);break;case 3:t[s]?t[s]+=(g()<<l)*u:(t[s]=_<<l,S=0);break;case 4:t[s]&&(t[s]+=(g()<<l)*u)}r++}4===S&&0==--k&&(S=0)}:function(e,t){var r=m(e.huffmanTableDC),n=0===r?0:w(r);e.pred+=n,t[0]=e.pred;for(var i=1;i<64;){var o=m(e.huffmanTableAC),a=15&o,s=o>>4;if(0===a){if(s<15)break;i+=16}else t[c[i+=s]]=w(a),i++}};var j,I,L=0;I=1===M?n[0].blocksPerLine*n[0].blocksPerColumn:f*r.mcusPerColumn;for(var D=i||I;L<I;){for(O=0;O<M;O++)n[O].pred=0;if(k=0,1===M)for(T=n[0],R=0;R<D;R++)E(T,A,L),L++;else for(R=0;R<D;R++){for(O=0;O<M;O++){var U=T=n[O],N=U.h,B=U.v;for(C=0;C<B;C++)for(P=0;P<N;P++)x(T,A,L,C,P)}if(++L===I)break}if(y=0,(j=e[p]<<8|e[p+1])<65280)throw new Error("marker was not found");if(!(j>=65488&&j<=65495))break;p+=2}return p-d}function k(e,t){var r=[],n=t.blocksPerLine,i=t.blocksPerColumn,o=n<<3,a=new Int32Array(64),s=new Uint8Array(64);function u(e,r,n){var i,o,a,s,u,l,f,c,w,_,k=t.quantizationTable,S=n;for(_=0;_<64;_++)S[_]=e[_]*k[_];for(_=0;_<8;++_){var x=8*_;0!==S[1+x]||0!==S[2+x]||0!==S[3+x]||0!==S[4+x]||0!==S[5+x]||0!==S[6+x]||0!==S[7+x]?(i=m*S[0+x]+128>>8,o=m*S[4+x]+128>>8,a=S[2+x],s=S[6+x],u=v*(S[1+x]-S[7+x])+128>>8,c=v*(S[1+x]+S[7+x])+128>>8,l=S[3+x]<<4,f=S[5+x]<<4,w=i-o+1>>1,i=i+o+1>>1,o=w,w=a*g+s*y+128>>8,a=a*y-s*g+128>>8,s=w,w=u-f+1>>1,u=u+f+1>>1,f=w,w=c+l+1>>1,l=c-l+1>>1,c=w,w=i-s+1>>1,i=i+s+1>>1,s=w,w=o-a+1>>1,o=o+a+1>>1,a=w,w=u*b+c*p+2048>>12,u=u*p-c*b+2048>>12,c=w,w=l*d+f*h+2048>>12,l=l*h-f*d+2048>>12,f=w,S[0+x]=i+c,S[7+x]=i-c,S[1+x]=o+f,S[6+x]=o-f,S[2+x]=a+l,S[5+x]=a-l,S[3+x]=s+u,S[4+x]=s-u):(w=m*S[0+x]+512>>10,S[0+x]=w,S[1+x]=w,S[2+x]=w,S[3+x]=w,S[4+x]=w,S[5+x]=w,S[6+x]=w,S[7+x]=w)}for(_=0;_<8;++_){var E=_;0!==S[8+E]||0!==S[16+E]||0!==S[24+E]||0!==S[32+E]||0!==S[40+E]||0!==S[48+E]||0!==S[56+E]?(i=m*S[0+E]+2048>>12,o=m*S[32+E]+2048>>12,a=S[16+E],s=S[48+E],u=v*(S[8+E]-S[56+E])+2048>>12,c=v*(S[8+E]+S[56+E])+2048>>12,l=S[24+E],f=S[40+E],w=i-o+1>>1,i=i+o+1>>1,o=w,w=a*g+s*y+2048>>12,a=a*y-s*g+2048>>12,s=w,w=u-f+1>>1,u=u+f+1>>1,f=w,w=c+l+1>>1,l=c-l+1>>1,c=w,w=i-s+1>>1,i=i+s+1>>1,s=w,w=o-a+1>>1,o=o+a+1>>1,a=w,w=u*b+c*p+2048>>12,u=u*p-c*b+2048>>12,c=w,w=l*d+f*h+2048>>12,l=l*h-f*d+2048>>12,f=w,S[0+E]=i+c,S[56+E]=i-c,S[8+E]=o+f,S[48+E]=o-f,S[16+E]=a+l,S[40+E]=a-l,S[24+E]=s+u,S[32+E]=s-u):(w=m*n[_+0]+8192>>14,S[0+E]=w,S[8+E]=w,S[16+E]=w,S[24+E]=w,S[32+E]=w,S[40+E]=w,S[48+E]=w,S[56+E]=w)}for(_=0;_<64;++_){var T=128+(S[_]+8>>4);r[_]=T<0?0:T>255?255:T}}for(var l=0;l<i;l++){for(var f=l<<3,c=0;c<8;c++)r.push(new Uint8Array(o));for(var w=0;w<n;w++){u(t.blocks[l][w],s,a);for(var _=0,k=w<<3,S=0;S<8;S++)for(var x=r[f+S],E=0;E<8;E++)x[k+E]=s[_++]}}return r}var S=function(){function e(){(0,a.default)(this,e),this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}return(0,s.default)(e,[{key:"resetFrames",value:function(){this.frames=[]}},{key:"parse",value:function(e){var t=0;function r(){var r=e[t]<<8|e[t+1];return t+=2,r}function n(e){var t,r,n=0,i=0;for(r in e.components)e.components.hasOwnProperty(r)&&(n<(t=e.components[r]).h&&(n=t.h),i<t.v&&(i=t.v));var o=Math.ceil(e.samplesPerLine/8/n),a=Math.ceil(e.scanLines/8/i);for(r in e.components)if(e.components.hasOwnProperty(r)){t=e.components[r];for(var s=Math.ceil(Math.ceil(e.samplesPerLine/8)*t.h/n),u=Math.ceil(Math.ceil(e.scanLines/8)*t.v/i),l=o*t.h,f=a*t.v,c=[],h=0;h<f;h++){for(var d=[],p=0;p<l;p++)d.push(new Int32Array(64));c.push(d)}t.blocksPerLine=s,t.blocksPerColumn=u,t.blocks=c}e.maxH=n,e.maxV=i,e.mcusPerLine=o,e.mcusPerColumn=a}var i,o,a=r();if(65496!==a)throw new Error("SOI not found");for(a=r();65497!==a;){switch(a){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var s=(void 0,void 0,i=r(),o=e.subarray(t,t+i-2),t+=o.length,o);65504===a&&74===s[0]&&70===s[1]&&73===s[2]&&70===s[3]&&0===s[4]&&(this.jfif={version:{major:s[5],minor:s[6]},densityUnits:s[7],xDensity:s[8]<<8|s[9],yDensity:s[10]<<8|s[11],thumbWidth:s[12],thumbHeight:s[13],thumbData:s.subarray(14,14+3*s[12]*s[13])}),65518===a&&65===s[0]&&100===s[1]&&111===s[2]&&98===s[3]&&101===s[4]&&0===s[5]&&(this.adobe={version:s[6],flags0:s[7]<<8|s[8],flags1:s[9]<<8|s[10],transformCode:s[11]});break;case 65499:for(var u=r()+t-2;t<u;){var l=e[t++],f=new Int32Array(64);if(l>>4==0)for(var h=0;h<64;h++)f[c[h]]=e[t++];else{if(l>>4!=1)throw new Error("DQT: invalid table spec");for(var d=0;d<64;d++)f[c[d]]=r()}this.quantizationTables[15&l]=f}break;case 65472:case 65473:case 65474:r();for(var p={extended:65473===a,progressive:65474===a,precision:e[t++],scanLines:r(),samplesPerLine:r(),components:{},componentsOrder:[]},b=e[t++],y=void 0,g=0;g<b;g++){y=e[t];var m=e[t+1]>>4,v=15&e[t+1],k=e[t+2];p.componentsOrder.push(y),p.components[y]={h:m,v:v,quantizationIdx:k},t+=3}n(p),this.frames.push(p);break;case 65476:for(var S=r(),x=2;x<S;){for(var E=e[t++],T=new Uint8Array(16),O=0,C=0;C<16;C++,t++)T[C]=e[t],O+=T[C];for(var P=new Uint8Array(O),R=0;R<O;R++,t++)P[R]=e[t];x+=17+O,E>>4==0?this.huffmanTablesDC[15&E]=w(T,P):this.huffmanTablesAC[15&E]=w(T,P)}break;case 65501:r(),this.resetInterval=r();break;case 65498:r();for(var A=e[t++],M=[],j=this.frames[0],I=0;I<A;I++){var L=j.components[e[t++]],D=e[t++];L.huffmanTableDC=this.huffmanTablesDC[D>>4],L.huffmanTableAC=this.huffmanTablesAC[15&D],M.push(L)}var U=e[t++],N=e[t++],B=e[t++],F=_(e,t,j,M,this.resetInterval,U,N,B>>4,15&B);t+=F;break;case 65535:255!==e[t]&&t--;break;default:if(255===e[t-3]&&e[t-2]>=192&&e[t-2]<=254){t-=3;break}throw new Error("unknown JPEG marker ".concat(a.toString(16)))}a=r()}}},{key:"getResult",value:function(){var e=this.frames;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(var t=0;t<this.frames.length;t++)for(var r=this.frames[t].components,n=0,i=Object.keys(r);n<i.length;n++){var o=i[n];r[o].quantizationTable=this.quantizationTables[r[o].quantizationIdx],delete r[o].quantizationIdx}for(var a=e[0],s=a.components,u=a.componentsOrder,l=[],f=a.samplesPerLine,c=a.scanLines,h=0;h<u.length;h++){var d=s[u[h]];l.push({lines:k(0,d),scaleX:d.h/a.maxH,scaleY:d.v/a.maxV})}for(var p=new Uint8Array(f*c*l.length),b=0,y=0;y<c;++y)for(var g=0;g<f;++g)for(var m=0;m<l.length;++m){var v=l[m];p[b]=v.lines[0|y*v.scaleY][0|g*v.scaleX],++b}return p}}]),e}(),x=function(e){function t(e){var r;return(0,a.default)(this,t),(r=(0,n.default)(this,(0,i.default)(t).call(this))).reader=new S,e.JPEGTables&&r.reader.parse(e.JPEGTables),r}return(0,o.default)(t,e),(0,s.default)(t,[{key:"decodeBlock",value:function(e){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(e)),this.reader.getResult().buffer}}]),t}(l.default);r.default=x},{"@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/typeof":"b9XL","./basedecoder":"FJDe"}],tbG5:[function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)i(r,n)&&(e[n]=r[n])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var o={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,a;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),i=0,t=0,r=e.length;t<r;t++)o=e[t],a.set(o,i),i+=o.length;return a}},a={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){e?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,o)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,a))},r.setTyped(n)},{}],uxo6:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}},{}],X4kj:[function(e,t,r){"use strict";var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var o=n,a=i+r;e^=-1;for(var s=i;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}},{}],LP5M:[function(e,t,r){"use strict";t.exports=function(e,t){var r,n,i,o,a,s,u,l,f,c,h,d,p,b,y,g,m,v,w,_,k,S,x,E,T;r=e.state,n=e.next_in,E=e.input,i=n+(e.avail_in-5),o=e.next_out,T=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),u=r.dmax,l=r.wsize,f=r.whave,c=r.wnext,h=r.window,d=r.hold,p=r.bits,b=r.lencode,y=r.distcode,g=(1<<r.lenbits)-1,m=(1<<r.distbits)-1;e:do{p<15&&(d+=E[n++]<<p,p+=8,d+=E[n++]<<p,p+=8),v=b[d&g];t:for(;;){if(d>>>=w=v>>>24,p-=w,0==(w=v>>>16&255))T[o++]=65535&v;else{if(!(16&w)){if(0==(64&w)){v=b[(65535&v)+(d&(1<<w)-1)];continue t}if(32&w){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}_=65535&v,(w&=15)&&(p<w&&(d+=E[n++]<<p,p+=8),_+=d&(1<<w)-1,d>>>=w,p-=w),p<15&&(d+=E[n++]<<p,p+=8,d+=E[n++]<<p,p+=8),v=y[d&m];r:for(;;){if(d>>>=w=v>>>24,p-=w,!(16&(w=v>>>16&255))){if(0==(64&w)){v=y[(65535&v)+(d&(1<<w)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(k=65535&v,p<(w&=15)&&(d+=E[n++]<<p,(p+=8)<w&&(d+=E[n++]<<p,p+=8)),(k+=d&(1<<w)-1)>u){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=w,p-=w,k>(w=o-a)){if((w=k-w)>f&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(S=0,x=h,0===c){if(S+=l-w,w<_){_-=w;do{T[o++]=h[S++]}while(--w);S=o-k,x=T}}else if(c<w){if(S+=l+c-w,(w-=c)<_){_-=w;do{T[o++]=h[S++]}while(--w);if(S=0,c<_){_-=w=c;do{T[o++]=h[S++]}while(--w);S=o-k,x=T}}}else if(S+=c-w,w<_){_-=w;do{T[o++]=h[S++]}while(--w);S=o-k,x=T}for(;_>2;)T[o++]=x[S++],T[o++]=x[S++],T[o++]=x[S++],_-=3;_&&(T[o++]=x[S++],_>1&&(T[o++]=x[S++]))}else{S=o-k;do{T[o++]=T[S++],T[o++]=T[S++],T[o++]=T[S++],_-=3}while(_>2);_&&(T[o++]=T[S++],_>1&&(T[o++]=T[S++]))}break}}break}}while(n<i&&o<s);n-=_=p>>3,d&=(1<<(p-=_<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=o<s?s-o+257:257-(o-s),r.hold=d,r.bits=p}},{}],uNlq:[function(e,t,r){"use strict";var n=e("../utils/common"),i=15,o=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],u=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,r,l,f,c,h,d){var p,b,y,g,m,v,w,_,k,S=d.bits,x=0,E=0,T=0,O=0,C=0,P=0,R=0,A=0,M=0,j=0,I=null,L=0,D=new n.Buf16(16),U=new n.Buf16(16),N=null,B=0;for(x=0;x<=i;x++)D[x]=0;for(E=0;E<l;E++)D[t[r+E]]++;for(C=S,O=i;O>=1&&0===D[O];O--);if(C>O&&(C=O),0===O)return f[c++]=20971520,f[c++]=20971520,d.bits=1,0;for(T=1;T<O&&0===D[T];T++);for(C<T&&(C=T),A=1,x=1;x<=i;x++)if(A<<=1,(A-=D[x])<0)return-1;if(A>0&&(0===e||1!==O))return-1;for(U[1]=0,x=1;x<i;x++)U[x+1]=U[x]+D[x];for(E=0;E<l;E++)0!==t[r+E]&&(h[U[t[r+E]]++]=E);if(0===e?(I=N=h,v=19):1===e?(I=o,L-=257,N=a,B-=257,v=256):(I=s,N=u,v=-1),j=0,E=0,x=T,m=c,P=C,R=0,y=-1,g=(M=1<<C)-1,1===e&&M>852||2===e&&M>592)return 1;for(;;){w=x-R,h[E]<v?(_=0,k=h[E]):h[E]>v?(_=N[B+h[E]],k=I[L+h[E]]):(_=96,k=0),p=1<<x-R,T=b=1<<P;do{f[m+(j>>R)+(b-=p)]=w<<24|_<<16|k|0}while(0!==b);for(p=1<<x-1;j&p;)p>>=1;if(0!==p?(j&=p-1,j+=p):j=0,E++,0==--D[x]){if(x===O)break;x=t[r+h[E]]}if(x>C&&(j&g)!==y){for(0===R&&(R=C),m+=T,A=1<<(P=x-R);P+R<O&&!((A-=D[P+R])<=0);)P++,A<<=1;if(M+=1<<P,1===e&&M>852||2===e&&M>592)return 1;f[y=j&g]=C<<24|P<<16|m-c|0}}return 0!==j&&(f[m+j]=x-R<<24|64<<16|0),d.bits=C,0}},{"../utils/common":"tbG5"}],GIDK:[function(e,t,r){"use strict";var n=e("../utils/common"),i=e("./adler32"),o=e("./crc32"),a=e("./inffast"),s=e("./inftrees"),u=0,l=1,f=2,c=4,h=5,d=6,p=0,b=1,y=2,g=-2,m=-3,v=-4,w=-5,_=8,k=1,S=2,x=3,E=4,T=5,O=6,C=7,P=8,R=9,A=10,M=11,j=12,I=13,L=14,D=15,U=16,N=17,B=18,F=19,G=20,W=21,q=22,z=23,H=24,K=25,Y=26,V=27,Z=28,J=29,Q=30,X=31,$=32,ee=852,te=592,re=15;function ne(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function ie(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function oe(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=k,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(ee),t.distcode=t.distdyn=new n.Buf32(te),t.sane=1,t.back=-1,p):g}function ae(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,oe(e)):g}function se(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?g:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,ae(e))):g}function ue(e,t){var r,n;return e?(n=new ie,e.state=n,n.window=null,(r=se(e,t))!==p&&(e.state=null),r):g}var le,fe,ce=!0;function he(e){if(ce){var t;for(le=new n.Buf32(512),fe=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(l,e.lens,0,288,le,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(f,e.lens,0,32,fe,0,e.work,{bits:5}),ce=!1}e.lencode=le,e.lenbits=9,e.distcode=fe,e.distbits=5}function de(e,t,r,i){var o,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new n.Buf8(a.wsize)),i>=a.wsize?(n.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):((o=a.wsize-a.wnext)>i&&(o=i),n.arraySet(a.window,t,r-i,o,a.wnext),(i-=o)?(n.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}r.inflateReset=ae,r.inflateReset2=se,r.inflateResetKeep=oe,r.inflateInit=function(e){return ue(e,re)},r.inflateInit2=ue,r.inflate=function(e,t){var r,ee,te,re,ie,oe,ae,se,ue,le,fe,ce,pe,be,ye,ge,me,ve,we,_e,ke,Se,xe,Ee,Te=0,Oe=new n.Buf8(4),Ce=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return g;(r=e.state).mode===j&&(r.mode=I),ie=e.next_out,te=e.output,ae=e.avail_out,re=e.next_in,ee=e.input,oe=e.avail_in,se=r.hold,ue=r.bits,le=oe,fe=ae,Se=p;e:for(;;)switch(r.mode){case k:if(0===r.wrap){r.mode=I;break}for(;ue<16;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}if(2&r.wrap&&35615===se){r.check=0,Oe[0]=255&se,Oe[1]=se>>>8&255,r.check=o(r.check,Oe,2,0),se=0,ue=0,r.mode=S;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&se)<<8)+(se>>8))%31){e.msg="incorrect header check",r.mode=Q;break}if((15&se)!==_){e.msg="unknown compression method",r.mode=Q;break}if(ue-=4,ke=8+(15&(se>>>=4)),0===r.wbits)r.wbits=ke;else if(ke>r.wbits){e.msg="invalid window size",r.mode=Q;break}r.dmax=1<<ke,e.adler=r.check=1,r.mode=512&se?A:j,se=0,ue=0;break;case S:for(;ue<16;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}if(r.flags=se,(255&r.flags)!==_){e.msg="unknown compression method",r.mode=Q;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=Q;break}r.head&&(r.head.text=se>>8&1),512&r.flags&&(Oe[0]=255&se,Oe[1]=se>>>8&255,r.check=o(r.check,Oe,2,0)),se=0,ue=0,r.mode=x;case x:for(;ue<32;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}r.head&&(r.head.time=se),512&r.flags&&(Oe[0]=255&se,Oe[1]=se>>>8&255,Oe[2]=se>>>16&255,Oe[3]=se>>>24&255,r.check=o(r.check,Oe,4,0)),se=0,ue=0,r.mode=E;case E:for(;ue<16;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}r.head&&(r.head.xflags=255&se,r.head.os=se>>8),512&r.flags&&(Oe[0]=255&se,Oe[1]=se>>>8&255,r.check=o(r.check,Oe,2,0)),se=0,ue=0,r.mode=T;case T:if(1024&r.flags){for(;ue<16;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}r.length=se,r.head&&(r.head.extra_len=se),512&r.flags&&(Oe[0]=255&se,Oe[1]=se>>>8&255,r.check=o(r.check,Oe,2,0)),se=0,ue=0}else r.head&&(r.head.extra=null);r.mode=O;case O:if(1024&r.flags&&((ce=r.length)>oe&&(ce=oe),ce&&(r.head&&(ke=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,ee,re,ce,ke)),512&r.flags&&(r.check=o(r.check,ee,ce,re)),oe-=ce,re+=ce,r.length-=ce),r.length))break e;r.length=0,r.mode=C;case C:if(2048&r.flags){if(0===oe)break e;ce=0;do{ke=ee[re+ce++],r.head&&ke&&r.length<65536&&(r.head.name+=String.fromCharCode(ke))}while(ke&&ce<oe);if(512&r.flags&&(r.check=o(r.check,ee,ce,re)),oe-=ce,re+=ce,ke)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=P;case P:if(4096&r.flags){if(0===oe)break e;ce=0;do{ke=ee[re+ce++],r.head&&ke&&r.length<65536&&(r.head.comment+=String.fromCharCode(ke))}while(ke&&ce<oe);if(512&r.flags&&(r.check=o(r.check,ee,ce,re)),oe-=ce,re+=ce,ke)break e}else r.head&&(r.head.comment=null);r.mode=R;case R:if(512&r.flags){for(;ue<16;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}if(se!==(65535&r.check)){e.msg="header crc mismatch",r.mode=Q;break}se=0,ue=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=j;break;case A:for(;ue<32;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}e.adler=r.check=ne(se),se=0,ue=0,r.mode=M;case M:if(0===r.havedict)return e.next_out=ie,e.avail_out=ae,e.next_in=re,e.avail_in=oe,r.hold=se,r.bits=ue,y;e.adler=r.check=1,r.mode=j;case j:if(t===h||t===d)break e;case I:if(r.last){se>>>=7&ue,ue-=7&ue,r.mode=V;break}for(;ue<3;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}switch(r.last=1&se,ue-=1,3&(se>>>=1)){case 0:r.mode=L;break;case 1:if(he(r),r.mode=G,t===d){se>>>=2,ue-=2;break e}break;case 2:r.mode=N;break;case 3:e.msg="invalid block type",r.mode=Q}se>>>=2,ue-=2;break;case L:for(se>>>=7&ue,ue-=7&ue;ue<32;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}if((65535&se)!=(se>>>16^65535)){e.msg="invalid stored block lengths",r.mode=Q;break}if(r.length=65535&se,se=0,ue=0,r.mode=D,t===d)break e;case D:r.mode=U;case U:if(ce=r.length){if(ce>oe&&(ce=oe),ce>ae&&(ce=ae),0===ce)break e;n.arraySet(te,ee,re,ce,ie),oe-=ce,re+=ce,ae-=ce,ie+=ce,r.length-=ce;break}r.mode=j;break;case N:for(;ue<14;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}if(r.nlen=257+(31&se),se>>>=5,ue-=5,r.ndist=1+(31&se),se>>>=5,ue-=5,r.ncode=4+(15&se),se>>>=4,ue-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=Q;break}r.have=0,r.mode=B;case B:for(;r.have<r.ncode;){for(;ue<3;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}r.lens[Ce[r.have++]]=7&se,se>>>=3,ue-=3}for(;r.have<19;)r.lens[Ce[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,xe={bits:r.lenbits},Se=s(u,r.lens,0,19,r.lencode,0,r.work,xe),r.lenbits=xe.bits,Se){e.msg="invalid code lengths set",r.mode=Q;break}r.have=0,r.mode=F;case F:for(;r.have<r.nlen+r.ndist;){for(;ge=(Te=r.lencode[se&(1<<r.lenbits)-1])>>>16&255,me=65535&Te,!((ye=Te>>>24)<=ue);){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}if(me<16)se>>>=ye,ue-=ye,r.lens[r.have++]=me;else{if(16===me){for(Ee=ye+2;ue<Ee;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}if(se>>>=ye,ue-=ye,0===r.have){e.msg="invalid bit length repeat",r.mode=Q;break}ke=r.lens[r.have-1],ce=3+(3&se),se>>>=2,ue-=2}else if(17===me){for(Ee=ye+3;ue<Ee;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}ue-=ye,ke=0,ce=3+(7&(se>>>=ye)),se>>>=3,ue-=3}else{for(Ee=ye+7;ue<Ee;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}ue-=ye,ke=0,ce=11+(127&(se>>>=ye)),se>>>=7,ue-=7}if(r.have+ce>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=Q;break}for(;ce--;)r.lens[r.have++]=ke}}if(r.mode===Q)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=Q;break}if(r.lenbits=9,xe={bits:r.lenbits},Se=s(l,r.lens,0,r.nlen,r.lencode,0,r.work,xe),r.lenbits=xe.bits,Se){e.msg="invalid literal/lengths set",r.mode=Q;break}if(r.distbits=6,r.distcode=r.distdyn,xe={bits:r.distbits},Se=s(f,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,xe),r.distbits=xe.bits,Se){e.msg="invalid distances set",r.mode=Q;break}if(r.mode=G,t===d)break e;case G:r.mode=W;case W:if(oe>=6&&ae>=258){e.next_out=ie,e.avail_out=ae,e.next_in=re,e.avail_in=oe,r.hold=se,r.bits=ue,a(e,fe),ie=e.next_out,te=e.output,ae=e.avail_out,re=e.next_in,ee=e.input,oe=e.avail_in,se=r.hold,ue=r.bits,r.mode===j&&(r.back=-1);break}for(r.back=0;ge=(Te=r.lencode[se&(1<<r.lenbits)-1])>>>16&255,me=65535&Te,!((ye=Te>>>24)<=ue);){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}if(ge&&0==(240&ge)){for(ve=ye,we=ge,_e=me;ge=(Te=r.lencode[_e+((se&(1<<ve+we)-1)>>ve)])>>>16&255,me=65535&Te,!(ve+(ye=Te>>>24)<=ue);){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}se>>>=ve,ue-=ve,r.back+=ve}if(se>>>=ye,ue-=ye,r.back+=ye,r.length=me,0===ge){r.mode=Y;break}if(32&ge){r.back=-1,r.mode=j;break}if(64&ge){e.msg="invalid literal/length code",r.mode=Q;break}r.extra=15&ge,r.mode=q;case q:if(r.extra){for(Ee=r.extra;ue<Ee;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}r.length+=se&(1<<r.extra)-1,se>>>=r.extra,ue-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=z;case z:for(;ge=(Te=r.distcode[se&(1<<r.distbits)-1])>>>16&255,me=65535&Te,!((ye=Te>>>24)<=ue);){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}if(0==(240&ge)){for(ve=ye,we=ge,_e=me;ge=(Te=r.distcode[_e+((se&(1<<ve+we)-1)>>ve)])>>>16&255,me=65535&Te,!(ve+(ye=Te>>>24)<=ue);){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}se>>>=ve,ue-=ve,r.back+=ve}if(se>>>=ye,ue-=ye,r.back+=ye,64&ge){e.msg="invalid distance code",r.mode=Q;break}r.offset=me,r.extra=15&ge,r.mode=H;case H:if(r.extra){for(Ee=r.extra;ue<Ee;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}r.offset+=se&(1<<r.extra)-1,se>>>=r.extra,ue-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=Q;break}r.mode=K;case K:if(0===ae)break e;if(ce=fe-ae,r.offset>ce){if((ce=r.offset-ce)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=Q;break}ce>r.wnext?(ce-=r.wnext,pe=r.wsize-ce):pe=r.wnext-ce,ce>r.length&&(ce=r.length),be=r.window}else be=te,pe=ie-r.offset,ce=r.length;ce>ae&&(ce=ae),ae-=ce,r.length-=ce;do{te[ie++]=be[pe++]}while(--ce);0===r.length&&(r.mode=W);break;case Y:if(0===ae)break e;te[ie++]=r.length,ae--,r.mode=W;break;case V:if(r.wrap){for(;ue<32;){if(0===oe)break e;oe--,se|=ee[re++]<<ue,ue+=8}if(fe-=ae,e.total_out+=fe,r.total+=fe,fe&&(e.adler=r.check=r.flags?o(r.check,te,fe,ie-fe):i(r.check,te,fe,ie-fe)),fe=ae,(r.flags?se:ne(se))!==r.check){e.msg="incorrect data check",r.mode=Q;break}se=0,ue=0}r.mode=Z;case Z:if(r.wrap&&r.flags){for(;ue<32;){if(0===oe)break e;oe--,se+=ee[re++]<<ue,ue+=8}if(se!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=Q;break}se=0,ue=0}r.mode=J;case J:Se=b;break e;case Q:Se=m;break e;case X:return v;case $:default:return g}return e.next_out=ie,e.avail_out=ae,e.next_in=re,e.avail_in=oe,r.hold=se,r.bits=ue,(r.wsize||fe!==e.avail_out&&r.mode<Q&&(r.mode<V||t!==c))&&de(e,e.output,e.next_out,fe-e.avail_out)?(r.mode=X,v):(le-=e.avail_in,fe-=e.avail_out,e.total_in+=le,e.total_out+=fe,r.total+=fe,r.wrap&&fe&&(e.adler=r.check=r.flags?o(r.check,te,fe,e.next_out-fe):i(r.check,te,fe,e.next_out-fe)),e.data_type=r.bits+(r.last?64:0)+(r.mode===j?128:0)+(r.mode===G||r.mode===D?256:0),(0===le&&0===fe||t===c)&&Se===p&&(Se=w),Se)},r.inflateEnd=function(e){if(!e||!e.state)return g;var t=e.state;return t.window&&(t.window=null),e.state=null,p},r.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?g:(r.head=t,t.done=!1,p):g},r.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&r.mode!==M?g:r.mode===M&&i(1,t,n,0)!==r.check?m:de(e,t,n,n)?(r.mode=X,v):(r.havedict=1,p):g},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":"tbG5","./adler32":"uxo6","./crc32":"X4kj","./inffast":"LP5M","./inftrees":"uNlq"}],Q3ZD:[function(e,t,r){"use strict";var n=e("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(l){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(l){o=!1}for(var a=new n.Buf8(256),s=0;s<256;s++)a[s]=s>=252?6:s>=248?5:s>=240?4:s>=224?3:s>=192?2:1;function u(e,t){if(t<65534&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",a=0;a<t;a++)r+=String.fromCharCode(e[a]);return r}a[254]=a[254]=1,r.string2buf=function(e){var t,r,i,o,a,s=e.length,u=0;for(o=0;o<s;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),u+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(u),a=0,o=0;a<u;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},r.buf2binstring=function(e){return u(e,e.length)},r.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t},r.buf2string=function(e,t){var r,n,i,o,s=t||e.length,l=new Array(2*s);for(n=0,r=0;r<s;)if((i=e[r++])<128)l[n++]=i;else if((o=a[i])>4)l[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&r<s;)i=i<<6|63&e[r++],o--;o>1?l[n++]=65533:i<65536?l[n++]=i:(i-=65536,l[n++]=55296|i>>10&1023,l[n++]=56320|1023&i)}return u(l,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0?t:0===r?t:r+a[e[r]]>t?r:t}},{"./common":"tbG5"}],xUUw:[function(e,t,r){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],gMAY:[function(e,t,r){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],bdtv:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],WIli:[function(e,t,r){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],faQk:[function(e,t,r){"use strict";var n=e("./zlib/inflate"),i=e("./utils/common"),o=e("./utils/strings"),a=e("./zlib/constants"),s=e("./zlib/messages"),u=e("./zlib/zstream"),l=e("./zlib/gzheader"),f=Object.prototype.toString;function c(e){if(!(this instanceof c))return new c(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==a.Z_OK)throw new Error(s[r]);if(this.header=new l,n.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=o.string2buf(t.dictionary):"[object ArrayBuffer]"===f.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=n.inflateSetDictionary(this.strm,t.dictionary))!==a.Z_OK))throw new Error(s[r])}function h(e,t){var r=new c(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}c.prototype.push=function(e,t){var r,s,u,l,c,h=this.strm,d=this.options.chunkSize,p=this.options.dictionary,b=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof e?h.input=o.binstring2buf(e):"[object ArrayBuffer]"===f.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new i.Buf8(d),h.next_out=0,h.avail_out=d),(r=n.inflate(h,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&p&&(r=n.inflateSetDictionary(this.strm,p)),r===a.Z_BUF_ERROR&&!0===b&&(r=a.Z_OK,b=!1),r!==a.Z_STREAM_END&&r!==a.Z_OK)return this.onEnd(r),this.ended=!0,!1;h.next_out&&(0!==h.avail_out&&r!==a.Z_STREAM_END&&(0!==h.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(u=o.utf8border(h.output,h.next_out),l=h.next_out-u,c=o.buf2string(h.output,u),h.next_out=l,h.avail_out=d-l,l&&i.arraySet(h.output,h.output,u,l,0),this.onData(c)):this.onData(i.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(b=!0)}while((h.avail_in>0||0===h.avail_out)&&r!==a.Z_STREAM_END);return r===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),h.avail_out=0,!0)},c.prototype.onData=function(e){this.chunks.push(e)},c.prototype.onEnd=function(e){e===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=c,r.inflate=h,r.inflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},r.ungzip=h},{"./zlib/inflate":"GIDK","./utils/common":"tbG5","./utils/strings":"Q3ZD","./zlib/constants":"xUUw","./zlib/messages":"gMAY","./zlib/zstream":"bdtv","./zlib/gzheader":"WIli"}],JAiC:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=l(e("@babel/runtime/helpers/classCallCheck")),i=l(e("@babel/runtime/helpers/createClass")),o=l(e("@babel/runtime/helpers/possibleConstructorReturn")),a=l(e("@babel/runtime/helpers/getPrototypeOf")),s=l(e("@babel/runtime/helpers/inherits")),u=e("pako/lib/inflate");function l(e){return e&&e.__esModule?e:{default:e}}var f=function(e){function t(){return(0,n.default)(this,t),(0,o.default)(this,(0,a.default)(t).apply(this,arguments))}return(0,s.default)(t,e),(0,i.default)(t,[{key:"decodeBlock",value:function(e){return(0,u.inflate)(new Uint8Array(e)).buffer}}]),t}(l(e("./basedecoder")).default);r.default=f},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","@babel/runtime/helpers/inherits":"d4H2","pako/lib/inflate":"faQk","./basedecoder":"FJDe"}],OcPz:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=u(e("@babel/runtime/helpers/classCallCheck")),i=u(e("@babel/runtime/helpers/createClass")),o=u(e("@babel/runtime/helpers/possibleConstructorReturn")),a=u(e("@babel/runtime/helpers/getPrototypeOf")),s=u(e("@babel/runtime/helpers/inherits"));function u(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(){return(0,n.default)(this,t),(0,o.default)(this,(0,a.default)(t).apply(this,arguments))}return(0,s.default)(t,e),(0,i.default)(t,[{key:"decodeBlock",value:function(e){for(var t=new DataView(e),r=[],n=0;n<e.byteLength;++n){var i=t.getInt8(n);if(i<0){var o=t.getUint8(n+1);i=-i;for(var a=0;a<=i;++a)r.push(o);n+=1}else{for(var s=0;s<=i;++s)r.push(t.getUint8(n+s+1));n+=i+1}}return new Uint8Array(r).buffer}}]),t}(u(e("./basedecoder")).default);r.default=l},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","@babel/runtime/helpers/inherits":"d4H2","./basedecoder":"FJDe"}],FGCZ:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getDecoder=function(e){switch(e.Compression){case void 0:case 1:return new n.default;case 5:return new i.default;case 6:throw new Error("old style JPEG compression is not supported.");case 7:return new o.default(e);case 8:case 32946:return new a.default;case 32773:return new s.default;default:throw new Error("Unknown compression method identifier: ".concat(e.Compression))}};var n=u(e("./raw")),i=u(e("./lzw")),o=u(e("./jpeg")),a=u(e("./deflate")),s=u(e("./packbits"));function u(e){return e&&e.__esModule?e:{default:e}}},{"./raw":"V9bQ","./lzw":"tcId","./jpeg":"J7kk","./deflate":"JAiC","./packbits":"OcPz"}],OQju:[function(e,t,r){"use strict";function n(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return new(Object.getPrototypeOf(e).constructor)(t*r*n)}function i(e,t,r,i,o){var a=t/i,s=r/o;return e.map(function(e){for(var u=n(e,i,o),l=0;l<o;++l)for(var f=Math.min(Math.round(s*l),r-1),c=0;c<i;++c){var h=Math.min(Math.round(a*c),t-1),d=e[f*t+h];u[l*i+c]=d}return u})}function o(e,t,r){return(1-r)*e+r*t}function a(e,t,r,i,a){var s=t/i,u=r/a;return e.map(function(e){for(var l=n(e,i,a),f=0;f<a;++f)for(var c=u*f,h=Math.floor(c),d=Math.min(Math.ceil(c),r-1),p=0;p<i;++p){var b=s*p,y=b%1,g=Math.floor(b),m=Math.min(Math.ceil(b),t-1),v=e[h*t+g],w=e[h*t+m],_=e[d*t+g],k=e[d*t+m],S=o(o(v,w,y),o(_,k,y),c%1);l[f*i+p]=S}return l})}function s(e,t,r,i,o,a){for(var s=t/i,u=r/o,l=n(e,i,o,a),f=0;f<o;++f)for(var c=Math.min(Math.round(u*f),r-1),h=0;h<i;++h)for(var d=Math.min(Math.round(s*h),t-1),p=0;p<a;++p){var b=e[c*t*a+d*a+p];l[f*i*a+h*a+p]=b}return l}function u(e,t,r,i,a,s){for(var u=t/i,l=r/a,f=n(e,i,a,s),c=0;c<a;++c)for(var h=l*c,d=Math.floor(h),p=Math.min(Math.ceil(h),r-1),b=0;b<i;++b)for(var y=u*b,g=y%1,m=Math.floor(y),v=Math.min(Math.ceil(y),t-1),w=0;w<s;++w){var _=e[d*t*s+m*s+w],k=e[d*t*s+v*s+w],S=e[p*t*s+m*s+w],x=e[p*t*s+v*s+w],E=o(o(_,k,g),o(S,x,g),h%1);f[c*i*s+b*s+w]=E}return f}Object.defineProperty(r,"__esModule",{value:!0}),r.resampleNearest=i,r.resampleBilinear=a,r.resample=function(e,t,r,n,o){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"nearest";switch(s.toLowerCase()){case"nearest":return i(e,t,r,n,o);case"bilinear":case"linear":return a(e,t,r,n,o);default:throw new Error("Unsupported resampling method: '".concat(s,"'"))}},r.resampleNearestInterleaved=s,r.resampleBilinearInterleaved=u,r.resampleInterleaved=function(e,t,r,n,i,o){var a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"nearest";switch(a.toLowerCase()){case"nearest":return s(e,t,r,n,i,o);case"bilinear":case"linear":return u(e,t,r,n,i,o);default:throw new Error("Unsupported resampling method: '".concat(a,"'"))}}},{}],eOWo:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=d(e("@babel/runtime/helpers/slicedToArray")),i=d(e("@babel/runtime/regenerator")),o=d(e("@babel/runtime/helpers/asyncToGenerator")),a=d(e("@babel/runtime/helpers/classCallCheck")),s=d(e("@babel/runtime/helpers/createClass")),u=d(e("txml")),l=e("./globals"),f=e("./rgb"),c=e("./compression"),h=e("./resample");function d(e){return e&&e.__esModule?e:{default:e}}function p(e,t,r){for(var n=0,i=t;i<r;++i)n+=e[i];return n}function b(e,t,r){switch(e){case 1:switch(t){case 8:return new Uint8Array(r);case 16:return new Uint16Array(r);case 32:return new Uint32Array(r)}break;case 2:switch(t){case 8:return new Int8Array(r);case 16:return new Int16Array(r);case 32:return new Int32Array(r)}break;case 3:switch(t){case 32:return new Float32Array(r);case 64:return new Float64Array(r)}}throw Error("Unsupported data format/bitsPerSample")}var y=function(){function e(t,r,n,i,o,s){(0,a.default)(this,e),this.fileDirectory=t,this.geoKeys=r,this.dataView=n,this.littleEndian=i,this.tiles=o?{}:null,this.isTiled=!t.StripOffsets;var u=t.PlanarConfiguration;if(this.planarConfiguration=void 0===u?1:u,1!==this.planarConfiguration&&2!==this.planarConfiguration)throw new Error("Invalid planar configuration.");this.source=s}return(0,s.default)(e,[{key:"getFileDirectory",value:function(){return this.fileDirectory}},{key:"getGeoKeys",value:function(){return this.geoKeys}},{key:"getWidth",value:function(){return this.fileDirectory.ImageWidth}},{key:"getHeight",value:function(){return this.fileDirectory.ImageLength}},{key:"getSamplesPerPixel",value:function(){return this.fileDirectory.SamplesPerPixel}},{key:"getTileWidth",value:function(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}},{key:"getTileHeight",value:function(){return this.isTiled?this.fileDirectory.TileLength:void 0!==this.fileDirectory.RowsPerStrip?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}},{key:"getBytesPerPixel",value:function(){for(var e=0,t=0;t<this.fileDirectory.BitsPerSample.length;++t){var r=this.fileDirectory.BitsPerSample[t];if(r%8!=0)throw new Error("Sample bit-width of ".concat(r," is not supported."));if(r!==this.fileDirectory.BitsPerSample[0])throw new Error("Differing size of samples in a pixel are not supported.");e+=r}return e/8}},{key:"getSampleByteSize",value:function(e){if(e>=this.fileDirectory.BitsPerSample.length)throw new RangeError("Sample index ".concat(e," is out of range."));var t=this.fileDirectory.BitsPerSample[e];if(t%8!=0)throw new Error("Sample bit-width of ".concat(t," is not supported."));return t/8}},{key:"getReaderForSample",value:function(e){var t=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1,r=this.fileDirectory.BitsPerSample[e];switch(t){case 1:switch(r){case 8:return DataView.prototype.getUint8;case 16:return DataView.prototype.getUint16;case 32:return DataView.prototype.getUint32}break;case 2:switch(r){case 8:return DataView.prototype.getInt8;case 16:return DataView.prototype.getInt16;case 32:return DataView.prototype.getInt32}break;case 3:switch(r){case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}}throw Error("Unsupported data format/bitsPerSample")}},{key:"getArrayForSample",value:function(e,t){return b(this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1,this.fileDirectory.BitsPerSample[e],t)}},{key:"getTileOrStrip",value:function(){var e=(0,o.default)(i.default.mark(function e(t,r,n,o){var a,s,u,l,f,c,h,d;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=Math.ceil(this.getWidth()/this.getTileWidth()),s=Math.ceil(this.getHeight()/this.getTileHeight()),l=this.tiles,1===this.planarConfiguration?u=r*a+t:2===this.planarConfiguration&&(u=n*a*s+r*a+t),this.isTiled?(f=this.fileDirectory.TileOffsets[u],c=this.fileDirectory.TileByteCounts[u]):(f=this.fileDirectory.StripOffsets[u],c=this.fileDirectory.StripByteCounts[u]),e.next=7,this.source.fetch(f,c);case 7:return h=e.sent,null===l?d=o.decode(this.fileDirectory,h):l[u]||(d=o.decode(this.fileDirectory,h),l[u]=d),e.t0=t,e.t1=r,e.t2=n,e.next=14,d;case 14:return e.t3=e.sent,e.abrupt("return",{x:e.t0,y:e.t1,sample:e.t2,data:e.t3});case 16:case"end":return e.stop()}},e,this)}));return function(t,r,n,i){return e.apply(this,arguments)}}()},{key:"_readRaster",value:function(){var e=(0,o.default)(i.default.mark(function e(t,r,n,o,a,s,u,l){var f,c,d,b,y,g,m,v,w,_,k,S,x,E,T,O,C,P,R=this;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:for(f=this.getTileWidth(),c=this.getTileHeight(),d=Math.max(Math.floor(t[0]/f),0),b=Math.min(Math.ceil(t[2]/f),Math.ceil(this.getWidth()/this.getTileWidth())),y=Math.max(Math.floor(t[1]/c),0),g=Math.min(Math.ceil(t[3]/c),Math.ceil(this.getHeight()/this.getTileHeight())),m=t[2]-t[0],v=this.getBytesPerPixel(),w=[],_=[],k=0;k<r.length;++k)1===this.planarConfiguration?w.push(p(this.fileDirectory.BitsPerSample,0,r[k])/8):w.push(0),_.push(this.getReaderForSample(r[k]));for(S=[],x=this.littleEndian,E=y;E<g;++E)for(T=d;T<b;++T)for(O=function(e){var i=e,s=r[e];2===R.planarConfiguration&&(v=R.getSampleByteSize(s));var u=R.getTileOrStrip(T,E,s,a);S.push(u),u.then(function(e){for(var a=e.data,s=new DataView(a),u=e.y*c,l=e.x*f,h=(e.y+1)*c,d=(e.x+1)*f,p=_[i],b=Math.min(c,c-(h-t[3])),y=Math.min(f,f-(d-t[2])),g=Math.max(0,t[1]-u);g<b;++g)for(var k=Math.max(0,t[0]-l);k<y;++k){var S=(g*f+k)*v,E=p.call(s,S+w[i],x),T=void 0;o?(T=(g+u-t[1])*m*r.length+(k+l-t[0])*r.length+i,n[T]=E):(T=(g+u-t[1])*m+k+l-t[0],n[i][T]=E)}})},C=0;C<r.length;++C)O(C);return e.next=16,Promise.all(S);case 16:if(!(s&&t[2]-t[0]!==s||u&&t[3]-t[1]!==u)){e.next=21;break}return(P=o?(0,h.resampleInterleaved)(n,t[2]-t[0],t[3]-t[1],s,u,r.length,l):(0,h.resample)(n,t[2]-t[0],t[3]-t[1],s,u,l)).width=s,P.height=u,e.abrupt("return",P);case 21:return n.width=s||t[2]-t[0],n.height=u||t[3]-t[1],e.abrupt("return",n);case 24:case"end":return e.stop()}},e,this)}));return function(t,r,n,i,o,a,s,u){return e.apply(this,arguments)}}()},{key:"readRasters",value:function(){var e=(0,o.default)(i.default.mark(function e(){var t,r,n,o,a,s,u,l,f,h,d,p,y,g,m,v,w,_,k,S,x,E,T,O,C=arguments;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=C.length>0&&void 0!==C[0]?C[0]:{},r=t.window,n=t.samples,o=void 0===n?[]:n,a=t.interleave,s=t.pool,u=void 0===s?null:s,l=t.width,f=t.height,h=t.resampleMethod,d=t.fillValue,!((p=r||[0,0,this.getWidth(),this.getHeight()])[0]>p[2]||p[1]>p[3])){e.next=4;break}throw new Error("Invalid subsets");case 4:if(y=p[2]-p[0],g=p[3]-p[1],m=y*g,o&&o.length){e.next=11;break}for(v=0;v<this.fileDirectory.SamplesPerPixel;++v)o.push(v);e.next=18;break;case 11:w=0;case 12:if(!(w<o.length)){e.next=18;break}if(!(o[w]>=this.fileDirectory.SamplesPerPixel)){e.next=15;break}return e.abrupt("return",Promise.reject(new RangeError("Invalid sample index '".concat(o[w],"'."))));case 15:++w,e.next=12;break;case 18:if(a)k=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,S=Math.max.apply(null,this.fileDirectory.BitsPerSample),_=b(k,S,m*o.length),d&&_.fill(d);else for(_=[],x=0;x<o.length;++x)E=this.getArrayForSample(o[x],m),Array.isArray(d)&&x<d.length?E.fill(d[x]):d&&!Array.isArray(d)&&E.fill(d),_.push(E);return T=u||(0,c.getDecoder)(this.fileDirectory),e.next=22,this._readRaster(p,o,_,a,T,l,f,h);case 22:return O=e.sent,e.abrupt("return",O);case 24:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"readRGB",value:function(){var e=(0,o.default)(i.default.mark(function e(){var t,r,n,o,a,s,u,c,h,d,p,b,y,g,m,v,w,_,k,S=arguments;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=S.length>0&&void 0!==S[0]?S[0]:{},r=t.window,n=t.pool,o=void 0===n?null:n,a=t.width,s=t.height,u=t.resampleMethod,c=t.enableAlpha,h=void 0!==c&&c,!((d=r||[0,0,this.getWidth(),this.getHeight()])[0]>d[2]||d[1]>d[3])){e.next=4;break}throw new Error("Invalid subsets");case 4:if((p=this.fileDirectory.PhotometricInterpretation)!==l.photometricInterpretations.RGB){e.next=9;break}if(b=[0,1,2],this.fileDirectory.ExtraSamples!==l.ExtraSamplesValues.Unspecified&&h)for(b=[],y=0;y<this.fileDirectory.BitsPerSample.length;y+=1)b.push(y);return e.abrupt("return",this.readRasters({window:r,interleave:!0,samples:b,pool:o,width:a,height:s}));case 9:e.t0=p,e.next=e.t0===l.photometricInterpretations.WhiteIsZero?12:e.t0===l.photometricInterpretations.BlackIsZero?12:e.t0===l.photometricInterpretations.Palette?12:e.t0===l.photometricInterpretations.CMYK?14:e.t0===l.photometricInterpretations.YCbCr?16:e.t0===l.photometricInterpretations.CIELab?16:18;break;case 12:return g=[0],e.abrupt("break",19);case 14:return g=[0,1,2,3],e.abrupt("break",19);case 16:return g=[0,1,2],e.abrupt("break",19);case 18:throw new Error("Invalid or unsupported photometric interpretation.");case 19:return m={window:d,interleave:!0,samples:g,pool:o,width:a,height:s,resampleMethod:u},v=this.fileDirectory,e.next=23,this.readRasters(m);case 23:w=e.sent,_=Math.pow(2,this.fileDirectory.BitsPerSample[0]),e.t1=p,e.next=e.t1===l.photometricInterpretations.WhiteIsZero?28:e.t1===l.photometricInterpretations.BlackIsZero?30:e.t1===l.photometricInterpretations.Palette?32:e.t1===l.photometricInterpretations.CMYK?34:e.t1===l.photometricInterpretations.YCbCr?36:e.t1===l.photometricInterpretations.CIELab?38:40;break;case 28:return k=(0,f.fromWhiteIsZero)(w,_),e.abrupt("break",41);case 30:return k=(0,f.fromBlackIsZero)(w,_),e.abrupt("break",41);case 32:return k=(0,f.fromPalette)(w,v.ColorMap),e.abrupt("break",41);case 34:return k=(0,f.fromCMYK)(w),e.abrupt("break",41);case 36:return k=(0,f.fromYCbCr)(w),e.abrupt("break",41);case 38:return k=(0,f.fromCIELab)(w),e.abrupt("break",41);case 40:throw new Error("Unsupported photometric interpretation.");case 41:return k.width=w.width,k.height=w.height,e.abrupt("return",k);case 44:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"getTiePoints",value:function(){if(!this.fileDirectory.ModelTiepoint)return[];for(var e=[],t=0;t<this.fileDirectory.ModelTiepoint.length;t+=6)e.push({i:this.fileDirectory.ModelTiepoint[t],j:this.fileDirectory.ModelTiepoint[t+1],k:this.fileDirectory.ModelTiepoint[t+2],x:this.fileDirectory.ModelTiepoint[t+3],y:this.fileDirectory.ModelTiepoint[t+4],z:this.fileDirectory.ModelTiepoint[t+5]});return e}},{key:"getGDALMetadata",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t={};if(!this.fileDirectory.GDAL_METADATA)return null;var r=this.fileDirectory.GDAL_METADATA,n=(0,u.default)(r.substring(0,r.length-1));if(!n[0].tagName)throw new Error("Failed to parse GDAL metadata XML.");var i=n[0];if("GDALMetadata"!==i.tagName)throw new Error("Unexpected GDAL metadata XML tag.");var o=i.children.filter(function(e){return"Item"===e.tagName});e&&(o=o.filter(function(t){return Number(t.attributes.sample)===e}));for(var a=0;a<o.length;++a){var s=o[a];t[s.attributes.name]=s.children[0]}return t}},{key:"getGDALNoData",value:function(){if(!this.fileDirectory.GDAL_NODATA)return null;var e=this.fileDirectory.GDAL_NODATA;return Number(e.substring(0,e.length-1))}},{key:"getOrigin",value:function(){var e=this.fileDirectory.ModelTiepoint,t=this.fileDirectory.ModelTransformation;if(e&&6===e.length)return[e[3],e[4],e[5]];if(t)return[t[3],t[7],t[11]];throw new Error("The image does not have an affine transformation.")}},{key:"getResolution",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.fileDirectory.ModelPixelScale,r=this.fileDirectory.ModelTransformation;if(t)return[t[0],-t[1],t[2]];if(r)return[r[0],r[5],r[10]];if(e){var i=e.getResolution(),o=(0,n.default)(i,3),a=o[0],s=o[1],u=o[2];return[a*e.getWidth()/this.getWidth(),s*e.getHeight()/this.getHeight(),u*e.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}},{key:"pixelIsArea",value:function(){return 1===this.geoKeys.GTRasterTypeGeoKey}},{key:"getBoundingBox",value:function(){var e=this.getOrigin(),t=this.getResolution(),r=e[0],n=e[1],i=r+t[0]*this.getWidth(),o=n+t[1]*this.getHeight();return[Math.min(r,i),Math.min(n,o),Math.max(r,i),Math.max(n,o)]}}]),e}();r.default=y},{"@babel/runtime/helpers/slicedToArray":"HETk","@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW",txml:"JO74","./globals":"j27V","./rgb":"fpBl","./compression":"FGCZ","./resample":"OQju"}],dqpX:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=o(e("@babel/runtime/helpers/classCallCheck")),i=o(e("@babel/runtime/helpers/createClass"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(){function e(t){(0,n.default)(this,e),this._dataView=new DataView(t)}return(0,i.default)(e,[{key:"getUint64",value:function(e,t){var r,n=this.getUint32(e,t),i=this.getUint32(e+4,t);if(t){if(r=n+Math.pow(2,32)*i,!Number.isSafeInteger(r))throw new Error("".concat(r," exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues"));return r}if(r=Math.pow(2,32)*n+i,!Number.isSafeInteger(r))throw new Error("".concat(r," exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues"));return r}},{key:"getInt64",value:function(e,t){for(var r=0,n=(128&this._dataView.getUint8(e+(t?7:0)))>0,i=!0,o=0;o<8;o++){var a=this._dataView.getUint8(e+(t?o:7-o));n&&(i?0!==a&&(a=255&~(a-1),i=!1):a=255&~a),r+=a*Math.pow(256,o)}return n&&(r=-r),r}},{key:"getUint8",value:function(e,t){return this._dataView.getUint8(e,t)}},{key:"getInt8",value:function(e,t){return this._dataView.getInt8(e,t)}},{key:"getUint16",value:function(e,t){return this._dataView.getUint16(e,t)}},{key:"getInt16",value:function(e,t){return this._dataView.getInt16(e,t)}},{key:"getUint32",value:function(e,t){return this._dataView.getUint32(e,t)}},{key:"getInt32",value:function(e,t){return this._dataView.getInt32(e,t)}},{key:"getFloat32",value:function(e,t){return this._dataView.getFloat32(e,t)}},{key:"getFloat64",value:function(e,t){return this._dataView.getFloat64(e,t)}},{key:"buffer",get:function(){return this._dataView.buffer}}]),e}();r.default=a},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW"}],dGLV:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=o(e("@babel/runtime/helpers/classCallCheck")),i=o(e("@babel/runtime/helpers/createClass"));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(){function e(t,r,i,o){(0,n.default)(this,e),this._dataView=new DataView(t),this._sliceOffset=r,this._littleEndian=i,this._bigTiff=o}return(0,i.default)(e,[{key:"covers",value:function(e,t){return this.sliceOffset<=e&&this.sliceTop>=e+t}},{key:"readUint8",value:function(e){return this._dataView.getUint8(e-this._sliceOffset,this._littleEndian)}},{key:"readInt8",value:function(e){return this._dataView.getInt8(e-this._sliceOffset,this._littleEndian)}},{key:"readUint16",value:function(e){return this._dataView.getUint16(e-this._sliceOffset,this._littleEndian)}},{key:"readInt16",value:function(e){return this._dataView.getInt16(e-this._sliceOffset,this._littleEndian)}},{key:"readUint32",value:function(e){return this._dataView.getUint32(e-this._sliceOffset,this._littleEndian)}},{key:"readInt32",value:function(e){return this._dataView.getInt32(e-this._sliceOffset,this._littleEndian)}},{key:"readFloat32",value:function(e){return this._dataView.getFloat32(e-this._sliceOffset,this._littleEndian)}},{key:"readFloat64",value:function(e){return this._dataView.getFloat64(e-this._sliceOffset,this._littleEndian)}},{key:"readUint64",value:function(e){var t,r=this.readUint32(e),n=this.readUint32(e+4);if(this._littleEndian){if(t=r+Math.pow(2,32)*n,!Number.isSafeInteger(t))throw new Error("".concat(t," exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues"));return t}if(t=Math.pow(2,32)*r+n,!Number.isSafeInteger(t))throw new Error("".concat(t," exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues"));return t}},{key:"readInt64",value:function(e){for(var t=0,r=(128&this._dataView.getUint8(e+(this._littleEndian?7:0)))>0,n=!0,i=0;i<8;i++){var o=this._dataView.getUint8(e+(this._littleEndian?i:7-i));r&&(n?0!==o&&(o=255&~(o-1),n=!1):o=255&~o),t+=o*Math.pow(256,i)}return r&&(t=-t),t}},{key:"readOffset",value:function(e){return this._bigTiff?this.readUint64(e):this.readUint32(e)}},{key:"sliceOffset",get:function(){return this._sliceOffset}},{key:"sliceTop",get:function(){return this._sliceOffset+this.buffer.byteLength}},{key:"littleEndian",get:function(){return this._littleEndian}},{key:"bigTiff",get:function(){return this._bigTiff}},{key:"buffer",get:function(){return this._dataView.buffer}}]),e}();r.default=a},{"@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW"}],z2GM:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.extendSerializer=function(e,t){const r=e.deserialize.bind(e),n=e.serialize.bind(e);return{deserialize:e=>t.deserialize(e,r),serialize:e=>t.serialize(e,n)}},r.DefaultSerializer=void 0;const n=e=>Object.assign(Error(e.message),{name:e.name,stack:e.stack}),i=e=>({__error_marker:"$$error",message:e.message,name:e.name,stack:e.stack}),o={deserialize:e=>(e=>e&&"object"==typeof e&&"__error_marker"in e&&"$$error"===e.__error_marker)(e)?n(e):e,serialize:e=>e instanceof Error?i(e):e};r.DefaultSerializer=o},{}],kdjL:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.registerSerializer=function(e){i=(0,n.extendSerializer)(i,e)},r.deserialize=function(e){return i.deserialize(e)},r.serialize=function(e){return i.serialize(e)};var n=e("./serializers");let i=n.DefaultSerializer},{"./serializers":"z2GM"}],LQHy:[function(e,t,r){"use strict";let n;function i(e){return(""+e).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)?\/[^/]+(?:\?.*)?$/,"$1")+"/"}Object.defineProperty(r,"__esModule",{value:!0}),r.getBaseURL=i,r.getBundleURL=function(){return n||(n=function(){try{throw new Error}catch(n){const t=(""+n.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g);if(t)return i(t[0])}return"/"}()),n}},{}],XK2w:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.selectWorkerImplementation=function(){return"undefined"==typeof Worker?class{constructor(){throw Error("No web worker implementation available. You might have tried to spawn a worker within a worker in a browser that doesn't support workers in workers.")}}:class extends Worker{constructor(e,t){"string"==typeof e&&t&&t._baseURL?e=new URL(e,t._baseURL):"string"==typeof e&&!o(e)&&(0,n.getBundleURL)().match(/^file:\/\//i)&&(e=new URL(e,(0,n.getBundleURL)().replace(/\/[^\/]+$/,"/")),e=a("importScripts(".concat(JSON.stringify(e),");"))),"string"==typeof e&&o(e)&&(e=a("importScripts(".concat(JSON.stringify(e),");"))),super(e,t)}}},r.defaultPoolSize=void 0;var n=e("./get-bundle-url.browser");const i="undefined"!=typeof navigator&&navigator.hardwareConcurrency?navigator.hardwareConcurrency:4;r.defaultPoolSize=i;const o=e=>/^(file|https?:)?\/\//i.test(e);function a(e){const t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}},{"./get-bundle-url.browser":"LQHy"}],IAgR:[function(e,t,r){var n=1e3,i=60*n,o=60*i,a=24*o,s=7*a,u=365.25*a;function l(e){if(!((e=String(e)).length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*u;case"weeks":case"week":case"w":return r*s;case"days":case"day":case"d":return r*a;case"hours":case"hour":case"hrs":case"hr":case"h":return r*o;case"minutes":case"minute":case"mins":case"min":case"m":return r*i;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function f(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+"d":t>=o?Math.round(e/o)+"h":t>=i?Math.round(e/i)+"m":t>=n?Math.round(e/n)+"s":e+"ms"}function c(e){var t=Math.abs(e);return t>=a?h(e,t,a,"day"):t>=o?h(e,t,o,"hour"):t>=i?h(e,t,i,"minute"):t>=n?h(e,t,n,"second"):e+" ms"}function h(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}t.exports=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return l(e);if("number"===r&&isFinite(e))return t.long?c(e):f(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],Kest:[function(e,t,r){t.exports=function(t){function r(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return n.colors[Math.abs(t)%n.colors.length]}function n(e){let t;function a(...e){if(!a.enabled)return;const r=a,i=Number(new Date),o=i-(t||i);r.diff=o,r.prev=t,r.curr=i,t=i,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(t,i)=>{if("%%"===t)return t;s++;const o=n.formatters[i];if("function"==typeof o){const n=e[s];t=o.call(r,n),e.splice(s,1),s--}return t}),n.formatArgs.call(r,e),(r.log||n.log).apply(r,e)}return a.namespace=e,a.enabled=n.enabled(e),a.useColors=n.useColors(),a.color=r(e),a.destroy=i,a.extend=o,"function"==typeof n.init&&n.init(a),n.instances.push(a),a}function i(){const e=n.instances.indexOf(this);return-1!==e&&(n.instances.splice(e,1),!0)}function o(e,t){const r=n(this.namespace+(void 0===t?":":t)+e);return r.log=this.log,r}function a(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){return e instanceof Error?e.stack||e.message:e},n.disable=function(){const e=[...n.names.map(a),...n.skips.map(a).map(e=>"-"+e)].join(",");return n.enable(""),e},n.enable=function(e){let t;n.save(e),n.names=[],n.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),i=r.length;for(t=0;t<i;t++)r[t]&&("-"===(e=r[t].replace(/\*/g,".*?"))[0]?n.skips.push(new RegExp("^"+e.substr(1)+"$")):n.names.push(new RegExp("^"+e+"$")));for(t=0;t<n.instances.length;t++){const e=n.instances[t];e.enabled=n.enabled(e.namespace)}},n.enabled=function(e){if("*"===e[e.length-1])return!0;let t,r;for(t=0,r=n.skips.length;t<r;t++)if(n.skips[t].test(e))return!1;for(t=0,r=n.names.length;t<r;t++)if(n.names[t].test(e))return!0;return!1},n.humanize=e("ms"),Object.keys(t).forEach(e=>{n[e]=t[e]}),n.instances=[],n.names=[],n.skips=[],n.formatters={},n.selectColor=r,n.enable(n.load()),n}},{ms:"IAgR"}],jcLW:[function(e,t,r){e("process");var n=e("process");r.log=function(...e){return"object"==typeof console&&console.log&&console.log(...e)},r.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;e.splice(1,0,r,"color: inherit");let n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))}),e.splice(i,0,r)},r.save=function(e){try{e?r.storage.setItem("debug",e):r.storage.removeItem("debug")}catch(t){}},r.load=function(){let e;try{e=r.storage.getItem("debug")}catch(t){}return!e&&void 0!==n&&"env"in n&&(e=void 0),e},r.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},r.storage=function(){try{return localStorage}catch(n){}}(),r.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.exports=e("./common")(r);const{formatters:i}=t.exports;i.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},{"./common":"Kest",process:"pBGv"}],sfrJ:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.AsyncSerialScheduler=void 0;var n=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(a,s)}u((n=n.apply(e,t||[])).next())})};r.AsyncSerialScheduler=class{constructor(e){this._baseObserver=e,this._pendingPromises=new Set}complete(){Promise.all(this._pendingPromises).then(()=>this._baseObserver.complete()).catch(e=>this._baseObserver.error(e))}error(e){this._baseObserver.error(e)}schedule(e){const t=Promise.all(this._pendingPromises),r=[],i=e=>r.push(e),o=Promise.resolve().then(()=>n(this,void 0,void 0,function*(){yield t,yield e(i),this._pendingPromises.delete(o);for(const e of r)this._baseObserver.next(e)})).catch(e=>{this._pendingPromises.delete(o),this._baseObserver.error(e)});this._pendingPromises.add(o)}}},{}],lj3f:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.registerObservableSymbol=function(){n()&&!i("observable")&&(Symbol.observable=Symbol("observable"))},r.getSymbol=r.hasSymbol=r.hasSymbols=void 0;const n=()=>"function"==typeof Symbol;r.hasSymbols=n;const i=e=>n()&&Boolean(Symbol[e]);r.hasSymbol=i;r.getSymbol=(e=>i(e)?Symbol[e]:"@@"+e),i("asyncIterator")||(Symbol.asyncIterator=Symbol.asyncIterator||Symbol.for("Symbol.asyncIterator"))},{}],B9l3:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=r.Observable=r.SubscriptionObserver=r.Subscription=void 0;var n=e("./_symbols");const i=(0,n.getSymbol)("iterator"),o=(0,n.getSymbol)("observable"),a=(0,n.getSymbol)("species");function s(e,t){const r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function u(e){let t=e.constructor;return void 0!==t&&null===(t=t[a])&&(t=void 0),void 0!==t?t:g}function l(e){l.log?l.log(e):setTimeout(()=>{throw e},0)}function f(e){Promise.resolve().then(()=>{try{e()}catch(i){l(i)}})}function c(e){const t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{const e=s(t,"unsubscribe");e&&e.call(t)}}catch(o){l(o)}}function h(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function d(e,t,r){e._state="running";const n=e._observer;try{const i=n?s(n,t):void 0;switch(t){case"next":i&&i.call(n,r);break;case"error":if(h(e),!i)throw r;i.call(n,r);break;case"complete":h(e),i&&i.call(n)}}catch(u){l(u)}"closed"===e._state?c(e):"running"===e._state&&(e._state="ready")}function p(e,t,r){if("closed"!==e._state)return"buffering"===e._state?(e._queue=e._queue||[],void e._queue.push({type:t,value:r})):"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void f(()=>(function(e){const t=e._queue;if(t){e._queue=void 0,e._state="ready";for(const r of t)if(d(e,r.type,r.value),"closed"===e._state)break}})(e))):void d(e,t,r)}class b{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";const r=new y(this);try{this._cleanup=t.call(void 0,r)}catch(a){r.error(a)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(h(this),c(this))}}r.Subscription=b;class y{constructor(e){this._subscription=e}get closed(){return"closed"===this._subscription._state}next(e){p(this._subscription,"next",e)}error(e){p(this._subscription,"error",e)}complete(){p(this._subscription,"complete")}}r.SubscriptionObserver=y;class g{constructor(e){if(!(this instanceof g))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof e)throw new TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e,t,r){return"object"==typeof e&&null!==e||(e={next:e,error:t,complete:r}),new b(e,this._subscriber)}pipe(e,...t){let r=this;for(const n of[e,...t])r=n(r);return r}tap(e,t,r){const n="object"!=typeof e||null===e?{next:e,error:t,complete:r}:e;return new g(e=>this.subscribe({next(t){n.next&&n.next(t),e.next(t)},error(t){n.error&&n.error(t),e.error(t)},complete(){n.complete&&n.complete(),e.complete()},start(e){n.start&&n.start(e)}}))}forEach(e){return new Promise((t,r)=>{if("function"!=typeof e)return void r(new TypeError(e+" is not a function"));function n(){i.unsubscribe(),t()}const i=this.subscribe({next(t){try{e(t,n)}catch(u){r(u),i.unsubscribe()}},error:r,complete:t})})}map(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(u(this))(t=>this.subscribe({next(r){let n=r;try{n=e(r)}catch(s){return t.error(s)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}}))}filter(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(u(this))(t=>this.subscribe({next(r){try{if(!e(r))return}catch(a){return t.error(a)}t.next(r)},error(e){t.error(e)},complete(){t.complete()}}))}reduce(e,t){if("function"!=typeof e)throw new TypeError(e+" is not a function");const r=u(this),n=arguments.length>1;let i=!1,o=t;return new r(t=>this.subscribe({next(r){const a=!i;if(i=!0,!a||n)try{o=e(o,r)}catch(l){return t.error(l)}else o=r},error(e){t.error(e)},complete(){if(!i&&!n)return t.error(new TypeError("Cannot reduce an empty sequence"));t.next(o),t.complete()}}))}concat(...e){const t=u(this);return new t(r=>{let n,i=0;return function o(a){n=a.subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){i===e.length?(n=void 0,r.complete()):o(t.from(e[i++]))}})}(this),()=>{n&&(n.unsubscribe(),n=void 0)}})}flatMap(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");const t=u(this);return new t(r=>{const n=[],i=this.subscribe({next(i){let a;if(e)try{a=e(i)}catch(f){return r.error(f)}else a=i;const s=t.from(a).subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){const e=n.indexOf(s);e>=0&&n.splice(e,1),o()}});n.push(s)},error(e){r.error(e)},complete(){o()}});function o(){i.closed&&0===n.length&&r.complete()}return()=>{n.forEach(e=>e.unsubscribe()),i.unsubscribe()}})}[o](){return this}static from(e){const t="function"==typeof this?this:g;if(null==e)throw new TypeError(e+" is not an object");const r=s(e,o);if(r){const n=r.call(e);if(Object(n)!==n)throw new TypeError(n+" is not an object");return function(e){return e instanceof g}(n)&&n.constructor===t?n:new t(e=>n.subscribe(e))}if((0,n.hasSymbol)("iterator")){const r=s(e,i);if(r)return new t(t=>{f(()=>{if(!t.closed){for(const n of r.call(e))if(t.next(n),t.closed)return;t.complete()}})})}if(Array.isArray(e))return new t(t=>{f(()=>{if(!t.closed){for(const r of e)if(t.next(r),t.closed)return;t.complete()}})});throw new TypeError(e+" is not observable")}static of(...e){return new("function"==typeof this?this:g)(t=>{f(()=>{if(!t.closed){for(const r of e)if(t.next(r),t.closed)return;t.complete()}})})}static get[a](){return this}}r.Observable=g,(0,n.hasSymbols)()&&Object.defineProperty(g,Symbol("extensions"),{value:{symbol:o,hostReportError:l},configurable:!0});var m=g;r.default=m},{"./_symbols":"lj3f"}],QC75:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=function(e){"function"==typeof e?e():e&&"function"==typeof e.unsubscribe&&e.unsubscribe()};r.default=n},{}],apmd:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=e("./_scheduler"),i=a(e("./observable")),o=a(e("./unsubscribe"));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(a,s)}u((n=n.apply(e,t||[])).next())})};var u=function(e){return t=>new i.default(r=>{const i=new n.AsyncSerialScheduler(r),a=t.subscribe({complete(){i.complete()},error(e){i.error(e)},next(t){i.schedule(r=>s(this,void 0,void 0,function*(){(yield e(t))&&r(t)}))}});return()=>(0,o.default)(a)})};r.default=u},{"./_scheduler":"sfrJ","./observable":"B9l3","./unsubscribe":"QC75"}],FgiE:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isAsyncIterator=function(e){return e&&(0,n.hasSymbol)("asyncIterator")&&e[Symbol.asyncIterator]},r.isIterator=function(e){return e&&(0,n.hasSymbol)("iterator")&&e[Symbol.iterator]};var n=e("./_symbols")},{"./_symbols":"lj3f"}],ltny:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=e("./_scheduler"),i=e("./_util"),o=s(e("./observable")),a=s(e("./unsubscribe"));function s(e){return e&&e.__esModule?e:{default:e}}var u=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(a,s)}u((n=n.apply(e,t||[])).next())})},l=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,i){!function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}(n,i,(t=e[r](t)).done,t.value)})}}};var f=function(e){return t=>new o.default(r=>{const o=new n.AsyncSerialScheduler(r),s=t.subscribe({complete(){o.complete()},error(e){o.error(e)},next(t){o.schedule(r=>u(this,void 0,void 0,function*(){var n,o;const a=yield e(t);if((0,i.isIterator)(a)||(0,i.isAsyncIterator)(a))try{for(var s,u=l(a);!(s=yield u.next()).done;){const e=s.value;r(e)}}catch(f){n={error:f}}finally{try{s&&!s.done&&(o=u.return)&&(yield o.call(u))}finally{if(n)throw n.error}}else a.map(e=>r(e))}))}});return()=>(0,a.default)(s)})};r.default=f},{"./_scheduler":"sfrJ","./_util":"FgiE","./observable":"B9l3","./unsubscribe":"QC75"}],jAhG:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){return new n.Observable(t=>{let r=0;const n=setInterval(()=>{t.next(r++)},e);return()=>clearInterval(n)})};var n=e("./observable")},{"./observable":"B9l3"}],aP59:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=e("./_scheduler"),i=a(e("./observable")),o=a(e("./unsubscribe"));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(a,s)}u((n=n.apply(e,t||[])).next())})};var u=function(e){return t=>new i.default(r=>{const i=new n.AsyncSerialScheduler(r),a=t.subscribe({complete(){i.complete()},error(e){i.error(e)},next(t){i.schedule(r=>s(this,void 0,void 0,function*(){const n=yield e(t);r(n)}))}});return()=>(0,o.default)(a)})};r.default=u},{"./_scheduler":"sfrJ","./observable":"B9l3","./unsubscribe":"QC75"}],Rg1v:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=e("./observable"),i=function(e){return e&&e.__esModule?e:{default:e}}(e("./unsubscribe"));var o=function(...e){return 0===e.length?n.Observable.from([]):new n.Observable(t=>{let r=0;const n=e.map(n=>n.subscribe({error(e){t.error(e),o()},next(e){t.next(e)},complete(){++r===e.length&&(t.complete(),o())}})),o=()=>{n.forEach(e=>(0,i.default)(e))};return o})};r.default=o},{"./observable":"B9l3","./unsubscribe":"QC75"}],wtHd:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(e("./observable"));var i=class extends n.default{constructor(){super(e=>(this._observers.add(e),()=>this._observers.delete(e))),this._observers=new Set}next(e){for(const t of this._observers)t.next(e)}error(e){for(const t of this._observers)t.error(e)}complete(){for(const e of this._observers)e.complete()}};r.default=i},{"./observable":"B9l3"}],NgdC:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=a(e("./observable")),i=a(e("./subject")),o=a(e("./unsubscribe"));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e){const t=new i.default;let r,a=0;return new n.default(n=>{r||(r=e.subscribe(t));const i=t.subscribe(n);return a++,()=>{a--,i.unsubscribe(),0===a&&((0,o.default)(r),r=void 0)}})};r.default=s},{"./observable":"B9l3","./subject":"wtHd","./unsubscribe":"QC75"}],b7o0:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=e("./_scheduler"),i=a(e("./observable")),o=a(e("./unsubscribe"));function a(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){e.done?i(e.value):new r(function(t){t(e.value)}).then(a,s)}u((n=n.apply(e,t||[])).next())})};var u=function(e,t){return r=>new i.default(i=>{let a,u=0;const l=new n.AsyncSerialScheduler(i),f=r.subscribe({complete(){l.complete()},error(e){l.error(e)},next(r){l.schedule(n=>s(this,void 0,void 0,function*(){const i=0===u?void 0===t?r:t:a;a=yield e(i,r,u++),n(a)}))}});return()=>(0,o.default)(f)})};r.default=u},{"./_scheduler":"sfrJ","./observable":"B9l3","./unsubscribe":"QC75"}],cyO3:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"filter",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(r,"flatMap",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(r,"interval",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(r,"map",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(r,"merge",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(r,"multicast",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(r,"Observable",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(r,"scan",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(r,"Subject",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(r,"unsubscribe",{enumerable:!0,get:function(){return h.default}});var n=d(e("./filter")),i=d(e("./flatMap")),o=d(e("./interval")),a=d(e("./map")),s=d(e("./merge")),u=d(e("./multicast")),l=d(e("./observable")),f=d(e("./scan")),c=d(e("./subject")),h=d(e("./unsubscribe"));function d(e){return e&&e.__esModule?e:{default:e}}},{"./filter":"apmd","./flatMap":"ltny","./interval":"jAhG","./map":"aP59","./merge":"Rg1v","./multicast":"NgdC","./observable":"B9l3","./scan":"b7o0","./subject":"wtHd","./unsubscribe":"QC75"}],vpgy:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.allSettled=function(e){return Promise.all(e.map(e=>{const t=e=>({status:"fulfilled",value:e}),r=e=>({status:"rejected",reason:e}),n=Promise.resolve(e);try{return n.then(t,r)}catch(i){return Promise.reject(i)}}))}},{}],UYCO:[function(e,t,r){"use strict";var n;Object.defineProperty(r,"__esModule",{value:!0}),r.PoolEventType=void 0,r.PoolEventType=n,function(e){e.initialized="initialized",e.taskCanceled="taskCanceled",e.taskCompleted="taskCompleted",e.taskFailed="taskFailed",e.taskQueued="taskQueued",e.taskQueueDrained="taskQueueDrained",e.taskStart="taskStart",e.terminated="terminated"}(n||(r.PoolEventType=n={}))},{}],fmdM:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.$worker=r.$transferable=r.$terminate=r.$events=r.$errors=void 0;const n=Symbol("thread.errors");r.$errors=n;const i=Symbol("thread.events");r.$events=i;const o=Symbol("thread.terminate");r.$terminate=o;const a=Symbol("thread.transferable");r.$transferable=a;const s=Symbol("thread.worker");r.$worker=s},{}],LBuu:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.Thread=void 0;var n=e("../symbols");function i(e){throw Error(e)}const o={errors:e=>e[n.$errors]||i("Error observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),events:e=>e[n.$events]||i("Events observable not found. Make sure to pass a thread instance as returned by the spawn() promise."),terminate:e=>e[n.$terminate]()};r.Thread=o},{"../symbols":"fmdM"}],EB3M:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PoolEventType",{enumerable:!0,get:function(){return s.PoolEventType}}),Object.defineProperty(r,"Thread",{enumerable:!0,get:function(){return u.Thread}}),r.Pool=void 0;var n=function(e){return e&&e.__esModule?e:{default:e}}(e("debug")),i=e("observable-fns"),o=e("../ponyfills"),a=e("./implementation"),s=e("./pool-types"),u=e("./thread");var l=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}u((n=n.apply(e,t||[])).next())})};let f=1;class c{constructor(e,t){this.eventSubject=new i.Subject,this.initErrors=[],this.isClosing=!1,this.nextTaskID=1,this.taskQueue=[];const r="number"==typeof t?{size:t}:t||{},{size:o=a.defaultPoolSize}=r;this.debug=(0,n.default)("threads:pool:".concat(function(e){return e.replace(/\W/g," ").trim().replace(/\s+/g,"-")}(r.name||String(f++)))),this.options=r,this.workers=function(e,t){return function(e){const t=[];for(let r=0;r<e;r++)t.push(r);return t}(t).map(()=>({init:e(),runningTasks:[]}))}(e,o),this.eventObservable=(0,i.multicast)(i.Observable.from(this.eventSubject)),Promise.all(this.workers.map(e=>e.init)).then(()=>this.eventSubject.next({type:s.PoolEventType.initialized,size:this.workers.length}),e=>{this.debug("Error while initializing pool worker:",e),this.eventSubject.error(e),this.initErrors.push(e)})}findIdlingWorker(){const{concurrency:e=1}=this.options;return this.workers.find(t=>t.runningTasks.length<e)}runPoolTask(e,t){return l(this,void 0,void 0,function*(){const r=this.workers.indexOf(e)+1;this.debug("Running task #".concat(t.id," on worker #").concat(r,"...")),this.eventSubject.next({type:s.PoolEventType.taskStart,taskID:t.id,workerID:r});try{const n=yield t.run(yield e.init);this.debug("Task #".concat(t.id," completed successfully")),this.eventSubject.next({type:s.PoolEventType.taskCompleted,returnValue:n,taskID:t.id,workerID:r})}catch(a){this.debug("Task #".concat(t.id," failed")),this.eventSubject.next({type:s.PoolEventType.taskFailed,taskID:t.id,error:a,workerID:r})}})}run(e,t){return l(this,void 0,void 0,function*(){const r=(()=>l(this,void 0,void 0,function*(){yield function(e){return new Promise(t=>setTimeout(t,e))}(0);try{yield this.runPoolTask(e,t)}finally{e.runningTasks=e.runningTasks.filter(e=>e!==r),this.isClosing||this.scheduleWork()}}))();e.runningTasks.push(r)})}scheduleWork(){this.debug("Attempt de-queueing a task in order to run it...");const e=this.findIdlingWorker();if(!e)return;const t=this.taskQueue.shift();if(!t)return this.debug("Task queue is empty"),void this.eventSubject.next({type:s.PoolEventType.taskQueueDrained});this.run(e,t)}taskCompletion(e){return new Promise((t,r)=>{const n=this.events().subscribe(i=>{i.type===s.PoolEventType.taskCompleted&&i.taskID===e?(n.unsubscribe(),t(i.returnValue)):i.type===s.PoolEventType.taskFailed&&i.taskID===e?(n.unsubscribe(),r(i.error)):i.type===s.PoolEventType.terminated&&(n.unsubscribe(),r(Error("Pool has been terminated before task was run.")))})})}settled(e=!1){return l(this,void 0,void 0,function*(){const t=()=>(function(e,t){return e.reduce((e,r)=>[...e,...t(r)],[])})(this.workers,e=>e.runningTasks),r=[],n=this.eventObservable.subscribe(e=>{e.type===s.PoolEventType.taskFailed&&r.push(e.error)});return this.initErrors.length>0?Promise.reject(this.initErrors[0]):e&&0===this.taskQueue.length?(yield(0,o.allSettled)(t()),r):(yield new Promise((e,t)=>{const r=this.eventObservable.subscribe({next(t){t.type===s.PoolEventType.taskQueueDrained&&(r.unsubscribe(),e())},error:t})}),yield(0,o.allSettled)(t()),n.unsubscribe(),r)})}completed(e=!1){return l(this,void 0,void 0,function*(){const t=this.settled(e),r=new Promise((e,r)=>{const n=this.eventObservable.subscribe({next(i){i.type===s.PoolEventType.taskQueueDrained?(n.unsubscribe(),e(t)):i.type===s.PoolEventType.taskFailed&&(n.unsubscribe(),r(i.error))},error:r})}),n=yield Promise.race([t,r]);if(n.length>0)throw n[0]})}events(){return this.eventObservable}queue(e){const{maxQueuedJobs:t=1/0}=this.options;if(this.isClosing)throw Error("Cannot schedule pool tasks after terminate() has been called.");if(this.initErrors.length>0)throw this.initErrors[0];const r=()=>this.taskCompletion(i.id);let n;const i={id:this.nextTaskID++,run:e,cancel:()=>{-1!==this.taskQueue.indexOf(i)&&(this.taskQueue=this.taskQueue.filter(e=>e!==i),this.eventSubject.next({type:s.PoolEventType.taskCanceled,taskID:i.id}))},get then(){if(!n){const e=r();n=e.then.bind(e)}return n}};if(this.taskQueue.length>=t)throw Error("Maximum number of pool tasks queued. Refusing to queue another one.\nThis usually happens for one of two reasons: We are either at peak workload right now or some tasks just won't finish, thus blocking the pool.");return this.debug("Queueing task #".concat(i.id,"...")),this.taskQueue.push(i),this.eventSubject.next({type:s.PoolEventType.taskQueued,taskID:i.id}),this.scheduleWork(),i}terminate(e){return l(this,void 0,void 0,function*(){this.isClosing=!0,e||(yield this.completed(!0)),this.eventSubject.next({type:s.PoolEventType.terminated,remainingQueue:[...this.taskQueue]}),this.eventSubject.complete(),yield Promise.all(this.workers.map(e=>l(this,void 0,void 0,function*(){return u.Thread.terminate(yield e.init)})))})}}function h(e,t){return new c(e,t)}c.EventType=s.PoolEventType,h.EventType=s.PoolEventType;const d=h;r.Pool=d},{debug:"jcLW","observable-fns":"cyO3","../ponyfills":"vpgy","./implementation":"XK2w","./pool-types":"UYCO","./thread":"LBuu"}],PRGP:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.createPromiseWithResolver=function(){let e,t=!1,r=n;return[new Promise(n=>{t?n(e):r=n}),n=>{t=!0,e=n,r()}]};const n=()=>void 0},{}],ZLGT:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.WorkerEventType=void 0;var n;e("../symbols");r.WorkerEventType=n,function(e){e.internalError="internalError",e.message="message",e.termination="termination"}(n||(r.WorkerEventType=n={}))},{"../symbols":"fmdM"}],zXl4:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ObservablePromise=void 0;var n=e("observable-fns");const i=()=>void 0,o=e=>e,a=e=>Promise.resolve().then(e);function s(e){throw e}class u extends n.Observable{constructor(e){super(t=>{const r=this,n=Object.assign(Object.assign({},t),{complete(){t.complete(),r.onCompletion()},error(e){t.error(e),r.onError(e)},next(e){t.next(e),r.onNext(e)}});try{return this.initHasRun=!0,e(n)}catch(s){n.error(s)}}),this.initHasRun=!1,this.fulfillmentCallbacks=[],this.rejectionCallbacks=[],this.firstValueSet=!1,this.state="pending"}onNext(e){this.firstValueSet||(this.firstValue=e,this.firstValueSet=!0)}onError(e){this.state="rejected",this.rejection=e;for(const t of this.rejectionCallbacks)a(()=>t(e))}onCompletion(){this.state="fulfilled";for(const e of this.fulfillmentCallbacks)a(()=>e(this.firstValue))}then(e,t){const r=e||o,n=t||s;let i=!1;return new Promise((e,t)=>{const o=o=>{if(!i){i=!0;try{e(n(o))}catch(r){t(r)}}};return this.initHasRun||this.subscribe({error:o}),"fulfilled"===this.state?e(r(this.firstValue)):"rejected"===this.state?(i=!0,e(n(this.rejection))):(this.fulfillmentCallbacks.push(t=>{try{e(r(t))}catch(s){o(s)}}),void this.rejectionCallbacks.push(o))})}catch(e){return this.then(void 0,e)}finally(e){const t=e||i;return this.then(e=>(t(),e),()=>t())}static from(e){return function(e){return e&&"function"==typeof e.then}(e)?new u(t=>{e.then(e=>{t.next(e),t.complete()},e=>{t.error(e)})}):super.from(e)}}r.ObservablePromise=u},{"observable-fns":"cyO3"}],qW1u:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isTransferDescriptor=function(e){return e&&"object"==typeof e&&e[n.$transferable]},r.Transfer=function(e,t){if(!t){if(!function(e){return!(!e||"object"!=typeof e)}(e))throw Error();t=[e]}return{[n.$transferable]:!0,send:e,transferables:t}};var n=e("./symbols")},{"./symbols":"fmdM"}],fUdt:[function(e,t,r){"use strict";var n,i;Object.defineProperty(r,"__esModule",{value:!0}),r.WorkerMessageType=r.MasterMessageType=void 0,r.MasterMessageType=n,function(e){e.run="run"}(n||(r.MasterMessageType=n={})),r.WorkerMessageType=i,function(e){e.error="error",e.init="init",e.result="result",e.running="running",e.uncaughtError="uncaughtError"}(i||(r.WorkerMessageType=i={}))},{}],iMbm:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.createProxyFunction=g,r.createProxyModule=function(e,t){const r={};for(const n of t)r[n]=g(e,n);return r};var n=function(e){return e&&e.__esModule?e:{default:e}}(e("debug")),i=e("observable-fns"),o=e("../common"),a=e("../observable-promise"),s=e("../transferable"),u=e("../types/messages");const l=(0,n.default)("threads:master:messages");let f=1;const c=e=>Array.from(new Set(e)),h=e=>e&&e.type===u.WorkerMessageType.error,d=e=>e&&e.type===u.WorkerMessageType.result,p=e=>e&&e.type===u.WorkerMessageType.running;function b(e,t){return new i.Observable(r=>{let n;const i=a=>{if(l("Message from worker:",a.data),a.data&&a.data.uid===t)if(p(a.data))n=a.data.resultType;else if(d(a.data))"promise"===n?(void 0!==a.data.payload&&r.next((0,o.deserialize)(a.data.payload)),r.complete(),e.removeEventListener("message",i)):(a.data.payload&&r.next((0,o.deserialize)(a.data.payload)),a.data.complete&&(r.complete(),e.removeEventListener("message",i)));else if(h(a.data)){const t=(0,o.deserialize)(a.data.error);r.error(t),e.removeEventListener("message",i)}};return e.addEventListener("message",i),()=>e.removeEventListener("message",i)})}function y(e){if(0===e.length)return{args:[],transferables:[]};const t=[],r=[];for(const n of e)(0,s.isTransferDescriptor)(n)?(t.push((0,o.serialize)(n.send)),r.push(...n.transferables)):t.push((0,o.serialize)(n));return{args:t,transferables:0===r.length?r:c(r)}}function g(e,t){return(...r)=>{const n=f++,{args:o,transferables:s}=y(r),c={type:u.MasterMessageType.run,uid:n,method:t,args:o};l("Sending command to run function to worker:",c);try{e.postMessage(c,s)}catch(p){return a.ObservablePromise.from(Promise.reject(p))}return a.ObservablePromise.from((0,i.multicast)(b(e,n)))}}},{debug:"jcLW","observable-fns":"cyO3","../common":"kdjL","../observable-promise":"zXl4","../transferable":"qW1u","../types/messages":"fUdt"}],a83E:[function(e,t,r){e("process"),e("process");Object.defineProperty(r,"__esModule",{value:!0}),r.spawn=function(e,t){return f(this,void 0,void 0,function*(){h("Initializing new thread");const r=(yield function(e,t,r){return f(this,void 0,void 0,function*(){let n;const i=new Promise((e,i)=>{n=setTimeout(()=>i(Error(r)),t)}),o=yield Promise.race([e,i]);return clearTimeout(n),o})}(g(e),t&&t.timeout?t.timeout:y,"Timeout: Did not receive an init message from worker after ".concat(y,"ms. Make sure the worker calls expose()."))).exposed,{termination:n,terminate:i}=v(e),o=m(e,n);if("function"===r.type)return w((0,l.createProxyFunction)(e),e,o,i);if("module"===r.type)return w((0,l.createProxyModule)(e,r.methods),e,o,i);{const e=r.type;throw Error("Worker init message states unexpected type of expose(): ".concat(e))}})};var n=function(e){return e&&e.__esModule?e:{default:e}}(e("debug")),i=e("observable-fns"),o=e("../common"),a=e("../promise"),s=e("../symbols"),u=e("../types/master"),l=e("./invocation-proxy");var f=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}u((n=n.apply(e,t||[])).next())})};const c=(0,n.default)("threads:master:messages"),h=(0,n.default)("threads:master:spawn"),d=(0,n.default)("threads:master:thread-utils"),p=e=>e&&"init"===e.type,b=e=>e&&"uncaughtError"===e.type,y=1e4;function g(e){return new Promise((t,r)=>{const n=i=>{c("Message from worker before finishing initialization:",i.data),p(i.data)?(e.removeEventListener("message",n),t(i.data)):b(i.data)&&(e.removeEventListener("message",n),r((0,o.deserialize)(i.data.error)))};e.addEventListener("message",n)})}function m(e,t){return new i.Observable(r=>{const n=e=>{const t={type:u.WorkerEventType.message,data:e.data};r.next(t)},i=e=>{d("Unhandled promise rejection event in thread:",e);const t={type:u.WorkerEventType.internalError,error:Error(e.reason)};r.next(t)};e.addEventListener("message",n),e.addEventListener("unhandledrejection",i),t.then(()=>{const t={type:u.WorkerEventType.termination};e.removeEventListener("message",n),e.removeEventListener("unhandledrejection",i),r.next(t),r.complete()})})}function v(e){const[t,r]=(0,a.createPromiseWithResolver)();return{terminate:()=>f(this,void 0,void 0,function*(){d("Terminating worker"),yield e.terminate(),r()}),termination:t}}function w(e,t,r,n){const i=r.filter(e=>e.type===u.WorkerEventType.internalError).map(e=>e.error);return Object.assign(e,{[s.$errors]:i,[s.$events]:r,[s.$terminate]:n,[s.$worker]:t})}},{debug:"jcLW","observable-fns":"cyO3","../common":"kdjL","../promise":"PRGP","../symbols":"fmdM","../types/master":"ZLGT","./invocation-proxy":"iMbm",process:"pBGv"}],HfK0:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"Pool",{enumerable:!0,get:function(){return i.Pool}}),Object.defineProperty(r,"spawn",{enumerable:!0,get:function(){return o.spawn}}),Object.defineProperty(r,"Thread",{enumerable:!0,get:function(){return a.Thread}}),r.Worker=void 0;var n=e("./implementation"),i=e("./pool"),o=e("./spawn"),a=e("./thread");const s=(0,n.selectWorkerImplementation)();r.Worker=s},{"./implementation":"XK2w","./pool":"EB3M","./spawn":"a83E","./thread":"LBuu"}],JZ8d:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(e){var t,r=e.Symbol;return"function"==typeof r?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}},{}],LkZ7:[function(e,t,r){arguments[3];var n=arguments[3];Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i,o=function(e){return e&&e.__esModule?e:{default:e}}(e("./ponyfill.js"));i="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n?n:void 0!==t?t:Function("return this")();var a=(0,o.default)(i);r.default=a},{"./ponyfill.js":"JZ8d"}],UALh:[function(e,t,r){"use strict";const n=e("symbol-observable").default;t.exports=(e=>Boolean(e&&e[n]&&e===e[n]()))},{"symbol-observable":"LkZ7"}],AZa4:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n={isWorkerRuntime:function(){return!("undefined"==typeof self||!self.postMessage)},postMessageToMaster:function(e,t){self.postMessage(e,t)},subscribeToMasterMessages:function(e){const t=t=>{e(t.data)};return self.addEventListener("message",t),()=>{self.removeEventListener("message",t)}}};r.default=n},{}],l5pR:[function(e,t,r){e("process");var n=e("process");Object.defineProperty(r,"__esModule",{value:!0}),r.expose=function(e){if(!u.default.isWorkerRuntime())throw Error("expose() called in the master thread.");if(c)throw Error("expose() called more than once. This is not possible. Pass an object to expose() if you want to expose multiple functions.");if(c=!0,"function"==typeof e)u.default.subscribeToMasterMessages(t=>{h(t)&&!t.method&&v(t.uid,e,t.args.map(o.deserialize))}),function(){const e={type:s.WorkerMessageType.init,exposed:{type:"function"}};u.default.postMessageToMaster(e)}();else{if("object"!=typeof e||!e)throw Error("Invalid argument passed to expose(). Expected a function or an object, got: ".concat(e));u.default.subscribeToMasterMessages(t=>{h(t)&&t.method&&v(t.uid,e[t.method],t.args.map(o.deserialize))}),function(e){const t={type:s.WorkerMessageType.init,exposed:{type:"module",methods:e}};u.default.postMessageToMaster(t)}(Object.keys(e).filter(t=>"function"==typeof e[t]))}},Object.defineProperty(r,"registerSerializer",{enumerable:!0,get:function(){return o.registerSerializer}}),Object.defineProperty(r,"Transfer",{enumerable:!0,get:function(){return a.Transfer}});var i=l(e("is-observable")),o=e("../common"),a=e("../transferable"),s=e("../types/messages"),u=l(e("./implementation"));function l(e){return e&&e.__esModule?e:{default:e}}var f=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,s)}u((n=n.apply(e,t||[])).next())})};let c=!1;const h=e=>e&&e.type===s.MasterMessageType.run,d=e=>(0,i.default)(e)||function(e){return e&&"object"==typeof e&&"function"==typeof e.subscribe}(e);function p(e){return(0,a.isTransferDescriptor)(e)?{payload:e.send,transferables:e.transferables}:{payload:e,transferables:void 0}}function b(e,t){const{payload:r,transferables:n}=p(t),i={type:s.WorkerMessageType.error,uid:e,error:(0,o.serialize)(r)};u.default.postMessageToMaster(i,n)}function y(e,t,r){const{payload:n,transferables:i}=p(r),o={type:s.WorkerMessageType.result,uid:e,complete:!!t||void 0,payload:n};u.default.postMessageToMaster(o,i)}function g(e,t){const r={type:s.WorkerMessageType.running,uid:e,resultType:t};u.default.postMessageToMaster(r)}function m(e){try{const t={type:s.WorkerMessageType.uncaughtError,error:(0,o.serialize)(e)};u.default.postMessageToMaster(t)}catch(i){console.error("Not reporting uncaught error back to master thread as it occured while reporting an uncaught error already. Latest error:",i)}}function v(e,t,r){return f(this,void 0,void 0,function*(){let n;try{n=t(...r)}catch(l){return b(e,l)}const i=d(n)?"observable":"promise";if(g(e,i),d(n))n.subscribe(t=>y(e,!1,(0,o.serialize)(t)),t=>b(e,(0,o.serialize)(t)),()=>y(e,!0));else try{const t=yield n;y(e,!0,(0,o.serialize)(t))}catch(l){b(e,(0,o.serialize)(l))}})}"undefined"!=typeof self&&"function"==typeof self.addEventListener&&u.default.isWorkerRuntime()&&(self.addEventListener("error",e=>{setTimeout(()=>m(e.error||e),250)}),self.addEventListener("unhandledrejection",e=>{const t=e.reason;t&&"string"==typeof t.message&&setTimeout(()=>m(t),250)})),void 0!==n&&"function"==typeof n.on&&u.default.isWorkerRuntime()&&(n.on("uncaughtException",e=>{setTimeout(()=>m(e),250)}),n.on("unhandledRejection",e=>{e&&"string"==typeof e.message&&setTimeout(()=>m(e),250)}))},{"is-observable":"UALh","../common":"kdjL","../transferable":"qW1u","../types/messages":"fUdt","./implementation":"AZa4",process:"pBGv"}],CqwR:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={registerSerializer:!0,expose:!0,DefaultSerializer:!0,Transfer:!0};Object.defineProperty(r,"registerSerializer",{enumerable:!0,get:function(){return i.registerSerializer}}),Object.defineProperty(r,"expose",{enumerable:!0,get:function(){return a.expose}}),Object.defineProperty(r,"DefaultSerializer",{enumerable:!0,get:function(){return s.DefaultSerializer}}),Object.defineProperty(r,"Transfer",{enumerable:!0,get:function(){return u.Transfer}});var i=e("./common"),o=e("./master/index");Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&(Object.prototype.hasOwnProperty.call(n,e)||Object.defineProperty(r,e,{enumerable:!0,get:function(){return o[e]}}))});var a=e("./worker/index"),s=e("./serializers"),u=e("./transferable")},{"./common":"kdjL","./master/index":"HfK0","./worker/index":"l5pR","./serializers":"z2GM","./transferable":"qW1u"}],dHPO:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=u(e("@babel/runtime/regenerator")),i=u(e("@babel/runtime/helpers/asyncToGenerator")),o=u(e("@babel/runtime/helpers/classCallCheck")),a=u(e("@babel/runtime/helpers/createClass")),s=e("threads");function u(e){return e&&e.__esModule?e:{default:e}}var l="undefined"!=typeof navigator?navigator.hardwareConcurrency:null,f=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l;(0,o.default)(this,e);var r=new s.Worker("/decoder.worker.e63f7811.js");this.pool=(0,s.Pool)(function(){return(0,s.spawn)(r)},t)}return(0,a.default)(e,[{key:"decode",value:function(){var e=(0,i.default)(n.default.mark(function e(t,r){var o=this;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e,a){o.pool.queue(function(){var o=(0,i.default)(n.default.mark(function i(o){var s;return n.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,o(t,r);case 3:s=n.sent,e(s),n.next=10;break;case 7:n.prev=7,n.t0=n.catch(0),a(n.t0);case 10:case"end":return n.stop()}},i,null,[[0,7]])}));return function(e){return o.apply(this,arguments)}}())}));case 1:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"destroy",value:function(){this.pool.terminate(!0)}}]),e}();r.default=f},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW",threads:"CqwR","./decoder.worker.js":[["decoder.worker.e63f7811.js","LHx9"],"decoder.worker.e63f7811.js.map","LHx9"]}],p5a1:[function(e,t,r){arguments[3];var n,i=arguments[3];r.fetch=l(i.fetch)&&l(i.ReadableStream),r.writableStream=l(i.WritableStream),r.abortController=l(i.AbortController),r.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),r.blobConstructor=!0}catch(f){}function o(){if(void 0!==n)return n;if(i.XMLHttpRequest){n=new i.XMLHttpRequest;try{n.open("GET",i.XDomainRequest?"/":"https://example.com")}catch(f){n=null}}else n=null;return n}function a(e){var t=o();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(f){}return!1}var s=void 0!==i.ArrayBuffer,u=s&&l(i.ArrayBuffer.prototype.slice);function l(e){return"function"==typeof e}r.arraybuffer=r.fetch||s&&a("arraybuffer"),r.msstream=!r.fetch&&u&&a("ms-stream"),r.mozchunkedarraybuffer=!r.fetch&&s&&a("moz-chunked-arraybuffer"),r.overrideMimeType=r.fetch||!!o()&&l(o().overrideMimeType),r.vbArray=l(i.VBArray),n=null},{}],Yj0v:[function(e,t,r){e("process");var n=e("process");void 0===n||!n.version||0===n.version.indexOf("v0.")||0===n.version.indexOf("v1.")&&0!==n.version.indexOf("v1.8.")?t.exports={nextTick:function(e,t,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return n.nextTick(e);case 2:return n.nextTick(function(){e.call(null,t)});case 3:return n.nextTick(function(){e.call(null,t,r)});case 4:return n.nextTick(function(){e.call(null,t,r,i)});default:for(o=new Array(s-1),a=0;a<o.length;)o[a++]=arguments[a];return n.nextTick(function(){e.apply(null,o)})}}}:t.exports=n},{process:"pBGv"}],Nqn4:[function(e,t,r){var n=e("buffer"),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?t.exports=n:(o(n,r),r.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)}},{buffer:"dskh"}],Q14w:[function(e,t,r){e("buffer").Buffer;var n=e("buffer").Buffer;function i(e){return Object.prototype.toString.call(e)}r.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===i(e)},r.isBoolean=function(e){return"boolean"==typeof e},r.isNull=function(e){return null===e},r.isNullOrUndefined=function(e){return null==e},r.isNumber=function(e){return"number"==typeof e},r.isString=function(e){return"string"==typeof e},r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=function(e){return void 0===e},r.isRegExp=function(e){return"[object RegExp]"===i(e)},r.isObject=function(e){return"object"==typeof e&&null!==e},r.isDate=function(e){return"[object Date]"===i(e)},r.isError=function(e){return"[object Error]"===i(e)||e instanceof Error},r.isFunction=function(e){return"function"==typeof e},r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=n.isBuffer},{buffer:"dskh"}],CQMM:[function(e,t,r){"use strict";var n=e("safe-buffer").Buffer,i=e("util");function o(e,t,r){e.copy(t,r)}t.exports=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t=n.allocUnsafe(e>>>0),r=this.head,i=0;r;)o(r.data,t,i),i+=r.data.length,r=r.next;return t},e}(),i&&i.inspect&&i.inspect.custom&&(t.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},{"safe-buffer":"Nqn4",util:"rDCW"}],lCUh:[function(e,t,r){"use strict";var n=e("process-nextick-args");function i(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var r=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(n.nextTick(i,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":"Yj0v"}],jPmE:[function(e,t,r){e("process"),arguments[3],e("process");var n=arguments[3],i=e("process-nextick-args");function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}t.exports=g;var a,s=i.nextTick;g.WritableState=y;var u=Object.create(e("core-util-is"));u.inherits=e("inherits");var l={deprecate:e("util-deprecate")},f=e("./internal/streams/stream"),c=e("safe-buffer").Buffer,h=n.Uint8Array||function(){};var d,p=e("./internal/streams/destroy");function b(){}function y(t,r){a=a||e("./_stream_duplex"),t=t||{};var n=r instanceof a;this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,s=t.writableHighWaterMark,u=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(s||0===s)?s:u,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 l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){S(r,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 o(this)}function g(t){if(a=a||e("./_stream_duplex"),!(d.call(g,this)||this instanceof a))return new g(t);this._writableState=new y(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),f.call(this)}function m(e,t){var r=new Error("write after end");e.emit("error",r),i.nextTick(t,r)}function v(e,t,r,n){var o=!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),i.nextTick(n,a),o=!1),o}function w(e,t,r,n,i,o){if(!r){var a=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,r)),t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else _(e,t,!1,s,n,i,o);return u}function _(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 k(e,t,r,n,o){--t.pendingcb,r?(i.nextTick(o,n),i.nextTick(P,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(o(n),e._writableState.errorEmitted=!0,e.emit("error",n),P(e,t))}function S(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)k(e,r,n,t,i);else{var o=T(r);o||r.corked||r.bufferProcessing||!r.bufferedRequest||E(e,r),n?s(x,e,r,o,i):x(e,r,o,i)}}function x(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),P(e,t)}function E(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var s=0,u=!0;r;)i[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;i.allBuffers=u,_(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,f=r.encoding,c=r.callback;if(_(e,t,!1,t.objectMode?1:l.length,l,f,c),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function T(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function O(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),P(e,t)})}function C(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,i.nextTick(O,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function P(e,t){var r=T(t);return r&&(C(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}function R(e,t,r){t.ending=!0,P(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}u.inherits(g,f),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]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(g,Symbol.hasInstance,{value:function(e){return!!d.call(this,e)||this===g&&e&&e._writableState instanceof y}})):d=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,o=!n.objectMode&&function(e){return c.isBuffer(e)||e instanceof h}(e);return o&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(r=t,t=null),o?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=b),n.ended?m(this,r):(o||v(this,n,e,r))&&(n.pendingcb++,i=w(this,n,o,e,t,r)),i},g.prototype.cork=function(){this._writableState.corked++},g.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||E(this,e))},g.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-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&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||R(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=p.destroy,g.prototype._undestroy=p.undestroy,g.prototype._destroy=function(e,t){this.end(),t(e)}},{"process-nextick-args":"Yj0v","core-util-is":"Q14w",inherits:"Bm0n","util-deprecate":"yM1o","./internal/streams/stream":"ExO1","safe-buffer":"Nqn4","./internal/streams/destroy":"lCUh","./_stream_duplex":"Jcj8",process:"pBGv"}],Jcj8:[function(e,t,r){"use strict";var n=e("process-nextick-args"),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};t.exports=c;var o=Object.create(e("core-util-is"));o.inherits=e("inherits");var a=e("./_stream_readable"),s=e("./_stream_writable");o.inherits(c,a);for(var u=i(s.prototype),l=0;l<u.length;l++){var f=u[l];c.prototype[f]||(c.prototype[f]=s.prototype[f])}function c(e){if(!(this instanceof c))return new c(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||n.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),c.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}},{"process-nextick-args":"Yj0v","core-util-is":"Q14w",inherits:"Bm0n","./_stream_readable":"YrHu","./_stream_writable":"jPmE"}],OUJr:[function(e,t,r){"use strict";var n=e("safe-buffer").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=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}function a(e){var t;switch(this.encoding=o(e),this.encoding){case"utf16le":this.text=l,this.end=f,t=4;break;case"utf8":this.fillLast=u,t=4;break;case"base64":this.text=c,this.end=h,t=3;break;default:return this.write=d,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(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 l(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 f(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 c(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 h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}r.StringDecoder=a,a.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<e.length?t?t+this.text(e,r):this.text(e,r):t||""},a.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},a.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):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)},a.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}},{"safe-buffer":"Nqn4"}],YrHu:[function(e,t,r){arguments[3],e("process");var n=arguments[3],i=e("process"),o=e("process-nextick-args");t.exports=_;var a,s=e("isarray");_.ReadableState=w;e("events").EventEmitter;var u=function(e,t){return e.listeners(t).length},l=e("./internal/streams/stream"),f=e("safe-buffer").Buffer,c=n.Uint8Array||function(){};var h=Object.create(e("core-util-is"));h.inherits=e("inherits");var d=e("util"),p=void 0;p=d&&d.debuglog?d.debuglog("stream"):function(){};var b,y=e("./internal/streams/BufferList"),g=e("./internal/streams/destroy");h.inherits(_,l);var m=["error","close","destroy","pause","resume"];function v(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?s(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}function w(t,r){t=t||{};var n=r instanceof(a=a||e("./_stream_duplex"));this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var i=t.highWaterMark,o=t.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(o||0===o)?o:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new y,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=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(b||(b=e("string_decoder/").StringDecoder),this.decoder=new b(t.encoding),this.encoding=t.encoding)}function _(t){if(a=a||e("./_stream_duplex"),!(this instanceof _))return new _(t);this._readableState=new w(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),l.call(this)}function k(e,t,r,n,i){var o,a=e._readableState;return null===t?(a.reading=!1,function(e,t){if(!t.ended){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;return function(e){return f.isBuffer(e)||e instanceof c}(t)||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===f.prototype||(t=function(e){return f.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):S(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?S(e,a,t,!1):C(e,a)):S(e,a,t,!1))):n||(a.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function S(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&T(e)),C(e,t)}Object.defineProperty(_.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),_.prototype.destroy=g.destroy,_.prototype._undestroy=g.undestroy,_.prototype._destroy=function(e,t){this.push(null),t(e)},_.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=f.from(e,t),t=""),r=!0),k(this,e,t,!1,r)},_.prototype.unshift=function(e){return k(this,e,null,!0,!1)},_.prototype.isPaused=function(){return!1===this._readableState.flowing},_.prototype.setEncoding=function(t){return b||(b=e("string_decoder/").StringDecoder),this._readableState.decoder=new b(t),this._readableState.encoding=t,this};var x=8388608;function E(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=x?e=x:(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||(p("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?o.nextTick(O,e):O(e))}function O(e){p("emit readable"),e.emit("readable"),M(e)}function C(e,t){t.readingMore||(t.readingMore=!0,o.nextTick(P,e,t))}function P(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(p("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function R(e){p("readable nexttick read 0"),e.read(0)}function A(e,t){t.reading||(p("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),M(e),t.flowing&&!t.reading&&e.read(0)}function M(e){var t=e._readableState;for(p("flow",t.flowing);t.flowing&&null!==e.read(););}function j(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=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;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;for(e-=i.length;r=r.next;){var o=r.data,a=e>o.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=f.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;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),n}(e,t.buffer,t.decoder),r);var r}function I(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,o.nextTick(L,t,e))}function L(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function D(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}_.prototype.read=function(e){p("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return p("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?I(this):T(this),null;if(0===(e=E(e,t))&&t.ended)return 0===t.length&&I(this),null;var n,i=t.needReadable;return p("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&p("length less than watermark",i=!0),t.ended||t.reading?p("reading or ended",i=!1):i&&(p("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=E(r,t))),null===(n=e>0?j(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&I(this)),null!==n&&this.emit("data",n),n},_.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},_.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,p("pipe count=%d opts=%j",n.pipesCount,t);var a=t&&!1===t.end||e===i.stdout||e===i.stderr?g:s;function s(){p("onend"),e.end()}n.endEmitted?o.nextTick(a):r.once("end",a),e.on("unpipe",function t(i,o){p("onunpipe"),i===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,p("cleanup"),e.removeListener("close",b),e.removeListener("finish",y),e.removeListener("drain",l),e.removeListener("error",d),e.removeListener("unpipe",t),r.removeListener("end",s),r.removeListener("end",g),r.removeListener("data",h),f=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||l())});var l=function(e){return function(){var t=e._readableState;p("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&u(e,"data")&&(t.flowing=!0,M(e))}}(r);e.on("drain",l);var f=!1,c=!1;function h(t){p("ondata"),c=!1,!1!==e.write(t)||c||((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==D(n.pipes,e))&&!f&&(p("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,c=!0),r.pause())}function d(t){p("onerror",t),g(),e.removeListener("error",d),0===u(e,"error")&&e.emit("error",t)}function b(){e.removeListener("finish",y),g()}function y(){p("onfinish"),e.removeListener("close",b),g()}function g(){p("unpipe"),r.unpipe(e)}return r.on("data",h),v(e,"error",d),e.once("close",b),e.once("finish",y),e.emit("pipe",r),n.flowing||(p("pipe resume"),r.resume()),e},_.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<i;o++)n[o].emit("unpipe",this,r);return this}var a=D(t.pipes,e);return-1===a?this:(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)},_.prototype.on=function(e,t){var r=l.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&T(this):o.nextTick(R,this))}return r},_.prototype.addListener=_.prototype.on,_.prototype.resume=function(){var e=this._readableState;return e.flowing||(p("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,o.nextTick(A,e,t))}(this,e)),this},_.prototype.pause=function(){return p("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(p("pause"),this._readableState.flowing=!1,this.emit("pause")),this},_.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(p("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){p("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<m.length;o++)e.on(m[o],this.emit.bind(this,m[o]));return this._read=function(t){p("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(_.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),_._fromList=j},{"process-nextick-args":"Yj0v",isarray:"REa7",events:"FRpO","./internal/streams/stream":"ExO1","safe-buffer":"Nqn4","core-util-is":"Q14w",inherits:"Bm0n",util:"rDCW","./internal/streams/BufferList":"CQMM","./internal/streams/destroy":"lCUh","./_stream_duplex":"Jcj8","string_decoder/":"OUJr",process:"pBGv"}],wBib:[function(e,t,r){"use strict";t.exports=a;var n=e("./_stream_duplex"),i=Object.create(e("core-util-is"));function o(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);n.call(this,e),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush(function(t,r){u(e,t,r)}):u(this,null,null)}function u(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=e("inherits"),i.inherits(a,n),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},a.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,function(e){t(e),r.emit("close")})}},{"./_stream_duplex":"Jcj8","core-util-is":"Q14w",inherits:"Bm0n"}],IxGW:[function(e,t,r){"use strict";t.exports=o;var n=e("./_stream_transform"),i=Object.create(e("core-util-is"));function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}i.inherits=e("inherits"),i.inherits(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},{"./_stream_transform":"wBib","core-util-is":"Q14w",inherits:"Bm0n"}],JaqQ:[function(e,t,r){(r=t.exports=e("./lib/_stream_readable.js")).Stream=r,r.Readable=r,r.Writable=e("./lib/_stream_writable.js"),r.Duplex=e("./lib/_stream_duplex.js"),r.Transform=e("./lib/_stream_transform.js"),r.PassThrough=e("./lib/_stream_passthrough.js")},{"./lib/_stream_readable.js":"YrHu","./lib/_stream_writable.js":"jPmE","./lib/_stream_duplex.js":"Jcj8","./lib/_stream_transform.js":"wBib","./lib/_stream_passthrough.js":"IxGW"}],UxIR:[function(e,t,r){e("process"),e("buffer").Buffer,arguments[3];var n=e("process"),i=e("buffer").Buffer,o=arguments[3],a=e("./capability"),s=e("inherits"),u=e("readable-stream"),l=r.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},f=r.IncomingMessage=function(e,t,r,s){var l=this;if(u.Readable.call(l),l._mode=r,l.headers={},l.rawHeaders=[],l.trailers={},l.rawTrailers=[],l.on("end",function(){n.nextTick(function(){l.emit("close")})}),"fetch"===r){if(l._fetchResponse=t,l.url=t.url,l.statusCode=t.status,l.statusMessage=t.statusText,t.headers.forEach(function(e,t){l.headers[t.toLowerCase()]=e,l.rawHeaders.push(t,e)}),a.writableStream){var f=new WritableStream({write:function(e){return new Promise(function(t,r){l._destroyed?r():l.push(new i(e))?t():l._resumeFetch=t})},close:function(){o.clearTimeout(s),l._destroyed||l.push(null)},abort:function(e){l._destroyed||l.emit("error",e)}});try{return void t.body.pipeTo(f).catch(function(e){o.clearTimeout(s),l._destroyed||l.emit("error",e)})}catch(p){}}var c=t.body.getReader();!function e(){c.read().then(function(t){if(!l._destroyed){if(t.done)return o.clearTimeout(s),void l.push(null);l.push(new i(t.value)),e()}}).catch(function(e){o.clearTimeout(s),l._destroyed||l.emit("error",e)})}()}else if(l._xhr=e,l._pos=0,l.url=e.responseURL,l.statusCode=e.status,l.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach(function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===l.headers[r]&&(l.headers[r]=[]),l.headers[r].push(t[2])):void 0!==l.headers[r]?l.headers[r]+=", "+t[2]:l.headers[r]=t[2],l.rawHeaders.push(t[1],t[2])}}),l._charset="x-user-defined",!a.overrideMimeType){var h=l.rawHeaders["mime-type"];if(h){var d=h.match(/;\s*charset=([^;])(;|$)/);d&&(l._charset=d[1].toLowerCase())}l._charset||(l._charset="utf-8")}};s(f,u.Readable),f.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},f.prototype._onXHRProgress=function(){var e=this,t=e._xhr,r=null;switch(e._mode){case"text:vbarray":if(t.readyState!==l.DONE)break;try{r=new o.VBArray(t.responseBody).toArray()}catch(f){}if(null!==r){e.push(new i(r));break}case"text":try{r=t.responseText}catch(f){e._mode="text:vbarray";break}if(r.length>e._pos){var n=r.substr(e._pos);if("x-user-defined"===e._charset){for(var a=new i(n.length),s=0;s<n.length;s++)a[s]=255&n.charCodeAt(s);e.push(a)}else e.push(n,e._charset);e._pos=r.length}break;case"arraybuffer":if(t.readyState!==l.DONE||!t.response)break;r=t.response,e.push(new i(new Uint8Array(r)));break;case"moz-chunked-arraybuffer":if(r=t.response,t.readyState!==l.LOADING||!r)break;e.push(new i(new Uint8Array(r)));break;case"ms-stream":if(r=t.response,t.readyState!==l.LOADING)break;var u=new o.MSStreamReader;u.onprogress=function(){u.result.byteLength>e._pos&&(e.push(new i(new Uint8Array(u.result.slice(e._pos)))),e._pos=u.result.byteLength)},u.onload=function(){e.push(null)},u.readAsArrayBuffer(r)}e._xhr.readyState===l.DONE&&"ms-stream"!==e._mode&&e.push(null)}},{"./capability":"p5a1",inherits:"Bm0n","readable-stream":"JaqQ",process:"pBGv",buffer:"dskh"}],AH4k:[function(e,t,r){var n=e("buffer").Buffer;t.exports=function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(n.isBuffer(e)){for(var t=new Uint8Array(e.length),r=e.length,i=0;i<r;i++)t[i]=e[i];return t.buffer}throw new Error("Argument must be a Buffer")}},{buffer:"dskh"}],yL7F:[function(e,t,r){e("buffer").Buffer,arguments[3],e("process");var n=e("buffer").Buffer,i=arguments[3],o=e("process"),a=e("./capability"),s=e("inherits"),u=e("./response"),l=e("readable-stream"),f=e("to-arraybuffer"),c=u.IncomingMessage,h=u.readyStates;var d=t.exports=function(e){var t,r=this;l.Writable.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+new n(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(t){r.setHeader(t,e.headers[t])});var i=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!a.abortController)i=!1,t=!0;else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!a.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");t=!0}r._mode=function(e,t){return a.fetch&&t?"fetch":a.mozchunkedarraybuffer?"moz-chunked-arraybuffer":a.msstream?"ms-stream":a.arraybuffer&&e?"arraybuffer":a.vbArray&&e?"text:vbarray":"text"}(t,i),r._fetchTimer=null,r.on("finish",function(){r._onFinish()})};s(d,l.Writable),d.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===p.indexOf(r)&&(this._headers[r]={name:e,value:t})},d.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},d.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},d.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts,r=e._headers,s=null;"GET"!==t.method&&"HEAD"!==t.method&&(s=a.arraybuffer?f(n.concat(e._body)):a.blobConstructor?new i.Blob(e._body.map(function(e){return f(e)}),{type:(r["content-type"]||{}).value||""}):n.concat(e._body).toString());var u=[];if(Object.keys(r).forEach(function(e){var t=r[e].name,n=r[e].value;Array.isArray(n)?n.forEach(function(e){u.push([t,e])}):u.push([t,n])}),"fetch"===e._mode){var l=null;if(a.abortController){var c=new AbortController;l=c.signal,e._fetchAbortController=c,"requestTimeout"in t&&0!==t.requestTimeout&&(e._fetchTimer=i.setTimeout(function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()},t.requestTimeout))}i.fetch(e._opts.url,{method:e._opts.method,headers:u,body:s||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:l}).then(function(t){e._fetchResponse=t,e._connect()},function(t){i.clearTimeout(e._fetchTimer),e._destroyed||e.emit("error",t)})}else{var d=e._xhr=new i.XMLHttpRequest;try{d.open(e._opts.method,e._opts.url,!0)}catch(p){return void o.nextTick(function(){e.emit("error",p)})}"responseType"in d&&(d.responseType=e._mode.split(":")[0]),"withCredentials"in d&&(d.withCredentials=!!t.withCredentials),"text"===e._mode&&"overrideMimeType"in d&&d.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in t&&(d.timeout=t.requestTimeout,d.ontimeout=function(){e.emit("requestTimeout")}),u.forEach(function(e){d.setRequestHeader(e[0],e[1])}),e._response=null,d.onreadystatechange=function(){switch(d.readyState){case h.LOADING:case h.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(d.onprogress=function(){e._onXHRProgress()}),d.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{d.send(s)}catch(p){return void o.nextTick(function(){e.emit("error",p)})}}}},d.prototype._onXHRProgress=function(){(function(e){try{var t=e.status;return null!==t&&0!==t}catch(o){return!1}})(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},d.prototype._connect=function(){var e=this;e._destroyed||(e._response=new c(e._xhr,e._fetchResponse,e._mode,e._fetchTimer),e._response.on("error",function(t){e.emit("error",t)}),e.emit("response",e._response))},d.prototype._write=function(e,t,r){this._body.push(e),r()},d.prototype.abort=d.prototype.destroy=function(){this._destroyed=!0,i.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},d.prototype.end=function(e,t,r){"function"==typeof e&&(r=e,e=void 0),l.Writable.prototype.end.call(this,e,t,r)},d.prototype.flushHeaders=function(){},d.prototype.setTimeout=function(){},d.prototype.setNoDelay=function(){},d.prototype.setSocketKeepAlive=function(){};var p=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]},{"./capability":"p5a1",inherits:"Bm0n","./response":"UxIR","readable-stream":"JaqQ","to-arraybuffer":"AH4k",buffer:"dskh",process:"pBGv"}],K5Tb:[function(e,t,r){t.exports=function(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var i in r)n.call(r,i)&&(e[i]=r[i])}return e};var n=Object.prototype.hasOwnProperty},{}],OpTI:[function(e,t,r){t.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},{}],oWqx:[function(e,t,r){arguments[3];var n=arguments[3];!function(e){var i="object"==typeof r&&r&&!r.nodeType&&r,o="object"==typeof t&&t&&!t.nodeType&&t,a="object"==typeof n&&n;a.global!==a&&a.window!==a&&a.self!==a||(e=a);var s,u,l=2147483647,f=36,c=1,h=26,d=38,p=700,b=72,y=128,g="-",m=/^xn--/,v=/[^\x20-\x7E]/,w=/[\x2E\u3002\uFF0E\uFF61]/g,_={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=f-c,S=Math.floor,x=String.fromCharCode;function E(e){throw new RangeError(_[e])}function T(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function O(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+T((e=e.replace(w,".")).split("."),t).join(".")}function C(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function P(e){return T(e,function(e){var t="";return e>65535&&(t+=x((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+x(e)}).join("")}function R(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function A(e,t,r){var n=0;for(e=r?S(e/p):e>>1,e+=S(e/t);e>k*h>>1;n+=f)e=S(e/k);return S(n+(k+1)*e/(e+d))}function M(e){var t,r,n,i,o,a,s,u,d,p,m,v=[],w=e.length,_=0,k=y,x=b;for((r=e.lastIndexOf(g))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&E("not-basic"),v.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<w;){for(o=_,a=1,s=f;i>=w&&E("invalid-input"),((u=(m=e.charCodeAt(i++))-48<10?m-22:m-65<26?m-65:m-97<26?m-97:f)>=f||u>S((l-_)/a))&&E("overflow"),_+=u*a,!(u<(d=s<=x?c:s>=x+h?h:s-x));s+=f)a>S(l/(p=f-d))&&E("overflow"),a*=p;x=A(_-o,t=v.length+1,0==o),S(_/t)>l-k&&E("overflow"),k+=S(_/t),_%=t,v.splice(_++,0,k)}return P(v)}function j(e){var t,r,n,i,o,a,s,u,d,p,m,v,w,_,k,T=[];for(v=(e=C(e)).length,t=y,r=0,o=b,a=0;a<v;++a)(m=e[a])<128&&T.push(x(m));for(n=i=T.length,i&&T.push(g);n<v;){for(s=l,a=0;a<v;++a)(m=e[a])>=t&&m<s&&(s=m);for(s-t>S((l-r)/(w=n+1))&&E("overflow"),r+=(s-t)*w,t=s,a=0;a<v;++a)if((m=e[a])<t&&++r>l&&E("overflow"),m==t){for(u=r,d=f;!(u<(p=d<=o?c:d>=o+h?h:d-o));d+=f)k=u-p,_=f-p,T.push(x(R(p+k%_,0))),u=S(k/_);T.push(x(R(u,0))),o=A(r,w,n==i),r=0,++n}++r,++t}return T.join("")}if(s={version:"1.4.1",ucs2:{decode:C,encode:P},decode:M,encode:j,toASCII:function(e){return O(e,function(e){return v.test(e)?"xn--"+j(e):e})},toUnicode:function(e){return O(e,function(e){return m.test(e)?M(e.slice(4).toLowerCase()):e})}},i&&o)if(t.exports==i)o.exports=s;else for(u in s)s.hasOwnProperty(u)&&(i[u]=s[u]);else e.punycode=s}(this)},{}],YsIc:[function(e,t,r){"use strict";t.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],J6GP:[function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,o){t=t||"&",r=r||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var l=e.length;u>0&&l>u&&(l=u);for(var f=0;f<l;++f){var c,h,d,p,b=e[f].replace(s,"%20"),y=b.indexOf(r);y>=0?(c=b.substr(0,y),h=b.substr(y+1)):(c=b,h=""),d=decodeURIComponent(c),p=decodeURIComponent(h),n(a,d)?i(a[d])?a[d].push(p):a[d]=[a[d],p]:a[d]=p}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],bvhO:[function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,s){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?o(a(e),function(a){var s=encodeURIComponent(n(a))+r;return i(e[a])?o(e[a],function(e){return s+encodeURIComponent(n(e))}).join(t):s+encodeURIComponent(n(e[a]))}).join(t):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var a=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}},{}],fk5h:[function(e,t,r){"use strict";r.decode=r.parse=e("./decode"),r.encode=r.stringify=e("./encode")},{"./decode":"J6GP","./encode":"bvhO"}],Mej7:[function(e,t,r){"use strict";var n=e("punycode"),i=e("./util");function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}r.parse=v,r.resolve=function(e,t){return v(e,!1,!0).resolve(t)},r.resolveObject=function(e,t){return e?v(e,!1,!0).resolveObject(t):t},r.format=function(e){return i.isString(e)&&(e=v(e)),e instanceof o?e.format():o.prototype.format.call(e)},r.Url=o;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),f=["'"].concat(l),c=["%","/","?",";","#"].concat(f),h=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=e("querystring");function v(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),s=-1!==o&&o<e.indexOf("#")?"?":"#",l=e.split(s);l[0]=l[0].replace(/\\/g,"/");var v=e=l.join(s);if(v=v.trim(),!r&&1===e.split("#").length){var w=u.exec(v);if(w)return this.path=v,this.href=v,this.pathname=w[1],w[2]?(this.search=w[2],this.query=t?m.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var _=a.exec(v);if(_){var k=(_=_[0]).toLowerCase();this.protocol=k,v=v.substr(_.length)}if(r||_||v.match(/^\/\/[^@\/]+@[^@\/]+/)){var S="//"===v.substr(0,2);!S||_&&y[_]||(v=v.substr(2),this.slashes=!0)}if(!y[_]&&(S||_&&!g[_])){for(var x,E,T=-1,O=0;O<h.length;O++)-1!==(C=v.indexOf(h[O]))&&(-1===T||C<T)&&(T=C);for(-1!==(E=-1===T?v.lastIndexOf("@"):v.lastIndexOf("@",T))&&(x=v.slice(0,E),v=v.slice(E+1),this.auth=decodeURIComponent(x)),T=-1,O=0;O<c.length;O++){var C;-1!==(C=v.indexOf(c[O]))&&(-1===T||C<T)&&(T=C)}-1===T&&(T=v.length),this.host=v.slice(0,T),v=v.slice(T),this.parseHost(),this.hostname=this.hostname||"";var P="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!P)for(var R=this.hostname.split(/\./),A=(O=0,R.length);O<A;O++){var M=R[O];if(M&&!M.match(d)){for(var j="",I=0,L=M.length;I<L;I++)M.charCodeAt(I)>127?j+="x":j+=M[I];if(!j.match(d)){var D=R.slice(0,O),U=R.slice(O+1),N=M.match(p);N&&(D.push(N[1]),U.unshift(N[2])),U.length&&(v="/"+U.join(".")+v),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=n.toASCII(this.hostname));var B=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+B,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!b[k])for(O=0,A=f.length;O<A;O++){var G=f[O];if(-1!==v.indexOf(G)){var W=encodeURIComponent(G);W===G&&(W=escape(G)),v=v.split(G).join(W)}}var q=v.indexOf("#");-1!==q&&(this.hash=v.substr(q),v=v.slice(0,q));var z=v.indexOf("?");if(-1!==z?(this.search=v.substr(z),this.query=v.substr(z+1),t&&(this.query=m.parse(this.query)),v=v.slice(0,z)):t&&(this.search="",this.query={}),v&&(this.pathname=v),g[k]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){B=this.pathname||"";var H=this.search||"";this.path=B+H}return this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,a="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(a=m.stringify(this.query));var s=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||g[t])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+o+(r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+n},o.prototype.resolve=function(e){return this.resolveObject(v(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if(i.isString(e)){var t=new o;t.parse(e,!1,!0),e=t}for(var r=new o,n=Object.keys(this),a=0;a<n.length;a++){var s=n[a];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var u=Object.keys(e),l=0;l<u.length;l++){var f=u[l];"protocol"!==f&&(r[f]=e[f])}return g[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!g[e.protocol]){for(var c=Object.keys(e),h=0;h<c.length;h++){var d=c[h];r[d]=e[d]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||y[e.protocol])r.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var b=r.pathname||"",m=r.search||"";r.path=b+m}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var v=r.pathname&&"/"===r.pathname.charAt(0),w=e.host||e.pathname&&"/"===e.pathname.charAt(0),_=w||v||r.host&&e.pathname,k=_,S=r.pathname&&r.pathname.split("/")||[],x=(p=e.pathname&&e.pathname.split("/")||[],r.protocol&&!g[r.protocol]);if(x&&(r.hostname="",r.port=null,r.host&&(""===S[0]?S[0]=r.host:S.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),_=_&&(""===p[0]||""===S[0])),w)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,S=p;else if(p.length)S||(S=[]),S.pop(),S=S.concat(p),r.search=e.search,r.query=e.query;else if(!i.isNullOrUndefined(e.search))return x&&(r.hostname=r.host=S.shift(),(P=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=P.shift(),r.host=r.hostname=P.shift())),r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var E=S.slice(-1)[0],T=(r.host||e.host||S.length>1)&&("."===E||".."===E)||""===E,O=0,C=S.length;C>=0;C--)"."===(E=S[C])?S.splice(C,1):".."===E?(S.splice(C,1),O++):O&&(S.splice(C,1),O--);if(!_&&!k)for(;O--;O)S.unshift("..");!_||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),T&&"/"!==S.join("/").substr(-1)&&S.push("");var P,R=""===S[0]||S[0]&&"/"===S[0].charAt(0);return x&&(r.hostname=r.host=R?"":S.length?S.shift():"",(P=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=P.shift(),r.host=r.hostname=P.shift())),(_=_||r.host&&S.length)&&!R&&S.unshift(""),S.length?r.pathname=S.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{punycode:"oWqx","./util":"YsIc",querystring:"fk5h"}],KKrj:[function(e,t,r){arguments[3];var n=arguments[3],i=e("./lib/request"),o=e("./lib/response"),a=e("xtend"),s=e("builtin-status-codes"),u=e("url"),l=r;l.request=function(e,t){e="string"==typeof e?u.parse(e):a(e);var r=-1===n.location.protocol.search(/^https?:$/)?"http:":"",o=e.protocol||r,s=e.hostname||e.host,l=e.port,f=e.path||"/";s&&-1!==s.indexOf(":")&&(s="["+s+"]"),e.url=(s?o+"//"+s:"")+(l?":"+l:"")+f,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var c=new i(e);return t&&c.on("response",t),c},l.get=function(e,t){var r=l.request(e,t);return r.end(),r},l.ClientRequest=i,l.IncomingMessage=o.IncomingMessage,l.Agent=function(){},l.Agent.defaultMaxSockets=4,l.globalAgent=new l.Agent,l.STATUS_CODES=s,l.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]},{"./lib/request":"yL7F","./lib/response":"UxIR",xtend:"K5Tb","builtin-status-codes":"OpTI",url:"Mej7"}],wVMl:[function(e,t,r){var n=e("http"),i=e("url"),o=t.exports;for(var a in n)n.hasOwnProperty(a)&&(o[a]=n[a]);function s(e){if("string"==typeof e&&(e=i.parse(e)),e.protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}o.request=function(e,t){return e=s(e),n.request.call(this,e,t)},o.get=function(e,t){return e=s(e),n.get.call(this,e,t)}},{http:"KKrj",url:"Mej7"}],cUx7:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.makeFetchSource=_,r.makeXHRSource=k,r.makeHttpSource=S,r.makeRemoteSource=function(e,t){var r=t.forceXHR;if("function"==typeof fetch&&!r)return _(e,t);if("undefined"!=typeof XMLHttpRequest)return k(e,t);if(c.default.get)return S(e,t);throw new Error("No remote source available")},r.makeBufferSource=function(e){return{fetch:function(t,r){return(0,u.default)(o.default.mark(function n(){return o.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",e.slice(t,t+r));case 1:case"end":return n.stop()}},n)}))()}}},r.makeFileSource=function(e){var t=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return new Promise(function(n,i){(0,f.open)(e,t,r,function(e,t){e?i(e):n(t)})})}(e,"r");return{fetch:function(e,r){return(0,u.default)(o.default.mark(function n(){var i,a,s;return o.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t;case 2:return i=n.sent,n.next=5,E(i,l.Buffer.alloc(r),0,r,e);case 5:return a=n.sent,s=a.buffer,n.abrupt("return",s.buffer);case 8:case"end":return n.stop()}},n)}))()},close:function(){return(0,u.default)(o.default.mark(function e(){var r;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:return r=e.sent,e.next=5,x(r);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}},e)}))()}}},r.makeFileReaderSource=function(e){return{fetch:function(t,r){return(0,u.default)(o.default.mark(function n(){return o.default.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",new Promise(function(n,i){var o=e.slice(t,t+r),a=new FileReader;a.onload=function(e){return n(e.target.result)},a.onerror=i,a.readAsArrayBuffer(o)}));case 1:case"end":return n.stop()}},n)}))()}}};var n=p(e("@babel/runtime/helpers/slicedToArray")),i=p(e("@babel/runtime/helpers/defineProperty")),o=p(e("@babel/runtime/regenerator")),a=p(e("@babel/runtime/helpers/classCallCheck")),s=p(e("@babel/runtime/helpers/createClass")),u=p(e("@babel/runtime/helpers/asyncToGenerator")),l=e("buffer"),f=e("fs"),c=p(e("http")),h=p(e("https")),d=p(e("url"));function p(e){return e&&e.__esModule?e:{default:e}}function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(Object(r),!0).forEach(function(t){(0,i.default)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function g(e,t,r){var n=t+r,i=new ArrayBuffer(r),o=new Uint8Array(i),a=!0,s=!1,u=void 0;try{for(var l,f=e[Symbol.iterator]();!(a=(l=f.next()).done);a=!0){var c=l.value,h=c.offset-t,d=c.top-n,p=0,b=0,y=void 0;h<0?p=-h:h>0&&(b=h),d<0?y=c.length-p:d>0&&(y=n-c.offset-p);var g=new Uint8Array(c.data,p,y);o.set(g,b)}}catch(w){s=!0,u=w}finally{try{a||null==f.return||f.return()}finally{if(s)throw u}}return i}function m(e){if(0===e.length)return[];var t=[],r=[];t.push(r);for(var n=0;n<e.length;++n)0===n||e[n]===e[n-1]+1?r.push(e[n]):(r=[e[n]],t.push(r));return t}function v(e){return function(){return(0,u.default)(o.default.mark(function e(t){return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise(function(e){return setTimeout(e,t)}));case 1:case"end":return e.stop()}},e)})).apply(this,arguments)}.apply(this,arguments)}var w=function(){function e(t){var r=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).blockSize,n=void 0===r?65536:r;(0,a.default)(this,e),this.retrievalFunction=t,this.blockSize=n,this.blockRequests=new Map,this.blocks=new Map,this.blockIdsAwaitingRequest=null}return(0,s.default)(e,[{key:"fetch",value:function(){var e=(0,u.default)(o.default.mark(function e(t,r){var n,i,a,s,l,f,c,h,d,p,b,y,w,_,k,S,x,E,T,O,C,P,R=this,A=arguments;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:for(n=A.length>2&&void 0!==A[2]&&A[2],i=t+r,a=Math.floor(t/this.blockSize)*this.blockSize,s=[],l=[],f=[],c=a;c<i;c+=this.blockSize)h=Math.floor(c/this.blockSize),this.blocks.has(h)||this.blockRequests.has(h)||l.push(h),this.blockRequests.has(h)&&f.push(this.blockRequests.get(h)),s.push(h);if(this.blockIdsAwaitingRequest)for(d=0;d<l.length;++d)p=l[d],this.blockIdsAwaitingRequest.add(p);else this.blockIdsAwaitingRequest=new Set(l);if(n){e.next=11;break}return e.next=11,v();case 11:if(!this.blockIdsAwaitingRequest){e.next=34;break}for(b=m(Array.from(this.blockIdsAwaitingRequest).sort()),y=!0,w=!1,_=void 0,e.prev=16,k=function(){for(var e=x.value,t=R.requestData(e[0]*R.blockSize,e.length*R.blockSize),r=function(r){var n=e[r];R.blockRequests.set(n,(0,u.default)(o.default.mark(function e(){var i,a,s,u;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t;case 2:i=e.sent,a=r*R.blockSize,s=Math.min(a+R.blockSize,i.data.byteLength),u=i.data.slice(a,s),R.blockRequests.delete(n),R.blocks.set(n,{data:u,offset:i.offset+a,length:u.byteLength,top:i.offset+s});case 8:case"end":return e.stop()}},e)}))())},n=0;n<e.length;++n)r(n)},S=b[Symbol.iterator]();!(y=(x=S.next()).done);y=!0)k();e.next=25;break;case 21:e.prev=21,e.t0=e.catch(16),w=!0,_=e.t0;case 25:e.prev=25,e.prev=26,y||null==S.return||S.return();case 28:if(e.prev=28,!w){e.next=31;break}throw _;case 31:return e.finish(28);case 32:return e.finish(25);case 33:this.blockIdsAwaitingRequest=null;case 34:for(E=[],T=0,O=l;T<O.length;T++)C=O[T],this.blockRequests.has(C)&&E.push(this.blockRequests.get(C));return e.next=38,Promise.all(E);case 38:return e.next=40,Promise.all(f);case 40:return P=s.map(function(e){return R.blocks.get(e)}),e.abrupt("return",g(P,t,r));case 42:case"end":return e.stop()}},e,this,[[16,21,25,33],[26,,28,32]])}));return function(t,r){return e.apply(this,arguments)}}()},{key:"requestData",value:function(){var e=(0,u.default)(o.default.mark(function e(t,r){var n;return o.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.retrievalFunction(t,r);case 2:return(n=e.sent).length?n.length!==n.data.byteLength&&(n.data=n.data.slice(0,n.length)):n.length=n.data.byteLength,n.top=n.offset+n.length,e.abrupt("return",n);case 6:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()}]),e}();function _(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.headers,n=void 0===r?{}:r,i=t.blockSize;return new w(function(){var t=(0,u.default)(o.default.mark(function t(r,i){var a,s,u;return o.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch(e,{headers:y({},n,{Range:"bytes=".concat(r,"-").concat(r+i-1)})});case 2:if((a=t.sent).ok){t.next=7;break}throw new Error("Error fetching data.");case 7:if(206!==a.status){t.next=21;break}if(!a.arrayBuffer){t.next=14;break}return t.next=11,a.arrayBuffer();case 11:t.t0=t.sent,t.next=17;break;case 14:return t.next=16,a.buffer();case 16:t.t0=t.sent.buffer;case 17:return s=t.t0,t.abrupt("return",{data:s,offset:r,length:i});case 21:if(!a.arrayBuffer){t.next=27;break}return t.next=24,a.arrayBuffer();case 24:t.t1=t.sent,t.next=30;break;case 27:return t.next=29,a.buffer();case 29:t.t1=t.sent.buffer;case 30:return u=t.t1,t.abrupt("return",{data:u,offset:0,length:u.byteLength});case 32:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}(),{blockSize:i})}function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.headers,i=void 0===r?{}:r,a=t.blockSize;return new w(function(){var t=(0,u.default)(o.default.mark(function t(r,a){return o.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(t,o){var s=new XMLHttpRequest;s.open("GET",e),s.responseType="arraybuffer";for(var u=y({},i,{Range:"bytes=".concat(r,"-").concat(r+a-1)}),l=0,f=Object.entries(u);l<f.length;l++){var c=(0,n.default)(f[l],2),h=c[0],d=c[1];s.setRequestHeader(h,d)}s.onload=function(){var e=s.response;206===s.status?t({data:e,offset:r,length:a}):t({data:e,offset:0,length:e.byteLength})},s.onerror=o,s.send()}));case 1:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}(),{blockSize:a})}function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.headers,n=void 0===r?{}:r,i=t.blockSize;return new w(function(){var t=(0,u.default)(o.default.mark(function t(r,i){return o.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(t,o){var a=d.default.parse(e);("http:"===a.protocol?c.default:h.default).get(y({},a,{headers:y({},n,{Range:"bytes=".concat(r,"-").concat(r+i-1)})}),function(e){var n=[];e.on("data",function(e){n.push(e)}),e.on("end",function(){var e=l.Buffer.concat(n).buffer;t({data:e,offset:r,length:e.byteLength})})}).on("error",o)}));case 1:case"end":return t.stop()}},t)}));return function(e,r){return t.apply(this,arguments)}}(),{blockSize:i})}function x(e){return new Promise(function(t,r){(0,f.close)(e,function(e){e?r(e):t()})})}function E(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return new Promise(function(e,r){f.read.apply(void 0,t.concat([function(t,n,i){t?r(t):e({bytesRead:n,buffer:i})}]))})}},{"@babel/runtime/helpers/slicedToArray":"HETk","@babel/runtime/helpers/defineProperty":"IxO8","@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/classCallCheck":"fcMS","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/asyncToGenerator":"agGE",buffer:"dskh",fs:"rDCW",http:"KKrj",https:"wVMl",url:"Mej7"}],FOZT:[function(e,t,r){"use strict";function n(e){for(var t=[],r=e.length,n=0;n<r;n++)t.push(e[n]);return t}Object.defineProperty(r,"__esModule",{value:!0}),r.assign=function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},r.chunk=function(e,t){for(var r=[],n=e.length,i=0;i<n;i+=t){for(var o=[],a=i;a<i+t;a++)o.push(e[a]);r.push(o)}return r},r.endsWith=function(e,t){return!(e.length<t.length)&&e.substr(e.length-t.length)===t},r.forEach=function(e,t){for(var r=e.length,n=0;n<r;n++)t(e[n],n)},r.invert=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t},r.range=function(e){for(var t=[],r=0;r<e;r++)t.push(r);return t},r.times=function(e,t){for(var r=[],n=0;n<e;n++)r.push(t(n));return r},r.toArray=n,r.toArrayRecursively=function e(t){return t.length?n(t).map(e):t}},{}],BGyE:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.writeGeotiff=function(e,t){var r,o,a,u;"number"==typeof e[0]?(r=t.height||t.ImageLength,a=t.width||t.ImageWidth,o=e.length/(r*a),u=e):(o=e.length,r=e[0].length,a=e[0][0].length,u=[],(0,i.times)(r,function(t){(0,i.times)(a,function(r){(0,i.times)(o,function(n){u.push(e[n][t][r])})})})),t.ImageLength=r,delete t.height,t.ImageWidth=a,delete t.width,t.BitsPerSample||(t.BitsPerSample=(0,i.times)(o,function(){return 8})),y.forEach(function(e){var r=e[0];if(!t[r]){var n=e[1];t[r]=n}}),t.PhotometricInterpretation||(t.PhotometricInterpretation=3===t.BitsPerSample.length?2:1),t.SamplesPerPixel||(t.SamplesPerPixel=[o]),t.StripByteCounts||(t.StripByteCounts=[o*r*a]),t.ModelPixelScale||(t.ModelPixelScale=[360/a,180/r,0]),t.SampleFormat||(t.SampleFormat=(0,i.times)(o,function(){return 1}));var l=Object.keys(t).filter(function(e){return(0,i.endsWith)(e,"GeoKey")}).sort(function(e,t){return s[e]-s[t]});if(!t.GeoKeyDirectory){var f=[1,1,0,l.length];l.forEach(function(e){var r,i,o,a=Number(s[e]);f.push(a),"SHORT"===n.fieldTagTypes[a]?(r=1,i=0,o=t[e]):"GeogCitationGeoKey"===e?(r=t.GeoAsciiParams.length,i=Number(s.GeoAsciiParams),o=0):console.log("[geotiff.js] couldn't get TIFFTagLocation for ".concat(e)),f.push(i),f.push(r),f.push(o)}),t.GeoKeyDirectory=f}for(var c in l)l.hasOwnProperty(c)&&delete t[c];["Compression","ExtraSamples","GeographicTypeGeoKey","GTModelTypeGeoKey","GTRasterTypeGeoKey","ImageLength","ImageWidth","PhotometricInterpretation","PlanarConfiguration","ResolutionUnit","SamplesPerPixel","XPosition","YPosition"].forEach(function(e){t[e]&&(t[e]=b(t[e]))});var h=p(t);return d(u,a,r,h)};var n=e("./globals"),i=e("./utils"),o=(0,i.invert)(n.fieldTagNames),a=(0,i.invert)(n.geoKeyNames),s={};(0,i.assign)(s,o),(0,i.assign)(s,a);var u=(0,i.invert)(n.fieldTypeNames),l=1e3,f={nextZero:function(e,t){for(var r=t;0!==e[r];)r++;return r},readUshort:function(e,t){return e[t]<<8|e[t+1]},readShort:function(e,t){var r=f.ui8;return r[0]=e[t+1],r[1]=e[t+0],f.i16[0]},readInt:function(e,t){var r=f.ui8;return r[0]=e[t+3],r[1]=e[t+2],r[2]=e[t+1],r[3]=e[t+0],f.i32[0]},readUint:function(e,t){var r=f.ui8;return r[0]=e[t+3],r[1]=e[t+2],r[2]=e[t+1],r[3]=e[t+0],f.ui32[0]},readASCII:function(e,t,r){return r.map(function(r){return String.fromCharCode(e[t+r])}).join("")},readFloat:function(e,t){var r=f.ui8;return(0,i.times)(4,function(n){r[n]=e[t+3-n]}),f.fl32[0]},readDouble:function(e,t){var r=f.ui8;return(0,i.times)(8,function(n){r[n]=e[t+7-n]}),f.fl64[0]},writeUshort:function(e,t,r){e[t]=r>>8&255,e[t+1]=255&r},writeUint:function(e,t,r){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=r>>0&255},writeASCII:function(e,t,r){(0,i.times)(r.length,function(n){e[t+n]=r.charCodeAt(n)})},ui8:new Uint8Array(8)};f.fl64=new Float64Array(f.ui8.buffer),f.writeDouble=function(e,t,r){f.fl64[0]=r,(0,i.times)(8,function(r){e[t+r]=f.ui8[7-r]})};var c=function(e,t,r,o){var a=r,s=Object.keys(o).filter(function(e){return null!=e&&"undefined"!==e});e.writeUshort(t,a,s.length);var l=(a+=2)+12*s.length+4,f=!0,c=!1,h=void 0;try{for(var d,p=function(){var r=d.value,s=null;"number"==typeof r?s=r:"string"==typeof r&&(s=parseInt(r,10));var f=n.fieldTagTypes[s],c=u[f];if(null==f||void 0===f||void 0===f)throw new Error("unknown type of tag: ".concat(s));var h=o[r];if(void 0===h)throw new Error("failed to get value for key ".concat(r));"ASCII"===f&&"string"==typeof h&&!1===(0,i.endsWith)(h,"\0")&&(h+="\0");var p=h.length;e.writeUshort(t,a,s),a+=2,e.writeUshort(t,a,c),a+=2,e.writeUint(t,a,p);var b=[-1,1,1,2,4,8,0,0,0,0,0,0,8][c]*p,y=a+=4;b>4&&(e.writeUint(t,a,l),y=l),"ASCII"===f?e.writeASCII(t,y,h):"SHORT"===f?(0,i.times)(p,function(r){e.writeUshort(t,y+2*r,h[r])}):"LONG"===f?(0,i.times)(p,function(r){e.writeUint(t,y+4*r,h[r])}):"RATIONAL"===f?(0,i.times)(p,function(r){e.writeUint(t,y+8*r,Math.round(1e4*h[r])),e.writeUint(t,y+8*r+4,1e4)}):"DOUBLE"===f&&(0,i.times)(p,function(r){e.writeDouble(t,y+8*r,h[r])}),b>4&&(l+=b+=1&b),a+=4},b=s[Symbol.iterator]();!(f=(d=b.next()).done);f=!0)p()}catch(y){c=!0,h=y}finally{try{f||null==b.return||b.return()}finally{if(c)throw h}}return[a,l]},h=function(e){var t=new Uint8Array(l),r=4,n=f;t[0]=77,t[1]=77,t[3]=42;var i=8;if(n.writeUint(t,r,i),r+=4,e.forEach(function(r,o){var a=c(n,t,i,r);i=a[1],o<e.length-1&&n.writeUint(t,a[0],i)}),t.slice)return t.slice(0,i).buffer;for(var o=new Uint8Array(i),a=0;a<i;a++)o[a]=t[a];return o.buffer},d=function(e,t,r,n){if(null==r)throw new Error("you passed into encodeImage a width of type ".concat(r));if(null==t)throw new Error("you passed into encodeImage a width of type ".concat(t));var o={256:[t],257:[r],273:[l],278:[r],305:"geotiff.js"};if(n)for(var a in n)n.hasOwnProperty(a)&&(o[a]=n[a]);var s=new Uint8Array(h([o])),u=new Uint8Array(e),f=o[277],c=new Uint8Array(l+t*r*f);return(0,i.times)(s.length,function(e){c[e]=s[e]}),(0,i.forEach)(u,function(e,t){c[l+t]=e}),c.buffer},p=function(e){var t={};for(var r in e)"StripOffsets"!==r&&(s[r]||console.error(r,"not in name2code:",Object.keys(s)),t[s[r]]=e[r]);return t},b=function(e){return Array.isArray(e)?e:[e]},y=[["Compression",1],["PlanarConfiguration",1],["XPosition",0],["YPosition",0],["ResolutionUnit",1],["ExtraSamples",0],["GeoAsciiParams","WGS 84\0"],["ModelTiepoint",[0,0,0,-180,90,0]],["GTModelTypeGeoKey",2],["GTRasterTypeGeoKey",1],["GeographicTypeGeoKey",4326],["GeogCitationGeoKey","WGS 84"]]},{"./globals":"j27V","./utils":"FOZT"}],bsJs:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.fromUrl=function(e){return D.apply(this,arguments)},r.fromArrayBuffer=function(e){return U.apply(this,arguments)},r.fromFile=function(e){return N.apply(this,arguments)},r.fromBlob=function(e){return B.apply(this,arguments)},r.fromUrls=function(e){return F.apply(this,arguments)},r.writeArrayBuffer=function(e,t){return G.apply(this,arguments)},Object.defineProperty(r,"Pool",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(r,"getDecoder",{enumerable:!0,get:function(){return _.getDecoder}}),r.rgb=r.globals=r.MultiGeoTIFF=r.default=r.GeoTIFF=void 0;var n=x(e("@babel/runtime/regenerator")),i=x(e("@babel/runtime/helpers/defineProperty")),o=x(e("@babel/runtime/helpers/slicedToArray")),a=x(e("@babel/runtime/helpers/asyncToGenerator")),s=x(e("@babel/runtime/helpers/createClass")),u=x(e("@babel/runtime/helpers/possibleConstructorReturn")),l=x(e("@babel/runtime/helpers/getPrototypeOf")),f=x(e("@babel/runtime/helpers/inherits")),c=x(e("@babel/runtime/helpers/wrapNativeSuper")),h=x(e("@babel/runtime/helpers/classCallCheck")),d=x(e("./geotiffimage")),p=x(e("./dataview64")),b=x(e("./dataslice")),y=x(e("./pool")),g=e("./source"),m=S(e("./globals"));r.globals=m;var v=e("./geotiffwriter"),w=S(e("./rgb"));r.rgb=w;var _=e("./compression");function k(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return k=function(){return e},e}function S(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=k();if(t&&t.has(e))return t.get(e);var r={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var o=n?Object.getOwnPropertyDescriptor(e,i):null;o&&(o.get||o.set)?Object.defineProperty(r,i,o):r[i]=e[i]}return r.default=e,t&&t.set(e,r),r}function x(e){return e&&e.__esModule?e:{default:e}}function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function T(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach(function(t){(0,i.default)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function O(e){switch(e){case m.fieldTypes.BYTE:case m.fieldTypes.ASCII:case m.fieldTypes.SBYTE:case m.fieldTypes.UNDEFINED:return 1;case m.fieldTypes.SHORT:case m.fieldTypes.SSHORT:return 2;case m.fieldTypes.LONG:case m.fieldTypes.SLONG:case m.fieldTypes.FLOAT:case m.fieldTypes.IFD:return 4;case m.fieldTypes.RATIONAL:case m.fieldTypes.SRATIONAL:case m.fieldTypes.DOUBLE:case m.fieldTypes.LONG8:case m.fieldTypes.SLONG8:case m.fieldTypes.IFD8:return 8;default:throw new RangeError("Invalid field type: ".concat(e))}}function C(e){var t=e.GeoKeyDirectory;if(!t)return null;for(var r={},n=4;n<=4*t[3];n+=4){var i=m.geoKeyNames[t[n]],o=t[n+1]?m.fieldTagNames[t[n+1]]:null,a=t[n+2],s=t[n+3],u=null;if(o){if(null==(u=e[o]))throw new Error("Could not get value of geoKey '".concat(i,"'."));"string"==typeof u?u=u.substring(s,s+a-1):u.subarray&&(u=u.subarray(s,s+a),1===a&&(u=u[0]))}else u=s;r[i]=u}return r}function P(e,t,r,n){var i=null,o=null,a=O(t);switch(t){case m.fieldTypes.BYTE:case m.fieldTypes.ASCII:case m.fieldTypes.UNDEFINED:i=new Uint8Array(r),o=e.readUint8;break;case m.fieldTypes.SBYTE:i=new Int8Array(r),o=e.readInt8;break;case m.fieldTypes.SHORT:i=new Uint16Array(r),o=e.readUint16;break;case m.fieldTypes.SSHORT:i=new Int16Array(r),o=e.readInt16;break;case m.fieldTypes.LONG:case m.fieldTypes.IFD:i=new Uint32Array(r),o=e.readUint32;break;case m.fieldTypes.SLONG:i=new Int32Array(r),o=e.readInt32;break;case m.fieldTypes.LONG8:case m.fieldTypes.IFD8:i=new Array(r),o=e.readUint64;break;case m.fieldTypes.SLONG8:i=new Array(r),o=e.readInt64;break;case m.fieldTypes.RATIONAL:i=new Uint32Array(2*r),o=e.readUint32;break;case m.fieldTypes.SRATIONAL:i=new Int32Array(2*r),o=e.readInt32;break;case m.fieldTypes.FLOAT:i=new Float32Array(r),o=e.readFloat32;break;case m.fieldTypes.DOUBLE:i=new Float64Array(r),o=e.readFloat64;break;default:throw new RangeError("Invalid field type: ".concat(t))}if(t!==m.fieldTypes.RATIONAL&&t!==m.fieldTypes.SRATIONAL)for(var s=0;s<r;++s)i[s]=o.call(e,n+s*a);else for(var u=0;u<r;u+=2)i[u]=o.call(e,n+u*a),i[u+1]=o.call(e,n+(u*a+4));return t===m.fieldTypes.ASCII?String.fromCharCode.apply(null,i):i}var R=function e(t,r,n){(0,h.default)(this,e),this.fileDirectory=t,this.geoKeyDirectory=r,this.nextIFDByteOffset=n},A=function(e){function t(e){var r;return(0,h.default)(this,t),(r=(0,u.default)(this,(0,l.default)(t).call(this,"No image at index ".concat(e)))).index=e,r}return(0,f.default)(t,e),t}((0,c.default)(Error)),M=function(){function e(){(0,h.default)(this,e)}return(0,s.default)(e,[{key:"readRasters",value:function(){var e=(0,a.default)(n.default.mark(function e(){var t,r,i,a,s,u,l,f,c,h,d,p,b,y,g,m,v,w,_,k,S,x,E,O,C,P,R,A,M,j,I,L,D,U,N,B,F,G,W,q=arguments;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=q.length>0&&void 0!==q[0]?q[0]:{},r=t.window,i=t.width,a=t.height,s=t.resX,u=t.resY,l=t.bbox,e.next=5,this.getImage();case 5:return f=e.sent,c=f,e.next=9,this.getImageCount();case 9:if(h=e.sent,d=f.getBoundingBox(),!r||!l){e.next=13;break}throw new Error('Both "bbox" and "window" passed.');case 13:if(!i&&!a){e.next=24;break}if(r&&(p=f.getOrigin(),b=(0,o.default)(p,2),y=b[0],g=b[1],m=f.getResolution(),v=(0,o.default)(m,2),w=v[0],_=v[1],l=[y+r[0]*w,g+r[1]*_,y+r[2]*w,g+r[3]*_]),k=l||d,!i){e.next=20;break}if(!s){e.next=19;break}throw new Error("Both width and resX passed");case 19:s=(k[2]-k[0])/i;case 20:if(!a){e.next=24;break}if(!u){e.next=23;break}throw new Error("Both width and resY passed");case 23:u=(k[3]-k[1])/a;case 24:if(!s&&!u){e.next=48;break}S=[],x=0;case 27:if(!(x<h)){e.next=36;break}return e.next=30,this.getImage(x);case 30:E=e.sent,O=E.fileDirectory,C=O.SubfileType,P=O.NewSubfileType,(0===x||2===C||1&P)&&S.push(E);case 33:++x,e.next=27;break;case 36:S.sort(function(e,t){return e.getWidth()-t.getWidth()}),R=0;case 38:if(!(R<S.length)){e.next=48;break}if(A=S[R],M=(d[2]-d[0])/A.getWidth(),j=(d[3]-d[1])/A.getHeight(),c=A,!(s&&s>M||u&&u>j)){e.next=45;break}return e.abrupt("break",48);case 45:++R,e.next=38;break;case 48:return I=r,l&&(L=f.getOrigin(),D=(0,o.default)(L,2),U=D[0],N=D[1],B=c.getResolution(f),F=(0,o.default)(B,2),G=F[0],W=F[1],I=[Math.round((l[0]-U)/G),Math.round((l[1]-N)/W),Math.round((l[2]-U)/G),Math.round((l[3]-N)/W)],I=[Math.min(I[0],I[2]),Math.min(I[1],I[3]),Math.max(I[0],I[2]),Math.max(I[1],I[3])]),e.abrupt("return",c.readRasters(T({},t,{window:I})));case 51:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()}]),e}(),j=function(e){function t(e,r,n,i){var o,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};return(0,h.default)(this,t),(o=(0,u.default)(this,(0,l.default)(t).call(this))).source=e,o.littleEndian=r,o.bigTiff=n,o.firstIFDOffset=i,o.cache=a.cache||!1,o.ifdRequests=[],o.ghostValues=null,o}return(0,f.default)(t,e),(0,s.default)(t,[{key:"getSlice",value:function(){var e=(0,a.default)(n.default.mark(function e(t,r){var i;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.bigTiff?4048:1024,e.t0=b.default,e.next=4,this.source.fetch(t,void 0!==r?r:i);case 4:return e.t1=e.sent,e.t2=t,e.t3=this.littleEndian,e.t4=this.bigTiff,e.abrupt("return",new e.t0(e.t1,e.t2,e.t3,e.t4));case 9:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"parseFileDirectoryAt",value:function(){var e=(0,a.default)(n.default.mark(function e(t){var r,i,o,a,s,u,l,f,c,h,d,p,b,y,g,v,w,_,k,S;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.bigTiff?20:12,i=this.bigTiff?8:2,e.next=4,this.getSlice(t);case 4:if(o=e.sent,a=this.bigTiff?o.readUint64(t):o.readUint16(t),s=a*r+(this.bigTiff?16:6),o.covers(t,s)){e.next=11;break}return e.next=10,this.getSlice(t,s);case 10:o=e.sent;case 11:u={},l=t+(this.bigTiff?8:2),f=0;case 14:if(!(f<a)){e.next=41;break}if(c=o.readUint16(l),h=o.readUint16(l+2),d=this.bigTiff?o.readUint64(l+4):o.readUint32(l+4),p=void 0,b=void 0,y=O(h),g=l+(this.bigTiff?12:8),!(y*d<=(this.bigTiff?8:4))){e.next=26;break}p=P(o,h,d,g),e.next=36;break;case 26:if(v=o.readOffset(g),w=O(h)*d,!o.covers(v,w)){e.next=32;break}p=P(o,h,d,v),e.next=36;break;case 32:return e.next=34,this.getSlice(v,w);case 34:_=e.sent,p=P(_,h,d,v);case 36:b=1===d&&-1===m.arrayFields.indexOf(c)&&h!==m.fieldTypes.RATIONAL&&h!==m.fieldTypes.SRATIONAL?p[0]:p,u[m.fieldTagNames[c]]=b;case 38:l+=r,++f,e.next=14;break;case 41:return k=C(u),S=o.readOffset(t+i+r*a),e.abrupt("return",new R(u,k,S));case 44:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"requestIFD",value:function(){var e=(0,a.default)(n.default.mark(function e(t){var r=this;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.ifdRequests[t]){e.next=4;break}return e.abrupt("return",this.ifdRequests[t]);case 4:if(0!==t){e.next=9;break}return this.ifdRequests[t]=this.parseFileDirectoryAt(this.firstIFDOffset),e.abrupt("return",this.ifdRequests[t]);case 9:if(this.ifdRequests[t-1]){e.next=19;break}e.prev=10,this.ifdRequests[t-1]=this.requestIFD(t-1),e.next=19;break;case 14:if(e.prev=14,e.t0=e.catch(10),!(e.t0 instanceof A)){e.next=18;break}throw new A(t);case 18:throw e.t0;case 19:return this.ifdRequests[t]=(0,a.default)(n.default.mark(function e(){var i;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.ifdRequests[t-1];case 2:if(0!==(i=e.sent).nextIFDByteOffset){e.next=5;break}throw new A(t);case 5:return e.abrupt("return",r.parseFileDirectoryAt(i.nextIFDByteOffset));case 6:case"end":return e.stop()}},e)}))(),e.abrupt("return",this.ifdRequests[t]);case 21:case"end":return e.stop()}},e,this,[[10,14]])}));return function(t){return e.apply(this,arguments)}}()},{key:"getImage",value:function(){var e=(0,a.default)(n.default.mark(function e(){var t,r,i=arguments;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]?i[0]:0,e.next=3,this.requestIFD(t);case 3:return r=e.sent,e.abrupt("return",new d.default(r.fileDirectory,r.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source));case 5:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"getImageCount",value:function(){var e=(0,a.default)(n.default.mark(function e(){var t,r;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=0,!(this.ifdRequests.length>0)){e.next=8;break}return e.next=4,this.ifdRequests[this.ifdRequests.length-1];case 4:if(0!==e.sent.nextIFDByteOffset){e.next=7;break}return e.abrupt("return",this.ifdRequests.length);case 7:t=this.ifdRequests.length;case 8:r=!0;case 9:if(!r){e.next=25;break}return e.prev=10,e.next=13,this.requestIFD(t);case 13:++t,e.next=23;break;case 16:if(e.prev=16,e.t0=e.catch(10),!(e.t0 instanceof A)){e.next=22;break}r=!1,e.next=23;break;case 22:throw e.t0;case 23:e.next=9;break;case 25:return e.abrupt("return",t);case 26:case"end":return e.stop()}},e,this,[[10,16]])}));return function(){return e.apply(this,arguments)}}()},{key:"getGhostValues",value:function(){var e=(0,a.default)(n.default.mark(function e(){var t,r,i,a,s,u,l,f,c=this;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.bigTiff?16:8,!this.ghostValues){e.next=3;break}return e.abrupt("return",this.ghostValues);case 3:return i=(r="GDAL_STRUCTURAL_METADATA_SIZE=").length+100,e.next=7,this.getSlice(t,i);case 7:if(a=e.sent,r!==P(a,m.fieldTypes.ASCII,r.length,t)){e.next=19;break}if(s=P(a,m.fieldTypes.ASCII,i,t),u=s.split("\n")[0],!((l=Number(u.split("=")[1].split(" ")[0])+u.length)>i)){e.next=16;break}return e.next=15,this.getSlice(t,l);case 15:a=e.sent;case 16:f=P(a,m.fieldTypes.ASCII,l,t),this.ghostValues={},f.split("\n").filter(function(e){return e.length>0}).map(function(e){return e.split("=")}).forEach(function(e){var t=(0,o.default)(e,2),r=t[0],n=t[1];c.ghostValues[r]=n});case 19:return e.abrupt("return",this.ghostValues);case 20:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"close",value:function(){return"function"==typeof this.source.close&&this.source.close()}}],[{key:"fromSource",value:function(){var e=(0,a.default)(n.default.mark(function e(r,i){var o,a,s,u,l,f,c;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.fetch(0,1024);case 2:if(o=e.sent,a=new p.default(o),18761!==(s=a.getUint16(0,0))){e.next=9;break}u=!0,e.next=14;break;case 9:if(19789!==s){e.next=13;break}u=!1,e.next=14;break;case 13:throw new TypeError("Invalid byte order value.");case 14:if(42!==(l=a.getUint16(2,u))){e.next=19;break}f=!1,e.next=27;break;case 19:if(43!==l){e.next=26;break}if(f=!0,8===a.getUint16(4,u)){e.next=24;break}throw new Error("Unsupported offset byte-size.");case 24:e.next=27;break;case 26:throw new TypeError("Invalid magic number.");case 27:return c=f?a.getUint64(8,u):a.getUint32(4,u),e.abrupt("return",new t(r,u,f,c,i));case 29:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}()}]),t}(M);r.GeoTIFF=j;var I=j;r.default=I;var L=function(e){function t(e,r){var n;return(0,h.default)(this,t),(n=(0,u.default)(this,(0,l.default)(t).call(this))).mainFile=e,n.overviewFiles=r,n.imageFiles=[e].concat(r),n.fileDirectoriesPerFile=null,n.fileDirectoriesPerFileParsing=null,n.imageCount=null,n}return(0,f.default)(t,e),(0,s.default)(t,[{key:"parseFileDirectoriesPerFile",value:function(){var e=(0,a.default)(n.default.mark(function e(){var t;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=[this.mainFile.parseFileDirectories()].concat(this.overviewFiles.map(function(e){return e.parseFileDirectories()})),e.next=3,Promise.all(t);case 3:return this.fileDirectoriesPerFile=e.sent,e.abrupt("return",this.fileDirectoriesPerFile);case 5:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"getImage",value:function(){var e=(0,a.default)(n.default.mark(function e(){var t,r,i,o,a,s=arguments;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=s.length>0&&void 0!==s[0]?s[0]:0,this.fileDirectoriesPerFile){e.next=6;break}return this.fileDirectoriesPerFileParsing||(this.fileDirectoriesPerFileParsing=this.parseFileDirectoriesPerFile()),e.next=5,this.fileDirectoriesPerFileParsing;case 5:this.fileDirectoriesPerFile=e.sent;case 6:r=t,i=0;case 8:if(!(i<this.fileDirectoriesPerFile.length)){e.next=17;break}if(o=this.fileDirectoriesPerFile[i],!(r<o.length)){e.next=13;break}return a=this.imageFiles[i],e.abrupt("return",new d.default(o[r][0],o[r][1],a.dataView,a.littleEndian,a.cache,a.source));case 13:r-=o.length;case 14:++i,e.next=8;break;case 17:throw new RangeError("Invalid image index");case 18:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"getImageCount",value:function(){var e=(0,a.default)(n.default.mark(function e(){return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.fileDirectoriesPerFile){e.next=5;break}return this.fileDirectoriesPerFileParsing||(this.fileDirectoriesPerFileParsing=this.parseFileDirectoriesPerFile()),e.next=4,this.fileDirectoriesPerFileParsing;case 4:this.fileDirectoriesPerFile=e.sent;case 5:return e.abrupt("return",this.fileDirectoriesPerFile.reduce(function(e,t){return e+t.length},0));case 6:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()}]),t}(M);function D(){return(D=(0,a.default)(n.default.mark(function e(t){var r,i=arguments;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.length>1&&void 0!==i[1]?i[1]:{},e.abrupt("return",j.fromSource((0,g.makeRemoteSource)(t,r)));case 2:case"end":return e.stop()}},e)}))).apply(this,arguments)}function U(){return(U=(0,a.default)(n.default.mark(function e(t){return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",j.fromSource((0,g.makeBufferSource)(t)));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function N(){return(N=(0,a.default)(n.default.mark(function e(t){return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",j.fromSource((0,g.makeFileSource)(t)));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function B(){return(B=(0,a.default)(n.default.mark(function e(t){return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",j.fromSource((0,g.makeFileReaderSource)(t)));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}function F(){return(F=(0,a.default)(n.default.mark(function e(t){var r,i,o,a,s=arguments;return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=s.length>1&&void 0!==s[1]?s[1]:[],i=s.length>2&&void 0!==s[2]?s[2]:{},e.next=4,j.fromSource((0,g.makeRemoteSource)(t,i));case 4:return o=e.sent,e.next=7,Promise.all(r.map(function(e){return j.fromSource((0,g.makeRemoteSource)(e,i))}));case 7:return a=e.sent,e.abrupt("return",new L(o,a));case 9:case"end":return e.stop()}},e)}))).apply(this,arguments)}function G(){return(G=(0,a.default)(n.default.mark(function e(t,r){return n.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,v.writeGeotiff)(t,r));case 1:case"end":return e.stop()}},e)}))).apply(this,arguments)}r.MultiGeoTIFF=L},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/defineProperty":"IxO8","@babel/runtime/helpers/slicedToArray":"HETk","@babel/runtime/helpers/asyncToGenerator":"agGE","@babel/runtime/helpers/createClass":"P8NW","@babel/runtime/helpers/possibleConstructorReturn":"pxk2","@babel/runtime/helpers/getPrototypeOf":"UJE0","@babel/runtime/helpers/inherits":"d4H2","@babel/runtime/helpers/wrapNativeSuper":"ozpi","@babel/runtime/helpers/classCallCheck":"fcMS","./geotiffimage":"eOWo","./dataview64":"dqpX","./dataslice":"dGLV","./pool":"dHPO","./source":"cUx7","./globals":"j27V","./geotiffwriter":"BGyE","./rgb":"fpBl","./compression":"FGCZ"}]},{},["bsJs"],"GeoTIFF");
|
|
142
|
-
},{}],"LtOz":[function(require,module,exports) {
|
|
143
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Water=void 0;var e=require("../../../build/three.module.js"),r=function(r,t){e.Mesh.call(this,r);var o=this,i=void 0!==(t=t||{}).textureWidth?t.textureWidth:512,a=void 0!==t.textureHeight?t.textureHeight:512,n=void 0!==t.clipBias?t.clipBias:0,l=void 0!==t.alpha?t.alpha:1,s=void 0!==t.time?t.time:0,u=void 0!==t.waterNormals?t.waterNormals:null,c=void 0!==t.sunDirection?t.sunDirection:new e.Vector3(.70707,.70707,0),m=new e.Color(void 0!==t.sunColor?t.sunColor:16777215),d=new e.Color(void 0!==t.waterColor?t.waterColor:8355711),v=void 0!==t.eye?t.eye:new e.Vector3(0,0,0),f=void 0!==t.distortionScale?t.distortionScale:20,p=void 0!==t.side?t.side:e.FrontSide,x=void 0!==t.fog&&t.fog,g=new e.Plane,w=new e.Vector3,h=new e.Vector3,y=new e.Vector3,M=new e.Matrix4,C=new e.Vector3(0,0,-1),S=new e.Vector4,_=new e.Vector3,b=new e.Vector3,D=new e.Vector4,L=new e.Matrix4,P=new e.PerspectiveCamera,W={minFilter:e.LinearFilter,magFilter:e.LinearFilter,format:e.RGBFormat,stencilBuffer:!1},N=new e.WebGLRenderTarget(i,a,W);e.MathUtils.isPowerOfTwo(i)&&e.MathUtils.isPowerOfTwo(a)||(N.texture.generateMipmaps=!1);var V={uniforms:e.UniformsUtils.merge([e.UniformsLib.fog,e.UniformsLib.lights,{normalSampler:{value:null},mirrorSampler:{value:null},alpha:{value:1},time:{value:0},size:{value:1},distortionScale:{value:20},textureMatrix:{value:new e.Matrix4},sunColor:{value:new e.Color(8355711)},sunDirection:{value:new e.Vector3(.70707,.70707,0)},eye:{value:new e.Vector3},waterColor:{value:new e.Color(5592405)}}]),vertexShader:["uniform mat4 textureMatrix;","uniform float time;","varying vec4 mirrorCoord;","varying vec4 worldPosition;","#include <common>","#include <fog_pars_vertex>","#include <shadowmap_pars_vertex>","#include <logdepthbuf_pars_vertex>","void main() {","\tmirrorCoord = modelMatrix * vec4( position, 1.0 );","\tworldPosition = mirrorCoord.xyzw;","\tmirrorCoord = textureMatrix * mirrorCoord;","\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );","\tgl_Position = projectionMatrix * mvPosition;","#include <beginnormal_vertex>","#include <defaultnormal_vertex>","#include <logdepthbuf_vertex>","#include <fog_vertex>","#include <shadowmap_vertex>","}"].join("\n"),fragmentShader:["uniform sampler2D mirrorSampler;","uniform float alpha;","uniform float time;","uniform float size;","uniform float distortionScale;","uniform sampler2D normalSampler;","uniform vec3 sunColor;","uniform vec3 sunDirection;","uniform vec3 eye;","uniform vec3 waterColor;","varying vec4 mirrorCoord;","varying vec4 worldPosition;","vec4 getNoise( vec2 uv ) {","\tvec2 uv0 = ( uv / 103.0 ) + vec2(time / 17.0, time / 29.0);","\tvec2 uv1 = uv / 107.0-vec2( time / -19.0, time / 31.0 );","\tvec2 uv2 = uv / vec2( 8907.0, 9803.0 ) + vec2( time / 101.0, time / 97.0 );","\tvec2 uv3 = uv / vec2( 1091.0, 1027.0 ) - vec2( time / 109.0, time / -113.0 );","\tvec4 noise = texture2D( normalSampler, uv0 ) +","\t\ttexture2D( normalSampler, uv1 ) +","\t\ttexture2D( normalSampler, uv2 ) +","\t\ttexture2D( normalSampler, uv3 );","\treturn noise * 0.5 - 1.0;","}","void sunLight( const vec3 surfaceNormal, const vec3 eyeDirection, float shiny, float spec, float diffuse, inout vec3 diffuseColor, inout vec3 specularColor ) {","\tvec3 reflection = normalize( reflect( -sunDirection, surfaceNormal ) );","\tfloat direction = max( 0.0, dot( eyeDirection, reflection ) );","\tspecularColor += pow( direction, shiny ) * sunColor * spec;","\tdiffuseColor += max( dot( sunDirection, surfaceNormal ), 0.0 ) * sunColor * diffuse;","}","#include <common>","#include <packing>","#include <bsdfs>","#include <fog_pars_fragment>","#include <logdepthbuf_pars_fragment>","#include <lights_pars_begin>","#include <shadowmap_pars_fragment>","#include <shadowmask_pars_fragment>","void main() {","#include <logdepthbuf_fragment>","\tvec4 noise = getNoise( worldPosition.xz * size );","\tvec3 surfaceNormal = normalize( noise.xzy * vec3( 1.5, 1.0, 1.5 ) );","\tvec3 diffuseLight = vec3(0.0);","\tvec3 specularLight = vec3(0.0);","\tvec3 worldToEye = eye-worldPosition.xyz;","\tvec3 eyeDirection = normalize( worldToEye );","\tsunLight( surfaceNormal, eyeDirection, 100.0, 2.0, 0.5, diffuseLight, specularLight );","\tfloat distance = length(worldToEye);","\tvec2 distortion = surfaceNormal.xz * ( 0.001 + 1.0 / distance ) * distortionScale;","\tvec3 reflectionSample = vec3( texture2D( mirrorSampler, mirrorCoord.xy / mirrorCoord.w + distortion ) );","\tfloat theta = max( dot( eyeDirection, surfaceNormal ), 0.0 );","\tfloat rf0 = 0.3;","\tfloat reflectance = rf0 + ( 1.0 - rf0 ) * pow( ( 1.0 - theta ), 5.0 );","\tvec3 scatter = max( 0.0, dot( surfaceNormal, eyeDirection ) ) * waterColor;","\tvec3 albedo = mix( ( sunColor * diffuseLight * 0.3 + scatter ) * getShadowMask(), ( vec3( 0.1 ) + reflectionSample * 0.9 + reflectionSample * specularLight ), reflectance);","\tvec3 outgoingLight = albedo;","\tgl_FragColor = vec4( outgoingLight, alpha );","#include <tonemapping_fragment>","#include <fog_fragment>","}"].join("\n")},z=new e.ShaderMaterial({fragmentShader:V.fragmentShader,vertexShader:V.vertexShader,uniforms:e.UniformsUtils.clone(V.uniforms),lights:!0,side:p,fog:x});z.uniforms.mirrorSampler.value=N.texture,z.uniforms.textureMatrix.value=L,z.uniforms.alpha.value=l,z.uniforms.time.value=s,z.uniforms.normalSampler.value=u,z.uniforms.sunColor.value=m,z.uniforms.waterColor.value=d,z.uniforms.sunDirection.value=c,z.uniforms.distortionScale.value=f,z.uniforms.eye.value=v,o.material=z,o.onBeforeRender=function(r,t,i){if(h.setFromMatrixPosition(o.matrixWorld),y.setFromMatrixPosition(i.matrixWorld),M.extractRotation(o.matrixWorld),w.set(0,0,1),w.applyMatrix4(M),_.subVectors(h,y),!(_.dot(w)>0)){_.reflect(w).negate(),_.add(h),M.extractRotation(i.matrixWorld),C.set(0,0,-1),C.applyMatrix4(M),C.add(y),b.subVectors(h,C),b.reflect(w).negate(),b.add(h),P.position.copy(_),P.up.set(0,1,0),P.up.applyMatrix4(M),P.up.reflect(w),P.lookAt(b),P.far=i.far,P.updateMatrixWorld(),P.projectionMatrix.copy(i.projectionMatrix),L.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),L.multiply(P.projectionMatrix),L.multiply(P.matrixWorldInverse),g.setFromNormalAndCoplanarPoint(w,h),g.applyMatrix4(P.matrixWorldInverse),S.set(g.normal.x,g.normal.y,g.normal.z,g.constant);var a=P.projectionMatrix;if(D.x=(Math.sign(S.x)+a.elements[8])/a.elements[0],D.y=(Math.sign(S.y)+a.elements[9])/a.elements[5],D.z=-1,D.w=(1+a.elements[10])/a.elements[14],S.multiplyScalar(2/S.dot(D)),a.elements[2]=S.x,a.elements[6]=S.y,a.elements[10]=S.z+1-n,a.elements[14]=S.w,v.setFromMatrixPosition(i.matrixWorld),r.outputEncoding!==e.LinearEncoding)return console.warn("THREE.Water: WebGLRenderer must use LinearEncoding as outputEncoding."),void(o.onBeforeRender=function(){});if(r.toneMapping!==e.NoToneMapping)return console.warn("THREE.Water: WebGLRenderer must use NoToneMapping as toneMapping."),void(o.onBeforeRender=function(){});var l=r.getRenderTarget(),s=r.xr.enabled,u=r.shadowMap.autoUpdate;o.visible=!1,r.xr.enabled=!1,r.shadowMap.autoUpdate=!1,r.setRenderTarget(N),r.state.buffers.depth.setMask(!0),!1===r.autoClear&&r.clear(),r.render(t,P),o.visible=!0,r.xr.enabled=s,r.shadowMap.autoUpdate=u,r.setRenderTarget(l);var c=i.viewport;void 0!==c&&r.state.viewport(c)}}};exports.Water=r,r.prototype=Object.create(e.Mesh.prototype),r.prototype.constructor=r;
|
|
144
|
-
},{"../../../build/three.module.js":"dKqR"}],"iowQ":[function(require,module,exports) {
|
|
145
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Terrain=void 0;var e=s(require("../utils/third/geotiff")),t=s(require("three")),r=require("../coordinate/Coordinate"),o=i(require("../materials/CUBE_Material")),a=require("three/examples/jsm/objects/Water"),n=require("./Layer");function i(e){return e&&e.__esModule?e:{default:e}}function l(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return l=function(){return e},e}function s(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=l();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var n=o?Object.getOwnPropertyDescriptor(e,a):null;n&&(n.get||n.set)?Object.defineProperty(r,a,n):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}class u{constructor(e){this.geometry=null,this.layer=new n.Layer(e)}Ground(e=20,r=20,a=32){const n=new t.PlaneBufferGeometry(e,r,a);n.rotateX(Math.PI/2),n.rotateZ(Math.PI);const i=new t.Mesh(n,(new o.default).Ground());return this.layer.Add(i),this.layer.Layer()}WaterGround(e=20,r=20,n=32){const i=new t.Light("#ffffff",.5);i.position.set(0,4,0);const l=(new o.default).GeoWater(i,!0),s=new t.PlaneBufferGeometry(e,r,n);s.rotateX(Math.PI/2),s.rotateZ(Math.PI);const u=new a.Water(s,l);return this.layer.Add(u),this.layer.Layer()}async GeoTiff(a,n=30,i={},l){const s=await e.fromArrayBuffer(a),u=await s.getImage(),d=u.getBoundingBox(),f={longitude:d[0],latitude:d[1]},c={longitude:d[2],latitude:d[3]},h=new r.Coordinate("GPS",f).ComputeWorldCoordinate(),y=new r.Coordinate("GPS",c).ComputeWorldCoordinate(),w=Math.abs(h.world.x-y.world.x),p=Math.abs(h.world.z-y.world.z),M=new t.PlaneGeometry(w,p,w-1,p-1),P=await u.readRasters({width:Math.floor(w),height:Math.floor(p),resampleMethod:"bilinear",interleave:!0});for(let e=0;e<P.length;e++){const t=P[e];M.vertices[e]&&(M.vertices[e].z=t/n)}M.rotateX(Math.PI/2),M.rotateY(Math.PI),M.rotateZ(Math.PI);const g=i.color?i.color:10066329;this.mat_terrain=l||(new o.default).Terrain({color:g,side:t.DoubleSide,wireframe:!0});const m=new t.Mesh(M,this.mat_terrain);return this.layer.Add(m),this.layer.Layer()}}exports.Terrain=u;
|
|
146
|
-
},{"../utils/third/geotiff":"hLzV","three":"dKqR","../coordinate/Coordinate":"tKb1","../materials/CUBE_Material":"E9Yg","three/examples/jsm/objects/Water":"LtOz","./Layer":"oe7K"}],"O6i0":[function(require,module,exports) {
|
|
147
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GLTFLoader=void 0;var e=require("../../../build/three.module.js"),t=function(){function t(t){e.Loader.call(this,t),this.dracoLoader=null,this.ddsLoader=null,this.ktx2Loader=null,this.pluginCallbacks=[],this.register(function(e){return new o(e)}),this.register(function(e){return new u(e)}),this.register(function(e){return new l(e)})}function r(){var e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}t.prototype=Object.assign(Object.create(e.Loader.prototype),{constructor:t,load:function(t,r,a,s){var n,i=this;n=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:e.LoaderUtils.extractUrlBase(t),i.manager.itemStart(t);var o=function(e){s?s(e):console.error(e),i.manager.itemError(t),i.manager.itemEnd(t)},l=new e.FileLoader(i.manager);l.setPath(this.path),l.setResponseType("arraybuffer"),l.setRequestHeader(this.requestHeader),"use-credentials"===i.crossOrigin&&l.setWithCredentials(!0),l.load(t,function(e){try{i.parse(e,n,function(e){r(e),i.manager.itemEnd(t)},o)}catch(a){o(a)}},a,o)},setDRACOLoader:function(e){return this.dracoLoader=e,this},setDDSLoader:function(e){return this.ddsLoader=e,this},setKTX2Loader:function(e){return this.ktx2Loader=e,this},register:function(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this},unregister:function(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this},parse:function(t,r,o,l){var u,p={},h={};if("string"==typeof t)u=t;else if(e.LoaderUtils.decodeText(new Uint8Array(t,0,4))===c){try{p[a.KHR_BINARY_GLTF]=new d(t)}catch(L){return void(l&&l(L))}u=p[a.KHR_BINARY_GLTF].content}else u=e.LoaderUtils.decodeText(new Uint8Array(t));var g=JSON.parse(u);if(void 0===g.asset||g.asset.version[0]<2)l&&l(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{var M=new j(g,{path:r||this.resourcePath||"",crossOrigin:this.crossOrigin,manager:this.manager,ktx2Loader:this.ktx2Loader});M.fileLoader.setRequestHeader(this.requestHeader);for(var y=0;y<this.pluginCallbacks.length;y++){var S=this.pluginCallbacks[y](M);h[S.name]=S,p[S.name]=!0}if(g.extensionsUsed)for(y=0;y<g.extensionsUsed.length;++y){var x=g.extensionsUsed[y],R=g.extensionsRequired||[];switch(x){case a.KHR_LIGHTS_PUNCTUAL:p[x]=new n(g);break;case a.KHR_MATERIALS_UNLIT:p[x]=new i;break;case a.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:p[x]=new v;break;case a.KHR_DRACO_MESH_COMPRESSION:p[x]=new f(g,this.dracoLoader);break;case a.MSFT_TEXTURE_DDS:p[x]=new s(this.ddsLoader);break;case a.KHR_TEXTURE_TRANSFORM:p[x]=new m;break;case a.KHR_MESH_QUANTIZATION:p[x]=new T;break;default:R.indexOf(x)>=0&&void 0===h[x]&&console.warn('THREE.GLTFLoader: Unknown extension "'+x+'".')}}M.setExtensions(p),M.setPlugins(h),M.parse(o,l)}}});var a={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:"KHR_materials_pbrSpecularGlossiness",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",MSFT_TEXTURE_DDS:"MSFT_texture_dds"};function s(e){if(!e)throw new Error("THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader");this.name=a.MSFT_TEXTURE_DDS,this.ddsLoader=e}function n(e){this.name=a.KHR_LIGHTS_PUNCTUAL;var t=e.extensions&&e.extensions[a.KHR_LIGHTS_PUNCTUAL]||{};this.lightDefs=t.lights||[]}function i(){this.name=a.KHR_MATERIALS_UNLIT}function o(e){this.parser=e,this.name=a.KHR_MATERIALS_CLEARCOAT}function l(e){this.parser=e,this.name=a.KHR_MATERIALS_TRANSMISSION}function u(e){this.parser=e,this.name=a.KHR_TEXTURE_BASISU}n.prototype.loadLight=function(t){var r,a=this.lightDefs[t],s=new e.Color(16777215);void 0!==a.color&&s.fromArray(a.color);var n=void 0!==a.range?a.range:0;switch(a.type){case"directional":(r=new e.DirectionalLight(s)).target.position.set(0,0,-1),r.add(r.target);break;case"point":(r=new e.PointLight(s)).distance=n;break;case"spot":(r=new e.SpotLight(s)).distance=n,a.spot=a.spot||{},a.spot.innerConeAngle=void 0!==a.spot.innerConeAngle?a.spot.innerConeAngle:0,a.spot.outerConeAngle=void 0!==a.spot.outerConeAngle?a.spot.outerConeAngle:Math.PI/4,r.angle=a.spot.outerConeAngle,r.penumbra=1-a.spot.innerConeAngle/a.spot.outerConeAngle,r.target.position.set(0,0,-1),r.add(r.target);break;default:throw new Error('THREE.GLTFLoader: Unexpected light type, "'+a.type+'".')}return r.position.set(0,0,0),r.decay=2,void 0!==a.intensity&&(r.intensity=a.intensity),r.name=a.name||"light_"+t,Promise.resolve(r)},i.prototype.getMaterialType=function(){return e.MeshBasicMaterial},i.prototype.extendParams=function(t,r,a){var s=[];t.color=new e.Color(1,1,1),t.opacity=1;var n=r.pbrMetallicRoughness;if(n){if(Array.isArray(n.baseColorFactor)){var i=n.baseColorFactor;t.color.fromArray(i),t.opacity=i[3]}void 0!==n.baseColorTexture&&s.push(a.assignTexture(t,"map",n.baseColorTexture))}return Promise.all(s)},o.prototype.getMaterialType=function(){return e.MeshPhysicalMaterial},o.prototype.extendMaterialParams=function(t,r){var a=this.parser,s=a.json.materials[t];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();var n=[],i=s.extensions[this.name];if(void 0!==i.clearcoatFactor&&(r.clearcoat=i.clearcoatFactor),void 0!==i.clearcoatTexture&&n.push(a.assignTexture(r,"clearcoatMap",i.clearcoatTexture)),void 0!==i.clearcoatRoughnessFactor&&(r.clearcoatRoughness=i.clearcoatRoughnessFactor),void 0!==i.clearcoatRoughnessTexture&&n.push(a.assignTexture(r,"clearcoatRoughnessMap",i.clearcoatRoughnessTexture)),void 0!==i.clearcoatNormalTexture&&(n.push(a.assignTexture(r,"clearcoatNormalMap",i.clearcoatNormalTexture)),void 0!==i.clearcoatNormalTexture.scale)){var o=i.clearcoatNormalTexture.scale;r.clearcoatNormalScale=new e.Vector2(o,o)}return Promise.all(n)},l.prototype.getMaterialType=function(){return e.MeshPhysicalMaterial},l.prototype.extendMaterialParams=function(e,t){var r=this.parser,a=r.json.materials[e];if(!a.extensions||!a.extensions[this.name])return Promise.resolve();var s=[],n=a.extensions[this.name];return void 0!==n.transmissionFactor&&(t.transmission=n.transmissionFactor),void 0!==n.transmissionTexture&&s.push(r.assignTexture(t,"transmissionMap",n.transmissionTexture)),Promise.all(s)},u.prototype.loadTexture=function(e){var t=this.parser,r=t.json,a=r.textures[e];if(!a.extensions||!a.extensions[this.name])return null;var s=a.extensions[this.name],n=r.images[s.source],i=t.options.ktx2Loader;if(!i)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return t.loadTextureImage(e,n,i)};var c="glTF",p=12,h={JSON:1313821514,BIN:5130562};function d(t){this.name=a.KHR_BINARY_GLTF,this.content=null,this.body=null;var r=new DataView(t,0,p);if(this.header={magic:e.LoaderUtils.decodeText(new Uint8Array(t.slice(0,4))),version:r.getUint32(4,!0),length:r.getUint32(8,!0)},this.header.magic!==c)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var s=new DataView(t,p),n=0;n<s.byteLength;){var i=s.getUint32(n,!0);n+=4;var o=s.getUint32(n,!0);if(n+=4,o===h.JSON){var l=new Uint8Array(t,p+n,i);this.content=e.LoaderUtils.decodeText(l)}else if(o===h.BIN){var u=p+n;this.body=t.slice(u,u+i)}n+=i}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")}function f(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=a.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}function m(){this.name=a.KHR_TEXTURE_TRANSFORM}function g(t){e.MeshStandardMaterial.call(this),this.isGLTFSpecularGlossinessMaterial=!0;var r=["#ifdef USE_SPECULARMAP","\tuniform sampler2D specularMap;","#endif"].join("\n"),a=["#ifdef USE_GLOSSINESSMAP","\tuniform sampler2D glossinessMap;","#endif"].join("\n"),s=["vec3 specularFactor = specular;","#ifdef USE_SPECULARMAP","\tvec4 texelSpecular = texture2D( specularMap, vUv );","\ttexelSpecular = sRGBToLinear( texelSpecular );","\t// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture","\tspecularFactor *= texelSpecular.rgb;","#endif"].join("\n"),n=["float glossinessFactor = glossiness;","#ifdef USE_GLOSSINESSMAP","\tvec4 texelGlossiness = texture2D( glossinessMap, vUv );","\t// reads channel A, compatible with a glTF Specular-Glossiness (RGBA) texture","\tglossinessFactor *= texelGlossiness.a;","#endif"].join("\n"),i=["PhysicalMaterial material;","material.diffuseColor = diffuseColor.rgb;","vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );","float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );","material.specularRoughness = max( 1.0 - glossinessFactor, 0.0525 );// 0.0525 corresponds to the base mip of a 256 cubemap.","material.specularRoughness += geometryRoughness;","material.specularRoughness = min( material.specularRoughness, 1.0 );","material.specularColor = specularFactor.rgb;"].join("\n"),o={specular:{value:(new e.Color).setHex(16777215)},glossiness:{value:1},specularMap:{value:null},glossinessMap:{value:null}};this._extraUniforms=o,this.onBeforeCompile=function(e){for(var t in o)e.uniforms[t]=o[t];e.fragmentShader=e.fragmentShader.replace("uniform float roughness;","uniform vec3 specular;"),e.fragmentShader=e.fragmentShader.replace("uniform float metalness;","uniform float glossiness;"),e.fragmentShader=e.fragmentShader.replace("#include <roughnessmap_pars_fragment>",r),e.fragmentShader=e.fragmentShader.replace("#include <metalnessmap_pars_fragment>",a),e.fragmentShader=e.fragmentShader.replace("#include <roughnessmap_fragment>",s),e.fragmentShader=e.fragmentShader.replace("#include <metalnessmap_fragment>",n),e.fragmentShader=e.fragmentShader.replace("#include <lights_physical_fragment>",i)},Object.defineProperties(this,{specular:{get:function(){return o.specular.value},set:function(e){o.specular.value=e}},specularMap:{get:function(){return o.specularMap.value},set:function(e){o.specularMap.value=e}},glossiness:{get:function(){return o.glossiness.value},set:function(e){o.glossiness.value=e}},glossinessMap:{get:function(){return o.glossinessMap.value},set:function(e){o.glossinessMap.value=e,e?(this.defines.USE_GLOSSINESSMAP="",this.defines.USE_ROUGHNESSMAP=""):(delete this.defines.USE_ROUGHNESSMAP,delete this.defines.USE_GLOSSINESSMAP)}}}),delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this.setValues(t)}function v(){return{name:a.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS,specularGlossinessParams:["color","map","lightMap","lightMapIntensity","aoMap","aoMapIntensity","emissive","emissiveIntensity","emissiveMap","bumpMap","bumpScale","normalMap","normalMapType","displacementMap","displacementScale","displacementBias","specularMap","specular","glossinessMap","glossiness","alphaMap","envMap","envMapIntensity","refractionRatio"],getMaterialType:function(){return g},extendParams:function(t,r,a){var s=r.extensions[this.name];t.color=new e.Color(1,1,1),t.opacity=1;var n=[];if(Array.isArray(s.diffuseFactor)){var i=s.diffuseFactor;t.color.fromArray(i),t.opacity=i[3]}if(void 0!==s.diffuseTexture&&n.push(a.assignTexture(t,"map",s.diffuseTexture)),t.emissive=new e.Color(0,0,0),t.glossiness=void 0!==s.glossinessFactor?s.glossinessFactor:1,t.specular=new e.Color(1,1,1),Array.isArray(s.specularFactor)&&t.specular.fromArray(s.specularFactor),void 0!==s.specularGlossinessTexture){var o=s.specularGlossinessTexture;n.push(a.assignTexture(t,"glossinessMap",o)),n.push(a.assignTexture(t,"specularMap",o))}return Promise.all(n)},createMaterial:function(t){var r=new g(t);return r.fog=!0,r.color=t.color,r.map=void 0===t.map?null:t.map,r.lightMap=null,r.lightMapIntensity=1,r.aoMap=void 0===t.aoMap?null:t.aoMap,r.aoMapIntensity=1,r.emissive=t.emissive,r.emissiveIntensity=1,r.emissiveMap=void 0===t.emissiveMap?null:t.emissiveMap,r.bumpMap=void 0===t.bumpMap?null:t.bumpMap,r.bumpScale=1,r.normalMap=void 0===t.normalMap?null:t.normalMap,r.normalMapType=e.TangentSpaceNormalMap,t.normalScale&&(r.normalScale=t.normalScale),r.displacementMap=null,r.displacementScale=1,r.displacementBias=0,r.specularMap=void 0===t.specularMap?null:t.specularMap,r.specular=t.specular,r.glossinessMap=void 0===t.glossinessMap?null:t.glossinessMap,r.glossiness=t.glossiness,r.alphaMap=null,r.envMap=void 0===t.envMap?null:t.envMap,r.envMapIntensity=1,r.refractionRatio=.98,r}}}function T(){this.name=a.KHR_MESH_QUANTIZATION}function M(t,r,a,s){e.Interpolant.call(this,t,r,a,s)}f.prototype.decodePrimitive=function(e,t){var r=this.json,a=this.dracoLoader,s=e.extensions[this.name].bufferView,n=e.extensions[this.name].attributes,i={},o={},l={};for(var u in n){var c=C[u]||u.toLowerCase();i[c]=n[u]}for(u in e.attributes){c=C[u]||u.toLowerCase();if(void 0!==n[u]){var p=r.accessors[e.attributes[u]],h=A[p.componentType];l[c]=h,o[c]=!0===p.normalized}}return t.getDependency("bufferView",s).then(function(e){return new Promise(function(t){a.decodeDracoFile(e,function(e){for(var r in e.attributes){var a=e.attributes[r],s=o[r];void 0!==s&&(a.normalized=s)}t(e)},i,l)})})},m.prototype.extendTexture=function(e,t){return e=e.clone(),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),void 0!==t.texCoord&&console.warn('THREE.GLTFLoader: Custom UV sets in "'+this.name+'" extension not yet supported.'),e.needsUpdate=!0,e},g.prototype=Object.create(e.MeshStandardMaterial.prototype),g.prototype.constructor=g,g.prototype.copy=function(t){return e.MeshStandardMaterial.prototype.copy.call(this,t),this.specularMap=t.specularMap,this.specular.copy(t.specular),this.glossinessMap=t.glossinessMap,this.glossiness=t.glossiness,delete this.metalness,delete this.roughness,delete this.metalnessMap,delete this.roughnessMap,this},M.prototype=Object.create(e.Interpolant.prototype),M.prototype.constructor=M,M.prototype.copySampleValue_=function(e){for(var t=this.resultBuffer,r=this.sampleValues,a=this.valueSize,s=e*a*3+a,n=0;n!==a;n++)t[n]=r[s+n];return t},M.prototype.beforeStart_=M.prototype.copySampleValue_,M.prototype.afterEnd_=M.prototype.copySampleValue_,M.prototype.interpolate_=function(e,t,r,a){for(var s=this.resultBuffer,n=this.sampleValues,i=this.valueSize,o=2*i,l=3*i,u=a-t,c=(r-t)/u,p=c*c,h=p*c,d=e*l,f=d-l,m=-2*h+3*p,g=h-p,v=1-m,T=g-p+c,M=0;M!==i;M++){var y=n[f+M+i],S=n[f+M+o]*u,x=n[d+M+i],R=n[d+M]*u;s[M]=v*y+T*S+m*x+g*R}return s};var y=0,S=1,x=2,R=3,L=4,_=5,E=6,A={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},w={9728:e.NearestFilter,9729:e.LinearFilter,9984:e.NearestMipmapNearestFilter,9985:e.LinearMipmapNearestFilter,9986:e.NearestMipmapLinearFilter,9987:e.LinearMipmapLinearFilter},b={33071:e.ClampToEdgeWrapping,33648:e.MirroredRepeatWrapping,10497:e.RepeatWrapping},I={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},C={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv2",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},P={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},N={CUBICSPLINE:void 0,LINEAR:e.InterpolateLinear,STEP:e.InterpolateDiscrete},O="OPAQUE",F="MASK",H="BLEND",U={"image/png":e.RGBAFormat,"image/jpeg":e.RGBFormat};function D(e,t){return"string"!=typeof e||""===e?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)?e:/^data:.*,.*$/i.test(e)?e:/^blob:.*$/i.test(e)?e:t+e)}function G(e,t,r){for(var a in r.extensions)void 0===e[a]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[a]=r.extensions[a])}function k(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function B(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var r=0,a=t.weights.length;r<a;r++)e.morphTargetInfluences[r]=t.weights[r];if(t.extras&&Array.isArray(t.extras.targetNames)){var s=t.extras.targetNames;if(e.morphTargetInfluences.length===s.length){e.morphTargetDictionary={};for(r=0,a=s.length;r<a;r++)e.morphTargetDictionary[s[r]]=r}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function K(e){for(var t="",r=Object.keys(e).sort(),a=0,s=r.length;a<s;a++)t+=r[a]+":"+e[r[a]]+";";return t}function j(t,a){this.json=t||{},this.extensions={},this.plugins={},this.options=a||{},this.cache=new r,this.associations=new Map,this.primitiveCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},"undefined"!=typeof createImageBitmap&&!1===/Firefox/.test(navigator.userAgent)?this.textureLoader=new e.ImageBitmapLoader(this.options.manager):this.textureLoader=new e.TextureLoader(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.fileLoader=new e.FileLoader(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}function V(t,r,a){var s=r.attributes,n=[];function i(e,r){return a.getDependency("accessor",e).then(function(e){t.setAttribute(r,e)})}for(var o in s){var l=C[o]||o.toLowerCase();l in t.attributes||n.push(i(s[o],l))}if(void 0!==r.indices&&!t.index){var u=a.getDependency("accessor",r.indices).then(function(e){t.setIndex(e)});n.push(u)}return k(t,r),function(t,r,a){var s=r.attributes,n=new e.Box3;if(void 0!==s.POSITION){var i=(d=a.json.accessors[s.POSITION]).min,o=d.max;if(void 0!==i&&void 0!==o){n.set(new e.Vector3(i[0],i[1],i[2]),new e.Vector3(o[0],o[1],o[2]));var l=r.targets;if(void 0!==l){for(var u=new e.Vector3,c=new e.Vector3,p=0,h=l.length;p<h;p++){var d,f=l[p];if(void 0!==f.POSITION)i=(d=a.json.accessors[f.POSITION]).min,o=d.max,void 0!==i&&void 0!==o?(c.setX(Math.max(Math.abs(i[0]),Math.abs(o[0]))),c.setY(Math.max(Math.abs(i[1]),Math.abs(o[1]))),c.setZ(Math.max(Math.abs(i[2]),Math.abs(o[2]))),u.max(c)):console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}n.expandByVector(u)}t.boundingBox=n;var m=new e.Sphere;n.getCenter(m.center),m.radius=n.min.distanceTo(n.max)/2,t.boundingSphere=m}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}(t,r,a),Promise.all(n).then(function(){return void 0!==r.targets?function(e,t,r){for(var a=!1,s=!1,n=0,i=t.length;n<i&&(void 0!==(u=t[n]).POSITION&&(a=!0),void 0!==u.NORMAL&&(s=!0),!a||!s);n++);if(!a&&!s)return Promise.resolve(e);var o=[],l=[];for(n=0,i=t.length;n<i;n++){var u=t[n];if(a){var c=void 0!==u.POSITION?r.getDependency("accessor",u.POSITION):e.attributes.position;o.push(c)}s&&(c=void 0!==u.NORMAL?r.getDependency("accessor",u.NORMAL):e.attributes.normal,l.push(c))}return Promise.all([Promise.all(o),Promise.all(l)]).then(function(t){var r=t[0],n=t[1];return a&&(e.morphAttributes.position=r),s&&(e.morphAttributes.normal=n),e.morphTargetsRelative=!0,e})}(t,r.targets,a):t})}function X(t,r){var a=t.getIndex();if(null===a){var s=[],n=t.getAttribute("position");if(void 0===n)return console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),t;for(var i=0;i<n.count;i++)s.push(i);t.setIndex(s),a=t.getIndex()}var o=a.count-2,l=[];if(r===e.TriangleFanDrawMode)for(i=1;i<=o;i++)l.push(a.getX(0)),l.push(a.getX(i)),l.push(a.getX(i+1));else for(i=0;i<o;i++)i%2==0?(l.push(a.getX(i)),l.push(a.getX(i+1)),l.push(a.getX(i+2))):(l.push(a.getX(i+2)),l.push(a.getX(i+1)),l.push(a.getX(i)));l.length/3!==o&&console.error("THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var u=t.clone();return u.setIndex(l),u}return j.prototype.setExtensions=function(e){this.extensions=e},j.prototype.setPlugins=function(e){this.plugins=e},j.prototype.parse=function(e,t){var r=this,a=this.json,s=this.extensions;this.cache.removeAll(),this._markDefs(),Promise.all([this.getDependencies("scene"),this.getDependencies("animation"),this.getDependencies("camera")]).then(function(t){var n={scene:t[0][a.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:a.asset,parser:r,userData:{}};G(s,n,a),k(n,a),e(n)}).catch(t)},j.prototype._markDefs=function(){for(var e=this.json.nodes||[],t=this.json.skins||[],r=this.json.meshes||[],s=0,n=t.length;s<n;s++)for(var i=t[s].joints,o=0,l=i.length;o<l;o++)e[i[o]].isBone=!0;for(var u=0,c=e.length;u<c;u++){var p=e[u];void 0!==p.mesh&&(this._addNodeRef(this.meshCache,p.mesh),void 0!==p.skin&&(r[p.mesh].isSkinnedMesh=!0)),void 0!==p.camera&&this._addNodeRef(this.cameraCache,p.camera),p.extensions&&p.extensions[a.KHR_LIGHTS_PUNCTUAL]&&void 0!==p.extensions[a.KHR_LIGHTS_PUNCTUAL].light&&this._addNodeRef(this.lightCache,p.extensions[a.KHR_LIGHTS_PUNCTUAL].light)}},j.prototype._addNodeRef=function(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)},j.prototype._getNodeRef=function(e,t,r){if(e.refs[t]<=1)return r;var a=r.clone();return a.name+="_instance_"+e.uses[t]++,a},j.prototype._invokeOne=function(e){var t=Object.values(this.plugins);t.push(this);for(var r=0;r<t.length;r++){var a=e(t[r]);if(a)return a}},j.prototype._invokeAll=function(e){var t=Object.values(this.plugins);t.unshift(this);for(var r=[],a=0;a<t.length;a++)r.push(e(t[a]));return Promise.all(r)},j.prototype.getDependency=function(e,t){var r=e+":"+t,s=this.cache.get(r);if(!s){switch(e){case"scene":s=this.loadScene(t);break;case"node":s=this.loadNode(t);break;case"mesh":s=this._invokeOne(function(e){return e.loadMesh&&e.loadMesh(t)});break;case"accessor":s=this.loadAccessor(t);break;case"bufferView":s=this._invokeOne(function(e){return e.loadBufferView&&e.loadBufferView(t)});break;case"buffer":s=this.loadBuffer(t);break;case"material":s=this._invokeOne(function(e){return e.loadMaterial&&e.loadMaterial(t)});break;case"texture":s=this._invokeOne(function(e){return e.loadTexture&&e.loadTexture(t)});break;case"skin":s=this.loadSkin(t);break;case"animation":s=this.loadAnimation(t);break;case"camera":s=this.loadCamera(t);break;case"light":s=this.extensions[a.KHR_LIGHTS_PUNCTUAL].loadLight(t);break;default:throw new Error("Unknown type: "+e)}this.cache.add(r,s)}return s},j.prototype.getDependencies=function(e){var t=this.cache.get(e);if(!t){var r=this,a=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(a.map(function(t,a){return r.getDependency(e,a)})),this.cache.add(e,t)}return t},j.prototype.loadBuffer=function(e){var t=this.json.buffers[e],r=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[a.KHR_BINARY_GLTF].body);var s=this.options;return new Promise(function(e,a){r.load(D(t.uri,s.path),e,void 0,function(){a(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})},j.prototype.loadBufferView=function(e){var t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(e){var r=t.byteLength||0,a=t.byteOffset||0;return e.slice(a,a+r)})},j.prototype.loadAccessor=function(t){var r=this,a=this.json,s=this.json.accessors[t];if(void 0===s.bufferView&&void 0===s.sparse)return Promise.resolve(null);var n=[];return void 0!==s.bufferView?n.push(this.getDependency("bufferView",s.bufferView)):n.push(null),void 0!==s.sparse&&(n.push(this.getDependency("bufferView",s.sparse.indices.bufferView)),n.push(this.getDependency("bufferView",s.sparse.values.bufferView))),Promise.all(n).then(function(t){var n,i,o=t[0],l=I[s.type],u=A[s.componentType],c=u.BYTES_PER_ELEMENT,p=c*l,h=s.byteOffset||0,d=void 0!==s.bufferView?a.bufferViews[s.bufferView].byteStride:void 0,f=!0===s.normalized;if(d&&d!==p){var m=Math.floor(h/d),g="InterleavedBuffer:"+s.bufferView+":"+s.componentType+":"+m+":"+s.count,v=r.cache.get(g);v||(n=new u(o,m*d,s.count*d/c),v=new e.InterleavedBuffer(n,d/c),r.cache.add(g,v)),i=new e.InterleavedBufferAttribute(v,l,h%d/c,f)}else n=null===o?new u(s.count*l):new u(o,h,s.count*l),i=new e.BufferAttribute(n,l,f);if(void 0!==s.sparse){var T=I.SCALAR,M=A[s.sparse.indices.componentType],y=s.sparse.indices.byteOffset||0,S=s.sparse.values.byteOffset||0,x=new M(t[1],y,s.sparse.count*T),R=new u(t[2],S,s.sparse.count*l);null!==o&&(i=new e.BufferAttribute(i.array.slice(),i.itemSize,i.normalized));for(var L=0,_=x.length;L<_;L++){var E=x[L];if(i.setX(E,R[L*l]),l>=2&&i.setY(E,R[L*l+1]),l>=3&&i.setZ(E,R[L*l+2]),l>=4&&i.setW(E,R[L*l+3]),l>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return i})},j.prototype.loadTexture=function(e){var t,r,s=this.json,n=this.options,i=s.textures[e],o=i.extensions||{};return(t=o[a.MSFT_TEXTURE_DDS]?s.images[o[a.MSFT_TEXTURE_DDS].source]:s.images[i.source]).uri&&(r=n.manager.getHandler(t.uri)),r||(r=o[a.MSFT_TEXTURE_DDS]?this.extensions[a.MSFT_TEXTURE_DDS].ddsLoader:this.textureLoader),this.loadTextureImage(e,t,r)},j.prototype.loadTextureImage=function(t,r,a){var s=this,n=this.json,i=this.options,o=n.textures[t],l=self.URL||self.webkitURL,u=r.uri,c=!1;return void 0!==r.bufferView&&(u=s.getDependency("bufferView",r.bufferView).then(function(e){c=!0;var t=new Blob([e],{type:r.mimeType});return u=l.createObjectURL(t)})),Promise.resolve(u).then(function(t){return new Promise(function(r,s){var n=r;!0===a.isImageBitmapLoader&&(n=function(t){r(new e.CanvasTexture(t))}),a.load(D(t,i.path),n,void 0,s)})}).then(function(a){!0===c&&l.revokeObjectURL(u),a.flipY=!1,o.name&&(a.name=o.name),r.mimeType in U&&(a.format=U[r.mimeType]);var i=(n.samplers||{})[o.sampler]||{};return a.magFilter=w[i.magFilter]||e.LinearFilter,a.minFilter=w[i.minFilter]||e.LinearMipmapLinearFilter,a.wrapS=b[i.wrapS]||e.RepeatWrapping,a.wrapT=b[i.wrapT]||e.RepeatWrapping,s.associations.set(a,{type:"textures",index:t}),a})},j.prototype.assignTexture=function(t,r,s){var n=this;return this.getDependency("texture",s.index).then(function(i){if(!i.isCompressedTexture)switch(r){case"aoMap":case"emissiveMap":case"metalnessMap":case"normalMap":case"roughnessMap":i.format=e.RGBFormat}if(void 0===s.texCoord||0==s.texCoord||"aoMap"===r&&1==s.texCoord||console.warn("THREE.GLTFLoader: Custom UV set "+s.texCoord+" for texture "+r+" not yet supported."),n.extensions[a.KHR_TEXTURE_TRANSFORM]){var o=void 0!==s.extensions?s.extensions[a.KHR_TEXTURE_TRANSFORM]:void 0;if(o){var l=n.associations.get(i);i=n.extensions[a.KHR_TEXTURE_TRANSFORM].extendTexture(i,o),n.associations.set(i,l)}}t[r]=i})},j.prototype.assignFinalMaterial=function(t){var r=t.geometry,a=t.material,s=void 0!==r.attributes.tangent,n=void 0!==r.attributes.color,i=void 0===r.attributes.normal,o=!0===t.isSkinnedMesh,l=Object.keys(r.morphAttributes).length>0,u=l&&void 0!==r.morphAttributes.normal;if(t.isPoints){var c="PointsMaterial:"+a.uuid,p=this.cache.get(c);p||(p=new e.PointsMaterial,e.Material.prototype.copy.call(p,a),p.color.copy(a.color),p.map=a.map,p.sizeAttenuation=!1,this.cache.add(c,p)),a=p}else if(t.isLine){c="LineBasicMaterial:"+a.uuid;var h=this.cache.get(c);h||(h=new e.LineBasicMaterial,e.Material.prototype.copy.call(h,a),h.color.copy(a.color),this.cache.add(c,h)),a=h}if(s||n||i||o||l){c="ClonedMaterial:"+a.uuid+":";a.isGLTFSpecularGlossinessMaterial&&(c+="specular-glossiness:"),o&&(c+="skinning:"),s&&(c+="vertex-tangents:"),n&&(c+="vertex-colors:"),i&&(c+="flat-shading:"),l&&(c+="morph-targets:"),u&&(c+="morph-normals:");var d=this.cache.get(c);d||(d=a.clone(),o&&(d.skinning=!0),s&&(d.vertexTangents=!0),n&&(d.vertexColors=!0),i&&(d.flatShading=!0),l&&(d.morphTargets=!0),u&&(d.morphNormals=!0),this.cache.add(c,d),this.associations.set(d,this.associations.get(a))),a=d}a.aoMap&&void 0===r.attributes.uv2&&void 0!==r.attributes.uv&&r.setAttribute("uv2",r.attributes.uv),a.normalScale&&!s&&(a.normalScale.y=-a.normalScale.y),a.clearcoatNormalScale&&!s&&(a.clearcoatNormalScale.y=-a.clearcoatNormalScale.y),t.material=a},j.prototype.getMaterialType=function(){return e.MeshStandardMaterial},j.prototype.loadMaterial=function(t){var r,s=this,n=this.json,i=this.extensions,o=n.materials[t],l={},u=o.extensions||{},c=[];if(u[a.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS]){var p=i[a.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS];r=p.getMaterialType(),c.push(p.extendParams(l,o,s))}else if(u[a.KHR_MATERIALS_UNLIT]){var h=i[a.KHR_MATERIALS_UNLIT];r=h.getMaterialType(),c.push(h.extendParams(l,o,s))}else{var d=o.pbrMetallicRoughness||{};if(l.color=new e.Color(1,1,1),l.opacity=1,Array.isArray(d.baseColorFactor)){var f=d.baseColorFactor;l.color.fromArray(f),l.opacity=f[3]}void 0!==d.baseColorTexture&&c.push(s.assignTexture(l,"map",d.baseColorTexture)),l.metalness=void 0!==d.metallicFactor?d.metallicFactor:1,l.roughness=void 0!==d.roughnessFactor?d.roughnessFactor:1,void 0!==d.metallicRoughnessTexture&&(c.push(s.assignTexture(l,"metalnessMap",d.metallicRoughnessTexture)),c.push(s.assignTexture(l,"roughnessMap",d.metallicRoughnessTexture))),r=this._invokeOne(function(e){return e.getMaterialType&&e.getMaterialType(t)}),c.push(this._invokeAll(function(e){return e.extendMaterialParams&&e.extendMaterialParams(t,l)}))}!0===o.doubleSided&&(l.side=e.DoubleSide);var m=o.alphaMode||O;return m===H?(l.transparent=!0,l.depthWrite=!1):(l.transparent=!1,m===F&&(l.alphaTest=void 0!==o.alphaCutoff?o.alphaCutoff:.5)),void 0!==o.normalTexture&&r!==e.MeshBasicMaterial&&(c.push(s.assignTexture(l,"normalMap",o.normalTexture)),l.normalScale=new e.Vector2(1,1),void 0!==o.normalTexture.scale&&l.normalScale.set(o.normalTexture.scale,o.normalTexture.scale)),void 0!==o.occlusionTexture&&r!==e.MeshBasicMaterial&&(c.push(s.assignTexture(l,"aoMap",o.occlusionTexture)),void 0!==o.occlusionTexture.strength&&(l.aoMapIntensity=o.occlusionTexture.strength)),void 0!==o.emissiveFactor&&r!==e.MeshBasicMaterial&&(l.emissive=(new e.Color).fromArray(o.emissiveFactor)),void 0!==o.emissiveTexture&&r!==e.MeshBasicMaterial&&c.push(s.assignTexture(l,"emissiveMap",o.emissiveTexture)),Promise.all(c).then(function(){var n;return n=r===g?i[a.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS].createMaterial(l):new r(l),o.name&&(n.name=o.name),n.map&&(n.map.encoding=e.sRGBEncoding),n.emissiveMap&&(n.emissiveMap.encoding=e.sRGBEncoding),k(n,o),s.associations.set(n,{type:"materials",index:t}),o.extensions&&G(i,n,o),n})},j.prototype.loadGeometries=function(t){var r=this,s=this.extensions,n=this.primitiveCache;function i(e){return s[a.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,r).then(function(t){return V(t,e,r)})}for(var o,l,u=[],c=0,p=t.length;c<p;c++){var h,d=t[c],f=(l=void 0,(l=(o=d).extensions&&o.extensions[a.KHR_DRACO_MESH_COMPRESSION])?"draco:"+l.bufferView+":"+l.indices+":"+K(l.attributes):o.indices+":"+K(o.attributes)+":"+o.mode),m=n[f];if(m)u.push(m.promise);else h=d.extensions&&d.extensions[a.KHR_DRACO_MESH_COMPRESSION]?i(d):V(new e.BufferGeometry,d,r),n[f]={primitive:d,promise:h},u.push(h)}return Promise.all(u)},j.prototype.loadMesh=function(t){for(var r,a=this,s=this.json.meshes[t],n=s.primitives,i=[],o=0,l=n.length;o<l;o++){var u=void 0===n[o].material?(void 0===(r=this.cache).DefaultMaterial&&(r.DefaultMaterial=new e.MeshStandardMaterial({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:e.FrontSide})),r.DefaultMaterial):this.getDependency("material",n[o].material);i.push(u)}return i.push(a.loadGeometries(n)),Promise.all(i).then(function(r){for(var i=r.slice(0,r.length-1),o=r[r.length-1],l=[],u=0,c=o.length;u<c;u++){var p,h=o[u],d=n[u],f=i[u];if(d.mode===L||d.mode===_||d.mode===E||void 0===d.mode)!0!==(p=!0===s.isSkinnedMesh?new e.SkinnedMesh(h,f):new e.Mesh(h,f)).isSkinnedMesh||p.geometry.attributes.skinWeight.normalized||p.normalizeSkinWeights(),d.mode===_?p.geometry=X(p.geometry,e.TriangleStripDrawMode):d.mode===E&&(p.geometry=X(p.geometry,e.TriangleFanDrawMode));else if(d.mode===S)p=new e.LineSegments(h,f);else if(d.mode===R)p=new e.Line(h,f);else if(d.mode===x)p=new e.LineLoop(h,f);else{if(d.mode!==y)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+d.mode);p=new e.Points(h,f)}Object.keys(p.geometry.morphAttributes).length>0&&B(p,s),p.name=s.name||"mesh_"+t,o.length>1&&(p.name+="_"+u),k(p,s),a.assignFinalMaterial(p),l.push(p)}if(1===l.length)return l[0];var m=new e.Group;for(u=0,c=l.length;u<c;u++)m.add(l[u]);return m})},j.prototype.loadCamera=function(t){var r,a=this.json.cameras[t],s=a[a.type];if(s)return"perspective"===a.type?r=new e.PerspectiveCamera(e.MathUtils.radToDeg(s.yfov),s.aspectRatio||1,s.znear||1,s.zfar||2e6):"orthographic"===a.type&&(r=new e.OrthographicCamera(-s.xmag,s.xmag,s.ymag,-s.ymag,s.znear,s.zfar)),a.name&&(r.name=a.name),k(r,a),Promise.resolve(r);console.warn("THREE.GLTFLoader: Missing camera parameters.")},j.prototype.loadSkin=function(e){var t=this.json.skins[e],r={joints:t.joints};return void 0===t.inverseBindMatrices?Promise.resolve(r):this.getDependency("accessor",t.inverseBindMatrices).then(function(e){return r.inverseBindMatrices=e,r})},j.prototype.loadAnimation=function(t){for(var r=this.json.animations[t],a=[],s=[],n=[],i=[],o=[],l=0,u=r.channels.length;l<u;l++){var c=r.channels[l],p=r.samplers[c.sampler],h=c.target,d=void 0!==h.node?h.node:h.id,f=void 0!==r.parameters?r.parameters[p.input]:p.input,m=void 0!==r.parameters?r.parameters[p.output]:p.output;a.push(this.getDependency("node",d)),s.push(this.getDependency("accessor",f)),n.push(this.getDependency("accessor",m)),i.push(p),o.push(h)}return Promise.all([Promise.all(a),Promise.all(s),Promise.all(n),Promise.all(i),Promise.all(o)]).then(function(a){for(var s=a[0],n=a[1],i=a[2],o=a[3],l=a[4],u=[],c=0,p=s.length;c<p;c++){var h=s[c],d=n[c],f=i[c],m=o[c],g=l[c];if(void 0!==h){var v;switch(h.updateMatrix(),h.matrixAutoUpdate=!0,P[g.path]){case P.weights:v=e.NumberKeyframeTrack;break;case P.rotation:v=e.QuaternionKeyframeTrack;break;case P.position:case P.scale:default:v=e.VectorKeyframeTrack}var T=h.name?h.name:h.uuid,y=void 0!==m.interpolation?N[m.interpolation]:e.InterpolateLinear,S=[];P[g.path]===P.weights?h.traverse(function(e){!0===e.isMesh&&e.morphTargetInfluences&&S.push(e.name?e.name:e.uuid)}):S.push(T);var x=f.array;if(f.normalized){var R;if(x.constructor===Int8Array)R=1/127;else if(x.constructor===Uint8Array)R=1/255;else if(x.constructor==Int16Array)R=1/32767;else{if(x.constructor!==Uint16Array)throw new Error("THREE.GLTFLoader: Unsupported output accessor component type.");R=1/65535}for(var L=new Float32Array(x.length),_=0,E=x.length;_<E;_++)L[_]=x[_]*R;x=L}for(_=0,E=S.length;_<E;_++){var A=new v(S[_]+"."+P[g.path],d.array,x,y);"CUBICSPLINE"===m.interpolation&&(A.createInterpolant=function(e){return new M(this.times,this.values,this.getValueSize()/3,e)},A.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0),u.push(A)}}}var w=r.name?r.name:"animation_"+t;return new e.AnimationClip(w,void 0,u)})},j.prototype.loadNode=function(t){var r=this.json,s=this.extensions,n=this,i=r.nodes[t];return function(){var e=[];if(void 0!==i.mesh&&e.push(n.getDependency("mesh",i.mesh).then(function(e){var t=n._getNodeRef(n.meshCache,i.mesh,e);return void 0!==i.weights&&t.traverse(function(e){if(e.isMesh)for(var t=0,r=i.weights.length;t<r;t++)e.morphTargetInfluences[t]=i.weights[t]}),t})),void 0!==i.camera&&e.push(n.getDependency("camera",i.camera).then(function(e){return n._getNodeRef(n.cameraCache,i.camera,e)})),i.extensions&&i.extensions[a.KHR_LIGHTS_PUNCTUAL]&&void 0!==i.extensions[a.KHR_LIGHTS_PUNCTUAL].light){var t=i.extensions[a.KHR_LIGHTS_PUNCTUAL].light;e.push(n.getDependency("light",t).then(function(e){return n._getNodeRef(n.lightCache,t,e)}))}return Promise.all(e)}().then(function(r){var a;if((a=!0===i.isBone?new e.Bone:r.length>1?new e.Group:1===r.length?r[0]:new e.Object3D)!==r[0])for(var o=0,l=r.length;o<l;o++)a.add(r[o]);if(i.name&&(a.userData.name=i.name,a.name=e.PropertyBinding.sanitizeNodeName(i.name)),k(a,i),i.extensions&&G(s,a,i),void 0!==i.matrix){var u=new e.Matrix4;u.fromArray(i.matrix),a.applyMatrix4(u)}else void 0!==i.translation&&a.position.fromArray(i.translation),void 0!==i.rotation&&a.quaternion.fromArray(i.rotation),void 0!==i.scale&&a.scale.fromArray(i.scale);return n.associations.set(a,{type:"nodes",index:t}),a})},j.prototype.loadScene=function(){function t(r,a,s,n){var i=s.nodes[r];return n.getDependency("node",r).then(function(t){return void 0===i.skin?t:n.getDependency("skin",i.skin).then(function(e){for(var t=[],a=0,s=(r=e).joints.length;a<s;a++)t.push(n.getDependency("node",r.joints[a]));return Promise.all(t)}).then(function(a){return t.traverse(function(t){if(t.isMesh){for(var s=[],n=[],i=0,o=a.length;i<o;i++){var l=a[i];if(l){s.push(l);var u=new e.Matrix4;void 0!==r.inverseBindMatrices&&u.fromArray(r.inverseBindMatrices.array,16*i),n.push(u)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',r.joints[i])}t.bind(new e.Skeleton(s,n),t.matrixWorld)}}),t});var r}).then(function(e){a.add(e);var r=[];if(i.children)for(var o=i.children,l=0,u=o.length;l<u;l++){var c=o[l];r.push(t(c,e,s,n))}return Promise.all(r)})}return function(r){var a=this.json,s=this.extensions,n=this.json.scenes[r],i=new e.Group;n.name&&(i.name=n.name),k(i,n),n.extensions&&G(s,i,n);for(var o=n.nodes||[],l=[],u=0,c=o.length;u<c;u++)l.push(t(o[u],i,a,this));return Promise.all(l).then(function(){return i})}}(),t}();exports.GLTFLoader=t;
|
|
148
|
-
},{"../../../build/three.module.js":"dKqR"}],"N4Z9":[function(require,module,exports) {
|
|
149
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Model=void 0;var e=o(require("three")),t=require("three/examples/jsm/loaders/GLTFLoader");function r(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return r=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=r();if(t&&t.has(e))return t.get(e);var o={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var s=n?Object.getOwnPropertyDescriptor(e,i):null;s&&(s.get||s.set)?Object.defineProperty(o,i,s):o[i]=e[i]}return o.default=e,t&&t.set(e,o),o}class n{constructor(t){this.position=new e.Vector3(t.x,t.y,t.z),this.object=null}LoadGLTF(e,r,o,n){return new Promise((i,s)=>{(new t.GLTFLoader).load(e,e=>{const t=e.scene.children[0];t.position.set(this.position.x,this.position.y,this.position.z),t.name=r,t.displayName=o,n&&(t.scale.x=n,t.scale.y=n,t.scale.z=n),this.object=t,i(this.object)},null,s)})}Attach(e){if(Array.isArray(e))for(let t=0;t<e.length;t++)this.object.add(e[t]);else this.object.add(e);return this.object}}exports.Model=n;
|
|
150
|
-
},{"three":"dKqR","three/examples/jsm/loaders/GLTFLoader":"O6i0"}],"Jcll":[function(require,module,exports) {
|
|
151
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BufferGeometryUtils=void 0;var e=require("../../../build/three.module.js"),r={computeTangents:function(r){var t=r.index,o=r.attributes;if(null!==t&&void 0!==o.position&&void 0!==o.normal&&void 0!==o.uv){var i=t.array,n=o.position.array,a=o.normal.array,u=o.uv.array,s=n.length/3;void 0===o.tangent&&r.setAttribute("tangent",new e.BufferAttribute(new Float32Array(4*s),4));for(var f=o.tangent.array,l=[],m=[],g=0;g<s;g++)l[g]=new e.Vector3,m[g]=new e.Vector3;var c=new e.Vector3,d=new e.Vector3,h=new e.Vector3,b=new e.Vector2,v=new e.Vector2,y=new e.Vector2,p=new e.Vector3,A=new e.Vector3,B=r.groups;0===B.length&&(B=[{start:0,count:i.length}]);g=0;for(var w=B.length;g<w;++g)for(var E=M=(H=B[g]).start,T=M+H.count;E<T;E+=3)D(i[E+0],i[E+1],i[E+2]);var x,G,U,S=new e.Vector3,R=new e.Vector3,z=new e.Vector3,V=new e.Vector3;for(g=0,w=B.length;g<w;++g){var H,M;for(E=M=(H=B[g]).start,T=M+H.count;E<T;E+=3)X(i[E+0]),X(i[E+1]),X(i[E+2])}}else console.error("THREE.BufferGeometryUtils: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");function D(e,r,t){c.fromArray(n,3*e),d.fromArray(n,3*r),h.fromArray(n,3*t),b.fromArray(u,2*e),v.fromArray(u,2*r),y.fromArray(u,2*t),d.sub(c),h.sub(c),v.sub(b),y.sub(b);var o=1/(v.x*y.y-y.x*v.y);isFinite(o)&&(p.copy(d).multiplyScalar(y.y).addScaledVector(h,-v.y).multiplyScalar(o),A.copy(h).multiplyScalar(v.x).addScaledVector(d,-y.x).multiplyScalar(o),l[e].add(p),l[r].add(p),l[t].add(p),m[e].add(A),m[r].add(A),m[t].add(A))}function X(e){z.fromArray(a,3*e),V.copy(z),G=l[e],S.copy(G),S.sub(z.multiplyScalar(z.dot(G))).normalize(),R.crossVectors(V,G),U=R.dot(m[e]),x=U<0?-1:1,f[4*e]=S.x,f[4*e+1]=S.y,f[4*e+2]=S.z,f[4*e+3]=x}},mergeBufferGeometries:function(r,t){for(var o=null!==r[0].index,i=new Set(Object.keys(r[0].attributes)),n=new Set(Object.keys(r[0].morphAttributes)),a={},u={},s=r[0].morphTargetsRelative,f=new e.BufferGeometry,l=0,m=0;m<r.length;++m){var g=r[m],c=0;if(o!==(null!==g.index))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+m+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(var d in g.attributes){if(!i.has(d))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+m+'. All geometries must have compatible attributes; make sure "'+d+'" attribute exists among all geometries, or in none of them.'),null;void 0===a[d]&&(a[d]=[]),a[d].push(g.attributes[d]),c++}if(c!==i.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+m+". Make sure all geometries have the same number of attributes."),null;if(s!==g.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+m+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(var d in g.morphAttributes){if(!n.has(d))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+m+". .morphAttributes must be consistent throughout all geometries."),null;void 0===u[d]&&(u[d]=[]),u[d].push(g.morphAttributes[d])}if(f.userData.mergedUserData=f.userData.mergedUserData||[],f.userData.mergedUserData.push(g.userData),t){var h;if(o)h=g.index.count;else{if(void 0===g.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+m+". The geometry must have either an index or a position attribute"),null;h=g.attributes.position.count}f.addGroup(l,h,m),l+=h}}if(o){var b=0,v=[];for(m=0;m<r.length;++m){for(var y=r[m].index,p=0;p<y.count;++p)v.push(y.getX(p)+b);b+=r[m].attributes.position.count}f.setIndex(v)}for(var d in a){var A=this.mergeBufferAttributes(a[d]);if(!A)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+d+" attribute."),null;f.setAttribute(d,A)}for(var d in u){var B=u[d][0].length;if(0===B)break;f.morphAttributes=f.morphAttributes||{},f.morphAttributes[d]=[];for(m=0;m<B;++m){var w=[];for(p=0;p<u[d].length;++p)w.push(u[d][p][m]);var E=this.mergeBufferAttributes(w);if(!E)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the "+d+" morphAttribute."),null;f.morphAttributes[d].push(E)}}return f},mergeBufferAttributes:function(r){for(var t,o,i,n=0,a=0;a<r.length;++a){var u=r[a];if(u.isInterleavedBufferAttribute)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. InterleavedBufferAttributes are not supported."),null;if(void 0===t&&(t=u.array.constructor),t!==u.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===o&&(o=u.itemSize),o!==u.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===i&&(i=u.normalized),i!==u.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;n+=u.array.length}var s=new t(n),f=0;for(a=0;a<r.length;++a)s.set(r[a].array,f),f+=r[a].array.length;return new e.BufferAttribute(s,o,i)},interleaveAttributes:function(r){for(var t,o=0,i=0,n=0,a=r.length;n<a;++n){var u=r[n];if(void 0===t&&(t=u.array.constructor),t!==u.array.constructor)return console.error("AttributeBuffers of different types cannot be interleaved"),null;o+=u.array.length,i+=u.itemSize}var s=new e.InterleavedBuffer(new t(o),i),f=0,l=[],m=["getX","getY","getZ","getW"],g=["setX","setY","setZ","setW"],c=0;for(a=r.length;c<a;c++){var d=(u=r[c]).itemSize,h=u.count,b=new e.InterleavedBufferAttribute(s,d,f,u.normalized);l.push(b),f+=d;for(var v=0;v<h;v++)for(var y=0;y<d;y++)b[g[y]](v,u[m[y]](v))}return l},estimateBytesUsed:function(e){var r=0;for(var t in e.attributes){var o=e.getAttribute(t);r+=o.count*o.itemSize*o.array.BYTES_PER_ELEMENT}var i=e.getIndex();return r+=i?i.count*i.itemSize*i.array.BYTES_PER_ELEMENT:0},mergeVertices:function(r,t=1e-4){t=Math.max(t,Number.EPSILON);for(var o={},i=r.getIndex(),n=r.getAttribute("position"),a=i?i.count:n.count,u=0,s=Object.keys(r.attributes),f={},l={},m=[],g=["getX","getY","getZ","getW"],c=0,d=s.length;c<d;c++){f[A=s[c]]=[],(T=r.morphAttributes[A])&&(l[A]=new Array(T.length).fill().map(()=>[]))}var h=Math.log10(1/t),b=Math.pow(10,h);for(c=0;c<a;c++){var v=i?i.getX(c):c,y="",p=0;for(d=s.length;p<d;p++)for(var A=s[p],B=(E=r.getAttribute(A)).itemSize,w=0;w<B;w++)y+=`${~~(E[g[w]](v)*b)},`;if(y in o)m.push(o[y]);else{for(p=0,d=s.length;p<d;p++){A=s[p];var E=r.getAttribute(A),T=r.morphAttributes[A],x=(B=E.itemSize,f[A]),G=l[A];for(w=0;w<B;w++){var U=g[w];if(x.push(E[U](v)),T)for(var S=0,R=T.length;S<R;S++)G[S].push(T[S][U](v))}}o[y]=u,m.push(u),u++}}const z=r.clone();for(c=0,d=s.length;c<d;c++){A=s[c];var V=r.getAttribute(A),H=new V.array.constructor(f[A]);E=new e.BufferAttribute(H,V.itemSize,V.normalized);if(z.setAttribute(A,E),A in l)for(p=0;p<l[A].length;p++){var M=r.morphAttributes[A][p],D=(H=new M.array.constructor(l[A][p]),new e.BufferAttribute(H,M.itemSize,M.normalized));z.morphAttributes[A][p]=D}}return z.setIndex(m),z},toTrianglesDrawMode:function(r,t){if(t===e.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),r;if(t===e.TriangleFanDrawMode||t===e.TriangleStripDrawMode){var o=r.getIndex();if(null===o){var i=[],n=r.getAttribute("position");if(void 0===n)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),r;for(var a=0;a<n.count;a++)i.push(a);r.setIndex(i),o=r.getIndex()}var u=o.count-2,s=[];if(t===e.TriangleFanDrawMode)for(a=1;a<=u;a++)s.push(o.getX(0)),s.push(o.getX(a)),s.push(o.getX(a+1));else for(a=0;a<u;a++)a%2==0?(s.push(o.getX(a)),s.push(o.getX(a+1)),s.push(o.getX(a+2))):(s.push(o.getX(a+2)),s.push(o.getX(a+1)),s.push(o.getX(a)));s.length/3!==u&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var f=r.clone();return f.setIndex(s),f.clearGroups(),f}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),r}};exports.BufferGeometryUtils=r;
|
|
152
|
-
},{"../../../build/three.module.js":"dKqR"}],"YQGE":[function(require,module,exports) {
|
|
153
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GenBuilding=u,exports.GenGeometry=i,exports.GenShape=s,exports.GenHelper=f,exports.GenLine=c,exports.GenLinePoints=l,exports.GenWaterGeometry=p,exports.MergeGeometry=a,exports.MergeLineGeometry=d;var e=o(require("three")),t=require("../coordinate/Coordinate"),r=require("three/examples/jsm/utils/BufferGeometryUtils.js");function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function o(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var i=o?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(r,u,i):r[u]=e[u]}return r.default=e,t&&t.set(e,r),r}function u(e,t){const r=this.GenShape(e);return this.GenGeometry(r,{curveSegments:2,steps:1,depth:.05*t,bevelEnabled:!1})}function i(t,r){const n=new e.ExtrudeBufferGeometry(t,r);return n.computeBoundingBox(),n}function s(r,n){const o=new e.Shape;for(let e=0;e<r.length;e++){const n=r[e],u=new t.Coordinate("GPS",{latitude:n[1],longitude:n[0]}).ComputeWorldCoordinate();0===e?o.moveTo(u.world.x,u.world.z):o.lineTo(u.world.x,u.world.z)}return o}function f(t){return t.computeBoundingBox(),t.computeBoundingSphere(),new e.Mesh(t,new e.MeshBasicMaterial)}function c(t){const r=this.GenLinePoints(t);return(new e.BufferGeometry).setFromPoints(r)}function l(r){const n=[];for(let o=0;o<r.length;o++){if(!r[0][1])return;const u=r[o];if(!u[0]||!u[1])return;let i=[u[0],u[1]];i=new t.Coordinate("GPS",{latitude:i[1],longitude:i[0]}).ComputeWorldCoordinate(),n.push(new e.Vector3(i.world.x,.1,i.world.z))}return n}function p(t,r){const n=new e.ExtrudeBufferGeometry(t,r);return n.computeBoundingBox(),n}function a(e){return r.BufferGeometryUtils.mergeBufferGeometries(e)}function d(t){const r=[];for(let e=0;e<t.length;e++)r.push(t[e].attributes.position.array);return new e.BufferGeometry}
|
|
154
|
-
},{"three":"dKqR","../coordinate/Coordinate":"tKb1","three/examples/jsm/utils/BufferGeometryUtils.js":"Jcll"}],"qlYF":[function(require,module,exports) {
|
|
155
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Polygon=void 0;var e=l(require("three")),r=n(require("../materials/CUBE_Material")),t=require("../utils/ModelBuilder"),o=require("./Layer");function n(e){return e&&e.__esModule?e:{default:e}}function a(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return a=function(){return e},e}function l(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a();if(r&&r.has(e))return r.get(e);var t={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var l=o?Object.getOwnPropertyDescriptor(e,n):null;l&&(l.get||l.set)?Object.defineProperty(t,n,l):t[n]=e[n]}return t.default=e,r&&r.set(e,t),t}class i{constructor(e,r){this.coors=r,this.layer=new o.Layer(e),this.layer_objects=new o.Layer(e+"_objects"),this.layer_collider=new o.Layer(e+"_collider")}Ground(t={},o={},n){const a=o.height?o.height:1,l=n||(new r.default).Ground({color:o.color?o.color:16777215}),i=s(this.coors,t,a);return this.layer_objects.Add(new e.Mesh(i.geometry,l)),this.layer.Add(this.layer_objects.Layer()),this.layer.Layer()}}function s(e,r,o=1){let n,a;for(let l=0;l<e.length;l++){const r=e[l];n="number"!=typeof r[0][0]?(0,t.GenShape)(r[0]):(0,t.GenShape)(r)}if(n)return(a=(0,t.GenGeometry)(n,{curveSegments:12,steps:1,depth:o,bevelEnabled:!1})).rotateX(Math.PI/2),a.rotateZ(Math.PI),{geometry:a}}exports.Polygon=i;
|
|
156
|
-
},{"three":"dKqR","../materials/CUBE_Material":"E9Yg","../utils/ModelBuilder":"YQGE","./Layer":"oe7K"}],"k8Dg":[function(require,module,exports) {
|
|
157
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineSegmentsGeometry=void 0;var t=require("../../../build/three.module.js"),e=function(){t.InstancedBufferGeometry.call(this),this.type="LineSegmentsGeometry";this.setIndex([0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5]),this.setAttribute("position",new t.Float32BufferAttribute([-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],3)),this.setAttribute("uv",new t.Float32BufferAttribute([-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],2))};exports.LineSegmentsGeometry=e,e.prototype=Object.assign(Object.create(t.InstancedBufferGeometry.prototype),{constructor:e,isLineSegmentsGeometry:!0,applyMatrix4:function(t){var e=this.attributes.instanceStart,r=this.attributes.instanceEnd;return void 0!==e&&(e.applyMatrix4(t),r.applyMatrix4(t),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this},setPositions:function(e){var r;e instanceof Float32Array?r=e:Array.isArray(e)&&(r=new Float32Array(e));var n=new t.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceStart",new t.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceEnd",new t.InterleavedBufferAttribute(n,3,3)),this.computeBoundingBox(),this.computeBoundingSphere(),this},setColors:function(e){var r;e instanceof Float32Array?r=e:Array.isArray(e)&&(r=new Float32Array(e));var n=new t.InstancedInterleavedBuffer(r,6,1);return this.setAttribute("instanceColorStart",new t.InterleavedBufferAttribute(n,3,0)),this.setAttribute("instanceColorEnd",new t.InterleavedBufferAttribute(n,3,3)),this},fromWireframeGeometry:function(t){return this.setPositions(t.attributes.position.array),this},fromEdgesGeometry:function(t){return this.setPositions(t.attributes.position.array),this},fromMesh:function(e){return this.fromWireframeGeometry(new t.WireframeGeometry(e.geometry)),this},fromLineSegments:function(t){var e=t.geometry;return e.isGeometry?this.setPositions(e.vertices):e.isBufferGeometry&&this.setPositions(e.attributes.position.array),this},computeBoundingBox:function(){var e=new t.Box3;return function(){null===this.boundingBox&&(this.boundingBox=new t.Box3);var r=this.attributes.instanceStart,n=this.attributes.instanceEnd;void 0!==r&&void 0!==n&&(this.boundingBox.setFromBufferAttribute(r),e.setFromBufferAttribute(n),this.boundingBox.union(e))}}(),computeBoundingSphere:function(){var e=new t.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new t.Sphere),null===this.boundingBox&&this.computeBoundingBox();var r=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(void 0!==r&&void 0!==n){var i=this.boundingSphere.center;this.boundingBox.getCenter(i);for(var o=0,s=0,u=r.count;s<u;s++)e.fromBufferAttribute(r,s),o=Math.max(o,i.distanceToSquared(e)),e.fromBufferAttribute(n,s),o=Math.max(o,i.distanceToSquared(e));this.boundingSphere.radius=Math.sqrt(o),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}}(),toJSON:function(){},applyMatrix:function(t){return console.warn("THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4()."),this.applyMatrix4(t)}});
|
|
158
|
-
},{"../../../build/three.module.js":"dKqR"}],"zCQ6":[function(require,module,exports) {
|
|
159
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineMaterial=void 0;var t=require("../../../build/three.module.js");t.UniformsLib.line={linewidth:{value:1},resolution:{value:new t.Vector2(1,1)},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1},opacity:{value:1}},t.ShaderLib.line={uniforms:t.UniformsUtils.merge([t.UniformsLib.common,t.UniformsLib.fog,t.UniformsLib.line]),vertexShader:"\n\t\t#include <common>\n\t\t#include <color_pars_vertex>\n\t\t#include <fog_pars_vertex>\n\t\t#include <logdepthbuf_pars_vertex>\n\t\t#include <clipping_planes_pars_vertex>\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 <logdepthbuf_vertex>\n\t\t\t#include <clipping_planes_vertex>\n\t\t\t#include <fog_vertex>\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 <common>\n\t\t#include <color_pars_fragment>\n\t\t#include <fog_pars_fragment>\n\t\t#include <logdepthbuf_pars_fragment>\n\t\t#include <clipping_planes_pars_fragment>\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\t#include <clipping_planes_fragment>\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 <logdepthbuf_fragment>\n\t\t\t#include <color_fragment>\n\n\t\t\tgl_FragColor = vec4( diffuseColor.rgb, diffuseColor.a );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <encodings_fragment>\n\t\t\t#include <fog_fragment>\n\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t}\n\t\t"};var n=function(n){t.ShaderMaterial.call(this,{type:"LineMaterial",uniforms:t.UniformsUtils.clone(t.ShaderLib.line.uniforms),vertexShader:t.ShaderLib.line.vertexShader,fragmentShader:t.ShaderLib.line.fragmentShader,clipping:!0}),this.dashed=!1,Object.defineProperties(this,{color:{enumerable:!0,get:function(){return this.uniforms.diffuse.value},set:function(t){this.uniforms.diffuse.value=t}},linewidth:{enumerable:!0,get:function(){return this.uniforms.linewidth.value},set:function(t){this.uniforms.linewidth.value=t}},dashScale:{enumerable:!0,get:function(){return this.uniforms.dashScale.value},set:function(t){this.uniforms.dashScale.value=t}},dashSize:{enumerable:!0,get:function(){return this.uniforms.dashSize.value},set:function(t){this.uniforms.dashSize.value=t}},gapSize:{enumerable:!0,get:function(){return this.uniforms.gapSize.value},set:function(t){this.uniforms.gapSize.value=t}},opacity:{enumerable:!0,get:function(){return this.uniforms.opacity.value},set:function(t){this.uniforms.opacity.value=t}},resolution:{enumerable:!0,get:function(){return this.uniforms.resolution.value},set:function(t){this.uniforms.resolution.value.copy(t)}}}),this.setValues(n)};exports.LineMaterial=n,n.prototype=Object.create(t.ShaderMaterial.prototype),n.prototype.constructor=n,n.prototype.isLineMaterial=!0;
|
|
160
|
-
},{"../../../build/three.module.js":"dKqR"}],"Aecc":[function(require,module,exports) {
|
|
161
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineSegments2=void 0;var t=require("../../../build/three.module.js"),e=require("../lines/LineSegmentsGeometry.js"),r=require("../lines/LineMaterial.js"),n=function(n,a){t.Mesh.call(this),this.type="LineSegments2",this.geometry=void 0!==n?n:new e.LineSegmentsGeometry,this.material=void 0!==a?a:new r.LineMaterial({color:16777215*Math.random()})};exports.LineSegments2=n,n.prototype=Object.assign(Object.create(t.Mesh.prototype),{constructor:n,isLineSegments2:!0,computeLineDistances:function(){var e=new t.Vector3,r=new t.Vector3;return function(){for(var n=this.geometry,a=n.attributes.instanceStart,i=n.attributes.instanceEnd,o=new Float32Array(2*a.data.count),s=0,c=0,u=a.data.count;s<u;s++,c+=2)e.fromBufferAttribute(a,s),r.fromBufferAttribute(i,s),o[c]=0===c?0:o[c-1],o[c+1]=o[c]+e.distanceTo(r);var l=new t.InstancedInterleavedBuffer(o,2,1);return n.setAttribute("instanceDistanceStart",new t.InterleavedBufferAttribute(l,1,0)),n.setAttribute("instanceDistanceEnd",new t.InterleavedBufferAttribute(l,1,1)),this}}(),raycast:function(){var e=new t.Vector4,r=new t.Vector4,n=new t.Vector4,a=new t.Vector3,i=new t.Matrix4,o=new t.Line3,s=new t.Vector3;return function(c,u){null===c.camera&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');var l=c.ray,p=c.camera,f=p.projectionMatrix,m=this.geometry,y=this.material,d=y.resolution,w=y.linewidth,v=m.attributes.instanceStart,x=m.attributes.instanceEnd;l.at(1,n),n.w=1,n.applyMatrix4(p.matrixWorldInverse),n.applyMatrix4(f),n.multiplyScalar(1/n.w),n.x*=d.x/2,n.y*=d.y/2,n.z=0,a.copy(n);var b=this.matrixWorld;i.multiplyMatrices(p.matrixWorldInverse,b);for(var M=0,h=v.count;M<h;M++){e.fromBufferAttribute(v,M),r.fromBufferAttribute(x,M),e.w=1,r.w=1,e.applyMatrix4(i),r.applyMatrix4(i),e.applyMatrix4(f),r.applyMatrix4(f),e.multiplyScalar(1/e.w),r.multiplyScalar(1/r.w);var S=e.z<-1&&r.z<-1,g=e.z>1&&r.z>1;if(!S&&!g){e.x*=d.x/2,e.y*=d.y/2,r.x*=d.x/2,r.y*=d.y/2,o.start.copy(e),o.start.z=0,o.end.copy(r),o.end.z=0;var L=o.closestPointToPointParameter(a,!0);o.at(L,s);var A=t.MathUtils.lerp(e.z,r.z,L),z=A>=-1&&A<=1,B=a.distanceTo(s)<.5*w;if(z&&B){o.start.fromBufferAttribute(v,M),o.end.fromBufferAttribute(x,M),o.start.applyMatrix4(b),o.end.applyMatrix4(b);var V=new t.Vector3,j=new t.Vector3;l.distanceSqToSegment(o.start,o.end,j,V),u.push({point:j,pointOnLine:V,distance:l.origin.distanceTo(j),object:this,face:null,faceIndex:M,uv:null,uv2:null})}}}}}()});
|
|
162
|
-
},{"../../../build/three.module.js":"dKqR","../lines/LineSegmentsGeometry.js":"k8Dg","../lines/LineMaterial.js":"zCQ6"}],"VYfi":[function(require,module,exports) {
|
|
163
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LineGeometry=void 0;var e=require("../lines/LineSegmentsGeometry.js"),t=function(){e.LineSegmentsGeometry.call(this),this.type="LineGeometry"};exports.LineGeometry=t,t.prototype=Object.assign(Object.create(e.LineSegmentsGeometry.prototype),{constructor:t,isLineGeometry:!0,setPositions:function(t){for(var o=t.length-3,r=new Float32Array(2*o),s=0;s<o;s+=3)r[2*s]=t[s],r[2*s+1]=t[s+1],r[2*s+2]=t[s+2],r[2*s+3]=t[s+3],r[2*s+4]=t[s+4],r[2*s+5]=t[s+5];return e.LineSegmentsGeometry.prototype.setPositions.call(this,r),this},setColors:function(t){for(var o=t.length-3,r=new Float32Array(2*o),s=0;s<o;s+=3)r[2*s]=t[s],r[2*s+1]=t[s+1],r[2*s+2]=t[s+2],r[2*s+3]=t[s+3],r[2*s+4]=t[s+4],r[2*s+5]=t[s+5];return e.LineSegmentsGeometry.prototype.setColors.call(this,r),this},fromLine:function(e){var t=e.geometry;return t.isGeometry?this.setPositions(t.vertices):t.isBufferGeometry&&this.setPositions(t.attributes.position.array),this},copy:function(){return this}});
|
|
164
|
-
},{"../lines/LineSegmentsGeometry.js":"k8Dg"}],"hckB":[function(require,module,exports) {
|
|
165
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Line2=void 0;var e=require("../lines/LineSegments2.js"),i=require("../lines/LineGeometry.js"),t=require("../lines/LineMaterial.js"),r=function(r,n){e.LineSegments2.call(this),this.type="Line2",this.geometry=void 0!==r?r:new i.LineGeometry,this.material=void 0!==n?n:new t.LineMaterial({color:16777215*Math.random()})};exports.Line2=r,r.prototype=Object.assign(Object.create(e.LineSegments2.prototype),{constructor:r,isLine2:!0});
|
|
166
|
-
},{"../lines/LineSegments2.js":"Aecc","../lines/LineGeometry.js":"VYfi","../lines/LineMaterial.js":"zCQ6"}],"ZSdE":[function(require,module,exports) {
|
|
167
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GeometryUtils=void 0;var r=require("../../../build/three.module.js"),e={hilbert2D:function(t,o,p,y,i,l,a){t=void 0!==t?t:new r.Vector3(0,0,0);var h=(o=void 0!==o?o:10)/2,v=(p=void 0!==p?p:1,y=void 0!==y?y:0,i=void 0!==i?i:1,l=void 0!==l?l:2,a=void 0!==a?a:3,[new r.Vector3(t.x-h,t.y,t.z-h),new r.Vector3(t.x-h,t.y,t.z+h),new r.Vector3(t.x+h,t.y,t.z+h),new r.Vector3(t.x+h,t.y,t.z-h)]),u=[v[y],v[i],v[l],v[a]];if(0<=--p){var d=[];return Array.prototype.push.apply(d,e.hilbert2D(u[0],h,p,y,a,l,i)),Array.prototype.push.apply(d,e.hilbert2D(u[1],h,p,y,i,l,a)),Array.prototype.push.apply(d,e.hilbert2D(u[2],h,p,y,i,l,a)),Array.prototype.push.apply(d,e.hilbert2D(u[3],h,p,l,i,y,a)),d}return u},hilbert3D:function(t,o,p,y,i,l,a,h,v,u,d){t=void 0!==t?t:new r.Vector3(0,0,0);var n=(o=void 0!==o?o:10)/2,s=(p=void 0!==p?p:1,y=void 0!==y?y:0,i=void 0!==i?i:1,l=void 0!==l?l:2,a=void 0!==a?a:3,h=void 0!==h?h:4,v=void 0!==v?v:5,u=void 0!==u?u:6,d=void 0!==d?d:7,[new r.Vector3(t.x-n,t.y+n,t.z-n),new r.Vector3(t.x-n,t.y+n,t.z+n),new r.Vector3(t.x-n,t.y-n,t.z+n),new r.Vector3(t.x-n,t.y-n,t.z-n),new r.Vector3(t.x+n,t.y-n,t.z-n),new r.Vector3(t.x+n,t.y-n,t.z+n),new r.Vector3(t.x+n,t.y+n,t.z+n),new r.Vector3(t.x+n,t.y+n,t.z-n)]),c=[s[y],s[i],s[l],s[a],s[h],s[v],s[u],s[d]];if(--p>=0){var b=[];return Array.prototype.push.apply(b,e.hilbert3D(c[0],n,p,y,a,h,d,u,v,l,i)),Array.prototype.push.apply(b,e.hilbert3D(c[1],n,p,y,d,u,i,l,v,h,a)),Array.prototype.push.apply(b,e.hilbert3D(c[2],n,p,y,d,u,i,l,v,h,a)),Array.prototype.push.apply(b,e.hilbert3D(c[3],n,p,l,a,y,i,u,d,h,v)),Array.prototype.push.apply(b,e.hilbert3D(c[4],n,p,l,a,y,i,u,d,h,v)),Array.prototype.push.apply(b,e.hilbert3D(c[5],n,p,h,a,l,v,u,i,y,d)),Array.prototype.push.apply(b,e.hilbert3D(c[6],n,p,h,a,l,v,u,i,y,d)),Array.prototype.push.apply(b,e.hilbert3D(c[7],n,p,u,v,l,i,y,a,h,d)),b}return c}};exports.GeometryUtils=e;
|
|
168
|
-
},{"../../../build/three.module.js":"dKqR"}],"mRBh":[function(require,module,exports) {
|
|
169
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GeoLayer=void 0;var e=y(require("three")),t=require("../coordinate/Coordinate"),r=require("../utils/ModelBuilder"),o=require("three/examples/jsm/objects/Water"),n=require("three/examples/jsm/lines/Line2"),i=require("three/examples/jsm/lines/LineMaterial.js"),s=require("three/examples/jsm/lines/LineGeometry.js"),a=require("three/examples/jsm/utils/GeometryUtils.js"),l=h(require("../materials/CUBE_Material")),c=require("../animation/Animation"),d=require("./Layer");function h(e){return e&&e.__esModule?e:{default:e}}function u(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return u=function(){return e},e}function y(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=u();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var i=o?Object.getOwnPropertyDescriptor(e,n):null;i&&(i.get||i.set)?Object.defineProperty(r,n,i):r[n]=e[n]}return r.default=e,t&&t.set(e,r),r}class m{constructor(e,t){this.geojson=t.features,this.name=e,this.layer=new d.Layer(e),this.materials=[],this.layer_objects=new d.Layer(e+"_objects"),this.layer_borders=new d.Layer(e+"_borders"),this.layer_colliders=new d.Layer(e+"_colliders"),this.layer.Layer().CUBE_COLLIDER={enabled:!1,colliders:[]},this.layer.Layer().CUBE_TYPE="GeoLayer"}AdministrativeMap(t={},o,n){this.mat_map=o||(new l.default).GeoMap(),this.mat_line=n||(new l.default).GeoBorder(),this.materials.push(this.mat_map),this.materials.push(this.mat_line);const i=this.geojson,s=t.height?t.height:2,a=[];t.collider=!!t.merge&&t.collider;for(let r=0;r<i.length;r++){const o=i[r];if(!o.properties)return;const n=o.properties;if(o.geometry.coordinates){let r=[];"Polygon"===o.geometry.type&&r.push(o.geometry.coordinates),"MultiPolygon"===o.geometry.type&&(r=o.geometry.coordinates);for(let o=0;o<r.length;o++){const i=r[o],l=g(i,n,t.collider,s);l&&(t.merge?(a.push(l.geometry),t.collider&&this.layer_colliders.Add(l.helper)):this.layer_objects.Add(new e.Mesh(l.geometry,this.mat_map))),t.border&&this.layer_borders.Add(L(i,this.mat_line,s+.01))}}}if(t.merge){const t=(0,r.MergeGeometry)(a),o=new e.Mesh(t,this.mat_map);this.layer_objects.Add(o)}return this.layer.Add(this.layer_objects.Layer()),t.collider&&(this.layer.Layer().CUBE_COLLIDER.colliders=this.layer_colliders.Layer(),this.layer.Layer().CUBE_COLLIDER.enabled=!0),this.layer.Add(this.layer_borders.Layer()),this.layer.Layer()}Buildings(t={},o){const n=!!t.terrain&&t.terrain.children[0].geometry;t.terrain&&console.warn("Building with terrain is an experimental function. In some case, it might cause performance issue and memory leak."),this.mat_building=o||(new l.default).GeoBuilding({color:t.color?t.color:7898290,specular:16448250,reflectivity:.6}),this.materials.push=this.mat_building;const i=this.geojson,s=[];t.collider?t.collider=!!t.merge&&t.collider:t.collider=!1;for(let r=0;r<i.length;r++){const o=i[r];if(!o.properties)return;const a=o.properties;if(x(a,"building")&&"Polygon"===o.geometry.type){let r=1;void 0!==a["building:levels"]?r=parseInt(a["building:levels"]):a.tags&&(r=parseInt(a.tags["building:levels"]));const i=p(o.geometry.coordinates,t.collider,a,r,n);if(i)if(t.merge)s.push(i.geometry),t.collider&&this.layer_colliders.Add(i.helper);else{const t=new e.Mesh(i.geometry,this.mat_building),r=x(a,"name");t.name=r||"building",t.info=a,this.layer_objects.Add(t)}}}if(t.merge){const t=(0,r.MergeGeometry)(s),o=new e.Mesh(t,this.mat_building);this.layer_objects.Add(o)}return this.layer.Add(this.layer_objects.Layer()),t.collider&&(this.layer.Layer().CUBE_COLLIDER.colliders=this.layer_colliders.Layer(),this.layer.Layer().CUBE_COLLIDER.enabled=!0),this.layer.Layer()}Road(t={color:1787526,terrain:null,width:2,color:4360181},r){const o=this.geojson;this.mat_road=(new l.default).GeoRoad({color:t.color?t.color:1787526});const a=!!t.terrain&&t.terrain.children[0].geometry;let c=[];this.mat_road=r||this.mat_road,this.materials.push(this.mat_road);for(let e=0;e<o.length;e++){const t=o[e];if(!t.properties)return;const r=x(t.properties,"highway");if(r&&"LineString"===t.geometry.type&&"pedestrian"!==r&&"footway"!==r&&"path"!==r){const e=w(t.geometry.coordinates,a);e&&c.push(e)}}for(let l=0;l<c.length;l++){const r=c[l],o=new s.LineGeometry,a=[],d=Math.round(24*r.length),h=new e.CatmullRomCurve3(r,!1,"catmullrom",.001),u=new e.Vector3;for(let e=0,t=d;e<t;e++){const r=e/t;h.getPoint(r,u),a.push(u.x,u.y,u.z)}o.setPositions(a),o.rotateZ(Math.PI);const y=window.CUBE_GLOBAL.MAP_SCALE*(t.width||2),m=new i.LineMaterial({color:t.color||4360181,linewidth:1e-4*y,vertexColors:!1,dashed:!1,alphaToCoverage:!0}),p=new n.Line2(o,m);p.computeLineDistances(),p.matrixAutoUpdate=!1,p.updateMatrix(),this.layer_objects.Add(p)}return this.layer.Add(this.layer_objects.Layer()),this.layer.Layer()}RoadSp(t={},r){const o=this.geojson;this.mat_road=(new l.default).GeoRoad();const n=!!t.terrain&&t.terrain.children[0].geometry;this.mat_road=r||this.mat_road,this.materials.push(this.mat_road);for(let i=0;i<o.length;i++){const r=o[i];if(!r.properties)return;const s=r.properties,a=x(s,"highway");if(a&&"LineString"===r.geometry.type&&"pedestrian"!==a&&"footway"!==a&&"path"!==a){const o=f(r.geometry.coordinates,n);if(o){const r=new e.Line(o.geometry,this.mat_road);if(r.info=s,r.position.set(r.position.x,1,r.position.z),r.matrixAutoUpdate=!1,r.updateMatrix(),t.animation&&t.animationEngine){r.computeLineDistances();const e=r.geometry.attributes.lineDistance.array[r.geometry.attributes.lineDistance.count-1];if(e>.8){const o=j(r.geometry,e),n=new c.Animation("l",o,"dashline").DashLine(e);t.animationEngine.Register(n)}}this.layer_objects.Add(r)}}}return this.layer.Add(this.layer_objects.Layer()),this.layer.Layer()}Water(t={}){const n=new e.Light("#ffffff",.5);n.position.set(0,4,0);const i=(new l.default).GeoWater(n,!0),s=this.geojson,a=[];for(let e=0;e<s.length;e++){const r=s[e];if(!r.properties)return;if("water"===x(r.properties,"natural")&&"Polygon"===r.geometry.type){const e=b(r.geometry.coordinates,r.properties);if(t.merge)a.push(e.geometry);else{const t=new o.Water(e.geometry,i);this.layer.Add(t)}}}if(t.merge){const e=(0,r.MergeGeometry)(a),t=new o.Water(e,i);this.layer.Add(t)}return this.layer.Layer()}Polygon(t={},o){this.mat=o||(new l.default).GeoMap({color:t.color?t.color:3027778}),this.materials.push(this.mat);const n=this.geojson,i=t.height?t.height:1,s=[];for(let r=0;r<n.length;r++){const o=n[r];if(!o.properties)return;const a=o.properties;if(o.geometry.coordinates){const r=[];"Polygon"===o.geometry.type&&r.push(o.geometry.coordinates);for(let o=0;o<r.length;o++){const n=p(r[o],!1,a,i);n&&(t.merge?s.push(n.geometry):this.layer_objects.Add(new e.Mesh(n.geometry,this.mat)))}}}if(t.merge){const t=(0,r.MergeGeometry)(s),o=new e.Mesh(t,this.mat);this.layer_objects.Add(o)}return this.layer.Add(this.layer_objects.Layer()),this.layer.Add(this.layer_borders.Layer()),this.layer.Layer()}}function p(t,o=!1,n={},i=1,s){let a;i=i||1;const l=[];for(let e=0;e<t.length;e++){const o=t[e];0===e?a=(0,r.GenShape)(o):l.push((0,r.GenShape)(o))}for(let e=0;e<l.length;e++)a.holes.push(l[e]);const c=(0,r.GenGeometry)(a,{curveSegments:1,depth:.1*i,bevelEnabled:!1});if(c.rotateX(Math.PI/2),c.rotateZ(Math.PI),c.computeBoundingSphere(),s){const t=new e.Vector3(a.currentPoint.x,0,a.currentPoint.y),r=new e.Vector3(0,0,1),o=Math.PI;t.applyAxisAngle(r,o);const n=M({x:t.x,z:t.z},s.vertices);n&&c.translate(0,n.y,0)}let d={};if(o&&(d=(0,r.GenHelper)(c))){const e=x(n,"name");d.name=e||"building",d.info=n}return{geometry:c,helper:d}}function g(e,t,o=!1,n=1){let i,s;for(let a=0;a<e.length;a++){const t=e[a];i="number"!=typeof t[0][0]?(0,r.GenShape)(t[0]):(0,r.GenShape)(t)}if(i){(s=(0,r.GenGeometry)(i,{curveSegments:12,steps:1,depth:n,bevelEnabled:!1})).rotateX(Math.PI/2),s.rotateZ(Math.PI),s.computeBoundingSphere();let e={};if(o&&(e=(0,r.GenHelper)(s))){const r=x(t,"name");e.name=r||"Area",e.info=t}return{geometry:s,helper:e}}}function f(r,o){const n=[];for(let s=0;s<r.length;s++){if(!r[0][1])return;const i=r[s];if(!i[0]||!i[1])return;let a=[i[0],i[1]];a=new t.Coordinate("GPS",{latitude:a[1],longitude:a[0]}).ComputeWorldCoordinate();const l=new e.Vector3(a.world.x,a.world.y,a.world.z),c=new e.Vector3(0,0,1),d=Math.PI;l.applyAxisAngle(c,d);let h=0;if(o){const e=M({x:l.x,z:l.z},o.vertices);e&&(h=-e.y)}n.push(new e.Vector3(a.world.x,a.world.y+h,a.world.z))}const i=(new e.BufferGeometry).setFromPoints(n);return i.rotateZ(Math.PI),{geometry:i}}function w(r,o){const n=[];for(let i=0;i<r.length;i++){if(!r[0][1])return;const s=r[i];if(!s[0]||!s[1])return;let a=[s[0],s[1]];a=new t.Coordinate("GPS",{latitude:a[1],longitude:a[0]}).ComputeWorldCoordinate();const l=new e.Vector3(a.world.x,a.world.y,a.world.z),c=new e.Vector3(0,0,1),d=Math.PI;l.applyAxisAngle(c,d);let h=0;if(o){const e=M({x:l.x,z:l.z},o.vertices);e&&(h=-e.y)}n.push(new e.Vector3(a.world.x,a.world.y+h,a.world.z)),0!==i&&i!==r.length-1&&n.push(new e.Vector3(a.world.x,a.world.y+h,a.world.z))}return n}function _(r,o){const n=new e.CurvePath;let i=null;for(let s=0;s<r.length;s++){if(!r[0][1])return;const a=r[s];if(!a[0]||!a[1])return;let l=[a[0],a[1]];l=new t.Coordinate("GPS",{latitude:l[1],longitude:l[0]}).ComputeWorldCoordinate();const c=new e.Vector3(l.world.x,l.world.y,l.world.z),d=new e.Vector3(0,0,1),h=Math.PI;c.applyAxisAngle(d,h);let u=0;if(o){const e=M({x:c.x,z:c.z},o.vertices);e&&(u=-e.y)}const y=new e.Vector3(l.world.x,l.world.y+u,l.world.z);if(i){const t=new e.LineCurve3(i,y);n.add(t)}i=y}return n}function L(r,o,n){const i=[];for(let l=0;l<r.length;l++)if(0===l){const o=r[l];for(let r=0;r<o.length;r++){let n=o[r];n=new t.Coordinate("GPS",{latitude:n[1],longitude:n[0]}).ComputeWorldCoordinate(),i.push(new e.Vector3(n.world.x,n.world.y,n.world.z))}}const s=(new e.BufferGeometry).setFromPoints(i);s.rotateZ(Math.PI);const a=new e.Line(s,o);return a.position.set(0,n,0),a.material.transparent=!0,a}function b(e){const t=[];let o;for(let i=0;i<e.length;i++){const n=e[i];0===i?o=(0,r.GenShape)(n):t.push((0,r.GenShape)(n))}for(let r=0;r<t.length;r++)o.holes.push(t[r]);const n=(0,r.GenWaterGeometry)(o,{curveSegments:2,steps:1,depth:.01,bevelEnabled:!1});return n.rotateX(Math.PI/2),n.rotateZ(Math.PI),n.computeBoundingSphere(),{geometry:n}}function M(e,t){let r=1e5,o=!1;for(let n=0;n<t.length;n++){const i=Math.sqrt(Math.pow(e.x-t[n].x,2)+Math.pow(e.z-t[n].z,2));i<=r&&(r=i,o=t[n])}return o}function x(e,t="building"){let r=!1;return void 0!==e[t]?r=e[t]:e.tags&&void 0!==e.tags[t]&&(r=e.tags[t]),r}function j(t,r,o=65535){const n=new e.Line(t,new e.LineDashedMaterial({color:o}));return n.material.transparent=!0,n.material.dashSize=0,n.material.gapSize=r+10,n}exports.GeoLayer=m;
|
|
170
|
-
},{"three":"dKqR","../coordinate/Coordinate":"tKb1","../utils/ModelBuilder":"YQGE","three/examples/jsm/objects/Water":"LtOz","three/examples/jsm/lines/Line2":"hckB","three/examples/jsm/lines/LineMaterial.js":"zCQ6","three/examples/jsm/lines/LineGeometry.js":"VYfi","three/examples/jsm/utils/GeometryUtils.js":"ZSdE","../materials/CUBE_Material":"E9Yg","../animation/Animation":"PPrL","./Layer":"oe7K"}],"gBbo":[function(require,module,exports) {
|
|
171
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GeoJsonLayer=void 0;var e=require("./Geo");const o=e.GeoLayer;exports.GeoJsonLayer=o;
|
|
172
|
-
},{"./Geo":"mRBh"}],"hrlU":[function(require,module,exports) {
|
|
173
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BitmapLayer=void 0;var e=a(require("three")),t=o(require("deepmerge")),r=require("../coordinate/Coordinate");function o(e){return e&&e.__esModule?e:{default:e}}function n(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return n=function(){return e},e}function a(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=n();if(t&&t.has(e))return t.get(e);var r={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var i=o?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(r,a,i):r[a]=e[a]}return r.default=e,t&&t.set(e,r),r}const i={source:"https://b.tile.openstreetmap.org/",size:.05*window.CUBE_GLOBAL.MAP_SCALE,copyright:'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>'};class s{constructor(t){this.center=window.CUBE_GLOBAL.CENTER,this.layer=new e.Group,this.layer.name=t}TileMap(o={}){const n=(0,t.default)(i,o),a=256*n.size,s=new e.Group,p=new r.Coordinate("GPS",this.center).ComputeTileCoordinate(15),u=[],c=[[-2,2],[-1,2],[0,2],[1,2],[2,2],[-2,1],[-1,1],[0,1],[1,1],[2,1],[-2,0],[-1,0],[0,0],[1,0],[2,0],[-2,-1],[-1,-1],[0,-1],[1,-1],[2,-1],[-2,-2],[-1,-2],[0,-2],[1,-2],[2,-2]];for(let t=0;t<c.length;t++){const r=p.tile.x-c[t][0],o=p.tile.y-c[t][1],a=n.source+15+"/"+r+"/"+o+".png",i=(new e.TextureLoader).load(a);u.push(i)}for(let t=0;t<u.length;t++){const r=new e.PlaneBufferGeometry(a,a,1,1),o=new e.MeshBasicMaterial({map:u[t]});r.rotateX(-Math.PI/2);const n=new e.Mesh(r,o);n.position.set(-c[t][0]*a,0,-c[t][1]*a),s.add(n)}return s.position.set(4.1*p.tile.centerOffset.x,0,5.65*p.tile.centerOffset.y),this.layer.add(s),this.layer}}exports.BitmapLayer=s;
|
|
174
|
-
},{"three":"dKqR","deepmerge":"oANd","../coordinate/Coordinate":"tKb1"}],"fzuX":[function(require,module,exports) {
|
|
175
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ShaderEngine=void 0;class e{constructor(e){this.ins=e,this.allShaders=[]}Register(e,a,r,s){e.material&&"uniforms"===a&&this.allShaders.push({node:e.material.uniforms[r],range:s})}Update(){this.allShaders.forEach(e=>{e&&(e.node.value<e.range.max?e.node.value+=e.range.step:e.node.value=e.range.min)})}}exports.ShaderEngine=e;
|
|
176
|
-
},{}],"RQfI":[function(require,module,exports) {
|
|
177
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GPSRelativePosition=u,exports.MakeBBox=r;var t=require("../../coordinate/Coordinate"),e=o(require("geolib"));function n(){if("function"!=typeof WeakMap)return null;var t=new WeakMap;return n=function(){return t},t}function o(t){if(t&&t.__esModule)return t;if(null===t||"object"!=typeof t&&"function"!=typeof t)return{default:t};var e=n();if(e&&e.has(t))return e.get(t);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in t)if(Object.prototype.hasOwnProperty.call(t,u)){var r=i?Object.getOwnPropertyDescriptor(t,u):null;r&&(r.get||r.set)?Object.defineProperty(o,u,r):o[u]=t[u]}return o.default=t,e&&e.set(t,o),o}const i=5e4;function u(e,n,o=i){const u=a(e.latitude,e.longitude),r=a(n.latitude,n.longitude);return new t.WorldCoordinate((r.x-u.x)/o,(r.y-u.y)/o)}function r(t,n){const o={};return o.east=e.computeDestinationPoint({latitude:t.latitude,longitude:t.longitude},n,90),o.west=e.computeDestinationPoint({latitude:t.latitude,longitude:t.longitude},n,270),o.north=e.computeDestinationPoint({latitude:t.latitude,longitude:t.longitude},n,0),o.south=e.computeDestinationPoint({latitude:t.latitude,longitude:t.longitude},n,180),{south:o.south.latitude,north:o.north.latitude,west:o.west.longitude,east:o.east.longitude}}function a(t,e){const n={};n.x=e*Math.PI/180*6378137;const o=t*Math.PI/180;return n.y=3189068.5*Math.log((1+Math.sin(o))/(1-Math.sin(o))),n}
|
|
178
|
-
},{"../../coordinate/Coordinate":"tKb1","geolib":"BnnT"}],"yh9p":[function(require,module,exports) {
|
|
179
|
-
"use strict";exports.byteLength=u,exports.toByteArray=i,exports.fromByteArray=d;for(var r=[],t=[],e="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=n.length;o<a;++o)r[o]=n[o],t[n.charCodeAt(o)]=o;function h(r){var t=r.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=r.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}function u(r){var t=h(r),e=t[0],n=t[1];return 3*(e+n)/4-n}function c(r,t,e){return 3*(t+e)/4-e}function i(r){var n,o,a=h(r),u=a[0],i=a[1],f=new e(c(r,u,i)),A=0,d=i>0?u-4:u;for(o=0;o<d;o+=4)n=t[r.charCodeAt(o)]<<18|t[r.charCodeAt(o+1)]<<12|t[r.charCodeAt(o+2)]<<6|t[r.charCodeAt(o+3)],f[A++]=n>>16&255,f[A++]=n>>8&255,f[A++]=255&n;return 2===i&&(n=t[r.charCodeAt(o)]<<2|t[r.charCodeAt(o+1)]>>4,f[A++]=255&n),1===i&&(n=t[r.charCodeAt(o)]<<10|t[r.charCodeAt(o+1)]<<4|t[r.charCodeAt(o+2)]>>2,f[A++]=n>>8&255,f[A++]=255&n),f}function f(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function A(r,t,e){for(var n,o=[],a=t;a<e;a+=3)n=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(255&r[a+2]),o.push(f(n));return o.join("")}function d(t){for(var e,n=t.length,o=n%3,a=[],h=0,u=n-o;h<u;h+=16383)a.push(A(t,h,h+16383>u?u:h+16383));return 1===o?(e=t[n-1],a.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],a.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),a.join("")}t["-".charCodeAt(0)]=62,t["_".charCodeAt(0)]=63;
|
|
180
|
-
},{}],"JgNJ":[function(require,module,exports) {
|
|
181
|
-
exports.read=function(a,o,t,r,h){var M,p,w=8*h-r-1,f=(1<<w)-1,e=f>>1,i=-7,N=t?h-1:0,n=t?-1:1,s=a[o+N];for(N+=n,M=s&(1<<-i)-1,s>>=-i,i+=w;i>0;M=256*M+a[o+N],N+=n,i-=8);for(p=M&(1<<-i)-1,M>>=-i,i+=r;i>0;p=256*p+a[o+N],N+=n,i-=8);if(0===M)M=1-e;else{if(M===f)return p?NaN:1/0*(s?-1:1);p+=Math.pow(2,r),M-=e}return(s?-1:1)*p*Math.pow(2,M-r)},exports.write=function(a,o,t,r,h,M){var p,w,f,e=8*M-h-1,i=(1<<e)-1,N=i>>1,n=23===h?Math.pow(2,-24)-Math.pow(2,-77):0,s=r?0:M-1,u=r?1:-1,l=o<0||0===o&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(w=isNaN(o)?1:0,p=i):(p=Math.floor(Math.log(o)/Math.LN2),o*(f=Math.pow(2,-p))<1&&(p--,f*=2),(o+=p+N>=1?n/f:n*Math.pow(2,1-N))*f>=2&&(p++,f/=2),p+N>=i?(w=0,p=i):p+N>=1?(w=(o*f-1)*Math.pow(2,h),p+=N):(w=o*Math.pow(2,N-1)*Math.pow(2,h),p=0));h>=8;a[t+s]=255&w,s+=u,w/=256,h-=8);for(p=p<<h|w,e+=h;e>0;a[t+s]=255&p,s+=u,p/=256,e-=8);a[t+s-u]|=128*l};
|
|
182
|
-
},{}],"REa7":[function(require,module,exports) {
|
|
183
|
-
var r={}.toString;module.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)};
|
|
184
|
-
},{}],"dskh":[function(require,module,exports) {
|
|
185
|
-
|
|
186
|
-
var global = arguments[3];
|
|
187
|
-
var t=arguments[3],r=require("base64-js"),e=require("ieee754"),n=require("isarray");function i(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(r){return!1}}function o(){return f.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,r){if(o()<r)throw new RangeError("Invalid typed array length");return f.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=f.prototype:(null===t&&(t=new f(r)),t.length=r),t}function f(t,r,e){if(!(f.TYPED_ARRAY_SUPPORT||this instanceof f))return new f(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return c(this,t)}return s(this,t,r,e)}function s(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?g(t,r,e,n):"string"==typeof r?l(t,r,e):y(t,r)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function a(t,r,e,n){return h(r),r<=0?u(t,r):void 0!==e?"string"==typeof n?u(t,r).fill(e,n):u(t,r).fill(e):u(t,r)}function c(t,r){if(h(r),t=u(t,r<0?0:0|w(r)),!f.TYPED_ARRAY_SUPPORT)for(var e=0;e<r;++e)t[e]=0;return t}function l(t,r,e){if("string"==typeof e&&""!==e||(e="utf8"),!f.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|v(r,e),i=(t=u(t,n)).write(r,e);return i!==n&&(t=t.slice(0,i)),t}function p(t,r){var e=r.length<0?0:0|w(r.length);t=u(t,e);for(var n=0;n<e;n+=1)t[n]=255&r[n];return t}function g(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");return r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n),f.TYPED_ARRAY_SUPPORT?(t=r).__proto__=f.prototype:t=p(t,r),t}function y(t,r){if(f.isBuffer(r)){var e=0|w(r.length);return 0===(t=u(t,e)).length?t:(r.copy(t,0,0,e),t)}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||W(r.length)?u(t,0):p(t,r);if("Buffer"===r.type&&n(r.data))return p(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function w(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function d(t){return+t!=t&&(t=0),f.alloc(+t)}function v(t,r){if(f.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return K(t).length;default:if(n)return $(t).length;r=(""+r).toLowerCase(),n=!0}}function E(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,r,e);case"utf8":case"utf-8":return Y(this,r,e);case"ascii":return L(this,r,e);case"latin1":case"binary":return D(this,r,e);case"base64":return S(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function R(t,r,e,n,i){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=i?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(i)return-1;e=t.length-1}else if(e<0){if(!i)return-1;e=0}if("string"==typeof r&&(r=f.from(r,n)),f.isBuffer(r))return 0===r.length?-1:_(t,r,e,n,i);if("number"==typeof r)return r&=255,f.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):_(t,[r],e,n,i);throw new TypeError("val must be string, number or Buffer")}function _(t,r,e,n,i){var o,u=1,f=t.length,s=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;u=2,f/=2,s/=2,e/=2}function h(t,r){return 1===u?t[r]:t.readUInt16BE(r*u)}if(i){var a=-1;for(o=e;o<f;o++)if(h(t,o)===h(r,-1===a?0:o-a)){if(-1===a&&(a=o),o-a+1===s)return a*u}else-1!==a&&(o-=o-a),a=-1}else for(e+s>f&&(e=f-s),o=e;o>=0;o--){for(var c=!0,l=0;l<s;l++)if(h(t,o+l)!==h(r,l)){c=!1;break}if(c)return o}return-1}function A(t,r,e,n){e=Number(e)||0;var i=t.length-e;n?(n=Number(n))>i&&(n=i):n=i;var o=r.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var u=0;u<n;++u){var f=parseInt(r.substr(2*u,2),16);if(isNaN(f))return u;t[e+u]=f}return u}function m(t,r,e,n){return Q($(r,t.length-e),t,e,n)}function P(t,r,e,n){return Q(G(r),t,e,n)}function T(t,r,e,n){return P(t,r,e,n)}function B(t,r,e,n){return Q(K(r),t,e,n)}function U(t,r,e,n){return Q(H(r,t.length-e),t,e,n)}function S(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function Y(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,u,f,s,h=t[i],a=null,c=h>239?4:h>223?3:h>191?2:1;if(i+c<=e)switch(c){case 1:h<128&&(a=h);break;case 2:128==(192&(o=t[i+1]))&&(s=(31&h)<<6|63&o)>127&&(a=s);break;case 3:o=t[i+1],u=t[i+2],128==(192&o)&&128==(192&u)&&(s=(15&h)<<12|(63&o)<<6|63&u)>2047&&(s<55296||s>57343)&&(a=s);break;case 4:o=t[i+1],u=t[i+2],f=t[i+3],128==(192&o)&&128==(192&u)&&128==(192&f)&&(s=(15&h)<<18|(63&o)<<12|(63&u)<<6|63&f)>65535&&s<1114112&&(a=s)}null===a?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=c}return O(n)}exports.Buffer=f,exports.SlowBuffer=d,exports.INSPECT_MAX_BYTES=50,f.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),exports.kMaxLength=o(),f.poolSize=8192,f._augment=function(t){return t.__proto__=f.prototype,t},f.from=function(t,r,e){return s(null,t,r,e)},f.TYPED_ARRAY_SUPPORT&&(f.prototype.__proto__=Uint8Array.prototype,f.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&f[Symbol.species]===f&&Object.defineProperty(f,Symbol.species,{value:null,configurable:!0})),f.alloc=function(t,r,e){return a(null,t,r,e)},f.allocUnsafe=function(t){return c(null,t)},f.allocUnsafeSlow=function(t){return c(null,t)},f.isBuffer=function(t){return!(null==t||!t._isBuffer)},f.compare=function(t,r){if(!f.isBuffer(t)||!f.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,i=0,o=Math.min(e,n);i<o;++i)if(t[i]!==r[i]){e=t[i],n=r[i];break}return e<n?-1:n<e?1:0},f.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},f.concat=function(t,r){if(!n(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return f.alloc(0);var e;if(void 0===r)for(r=0,e=0;e<t.length;++e)r+=t[e].length;var i=f.allocUnsafe(r),o=0;for(e=0;e<t.length;++e){var u=t[e];if(!f.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(i,o),o+=u.length}return i},f.byteLength=v,f.prototype._isBuffer=!0,f.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<t;r+=2)b(this,r,r+1);return this},f.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<t;r+=4)b(this,r,r+3),b(this,r+1,r+2);return this},f.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<t;r+=8)b(this,r,r+7),b(this,r+1,r+6),b(this,r+2,r+5),b(this,r+3,r+4);return this},f.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?Y(this,0,t):E.apply(this,arguments)},f.prototype.equals=function(t){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===f.compare(this,t)},f.prototype.inspect=function(){var t="",r=exports.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},f.prototype.compare=function(t,r,e,n,i){if(!f.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),r<0||e>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&r>=e)return 0;if(n>=i)return-1;if(r>=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),u=(e>>>=0)-(r>>>=0),s=Math.min(o,u),h=this.slice(n,i),a=t.slice(r,e),c=0;c<s;++c)if(h[c]!==a[c]){o=h[c],u=a[c];break}return o<u?-1:u<o?1:0},f.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},f.prototype.indexOf=function(t,r,e){return R(this,t,r,e,!0)},f.prototype.lastIndexOf=function(t,r,e){return R(this,t,r,e,!1)},f.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var i=this.length-r;if((void 0===e||e>i)&&(e=i),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return A(this,t,r,e);case"utf8":case"utf-8":return m(this,t,r,e);case"ascii":return P(this,t,r,e);case"latin1":case"binary":return T(this,t,r,e);case"base64":return B(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r,e);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function O(t){var r=t.length;if(r<=I)return String.fromCharCode.apply(String,t);for(var e="",n=0;n<r;)e+=String.fromCharCode.apply(String,t.slice(n,n+=I));return e}function L(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function D(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function x(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var i="",o=r;o<e;++o)i+=Z(t[o]);return i}function C(t,r,e){for(var n=t.slice(r,e),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function M(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function k(t,r,e,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>i||r<o)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function N(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function z(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function F(t,r,e,n,i,o){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function j(t,r,n,i,o){return o||F(t,r,n,4,3.4028234663852886e38,-3.4028234663852886e38),e.write(t,r,n,i,23,4),n+4}function q(t,r,n,i,o){return o||F(t,r,n,8,1.7976931348623157e308,-1.7976931348623157e308),e.write(t,r,n,i,52,8),n+8}f.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),f.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=f.prototype;else{var i=r-t;e=new f(i,void 0);for(var o=0;o<i;++o)e[o]=this[o+t]}return e},f.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n},f.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t+--r],i=1;r>0&&(i*=256);)n+=this[t+--r]*i;return n},f.prototype.readUInt8=function(t,r){return r||M(t,1,this.length),this[t]},f.prototype.readUInt16LE=function(t,r){return r||M(t,2,this.length),this[t]|this[t+1]<<8},f.prototype.readUInt16BE=function(t,r){return r||M(t,2,this.length),this[t]<<8|this[t+1]},f.prototype.readUInt32LE=function(t,r){return r||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},f.prototype.readUInt32BE=function(t,r){return r||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},f.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],i=1,o=0;++o<r&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*r)),n},f.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=r,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*r)),o},f.prototype.readInt8=function(t,r){return r||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},f.prototype.readInt16LE=function(t,r){r||M(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt16BE=function(t,r){r||M(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},f.prototype.readInt32LE=function(t,r){return r||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},f.prototype.readInt32BE=function(t,r){return r||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},f.prototype.readFloatLE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!0,23,4)},f.prototype.readFloatBE=function(t,r){return r||M(t,4,this.length),e.read(this,t,!1,23,4)},f.prototype.readDoubleLE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!0,52,8)},f.prototype.readDoubleBE=function(t,r){return r||M(t,8,this.length),e.read(this,t,!1,52,8)},f.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=1,o=0;for(this[r]=255&t;++o<e&&(i*=256);)this[r+o]=t/i&255;return r+e},f.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||k(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},f.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,255,0),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},f.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,65535,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):z(this,t,r,!0),r+4},f.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,4294967295,0),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=0,u=1,f=0;for(this[r]=255&t;++o<e&&(u*=256);)t<0&&0===f&&0!==this[r+o-1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var i=Math.pow(2,8*e-1);k(this,t,r,e,i-1,-i)}var o=e-1,u=1,f=0;for(this[r+o]=255&t;--o>=0&&(u*=256);)t<0&&0===f&&0!==this[r+o+1]&&(f=1),this[r+o]=(t/u>>0)-f&255;return r+e},f.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,1,127,-128),f.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},f.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):N(this,t,r,!0),r+2},f.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,2,32767,-32768),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):N(this,t,r,!1),r+2},f.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),f.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):z(this,t,r,!0),r+4},f.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||k(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),f.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},f.prototype.writeFloatLE=function(t,r,e){return j(this,t,r,!0,e)},f.prototype.writeFloatBE=function(t,r,e){return j(this,t,r,!1,e)},f.prototype.writeDoubleLE=function(t,r,e){return q(this,t,r,!0,e)},f.prototype.writeDoubleBE=function(t,r,e){return q(this,t,r,!1,e)},f.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!f.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},f.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!f.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var o;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(o=r;o<e;++o)this[o]=t;else{var u=f.isBuffer(t)?t:$(new f(t,n).toString()),s=u.length;for(o=0;o<e-r;++o)this[o+r]=u[o%s]}return this};var V=/[^+\/0-9A-Za-z-_]/g;function X(t){if((t=J(t).replace(V,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}function J(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Z(t){return t<16?"0"+t.toString(16):t.toString(16)}function $(t,r){var e;r=r||1/0;for(var n=t.length,i=null,o=[],u=0;u<n;++u){if((e=t.charCodeAt(u))>55295&&e<57344){if(!i){if(e>56319){(r-=3)>-1&&o.push(239,191,189);continue}if(u+1===n){(r-=3)>-1&&o.push(239,191,189);continue}i=e;continue}if(e<56320){(r-=3)>-1&&o.push(239,191,189),i=e;continue}e=65536+(i-55296<<10|e-56320)}else i&&(r-=3)>-1&&o.push(239,191,189);if(i=null,e<128){if((r-=1)<0)break;o.push(e)}else if(e<2048){if((r-=2)<0)break;o.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;o.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;o.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return o}function G(t){for(var r=[],e=0;e<t.length;++e)r.push(255&t.charCodeAt(e));return r}function H(t,r){for(var e,n,i,o=[],u=0;u<t.length&&!((r-=2)<0);++u)n=(e=t.charCodeAt(u))>>8,i=e%256,o.push(i),o.push(n);return o}function K(t){return r.toByteArray(X(t))}function Q(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}function W(t){return t!=t}
|
|
188
|
-
},{"base64-js":"yh9p","ieee754":"JgNJ","isarray":"REa7","buffer":"dskh"}],"Sdet":[function(require,module,exports) {
|
|
189
|
-
var global = arguments[3];
|
|
190
|
-
var Buffer = require("buffer").Buffer;
|
|
191
|
-
var t=arguments[3],r=require("buffer").Buffer;(function(){var r,n=200,e="Expected a function",u="__lodash_hash_undefined__",o=1,c=2,a=1/0,i=9007199254740991,f="[object Arguments]",s="[object Array]",l="[object Boolean]",p="[object Date]",h="[object Error]",v="[object Function]",y="[object GeneratorFunction]",_="[object Map]",b="[object Number]",g="[object Object]",d="[object RegExp]",j="[object Set]",w="[object String]",O="[object Symbol]",m="[object WeakMap]",A="[object ArrayBuffer]",x="[object DataView]",k="[object Float32Array]",S="[object Float64Array]",E="[object Int8Array]",$="[object Int16Array]",I="[object Int32Array]",L="[object Uint8Array]",P="[object Uint8ClampedArray]",F="[object Uint16Array]",B="[object Uint32Array]",z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,M=/^\./,U=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,C=/\\(\\)?/g,R=/\w*$/,D=/^\[object .+?Constructor\]$/,V=/^(?:0|[1-9]\d*)$/,q={};q[k]=q[S]=q[E]=q[$]=q[I]=q[L]=q[P]=q[F]=q[B]=!0,q[f]=q[s]=q[A]=q[l]=q[x]=q[p]=q[h]=q[v]=q[_]=q[b]=q[g]=q[d]=q[j]=q[w]=q[m]=!1;var N={};N[f]=N[s]=N[A]=N[x]=N[l]=N[p]=N[k]=N[S]=N[E]=N[$]=N[I]=N[_]=N[b]=N[g]=N[d]=N[j]=N[w]=N[O]=N[L]=N[P]=N[F]=N[B]=!0,N[h]=N[v]=N[m]=!1;var W="object"==typeof t&&t&&t.Object===Object&&t,G="object"==typeof self&&self&&self.Object===Object&&self,H=W||G||Function("return this")(),J="object"==typeof exports&&exports&&!exports.nodeType&&exports,K=J&&"object"==typeof module&&module&&!module.nodeType&&module,Q=K&&K.exports===J,X=Q&&W.process,Y=function(){try{return X&&X.binding("util")}catch(t){}}(),Z=Y&&Y.isTypedArray;function tt(t,r){return t.set(r[0],r[1]),t}function rt(t,r){return t.add(r),t}function nt(t,r){for(var n=-1,e=t?t.length:0;++n<e&&!1!==r(t[n],n,t););return t}function et(t,r,n,e){var u=-1,o=t?t.length:0;for(e&&o&&(n=t[++u]);++u<o;)n=r(n,t[u],u,t);return n}function ut(t,r){for(var n=-1,e=t?t.length:0;++n<e;)if(r(t[n],n,t))return!0;return!1}function ot(t){var r=!1;if(null!=t&&"function"!=typeof t.toString)try{r=!!(t+"")}catch(n){}return r}function ct(t){var r=-1,n=Array(t.size);return t.forEach(function(t,e){n[++r]=[e,t]}),n}function at(t,r){return function(n){return t(r(n))}}function it(t){var r=-1,n=Array(t.size);return t.forEach(function(t){n[++r]=t}),n}var ft,st=Array.prototype,lt=Function.prototype,pt=Object.prototype,ht=H["__core-js_shared__"],vt=(ft=/[^.]+$/.exec(ht&&ht.keys&&ht.keys.IE_PROTO||""))?"Symbol(src)_1."+ft:"",yt=lt.toString,_t=pt.hasOwnProperty,bt=yt.call(Object),gt=pt.toString,dt=RegExp("^"+yt.call(_t).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),jt=Q?H.Buffer:r,wt=H.Symbol,Ot=H.Uint8Array,mt=at(Object.getPrototypeOf,Object),At=Object.create,xt=pt.propertyIsEnumerable,kt=st.splice,St=Object.getOwnPropertySymbols,Et=jt?jt.isBuffer:r,$t=at(Object.keys,Object),It=Math.max,Lt=wr(H,"DataView"),Pt=wr(H,"Map"),Ft=wr(H,"Promise"),Bt=wr(H,"Set"),zt=wr(H,"WeakMap"),Tt=wr(Object,"create"),Mt=!xt.call({valueOf:1},"valueOf"),Ut=Lr(Lt),Ct=Lr(Pt),Rt=Lr(Ft),Dt=Lr(Bt),Vt=Lr(zt),qt=wt?wt.prototype:r,Nt=qt?qt.valueOf:r,Wt=qt?qt.toString:r;function Gt(){}function Ht(t){var r=-1,n=t?t.length:0;for(this.clear();++r<n;){var e=t[r];this.set(e[0],e[1])}}function Jt(t){var r=-1,n=t?t.length:0;for(this.clear();++r<n;){var e=t[r];this.set(e[0],e[1])}}function Kt(t){var r=-1,n=t?t.length:0;for(this.clear();++r<n;){var e=t[r];this.set(e[0],e[1])}}function Qt(t){var r=-1,n=t?t.length:0;for(this.__data__=new Kt;++r<n;)this.add(t[r])}function Xt(t){this.__data__=new Jt(t)}function Yt(t,r){var n=Tr(t)||zr(t)?function(t,r){for(var n=-1,e=Array(t);++n<t;)e[n]=r(n);return e}(t.length,String):[],e=n.length,u=!!e;for(var o in t)!r&&!_t.call(t,o)||u&&("length"==o||Ar(o,e))||n.push(o);return n}function Zt(t,n,e){(e===r||Br(t[n],e))&&("number"!=typeof n||e!==r||n in t)||(t[n]=e)}function tr(t,n,e){var u=t[n];_t.call(t,n)&&Br(u,e)&&(e!==r||n in t)||(t[n]=e)}function rr(t,r){for(var n=t.length;n--;)if(Br(t[n][0],r))return n;return-1}function nr(t,n,e,u,o,c,a){var i;if(u&&(i=c?u(t,o,c,a):u(t)),i!==r)return i;if(!Vr(t))return t;var s=Tr(t);if(s){if(i=function(t){var r=t.length,n=t.constructor(r);r&&"string"==typeof t[0]&&_t.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!n)return _r(t,i)}else{var h=mr(t),m=h==v||h==y;if(Cr(t))return function(t,r){if(r)return t.slice();var n=new t.constructor(t.length);return t.copy(n),n}(t,n);if(h==g||h==f||m&&!c){if(ot(t))return c?t:{};if(i=function(t){return"function"!=typeof t.constructor||kr(t)?{}:(r=mt(t),Vr(r)?At(r):{});var r}(m?{}:t),!n)return function(t,r){return br(t,Or(t),r)}(t,function(t,r){return t&&br(r,Yr(r),t)}(i,t))}else{if(!N[h])return c?t:{};i=function(t,r,n,e){var u=t.constructor;switch(r){case A:return yr(t);case l:case p:return new u(+t);case x:return function(t,r){var n=r?yr(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,e);case k:case S:case E:case $:case I:case L:case P:case F:case B:return function(t,r){var n=r?yr(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}(t,e);case _:return function(t,r,n){return et(r?n(ct(t),!0):ct(t),tt,new t.constructor)}(t,e,n);case b:case w:return new u(t);case d:return(a=new(c=t).constructor(c.source,R.exec(c))).lastIndex=c.lastIndex,a;case j:return function(t,r,n){return et(r?n(it(t),!0):it(t),rt,new t.constructor)}(t,e,n);case O:return o=t,Nt?Object(Nt.call(o)):{}}var o;var c,a}(t,h,nr,n)}}a||(a=new Xt);var z=a.get(t);if(z)return z;if(a.set(t,i),!s)var T=e?function(t){return function(t,r,n){var e=r(t);return Tr(t)?e:function(t,r){for(var n=-1,e=r.length,u=t.length;++n<e;)t[u+n]=r[n];return t}(e,n(t))}(t,Yr,Or)}(t):Yr(t);return nt(T||t,function(r,o){T&&(r=t[o=r]),tr(i,o,nr(r,n,e,u,o,t,a))}),i}Ht.prototype.clear=function(){this.__data__=Tt?Tt(null):{}},Ht.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},Ht.prototype.get=function(t){var n=this.__data__;if(Tt){var e=n[t];return e===u?r:e}return _t.call(n,t)?n[t]:r},Ht.prototype.has=function(t){var n=this.__data__;return Tt?n[t]!==r:_t.call(n,t)},Ht.prototype.set=function(t,n){return this.__data__[t]=Tt&&n===r?u:n,this},Jt.prototype.clear=function(){this.__data__=[]},Jt.prototype.delete=function(t){var r=this.__data__,n=rr(r,t);return!(n<0||(n==r.length-1?r.pop():kt.call(r,n,1),0))},Jt.prototype.get=function(t){var n=this.__data__,e=rr(n,t);return e<0?r:n[e][1]},Jt.prototype.has=function(t){return rr(this.__data__,t)>-1},Jt.prototype.set=function(t,r){var n=this.__data__,e=rr(n,t);return e<0?n.push([t,r]):n[e][1]=r,this},Kt.prototype.clear=function(){this.__data__={hash:new Ht,map:new(Pt||Jt),string:new Ht}},Kt.prototype.delete=function(t){return jr(this,t).delete(t)},Kt.prototype.get=function(t){return jr(this,t).get(t)},Kt.prototype.has=function(t){return jr(this,t).has(t)},Kt.prototype.set=function(t,r){return jr(this,t).set(t,r),this},Qt.prototype.add=Qt.prototype.push=function(t){return this.__data__.set(t,u),this},Qt.prototype.has=function(t){return this.__data__.has(t)},Xt.prototype.clear=function(){this.__data__=new Jt},Xt.prototype.delete=function(t){return this.__data__.delete(t)},Xt.prototype.get=function(t){return this.__data__.get(t)},Xt.prototype.has=function(t){return this.__data__.has(t)},Xt.prototype.set=function(t,r){var e=this.__data__;if(e instanceof Jt){var u=e.__data__;if(!Pt||u.length<n-1)return u.push([t,r]),this;e=this.__data__=new Kt(u)}return e.set(t,r),this};var er,ur,or=(er=function(t,r){return t&&cr(t,r,Yr)},function(t,r){if(null==t)return t;if(!Mr(t))return er(t,r);for(var n=t.length,e=ur?n:-1,u=Object(t);(ur?e--:++e<n)&&!1!==r(u[e],e,u););return t}),cr=function(t){return function(r,n,e){for(var u=-1,o=Object(r),c=e(r),a=c.length;a--;){var i=c[t?a:++u];if(!1===n(o[i],i,o))break}return r}}();function ar(t,n){for(var e=0,u=(n=xr(n,t)?[n]:vr(n)).length;null!=t&&e<u;)t=t[Ir(n[e++])];return e&&e==u?t:r}function ir(t,r){return null!=t&&r in Object(t)}function fr(t,n,e,u,a){return t===n||(null==t||null==n||!Vr(t)&&!qr(n)?t!=t&&n!=n:function(t,n,e,u,a,i){var v=Tr(t),y=Tr(n),m=s,k=s;v||(m=(m=mr(t))==f?g:m);y||(k=(k=mr(n))==f?g:k);var S=m==g&&!ot(t),E=k==g&&!ot(n),$=m==k;if($&&!S)return i||(i=new Xt),v||Hr(t)?gr(t,n,e,u,a,i):function(t,r,n,e,u,a,i){switch(n){case x:if(t.byteLength!=r.byteLength||t.byteOffset!=r.byteOffset)return!1;t=t.buffer,r=r.buffer;case A:return!(t.byteLength!=r.byteLength||!e(new Ot(t),new Ot(r)));case l:case p:case b:return Br(+t,+r);case h:return t.name==r.name&&t.message==r.message;case d:case w:return t==r+"";case _:var f=ct;case j:var s=a&c;if(f||(f=it),t.size!=r.size&&!s)return!1;var v=i.get(t);if(v)return v==r;a|=o,i.set(t,r);var y=gr(f(t),f(r),e,u,a,i);return i.delete(t),y;case O:if(Nt)return Nt.call(t)==Nt.call(r)}return!1}(t,n,m,e,u,a,i);if(!(a&c)){var I=S&&_t.call(t,"__wrapped__"),L=E&&_t.call(n,"__wrapped__");if(I||L){var P=I?t.value():t,F=L?n.value():n;return i||(i=new Xt),e(P,F,u,a,i)}}if(!$)return!1;return i||(i=new Xt),function(t,n,e,u,o,a){var i=o&c,f=Yr(t),s=f.length,l=Yr(n).length;if(s!=l&&!i)return!1;for(var p=s;p--;){var h=f[p];if(!(i?h in n:_t.call(n,h)))return!1}var v=a.get(t);if(v&&a.get(n))return v==n;var y=!0;a.set(t,n),a.set(n,t);for(var _=i;++p<s;){h=f[p];var b=t[h],g=n[h];if(u)var d=i?u(g,b,h,n,t,a):u(b,g,h,t,n,a);if(!(d===r?b===g||e(b,g,u,o,a):d)){y=!1;break}_||(_="constructor"==h)}if(y&&!_){var j=t.constructor,w=n.constructor;j!=w&&"constructor"in t&&"constructor"in n&&!("function"==typeof j&&j instanceof j&&"function"==typeof w&&w instanceof w)&&(y=!1)}return a.delete(t),a.delete(n),y}(t,n,e,u,a,i)}(t,n,fr,e,u,a))}function sr(t){return!(!Vr(t)||(r=t,vt&&vt in r))&&(Rr(t)||ot(t)?dt:D).test(Lr(t));var r}function lr(t){return"function"==typeof t?t:null==t?rn:"object"==typeof t?Tr(t)?function(t,n){if(xr(t)&&Sr(n))return Er(Ir(t),n);return function(e){var u=Qr(e,t);return u===r&&u===n?Xr(e,t):fr(n,u,r,o|c)}}(t[0],t[1]):function(t){var n=function(t){var r=Yr(t),n=r.length;for(;n--;){var e=r[n],u=t[e];r[n]=[e,u,Sr(u)]}return r}(t);if(1==n.length&&n[0][2])return Er(n[0][0],n[0][1]);return function(e){return e===t||function(t,n,e,u){var a=e.length,i=a,f=!u;if(null==t)return!i;for(t=Object(t);a--;){var s=e[a];if(f&&s[2]?s[1]!==t[s[0]]:!(s[0]in t))return!1}for(;++a<i;){var l=(s=e[a])[0],p=t[l],h=s[1];if(f&&s[2]){if(p===r&&!(l in t))return!1}else{var v=new Xt;if(u)var y=u(p,h,l,t,n,v);if(!(y===r?fr(h,p,u,o|c,v):y))return!1}}return!0}(e,t,n)}}(t):en(t)}function pr(t){if(!Vr(t))return function(t){var r=[];if(null!=t)for(var n in Object(t))r.push(n);return r}(t);var r=kr(t),n=[];for(var e in t)("constructor"!=e||!r&&_t.call(t,e))&&n.push(e);return n}function hr(t,n,e,u,o){if(t!==n){if(!Tr(n)&&!Hr(n))var c=pr(n);nt(c||n,function(a,i){if(c&&(a=n[i=a]),Vr(a))o||(o=new Xt),function(t,n,e,u,o,c,a){var i=t[e],f=n[e],s=a.get(f);if(s)return void Zt(t,e,s);var l=c?c(i,f,e+"",t,n,a):r,p=l===r;p&&(l=f,Tr(f)||Hr(f)?Tr(i)?l=i:Ur(i)?l=_r(i):(p=!1,l=nr(f,!0)):Nr(f)||zr(f)?zr(i)?l=Jr(i):!Vr(i)||u&&Rr(i)?(p=!1,l=nr(f,!0)):l=i:p=!1);p&&(a.set(f,l),o(l,f,u,c,a),a.delete(f));Zt(t,e,l)}(t,n,i,e,hr,u,o);else{var f=u?u(t[i],a,i+"",t,n,o):r;f===r&&(f=a),Zt(t,i,f)}})}}function vr(t){return Tr(t)?t:$r(t)}function yr(t){var r=new t.constructor(t.byteLength);return new Ot(r).set(new Ot(t)),r}function _r(t,r){var n=-1,e=t.length;for(r||(r=Array(e));++n<e;)r[n]=t[n];return r}function br(t,n,e,u){e||(e={});for(var o=-1,c=n.length;++o<c;){var a=n[o],i=u?u(e[a],t[a],a,e,t):r;tr(e,a,i===r?t[a]:i)}return e}function gr(t,n,e,u,a,i){var f=a&c,s=t.length,l=n.length;if(s!=l&&!(f&&l>s))return!1;var p=i.get(t);if(p&&i.get(n))return p==n;var h=-1,v=!0,y=a&o?new Qt:r;for(i.set(t,n),i.set(n,t);++h<s;){var _=t[h],b=n[h];if(u)var g=f?u(b,_,h,n,t,i):u(_,b,h,t,n,i);if(g!==r){if(g)continue;v=!1;break}if(y){if(!ut(n,function(t,r){if(!y.has(r)&&(_===t||e(_,t,u,a,i)))return y.add(r)})){v=!1;break}}else if(_!==b&&!e(_,b,u,a,i)){v=!1;break}}return i.delete(t),i.delete(n),v}function dr(){var t=Gt.iteratee||nn;return t=t===nn?lr:t,arguments.length?t(arguments[0],arguments[1]):t}function jr(t,r){var n,e,u=t.__data__;return("string"==(e=typeof(n=r))||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==n:null===n)?u["string"==typeof r?"string":"hash"]:u.map}function wr(t,n){var e=function(t,n){return null==t?r:t[n]}(t,n);return sr(e)?e:r}var Or=St?at(St,Object):un,mr=function(t){return gt.call(t)};function Ar(t,r){return!!(r=null==r?i:r)&&("number"==typeof t||V.test(t))&&t>-1&&t%1==0&&t<r}function xr(t,r){if(Tr(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Wr(t))||(T.test(t)||!z.test(t)||null!=r&&t in Object(r))}function kr(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||pt)}function Sr(t){return t==t&&!Vr(t)}function Er(t,n){return function(e){return null!=e&&(e[t]===n&&(n!==r||t in Object(e)))}}(Lt&&mr(new Lt(new ArrayBuffer(1)))!=x||Pt&&mr(new Pt)!=_||Ft&&"[object Promise]"!=mr(Ft.resolve())||Bt&&mr(new Bt)!=j||zt&&mr(new zt)!=m)&&(mr=function(t){var n=gt.call(t),e=n==g?t.constructor:r,u=e?Lr(e):r;if(u)switch(u){case Ut:return x;case Ct:return _;case Rt:return"[object Promise]";case Dt:return j;case Vt:return m}return n});var $r=Fr(function(t){t=Kr(t);var r=[];return M.test(t)&&r.push(""),t.replace(U,function(t,n,e,u){r.push(e?u.replace(C,"$1"):n||t)}),r});function Ir(t){if("string"==typeof t||Wr(t))return t;var r=t+"";return"0"==r&&1/t==-a?"-0":r}function Lr(t){if(null!=t){try{return yt.call(t)}catch(r){}try{return t+""}catch(r){}}return""}function Pr(t,r){return(Tr(t)?nt:or)(t,dr(r,3))}function Fr(t,r){if("function"!=typeof t||r&&"function"!=typeof r)throw new TypeError(e);var n=function(){var e=arguments,u=r?r.apply(this,e):e[0],o=n.cache;if(o.has(u))return o.get(u);var c=t.apply(this,e);return n.cache=o.set(u,c),c};return n.cache=new(Fr.Cache||Kt),n}function Br(t,r){return t===r||t!=t&&r!=r}function zr(t){return Ur(t)&&_t.call(t,"callee")&&(!xt.call(t,"callee")||gt.call(t)==f)}Fr.Cache=Kt;var Tr=Array.isArray;function Mr(t){return null!=t&&Dr(t.length)&&!Rr(t)}function Ur(t){return qr(t)&&Mr(t)}var Cr=Et||on;function Rr(t){var r=Vr(t)?gt.call(t):"";return r==v||r==y}function Dr(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=i}function Vr(t){var r=typeof t;return!!t&&("object"==r||"function"==r)}function qr(t){return!!t&&"object"==typeof t}function Nr(t){if(!qr(t)||gt.call(t)!=g||ot(t))return!1;var r=mt(t);if(null===r)return!0;var n=_t.call(r,"constructor")&&r.constructor;return"function"==typeof n&&n instanceof n&&yt.call(n)==bt}function Wr(t){return"symbol"==typeof t||qr(t)&>.call(t)==O}var Gr,Hr=Z?(Gr=Z,function(t){return Gr(t)}):function(t){return qr(t)&&Dr(t.length)&&!!q[gt.call(t)]};function Jr(t){return br(t,Zr(t))}function Kr(t){return null==t?"":function(t){if("string"==typeof t)return t;if(Wr(t))return Wt?Wt.call(t):"";var r=t+"";return"0"==r&&1/t==-a?"-0":r}(t)}function Qr(t,n,e){var u=null==t?r:ar(t,n);return u===r?e:u}function Xr(t,r){return null!=t&&function(t,r,n){for(var e,u=-1,o=(r=xr(r,t)?[r]:vr(r)).length;++u<o;){var c=Ir(r[u]);if(!(e=null!=t&&n(t,c)))break;t=t[c]}return e||!!(o=t?t.length:0)&&Dr(o)&&Ar(c,o)&&(Tr(t)||zr(t))}(t,r,ir)}function Yr(t){return Mr(t)?Yt(t):function(t){if(!kr(t))return $t(t);var r=[];for(var n in Object(t))_t.call(t,n)&&"constructor"!=n&&r.push(n);return r}(t)}function Zr(t){return Mr(t)?Yt(t,!0):pr(t)}var tn=function(t){return n=function(n,e){var u=-1,o=e.length,c=o>1?e[o-1]:r,a=o>2?e[2]:r;for(c=t.length>3&&"function"==typeof c?(o--,c):r,a&&function(t,r,n){if(!Vr(n))return!1;var e=typeof r;return!!("number"==e?Mr(n)&&Ar(r,n.length):"string"==e&&r in n)&&Br(n[r],t)}(e[0],e[1],a)&&(c=o<3?r:c,o=1),n=Object(n);++u<o;){var i=e[u];i&&t(n,i,u,c)}return n},e=It(e===r?n.length-1:e,0),function(){for(var t=arguments,r=-1,u=It(t.length-e,0),o=Array(u);++r<u;)o[r]=t[e+r];r=-1;for(var c=Array(e+1);++r<e;)c[r]=t[r];return c[e]=o,function(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}(n,this,c)};var n,e}(function(t,r,n){hr(t,r,n)});function rn(t){return t}function nn(t){return lr("function"==typeof t?t:nr(t,!0))}function en(t){return xr(t)?(n=Ir(t),function(t){return null==t?r:t[n]}):function(t){return function(r){return ar(r,t)}}(t);var n}function un(){return[]}function on(){return!1}Gt.compact=function(t){for(var r=-1,n=t?t.length:0,e=0,u=[];++r<n;){var o=t[r];o&&(u[e++]=o)}return u},Gt.iteratee=nn,Gt.keys=Yr,Gt.keysIn=Zr,Gt.memoize=Fr,Gt.merge=tn,Gt.property=en,Gt.toPlainObject=Jr,Gt.clone=function(t){return nr(t,!1,!0)},Gt.eq=Br,Gt.forEach=Pr,Gt.get=Qr,Gt.hasIn=Xr,Gt.identity=rn,Gt.isArguments=zr,Gt.isArray=Tr,Gt.isArrayLike=Mr,Gt.isArrayLikeObject=Ur,Gt.isBuffer=Cr,Gt.isEmpty=function(t){if(Mr(t)&&(Tr(t)||"string"==typeof t||"function"==typeof t.splice||Cr(t)||zr(t)))return!t.length;var r=mr(t);if(r==_||r==j)return!t.size;if(Mt||kr(t))return!$t(t).length;for(var n in t)if(_t.call(t,n))return!1;return!0},Gt.isFunction=Rr,Gt.isLength=Dr,Gt.isObject=Vr,Gt.isObjectLike=qr,Gt.isPlainObject=Nr,Gt.isSymbol=Wr,Gt.isTypedArray=Hr,Gt.stubArray=un,Gt.stubFalse=on,Gt.toString=Kr,Gt.each=Pr,Gt.VERSION="4.15.0",K&&((K.exports=Gt)._=Gt,J._=Gt)}).call(this);
|
|
192
|
-
},{"buffer":"dskh"}],"JpVt":[function(require,module,exports) {
|
|
193
|
-
module.exports.RADIUS=6378137,module.exports.FLATTENING=1/298.257223563,module.exports.POLAR_RADIUS=6356752.3142;
|
|
194
|
-
},{}],"eBm2":[function(require,module,exports) {
|
|
195
|
-
var e=require("wgs84");function t(e){var n,o=0;switch(e.type){case"Polygon":return r(e.coordinates);case"MultiPolygon":for(n=0;n<e.coordinates.length;n++)o+=r(e.coordinates[n]);return o;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(n=0;n<e.geometries.length;n++)o+=t(e.geometries[n]);return o}}function r(e){var t=0;if(e&&e.length>0){t+=Math.abs(n(e[0]));for(var r=1;r<e.length;r++)t-=Math.abs(n(e[r]))}return t}function n(t){var r,n,i,a,s,u,c=0,g=t.length;if(g>2){for(u=0;u<g;u++)u===g-2?(i=g-2,a=g-1,s=0):u===g-1?(i=g-1,a=0,s=1):(i=u,a=u+1,s=u+2),r=t[i],n=t[a],c+=(o(t[s][0])-o(r[0]))*Math.sin(o(n[1]));c=c*e.RADIUS*e.RADIUS/2}return c}function o(e){return e*Math.PI/180}module.exports.geometry=t,module.exports.ring=n;
|
|
196
|
-
},{"wgs84":"JpVt"}],"yJvc":[function(require,module,exports) {
|
|
197
|
-
var e=require("@mapbox/geojson-area");function r(e,o){switch(e&&e.type||null){case"FeatureCollection":return e.features=e.features.map(t(r,o)),e;case"GeometryCollection":return e.geometries=e.geometries.map(t(r,o)),e;case"Feature":return e.geometry=r(e.geometry,o),e;case"Polygon":case"MultiPolygon":return n(e,o);default:return e}}function t(e,r){return function(t){return e(t,r)}}function n(e,r){return"Polygon"===e.type?e.coordinates=o(e.coordinates,r):"MultiPolygon"===e.type&&(e.coordinates=e.coordinates.map(t(o,r))),e}function o(e,r){r=!!r,e[0]=u(e[0],r);for(var t=1;t<e.length;t++)e[t]=u(e[t],!r);return e}function u(e,r){return a(e)===r?e:e.reverse()}function a(r){return e.ring(r)>=0}module.exports=r;
|
|
198
|
-
},{"@mapbox/geojson-area":"eBm2"}],"GNBi":[function(require,module,exports) {
|
|
199
|
-
module.exports=[{key:"building",polygon:"all"},{key:"highway",polygon:"whitelist",values:["services","rest_area","escape","elevator"]},{key:"natural",polygon:"blacklist",values:["coastline","cliff","ridge","arete","tree_row"]},{key:"landuse",polygon:"all"},{key:"waterway",polygon:"whitelist",values:["riverbank","dock","boatyard","dam"]},{key:"amenity",polygon:"all"},{key:"leisure",polygon:"all"},{key:"barrier",polygon:"whitelist",values:["city_wall","ditch","hedge","retaining_wall","wall","spikes"]},{key:"railway",polygon:"whitelist",values:["station","turntable","roundhouse","platform"]},{key:"area",polygon:"all"},{key:"boundary",polygon:"all"},{key:"man_made",polygon:"blacklist",values:["cutline","embankment","pipeline"]},{key:"power",polygon:"whitelist",values:["plant","substation","generator","transformer"]},{key:"place",polygon:"all"},{key:"shop",polygon:"all"},{key:"aeroway",polygon:"blacklist",values:["taxiway"]},{key:"tourism",polygon:"all"},{key:"historic",polygon:"all"},{key:"public_transport",polygon:"all"},{key:"office",polygon:"all"},{key:"building:part",polygon:"all"},{key:"military",polygon:"all"},{key:"ruins",polygon:"all"},{key:"area:highway",polygon:"all"},{key:"craft",polygon:"all"},{key:"golf",polygon:"all"},{key:"indoor",polygon:"all"}];
|
|
200
|
-
},{}],"HxNc":[function(require,module,exports) {
|
|
201
|
-
module.exports=require("./polygon-features.json");
|
|
202
|
-
},{"./polygon-features.json":"GNBi"}],"Ro4b":[function(require,module,exports) {
|
|
203
|
-
var e=require("./lodash.custom.js"),t=require("@mapbox/geojson-rewind"),n={};function r(t,n){return(t.version||n.version)&&t.version!==n.version?(+t.version||0)>(+n.version||0)?t:n:e.merge(t,n)}require("osm-polygon-features").forEach(function(e){if("all"===e.polygon)n[e.key]=!0;else{var t="whitelist"===e.polygon?"included_values":"excluded_values",r={};e.values.forEach(function(e){r[e]=!0}),n[e.key]={},n[e.key][t]=r}});var o={};function i(e){for(var t,n,r,o,i,a,s=function(e){return e[0]},u=function(e){return e[e.length-1]},l=function(e,t){return void 0!==e&&void 0!==t&&e.id===t.id},d=[];e.length;)for(t=e.pop().nodes.slice(),d.push(t);e.length&&!l(s(t),u(t));){for(n=s(t),r=u(t),o=0;o<e.length;o++){if(l(r,s(a=e[o].nodes))){i=t.push,a=a.slice(1);break}if(l(r,u(a))){i=t.push,a=a.slice(0,-1).reverse();break}if(l(n,u(a))){i=t.unshift,a=a.slice(0,-1);break}if(l(n,s(a))){i=t.unshift,a=a.slice(1).reverse();break}a=i=null}if(!a)break;e.splice(o,1),i.apply(t,a)}return d}(o=function(o,a,s){return a=e.merge({verbose:!1,flatProperties:!0,uninterestingTags:{source:!0,source_ref:!0,"source:ref":!0,history:!0,attribution:!0,created_by:!0,"tiger:county":!0,"tiger:tlid":!0,"tiger:upload_uuid":!0},polygonFeatures:n,deduplicator:r},a),"undefined"!=typeof XMLDocument&&o instanceof XMLDocument||"undefined"==typeof XMLDocument&&o.childNodes?function(t){var n,r,o=new Array,i=new Array,a=new Array;function s(e,t,n){e.hasAttribute(n)&&(t[n]=e.getAttribute(n))}function l(t,n){var r=e.clone(t);s(n,r,"lat"),s(n,r,"lon"),r.__is_center_placeholder=!0,o.push(r)}function d(t,n){var r=e.clone(t);function a(e,t,n){var i={type:"node",id:"_"+r.type+"/"+r.id+"bounds"+n,lat:e,lon:t};r.nodes.push(i.id),o.push(i)}r.nodes=[],a(n.getAttribute("minlat"),n.getAttribute("minlon"),1),a(n.getAttribute("maxlat"),n.getAttribute("minlon"),2),a(n.getAttribute("maxlat"),n.getAttribute("maxlon"),3),a(n.getAttribute("minlat"),n.getAttribute("maxlon"),4),r.nodes.push(r.nodes[0]),r.__is_bounds_placeholder=!0,i.push(r)}return e.each(t.getElementsByTagName("node"),function(t,n){var r={};e.each(t.getElementsByTagName("tag"),function(e){r[e.getAttribute("k")]=e.getAttribute("v")});var i={type:"node"};s(t,i,"id"),s(t,i,"lat"),s(t,i,"lon"),s(t,i,"version"),s(t,i,"timestamp"),s(t,i,"changeset"),s(t,i,"uid"),s(t,i,"user"),e.isEmpty(r)||(i.tags=r),o.push(i)}),e.each(t.getElementsByTagName("way"),function(t,a){var u={},c=[];e.each(t.getElementsByTagName("tag"),function(e){u[e.getAttribute("k")]=e.getAttribute("v")});var p=!1;e.each(t.getElementsByTagName("nd"),function(e,t){var n;(n=e.getAttribute("ref"))&&(c[t]=n),!p&&e.getAttribute("lat")&&(p=!0)});var m={type:"way"};s(t,m,"id"),s(t,m,"version"),s(t,m,"timestamp"),s(t,m,"changeset"),s(t,m,"uid"),s(t,m,"user"),c.length>0&&(m.nodes=c),e.isEmpty(u)||(m.tags=u),(n=t.getElementsByTagName("center")[0])&&l(m,n),p?function(t,n){e.isArray(t.nodes)||(t.nodes=[],e.each(n,function(e,n){t.nodes.push("_anonymous@"+e.getAttribute("lat")+"/"+e.getAttribute("lon"))})),e.each(n,function(e,n){var r,i,a,s;e.getAttribute("lat")&&(r=e.getAttribute("lat"),i=e.getAttribute("lon"),a=t.nodes[n],s={type:"node",id:a,lat:r,lon:i},o.push(s))})}(m,t.getElementsByTagName("nd")):(r=t.getElementsByTagName("bounds")[0])&&d(m,r),i.push(m)}),e.each(t.getElementsByTagName("relation"),function(t,u){var c={},p=[];e.each(t.getElementsByTagName("tag"),function(e){c[e.getAttribute("k")]=e.getAttribute("v")});var m=!1;e.each(t.getElementsByTagName("member"),function(e,t){p[t]={},s(e,p[t],"ref"),s(e,p[t],"role"),s(e,p[t],"type"),(!m&&"node"==p[t].type&&e.getAttribute("lat")||"way"==p[t].type&&e.getElementsByTagName("nd").length>0)&&(m=!0)});var f={type:"relation"};s(t,f,"id"),s(t,f,"version"),s(t,f,"timestamp"),s(t,f,"changeset"),s(t,f,"uid"),s(t,f,"user"),p.length>0&&(f.members=p),e.isEmpty(c)||(f.tags=c),(n=t.getElementsByTagName("center")[0])&&l(f,n),m?function(t,n){function r(t,n){if(!i.some(function(e){return"way"==e.type&&e.id==n})){var r={type:"way",id:n,nodes:[]};e.each(t,function(e){var t,n,i;e.getAttribute("lat")?(t=e.getAttribute("lat"),n=e.getAttribute("lon"),i={type:"node",id:"_anonymous@"+t+"/"+n,lat:t,lon:n},r.nodes.push(i.id),o.push(i)):r.nodes.push(void 0)}),i.push(r)}}e.each(n,function(e,n){var i,a,s,u;"node"==t.members[n].type?e.getAttribute("lat")&&(i=e.getAttribute("lat"),a=e.getAttribute("lon"),s=t.members[n].ref,u={type:"node",id:s,lat:i,lon:a},o.push(u)):"way"==t.members[n].type&&e.getElementsByTagName("nd").length>0&&(t.members[n].ref="_fullGeom"+t.members[n].ref,r(e.getElementsByTagName("nd"),t.members[n].ref))})}(f,t.getElementsByTagName("member")):(r=t.getElementsByTagName("bounds")[0])&&d(f,r),a.push(f)}),u(o,i,a)}(o):function(t){var n=new Array,r=new Array,o=new Array;function i(t){var r=e.clone(t);r.lat=t.center.lat,r.lon=t.center.lon,r.__is_center_placeholder=!0,n.push(r)}function a(t){var o=e.clone(t);function i(e,t,r){var i={type:"node",id:"_"+o.type+"/"+o.id+"bounds"+r,lat:e,lon:t};o.nodes.push(i.id),n.push(i)}o.nodes=[],i(o.bounds.minlat,o.bounds.minlon,1),i(o.bounds.maxlat,o.bounds.minlon,2),i(o.bounds.maxlat,o.bounds.maxlon,3),i(o.bounds.minlat,o.bounds.maxlon,4),o.nodes.push(o.nodes[0]),o.__is_bounds_placeholder=!0,r.push(o)}function s(t){e.isArray(t.nodes)||(t.nodes=t.geometry.map(function(e){return null!==e?"_anonymous@"+e.lat+"/"+e.lon:"_anonymous@unknown_location"})),t.geometry.forEach(function(e,r){var o,i,a,s;e&&(o=e.lat,i=e.lon,a=t.nodes[r],s={type:"node",id:a,lat:o,lon:i},n.push(s))})}function l(e){function t(e,t){if(!r.some(function(e){return"way"==e.type&&e.id==t})){var o={type:"way",id:t,nodes:[]};e.forEach(function(e){var t,r,i;e?(t=e.lat,r=e.lon,i={type:"node",id:"_anonymous@"+t+"/"+r,lat:t,lon:r},o.nodes.push(i.id),n.push(i)):o.nodes.push(void 0)}),r.push(o)}}e.members.forEach(function(e,r){var o,i,a,s;"node"==e.type?e.lat&&(o=e.lat,i=e.lon,a=e.ref,s={type:"node",id:a,lat:o,lon:i},n.push(s)):"way"==e.type&&e.geometry&&(e.ref="_fullGeom"+e.ref,t(e.geometry,e.ref))})}for(var d=0;d<t.elements.length;d++)switch(t.elements[d].type){case"node":var c=t.elements[d];n.push(c);break;case"way":var p=e.clone(t.elements[d]);p.nodes=e.clone(p.nodes),r.push(p),p.center&&i(p),p.geometry?s(p):p.bounds&&a(p);break;case"relation":var m=e.clone(t.elements[d]);m.members=e.clone(m.members),o.push(m);var f=m.members&&m.members.some(function(e){return"node"==e.type&&e.lat||"way"==e.type&&e.geometry&&e.geometry.length>0});m.center&&i(m),f?l(m):m.bounds&&a(m)}return u(n,r,o)}(o);function u(n,r,o){function u(e,t){if("object"!=typeof t&&(t={}),"function"==typeof a.uninterestingTags)return!a.uninterestingTags(e,t);for(var n in e)if(!0!==a.uninterestingTags[n]&&!0!==t[n]&&t[n]!==e[n])return!0;return!1}function d(e){var t={timestamp:e.timestamp,version:e.version,changeset:e.changeset,user:e.user,uid:e.uid};for(var n in t)void 0===t[n]&&delete t[n];return t}for(var c=new Object,p=new Object,m=0;m<n.length;m++){void 0!==c[(w=n[m]).id]&&(w=a.deduplicator(w,c[w.id])),c[w.id]=w,void 0!==w.tags&&u(w.tags)&&(p[w.id]=!0)}for(m=0;m<o.length;m++)if(e.isArray(o[m].members))for(var f=0;f<o[m].members.length;f++)"node"==o[m].members[f].type&&(p[o[m].members[f].ref]=!0);var y=new Object,g=new Object;for(m=0;m<r.length;m++){var b=r[m];if(y[b.id]&&(b=a.deduplicator(b,y[b.id])),y[b.id]=b,e.isArray(b.nodes))for(f=0;f<b.nodes.length;f++)"object"!=typeof b.nodes[f]&&(g[b.nodes[f]]=!0,b.nodes[f]=c[b.nodes[f]])}var v=new Array;for(var h in c){var w=c[h];g[h]&&!p[h]||v.push(w)}var _=new Array;for(m=0;m<o.length;m++){_[(T=o[m]).id]&&(T=a.deduplicator(T,_[T.id])),_[T.id]=T}var A,E={node:{},way:{},relation:{}};for(var h in _){var T=_[h];if(e.isArray(T.members))for(f=0;f<T.members.length;f++){var k=T.members[f].type,N=T.members[f].ref;"number"!=typeof N&&(N=N.replace("_fullGeom","")),E[k]?(void 0===E[k][N]&&(E[k][N]=[]),E[k][N].push({role:T.members[f].role,rel:T.id,reltags:T.tags})):a.verbose&&console.warn("Relation",T.type+"/"+T.id,"member",k+"/"+N,"ignored because it has an invalid type")}else a.verbose&&console.warn("Relation",T.type+"/"+T.id,"ignored because it has no members")}var B=[];for(m=0;m<v.length;m++)if(void 0!==v[m].lon&&void 0!==v[m].lat){var M={type:"Feature",id:v[m].type+"/"+v[m].id,properties:{type:v[m].type,id:v[m].id,tags:v[m].tags||{},relations:E.node[v[m].id]||[],meta:d(v[m])},geometry:{type:"Point",coordinates:[+v[m].lon,+v[m].lat]}};v[m].__is_center_placeholder&&(M.properties.geometry="center"),s?s(M):B.push(M)}else a.verbose&&console.warn("POI",v[m].type+"/"+v[m].id,"ignored because it lacks coordinates");var x=[],j=[];for(m=0;m<o.length;m++)if(_[o[m].id]===o[m]){if(void 0!==o[m].tags&&("route"==o[m].tags.type||"waterway"==o[m].tags.type)){if(!e.isArray(o[m].members)){a.verbose&&console.warn("Route",o[m].type+"/"+o[m].id,"ignored because it has no members");continue}if(o[m].members.forEach(function(e){y[e.ref]&&!u(y[e.ref].tags)&&(y[e.ref].is_skippablerelationmember=!0)}),!1===(M=R(o[m]))){a.verbose&&console.warn("Route relation",o[m].type+"/"+o[m].id,"ignored because it has invalid geometry");continue}function R(t){var n,r,o=!1;n=(n=t.members.filter(function(e){return"way"===e.type})).map(function(e){var n=y[e.ref];return void 0===n||void 0===n.nodes?(a.verbose&&console.warn("Route "+t.type+"/"+t.id,"tainted by a missing or incomplete way",e.type+"/"+e.ref),void(o=!0)):{id:e.ref,role:e.role,way:n,nodes:n.nodes.filter(function(n){return void 0!==n||(o=!0,a.verbose&&console.warn("Route",t.type+"/"+t.id,"tainted by a way",e.type+"/"+e.ref,"with a missing node"),!1)})}}),r=i(n=e.compact(n));var s;if(0==(s=e.compact(r.map(function(t){return e.compact(t.map(function(e){return[+e.lon,+e.lat]}))}))).length)return a.verbose&&console.warn("Route",t.type+"/"+t.id,"contains no coordinates"),!1;var u={type:"Feature",id:t.type+"/"+t.id,properties:{type:t.type,id:t.id,tags:t.tags||{},relations:E[t.type][t.id]||[],meta:d(t)},geometry:{type:1===s.length?"LineString":"MultiLineString",coordinates:1===s.length?s[0]:s}};return o&&(a.verbose&&console.warn("Route",t.type+"/"+t.id,"is tainted"),u.properties.tainted=!0),u}s?s(t(M)):j.push(M)}if(void 0!==o[m].tags&&("multipolygon"==o[m].tags.type||"boundary"==o[m].tags.type)){if(!e.isArray(o[m].members)){a.verbose&&console.warn("Multipolygon",o[m].type+"/"+o[m].id,"ignored because it has no members");continue}var F=0;for(f=0;f<o[m].members.length;f++)"outer"==o[m].members[f].role?F++:a.verbose&&"inner"!=o[m].members[f].role&&console.warn("Multipolygon",o[m].type+"/"+o[m].id,"member",o[m].members[f].type+"/"+o[m].members[f].ref,'ignored because it has an invalid role: "'+o[m].members[f].role+'"');if(o[m].members.forEach(function(e){y[e.ref]&&("outer"!==e.role||u(y[e.ref].tags,o[m].tags)||(y[e.ref].is_skippablerelationmember=!0),"inner"!==e.role||u(y[e.ref].tags)||(y[e.ref].is_skippablerelationmember=!0))}),0==F){a.verbose&&console.warn("Multipolygon relation",o[m].type+"/"+o[m].id,"ignored because it has no outer ways");continue}var L=!1;1!=F||u(o[m].tags,{type:!0})||(L=!0);M=null;if(L){var P=o[m].members.filter(function(e){return"outer"===e.role})[0];if(void 0===(P=y[P.ref])){a.verbose&&console.warn("Multipolygon relation",o[m].type+"/"+o[m].id,"ignored because outer way",P.type+"/"+P.ref,"is missing");continue}P.is_skippablerelationmember=!0,M=G(P,o[m])}else M=G(o[m],o[m]);if(!1===M){a.verbose&&console.warn("Multipolygon relation",o[m].type+"/"+o[m].id,"ignored because it has invalid geometry");continue}function G(t,n){var r,o,s,u,l=!1,c=L?"way":"relation",p="number"==typeof t.id?t.id:+t.id.replace("_fullGeom","");function m(e){var t,n=function(e,t){for(var n=0;n<t.length;n++)if(i(t[n],e))return!0;return!1},r=function(e){return e.map(function(e){return[+e.lat,+e.lon]})},i=function(e,t){for(var n=e[0],r=e[1],o=!1,i=0,a=t.length-1;i<t.length;a=i++){var s=t[i][0],u=t[i][1],l=t[a][0],d=t[a][1];u>r!=d>r&&n<(l-s)*(r-u)/(d-u)+s&&(o=!o)}return o};for(e=r(e),t=0;t<o.length;t++)if(n(r(o[t]),e))return t}r=(r=n.members.filter(function(e){return"way"===e.type})).map(function(e){var t=y[e.ref];return void 0===t||void 0===t.nodes?(a.verbose&&console.warn("Multipolygon",c+"/"+p,"tainted by a missing or incomplete way",e.type+"/"+e.ref),void(l=!0)):{id:e.ref,role:e.role||"outer",way:t,nodes:t.nodes.filter(function(t){return void 0!==t||(l=!0,a.verbose&&console.warn("Multipolygon",c+"/"+p,"tainted by a way",e.type+"/"+e.ref,"with a missing node"),!1)})}}),r=e.compact(r),o=i(r.filter(function(e){return"outer"===e.role})),s=i(r.filter(function(e){return"inner"===e.role})),u=o.map(function(e){return[e]});for(var f=0;f<s.length;f++){var g=m(s[f]);void 0!==g?u[g].push(s[f]):a.verbose&&console.warn("Multipolygon",c+"/"+p,"contains an inner ring with no containing outer")}var b=[];if(0==(b=e.compact(u.map(function(t){var n=e.compact(t.map(function(t){if(!(t.length<4))return e.compact(t.map(function(e){return[+e.lon,+e.lat]}));a.verbose&&console.warn("Multipolygon",c+"/"+p,"contains a ring with less than four nodes")}));if(0!=n.length)return n;a.verbose&&console.warn("Multipolygon",c+"/"+p,"contains an empty ring cluster")}))).length)return a.verbose&&console.warn("Multipolygon",c+"/"+p,"contains no coordinates"),!1;var v="MultiPolygon";1===b.length&&(v="Polygon",b=b[0]);var h={type:"Feature",id:t.type+"/"+p,properties:{type:t.type,id:p,tags:t.tags||{},relations:E[t.type][t.id]||[],meta:d(t)},geometry:{type:v,coordinates:b}};return l&&(a.verbose&&console.warn("Multipolygon",c+"/"+p,"is tainted"),h.properties.tainted=!0),h}s?s(t(M)):j.push(M)}}for(m=0;m<r.length;m++)if(y[r[m].id]===r[m])if(e.isArray(r[m].nodes)){if(!r[m].is_skippablerelationmember){"number"!=typeof r[m].id&&(r[m].id=+r[m].id.replace("_fullGeom","")),r[m].tainted=!1,r[m].hidden=!1;var O=new Array;for(f=0;f<r[m].nodes.length;f++)"object"==typeof r[m].nodes[f]?O.push([+r[m].nodes[f].lon,+r[m].nodes[f].lat]):(a.verbose&&console.warn("Way",r[m].type+"/"+r[m].id,"is tainted by an invalid node"),r[m].tainted=!0);if(O.length<=1)a.verbose&&console.warn("Way",r[m].type+"/"+r[m].id,"ignored because it contains too few nodes");else{var S="LineString";void 0!==r[m].nodes[0]&&void 0!==r[m].nodes[r[m].nodes.length-1]&&r[m].nodes[0].id===r[m].nodes[r[m].nodes.length-1].id&&(void 0!==r[m].tags&&l(r[m].tags)||r[m].__is_bounds_placeholder)&&(S="Polygon",O=[O]);M={type:"Feature",id:r[m].type+"/"+r[m].id,properties:{type:r[m].type,id:r[m].id,tags:r[m].tags||{},relations:E.way[r[m].id]||[],meta:d(r[m])},geometry:{type:S,coordinates:O}};r[m].tainted&&(a.verbose&&console.warn("Way",r[m].type+"/"+r[m].id,"is tainted"),M.properties.tainted=!0),r[m].__is_bounds_placeholder&&(M.properties.geometry="bounds"),s?s(t(M)):"LineString"==S?x.push(M):j.push(M)}}}else a.verbose&&console.warn("Way",r[m].type+"/"+r[m].id,"ignored because it has no nodes");return!!s||((A={type:"FeatureCollection",features:[]}).features=A.features.concat(j),A.features=A.features.concat(x),A.features=A.features.concat(B),a.flatProperties&&A.features.forEach(function(t){t.properties=e.merge(t.properties.meta,t.properties.tags,{id:t.properties.type+"/"+t.properties.id})}),A=t(A))}function l(e){var t=a.polygonFeatures;if("function"==typeof t)return t(e);if("no"===e.area)return!1;for(var n in e){var r=e[n],o=t[n];if(void 0!==o&&"no"!==r){if(!0===o)return!0;if(o.included_values&&!0===o.included_values[r])return!0;if(o.excluded_values&&!0!==o.excluded_values[r])return!0}}return!1}}).toGeojson=o,module.exports=o;
|
|
204
|
-
},{"./lodash.custom.js":"Sdet","@mapbox/geojson-rewind":"yJvc","osm-polygon-features":"HxNc"}],"bd6r":[function(require,module,exports) {
|
|
205
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.City=void 0;var t=require("../utils/geotools/GeoCalculator"),o=require("osmtogeojson");const a="http://overpass-api.de/api/interpreter",e="https://portal.opentopography.org/API/globaldem";class n{constructor(o=1e3,n={}){this.API_MAP=n.API_MAP?n.API_MAP:a,this.API_TERRAIN=n.API_TERRAIN?n.API_TERRAIN:e,this.center=window.CUBE_GLOBAL.CENTER,this.range=o,this.bbox=(0,t.MakeBBox)(this.center,this.range)}async Buildings(t="building",a={merge:!0,color:15066597},e){const n=i(this.API_MAP,"building",this.bbox),r=await(await fetch(n)).json(),s=(0,o.toGeojson)(r);return new CUBE.GeoLayer(t,s).Buildings(a,e||void 0)}async Roads(t="roads",a,e){const n=i(this.API_MAP,"highway",this.bbox),r=await(await fetch(n)).json(),s=(0,o.toGeojson)(r);return new CUBE.GeoLayer(t,s).Road(a||void 0,e||void 0)}}function i(t,o,a,e="json",n=30){let i="[out:".concat(e,"][timeout:").concat(n,"];");const r="(".concat(a.south,", ").concat(a.west,", ").concat(a.north,", ").concat(a.east,")");return"building"===o&&(i+='(way["building"]'.concat(r,'; relation["building"]["type"="multipolygon"]').concat(r,";);")),"highway"===o&&(i+='(way["highway"]'.concat(r,";);")),"water"===o&&(i+='(way["natural"="water"]'.concat(r,';relation["natural"="water"]').concat(r,';way["waterway"]').concat(r,";);")),i+="out;>;out qt;",t+"?data="+encodeURI(i)}exports.City=n;
|
|
206
|
-
},{"../utils/geotools/GeoCalculator":"RQfI","osmtogeojson":"Ro4b"}],"HRKn":[function(require,module,exports) {
|
|
207
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"Space",{enumerable:!0,get:function(){return e.Space}}),Object.defineProperty(exports,"Shapes",{enumerable:!0,get:function(){return r.Shapes}}),Object.defineProperty(exports,"Data",{enumerable:!0,get:function(){return t.Data}}),Object.defineProperty(exports,"Datasets",{enumerable:!0,get:function(){return n.Datasets}}),Object.defineProperty(exports,"Terrain",{enumerable:!0,get:function(){return i.Terrain}}),Object.defineProperty(exports,"Model",{enumerable:!0,get:function(){return o.Model}}),Object.defineProperty(exports,"Polygon",{enumerable:!0,get:function(){return a.Polygon}}),Object.defineProperty(exports,"Layer",{enumerable:!0,get:function(){return u.Layer}}),Object.defineProperty(exports,"GeoLayer",{enumerable:!0,get:function(){return p.GeoLayer}}),Object.defineProperty(exports,"GeoJsonLayer",{enumerable:!0,get:function(){return s.GeoJsonLayer}}),Object.defineProperty(exports,"BitmapLayer",{enumerable:!0,get:function(){return c.BitmapLayer}}),Object.defineProperty(exports,"Animation",{enumerable:!0,get:function(){return y.Animation}}),Object.defineProperty(exports,"AnimationEngine",{enumerable:!0,get:function(){return b.AnimationEngine}}),Object.defineProperty(exports,"ShaderEngine",{enumerable:!0,get:function(){return f.ShaderEngine}}),Object.defineProperty(exports,"Coordinate",{enumerable:!0,get:function(){return d.Coordinate}}),Object.defineProperty(exports,"City",{enumerable:!0,get:function(){return l.City}});var e=require("./Space"),r=require("./shapes/Shapes"),t=require("./data/Data"),n=require("./data/Datasets"),i=require("./layers/Terrain"),o=require("./model/model"),a=require("./layers/Polygon"),u=require("./layers/Layer"),p=require("./layers/Geo"),s=require("./layers/GeoJson"),c=require("./layers/Bitmap"),y=require("./animation/Animation"),b=require("./animation/AnimationEngine"),f=require("./shader/ShaderEngine"),d=require("./coordinate/Coordinate"),l=require("./high/City");
|
|
208
|
-
},{"./Space":"Bo3y","./shapes/Shapes":"MwKH","./data/Data":"JMpY","./data/Datasets":"gy7o","./layers/Terrain":"iowQ","./model/model":"N4Z9","./layers/Polygon":"qlYF","./layers/Layer":"oe7K","./layers/Geo":"mRBh","./layers/GeoJson":"gBbo","./layers/Bitmap":"hrlU","./animation/Animation":"PPrL","./animation/AnimationEngine":"rji6","./shader/ShaderEngine":"fzuX","./coordinate/Coordinate":"tKb1","./high/City":"bd6r"}],"Focm":[function(require,module,exports) {
|
|
209
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=r(require("./Main"));function t(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return t=function(){return e},e}function r(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=t();if(r&&r.has(e))return r.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var f=o?Object.getOwnPropertyDescriptor(e,u):null;f&&(f.get||f.set)?Object.defineProperty(n,u,f):n[u]=e[u]}return n.default=e,r&&r.set(e,n),n}var n=e;exports.default=n,window.CUBE=e;
|
|
210
|
-
},{"./Main":"HRKn"}],"SeQb":[function(require,module,exports) {
|
|
211
|
-
module.exports=function(t){return fetch(t).then(function(t){return WebAssembly.instantiateStreaming?WebAssembly.instantiateStreaming(t):t.arrayBuffer().then(function(t){return WebAssembly.instantiate(t)})}).then(function(t){return t.instance.exports})};
|
|
212
|
-
},{}],0:[function(require,module,exports) {
|
|
213
|
-
var b=require("TUK3");b.register("wasm",require("SeQb"));
|
|
214
|
-
},{}]},{},[0,"Focm"], null)
|
|
215
|
-
//# sourceMappingURL=/cubegl.js.map
|